]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/msw/_core.py
Don't use hidden items for size calc (patch 1698314)
[wxWidgets.git] / wxPython / src / msw / _core.py
CommitLineData
554f62e9 1# This file was created automatically by SWIG 1.3.29.
d55e5bfc
RD
2# Don't modify this file, modify the SWIG interface instead.
3
4import _core_
554f62e9
RD
5import new
6new_instancemethod = new.instancemethod
093d3ff1 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
554f62e9 8 if (name == "thisown"): return self.this.own(value)
093d3ff1 9 if (name == "this"):
554f62e9
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
093d3ff1
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
554f62e9 15 if (not static) or hasattr(self,name):
093d3ff1
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
554f62e9 24 if (name == "thisown"): return self.this.own()
093d3ff1
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
554f62e9
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
093d3ff1
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
554f62e9
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
093d3ff1
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d55e5bfc
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
56_core_._wxPySetDictionary(vars())
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
c24da6d6
RD
63
64#----------------------------------------------------------------------------
65
66def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81#----------------------------------------------------------------------------
82
d55e5bfc
RD
83NOT_FOUND = _core_.NOT_FOUND
84VSCROLL = _core_.VSCROLL
85HSCROLL = _core_.HSCROLL
86CAPTION = _core_.CAPTION
87DOUBLE_BORDER = _core_.DOUBLE_BORDER
88SUNKEN_BORDER = _core_.SUNKEN_BORDER
89RAISED_BORDER = _core_.RAISED_BORDER
90BORDER = _core_.BORDER
91SIMPLE_BORDER = _core_.SIMPLE_BORDER
92STATIC_BORDER = _core_.STATIC_BORDER
93TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94NO_BORDER = _core_.NO_BORDER
57133d5c 95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
d55e5bfc
RD
97TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98WANTS_CHARS = _core_.WANTS_CHARS
99POPUP_WINDOW = _core_.POPUP_WINDOW
100CENTER_FRAME = _core_.CENTER_FRAME
101CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
d55e5bfc
RD
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
092f0ed7 105WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
d55e5bfc
RD
106ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107RETAINED = _core_.RETAINED
108BACKINGSTORE = _core_.BACKINGSTORE
109COLOURED = _core_.COLOURED
110FIXED_LENGTH = _core_.FIXED_LENGTH
111LB_NEEDED_SB = _core_.LB_NEEDED_SB
112LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113LB_SORT = _core_.LB_SORT
114LB_SINGLE = _core_.LB_SINGLE
115LB_MULTIPLE = _core_.LB_MULTIPLE
116LB_EXTENDED = _core_.LB_EXTENDED
117LB_OWNERDRAW = _core_.LB_OWNERDRAW
118LB_HSCROLL = _core_.LB_HSCROLL
d55e5bfc
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
fef4c27a 127RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
d55e5bfc
RD
128RB_GROUP = _core_.RB_GROUP
129RB_SINGLE = _core_.RB_SINGLE
d55e5bfc
RD
130SB_HORIZONTAL = _core_.SB_HORIZONTAL
131SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 132RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
d55e5bfc 133ST_SIZEGRIP = _core_.ST_SIZEGRIP
d55e5bfc
RD
134FLOOD_SURFACE = _core_.FLOOD_SURFACE
135FLOOD_BORDER = _core_.FLOOD_BORDER
136ODDEVEN_RULE = _core_.ODDEVEN_RULE
137WINDING_RULE = _core_.WINDING_RULE
138TOOL_TOP = _core_.TOOL_TOP
139TOOL_BOTTOM = _core_.TOOL_BOTTOM
140TOOL_LEFT = _core_.TOOL_LEFT
141TOOL_RIGHT = _core_.TOOL_RIGHT
142OK = _core_.OK
143YES_NO = _core_.YES_NO
144CANCEL = _core_.CANCEL
145YES = _core_.YES
146NO = _core_.NO
147NO_DEFAULT = _core_.NO_DEFAULT
148YES_DEFAULT = _core_.YES_DEFAULT
149ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
150ICON_HAND = _core_.ICON_HAND
151ICON_QUESTION = _core_.ICON_QUESTION
152ICON_INFORMATION = _core_.ICON_INFORMATION
153ICON_STOP = _core_.ICON_STOP
154ICON_ASTERISK = _core_.ICON_ASTERISK
155ICON_MASK = _core_.ICON_MASK
156ICON_WARNING = _core_.ICON_WARNING
157ICON_ERROR = _core_.ICON_ERROR
158FORWARD = _core_.FORWARD
159BACKWARD = _core_.BACKWARD
160RESET = _core_.RESET
161HELP = _core_.HELP
162MORE = _core_.MORE
163SETUP = _core_.SETUP
164SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
165SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
166SIZE_AUTO = _core_.SIZE_AUTO
167SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
168SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
9d7dfdff 169SIZE_FORCE = _core_.SIZE_FORCE
d55e5bfc
RD
170PORTRAIT = _core_.PORTRAIT
171LANDSCAPE = _core_.LANDSCAPE
172PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
173PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
174PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
175PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
176ID_ANY = _core_.ID_ANY
177ID_SEPARATOR = _core_.ID_SEPARATOR
9d7dfdff 178ID_NONE = _core_.ID_NONE
d55e5bfc
RD
179ID_LOWEST = _core_.ID_LOWEST
180ID_OPEN = _core_.ID_OPEN
181ID_CLOSE = _core_.ID_CLOSE
182ID_NEW = _core_.ID_NEW
183ID_SAVE = _core_.ID_SAVE
184ID_SAVEAS = _core_.ID_SAVEAS
185ID_REVERT = _core_.ID_REVERT
186ID_EXIT = _core_.ID_EXIT
187ID_UNDO = _core_.ID_UNDO
188ID_REDO = _core_.ID_REDO
189ID_HELP = _core_.ID_HELP
190ID_PRINT = _core_.ID_PRINT
191ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
fc46b7f3 192ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
d55e5bfc
RD
193ID_PREVIEW = _core_.ID_PREVIEW
194ID_ABOUT = _core_.ID_ABOUT
195ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
196ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
197ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
198ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
1eeb270e
RD
199ID_HELP_INDEX = _core_.ID_HELP_INDEX
200ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
d55e5bfc
RD
201ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
202ID_PREFERENCES = _core_.ID_PREFERENCES
97ab0f6a 203ID_EDIT = _core_.ID_EDIT
d55e5bfc
RD
204ID_CUT = _core_.ID_CUT
205ID_COPY = _core_.ID_COPY
206ID_PASTE = _core_.ID_PASTE
207ID_CLEAR = _core_.ID_CLEAR
208ID_FIND = _core_.ID_FIND
209ID_DUPLICATE = _core_.ID_DUPLICATE
210ID_SELECTALL = _core_.ID_SELECTALL
211ID_DELETE = _core_.ID_DELETE
212ID_REPLACE = _core_.ID_REPLACE
213ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
214ID_PROPERTIES = _core_.ID_PROPERTIES
215ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
216ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
217ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
218ID_VIEW_LIST = _core_.ID_VIEW_LIST
219ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
220ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
221ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
222ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
97ab0f6a 223ID_FILE = _core_.ID_FILE
d55e5bfc
RD
224ID_FILE1 = _core_.ID_FILE1
225ID_FILE2 = _core_.ID_FILE2
226ID_FILE3 = _core_.ID_FILE3
227ID_FILE4 = _core_.ID_FILE4
228ID_FILE5 = _core_.ID_FILE5
229ID_FILE6 = _core_.ID_FILE6
230ID_FILE7 = _core_.ID_FILE7
231ID_FILE8 = _core_.ID_FILE8
232ID_FILE9 = _core_.ID_FILE9
233ID_OK = _core_.ID_OK
234ID_CANCEL = _core_.ID_CANCEL
235ID_APPLY = _core_.ID_APPLY
236ID_YES = _core_.ID_YES
237ID_NO = _core_.ID_NO
238ID_STATIC = _core_.ID_STATIC
239ID_FORWARD = _core_.ID_FORWARD
240ID_BACKWARD = _core_.ID_BACKWARD
241ID_DEFAULT = _core_.ID_DEFAULT
242ID_MORE = _core_.ID_MORE
243ID_SETUP = _core_.ID_SETUP
244ID_RESET = _core_.ID_RESET
245ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
246ID_YESTOALL = _core_.ID_YESTOALL
247ID_NOTOALL = _core_.ID_NOTOALL
248ID_ABORT = _core_.ID_ABORT
249ID_RETRY = _core_.ID_RETRY
250ID_IGNORE = _core_.ID_IGNORE
0f63ec68
RD
251ID_ADD = _core_.ID_ADD
252ID_REMOVE = _core_.ID_REMOVE
253ID_UP = _core_.ID_UP
254ID_DOWN = _core_.ID_DOWN
255ID_HOME = _core_.ID_HOME
256ID_REFRESH = _core_.ID_REFRESH
257ID_STOP = _core_.ID_STOP
258ID_INDEX = _core_.ID_INDEX
259ID_BOLD = _core_.ID_BOLD
260ID_ITALIC = _core_.ID_ITALIC
261ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
262ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
263ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
264ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
265ID_UNDERLINE = _core_.ID_UNDERLINE
266ID_INDENT = _core_.ID_INDENT
267ID_UNINDENT = _core_.ID_UNINDENT
268ID_ZOOM_100 = _core_.ID_ZOOM_100
269ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
270ID_ZOOM_IN = _core_.ID_ZOOM_IN
271ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
272ID_UNDELETE = _core_.ID_UNDELETE
273ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
d55e5bfc 274ID_HIGHEST = _core_.ID_HIGHEST
d55e5bfc
RD
275MENU_TEAROFF = _core_.MENU_TEAROFF
276MB_DOCKABLE = _core_.MB_DOCKABLE
277NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
278FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
279LI_HORIZONTAL = _core_.LI_HORIZONTAL
280LI_VERTICAL = _core_.LI_VERTICAL
281WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
282WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
283WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
284WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
285WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
286WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
287MM_TEXT = _core_.MM_TEXT
288MM_LOMETRIC = _core_.MM_LOMETRIC
289MM_HIMETRIC = _core_.MM_HIMETRIC
290MM_LOENGLISH = _core_.MM_LOENGLISH
291MM_HIENGLISH = _core_.MM_HIENGLISH
292MM_TWIPS = _core_.MM_TWIPS
293MM_ISOTROPIC = _core_.MM_ISOTROPIC
294MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
295MM_POINTS = _core_.MM_POINTS
296MM_METRIC = _core_.MM_METRIC
297CENTRE = _core_.CENTRE
298CENTER = _core_.CENTER
299HORIZONTAL = _core_.HORIZONTAL
300VERTICAL = _core_.VERTICAL
301BOTH = _core_.BOTH
302LEFT = _core_.LEFT
303RIGHT = _core_.RIGHT
304UP = _core_.UP
305DOWN = _core_.DOWN
306TOP = _core_.TOP
307BOTTOM = _core_.BOTTOM
308NORTH = _core_.NORTH
309SOUTH = _core_.SOUTH
310WEST = _core_.WEST
311EAST = _core_.EAST
312ALL = _core_.ALL
313ALIGN_NOT = _core_.ALIGN_NOT
314ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
315ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
316ALIGN_LEFT = _core_.ALIGN_LEFT
317ALIGN_TOP = _core_.ALIGN_TOP
318ALIGN_RIGHT = _core_.ALIGN_RIGHT
319ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
320ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
321ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
322ALIGN_CENTER = _core_.ALIGN_CENTER
323ALIGN_CENTRE = _core_.ALIGN_CENTRE
324ALIGN_MASK = _core_.ALIGN_MASK
325STRETCH_NOT = _core_.STRETCH_NOT
326SHRINK = _core_.SHRINK
327GROW = _core_.GROW
328EXPAND = _core_.EXPAND
329SHAPED = _core_.SHAPED
330FIXED_MINSIZE = _core_.FIXED_MINSIZE
331TILE = _core_.TILE
cbfc9df6 332ADJUST_MINSIZE = 0
d55e5bfc
RD
333BORDER_DEFAULT = _core_.BORDER_DEFAULT
334BORDER_NONE = _core_.BORDER_NONE
335BORDER_STATIC = _core_.BORDER_STATIC
336BORDER_SIMPLE = _core_.BORDER_SIMPLE
337BORDER_RAISED = _core_.BORDER_RAISED
338BORDER_SUNKEN = _core_.BORDER_SUNKEN
339BORDER_DOUBLE = _core_.BORDER_DOUBLE
340BORDER_MASK = _core_.BORDER_MASK
0f63ec68
RD
341BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
342BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
343BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
d55e5bfc
RD
344DEFAULT = _core_.DEFAULT
345DECORATIVE = _core_.DECORATIVE
346ROMAN = _core_.ROMAN
347SCRIPT = _core_.SCRIPT
348SWISS = _core_.SWISS
349MODERN = _core_.MODERN
350TELETYPE = _core_.TELETYPE
351VARIABLE = _core_.VARIABLE
352FIXED = _core_.FIXED
353NORMAL = _core_.NORMAL
354LIGHT = _core_.LIGHT
355BOLD = _core_.BOLD
356ITALIC = _core_.ITALIC
357SLANT = _core_.SLANT
358SOLID = _core_.SOLID
359DOT = _core_.DOT
360LONG_DASH = _core_.LONG_DASH
361SHORT_DASH = _core_.SHORT_DASH
362DOT_DASH = _core_.DOT_DASH
363USER_DASH = _core_.USER_DASH
364TRANSPARENT = _core_.TRANSPARENT
365STIPPLE = _core_.STIPPLE
d04418a7
RD
366STIPPLE_MASK = _core_.STIPPLE_MASK
367STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
d55e5bfc
RD
368BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
369CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
370FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
371CROSS_HATCH = _core_.CROSS_HATCH
372HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
373VERTICAL_HATCH = _core_.VERTICAL_HATCH
374JOIN_BEVEL = _core_.JOIN_BEVEL
375JOIN_MITER = _core_.JOIN_MITER
376JOIN_ROUND = _core_.JOIN_ROUND
377CAP_ROUND = _core_.CAP_ROUND
378CAP_PROJECTING = _core_.CAP_PROJECTING
379CAP_BUTT = _core_.CAP_BUTT
380CLEAR = _core_.CLEAR
381XOR = _core_.XOR
382INVERT = _core_.INVERT
383OR_REVERSE = _core_.OR_REVERSE
384AND_REVERSE = _core_.AND_REVERSE
385COPY = _core_.COPY
386AND = _core_.AND
387AND_INVERT = _core_.AND_INVERT
388NO_OP = _core_.NO_OP
389NOR = _core_.NOR
390EQUIV = _core_.EQUIV
391SRC_INVERT = _core_.SRC_INVERT
392OR_INVERT = _core_.OR_INVERT
393NAND = _core_.NAND
394OR = _core_.OR
395SET = _core_.SET
396WXK_BACK = _core_.WXK_BACK
397WXK_TAB = _core_.WXK_TAB
398WXK_RETURN = _core_.WXK_RETURN
399WXK_ESCAPE = _core_.WXK_ESCAPE
400WXK_SPACE = _core_.WXK_SPACE
401WXK_DELETE = _core_.WXK_DELETE
402WXK_START = _core_.WXK_START
403WXK_LBUTTON = _core_.WXK_LBUTTON
404WXK_RBUTTON = _core_.WXK_RBUTTON
405WXK_CANCEL = _core_.WXK_CANCEL
406WXK_MBUTTON = _core_.WXK_MBUTTON
407WXK_CLEAR = _core_.WXK_CLEAR
408WXK_SHIFT = _core_.WXK_SHIFT
409WXK_ALT = _core_.WXK_ALT
410WXK_CONTROL = _core_.WXK_CONTROL
411WXK_MENU = _core_.WXK_MENU
412WXK_PAUSE = _core_.WXK_PAUSE
413WXK_CAPITAL = _core_.WXK_CAPITAL
d55e5bfc
RD
414WXK_END = _core_.WXK_END
415WXK_HOME = _core_.WXK_HOME
416WXK_LEFT = _core_.WXK_LEFT
417WXK_UP = _core_.WXK_UP
418WXK_RIGHT = _core_.WXK_RIGHT
419WXK_DOWN = _core_.WXK_DOWN
420WXK_SELECT = _core_.WXK_SELECT
421WXK_PRINT = _core_.WXK_PRINT
422WXK_EXECUTE = _core_.WXK_EXECUTE
423WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
424WXK_INSERT = _core_.WXK_INSERT
425WXK_HELP = _core_.WXK_HELP
426WXK_NUMPAD0 = _core_.WXK_NUMPAD0
427WXK_NUMPAD1 = _core_.WXK_NUMPAD1
428WXK_NUMPAD2 = _core_.WXK_NUMPAD2
429WXK_NUMPAD3 = _core_.WXK_NUMPAD3
430WXK_NUMPAD4 = _core_.WXK_NUMPAD4
431WXK_NUMPAD5 = _core_.WXK_NUMPAD5
432WXK_NUMPAD6 = _core_.WXK_NUMPAD6
433WXK_NUMPAD7 = _core_.WXK_NUMPAD7
434WXK_NUMPAD8 = _core_.WXK_NUMPAD8
435WXK_NUMPAD9 = _core_.WXK_NUMPAD9
436WXK_MULTIPLY = _core_.WXK_MULTIPLY
437WXK_ADD = _core_.WXK_ADD
438WXK_SEPARATOR = _core_.WXK_SEPARATOR
439WXK_SUBTRACT = _core_.WXK_SUBTRACT
440WXK_DECIMAL = _core_.WXK_DECIMAL
441WXK_DIVIDE = _core_.WXK_DIVIDE
442WXK_F1 = _core_.WXK_F1
443WXK_F2 = _core_.WXK_F2
444WXK_F3 = _core_.WXK_F3
445WXK_F4 = _core_.WXK_F4
446WXK_F5 = _core_.WXK_F5
447WXK_F6 = _core_.WXK_F6
448WXK_F7 = _core_.WXK_F7
449WXK_F8 = _core_.WXK_F8
450WXK_F9 = _core_.WXK_F9
451WXK_F10 = _core_.WXK_F10
452WXK_F11 = _core_.WXK_F11
453WXK_F12 = _core_.WXK_F12
454WXK_F13 = _core_.WXK_F13
455WXK_F14 = _core_.WXK_F14
456WXK_F15 = _core_.WXK_F15
457WXK_F16 = _core_.WXK_F16
458WXK_F17 = _core_.WXK_F17
459WXK_F18 = _core_.WXK_F18
460WXK_F19 = _core_.WXK_F19
461WXK_F20 = _core_.WXK_F20
462WXK_F21 = _core_.WXK_F21
463WXK_F22 = _core_.WXK_F22
464WXK_F23 = _core_.WXK_F23
465WXK_F24 = _core_.WXK_F24
466WXK_NUMLOCK = _core_.WXK_NUMLOCK
467WXK_SCROLL = _core_.WXK_SCROLL
468WXK_PAGEUP = _core_.WXK_PAGEUP
469WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
470WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
471WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
472WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
473WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
474WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
475WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
476WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
477WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
478WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
479WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
480WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
481WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
d55e5bfc 482WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
d55e5bfc
RD
483WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
484WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
485WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
486WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
487WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
488WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
489WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
490WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
491WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
492WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
493WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
494WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
495WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
496WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
497WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
498WXK_COMMAND = _core_.WXK_COMMAND
499WXK_SPECIAL1 = _core_.WXK_SPECIAL1
500WXK_SPECIAL2 = _core_.WXK_SPECIAL2
501WXK_SPECIAL3 = _core_.WXK_SPECIAL3
502WXK_SPECIAL4 = _core_.WXK_SPECIAL4
503WXK_SPECIAL5 = _core_.WXK_SPECIAL5
504WXK_SPECIAL6 = _core_.WXK_SPECIAL6
505WXK_SPECIAL7 = _core_.WXK_SPECIAL7
506WXK_SPECIAL8 = _core_.WXK_SPECIAL8
507WXK_SPECIAL9 = _core_.WXK_SPECIAL9
508WXK_SPECIAL10 = _core_.WXK_SPECIAL10
509WXK_SPECIAL11 = _core_.WXK_SPECIAL11
510WXK_SPECIAL12 = _core_.WXK_SPECIAL12
511WXK_SPECIAL13 = _core_.WXK_SPECIAL13
512WXK_SPECIAL14 = _core_.WXK_SPECIAL14
513WXK_SPECIAL15 = _core_.WXK_SPECIAL15
514WXK_SPECIAL16 = _core_.WXK_SPECIAL16
515WXK_SPECIAL17 = _core_.WXK_SPECIAL17
516WXK_SPECIAL18 = _core_.WXK_SPECIAL18
517WXK_SPECIAL19 = _core_.WXK_SPECIAL19
518WXK_SPECIAL20 = _core_.WXK_SPECIAL20
cbfc9df6
RD
519WXK_PRIOR = WXK_PAGEUP
520WXK_NEXT = WXK_PAGEDOWN
521WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP
522WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN
523
d55e5bfc
RD
524PAPER_NONE = _core_.PAPER_NONE
525PAPER_LETTER = _core_.PAPER_LETTER
526PAPER_LEGAL = _core_.PAPER_LEGAL
527PAPER_A4 = _core_.PAPER_A4
528PAPER_CSHEET = _core_.PAPER_CSHEET
529PAPER_DSHEET = _core_.PAPER_DSHEET
530PAPER_ESHEET = _core_.PAPER_ESHEET
531PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
532PAPER_TABLOID = _core_.PAPER_TABLOID
533PAPER_LEDGER = _core_.PAPER_LEDGER
534PAPER_STATEMENT = _core_.PAPER_STATEMENT
535PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
536PAPER_A3 = _core_.PAPER_A3
537PAPER_A4SMALL = _core_.PAPER_A4SMALL
538PAPER_A5 = _core_.PAPER_A5
539PAPER_B4 = _core_.PAPER_B4
540PAPER_B5 = _core_.PAPER_B5
541PAPER_FOLIO = _core_.PAPER_FOLIO
542PAPER_QUARTO = _core_.PAPER_QUARTO
543PAPER_10X14 = _core_.PAPER_10X14
544PAPER_11X17 = _core_.PAPER_11X17
545PAPER_NOTE = _core_.PAPER_NOTE
546PAPER_ENV_9 = _core_.PAPER_ENV_9
547PAPER_ENV_10 = _core_.PAPER_ENV_10
548PAPER_ENV_11 = _core_.PAPER_ENV_11
549PAPER_ENV_12 = _core_.PAPER_ENV_12
550PAPER_ENV_14 = _core_.PAPER_ENV_14
551PAPER_ENV_DL = _core_.PAPER_ENV_DL
552PAPER_ENV_C5 = _core_.PAPER_ENV_C5
553PAPER_ENV_C3 = _core_.PAPER_ENV_C3
554PAPER_ENV_C4 = _core_.PAPER_ENV_C4
555PAPER_ENV_C6 = _core_.PAPER_ENV_C6
556PAPER_ENV_C65 = _core_.PAPER_ENV_C65
557PAPER_ENV_B4 = _core_.PAPER_ENV_B4
558PAPER_ENV_B5 = _core_.PAPER_ENV_B5
559PAPER_ENV_B6 = _core_.PAPER_ENV_B6
560PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
561PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
562PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
563PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
564PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
565PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
566PAPER_ISO_B4 = _core_.PAPER_ISO_B4
567PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
568PAPER_9X11 = _core_.PAPER_9X11
569PAPER_10X11 = _core_.PAPER_10X11
570PAPER_15X11 = _core_.PAPER_15X11
571PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
572PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
573PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
574PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
575PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
576PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
577PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
578PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
579PAPER_A_PLUS = _core_.PAPER_A_PLUS
580PAPER_B_PLUS = _core_.PAPER_B_PLUS
581PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
582PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
583PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
584PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
585PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
586PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
587PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
588PAPER_A2 = _core_.PAPER_A2
589PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
590PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
591PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
592PAPER_A6 = _core_.PAPER_A6
593PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
594PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
595PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
596PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
597PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
598PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
599PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
600PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
601PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
602PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
603PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
604PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
605PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
606PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
607PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
608PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
609PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
610PAPER_B6_JIS = _core_.PAPER_B6_JIS
611PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
612PAPER_12X11 = _core_.PAPER_12X11
613PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
614PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
615PAPER_P16K = _core_.PAPER_P16K
616PAPER_P32K = _core_.PAPER_P32K
617PAPER_P32KBIG = _core_.PAPER_P32KBIG
618PAPER_PENV_1 = _core_.PAPER_PENV_1
619PAPER_PENV_2 = _core_.PAPER_PENV_2
620PAPER_PENV_3 = _core_.PAPER_PENV_3
621PAPER_PENV_4 = _core_.PAPER_PENV_4
622PAPER_PENV_5 = _core_.PAPER_PENV_5
623PAPER_PENV_6 = _core_.PAPER_PENV_6
624PAPER_PENV_7 = _core_.PAPER_PENV_7
625PAPER_PENV_8 = _core_.PAPER_PENV_8
626PAPER_PENV_9 = _core_.PAPER_PENV_9
627PAPER_PENV_10 = _core_.PAPER_PENV_10
628PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
629PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
630PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
631PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
632PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
633PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
634PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
635PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
636PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
637PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
638PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
639PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
640PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
d55e5bfc
RD
641DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
642DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
643DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
644ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
645ITEM_NORMAL = _core_.ITEM_NORMAL
646ITEM_CHECK = _core_.ITEM_CHECK
647ITEM_RADIO = _core_.ITEM_RADIO
648ITEM_MAX = _core_.ITEM_MAX
649HT_NOWHERE = _core_.HT_NOWHERE
650HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
651HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
652HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
653HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
654HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
655HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
656HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
657HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
658HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
659HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
660HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
661HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
662HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
663HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
664HT_MAX = _core_.HT_MAX
665MOD_NONE = _core_.MOD_NONE
666MOD_ALT = _core_.MOD_ALT
667MOD_CONTROL = _core_.MOD_CONTROL
9d7dfdff 668MOD_ALTGR = _core_.MOD_ALTGR
d55e5bfc 669MOD_SHIFT = _core_.MOD_SHIFT
9d7dfdff 670MOD_META = _core_.MOD_META
d55e5bfc 671MOD_WIN = _core_.MOD_WIN
9d7dfdff
RD
672MOD_CMD = _core_.MOD_CMD
673MOD_ALL = _core_.MOD_ALL
d55e5bfc
RD
674UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
675UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
676UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
994453b8
RD
677Layout_Default = _core_.Layout_Default
678Layout_LeftToRight = _core_.Layout_LeftToRight
679Layout_RightToLeft = _core_.Layout_RightToLeft
d55e5bfc
RD
680#---------------------------------------------------------------------------
681
682class Object(object):
683 """
684 The base class for most wx objects, although in wxPython not
685 much functionality is needed nor exposed.
686 """
554f62e9
RD
687 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
688 def __init__(self): raise AttributeError, "No constructor defined"
689 __repr__ = _swig_repr
d55e5bfc
RD
690 def GetClassName(*args, **kwargs):
691 """
692 GetClassName(self) -> String
693
694 Returns the class name of the C++ class using wxRTTI.
695 """
696 return _core_.Object_GetClassName(*args, **kwargs)
697
698 def Destroy(*args, **kwargs):
699 """
700 Destroy(self)
701
702 Deletes the C++ object this Python object is a proxy for.
703 """
b39fe951
RD
704 args[0].this.own(False)
705 return _core_.Object_Destroy(*args, **kwargs)
d55e5bfc 706
8f514ab4
RD
707 def IsSameAs(*args, **kwargs):
708 """
709 IsSameAs(self, Object p) -> bool
710
711 For wx.Objects that use C++ reference counting internally, this method
712 can be used to determine if two objects are referencing the same data
713 object.
714 """
715 return _core_.Object_IsSameAs(*args, **kwargs)
716
33d6fd3b 717 ClassName = property(GetClassName,doc="See `GetClassName`")
2131d850 718_core_.Object_swigregister(Object)
d55e5bfc 719_wxPySetDictionary = _core_._wxPySetDictionary
d55e5bfc
RD
720cvar = _core_.cvar
721EmptyString = cvar.EmptyString
722
723#---------------------------------------------------------------------------
724
725BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
726BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
727BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
728BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
729BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
730BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
731BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
732BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
733BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
734BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
735BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
736BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
737BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
738BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
739BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
740BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
741BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
742BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
8f514ab4 743BITMAP_TYPE_TGA = _core_.BITMAP_TYPE_TGA
d55e5bfc
RD
744BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
745BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
746CURSOR_NONE = _core_.CURSOR_NONE
747CURSOR_ARROW = _core_.CURSOR_ARROW
748CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
749CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
750CURSOR_CHAR = _core_.CURSOR_CHAR
751CURSOR_CROSS = _core_.CURSOR_CROSS
752CURSOR_HAND = _core_.CURSOR_HAND
753CURSOR_IBEAM = _core_.CURSOR_IBEAM
754CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
755CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
756CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
757CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
758CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
759CURSOR_PENCIL = _core_.CURSOR_PENCIL
760CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
761CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
762CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
763CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
764CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
765CURSOR_SIZENS = _core_.CURSOR_SIZENS
766CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
767CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
768CURSOR_SIZING = _core_.CURSOR_SIZING
769CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
770CURSOR_WAIT = _core_.CURSOR_WAIT
771CURSOR_WATCH = _core_.CURSOR_WATCH
772CURSOR_BLANK = _core_.CURSOR_BLANK
773CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
774CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
775CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
776CURSOR_MAX = _core_.CURSOR_MAX
777#---------------------------------------------------------------------------
778
779class Size(object):
780 """
79fccf9d 781 wx.Size is a useful data structure used to represent the size of
554f62e9
RD
782 something. It simply contains integer width and height
783 properties. In most places in wxPython where a wx.Size is
093d3ff1 784 expected a (width, height) tuple can be used instead.
d55e5bfc 785 """
554f62e9
RD
786 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
787 __repr__ = _swig_repr
d55e5bfc
RD
788 width = property(_core_.Size_width_get, _core_.Size_width_set)
789 height = property(_core_.Size_height_get, _core_.Size_height_set)
790 x = width; y = height
554f62e9 791 def __init__(self, *args, **kwargs):
d55e5bfc
RD
792 """
793 __init__(self, int w=0, int h=0) -> Size
794
795 Creates a size object.
796 """
554f62e9
RD
797 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
798 __swig_destroy__ = _core_.delete_Size
799 __del__ = lambda self : None;
d55e5bfc
RD
800 def __eq__(*args, **kwargs):
801 """
e9d6f3a4 802 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
803
804 Test for equality of wx.Size objects.
805 """
806 return _core_.Size___eq__(*args, **kwargs)
807
808 def __ne__(*args, **kwargs):
809 """
e9d6f3a4 810 __ne__(self, PyObject other) -> bool
d55e5bfc 811
e9d6f3a4 812 Test for inequality of wx.Size objects.
d55e5bfc
RD
813 """
814 return _core_.Size___ne__(*args, **kwargs)
815
816 def __add__(*args, **kwargs):
817 """
818 __add__(self, Size sz) -> Size
819
820 Add sz's proprties to this and return the result.
821 """
822 return _core_.Size___add__(*args, **kwargs)
823
824 def __sub__(*args, **kwargs):
825 """
826 __sub__(self, Size sz) -> Size
827
828 Subtract sz's properties from this and return the result.
829 """
830 return _core_.Size___sub__(*args, **kwargs)
831
832 def IncTo(*args, **kwargs):
833 """
834 IncTo(self, Size sz)
835
836 Increments this object so that both of its dimensions are not less
837 than the corresponding dimensions of the size.
838 """
839 return _core_.Size_IncTo(*args, **kwargs)
840
841 def DecTo(*args, **kwargs):
842 """
843 DecTo(self, Size sz)
844
845 Decrements this object so that both of its dimensions are not greater
846 than the corresponding dimensions of the size.
847 """
848 return _core_.Size_DecTo(*args, **kwargs)
849
f5263701
RD
850 def IncBy(*args, **kwargs):
851 """IncBy(self, int dx, int dy)"""
852 return _core_.Size_IncBy(*args, **kwargs)
853
854 def DecBy(*args, **kwargs):
855 """DecBy(self, int dx, int dy)"""
856 return _core_.Size_DecBy(*args, **kwargs)
857
1eeb270e
RD
858 def Scale(*args, **kwargs):
859 """
860 Scale(self, float xscale, float yscale)
861
862 Scales the dimensions of this object by the given factors.
863 """
864 return _core_.Size_Scale(*args, **kwargs)
865
d55e5bfc
RD
866 def Set(*args, **kwargs):
867 """
868 Set(self, int w, int h)
869
870 Set both width and height.
871 """
872 return _core_.Size_Set(*args, **kwargs)
873
874 def SetWidth(*args, **kwargs):
875 """SetWidth(self, int w)"""
876 return _core_.Size_SetWidth(*args, **kwargs)
877
878 def SetHeight(*args, **kwargs):
879 """SetHeight(self, int h)"""
880 return _core_.Size_SetHeight(*args, **kwargs)
881
882 def GetWidth(*args, **kwargs):
883 """GetWidth(self) -> int"""
884 return _core_.Size_GetWidth(*args, **kwargs)
885
886 def GetHeight(*args, **kwargs):
887 """GetHeight(self) -> int"""
888 return _core_.Size_GetHeight(*args, **kwargs)
889
890 def IsFullySpecified(*args, **kwargs):
891 """
892 IsFullySpecified(self) -> bool
893
894 Returns True if both components of the size are non-default values.
895 """
896 return _core_.Size_IsFullySpecified(*args, **kwargs)
897
898 def SetDefaults(*args, **kwargs):
899 """
900 SetDefaults(self, Size size)
901
79fccf9d
RD
902 Combine this size with the other one replacing the default components
903 of this object (i.e. equal to -1) with those of the other.
d55e5bfc
RD
904 """
905 return _core_.Size_SetDefaults(*args, **kwargs)
906
907 def Get(*args, **kwargs):
908 """
909 Get() -> (width,height)
910
911 Returns the width and height properties as a tuple.
912 """
913 return _core_.Size_Get(*args, **kwargs)
914
79fccf9d 915 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
916 def __str__(self): return str(self.Get())
917 def __repr__(self): return 'wx.Size'+str(self.Get())
918 def __len__(self): return len(self.Get())
919 def __getitem__(self, index): return self.Get()[index]
920 def __setitem__(self, index, val):
921 if index == 0: self.width = val
922 elif index == 1: self.height = val
923 else: raise IndexError
924 def __nonzero__(self): return self.Get() != (0,0)
925 __safe_for_unpickling__ = True
926 def __reduce__(self): return (wx.Size, self.Get())
927
2131d850 928_core_.Size_swigregister(Size)
d55e5bfc
RD
929
930#---------------------------------------------------------------------------
931
932class RealPoint(object):
933 """
79fccf9d
RD
934 A data structure for representing a point or position with floating
935 point x and y properties. In wxPython most places that expect a
936 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc 937 """
554f62e9
RD
938 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
939 __repr__ = _swig_repr
d55e5bfc
RD
940 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
941 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
554f62e9 942 def __init__(self, *args, **kwargs):
d55e5bfc
RD
943 """
944 __init__(self, double x=0.0, double y=0.0) -> RealPoint
945
946 Create a wx.RealPoint object
947 """
554f62e9
RD
948 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
949 __swig_destroy__ = _core_.delete_RealPoint
950 __del__ = lambda self : None;
d55e5bfc
RD
951 def __eq__(*args, **kwargs):
952 """
e9d6f3a4 953 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
954
955 Test for equality of wx.RealPoint objects.
956 """
957 return _core_.RealPoint___eq__(*args, **kwargs)
958
959 def __ne__(*args, **kwargs):
960 """
e9d6f3a4 961 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
962
963 Test for inequality of wx.RealPoint objects.
964 """
965 return _core_.RealPoint___ne__(*args, **kwargs)
966
967 def __add__(*args, **kwargs):
968 """
969 __add__(self, RealPoint pt) -> RealPoint
970
971 Add pt's proprties to this and return the result.
972 """
973 return _core_.RealPoint___add__(*args, **kwargs)
974
975 def __sub__(*args, **kwargs):
976 """
977 __sub__(self, RealPoint pt) -> RealPoint
978
979 Subtract pt's proprties from this and return the result
980 """
981 return _core_.RealPoint___sub__(*args, **kwargs)
982
983 def Set(*args, **kwargs):
984 """
985 Set(self, double x, double y)
986
987 Set both the x and y properties
988 """
989 return _core_.RealPoint_Set(*args, **kwargs)
990
991 def Get(*args, **kwargs):
992 """
993 Get() -> (x,y)
994
995 Return the x and y properties as a tuple.
996 """
997 return _core_.RealPoint_Get(*args, **kwargs)
998
79fccf9d 999 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1000 def __str__(self): return str(self.Get())
1001 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1002 def __len__(self): return len(self.Get())
1003 def __getitem__(self, index): return self.Get()[index]
1004 def __setitem__(self, index, val):
1005 if index == 0: self.x = val
1006 elif index == 1: self.y = val
1007 else: raise IndexError
1008 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1009 __safe_for_unpickling__ = True
1010 def __reduce__(self): return (wx.RealPoint, self.Get())
1011
2131d850 1012_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
1013
1014#---------------------------------------------------------------------------
1015
1016class Point(object):
1017 """
79fccf9d
RD
1018 A data structure for representing a point or position with integer x
1019 and y properties. Most places in wxPython that expect a wx.Point can
1020 also accept a (x,y) tuple.
d55e5bfc 1021 """
554f62e9
RD
1022 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1023 __repr__ = _swig_repr
d55e5bfc
RD
1024 x = property(_core_.Point_x_get, _core_.Point_x_set)
1025 y = property(_core_.Point_y_get, _core_.Point_y_set)
554f62e9 1026 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1027 """
1028 __init__(self, int x=0, int y=0) -> Point
1029
1030 Create a wx.Point object
1031 """
554f62e9
RD
1032 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1033 __swig_destroy__ = _core_.delete_Point
1034 __del__ = lambda self : None;
d55e5bfc
RD
1035 def __eq__(*args, **kwargs):
1036 """
e9d6f3a4 1037 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1038
1039 Test for equality of wx.Point objects.
1040 """
1041 return _core_.Point___eq__(*args, **kwargs)
1042
1043 def __ne__(*args, **kwargs):
1044 """
e9d6f3a4 1045 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1046
1047 Test for inequality of wx.Point objects.
1048 """
1049 return _core_.Point___ne__(*args, **kwargs)
1050
1051 def __add__(*args, **kwargs):
1052 """
1053 __add__(self, Point pt) -> Point
1054
1055 Add pt's proprties to this and return the result.
1056 """
1057 return _core_.Point___add__(*args, **kwargs)
1058
1059 def __sub__(*args, **kwargs):
1060 """
1061 __sub__(self, Point pt) -> Point
1062
1063 Subtract pt's proprties from this and return the result
1064 """
1065 return _core_.Point___sub__(*args, **kwargs)
1066
1067 def __iadd__(*args, **kwargs):
1068 """
1069 __iadd__(self, Point pt) -> Point
1070
1071 Add pt to this object.
1072 """
1073 return _core_.Point___iadd__(*args, **kwargs)
1074
1075 def __isub__(*args, **kwargs):
1076 """
1077 __isub__(self, Point pt) -> Point
1078
1079 Subtract pt from this object.
1080 """
1081 return _core_.Point___isub__(*args, **kwargs)
1082
1083 def Set(*args, **kwargs):
1084 """
1085 Set(self, long x, long y)
1086
1087 Set both the x and y properties
1088 """
1089 return _core_.Point_Set(*args, **kwargs)
1090
1091 def Get(*args, **kwargs):
1092 """
1093 Get() -> (x,y)
1094
1095 Return the x and y properties as a tuple.
1096 """
1097 return _core_.Point_Get(*args, **kwargs)
1098
79fccf9d 1099 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1100 def __str__(self): return str(self.Get())
1101 def __repr__(self): return 'wx.Point'+str(self.Get())
1102 def __len__(self): return len(self.Get())
1103 def __getitem__(self, index): return self.Get()[index]
1104 def __setitem__(self, index, val):
1105 if index == 0: self.x = val
1106 elif index == 1: self.y = val
1107 else: raise IndexError
1108 def __nonzero__(self): return self.Get() != (0,0)
1109 __safe_for_unpickling__ = True
1110 def __reduce__(self): return (wx.Point, self.Get())
1111
2131d850 1112_core_.Point_swigregister(Point)
d55e5bfc
RD
1113
1114#---------------------------------------------------------------------------
1115
1116class Rect(object):
1117 """
79fccf9d
RD
1118 A class for representing and manipulating rectangles. It has x, y,
1119 width and height properties. In wxPython most palces that expect a
1120 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1121 """
554f62e9
RD
1122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1123 __repr__ = _swig_repr
1124 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1125 """
1126 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1127
1128 Create a new Rect object.
1129 """
554f62e9
RD
1130 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1131 __swig_destroy__ = _core_.delete_Rect
1132 __del__ = lambda self : None;
d55e5bfc
RD
1133 def GetX(*args, **kwargs):
1134 """GetX(self) -> int"""
1135 return _core_.Rect_GetX(*args, **kwargs)
1136
1137 def SetX(*args, **kwargs):
1138 """SetX(self, int x)"""
1139 return _core_.Rect_SetX(*args, **kwargs)
1140
1141 def GetY(*args, **kwargs):
1142 """GetY(self) -> int"""
1143 return _core_.Rect_GetY(*args, **kwargs)
1144
1145 def SetY(*args, **kwargs):
1146 """SetY(self, int y)"""
1147 return _core_.Rect_SetY(*args, **kwargs)
1148
1149 def GetWidth(*args, **kwargs):
1150 """GetWidth(self) -> int"""
1151 return _core_.Rect_GetWidth(*args, **kwargs)
1152
1153 def SetWidth(*args, **kwargs):
1154 """SetWidth(self, int w)"""
1155 return _core_.Rect_SetWidth(*args, **kwargs)
1156
1157 def GetHeight(*args, **kwargs):
1158 """GetHeight(self) -> int"""
1159 return _core_.Rect_GetHeight(*args, **kwargs)
1160
1161 def SetHeight(*args, **kwargs):
1162 """SetHeight(self, int h)"""
1163 return _core_.Rect_SetHeight(*args, **kwargs)
1164
1165 def GetPosition(*args, **kwargs):
1166 """GetPosition(self) -> Point"""
1167 return _core_.Rect_GetPosition(*args, **kwargs)
1168
1169 def SetPosition(*args, **kwargs):
1170 """SetPosition(self, Point p)"""
1171 return _core_.Rect_SetPosition(*args, **kwargs)
1172
1173 def GetSize(*args, **kwargs):
1174 """GetSize(self) -> Size"""
1175 return _core_.Rect_GetSize(*args, **kwargs)
1176
1177 def SetSize(*args, **kwargs):
1178 """SetSize(self, Size s)"""
1179 return _core_.Rect_SetSize(*args, **kwargs)
1180
aff4cc5c
RD
1181 def IsEmpty(*args, **kwargs):
1182 """IsEmpty(self) -> bool"""
1183 return _core_.Rect_IsEmpty(*args, **kwargs)
1184
d55e5bfc
RD
1185 def GetTopLeft(*args, **kwargs):
1186 """GetTopLeft(self) -> Point"""
1187 return _core_.Rect_GetTopLeft(*args, **kwargs)
1188
1189 def SetTopLeft(*args, **kwargs):
1190 """SetTopLeft(self, Point p)"""
1191 return _core_.Rect_SetTopLeft(*args, **kwargs)
1192
1193 def GetBottomRight(*args, **kwargs):
1194 """GetBottomRight(self) -> Point"""
1195 return _core_.Rect_GetBottomRight(*args, **kwargs)
1196
1197 def SetBottomRight(*args, **kwargs):
1198 """SetBottomRight(self, Point p)"""
1199 return _core_.Rect_SetBottomRight(*args, **kwargs)
1200
5acb46e0
RD
1201 def GetTopRight(*args, **kwargs):
1202 """GetTopRight(self) -> Point"""
1203 return _core_.Rect_GetTopRight(*args, **kwargs)
1204
1205 def SetTopRight(*args, **kwargs):
1206 """SetTopRight(self, Point p)"""
1207 return _core_.Rect_SetTopRight(*args, **kwargs)
1208
1209 def GetBottomLeft(*args, **kwargs):
1210 """GetBottomLeft(self) -> Point"""
1211 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1212
1213 def SetBottomLeft(*args, **kwargs):
1214 """SetBottomLeft(self, Point p)"""
1215 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1216
d55e5bfc
RD
1217 def GetLeft(*args, **kwargs):
1218 """GetLeft(self) -> int"""
1219 return _core_.Rect_GetLeft(*args, **kwargs)
1220
1221 def GetTop(*args, **kwargs):
1222 """GetTop(self) -> int"""
1223 return _core_.Rect_GetTop(*args, **kwargs)
1224
1225 def GetBottom(*args, **kwargs):
1226 """GetBottom(self) -> int"""
1227 return _core_.Rect_GetBottom(*args, **kwargs)
1228
1229 def GetRight(*args, **kwargs):
1230 """GetRight(self) -> int"""
1231 return _core_.Rect_GetRight(*args, **kwargs)
1232
1233 def SetLeft(*args, **kwargs):
1234 """SetLeft(self, int left)"""
1235 return _core_.Rect_SetLeft(*args, **kwargs)
1236
1237 def SetRight(*args, **kwargs):
1238 """SetRight(self, int right)"""
1239 return _core_.Rect_SetRight(*args, **kwargs)
1240
1241 def SetTop(*args, **kwargs):
1242 """SetTop(self, int top)"""
1243 return _core_.Rect_SetTop(*args, **kwargs)
1244
1245 def SetBottom(*args, **kwargs):
1246 """SetBottom(self, int bottom)"""
1247 return _core_.Rect_SetBottom(*args, **kwargs)
1248
1249 position = property(GetPosition, SetPosition)
1250 size = property(GetSize, SetSize)
1251 left = property(GetLeft, SetLeft)
1252 right = property(GetRight, SetRight)
1253 top = property(GetTop, SetTop)
1254 bottom = property(GetBottom, SetBottom)
1255
1256 def Inflate(*args, **kwargs):
1257 """
1258 Inflate(self, int dx, int dy) -> Rect
1259
091fdbfa
RD
1260 Increases the size of the rectangle.
1261
1262 The left border is moved farther left and the right border is moved
1263 farther right by ``dx``. The upper border is moved farther up and the
1264 bottom border is moved farther down by ``dy``. (Note the the width and
1265 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1266 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1267 opposite happens: the rectangle size decreases in the respective
1268 direction.
1269
1270 The change is made to the rectangle inplace, if instead you need a
1271 copy that is inflated, preserving the original then make the copy
1272 first::
1273
1274 copy = wx.Rect(*original)
1275 copy.Inflate(10,15)
1276
1277
d55e5bfc
RD
1278 """
1279 return _core_.Rect_Inflate(*args, **kwargs)
1280
1281 def Deflate(*args, **kwargs):
1282 """
1283 Deflate(self, int dx, int dy) -> Rect
1284
091fdbfa
RD
1285 Decrease the rectangle size. This method is the opposite of `Inflate`
1286 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1287 `Inflate` for a full description.
d55e5bfc
RD
1288 """
1289 return _core_.Rect_Deflate(*args, **kwargs)
1290
1291 def OffsetXY(*args, **kwargs):
1292 """
1293 OffsetXY(self, int dx, int dy)
1294
79fccf9d
RD
1295 Moves the rectangle by the specified offset. If dx is positive, the
1296 rectangle is moved to the right, if dy is positive, it is moved to the
1297 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc
RD
1298 """
1299 return _core_.Rect_OffsetXY(*args, **kwargs)
1300
1301 def Offset(*args, **kwargs):
1302 """
1303 Offset(self, Point pt)
1304
b1fcee84 1305 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc
RD
1306 """
1307 return _core_.Rect_Offset(*args, **kwargs)
1308
1309 def Intersect(*args, **kwargs):
1310 """
1311 Intersect(self, Rect rect) -> Rect
1312
b519803b 1313 Returns the intersectsion of this rectangle and rect.
d55e5bfc
RD
1314 """
1315 return _core_.Rect_Intersect(*args, **kwargs)
1316
b519803b
RD
1317 def Union(*args, **kwargs):
1318 """
1319 Union(self, Rect rect) -> Rect
1320
1321 Returns the union of this rectangle and rect.
1322 """
1323 return _core_.Rect_Union(*args, **kwargs)
1324
d55e5bfc
RD
1325 def __add__(*args, **kwargs):
1326 """
1327 __add__(self, Rect rect) -> Rect
1328
1329 Add the properties of rect to this rectangle and return the result.
1330 """
1331 return _core_.Rect___add__(*args, **kwargs)
1332
1333 def __iadd__(*args, **kwargs):
1334 """
1335 __iadd__(self, Rect rect) -> Rect
1336
1337 Add the properties of rect to this rectangle, updating this rectangle.
1338 """
1339 return _core_.Rect___iadd__(*args, **kwargs)
1340
1341 def __eq__(*args, **kwargs):
1342 """
e9d6f3a4 1343 __eq__(self, PyObject other) -> bool
d55e5bfc 1344
e9d6f3a4 1345 Test for equality of wx.Rect objects.
d55e5bfc
RD
1346 """
1347 return _core_.Rect___eq__(*args, **kwargs)
1348
1349 def __ne__(*args, **kwargs):
1350 """
e9d6f3a4 1351 __ne__(self, PyObject other) -> bool
d55e5bfc 1352
e9d6f3a4 1353 Test for inequality of wx.Rect objects.
d55e5bfc
RD
1354 """
1355 return _core_.Rect___ne__(*args, **kwargs)
1356
33d6fd3b 1357 def ContainsXY(*args, **kwargs):
d55e5bfc 1358 """
33d6fd3b 1359 ContainsXY(self, int x, int y) -> bool
d55e5bfc 1360
33d6fd3b 1361 Return True if the point is inside the rect.
d55e5bfc 1362 """
33d6fd3b 1363 return _core_.Rect_ContainsXY(*args, **kwargs)
d55e5bfc 1364
33d6fd3b 1365 def Contains(*args, **kwargs):
d55e5bfc 1366 """
33d6fd3b 1367 Contains(self, Point pt) -> bool
d55e5bfc 1368
33d6fd3b 1369 Return True if the point is inside the rect.
d55e5bfc 1370 """
33d6fd3b 1371 return _core_.Rect_Contains(*args, **kwargs)
d55e5bfc 1372
33d6fd3b 1373 def ContainsRect(*args, **kwargs):
fc46b7f3 1374 """
33d6fd3b 1375 ContainsRect(self, Rect rect) -> bool
fc46b7f3
RD
1376
1377 Returns ``True`` if the given rectangle is completely inside this
1378 rectangle or touches its boundary.
1379 """
33d6fd3b
RD
1380 return _core_.Rect_ContainsRect(*args, **kwargs)
1381
72ef6efb
RD
1382 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1383 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1384 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1385 Inside = Contains
1386 InsideXY = ContainsXY
1387 InsideRect = ContainsRect
fc46b7f3 1388
d55e5bfc
RD
1389 def Intersects(*args, **kwargs):
1390 """
1391 Intersects(self, Rect rect) -> bool
1392
1393 Returns True if the rectangles have a non empty intersection.
1394 """
1395 return _core_.Rect_Intersects(*args, **kwargs)
1396
b1fcee84
RD
1397 def CenterIn(*args, **kwargs):
1398 """
1399 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1400
1401 Center this rectangle within the one passed to the method, which is
1402 usually, but not necessarily, the larger one.
1403 """
1404 return _core_.Rect_CenterIn(*args, **kwargs)
1405
1406 CentreIn = CenterIn
d55e5bfc
RD
1407 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1408 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1409 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1410 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1411 def Set(*args, **kwargs):
1412 """
1413 Set(self, int x=0, int y=0, int width=0, int height=0)
1414
1415 Set all rectangle properties.
1416 """
1417 return _core_.Rect_Set(*args, **kwargs)
1418
1419 def Get(*args, **kwargs):
1420 """
1421 Get() -> (x,y,width,height)
1422
1423 Return the rectangle properties as a tuple.
1424 """
1425 return _core_.Rect_Get(*args, **kwargs)
1426
79fccf9d 1427 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1428 def __str__(self): return str(self.Get())
1429 def __repr__(self): return 'wx.Rect'+str(self.Get())
1430 def __len__(self): return len(self.Get())
1431 def __getitem__(self, index): return self.Get()[index]
1432 def __setitem__(self, index, val):
1433 if index == 0: self.x = val
1434 elif index == 1: self.y = val
1435 elif index == 2: self.width = val
1436 elif index == 3: self.height = val
1437 else: raise IndexError
1438 def __nonzero__(self): return self.Get() != (0,0,0,0)
1439 __safe_for_unpickling__ = True
1440 def __reduce__(self): return (wx.Rect, self.Get())
1441
33d6fd3b
RD
1442 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1443 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
5acb46e0 1444 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
33d6fd3b
RD
1445 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1446 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1447 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1448 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1449 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1450 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1451 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
5acb46e0 1452 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
33d6fd3b
RD
1453 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1454 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1455 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1456 Empty = property(IsEmpty,doc="See `IsEmpty`")
2131d850 1457_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1458
1459def RectPP(*args, **kwargs):
1460 """
1461 RectPP(Point topLeft, Point bottomRight) -> Rect
1462
1463 Create a new Rect object from Points representing two corners.
1464 """
1465 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1466 return val
1467
1468def RectPS(*args, **kwargs):
1469 """
1470 RectPS(Point pos, Size size) -> Rect
1471
1472 Create a new Rect from a position and size.
1473 """
1474 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1475 return val
1476
c1cb24a4
RD
1477def RectS(*args, **kwargs):
1478 """
1479 RectS(Size size) -> Rect
1480
1481 Create a new Rect from a size only.
1482 """
1483 val = _core_.new_RectS(*args, **kwargs)
c1cb24a4
RD
1484 return val
1485
d55e5bfc
RD
1486
1487def IntersectRect(*args, **kwargs):
554f62e9 1488 """
d55e5bfc
RD
1489 IntersectRect(Rect r1, Rect r2) -> Rect
1490
1491 Calculate and return the intersection of r1 and r2.
1492 """
554f62e9 1493 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1494#---------------------------------------------------------------------------
1495
1496class Point2D(object):
79fccf9d
RD
1497 """
1498 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1499 with floating point values.
1500 """
554f62e9
RD
1501 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1502 __repr__ = _swig_repr
1503 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1504 """
1505 __init__(self, double x=0.0, double y=0.0) -> Point2D
1506
1507 Create a w.Point2D object.
1508 """
554f62e9 1509 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
b39fe951
RD
1510 __swig_destroy__ = _core_.delete_Point2D
1511 __del__ = lambda self : None;
d55e5bfc 1512 def GetFloor(*args, **kwargs):
a8eff060
RD
1513 """
1514 GetFloor() -> (x,y)
1515
1516 Convert to integer
1517 """
d55e5bfc
RD
1518 return _core_.Point2D_GetFloor(*args, **kwargs)
1519
1520 def GetRounded(*args, **kwargs):
a8eff060
RD
1521 """
1522 GetRounded() -> (x,y)
1523
1524 Convert to integer
1525 """
d55e5bfc
RD
1526 return _core_.Point2D_GetRounded(*args, **kwargs)
1527
1528 def GetVectorLength(*args, **kwargs):
1529 """GetVectorLength(self) -> double"""
1530 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1531
1532 def GetVectorAngle(*args, **kwargs):
1533 """GetVectorAngle(self) -> double"""
1534 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1535
1536 def SetVectorLength(*args, **kwargs):
1537 """SetVectorLength(self, double length)"""
1538 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1539
1540 def SetVectorAngle(*args, **kwargs):
1541 """SetVectorAngle(self, double degrees)"""
1542 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1543
1544 def SetPolarCoordinates(self, angle, length):
1545 self.SetVectorLength(length)
1546 self.SetVectorAngle(angle)
1547 def Normalize(self):
1548 self.SetVectorLength(1.0)
1549
1550 def GetDistance(*args, **kwargs):
1551 """GetDistance(self, Point2D pt) -> double"""
1552 return _core_.Point2D_GetDistance(*args, **kwargs)
1553
1554 def GetDistanceSquare(*args, **kwargs):
1555 """GetDistanceSquare(self, Point2D pt) -> double"""
1556 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1557
1558 def GetDotProduct(*args, **kwargs):
1559 """GetDotProduct(self, Point2D vec) -> double"""
1560 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1561
1562 def GetCrossProduct(*args, **kwargs):
1563 """GetCrossProduct(self, Point2D vec) -> double"""
1564 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1565
1566 def __neg__(*args, **kwargs):
1567 """
1568 __neg__(self) -> Point2D
1569
1570 the reflection of this point
1571 """
1572 return _core_.Point2D___neg__(*args, **kwargs)
1573
1574 def __iadd__(*args, **kwargs):
1575 """__iadd__(self, Point2D pt) -> Point2D"""
1576 return _core_.Point2D___iadd__(*args, **kwargs)
1577
1578 def __isub__(*args, **kwargs):
1579 """__isub__(self, Point2D pt) -> Point2D"""
1580 return _core_.Point2D___isub__(*args, **kwargs)
1581
1582 def __imul__(*args, **kwargs):
1583 """__imul__(self, Point2D pt) -> Point2D"""
1584 return _core_.Point2D___imul__(*args, **kwargs)
1585
1586 def __idiv__(*args, **kwargs):
1587 """__idiv__(self, Point2D pt) -> Point2D"""
1588 return _core_.Point2D___idiv__(*args, **kwargs)
1589
1590 def __eq__(*args, **kwargs):
1591 """
e9d6f3a4 1592 __eq__(self, PyObject other) -> bool
d55e5bfc 1593
e9d6f3a4 1594 Test for equality of wx.Point2D objects.
d55e5bfc
RD
1595 """
1596 return _core_.Point2D___eq__(*args, **kwargs)
1597
1598 def __ne__(*args, **kwargs):
1599 """
e9d6f3a4 1600 __ne__(self, PyObject other) -> bool
d55e5bfc 1601
e9d6f3a4 1602 Test for inequality of wx.Point2D objects.
d55e5bfc
RD
1603 """
1604 return _core_.Point2D___ne__(*args, **kwargs)
1605
1606 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1607 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1608 def Set(*args, **kwargs):
1609 """Set(self, double x=0, double y=0)"""
1610 return _core_.Point2D_Set(*args, **kwargs)
1611
1612 def Get(*args, **kwargs):
1613 """
1614 Get() -> (x,y)
1615
1616 Return x and y properties as a tuple.
1617 """
1618 return _core_.Point2D_Get(*args, **kwargs)
1619
79fccf9d 1620 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1621 def __str__(self): return str(self.Get())
1622 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1623 def __len__(self): return len(self.Get())
1624 def __getitem__(self, index): return self.Get()[index]
1625 def __setitem__(self, index, val):
1626 if index == 0: self.x = val
1627 elif index == 1: self.y = val
1628 else: raise IndexError
1629 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1630 __safe_for_unpickling__ = True
1631 def __reduce__(self): return (wx.Point2D, self.Get())
1632
33d6fd3b
RD
1633 Floor = property(GetFloor,doc="See `GetFloor`")
1634 Rounded = property(GetRounded,doc="See `GetRounded`")
1635 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1636 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
2131d850 1637_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1638
1639def Point2DCopy(*args, **kwargs):
1640 """
1641 Point2DCopy(Point2D pt) -> Point2D
1642
1643 Create a w.Point2D object.
1644 """
1645 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1646 return val
1647
1648def Point2DFromPoint(*args, **kwargs):
1649 """
1650 Point2DFromPoint(Point pt) -> Point2D
1651
1652 Create a w.Point2D object.
1653 """
1654 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1655 return val
1656
1657#---------------------------------------------------------------------------
1658
70d7cb34
RD
1659Inside = _core_.Inside
1660OutLeft = _core_.OutLeft
1661OutRight = _core_.OutRight
1662OutTop = _core_.OutTop
1663OutBottom = _core_.OutBottom
1664class Rect2D(object):
1665 """
1666 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1667 with floating point component values.
1668 """
1669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1670 __repr__ = _swig_repr
1671 def __init__(self, *args, **kwargs):
1672 """
1673 __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D
1674
1675 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1676 with floating point component values.
1677 """
1678 _core_.Rect2D_swiginit(self,_core_.new_Rect2D(*args, **kwargs))
1679 __swig_destroy__ = _core_.delete_Rect2D
1680 __del__ = lambda self : None;
1681 def GetPosition(*args, **kwargs):
1682 """GetPosition(self) -> Point2D"""
1683 return _core_.Rect2D_GetPosition(*args, **kwargs)
1684
1685 def GetSize(*args, **kwargs):
1686 """GetSize(self) -> Size"""
1687 return _core_.Rect2D_GetSize(*args, **kwargs)
1688
1689 def GetLeft(*args, **kwargs):
1690 """GetLeft(self) -> wxDouble"""
1691 return _core_.Rect2D_GetLeft(*args, **kwargs)
1692
1693 def SetLeft(*args, **kwargs):
1694 """SetLeft(self, wxDouble n)"""
1695 return _core_.Rect2D_SetLeft(*args, **kwargs)
1696
1697 def MoveLeftTo(*args, **kwargs):
1698 """MoveLeftTo(self, wxDouble n)"""
1699 return _core_.Rect2D_MoveLeftTo(*args, **kwargs)
1700
1701 def GetTop(*args, **kwargs):
1702 """GetTop(self) -> wxDouble"""
1703 return _core_.Rect2D_GetTop(*args, **kwargs)
1704
1705 def SetTop(*args, **kwargs):
1706 """SetTop(self, wxDouble n)"""
1707 return _core_.Rect2D_SetTop(*args, **kwargs)
1708
1709 def MoveTopTo(*args, **kwargs):
1710 """MoveTopTo(self, wxDouble n)"""
1711 return _core_.Rect2D_MoveTopTo(*args, **kwargs)
1712
1713 def GetBottom(*args, **kwargs):
1714 """GetBottom(self) -> wxDouble"""
1715 return _core_.Rect2D_GetBottom(*args, **kwargs)
1716
1717 def SetBottom(*args, **kwargs):
1718 """SetBottom(self, wxDouble n)"""
1719 return _core_.Rect2D_SetBottom(*args, **kwargs)
1720
1721 def MoveBottomTo(*args, **kwargs):
1722 """MoveBottomTo(self, wxDouble n)"""
1723 return _core_.Rect2D_MoveBottomTo(*args, **kwargs)
1724
1725 def GetRight(*args, **kwargs):
1726 """GetRight(self) -> wxDouble"""
1727 return _core_.Rect2D_GetRight(*args, **kwargs)
1728
1729 def SetRight(*args, **kwargs):
1730 """SetRight(self, wxDouble n)"""
1731 return _core_.Rect2D_SetRight(*args, **kwargs)
1732
1733 def MoveRightTo(*args, **kwargs):
1734 """MoveRightTo(self, wxDouble n)"""
1735 return _core_.Rect2D_MoveRightTo(*args, **kwargs)
1736
1737 def GetLeftTop(*args, **kwargs):
1738 """GetLeftTop(self) -> Point2D"""
1739 return _core_.Rect2D_GetLeftTop(*args, **kwargs)
1740
1741 def SetLeftTop(*args, **kwargs):
1742 """SetLeftTop(self, Point2D pt)"""
1743 return _core_.Rect2D_SetLeftTop(*args, **kwargs)
1744
1745 def MoveLeftTopTo(*args, **kwargs):
1746 """MoveLeftTopTo(self, Point2D pt)"""
1747 return _core_.Rect2D_MoveLeftTopTo(*args, **kwargs)
1748
1749 def GetLeftBottom(*args, **kwargs):
1750 """GetLeftBottom(self) -> Point2D"""
1751 return _core_.Rect2D_GetLeftBottom(*args, **kwargs)
1752
1753 def SetLeftBottom(*args, **kwargs):
1754 """SetLeftBottom(self, Point2D pt)"""
1755 return _core_.Rect2D_SetLeftBottom(*args, **kwargs)
1756
1757 def MoveLeftBottomTo(*args, **kwargs):
1758 """MoveLeftBottomTo(self, Point2D pt)"""
1759 return _core_.Rect2D_MoveLeftBottomTo(*args, **kwargs)
1760
1761 def GetRightTop(*args, **kwargs):
1762 """GetRightTop(self) -> Point2D"""
1763 return _core_.Rect2D_GetRightTop(*args, **kwargs)
1764
1765 def SetRightTop(*args, **kwargs):
1766 """SetRightTop(self, Point2D pt)"""
1767 return _core_.Rect2D_SetRightTop(*args, **kwargs)
1768
1769 def MoveRightTopTo(*args, **kwargs):
1770 """MoveRightTopTo(self, Point2D pt)"""
1771 return _core_.Rect2D_MoveRightTopTo(*args, **kwargs)
1772
1773 def GetRightBottom(*args, **kwargs):
1774 """GetRightBottom(self) -> Point2D"""
1775 return _core_.Rect2D_GetRightBottom(*args, **kwargs)
1776
1777 def SetRightBottom(*args, **kwargs):
1778 """SetRightBottom(self, Point2D pt)"""
1779 return _core_.Rect2D_SetRightBottom(*args, **kwargs)
1780
1781 def MoveRightBottomTo(*args, **kwargs):
1782 """MoveRightBottomTo(self, Point2D pt)"""
1783 return _core_.Rect2D_MoveRightBottomTo(*args, **kwargs)
1784
1785 def GetCentre(*args, **kwargs):
1786 """GetCentre(self) -> Point2D"""
1787 return _core_.Rect2D_GetCentre(*args, **kwargs)
1788
1789 def SetCentre(*args, **kwargs):
1790 """SetCentre(self, Point2D pt)"""
1791 return _core_.Rect2D_SetCentre(*args, **kwargs)
1792
1793 def MoveCentreTo(*args, **kwargs):
1794 """MoveCentreTo(self, Point2D pt)"""
1795 return _core_.Rect2D_MoveCentreTo(*args, **kwargs)
1796
1797 def GetOutcode(*args, **kwargs):
1798 """GetOutcode(self, Point2D pt) -> int"""
1799 return _core_.Rect2D_GetOutcode(*args, **kwargs)
1800
1801 def Contains(*args, **kwargs):
1802 """Contains(self, Point2D pt) -> bool"""
1803 return _core_.Rect2D_Contains(*args, **kwargs)
1804
1805 def ContainsRect(*args, **kwargs):
1806 """ContainsRect(self, Rect2D rect) -> bool"""
1807 return _core_.Rect2D_ContainsRect(*args, **kwargs)
1808
1809 def IsEmpty(*args, **kwargs):
1810 """IsEmpty(self) -> bool"""
1811 return _core_.Rect2D_IsEmpty(*args, **kwargs)
1812
1813 def HaveEqualSize(*args, **kwargs):
1814 """HaveEqualSize(self, Rect2D rect) -> bool"""
1815 return _core_.Rect2D_HaveEqualSize(*args, **kwargs)
1816
1817 def Inset(*args):
1818 """
1819 Inset(self, wxDouble x, wxDouble y)
1820 Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom)
1821 """
1822 return _core_.Rect2D_Inset(*args)
1823
1824 def Offset(*args, **kwargs):
1825 """Offset(self, Point2D pt)"""
1826 return _core_.Rect2D_Offset(*args, **kwargs)
1827
1828 def ConstrainTo(*args, **kwargs):
1829 """ConstrainTo(self, Rect2D rect)"""
1830 return _core_.Rect2D_ConstrainTo(*args, **kwargs)
1831
1832 def Interpolate(*args, **kwargs):
1833 """Interpolate(self, int widthfactor, int heightfactor) -> Point2D"""
1834 return _core_.Rect2D_Interpolate(*args, **kwargs)
1835
1836 def Intersect(*args, **kwargs):
1837 """Intersect(self, Rect2D otherRect)"""
1838 return _core_.Rect2D_Intersect(*args, **kwargs)
1839
1840 def CreateIntersection(*args, **kwargs):
1841 """CreateIntersection(self, Rect2D otherRect) -> Rect2D"""
1842 return _core_.Rect2D_CreateIntersection(*args, **kwargs)
1843
1844 def Intersects(*args, **kwargs):
1845 """Intersects(self, Rect2D rect) -> bool"""
1846 return _core_.Rect2D_Intersects(*args, **kwargs)
1847
1848 def Union(*args, **kwargs):
1849 """Union(self, Rect2D otherRect)"""
1850 return _core_.Rect2D_Union(*args, **kwargs)
1851
1852 def CreateUnion(*args, **kwargs):
1853 """CreateUnion(self, Rect2D otherRect) -> Rect2D"""
1854 return _core_.Rect2D_CreateUnion(*args, **kwargs)
1855
1856 def Scale(*args):
1857 """
1858 Scale(self, wxDouble f)
1859 Scale(self, int num, int denum)
1860 """
1861 return _core_.Rect2D_Scale(*args)
1862
1863 def __eq__(*args, **kwargs):
1864 """
1865 __eq__(self, PyObject other) -> bool
1866
1867 Test for equality of wx.Rect2D objects.
1868 """
1869 return _core_.Rect2D___eq__(*args, **kwargs)
1870
1871 def __ne__(*args, **kwargs):
1872 """
1873 __ne__(self, PyObject other) -> bool
1874
1875 Test for inequality of wx.Rect2D objects.
1876 """
1877 return _core_.Rect2D___ne__(*args, **kwargs)
1878
1879 x = property(_core_.Rect2D_x_get, _core_.Rect2D_x_set)
1880 y = property(_core_.Rect2D_y_get, _core_.Rect2D_y_set)
1881 width = property(_core_.Rect2D_width_get, _core_.Rect2D_width_set)
1882 height = property(_core_.Rect2D_height_get, _core_.Rect2D_height_set)
1883 def Set(*args, **kwargs):
1884 """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)"""
1885 return _core_.Rect2D_Set(*args, **kwargs)
1886
1887 def Get(*args, **kwargs):
1888 """
1889 Get() -> (x,y, width, height)
1890
1891 Return x, y, width and height y properties as a tuple.
1892 """
1893 return _core_.Rect2D_Get(*args, **kwargs)
1894
1895 def __str__(self): return str(self.Get())
1896 def __repr__(self): return 'wx.Rect2D'+str(self.Get())
1897 def __len__(self): return len(self.Get())
1898 def __getitem__(self, index): return self.Get()[index]
1899 def __setitem__(self, index, val):
1900 if index == 0: self.x = val
1901 elif index == 1: self.y = val
1902 elif index == 2: self.width = val
1903 elif index == 3: self.height = val
1904 else: raise IndexError
1905 def __nonzero__(self): return self.Get() != (0.0, 0.0, 0.0, 0.0)
1906 __safe_for_unpickling__ = True
1907 def __reduce__(self): return (wx.Rect2D, self.Get())
1908
1909_core_.Rect2D_swigregister(Rect2D)
1910
1911#---------------------------------------------------------------------------
1912
d55e5bfc
RD
1913FromStart = _core_.FromStart
1914FromCurrent = _core_.FromCurrent
1915FromEnd = _core_.FromEnd
1916class InputStream(object):
093d3ff1 1917 """Proxy of C++ InputStream class"""
554f62e9
RD
1918 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1919 __repr__ = _swig_repr
1920 def __init__(self, *args, **kwargs):
d55e5bfc 1921 """__init__(self, PyObject p) -> InputStream"""
554f62e9
RD
1922 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1923 __swig_destroy__ = _core_.delete_InputStream
1924 __del__ = lambda self : None;
d55e5bfc
RD
1925 def close(*args, **kwargs):
1926 """close(self)"""
1927 return _core_.InputStream_close(*args, **kwargs)
1928
1929 def flush(*args, **kwargs):
1930 """flush(self)"""
1931 return _core_.InputStream_flush(*args, **kwargs)
1932
1933 def eof(*args, **kwargs):
1934 """eof(self) -> bool"""
1935 return _core_.InputStream_eof(*args, **kwargs)
1936
1937 def read(*args, **kwargs):
1938 """read(self, int size=-1) -> PyObject"""
1939 return _core_.InputStream_read(*args, **kwargs)
1940
1941 def readline(*args, **kwargs):
1942 """readline(self, int size=-1) -> PyObject"""
1943 return _core_.InputStream_readline(*args, **kwargs)
1944
1945 def readlines(*args, **kwargs):
1946 """readlines(self, int sizehint=-1) -> PyObject"""
1947 return _core_.InputStream_readlines(*args, **kwargs)
1948
1949 def seek(*args, **kwargs):
1950 """seek(self, int offset, int whence=0)"""
1951 return _core_.InputStream_seek(*args, **kwargs)
1952
1953 def tell(*args, **kwargs):
1954 """tell(self) -> int"""
1955 return _core_.InputStream_tell(*args, **kwargs)
1956
1957 def Peek(*args, **kwargs):
1958 """Peek(self) -> char"""
1959 return _core_.InputStream_Peek(*args, **kwargs)
1960
1961 def GetC(*args, **kwargs):
1962 """GetC(self) -> char"""
1963 return _core_.InputStream_GetC(*args, **kwargs)
1964
1965 def LastRead(*args, **kwargs):
1966 """LastRead(self) -> size_t"""
1967 return _core_.InputStream_LastRead(*args, **kwargs)
1968
1969 def CanRead(*args, **kwargs):
1970 """CanRead(self) -> bool"""
1971 return _core_.InputStream_CanRead(*args, **kwargs)
1972
1973 def Eof(*args, **kwargs):
1974 """Eof(self) -> bool"""
1975 return _core_.InputStream_Eof(*args, **kwargs)
1976
1977 def Ungetch(*args, **kwargs):
1978 """Ungetch(self, char c) -> bool"""
1979 return _core_.InputStream_Ungetch(*args, **kwargs)
1980
1981 def SeekI(*args, **kwargs):
1982 """SeekI(self, long pos, int mode=FromStart) -> long"""
1983 return _core_.InputStream_SeekI(*args, **kwargs)
1984
1985 def TellI(*args, **kwargs):
1986 """TellI(self) -> long"""
1987 return _core_.InputStream_TellI(*args, **kwargs)
1988
2131d850 1989_core_.InputStream_swigregister(InputStream)
d55e5bfc
RD
1990DefaultPosition = cvar.DefaultPosition
1991DefaultSize = cvar.DefaultSize
1992
1993class OutputStream(object):
093d3ff1 1994 """Proxy of C++ OutputStream class"""
554f62e9
RD
1995 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1996 def __init__(self): raise AttributeError, "No constructor defined"
1997 __repr__ = _swig_repr
d55e5bfc
RD
1998 def write(*args, **kwargs):
1999 """write(self, PyObject obj)"""
2000 return _core_.OutputStream_write(*args, **kwargs)
2001
554f62e9
RD
2002 def LastWrite(*args, **kwargs):
2003 """LastWrite(self) -> size_t"""
2004 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 2005
2131d850 2006_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
2007
2008#---------------------------------------------------------------------------
2009
2010class FSFile(Object):
093d3ff1 2011 """Proxy of C++ FSFile class"""
554f62e9
RD
2012 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2013 __repr__ = _swig_repr
2014 def __init__(self, *args, **kwargs):
d55e5bfc
RD
2015 """
2016 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
2017 DateTime modif) -> FSFile
2018 """
554f62e9 2019 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
554f62e9
RD
2020 __swig_destroy__ = _core_.delete_FSFile
2021 __del__ = lambda self : None;
d55e5bfc
RD
2022 def GetStream(*args, **kwargs):
2023 """GetStream(self) -> InputStream"""
2024 return _core_.FSFile_GetStream(*args, **kwargs)
2025
97ab0f6a
RD
2026 def DetachStream(*args, **kwargs):
2027 """DetachStream(self)"""
2028 return _core_.FSFile_DetachStream(*args, **kwargs)
2029
d55e5bfc
RD
2030 def GetMimeType(*args, **kwargs):
2031 """GetMimeType(self) -> String"""
2032 return _core_.FSFile_GetMimeType(*args, **kwargs)
2033
2034 def GetLocation(*args, **kwargs):
2035 """GetLocation(self) -> String"""
2036 return _core_.FSFile_GetLocation(*args, **kwargs)
2037
2038 def GetAnchor(*args, **kwargs):
2039 """GetAnchor(self) -> String"""
2040 return _core_.FSFile_GetAnchor(*args, **kwargs)
2041
2042 def GetModificationTime(*args, **kwargs):
2043 """GetModificationTime(self) -> DateTime"""
2044 return _core_.FSFile_GetModificationTime(*args, **kwargs)
2045
97ab0f6a
RD
2046 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2047 Location = property(GetLocation,doc="See `GetLocation`")
2048 MimeType = property(GetMimeType,doc="See `GetMimeType`")
2049 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
2050 Stream = property(GetStream,doc="See `GetStream`")
2131d850 2051_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
2052
2053class CPPFileSystemHandler(object):
093d3ff1 2054 """Proxy of C++ CPPFileSystemHandler class"""
554f62e9
RD
2055 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2056 def __init__(self): raise AttributeError, "No constructor defined"
2057 __repr__ = _swig_repr
50f151d7
RD
2058 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
2059 __del__ = lambda self : None;
2131d850 2060_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
2061
2062class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 2063 """Proxy of C++ FileSystemHandler class"""
554f62e9
RD
2064 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2065 __repr__ = _swig_repr
2066 def __init__(self, *args, **kwargs):
d55e5bfc 2067 """__init__(self) -> FileSystemHandler"""
554f62e9 2068 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
c25f90f6 2069 FileSystemHandler._setCallbackInfo(self, self, FileSystemHandler)
d55e5bfc
RD
2070
2071 def _setCallbackInfo(*args, **kwargs):
2072 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
2073 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
2074
2075 def CanOpen(*args, **kwargs):
2076 """CanOpen(self, String location) -> bool"""
2077 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
2078
2079 def OpenFile(*args, **kwargs):
2080 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2081 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
2082
2083 def FindFirst(*args, **kwargs):
2084 """FindFirst(self, String spec, int flags=0) -> String"""
2085 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
2086
2087 def FindNext(*args, **kwargs):
2088 """FindNext(self) -> String"""
2089 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
2090
2091 def GetProtocol(*args, **kwargs):
2092 """GetProtocol(self, String location) -> String"""
2093 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
2094
2095 def GetLeftLocation(*args, **kwargs):
2096 """GetLeftLocation(self, String location) -> String"""
2097 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
2098
2099 def GetAnchor(*args, **kwargs):
2100 """GetAnchor(self, String location) -> String"""
2101 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
2102
2103 def GetRightLocation(*args, **kwargs):
2104 """GetRightLocation(self, String location) -> String"""
2105 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
2106
2107 def GetMimeTypeFromExt(*args, **kwargs):
2108 """GetMimeTypeFromExt(self, String location) -> String"""
2109 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
2110
97ab0f6a
RD
2111 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2112 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
2113 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
2114 Protocol = property(GetProtocol,doc="See `GetProtocol`")
2115 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2131d850 2116_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc
RD
2117
2118class FileSystem(Object):
093d3ff1 2119 """Proxy of C++ FileSystem class"""
554f62e9
RD
2120 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2121 __repr__ = _swig_repr
2122 def __init__(self, *args, **kwargs):
d55e5bfc 2123 """__init__(self) -> FileSystem"""
554f62e9
RD
2124 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
2125 __swig_destroy__ = _core_.delete_FileSystem
2126 __del__ = lambda self : None;
d55e5bfc
RD
2127 def ChangePathTo(*args, **kwargs):
2128 """ChangePathTo(self, String location, bool is_dir=False)"""
2129 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
2130
2131 def GetPath(*args, **kwargs):
2132 """GetPath(self) -> String"""
2133 return _core_.FileSystem_GetPath(*args, **kwargs)
2134
2135 def OpenFile(*args, **kwargs):
2136 """OpenFile(self, String location) -> FSFile"""
2137 return _core_.FileSystem_OpenFile(*args, **kwargs)
2138
2139 def FindFirst(*args, **kwargs):
2140 """FindFirst(self, String spec, int flags=0) -> String"""
2141 return _core_.FileSystem_FindFirst(*args, **kwargs)
2142
2143 def FindNext(*args, **kwargs):
2144 """FindNext(self) -> String"""
2145 return _core_.FileSystem_FindNext(*args, **kwargs)
2146
2147 def AddHandler(*args, **kwargs):
c24da6d6 2148 """AddHandler(CPPFileSystemHandler handler)"""
d55e5bfc
RD
2149 return _core_.FileSystem_AddHandler(*args, **kwargs)
2150
2151 AddHandler = staticmethod(AddHandler)
97ab0f6a
RD
2152 def RemoveHandler(*args, **kwargs):
2153 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2154 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2155
2156 RemoveHandler = staticmethod(RemoveHandler)
d55e5bfc 2157 def CleanUpHandlers(*args, **kwargs):
c24da6d6 2158 """CleanUpHandlers()"""
d55e5bfc
RD
2159 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
2160
2161 CleanUpHandlers = staticmethod(CleanUpHandlers)
2162 def FileNameToURL(*args, **kwargs):
c24da6d6 2163 """FileNameToURL(String filename) -> String"""
d55e5bfc
RD
2164 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
2165
2166 FileNameToURL = staticmethod(FileNameToURL)
ae8162c8
RD
2167 def URLToFileName(*args, **kwargs):
2168 """URLToFileName(String url) -> String"""
2169 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2170
2171 URLToFileName = staticmethod(URLToFileName)
97ab0f6a 2172 Path = property(GetPath,doc="See `GetPath`")
2131d850 2173_core_.FileSystem_swigregister(FileSystem)
d55e5bfc
RD
2174
2175def FileSystem_AddHandler(*args, **kwargs):
554f62e9
RD
2176 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
2177 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 2178
97ab0f6a
RD
2179def FileSystem_RemoveHandler(*args, **kwargs):
2180 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2181 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2182
554f62e9
RD
2183def FileSystem_CleanUpHandlers(*args):
2184 """FileSystem_CleanUpHandlers()"""
2185 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc
RD
2186
2187def FileSystem_FileNameToURL(*args, **kwargs):
554f62e9
RD
2188 """FileSystem_FileNameToURL(String filename) -> String"""
2189 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 2190
d55e5bfc 2191def FileSystem_URLToFileName(*args, **kwargs):
554f62e9
RD
2192 """FileSystem_URLToFileName(String url) -> String"""
2193 return _core_.FileSystem_URLToFileName(*args, **kwargs)
ae8162c8 2194
d55e5bfc 2195class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 2196 """Proxy of C++ InternetFSHandler class"""
554f62e9
RD
2197 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2198 __repr__ = _swig_repr
2199 def __init__(self, *args, **kwargs):
d55e5bfc 2200 """__init__(self) -> InternetFSHandler"""
554f62e9 2201 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc
RD
2202 def CanOpen(*args, **kwargs):
2203 """CanOpen(self, String location) -> bool"""
2204 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
2205
2206 def OpenFile(*args, **kwargs):
2207 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2208 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
2209
2131d850 2210_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc
RD
2211
2212class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 2213 """Proxy of C++ ZipFSHandler class"""
554f62e9
RD
2214 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2215 __repr__ = _swig_repr
2216 def __init__(self, *args, **kwargs):
d55e5bfc 2217 """__init__(self) -> ZipFSHandler"""
554f62e9 2218 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc
RD
2219 def CanOpen(*args, **kwargs):
2220 """CanOpen(self, String location) -> bool"""
2221 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
2222
2223 def OpenFile(*args, **kwargs):
2224 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2225 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
2226
2227 def FindFirst(*args, **kwargs):
2228 """FindFirst(self, String spec, int flags=0) -> String"""
2229 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
2230
2231 def FindNext(*args, **kwargs):
2232 """FindNext(self) -> String"""
2233 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
2234
2131d850 2235_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
2236
2237
2238def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
554f62e9
RD
2239 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2240 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
2241
2242def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
554f62e9
RD
2243 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2244 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
2245
2246def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
554f62e9
RD
2247 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2248 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
ae8162c8
RD
2249def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2250 """
2251 Add 'file' to the memory filesystem. The dataItem parameter can
2252 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2253 arbitrary data. If a bitmap or image is used then the imgType
2254 parameter should specify what kind of image file it should be
2255 written as, wx.BITMAP_TYPE_PNG, etc.
2256 """
2257 if isinstance(dataItem, wx.Image):
2258 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2259 elif isinstance(dataItem, wx.Bitmap):
2260 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2261 elif type(dataItem) == str:
2262 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2263 else:
2264 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc
RD
2265
2266class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 2267 """Proxy of C++ MemoryFSHandler class"""
554f62e9
RD
2268 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2269 __repr__ = _swig_repr
2270 def __init__(self, *args, **kwargs):
d55e5bfc 2271 """__init__(self) -> MemoryFSHandler"""
554f62e9 2272 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 2273 def RemoveFile(*args, **kwargs):
c24da6d6 2274 """RemoveFile(String filename)"""
d55e5bfc
RD
2275 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2276
2277 RemoveFile = staticmethod(RemoveFile)
2278 AddFile = staticmethod(MemoryFSHandler_AddFile)
2279 def CanOpen(*args, **kwargs):
2280 """CanOpen(self, String location) -> bool"""
2281 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2282
2283 def OpenFile(*args, **kwargs):
2284 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2285 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2286
2287 def FindFirst(*args, **kwargs):
2288 """FindFirst(self, String spec, int flags=0) -> String"""
2289 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2290
2291 def FindNext(*args, **kwargs):
2292 """FindNext(self) -> String"""
2293 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2294
2131d850 2295_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc
RD
2296
2297def MemoryFSHandler_RemoveFile(*args, **kwargs):
554f62e9
RD
2298 """MemoryFSHandler_RemoveFile(String filename)"""
2299 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 2300
57133d5c
RD
2301IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2302IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2303IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
f5263701
RD
2304IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2305IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
d55e5bfc
RD
2306#---------------------------------------------------------------------------
2307
2308class ImageHandler(Object):
27fb7603
RD
2309 """
2310 This is the base class for implementing image file loading/saving, and
2311 image creation from data. It is used within `wx.Image` and is not
2312 normally seen by the application.
2313 """
554f62e9
RD
2314 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2315 def __init__(self): raise AttributeError, "No constructor defined"
2316 __repr__ = _swig_repr
d55e5bfc
RD
2317 def GetName(*args, **kwargs):
2318 """GetName(self) -> String"""
2319 return _core_.ImageHandler_GetName(*args, **kwargs)
2320
2321 def GetExtension(*args, **kwargs):
2322 """GetExtension(self) -> String"""
2323 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2324
2325 def GetType(*args, **kwargs):
2326 """GetType(self) -> long"""
2327 return _core_.ImageHandler_GetType(*args, **kwargs)
2328
2329 def GetMimeType(*args, **kwargs):
2330 """GetMimeType(self) -> String"""
2331 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2332
2333 def CanRead(*args, **kwargs):
2334 """CanRead(self, String name) -> bool"""
2335 return _core_.ImageHandler_CanRead(*args, **kwargs)
2336
b02396e8
RD
2337 def CanReadStream(*args, **kwargs):
2338 """CanReadStream(self, InputStream stream) -> bool"""
2339 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2340
d55e5bfc
RD
2341 def SetName(*args, **kwargs):
2342 """SetName(self, String name)"""
2343 return _core_.ImageHandler_SetName(*args, **kwargs)
2344
2345 def SetExtension(*args, **kwargs):
2346 """SetExtension(self, String extension)"""
2347 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2348
2349 def SetType(*args, **kwargs):
2350 """SetType(self, long type)"""
2351 return _core_.ImageHandler_SetType(*args, **kwargs)
2352
2353 def SetMimeType(*args, **kwargs):
2354 """SetMimeType(self, String mimetype)"""
2355 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2356
97ab0f6a
RD
2357 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2358 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2359 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2360 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2131d850 2361_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2362
9d7dfdff
RD
2363class PyImageHandler(ImageHandler):
2364 """
2365 This is the base class for implementing image file loading/saving, and
2366 image creation from data, all written in Python. To create a custom
2367 image handler derive a new class from wx.PyImageHandler and provide
2368 the following methods::
2369
2370 def DoCanRead(self, stream) --> bool
2371 '''Check if this handler can read the image on the stream'''
2372
2373 def LoadFile(self, image, stream, verbose, index) --> bool
2374 '''Load image data from the stream and load it into image.'''
2375
2376 def SaveFile(self, image, stream, verbose) --> bool
2377 '''Save the iamge data in image to the stream using
2378 this handler's image file format.'''
2379
2380 def GetImageCount(self, stream) --> int
2381 '''If this image format can hold more than one image,
2382 how many does the image on the stream have?'''
2383
2384 To activate your handler create an instance of it and pass it to
2385 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2386 `SetExtension` from your constructor.
2387
2388 """
554f62e9
RD
2389 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2390 __repr__ = _swig_repr
2391 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2392 """
2393 __init__(self) -> PyImageHandler
2394
2395 This is the base class for implementing image file loading/saving, and
2396 image creation from data, all written in Python. To create a custom
2397 image handler derive a new class from wx.PyImageHandler and provide
2398 the following methods::
2399
2400 def DoCanRead(self, stream) --> bool
2401 '''Check if this handler can read the image on the stream'''
2402
2403 def LoadFile(self, image, stream, verbose, index) --> bool
2404 '''Load image data from the stream and load it into image.'''
2405
2406 def SaveFile(self, image, stream, verbose) --> bool
2407 '''Save the iamge data in image to the stream using
2408 this handler's image file format.'''
2409
2410 def GetImageCount(self, stream) --> int
2411 '''If this image format can hold more than one image,
2412 how many does the image on the stream have?'''
2413
2414 To activate your handler create an instance of it and pass it to
2415 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2416 `SetExtension` from your constructor.
2417
2418 """
554f62e9 2419 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
9d7dfdff
RD
2420 self._SetSelf(self)
2421
2422 def _SetSelf(*args, **kwargs):
2423 """_SetSelf(self, PyObject self)"""
2424 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2425
2131d850 2426_core_.PyImageHandler_swigregister(PyImageHandler)
9d7dfdff 2427
d55e5bfc 2428class ImageHistogram(object):
093d3ff1 2429 """Proxy of C++ ImageHistogram class"""
554f62e9
RD
2430 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2431 __repr__ = _swig_repr
2432 def __init__(self, *args, **kwargs):
d55e5bfc 2433 """__init__(self) -> ImageHistogram"""
554f62e9 2434 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2435 def MakeKey(*args, **kwargs):
2436 """
7a27cf7c 2437 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2438
2439 Get the key in the histogram for the given RGB values
2440 """
2441 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2442
2443 MakeKey = staticmethod(MakeKey)
2444 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2445 """
2446 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2447
2448 Find first colour that is not used in the image and has higher RGB
2449 values than startR, startG, startB. Returns a tuple consisting of a
2450 success flag and rgb values.
2451 """
d55e5bfc
RD
2452 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2453
f1cbd8fa
RD
2454 def GetCount(*args, **kwargs):
2455 """
2456 GetCount(self, unsigned long key) -> unsigned long
2457
2458 Returns the pixel count for the given key. Use `MakeKey` to create a
2459 key value from a RGB tripple.
2460 """
2461 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2462
2463 def GetCountRGB(*args, **kwargs):
2464 """
7a27cf7c 2465 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2466
2467 Returns the pixel count for the given RGB values.
2468 """
2469 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2470
2471 def GetCountColour(*args, **kwargs):
2472 """
2473 GetCountColour(self, Colour colour) -> unsigned long
2474
2475 Returns the pixel count for the given `wx.Colour` value.
2476 """
2477 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2478
2131d850 2479_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc
RD
2480
2481def ImageHistogram_MakeKey(*args, **kwargs):
554f62e9 2482 """
7a27cf7c 2483 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2484
2485 Get the key in the histogram for the given RGB values
2486 """
554f62e9 2487 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2488
2f91e3df 2489class Image_RGBValue(object):
9d7dfdff
RD
2490 """
2491 An object that contains values for red, green and blue which represent
2492 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2493 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2494 color space.
2495 """
554f62e9
RD
2496 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2497 __repr__ = _swig_repr
2498 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2499 """
2500 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2501
2502 Constructor.
2503 """
554f62e9 2504 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2f91e3df
KO
2505 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2506 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2507 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2508_core_.Image_RGBValue_swigregister(Image_RGBValue)
2f91e3df
KO
2509
2510class Image_HSVValue(object):
9d7dfdff
RD
2511 """
2512 An object that contains values for hue, saturation and value which
2513 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2514 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2515 color space.
2516 """
554f62e9
RD
2517 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2518 __repr__ = _swig_repr
2519 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2520 """
2521 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2522
2523 Constructor.
2524 """
554f62e9 2525 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2f91e3df
KO
2526 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2527 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2528 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2529_core_.Image_HSVValue_swigregister(Image_HSVValue)
2f91e3df 2530
d55e5bfc 2531class Image(Object):
7a27cf7c
RD
2532 """
2533 A platform-independent image class. An image can be created from
2534 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2535 variety of formats. Functions are available to set and get image
2536 bits, so it can be used for basic image manipulation.
2537
2538 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2539 platform-specific `wx.Bitmap` object must be created from it using the
2540 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2541 device context, using `wx.DC.DrawBitmap`.
2542
2543 One colour value of the image may be used as a mask colour which will
2544 lead to the automatic creation of a `wx.Mask` object associated to the
2545 bitmap object.
2546
2547 wx.Image supports alpha channel data, that is in addition to a byte
2548 for the red, green and blue colour components for each pixel it also
2549 stores a byte representing the pixel opacity. An alpha value of 0
2550 corresponds to a transparent pixel (null opacity) while a value of 255
2551 means that the pixel is 100% opaque.
2552
2553 Unlike RGB data, not all images have an alpha channel and before using
2554 `GetAlpha` you should check if this image contains an alpha channel
2555 with `HasAlpha`. Note that currently only images loaded from PNG files
2556 with transparency information will have an alpha channel.
2557 """
554f62e9
RD
2558 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2559 __repr__ = _swig_repr
2560 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2561 """
2562 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2563
2564 Loads an image from a file.
2565 """
554f62e9
RD
2566 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2567 __swig_destroy__ = _core_.delete_Image
2568 __del__ = lambda self : None;
d55e5bfc 2569 def Create(*args, **kwargs):
7a27cf7c
RD
2570 """
2571 Create(self, int width, int height, bool clear=True)
2572
2573 Creates a fresh image. If clear is ``True``, the new image will be
2574 initialized to black. Otherwise, the image data will be uninitialized.
2575 """
d55e5bfc
RD
2576 return _core_.Image_Create(*args, **kwargs)
2577
2578 def Destroy(*args, **kwargs):
2579 """
2580 Destroy(self)
2581
7a27cf7c 2582 Destroys the image data.
d55e5bfc 2583 """
b39fe951
RD
2584 args[0].this.own(False)
2585 return _core_.Image_Destroy(*args, **kwargs)
d55e5bfc
RD
2586
2587 def Scale(*args, **kwargs):
7a27cf7c 2588 """
f5263701 2589 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2590
2591 Returns a scaled version of the image. This is also useful for scaling
2592 bitmaps in general as the only other way to scale bitmaps is to blit a
f5263701
RD
2593 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2594 specifies what method to use for resampling the image. It can be
2595 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2596 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2597 bicubic and box averaging resampling methods for upsampling and
2598 downsampling respectively.
7a27cf7c 2599 """
d55e5bfc
RD
2600 return _core_.Image_Scale(*args, **kwargs)
2601
f5263701
RD
2602 def ResampleBox(*args, **kwargs):
2603 """ResampleBox(self, int width, int height) -> Image"""
2604 return _core_.Image_ResampleBox(*args, **kwargs)
2605
2606 def ResampleBicubic(*args, **kwargs):
2607 """ResampleBicubic(self, int width, int height) -> Image"""
2608 return _core_.Image_ResampleBicubic(*args, **kwargs)
2609
2610 def Blur(*args, **kwargs):
2611 """
2612 Blur(self, int radius) -> Image
2613
2614 Blurs the image in both horizontal and vertical directions by the
2615 specified pixel ``radius``. This should not be used when using a
2616 single mask colour for transparency.
2617 """
2618 return _core_.Image_Blur(*args, **kwargs)
2619
2620 def BlurHorizontal(*args, **kwargs):
2621 """
2622 BlurHorizontal(self, int radius) -> Image
2623
2624 Blurs the image in the horizontal direction only. This should not be
2625 used when using a single mask colour for transparency.
2626
2627 """
2628 return _core_.Image_BlurHorizontal(*args, **kwargs)
2629
2630 def BlurVertical(*args, **kwargs):
2631 """
2632 BlurVertical(self, int radius) -> Image
2633
2634 Blurs the image in the vertical direction only. This should not be
2635 used when using a single mask colour for transparency.
2636 """
2637 return _core_.Image_BlurVertical(*args, **kwargs)
2638
d55e5bfc 2639 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2640 """
2641 ShrinkBy(self, int xFactor, int yFactor) -> Image
2642
2643 Return a version of the image scaled smaller by the given factors.
2644 """
d55e5bfc
RD
2645 return _core_.Image_ShrinkBy(*args, **kwargs)
2646
2647 def Rescale(*args, **kwargs):
7a27cf7c 2648 """
f5263701 2649 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2650
2651 Changes the size of the image in-place by scaling it: after a call to
2652 this function, the image will have the given width and height.
2653
2654 Returns the (modified) image itself.
2655 """
d55e5bfc
RD
2656 return _core_.Image_Rescale(*args, **kwargs)
2657
aff4cc5c 2658 def Resize(*args, **kwargs):
7a27cf7c
RD
2659 """
2660 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2661
2662 Changes the size of the image in-place without scaling it, by adding
2663 either a border with the given colour or cropping as necessary. The
2664 image is pasted into a new image with the given size and background
2665 colour at the position pos relative to the upper left of the new
2666 image. If red = green = blue = -1 then use either the current mask
2667 colour if set or find, use, and set a suitable mask colour for any
2668 newly exposed areas.
2669
2670 Returns the (modified) image itself.
2671 """
aff4cc5c
RD
2672 return _core_.Image_Resize(*args, **kwargs)
2673
d55e5bfc 2674 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2675 """
2676 SetRGB(self, int x, int y, byte r, byte g, byte b)
2677
2678 Sets the pixel at the given coordinate. This routine performs
2679 bounds-checks for the coordinate so it can be considered a safe way to
2680 manipulate the data, but in some cases this might be too slow so that
2681 the data will have to be set directly. In that case you will have to
2682 get access to the image data using the `GetData` method.
2683 """
d55e5bfc
RD
2684 return _core_.Image_SetRGB(*args, **kwargs)
2685
aff4cc5c 2686 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2687 """
2688 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2689
2690 Sets the colour of the pixels within the given rectangle. This routine
2691 performs bounds-checks for the rectangle so it can be considered a
2692 safe way to manipulate the data.
2693 """
aff4cc5c
RD
2694 return _core_.Image_SetRGBRect(*args, **kwargs)
2695
d55e5bfc 2696 def GetRed(*args, **kwargs):
7a27cf7c
RD
2697 """
2698 GetRed(self, int x, int y) -> byte
2699
2700 Returns the red intensity at the given coordinate.
2701 """
d55e5bfc
RD
2702 return _core_.Image_GetRed(*args, **kwargs)
2703
2704 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2705 """
2706 GetGreen(self, int x, int y) -> byte
2707
2708 Returns the green intensity at the given coordinate.
2709 """
d55e5bfc
RD
2710 return _core_.Image_GetGreen(*args, **kwargs)
2711
2712 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2713 """
2714 GetBlue(self, int x, int y) -> byte
2715
2716 Returns the blue intensity at the given coordinate.
2717 """
d55e5bfc
RD
2718 return _core_.Image_GetBlue(*args, **kwargs)
2719
2720 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2721 """
2722 SetAlpha(self, int x, int y, byte alpha)
2723
2724 Sets the alpha value for the given pixel. This function should only be
2725 called if the image has alpha channel data, use `HasAlpha` to check
2726 for this.
2727 """
d55e5bfc
RD
2728 return _core_.Image_SetAlpha(*args, **kwargs)
2729
2730 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2731 """
2732 GetAlpha(self, int x, int y) -> byte
2733
2734 Returns the alpha value for the given pixel. This function may only be
2735 called for the images with alpha channel, use `HasAlpha` to check for
2736 this.
2737
2738 The returned value is the *opacity* of the image, i.e. the value of 0
2739 corresponds to the fully transparent pixels while the value of 255 to
2740 the fully opaque pixels.
2741 """
d55e5bfc
RD
2742 return _core_.Image_GetAlpha(*args, **kwargs)
2743
2744 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2745 """
2746 HasAlpha(self) -> bool
2747
2748 Returns true if this image has alpha channel, false otherwise.
2749 """
d55e5bfc
RD
2750 return _core_.Image_HasAlpha(*args, **kwargs)
2751
68350608
RD
2752 def InitAlpha(*args, **kwargs):
2753 """
2754 InitAlpha(self)
2755
2756 Initializes the image alpha channel data. It is an error to call it if
2757 the image already has alpha data. If it doesn't, alpha data will be by
2758 default initialized to all pixels being fully opaque. But if the image
2759 has a a mask colour, all mask pixels will be completely transparent.
2760 """
2761 return _core_.Image_InitAlpha(*args, **kwargs)
2762
57133d5c
RD
2763 def IsTransparent(*args, **kwargs):
2764 """
7a27cf7c 2765 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
57133d5c 2766
7a27cf7c
RD
2767 Returns ``True`` if this pixel is masked or has an alpha value less
2768 than the spcified threshold.
57133d5c
RD
2769 """
2770 return _core_.Image_IsTransparent(*args, **kwargs)
2771
d55e5bfc 2772 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2773 """
2774 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2775
2776 Find first colour that is not used in the image and has higher RGB
2777 values than startR, startG, startB. Returns a tuple consisting of a
2778 success flag and rgb values.
2779 """
d55e5bfc
RD
2780 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2781
4cf4100f
RD
2782 def ConvertAlphaToMask(*args, **kwargs):
2783 """
57133d5c 2784 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2785
7a27cf7c
RD
2786 If the image has alpha channel, this method converts it to mask. All
2787 pixels with alpha value less than ``threshold`` are replaced with the
2788 mask colour and the alpha channel is removed. The mask colour is
2789 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2790
2791 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2792 nothing.
2793 """
2794 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2795
8fb0e70a
RD
2796 def ConvertColourToAlpha(*args, **kwargs):
2797 """
7a27cf7c 2798 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2799
2800 This method converts an image where the original alpha information is
2801 only available as a shades of a colour (actually shades of grey)
2802 typically when you draw anti-aliased text into a bitmap. The DC
2803 drawing routines draw grey values on the black background although
2804 they actually mean to draw white with differnt alpha values. This
2805 method reverses it, assuming a black (!) background and white text.
2806 The method will then fill up the whole image with the colour given.
2807 """
2808 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2809
d55e5bfc 2810 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2811 """
2812 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2813
2814 Sets the image's mask so that the pixels that have RGB value of
2815 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2816 by first finding an unused colour in the image, setting this colour as
2817 the mask colour and then using this colour to draw all pixels in the
2818 image who corresponding pixel in mask has given RGB value.
2819
2820 Returns ``False`` if ``mask`` does not have same dimensions as the
2821 image or if there is no unused colour left. Returns ``True`` if the
2822 mask was successfully applied.
2823
2824 Note that this method involves computing the histogram, which is
2825 computationally intensive operation.
2826 """
d55e5bfc
RD
2827 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2828
2829 def CanRead(*args, **kwargs):
7a27cf7c
RD
2830 """
2831 CanRead(String filename) -> bool
2832
2833 Returns True if the image handlers can read this file.
2834 """
d55e5bfc
RD
2835 return _core_.Image_CanRead(*args, **kwargs)
2836
2837 CanRead = staticmethod(CanRead)
2838 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2839 """
2840 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2841
2842 If the image file contains more than one image and the image handler
2843 is capable of retrieving these individually, this function will return
2844 the number of available images.
2845 """
d55e5bfc
RD
2846 return _core_.Image_GetImageCount(*args, **kwargs)
2847
2848 GetImageCount = staticmethod(GetImageCount)
2849 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2850 """
2851 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2852
2853 Loads an image from a file. If no handler type is provided, the
2854 library will try to autodetect the format.
2855 """
d55e5bfc
RD
2856 return _core_.Image_LoadFile(*args, **kwargs)
2857
2858 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2859 """
2860 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2861
2862 Loads an image from a file, specifying the image type with a MIME type
2863 string.
2864 """
d55e5bfc
RD
2865 return _core_.Image_LoadMimeFile(*args, **kwargs)
2866
2867 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2868 """
2869 SaveFile(self, String name, int type) -> bool
2870
2871 Saves an image in the named file.
2872 """
d55e5bfc
RD
2873 return _core_.Image_SaveFile(*args, **kwargs)
2874
2875 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2876 """
2877 SaveMimeFile(self, String name, String mimetype) -> bool
2878
2879 Saves an image in the named file.
2880 """
d55e5bfc
RD
2881 return _core_.Image_SaveMimeFile(*args, **kwargs)
2882
2883 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2884 """
2885 CanReadStream(InputStream stream) -> bool
2886
2887 Returns True if the image handlers can read an image file from the
2888 data currently on the input stream, or a readable Python file-like
2889 object.
2890 """
d55e5bfc
RD
2891 return _core_.Image_CanReadStream(*args, **kwargs)
2892
2893 CanReadStream = staticmethod(CanReadStream)
2894 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2895 """
2896 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2897
2898 Loads an image from an input stream or a readable Python file-like
2899 object. If no handler type is provided, the library will try to
2900 autodetect the format.
2901 """
d55e5bfc
RD
2902 return _core_.Image_LoadStream(*args, **kwargs)
2903
2904 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2905 """
2906 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2907
2908 Loads an image from an input stream or a readable Python file-like
2909 object, using a MIME type string to specify the image file format.
2910 """
d55e5bfc
RD
2911 return _core_.Image_LoadMimeStream(*args, **kwargs)
2912
b39fe951 2913 def IsOk(*args, **kwargs):
7a27cf7c 2914 """
b39fe951 2915 IsOk(self) -> bool
7a27cf7c
RD
2916
2917 Returns true if image data is present.
2918 """
b39fe951 2919 return _core_.Image_IsOk(*args, **kwargs)
d55e5bfc 2920
b39fe951 2921 Ok = IsOk
d55e5bfc 2922 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2923 """
2924 GetWidth(self) -> int
2925
2926 Gets the width of the image in pixels.
2927 """
d55e5bfc
RD
2928 return _core_.Image_GetWidth(*args, **kwargs)
2929
2930 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2931 """
2932 GetHeight(self) -> int
2933
2934 Gets the height of the image in pixels.
2935 """
d55e5bfc
RD
2936 return _core_.Image_GetHeight(*args, **kwargs)
2937
2938 def GetSize(*args, **kwargs):
7a27cf7c
RD
2939 """
2940 GetSize(self) -> Size
2941
2942 Returns the size of the image in pixels.
2943 """
d55e5bfc
RD
2944 return _core_.Image_GetSize(*args, **kwargs)
2945
2946 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2947 """
2948 GetSubImage(self, Rect rect) -> Image
2949
2950 Returns a sub image of the current one as long as the rect belongs
2951 entirely to the image.
2952 """
d55e5bfc
RD
2953 return _core_.Image_GetSubImage(*args, **kwargs)
2954
aff4cc5c 2955 def Size(*args, **kwargs):
7a27cf7c
RD
2956 """
2957 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2958
2959 Returns a resized version of this image without scaling it by adding
2960 either a border with the given colour or cropping as necessary. The
2961 image is pasted into a new image with the given size and background
2962 colour at the position ``pos`` relative to the upper left of the new
2963 image. If red = green = blue = -1 then use either the current mask
2964 colour if set or find, use, and set a suitable mask colour for any
2965 newly exposed areas.
2966 """
aff4cc5c
RD
2967 return _core_.Image_Size(*args, **kwargs)
2968
d55e5bfc 2969 def Copy(*args, **kwargs):
7a27cf7c
RD
2970 """
2971 Copy(self) -> Image
2972
2973 Returns an identical copy of the image.
2974 """
d55e5bfc
RD
2975 return _core_.Image_Copy(*args, **kwargs)
2976
2977 def Paste(*args, **kwargs):
7a27cf7c
RD
2978 """
2979 Paste(self, Image image, int x, int y)
2980
2981 Pastes ``image`` into this instance and takes care of the mask colour
2982 and any out of bounds problems.
2983 """
d55e5bfc
RD
2984 return _core_.Image_Paste(*args, **kwargs)
2985
2986 def GetData(*args, **kwargs):
ea939623
RD
2987 """
2988 GetData(self) -> PyObject
2989
2990 Returns a string containing a copy of the RGB bytes of the image.
2991 """
d55e5bfc
RD
2992 return _core_.Image_GetData(*args, **kwargs)
2993
2994 def SetData(*args, **kwargs):
ea939623
RD
2995 """
2996 SetData(self, buffer data)
2997
2998 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2999 either a string or a buffer object holding the data and the length of
3000 the data must be width*height*3.
3001 """
d55e5bfc
RD
3002 return _core_.Image_SetData(*args, **kwargs)
3003
3004 def GetDataBuffer(*args, **kwargs):
ea939623
RD
3005 """
3006 GetDataBuffer(self) -> PyObject
3007
3008 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
3009 image data buffer inside the wx.Image. You need to ensure that you do
3010 not use this buffer object after the image has been destroyed.
ea939623 3011 """
d55e5bfc
RD
3012 return _core_.Image_GetDataBuffer(*args, **kwargs)
3013
3014 def SetDataBuffer(*args, **kwargs):
ea939623
RD
3015 """
3016 SetDataBuffer(self, buffer data)
3017
3018 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
3019 object. This can save making an extra copy of the data but you must
3020 ensure that the buffer object lives longer than the wx.Image does.
ea939623 3021 """
d55e5bfc
RD
3022 return _core_.Image_SetDataBuffer(*args, **kwargs)
3023
3024 def GetAlphaData(*args, **kwargs):
ea939623
RD
3025 """
3026 GetAlphaData(self) -> PyObject
3027
3028 Returns a string containing a copy of the alpha bytes of the image.
3029 """
d55e5bfc
RD
3030 return _core_.Image_GetAlphaData(*args, **kwargs)
3031
3032 def SetAlphaData(*args, **kwargs):
ea939623
RD
3033 """
3034 SetAlphaData(self, buffer alpha)
3035
3036 Resets the Image's alpha data from a buffer of bytes. Accepts either
3037 a string or a buffer object holding the data and the length of the
3038 data must be width*height.
3039 """
d55e5bfc
RD
3040 return _core_.Image_SetAlphaData(*args, **kwargs)
3041
3042 def GetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
3043 """
3044 GetAlphaBuffer(self) -> PyObject
3045
3046 Returns a writable Python buffer object that is pointing at the Alpha
3047 data buffer inside the wx.Image. You need to ensure that you do not
3048 use this buffer object after the image has been destroyed.
3049 """
d55e5bfc
RD
3050 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
3051
3052 def SetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
3053 """
3054 SetAlphaBuffer(self, buffer alpha)
3055
3056 Sets the internal image alpha pointer to point at a Python buffer
3057 object. This can save making an extra copy of the data but you must
3058 ensure that the buffer object lives as long as the wx.Image does.
3059 """
d55e5bfc
RD
3060 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
3061
3062 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
3063 """
3064 SetMaskColour(self, byte r, byte g, byte b)
3065
3066 Sets the mask colour for this image (and tells the image to use the
3067 mask).
3068 """
d55e5bfc
RD
3069 return _core_.Image_SetMaskColour(*args, **kwargs)
3070
aff4cc5c
RD
3071 def GetOrFindMaskColour(*args, **kwargs):
3072 """
3073 GetOrFindMaskColour() -> (r,g,b)
3074
3075 Get the current mask colour or find a suitable colour.
3076 """
3077 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
3078
d55e5bfc 3079 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
3080 """
3081 GetMaskRed(self) -> byte
3082
3083 Gets the red component of the mask colour.
3084 """
d55e5bfc
RD
3085 return _core_.Image_GetMaskRed(*args, **kwargs)
3086
3087 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
3088 """
3089 GetMaskGreen(self) -> byte
3090
3091 Gets the green component of the mask colour.
3092 """
d55e5bfc
RD
3093 return _core_.Image_GetMaskGreen(*args, **kwargs)
3094
3095 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
3096 """
3097 GetMaskBlue(self) -> byte
3098
3099 Gets the blue component of the mask colour.
3100 """
d55e5bfc
RD
3101 return _core_.Image_GetMaskBlue(*args, **kwargs)
3102
3103 def SetMask(*args, **kwargs):
7a27cf7c
RD
3104 """
3105 SetMask(self, bool mask=True)
3106
3107 Specifies whether there is a mask or not. The area of the mask is
3108 determined by the current mask colour.
3109 """
d55e5bfc
RD
3110 return _core_.Image_SetMask(*args, **kwargs)
3111
3112 def HasMask(*args, **kwargs):
7a27cf7c
RD
3113 """
3114 HasMask(self) -> bool
3115
3116 Returns ``True`` if there is a mask active, ``False`` otherwise.
3117 """
d55e5bfc
RD
3118 return _core_.Image_HasMask(*args, **kwargs)
3119
3120 def Rotate(*args, **kwargs):
3121 """
3122 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
3123 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
3124
3125 Rotates the image about the given point, by ``angle`` radians. Passing
3126 ``True`` to ``interpolating`` results in better image quality, but is
3127 slower. If the image has a mask, then the mask colour is used for the
3128 uncovered pixels in the rotated image background. Otherwise, black
3129 will be used as the fill colour.
3130
3131 Returns the rotated image, leaving this image intact.
d55e5bfc
RD
3132 """
3133 return _core_.Image_Rotate(*args, **kwargs)
3134
3135 def Rotate90(*args, **kwargs):
7a27cf7c
RD
3136 """
3137 Rotate90(self, bool clockwise=True) -> Image
3138
3139 Returns a copy of the image rotated 90 degrees in the direction
3140 indicated by ``clockwise``.
3141 """
d55e5bfc
RD
3142 return _core_.Image_Rotate90(*args, **kwargs)
3143
3144 def Mirror(*args, **kwargs):
7a27cf7c
RD
3145 """
3146 Mirror(self, bool horizontally=True) -> Image
3147
3148 Returns a mirrored copy of the image. The parameter ``horizontally``
3149 indicates the orientation.
3150 """
d55e5bfc
RD
3151 return _core_.Image_Mirror(*args, **kwargs)
3152
3153 def Replace(*args, **kwargs):
3154 """
7a27cf7c
RD
3155 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
3156
3157 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
3158 ``(r2,g2,b2)``.
d55e5bfc
RD
3159 """
3160 return _core_.Image_Replace(*args, **kwargs)
3161
7449af73
RD
3162 def ConvertToGreyscale(*args, **kwargs):
3163 """
3164 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
3165
3166 Convert to greyscale image. Uses the luminance component (Y) of the
3167 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
3168 defaults to ITU-T BT.601
3169 """
3170 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
3171
d55e5bfc 3172 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
3173 """
3174 ConvertToMono(self, byte r, byte g, byte b) -> Image
3175
3176 Returns monochromatic version of the image. The returned image has
3177 white colour where the original has ``(r,g,b)`` colour and black
3178 colour everywhere else.
3179 """
d55e5bfc
RD
3180 return _core_.Image_ConvertToMono(*args, **kwargs)
3181
3182 def SetOption(*args, **kwargs):
7a27cf7c
RD
3183 """
3184 SetOption(self, String name, String value)
3185
3186 Sets an image handler defined option. For example, when saving as a
3187 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
3188 number between 0 and 100 (0 is terrible, 100 is very good).
3189 """
d55e5bfc
RD
3190 return _core_.Image_SetOption(*args, **kwargs)
3191
3192 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
3193 """
3194 SetOptionInt(self, String name, int value)
3195
3196 Sets an image option as an integer.
3197 """
d55e5bfc
RD
3198 return _core_.Image_SetOptionInt(*args, **kwargs)
3199
3200 def GetOption(*args, **kwargs):
7a27cf7c
RD
3201 """
3202 GetOption(self, String name) -> String
3203
3204 Gets the value of an image handler option.
3205 """
d55e5bfc
RD
3206 return _core_.Image_GetOption(*args, **kwargs)
3207
3208 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
3209 """
3210 GetOptionInt(self, String name) -> int
3211
3212 Gets the value of an image handler option as an integer. If the given
3213 option is not present, the function returns 0.
3214 """
d55e5bfc
RD
3215 return _core_.Image_GetOptionInt(*args, **kwargs)
3216
3217 def HasOption(*args, **kwargs):
7a27cf7c
RD
3218 """
3219 HasOption(self, String name) -> bool
3220
3221 Returns true if the given option is present.
3222 """
d55e5bfc
RD
3223 return _core_.Image_HasOption(*args, **kwargs)
3224
3225 def CountColours(*args, **kwargs):
3226 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
3227 return _core_.Image_CountColours(*args, **kwargs)
3228
3229 def ComputeHistogram(*args, **kwargs):
3230 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3231 return _core_.Image_ComputeHistogram(*args, **kwargs)
3232
3233 def AddHandler(*args, **kwargs):
c24da6d6 3234 """AddHandler(ImageHandler handler)"""
d55e5bfc
RD
3235 return _core_.Image_AddHandler(*args, **kwargs)
3236
3237 AddHandler = staticmethod(AddHandler)
3238 def InsertHandler(*args, **kwargs):
c24da6d6 3239 """InsertHandler(ImageHandler handler)"""
d55e5bfc
RD
3240 return _core_.Image_InsertHandler(*args, **kwargs)
3241
3242 InsertHandler = staticmethod(InsertHandler)
3243 def RemoveHandler(*args, **kwargs):
c24da6d6 3244 """RemoveHandler(String name) -> bool"""
d55e5bfc
RD
3245 return _core_.Image_RemoveHandler(*args, **kwargs)
3246
3247 RemoveHandler = staticmethod(RemoveHandler)
554f62e9
RD
3248 def GetHandlers(*args, **kwargs):
3249 """GetHandlers() -> PyObject"""
3250 return _core_.Image_GetHandlers(*args, **kwargs)
3251
3252 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 3253 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3254 """
3255 GetImageExtWildcard() -> String
3256
3257 Iterates all registered wxImageHandler objects, and returns a string
3258 containing file extension masks suitable for passing to file open/save
3259 dialog boxes.
3260 """
d55e5bfc
RD
3261 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
3262
3263 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3264 def ConvertToBitmap(*args, **kwargs):
1fbf26be 3265 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
d55e5bfc
RD
3266 return _core_.Image_ConvertToBitmap(*args, **kwargs)
3267
3268 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3269 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
d55e5bfc
RD
3270 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
3271
2f91e3df
KO
3272 def RotateHue(*args, **kwargs):
3273 """
3274 RotateHue(self, double angle)
3275
3276 Rotates the hue of each pixel of the image. Hue is a double in the
3277 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3278 """
3279 return _core_.Image_RotateHue(*args, **kwargs)
3280
3281 def RGBtoHSV(*args, **kwargs):
9d7dfdff
RD
3282 """
3283 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3284
3285 Converts a color in RGB color space to HSV color space.
3286 """
2f91e3df
KO
3287 return _core_.Image_RGBtoHSV(*args, **kwargs)
3288
3289 RGBtoHSV = staticmethod(RGBtoHSV)
3290 def HSVtoRGB(*args, **kwargs):
9d7dfdff
RD
3291 """
3292 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3293
3294 Converts a color in HSV color space to RGB color space.
3295 """
2f91e3df
KO
3296 return _core_.Image_HSVtoRGB(*args, **kwargs)
3297
3298 HSVtoRGB = staticmethod(HSVtoRGB)
b39fe951 3299 def __nonzero__(self): return self.IsOk()
97ab0f6a
RD
3300 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3301 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3302 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3303 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3304 Height = property(GetHeight,doc="See `GetHeight`")
3305 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3306 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3307 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
97ab0f6a 3308 Width = property(GetWidth,doc="See `GetWidth`")
2131d850 3309_core_.Image_swigregister(Image)
d55e5bfc
RD
3310
3311def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3312 """
3313 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3314
3315 Loads an image from a file, using a MIME type string (such as
3316 'image/jpeg') to specify image type.
3317 """
d55e5bfc 3318 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
3319 return val
3320
3321def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3322 """
3323 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3324
3325 Loads an image from an input stream, or any readable Python file-like
3326 object.
3327 """
d55e5bfc 3328 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
3329 return val
3330
3331def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3332 """
3333 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3334
3335 Loads an image from an input stream, or any readable Python file-like
3336 object, specifying the image format with a MIME type string.
3337 """
d55e5bfc 3338 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
3339 return val
3340
c24da6d6 3341def EmptyImage(*args, **kwargs):
ea939623
RD
3342 """
3343 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3344
3345 Construct an empty image of a given size, optionally setting all
3346 pixels to black.
3347 """
c24da6d6 3348 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
3349 return val
3350
3351def ImageFromBitmap(*args, **kwargs):
ea939623
RD
3352 """
3353 ImageFromBitmap(Bitmap bitmap) -> Image
3354
3355 Construct an Image from a `wx.Bitmap`.
3356 """
d55e5bfc 3357 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
3358 return val
3359
3360def ImageFromData(*args, **kwargs):
ea939623
RD
3361 """
3362 ImageFromData(int width, int height, buffer data) -> Image
3363
3364 Construct an Image from a buffer of RGB bytes. Accepts either a
3365 string or a buffer object holding the data and the length of the data
3366 must be width*height*3.
3367 """
d55e5bfc 3368 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
3369 return val
3370
c9c2cf70 3371def ImageFromDataWithAlpha(*args, **kwargs):
ea939623
RD
3372 """
3373 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3374
3375 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3376 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3377 length of the data must be width*height*3 bytes, and the length of the
3378 alpha data must be width*height bytes.
ea939623 3379 """
c9c2cf70 3380 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
c9c2cf70
RD
3381 return val
3382
d55e5bfc 3383def Image_CanRead(*args, **kwargs):
554f62e9 3384 """
7a27cf7c
RD
3385 Image_CanRead(String filename) -> bool
3386
3387 Returns True if the image handlers can read this file.
3388 """
554f62e9 3389 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
3390
3391def Image_GetImageCount(*args, **kwargs):
554f62e9 3392 """
7a27cf7c
RD
3393 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3394
3395 If the image file contains more than one image and the image handler
3396 is capable of retrieving these individually, this function will return
3397 the number of available images.
3398 """
554f62e9 3399 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
3400
3401def Image_CanReadStream(*args, **kwargs):
554f62e9 3402 """
7a27cf7c
RD
3403 Image_CanReadStream(InputStream stream) -> bool
3404
3405 Returns True if the image handlers can read an image file from the
3406 data currently on the input stream, or a readable Python file-like
3407 object.
3408 """
554f62e9 3409 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
3410
3411def Image_AddHandler(*args, **kwargs):
554f62e9
RD
3412 """Image_AddHandler(ImageHandler handler)"""
3413 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
3414
3415def Image_InsertHandler(*args, **kwargs):
554f62e9
RD
3416 """Image_InsertHandler(ImageHandler handler)"""
3417 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
3418
3419def Image_RemoveHandler(*args, **kwargs):
554f62e9
RD
3420 """Image_RemoveHandler(String name) -> bool"""
3421 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3422
554f62e9
RD
3423def Image_GetHandlers(*args):
3424 """Image_GetHandlers() -> PyObject"""
3425 return _core_.Image_GetHandlers(*args)
3426
3427def Image_GetImageExtWildcard(*args):
3428 """
7a27cf7c
RD
3429 Image_GetImageExtWildcard() -> String
3430
3431 Iterates all registered wxImageHandler objects, and returns a string
3432 containing file extension masks suitable for passing to file open/save
3433 dialog boxes.
3434 """
554f62e9 3435 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3436
2f91e3df 3437def Image_RGBtoHSV(*args, **kwargs):
554f62e9 3438 """
9d7dfdff
RD
3439 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3440
3441 Converts a color in RGB color space to HSV color space.
3442 """
554f62e9 3443 return _core_.Image_RGBtoHSV(*args, **kwargs)
2f91e3df
KO
3444
3445def Image_HSVtoRGB(*args, **kwargs):
554f62e9 3446 """
9d7dfdff
RD
3447 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3448
3449 Converts a color in HSV color space to RGB color space.
3450 """
554f62e9 3451 return _core_.Image_HSVtoRGB(*args, **kwargs)
2f91e3df 3452
fc46b7f3
RD
3453
3454def _ImageFromBuffer(*args, **kwargs):
3455 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3456 return _core_._ImageFromBuffer(*args, **kwargs)
3457def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3458 """
3459 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
eec1c382
RD
3460 parameter must be a Python object that implements the buffer interface,
3461 such as a string, array, etc. The dataBuffer object is expected to
3462 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3463 object can optionally be supplied for the image's alpha channel data, and
3464 it is expected to be width*height bytes long.
fc46b7f3
RD
3465
3466 The wx.Image will be created with its data and alpha pointers initialized
3467 to the memory address pointed to by the buffer objects, thus saving the
3468 time needed to copy the image data from the buffer object to the wx.Image.
3469 While this has advantages, it also has the shoot-yourself-in-the-foot
3470 risks associated with sharing a C pointer between two objects.
3471
3472 To help alleviate the risk a reference to the data and alpha buffer
3473 objects are kept with the wx.Image, so that they won't get deleted until
3474 after the wx.Image is deleted. However please be aware that it is not
3475 guaranteed that an object won't move its memory buffer to a new location
3476 when it needs to resize its contents. If that happens then the wx.Image
3477 will end up referring to an invalid memory location and could cause the
3478 application to crash. Therefore care should be taken to not manipulate
3479 the objects used for the data and alpha buffers in a way that would cause
3480 them to change size.
3481 """
fc46b7f3
RD
3482 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3483 image._buffer = dataBuffer
3484 image._alpha = alphaBuffer
3485 return image
3486
a07a67e6
RD
3487def InitAllImageHandlers():
3488 """
3489 The former functionality of InitAllImageHanders is now done internal to
3490 the _core_ extension module and so this function has become a simple NOP.
3491 """
3492 pass
d55e5bfc 3493
d55e5bfc
RD
3494IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3495IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3496PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3497PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3498PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
d55e5bfc
RD
3499BMP_24BPP = _core_.BMP_24BPP
3500BMP_8BPP = _core_.BMP_8BPP
3501BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3502BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3503BMP_8BPP_RED = _core_.BMP_8BPP_RED
3504BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3505BMP_4BPP = _core_.BMP_4BPP
3506BMP_1BPP = _core_.BMP_1BPP
3507BMP_1BPP_BW = _core_.BMP_1BPP_BW
3508class BMPHandler(ImageHandler):
27fb7603 3509 """A `wx.ImageHandler` for \*.bmp bitmap files."""
554f62e9
RD
3510 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3511 __repr__ = _swig_repr
3512 def __init__(self, *args, **kwargs):
27fb7603
RD
3513 """
3514 __init__(self) -> BMPHandler
3515
3516 A `wx.ImageHandler` for \*.bmp bitmap files.
3517 """
554f62e9 3518 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3519_core_.BMPHandler_swigregister(BMPHandler)
d55e5bfc 3520NullImage = cvar.NullImage
68350608 3521IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3522IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3523IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3524IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3525IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3526IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3527IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3528IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3529IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3530IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3531IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3532IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3533IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3534IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3535IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc
RD
3536
3537class ICOHandler(BMPHandler):
27fb7603 3538 """A `wx.ImageHandler` for \*.ico icon files."""
554f62e9
RD
3539 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3540 __repr__ = _swig_repr
3541 def __init__(self, *args, **kwargs):
27fb7603
RD
3542 """
3543 __init__(self) -> ICOHandler
3544
3545 A `wx.ImageHandler` for \*.ico icon files.
3546 """
554f62e9 3547 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3548_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc
RD
3549
3550class CURHandler(ICOHandler):
27fb7603 3551 """A `wx.ImageHandler` for \*.cur cursor files."""
554f62e9
RD
3552 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3553 __repr__ = _swig_repr
3554 def __init__(self, *args, **kwargs):
27fb7603
RD
3555 """
3556 __init__(self) -> CURHandler
3557
3558 A `wx.ImageHandler` for \*.cur cursor files.
3559 """
554f62e9 3560 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3561_core_.CURHandler_swigregister(CURHandler)
d55e5bfc
RD
3562
3563class ANIHandler(CURHandler):
27fb7603 3564 """A `wx.ImageHandler` for \*.ani animated cursor files."""
554f62e9
RD
3565 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3566 __repr__ = _swig_repr
3567 def __init__(self, *args, **kwargs):
27fb7603
RD
3568 """
3569 __init__(self) -> ANIHandler
3570
3571 A `wx.ImageHandler` for \*.ani animated cursor files.
3572 """
554f62e9 3573 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3574_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc
RD
3575
3576class PNGHandler(ImageHandler):
27fb7603 3577 """A `wx.ImageHandler` for PNG image files."""
554f62e9
RD
3578 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3579 __repr__ = _swig_repr
3580 def __init__(self, *args, **kwargs):
27fb7603
RD
3581 """
3582 __init__(self) -> PNGHandler
3583
3584 A `wx.ImageHandler` for PNG image files.
3585 """
554f62e9 3586 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3587_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc
RD
3588
3589class GIFHandler(ImageHandler):
27fb7603 3590 """A `wx.ImageHandler` for GIF image files."""
554f62e9
RD
3591 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3592 __repr__ = _swig_repr
3593 def __init__(self, *args, **kwargs):
27fb7603
RD
3594 """
3595 __init__(self) -> GIFHandler
3596
3597 A `wx.ImageHandler` for GIF image files.
3598 """
554f62e9 3599 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3600_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc
RD
3601
3602class PCXHandler(ImageHandler):
27fb7603 3603 """A `wx.ImageHandler` for PCX imager files."""
554f62e9
RD
3604 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3605 __repr__ = _swig_repr
3606 def __init__(self, *args, **kwargs):
27fb7603
RD
3607 """
3608 __init__(self) -> PCXHandler
3609
3610 A `wx.ImageHandler` for PCX imager files.
3611 """
554f62e9 3612 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3613_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc
RD
3614
3615class JPEGHandler(ImageHandler):
27fb7603 3616 """A `wx.ImageHandler` for JPEG/JPG image files."""
554f62e9
RD
3617 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3618 __repr__ = _swig_repr
3619 def __init__(self, *args, **kwargs):
27fb7603
RD
3620 """
3621 __init__(self) -> JPEGHandler
3622
3623 A `wx.ImageHandler` for JPEG/JPG image files.
3624 """
554f62e9 3625 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3626_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc
RD
3627
3628class PNMHandler(ImageHandler):
27fb7603 3629 """A `wx.ImageHandler` for PNM image files."""
554f62e9
RD
3630 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3631 __repr__ = _swig_repr
3632 def __init__(self, *args, **kwargs):
27fb7603
RD
3633 """
3634 __init__(self) -> PNMHandler
3635
3636 A `wx.ImageHandler` for PNM image files.
3637 """
554f62e9 3638 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3639_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc
RD
3640
3641class XPMHandler(ImageHandler):
27fb7603 3642 """A `wx.ImageHandler` for XPM image."""
554f62e9
RD
3643 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3644 __repr__ = _swig_repr
3645 def __init__(self, *args, **kwargs):
27fb7603
RD
3646 """
3647 __init__(self) -> XPMHandler
3648
3649 A `wx.ImageHandler` for XPM image.
3650 """
554f62e9 3651 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3652_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc
RD
3653
3654class TIFFHandler(ImageHandler):
27fb7603 3655 """A `wx.ImageHandler` for TIFF image files."""
554f62e9
RD
3656 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3657 __repr__ = _swig_repr
3658 def __init__(self, *args, **kwargs):
27fb7603
RD
3659 """
3660 __init__(self) -> TIFFHandler
3661
3662 A `wx.ImageHandler` for TIFF image files.
3663 """
554f62e9 3664 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3665_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3666
580080c5
RD
3667class TGAHandler(ImageHandler):
3668 """A `wx.ImageHandler` for TGA image files."""
3669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3670 __repr__ = _swig_repr
3671 def __init__(self, *args, **kwargs):
3672 """
3673 __init__(self) -> TGAHandler
3674
3675 A `wx.ImageHandler` for TGA image files.
3676 """
3677 _core_.TGAHandler_swiginit(self,_core_.new_TGAHandler(*args, **kwargs))
3678_core_.TGAHandler_swigregister(TGAHandler)
3679
c0de73ae
RD
3680QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3681QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3682class Quantize(object):
3683 """Performs quantization, or colour reduction, on a wxImage."""
554f62e9
RD
3684 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3685 def __init__(self): raise AttributeError, "No constructor defined"
3686 __repr__ = _swig_repr
c0de73ae
RD
3687 def Quantize(*args, **kwargs):
3688 """
3689 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3690
3691 Reduce the colours in the source image and put the result into the
3692 destination image, setting the palette in the destination if
3693 needed. Both images may be the same, to overwrite the source image.
3694 """
3695 return _core_.Quantize_Quantize(*args, **kwargs)
3696
3697 Quantize = staticmethod(Quantize)
2131d850 3698_core_.Quantize_swigregister(Quantize)
c0de73ae
RD
3699
3700def Quantize_Quantize(*args, **kwargs):
554f62e9 3701 """
c0de73ae
RD
3702 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3703
3704 Reduce the colours in the source image and put the result into the
3705 destination image, setting the palette in the destination if
3706 needed. Both images may be the same, to overwrite the source image.
3707 """
554f62e9 3708 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3709
d55e5bfc
RD
3710#---------------------------------------------------------------------------
3711
3712class EvtHandler(Object):
093d3ff1 3713 """Proxy of C++ EvtHandler class"""
554f62e9
RD
3714 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3715 __repr__ = _swig_repr
3716 def __init__(self, *args, **kwargs):
d55e5bfc 3717 """__init__(self) -> EvtHandler"""
554f62e9 3718 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d49bdf34
RD
3719 self._setOORInfo(self)
3720
d55e5bfc
RD
3721 def GetNextHandler(*args, **kwargs):
3722 """GetNextHandler(self) -> EvtHandler"""
3723 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3724
3725 def GetPreviousHandler(*args, **kwargs):
3726 """GetPreviousHandler(self) -> EvtHandler"""
3727 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3728
3729 def SetNextHandler(*args, **kwargs):
3730 """SetNextHandler(self, EvtHandler handler)"""
3731 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3732
3733 def SetPreviousHandler(*args, **kwargs):
3734 """SetPreviousHandler(self, EvtHandler handler)"""
3735 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3736
3737 def GetEvtHandlerEnabled(*args, **kwargs):
3738 """GetEvtHandlerEnabled(self) -> bool"""
3739 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3740
3741 def SetEvtHandlerEnabled(*args, **kwargs):
3742 """SetEvtHandlerEnabled(self, bool enabled)"""
3743 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3744
3745 def ProcessEvent(*args, **kwargs):
3746 """ProcessEvent(self, Event event) -> bool"""
3747 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3748
3749 def AddPendingEvent(*args, **kwargs):
3750 """AddPendingEvent(self, Event event)"""
3751 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3752
3753 def ProcessPendingEvents(*args, **kwargs):
3754 """ProcessPendingEvents(self)"""
3755 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3756
3757 def Connect(*args, **kwargs):
3758 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3759 return _core_.EvtHandler_Connect(*args, **kwargs)
3760
3761 def Disconnect(*args, **kwargs):
f460c29d 3762 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
d55e5bfc
RD
3763 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3764
3765 def _setOORInfo(*args, **kwargs):
093d3ff1 3766 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef 3767 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
15665b47 3768 args[0].this.own(False)
7e08d4ef 3769 return val
d55e5bfc
RD
3770
3771 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3772 """
3773 Bind an event to an event handler.
3774
caef1a4d
RD
3775 :param event: One of the EVT_* objects that specifies the
3776 type of event to bind,
d55e5bfc 3777
caef1a4d
RD
3778 :param handler: A callable object to be invoked when the
3779 event is delivered to self. Pass None to
3780 disconnect an event handler.
d55e5bfc 3781
caef1a4d
RD
3782 :param source: Sometimes the event originates from a
3783 different window than self, but you still
3784 want to catch it in self. (For example, a
3785 button event delivered to a frame.) By
3786 passing the source of the event, the event
3787 handling system is able to differentiate
3788 between the same event type from different
3789 controls.
d55e5bfc 3790
caef1a4d
RD
3791 :param id: Used to spcify the event source by ID instead
3792 of instance.
3793
3794 :param id2: Used when it is desirable to bind a handler
3795 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3796 """
3797 if source is not None:
3798 id = source.GetId()
3799 event.Bind(self, id, id2, handler)
3800
c24da6d6
RD
3801 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3802 """
3803 Disconencts the event handler binding for event from self.
3804 Returns True if successful.
3805 """
3806 if source is not None:
3807 id = source.GetId()
3808 return event.Unbind(self, id, id2)
d55e5bfc 3809
97ab0f6a
RD
3810 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3811 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3812 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
2131d850 3813_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3814
3815#---------------------------------------------------------------------------
3816
3817class PyEventBinder(object):
3818 """
3819 Instances of this class are used to bind specific events to event
3820 handlers.
3821 """
3822 def __init__(self, evtType, expectedIDs=0):
3823 if expectedIDs not in [0, 1, 2]:
3824 raise ValueError, "Invalid number of expectedIDs"
3825 self.expectedIDs = expectedIDs
3826
3827 if type(evtType) == list or type(evtType) == tuple:
3828 self.evtType = evtType
3829 else:
3830 self.evtType = [evtType]
3831
3832
3833 def Bind(self, target, id1, id2, function):
3834 """Bind this set of event types to target."""
3835 for et in self.evtType:
3836 target.Connect(id1, id2, et, function)
3837
c24da6d6
RD
3838
3839 def Unbind(self, target, id1, id2):
3840 """Remove an event binding."""
3841 success = 0
3842 for et in self.evtType:
3843 success += target.Disconnect(id1, id2, et)
3844 return success != 0
3845
b08d67c2
RD
3846 def _getEvtType(self):
3847 """
3848 Make it easy to get to the default wxEventType typeID for this
3849 event binder.
3850 """
3851 return self.evtType[0]
3852
3853 typeId = property(_getEvtType)
3854
d55e5bfc
RD
3855
3856 def __call__(self, *args):
3857 """
3858 For backwards compatibility with the old EVT_* functions.
3859 Should be called with either (window, func), (window, ID,
3860 func) or (window, ID1, ID2, func) parameters depending on the
3861 type of the event.
3862 """
3863 assert len(args) == 2 + self.expectedIDs
3864 id1 = wx.ID_ANY
3865 id2 = wx.ID_ANY
3866 target = args[0]
3867 if self.expectedIDs == 0:
3868 func = args[1]
3869 elif self.expectedIDs == 1:
3870 id1 = args[1]
3871 func = args[2]
3872 elif self.expectedIDs == 2:
3873 id1 = args[1]
3874 id2 = args[2]
3875 func = args[3]
3876 else:
3877 raise ValueError, "Unexpected number of IDs"
3878
3879 self.Bind(target, id1, id2, func)
3880
3881
3882# These two are square pegs that don't fit the PyEventBinder hole...
3883def EVT_COMMAND(win, id, cmd, func):
3884 win.Connect(id, -1, cmd, func)
3885def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3886 win.Connect(id1, id2, cmd, func)
3887
3888
3889#---------------------------------------------------------------------------
3890
3891#---------------------------------------------------------------------------
3892
3893EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3894EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3895
554f62e9 3896def NewEventType(*args):
f460c29d 3897 """NewEventType() -> EventType"""
554f62e9 3898 return _core_.NewEventType(*args)
4976f996 3899wxEVT_ANY = _core_.wxEVT_ANY
d55e5bfc
RD
3900wxEVT_NULL = _core_.wxEVT_NULL
3901wxEVT_FIRST = _core_.wxEVT_FIRST
3902wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3903wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3904wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3905wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3906wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3907wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3908wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3909wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3910wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3911wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3912wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3913wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3914wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3915wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3916wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3917wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3918wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3919wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3920wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3921wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3922wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3923wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3924wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3925wxEVT_MOTION = _core_.wxEVT_MOTION
3926wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3927wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3928wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3929wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3930wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3931wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3932wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3933wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3934wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3935wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3936wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3937wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3938wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3939wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3940wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3941wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3942wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3943wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3944wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3945wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3946wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3947wxEVT_CHAR = _core_.wxEVT_CHAR
3948wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3949wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3950wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3951wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3952wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3953wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3954wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3955wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3956wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3957wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3958wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3959wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3960wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3961wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
db67f999
RD
3962wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3963wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
d55e5bfc
RD
3964wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3965wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3966wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3967wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3968wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3969wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3970wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3971wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3972wxEVT_SIZE = _core_.wxEVT_SIZE
3973wxEVT_MOVE = _core_.wxEVT_MOVE
3974wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3975wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3976wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3977wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
d55e5bfc
RD
3978wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3979wxEVT_CREATE = _core_.wxEVT_CREATE
3980wxEVT_DESTROY = _core_.wxEVT_DESTROY
3981wxEVT_SHOW = _core_.wxEVT_SHOW
3982wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3983wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3984wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
0f83f5da 3985wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
d55e5bfc
RD
3986wxEVT_PAINT = _core_.wxEVT_PAINT
3987wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3988wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3989wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3990wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3991wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3992wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3993wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3994wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3995wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3996wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3997wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3998wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3999wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
4000wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
4001wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
4002wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
4003wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
4004wxEVT_IDLE = _core_.wxEVT_IDLE
4005wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
4006wxEVT_SIZING = _core_.wxEVT_SIZING
4007wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 4008wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
4009wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
4010wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
4011wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
d55e5bfc
RD
4012wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
4013wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
4014wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
4015wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
4016wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
4017wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
4018wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
4019#
4020# Create some event binders
4021EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
4022EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
4023EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
4024EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
4025EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
4026EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4027EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4028EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
4029EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
4030EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
4031EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
4032EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
4033EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 4034EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
4035EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
4036EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
4037EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
4038EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
4039EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
4040EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
4041EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
4042EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
4043EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
4044EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 4045EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
4046EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4047EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4048EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
4049EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
4050EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
4051EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
4052EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
4053EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
4054EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
4055EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
4056EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
4057EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
4058EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
4059EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
4060EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
4061EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
0f83f5da 4062EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d55e5bfc
RD
4063
4064EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
4065EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
4066EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
4067EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
4068EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
4069EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
4070EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
4071EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
4072EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
4073EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
4074EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
4075EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
4076EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
4077
4078EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
4079 wxEVT_LEFT_UP,
4080 wxEVT_MIDDLE_DOWN,
4081 wxEVT_MIDDLE_UP,
4082 wxEVT_RIGHT_DOWN,
4083 wxEVT_RIGHT_UP,
4084 wxEVT_MOTION,
4085 wxEVT_LEFT_DCLICK,
4086 wxEVT_MIDDLE_DCLICK,
4087 wxEVT_RIGHT_DCLICK,
4088 wxEVT_ENTER_WINDOW,
4089 wxEVT_LEAVE_WINDOW,
4090 wxEVT_MOUSEWHEEL
4091 ])
4092
4093
4094# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 4095EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
4096 wxEVT_SCROLLWIN_BOTTOM,
4097 wxEVT_SCROLLWIN_LINEUP,
4098 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 4099 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
4100 wxEVT_SCROLLWIN_PAGEDOWN,
4101 wxEVT_SCROLLWIN_THUMBTRACK,
4102 wxEVT_SCROLLWIN_THUMBRELEASE,
4103 ])
4104
4105EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
4106EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
4107EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
4108EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
4109EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
4110EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
4111EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
4112EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
4113
27fb7603 4114# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
4115EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4116 wxEVT_SCROLL_BOTTOM,
4117 wxEVT_SCROLL_LINEUP,
4118 wxEVT_SCROLL_LINEDOWN,
4119 wxEVT_SCROLL_PAGEUP,
4120 wxEVT_SCROLL_PAGEDOWN,
4121 wxEVT_SCROLL_THUMBTRACK,
4122 wxEVT_SCROLL_THUMBRELEASE,
db67f999 4123 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
4124 ])
4125
4126EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
4127EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
4128EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
4129EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
4130EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
4131EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
4132EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
4133EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
db67f999
RD
4134EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
4135EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 4136
27fb7603 4137# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
4138EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4139 wxEVT_SCROLL_BOTTOM,
4140 wxEVT_SCROLL_LINEUP,
4141 wxEVT_SCROLL_LINEDOWN,
4142 wxEVT_SCROLL_PAGEUP,
4143 wxEVT_SCROLL_PAGEDOWN,
4144 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 4145 wxEVT_SCROLL_THUMBRELEASE,
db67f999 4146 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
4147 ], 1)
4148
4149EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
4150EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
4151EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
4152EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
4153EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
4154EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
4155EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
4156EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
db67f999
RD
4157EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
4158EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
4159
4160EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
4161EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
4162EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
4163EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
4164EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
4165EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
4166EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
4167EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
4168EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
4169EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
4170
4171EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
4172EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
4173EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
4174EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
4175EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
4176EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
4177EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
4178EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
4179EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
4180
4181
4182EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
4183EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
4184EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
4185EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
4186EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
4187EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
4188EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
4189
4190EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4191
4192EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4193EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4194
4195EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4196
2131d850
RD
4197EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
4198EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
4199EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
4200
4201
4202#---------------------------------------------------------------------------
4203
4204class Event(Object):
27fb7603
RD
4205 """
4206 An event is a structure holding information about an event passed to a
4207 callback or member function. wx.Event is an abstract base class for
4208 other event classes
4209 """
554f62e9
RD
4210 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4211 def __init__(self): raise AttributeError, "No constructor defined"
4212 __repr__ = _swig_repr
4213 __swig_destroy__ = _core_.delete_Event
4214 __del__ = lambda self : None;
d55e5bfc 4215 def SetEventType(*args, **kwargs):
27fb7603 4216 """
f460c29d 4217 SetEventType(self, EventType typ)
27fb7603
RD
4218
4219 Sets the specific type of the event.
4220 """
d55e5bfc
RD
4221 return _core_.Event_SetEventType(*args, **kwargs)
4222
4223 def GetEventType(*args, **kwargs):
27fb7603 4224 """
f460c29d 4225 GetEventType(self) -> EventType
27fb7603
RD
4226
4227 Returns the identifier of the given event type, such as
4228 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4229 """
d55e5bfc
RD
4230 return _core_.Event_GetEventType(*args, **kwargs)
4231
4232 def GetEventObject(*args, **kwargs):
27fb7603
RD
4233 """
4234 GetEventObject(self) -> Object
4235
4236 Returns the object (usually a window) associated with the event, if
4237 any.
4238 """
d55e5bfc
RD
4239 return _core_.Event_GetEventObject(*args, **kwargs)
4240
4241 def SetEventObject(*args, **kwargs):
27fb7603
RD
4242 """
4243 SetEventObject(self, Object obj)
4244
4245 Sets the originating object, or in other words, obj is normally the
4246 object that is sending the event.
4247 """
d55e5bfc
RD
4248 return _core_.Event_SetEventObject(*args, **kwargs)
4249
4250 def GetTimestamp(*args, **kwargs):
4251 """GetTimestamp(self) -> long"""
4252 return _core_.Event_GetTimestamp(*args, **kwargs)
4253
4254 def SetTimestamp(*args, **kwargs):
4255 """SetTimestamp(self, long ts=0)"""
4256 return _core_.Event_SetTimestamp(*args, **kwargs)
4257
4258 def GetId(*args, **kwargs):
27fb7603
RD
4259 """
4260 GetId(self) -> int
4261
4262 Returns the identifier associated with this event, such as a button
4263 command id.
4264 """
d55e5bfc
RD
4265 return _core_.Event_GetId(*args, **kwargs)
4266
4267 def SetId(*args, **kwargs):
27fb7603
RD
4268 """
4269 SetId(self, int Id)
4270
4271 Set's the ID for the event. This is usually the ID of the window that
4272 is sending the event, but it can also be a command id from a menu
4273 item, etc.
4274 """
d55e5bfc
RD
4275 return _core_.Event_SetId(*args, **kwargs)
4276
4277 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4278 """
4279 IsCommandEvent(self) -> bool
4280
4281 Returns true if the event is or is derived from `wx.CommandEvent` else
4282 it returns false. Note: Exists only for optimization purposes.
4283 """
d55e5bfc
RD
4284 return _core_.Event_IsCommandEvent(*args, **kwargs)
4285
4286 def Skip(*args, **kwargs):
51b83b37
RD
4287 """
4288 Skip(self, bool skip=True)
4289
6b449b19
RD
4290 This method can be used inside an event handler to control whether
4291 further event handlers bound to this event will be called after the
4292 current one returns. Without Skip() (or equivalently if Skip(False) is
4293 used), the event will not be processed any more. If Skip(True) is
4294 called, the event processing system continues searching for a further
4295 handler function for this event, even though it has been processed
4296 already in the current handler.
51b83b37 4297 """
d55e5bfc
RD
4298 return _core_.Event_Skip(*args, **kwargs)
4299
4300 def GetSkipped(*args, **kwargs):
27fb7603
RD
4301 """
4302 GetSkipped(self) -> bool
4303
4304 Returns true if the event handler should be skipped, false otherwise.
4305 :see: `Skip`
4306 """
d55e5bfc
RD
4307 return _core_.Event_GetSkipped(*args, **kwargs)
4308
4309 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4310 """
4311 ShouldPropagate(self) -> bool
4312
4313 Test if this event should be propagated to the parent window or not,
4314 i.e. if the propagation level is currently greater than 0.
4315 """
d55e5bfc
RD
4316 return _core_.Event_ShouldPropagate(*args, **kwargs)
4317
4318 def StopPropagation(*args, **kwargs):
27fb7603
RD
4319 """
4320 StopPropagation(self) -> int
4321
4322 Stop the event from propagating to its parent window. Returns the old
4323 propagation level value which may be later passed to
4324 `ResumePropagation` to allow propagating the event again.
4325 """
d55e5bfc
RD
4326 return _core_.Event_StopPropagation(*args, **kwargs)
4327
4328 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4329 """
4330 ResumePropagation(self, int propagationLevel)
4331
4332 Resume the event propagation by restoring the propagation level. (For
4333 example, you can use the value returned by an earlier call to
4334 `StopPropagation`.)
4335
4336 """
d55e5bfc
RD
4337 return _core_.Event_ResumePropagation(*args, **kwargs)
4338
4339 def Clone(*args, **kwargs):
4340 """Clone(self) -> Event"""
4341 return _core_.Event_Clone(*args, **kwargs)
4342
97ab0f6a
RD
4343 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4344 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4345 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4346 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4347 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
2131d850 4348_core_.Event_swigregister(Event)
d55e5bfc
RD
4349
4350#---------------------------------------------------------------------------
4351
4352class PropagationDisabler(object):
27fb7603
RD
4353 """
4354 Helper class to temporarily change an event not to propagate. Simply
4355 create an instance of this class and then whe it is destroyed the
4356 propogation of the event will be restored.
4357 """
554f62e9
RD
4358 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4359 __repr__ = _swig_repr
4360 def __init__(self, *args, **kwargs):
27fb7603
RD
4361 """
4362 __init__(self, Event event) -> PropagationDisabler
4363
4364 Helper class to temporarily change an event not to propagate. Simply
4365 create an instance of this class and then whe it is destroyed the
4366 propogation of the event will be restored.
4367 """
554f62e9
RD
4368 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4369 __swig_destroy__ = _core_.delete_PropagationDisabler
4370 __del__ = lambda self : None;
2131d850 4371_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc
RD
4372
4373class PropagateOnce(object):
27fb7603
RD
4374 """
4375 A helper class that will temporarily lower propagation level of an
4376 event. Simply create an instance of this class and then whe it is
4377 destroyed the propogation of the event will be restored.
4378 """
554f62e9
RD
4379 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4380 __repr__ = _swig_repr
4381 def __init__(self, *args, **kwargs):
27fb7603
RD
4382 """
4383 __init__(self, Event event) -> PropagateOnce
4384
4385 A helper class that will temporarily lower propagation level of an
4386 event. Simply create an instance of this class and then whe it is
4387 destroyed the propogation of the event will be restored.
4388 """
554f62e9
RD
4389 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4390 __swig_destroy__ = _core_.delete_PropagateOnce
4391 __del__ = lambda self : None;
2131d850 4392_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
4393
4394#---------------------------------------------------------------------------
4395
4396class CommandEvent(Event):
27fb7603
RD
4397 """
4398 This event class contains information about command events, which
4399 originate from a variety of simple controls, as well as menus and
4400 toolbars.
4401 """
554f62e9
RD
4402 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4403 __repr__ = _swig_repr
4404 def __init__(self, *args, **kwargs):
27fb7603 4405 """
f460c29d 4406 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
4407
4408 This event class contains information about command events, which
4409 originate from a variety of simple controls, as well as menus and
4410 toolbars.
4411 """
554f62e9 4412 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 4413 def GetSelection(*args, **kwargs):
27fb7603
RD
4414 """
4415 GetSelection(self) -> int
4416
4417 Returns item index for a listbox or choice selection event (not valid
4418 for a deselection).
4419 """
d55e5bfc
RD
4420 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4421
4422 def SetString(*args, **kwargs):
4423 """SetString(self, String s)"""
4424 return _core_.CommandEvent_SetString(*args, **kwargs)
4425
4426 def GetString(*args, **kwargs):
27fb7603
RD
4427 """
4428 GetString(self) -> String
4429
4430 Returns item string for a listbox or choice selection event (not valid
4431 for a deselection).
4432 """
d55e5bfc
RD
4433 return _core_.CommandEvent_GetString(*args, **kwargs)
4434
4435 def IsChecked(*args, **kwargs):
27fb7603
RD
4436 """
4437 IsChecked(self) -> bool
4438
4439 This method can be used with checkbox and menu events: for the
4440 checkboxes, the method returns true for a selection event and false
4441 for a deselection one. For the menu events, this method indicates if
4442 the menu item just has become checked or unchecked (and thus only
4443 makes sense for checkable menu items).
4444 """
d55e5bfc
RD
4445 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4446
4447 Checked = IsChecked
4448 def IsSelection(*args, **kwargs):
27fb7603
RD
4449 """
4450 IsSelection(self) -> bool
4451
4452 For a listbox or similar event, returns true if it is a selection,
4453 false if it is a deselection.
4454 """
d55e5bfc
RD
4455 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4456
4457 def SetExtraLong(*args, **kwargs):
4458 """SetExtraLong(self, long extraLong)"""
4459 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4460
4461 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4462 """
4463 GetExtraLong(self) -> long
4464
5ba5649b
RD
4465 Returns extra information dependant on the event objects type. If the
4466 event comes from a listbox selection, it is a boolean determining
4467 whether the event was a selection (true) or a deselection (false). A
4468 listbox deselection only occurs for multiple-selection boxes, and in
4469 this case the index and string values are indeterminate and the
4470 listbox must be examined by the application.
27fb7603 4471 """
d55e5bfc
RD
4472 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4473
4474 def SetInt(*args, **kwargs):
4475 """SetInt(self, int i)"""
4476 return _core_.CommandEvent_SetInt(*args, **kwargs)
4477
4478 def GetInt(*args, **kwargs):
27fb7603 4479 """
f460c29d 4480 GetInt(self) -> int
27fb7603 4481
5ba5649b
RD
4482 Returns the integer identifier corresponding to a listbox, choice or
4483 radiobox selection (only if the event was a selection, not a
4484 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4485 """
d55e5bfc
RD
4486 return _core_.CommandEvent_GetInt(*args, **kwargs)
4487
554f62e9
RD
4488 def GetClientData(*args, **kwargs):
4489 """
4490 GetClientData(self) -> PyObject
4491
4492 Returns the client data object for a listbox or choice selection event, (if any.)
4493 """
4494 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4495
4496 def SetClientData(*args, **kwargs):
4497 """
4498 SetClientData(self, PyObject clientData)
4499
4500 Associate the given client data with the item at position n.
4501 """
4502 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4503
4504 GetClientObject = GetClientData
4505 SetClientObject = SetClientData
4506
d55e5bfc
RD
4507 def Clone(*args, **kwargs):
4508 """Clone(self) -> Event"""
4509 return _core_.CommandEvent_Clone(*args, **kwargs)
4510
226118fc
RD
4511 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4512 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4513 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4514 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4515 Selection = property(GetSelection,doc="See `GetSelection`")
4516 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
2131d850 4517_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4518
4519#---------------------------------------------------------------------------
4520
4521class NotifyEvent(CommandEvent):
27fb7603
RD
4522 """
4523 An instance of this class (or one of its derived classes) is sent from
4524 a control when the control's state is being changed and the control
4525 allows that change to be prevented from happening. The event handler
4526 can call `Veto` or `Allow` to tell the control what to do.
4527 """
554f62e9
RD
4528 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4529 __repr__ = _swig_repr
4530 def __init__(self, *args, **kwargs):
27fb7603 4531 """
f460c29d 4532 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4533
4534 An instance of this class (or one of its derived classes) is sent from
4535 a control when the control's state is being changed and the control
4536 allows that change to be prevented from happening. The event handler
4537 can call `Veto` or `Allow` to tell the control what to do.
4538 """
554f62e9 4539 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4540 def Veto(*args, **kwargs):
27fb7603
RD
4541 """
4542 Veto(self)
4543
4544 Prevents the change announced by this event from happening.
4545
4546 It is in general a good idea to notify the user about the reasons for
4547 vetoing the change because otherwise the applications behaviour (which
4548 just refuses to do what the user wants) might be quite surprising.
4549 """
d55e5bfc
RD
4550 return _core_.NotifyEvent_Veto(*args, **kwargs)
4551
4552 def Allow(*args, **kwargs):
27fb7603
RD
4553 """
4554 Allow(self)
4555
4556 This is the opposite of `Veto`: it explicitly allows the event to be
4557 processed. For most events it is not necessary to call this method as
4558 the events are allowed anyhow but some are forbidden by default (this
4559 will be mentioned in the corresponding event description).
4560 """
d55e5bfc
RD
4561 return _core_.NotifyEvent_Allow(*args, **kwargs)
4562
4563 def IsAllowed(*args, **kwargs):
27fb7603
RD
4564 """
4565 IsAllowed(self) -> bool
4566
4567 Returns true if the change is allowed (`Veto` hasn't been called) or
4568 false otherwise (if it was).
4569 """
d55e5bfc
RD
4570 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4571
2131d850 4572_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4573
4574#---------------------------------------------------------------------------
4575
4576class ScrollEvent(CommandEvent):
27fb7603
RD
4577 """
4578 A scroll event holds information about events sent from stand-alone
4579 scrollbars and sliders. Note that scrolled windows do not send
cbfc9df6 4580 instances of this event class, but send the `wx.ScrollWinEvent`
27fb7603
RD
4581 instead.
4582 """
554f62e9
RD
4583 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4584 __repr__ = _swig_repr
4585 def __init__(self, *args, **kwargs):
d55e5bfc 4586 """
f460c29d 4587 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
d55e5bfc
RD
4588 int orient=0) -> ScrollEvent
4589 """
554f62e9 4590 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4591 def GetOrientation(*args, **kwargs):
27fb7603
RD
4592 """
4593 GetOrientation(self) -> int
4594
4595 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4596 the scrollbar.
4597 """
d55e5bfc
RD
4598 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4599
4600 def GetPosition(*args, **kwargs):
27fb7603
RD
4601 """
4602 GetPosition(self) -> int
4603
4604 Returns the position of the scrollbar.
4605 """
d55e5bfc
RD
4606 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4607
4608 def SetOrientation(*args, **kwargs):
4609 """SetOrientation(self, int orient)"""
4610 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4611
4612 def SetPosition(*args, **kwargs):
4613 """SetPosition(self, int pos)"""
4614 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4615
33d6fd3b
RD
4616 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4617 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4618_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4619
4620#---------------------------------------------------------------------------
4621
4622class ScrollWinEvent(Event):
27fb7603
RD
4623 """
4624 A wx.ScrollWinEvent holds information about scrolling and is sent from
4625 scrolling windows.
4626 """
554f62e9
RD
4627 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4628 __repr__ = _swig_repr
4629 def __init__(self, *args, **kwargs):
27fb7603 4630 """
f460c29d 4631 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4632
4633 A wx.ScrollWinEvent holds information about scrolling and is sent from
4634 scrolling windows.
4635 """
554f62e9 4636 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4637 def GetOrientation(*args, **kwargs):
27fb7603
RD
4638 """
4639 GetOrientation(self) -> int
4640
4641 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4642 the scrollbar.
4643 """
d55e5bfc
RD
4644 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4645
4646 def GetPosition(*args, **kwargs):
27fb7603
RD
4647 """
4648 GetPosition(self) -> int
4649
4650 Returns the position of the scrollbar for the thumb track and release
4651 events. Note that this field can't be used for the other events, you
4652 need to query the window itself for the current position in that case.
4653 """
d55e5bfc
RD
4654 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4655
4656 def SetOrientation(*args, **kwargs):
4657 """SetOrientation(self, int orient)"""
4658 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4659
4660 def SetPosition(*args, **kwargs):
4661 """SetPosition(self, int pos)"""
4662 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4663
33d6fd3b
RD
4664 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4665 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4666_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4667
4668#---------------------------------------------------------------------------
4669
4670MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4671MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4672MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4673MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4674MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4675class MouseEvent(Event):
27fb7603
RD
4676 """
4677 This event class contains information about the events generated by
4678 the mouse: they include mouse buttons press and release events and
4679 mouse move events.
4680
4681 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4682 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4683 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4684 a middle button so a portable application should avoid relying on the
4685 events from it.
4686
4687 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4688 the former returns true when the event corresponds to the left mouse
4689 button click while the latter returns true if the left mouse button is
4690 currently being pressed. For example, when the user is dragging the
4691 mouse you can use `LeftIsDown` to test whether the left mouse button
4692 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4693 `LeftIsDown` will also return true in wxWidgets whatever the
4694 underlying GUI behaviour is (which is platform-dependent). The same
4695 applies, of course, to other mouse buttons as well.
4696 """
554f62e9
RD
4697 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4698 __repr__ = _swig_repr
4699 def __init__(self, *args, **kwargs):
27fb7603 4700 """
f460c29d 4701 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4702
4703 Constructs a wx.MouseEvent. Valid event types are:
4704
4705 * wxEVT_ENTER_WINDOW
4706 * wxEVT_LEAVE_WINDOW
4707 * wxEVT_LEFT_DOWN
4708 * wxEVT_LEFT_UP
4709 * wxEVT_LEFT_DCLICK
4710 * wxEVT_MIDDLE_DOWN
4711 * wxEVT_MIDDLE_UP
4712 * wxEVT_MIDDLE_DCLICK
4713 * wxEVT_RIGHT_DOWN
4714 * wxEVT_RIGHT_UP
4715 * wxEVT_RIGHT_DCLICK
4716 * wxEVT_MOTION
4717 * wxEVT_MOUSEWHEEL
4718 """
554f62e9 4719 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4720 def IsButton(*args, **kwargs):
27fb7603
RD
4721 """
4722 IsButton(self) -> bool
4723
4724 Returns true if the event was a mouse button event (not necessarily a
4725 button down event - that may be tested using `ButtonDown`).
4726 """
d55e5bfc
RD
4727 return _core_.MouseEvent_IsButton(*args, **kwargs)
4728
4729 def ButtonDown(*args, **kwargs):
27fb7603
RD
4730 """
4731 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4732
5ba5649b
RD
4733 If the argument is omitted, this returns true if the event was any
4734 mouse button down event. Otherwise the argument specifies which
4735 button-down event shold be checked for (see `Button` for the possible
4736 values).
27fb7603 4737 """
d55e5bfc
RD
4738 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4739
4740 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4741 """
4742 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4743
4744 If the argument is omitted, this returns true if the event was any
4745 mouse double click event. Otherwise the argument specifies which
4746 double click event to check for (see `Button` for the possible
4747 values).
4748 """
d55e5bfc
RD
4749 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4750
4751 def ButtonUp(*args, **kwargs):
27fb7603
RD
4752 """
4753 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4754
4755 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4756 mouse button up event. Otherwise the argument specifies which button
4757 up event to check for (see `Button` for the possible values).
27fb7603 4758 """
d55e5bfc
RD
4759 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4760
4761 def Button(*args, **kwargs):
27fb7603
RD
4762 """
4763 Button(self, int button) -> bool
4764
4765 Returns true if the identified mouse button is changing state. Valid
4766 values of button are:
4767
4768 ==================== =====================================
4769 wx.MOUSE_BTN_LEFT check if left button was pressed
4770 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4771 wx.MOUSE_BTN_RIGHT check if right button was pressed
4772 wx.MOUSE_BTN_ANY check if any button was pressed
4773 ==================== =====================================
4774
4775 """
d55e5bfc
RD
4776 return _core_.MouseEvent_Button(*args, **kwargs)
4777
4778 def ButtonIsDown(*args, **kwargs):
4779 """ButtonIsDown(self, int but) -> bool"""
4780 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4781
4782 def GetButton(*args, **kwargs):
27fb7603
RD
4783 """
4784 GetButton(self) -> int
4785
4786 Returns the mouse button which generated this event or
4787 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4788 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4789 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4790 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4791 right buttons respectively.
4792 """
d55e5bfc
RD
4793 return _core_.MouseEvent_GetButton(*args, **kwargs)
4794
4795 def ControlDown(*args, **kwargs):
27fb7603
RD
4796 """
4797 ControlDown(self) -> bool
4798
4799 Returns true if the control key was down at the time of the event.
4800 """
d55e5bfc
RD
4801 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4802
4803 def MetaDown(*args, **kwargs):
27fb7603
RD
4804 """
4805 MetaDown(self) -> bool
4806
4807 Returns true if the Meta key was down at the time of the event.
4808 """
d55e5bfc
RD
4809 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4810
4811 def AltDown(*args, **kwargs):
27fb7603
RD
4812 """
4813 AltDown(self) -> bool
4814
4815 Returns true if the Alt key was down at the time of the event.
4816 """
d55e5bfc
RD
4817 return _core_.MouseEvent_AltDown(*args, **kwargs)
4818
4819 def ShiftDown(*args, **kwargs):
27fb7603
RD
4820 """
4821 ShiftDown(self) -> bool
4822
4823 Returns true if the Shift key was down at the time of the event.
4824 """
d55e5bfc
RD
4825 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4826
412d302d
RD
4827 def CmdDown(*args, **kwargs):
4828 """
4829 CmdDown(self) -> bool
4830
4831 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4832 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4833 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4834 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4835 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4836 purpose. So for non-Mac platforms this is the same as `ControlDown`
4837 and Macs this is the same as `MetaDown`.
4838 """
4839 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4840
d55e5bfc 4841 def LeftDown(*args, **kwargs):
27fb7603
RD
4842 """
4843 LeftDown(self) -> bool
4844
4845 Returns true if the left mouse button state changed to down.
4846 """
d55e5bfc
RD
4847 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4848
4849 def MiddleDown(*args, **kwargs):
27fb7603
RD
4850 """
4851 MiddleDown(self) -> bool
4852
4853 Returns true if the middle mouse button state changed to down.
4854 """
d55e5bfc
RD
4855 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4856
4857 def RightDown(*args, **kwargs):
27fb7603
RD
4858 """
4859 RightDown(self) -> bool
4860
4861 Returns true if the right mouse button state changed to down.
4862 """
d55e5bfc
RD
4863 return _core_.MouseEvent_RightDown(*args, **kwargs)
4864
4865 def LeftUp(*args, **kwargs):
27fb7603
RD
4866 """
4867 LeftUp(self) -> bool
4868
4869 Returns true if the left mouse button state changed to up.
4870 """
d55e5bfc
RD
4871 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4872
4873 def MiddleUp(*args, **kwargs):
27fb7603
RD
4874 """
4875 MiddleUp(self) -> bool
4876
4877 Returns true if the middle mouse button state changed to up.
4878 """
d55e5bfc
RD
4879 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4880
4881 def RightUp(*args, **kwargs):
27fb7603
RD
4882 """
4883 RightUp(self) -> bool
4884
4885 Returns true if the right mouse button state changed to up.
4886 """
d55e5bfc
RD
4887 return _core_.MouseEvent_RightUp(*args, **kwargs)
4888
4889 def LeftDClick(*args, **kwargs):
27fb7603
RD
4890 """
4891 LeftDClick(self) -> bool
4892
4893 Returns true if the event was a left button double click.
4894 """
d55e5bfc
RD
4895 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4896
4897 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4898 """
4899 MiddleDClick(self) -> bool
4900
4901 Returns true if the event was a middle button double click.
4902 """
d55e5bfc
RD
4903 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4904
4905 def RightDClick(*args, **kwargs):
27fb7603
RD
4906 """
4907 RightDClick(self) -> bool
4908
4909 Returns true if the event was a right button double click.
4910 """
d55e5bfc
RD
4911 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4912
4913 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4914 """
4915 LeftIsDown(self) -> bool
4916
4917 Returns true if the left mouse button is currently down, independent
4918 of the current event type.
4919
4920 Please notice that it is not the same as LeftDown which returns true
4921 if the left mouse button was just pressed. Rather, it describes the
4922 state of the mouse button before the event happened.
4923
4924 This event is usually used in the mouse event handlers which process
4925 "move mouse" messages to determine whether the user is (still)
4926 dragging the mouse.
4927 """
d55e5bfc
RD
4928 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4929
4930 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4931 """
4932 MiddleIsDown(self) -> bool
4933
4934 Returns true if the middle mouse button is currently down, independent
4935 of the current event type.
4936 """
d55e5bfc
RD
4937 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4938
4939 def RightIsDown(*args, **kwargs):
27fb7603
RD
4940 """
4941 RightIsDown(self) -> bool
4942
4943 Returns true if the right mouse button is currently down, independent
4944 of the current event type.
4945 """
d55e5bfc
RD
4946 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4947
4948 def Dragging(*args, **kwargs):
27fb7603
RD
4949 """
4950 Dragging(self) -> bool
4951
4952 Returns true if this was a dragging event (motion while a button is
4953 depressed).
4954 """
d55e5bfc
RD
4955 return _core_.MouseEvent_Dragging(*args, **kwargs)
4956
4957 def Moving(*args, **kwargs):
27fb7603
RD
4958 """
4959 Moving(self) -> bool
4960
4961 Returns true if this was a motion event and no mouse buttons were
4962 pressed. If any mouse button is held pressed, then this method returns
4963 false and Dragging returns true.
4964 """
d55e5bfc
RD
4965 return _core_.MouseEvent_Moving(*args, **kwargs)
4966
4967 def Entering(*args, **kwargs):
27fb7603
RD
4968 """
4969 Entering(self) -> bool
4970
4971 Returns true if the mouse was entering the window.
4972 """
d55e5bfc
RD
4973 return _core_.MouseEvent_Entering(*args, **kwargs)
4974
4975 def Leaving(*args, **kwargs):
27fb7603
RD
4976 """
4977 Leaving(self) -> bool
4978
4979 Returns true if the mouse was leaving the window.
4980 """
d55e5bfc
RD
4981 return _core_.MouseEvent_Leaving(*args, **kwargs)
4982
4983 def GetPosition(*args, **kwargs):
4984 """
4985 GetPosition(self) -> Point
4986
27fb7603
RD
4987 Returns the pixel position of the mouse in window coordinates when the
4988 event happened.
d55e5bfc
RD
4989 """
4990 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4991
4992 def GetPositionTuple(*args, **kwargs):
4993 """
4994 GetPositionTuple() -> (x,y)
4995
27fb7603
RD
4996 Returns the pixel position of the mouse in window coordinates when the
4997 event happened.
d55e5bfc
RD
4998 """
4999 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
5000
5001 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
5002 """
5003 GetLogicalPosition(self, DC dc) -> Point
5004
5005 Returns the logical mouse position in pixels (i.e. translated
5006 according to the translation set for the DC, which usually indicates
5007 that the window has been scrolled).
5008 """
d55e5bfc
RD
5009 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
5010
5011 def GetX(*args, **kwargs):
27fb7603
RD
5012 """
5013 GetX(self) -> int
5014
5015 Returns X coordinate of the physical mouse event position.
5016 """
d55e5bfc
RD
5017 return _core_.MouseEvent_GetX(*args, **kwargs)
5018
5019 def GetY(*args, **kwargs):
27fb7603
RD
5020 """
5021 GetY(self) -> int
5022
5023 Returns Y coordinate of the physical mouse event position.
5024 """
d55e5bfc
RD
5025 return _core_.MouseEvent_GetY(*args, **kwargs)
5026
5027 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
5028 """
5029 GetWheelRotation(self) -> int
5030
5031 Get wheel rotation, positive or negative indicates direction of
5032 rotation. Current devices all send an event when rotation is equal to
5033 +/-WheelDelta, but this allows for finer resolution devices to be
5034 created in the future. Because of this you shouldn't assume that one
5035 event is equal to 1 line or whatever, but you should be able to either
5036 do partial line scrolling or wait until +/-WheelDelta rotation values
5037 have been accumulated before scrolling.
5038 """
d55e5bfc
RD
5039 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
5040
5041 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
5042 """
5043 GetWheelDelta(self) -> int
5044
5045 Get wheel delta, normally 120. This is the threshold for action to be
5046 taken, and one such action (for example, scrolling one increment)
5047 should occur for each delta.
5048 """
d55e5bfc
RD
5049 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
5050
4976f996
RD
5051 def GetWheelAxis(*args, **kwargs):
5052 """
5053 GetWheelAxis(self) -> int
5054
5055 Gets the axis the wheel operation concerns, 0 being the y axis as on
5056 most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
5057 or horizontal trackpad scrolling.
5058 """
5059 return _core_.MouseEvent_GetWheelAxis(*args, **kwargs)
5060
d55e5bfc 5061 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
5062 """
5063 GetLinesPerAction(self) -> int
5064
5065 Returns the configured number of lines (or whatever) to be scrolled
5066 per wheel action. Defaults to three.
5067 """
d55e5bfc
RD
5068 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
5069
5070 def IsPageScroll(*args, **kwargs):
27fb7603
RD
5071 """
5072 IsPageScroll(self) -> bool
5073
5074 Returns true if the system has been setup to do page scrolling with
5075 the mouse wheel instead of line scrolling.
5076 """
d55e5bfc
RD
5077 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
5078
5079 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
5080 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
5081 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
5082 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
5083 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
5084 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
5085 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
5086 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
5087 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
5088 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
5089 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
5090 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
57332a5a
RD
5091 Button = property(GetButton,doc="See `GetButton`")
5092 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
5093 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
5094 Position = property(GetPosition,doc="See `GetPosition`")
5095 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
5096 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
5097 X = property(GetX,doc="See `GetX`")
5098 Y = property(GetY,doc="See `GetY`")
2131d850 5099_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
5100
5101#---------------------------------------------------------------------------
5102
5103class SetCursorEvent(Event):
5ba5649b
RD
5104 """
5105 A SetCursorEvent is generated when the mouse cursor is about to be set
5106 as a result of mouse motion. This event gives the application the
5107 chance to perform specific mouse cursor processing based on the
5108 current position of the mouse within the window. Use the `SetCursor`
5109 method to specify the cursor you want to be displayed.
5110 """
554f62e9
RD
5111 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5112 __repr__ = _swig_repr
5113 def __init__(self, *args, **kwargs):
5ba5649b
RD
5114 """
5115 __init__(self, int x=0, int y=0) -> SetCursorEvent
5116
5117 Construct a new `wx.SetCursorEvent`.
5118 """
554f62e9 5119 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 5120 def GetX(*args, **kwargs):
5ba5649b
RD
5121 """
5122 GetX(self) -> int
5123
5124 Returns the X coordinate of the mouse in client coordinates.
5125 """
d55e5bfc
RD
5126 return _core_.SetCursorEvent_GetX(*args, **kwargs)
5127
5128 def GetY(*args, **kwargs):
5ba5649b
RD
5129 """
5130 GetY(self) -> int
5131
5132 Returns the Y coordinate of the mouse in client coordinates.
5133 """
d55e5bfc
RD
5134 return _core_.SetCursorEvent_GetY(*args, **kwargs)
5135
5136 def SetCursor(*args, **kwargs):
5ba5649b
RD
5137 """
5138 SetCursor(self, Cursor cursor)
5139
5140 Sets the cursor associated with this event.
5141 """
d55e5bfc
RD
5142 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
5143
5144 def GetCursor(*args, **kwargs):
5ba5649b
RD
5145 """
5146 GetCursor(self) -> Cursor
5147
5148 Returns a reference to the cursor specified by this event.
5149 """
d55e5bfc
RD
5150 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
5151
5152 def HasCursor(*args, **kwargs):
5ba5649b
RD
5153 """
5154 HasCursor(self) -> bool
5155
5156 Returns true if the cursor specified by this event is a valid cursor.
5157 """
d55e5bfc
RD
5158 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
5159
33d6fd3b
RD
5160 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
5161 X = property(GetX,doc="See `GetX`")
5162 Y = property(GetY,doc="See `GetY`")
2131d850 5163_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
5164
5165#---------------------------------------------------------------------------
5166
5167class KeyEvent(Event):
5ba5649b
RD
5168 """
5169 This event class contains information about keypress and character
5170 events. These events are only sent to the widget that currently has
5171 the keyboard focus.
5172
5173 Notice that there are three different kinds of keyboard events in
5174 wxWidgets: key down and up events and char events. The difference
5175 between the first two is clear - the first corresponds to a key press
5176 and the second to a key release - otherwise they are identical. Just
5177 note that if the key is maintained in a pressed state you will
5178 typically get a lot of (automatically generated) down events but only
5179 one up so it is wrong to assume that there is one up event
5180 corresponding to each down one.
5181
5182 Both key events provide untranslated key codes while the char event
5183 carries the translated one. The untranslated code for alphanumeric
5184 keys is always an upper case value. For the other keys it is one of
5185 WXK_XXX values from the keycodes table. The translated key is, in
5186 general, the character the user expects to appear as the result of the
5187 key combination when typing the text into a text entry zone, for
5188 example.
5189
5190 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5191 and the standard US keyboard): when the 'A' key is pressed, the key
5192 down event key code is equal to ASCII A == 65. But the char event key
5193 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5194 'A' keys simultaneously , the key code in key down event will still be
5195 just 'A' while the char event key code parameter will now be 'A' as
5196 well.
5197
5198 Although in this simple case it is clear that the correct key code
5199 could be found in the key down event handler by checking the value
5200 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5201 as for non alphanumeric keys or non-US keyboard layouts the
5202 translation is keyboard-layout dependent and can only be done properly
5203 by the system itself.
5204
5205 Another kind of translation is done when the control key is pressed:
5206 for example, for CTRL-A key press the key down event still carries the
5207 same key code 'A' as usual but the char event will have key code of 1,
5208 the ASCII value of this key combination.
5209
5210 You may discover how the other keys on your system behave
5211 interactively by running the KeyEvents sample in the wxPython demo and
5212 pressing some keys while the blue box at the top has the keyboard
5213 focus.
5214
5215 **Note**: If a key down event is caught and the event handler does not
5216 call event.Skip() then the coresponding char event will not
5217 happen. This is by design and enables the programs that handle both
5218 types of events to be a bit simpler.
5219
5220 **Note for Windows programmers**: The key and char events in wxWidgets
5221 are similar to but slightly different from Windows WM_KEYDOWN and
5222 WM_CHAR events. In particular, Alt-x combination will generate a char
5223 event in wxWidgets (unless it is used as an accelerator).
5224
5225 **Tip**: be sure to call event.Skip() for events that you don't
5226 process in key event function, otherwise menu shortcuts may cease to
5227 work under Windows.
5228
5229 """
554f62e9
RD
5230 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5231 __repr__ = _swig_repr
5232 def __init__(self, *args, **kwargs):
5ba5649b 5233 """
f460c29d 5234 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
5235
5236 Construct a new `wx.KeyEvent`. Valid event types are:
5237 *
5238 """
554f62e9 5239 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
5240 def GetModifiers(*args, **kwargs):
5241 """
5242 GetModifiers(self) -> int
5243
5244 Returns a bitmask of the current modifier settings. Can be used to
5245 check if the key event has exactly the given modifiers without having
5246 to explicitly check that the other modifiers are not down. For
5247 example::
5248
5249 if event.GetModifers() == wx.MOD_CONTROL:
5250 DoSomething()
5251
5252 """
5253 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
5254
d55e5bfc 5255 def ControlDown(*args, **kwargs):
5ba5649b
RD
5256 """
5257 ControlDown(self) -> bool
5258
5259 Returns ``True`` if the Control key was down at the time of the event.
5260 """
d55e5bfc
RD
5261 return _core_.KeyEvent_ControlDown(*args, **kwargs)
5262
5263 def MetaDown(*args, **kwargs):
5ba5649b
RD
5264 """
5265 MetaDown(self) -> bool
5266
5267 Returns ``True`` if the Meta key was down at the time of the event.
5268 """
d55e5bfc
RD
5269 return _core_.KeyEvent_MetaDown(*args, **kwargs)
5270
5271 def AltDown(*args, **kwargs):
5ba5649b
RD
5272 """
5273 AltDown(self) -> bool
5274
5275 Returns ``True`` if the Alt key was down at the time of the event.
5276 """
d55e5bfc
RD
5277 return _core_.KeyEvent_AltDown(*args, **kwargs)
5278
5279 def ShiftDown(*args, **kwargs):
5ba5649b
RD
5280 """
5281 ShiftDown(self) -> bool
5282
5283 Returns ``True`` if the Shift key was down at the time of the event.
5284 """
d55e5bfc
RD
5285 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
5286
412d302d
RD
5287 def CmdDown(*args, **kwargs):
5288 """
5289 CmdDown(self) -> bool
5290
5291 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5292 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5293 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5294 because Cmd key is used for the same thing under Mac as Ctrl
5295 elsewhere. The Ctrl still exists, it's just not used for this
5296 purpose. So for non-Mac platforms this is the same as `ControlDown`
5297 and Macs this is the same as `MetaDown`.
5298 """
5299 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5300
d55e5bfc 5301 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5302 """
5303 HasModifiers(self) -> bool
5304
5305 Returns true if either CTRL or ALT keys was down at the time of the
5306 key event. Note that this function does not take into account neither
5307 SHIFT nor META key states (the reason for ignoring the latter is that
5308 it is common for NUMLOCK key to be configured as META under X but the
5309 key presses even while NUMLOCK is on should be still processed
5310 normally).
5311 """
d55e5bfc
RD
5312 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
5313
5314 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5315 """
5316 GetKeyCode(self) -> int
5317
5318 Returns the virtual key code. ASCII events return normal ASCII values,
5319 while non-ASCII events return values such as WXK_LEFT for the left
5320 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5321 codes.
5322
5323 Note that in Unicode build, the returned value is meaningful only if
5324 the user entered a character that can be represented in current
5325 locale's default charset. You can obtain the corresponding Unicode
5326 character using `GetUnicodeKey`.
5327 """
d55e5bfc
RD
5328 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
5329
19272049 5330 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5331 """
5332 GetUnicodeKey(self) -> int
5333
5334 Returns the Unicode character corresponding to this key event. This
5335 function is only meaningfule in a Unicode build of wxPython.
5336 """
19272049 5337 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 5338
19272049 5339 GetUniChar = GetUnicodeKey
b850e7f3
RD
5340 def SetUnicodeKey(*args, **kwargs):
5341 """
5342 SetUnicodeKey(self, int uniChar)
5343
5344 Set the Unicode value of the key event, but only if this is a Unicode
5345 build of wxPython.
5346 """
5347 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5348
d55e5bfc 5349 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5350 """
5351 GetRawKeyCode(self) -> unsigned int
5352
5353 Returns the raw key code for this event. This is a platform-dependent
5354 scan code which should only be used in advanced
5355 applications. Currently the raw key codes are not supported by all
5356 ports.
5357 """
d55e5bfc
RD
5358 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
5359
5360 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5361 """
5362 GetRawKeyFlags(self) -> unsigned int
5363
5364 Returns the low level key flags for this event. The flags are
5365 platform-dependent and should only be used in advanced applications.
5366 Currently the raw key flags are not supported by all ports.
5367 """
d55e5bfc
RD
5368 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
5369
5370 def GetPosition(*args, **kwargs):
5371 """
5372 GetPosition(self) -> Point
5373
5ba5649b 5374 Find the position of the event, if applicable.
d55e5bfc
RD
5375 """
5376 return _core_.KeyEvent_GetPosition(*args, **kwargs)
5377
5378 def GetPositionTuple(*args, **kwargs):
5379 """
5380 GetPositionTuple() -> (x,y)
5381
5ba5649b 5382 Find the position of the event, if applicable.
d55e5bfc
RD
5383 """
5384 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
5385
5386 def GetX(*args, **kwargs):
5ba5649b
RD
5387 """
5388 GetX(self) -> int
5389
5390 Returns the X position (in client coordinates) of the event, if
5391 applicable.
5392 """
d55e5bfc
RD
5393 return _core_.KeyEvent_GetX(*args, **kwargs)
5394
5395 def GetY(*args, **kwargs):
5ba5649b
RD
5396 """
5397 GetY(self) -> int
5398
5399 Returns the Y position (in client coordinates) of the event, if
5400 applicable.
5401 """
d55e5bfc
RD
5402 return _core_.KeyEvent_GetY(*args, **kwargs)
5403
5404 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5405 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5406 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5407 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5408 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5409 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5410 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5411 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5412 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5413 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
97ab0f6a
RD
5414 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5415 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5416 Position = property(GetPosition,doc="See `GetPosition`")
5417 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5418 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5419 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5420 X = property(GetX,doc="See `GetX`")
5421 Y = property(GetY,doc="See `GetY`")
2131d850 5422_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
5423
5424#---------------------------------------------------------------------------
5425
5426class SizeEvent(Event):
5ba5649b
RD
5427 """
5428 A size event holds information about size change events. The EVT_SIZE
5429 handler function will be called when the window it is bound to has
5430 been resized.
5431
5432 Note that the size passed is of the whole window: call
5433 `wx.Window.GetClientSize` for the area which may be used by the
5434 application.
5435
5436 When a window is resized, usually only a small part of the window is
5437 damaged and and that area is all that is in the update region for the
5438 next paint event. However, if your drawing depends on the size of the
5439 window, you may need to clear the DC explicitly and repaint the whole
5440 window. In which case, you may need to call `wx.Window.Refresh` to
5441 invalidate the entire window.
5442
5443 """
554f62e9
RD
5444 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5445 __repr__ = _swig_repr
5446 def __init__(self, *args, **kwargs):
5ba5649b
RD
5447 """
5448 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5449
5450 Construct a new ``wx.SizeEvent``.
5451 """
554f62e9 5452 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 5453 def GetSize(*args, **kwargs):
5ba5649b
RD
5454 """
5455 GetSize(self) -> Size
5456
5457 Returns the entire size of the window generating the size change
5458 event.
5459 """
d55e5bfc
RD
5460 return _core_.SizeEvent_GetSize(*args, **kwargs)
5461
5462 def GetRect(*args, **kwargs):
5463 """GetRect(self) -> Rect"""
5464 return _core_.SizeEvent_GetRect(*args, **kwargs)
5465
5466 def SetRect(*args, **kwargs):
5467 """SetRect(self, Rect rect)"""
5468 return _core_.SizeEvent_SetRect(*args, **kwargs)
5469
5470 def SetSize(*args, **kwargs):
5471 """SetSize(self, Size size)"""
5472 return _core_.SizeEvent_SetSize(*args, **kwargs)
5473
5474 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5475 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
33d6fd3b
RD
5476 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5477 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
2131d850 5478_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
5479
5480#---------------------------------------------------------------------------
5481
5482class MoveEvent(Event):
5ba5649b
RD
5483 """
5484 This event object is sent for EVT_MOVE event bindings when a window is
5485 moved to a new position.
5486 """
554f62e9
RD
5487 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5488 __repr__ = _swig_repr
5489 def __init__(self, *args, **kwargs):
5ba5649b
RD
5490 """
5491 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5492
5493 Constructor.
5494 """
554f62e9 5495 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 5496 def GetPosition(*args, **kwargs):
5ba5649b
RD
5497 """
5498 GetPosition(self) -> Point
5499
5500 Returns the position of the window generating the move change event.
5501 """
d55e5bfc
RD
5502 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5503
5504 def GetRect(*args, **kwargs):
5505 """GetRect(self) -> Rect"""
5506 return _core_.MoveEvent_GetRect(*args, **kwargs)
5507
5508 def SetRect(*args, **kwargs):
5509 """SetRect(self, Rect rect)"""
5510 return _core_.MoveEvent_SetRect(*args, **kwargs)
5511
5512 def SetPosition(*args, **kwargs):
5513 """SetPosition(self, Point pos)"""
5514 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5515
fef4c27a
RD
5516 m_pos = property(GetPosition, SetPosition)
5517 m_rect = property(GetRect, SetRect)
5518
57332a5a
RD
5519 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5520 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
2131d850 5521_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
5522
5523#---------------------------------------------------------------------------
5524
5525class PaintEvent(Event):
5ba5649b
RD
5526 """
5527 A paint event is sent when a window's contents needs to be repainted.
5528 Note that in an EVT_PAINT handler the application must *always* create
5529 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5530 Windows assumes that the window has not been painted yet and will send
5531 the event again, causing endless refreshes.
5532
5533 You can optimize painting by retrieving the rectangles that have been
5534 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5535 and only repainting these rectangles. The rectangles are in terms of
5536 the client area, and are unscrolled, so you will need to do some
5537 calculations using the current view position to obtain logical,
5538 scrolled units.
5539
5540 """
554f62e9
RD
5541 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5542 __repr__ = _swig_repr
5543 def __init__(self, *args, **kwargs):
d55e5bfc 5544 """__init__(self, int Id=0) -> PaintEvent"""
554f62e9 5545 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5546_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc
RD
5547
5548class NcPaintEvent(Event):
093d3ff1 5549 """Proxy of C++ NcPaintEvent class"""
554f62e9
RD
5550 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5551 __repr__ = _swig_repr
5552 def __init__(self, *args, **kwargs):
d55e5bfc 5553 """__init__(self, int winid=0) -> NcPaintEvent"""
554f62e9 5554 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5555_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5556
5557#---------------------------------------------------------------------------
5558
5559class EraseEvent(Event):
5ba5649b
RD
5560 """
5561 An erase event is sent whenever the background of a window needs to be
5562 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5563 binder. On some platforms, such as GTK+, this event is simulated
5564 (simply generated just before the paint event) and may cause flicker.
5565
5566 To paint a custom background use the `GetDC` method and use the returned
5567 device context if it is not ``None``, otherwise create a temporary
5568 `wx.ClientDC` and draw on that.
5569
5570 """
554f62e9
RD
5571 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5572 __repr__ = _swig_repr
5573 def __init__(self, *args, **kwargs):
5ba5649b
RD
5574 """
5575 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5576
5577 Constructor
5578 """
554f62e9 5579 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5580 def GetDC(*args, **kwargs):
5ba5649b
RD
5581 """
5582 GetDC(self) -> DC
5583
5584 Returns the device context the event handler should draw upon. If
5585 ``None`` is returned then create a temporary `wx.ClientDC` and use
5586 that instead.
5587 """
d55e5bfc
RD
5588 return _core_.EraseEvent_GetDC(*args, **kwargs)
5589
97ab0f6a 5590 DC = property(GetDC,doc="See `GetDC`")
2131d850 5591_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5592
5593#---------------------------------------------------------------------------
5594
5595class FocusEvent(Event):
5ba5649b
RD
5596 """
5597 A focus event is sent when a window's focus changes. The window losing
5598 focus receives an EVT_KILL_FOCUS event while the window gaining it
5599 gets an EVT_SET_FOCUS event.
5600
5601 Notice that the set focus event happens both when the user gives focus
5602 to the window (whether using the mouse or keyboard) and when it is
5603 done from the program itself using `wx.Window.SetFocus`.
5604
5605 """
554f62e9
RD
5606 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5607 __repr__ = _swig_repr
5608 def __init__(self, *args, **kwargs):
5ba5649b 5609 """
f460c29d 5610 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5611
5612 Constructor
5613 """
554f62e9 5614 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5615 def GetWindow(*args, **kwargs):
5ba5649b
RD
5616 """
5617 GetWindow(self) -> Window
5618
5619 Returns the other window associated with this event, that is the
5620 window which had the focus before for the EVT_SET_FOCUS event and the
5621 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5622
5623 Warning: the window returned may be None!
5624 """
d55e5bfc
RD
5625 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5626
5627 def SetWindow(*args, **kwargs):
5628 """SetWindow(self, Window win)"""
5629 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5630
97ab0f6a 5631 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 5632_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5633
5634#---------------------------------------------------------------------------
5635
5636class ChildFocusEvent(CommandEvent):
5ba5649b 5637 """
33d6fd3b
RD
5638 A child focus event is sent to a (parent-)window when one of its child
5639 windows gains focus, so that the window could restore the focus back
5640 to its corresponding child if it loses it now and regains later.
5641
5642 Notice that child window is the direct child of the window receiving
5643 the event, and so may not be the actual widget recieving focus if it
5644 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5645 to get the widget that is actually receiving focus.
5ba5649b 5646 """
554f62e9
RD
5647 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5648 __repr__ = _swig_repr
5649 def __init__(self, *args, **kwargs):
5ba5649b
RD
5650 """
5651 __init__(self, Window win=None) -> ChildFocusEvent
5652
5653 Constructor
5654 """
554f62e9 5655 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5656 def GetWindow(*args, **kwargs):
5ba5649b
RD
5657 """
5658 GetWindow(self) -> Window
5659
33d6fd3b
RD
5660 The window, or (grand)parent of the window which has just received the
5661 focus.
5ba5649b 5662 """
d55e5bfc
RD
5663 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5664
226118fc 5665 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 5666_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5667
5668#---------------------------------------------------------------------------
5669
5670class ActivateEvent(Event):
5ba5649b
RD
5671 """
5672 An activate event is sent when a top-level window or the entire
5673 application is being activated or deactivated.
5674
5675 A top-level window (a dialog or frame) receives an activate event when
5676 is being activated or deactivated. This is indicated visually by the
5677 title bar changing colour, and a subwindow gaining the keyboard focus.
5678 An application is activated or deactivated when one of its frames
5679 becomes activated, or a frame becomes inactivate resulting in all
5680 application frames being inactive.
5681
5682 Please note that usually you should call event.Skip() in your handlers
5683 for these events so the default handlers will still be called, as not
5684 doing so can result in strange effects.
5685
5686 """
554f62e9
RD
5687 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5688 __repr__ = _swig_repr
5689 def __init__(self, *args, **kwargs):
5ba5649b 5690 """
f460c29d 5691 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5692
5693 Constructor
5694 """
554f62e9 5695 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5696 def GetActive(*args, **kwargs):
5ba5649b
RD
5697 """
5698 GetActive(self) -> bool
5699
5700 Returns true if the application or window is being activated, false
5701 otherwise.
5702 """
d55e5bfc
RD
5703 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5704
226118fc 5705 Active = property(GetActive,doc="See `GetActive`")
2131d850 5706_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5707
5708#---------------------------------------------------------------------------
5709
5710class InitDialogEvent(Event):
5ba5649b
RD
5711 """
5712 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5713 any window when `wx.Window.InitDialog` is called. Handlers for this
5714 event can transfer data to the window, or anything else that should be
5715 done before the user begins editing the form. The default handler
5716 calls `wx.Window.TransferDataToWindow`.
5717 """
554f62e9
RD
5718 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5719 __repr__ = _swig_repr
5720 def __init__(self, *args, **kwargs):
5ba5649b
RD
5721 """
5722 __init__(self, int Id=0) -> InitDialogEvent
5723
5724 Constructor
5725 """
554f62e9 5726 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5727_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5728
5729#---------------------------------------------------------------------------
5730
5731class MenuEvent(Event):
5ba5649b
RD
5732 """
5733 This class is used for a variety of menu-related events. Note that
5734 these do not include menu command events, which are handled by sending
5735 `wx.CommandEvent` objects.
5736
5737 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5738 text in the first field of the status bar.
5739 """
554f62e9
RD
5740 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5741 __repr__ = _swig_repr
5742 def __init__(self, *args, **kwargs):
5ba5649b 5743 """
f460c29d 5744 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5745
5746 Constructor
5747 """
554f62e9 5748 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5749 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5750 """
5751 GetMenuId(self) -> int
5752
5753 Returns the menu identifier associated with the event. This method
5754 should be only used with the HIGHLIGHT events.
5755 """
d55e5bfc
RD
5756 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5757
5758 def IsPopup(*args, **kwargs):
5ba5649b
RD
5759 """
5760 IsPopup(self) -> bool
5761
5762 Returns ``True`` if the menu which is being opened or closed is a
5763 popup menu, ``False`` if it is a normal one. This method should only
5764 be used with the OPEN and CLOSE events.
5765 """
d55e5bfc
RD
5766 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5767
5768 def GetMenu(*args, **kwargs):
5ba5649b
RD
5769 """
5770 GetMenu(self) -> Menu
5771
5772 Returns the menu which is being opened or closed. This method should
5773 only be used with the OPEN and CLOSE events.
5774 """
d55e5bfc
RD
5775 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5776
57332a5a
RD
5777 Menu = property(GetMenu,doc="See `GetMenu`")
5778 MenuId = property(GetMenuId,doc="See `GetMenuId`")
2131d850 5779_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5780
5781#---------------------------------------------------------------------------
5782
5783class CloseEvent(Event):
5ba5649b
RD
5784 """
5785 This event class contains information about window and session close
5786 events.
5787
5788 The handler function for EVT_CLOSE is called when the user has tried
5789 to close a a frame or dialog box using the window manager controls or
5790 the system menu. It can also be invoked by the application itself
5791 programmatically, for example by calling the `wx.Window.Close`
5792 function.
5793
5794 You should check whether the application is forcing the deletion of
5795 the window using `CanVeto`. If it returns ``False``, you must destroy
5796 the window using `wx.Window.Destroy`. If the return value is ``True``,
5797 it is up to you whether you respond by destroying the window or not.
5798 For example you may wish to display a message dialog prompting to save
5799 files or to cancel the close.
5800
5801 If you don't destroy the window, you should call `Veto` to let the
5802 calling code know that you did not destroy the window. This allows the
5803 `wx.Window.Close` function to return ``True`` or ``False`` depending
5804 on whether the close instruction was honored or not.
5805 """
554f62e9
RD
5806 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5807 __repr__ = _swig_repr
5808 def __init__(self, *args, **kwargs):
5ba5649b 5809 """
f460c29d 5810 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5811
5812 Constructor.
5813 """
554f62e9 5814 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5815 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5816 """
5817 SetLoggingOff(self, bool logOff)
5818
5819 Sets the 'logging off' flag.
5820 """
d55e5bfc
RD
5821 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5822
5823 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5824 """
5825 GetLoggingOff(self) -> bool
5826
034e3677
RD
5827 Returns ``True`` if the user is logging off or ``False`` if the
5828 system is shutting down. This method can only be called for end
5829 session and query end session events, it doesn't make sense for close
5830 window event.
5ba5649b 5831 """
d55e5bfc
RD
5832 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5833
5834 def Veto(*args, **kwargs):
5ba5649b
RD
5835 """
5836 Veto(self, bool veto=True)
5837
5838 Call this from your event handler to veto a system shutdown or to
5839 signal to the calling application that a window close did not happen.
5840
5841 You can only veto a shutdown or close if `CanVeto` returns true.
5842 """
d55e5bfc
RD
5843 return _core_.CloseEvent_Veto(*args, **kwargs)
5844
5ba5649b
RD
5845 def GetVeto(*args, **kwargs):
5846 """GetVeto(self) -> bool"""
5847 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5848
d55e5bfc 5849 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5850 """
5851 SetCanVeto(self, bool canVeto)
5852
5853 Sets the 'can veto' flag.
5854 """
d55e5bfc
RD
5855 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5856
5857 def CanVeto(*args, **kwargs):
5ba5649b
RD
5858 """
5859 CanVeto(self) -> bool
d55e5bfc 5860
5ba5649b
RD
5861 Returns true if you can veto a system shutdown or a window close
5862 event. Vetoing a window close event is not possible if the calling
5863 code wishes to force the application to exit, and so this function
5864 must be called to check this.
5865 """
5866 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5867
226118fc 5868 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
2131d850 5869_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5870
5871#---------------------------------------------------------------------------
5872
5873class ShowEvent(Event):
5ba5649b 5874 """An EVT_SHOW event is sent when a window is shown or hidden."""
554f62e9
RD
5875 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5876 __repr__ = _swig_repr
5877 def __init__(self, *args, **kwargs):
5ba5649b
RD
5878 """
5879 __init__(self, int winid=0, bool show=False) -> ShowEvent
5880
5881 An EVT_SHOW event is sent when a window is shown or hidden.
5882 """
554f62e9 5883 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5884 def SetShow(*args, **kwargs):
5885 """SetShow(self, bool show)"""
5886 return _core_.ShowEvent_SetShow(*args, **kwargs)
5887
5888 def GetShow(*args, **kwargs):
5889 """GetShow(self) -> bool"""
5890 return _core_.ShowEvent_GetShow(*args, **kwargs)
5891
33d6fd3b 5892 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
2131d850 5893_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5894
5895#---------------------------------------------------------------------------
5896
5897class IconizeEvent(Event):
5ba5649b
RD
5898 """
5899 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5900 restored.
5901 """
554f62e9
RD
5902 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5903 __repr__ = _swig_repr
5904 def __init__(self, *args, **kwargs):
5ba5649b
RD
5905 """
5906 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5907
5908 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5909 restored.
5910 """
554f62e9 5911 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5912 def Iconized(*args, **kwargs):
5ba5649b
RD
5913 """
5914 Iconized(self) -> bool
5915
5916 Returns ``True`` if the frame has been iconized, ``False`` if it has
5917 been restored.
5918 """
d55e5bfc
RD
5919 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5920
2131d850 5921_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5922
5923#---------------------------------------------------------------------------
5924
5925class MaximizeEvent(Event):
5ba5649b 5926 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
554f62e9
RD
5927 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5928 __repr__ = _swig_repr
5929 def __init__(self, *args, **kwargs):
5ba5649b
RD
5930 """
5931 __init__(self, int id=0) -> MaximizeEvent
5932
5933 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5934 """
554f62e9 5935 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5936_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5937
5938#---------------------------------------------------------------------------
5939
5940class DropFilesEvent(Event):
5ba5649b
RD
5941 """
5942 This class is used for drop files events, that is, when files have
5943 been dropped onto the window. This functionality is only available
5944 under Windows. The window must have previously been enabled for
5945 dropping by calling `wx.Window.DragAcceptFiles`.
5946
5947 Important note: this is a separate implementation to the more general
5948 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5949 implementation uses the older, Windows message-based approach of
5950 dropping files.
5951
5952 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5953 events.
5954
5955 """
554f62e9
RD
5956 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5957 def __init__(self): raise AttributeError, "No constructor defined"
5958 __repr__ = _swig_repr
d55e5bfc 5959 def GetPosition(*args, **kwargs):
5ba5649b
RD
5960 """
5961 GetPosition(self) -> Point
5962
5963 Returns the position at which the files were dropped.
5964 """
d55e5bfc
RD
5965 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5966
5967 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5968 """
5969 GetNumberOfFiles(self) -> int
5970
5971 Returns the number of files dropped.
5972 """
d55e5bfc
RD
5973 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5974
5975 def GetFiles(*args, **kwargs):
5ba5649b
RD
5976 """
5977 GetFiles(self) -> PyObject
5978
5979 Returns a list of the filenames that were dropped.
5980 """
d55e5bfc
RD
5981 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5982
226118fc
RD
5983 Files = property(GetFiles,doc="See `GetFiles`")
5984 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5985 Position = property(GetPosition,doc="See `GetPosition`")
2131d850 5986_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5987
5988#---------------------------------------------------------------------------
5989
5990UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5991UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5992class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5993 """
5994 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5995 wxWidgets to give an application the chance to update various user
5996 interface elements.
5997
5998 Without update UI events, an application has to work hard to
5999 check/uncheck, enable/disable, and set the text for elements such as
6000 menu items and toolbar buttons. The code for doing this has to be
6001 mixed up with the code that is invoked when an action is invoked for a
6002 menu item or button.
6003
6004 With update UI events, you define an event handler to look at the
6005 state of the application and change UI elements accordingly. wxWidgets
6006 will call your handler functions in idle time, so you don't have to
6007 worry where to call this code. In addition to being a clearer and more
6008 declarative method, it also means you don't have to worry whether
6009 you're updating a toolbar or menubar identifier. The same handler can
6010 update a menu item and toolbar button, if the ID values are the same.
6011
6012 Instead of directly manipulating the menu or button, you call
6013 functions in the event object, such as `Check`. wxWidgets will
6014 determine whether such a call has been made, and which UI element to
6015 update.
6016
6017 These events will work for popup menus as well as menubars. Just
6018 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
6019 any UI events for the window that owns the menu.
6020
6021 If you find that the overhead of UI update processing is affecting
6022 your application, you can do one or both of the following:
6023
6024 1. Call `wx.UpdateUIEvent.SetMode` with a value of
6025 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
6026 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
6027 receive update events. No other windows will receive update
6028 events.
6029
6030 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6031 value to set the delay between updates. You may need to call
6032 `wx.Window.UpdateWindowUI` at critical points, for example when
6033 a dialog is about to be shown, in case the user sees a slight
6034 delay before windows are updated.
6035
6036 Note that although events are sent in idle time, defining a EVT_IDLE
6037 handler for a window does not affect this because the events are sent
6038 from an internal idle handler.
6039
6040 wxWidgets tries to optimize update events on some platforms. On
6041 Windows and GTK+, events for menubar items are only sent when the menu
6042 is about to be shown, and not in idle time.
6043
6044 """
554f62e9
RD
6045 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6046 __repr__ = _swig_repr
6047 def __init__(self, *args, **kwargs):
5ba5649b
RD
6048 """
6049 __init__(self, int commandId=0) -> UpdateUIEvent
6050
6051 Constructor
6052 """
554f62e9 6053 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 6054 def GetChecked(*args, **kwargs):
5ba5649b
RD
6055 """
6056 GetChecked(self) -> bool
6057
6058 Returns ``True`` if the UI element should be checked.
6059 """
d55e5bfc
RD
6060 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
6061
6062 def GetEnabled(*args, **kwargs):
5ba5649b
RD
6063 """
6064 GetEnabled(self) -> bool
6065
6066 Returns ``True`` if the UI element should be enabled.
6067 """
d55e5bfc
RD
6068 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
6069
554f62e9
RD
6070 def GetShown(*args, **kwargs):
6071 """
6072 GetShown(self) -> bool
6073
6074 Returns ``True`` if the UI element should be shown.
6075 """
6076 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
6077
d55e5bfc 6078 def GetText(*args, **kwargs):
5ba5649b
RD
6079 """
6080 GetText(self) -> String
6081
6082 Returns the text that should be set for the UI element.
6083 """
d55e5bfc
RD
6084 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
6085
6086 def GetSetText(*args, **kwargs):
5ba5649b
RD
6087 """
6088 GetSetText(self) -> bool
6089
6090 Returns ``True`` if the application has called `SetText`. For
6091 wxWidgets internal use only.
6092 """
d55e5bfc
RD
6093 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
6094
6095 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
6096 """
6097 GetSetChecked(self) -> bool
6098
6099 Returns ``True`` if the application has called `Check`. For wxWidgets
6100 internal use only.
6101 """
d55e5bfc
RD
6102 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
6103
6104 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
6105 """
6106 GetSetEnabled(self) -> bool
6107
6108 Returns ``True`` if the application has called `Enable`. For wxWidgets
6109 internal use only.
6110 """
d55e5bfc
RD
6111 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
6112
554f62e9
RD
6113 def GetSetShown(*args, **kwargs):
6114 """
6115 GetSetShown(self) -> bool
6116
6117 Returns ``True`` if the application has called `Show`. For wxWidgets
6118 internal use only.
6119 """
6120 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
6121
d55e5bfc 6122 def Check(*args, **kwargs):
5ba5649b
RD
6123 """
6124 Check(self, bool check)
6125
6126 Check or uncheck the UI element.
6127 """
d55e5bfc
RD
6128 return _core_.UpdateUIEvent_Check(*args, **kwargs)
6129
6130 def Enable(*args, **kwargs):
5ba5649b
RD
6131 """
6132 Enable(self, bool enable)
6133
6134 Enable or disable the UI element.
6135 """
d55e5bfc
RD
6136 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
6137
554f62e9
RD
6138 def Show(*args, **kwargs):
6139 """
6140 Show(self, bool show)
6141
6142 Show or hide the UI element.
6143 """
6144 return _core_.UpdateUIEvent_Show(*args, **kwargs)
6145
d55e5bfc 6146 def SetText(*args, **kwargs):
5ba5649b
RD
6147 """
6148 SetText(self, String text)
6149
6150 Sets the text for this UI element.
6151 """
d55e5bfc
RD
6152 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
6153
6154 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6155 """
6156 SetUpdateInterval(long updateInterval)
6157
6158 Sets the interval between updates in milliseconds. Set to -1 to
6159 disable updates, or to 0 to update as frequently as possible. The
6160 default is 0.
6161
6162 Use this to reduce the overhead of UI update events if your
6163 application has a lot of windows. If you set the value to -1 or
6164 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6165 at appropriate points in your application, such as when a dialog is
6166 about to be shown.
6167 """
d55e5bfc
RD
6168 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
6169
6170 SetUpdateInterval = staticmethod(SetUpdateInterval)
6171 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6172 """
6173 GetUpdateInterval() -> long
6174
6175 Returns the current interval between updates in milliseconds. -1
6176 disables updates, 0 updates as frequently as possible.
6177 """
d55e5bfc
RD
6178 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
6179
6180 GetUpdateInterval = staticmethod(GetUpdateInterval)
6181 def CanUpdate(*args, **kwargs):
5ba5649b
RD
6182 """
6183 CanUpdate(Window win) -> bool
6184
6185 Returns ``True`` if it is appropriate to update (send UI update events
6186 to) this window.
6187
6188 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6189 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6190 events were last sent in idle time, and the update interval, to
6191 determine whether events should be sent to this window now. By default
6192 this will always return true because the update mode is initially
6193 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6194 events will be sent as often as possible. You can reduce the frequency
6195 that events are sent by changing the mode and/or setting an update
6196 interval.
6197
6198 """
d55e5bfc
RD
6199 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
6200
6201 CanUpdate = staticmethod(CanUpdate)
6202 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6203 """
6204 ResetUpdateTime()
6205
6206 Used internally to reset the last-updated time to the current time. It
6207 is assumed that update events are normally sent in idle time, so this
6208 is called at the end of idle processing.
6209 """
d55e5bfc
RD
6210 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
6211
6212 ResetUpdateTime = staticmethod(ResetUpdateTime)
6213 def SetMode(*args, **kwargs):
5ba5649b
RD
6214 """
6215 SetMode(int mode)
6216
6217 Specify how wxWidgets will send update events: to all windows, or only
6218 to those which specify that they will process the events.
6219
6220 The mode may be one of the following values:
6221
6222 ============================= ==========================================
6223 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6224 is the default setting.
6225 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6226 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6227 style set.
6228 ============================= ==========================================
6229
6230 """
d55e5bfc
RD
6231 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
6232
6233 SetMode = staticmethod(SetMode)
6234 def GetMode(*args, **kwargs):
5ba5649b
RD
6235 """
6236 GetMode() -> int
6237
6238 Returns a value specifying how wxWidgets will send update events: to
6239 all windows, or only to those which specify that they will process the
6240 events.
6241 """
d55e5bfc
RD
6242 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
6243
6244 GetMode = staticmethod(GetMode)
dba7934c
RD
6245 Checked = property(GetChecked,Check,doc="See `GetChecked`")
6246 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
6247 Shown = property(GetShown,Show,doc="See `GetShown`")
6248 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
2131d850 6249_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc
RD
6250
6251def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
554f62e9 6252 """
5ba5649b
RD
6253 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6254
6255 Sets the interval between updates in milliseconds. Set to -1 to
6256 disable updates, or to 0 to update as frequently as possible. The
6257 default is 0.
6258
6259 Use this to reduce the overhead of UI update events if your
6260 application has a lot of windows. If you set the value to -1 or
6261 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6262 at appropriate points in your application, such as when a dialog is
6263 about to be shown.
6264 """
554f62e9 6265 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 6266
554f62e9
RD
6267def UpdateUIEvent_GetUpdateInterval(*args):
6268 """
5ba5649b
RD
6269 UpdateUIEvent_GetUpdateInterval() -> long
6270
6271 Returns the current interval between updates in milliseconds. -1
6272 disables updates, 0 updates as frequently as possible.
6273 """
554f62e9 6274 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc
RD
6275
6276def UpdateUIEvent_CanUpdate(*args, **kwargs):
554f62e9 6277 """
5ba5649b
RD
6278 UpdateUIEvent_CanUpdate(Window win) -> bool
6279
6280 Returns ``True`` if it is appropriate to update (send UI update events
6281 to) this window.
6282
6283 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6284 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6285 events were last sent in idle time, and the update interval, to
6286 determine whether events should be sent to this window now. By default
6287 this will always return true because the update mode is initially
6288 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6289 events will be sent as often as possible. You can reduce the frequency
6290 that events are sent by changing the mode and/or setting an update
6291 interval.
6292
6293 """
554f62e9 6294 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 6295
554f62e9
RD
6296def UpdateUIEvent_ResetUpdateTime(*args):
6297 """
5ba5649b
RD
6298 UpdateUIEvent_ResetUpdateTime()
6299
6300 Used internally to reset the last-updated time to the current time. It
6301 is assumed that update events are normally sent in idle time, so this
6302 is called at the end of idle processing.
6303 """
554f62e9 6304 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc
RD
6305
6306def UpdateUIEvent_SetMode(*args, **kwargs):
554f62e9 6307 """
5ba5649b
RD
6308 UpdateUIEvent_SetMode(int mode)
6309
6310 Specify how wxWidgets will send update events: to all windows, or only
6311 to those which specify that they will process the events.
6312
6313 The mode may be one of the following values:
6314
6315 ============================= ==========================================
6316 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6317 is the default setting.
6318 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6319 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6320 style set.
6321 ============================= ==========================================
6322
6323 """
554f62e9 6324 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 6325
554f62e9
RD
6326def UpdateUIEvent_GetMode(*args):
6327 """
5ba5649b
RD
6328 UpdateUIEvent_GetMode() -> int
6329
6330 Returns a value specifying how wxWidgets will send update events: to
6331 all windows, or only to those which specify that they will process the
6332 events.
6333 """
554f62e9 6334 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
6335
6336#---------------------------------------------------------------------------
6337
6338class SysColourChangedEvent(Event):
5ba5649b
RD
6339 """
6340 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6341 when the user changes the colour settings using the control
6342 panel. This is only applicable under Windows.
6343
6344 The default event handler for this event propagates the event to child
6345 windows, since Windows only sends the events to top-level windows. If
6346 intercepting this event for a top-level window, remember to call
6347 `Skip` so the the base class handler will still be executed, or to
6348 pass the event on to the window's children explicitly.
6349
6350 """
554f62e9
RD
6351 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6352 __repr__ = _swig_repr
6353 def __init__(self, *args, **kwargs):
5ba5649b
RD
6354 """
6355 __init__(self) -> SysColourChangedEvent
6356
6357 Constructor
6358 """
554f62e9 6359 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 6360_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
6361
6362#---------------------------------------------------------------------------
6363
6364class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6365 """
6366 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6367 a window that loses its mouse capture. This is called even if
6368 `wx.Window.ReleaseMouse` was called by the application code. Handling
6369 this event allows an application to cater for unexpected capture
6370 releases which might otherwise confuse mouse handling code.
6371
6372 This event is implemented under Windows only.
6373 """
554f62e9
RD
6374 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6375 __repr__ = _swig_repr
6376 def __init__(self, *args, **kwargs):
5ba5649b
RD
6377 """
6378 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6379
6380 Constructor
6381 """
554f62e9 6382 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 6383 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6384 """
6385 GetCapturedWindow(self) -> Window
6386
6387 Returns the window that gained the capture, or ``None`` if it was a
6388 non-wxWidgets window.
6389 """
d55e5bfc
RD
6390 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
6391
57332a5a 6392 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
2131d850 6393_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
6394
6395#---------------------------------------------------------------------------
6396
0f83f5da
RD
6397class MouseCaptureLostEvent(Event):
6398 """
6399 A mouse capture lost event is sent to a window that obtained mouse
6400 capture, which was subsequently loss due to "external" event, for
6401 example when a dialog box is shown or if another application captures
6402 the mouse.
6403
6404 If this happens, this event is sent to all windows that are on the
6405 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6406 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6407 if the capture changes because of a call to CaptureMouse or
6408 ReleaseMouse.
6409
6410 This event is currently emitted under Windows only.
6411
6412 """
6413 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6414 __repr__ = _swig_repr
6415 def __init__(self, *args, **kwargs):
6416 """
6417 __init__(self, int winid=0) -> MouseCaptureLostEvent
6418
6419 A mouse capture lost event is sent to a window that obtained mouse
6420 capture, which was subsequently loss due to "external" event, for
6421 example when a dialog box is shown or if another application captures
6422 the mouse.
6423
6424 If this happens, this event is sent to all windows that are on the
6425 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6426 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6427 if the capture changes because of a call to CaptureMouse or
6428 ReleaseMouse.
6429
6430 This event is currently emitted under Windows only.
6431
6432 """
6433 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6434_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6435
6436#---------------------------------------------------------------------------
6437
d55e5bfc 6438class DisplayChangedEvent(Event):
5ba5649b
RD
6439 """
6440 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6441 resolution has changed.
6442
6443 This event is implemented under Windows only.
6444 """
554f62e9
RD
6445 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6446 __repr__ = _swig_repr
6447 def __init__(self, *args, **kwargs):
d55e5bfc 6448 """__init__(self) -> DisplayChangedEvent"""
554f62e9 6449 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 6450_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
6451
6452#---------------------------------------------------------------------------
6453
6454class PaletteChangedEvent(Event):
5ba5649b
RD
6455 """
6456 An EVT_PALETTE_CHANGED event is sent when the system palette has
6457 changed, thereby giving each window a chance to redo their own to
6458 match.
6459
6460 This event is implemented under Windows only.
6461 """
554f62e9
RD
6462 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6463 __repr__ = _swig_repr
6464 def __init__(self, *args, **kwargs):
5ba5649b
RD
6465 """
6466 __init__(self, int id=0) -> PaletteChangedEvent
6467
6468 An EVT_PALETTE_CHANGED event is sent when the system palette has
6469 changed, thereby giving each window a chance to redo their own to
6470 match.
6471
6472 This event is implemented under Windows only.
6473 """
554f62e9 6474 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc
RD
6475 def SetChangedWindow(*args, **kwargs):
6476 """SetChangedWindow(self, Window win)"""
6477 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6478
6479 def GetChangedWindow(*args, **kwargs):
6480 """GetChangedWindow(self) -> Window"""
6481 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6482
33d6fd3b 6483 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
2131d850 6484_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
6485
6486#---------------------------------------------------------------------------
6487
6488class QueryNewPaletteEvent(Event):
5ba5649b
RD
6489 """
6490 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6491 focus and should re-do its palette.
6492
6493 This event is implemented under Windows only.
6494 """
554f62e9
RD
6495 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6496 __repr__ = _swig_repr
6497 def __init__(self, *args, **kwargs):
5ba5649b
RD
6498 """
6499 __init__(self, int winid=0) -> QueryNewPaletteEvent
6500
6501 Constructor.
6502 """
554f62e9 6503 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 6504 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6505 """
6506 SetPaletteRealized(self, bool realized)
6507
6508 App should set this if it changes the palette.
6509 """
d55e5bfc
RD
6510 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6511
6512 def GetPaletteRealized(*args, **kwargs):
6513 """GetPaletteRealized(self) -> bool"""
6514 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6515
33d6fd3b 6516 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
2131d850 6517_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
6518
6519#---------------------------------------------------------------------------
6520
6521class NavigationKeyEvent(Event):
5ba5649b
RD
6522 """
6523 EVT_NAVIGATION_KEY events are used to control moving the focus between
6524 widgets, otherwise known as tab-traversal. You woudl normally not
6525 catch navigation events in applications as there are already
6526 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6527 it useful to send navigation events in certain situations to change
6528 the focus in certain ways, although it's probably easier to just call
6529 `wx.Window.Navigate`.
6530 """
554f62e9
RD
6531 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6532 __repr__ = _swig_repr
6533 def __init__(self, *args, **kwargs):
d55e5bfc 6534 """__init__(self) -> NavigationKeyEvent"""
554f62e9 6535 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 6536 def GetDirection(*args, **kwargs):
5ba5649b
RD
6537 """
6538 GetDirection(self) -> bool
6539
6540 Returns ``True`` if the direction is forward, ``False`` otherwise.
6541 """
d55e5bfc
RD
6542 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6543
6544 def SetDirection(*args, **kwargs):
5ba5649b
RD
6545 """
6546 SetDirection(self, bool forward)
6547
6548 Specify the direction that the navigation should take. Usually the
6549 difference between using Tab and Shift-Tab.
6550 """
d55e5bfc
RD
6551 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6552
6553 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6554 """
6555 IsWindowChange(self) -> bool
6556
6557 Returns ``True`` if window change is allowed.
6558 """
d55e5bfc
RD
6559 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6560
6561 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6562 """
6563 SetWindowChange(self, bool ischange)
6564
6565 Specify if the navigation should be able to change parent windows.
6566 For example, changing notebook pages, etc. This is usually implemented
6567 by using Control-Tab.
6568 """
d55e5bfc
RD
6569 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6570
68350608 6571 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6572 """
6573 IsFromTab(self) -> bool
6574
6575 Returns ``True`` if the navigation event is originated from the Tab
6576 key.
6577 """
68350608
RD
6578 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6579
6580 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6581 """
6582 SetFromTab(self, bool bIs)
6583
6584 Set to true under MSW if the event was generated using the tab key.
6585 This is required for proper navogation over radio buttons.
6586 """
68350608
RD
6587 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6588
908b74cd 6589 def SetFlags(*args, **kwargs):
5ba5649b
RD
6590 """
6591 SetFlags(self, long flags)
6592
6593 Set the navigation flags to a combination of the following:
6594
6595 * wx.NavigationKeyEvent.IsBackward
6596 * wx.NavigationKeyEvent.IsForward
6597 * wx.NavigationKeyEvent.WinChange
6598 * wx.NavigationKeyEvent.FromTab
6599
6600 """
908b74cd
RD
6601 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6602
d55e5bfc 6603 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6604 """
6605 GetCurrentFocus(self) -> Window
6606
6607 Returns the child window which currenty has the focus. May be
6608 ``None``.
6609 """
d55e5bfc
RD
6610 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6611
6612 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6613 """
6614 SetCurrentFocus(self, Window win)
6615
6616 Set the window that has the focus.
6617 """
d55e5bfc
RD
6618 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6619
b0f7404b 6620 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6621 IsForward = _core_.NavigationKeyEvent_IsForward
6622 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6623 FromTab = _core_.NavigationKeyEvent_FromTab
57332a5a
RD
6624 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6625 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
2131d850 6626_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6627
6628#---------------------------------------------------------------------------
6629
6630class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6631 """
6632 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6633 underlying GUI object) exists.
6634 """
554f62e9
RD
6635 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6636 __repr__ = _swig_repr
6637 def __init__(self, *args, **kwargs):
5ba5649b
RD
6638 """
6639 __init__(self, Window win=None) -> WindowCreateEvent
6640
6641 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6642 underlying GUI object) exists.
6643 """
554f62e9 6644 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6645 def GetWindow(*args, **kwargs):
5ba5649b
RD
6646 """
6647 GetWindow(self) -> Window
6648
6649 Returns the window that this event refers to.
6650 """
d55e5bfc
RD
6651 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6652
dba7934c 6653 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6654_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc
RD
6655
6656class WindowDestroyEvent(CommandEvent):
5ba5649b 6657 """
9d7dfdff
RD
6658 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6659 when the GUI window is destroyed.
6660
6661 When a class derived from `wx.Window` is destroyed its destructor will
6662 have already run by the time this event is sent. Therefore this event
6663 will not usually be received at all by the window itself. Since it is
6664 received after the destructor has run, an object should not try to
6665 handle its own wx.WindowDestroyEvent, but it can be used to get
6666 notification of the destruction of another window.
5ba5649b 6667 """
554f62e9
RD
6668 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6669 __repr__ = _swig_repr
6670 def __init__(self, *args, **kwargs):
5ba5649b
RD
6671 """
6672 __init__(self, Window win=None) -> WindowDestroyEvent
6673
9d7dfdff
RD
6674 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6675 when the GUI window is destroyed.
6676
6677 When a class derived from `wx.Window` is destroyed its destructor will
6678 have already run by the time this event is sent. Therefore this event
6679 will not usually be received at all by the window itself. Since it is
6680 received after the destructor has run, an object should not try to
6681 handle its own wx.WindowDestroyEvent, but it can be used to get
6682 notification of the destruction of another window.
5ba5649b 6683 """
554f62e9 6684 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6685 def GetWindow(*args, **kwargs):
5ba5649b
RD
6686 """
6687 GetWindow(self) -> Window
6688
6689 Returns the window that this event refers to.
6690 """
d55e5bfc
RD
6691 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6692
dba7934c 6693 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6694_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6695
6696#---------------------------------------------------------------------------
6697
6698class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6699 """
6700 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6701 give the application a chance to show a context (popup) menu.
6702 """
554f62e9
RD
6703 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6704 __repr__ = _swig_repr
6705 def __init__(self, *args, **kwargs):
5ba5649b 6706 """
f460c29d 6707 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6708
6709 Constructor.
6710 """
554f62e9 6711 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6712 def GetPosition(*args, **kwargs):
5ba5649b
RD
6713 """
6714 GetPosition(self) -> Point
6715
6716 Returns the position (in screen coordinants) at which the menu should
6717 be shown.
6718 """
d55e5bfc
RD
6719 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6720
6721 def SetPosition(*args, **kwargs):
5ba5649b
RD
6722 """
6723 SetPosition(self, Point pos)
6724
6725 Sets the position at which the menu should be shown.
6726 """
d55e5bfc
RD
6727 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6728
226118fc 6729 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 6730_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6731
6732#---------------------------------------------------------------------------
6733
6734IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6735IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6736class IdleEvent(Event):
5ba5649b
RD
6737 """
6738 This class is used for EVT_IDLE events, which are generated and sent
6739 when the application *becomes* idle. In other words, the when the
6740 event queue becomes empty then idle events are sent to all windows (by
6741 default) and as long as none of them call `RequestMore` then there are
6742 no more idle events until after the system event queue has some normal
6743 events and then becomes empty again.
6744
6745 By default, idle events are sent to all windows. If this is causing a
6746 significant overhead in your application, you can call
6747 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6748 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6749 which should receive idle events. Then idle events will only be sent
6750 to those windows and not to any others.
6751 """
554f62e9
RD
6752 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6753 __repr__ = _swig_repr
6754 def __init__(self, *args, **kwargs):
5ba5649b
RD
6755 """
6756 __init__(self) -> IdleEvent
6757
6758 Constructor
6759 """
554f62e9 6760 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6761 def RequestMore(*args, **kwargs):
5ba5649b
RD
6762 """
6763 RequestMore(self, bool needMore=True)
6764
6765 Tells wxWidgets that more processing is required. This function can be
6766 called by an EVT_IDLE handler for a window to indicate that the
6767 application should forward the EVT_IDLE event once more to the
6768 application windows. If no window calls this function during its
6769 EVT_IDLE handler, then the application will remain in a passive event
6770 loop until a new event is posted to the application by the windowing
6771 system.
6772 """
d55e5bfc
RD
6773 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6774
6775 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6776 """
6777 MoreRequested(self) -> bool
6778
6779 Returns ``True`` if the OnIdle function processing this event
6780 requested more processing time.
6781 """
d55e5bfc
RD
6782 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6783
6784 def SetMode(*args, **kwargs):
5ba5649b
RD
6785 """
6786 SetMode(int mode)
6787
6788 Static method for specifying how wxWidgets will send idle events: to
6789 all windows, or only to those which specify that they will process the
6790 events.
6791
6792 The mode can be one of the following values:
6793
6794 ========================= ========================================
6795 wx.IDLE_PROCESS_ALL Send idle events to all windows
6796 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6797 the wx.WS_EX_PROCESS_IDLE extra style
6798 flag set.
6799 ========================= ========================================
6800
6801 """
d55e5bfc
RD
6802 return _core_.IdleEvent_SetMode(*args, **kwargs)
6803
6804 SetMode = staticmethod(SetMode)
6805 def GetMode(*args, **kwargs):
5ba5649b
RD
6806 """
6807 GetMode() -> int
6808
6809 Static method returning a value specifying how wxWidgets will send
6810 idle events: to all windows, or only to those which specify that they
6811 will process the events.
6812 """
d55e5bfc
RD
6813 return _core_.IdleEvent_GetMode(*args, **kwargs)
6814
6815 GetMode = staticmethod(GetMode)
6816 def CanSend(*args, **kwargs):
5ba5649b
RD
6817 """
6818 CanSend(Window win) -> bool
6819
6820 Returns ``True`` if it is appropriate to send idle events to this
6821 window.
6822
6823 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6824 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6825 events should be sent to this window now. By default this will always
6826 return ``True`` because the update mode is initially
6827 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6828 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6829 """
d55e5bfc
RD
6830 return _core_.IdleEvent_CanSend(*args, **kwargs)
6831
6832 CanSend = staticmethod(CanSend)
2131d850 6833_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc
RD
6834
6835def IdleEvent_SetMode(*args, **kwargs):
554f62e9 6836 """
5ba5649b
RD
6837 IdleEvent_SetMode(int mode)
6838
6839 Static method for specifying how wxWidgets will send idle events: to
6840 all windows, or only to those which specify that they will process the
6841 events.
6842
6843 The mode can be one of the following values:
6844
6845 ========================= ========================================
6846 wx.IDLE_PROCESS_ALL Send idle events to all windows
6847 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6848 the wx.WS_EX_PROCESS_IDLE extra style
6849 flag set.
6850 ========================= ========================================
6851
6852 """
554f62e9 6853 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6854
554f62e9
RD
6855def IdleEvent_GetMode(*args):
6856 """
5ba5649b
RD
6857 IdleEvent_GetMode() -> int
6858
6859 Static method returning a value specifying how wxWidgets will send
6860 idle events: to all windows, or only to those which specify that they
6861 will process the events.
6862 """
554f62e9 6863 return _core_.IdleEvent_GetMode(*args)
d55e5bfc
RD
6864
6865def IdleEvent_CanSend(*args, **kwargs):
554f62e9 6866 """
5ba5649b
RD
6867 IdleEvent_CanSend(Window win) -> bool
6868
6869 Returns ``True`` if it is appropriate to send idle events to this
6870 window.
6871
6872 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6873 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6874 events should be sent to this window now. By default this will always
6875 return ``True`` because the update mode is initially
6876 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6877 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6878 """
554f62e9 6879 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6880
6881#---------------------------------------------------------------------------
6882
2131d850
RD
6883class ClipboardTextEvent(CommandEvent):
6884 """
6885 A Clipboard Text event is sent when a window intercepts a text
6886 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6887 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6888 popup menu command, etc. NOTE : under windows these events are *NOT*
6889 generated automatically for a Rich Edit text control.
6890 """
6891 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6892 __repr__ = _swig_repr
6893 def __init__(self, *args, **kwargs):
6894 """
6895 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6896
6897 A Clipboard Text event is sent when a window intercepts a text
6898 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6899 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6900 popup menu command, etc. NOTE : under windows these events are *NOT*
6901 generated automatically for a Rich Edit text control.
6902 """
6903 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6904_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6905
6906#---------------------------------------------------------------------------
6907
d55e5bfc 6908class PyEvent(Event):
5ba5649b
RD
6909 """
6910 wx.PyEvent can be used as a base class for implementing custom event
6911 types in Python. You should derived from this class instead of
6912 `wx.Event` because this class is Python-aware and is able to transport
6913 its Python bits safely through the wxWidgets event system and have
6914 them still be there when the event handler is invoked.
6915
6916 :see: `wx.PyCommandEvent`
6917
6918 """
554f62e9
RD
6919 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6920 __repr__ = _swig_repr
6921 def __init__(self, *args, **kwargs):
f460c29d 6922 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
554f62e9 6923 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6924 self._SetSelf(self)
d55e5bfc 6925
554f62e9
RD
6926 __swig_destroy__ = _core_.delete_PyEvent
6927 __del__ = lambda self : None;
5ba5649b
RD
6928 def _SetSelf(*args, **kwargs):
6929 """_SetSelf(self, PyObject self)"""
6930 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6931
5ba5649b
RD
6932 def _GetSelf(*args, **kwargs):
6933 """_GetSelf(self) -> PyObject"""
6934 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6935
2131d850 6936_core_.PyEvent_swigregister(PyEvent)
d55e5bfc
RD
6937
6938class PyCommandEvent(CommandEvent):
5ba5649b
RD
6939 """
6940 wx.PyCommandEvent can be used as a base class for implementing custom
6941 event types in Python, where the event shoudl travel up to parent
6942 windows looking for a handler. You should derived from this class
6943 instead of `wx.CommandEvent` because this class is Python-aware and is
6944 able to transport its Python bits safely through the wxWidgets event
6945 system and have them still be there when the event handler is invoked.
6946
6947 :see: `wx.PyEvent`
6948
6949 """
554f62e9
RD
6950 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6951 __repr__ = _swig_repr
6952 def __init__(self, *args, **kwargs):
f460c29d 6953 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
554f62e9 6954 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6955 self._SetSelf(self)
d55e5bfc 6956
554f62e9
RD
6957 __swig_destroy__ = _core_.delete_PyCommandEvent
6958 __del__ = lambda self : None;
5ba5649b
RD
6959 def _SetSelf(*args, **kwargs):
6960 """_SetSelf(self, PyObject self)"""
6961 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6962
5ba5649b
RD
6963 def _GetSelf(*args, **kwargs):
6964 """_GetSelf(self) -> PyObject"""
6965 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6966
2131d850 6967_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6968
53aa7709 6969class DateEvent(CommandEvent):
5ba5649b
RD
6970 """
6971 This event class holds information about a date change event and is
6972 used together with `wx.DatePickerCtrl`. It also serves as a base class
6973 for `wx.calendar.CalendarEvent`. Bind these event types with
6974 EVT_DATE_CHANGED.
6975 """
554f62e9
RD
6976 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6977 __repr__ = _swig_repr
6978 def __init__(self, *args, **kwargs):
f460c29d 6979 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
554f62e9 6980 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6981 def GetDate(*args, **kwargs):
5ba5649b
RD
6982 """
6983 GetDate(self) -> DateTime
6984
6985 Returns the date.
6986 """
53aa7709
RD
6987 return _core_.DateEvent_GetDate(*args, **kwargs)
6988
6989 def SetDate(*args, **kwargs):
5ba5649b
RD
6990 """
6991 SetDate(self, DateTime date)
6992
6993 Sets the date carried by the event, normally only used by the library
6994 internally.
6995 """
53aa7709
RD
6996 return _core_.DateEvent_SetDate(*args, **kwargs)
6997
226118fc 6998 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
2131d850 6999_core_.DateEvent_swigregister(DateEvent)
53aa7709
RD
7000
7001wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
7002EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
7003
4976f996
RD
7004class EventBlocker(EvtHandler):
7005 """Helper class to temporarily disable event handling for a window."""
7006 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7007 __repr__ = _swig_repr
7008 def __init__(self, *args, **kwargs):
7009 """
7010 __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker
7011
7012 Helper class to temporarily disable event handling for a window.
7013 """
7014 _core_.EventBlocker_swiginit(self,_core_.new_EventBlocker(*args, **kwargs))
7015 __swig_destroy__ = _core_.delete_EventBlocker
7016 __del__ = lambda self : None;
7017 def Block(*args, **kwargs):
7018 """Block(self, EventType type)"""
7019 return _core_.EventBlocker_Block(*args, **kwargs)
7020
7021_core_.EventBlocker_swigregister(EventBlocker)
7022
d55e5bfc
RD
7023#---------------------------------------------------------------------------
7024
7025PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
7026PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
7027PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
7028PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
7029PRINT_WINDOWS = _core_.PRINT_WINDOWS
7030PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
7031class PyApp(EvtHandler):
c24da6d6
RD
7032 """
7033 The ``wx.PyApp`` class is an *implementation detail*, please use the
7034 `wx.App` class (or some other derived class) instead.
7035 """
554f62e9
RD
7036 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7037 __repr__ = _swig_repr
7038 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7039 """
7040 __init__(self) -> PyApp
7041
7042 Create a new application object, starting the bootstrap process.
7043 """
554f62e9 7044 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
c25f90f6 7045 self._setOORInfo(self, False);PyApp._setCallbackInfo(self, self, PyApp)
d55e5bfc 7046
554f62e9
RD
7047 __swig_destroy__ = _core_.delete_PyApp
7048 __del__ = lambda self : None;
d55e5bfc 7049 def _setCallbackInfo(*args, **kwargs):
c25f90f6 7050 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)"""
d55e5bfc
RD
7051 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
7052
7053 def GetAppName(*args, **kwargs):
7054 """
7055 GetAppName(self) -> String
7056
7057 Get the application name.
7058 """
7059 return _core_.PyApp_GetAppName(*args, **kwargs)
7060
7061 def SetAppName(*args, **kwargs):
7062 """
7063 SetAppName(self, String name)
7064
c24da6d6
RD
7065 Set the application name. This value may be used automatically by
7066 `wx.Config` and such.
d55e5bfc
RD
7067 """
7068 return _core_.PyApp_SetAppName(*args, **kwargs)
7069
7070 def GetClassName(*args, **kwargs):
7071 """
7072 GetClassName(self) -> String
7073
7074 Get the application's class name.
7075 """
7076 return _core_.PyApp_GetClassName(*args, **kwargs)
7077
7078 def SetClassName(*args, **kwargs):
7079 """
7080 SetClassName(self, String name)
7081
c24da6d6
RD
7082 Set the application's class name. This value may be used for
7083 X-resources if applicable for the platform
d55e5bfc
RD
7084 """
7085 return _core_.PyApp_SetClassName(*args, **kwargs)
7086
7087 def GetVendorName(*args, **kwargs):
7088 """
7089 GetVendorName(self) -> String
7090
7091 Get the application's vendor name.
7092 """
7093 return _core_.PyApp_GetVendorName(*args, **kwargs)
7094
7095 def SetVendorName(*args, **kwargs):
7096 """
7097 SetVendorName(self, String name)
7098
c24da6d6
RD
7099 Set the application's vendor name. This value may be used
7100 automatically by `wx.Config` and such.
d55e5bfc
RD
7101 """
7102 return _core_.PyApp_SetVendorName(*args, **kwargs)
7103
7104 def GetTraits(*args, **kwargs):
7105 """
7106 GetTraits(self) -> wxAppTraits
7107
c24da6d6
RD
7108 Return (and create if necessary) the app traits object to which we
7109 delegate for everything which either should be configurable by the
7110 user (then he can change the default behaviour simply by overriding
7111 CreateTraits() and returning his own traits object) or which is
7112 GUI/console dependent as then wx.AppTraits allows us to abstract the
7113 differences behind the common facade.
7114
7115 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc
RD
7116 """
7117 return _core_.PyApp_GetTraits(*args, **kwargs)
7118
7119 def ProcessPendingEvents(*args, **kwargs):
7120 """
7121 ProcessPendingEvents(self)
7122
c24da6d6
RD
7123 Process all events in the Pending Events list -- it is necessary to
7124 call this function to process posted events. This normally happens
7125 during each event loop iteration.
d55e5bfc
RD
7126 """
7127 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
7128
7129 def Yield(*args, **kwargs):
7130 """
7131 Yield(self, bool onlyIfNeeded=False) -> bool
7132
c24da6d6
RD
7133 Process all currently pending events right now, instead of waiting
7134 until return to the event loop. It is an error to call ``Yield``
7135 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 7136
c24da6d6 7137 :warning: This function is dangerous as it can lead to unexpected
79fccf9d
RD
7138 reentrancies (i.e. when called from an event handler it may
7139 result in calling the same event handler again), use with
7140 extreme care or, better, don't use at all!
d55e5bfc 7141
c24da6d6 7142 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
79fccf9d 7143
d55e5bfc
RD
7144 """
7145 return _core_.PyApp_Yield(*args, **kwargs)
7146
7147 def WakeUpIdle(*args, **kwargs):
7148 """
7149 WakeUpIdle(self)
7150
c24da6d6
RD
7151 Make sure that idle events are sent again.
7152 :see: `wx.WakeUpIdle`
d55e5bfc
RD
7153 """
7154 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
7155
84f85550
RD
7156 def IsMainLoopRunning(*args, **kwargs):
7157 """
7158 IsMainLoopRunning() -> bool
7159
7160 Returns True if we're running the main loop, i.e. if the events can
7161 currently be dispatched.
7162 """
7163 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7164
7165 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
7166 def MainLoop(*args, **kwargs):
7167 """
7168 MainLoop(self) -> int
7169
c24da6d6
RD
7170 Execute the main GUI loop, the function doesn't normally return until
7171 all top level windows have been closed and destroyed.
d55e5bfc
RD
7172 """
7173 return _core_.PyApp_MainLoop(*args, **kwargs)
7174
7175 def Exit(*args, **kwargs):
7176 """
7177 Exit(self)
7178
7179 Exit the main loop thus terminating the application.
c24da6d6 7180 :see: `wx.Exit`
d55e5bfc
RD
7181 """
7182 return _core_.PyApp_Exit(*args, **kwargs)
7183
97ab0f6a
RD
7184 def GetLayoutDirection(*args, **kwargs):
7185 """
994453b8 7186 GetLayoutDirection(self) -> int
97ab0f6a
RD
7187
7188 Return the layout direction for the current locale.
7189 """
7190 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
7191
d55e5bfc
RD
7192 def ExitMainLoop(*args, **kwargs):
7193 """
7194 ExitMainLoop(self)
7195
c24da6d6
RD
7196 Exit the main GUI loop during the next iteration of the main
7197 loop, (i.e. it does not stop the program immediately!)
d55e5bfc
RD
7198 """
7199 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
7200
7201 def Pending(*args, **kwargs):
7202 """
7203 Pending(self) -> bool
7204
7205 Returns True if there are unprocessed events in the event queue.
7206 """
7207 return _core_.PyApp_Pending(*args, **kwargs)
7208
7209 def Dispatch(*args, **kwargs):
7210 """
7211 Dispatch(self) -> bool
7212
7213 Process the first event in the event queue (blocks until an event
7214 appears if there are none currently)
7215 """
7216 return _core_.PyApp_Dispatch(*args, **kwargs)
7217
7218 def ProcessIdle(*args, **kwargs):
7219 """
7220 ProcessIdle(self) -> bool
7221
c24da6d6
RD
7222 Called from the MainLoop when the application becomes idle (there are
7223 no pending events) and sends a `wx.IdleEvent` to all interested
7224 parties. Returns True if more idle events are needed, False if not.
d55e5bfc
RD
7225 """
7226 return _core_.PyApp_ProcessIdle(*args, **kwargs)
7227
7228 def SendIdleEvents(*args, **kwargs):
7229 """
7230 SendIdleEvents(self, Window win, IdleEvent event) -> bool
7231
c24da6d6
RD
7232 Send idle event to window and all subwindows. Returns True if more
7233 idle time is requested.
d55e5bfc
RD
7234 """
7235 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
7236
7237 def IsActive(*args, **kwargs):
7238 """
7239 IsActive(self) -> bool
7240
7241 Return True if our app has focus.
7242 """
7243 return _core_.PyApp_IsActive(*args, **kwargs)
7244
7245 def SetTopWindow(*args, **kwargs):
7246 """
7247 SetTopWindow(self, Window win)
7248
c24da6d6 7249 Set the *main* top level window
d55e5bfc
RD
7250 """
7251 return _core_.PyApp_SetTopWindow(*args, **kwargs)
7252
7253 def GetTopWindow(*args, **kwargs):
7254 """
7255 GetTopWindow(self) -> Window
7256
c24da6d6
RD
7257 Return the *main* top level window (if it hadn't been set previously
7258 with SetTopWindow(), will return just some top level window and, if
7259 there not any, will return None)
d55e5bfc
RD
7260 """
7261 return _core_.PyApp_GetTopWindow(*args, **kwargs)
7262
7263 def SetExitOnFrameDelete(*args, **kwargs):
7264 """
7265 SetExitOnFrameDelete(self, bool flag)
7266
c24da6d6
RD
7267 Control the exit behaviour: by default, the program will exit the main
7268 loop (and so, usually, terminate) when the last top-level program
7269 window is deleted. Beware that if you disable this behaviour (with
7270 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7271 explicitly from somewhere.
d55e5bfc
RD
7272 """
7273 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
7274
7275 def GetExitOnFrameDelete(*args, **kwargs):
7276 """
7277 GetExitOnFrameDelete(self) -> bool
7278
7279 Get the current exit behaviour setting.
7280 """
7281 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
7282
7283 def SetUseBestVisual(*args, **kwargs):
7284 """
eccab1a7 7285 SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
d55e5bfc 7286
c24da6d6
RD
7287 Set whether the app should try to use the best available visual on
7288 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc
RD
7289 """
7290 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
7291
7292 def GetUseBestVisual(*args, **kwargs):
7293 """
7294 GetUseBestVisual(self) -> bool
7295
7296 Get current UseBestVisual setting.
7297 """
7298 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
7299
7300 def SetPrintMode(*args, **kwargs):
7301 """SetPrintMode(self, int mode)"""
7302 return _core_.PyApp_SetPrintMode(*args, **kwargs)
7303
7304 def GetPrintMode(*args, **kwargs):
7305 """GetPrintMode(self) -> int"""
7306 return _core_.PyApp_GetPrintMode(*args, **kwargs)
7307
7308 def SetAssertMode(*args, **kwargs):
7309 """
7310 SetAssertMode(self, int mode)
7311
79fccf9d 7312 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc
RD
7313 """
7314 return _core_.PyApp_SetAssertMode(*args, **kwargs)
7315
7316 def GetAssertMode(*args, **kwargs):
7317 """
7318 GetAssertMode(self) -> int
7319
7320 Get the current OnAssert behaviour setting.
7321 """
7322 return _core_.PyApp_GetAssertMode(*args, **kwargs)
7323
7324 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 7325 """GetMacSupportPCMenuShortcuts() -> bool"""
d55e5bfc
RD
7326 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
7327
7328 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7329 def GetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 7330 """GetMacAboutMenuItemId() -> long"""
d55e5bfc
RD
7331 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
7332
7333 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7334 def GetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 7335 """GetMacPreferencesMenuItemId() -> long"""
d55e5bfc
RD
7336 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
7337
7338 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7339 def GetMacExitMenuItemId(*args, **kwargs):
c24da6d6 7340 """GetMacExitMenuItemId() -> long"""
d55e5bfc
RD
7341 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
7342
7343 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7344 def GetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 7345 """GetMacHelpMenuTitleName() -> String"""
d55e5bfc
RD
7346 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
7347
7348 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7349 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 7350 """SetMacSupportPCMenuShortcuts(bool val)"""
d55e5bfc
RD
7351 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7352
7353 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7354 def SetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 7355 """SetMacAboutMenuItemId(long val)"""
d55e5bfc
RD
7356 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7357
7358 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7359 def SetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 7360 """SetMacPreferencesMenuItemId(long val)"""
d55e5bfc
RD
7361 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7362
7363 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7364 def SetMacExitMenuItemId(*args, **kwargs):
c24da6d6 7365 """SetMacExitMenuItemId(long val)"""
d55e5bfc
RD
7366 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7367
7368 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7369 def SetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 7370 """SetMacHelpMenuTitleName(String val)"""
d55e5bfc
RD
7371 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7372
7373 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7374 def _BootstrapApp(*args, **kwargs):
7375 """
7376 _BootstrapApp(self)
7377
7378 For internal use only
7379 """
7380 return _core_.PyApp__BootstrapApp(*args, **kwargs)
7381
7382 def GetComCtl32Version(*args, **kwargs):
7383 """
c24da6d6 7384 GetComCtl32Version() -> int
d55e5bfc 7385
c24da6d6
RD
7386 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7387 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
7388 """
7389 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
7390
7391 GetComCtl32Version = staticmethod(GetComCtl32Version)
33d6fd3b 7392 def IsDisplayAvailable(*args, **kwargs):
fc46b7f3 7393 """
33d6fd3b 7394 IsDisplayAvailable() -> bool
fc46b7f3
RD
7395
7396 Tests if it is possible to create a GUI in the current environment.
7397 This will mean different things on the different platforms.
7398
7399 * On X Windows systems this function will return ``False`` if it is
7400 not able to open a connection to the X display, which can happen
7401 if $DISPLAY is not set, or is not set correctly.
7402
7403 * On Mac OS X a ``False`` return value will mean that wx is not
7404 able to access the window manager, which can happen if logged in
7405 remotely or if running from the normal version of python instead
7406 of the framework version, (i.e., pythonw.)
7407
7408 * On MS Windows...
7409
7410 """
33d6fd3b
RD
7411 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7412
7413 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7414 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7415 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7416 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7417 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7418 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7419 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7420 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7421 Traits = property(GetTraits,doc="See `GetTraits`")
7422 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7423 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7424 Active = property(IsActive)
2131d850 7425_core_.PyApp_swigregister(PyApp)
d55e5bfc 7426
554f62e9
RD
7427def PyApp_IsMainLoopRunning(*args):
7428 """
84f85550
RD
7429 PyApp_IsMainLoopRunning() -> bool
7430
7431 Returns True if we're running the main loop, i.e. if the events can
7432 currently be dispatched.
7433 """
554f62e9 7434 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 7435
554f62e9
RD
7436def PyApp_GetMacSupportPCMenuShortcuts(*args):
7437 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7438 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 7439
554f62e9
RD
7440def PyApp_GetMacAboutMenuItemId(*args):
7441 """PyApp_GetMacAboutMenuItemId() -> long"""
7442 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 7443
554f62e9
RD
7444def PyApp_GetMacPreferencesMenuItemId(*args):
7445 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7446 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 7447
554f62e9
RD
7448def PyApp_GetMacExitMenuItemId(*args):
7449 """PyApp_GetMacExitMenuItemId() -> long"""
7450 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 7451
554f62e9
RD
7452def PyApp_GetMacHelpMenuTitleName(*args):
7453 """PyApp_GetMacHelpMenuTitleName() -> String"""
7454 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc
RD
7455
7456def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
554f62e9
RD
7457 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7458 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7459
7460def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
554f62e9
RD
7461 """PyApp_SetMacAboutMenuItemId(long val)"""
7462 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7463
7464def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
554f62e9
RD
7465 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7466 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7467
7468def PyApp_SetMacExitMenuItemId(*args, **kwargs):
554f62e9
RD
7469 """PyApp_SetMacExitMenuItemId(long val)"""
7470 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7471
7472def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
554f62e9
RD
7473 """PyApp_SetMacHelpMenuTitleName(String val)"""
7474 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7475
554f62e9
RD
7476def PyApp_GetComCtl32Version(*args):
7477 """
d55e5bfc
RD
7478 PyApp_GetComCtl32Version() -> int
7479
c24da6d6
RD
7480 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7481 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7482 """
554f62e9 7483 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc 7484
33d6fd3b 7485def PyApp_IsDisplayAvailable(*args):
fc46b7f3 7486 """
33d6fd3b 7487 PyApp_IsDisplayAvailable() -> bool
fc46b7f3
RD
7488
7489 Tests if it is possible to create a GUI in the current environment.
7490 This will mean different things on the different platforms.
7491
7492 * On X Windows systems this function will return ``False`` if it is
7493 not able to open a connection to the X display, which can happen
7494 if $DISPLAY is not set, or is not set correctly.
7495
7496 * On Mac OS X a ``False`` return value will mean that wx is not
7497 able to access the window manager, which can happen if logged in
7498 remotely or if running from the normal version of python instead
7499 of the framework version, (i.e., pythonw.)
7500
7501 * On MS Windows...
7502
7503 """
33d6fd3b 7504 return _core_.PyApp_IsDisplayAvailable(*args)
fc46b7f3 7505
d55e5bfc
RD
7506#---------------------------------------------------------------------------
7507
7508
554f62e9
RD
7509def Exit(*args):
7510 """
d55e5bfc
RD
7511 Exit()
7512
7513 Force an exit of the application. Convenience for wx.GetApp().Exit()
7514 """
554f62e9 7515 return _core_.Exit(*args)
d55e5bfc 7516
554f62e9
RD
7517def Yield(*args):
7518 """
d55e5bfc
RD
7519 Yield() -> bool
7520
7521 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7522 """
554f62e9 7523 return _core_.Yield(*args)
d55e5bfc 7524
554f62e9
RD
7525def YieldIfNeeded(*args):
7526 """
d55e5bfc
RD
7527 YieldIfNeeded() -> bool
7528
7529 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7530 """
554f62e9 7531 return _core_.YieldIfNeeded(*args)
d55e5bfc
RD
7532
7533def SafeYield(*args, **kwargs):
554f62e9 7534 """
d55e5bfc
RD
7535 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7536
c24da6d6
RD
7537 This function is similar to `wx.Yield`, except that it disables the
7538 user input to all program windows before calling `wx.Yield` and
7539 re-enables it again afterwards. If ``win`` is not None, this window
7540 will remain enabled, allowing the implementation of some limited user
7541 interaction.
d55e5bfc 7542
c24da6d6 7543 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 7544 """
554f62e9 7545 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 7546
554f62e9
RD
7547def WakeUpIdle(*args):
7548 """
d55e5bfc
RD
7549 WakeUpIdle()
7550
c24da6d6
RD
7551 Cause the message queue to become empty again, so idle events will be
7552 sent.
d55e5bfc 7553 """
554f62e9 7554 return _core_.WakeUpIdle(*args)
d55e5bfc
RD
7555
7556def PostEvent(*args, **kwargs):
554f62e9 7557 """
d55e5bfc
RD
7558 PostEvent(EvtHandler dest, Event event)
7559
c24da6d6
RD
7560 Send an event to a window or other wx.EvtHandler to be processed
7561 later.
d55e5bfc 7562 """
554f62e9 7563 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 7564
554f62e9
RD
7565def App_CleanUp(*args):
7566 """
d55e5bfc
RD
7567 App_CleanUp()
7568
79fccf9d 7569 For internal use only, it is used to cleanup after wxWidgets when
c24da6d6 7570 Python shuts down.
d55e5bfc 7571 """
554f62e9 7572 return _core_.App_CleanUp(*args)
d55e5bfc 7573
554f62e9
RD
7574def GetApp(*args):
7575 """
d55e5bfc
RD
7576 GetApp() -> PyApp
7577
7578 Return a reference to the current wx.App object.
7579 """
554f62e9 7580 return _core_.GetApp(*args)
5cbf236d
RD
7581
7582def SetDefaultPyEncoding(*args, **kwargs):
554f62e9 7583 """
5cbf236d
RD
7584 SetDefaultPyEncoding(string encoding)
7585
7586 Sets the encoding that wxPython will use when it needs to convert a
7587 Python string or unicode object to or from a wxString.
62d32a5f
RD
7588
7589 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7590 but please be aware that the default encoding within the same locale
7591 may be slightly different on different platforms. For example, please
7592 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7593 between the common latin/roman encodings.
5cbf236d 7594 """
554f62e9 7595 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7596
554f62e9
RD
7597def GetDefaultPyEncoding(*args):
7598 """
5cbf236d
RD
7599 GetDefaultPyEncoding() -> string
7600
7601 Gets the current encoding that wxPython will use when it needs to
7602 convert a Python string or unicode object to or from a wxString.
7603 """
554f62e9 7604 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
7605#----------------------------------------------------------------------
7606
7607class PyOnDemandOutputWindow:
7608 """
7609 A class that can be used for redirecting Python's stdout and
7610 stderr streams. It will do nothing until something is wrriten to
7611 the stream at which point it will create a Frame with a text area
7612 and write the text there.
7613 """
7614 def __init__(self, title = "wxPython: stdout/stderr"):
7615 self.frame = None
7616 self.title = title
412d302d
RD
7617 self.pos = wx.DefaultPosition
7618 self.size = (450, 300)
d55e5bfc
RD
7619 self.parent = None
7620
7621 def SetParent(self, parent):
7622 """Set the window to be used as the popup Frame's parent."""
7623 self.parent = parent
7624
7625
7626 def CreateOutputWindow(self, st):
412d302d
RD
7627 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7628 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7629 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7630 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7631 self.text.AppendText(st)
d55e5bfc 7632 self.frame.Show(True)
2131d850 7633 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
7634
7635
7636 def OnCloseWindow(self, event):
7637 if self.frame is not None:
7638 self.frame.Destroy()
7639 self.frame = None
7640 self.text = None
7641
7642
7643 # These methods provide the file-like output behaviour.
7644 def write(self, text):
7645 """
7646 Create the output window if needed and write the string to it.
7647 If not called in the context of the gui thread then uses
7648 CallAfter to do the work there.
7649 """
7650 if self.frame is None:
7651 if not wx.Thread_IsMain():
7652 wx.CallAfter(self.CreateOutputWindow, text)
7653 else:
7654 self.CreateOutputWindow(text)
7655 else:
7656 if not wx.Thread_IsMain():
7657 wx.CallAfter(self.text.AppendText, text)
7658 else:
7659 self.text.AppendText(text)
7660
7661
7662 def close(self):
7663 if self.frame is not None:
7664 wx.CallAfter(self.frame.Close)
7665
7666
19272049
RD
7667 def flush(self):
7668 pass
7669
7670
d55e5bfc
RD
7671
7672#----------------------------------------------------------------------
7673
7674_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
fc46b7f3 7675
d55e5bfc
RD
7676class App(wx.PyApp):
7677 """
c24da6d6
RD
7678 The ``wx.App`` class represents the application and is used to:
7679
7680 * bootstrap the wxPython system and initialize the underlying
7681 gui toolkit
7682 * set and get application-wide properties
7683 * implement the windowing system main message or event loop,
7684 and to dispatch events to window instances
7685 * etc.
7686
7687 Every application must have a ``wx.App`` instance, and all
7688 creation of UI objects should be delayed until after the
7689 ``wx.App`` object has been created in order to ensure that the gui
7690 platform and wxWidgets have been fully initialized.
7691
7692 Normally you would derive from this class and implement an
7693 ``OnInit`` method that creates a frame and then calls
7694 ``self.SetTopWindow(frame)``.
7695
7696 :see: `wx.PySimpleApp` for a simpler app class that can be used
79fccf9d 7697 directly.
d55e5bfc 7698 """
c24da6d6 7699
d55e5bfc
RD
7700 outputWindowClass = PyOnDemandOutputWindow
7701
c24da6d6
RD
7702 def __init__(self, redirect=_defRedirect, filename=None,
7703 useBestVisual=False, clearSigInt=True):
7704 """
7705 Construct a ``wx.App`` object.
7706
7707 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7708 redirected? Defaults to True on Windows and Mac, False
7709 otherwise. If `filename` is None then output will be
7710 redirected to a window that pops up as needed. (You can
7711 control what kind of window is created for the output by
7712 resetting the class variable ``outputWindowClass`` to a
7713 class of your choosing.)
7714
7715 :param filename: The name of a file to redirect output to, if
7716 redirect is True.
7717
7718 :param useBestVisual: Should the app try to use the best
7719 available visual provided by the system (only relevant on
7720 systems that have more than one visual.) This parameter
7721 must be used instead of calling `SetUseBestVisual` later
7722 on because it must be set before the underlying GUI
7723 toolkit is initialized.
7724
7725 :param clearSigInt: Should SIGINT be cleared? This allows the
7726 app to terminate upon a Ctrl-C in the console like other
7727 GUI apps will.
7728
7729 :note: You should override OnInit to do applicaition
7730 initialization to ensure that the system, toolkit and
7731 wxWidgets are fully initialized.
7732 """
fc46b7f3 7733
d55e5bfc
RD
7734 wx.PyApp.__init__(self)
7735
fc46b7f3 7736 # make sure we can create a GUI
33d6fd3b 7737 if not self.IsDisplayAvailable():
fc46b7f3
RD
7738
7739 if wx.Platform == "__WXMAC__":
7740 msg = """This program needs access to the screen.
7741Please run with 'pythonw', not 'python', and only when you are logged
7742in on the main display of your Mac."""
7743
7744 elif wx.Platform == "__WXGTK__":
7745 msg ="Unable to access the X Display, is $DISPLAY set properly?"
d55e5bfc 7746
fc46b7f3
RD
7747 else:
7748 msg = "Unable to create GUI"
7749 # TODO: more description is needed for wxMSW...
7750
7751 raise SystemExit(msg)
7752
d55e5bfc
RD
7753 # This has to be done before OnInit
7754 self.SetUseBestVisual(useBestVisual)
7755
7756 # Set the default handler for SIGINT. This fixes a problem
7757 # where if Ctrl-C is pressed in the console that started this
7758 # app then it will not appear to do anything, (not even send
7759 # KeyboardInterrupt???) but will later segfault on exit. By
7760 # setting the default handler then the app will exit, as
7761 # expected (depending on platform.)
c24da6d6
RD
7762 if clearSigInt:
7763 try:
7764 import signal
7765 signal.signal(signal.SIGINT, signal.SIG_DFL)
7766 except:
7767 pass
d55e5bfc
RD
7768
7769 # Save and redirect the stdio to a window?
7770 self.stdioWin = None
7771 self.saveStdio = (_sys.stdout, _sys.stderr)
7772 if redirect:
7773 self.RedirectStdio(filename)
7774
8fb0e70a
RD
7775 # Use Python's install prefix as the default
7776 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7777
48a0c021
RD
7778 # Until the new native control for wxMac is up to par, still use the generic one.
7779 wx.SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 1)
7780
d55e5bfc
RD
7781 # This finishes the initialization of wxWindows and then calls
7782 # the OnInit that should be present in the derived class
7783 self._BootstrapApp()
7784
7785
f460c29d
RD
7786 def OnPreInit(self):
7787 """
7788 Things that must be done after _BootstrapApp has done its
7789 thing, but would be nice if they were already done by the time
7790 that OnInit is called.
7791 """
7792 wx.StockGDI._initStockObjects()
7793
7794
66af7a75
RD
7795 def __del__(self, destroy=wx.PyApp.__del__):
7796 self.RestoreStdio() # Just in case the MainLoop was overridden
7797 destroy(self)
d55e5bfc 7798
70b7a5fe 7799 def Destroy(self):
b39fe951 7800 self.this.own(False)
70b7a5fe 7801 wx.PyApp.Destroy(self)
d55e5bfc
RD
7802
7803 def SetTopWindow(self, frame):
7804 """Set the \"main\" top level window"""
7805 if self.stdioWin:
7806 self.stdioWin.SetParent(frame)
7807 wx.PyApp.SetTopWindow(self, frame)
7808
7809
7810 def MainLoop(self):
7811 """Execute the main GUI event loop"""
7812 wx.PyApp.MainLoop(self)
7813 self.RestoreStdio()
7814
7815
7816 def RedirectStdio(self, filename=None):
7817 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7818 if filename:
7819 _sys.stdout = _sys.stderr = open(filename, 'a')
7820 else:
7821 self.stdioWin = self.outputWindowClass()
7822 _sys.stdout = _sys.stderr = self.stdioWin
7823
7824
7825 def RestoreStdio(self):
66af7a75
RD
7826 try:
7827 _sys.stdout, _sys.stderr = self.saveStdio
7828 except:
7829 pass
d55e5bfc
RD
7830
7831
412d302d
RD
7832 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7833 """
7834 Set the title, position and/or size of the output window if
f5b96ee1
RD
7835 the stdio has been redirected. This should be called before
7836 any output would cause the output window to be created.
412d302d
RD
7837 """
7838 if self.stdioWin:
7839 if title is not None:
7840 self.stdioWin.title = title
7841 if pos is not None:
7842 self.stdioWin.pos = pos
7843 if size is not None:
7844 self.stdioWin.size = size
7845
7846
7847
d55e5bfc 7848
c24da6d6 7849# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7850App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7851App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7852App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7853App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7854App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7855App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7856App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7857App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7858App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7859App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7860App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7861
7862#----------------------------------------------------------------------------
7863
7864class PySimpleApp(wx.App):
7865 """
7866 A simple application class. You can just create one of these and
7867 then then make your top level windows later, and not have to worry
c24da6d6 7868 about OnInit. For example::
d55e5bfc 7869
c24da6d6
RD
7870 app = wx.PySimpleApp()
7871 frame = wx.Frame(None, title='Hello World')
7872 frame.Show()
7873 app.MainLoop()
7874
7875 :see: `wx.App`
7876 """
7877
7878 def __init__(self, redirect=False, filename=None,
7879 useBestVisual=False, clearSigInt=True):
7880 """
7881 :see: `wx.App.__init__`
7882 """
7883 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7884
7885 def OnInit(self):
d55e5bfc
RD
7886 return True
7887
7888
c24da6d6 7889
d55e5bfc
RD
7890# Is anybody using this one?
7891class PyWidgetTester(wx.App):
7892 def __init__(self, size = (250, 100)):
7893 self.size = size
7894 wx.App.__init__(self, 0)
7895
7896 def OnInit(self):
7897 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7898 self.SetTopWindow(self.frame)
7899 return True
7900
c24da6d6
RD
7901 def SetWidget(self, widgetClass, *args, **kwargs):
7902 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7903 self.frame.Show(True)
7904
7905#----------------------------------------------------------------------------
7906# DO NOT hold any other references to this object. This is how we
c24da6d6 7907# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7908# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
c24da6d6 7909# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7910
7911class __wxPyCleanup:
7912 def __init__(self):
7913 self.cleanup = _core_.App_CleanUp
7914 def __del__(self):
7915 self.cleanup()
7916
7917_sys.__wxPythonCleanup = __wxPyCleanup()
7918
7919## # another possible solution, but it gets called too early...
c24da6d6
RD
7920## import atexit
7921## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7922
7923
7924#----------------------------------------------------------------------------
7925
7926#---------------------------------------------------------------------------
7927
ae8162c8 7928class EventLoop(object):
093d3ff1 7929 """Proxy of C++ EventLoop class"""
554f62e9
RD
7930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7931 __repr__ = _swig_repr
7932 def __init__(self, *args, **kwargs):
ae8162c8 7933 """__init__(self) -> EventLoop"""
554f62e9
RD
7934 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7935 __swig_destroy__ = _core_.delete_EventLoop
7936 __del__ = lambda self : None;
ae8162c8
RD
7937 def Run(*args, **kwargs):
7938 """Run(self) -> int"""
7939 return _core_.EventLoop_Run(*args, **kwargs)
7940
7941 def Exit(*args, **kwargs):
7942 """Exit(self, int rc=0)"""
7943 return _core_.EventLoop_Exit(*args, **kwargs)
7944
7945 def Pending(*args, **kwargs):
7946 """Pending(self) -> bool"""
7947 return _core_.EventLoop_Pending(*args, **kwargs)
7948
7949 def Dispatch(*args, **kwargs):
7950 """Dispatch(self) -> bool"""
7951 return _core_.EventLoop_Dispatch(*args, **kwargs)
7952
7953 def IsRunning(*args, **kwargs):
7954 """IsRunning(self) -> bool"""
7955 return _core_.EventLoop_IsRunning(*args, **kwargs)
7956
7957 def GetActive(*args, **kwargs):
7958 """GetActive() -> EventLoop"""
7959 return _core_.EventLoop_GetActive(*args, **kwargs)
7960
7961 GetActive = staticmethod(GetActive)
7962 def SetActive(*args, **kwargs):
7963 """SetActive(EventLoop loop)"""
7964 return _core_.EventLoop_SetActive(*args, **kwargs)
7965
7966 SetActive = staticmethod(SetActive)
2131d850 7967_core_.EventLoop_swigregister(EventLoop)
ae8162c8 7968
554f62e9
RD
7969def EventLoop_GetActive(*args):
7970 """EventLoop_GetActive() -> EventLoop"""
7971 return _core_.EventLoop_GetActive(*args)
ae8162c8
RD
7972
7973def EventLoop_SetActive(*args, **kwargs):
554f62e9
RD
7974 """EventLoop_SetActive(EventLoop loop)"""
7975 return _core_.EventLoop_SetActive(*args, **kwargs)
ae8162c8 7976
7449af73
RD
7977class EventLoopActivator(object):
7978 """Proxy of C++ EventLoopActivator class"""
554f62e9
RD
7979 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7980 __repr__ = _swig_repr
7981 def __init__(self, *args, **kwargs):
7449af73 7982 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
554f62e9
RD
7983 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7984 __swig_destroy__ = _core_.delete_EventLoopActivator
7985 __del__ = lambda self : None;
2131d850 7986_core_.EventLoopActivator_swigregister(EventLoopActivator)
7449af73 7987
ae8162c8
RD
7988#---------------------------------------------------------------------------
7989
eec1c382
RD
7990ACCEL_ALT = _core_.ACCEL_ALT
7991ACCEL_CTRL = _core_.ACCEL_CTRL
7992ACCEL_SHIFT = _core_.ACCEL_SHIFT
7993ACCEL_NORMAL = _core_.ACCEL_NORMAL
7994ACCEL_CMD = _core_.ACCEL_CMD
d55e5bfc 7995class AcceleratorEntry(object):
c24da6d6
RD
7996 """
7997 A class used to define items in an `wx.AcceleratorTable`. wxPython
7998 programs can choose to use wx.AcceleratorEntry objects, but using a
7999 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
79fccf9d 8000 as well. See `__init__` for of the tuple values.
c24da6d6
RD
8001
8002 :see: `wx.AcceleratorTable`
8003 """
554f62e9
RD
8004 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8005 __repr__ = _swig_repr
8006 def __init__(self, *args, **kwargs):
c24da6d6
RD
8007 """
8008 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
8009
8010 Construct a wx.AcceleratorEntry.
c24da6d6 8011 """
554f62e9
RD
8012 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
8013 __swig_destroy__ = _core_.delete_AcceleratorEntry
8014 __del__ = lambda self : None;
d55e5bfc 8015 def Set(*args, **kwargs):
c24da6d6
RD
8016 """
8017 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 8018
c24da6d6
RD
8019 (Re)set the attributes of a wx.AcceleratorEntry.
8020 :see `__init__`
8021 """
8022 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc 8023
97ab0f6a
RD
8024 def Create(*args, **kwargs):
8025 """
8026 Create(String str) -> AcceleratorEntry
8027
8028 Create accelerator corresponding to the specified string, or None if
8029 it coulnd't be parsed.
8030 """
8031 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8032
8033 Create = staticmethod(Create)
d55e5bfc 8034 def GetFlags(*args, **kwargs):
c24da6d6
RD
8035 """
8036 GetFlags(self) -> int
8037
8038 Get the AcceleratorEntry's flags.
8039 """
d55e5bfc
RD
8040 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
8041
8042 def GetKeyCode(*args, **kwargs):
c24da6d6
RD
8043 """
8044 GetKeyCode(self) -> int
8045
8046 Get the AcceleratorEntry's keycode.
8047 """
d55e5bfc
RD
8048 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
8049
8050 def GetCommand(*args, **kwargs):
c24da6d6
RD
8051 """
8052 GetCommand(self) -> int
8053
8054 Get the AcceleratorEntry's command ID.
8055 """
d55e5bfc
RD
8056 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
8057
97ab0f6a
RD
8058 def IsOk(*args, **kwargs):
8059 """IsOk(self) -> bool"""
8060 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
8061
8062 def ToString(*args, **kwargs):
8063 """
8064 ToString(self) -> String
8065
8066 Returns a string representation for the this accelerator. The string
8067 is formatted using the <flags>-<keycode> format where <flags> maybe a
8068 hyphen-separed list of "shift|alt|ctrl"
8069
8070 """
8071 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
8072
8073 def FromString(*args, **kwargs):
8074 """
8075 FromString(self, String str) -> bool
8076
8077 Returns true if the given string correctly initialized this object.
8078 """
8079 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
8080
226118fc
RD
8081 Command = property(GetCommand,doc="See `GetCommand`")
8082 Flags = property(GetFlags,doc="See `GetFlags`")
8083 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
2131d850 8084_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc 8085
97ab0f6a
RD
8086def AcceleratorEntry_Create(*args, **kwargs):
8087 """
8088 AcceleratorEntry_Create(String str) -> AcceleratorEntry
8089
8090 Create accelerator corresponding to the specified string, or None if
8091 it coulnd't be parsed.
8092 """
8093 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8094
d55e5bfc 8095class AcceleratorTable(Object):
c24da6d6
RD
8096 """
8097 An accelerator table allows the application to specify a table of
8098 keyboard shortcuts for menus or other commands. On Windows, menu or
8099 button commands are supported; on GTK, only menu commands are
8100 supported.
c24da6d6 8101 """
554f62e9
RD
8102 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8103 __repr__ = _swig_repr
8104 def __init__(self, *args, **kwargs):
d55e5bfc
RD
8105 """
8106 __init__(entries) -> AcceleratorTable
8107
c24da6d6
RD
8108 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8109 items or or of 3-tuples (flags, keyCode, cmdID)
8110
8111 :see: `wx.AcceleratorEntry`
d55e5bfc 8112 """
554f62e9
RD
8113 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
8114 __swig_destroy__ = _core_.delete_AcceleratorTable
8115 __del__ = lambda self : None;
b39fe951
RD
8116 def IsOk(*args, **kwargs):
8117 """IsOk(self) -> bool"""
8118 return _core_.AcceleratorTable_IsOk(*args, **kwargs)
d55e5bfc 8119
b39fe951 8120 Ok = IsOk
2131d850 8121_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc 8122
cbfc9df6
RD
8123def GetAccelFromString(label):
8124 entry = AcceleratorEntry()
8125 entry.FromString(label)
8126 return entry
d55e5bfc 8127
d55e5bfc
RD
8128#---------------------------------------------------------------------------
8129
8130class VisualAttributes(object):
8131 """struct containing all the visual attributes of a control"""
554f62e9
RD
8132 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8133 __repr__ = _swig_repr
8134 def __init__(self, *args, **kwargs):
d55e5bfc
RD
8135 """
8136 __init__(self) -> VisualAttributes
8137
8138 struct containing all the visual attributes of a control
8139 """
554f62e9
RD
8140 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
8141 __swig_destroy__ = _core_.delete_VisualAttributes
8142 __del__ = lambda self : None;
d55e5bfc
RD
8143 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
8144 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
8145 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 8146_core_.VisualAttributes_swigregister(VisualAttributes)
d55e5bfc
RD
8147NullAcceleratorTable = cvar.NullAcceleratorTable
8148PanelNameStr = cvar.PanelNameStr
8149
8150WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8151WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8152WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8153WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8154WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
8155class Window(EvtHandler):
8156 """
8157 wx.Window is the base class for all windows and represents any visible
8158 object on the screen. All controls, top level windows and so on are
8159 wx.Windows. Sizers and device contexts are not however, as they don't
8160 appear on screen themselves.
8161
8162 """
554f62e9
RD
8163 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8164 __repr__ = _swig_repr
8165 def __init__(self, *args, **kwargs):
d55e5bfc
RD
8166 """
8167 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8168 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
8169
8170 Construct and show a generic Window.
8171 """
554f62e9 8172 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
8173 self._setOORInfo(self)
8174
8175 def Create(*args, **kwargs):
8176 """
8177 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8178 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
8179
8180 Create the GUI part of the Window for 2-phase creation mode.
8181 """
8182 return _core_.Window_Create(*args, **kwargs)
8183
8184 def Close(*args, **kwargs):
8185 """
8186 Close(self, bool force=False) -> bool
8187
8188 This function simply generates a EVT_CLOSE event whose handler usually
8189 tries to close the window. It doesn't close the window itself,
8190 however. If force is False (the default) then the window's close
8191 handler will be allowed to veto the destruction of the window.
d55e5bfc
RD
8192 """
8193 return _core_.Window_Close(*args, **kwargs)
8194
8195 def Destroy(*args, **kwargs):
8196 """
8197 Destroy(self) -> bool
8198
8199 Destroys the window safely. Frames and dialogs are not destroyed
8200 immediately when this function is called -- they are added to a list
8201 of windows to be deleted on idle time, when all the window's events
8202 have been processed. This prevents problems with events being sent to
8203 non-existent windows.
8204
8205 Returns True if the window has either been successfully deleted, or it
8206 has been added to the list of windows pending real deletion.
8207 """
b39fe951
RD
8208 args[0].this.own(False)
8209 return _core_.Window_Destroy(*args, **kwargs)
d55e5bfc
RD
8210
8211 def DestroyChildren(*args, **kwargs):
8212 """
8213 DestroyChildren(self) -> bool
8214
79fccf9d
RD
8215 Destroys all children of a window. Called automatically by the
8216 destructor.
d55e5bfc
RD
8217 """
8218 return _core_.Window_DestroyChildren(*args, **kwargs)
8219
8220 def IsBeingDeleted(*args, **kwargs):
8221 """
8222 IsBeingDeleted(self) -> bool
8223
8224 Is the window in the process of being deleted?
8225 """
8226 return _core_.Window_IsBeingDeleted(*args, **kwargs)
8227
d55e5bfc
RD
8228 def SetLabel(*args, **kwargs):
8229 """
8230 SetLabel(self, String label)
8231
8232 Set the text which the window shows in its label if applicable.
8233 """
8234 return _core_.Window_SetLabel(*args, **kwargs)
8235
8236 def GetLabel(*args, **kwargs):
8237 """
8238 GetLabel(self) -> String
8239
79fccf9d
RD
8240 Generic way of getting a label from any window, for identification
8241 purposes. The interpretation of this function differs from class to
8242 class. For frames and dialogs, the value returned is the title. For
8243 buttons or static text controls, it is the button text. This function
8244 can be useful for meta-programs such as testing tools or special-needs
8245 access programs)which need to identify windows by name.
d55e5bfc
RD
8246 """
8247 return _core_.Window_GetLabel(*args, **kwargs)
8248
8249 def SetName(*args, **kwargs):
8250 """
8251 SetName(self, String name)
8252
79fccf9d
RD
8253 Sets the window's name. The window name is used for ressource setting
8254 in X, it is not the same as the window title/label
d55e5bfc
RD
8255 """
8256 return _core_.Window_SetName(*args, **kwargs)
8257
8258 def GetName(*args, **kwargs):
8259 """
8260 GetName(self) -> String
8261
79fccf9d
RD
8262 Returns the windows name. This name is not guaranteed to be unique;
8263 it is up to the programmer to supply an appropriate name in the window
8264 constructor or via wx.Window.SetName.
d55e5bfc
RD
8265 """
8266 return _core_.Window_GetName(*args, **kwargs)
8267
8268 def SetWindowVariant(*args, **kwargs):
8269 """
8270 SetWindowVariant(self, int variant)
8271
79fccf9d
RD
8272 Sets the variant of the window/font size to use for this window, if
8273 the platform supports variants, for example, wxMac.
d55e5bfc
RD
8274 """
8275 return _core_.Window_SetWindowVariant(*args, **kwargs)
8276
8277 def GetWindowVariant(*args, **kwargs):
8278 """GetWindowVariant(self) -> int"""
8279 return _core_.Window_GetWindowVariant(*args, **kwargs)
8280
8281 def SetId(*args, **kwargs):
8282 """
8283 SetId(self, int winid)
8284
8285 Sets the identifier of the window. Each window has an integer
8286 identifier. If the application has not provided one, an identifier
8287 will be generated. Normally, the identifier should be provided on
8288 creation and should not be modified subsequently.
8289 """
8290 return _core_.Window_SetId(*args, **kwargs)
8291
8292 def GetId(*args, **kwargs):
8293 """
8294 GetId(self) -> int
8295
8296 Returns the identifier of the window. Each window has an integer
8297 identifier. If the application has not provided one (or the default Id
8298 -1 is used) then an unique identifier with a negative value will be
8299 generated.
8300 """
8301 return _core_.Window_GetId(*args, **kwargs)
8302
8303 def NewControlId(*args, **kwargs):
8304 """
c24da6d6 8305 NewControlId() -> int
d55e5bfc
RD
8306
8307 Generate a control id for the controls which were not given one.
8308 """
8309 return _core_.Window_NewControlId(*args, **kwargs)
8310
8311 NewControlId = staticmethod(NewControlId)
8312 def NextControlId(*args, **kwargs):
8313 """
c24da6d6 8314 NextControlId(int winid) -> int
d55e5bfc
RD
8315
8316 Get the id of the control following the one with the given
79fccf9d 8317 autogenerated) id
d55e5bfc
RD
8318 """
8319 return _core_.Window_NextControlId(*args, **kwargs)
8320
8321 NextControlId = staticmethod(NextControlId)
8322 def PrevControlId(*args, **kwargs):
8323 """
c24da6d6 8324 PrevControlId(int winid) -> int
d55e5bfc
RD
8325
8326 Get the id of the control preceding the one with the given
79fccf9d 8327 autogenerated) id
d55e5bfc
RD
8328 """
8329 return _core_.Window_PrevControlId(*args, **kwargs)
8330
8331 PrevControlId = staticmethod(PrevControlId)
97ab0f6a
RD
8332 def GetLayoutDirection(*args, **kwargs):
8333 """
994453b8 8334 GetLayoutDirection(self) -> int
97ab0f6a
RD
8335
8336 Get the layout direction (LTR or RTL) for this window. Returns
8337 ``wx.Layout_Default`` if layout direction is not supported.
8338 """
8339 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8340
8341 def SetLayoutDirection(*args, **kwargs):
8342 """
994453b8 8343 SetLayoutDirection(self, int dir)
97ab0f6a
RD
8344
8345 Set the layout direction (LTR or RTL) for this window.
8346 """
8347 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8348
8349 def AdjustForLayoutDirection(*args, **kwargs):
8350 """
8351 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8352
8353 Mirror coordinates for RTL layout if this window uses it and if the
8354 mirroring is not done automatically like Win32.
8355 """
8356 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8357
d55e5bfc
RD
8358 def SetSize(*args, **kwargs):
8359 """
8360 SetSize(self, Size size)
8361
8362 Sets the size of the window in pixels.
8363 """
8364 return _core_.Window_SetSize(*args, **kwargs)
8365
8366 def SetDimensions(*args, **kwargs):
8367 """
8368 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8369
8370 Sets the position and size of the window in pixels. The sizeFlags
8371 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
8372 equal to -1.
8373
8374 ======================== ======================================
8375 wx.SIZE_AUTO A -1 indicates that a class-specific
8376 default should be used.
8377 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8378 -1 values are supplied.
8379 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8380 interpreted as real dimensions, not
8381 default values.
8382 ======================== ======================================
8383
d55e5bfc
RD
8384 """
8385 return _core_.Window_SetDimensions(*args, **kwargs)
8386
8387 def SetRect(*args, **kwargs):
8388 """
8389 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8390
8391 Sets the position and size of the window in pixels using a wx.Rect.
8392 """
8393 return _core_.Window_SetRect(*args, **kwargs)
8394
8395 def SetSizeWH(*args, **kwargs):
8396 """
8397 SetSizeWH(self, int width, int height)
8398
8399 Sets the size of the window in pixels.
8400 """
8401 return _core_.Window_SetSizeWH(*args, **kwargs)
8402
8403 def Move(*args, **kwargs):
8404 """
8405 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8406
8407 Moves the window to the given position.
8408 """
8409 return _core_.Window_Move(*args, **kwargs)
8410
8411 SetPosition = Move
8412 def MoveXY(*args, **kwargs):
8413 """
8414 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8415
8416 Moves the window to the given position.
8417 """
8418 return _core_.Window_MoveXY(*args, **kwargs)
8419
580080c5 8420 def SetInitialSize(*args, **kwargs):
f8167d6e 8421 """
580080c5 8422 SetInitialSize(self, Size size=DefaultSize)
f8167d6e
RD
8423
8424 A 'Smart' SetSize that will fill in default size components with the
8425 window's *best size* values. Also set's the minsize for use with sizers.
8426 """
580080c5 8427 return _core_.Window_SetInitialSize(*args, **kwargs)
f8167d6e 8428
580080c5 8429 SetBestFittingSize = wx._deprecated(SetInitialSize, 'Use `SetInitialSize`')
d55e5bfc
RD
8430 def Raise(*args, **kwargs):
8431 """
8432 Raise(self)
8433
9d7dfdff 8434 Raises the window to the top of the window hierarchy. In current
70b63a99 8435 version of wxWidgets this works both for managed and child windows.
d55e5bfc
RD
8436 """
8437 return _core_.Window_Raise(*args, **kwargs)
8438
8439 def Lower(*args, **kwargs):
8440 """
8441 Lower(self)
8442
9d7dfdff 8443 Lowers the window to the bottom of the window hierarchy. In current
70b63a99 8444 version of wxWidgets this works both for managed and child windows.
d55e5bfc
RD
8445 """
8446 return _core_.Window_Lower(*args, **kwargs)
8447
8448 def SetClientSize(*args, **kwargs):
8449 """
8450 SetClientSize(self, Size size)
8451
8452 This sets the size of the window client area in pixels. Using this
8453 function to size a window tends to be more device-independent than
8454 wx.Window.SetSize, since the application need not worry about what
8455 dimensions the border or title bar have when trying to fit the window
8456 around panel items, for example.
8457 """
8458 return _core_.Window_SetClientSize(*args, **kwargs)
8459
8460 def SetClientSizeWH(*args, **kwargs):
8461 """
8462 SetClientSizeWH(self, int width, int height)
8463
8464 This sets the size of the window client area in pixels. Using this
8465 function to size a window tends to be more device-independent than
8466 wx.Window.SetSize, since the application need not worry about what
8467 dimensions the border or title bar have when trying to fit the window
8468 around panel items, for example.
8469 """
8470 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8471
8472 def SetClientRect(*args, **kwargs):
8473 """
8474 SetClientRect(self, Rect rect)
8475
8476 This sets the size of the window client area in pixels. Using this
8477 function to size a window tends to be more device-independent than
8478 wx.Window.SetSize, since the application need not worry about what
8479 dimensions the border or title bar have when trying to fit the window
8480 around panel items, for example.
8481 """
8482 return _core_.Window_SetClientRect(*args, **kwargs)
8483
8484 def GetPosition(*args, **kwargs):
8485 """
8486 GetPosition(self) -> Point
8487
1c71765a
RD
8488 Get the window's position. Notice that the position is in client
8489 coordinates for child windows and screen coordinates for the top level
8490 ones, use `GetScreenPosition` if you need screen coordinates for all
8491 kinds of windows.
d55e5bfc
RD
8492 """
8493 return _core_.Window_GetPosition(*args, **kwargs)
8494
8495 def GetPositionTuple(*args, **kwargs):
8496 """
8497 GetPositionTuple() -> (x,y)
8498
1c71765a
RD
8499 Get the window's position. Notice that the position is in client
8500 coordinates for child windows and screen coordinates for the top level
8501 ones, use `GetScreenPosition` if you need screen coordinates for all
8502 kinds of windows.
d55e5bfc
RD
8503 """
8504 return _core_.Window_GetPositionTuple(*args, **kwargs)
8505
1c71765a
RD
8506 def GetScreenPosition(*args, **kwargs):
8507 """
8508 GetScreenPosition(self) -> Point
8509
8510 Get the position of the window in screen coordinantes.
8511 """
8512 return _core_.Window_GetScreenPosition(*args, **kwargs)
8513
8514 def GetScreenPositionTuple(*args, **kwargs):
8515 """
8516 GetScreenPositionTuple() -> (x,y)
8517
8518 Get the position of the window in screen coordinantes.
8519 """
8520 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8521
8522 def GetScreenRect(*args, **kwargs):
8523 """
8524 GetScreenRect(self) -> Rect
8525
8526 Returns the size and position of the window in screen coordinantes as
8527 a `wx.Rect` object.
8528 """
8529 return _core_.Window_GetScreenRect(*args, **kwargs)
8530
d55e5bfc
RD
8531 def GetSize(*args, **kwargs):
8532 """
8533 GetSize(self) -> Size
8534
8535 Get the window size.
8536 """
8537 return _core_.Window_GetSize(*args, **kwargs)
8538
8539 def GetSizeTuple(*args, **kwargs):
8540 """
8541 GetSizeTuple() -> (width, height)
8542
8543 Get the window size.
8544 """
8545 return _core_.Window_GetSizeTuple(*args, **kwargs)
8546
8547 def GetRect(*args, **kwargs):
8548 """
8549 GetRect(self) -> Rect
8550
1c71765a 8551 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc
RD
8552 """
8553 return _core_.Window_GetRect(*args, **kwargs)
8554
8555 def GetClientSize(*args, **kwargs):
8556 """
8557 GetClientSize(self) -> Size
8558
8559 This gets the size of the window's 'client area' in pixels. The client
8560 area is the area which may be drawn on by the programmer, excluding
8561 title bar, border, scrollbars, etc.
8562 """
8563 return _core_.Window_GetClientSize(*args, **kwargs)
8564
8565 def GetClientSizeTuple(*args, **kwargs):
8566 """
8567 GetClientSizeTuple() -> (width, height)
8568
8569 This gets the size of the window's 'client area' in pixels. The client
8570 area is the area which may be drawn on by the programmer, excluding
8571 title bar, border, scrollbars, etc.
8572 """
8573 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8574
8575 def GetClientAreaOrigin(*args, **kwargs):
8576 """
8577 GetClientAreaOrigin(self) -> Point
8578
8579 Get the origin of the client area of the window relative to the
8580 window's top left corner (the client area may be shifted because of
8581 the borders, scrollbars, other decorations...)
8582 """
8583 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8584
8585 def GetClientRect(*args, **kwargs):
8586 """
8587 GetClientRect(self) -> Rect
8588
629f3c1b 8589 Get the client area position and size as a `wx.Rect` object.
d55e5bfc
RD
8590 """
8591 return _core_.Window_GetClientRect(*args, **kwargs)
8592
8593 def GetBestSize(*args, **kwargs):
8594 """
8595 GetBestSize(self) -> Size
8596
248ed943 8597 This function returns the best acceptable minimal size for the
79fccf9d
RD
8598 window, if applicable. For example, for a static text control, it will
8599 be the minimal size such that the control label is not truncated. For
8600 windows containing subwindows (suzh aswx.Panel), the size returned by
8601 this function will be the same as the size the window would have had
8602 after calling Fit.
d55e5bfc
RD
8603 """
8604 return _core_.Window_GetBestSize(*args, **kwargs)
8605
8606 def GetBestSizeTuple(*args, **kwargs):
8607 """
8608 GetBestSizeTuple() -> (width, height)
8609
248ed943 8610 This function returns the best acceptable minimal size for the
79fccf9d
RD
8611 window, if applicable. For example, for a static text control, it will
8612 be the minimal size such that the control label is not truncated. For
8613 windows containing subwindows (suzh aswx.Panel), the size returned by
8614 this function will be the same as the size the window would have had
8615 after calling Fit.
d55e5bfc
RD
8616 """
8617 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8618
a001823c
RD
8619 def InvalidateBestSize(*args, **kwargs):
8620 """
8621 InvalidateBestSize(self)
8622
8623 Reset the cached best size value so it will be recalculated the next
8624 time it is needed.
8625 """
8626 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8627
e2813725
RD
8628 def CacheBestSize(*args, **kwargs):
8629 """
8630 CacheBestSize(self, Size size)
8631
8632 Cache the best size so it doesn't need to be calculated again, (at least until
8633 some properties of the window change.)
8634 """
8635 return _core_.Window_CacheBestSize(*args, **kwargs)
8636
580080c5 8637 def GetEffectiveMinSize(*args, **kwargs):
a001823c 8638 """
580080c5 8639 GetEffectiveMinSize(self) -> Size
a001823c
RD
8640
8641 This function will merge the window's best size into the window's
8642 minimum size, giving priority to the min size components, and returns
8643 the results.
8644
8645 """
580080c5 8646 return _core_.Window_GetEffectiveMinSize(*args, **kwargs)
a001823c 8647
0d82d64e 8648 GetBestFittingSize = wx._deprecated(GetEffectiveMinSize, 'Use `GetEffectiveMinSize` instead.')
8f514ab4
RD
8649 def GetAdjustedBestSize(self):
8650 s = self.GetBestSize()
8651 return wx.Size(max(s.width, self.GetMinWidth()),
8652 max(s.height, self.GetMinHeight()))
580080c5 8653 GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetEffectiveMinSize` instead.')
d55e5bfc
RD
8654
8655 def Center(*args, **kwargs):
8656 """
8657 Center(self, int direction=BOTH)
8658
8659 Centers the window. The parameter specifies the direction for
8660 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8661 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8662 on the entire screen and not on its parent window. If it is a
8663 top-level window and has no parent then it will always be centered
8664 relative to the screen.
8665 """
8666 return _core_.Window_Center(*args, **kwargs)
8667
8668 Centre = Center
d55e5bfc
RD
8669 def CenterOnParent(*args, **kwargs):
8670 """
8671 CenterOnParent(self, int dir=BOTH)
8672
8673 Center with respect to the the parent window
8674 """
8675 return _core_.Window_CenterOnParent(*args, **kwargs)
8676
8677 CentreOnParent = CenterOnParent
8678 def Fit(*args, **kwargs):
8679 """
8680 Fit(self)
8681
8682 Sizes the window so that it fits around its subwindows. This function
8683 won't do anything if there are no subwindows and will only really work
8684 correctly if sizers are used for the subwindows layout. Also, if the
8685 window has exactly one subwindow it is better (faster and the result
8686 is more precise as Fit adds some margin to account for fuzziness of
8687 its calculations) to call window.SetClientSize(child.GetSize())
8688 instead of calling Fit.
8689 """
8690 return _core_.Window_Fit(*args, **kwargs)
8691
8692 def FitInside(*args, **kwargs):
8693 """
8694 FitInside(self)
8695
8696 Similar to Fit, but sizes the interior (virtual) size of a
8697 window. Mainly useful with scrolled windows to reset scrollbars after
8698 sizing changes that do not trigger a size event, and/or scrolled
8699 windows without an interior sizer. This function similarly won't do
8700 anything if there are no subwindows.
8701 """
8702 return _core_.Window_FitInside(*args, **kwargs)
8703
03837c5c 8704 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8705 """
8706 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8707 int incH=-1)
d55e5bfc
RD
8708
8709 Allows specification of minimum and maximum window sizes, and window
8710 size increments. If a pair of values is not set (or set to -1), the
8711 default values will be used. If this function is called, the user
908b74cd
RD
8712 will not be able to size the window outside the given bounds (if it is
8713 a top-level window.) Sizers will also inspect the minimum window size
8714 and will use that value if set when calculating layout.
8715
8716 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8717 """
03837c5c 8718 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8719
03837c5c
RD
8720 def SetSizeHintsSz(*args, **kwargs):
8721 """
8722 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8723
8724 Allows specification of minimum and maximum window sizes, and window
8725 size increments. If a pair of values is not set (or set to -1), the
8726 default values will be used. If this function is called, the user
8727 will not be able to size the window outside the given bounds (if it is
8728 a top-level window.) Sizers will also inspect the minimum window size
8729 and will use that value if set when calculating layout.
8730
8731 The resizing increments are only significant under Motif or Xt.
8732 """
8733 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8734
8735 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8736 """
908b74cd 8737 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8738
8739 Allows specification of minimum and maximum virtual window sizes. If a
8740 pair of values is not set (or set to -1), the default values will be
8741 used. If this function is called, the user will not be able to size
8742 the virtual area of the window outside the given bounds.
8743 """
03837c5c
RD
8744 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8745
8746 def SetVirtualSizeHintsSz(*args, **kwargs):
8747 """
8748 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8749
8750 Allows specification of minimum and maximum virtual window sizes. If a
8751 pair of values is not set (or set to -1), the default values will be
8752 used. If this function is called, the user will not be able to size
8753 the virtual area of the window outside the given bounds.
8754 """
8755 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8756
908b74cd
RD
8757 def GetMaxSize(*args, **kwargs):
8758 """GetMaxSize(self) -> Size"""
8759 return _core_.Window_GetMaxSize(*args, **kwargs)
8760
8761 def GetMinSize(*args, **kwargs):
8762 """GetMinSize(self) -> Size"""
8763 return _core_.Window_GetMinSize(*args, **kwargs)
8764
8765 def SetMinSize(*args, **kwargs):
8766 """
8767 SetMinSize(self, Size minSize)
8768
8769 A more convenient method than `SetSizeHints` for setting just the
8770 min size.
8771 """
8772 return _core_.Window_SetMinSize(*args, **kwargs)
8773
8774 def SetMaxSize(*args, **kwargs):
8775 """
8776 SetMaxSize(self, Size maxSize)
8777
8778 A more convenient method than `SetSizeHints` for setting just the
8779 max size.
8780 """
8781 return _core_.Window_SetMaxSize(*args, **kwargs)
8782
d55e5bfc
RD
8783 def GetMinWidth(*args, **kwargs):
8784 """GetMinWidth(self) -> int"""
8785 return _core_.Window_GetMinWidth(*args, **kwargs)
8786
8787 def GetMinHeight(*args, **kwargs):
8788 """GetMinHeight(self) -> int"""
8789 return _core_.Window_GetMinHeight(*args, **kwargs)
8790
8791 def GetMaxWidth(*args, **kwargs):
8792 """GetMaxWidth(self) -> int"""
8793 return _core_.Window_GetMaxWidth(*args, **kwargs)
8794
8795 def GetMaxHeight(*args, **kwargs):
8796 """GetMaxHeight(self) -> int"""
8797 return _core_.Window_GetMaxHeight(*args, **kwargs)
8798
d55e5bfc
RD
8799 def SetVirtualSize(*args, **kwargs):
8800 """
8801 SetVirtualSize(self, Size size)
8802
8803 Set the the virtual size of a window in pixels. For most windows this
8804 is just the client area of the window, but for some like scrolled
8805 windows it is more or less independent of the screen window size.
8806 """
8807 return _core_.Window_SetVirtualSize(*args, **kwargs)
8808
8809 def SetVirtualSizeWH(*args, **kwargs):
8810 """
8811 SetVirtualSizeWH(self, int w, int h)
8812
8813 Set the the virtual size of a window in pixels. For most windows this
8814 is just the client area of the window, but for some like scrolled
8815 windows it is more or less independent of the screen window size.
8816 """
8817 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8818
8819 def GetVirtualSize(*args, **kwargs):
8820 """
8821 GetVirtualSize(self) -> Size
8822
8823 Get the the virtual size of the window in pixels. For most windows
8824 this is just the client area of the window, but for some like scrolled
8825 windows it is more or less independent of the screen window size.
8826 """
8827 return _core_.Window_GetVirtualSize(*args, **kwargs)
8828
8829 def GetVirtualSizeTuple(*args, **kwargs):
8830 """
8831 GetVirtualSizeTuple() -> (width, height)
8832
8833 Get the the virtual size of the window in pixels. For most windows
8834 this is just the client area of the window, but for some like scrolled
8835 windows it is more or less independent of the screen window size.
8836 """
8837 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8838
cbdf0fb0
RD
8839 def GetWindowBorderSize(*args, **kwargs):
8840 """
8841 GetWindowBorderSize(self) -> Size
8842
8843 Return the size of the left/right and top/bottom borders.
8844 """
8845 return _core_.Window_GetWindowBorderSize(*args, **kwargs)
8846
d55e5bfc
RD
8847 def GetBestVirtualSize(*args, **kwargs):
8848 """
8849 GetBestVirtualSize(self) -> Size
8850
8851 Return the largest of ClientSize and BestSize (as determined by a
8852 sizer, interior children, or other means)
8853 """
8854 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8855
8856 def Show(*args, **kwargs):
8857 """
8858 Show(self, bool show=True) -> bool
8859
8860 Shows or hides the window. You may need to call Raise for a top level
8861 window if you want to bring it to top, although this is not needed if
8862 Show is called immediately after the frame creation. Returns True if
8863 the window has been shown or hidden or False if nothing was done
8864 because it already was in the requested state.
8865 """
8866 return _core_.Window_Show(*args, **kwargs)
8867
8868 def Hide(*args, **kwargs):
8869 """
8870 Hide(self) -> bool
8871
8872 Equivalent to calling Show(False).
8873 """
8874 return _core_.Window_Hide(*args, **kwargs)
8875
8876 def Enable(*args, **kwargs):
8877 """
8878 Enable(self, bool enable=True) -> bool
8879
8880 Enable or disable the window for user input. Note that when a parent
8881 window is disabled, all of its children are disabled as well and they
8882 are reenabled again when the parent is. Returns true if the window
8883 has been enabled or disabled, false if nothing was done, i.e. if the
8884 window had already been in the specified state.
8885 """
8886 return _core_.Window_Enable(*args, **kwargs)
8887
8888 def Disable(*args, **kwargs):
8889 """
8890 Disable(self) -> bool
8891
8892 Disables the window, same as Enable(false).
8893 """
8894 return _core_.Window_Disable(*args, **kwargs)
8895
8896 def IsShown(*args, **kwargs):
8897 """
8898 IsShown(self) -> bool
8899
8900 Returns true if the window is shown, false if it has been hidden.
8901 """
8902 return _core_.Window_IsShown(*args, **kwargs)
8903
8904 def IsEnabled(*args, **kwargs):
8905 """
8906 IsEnabled(self) -> bool
8907
8908 Returns true if the window is enabled for input, false otherwise.
cbfc9df6
RD
8909 This method takes into account the enabled state of parent windows up
8910 to the top-level window.
d55e5bfc
RD
8911 """
8912 return _core_.Window_IsEnabled(*args, **kwargs)
8913
cbfc9df6
RD
8914 def IsThisEnabled(*args, **kwargs):
8915 """
8916 IsThisEnabled(self) -> bool
8917
8918 Returns the internal enabled state independent of the parent(s) state,
8919 i.e. the state in which the window would be if all of its parents are
8920 enabled. Use `IsEnabled` to get the effective window state.
8921 """
8922 return _core_.Window_IsThisEnabled(*args, **kwargs)
8923
33d6fd3b
RD
8924 def IsShownOnScreen(*args, **kwargs):
8925 """
8926 IsShownOnScreen(self) -> bool
8927
8928 Returns ``True`` if the window is physically visible on the screen,
8929 i.e. it is shown and all its parents up to the toplevel window are
8930 shown as well.
8931 """
8932 return _core_.Window_IsShownOnScreen(*args, **kwargs)
8933
d55e5bfc
RD
8934 def SetWindowStyleFlag(*args, **kwargs):
8935 """
8936 SetWindowStyleFlag(self, long style)
8937
79fccf9d
RD
8938 Sets the style of the window. Please note that some styles cannot be
8939 changed after the window creation and that Refresh() might need to be
8940 called after changing the others for the change to take place
8941 immediately.
d55e5bfc
RD
8942 """
8943 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8944
8945 def GetWindowStyleFlag(*args, **kwargs):
8946 """
8947 GetWindowStyleFlag(self) -> long
8948
8949 Gets the window style that was passed to the constructor or Create
8950 method.
8951 """
8952 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8953
8954 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8955 def HasFlag(*args, **kwargs):
8956 """
8957 HasFlag(self, int flag) -> bool
8958
8959 Test if the given style is set for this window.
8960 """
8961 return _core_.Window_HasFlag(*args, **kwargs)
8962
8963 def IsRetained(*args, **kwargs):
8964 """
8965 IsRetained(self) -> bool
8966
8967 Returns true if the window is retained, false otherwise. Retained
8968 windows are only available on X platforms.
8969 """
8970 return _core_.Window_IsRetained(*args, **kwargs)
8971
5917d041
RD
8972 def ToggleWindowStyle(*args, **kwargs):
8973 """
8974 ToggleWindowStyle(self, int flag) -> bool
8975
8976 Turn the flag on if it had been turned off before and vice versa,
8977 returns True if the flag is turned on by this function call.
8978 """
8979 return _core_.Window_ToggleWindowStyle(*args, **kwargs)
8980
d55e5bfc
RD
8981 def SetExtraStyle(*args, **kwargs):
8982 """
8983 SetExtraStyle(self, long exStyle)
8984
8985 Sets the extra style bits for the window. Extra styles are the less
8986 often used style bits which can't be set with the constructor or with
8987 SetWindowStyleFlag()
8988 """
8989 return _core_.Window_SetExtraStyle(*args, **kwargs)
8990
8991 def GetExtraStyle(*args, **kwargs):
8992 """
8993 GetExtraStyle(self) -> long
8994
8995 Returns the extra style bits for the window.
8996 """
8997 return _core_.Window_GetExtraStyle(*args, **kwargs)
8998
8999 def MakeModal(*args, **kwargs):
9000 """
9001 MakeModal(self, bool modal=True)
9002
9003 Disables all other windows in the application so that the user can
9004 only interact with this window. Passing False will reverse this
9005 effect.
9006 """
9007 return _core_.Window_MakeModal(*args, **kwargs)
9008
9009 def SetThemeEnabled(*args, **kwargs):
9010 """
9011 SetThemeEnabled(self, bool enableTheme)
9012
9013 This function tells a window if it should use the system's "theme"
9014 code to draw the windows' background instead if its own background
9015 drawing code. This will only have an effect on platforms that support
9016 the notion of themes in user defined windows. One such platform is
9017 GTK+ where windows can have (very colourful) backgrounds defined by a
9018 user's selected theme.
9019
9020 Dialogs, notebook pages and the status bar have this flag set to true
9021 by default so that the default look and feel is simulated best.
9022 """
9023 return _core_.Window_SetThemeEnabled(*args, **kwargs)
9024
9025 def GetThemeEnabled(*args, **kwargs):
9026 """
9027 GetThemeEnabled(self) -> bool
9028
9029 Return the themeEnabled flag.
9030 """
9031 return _core_.Window_GetThemeEnabled(*args, **kwargs)
9032
9033 def SetFocus(*args, **kwargs):
9034 """
9035 SetFocus(self)
9036
9037 Set's the focus to this window, allowing it to receive keyboard input.
9038 """
9039 return _core_.Window_SetFocus(*args, **kwargs)
9040
9041 def SetFocusFromKbd(*args, **kwargs):
9042 """
9043 SetFocusFromKbd(self)
9044
9045 Set focus to this window as the result of a keyboard action. Normally
9046 only called internally.
9047 """
9048 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
9049
9050 def FindFocus(*args, **kwargs):
9051 """
c24da6d6 9052 FindFocus() -> Window
d55e5bfc
RD
9053
9054 Returns the window or control that currently has the keyboard focus,
9055 or None.
9056 """
9057 return _core_.Window_FindFocus(*args, **kwargs)
9058
9059 FindFocus = staticmethod(FindFocus)
9060 def AcceptsFocus(*args, **kwargs):
9061 """
9062 AcceptsFocus(self) -> bool
9063
9064 Can this window have focus?
9065 """
9066 return _core_.Window_AcceptsFocus(*args, **kwargs)
9067
cbfc9df6
RD
9068 def CanAcceptFocus(*args, **kwargs):
9069 """
9070 CanAcceptFocus(self) -> bool
9071
9072 Can this window have focus right now?
9073 """
9074 return _core_.Window_CanAcceptFocus(*args, **kwargs)
9075
d55e5bfc
RD
9076 def AcceptsFocusFromKeyboard(*args, **kwargs):
9077 """
9078 AcceptsFocusFromKeyboard(self) -> bool
9079
9080 Can this window be given focus by keyboard navigation? if not, the
9081 only way to give it focus (provided it accepts it at all) is to click
9082 it.
9083 """
9084 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
9085
cbfc9df6
RD
9086 def CanAcceptFocusFromKeyboard(*args, **kwargs):
9087 """
9088 CanAcceptFocusFromKeyboard(self) -> bool
9089
9090 Can this window be assigned focus from keyboard right now?
9091 """
9092 return _core_.Window_CanAcceptFocusFromKeyboard(*args, **kwargs)
9093
9094 def NavigateIn(*args, **kwargs):
9095 """
9096 NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool
9097
9098 Navigates inside this window.
9099 """
9100 return _core_.Window_NavigateIn(*args, **kwargs)
9101
908b74cd
RD
9102 def Navigate(*args, **kwargs):
9103 """
9104 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
9105
cbfc9df6
RD
9106 Does keyboard navigation starting from this window to another. This is
9107 equivalient to self.GetParent().NavigateIn().
908b74cd
RD
9108 """
9109 return _core_.Window_Navigate(*args, **kwargs)
9110
bf26d883
RD
9111 def MoveAfterInTabOrder(*args, **kwargs):
9112 """
9113 MoveAfterInTabOrder(self, Window win)
9114
9115 Moves this window in the tab navigation order after the specified
9116 sibling window. This means that when the user presses the TAB key on
9117 that other window, the focus switches to this window.
9118
9119 The default tab order is the same as creation order. This function
9120 and `MoveBeforeInTabOrder` allow to change it after creating all the
9121 windows.
9122
9123 """
9124 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
9125
9126 def MoveBeforeInTabOrder(*args, **kwargs):
9127 """
9128 MoveBeforeInTabOrder(self, Window win)
9129
9130 Same as `MoveAfterInTabOrder` except that it inserts this window just
9131 before win instead of putting it right after it.
9132 """
9133 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
9134
d55e5bfc
RD
9135 def GetChildren(*args, **kwargs):
9136 """
9137 GetChildren(self) -> PyObject
9138
9139 Returns a list of the window's children. NOTE: Currently this is a
9140 copy of the child window list maintained by the window, so the return
9141 value of this function is only valid as long as the window's children
9142 do not change.
9143 """
9144 return _core_.Window_GetChildren(*args, **kwargs)
9145
9146 def GetParent(*args, **kwargs):
9147 """
9148 GetParent(self) -> Window
9149
9150 Returns the parent window of this window, or None if there isn't one.
9151 """
9152 return _core_.Window_GetParent(*args, **kwargs)
9153
9154 def GetGrandParent(*args, **kwargs):
9155 """
9156 GetGrandParent(self) -> Window
9157
79fccf9d
RD
9158 Returns the parent of the parent of this window, or None if there
9159 isn't one.
d55e5bfc
RD
9160 """
9161 return _core_.Window_GetGrandParent(*args, **kwargs)
9162
cbfc9df6
RD
9163 def GetTopLevelParent(*args, **kwargs):
9164 """
9165 GetTopLevelParent(self) -> Window
9166
9167 Returns the first frame or dialog in this window's parental hierarchy.
9168 """
9169 return _core_.Window_GetTopLevelParent(*args, **kwargs)
9170
d55e5bfc
RD
9171 def IsTopLevel(*args, **kwargs):
9172 """
9173 IsTopLevel(self) -> bool
9174
9175 Returns true if the given window is a top-level one. Currently all
9176 frames and dialogs are always considered to be top-level windows (even
9177 if they have a parent window).
9178 """
9179 return _core_.Window_IsTopLevel(*args, **kwargs)
9180
9181 def Reparent(*args, **kwargs):
9182 """
9183 Reparent(self, Window newParent) -> bool
9184
9185 Reparents the window, i.e the window will be removed from its current
9186 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9187 re-inserted into another. Available on Windows and GTK. Returns True
9188 if the parent was changed, False otherwise (error or newParent ==
9189 oldParent)
9190 """
9191 return _core_.Window_Reparent(*args, **kwargs)
9192
9193 def AddChild(*args, **kwargs):
9194 """
9195 AddChild(self, Window child)
9196
9197 Adds a child window. This is called automatically by window creation
9198 functions so should not be required by the application programmer.
9199 """
9200 return _core_.Window_AddChild(*args, **kwargs)
9201
9202 def RemoveChild(*args, **kwargs):
9203 """
9204 RemoveChild(self, Window child)
9205
9206 Removes a child window. This is called automatically by window
9207 deletion functions so should not be required by the application
9208 programmer.
9209 """
9210 return _core_.Window_RemoveChild(*args, **kwargs)
9211
704eda0c
RD
9212 def SetDoubleBuffered(*args, **kwargs):
9213 """
9214 SetDoubleBuffered(self, bool on)
9215
9216 Currently wxGTK2 only.
9217 """
9218 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
9219
d55e5bfc
RD
9220 def FindWindowById(*args, **kwargs):
9221 """
9222 FindWindowById(self, long winid) -> Window
9223
9224 Find a chld of this window by window ID
9225 """
9226 return _core_.Window_FindWindowById(*args, **kwargs)
9227
9228 def FindWindowByName(*args, **kwargs):
9229 """
9230 FindWindowByName(self, String name) -> Window
9231
9232 Find a child of this window by name
9233 """
9234 return _core_.Window_FindWindowByName(*args, **kwargs)
9235
9236 def GetEventHandler(*args, **kwargs):
9237 """
9238 GetEventHandler(self) -> EvtHandler
9239
9240 Returns the event handler for this window. By default, the window is
9241 its own event handler.
9242 """
9243 return _core_.Window_GetEventHandler(*args, **kwargs)
9244
9245 def SetEventHandler(*args, **kwargs):
9246 """
9247 SetEventHandler(self, EvtHandler handler)
9248
9249 Sets the event handler for this window. An event handler is an object
d49bdf34
RD
9250 that is capable of processing the events sent to a window. (In other
9251 words, is able to dispatch the events to handler function.) By
9252 default, the window is its own event handler, but an application may
9253 wish to substitute another, for example to allow central
9254 implementation of event-handling for a variety of different window
9255 classes.
d55e5bfc 9256
79fccf9d 9257 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc 9258 up a chain of event handlers, where an event not handled by one event
d49bdf34 9259 handler is handed off to the next one in the chain.
d55e5bfc
RD
9260 """
9261 return _core_.Window_SetEventHandler(*args, **kwargs)
9262
9263 def PushEventHandler(*args, **kwargs):
9264 """
9265 PushEventHandler(self, EvtHandler handler)
9266
9267 Pushes this event handler onto the event handler stack for the window.
9268 An event handler is an object that is capable of processing the events
d49bdf34
RD
9269 sent to a window. (In other words, is able to dispatch the events to
9270 handler function.) By default, the window is its own event handler,
9271 but an application may wish to substitute another, for example to
9272 allow central implementation of event-handling for a variety of
9273 different window classes.
d55e5bfc
RD
9274
9275 wx.Window.PushEventHandler allows an application to set up a chain of
9276 event handlers, where an event not handled by one event handler is
d49bdf34
RD
9277 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
9278 to remove the event handler. Ownership of the handler is *not* given
9279 to the window, so you should be sure to pop the handler before the
9280 window is destroyed and either let PopEventHandler destroy it, or call
9281 its Destroy method yourself.
d55e5bfc
RD
9282 """
9283 return _core_.Window_PushEventHandler(*args, **kwargs)
9284
9285 def PopEventHandler(*args, **kwargs):
9286 """
9287 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
9288
9289 Removes and returns the top-most event handler on the event handler
9290 stack. If deleteHandler is True then the wx.EvtHandler object will be
d49bdf34 9291 destroyed after it is popped, and ``None`` will be returned instead.
d55e5bfc
RD
9292 """
9293 return _core_.Window_PopEventHandler(*args, **kwargs)
9294
9295 def RemoveEventHandler(*args, **kwargs):
9296 """
9297 RemoveEventHandler(self, EvtHandler handler) -> bool
9298
79fccf9d 9299 Find the given handler in the event handler chain and remove (but not
d49bdf34 9300 delete) it from the event handler chain, returns True if it was found
79fccf9d
RD
9301 and False otherwise (this also results in an assert failure so this
9302 function should only be called when the handler is supposed to be
9303 there.)
d55e5bfc
RD
9304 """
9305 return _core_.Window_RemoveEventHandler(*args, **kwargs)
9306
9307 def SetValidator(*args, **kwargs):
9308 """
9309 SetValidator(self, Validator validator)
9310
9311 Deletes the current validator (if any) and sets the window validator,
9312 having called wx.Validator.Clone to create a new validator of this
9313 type.
9314 """
9315 return _core_.Window_SetValidator(*args, **kwargs)
9316
9317 def GetValidator(*args, **kwargs):
9318 """
9319 GetValidator(self) -> Validator
9320
9321 Returns a pointer to the current validator for the window, or None if
9322 there is none.
9323 """
9324 return _core_.Window_GetValidator(*args, **kwargs)
9325
9326 def Validate(*args, **kwargs):
9327 """
9328 Validate(self) -> bool
9329
9330 Validates the current values of the child controls using their
79fccf9d
RD
9331 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9332 style flag set, the method will also call Validate() of all child
9333 windows. Returns false if any of the validations failed.
d55e5bfc
RD
9334 """
9335 return _core_.Window_Validate(*args, **kwargs)
9336
9337 def TransferDataToWindow(*args, **kwargs):
9338 """
9339 TransferDataToWindow(self) -> bool
9340
79fccf9d
RD
9341 Transfers values to child controls from data areas specified by their
9342 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9343 style flag set, the method will also call TransferDataToWindow() of
9344 all child windows.
d55e5bfc
RD
9345 """
9346 return _core_.Window_TransferDataToWindow(*args, **kwargs)
9347
9348 def TransferDataFromWindow(*args, **kwargs):
9349 """
9350 TransferDataFromWindow(self) -> bool
9351
79fccf9d
RD
9352 Transfers values from child controls to data areas specified by their
9353 validators. Returns false if a transfer failed. If the window has
9354 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9355 also call TransferDataFromWindow() of all child windows.
d55e5bfc
RD
9356 """
9357 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
9358
9359 def InitDialog(*args, **kwargs):
9360 """
9361 InitDialog(self)
9362
79fccf9d
RD
9363 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9364 to the dialog via validators.
d55e5bfc
RD
9365 """
9366 return _core_.Window_InitDialog(*args, **kwargs)
9367
9368 def SetAcceleratorTable(*args, **kwargs):
9369 """
9370 SetAcceleratorTable(self, AcceleratorTable accel)
9371
9372 Sets the accelerator table for this window.
9373 """
9374 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
9375
9376 def GetAcceleratorTable(*args, **kwargs):
9377 """
9378 GetAcceleratorTable(self) -> AcceleratorTable
9379
9380 Gets the accelerator table for this window.
9381 """
9382 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
9383
9384 def RegisterHotKey(*args, **kwargs):
9385 """
9386 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9387
9388 Registers a system wide hotkey. Every time the user presses the hotkey
9389 registered here, this window will receive a hotkey event. It will
9390 receive the event even if the application is in the background and
9391 does not have the input focus because the user is working with some
9392 other application. To bind an event handler function to this hotkey
9393 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9394 hotkey was registered successfully.
9395 """
9396 return _core_.Window_RegisterHotKey(*args, **kwargs)
9397
9398 def UnregisterHotKey(*args, **kwargs):
9399 """
9400 UnregisterHotKey(self, int hotkeyId) -> bool
9401
9402 Unregisters a system wide hotkey.
9403 """
9404 return _core_.Window_UnregisterHotKey(*args, **kwargs)
9405
9406 def ConvertDialogPointToPixels(*args, **kwargs):
9407 """
9408 ConvertDialogPointToPixels(self, Point pt) -> Point
9409
9410 Converts a point or size from dialog units to pixels. Dialog units
9411 are used for maintaining a dialog's proportions even if the font
9412 changes. For the x dimension, the dialog units are multiplied by the
9413 average character width and then divided by 4. For the y dimension,
9414 the dialog units are multiplied by the average character height and
9415 then divided by 8.
9416 """
9417 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
9418
9419 def ConvertDialogSizeToPixels(*args, **kwargs):
9420 """
9421 ConvertDialogSizeToPixels(self, Size sz) -> Size
9422
9423 Converts a point or size from dialog units to pixels. Dialog units
9424 are used for maintaining a dialog's proportions even if the font
9425 changes. For the x dimension, the dialog units are multiplied by the
9426 average character width and then divided by 4. For the y dimension,
9427 the dialog units are multiplied by the average character height and
9428 then divided by 8.
9429 """
9430 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
9431
9432 def DLG_PNT(*args, **kwargs):
9433 """
9434 DLG_PNT(self, Point pt) -> Point
9435
9436 Converts a point or size from dialog units to pixels. Dialog units
9437 are used for maintaining a dialog's proportions even if the font
9438 changes. For the x dimension, the dialog units are multiplied by the
9439 average character width and then divided by 4. For the y dimension,
9440 the dialog units are multiplied by the average character height and
9441 then divided by 8.
9442 """
9443 return _core_.Window_DLG_PNT(*args, **kwargs)
9444
9445 def DLG_SZE(*args, **kwargs):
9446 """
9447 DLG_SZE(self, Size sz) -> Size
9448
9449 Converts a point or size from dialog units to pixels. Dialog units
9450 are used for maintaining a dialog's proportions even if the font
9451 changes. For the x dimension, the dialog units are multiplied by the
9452 average character width and then divided by 4. For the y dimension,
9453 the dialog units are multiplied by the average character height and
9454 then divided by 8.
9455 """
9456 return _core_.Window_DLG_SZE(*args, **kwargs)
9457
9458 def ConvertPixelPointToDialog(*args, **kwargs):
9459 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9460 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
9461
9462 def ConvertPixelSizeToDialog(*args, **kwargs):
9463 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9464 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
9465
9466 def WarpPointer(*args, **kwargs):
9467 """
9468 WarpPointer(self, int x, int y)
9469
9470 Moves the pointer to the given position on the window.
9471
9472 NOTE: This function is not supported under Mac because Apple Human
9473 Interface Guidelines forbid moving the mouse cursor programmatically.
9474 """
9475 return _core_.Window_WarpPointer(*args, **kwargs)
9476
9477 def CaptureMouse(*args, **kwargs):
9478 """
9479 CaptureMouse(self)
9480
9481 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9482 release the capture.
9483
9484 Note that wxWindows maintains the stack of windows having captured the
9485 mouse and when the mouse is released the capture returns to the window
9486 which had had captured it previously and it is only really released if
9487 there were no previous window. In particular, this means that you must
0f83f5da
RD
9488 release the mouse as many times as you capture it, unless the window
9489 receives the `wx.MouseCaptureLostEvent` event.
9490
9491 Any application which captures the mouse in the beginning of some
9492 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9493 operation when it receives the event. The event handler must not
9494 recapture mouse.
d55e5bfc
RD
9495 """
9496 return _core_.Window_CaptureMouse(*args, **kwargs)
9497
9498 def ReleaseMouse(*args, **kwargs):
9499 """
9500 ReleaseMouse(self)
9501
9502 Releases mouse input captured with wx.Window.CaptureMouse.
9503 """
9504 return _core_.Window_ReleaseMouse(*args, **kwargs)
9505
9506 def GetCapture(*args, **kwargs):
9507 """
c24da6d6 9508 GetCapture() -> Window
d55e5bfc
RD
9509
9510 Returns the window which currently captures the mouse or None
9511 """
9512 return _core_.Window_GetCapture(*args, **kwargs)
9513
9514 GetCapture = staticmethod(GetCapture)
9515 def HasCapture(*args, **kwargs):
9516 """
9517 HasCapture(self) -> bool
9518
9519 Returns true if this window has the current mouse capture.
9520 """
9521 return _core_.Window_HasCapture(*args, **kwargs)
9522
9523 def Refresh(*args, **kwargs):
9524 """
9525 Refresh(self, bool eraseBackground=True, Rect rect=None)
9526
9527 Mark the specified rectangle (or the whole window) as "dirty" so it
9528 will be repainted. Causes an EVT_PAINT event to be generated and sent
9529 to the window.
9530 """
9531 return _core_.Window_Refresh(*args, **kwargs)
9532
9533 def RefreshRect(*args, **kwargs):
9534 """
fef4c27a 9535 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
9536
9537 Redraws the contents of the given rectangle: the area inside it will
9538 be repainted. This is the same as Refresh but has a nicer syntax.
9539 """
9540 return _core_.Window_RefreshRect(*args, **kwargs)
9541
9542 def Update(*args, **kwargs):
9543 """
9544 Update(self)
9545
9546 Calling this method immediately repaints the invalidated area of the
9547 window instead of waiting for the EVT_PAINT event to happen, (normally
9548 this would usually only happen when the flow of control returns to the
9549 event loop.) Notice that this function doesn't refresh the window and
9b940138 9550 does nothing if the window has been already repainted. Use `Refresh`
d55e5bfc
RD
9551 first if you want to immediately redraw the window (or some portion of
9552 it) unconditionally.
9553 """
9554 return _core_.Window_Update(*args, **kwargs)
9555
9556 def ClearBackground(*args, **kwargs):
9557 """
9558 ClearBackground(self)
9559
9560 Clears the window by filling it with the current background
9561 colour. Does not cause an erase background event to be generated.
9562 """
9563 return _core_.Window_ClearBackground(*args, **kwargs)
9564
9565 def Freeze(*args, **kwargs):
9566 """
9567 Freeze(self)
9568
79fccf9d
RD
9569 Freezes the window or, in other words, prevents any updates from
9570 taking place on screen, the window is not redrawn at all. Thaw must be
9571 called to reenable window redrawing. Calls to Freeze/Thaw may be
9572 nested, with the actual Thaw being delayed until all the nesting has
9573 been undone.
d55e5bfc
RD
9574
9575 This method is useful for visual appearance optimization (for example,
9576 it is a good idea to use it before inserting large amount of text into
9577 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9578 for all controls so it is mostly just a hint to wxWindows and not a
9579 mandatory directive.
9580 """
9581 return _core_.Window_Freeze(*args, **kwargs)
9582
33d6fd3b
RD
9583 def IsFrozen(*args, **kwargs):
9584 """
9585 IsFrozen(self) -> bool
9586
9587 Returns ``True`` if the window has been frozen and not thawed yet.
9588
9589 :see: `Freeze` and `Thaw`
9590 """
9591 return _core_.Window_IsFrozen(*args, **kwargs)
9592
d55e5bfc
RD
9593 def Thaw(*args, **kwargs):
9594 """
9595 Thaw(self)
9596
9597 Reenables window updating after a previous call to Freeze. Calls to
79fccf9d
RD
9598 Freeze/Thaw may be nested, so Thaw must be called the same number of
9599 times that Freeze was before the window will be updated.
d55e5bfc
RD
9600 """
9601 return _core_.Window_Thaw(*args, **kwargs)
9602
9603 def PrepareDC(*args, **kwargs):
9604 """
9605 PrepareDC(self, DC dc)
9606
9607 Call this function to prepare the device context for drawing a
9608 scrolled image. It sets the device origin according to the current
9609 scroll position.
9610 """
9611 return _core_.Window_PrepareDC(*args, **kwargs)
9612
b39fe951
RD
9613 def IsDoubleBuffered(*args, **kwargs):
9614 """
9615 IsDoubleBuffered(self) -> bool
9616
9617 Returns ``True`` if the window contents is double-buffered by the
9618 system, i.e. if any drawing done on the window is really done on a
9619 temporary backing surface and transferred to the screen all at once
9620 later.
9621 """
9622 return _core_.Window_IsDoubleBuffered(*args, **kwargs)
9623
d55e5bfc
RD
9624 def GetUpdateRegion(*args, **kwargs):
9625 """
9626 GetUpdateRegion(self) -> Region
9627
9628 Returns the region specifying which parts of the window have been
9629 damaged. Should only be called within an EVT_PAINT handler.
9630 """
9631 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9632
9633 def GetUpdateClientRect(*args, **kwargs):
9634 """
9635 GetUpdateClientRect(self) -> Rect
9636
9637 Get the update rectangle region bounding box in client coords.
9638 """
9639 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9640
9641 def IsExposed(*args, **kwargs):
9642 """
9643 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9644
9645 Returns true if the given point or rectangle area has been exposed
9646 since the last repaint. Call this in an paint event handler to
9647 optimize redrawing by only redrawing those areas, which have been
9648 exposed.
9649 """
9650 return _core_.Window_IsExposed(*args, **kwargs)
9651
9652 def IsExposedPoint(*args, **kwargs):
9653 """
9654 IsExposedPoint(self, Point pt) -> bool
9655
9656 Returns true if the given point or rectangle area has been exposed
9657 since the last repaint. Call this in an paint event handler to
9658 optimize redrawing by only redrawing those areas, which have been
9659 exposed.
9660 """
9661 return _core_.Window_IsExposedPoint(*args, **kwargs)
9662
9663 def IsExposedRect(*args, **kwargs):
9664 """
9665 IsExposedRect(self, Rect rect) -> bool
9666
9667 Returns true if the given point or rectangle area has been exposed
9668 since the last repaint. Call this in an paint event handler to
9669 optimize redrawing by only redrawing those areas, which have been
9670 exposed.
9671 """
9672 return _core_.Window_IsExposedRect(*args, **kwargs)
9673
9674 def GetDefaultAttributes(*args, **kwargs):
9675 """
9676 GetDefaultAttributes(self) -> VisualAttributes
9677
79fccf9d
RD
9678 Get the default attributes for an instance of this class. This is
9679 useful if you want to use the same font or colour in your own control
9680 as in a standard control -- which is a much better idea than hard
9681 coding specific colours or fonts which might look completely out of
caef1a4d 9682 place on the user's system, especially if it uses themes.
d55e5bfc
RD
9683 """
9684 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9685
9686 def GetClassDefaultAttributes(*args, **kwargs):
9687 """
c24da6d6 9688 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9689
79fccf9d
RD
9690 Get the default attributes for this class. This is useful if you want
9691 to use the same font or colour in your own control as in a standard
9692 control -- which is a much better idea than hard coding specific
caef1a4d
RD
9693 colours or fonts which might look completely out of place on the
9694 user's system, especially if it uses themes.
d55e5bfc
RD
9695
9696 The variant parameter is only relevant under Mac currently and is
79fccf9d 9697 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
9698 the returned font. See `wx.Window.SetWindowVariant` for more about
9699 this.
d55e5bfc
RD
9700 """
9701 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9702
9703 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9704 def SetBackgroundColour(*args, **kwargs):
9705 """
9706 SetBackgroundColour(self, Colour colour) -> bool
9707
9708 Sets the background colour of the window. Returns True if the colour
9709 was changed. The background colour is usually painted by the default
9710 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9711 automatically under GTK. Using `wx.NullColour` will reset the window
9712 to the default background colour.
d55e5bfc 9713
caef1a4d 9714 Note that setting the background colour may not cause an immediate
f8167d6e 9715 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
9716 calling this function.
9717
f8167d6e
RD
9718 Using this function will disable attempts to use themes for this
9719 window, if the system supports them. Use with care since usually the
9720 themes represent the appearance chosen by the user to be used for all
9721 applications on the system.
d55e5bfc
RD
9722 """
9723 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9724
412d302d
RD
9725 def SetOwnBackgroundColour(*args, **kwargs):
9726 """SetOwnBackgroundColour(self, Colour colour)"""
9727 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9728
9729 def SetForegroundColour(*args, **kwargs):
9730 """
9731 SetForegroundColour(self, Colour colour) -> bool
9732
9733 Sets the foreground colour of the window. Returns True is the colour
9734 was changed. The interpretation of foreground colour is dependent on
9735 the window class; it may be the text colour or other colour, or it may
9736 not be used at all.
9737 """
9738 return _core_.Window_SetForegroundColour(*args, **kwargs)
9739
fa47d7a7
VS
9740 def SetOwnForegroundColour(*args, **kwargs):
9741 """SetOwnForegroundColour(self, Colour colour)"""
9742 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9743
9744 def GetBackgroundColour(*args, **kwargs):
9745 """
9746 GetBackgroundColour(self) -> Colour
9747
9748 Returns the background colour of the window.
9749 """
9750 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9751
9752 def GetForegroundColour(*args, **kwargs):
9753 """
9754 GetForegroundColour(self) -> Colour
9755
9756 Returns the foreground colour of the window. The interpretation of
9757 foreground colour is dependent on the window class; it may be the text
9758 colour or other colour, or it may not be used at all.
9759 """
9760 return _core_.Window_GetForegroundColour(*args, **kwargs)
9761
dcb8fc74
RD
9762 def InheritsBackgroundColour(*args, **kwargs):
9763 """InheritsBackgroundColour(self) -> bool"""
9764 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9765
9766 def UseBgCol(*args, **kwargs):
9767 """UseBgCol(self) -> bool"""
9768 return _core_.Window_UseBgCol(*args, **kwargs)
9769
0f63ec68
RD
9770 def SetBackgroundStyle(*args, **kwargs):
9771 """
9772 SetBackgroundStyle(self, int style) -> bool
9773
9774 Returns the background style of the window. The background style
9775 indicates how the background of the window is drawn.
9776
9777 ====================== ========================================
9778 wx.BG_STYLE_SYSTEM The background colour or pattern should
9779 be determined by the system
9780 wx.BG_STYLE_COLOUR The background should be a solid colour
9781 wx.BG_STYLE_CUSTOM The background will be implemented by the
9782 application.
9783 ====================== ========================================
9784
9785 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9786 a custom background, such as a tiled bitmap. Currently the style has
9787 no effect on other platforms.
9788
9789 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9790 """
9791 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9792
9793 def GetBackgroundStyle(*args, **kwargs):
9794 """
9795 GetBackgroundStyle(self) -> int
9796
9797 Returns the background style of the window.
9798
9799 :see: `SetBackgroundStyle`
9800 """
9801 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9802
51b83b37
RD
9803 def HasTransparentBackground(*args, **kwargs):
9804 """
9805 HasTransparentBackground(self) -> bool
9806
9807 Returns True if this window's background is transparent (as, for
9808 example, for `wx.StaticText`) and should show the parent window's
9809 background.
9810
9811 This method is mostly used internally by the library itself and you
9812 normally shouldn't have to call it. You may, however, have to override
9813 it in your custom control classes to ensure that background is painted
9814 correctly.
9815 """
9816 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9817
d55e5bfc
RD
9818 def SetCursor(*args, **kwargs):
9819 """
9820 SetCursor(self, Cursor cursor) -> bool
9821
9822 Sets the window's cursor. Notice that the window cursor also sets it
9823 for the children of the window implicitly.
9824
9825 The cursor may be wx.NullCursor in which case the window cursor will
9826 be reset back to default.
9827 """
9828 return _core_.Window_SetCursor(*args, **kwargs)
9829
9830 def GetCursor(*args, **kwargs):
9831 """
9832 GetCursor(self) -> Cursor
9833
9834 Return the cursor associated with this window.
9835 """
9836 return _core_.Window_GetCursor(*args, **kwargs)
9837
9838 def SetFont(*args, **kwargs):
9839 """
9840 SetFont(self, Font font) -> bool
9841
9842 Sets the font for this window.
9843 """
9844 return _core_.Window_SetFont(*args, **kwargs)
9845
fa47d7a7
VS
9846 def SetOwnFont(*args, **kwargs):
9847 """SetOwnFont(self, Font font)"""
9848 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9849
9850 def GetFont(*args, **kwargs):
9851 """
9852 GetFont(self) -> Font
9853
9854 Returns the default font used for this window.
9855 """
9856 return _core_.Window_GetFont(*args, **kwargs)
9857
9858 def SetCaret(*args, **kwargs):
9859 """
9860 SetCaret(self, Caret caret)
9861
9862 Sets the caret associated with the window.
9863 """
9864 return _core_.Window_SetCaret(*args, **kwargs)
9865
9866 def GetCaret(*args, **kwargs):
9867 """
9868 GetCaret(self) -> Caret
9869
9870 Returns the caret associated with the window.
9871 """
9872 return _core_.Window_GetCaret(*args, **kwargs)
9873
9874 def GetCharHeight(*args, **kwargs):
9875 """
9876 GetCharHeight(self) -> int
9877
9878 Get the (average) character size for the current font.
9879 """
9880 return _core_.Window_GetCharHeight(*args, **kwargs)
9881
9882 def GetCharWidth(*args, **kwargs):
9883 """
9884 GetCharWidth(self) -> int
9885
9886 Get the (average) character size for the current font.
9887 """
9888 return _core_.Window_GetCharWidth(*args, **kwargs)
9889
9890 def GetTextExtent(*args, **kwargs):
a8eff060
RD
9891 """
9892 GetTextExtent(String string) -> (width, height)
9893
9894 Get the width and height of the text using the current font.
9895 """
d55e5bfc
RD
9896 return _core_.Window_GetTextExtent(*args, **kwargs)
9897
9898 def GetFullTextExtent(*args, **kwargs):
9899 """
9900 GetFullTextExtent(String string, Font font=None) ->
9901 (width, height, descent, externalLeading)
9902
9903 Get the width, height, decent and leading of the text using the
9904 current or specified font.
9905 """
9906 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9907
9908 def ClientToScreenXY(*args, **kwargs):
9909 """
9910 ClientToScreenXY(int x, int y) -> (x,y)
9911
9912 Converts to screen coordinates from coordinates relative to this window.
9913 """
9914 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9915
9916 def ScreenToClientXY(*args, **kwargs):
9917 """
9918 ScreenToClientXY(int x, int y) -> (x,y)
9919
9920 Converts from screen to client window coordinates.
9921 """
9922 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9923
9924 def ClientToScreen(*args, **kwargs):
9925 """
9926 ClientToScreen(self, Point pt) -> Point
9927
9928 Converts to screen coordinates from coordinates relative to this window.
9929 """
9930 return _core_.Window_ClientToScreen(*args, **kwargs)
9931
9932 def ScreenToClient(*args, **kwargs):
9933 """
9934 ScreenToClient(self, Point pt) -> Point
9935
9936 Converts from screen to client window coordinates.
9937 """
9938 return _core_.Window_ScreenToClient(*args, **kwargs)
9939
9940 def HitTestXY(*args, **kwargs):
9941 """
9942 HitTestXY(self, int x, int y) -> int
9943
9944 Test where the given (in client coords) point lies
9945 """
9946 return _core_.Window_HitTestXY(*args, **kwargs)
9947
9948 def HitTest(*args, **kwargs):
9949 """
9950 HitTest(self, Point pt) -> int
9951
9952 Test where the given (in client coords) point lies
9953 """
9954 return _core_.Window_HitTest(*args, **kwargs)
9955
9956 def GetBorder(*args):
9957 """
9958 GetBorder(self, long flags) -> int
9959 GetBorder(self) -> int
9960
9961 Get border for the flags of this window
9962 """
9963 return _core_.Window_GetBorder(*args)
9964
9965 def UpdateWindowUI(*args, **kwargs):
9966 """
9967 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9968
9969 This function sends EVT_UPDATE_UI events to the window. The particular
9970 implementation depends on the window; for example a wx.ToolBar will
9971 send an update UI event for each toolbar button, and a wx.Frame will
9972 send an update UI event for each menubar menu item. You can call this
9973 function from your application to ensure that your UI is up-to-date at
9974 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9975 concerned). This may be necessary if you have called
5ba5649b 9976 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9977 limit the overhead that wxWindows incurs by sending update UI events
9978 in idle time.
d55e5bfc
RD
9979 """
9980 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9981
9982 def PopupMenuXY(*args, **kwargs):
9983 """
7a0b95b0 9984 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9985
7a0b95b0
RD
9986 Pops up the given menu at the specified coordinates, relative to this window,
9987 and returns control when the user has dismissed the menu. If a menu item is
9988 selected, the corresponding menu event is generated and will be processed as
9989 usual. If the default position is given then the current position of the
9990 mouse cursor will be used.
d55e5bfc
RD
9991 """
9992 return _core_.Window_PopupMenuXY(*args, **kwargs)
9993
9994 def PopupMenu(*args, **kwargs):
9995 """
7a0b95b0 9996 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9997
7a0b95b0
RD
9998 Pops up the given menu at the specified coordinates, relative to this window,
9999 and returns control when the user has dismissed the menu. If a menu item is
10000 selected, the corresponding menu event is generated and will be processed as
10001 usual. If the default position is given then the current position of the
10002 mouse cursor will be used.
d55e5bfc
RD
10003 """
10004 return _core_.Window_PopupMenu(*args, **kwargs)
10005
1eeb270e
RD
10006 def HasMultiplePages(*args, **kwargs):
10007 """HasMultiplePages(self) -> bool"""
10008 return _core_.Window_HasMultiplePages(*args, **kwargs)
10009
d55e5bfc
RD
10010 def GetHandle(*args, **kwargs):
10011 """
10012 GetHandle(self) -> long
10013
10014 Returns the platform-specific handle (as a long integer) of the
10015 physical window. Currently on wxMac it returns the handle of the
10016 toplevel parent of the window.
10017 """
10018 return _core_.Window_GetHandle(*args, **kwargs)
10019
629e65c2
RD
10020 def AssociateHandle(*args, **kwargs):
10021 """
10022 AssociateHandle(self, long handle)
10023
10024 Associate the window with a new native handle
10025 """
10026 return _core_.Window_AssociateHandle(*args, **kwargs)
10027
10028 def DissociateHandle(*args, **kwargs):
10029 """
10030 DissociateHandle(self)
10031
10032 Dissociate the current native handle from the window
10033 """
10034 return _core_.Window_DissociateHandle(*args, **kwargs)
10035
d55e5bfc
RD
10036 def OnPaint(*args, **kwargs):
10037 """OnPaint(self, PaintEvent event)"""
10038 return _core_.Window_OnPaint(*args, **kwargs)
10039
10040 def HasScrollbar(*args, **kwargs):
10041 """
10042 HasScrollbar(self, int orient) -> bool
10043
10044 Does the window have the scrollbar for this orientation?
10045 """
10046 return _core_.Window_HasScrollbar(*args, **kwargs)
10047
10048 def SetScrollbar(*args, **kwargs):
10049 """
79fccf9d 10050 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
10051 bool refresh=True)
10052
10053 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc
RD
10054 """
10055 return _core_.Window_SetScrollbar(*args, **kwargs)
10056
10057 def SetScrollPos(*args, **kwargs):
10058 """
10059 SetScrollPos(self, int orientation, int pos, bool refresh=True)
10060
10061 Sets the position of one of the built-in scrollbars.
10062 """
10063 return _core_.Window_SetScrollPos(*args, **kwargs)
10064
10065 def GetScrollPos(*args, **kwargs):
10066 """
10067 GetScrollPos(self, int orientation) -> int
10068
10069 Returns the built-in scrollbar position.
10070 """
10071 return _core_.Window_GetScrollPos(*args, **kwargs)
10072
10073 def GetScrollThumb(*args, **kwargs):
10074 """
10075 GetScrollThumb(self, int orientation) -> int
10076
10077 Returns the built-in scrollbar thumb size.
10078 """
10079 return _core_.Window_GetScrollThumb(*args, **kwargs)
10080
10081 def GetScrollRange(*args, **kwargs):
10082 """
10083 GetScrollRange(self, int orientation) -> int
10084
10085 Returns the built-in scrollbar range.
10086 """
10087 return _core_.Window_GetScrollRange(*args, **kwargs)
10088
10089 def ScrollWindow(*args, **kwargs):
10090 """
10091 ScrollWindow(self, int dx, int dy, Rect rect=None)
10092
10093 Physically scrolls the pixels in the window and move child windows
10094 accordingly. Use this function to optimise your scrolling
10095 implementations, to minimise the area that must be redrawn. Note that
10096 it is rarely required to call this function from a user program.
d55e5bfc
RD
10097 """
10098 return _core_.Window_ScrollWindow(*args, **kwargs)
10099
10100 def ScrollLines(*args, **kwargs):
10101 """
10102 ScrollLines(self, int lines) -> bool
10103
10104 If the platform and window class supports it, scrolls the window by
10105 the given number of lines down, if lines is positive, or up if lines
10106 is negative. Returns True if the window was scrolled, False if it was
10107 already on top/bottom and nothing was done.
10108 """
10109 return _core_.Window_ScrollLines(*args, **kwargs)
10110
10111 def ScrollPages(*args, **kwargs):
10112 """
10113 ScrollPages(self, int pages) -> bool
10114
79fccf9d 10115 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
10116 the given number of pages down, if pages is positive, or up if pages
10117 is negative. Returns True if the window was scrolled, False if it was
10118 already on top/bottom and nothing was done.
10119 """
10120 return _core_.Window_ScrollPages(*args, **kwargs)
10121
10122 def LineUp(*args, **kwargs):
10123 """
10124 LineUp(self) -> bool
10125
10126 This is just a wrapper for ScrollLines(-1).
10127 """
10128 return _core_.Window_LineUp(*args, **kwargs)
10129
10130 def LineDown(*args, **kwargs):
10131 """
10132 LineDown(self) -> bool
10133
10134 This is just a wrapper for ScrollLines(1).
10135 """
10136 return _core_.Window_LineDown(*args, **kwargs)
10137
10138 def PageUp(*args, **kwargs):
10139 """
10140 PageUp(self) -> bool
10141
10142 This is just a wrapper for ScrollPages(-1).
10143 """
10144 return _core_.Window_PageUp(*args, **kwargs)
10145
10146 def PageDown(*args, **kwargs):
10147 """
10148 PageDown(self) -> bool
10149
10150 This is just a wrapper for ScrollPages(1).
10151 """
10152 return _core_.Window_PageDown(*args, **kwargs)
10153
10154 def SetHelpText(*args, **kwargs):
10155 """
10156 SetHelpText(self, String text)
10157
10158 Sets the help text to be used as context-sensitive help for this
10159 window. Note that the text is actually stored by the current
f52cbe90 10160 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc
RD
10161 """
10162 return _core_.Window_SetHelpText(*args, **kwargs)
10163
10164 def SetHelpTextForId(*args, **kwargs):
10165 """
10166 SetHelpTextForId(self, String text)
10167
10168 Associate this help text with all windows with the same id as this
10169 one.
10170 """
10171 return _core_.Window_SetHelpTextForId(*args, **kwargs)
10172
b850e7f3
RD
10173 def GetHelpTextAtPoint(*args, **kwargs):
10174 """
10175 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
10176
10177 Get the help string associated with the given position in this window.
10178
10179 Notice that pt may be invalid if event origin is keyboard or unknown
10180 and this method should return the global window help text then
10181
10182 """
10183 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
10184
d55e5bfc
RD
10185 def GetHelpText(*args, **kwargs):
10186 """
10187 GetHelpText(self) -> String
10188
10189 Gets the help text to be used as context-sensitive help for this
10190 window. Note that the text is actually stored by the current
f52cbe90 10191 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc
RD
10192 """
10193 return _core_.Window_GetHelpText(*args, **kwargs)
10194
10195 def SetToolTipString(*args, **kwargs):
10196 """
10197 SetToolTipString(self, String tip)
10198
10199 Attach a tooltip to the window.
10200 """
10201 return _core_.Window_SetToolTipString(*args, **kwargs)
10202
10203 def SetToolTip(*args, **kwargs):
10204 """
10205 SetToolTip(self, ToolTip tip)
10206
10207 Attach a tooltip to the window.
10208 """
10209 return _core_.Window_SetToolTip(*args, **kwargs)
10210
10211 def GetToolTip(*args, **kwargs):
10212 """
10213 GetToolTip(self) -> ToolTip
10214
10215 get the associated tooltip or None if none
10216 """
10217 return _core_.Window_GetToolTip(*args, **kwargs)
10218
10219 def SetDropTarget(*args, **kwargs):
10220 """
10221 SetDropTarget(self, DropTarget dropTarget)
10222
10223 Associates a drop target with this window. If the window already has
10224 a drop target, it is deleted.
10225 """
10226 return _core_.Window_SetDropTarget(*args, **kwargs)
10227
10228 def GetDropTarget(*args, **kwargs):
10229 """
10230 GetDropTarget(self) -> DropTarget
10231
10232 Returns the associated drop target, which may be None.
10233 """
10234 return _core_.Window_GetDropTarget(*args, **kwargs)
10235
10236 def DragAcceptFiles(*args, **kwargs):
10237 """
10238 DragAcceptFiles(self, bool accept)
10239
10240 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
5ba5649b 10241 Only functional on Windows.
d55e5bfc
RD
10242 """
10243 return _core_.Window_DragAcceptFiles(*args, **kwargs)
10244
10245 def SetConstraints(*args, **kwargs):
10246 """
10247 SetConstraints(self, LayoutConstraints constraints)
10248
10249 Sets the window to have the given layout constraints. If an existing
10250 layout constraints object is already owned by the window, it will be
10251 deleted. Pass None to disassociate and delete the window's current
10252 constraints.
10253
10254 You must call SetAutoLayout to tell a window to use the constraints
10255 automatically in its default EVT_SIZE handler; otherwise, you must
10256 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10257 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10258 effect.
10259 """
10260 return _core_.Window_SetConstraints(*args, **kwargs)
10261
10262 def GetConstraints(*args, **kwargs):
10263 """
10264 GetConstraints(self) -> LayoutConstraints
10265
10266 Returns a pointer to the window's layout constraints, or None if there
10267 are none.
10268 """
10269 return _core_.Window_GetConstraints(*args, **kwargs)
10270
10271 def SetAutoLayout(*args, **kwargs):
10272 """
10273 SetAutoLayout(self, bool autoLayout)
10274
10275 Determines whether the Layout function will be called automatically
b1fcee84
RD
10276 when the window is resized. lease note that this only happens for the
10277 windows usually used to contain children, namely `wx.Panel` and
10278 `wx.TopLevelWindow` (and the classes deriving from them).
10279
10280 This method is called implicitly by `SetSizer` but if you use
10281 `SetConstraints` you should call it manually or otherwise the window
10282 layout won't be correctly updated when its size changes.
d55e5bfc
RD
10283 """
10284 return _core_.Window_SetAutoLayout(*args, **kwargs)
10285
10286 def GetAutoLayout(*args, **kwargs):
10287 """
10288 GetAutoLayout(self) -> bool
10289
10290 Returns the current autoLayout setting
10291 """
10292 return _core_.Window_GetAutoLayout(*args, **kwargs)
10293
10294 def Layout(*args, **kwargs):
10295 """
10296 Layout(self) -> bool
10297
10298 Invokes the constraint-based layout algorithm or the sizer-based
10299 algorithm for this window. See SetAutoLayout: when auto layout is on,
10300 this function gets called automatically by the default EVT_SIZE
10301 handler when the window is resized.
10302 """
10303 return _core_.Window_Layout(*args, **kwargs)
10304
10305 def SetSizer(*args, **kwargs):
10306 """
10307 SetSizer(self, Sizer sizer, bool deleteOld=True)
10308
10309 Sets the window to have the given layout sizer. The window will then
10310 own the object, and will take care of its deletion. If an existing
10311 layout sizer object is already owned by the window, it will be deleted
10312 if the deleteOld parameter is true. Note that this function will also
10313 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 10314 non-None, and False otherwise.
d55e5bfc
RD
10315 """
10316 return _core_.Window_SetSizer(*args, **kwargs)
10317
10318 def SetSizerAndFit(*args, **kwargs):
10319 """
10320 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
10321
10322 The same as SetSizer, except it also sets the size hints for the
10323 window based on the sizer's minimum size.
10324 """
10325 return _core_.Window_SetSizerAndFit(*args, **kwargs)
10326
10327 def GetSizer(*args, **kwargs):
10328 """
10329 GetSizer(self) -> Sizer
10330
10331 Return the sizer associated with the window by a previous call to
10332 SetSizer or None if there isn't one.
10333 """
10334 return _core_.Window_GetSizer(*args, **kwargs)
10335
10336 def SetContainingSizer(*args, **kwargs):
10337 """
10338 SetContainingSizer(self, Sizer sizer)
10339
10340 This normally does not need to be called by application code. It is
10341 called internally when a window is added to a sizer, and is used so
10342 the window can remove itself from the sizer when it is destroyed.
10343 """
10344 return _core_.Window_SetContainingSizer(*args, **kwargs)
10345
10346 def GetContainingSizer(*args, **kwargs):
10347 """
10348 GetContainingSizer(self) -> Sizer
10349
10350 Return the sizer that this window is a member of, if any, otherwise None.
10351 """
10352 return _core_.Window_GetContainingSizer(*args, **kwargs)
10353
10354 def InheritAttributes(*args, **kwargs):
10355 """
10356 InheritAttributes(self)
10357
79fccf9d
RD
10358 This function is (or should be, in case of custom controls) called
10359 during window creation to intelligently set up the window visual
10360 attributes, that is the font and the foreground and background
10361 colours.
10362
10363 By 'intelligently' the following is meant: by default, all windows use
10364 their own default attributes. However if some of the parent's
10365 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10366 SetOwnFont) and if the corresponding attribute hadn't been
79fccf9d
RD
10367 explicitly set for this window itself, then this window takes the same
10368 value as used by the parent. In addition, if the window overrides
10369 ShouldInheritColours to return false, the colours will not be changed
10370 no matter what and only the font might.
10371
ec9b55ca
RD
10372 This rather complicated logic is necessary in order to accommodate the
10373 different usage scenarios. The most common one is when all default
79fccf9d
RD
10374 attributes are used and in this case, nothing should be inherited as
10375 in modern GUIs different controls use different fonts (and colours)
10376 than their siblings so they can't inherit the same value from the
10377 parent. However it was also deemed desirable to allow to simply change
10378 the attributes of all children at once by just changing the font or
10379 colour of their common parent, hence in this case we do inherit the
10380 parents attributes.
10381
d55e5bfc
RD
10382 """
10383 return _core_.Window_InheritAttributes(*args, **kwargs)
10384
10385 def ShouldInheritColours(*args, **kwargs):
10386 """
10387 ShouldInheritColours(self) -> bool
10388
10389 Return true from here to allow the colours of this window to be
79fccf9d
RD
10390 changed by InheritAttributes, returning false forbids inheriting them
10391 from the parent window.
d55e5bfc 10392
79fccf9d
RD
10393 The base class version returns false, but this method is overridden in
10394 wxControl where it returns true.
d55e5bfc
RD
10395 """
10396 return _core_.Window_ShouldInheritColours(*args, **kwargs)
10397
fc46b7f3
RD
10398 def CanSetTransparent(*args, **kwargs):
10399 """
10400 CanSetTransparent(self) -> bool
10401
10402 Returns ``True`` if the platform supports setting the transparency for
10403 this window. Note that this method will err on the side of caution,
10404 so it is possible that this will return ``False`` when it is in fact
10405 possible to set the transparency.
10406
10407 NOTE: On X-windows systems the X server must have the composite
10408 extension loaded, and there must be a composite manager program (such
10409 as xcompmgr) running.
10410 """
10411 return _core_.Window_CanSetTransparent(*args, **kwargs)
10412
10413 def SetTransparent(*args, **kwargs):
10414 """
10415 SetTransparent(self, byte alpha) -> bool
10416
10417 Attempt to set the transparency of this window to the ``alpha`` value,
10418 returns True on success. The ``alpha`` value is an integer in the
10419 range of 0 to 255, where 0 is fully transparent and 255 is fully
10420 opaque.
10421 """
10422 return _core_.Window_SetTransparent(*args, **kwargs)
10423
d55e5bfc
RD
10424 def PostCreate(self, pre):
10425 """
10426 Phase 3 of the 2-phase create <wink!>
10427 Call this method after precreating the window with the 2-phase create method.
10428 """
10429 self.this = pre.this
10430 self.thisown = pre.thisown
10431 pre.thisown = 0
10432 if hasattr(self, '_setOORInfo'):
4976f996
RD
10433 try:
10434 self._setOORInfo(self)
10435 except TypeError:
10436 pass
d55e5bfc 10437 if hasattr(self, '_setCallbackInfo'):
4976f996
RD
10438 try:
10439 self._setCallbackInfo(self, pre.__class__)
10440 except TypeError:
10441 pass
d55e5bfc 10442
7e08d4ef 10443 def SendSizeEvent(self):
0ef86618 10444 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 10445
226118fc 10446 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
226118fc
RD
10447 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10448 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10449 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
580080c5 10450 EffectiveMinSize = property(GetEffectiveMinSize,doc="See `GetEffectiveMinSize`")
226118fc
RD
10451 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10452 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10453 Border = property(GetBorder,doc="See `GetBorder`")
10454 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10455 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10456 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10457 Children = property(GetChildren,doc="See `GetChildren`")
10458 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10459 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10460 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10461 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10462 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10463 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10464 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10465 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10466 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10467 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10468 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10469 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
226118fc 10470 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
cbfc9df6 10471 TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`")
226118fc
RD
10472 Handle = property(GetHandle,doc="See `GetHandle`")
10473 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
226118fc
RD
10474 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10475 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
994453b8 10476 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
226118fc
RD
10477 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10478 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10479 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10480 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10481 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10482 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10483 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10484 Parent = property(GetParent,doc="See `GetParent`")
10485 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10486 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10487 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10488 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
226118fc
RD
10489 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10490 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
226118fc
RD
10491 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10492 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10493 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10494 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10495 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10496 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10497 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10498 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10499 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
97ab0f6a
RD
10500 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10501 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10502 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
2131d850 10503_core_.Window_swigregister(Window)
d55e5bfc
RD
10504
10505def PreWindow(*args, **kwargs):
10506 """
10507 PreWindow() -> Window
10508
10509 Precreate a Window for 2-phase creation.
10510 """
10511 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
10512 return val
10513
554f62e9
RD
10514def Window_NewControlId(*args):
10515 """
d55e5bfc
RD
10516 Window_NewControlId() -> int
10517
10518 Generate a control id for the controls which were not given one.
10519 """
554f62e9 10520 return _core_.Window_NewControlId(*args)
d55e5bfc
RD
10521
10522def Window_NextControlId(*args, **kwargs):
554f62e9 10523 """
d55e5bfc
RD
10524 Window_NextControlId(int winid) -> int
10525
10526 Get the id of the control following the one with the given
79fccf9d 10527 autogenerated) id
d55e5bfc 10528 """
554f62e9 10529 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
10530
10531def Window_PrevControlId(*args, **kwargs):
554f62e9 10532 """
d55e5bfc
RD
10533 Window_PrevControlId(int winid) -> int
10534
10535 Get the id of the control preceding the one with the given
79fccf9d 10536 autogenerated) id
d55e5bfc 10537 """
554f62e9 10538 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 10539
554f62e9
RD
10540def Window_FindFocus(*args):
10541 """
d55e5bfc
RD
10542 Window_FindFocus() -> Window
10543
10544 Returns the window or control that currently has the keyboard focus,
10545 or None.
10546 """
554f62e9 10547 return _core_.Window_FindFocus(*args)
d55e5bfc 10548
554f62e9
RD
10549def Window_GetCapture(*args):
10550 """
d55e5bfc
RD
10551 Window_GetCapture() -> Window
10552
10553 Returns the window which currently captures the mouse or None
10554 """
554f62e9 10555 return _core_.Window_GetCapture(*args)
d55e5bfc
RD
10556
10557def Window_GetClassDefaultAttributes(*args, **kwargs):
554f62e9 10558 """
d55e5bfc
RD
10559 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10560
79fccf9d
RD
10561 Get the default attributes for this class. This is useful if you want
10562 to use the same font or colour in your own control as in a standard
10563 control -- which is a much better idea than hard coding specific
caef1a4d
RD
10564 colours or fonts which might look completely out of place on the
10565 user's system, especially if it uses themes.
d55e5bfc
RD
10566
10567 The variant parameter is only relevant under Mac currently and is
79fccf9d 10568 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
10569 the returned font. See `wx.Window.SetWindowVariant` for more about
10570 this.
d55e5bfc 10571 """
554f62e9 10572 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10573
10574def DLG_PNT(win, point_or_x, y=None):
10575 """
10576 Convenience function for converting a Point or (x,y) in
10577 dialog units to pixel units.
10578 """
10579 if y is None:
10580 return win.ConvertDialogPointToPixels(point_or_x)
10581 else:
10582 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10583
10584def DLG_SZE(win, size_width, height=None):
10585 """
10586 Convenience function for converting a Size or (w,h) in
10587 dialog units to pixel units.
10588 """
10589 if height is None:
10590 return win.ConvertDialogSizeToPixels(size_width)
10591 else:
10592 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10593
10594
10595def FindWindowById(*args, **kwargs):
554f62e9 10596 """
d55e5bfc
RD
10597 FindWindowById(long id, Window parent=None) -> Window
10598
10599 Find the first window in the application with the given id. If parent
10600 is None, the search will start from all top-level frames and dialog
10601 boxes; if non-None, the search will be limited to the given window
10602 hierarchy. The search is recursive in both cases.
10603 """
554f62e9 10604 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc
RD
10605
10606def FindWindowByName(*args, **kwargs):
554f62e9 10607 """
d55e5bfc
RD
10608 FindWindowByName(String name, Window parent=None) -> Window
10609
10610 Find a window by its name (as given in a window constructor or Create
10611 function call). If parent is None, the search will start from all
10612 top-level frames and dialog boxes; if non-None, the search will be
10613 limited to the given window hierarchy. The search is recursive in both
10614 cases.
10615
10616 If no window with such name is found, wx.FindWindowByLabel is called.
10617 """
554f62e9 10618 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc
RD
10619
10620def FindWindowByLabel(*args, **kwargs):
554f62e9 10621 """
d55e5bfc
RD
10622 FindWindowByLabel(String label, Window parent=None) -> Window
10623
10624 Find a window by its label. Depending on the type of window, the label
10625 may be a window title or panel item label. If parent is None, the
10626 search will start from all top-level frames and dialog boxes; if
10627 non-None, the search will be limited to the given window
10628 hierarchy. The search is recursive in both cases.
10629 """
554f62e9 10630 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc
RD
10631
10632def Window_FromHWND(*args, **kwargs):
554f62e9
RD
10633 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10634 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 10635
554f62e9
RD
10636def GetTopLevelWindows(*args):
10637 """
3215336e
RD
10638 GetTopLevelWindows() -> PyObject
10639
10640 Returns a list of the the application's top-level windows, (frames,
10641 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10642 by wxWidgets, and so it is only valid as long as no top-level windows
10643 are closed or new top-level windows are created.
10644
10645 """
554f62e9 10646 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
10647#---------------------------------------------------------------------------
10648
10649class Validator(EvtHandler):
093d3ff1 10650 """Proxy of C++ Validator class"""
554f62e9
RD
10651 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10652 __repr__ = _swig_repr
10653 def __init__(self, *args, **kwargs):
d55e5bfc 10654 """__init__(self) -> Validator"""
554f62e9 10655 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
10656 self._setOORInfo(self)
10657
10658 def Clone(*args, **kwargs):
10659 """Clone(self) -> Validator"""
10660 return _core_.Validator_Clone(*args, **kwargs)
10661
10662 def Validate(*args, **kwargs):
10663 """Validate(self, Window parent) -> bool"""
10664 return _core_.Validator_Validate(*args, **kwargs)
10665
10666 def TransferToWindow(*args, **kwargs):
10667 """TransferToWindow(self) -> bool"""
10668 return _core_.Validator_TransferToWindow(*args, **kwargs)
10669
10670 def TransferFromWindow(*args, **kwargs):
10671 """TransferFromWindow(self) -> bool"""
10672 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10673
10674 def GetWindow(*args, **kwargs):
10675 """GetWindow(self) -> Window"""
10676 return _core_.Validator_GetWindow(*args, **kwargs)
10677
10678 def SetWindow(*args, **kwargs):
10679 """SetWindow(self, Window window)"""
10680 return _core_.Validator_SetWindow(*args, **kwargs)
10681
10682 def IsSilent(*args, **kwargs):
c24da6d6 10683 """IsSilent() -> bool"""
d55e5bfc
RD
10684 return _core_.Validator_IsSilent(*args, **kwargs)
10685
10686 IsSilent = staticmethod(IsSilent)
10687 def SetBellOnError(*args, **kwargs):
c24da6d6 10688 """SetBellOnError(int doIt=True)"""
d55e5bfc
RD
10689 return _core_.Validator_SetBellOnError(*args, **kwargs)
10690
10691 SetBellOnError = staticmethod(SetBellOnError)
dba7934c 10692 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 10693_core_.Validator_swigregister(Validator)
d55e5bfc 10694
554f62e9
RD
10695def Validator_IsSilent(*args):
10696 """Validator_IsSilent() -> bool"""
10697 return _core_.Validator_IsSilent(*args)
d55e5bfc
RD
10698
10699def Validator_SetBellOnError(*args, **kwargs):
554f62e9
RD
10700 """Validator_SetBellOnError(int doIt=True)"""
10701 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
10702
10703class PyValidator(Validator):
093d3ff1 10704 """Proxy of C++ PyValidator class"""
554f62e9
RD
10705 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10706 __repr__ = _swig_repr
10707 def __init__(self, *args, **kwargs):
d55e5bfc 10708 """__init__(self) -> PyValidator"""
554f62e9 10709 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
c25f90f6 10710 self._setOORInfo(self);PyValidator._setCallbackInfo(self, self, PyValidator)
d55e5bfc
RD
10711
10712 def _setCallbackInfo(*args, **kwargs):
c25f90f6 10713 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
d55e5bfc
RD
10714 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10715
2131d850 10716_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
10717
10718#---------------------------------------------------------------------------
10719
10720class Menu(EvtHandler):
093d3ff1 10721 """Proxy of C++ Menu class"""
554f62e9
RD
10722 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10723 __repr__ = _swig_repr
10724 def __init__(self, *args, **kwargs):
d55e5bfc 10725 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
554f62e9 10726 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
10727 self._setOORInfo(self)
10728
10729 def Append(*args, **kwargs):
97ab0f6a
RD
10730 """
10731 Append(self, int id, String text=EmptyString, String help=EmptyString,
10732 int kind=ITEM_NORMAL) -> MenuItem
10733 """
d55e5bfc
RD
10734 return _core_.Menu_Append(*args, **kwargs)
10735
10736 def AppendSeparator(*args, **kwargs):
10737 """AppendSeparator(self) -> MenuItem"""
10738 return _core_.Menu_AppendSeparator(*args, **kwargs)
10739
10740 def AppendCheckItem(*args, **kwargs):
10741 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10742 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10743
10744 def AppendRadioItem(*args, **kwargs):
10745 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10746 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10747
10748 def AppendMenu(*args, **kwargs):
10749 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10750 return _core_.Menu_AppendMenu(*args, **kwargs)
10751
50efceee
RD
10752 def AppendSubMenu(*args, **kwargs):
10753 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10754 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10755
d55e5bfc
RD
10756 def AppendItem(*args, **kwargs):
10757 """AppendItem(self, MenuItem item) -> MenuItem"""
10758 return _core_.Menu_AppendItem(*args, **kwargs)
10759
d55e5bfc
RD
10760 def InsertItem(*args, **kwargs):
10761 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10762 return _core_.Menu_InsertItem(*args, **kwargs)
10763
554f62e9
RD
10764 def PrependItem(*args, **kwargs):
10765 """PrependItem(self, MenuItem item) -> MenuItem"""
10766 return _core_.Menu_PrependItem(*args, **kwargs)
10767
10768 def Break(*args, **kwargs):
10769 """Break(self)"""
10770 return _core_.Menu_Break(*args, **kwargs)
10771
d55e5bfc
RD
10772 def Insert(*args, **kwargs):
10773 """
97ab0f6a 10774 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
d55e5bfc
RD
10775 int kind=ITEM_NORMAL) -> MenuItem
10776 """
10777 return _core_.Menu_Insert(*args, **kwargs)
10778
10779 def InsertSeparator(*args, **kwargs):
10780 """InsertSeparator(self, size_t pos) -> MenuItem"""
10781 return _core_.Menu_InsertSeparator(*args, **kwargs)
10782
10783 def InsertCheckItem(*args, **kwargs):
10784 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10785 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10786
10787 def InsertRadioItem(*args, **kwargs):
10788 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10789 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10790
10791 def InsertMenu(*args, **kwargs):
10792 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10793 return _core_.Menu_InsertMenu(*args, **kwargs)
10794
d55e5bfc 10795 def Prepend(*args, **kwargs):
97ab0f6a
RD
10796 """
10797 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10798 int kind=ITEM_NORMAL) -> MenuItem
10799 """
d55e5bfc
RD
10800 return _core_.Menu_Prepend(*args, **kwargs)
10801
10802 def PrependSeparator(*args, **kwargs):
10803 """PrependSeparator(self) -> MenuItem"""
10804 return _core_.Menu_PrependSeparator(*args, **kwargs)
10805
10806 def PrependCheckItem(*args, **kwargs):
10807 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10808 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10809
10810 def PrependRadioItem(*args, **kwargs):
10811 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10812 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10813
10814 def PrependMenu(*args, **kwargs):
10815 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10816 return _core_.Menu_PrependMenu(*args, **kwargs)
10817
10818 def Remove(*args, **kwargs):
10819 """Remove(self, int id) -> MenuItem"""
10820 return _core_.Menu_Remove(*args, **kwargs)
10821
59ccbf7f 10822 def RemoveItem(self, item):
d55e5bfc 10823 """RemoveItem(self, MenuItem item) -> MenuItem"""
59ccbf7f
RD
10824 #// The return object is always the parameter, so return that
10825 #// proxy instead of the new one
10826 val = _core_.Menu_RemoveItem(self, item)
10827 item.this.own(val.this.own())
10828 val.this.disown()
10829 return item
10830
d55e5bfc
RD
10831
10832 def Delete(*args, **kwargs):
10833 """Delete(self, int id) -> bool"""
10834 return _core_.Menu_Delete(*args, **kwargs)
10835
10836 def DeleteItem(*args, **kwargs):
10837 """DeleteItem(self, MenuItem item) -> bool"""
10838 return _core_.Menu_DeleteItem(*args, **kwargs)
10839
10840 def Destroy(*args, **kwargs):
10841 """
10842 Destroy(self)
10843
10844 Deletes the C++ object this Python object is a proxy for.
10845 """
b39fe951
RD
10846 args[0].this.own(False)
10847 return _core_.Menu_Destroy(*args, **kwargs)
d55e5bfc
RD
10848
10849 def DestroyId(*args, **kwargs):
b39fe951
RD
10850 """DestroyId(self, int id) -> bool"""
10851 return _core_.Menu_DestroyId(*args, **kwargs)
d55e5bfc
RD
10852
10853 def DestroyItem(*args, **kwargs):
b39fe951
RD
10854 """DestroyItem(self, MenuItem item) -> bool"""
10855 return _core_.Menu_DestroyItem(*args, **kwargs)
d55e5bfc
RD
10856
10857 def GetMenuItemCount(*args, **kwargs):
10858 """GetMenuItemCount(self) -> size_t"""
10859 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10860
10861 def GetMenuItems(*args, **kwargs):
10862 """GetMenuItems(self) -> PyObject"""
10863 return _core_.Menu_GetMenuItems(*args, **kwargs)
10864
10865 def FindItem(*args, **kwargs):
10866 """FindItem(self, String item) -> int"""
10867 return _core_.Menu_FindItem(*args, **kwargs)
10868
10869 def FindItemById(*args, **kwargs):
10870 """FindItemById(self, int id) -> MenuItem"""
10871 return _core_.Menu_FindItemById(*args, **kwargs)
10872
10873 def FindItemByPosition(*args, **kwargs):
10874 """FindItemByPosition(self, size_t position) -> MenuItem"""
10875 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10876
10877 def Enable(*args, **kwargs):
10878 """Enable(self, int id, bool enable)"""
10879 return _core_.Menu_Enable(*args, **kwargs)
10880
10881 def IsEnabled(*args, **kwargs):
10882 """IsEnabled(self, int id) -> bool"""
10883 return _core_.Menu_IsEnabled(*args, **kwargs)
10884
10885 def Check(*args, **kwargs):
10886 """Check(self, int id, bool check)"""
10887 return _core_.Menu_Check(*args, **kwargs)
10888
10889 def IsChecked(*args, **kwargs):
10890 """IsChecked(self, int id) -> bool"""
10891 return _core_.Menu_IsChecked(*args, **kwargs)
10892
10893 def SetLabel(*args, **kwargs):
10894 """SetLabel(self, int id, String label)"""
10895 return _core_.Menu_SetLabel(*args, **kwargs)
10896
10897 def GetLabel(*args, **kwargs):
10898 """GetLabel(self, int id) -> String"""
10899 return _core_.Menu_GetLabel(*args, **kwargs)
10900
10901 def SetHelpString(*args, **kwargs):
10902 """SetHelpString(self, int id, String helpString)"""
10903 return _core_.Menu_SetHelpString(*args, **kwargs)
10904
10905 def GetHelpString(*args, **kwargs):
10906 """GetHelpString(self, int id) -> String"""
10907 return _core_.Menu_GetHelpString(*args, **kwargs)
10908
10909 def SetTitle(*args, **kwargs):
10910 """SetTitle(self, String title)"""
10911 return _core_.Menu_SetTitle(*args, **kwargs)
10912
10913 def GetTitle(*args, **kwargs):
10914 """GetTitle(self) -> String"""
10915 return _core_.Menu_GetTitle(*args, **kwargs)
10916
10917 def SetEventHandler(*args, **kwargs):
10918 """SetEventHandler(self, EvtHandler handler)"""
10919 return _core_.Menu_SetEventHandler(*args, **kwargs)
10920
10921 def GetEventHandler(*args, **kwargs):
10922 """GetEventHandler(self) -> EvtHandler"""
10923 return _core_.Menu_GetEventHandler(*args, **kwargs)
10924
10925 def SetInvokingWindow(*args, **kwargs):
10926 """SetInvokingWindow(self, Window win)"""
10927 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10928
10929 def GetInvokingWindow(*args, **kwargs):
10930 """GetInvokingWindow(self) -> Window"""
10931 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10932
10933 def GetStyle(*args, **kwargs):
10934 """GetStyle(self) -> long"""
10935 return _core_.Menu_GetStyle(*args, **kwargs)
10936
10937 def UpdateUI(*args, **kwargs):
10938 """UpdateUI(self, EvtHandler source=None)"""
10939 return _core_.Menu_UpdateUI(*args, **kwargs)
10940
10941 def GetMenuBar(*args, **kwargs):
10942 """GetMenuBar(self) -> MenuBar"""
10943 return _core_.Menu_GetMenuBar(*args, **kwargs)
10944
10945 def Attach(*args, **kwargs):
10946 """Attach(self, wxMenuBarBase menubar)"""
10947 return _core_.Menu_Attach(*args, **kwargs)
10948
10949 def Detach(*args, **kwargs):
10950 """Detach(self)"""
10951 return _core_.Menu_Detach(*args, **kwargs)
10952
10953 def IsAttached(*args, **kwargs):
10954 """IsAttached(self) -> bool"""
10955 return _core_.Menu_IsAttached(*args, **kwargs)
10956
10957 def SetParent(*args, **kwargs):
10958 """SetParent(self, Menu parent)"""
10959 return _core_.Menu_SetParent(*args, **kwargs)
10960
10961 def GetParent(*args, **kwargs):
10962 """GetParent(self) -> Menu"""
10963 return _core_.Menu_GetParent(*args, **kwargs)
10964
57332a5a
RD
10965 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10966 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10967 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10968 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10969 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10970 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10971 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10972 Style = property(GetStyle,doc="See `GetStyle`")
10973 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
2131d850 10974_core_.Menu_swigregister(Menu)
d55e5bfc
RD
10975DefaultValidator = cvar.DefaultValidator
10976
10977#---------------------------------------------------------------------------
10978
10979class MenuBar(Window):
093d3ff1 10980 """Proxy of C++ MenuBar class"""
554f62e9
RD
10981 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10982 __repr__ = _swig_repr
10983 def __init__(self, *args, **kwargs):
d55e5bfc 10984 """__init__(self, long style=0) -> MenuBar"""
554f62e9 10985 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10986 self._setOORInfo(self)
10987
10988 def Append(*args, **kwargs):
10989 """Append(self, Menu menu, String title) -> bool"""
10990 return _core_.MenuBar_Append(*args, **kwargs)
10991
10992 def Insert(*args, **kwargs):
10993 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10994 return _core_.MenuBar_Insert(*args, **kwargs)
10995
10996 def GetMenuCount(*args, **kwargs):
10997 """GetMenuCount(self) -> size_t"""
10998 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10999
11000 def GetMenu(*args, **kwargs):
11001 """GetMenu(self, size_t pos) -> Menu"""
11002 return _core_.MenuBar_GetMenu(*args, **kwargs)
11003
11004 def Replace(*args, **kwargs):
11005 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
11006 return _core_.MenuBar_Replace(*args, **kwargs)
11007
11008 def Remove(*args, **kwargs):
11009 """Remove(self, size_t pos) -> Menu"""
11010 return _core_.MenuBar_Remove(*args, **kwargs)
11011
11012 def EnableTop(*args, **kwargs):
11013 """EnableTop(self, size_t pos, bool enable)"""
11014 return _core_.MenuBar_EnableTop(*args, **kwargs)
11015
11016 def IsEnabledTop(*args, **kwargs):
11017 """IsEnabledTop(self, size_t pos) -> bool"""
11018 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
11019
11020 def SetLabelTop(*args, **kwargs):
11021 """SetLabelTop(self, size_t pos, String label)"""
11022 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
11023
11024 def GetLabelTop(*args, **kwargs):
11025 """GetLabelTop(self, size_t pos) -> String"""
11026 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
11027
11028 def FindMenuItem(*args, **kwargs):
11029 """FindMenuItem(self, String menu, String item) -> int"""
11030 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
11031
11032 def FindItemById(*args, **kwargs):
11033 """FindItemById(self, int id) -> MenuItem"""
11034 return _core_.MenuBar_FindItemById(*args, **kwargs)
11035
11036 def FindMenu(*args, **kwargs):
11037 """FindMenu(self, String title) -> int"""
11038 return _core_.MenuBar_FindMenu(*args, **kwargs)
11039
11040 def Enable(*args, **kwargs):
11041 """Enable(self, int id, bool enable)"""
11042 return _core_.MenuBar_Enable(*args, **kwargs)
11043
11044 def Check(*args, **kwargs):
11045 """Check(self, int id, bool check)"""
11046 return _core_.MenuBar_Check(*args, **kwargs)
11047
11048 def IsChecked(*args, **kwargs):
11049 """IsChecked(self, int id) -> bool"""
11050 return _core_.MenuBar_IsChecked(*args, **kwargs)
11051
11052 def IsEnabled(*args, **kwargs):
11053 """IsEnabled(self, int id) -> bool"""
11054 return _core_.MenuBar_IsEnabled(*args, **kwargs)
11055
11056 def SetLabel(*args, **kwargs):
11057 """SetLabel(self, int id, String label)"""
11058 return _core_.MenuBar_SetLabel(*args, **kwargs)
11059
11060 def GetLabel(*args, **kwargs):
11061 """GetLabel(self, int id) -> String"""
11062 return _core_.MenuBar_GetLabel(*args, **kwargs)
11063
11064 def SetHelpString(*args, **kwargs):
11065 """SetHelpString(self, int id, String helpString)"""
11066 return _core_.MenuBar_SetHelpString(*args, **kwargs)
11067
11068 def GetHelpString(*args, **kwargs):
11069 """GetHelpString(self, int id) -> String"""
11070 return _core_.MenuBar_GetHelpString(*args, **kwargs)
11071
11072 def GetFrame(*args, **kwargs):
11073 """GetFrame(self) -> wxFrame"""
11074 return _core_.MenuBar_GetFrame(*args, **kwargs)
11075
11076 def IsAttached(*args, **kwargs):
11077 """IsAttached(self) -> bool"""
11078 return _core_.MenuBar_IsAttached(*args, **kwargs)
11079
11080 def Attach(*args, **kwargs):
11081 """Attach(self, wxFrame frame)"""
11082 return _core_.MenuBar_Attach(*args, **kwargs)
11083
11084 def Detach(*args, **kwargs):
11085 """Detach(self)"""
11086 return _core_.MenuBar_Detach(*args, **kwargs)
11087
587d0f36
RD
11088 def UpdateMenus(*args, **kwargs):
11089 """UpdateMenus(self)"""
11090 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
11091
db67f999
RD
11092 def SetAutoWindowMenu(*args, **kwargs):
11093 """SetAutoWindowMenu(bool enable)"""
11094 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
11095
11096 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
11097 def GetAutoWindowMenu(*args, **kwargs):
11098 """GetAutoWindowMenu() -> bool"""
11099 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
11100
11101 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
97ab0f6a
RD
11102 def GetMenus(self):
11103 """Return a list of (menu, label) items for the menus in the MenuBar. """
11104 return [(self.GetMenu(i), self.GetLabelTop(i))
11105 for i in range(self.GetMenuCount())]
11106
11107 def SetMenus(self, items):
11108 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
11109 for i in range(self.GetMenuCount()-1, -1, -1):
11110 self.Remove(i)
11111 for m, l in items:
11112 self.Append(m, l)
11113
57332a5a 11114 Frame = property(GetFrame,doc="See `GetFrame`")
57332a5a
RD
11115 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
11116 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
2131d850 11117_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 11118
db67f999 11119def MenuBar_SetAutoWindowMenu(*args, **kwargs):
554f62e9
RD
11120 """MenuBar_SetAutoWindowMenu(bool enable)"""
11121 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
db67f999 11122
554f62e9
RD
11123def MenuBar_GetAutoWindowMenu(*args):
11124 """MenuBar_GetAutoWindowMenu() -> bool"""
11125 return _core_.MenuBar_GetAutoWindowMenu(*args)
db67f999 11126
d55e5bfc
RD
11127#---------------------------------------------------------------------------
11128
11129class MenuItem(Object):
093d3ff1 11130 """Proxy of C++ MenuItem class"""
554f62e9
RD
11131 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11132 __repr__ = _swig_repr
11133 def __init__(self, *args, **kwargs):
d55e5bfc 11134 """
89d1e2ee 11135 __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString,
d55e5bfc
RD
11136 String help=EmptyString, int kind=ITEM_NORMAL,
11137 Menu subMenu=None) -> MenuItem
11138 """
554f62e9
RD
11139 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
11140 __swig_destroy__ = _core_.delete_MenuItem
11141 __del__ = lambda self : None;
89d1e2ee 11142 def Destroy(self): pass
d55e5bfc
RD
11143 def GetMenu(*args, **kwargs):
11144 """GetMenu(self) -> Menu"""
11145 return _core_.MenuItem_GetMenu(*args, **kwargs)
11146
11147 def SetMenu(*args, **kwargs):
11148 """SetMenu(self, Menu menu)"""
11149 return _core_.MenuItem_SetMenu(*args, **kwargs)
11150
11151 def SetId(*args, **kwargs):
11152 """SetId(self, int id)"""
11153 return _core_.MenuItem_SetId(*args, **kwargs)
11154
11155 def GetId(*args, **kwargs):
11156 """GetId(self) -> int"""
11157 return _core_.MenuItem_GetId(*args, **kwargs)
11158
11159 def IsSeparator(*args, **kwargs):
11160 """IsSeparator(self) -> bool"""
11161 return _core_.MenuItem_IsSeparator(*args, **kwargs)
11162
11163 def SetText(*args, **kwargs):
11164 """SetText(self, String str)"""
11165 return _core_.MenuItem_SetText(*args, **kwargs)
11166
11167 def GetLabel(*args, **kwargs):
11168 """GetLabel(self) -> String"""
11169 return _core_.MenuItem_GetLabel(*args, **kwargs)
11170
11171 def GetText(*args, **kwargs):
11172 """GetText(self) -> String"""
11173 return _core_.MenuItem_GetText(*args, **kwargs)
11174
11175 def GetLabelFromText(*args, **kwargs):
c24da6d6 11176 """GetLabelFromText(String text) -> String"""
d55e5bfc
RD
11177 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
11178
11179 GetLabelFromText = staticmethod(GetLabelFromText)
11180 def GetKind(*args, **kwargs):
11181 """GetKind(self) -> int"""
11182 return _core_.MenuItem_GetKind(*args, **kwargs)
11183
11184 def SetKind(*args, **kwargs):
11185 """SetKind(self, int kind)"""
11186 return _core_.MenuItem_SetKind(*args, **kwargs)
11187
11188 def SetCheckable(*args, **kwargs):
11189 """SetCheckable(self, bool checkable)"""
11190 return _core_.MenuItem_SetCheckable(*args, **kwargs)
11191
11192 def IsCheckable(*args, **kwargs):
11193 """IsCheckable(self) -> bool"""
11194 return _core_.MenuItem_IsCheckable(*args, **kwargs)
11195
11196 def IsSubMenu(*args, **kwargs):
11197 """IsSubMenu(self) -> bool"""
11198 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
11199
11200 def SetSubMenu(*args, **kwargs):
11201 """SetSubMenu(self, Menu menu)"""
11202 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
11203
11204 def GetSubMenu(*args, **kwargs):
11205 """GetSubMenu(self) -> Menu"""
11206 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
11207
11208 def Enable(*args, **kwargs):
11209 """Enable(self, bool enable=True)"""
11210 return _core_.MenuItem_Enable(*args, **kwargs)
11211
11212 def IsEnabled(*args, **kwargs):
11213 """IsEnabled(self) -> bool"""
11214 return _core_.MenuItem_IsEnabled(*args, **kwargs)
11215
11216 def Check(*args, **kwargs):
11217 """Check(self, bool check=True)"""
11218 return _core_.MenuItem_Check(*args, **kwargs)
11219
11220 def IsChecked(*args, **kwargs):
11221 """IsChecked(self) -> bool"""
11222 return _core_.MenuItem_IsChecked(*args, **kwargs)
11223
11224 def Toggle(*args, **kwargs):
11225 """Toggle(self)"""
11226 return _core_.MenuItem_Toggle(*args, **kwargs)
11227
11228 def SetHelp(*args, **kwargs):
11229 """SetHelp(self, String str)"""
11230 return _core_.MenuItem_SetHelp(*args, **kwargs)
11231
11232 def GetHelp(*args, **kwargs):
11233 """GetHelp(self) -> String"""
11234 return _core_.MenuItem_GetHelp(*args, **kwargs)
11235
11236 def GetAccel(*args, **kwargs):
11237 """GetAccel(self) -> AcceleratorEntry"""
11238 return _core_.MenuItem_GetAccel(*args, **kwargs)
11239
11240 def SetAccel(*args, **kwargs):
11241 """SetAccel(self, AcceleratorEntry accel)"""
11242 return _core_.MenuItem_SetAccel(*args, **kwargs)
11243
7449af73
RD
11244 def SetBitmap(*args, **kwargs):
11245 """SetBitmap(self, Bitmap bitmap)"""
11246 return _core_.MenuItem_SetBitmap(*args, **kwargs)
11247
11248 def GetBitmap(*args, **kwargs):
11249 """GetBitmap(self) -> Bitmap"""
11250 return _core_.MenuItem_GetBitmap(*args, **kwargs)
11251
d55e5bfc
RD
11252 def SetFont(*args, **kwargs):
11253 """SetFont(self, Font font)"""
11254 return _core_.MenuItem_SetFont(*args, **kwargs)
11255
11256 def GetFont(*args, **kwargs):
11257 """GetFont(self) -> Font"""
11258 return _core_.MenuItem_GetFont(*args, **kwargs)
11259
11260 def SetTextColour(*args, **kwargs):
11261 """SetTextColour(self, Colour colText)"""
11262 return _core_.MenuItem_SetTextColour(*args, **kwargs)
11263
11264 def GetTextColour(*args, **kwargs):
11265 """GetTextColour(self) -> Colour"""
11266 return _core_.MenuItem_GetTextColour(*args, **kwargs)
11267
11268 def SetBackgroundColour(*args, **kwargs):
11269 """SetBackgroundColour(self, Colour colBack)"""
11270 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
11271
11272 def GetBackgroundColour(*args, **kwargs):
11273 """GetBackgroundColour(self) -> Colour"""
11274 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
11275
11276 def SetBitmaps(*args, **kwargs):
11277 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11278 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
11279
11280 def SetDisabledBitmap(*args, **kwargs):
11281 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11282 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
11283
11284 def GetDisabledBitmap(*args, **kwargs):
11285 """GetDisabledBitmap(self) -> Bitmap"""
11286 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
11287
11288 def SetMarginWidth(*args, **kwargs):
11289 """SetMarginWidth(self, int nWidth)"""
11290 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
11291
11292 def GetMarginWidth(*args, **kwargs):
11293 """GetMarginWidth(self) -> int"""
11294 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
11295
11296 def GetDefaultMarginWidth(*args, **kwargs):
c24da6d6 11297 """GetDefaultMarginWidth() -> int"""
d55e5bfc
RD
11298 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
11299
11300 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
11301 def IsOwnerDrawn(*args, **kwargs):
11302 """IsOwnerDrawn(self) -> bool"""
11303 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
11304
11305 def SetOwnerDrawn(*args, **kwargs):
11306 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
11307 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
11308
11309 def ResetOwnerDrawn(*args, **kwargs):
11310 """ResetOwnerDrawn(self)"""
11311 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
11312
57332a5a
RD
11313 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
11314 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
11315 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
11316 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
11317 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
11318 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
11319 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
11320 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
11321 Label = property(GetLabel,doc="See `GetLabel`")
11322 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
11323 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
11324 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
11325 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
11326 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
2131d850 11327_core_.MenuItem_swigregister(MenuItem)
d55e5bfc
RD
11328
11329def MenuItem_GetLabelFromText(*args, **kwargs):
554f62e9
RD
11330 """MenuItem_GetLabelFromText(String text) -> String"""
11331 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 11332
554f62e9
RD
11333def MenuItem_GetDefaultMarginWidth(*args):
11334 """MenuItem_GetDefaultMarginWidth() -> int"""
11335 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
11336
11337#---------------------------------------------------------------------------
11338
11339class Control(Window):
11340 """
11341 This is the base class for a control or 'widget'.
11342
79fccf9d
RD
11343 A control is generally a small window which processes user input
11344 and/or displays one or more item of data.
d55e5bfc 11345 """
554f62e9
RD
11346 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11347 __repr__ = _swig_repr
11348 def __init__(self, *args, **kwargs):
d55e5bfc 11349 """
248ed943
RD
11350 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11351 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
11352 String name=ControlNameStr) -> Control
11353
79fccf9d
RD
11354 Create a Control. Normally you should only call this from a subclass'
11355 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 11356 """
554f62e9 11357 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
11358 self._setOORInfo(self)
11359
11360 def Create(*args, **kwargs):
11361 """
248ed943
RD
11362 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11363 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
11364 String name=ControlNameStr) -> bool
11365
11366 Do the 2nd phase and create the GUI control.
11367 """
11368 return _core_.Control_Create(*args, **kwargs)
11369
1eeb270e
RD
11370 def GetAlignment(*args, **kwargs):
11371 """
11372 GetAlignment(self) -> int
11373
11374 Get the control alignment (left/right/centre, top/bottom/centre)
11375 """
11376 return _core_.Control_GetAlignment(*args, **kwargs)
11377
0f83f5da 11378 def GetLabelText(*args, **kwargs):
1eeb270e 11379 """
1eeb270e
RD
11380 GetLabelText(self) -> String
11381
11382 Get just the text of the label, without mnemonic characters ('&')
11383 """
0f83f5da 11384 return _core_.Control_GetLabelText(*args, **kwargs)
1eeb270e 11385
d55e5bfc
RD
11386 def Command(*args, **kwargs):
11387 """
11388 Command(self, CommandEvent event)
11389
79fccf9d
RD
11390 Simulates the effect of the user issuing a command to the item.
11391
11392 :see: `wx.CommandEvent`
11393
d55e5bfc
RD
11394 """
11395 return _core_.Control_Command(*args, **kwargs)
11396
ddeca22c
RD
11397 def RemoveMnemonics(*args, **kwargs):
11398 """
11399 RemoveMnemonics(String str) -> String
11400
11401 removes the mnemonics characters
11402 """
11403 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11404
11405 RemoveMnemonics = staticmethod(RemoveMnemonics)
a001823c 11406 def GetClassDefaultAttributes(*args, **kwargs):
f8167d6e 11407 """
a001823c 11408 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
f8167d6e 11409
a001823c
RD
11410 Get the default attributes for this class. This is useful if you want
11411 to use the same font or colour in your own control as in a standard
11412 control -- which is a much better idea than hard coding specific
11413 colours or fonts which might look completely out of place on the
11414 user's system, especially if it uses themes.
f8167d6e 11415
a001823c
RD
11416 The variant parameter is only relevant under Mac currently and is
11417 ignore under other platforms. Under Mac, it will change the size of
11418 the returned font. See `wx.Window.SetWindowVariant` for more about
11419 this.
f8167d6e 11420 """
d55e5bfc
RD
11421 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11422
11423 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
226118fc 11424 Alignment = property(GetAlignment,doc="See `GetAlignment`")
226118fc 11425 LabelText = property(GetLabelText,doc="See `GetLabelText`")
2131d850 11426_core_.Control_swigregister(Control)
d55e5bfc
RD
11427ControlNameStr = cvar.ControlNameStr
11428
11429def PreControl(*args, **kwargs):
11430 """
11431 PreControl() -> Control
11432
11433 Precreate a Control control for 2-phase creation
11434 """
11435 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
11436 return val
11437
ddeca22c
RD
11438def Control_RemoveMnemonics(*args, **kwargs):
11439 """
11440 Control_RemoveMnemonics(String str) -> String
11441
11442 removes the mnemonics characters
11443 """
11444 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11445
d55e5bfc 11446def Control_GetClassDefaultAttributes(*args, **kwargs):
554f62e9 11447 """
a001823c
RD
11448 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11449
11450 Get the default attributes for this class. This is useful if you want
11451 to use the same font or colour in your own control as in a standard
11452 control -- which is a much better idea than hard coding specific
11453 colours or fonts which might look completely out of place on the
11454 user's system, especially if it uses themes.
11455
11456 The variant parameter is only relevant under Mac currently and is
11457 ignore under other platforms. Under Mac, it will change the size of
11458 the returned font. See `wx.Window.SetWindowVariant` for more about
11459 this.
11460 """
554f62e9 11461 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11462
11463#---------------------------------------------------------------------------
11464
11465class ItemContainer(object):
11466 """
53aa7709
RD
11467 The wx.ItemContainer class defines an interface which is implemented
11468 by all controls which have string subitems, each of which may be
11469 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11470 as `wx.ComboBox` which implements an extended interface deriving from
79fccf9d 11471 this one.
d55e5bfc 11472
79fccf9d
RD
11473 It defines the methods for accessing the control's items and although
11474 each of the derived classes implements them differently, they still
11475 all conform to the same interface.
d55e5bfc 11476
79fccf9d
RD
11477 The items in a wx.ItemContainer have (non empty) string labels and,
11478 optionally, client data associated with them.
d55e5bfc
RD
11479
11480 """
554f62e9
RD
11481 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11482 def __init__(self): raise AttributeError, "No constructor defined"
11483 __repr__ = _swig_repr
d55e5bfc
RD
11484 def Append(*args, **kwargs):
11485 """
11486 Append(self, String item, PyObject clientData=None) -> int
11487
79fccf9d
RD
11488 Adds the item to the control, associating the given data with the item
11489 if not None. The return value is the index of the newly added item
11490 which may be different from the last one if the control is sorted (e.g.
11491 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc
RD
11492 """
11493 return _core_.ItemContainer_Append(*args, **kwargs)
11494
11495 def AppendItems(*args, **kwargs):
11496 """
f5b96ee1 11497 AppendItems(self, List strings)
d55e5bfc 11498
79fccf9d
RD
11499 Apend several items at once to the control. Notice that calling this
11500 method may be much faster than appending the items one by one if you
11501 need to add a lot of items.
d55e5bfc
RD
11502 """
11503 return _core_.ItemContainer_AppendItems(*args, **kwargs)
11504
11505 def Insert(*args, **kwargs):
11506 """
d359a380 11507 Insert(self, String item, int pos, PyObject clientData=None) -> int
d55e5bfc 11508
79fccf9d 11509 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
11510 optionally associating some data object with the item.
11511 """
11512 return _core_.ItemContainer_Insert(*args, **kwargs)
11513
11514 def Clear(*args, **kwargs):
11515 """
11516 Clear(self)
11517
11518 Removes all items from the control.
11519 """
11520 return _core_.ItemContainer_Clear(*args, **kwargs)
11521
11522 def Delete(*args, **kwargs):
11523 """
d359a380 11524 Delete(self, int n)
d55e5bfc 11525
79fccf9d
RD
11526 Deletes the item at the zero-based index 'n' from the control. Note
11527 that it is an error (signalled by a `wx.PyAssertionError` exception if
11528 enabled) to remove an item with the index negative or greater or equal
11529 than the number of items in the control.
d55e5bfc
RD
11530 """
11531 return _core_.ItemContainer_Delete(*args, **kwargs)
11532
53aa7709
RD
11533 def GetClientData(*args, **kwargs):
11534 """
d359a380 11535 GetClientData(self, int n) -> PyObject
53aa7709
RD
11536
11537 Returns the client data associated with the given item, (if any.)
11538 """
11539 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11540
11541 def SetClientData(*args, **kwargs):
11542 """
d359a380 11543 SetClientData(self, int n, PyObject clientData)
53aa7709
RD
11544
11545 Associate the given client data with the item at position n.
11546 """
11547 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11548
d55e5bfc
RD
11549 def GetCount(*args, **kwargs):
11550 """
d359a380 11551 GetCount(self) -> int
d55e5bfc
RD
11552
11553 Returns the number of items in the control.
11554 """
11555 return _core_.ItemContainer_GetCount(*args, **kwargs)
11556
11557 def IsEmpty(*args, **kwargs):
11558 """
11559 IsEmpty(self) -> bool
11560
11561 Returns True if the control is empty or False if it has some items.
11562 """
11563 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
11564
11565 def GetString(*args, **kwargs):
11566 """
d359a380 11567 GetString(self, int n) -> String
d55e5bfc
RD
11568
11569 Returns the label of the item with the given index.
11570 """
11571 return _core_.ItemContainer_GetString(*args, **kwargs)
11572
11573 def GetStrings(*args, **kwargs):
11574 """GetStrings(self) -> wxArrayString"""
11575 return _core_.ItemContainer_GetStrings(*args, **kwargs)
11576
11577 def SetString(*args, **kwargs):
11578 """
d359a380 11579 SetString(self, int n, String s)
d55e5bfc
RD
11580
11581 Sets the label for the given item.
11582 """
11583 return _core_.ItemContainer_SetString(*args, **kwargs)
11584
11585 def FindString(*args, **kwargs):
11586 """
11587 FindString(self, String s) -> int
11588
11589 Finds an item whose label matches the given string. Returns the
79fccf9d
RD
11590 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11591 found.
d55e5bfc
RD
11592 """
11593 return _core_.ItemContainer_FindString(*args, **kwargs)
11594
53aa7709 11595 def SetSelection(*args, **kwargs):
d55e5bfc 11596 """
53aa7709 11597 SetSelection(self, int n)
d55e5bfc
RD
11598
11599 Sets the item at index 'n' to be the selected item.
11600 """
53aa7709 11601 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 11602
d55e5bfc
RD
11603 def GetSelection(*args, **kwargs):
11604 """
11605 GetSelection(self) -> int
11606
79fccf9d
RD
11607 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11608 is selected.
d55e5bfc
RD
11609 """
11610 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11611
53aa7709
RD
11612 def SetStringSelection(*args, **kwargs):
11613 """SetStringSelection(self, String s) -> bool"""
11614 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11615
d55e5bfc
RD
11616 def GetStringSelection(*args, **kwargs):
11617 """
11618 GetStringSelection(self) -> String
11619
79fccf9d
RD
11620 Returns the label of the selected item or an empty string if no item
11621 is selected.
d55e5bfc
RD
11622 """
11623 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11624
53aa7709 11625 def Select(*args, **kwargs):
d55e5bfc 11626 """
53aa7709 11627 Select(self, int n)
d55e5bfc 11628
53aa7709
RD
11629 This is the same as `SetSelection` and exists only because it is
11630 slightly more natural for controls which support multiple selection.
d55e5bfc 11631 """
53aa7709 11632 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 11633
97ab0f6a
RD
11634 def GetItems(self):
11635 """Return a list of the strings in the control"""
11636 return [self.GetString(i) for i in xrange(self.GetCount())]
11637
11638 def SetItems(self, items):
11639 """Clear and set the strings in the control from a list"""
11640 self.Clear()
11641 for i in items:
11642 self.Append(i)
11643
11644 Count = property(GetCount,doc="See `GetCount`")
11645 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11646 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11647 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11648 Strings = property(GetStrings,doc="See `GetStrings`")
2131d850 11649_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
11650
11651#---------------------------------------------------------------------------
11652
11653class ControlWithItems(Control,ItemContainer):
11654 """
79fccf9d
RD
11655 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11656 wx.Control class, and is used for the base class of various controls
11657 that have items.
d55e5bfc 11658 """
554f62e9
RD
11659 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11660 def __init__(self): raise AttributeError, "No constructor defined"
11661 __repr__ = _swig_repr
2131d850 11662_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
11663
11664#---------------------------------------------------------------------------
11665
cbfc9df6
RD
11666class SizerFlags(object):
11667 """
11668 Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
11669 to specify a lot of flags and parameters which can be unwieldy. This
11670 is where wx.SizerFlags comes in: it allows you to specify all
11671 parameters using the named methods instead. For example, instead of::
11672
11673 sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
11674
11675 you can now write::
11676
11677 sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
11678
11679 This is more readable and also allows you to create wx.SizerFlags
11680 objects which can be reused for several sizer items.::
11681
11682 flagsExpand = wx.SizerFlags(1)
11683 flagsExpand.Expand().Border(wx.ALL, 10)
11684 sizer.AddF(ctrl1, flagsExpand)
11685 sizer.AddF(ctrl2, flagsExpand)
11686
11687 Note that by specification, all methods of wx.SizerFlags return the
11688 wx.SizerFlags object itself allowing chaining multiple method calls
11689 like in the examples above.
11690 """
11691 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11692 __repr__ = _swig_repr
11693 def __init__(self, *args, **kwargs):
11694 """
11695 __init__(self, int proportion=0) -> SizerFlags
11696
11697 Constructs the flags object with the specified proportion.
11698 """
11699 _core_.SizerFlags_swiginit(self,_core_.new_SizerFlags(*args, **kwargs))
11700 __swig_destroy__ = _core_.delete_SizerFlags
11701 __del__ = lambda self : None;
11702 def Proportion(*args, **kwargs):
11703 """
11704 Proportion(self, int proportion) -> SizerFlags
11705
11706 Sets the item's proportion value.
11707 """
11708 return _core_.SizerFlags_Proportion(*args, **kwargs)
11709
11710 def Align(*args, **kwargs):
11711 """
11712 Align(self, int alignment) -> SizerFlags
11713
11714 Sets the item's alignment
11715 """
11716 return _core_.SizerFlags_Align(*args, **kwargs)
11717
11718 def Expand(*args, **kwargs):
11719 """
11720 Expand(self) -> SizerFlags
11721
11722 Sets the wx.EXPAND flag, which will cause the item to be expanded to
11723 fill as much space as it is given by the sizer.
11724 """
11725 return _core_.SizerFlags_Expand(*args, **kwargs)
11726
11727 def Centre(*args, **kwargs):
11728 """
11729 Centre(self) -> SizerFlags
11730
11731 Same as `Center` for those with an alternate dialect of English.
11732 """
11733 return _core_.SizerFlags_Centre(*args, **kwargs)
11734
11735 def Center(*args, **kwargs):
11736 """
11737 Center(self) -> SizerFlags
11738
11739 Sets the centering alignment flags.
11740 """
11741 return _core_.SizerFlags_Center(*args, **kwargs)
11742
11743 def Left(*args, **kwargs):
11744 """
11745 Left(self) -> SizerFlags
11746
11747 Aligns the object to the left, a shortcut for calling
11748 Align(wx.ALIGN_LEFT)
11749 """
11750 return _core_.SizerFlags_Left(*args, **kwargs)
11751
11752 def Right(*args, **kwargs):
11753 """
11754 Right(self) -> SizerFlags
11755
11756 Aligns the object to the right, a shortcut for calling
11757 Align(wx.ALIGN_RIGHT)
11758 """
11759 return _core_.SizerFlags_Right(*args, **kwargs)
11760
11761 def Top(*args, **kwargs):
11762 """
11763 Top(self) -> SizerFlags
11764
11765 Aligns the object to the top of the available space, a shortcut for
11766 calling Align(wx.ALIGN_TOP)
11767 """
11768 return _core_.SizerFlags_Top(*args, **kwargs)
11769
11770 def Bottom(*args, **kwargs):
11771 """
11772 Bottom(self) -> SizerFlags
11773
11774 Aligns the object to the bottom of the available space, a shortcut for
11775 calling Align(wx.ALIGN_BOTTOM)
11776 """
11777 return _core_.SizerFlags_Bottom(*args, **kwargs)
11778
11779 def Shaped(*args, **kwargs):
11780 """
11781 Shaped(self) -> SizerFlags
11782
11783 Sets the wx.SHAPED flag.
11784 """
11785 return _core_.SizerFlags_Shaped(*args, **kwargs)
11786
11787 def FixedMinSize(*args, **kwargs):
11788 """
11789 FixedMinSize(self) -> SizerFlags
11790
11791 Sets the wx.FIXED_MINSIZE flag.
11792 """
11793 return _core_.SizerFlags_FixedMinSize(*args, **kwargs)
11794
11795 def Border(*args, **kwargs):
11796 """
11797 Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags
11798
11799 Sets the border of the item in the direction(s) or sides given by the
11800 direction parameter. If the borderInPixels value is not given then
11801 the default border size (see `GetDefaultBorder`) will be used.
11802 """
11803 return _core_.SizerFlags_Border(*args, **kwargs)
11804
11805 def DoubleBorder(*args, **kwargs):
11806 """
11807 DoubleBorder(self, int direction=ALL) -> SizerFlags
11808
11809 Sets the border in the given direction to twice the default border
11810 size.
11811 """
11812 return _core_.SizerFlags_DoubleBorder(*args, **kwargs)
11813
11814 def TripleBorder(*args, **kwargs):
11815 """
11816 TripleBorder(self, int direction=ALL) -> SizerFlags
11817
11818 Sets the border in the given direction to three times the default
11819 border size.
11820 """
11821 return _core_.SizerFlags_TripleBorder(*args, **kwargs)
11822
11823 def HorzBorder(*args, **kwargs):
11824 """
11825 HorzBorder(self) -> SizerFlags
11826
11827 Sets the left and right borders to the default border size.
11828 """
11829 return _core_.SizerFlags_HorzBorder(*args, **kwargs)
11830
11831 def DoubleHorzBorder(*args, **kwargs):
11832 """
11833 DoubleHorzBorder(self) -> SizerFlags
11834
11835 Sets the left and right borders to twice the default border size.
11836 """
11837 return _core_.SizerFlags_DoubleHorzBorder(*args, **kwargs)
11838
11839 def GetDefaultBorder(*args, **kwargs):
11840 """
11841 GetDefaultBorder() -> int
11842
11843 Returns the default border size used by the other border methods
11844 """
11845 return _core_.SizerFlags_GetDefaultBorder(*args, **kwargs)
11846
11847 GetDefaultBorder = staticmethod(GetDefaultBorder)
11848 def GetProportion(*args, **kwargs):
11849 """
11850 GetProportion(self) -> int
11851
11852 Returns the proportion value to be used in the sizer item.
11853 """
11854 return _core_.SizerFlags_GetProportion(*args, **kwargs)
11855
11856 def GetFlags(*args, **kwargs):
11857 """
11858 GetFlags(self) -> int
11859
11860 Returns the flags value to be used in the sizer item.
11861 """
11862 return _core_.SizerFlags_GetFlags(*args, **kwargs)
11863
11864 def GetBorderInPixels(*args, **kwargs):
11865 """
11866 GetBorderInPixels(self) -> int
11867
11868 Returns the border value in pixels to be used in the sizer item.
11869 """
11870 return _core_.SizerFlags_GetBorderInPixels(*args, **kwargs)
11871
11872_core_.SizerFlags_swigregister(SizerFlags)
11873
11874def SizerFlags_GetDefaultBorder(*args):
11875 """
11876 SizerFlags_GetDefaultBorder() -> int
11877
11878 Returns the default border size used by the other border methods
11879 """
11880 return _core_.SizerFlags_GetDefaultBorder(*args)
11881
d55e5bfc 11882class SizerItem(Object):
248ed943
RD
11883 """
11884 The wx.SizerItem class is used to track the position, size and other
f460c29d
RD
11885 attributes of each item managed by a `wx.Sizer`. It is not usually
11886 necessary to use this class because the sizer elements can also be
11887 identified by their positions or window or sizer references but
11888 sometimes it may be more convenient to use wx.SizerItem directly.
11889 Also, custom classes derived from `wx.PySizer` will probably need to
11890 use the collection of wx.SizerItems held by wx.Sizer when calculating
11891 layout.
248ed943
RD
11892
11893 :see: `wx.Sizer`, `wx.GBSizerItem`
11894 """
554f62e9
RD
11895 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11896 __repr__ = _swig_repr
11897 def __init__(self, *args, **kwargs):
248ed943
RD
11898 """
11899 __init__(self) -> SizerItem
11900
11901 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11902 size will need to be set before this item can be used in a Sizer.
11903
11904 You will probably never need to create a wx.SizerItem directly as they
11905 are created automatically when the sizer's Add, Insert or Prepend
11906 methods are called.
11907
11908 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11909 """
554f62e9
RD
11910 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11911 __swig_destroy__ = _core_.delete_SizerItem
11912 __del__ = lambda self : None;
d55e5bfc 11913 def DeleteWindows(*args, **kwargs):
248ed943
RD
11914 """
11915 DeleteWindows(self)
11916
11917 Destroy the window or the windows in a subsizer, depending on the type
11918 of item.
11919 """
d55e5bfc
RD
11920 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
11921
11922 def DetachSizer(*args, **kwargs):
248ed943
RD
11923 """
11924 DetachSizer(self)
11925
11926 Enable deleting the SizerItem without destroying the contained sizer.
11927 """
d55e5bfc
RD
11928 return _core_.SizerItem_DetachSizer(*args, **kwargs)
11929
11930 def GetSize(*args, **kwargs):
248ed943
RD
11931 """
11932 GetSize(self) -> Size
11933
11934 Get the current size of the item, as set in the last Layout.
11935 """
d55e5bfc
RD
11936 return _core_.SizerItem_GetSize(*args, **kwargs)
11937
11938 def CalcMin(*args, **kwargs):
248ed943
RD
11939 """
11940 CalcMin(self) -> Size
11941
11942 Calculates the minimum desired size for the item, including any space
11943 needed by borders.
11944 """
d55e5bfc
RD
11945 return _core_.SizerItem_CalcMin(*args, **kwargs)
11946
11947 def SetDimension(*args, **kwargs):
248ed943
RD
11948 """
11949 SetDimension(self, Point pos, Size size)
11950
11951 Set the position and size of the space allocated for this item by the
11952 sizer, and adjust the position and size of the item (window or
11953 subsizer) to be within that space taking alignment and borders into
11954 account.
11955 """
d55e5bfc
RD
11956 return _core_.SizerItem_SetDimension(*args, **kwargs)
11957
11958 def GetMinSize(*args, **kwargs):
248ed943
RD
11959 """
11960 GetMinSize(self) -> Size
11961
11962 Get the minimum size needed for the item.
11963 """
d55e5bfc
RD
11964 return _core_.SizerItem_GetMinSize(*args, **kwargs)
11965
a001823c
RD
11966 def GetMinSizeWithBorder(*args, **kwargs):
11967 """
11968 GetMinSizeWithBorder(self) -> Size
11969
11970 Get the minimum size needed for the item with space for the borders
11971 added, if needed.
11972 """
11973 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11974
d55e5bfc
RD
11975 def SetInitSize(*args, **kwargs):
11976 """SetInitSize(self, int x, int y)"""
11977 return _core_.SizerItem_SetInitSize(*args, **kwargs)
11978
11979 def SetRatioWH(*args, **kwargs):
248ed943
RD
11980 """
11981 SetRatioWH(self, int width, int height)
11982
11983 Set the ratio item attribute.
11984 """
d55e5bfc
RD
11985 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
11986
11987 def SetRatioSize(*args, **kwargs):
248ed943
RD
11988 """
11989 SetRatioSize(self, Size size)
11990
11991 Set the ratio item attribute.
11992 """
d55e5bfc
RD
11993 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
11994
11995 def SetRatio(*args, **kwargs):
248ed943
RD
11996 """
11997 SetRatio(self, float ratio)
11998
11999 Set the ratio item attribute.
12000 """
d55e5bfc
RD
12001 return _core_.SizerItem_SetRatio(*args, **kwargs)
12002
12003 def GetRatio(*args, **kwargs):
248ed943
RD
12004 """
12005 GetRatio(self) -> float
12006
12007 Set the ratio item attribute.
12008 """
d55e5bfc
RD
12009 return _core_.SizerItem_GetRatio(*args, **kwargs)
12010
c1cb24a4
RD
12011 def GetRect(*args, **kwargs):
12012 """
12013 GetRect(self) -> Rect
12014
12015 Returns the rectangle that the sizer item should occupy
12016 """
12017 return _core_.SizerItem_GetRect(*args, **kwargs)
12018
d55e5bfc 12019 def IsWindow(*args, **kwargs):
248ed943
RD
12020 """
12021 IsWindow(self) -> bool
12022
12023 Is this sizer item a window?
12024 """
d55e5bfc
RD
12025 return _core_.SizerItem_IsWindow(*args, **kwargs)
12026
12027 def IsSizer(*args, **kwargs):
248ed943
RD
12028 """
12029 IsSizer(self) -> bool
12030
12031 Is this sizer item a subsizer?
12032 """
d55e5bfc
RD
12033 return _core_.SizerItem_IsSizer(*args, **kwargs)
12034
12035 def IsSpacer(*args, **kwargs):
248ed943
RD
12036 """
12037 IsSpacer(self) -> bool
12038
12039 Is this sizer item a spacer?
12040 """
d55e5bfc
RD
12041 return _core_.SizerItem_IsSpacer(*args, **kwargs)
12042
12043 def SetProportion(*args, **kwargs):
248ed943
RD
12044 """
12045 SetProportion(self, int proportion)
12046
12047 Set the proportion value for this item.
12048 """
d55e5bfc
RD
12049 return _core_.SizerItem_SetProportion(*args, **kwargs)
12050
12051 def GetProportion(*args, **kwargs):
248ed943
RD
12052 """
12053 GetProportion(self) -> int
12054
12055 Get the proportion value for this item.
12056 """
d55e5bfc
RD
12057 return _core_.SizerItem_GetProportion(*args, **kwargs)
12058
248ed943
RD
12059 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
12060 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 12061 def SetFlag(*args, **kwargs):
248ed943
RD
12062 """
12063 SetFlag(self, int flag)
12064
12065 Set the flag value for this item.
12066 """
d55e5bfc
RD
12067 return _core_.SizerItem_SetFlag(*args, **kwargs)
12068
12069 def GetFlag(*args, **kwargs):
248ed943
RD
12070 """
12071 GetFlag(self) -> int
12072
12073 Get the flag value for this item.
12074 """
d55e5bfc
RD
12075 return _core_.SizerItem_GetFlag(*args, **kwargs)
12076
12077 def SetBorder(*args, **kwargs):
248ed943
RD
12078 """
12079 SetBorder(self, int border)
12080
12081 Set the border value for this item.
12082 """
d55e5bfc
RD
12083 return _core_.SizerItem_SetBorder(*args, **kwargs)
12084
12085 def GetBorder(*args, **kwargs):
248ed943
RD
12086 """
12087 GetBorder(self) -> int
12088
12089 Get the border value for this item.
12090 """
d55e5bfc
RD
12091 return _core_.SizerItem_GetBorder(*args, **kwargs)
12092
12093 def GetWindow(*args, **kwargs):
248ed943
RD
12094 """
12095 GetWindow(self) -> Window
12096
12097 Get the window (if any) that is managed by this sizer item.
12098 """
d55e5bfc
RD
12099 return _core_.SizerItem_GetWindow(*args, **kwargs)
12100
d55e5bfc 12101 def GetSizer(*args, **kwargs):
248ed943
RD
12102 """
12103 GetSizer(self) -> Sizer
12104
12105 Get the subsizer (if any) that is managed by this sizer item.
12106 """
d55e5bfc
RD
12107 return _core_.SizerItem_GetSizer(*args, **kwargs)
12108
ddeca22c
RD
12109 def GetSpacer(*args, **kwargs):
12110 """
12111 GetSpacer(self) -> Size
12112
12113 Get the size of the spacer managed by this sizer item.
12114 """
12115 return _core_.SizerItem_GetSpacer(*args, **kwargs)
12116
12117 def SetWindow(*args, **kwargs):
12118 """
12119 SetWindow(self, Window window)
12120
12121 Set the window to be managed by this sizer item.
12122 """
12123 return _core_.SizerItem_SetWindow(*args, **kwargs)
12124
d55e5bfc 12125 def SetSizer(*args, **kwargs):
248ed943
RD
12126 """
12127 SetSizer(self, Sizer sizer)
12128
12129 Set the subsizer to be managed by this sizer item.
12130 """
d55e5bfc
RD
12131 return _core_.SizerItem_SetSizer(*args, **kwargs)
12132
ddeca22c 12133 def SetSpacer(*args, **kwargs):
248ed943 12134 """
ddeca22c 12135 SetSpacer(self, Size size)
248ed943 12136
ddeca22c 12137 Set the size of the spacer to be managed by this sizer item.
248ed943 12138 """
ddeca22c 12139 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc 12140
ddeca22c
RD
12141 SetWindow = wx._deprecated(SetWindow, "Use `AssignWindow` instead.")
12142 SetSizer = wx._deprecated(SetSizer, "Use `AssignSizer` instead.")
12143 SetSpacer = wx._deprecated(SetSpacer, "Use `AssignSpacer` instead.")
12144
12145 def AssignWindow(*args, **kwargs):
248ed943 12146 """
ddeca22c
RD
12147 AssignWindow(self, Window window)
12148
12149 Set the window to be managed by this sizer item.
12150 """
12151 return _core_.SizerItem_AssignWindow(*args, **kwargs)
12152
12153 def AssignSizer(*args, **kwargs):
12154 """
12155 AssignSizer(self, Sizer sizer)
12156
12157 Set the subsizer to be managed by this sizer item.
12158 """
12159 return _core_.SizerItem_AssignSizer(*args, **kwargs)
12160
12161 def AssignSpacer(*args, **kwargs):
12162 """
12163 AssignSpacer(self, Size size)
248ed943
RD
12164
12165 Set the size of the spacer to be managed by this sizer item.
12166 """
ddeca22c 12167 return _core_.SizerItem_AssignSpacer(*args, **kwargs)
d55e5bfc
RD
12168
12169 def Show(*args, **kwargs):
248ed943
RD
12170 """
12171 Show(self, bool show)
12172
12173 Set the show item attribute, which sizers use to determine if the item
12174 is to be made part of the layout or not. If the item is tracking a
12175 window then it is shown or hidden as needed.
12176 """
d55e5bfc
RD
12177 return _core_.SizerItem_Show(*args, **kwargs)
12178
12179 def IsShown(*args, **kwargs):
248ed943
RD
12180 """
12181 IsShown(self) -> bool
12182
12183 Is the item to be shown in the layout?
12184 """
d55e5bfc
RD
12185 return _core_.SizerItem_IsShown(*args, **kwargs)
12186
12187 def GetPosition(*args, **kwargs):
248ed943
RD
12188 """
12189 GetPosition(self) -> Point
12190
12191 Returns the current position of the item, as set in the last Layout.
12192 """
d55e5bfc
RD
12193 return _core_.SizerItem_GetPosition(*args, **kwargs)
12194
12195 def GetUserData(*args, **kwargs):
248ed943
RD
12196 """
12197 GetUserData(self) -> PyObject
12198
12199 Returns the userData associated with this sizer item, or None if there
12200 isn't any.
12201 """
d55e5bfc
RD
12202 return _core_.SizerItem_GetUserData(*args, **kwargs)
12203
7449af73
RD
12204 def SetUserData(*args, **kwargs):
12205 """
12206 SetUserData(self, PyObject userData)
12207
12208 Associate a Python object with this sizer item.
12209 """
12210 return _core_.SizerItem_SetUserData(*args, **kwargs)
12211
33d6fd3b
RD
12212 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
12213 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
12214 MinSize = property(GetMinSize,doc="See `GetMinSize`")
12215 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
12216 Position = property(GetPosition,doc="See `GetPosition`")
12217 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
12218 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
12219 Rect = property(GetRect,doc="See `GetRect`")
12220 Size = property(GetSize,doc="See `GetSize`")
ddeca22c
RD
12221 Sizer = property(GetSizer,AssignSizer,doc="See `GetSizer` and `AssignSizer`")
12222 Spacer = property(GetSpacer,AssignSpacer,doc="See `GetSpacer` and `AssignSpacer`")
33d6fd3b 12223 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
ddeca22c 12224 Window = property(GetWindow,AssignWindow,doc="See `GetWindow` and `AssignWindow`")
2131d850 12225_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 12226
248ed943 12227def SizerItemWindow(*args, **kwargs):
d55e5bfc 12228 """
248ed943
RD
12229 SizerItemWindow(Window window, int proportion, int flag, int border,
12230 PyObject userData=None) -> SizerItem
12231
12232 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 12233 """
248ed943 12234 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12235 return val
12236
248ed943 12237def SizerItemSpacer(*args, **kwargs):
d55e5bfc 12238 """
248ed943
RD
12239 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
12240 PyObject userData=None) -> SizerItem
12241
12242 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 12243 """
248ed943 12244 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12245 return val
12246
12247def SizerItemSizer(*args, **kwargs):
12248 """
12249 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
12250 PyObject userData=None) -> SizerItem
12251
12252 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc
RD
12253 """
12254 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12255 return val
12256
12257class Sizer(Object):
248ed943
RD
12258 """
12259 wx.Sizer is the abstract base class used for laying out subwindows in
12260 a window. You cannot use wx.Sizer directly; instead, you will have to
12261 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
12262 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
12263 `wx.GridBagSizer`.
248ed943
RD
12264
12265 The concept implemented by sizers in wxWidgets is closely related to
12266 layout tools in other GUI toolkits, such as Java's AWT, the GTK
12267 toolkit or the Qt toolkit. It is based upon the idea of the individual
12268 subwindows reporting their minimal required size and their ability to
12269 get stretched if the size of the parent window has changed. This will
12270 most often mean that the programmer does not set the original size of
12271 a dialog in the beginning, rather the dialog will assigned a sizer and
12272 this sizer will be queried about the recommended size. The sizer in
12273 turn will query its children, which can be normal windows or contorls,
12274 empty space or other sizers, so that a hierarchy of sizers can be
12275 constructed. Note that wxSizer does not derive from wxWindow and thus
12276 do not interfere with tab ordering and requires very little resources
12277 compared to a real window on screen.
12278
12279 What makes sizers so well fitted for use in wxWidgets is the fact that
12280 every control reports its own minimal size and the algorithm can
12281 handle differences in font sizes or different window (dialog item)
12282 sizes on different platforms without problems. If for example the
12283 standard font as well as the overall design of Mac widgets requires
12284 more space than on Windows, then the initial size of a dialog using a
12285 sizer will automatically be bigger on Mac than on Windows.
12286 """
554f62e9
RD
12287 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12288 def __init__(self): raise AttributeError, "No constructor defined"
12289 __repr__ = _swig_repr
12290 __swig_destroy__ = _core_.delete_Sizer
12291 __del__ = lambda self : None;
d55e5bfc
RD
12292 def _setOORInfo(*args, **kwargs):
12293 """_setOORInfo(self, PyObject _self)"""
12294 return _core_.Sizer__setOORInfo(*args, **kwargs)
12295
12296 def Add(*args, **kwargs):
12297 """
248ed943 12298 Add(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 12299 PyObject userData=None) -> wx.SizerItem
248ed943
RD
12300
12301 Appends a child item to the sizer.
d55e5bfc
RD
12302 """
12303 return _core_.Sizer_Add(*args, **kwargs)
12304
cbfc9df6
RD
12305 def AddF(*args, **kwargs):
12306 """
12307 AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12308
12309 Similar to `Add` but uses the `wx.SizerFlags` convenience class for
12310 setting the various flags, options and borders.
12311 """
12312 return _core_.Sizer_AddF(*args, **kwargs)
12313
d55e5bfc
RD
12314 def Insert(*args, **kwargs):
12315 """
248ed943 12316 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 12317 PyObject userData=None) -> wx.SizerItem
248ed943
RD
12318
12319 Inserts a new item into the list of items managed by this sizer before
12320 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc
RD
12321 """
12322 return _core_.Sizer_Insert(*args, **kwargs)
12323
cbfc9df6
RD
12324 def InsertF(*args, **kwargs):
12325 """
12326 InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
12327
12328 Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
12329 for setting the various flags, options and borders.
12330 """
12331 return _core_.Sizer_InsertF(*args, **kwargs)
12332
d55e5bfc
RD
12333 def Prepend(*args, **kwargs):
12334 """
248ed943 12335 Prepend(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 12336 PyObject userData=None) -> wx.SizerItem
248ed943
RD
12337
12338 Adds a new item to the begining of the list of sizer items managed by
12339 this sizer. See `Add` for a description of the parameters.
d55e5bfc
RD
12340 """
12341 return _core_.Sizer_Prepend(*args, **kwargs)
12342
cbfc9df6
RD
12343 def PrependF(*args, **kwargs):
12344 """
12345 PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12346
12347 Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
12348 for setting the various flags, options and borders.
12349 """
12350 return _core_.Sizer_PrependF(*args, **kwargs)
12351
d55e5bfc 12352 def Remove(*args, **kwargs):
248ed943
RD
12353 """
12354 Remove(self, item) -> bool
12355
12356 Removes an item from the sizer and destroys it. This method does not
12357 cause any layout or resizing to take place, call `Layout` to update
12358 the layout on screen after removing a child from the sizer. The
12359 *item* parameter can be either a window, a sizer, or the zero-based
12360 index of an item to remove. Returns True if the child item was found
12361 and removed.
12362 """
d55e5bfc
RD
12363 return _core_.Sizer_Remove(*args, **kwargs)
12364
1a6bba1e 12365 def Detach(*args, **kwargs):
248ed943
RD
12366 """
12367 Detach(self, item) -> bool
12368
12369 Detaches an item from the sizer without destroying it. This method
12370 does not cause any layout or resizing to take place, call `Layout` to
12371 do so. The *item* parameter can be either a window, a sizer, or the
12372 zero-based index of the item to be detached. Returns True if the child item
12373 was found and detached.
12374 """
1a6bba1e
RD
12375 return _core_.Sizer_Detach(*args, **kwargs)
12376
c1cb24a4
RD
12377 def GetItem(*args, **kwargs):
12378 """
cbfc9df6 12379 GetItem(self, item, recursive=False) -> wx.SizerItem
c1cb24a4
RD
12380
12381 Returns the `wx.SizerItem` which holds the *item* given. The *item*
12382 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 12383 the item to be found.
c1cb24a4
RD
12384 """
12385 return _core_.Sizer_GetItem(*args, **kwargs)
12386
d55e5bfc
RD
12387 def _SetItemMinSize(*args, **kwargs):
12388 """_SetItemMinSize(self, PyObject item, Size size)"""
12389 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
12390
97ab0f6a
RD
12391 def _ReplaceWin(*args, **kwargs):
12392 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
12393 return _core_.Sizer__ReplaceWin(*args, **kwargs)
12394
12395 def _ReplaceSizer(*args, **kwargs):
12396 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
12397 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
12398
12399 def _ReplaceItem(*args, **kwargs):
12400 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
12401 return _core_.Sizer__ReplaceItem(*args, **kwargs)
12402
12403 def Replace(self, olditem, item, recursive=False):
12404 """
12405 Detaches the given ``olditem`` from the sizer and replaces it with
12406 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
12407 detached child is destroyed only if it is not a window, (because
12408 windows are owned by their parent, not the sizer.) The
12409 ``recursive`` parameter can be used to search for the given
12410 element recursivly in subsizers.
12411
12412 This method does not cause any layout or resizing to take place,
12413 call `Layout` to do so.
12414
12415 Returns ``True`` if the child item was found and removed.
12416 """
12417 if isinstance(olditem, wx.Window):
12418 return self._ReplaceWin(olditem, item, recursive)
cbfc9df6 12419 elif isinstance(olditem, wx.Sizer):
97ab0f6a 12420 return self._ReplaceSizer(olditem, item, recursive)
cbfc9df6 12421 elif isinstance(olditem, int):
97ab0f6a
RD
12422 return self._ReplaceItem(olditem, item)
12423 else:
12424 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
12425
12426 def SetContainingWindow(*args, **kwargs):
12427 """
12428 SetContainingWindow(self, Window window)
12429
12430 Set (or unset) the window this sizer is used in.
12431 """
12432 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
12433
12434 def GetContainingWindow(*args, **kwargs):
12435 """
12436 GetContainingWindow(self) -> Window
12437
12438 Get the window this sizer is used in.
12439 """
12440 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
12441
248ed943
RD
12442 def SetItemMinSize(self, item, *args):
12443 """
12444 SetItemMinSize(self, item, Size size)
12445
12446 Sets the minimum size that will be allocated for an item in the sizer.
12447 The *item* parameter can be either a window, a sizer, or the
12448 zero-based index of the item. If a window or sizer is given then it
12449 will be searched for recursivly in subsizers if neccessary.
12450 """
12451 if len(args) == 2:
12452 # for backward compatibility accept separate width,height args too
12453 return self._SetItemMinSize(item, args)
12454 else:
12455 return self._SetItemMinSize(item, args[0])
12456
d55e5bfc 12457 def AddItem(*args, **kwargs):
248ed943
RD
12458 """
12459 AddItem(self, SizerItem item)
12460
12461 Adds a `wx.SizerItem` to the sizer.
12462 """
d55e5bfc
RD
12463 return _core_.Sizer_AddItem(*args, **kwargs)
12464
12465 def InsertItem(*args, **kwargs):
248ed943
RD
12466 """
12467 InsertItem(self, int index, SizerItem item)
12468
12469 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
12470 """
d55e5bfc
RD
12471 return _core_.Sizer_InsertItem(*args, **kwargs)
12472
12473 def PrependItem(*args, **kwargs):
248ed943
RD
12474 """
12475 PrependItem(self, SizerItem item)
12476
12477 Prepends a `wx.SizerItem` to the sizer.
12478 """
d55e5bfc
RD
12479 return _core_.Sizer_PrependItem(*args, **kwargs)
12480
248ed943 12481 def AddMany(self, items):
c24da6d6
RD
12482 """
12483 AddMany is a convenience method for adding several items
12484 to a sizer at one time. Simply pass it a list of tuples,
12485 where each tuple consists of the parameters that you
12486 would normally pass to the `Add` method.
12487 """
248ed943
RD
12488 for item in items:
12489 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
12490 item = (item, )
12491 self.Add(*item)
d55e5bfc 12492
0d2c9713
RD
12493 def AddSpacer(self, *args, **kw):
12494 """AddSpacer(int size) --> SizerItem
12495
12496 Add a spacer that is (size,size) pixels.
12497 """
12498 if args and type(args[0]) == int:
12499 return self.Add( (args[0],args[0] ), 0)
12500 else: # otherwise stay compatible with old AddSpacer
12501 return self.Add(*args, **kw)
12502 def PrependSpacer(self, *args, **kw):
12503 """PrependSpacer(int size) --> SizerItem
12504
12505 Prepend a spacer that is (size, size) pixels."""
12506 if args and type(args[0]) == int:
12507 return self.Prepend( (args[0],args[0] ), 0)
12508 else: # otherwise stay compatible with old PrependSpacer
12509 return self.Prepend(*args, **kw)
12510 def InsertSpacer(self, index, *args, **kw):
12511 """InsertSpacer(int index, int size) --> SizerItem
12512
12513 Insert a spacer at position index that is (size, size) pixels."""
12514 if args and type(args[0]) == int:
12515 return self.Insert( index, (args[0],args[0] ), 0)
12516 else: # otherwise stay compatible with old InsertSpacer
12517 return self.Insert(index, *args, **kw)
12518
12519
12520 def AddStretchSpacer(self, prop=1):
12521 """AddStretchSpacer(int prop=1) --> SizerItem
12522
12523 Add a stretchable spacer."""
12524 return self.Add((0,0), prop)
12525 def PrependStretchSpacer(self, prop=1):
12526 """PrependStretchSpacer(int prop=1) --> SizerItem
12527
12528 Prepend a stretchable spacer."""
12529 return self.Prepend((0,0), prop)
12530 def InsertStretchSpacer(self, index, prop=1):
12531 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
12532
12533 Insert a stretchable spacer."""
12534 return self.Insert(index, (0,0), prop)
12535
12536
d55e5bfc 12537 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
12538 def AddWindow(self, *args, **kw):
12539 """Compatibility alias for `Add`."""
12540 return self.Add(*args, **kw)
12541 def AddSizer(self, *args, **kw):
12542 """Compatibility alias for `Add`."""
12543 return self.Add(*args, **kw)
b9d6a5f3
RD
12544
12545 def PrependWindow(self, *args, **kw):
12546 """Compatibility alias for `Prepend`."""
12547 return self.Prepend(*args, **kw)
12548 def PrependSizer(self, *args, **kw):
12549 """Compatibility alias for `Prepend`."""
12550 return self.Prepend(*args, **kw)
b9d6a5f3
RD
12551
12552 def InsertWindow(self, *args, **kw):
12553 """Compatibility alias for `Insert`."""
12554 return self.Insert(*args, **kw)
12555 def InsertSizer(self, *args, **kw):
12556 """Compatibility alias for `Insert`."""
b9d6a5f3
RD
12557 return self.Insert(*args, **kw)
12558
12559 def RemoveWindow(self, *args, **kw):
12560 """Compatibility alias for `Remove`."""
12561 return self.Remove(*args, **kw)
12562 def RemoveSizer(self, *args, **kw):
12563 """Compatibility alias for `Remove`."""
12564 return self.Remove(*args, **kw)
12565 def RemovePos(self, *args, **kw):
12566 """Compatibility alias for `Remove`."""
12567 return self.Remove(*args, **kw)
d55e5bfc
RD
12568
12569
d55e5bfc 12570 def SetDimension(*args, **kwargs):
248ed943
RD
12571 """
12572 SetDimension(self, int x, int y, int width, int height)
12573
12574 Call this to force the sizer to take the given dimension and thus
12575 force the items owned by the sizer to resize themselves according to
12576 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
12577 methods.
12578 """
d55e5bfc
RD
12579 return _core_.Sizer_SetDimension(*args, **kwargs)
12580
12581 def SetMinSize(*args, **kwargs):
248ed943
RD
12582 """
12583 SetMinSize(self, Size size)
12584
12585 Call this to give the sizer a minimal size. Normally, the sizer will
12586 calculate its minimal size based purely on how much space its children
12587 need. After calling this method `GetMinSize` will return either the
12588 minimal size as requested by its children or the minimal size set
12589 here, depending on which is bigger.
12590 """
d55e5bfc
RD
12591 return _core_.Sizer_SetMinSize(*args, **kwargs)
12592
12593 def GetSize(*args, **kwargs):
248ed943
RD
12594 """
12595 GetSize(self) -> Size
12596
12597 Returns the current size of the space managed by the sizer.
12598 """
d55e5bfc
RD
12599 return _core_.Sizer_GetSize(*args, **kwargs)
12600
12601 def GetPosition(*args, **kwargs):
248ed943
RD
12602 """
12603 GetPosition(self) -> Point
12604
12605 Returns the current position of the sizer's managed space.
12606 """
d55e5bfc
RD
12607 return _core_.Sizer_GetPosition(*args, **kwargs)
12608
12609 def GetMinSize(*args, **kwargs):
248ed943
RD
12610 """
12611 GetMinSize(self) -> Size
12612
12613 Returns the minimal size of the sizer. This is either the combined
12614 minimal size of all the children and their borders or the minimal size
12615 set by SetMinSize, depending on which is bigger.
12616 """
d55e5bfc
RD
12617 return _core_.Sizer_GetMinSize(*args, **kwargs)
12618
12619 def GetSizeTuple(self):
1a6bba1e 12620 return self.GetSize().Get()
d55e5bfc 12621 def GetPositionTuple(self):
1a6bba1e 12622 return self.GetPosition().Get()
d55e5bfc 12623 def GetMinSizeTuple(self):
1a6bba1e 12624 return self.GetMinSize().Get()
d55e5bfc
RD
12625
12626 def RecalcSizes(*args, **kwargs):
248ed943
RD
12627 """
12628 RecalcSizes(self)
12629
12630 Using the sizes calculated by `CalcMin` reposition and resize all the
12631 items managed by this sizer. You should not need to call this directly as
12632 it is called by `Layout`.
12633 """
d55e5bfc
RD
12634 return _core_.Sizer_RecalcSizes(*args, **kwargs)
12635
12636 def CalcMin(*args, **kwargs):
248ed943
RD
12637 """
12638 CalcMin(self) -> Size
12639
12640 This method is where the sizer will do the actual calculation of its
12641 children's minimal sizes. You should not need to call this directly as
12642 it is called by `Layout`.
12643 """
d55e5bfc
RD
12644 return _core_.Sizer_CalcMin(*args, **kwargs)
12645
12646 def Layout(*args, **kwargs):
248ed943
RD
12647 """
12648 Layout(self)
12649
12650 This method will force the recalculation and layout of the items
12651 controlled by the sizer using the current space allocated to the
12652 sizer. Normally this is called automatically from the owning window's
12653 EVT_SIZE handler, but it is also useful to call it from user code when
12654 one of the items in a sizer change size, or items are added or
12655 removed.
12656 """
d55e5bfc
RD
12657 return _core_.Sizer_Layout(*args, **kwargs)
12658
12659 def Fit(*args, **kwargs):
248ed943
RD
12660 """
12661 Fit(self, Window window) -> Size
12662
12663 Tell the sizer to resize the *window* to match the sizer's minimal
12664 size. This is commonly done in the constructor of the window itself in
12665 order to set its initial size to match the needs of the children as
12666 determined by the sizer. Returns the new size.
12667
12668 For a top level window this is the total window size, not the client size.
12669 """
d55e5bfc
RD
12670 return _core_.Sizer_Fit(*args, **kwargs)
12671
12672 def FitInside(*args, **kwargs):
248ed943
RD
12673 """
12674 FitInside(self, Window window)
12675
12676 Tell the sizer to resize the *virtual size* of the *window* to match the
12677 sizer's minimal size. This will not alter the on screen size of the
12678 window, but may cause the addition/removal/alteration of scrollbars
12679 required to view the virtual area in windows which manage it.
12680
12681 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12682
12683 """
d55e5bfc
RD
12684 return _core_.Sizer_FitInside(*args, **kwargs)
12685
12686 def SetSizeHints(*args, **kwargs):
248ed943
RD
12687 """
12688 SetSizeHints(self, Window window)
12689
12690 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12691 match the sizer's minimal size. This is commonly done in the
12692 constructor of the window itself if the window is resizable (as are
12693 many dialogs under Unix and frames on probably all platforms) in order
12694 to prevent the window from being sized smaller than the minimal size
12695 required by the sizer.
12696 """
d55e5bfc
RD
12697 return _core_.Sizer_SetSizeHints(*args, **kwargs)
12698
12699 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
12700 """
12701 SetVirtualSizeHints(self, Window window)
12702
12703 Tell the sizer to set the minimal size of the window virtual area to
12704 match the sizer's minimal size. For windows with managed scrollbars
12705 this will set them appropriately.
12706
12707 :see: `wx.ScrolledWindow.SetScrollbars`
12708
12709 """
d55e5bfc
RD
12710 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
12711
12712 def Clear(*args, **kwargs):
248ed943
RD
12713 """
12714 Clear(self, bool deleteWindows=False)
12715
12716 Clear all items from the sizer, optionally destroying the window items
12717 as well.
12718 """
d55e5bfc
RD
12719 return _core_.Sizer_Clear(*args, **kwargs)
12720
12721 def DeleteWindows(*args, **kwargs):
248ed943
RD
12722 """
12723 DeleteWindows(self)
12724
12725 Destroy all windows managed by the sizer.
12726 """
d55e5bfc
RD
12727 return _core_.Sizer_DeleteWindows(*args, **kwargs)
12728
12729 def GetChildren(*args, **kwargs):
248ed943 12730 """
51b83b37 12731 GetChildren(self) -> list
248ed943
RD
12732
12733 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12734 """
d55e5bfc
RD
12735 return _core_.Sizer_GetChildren(*args, **kwargs)
12736
12737 def Show(*args, **kwargs):
248ed943 12738 """
ae8162c8 12739 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 12740
248ed943
RD
12741 Shows or hides an item managed by the sizer. To make a sizer item
12742 disappear or reappear, use Show followed by `Layout`. The *item*
12743 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
12744 the item. Use the recursive parameter to show or hide an item in a
12745 subsizer. Returns True if the item was found.
248ed943
RD
12746 """
12747 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
12748
12749 def IsShown(*args, **kwargs):
248ed943
RD
12750 """
12751 IsShown(self, item)
12752
b1fcee84 12753 Determines if the item is currently shown. To make a sizer
248ed943
RD
12754 item disappear or reappear, use Show followed by `Layout`. The *item*
12755 parameter can be either a window, a sizer, or the zero-based index of
12756 the item.
12757 """
d55e5bfc
RD
12758 return _core_.Sizer_IsShown(*args, **kwargs)
12759
629e65c2 12760 def Hide(self, item, recursive=False):
248ed943 12761 """
27fb7603 12762 A convenience method for `Show` (item, False, recursive).
248ed943 12763 """
06759a38 12764 return self.Show(item, False, recursive)
248ed943 12765
d55e5bfc 12766 def ShowItems(*args, **kwargs):
248ed943
RD
12767 """
12768 ShowItems(self, bool show)
12769
84f85550 12770 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 12771 """
d55e5bfc
RD
12772 return _core_.Sizer_ShowItems(*args, **kwargs)
12773
33d6fd3b
RD
12774 Children = property(GetChildren,doc="See `GetChildren`")
12775 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12776 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12777 Position = property(GetPosition,doc="See `GetPosition`")
12778 Size = property(GetSize,doc="See `GetSize`")
2131d850 12779_core_.Sizer_swigregister(Sizer)
d55e5bfc
RD
12780
12781class PySizer(Sizer):
248ed943
RD
12782 """
12783 wx.PySizer is a special version of `wx.Sizer` that has been
12784 instrumented to allow the C++ virtual methods to be overloaded in
12785 Python derived classes. You would derive from this class if you are
12786 wanting to implement a custom sizer in Python code. Simply implement
12787 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12788 For example::
12789
12790 class MySizer(wx.PySizer):
12791 def __init__(self):
12792 wx.PySizer.__init__(self)
12793
12794 def CalcMin(self):
12795 for item in self.GetChildren():
12796 # calculate the total minimum width and height needed
12797 # by all items in the sizer according to this sizer's
12798 # layout algorithm.
12799 ...
12800 return wx.Size(width, height)
12801
12802 def RecalcSizes(self):
12803 # find the space allotted to this sizer
12804 pos = self.GetPosition()
12805 size = self.GetSize()
12806 for item in self.GetChildren():
12807 # Recalculate (if necessary) the position and size of
12808 # each item and then call item.SetDimension to do the
12809 # actual positioning and sizing of the items within the
12810 # space alloted to this sizer.
12811 ...
12812 item.SetDimension(itemPos, itemSize)
12813
12814
12815 When `Layout` is called it first calls `CalcMin` followed by
12816 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 12817 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
12818
12819 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12820
12821
12822 """
554f62e9
RD
12823 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12824 __repr__ = _swig_repr
12825 def __init__(self, *args, **kwargs):
248ed943
RD
12826 """
12827 __init__(self) -> PySizer
12828
12829 Creates a wx.PySizer. Must be called from the __init__ in the derived
12830 class.
12831 """
554f62e9 12832 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
c25f90f6 12833 self._setOORInfo(self);PySizer._setCallbackInfo(self, self, PySizer)
d55e5bfc
RD
12834
12835 def _setCallbackInfo(*args, **kwargs):
12836 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12837 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
12838
2131d850 12839_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
12840
12841#---------------------------------------------------------------------------
12842
12843class BoxSizer(Sizer):
248ed943
RD
12844 """
12845 The basic idea behind a box sizer is that windows will most often be
12846 laid out in rather simple basic geometry, typically in a row or a
12847 column or nested hierarchies of either. A wx.BoxSizer will lay out
12848 its items in a simple row or column, depending on the orientation
12849 parameter passed to the constructor.
12850 """
554f62e9
RD
12851 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12852 __repr__ = _swig_repr
12853 def __init__(self, *args, **kwargs):
248ed943
RD
12854 """
12855 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12856
12857 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12858 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12859 sizer.
12860 """
554f62e9 12861 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
12862 self._setOORInfo(self)
12863
12864 def GetOrientation(*args, **kwargs):
248ed943
RD
12865 """
12866 GetOrientation(self) -> int
12867
12868 Returns the current orientation of the sizer.
12869 """
d55e5bfc
RD
12870 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
12871
12872 def SetOrientation(*args, **kwargs):
248ed943
RD
12873 """
12874 SetOrientation(self, int orient)
d55e5bfc 12875
248ed943
RD
12876 Resets the orientation of the sizer.
12877 """
12878 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 12879
226118fc 12880 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
2131d850 12881_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
12882
12883#---------------------------------------------------------------------------
12884
12885class StaticBoxSizer(BoxSizer):
248ed943
RD
12886 """
12887 wx.StaticBoxSizer derives from and functions identically to the
12888 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12889 manages. Note that this static box must be created separately and
12890 passed to the sizer constructor.
12891 """
554f62e9
RD
12892 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12893 __repr__ = _swig_repr
12894 def __init__(self, *args, **kwargs):
248ed943
RD
12895 """
12896 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12897
12898 Constructor. It takes an associated static box and the orientation
12899 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12900 ``wx.HORIZONTAL``.
12901 """
554f62e9 12902 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
12903 self._setOORInfo(self)
12904
12905 def GetStaticBox(*args, **kwargs):
248ed943
RD
12906 """
12907 GetStaticBox(self) -> StaticBox
d55e5bfc 12908
248ed943
RD
12909 Returns the static box associated with this sizer.
12910 """
12911 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 12912
33d6fd3b 12913 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
2131d850 12914_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
12915
12916#---------------------------------------------------------------------------
12917
12918class GridSizer(Sizer):
248ed943
RD
12919 """
12920 A grid sizer is a sizer which lays out its children in a
12921 two-dimensional table with all cells having the same size. In other
12922 words, the width of each cell within the grid is the width of the
12923 widest item added to the sizer and the height of each grid cell is the
12924 height of the tallest item. An optional vertical and/or horizontal
12925 gap between items can also be specified (in pixels.)
12926
12927 Items are placed in the cells of the grid in the order they are added,
12928 in row-major order. In other words, the first row is filled first,
12929 then the second, and so on until all items have been added. (If
12930 neccessary, additional rows will be added as items are added.) If you
12931 need to have greater control over the cells that items are placed in
12932 then use the `wx.GridBagSizer`.
12933
12934 """
554f62e9
RD
12935 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12936 __repr__ = _swig_repr
12937 def __init__(self, *args, **kwargs):
248ed943
RD
12938 """
12939 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12940
12941 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12942 of columns and rows in the sizer - if either of the parameters is
12943 zero, it will be calculated to from the total number of children in
12944 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12945 define extra space between all children.
12946 """
554f62e9 12947 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
12948 self._setOORInfo(self)
12949
d55e5bfc 12950 def SetCols(*args, **kwargs):
248ed943
RD
12951 """
12952 SetCols(self, int cols)
12953
12954 Sets the number of columns in the sizer.
12955 """
d55e5bfc
RD
12956 return _core_.GridSizer_SetCols(*args, **kwargs)
12957
12958 def SetRows(*args, **kwargs):
248ed943
RD
12959 """
12960 SetRows(self, int rows)
12961
12962 Sets the number of rows in the sizer.
12963 """
d55e5bfc
RD
12964 return _core_.GridSizer_SetRows(*args, **kwargs)
12965
12966 def SetVGap(*args, **kwargs):
248ed943
RD
12967 """
12968 SetVGap(self, int gap)
12969
12970 Sets the vertical gap (in pixels) between the cells in the sizer.
12971 """
d55e5bfc
RD
12972 return _core_.GridSizer_SetVGap(*args, **kwargs)
12973
12974 def SetHGap(*args, **kwargs):
248ed943
RD
12975 """
12976 SetHGap(self, int gap)
12977
12978 Sets the horizontal gap (in pixels) between cells in the sizer
12979 """
d55e5bfc
RD
12980 return _core_.GridSizer_SetHGap(*args, **kwargs)
12981
12982 def GetCols(*args, **kwargs):
248ed943
RD
12983 """
12984 GetCols(self) -> int
12985
12986 Returns the number of columns in the sizer.
12987 """
d55e5bfc
RD
12988 return _core_.GridSizer_GetCols(*args, **kwargs)
12989
12990 def GetRows(*args, **kwargs):
248ed943
RD
12991 """
12992 GetRows(self) -> int
12993
12994 Returns the number of rows in the sizer.
12995 """
d55e5bfc
RD
12996 return _core_.GridSizer_GetRows(*args, **kwargs)
12997
12998 def GetVGap(*args, **kwargs):
248ed943
RD
12999 """
13000 GetVGap(self) -> int
13001
13002 Returns the vertical gap (in pixels) between the cells in the sizer.
13003 """
d55e5bfc
RD
13004 return _core_.GridSizer_GetVGap(*args, **kwargs)
13005
13006 def GetHGap(*args, **kwargs):
248ed943
RD
13007 """
13008 GetHGap(self) -> int
13009
13010 Returns the horizontal gap (in pixels) between cells in the sizer.
13011 """
d55e5bfc
RD
13012 return _core_.GridSizer_GetHGap(*args, **kwargs)
13013
554f62e9
RD
13014 def CalcRowsCols(self):
13015 """
13016 CalcRowsCols() -> (rows, cols)
d55e5bfc 13017
554f62e9
RD
13018 Calculates how many rows and columns will be in the sizer based
13019 on the current number of items and also the rows, cols specified
13020 in the constructor.
13021 """
13022 nitems = len(self.GetChildren())
13023 rows = self.GetRows()
13024 cols = self.GetCols()
13025 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
13026 if cols != 0:
13027 rows = (nitems + cols - 1) / cols
13028 elif rows != 0:
13029 cols = (nitems + rows - 1) / rows
13030 return (rows, cols)
13031
97ab0f6a
RD
13032 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
13033 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
13034 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
13035 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
2131d850 13036_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
13037
13038#---------------------------------------------------------------------------
13039
13040FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
13041FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
13042FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
13043class FlexGridSizer(GridSizer):
248ed943
RD
13044 """
13045 A flex grid sizer is a sizer which lays out its children in a
13046 two-dimensional table with all table cells in one row having the same
13047 height and all cells in one column having the same width, but all
13048 rows or all columns are not necessarily the same height or width as in
13049 the `wx.GridSizer`.
13050
13051 wx.FlexGridSizer can also size items equally in one direction but
13052 unequally ("flexibly") in the other. If the sizer is only flexible
13053 in one direction (this can be changed using `SetFlexibleDirection`), it
13054 needs to be decided how the sizer should grow in the other ("non
13055 flexible") direction in order to fill the available space. The
13056 `SetNonFlexibleGrowMode` method serves this purpose.
13057
13058
13059 """
554f62e9
RD
13060 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13061 __repr__ = _swig_repr
13062 def __init__(self, *args, **kwargs):
248ed943
RD
13063 """
13064 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
13065
13066 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
13067 number of columns and rows in the sizer - if either of the parameters
13068 is zero, it will be calculated to from the total number of children in
13069 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13070 define extra space between all children.
13071 """
554f62e9 13072 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
13073 self._setOORInfo(self)
13074
248ed943
RD
13075 def AddGrowableRow(*args, **kwargs):
13076 """
13077 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 13078
248ed943
RD
13079 Specifies that row *idx* (starting from zero) should be grown if there
13080 is extra space available to the sizer.
d55e5bfc 13081
248ed943
RD
13082 The *proportion* parameter has the same meaning as the stretch factor
13083 for the box sizers except that if all proportions are 0, then all
13084 columns are resized equally (instead of not being resized at all).
13085 """
d55e5bfc
RD
13086 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
13087
13088 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
13089 """
13090 RemoveGrowableRow(self, size_t idx)
13091
13092 Specifies that row *idx* is no longer growable.
13093 """
d55e5bfc
RD
13094 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
13095
13096 def AddGrowableCol(*args, **kwargs):
248ed943
RD
13097 """
13098 AddGrowableCol(self, size_t idx, int proportion=0)
13099
13100 Specifies that column *idx* (starting from zero) should be grown if
13101 there is extra space available to the sizer.
13102
13103 The *proportion* parameter has the same meaning as the stretch factor
13104 for the box sizers except that if all proportions are 0, then all
13105 columns are resized equally (instead of not being resized at all).
13106 """
d55e5bfc
RD
13107 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
13108
13109 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
13110 """
13111 RemoveGrowableCol(self, size_t idx)
13112
13113 Specifies that column *idx* is no longer growable.
13114 """
d55e5bfc
RD
13115 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
13116
13117 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
13118 """
13119 SetFlexibleDirection(self, int direction)
13120
13121 Specifies whether the sizer should flexibly resize its columns, rows,
13122 or both. Argument *direction* can be one of the following values. Any
13123 other value is ignored.
13124
13125 ============== =======================================
13126 wx.VERTICAL Rows are flexibly sized.
13127 wx.HORIZONTAL Columns are flexibly sized.
13128 wx.BOTH Both rows and columns are flexibly sized
13129 (this is the default value).
13130 ============== =======================================
13131
13132 Note that this method does not trigger relayout.
13133
13134 """
d55e5bfc
RD
13135 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
13136
13137 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
13138 """
13139 GetFlexibleDirection(self) -> int
13140
13141 Returns a value that specifies whether the sizer
13142 flexibly resizes its columns, rows, or both (default).
13143
13144 :see: `SetFlexibleDirection`
13145 """
d55e5bfc
RD
13146 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
13147
13148 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
13149 """
13150 SetNonFlexibleGrowMode(self, int mode)
13151
13152 Specifies how the sizer should grow in the non-flexible direction if
13153 there is one (so `SetFlexibleDirection` must have been called
13154 previously). Argument *mode* can be one of the following values:
13155
13156 ========================== =================================================
13157 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
13158 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
13159 `AddGrowableCol` and `AddGrowableRow`. In this
13160 case equal sizing applies to minimum sizes of
13161 columns or rows (this is the default value).
13162 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
13163 the non flexible direction, whether they are
13164 growable or not in the flexbile direction.
13165 ========================== =================================================
13166
13167 Note that this method does not trigger relayout.
248ed943 13168 """
d55e5bfc
RD
13169 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
13170
13171 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
13172 """
13173 GetNonFlexibleGrowMode(self) -> int
13174
13175 Returns the value that specifies how the sizer grows in the
13176 non-flexible direction if there is one.
13177
13178 :see: `SetNonFlexibleGrowMode`
13179 """
d55e5bfc
RD
13180 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
13181
13182 def GetRowHeights(*args, **kwargs):
a8eff060
RD
13183 """
13184 GetRowHeights(self) -> list
13185
13186 Returns a list of integers representing the heights of each of the
13187 rows in the sizer.
13188 """
d55e5bfc
RD
13189 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
13190
13191 def GetColWidths(*args, **kwargs):
a8eff060
RD
13192 """
13193 GetColWidths(self) -> list
13194
13195 Returns a list of integers representing the widths of each of the
13196 columns in the sizer.
13197 """
d55e5bfc
RD
13198 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
13199
97ab0f6a
RD
13200 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
13201 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
13202 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
13203 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
2131d850 13204_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 13205
62d32a5f
RD
13206class StdDialogButtonSizer(BoxSizer):
13207 """
13208 A special sizer that knows how to order and position standard buttons
13209 in order to conform to the current platform's standards. You simply
13210 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 13211 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
13212 will take care of the rest.
13213
13214 """
554f62e9
RD
13215 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13216 __repr__ = _swig_repr
13217 def __init__(self, *args, **kwargs):
62d32a5f 13218 """__init__(self) -> StdDialogButtonSizer"""
554f62e9 13219 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
13220 def AddButton(*args, **kwargs):
13221 """
13222 AddButton(self, wxButton button)
13223
13224 Use this to add the buttons to this sizer. Do not use the `Add`
13225 method in the base class.
13226 """
13227 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
13228
53aa7709 13229 def Realize(*args, **kwargs):
62d32a5f 13230 """
53aa7709 13231 Realize(self)
62d32a5f
RD
13232
13233 This funciton needs to be called after all the buttons have been added
13234 to the sizer. It will reorder them and position them in a platform
13235 specifc manner.
13236 """
53aa7709 13237 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
13238
13239 def SetAffirmativeButton(*args, **kwargs):
13240 """SetAffirmativeButton(self, wxButton button)"""
13241 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
13242
13243 def SetNegativeButton(*args, **kwargs):
13244 """SetNegativeButton(self, wxButton button)"""
13245 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
13246
13247 def SetCancelButton(*args, **kwargs):
13248 """SetCancelButton(self, wxButton button)"""
13249 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
13250
13251 def GetAffirmativeButton(*args, **kwargs):
13252 """GetAffirmativeButton(self) -> wxButton"""
13253 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
13254
13255 def GetApplyButton(*args, **kwargs):
13256 """GetApplyButton(self) -> wxButton"""
13257 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
13258
13259 def GetNegativeButton(*args, **kwargs):
13260 """GetNegativeButton(self) -> wxButton"""
13261 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
13262
13263 def GetCancelButton(*args, **kwargs):
13264 """GetCancelButton(self) -> wxButton"""
13265 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
13266
13267 def GetHelpButton(*args, **kwargs):
13268 """GetHelpButton(self) -> wxButton"""
13269 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
13270
33d6fd3b
RD
13271 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
13272 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
13273 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
13274 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
13275 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
2131d850 13276_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 13277
d55e5bfc
RD
13278#---------------------------------------------------------------------------
13279
13280class GBPosition(object):
248ed943
RD
13281 """
13282 This class represents the position of an item in a virtual grid of
13283 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13284 typemaps that will automatically convert from a 2-element sequence of
13285 integers to a wx.GBPosition, so you can use the more pythonic
13286 representation of the position nearly transparently in Python code.
13287 """
554f62e9
RD
13288 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13289 __repr__ = _swig_repr
13290 def __init__(self, *args, **kwargs):
248ed943
RD
13291 """
13292 __init__(self, int row=0, int col=0) -> GBPosition
13293
13294 This class represents the position of an item in a virtual grid of
13295 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13296 typemaps that will automatically convert from a 2-element sequence of
13297 integers to a wx.GBPosition, so you can use the more pythonic
13298 representation of the position nearly transparently in Python code.
13299 """
554f62e9
RD
13300 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
13301 __swig_destroy__ = _core_.delete_GBPosition
13302 __del__ = lambda self : None;
d55e5bfc
RD
13303 def GetRow(*args, **kwargs):
13304 """GetRow(self) -> int"""
13305 return _core_.GBPosition_GetRow(*args, **kwargs)
13306
13307 def GetCol(*args, **kwargs):
13308 """GetCol(self) -> int"""
13309 return _core_.GBPosition_GetCol(*args, **kwargs)
13310
13311 def SetRow(*args, **kwargs):
13312 """SetRow(self, int row)"""
13313 return _core_.GBPosition_SetRow(*args, **kwargs)
13314
13315 def SetCol(*args, **kwargs):
13316 """SetCol(self, int col)"""
13317 return _core_.GBPosition_SetCol(*args, **kwargs)
13318
13319 def __eq__(*args, **kwargs):
e9d6f3a4
RD
13320 """
13321 __eq__(self, PyObject other) -> bool
13322
13323 Compare GBPosition for equality.
13324 """
d55e5bfc
RD
13325 return _core_.GBPosition___eq__(*args, **kwargs)
13326
13327 def __ne__(*args, **kwargs):
e9d6f3a4
RD
13328 """
13329 __ne__(self, PyObject other) -> bool
13330
13331 Compare GBPosition for inequality.
13332 """
d55e5bfc
RD
13333 return _core_.GBPosition___ne__(*args, **kwargs)
13334
13335 def Set(*args, **kwargs):
13336 """Set(self, int row=0, int col=0)"""
13337 return _core_.GBPosition_Set(*args, **kwargs)
13338
13339 def Get(*args, **kwargs):
13340 """Get(self) -> PyObject"""
13341 return _core_.GBPosition_Get(*args, **kwargs)
13342
79fccf9d 13343 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
13344 def __str__(self): return str(self.Get())
13345 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
13346 def __len__(self): return len(self.Get())
13347 def __getitem__(self, index): return self.Get()[index]
13348 def __setitem__(self, index, val):
13349 if index == 0: self.SetRow(val)
13350 elif index == 1: self.SetCol(val)
13351 else: raise IndexError
13352 def __nonzero__(self): return self.Get() != (0,0)
13353 __safe_for_unpickling__ = True
13354 def __reduce__(self): return (wx.GBPosition, self.Get())
13355
13356 row = property(GetRow, SetRow)
13357 col = property(GetCol, SetCol)
13358
2131d850 13359_core_.GBPosition_swigregister(GBPosition)
d55e5bfc
RD
13360
13361class GBSpan(object):
248ed943
RD
13362 """
13363 This class is used to hold the row and column spanning attributes of
13364 items in a `wx.GridBagSizer`. wxPython has typemaps that will
13365 automatically convert from a 2-element sequence of integers to a
13366 wx.GBSpan, so you can use the more pythonic representation of the span
13367 nearly transparently in Python code.
13368
13369 """
554f62e9
RD
13370 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13371 __repr__ = _swig_repr
13372 def __init__(self, *args, **kwargs):
248ed943
RD
13373 """
13374 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
13375
13376 Construct a new wxGBSpan, optionally setting the rowspan and
13377 colspan. The default is (1,1). (Meaning that the item occupies one
13378 cell in each direction.
13379 """
554f62e9
RD
13380 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
13381 __swig_destroy__ = _core_.delete_GBSpan
13382 __del__ = lambda self : None;
d55e5bfc
RD
13383 def GetRowspan(*args, **kwargs):
13384 """GetRowspan(self) -> int"""
13385 return _core_.GBSpan_GetRowspan(*args, **kwargs)
13386
13387 def GetColspan(*args, **kwargs):
13388 """GetColspan(self) -> int"""
13389 return _core_.GBSpan_GetColspan(*args, **kwargs)
13390
13391 def SetRowspan(*args, **kwargs):
13392 """SetRowspan(self, int rowspan)"""
13393 return _core_.GBSpan_SetRowspan(*args, **kwargs)
13394
13395 def SetColspan(*args, **kwargs):
13396 """SetColspan(self, int colspan)"""
13397 return _core_.GBSpan_SetColspan(*args, **kwargs)
13398
13399 def __eq__(*args, **kwargs):
e9d6f3a4
RD
13400 """
13401 __eq__(self, PyObject other) -> bool
13402
13403 Compare wxGBSpan for equality.
13404 """
d55e5bfc
RD
13405 return _core_.GBSpan___eq__(*args, **kwargs)
13406
13407 def __ne__(*args, **kwargs):
e9d6f3a4
RD
13408 """
13409 __ne__(self, PyObject other) -> bool
13410
13411 Compare GBSpan for inequality.
13412 """
d55e5bfc
RD
13413 return _core_.GBSpan___ne__(*args, **kwargs)
13414
13415 def Set(*args, **kwargs):
13416 """Set(self, int rowspan=1, int colspan=1)"""
13417 return _core_.GBSpan_Set(*args, **kwargs)
13418
13419 def Get(*args, **kwargs):
13420 """Get(self) -> PyObject"""
13421 return _core_.GBSpan_Get(*args, **kwargs)
13422
79fccf9d 13423 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
13424 def __str__(self): return str(self.Get())
13425 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
13426 def __len__(self): return len(self.Get())
13427 def __getitem__(self, index): return self.Get()[index]
13428 def __setitem__(self, index, val):
13429 if index == 0: self.SetRowspan(val)
13430 elif index == 1: self.SetColspan(val)
13431 else: raise IndexError
13432 def __nonzero__(self): return self.Get() != (0,0)
13433 __safe_for_unpickling__ = True
13434 def __reduce__(self): return (wx.GBSpan, self.Get())
13435
13436 rowspan = property(GetRowspan, SetRowspan)
13437 colspan = property(GetColspan, SetColspan)
13438
2131d850 13439_core_.GBSpan_swigregister(GBSpan)
d55e5bfc
RD
13440
13441class GBSizerItem(SizerItem):
248ed943
RD
13442 """
13443 The wx.GBSizerItem class is used to track the additional data about
13444 items in a `wx.GridBagSizer` such as the item's position in the grid
13445 and how many rows or columns it spans.
13446
13447 """
554f62e9
RD
13448 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13449 __repr__ = _swig_repr
13450 def __init__(self, *args, **kwargs):
248ed943
RD
13451 """
13452 __init__(self) -> GBSizerItem
13453
13454 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
13455 size will need to be set, as well as a position and span before this
13456 item can be used in a Sizer.
13457
13458 You will probably never need to create a wx.GBSizerItem directly as they
13459 are created automatically when the sizer's Add method is called.
13460 """
554f62e9
RD
13461 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
13462 __swig_destroy__ = _core_.delete_GBSizerItem
13463 __del__ = lambda self : None;
d55e5bfc 13464 def GetPos(*args, **kwargs):
248ed943
RD
13465 """
13466 GetPos(self) -> GBPosition
13467
13468 Get the grid position of the item
13469 """
d55e5bfc
RD
13470 return _core_.GBSizerItem_GetPos(*args, **kwargs)
13471
13472 def GetPosTuple(self): return self.GetPos().Get()
13473 def GetSpan(*args, **kwargs):
248ed943
RD
13474 """
13475 GetSpan(self) -> GBSpan
13476
13477 Get the row and column spanning of the item
13478 """
d55e5bfc
RD
13479 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
13480
13481 def GetSpanTuple(self): return self.GetSpan().Get()
13482 def SetPos(*args, **kwargs):
248ed943
RD
13483 """
13484 SetPos(self, GBPosition pos) -> bool
13485
13486 If the item is already a member of a sizer then first ensure that
13487 there is no other item that would intersect with this one at the new
13488 position, then set the new position. Returns True if the change is
13489 successful and after the next Layout() the item will be moved.
13490 """
d55e5bfc
RD
13491 return _core_.GBSizerItem_SetPos(*args, **kwargs)
13492
13493 def SetSpan(*args, **kwargs):
248ed943
RD
13494 """
13495 SetSpan(self, GBSpan span) -> bool
13496
13497 If the item is already a member of a sizer then first ensure that
13498 there is no other item that would intersect with this one with its new
13499 spanning size, then set the new spanning. Returns True if the change
13500 is successful and after the next Layout() the item will be resized.
13501
13502 """
d55e5bfc
RD
13503 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
13504
248ed943 13505 def Intersects(*args, **kwargs):
d55e5bfc
RD
13506 """
13507 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
13508
13509 Returns True if this item and the other item instersect.
d55e5bfc 13510 """
248ed943
RD
13511 return _core_.GBSizerItem_Intersects(*args, **kwargs)
13512
13513 def IntersectsPos(*args, **kwargs):
13514 """
13515 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
13516
13517 Returns True if the given pos/span would intersect with this item.
13518 """
13519 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
13520
13521 def GetEndPos(*args, **kwargs):
248ed943
RD
13522 """
13523 GetEndPos(self) -> GBPosition
13524
13525 Get the row and column of the endpoint of this item.
13526 """
d55e5bfc
RD
13527 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
13528
13529 def GetGBSizer(*args, **kwargs):
248ed943
RD
13530 """
13531 GetGBSizer(self) -> GridBagSizer
13532
13533 Get the sizer this item is a member of.
13534 """
d55e5bfc
RD
13535 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
13536
13537 def SetGBSizer(*args, **kwargs):
248ed943
RD
13538 """
13539 SetGBSizer(self, GridBagSizer sizer)
13540
13541 Set the sizer this item is a member of.
13542 """
d55e5bfc
RD
13543 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
13544
97ab0f6a
RD
13545 EndPos = property(GetEndPos,doc="See `GetEndPos`")
13546 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
13547 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
13548 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
2131d850 13549_core_.GBSizerItem_swigregister(GBSizerItem)
d55e5bfc
RD
13550DefaultSpan = cvar.DefaultSpan
13551
13552def GBSizerItemWindow(*args, **kwargs):
13553 """
13554 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
13555 int border, PyObject userData=None) -> GBSizerItem
13556
13557 Construct a `wx.GBSizerItem` for a window.
d55e5bfc
RD
13558 """
13559 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
13560 return val
13561
13562def GBSizerItemSizer(*args, **kwargs):
13563 """
13564 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
13565 int border, PyObject userData=None) -> GBSizerItem
13566
13567 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc
RD
13568 """
13569 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
13570 return val
13571
13572def GBSizerItemSpacer(*args, **kwargs):
13573 """
13574 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
13575 int flag, int border, PyObject userData=None) -> GBSizerItem
13576
13577 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc
RD
13578 """
13579 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
13580 return val
13581
13582class GridBagSizer(FlexGridSizer):
248ed943
RD
13583 """
13584 A `wx.Sizer` that can lay out items in a virtual grid like a
13585 `wx.FlexGridSizer` but in this case explicit positioning of the items
13586 is allowed using `wx.GBPosition`, and items can optionally span more
13587 than one row and/or column using `wx.GBSpan`. The total size of the
13588 virtual grid is determined by the largest row and column that items are
13589 positioned at, adjusted for spanning.
13590
13591 """
554f62e9
RD
13592 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13593 __repr__ = _swig_repr
13594 def __init__(self, *args, **kwargs):
248ed943
RD
13595 """
13596 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
13597
13598 Constructor, with optional parameters to specify the gap between the
13599 rows and columns.
13600 """
554f62e9 13601 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
c9c2cf70
RD
13602 self._setOORInfo(self)
13603
d55e5bfc
RD
13604 def Add(*args, **kwargs):
13605 """
248ed943 13606 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
c1cb24a4 13607 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
13608
13609 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13610 more than one row or column as specified with *span*. The remaining
13611 args behave similarly to `wx.Sizer.Add`.
13612
13613 Returns True if the item was successfully placed at the given cell
13614 position, False if something was already there.
13615
d55e5bfc
RD
13616 """
13617 return _core_.GridBagSizer_Add(*args, **kwargs)
13618
13619 def AddItem(*args, **kwargs):
248ed943 13620 """
c1cb24a4 13621 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
13622
13623 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13624 the item was successfully placed at its given cell position, False if
13625 something was already there.
13626 """
d55e5bfc
RD
13627 return _core_.GridBagSizer_AddItem(*args, **kwargs)
13628
84f85550
RD
13629 def GetCellSize(*args, **kwargs):
13630 """
13631 GetCellSize(self, int row, int col) -> Size
13632
13633 Get the size of the specified cell, including hgap and
13634 vgap. Only valid after a Layout.
13635 """
13636 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
13637
d55e5bfc 13638 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
13639 """
13640 GetEmptyCellSize(self) -> Size
13641
13642 Get the size used for cells in the grid with no item.
13643 """
d55e5bfc
RD
13644 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
13645
13646 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
13647 """
13648 SetEmptyCellSize(self, Size sz)
13649
13650 Set the size used for cells in the grid with no item.
13651 """
d55e5bfc
RD
13652 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
13653
13654 def GetItemPosition(*args):
13655 """
248ed943
RD
13656 GetItemPosition(self, item) -> GBPosition
13657
13658 Get the grid position of the specified *item* where *item* is either a
13659 window or subsizer that is a member of this sizer, or a zero-based
13660 index of an item.
d55e5bfc
RD
13661 """
13662 return _core_.GridBagSizer_GetItemPosition(*args)
13663
13664 def SetItemPosition(*args):
13665 """
248ed943
RD
13666 SetItemPosition(self, item, GBPosition pos) -> bool
13667
13668 Set the grid position of the specified *item* where *item* is either a
13669 window or subsizer that is a member of this sizer, or a zero-based
13670 index of an item. Returns True on success. If the move is not
13671 allowed (because an item is already there) then False is returned.
13672
d55e5bfc
RD
13673 """
13674 return _core_.GridBagSizer_SetItemPosition(*args)
13675
13676 def GetItemSpan(*args):
13677 """
248ed943
RD
13678 GetItemSpan(self, item) -> GBSpan
13679
13680 Get the row/col spanning of the specified *item* where *item* is
13681 either a window or subsizer that is a member of this sizer, or a
13682 zero-based index of an item.
d55e5bfc
RD
13683 """
13684 return _core_.GridBagSizer_GetItemSpan(*args)
13685
13686 def SetItemSpan(*args):
13687 """
248ed943
RD
13688 SetItemSpan(self, item, GBSpan span) -> bool
13689
13690 Set the row/col spanning of the specified *item* where *item* is
13691 either a window or subsizer that is a member of this sizer, or a
13692 zero-based index of an item. Returns True on success. If the move is
13693 not allowed (because an item is already there) then False is returned.
d55e5bfc
RD
13694 """
13695 return _core_.GridBagSizer_SetItemSpan(*args)
13696
13697 def FindItem(*args):
13698 """
248ed943
RD
13699 FindItem(self, item) -> GBSizerItem
13700
13701 Find the sizer item for the given window or subsizer, returns None if
13702 not found. (non-recursive)
d55e5bfc
RD
13703 """
13704 return _core_.GridBagSizer_FindItem(*args)
13705
b08d67c2
RD
13706 def GetItem(self, item):
13707 gbsi = None
13708 si = wx.FlexGridSizer.GetItem(self, item)
13709 if not si:
13710 return None
13711 if type(item) is not int:
13712 gbsi = self.FindItem(item)
13713 if gbsi: return gbsi
13714 return si
13715
d55e5bfc 13716 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
13717 """
13718 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13719
13720 Return the sizer item for the given grid cell, or None if there is no
13721 item at that position. (non-recursive)
13722 """
d55e5bfc
RD
13723 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
13724
13725 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
13726 """
13727 FindItemAtPoint(self, Point pt) -> GBSizerItem
13728
13729 Return the sizer item located at the point given in *pt*, or None if
13730 there is no item at that point. The (x,y) coordinates in pt correspond
13731 to the client coordinates of the window using the sizer for
13732 layout. (non-recursive)
13733 """
d55e5bfc
RD
13734 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
13735
248ed943
RD
13736 def CheckForIntersection(*args, **kwargs):
13737 """
13738 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 13739
248ed943
RD
13740 Look at all items and see if any intersect (or would overlap) the
13741 given *item*. Returns True if so, False if there would be no overlap.
13742 If an *excludeItem* is given then it will not be checked for
13743 intersection, for example it may be the item we are checking the
13744 position of.
d55e5bfc 13745
248ed943
RD
13746 """
13747 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 13748
248ed943 13749 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 13750 """
248ed943
RD
13751 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13752
13753 Look at all items and see if any intersect (or would overlap) the
13754 given position and span. Returns True if so, False if there would be
13755 no overlap. If an *excludeItem* is given then it will not be checked
13756 for intersection, for example it may be the item we are checking the
13757 position of.
d55e5bfc 13758 """
248ed943 13759 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 13760
2131d850 13761_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
13762
13763#---------------------------------------------------------------------------
13764
13765Left = _core_.Left
13766Top = _core_.Top
13767Right = _core_.Right
13768Bottom = _core_.Bottom
13769Width = _core_.Width
13770Height = _core_.Height
13771Centre = _core_.Centre
13772Center = _core_.Center
13773CentreX = _core_.CentreX
13774CentreY = _core_.CentreY
13775Unconstrained = _core_.Unconstrained
13776AsIs = _core_.AsIs
13777PercentOf = _core_.PercentOf
13778Above = _core_.Above
13779Below = _core_.Below
13780LeftOf = _core_.LeftOf
13781RightOf = _core_.RightOf
13782SameAs = _core_.SameAs
13783Absolute = _core_.Absolute
13784class IndividualLayoutConstraint(Object):
13785 """
79fccf9d
RD
13786 Objects of this class are stored in the `wx.LayoutConstraints` class as
13787 one of eight possible constraints that a window can be involved in.
13788 You will never need to create an instance of
13789 wx.IndividualLayoutConstraint, rather you should create a
13790 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 13791 that it contains.
d55e5bfc 13792 """
554f62e9
RD
13793 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13794 def __init__(self): raise AttributeError, "No constructor defined"
13795 __repr__ = _swig_repr
d55e5bfc 13796 def Set(*args, **kwargs):
79fccf9d
RD
13797 """
13798 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13799
13800 Sets the properties of the constraint. Normally called by one of the
13801 convenience functions such as Above, RightOf, SameAs.
13802 """
d55e5bfc
RD
13803 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
13804
13805 def LeftOf(*args, **kwargs):
13806 """
13807 LeftOf(self, Window sibling, int marg=0)
13808
79fccf9d
RD
13809 Constrains this edge to be to the left of the given window, with an
13810 optional margin. Implicitly, this is relative to the left edge of the
13811 other window.
d55e5bfc
RD
13812 """
13813 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
13814
13815 def RightOf(*args, **kwargs):
13816 """
13817 RightOf(self, Window sibling, int marg=0)
13818
79fccf9d
RD
13819 Constrains this edge to be to the right of the given window, with an
13820 optional margin. Implicitly, this is relative to the right edge of the
13821 other window.
d55e5bfc
RD
13822 """
13823 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
13824
13825 def Above(*args, **kwargs):
13826 """
13827 Above(self, Window sibling, int marg=0)
13828
79fccf9d
RD
13829 Constrains this edge to be above the given window, with an optional
13830 margin. Implicitly, this is relative to the top edge of the other
13831 window.
d55e5bfc
RD
13832 """
13833 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
13834
13835 def Below(*args, **kwargs):
13836 """
13837 Below(self, Window sibling, int marg=0)
13838
79fccf9d
RD
13839 Constrains this edge to be below the given window, with an optional
13840 margin. Implicitly, this is relative to the bottom edge of the other
13841 window.
d55e5bfc
RD
13842 """
13843 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
13844
13845 def SameAs(*args, **kwargs):
13846 """
13847 SameAs(self, Window otherW, int edge, int marg=0)
13848
79fccf9d
RD
13849 Constrains this edge or dimension to be to the same as the edge of the
13850 given window, with an optional margin.
d55e5bfc
RD
13851 """
13852 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
13853
13854 def PercentOf(*args, **kwargs):
13855 """
13856 PercentOf(self, Window otherW, int wh, int per)
13857
79fccf9d
RD
13858 Constrains this edge or dimension to be to a percentage of the given
13859 window, with an optional margin.
d55e5bfc
RD
13860 """
13861 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
13862
13863 def Absolute(*args, **kwargs):
13864 """
13865 Absolute(self, int val)
13866
79fccf9d 13867 Constrains this edge or dimension to be the given absolute value.
d55e5bfc
RD
13868 """
13869 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
13870
13871 def Unconstrained(*args, **kwargs):
13872 """
13873 Unconstrained(self)
13874
79fccf9d
RD
13875 Sets this edge or dimension to be unconstrained, that is, dependent on
13876 other edges and dimensions from which this value can be deduced.
d55e5bfc
RD
13877 """
13878 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
13879
13880 def AsIs(*args, **kwargs):
13881 """
13882 AsIs(self)
13883
79fccf9d
RD
13884 Sets this edge or constraint to be whatever the window's value is at
13885 the moment. If either of the width and height constraints are *as is*,
13886 the window will not be resized, but moved instead. This is important
13887 when considering panel items which are intended to have a default
13888 size, such as a button, which may take its size from the size of the
13889 button label.
d55e5bfc
RD
13890 """
13891 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
13892
13893 def GetOtherWindow(*args, **kwargs):
13894 """GetOtherWindow(self) -> Window"""
13895 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
13896
13897 def GetMyEdge(*args, **kwargs):
13898 """GetMyEdge(self) -> int"""
13899 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
13900
13901 def SetEdge(*args, **kwargs):
13902 """SetEdge(self, int which)"""
13903 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
13904
13905 def SetValue(*args, **kwargs):
13906 """SetValue(self, int v)"""
13907 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
13908
13909 def GetMargin(*args, **kwargs):
13910 """GetMargin(self) -> int"""
13911 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
13912
13913 def SetMargin(*args, **kwargs):
13914 """SetMargin(self, int m)"""
13915 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
13916
13917 def GetValue(*args, **kwargs):
13918 """GetValue(self) -> int"""
13919 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
13920
13921 def GetPercent(*args, **kwargs):
13922 """GetPercent(self) -> int"""
13923 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
13924
13925 def GetOtherEdge(*args, **kwargs):
13926 """GetOtherEdge(self) -> int"""
13927 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
13928
13929 def GetDone(*args, **kwargs):
13930 """GetDone(self) -> bool"""
13931 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
13932
13933 def SetDone(*args, **kwargs):
13934 """SetDone(self, bool d)"""
13935 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
13936
13937 def GetRelationship(*args, **kwargs):
13938 """GetRelationship(self) -> int"""
13939 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
13940
13941 def SetRelationship(*args, **kwargs):
13942 """SetRelationship(self, int r)"""
13943 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
13944
13945 def ResetIfWin(*args, **kwargs):
13946 """
13947 ResetIfWin(self, Window otherW) -> bool
13948
13949 Reset constraint if it mentions otherWin
13950 """
13951 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
13952
13953 def SatisfyConstraint(*args, **kwargs):
13954 """
13955 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13956
13957 Try to satisfy constraint
13958 """
13959 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
13960
13961 def GetEdge(*args, **kwargs):
13962 """
13963 GetEdge(self, int which, Window thisWin, Window other) -> int
13964
13965 Get the value of this edge or dimension, or if this
13966 is not determinable, -1.
13967 """
13968 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
13969
97ab0f6a
RD
13970 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13971 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13972 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13973 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13974 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13975 Percent = property(GetPercent,doc="See `GetPercent`")
13976 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13977 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
2131d850 13978_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc
RD
13979
13980class LayoutConstraints(Object):
13981 """
79fccf9d
RD
13982 **Note:** constraints are now deprecated and you should use sizers
13983 instead.
d55e5bfc 13984
79fccf9d
RD
13985 Objects of this class can be associated with a window to define its
13986 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
13987
13988 The class consists of the following eight constraints of class
13989 wx.IndividualLayoutConstraint, some or all of which should be accessed
13990 directly to set the appropriate constraints.
13991
13992 * left: represents the left hand edge of the window
13993 * right: represents the right hand edge of the window
13994 * top: represents the top edge of the window
13995 * bottom: represents the bottom edge of the window
13996 * width: represents the width of the window
13997 * height: represents the height of the window
13998 * centreX: represents the horizontal centre point of the window
13999 * centreY: represents the vertical centre point of the window
14000
79fccf9d
RD
14001 Most constraints are initially set to have the relationship
14002 wxUnconstrained, which means that their values should be calculated by
14003 looking at known constraints. The exceptions are width and height,
14004 which are set to wxAsIs to ensure that if the user does not specify a
14005 constraint, the existing width and height will be used, to be
14006 compatible with panel items which often have take a default size. If
14007 the constraint is ``wx.AsIs``, the dimension will not be changed.
14008
14009 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
14010
14011 """
554f62e9
RD
14012 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
14013 __repr__ = _swig_repr
d55e5bfc
RD
14014 left = property(_core_.LayoutConstraints_left_get)
14015 top = property(_core_.LayoutConstraints_top_get)
14016 right = property(_core_.LayoutConstraints_right_get)
14017 bottom = property(_core_.LayoutConstraints_bottom_get)
14018 width = property(_core_.LayoutConstraints_width_get)
14019 height = property(_core_.LayoutConstraints_height_get)
14020 centreX = property(_core_.LayoutConstraints_centreX_get)
14021 centreY = property(_core_.LayoutConstraints_centreY_get)
554f62e9 14022 def __init__(self, *args, **kwargs):
d55e5bfc 14023 """__init__(self) -> LayoutConstraints"""
554f62e9
RD
14024 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
14025 __swig_destroy__ = _core_.delete_LayoutConstraints
14026 __del__ = lambda self : None;
d55e5bfc
RD
14027 def SatisfyConstraints(*args, **kwargs):
14028 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
14029 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
14030
14031 def AreSatisfied(*args, **kwargs):
14032 """AreSatisfied(self) -> bool"""
14033 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
14034
2131d850 14035_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
14036
14037#----------------------------------------------------------------------------
14038
14039# Use Python's bool constants if available, make some if not
14040try:
14041 True
14042except NameError:
14043 __builtins__.True = 1==1
14044 __builtins__.False = 1==0
14045 def bool(value): return not not value
14046 __builtins__.bool = bool
14047
14048
14049
14050# workarounds for bad wxRTTI names
14051__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
14052__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
14053__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
14054
14055
14056#----------------------------------------------------------------------------
14057# Load version numbers from __version__... Ensure that major and minor
0f63ec68 14058# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
14059
14060from __version__ import *
14061__version__ = VERSION_STRING
14062
0f63ec68
RD
14063assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
14064assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
14065if RELEASE_VERSION != _core_.RELEASE_VERSION:
14066 import warnings
0f63ec68 14067 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc 14068
f9bf356b
RD
14069
14070def version():
14071 """Returns a string containing version and port info"""
14072 ctype = wx.USE_UNICODE and 'unicode' or 'ansi'
14073 if wx.Platform == '__WXMSW__':
14074 port = 'msw'
14075 elif wx.Platform == '__WXMAC__':
14076 port = 'mac'
14077 elif wx.Platform == '__WXGTK__':
14078 port = 'gtk'
14079 if 'gtk2' in wx.PlatformInfo:
14080 port = 'gtk2'
14081 else:
14082 port = '?'
14083
14084 return "%s (%s-%s)" % (wx.VERSION_STRING, port, ctype)
14085
14086
d55e5bfc
RD
14087#----------------------------------------------------------------------------
14088
70b7a5fe
RD
14089# Set wxPython's default string<-->unicode conversion encoding from
14090# the locale, but only if Python's default hasn't been changed. (We
14091# assume that if the user has customized it already then that is the
14092# encoding we need to use as well.)
14093#
14094# The encoding selected here is used when string or unicode objects
14095# need to be converted in order to pass them to wxWidgets. Please be
14096# aware that the default encoding within the same locale may be
14097# slightly different on different platforms. For example, please see
62d32a5f
RD
14098# http://www.alanwood.net/demos/charsetdiffs.html for differences
14099# between the common latin/roman encodings.
396fb509
RD
14100
14101default = _sys.getdefaultencoding()
14102if default == 'ascii':
14103 import locale
14104 import codecs
14105 try:
474e2ff2
RD
14106 if hasattr(locale, 'getpreferredencoding'):
14107 default = locale.getpreferredencoding()
14108 else:
14109 default = locale.getdefaultlocale()[1]
396fb509 14110 codecs.lookup(default)
70b7a5fe 14111 except (ValueError, LookupError, TypeError):
396fb509
RD
14112 default = _sys.getdefaultencoding()
14113 del locale
14114 del codecs
5cbf236d
RD
14115if default:
14116 wx.SetDefaultPyEncoding(default)
14117del default
5cbf236d
RD
14118
14119#----------------------------------------------------------------------------
14120
d55e5bfc
RD
14121class PyDeadObjectError(AttributeError):
14122 pass
14123
14124class _wxPyDeadObject(object):
14125 """
14126 Instances of wx objects that are OOR capable will have their __class__
14127 changed to this class when the C++ object is deleted. This should help
14128 prevent crashes due to referencing a bogus C++ pointer.
14129 """
14130 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
14131 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
14132
14133 def __repr__(self):
14134 if not hasattr(self, "_name"):
14135 self._name = "[unknown]"
14136 return self.reprStr % self._name
14137
14138 def __getattr__(self, *args):
14139 if not hasattr(self, "_name"):
14140 self._name = "[unknown]"
14141 raise PyDeadObjectError(self.attrStr % self._name)
14142
14143 def __nonzero__(self):
14144 return 0
14145
14146
14147
14148class PyUnbornObjectError(AttributeError):
14149 pass
14150
14151class _wxPyUnbornObject(object):
14152 """
14153 Some stock objects are created when the wx._core module is
14154 imported, but their C++ instance is not created until the wx.App
14155 object is created and initialized. These object instances will
14156 temporarily have their __class__ changed to this class so an
14157 exception will be raised if they are used before the C++ instance
14158 is ready.
14159 """
14160
14161 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
14162 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
14163
14164 def __repr__(self):
14165 #if not hasattr(self, "_name"):
14166 # self._name = "[unknown]"
14167 return self.reprStr #% self._name
14168
14169 def __getattr__(self, *args):
14170 #if not hasattr(self, "_name"):
14171 # self._name = "[unknown]"
14172 raise PyUnbornObjectError(self.attrStr) # % self._name )
14173
14174 def __nonzero__(self):
14175 return 0
14176
14177
14178#----------------------------------------------------------------------------
d55e5bfc
RD
14179
14180def CallAfter(callable, *args, **kw):
14181 """
14182 Call the specified function after the current and pending event
14183 handlers have been completed. This is also good for making GUI
0439c23b
RD
14184 method calls from non-GUI threads. Any extra positional or
14185 keyword args are passed on to the callable when it is called.
14186
846c181b 14187 :see: `wx.CallLater`
d55e5bfc
RD
14188 """
14189 app = wx.GetApp()
a001823c 14190 assert app is not None, 'No wx.App created yet'
d55e5bfc 14191
891bb194
RD
14192 if not hasattr(app, "_CallAfterId"):
14193 app._CallAfterId = wx.NewEventType()
14194 app.Connect(-1, -1, app._CallAfterId,
14195 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 14196 evt = wx.PyEvent()
891bb194 14197 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
14198 evt.callable = callable
14199 evt.args = args
14200 evt.kw = kw
14201 wx.PostEvent(app, evt)
14202
d55e5bfc
RD
14203#----------------------------------------------------------------------------
14204
14205
846c181b 14206class CallLater:
d55e5bfc 14207 """
8ac8dba0 14208 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
14209 object once after the given amount of milliseconds, passing any
14210 positional or keyword args. The return value of the callable is
0439c23b 14211 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
14212
14213 If you don't need to get the return value or restart the timer
14214 then there is no need to hold a reference to this object. It will
14215 hold a reference to itself while the timer is running (the timer
14216 has a reference to self.Notify) but the cycle will be broken when
846c181b 14217 the timer completes, automatically cleaning up the wx.CallLater
d55e5bfc 14218 object.
0439c23b
RD
14219
14220 :see: `wx.CallAfter`
d55e5bfc
RD
14221 """
14222 def __init__(self, millis, callable, *args, **kwargs):
14223 self.millis = millis
14224 self.callable = callable
14225 self.SetArgs(*args, **kwargs)
14226 self.runCount = 0
14227 self.running = False
14228 self.hasRun = False
14229 self.result = None
14230 self.timer = None
14231 self.Start()
14232
14233 def __del__(self):
14234 self.Stop()
14235
14236
14237 def Start(self, millis=None, *args, **kwargs):
14238 """
14239 (Re)start the timer
14240 """
14241 self.hasRun = False
14242 if millis is not None:
14243 self.millis = millis
14244 if args or kwargs:
14245 self.SetArgs(*args, **kwargs)
14246 self.Stop()
14247 self.timer = wx.PyTimer(self.Notify)
14248 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
14249 self.running = True
14250 Restart = Start
14251
14252
14253 def Stop(self):
14254 """
14255 Stop and destroy the timer.
14256 """
14257 if self.timer is not None:
14258 self.timer.Stop()
14259 self.timer = None
14260
14261
14262 def GetInterval(self):
14263 if self.timer is not None:
14264 return self.timer.GetInterval()
14265 else:
14266 return 0
14267
14268
14269 def IsRunning(self):
14270 return self.timer is not None and self.timer.IsRunning()
14271
14272
14273 def SetArgs(self, *args, **kwargs):
14274 """
14275 (Re)set the args passed to the callable object. This is
14276 useful in conjunction with Restart if you want to schedule a
14277 new call to the same callable object but with different
14278 parameters.
14279 """
14280 self.args = args
14281 self.kwargs = kwargs
14282
14283
14284 def HasRun(self):
14285 return self.hasRun
14286
14287 def GetResult(self):
14288 return self.result
14289
14290 def Notify(self):
14291 """
14292 The timer has expired so call the callable.
14293 """
14294 if self.callable and getattr(self.callable, 'im_self', True):
14295 self.runCount += 1
14296 self.running = False
14297 self.result = self.callable(*self.args, **self.kwargs)
14298 self.hasRun = True
14299 if not self.running:
14300 # if it wasn't restarted, then cleanup
14301 wx.CallAfter(self.Stop)
14302
97ab0f6a
RD
14303 Interval = property(GetInterval)
14304 Result = property(GetResult)
d55e5bfc
RD
14305
14306
846c181b
RD
14307class FutureCall(CallLater):
14308 """A compatibility alias for `CallLater`."""
14309
d55e5bfc
RD
14310#----------------------------------------------------------------------------
14311# Control which items in this module should be documented by epydoc.
14312# We allow only classes and functions, which will help reduce the size
14313# of the docs by filtering out the zillions of constants, EVT objects,
14314# and etc that don't make much sense by themselves, but are instead
14315# documented (or will be) as part of the classes/functions/methods
14316# where they should be used.
14317
c24da6d6
RD
14318class __DocFilter:
14319 """
14320 A filter for epydoc that only allows non-Ptr classes and
0f83f5da 14321 functions, in order to reduce the clutter in the API docs.
c24da6d6
RD
14322 """
14323 def __init__(self, globals):
14324 self._globals = globals
14325
14326 def __call__(self, name):
14327 import types
14328 obj = self._globals.get(name, None)
0f83f5da
RD
14329
14330 # only document classes and function
c24da6d6
RD
14331 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
14332 return False
0f83f5da
RD
14333
14334 # skip other things that are private or will be documented as part of somethign else
554f62e9 14335 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
c24da6d6 14336 return False
0f83f5da
RD
14337
14338 # skip functions that are duplicates of static functions in a class
14339 if name.find('_') != -1:
14340 cls = self._globals.get(name.split('_')[0], None)
14341 methname = name.split('_')[1]
14342 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
14343 return False
14344
c24da6d6 14345 return True
d55e5bfc
RD
14346
14347#----------------------------------------------------------------------------
14348#----------------------------------------------------------------------------
14349
14350# Import other modules in this package that should show up in the
14351# "core" wx namespace
14352from _gdi import *
14353from _windows import *
14354from _controls import *
14355from _misc import *
14356
d55e5bfc
RD
14357#----------------------------------------------------------------------------
14358#----------------------------------------------------------------------------
14359
14360
7449af73 14361