]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
wx.VScrolledWindow has been refactored, and new wx.HScrolledWindow and
[wxWidgets.git] / wxPython / src / mac / _core.py
CommitLineData
1bd55598 1# This file was created automatically by SWIG 1.3.29.
d55e5bfc
RD
2# Don't modify this file, modify the SWIG interface instead.
3
5b5c9bc7 4import _core_
1bd55598
RD
5import new
6new_instancemethod = new.instancemethod
36ed4f51 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
1bd55598 8 if (name == "thisown"): return self.this.own(value)
36ed4f51 9 if (name == "this"):
1bd55598
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
36ed4f51
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
1bd55598 15 if (not static) or hasattr(self,name):
36ed4f51
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
1bd55598 24 if (name == "thisown"): return self.this.own()
36ed4f51
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
1bd55598
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
36ed4f51
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
1bd55598
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
36ed4f51
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d55e5bfc
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
56_core_._wxPySetDictionary(vars())
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
d6c14a4c
RD
63
64#----------------------------------------------------------------------------
65
66def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81#----------------------------------------------------------------------------
82
5b5c9bc7
RD
83NOT_FOUND = _core_.NOT_FOUND
84VSCROLL = _core_.VSCROLL
85HSCROLL = _core_.HSCROLL
86CAPTION = _core_.CAPTION
87DOUBLE_BORDER = _core_.DOUBLE_BORDER
88SUNKEN_BORDER = _core_.SUNKEN_BORDER
89RAISED_BORDER = _core_.RAISED_BORDER
90BORDER = _core_.BORDER
91SIMPLE_BORDER = _core_.SIMPLE_BORDER
92STATIC_BORDER = _core_.STATIC_BORDER
93TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94NO_BORDER = _core_.NO_BORDER
95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
5b5c9bc7
RD
97TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98WANTS_CHARS = _core_.WANTS_CHARS
99POPUP_WINDOW = _core_.POPUP_WINDOW
100CENTER_FRAME = _core_.CENTER_FRAME
101CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
092f0ed7 105WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
5b5c9bc7
RD
106ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107RETAINED = _core_.RETAINED
108BACKINGSTORE = _core_.BACKINGSTORE
109COLOURED = _core_.COLOURED
110FIXED_LENGTH = _core_.FIXED_LENGTH
111LB_NEEDED_SB = _core_.LB_NEEDED_SB
112LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113LB_SORT = _core_.LB_SORT
114LB_SINGLE = _core_.LB_SINGLE
115LB_MULTIPLE = _core_.LB_MULTIPLE
116LB_EXTENDED = _core_.LB_EXTENDED
117LB_OWNERDRAW = _core_.LB_OWNERDRAW
118LB_HSCROLL = _core_.LB_HSCROLL
5b5c9bc7
RD
119CB_SIMPLE = _core_.CB_SIMPLE
120CB_DROPDOWN = _core_.CB_DROPDOWN
121CB_SORT = _core_.CB_SORT
122CB_READONLY = _core_.CB_READONLY
123RA_HORIZONTAL = _core_.RA_HORIZONTAL
124RA_VERTICAL = _core_.RA_VERTICAL
125RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
126RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
127RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
128RB_GROUP = _core_.RB_GROUP
129RB_SINGLE = _core_.RB_SINGLE
130SB_HORIZONTAL = _core_.SB_HORIZONTAL
131SB_VERTICAL = _core_.SB_VERTICAL
132RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
133ST_SIZEGRIP = _core_.ST_SIZEGRIP
5b5c9bc7
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
943e8dfd 169SIZE_FORCE = _core_.SIZE_FORCE
5b5c9bc7
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
943e8dfd 178ID_NONE = _core_.ID_NONE
5b5c9bc7
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
5b5c9bc7
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
5b5c9bc7
RD
201ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
202ID_PREFERENCES = _core_.ID_PREFERENCES
ac5d357a 203ID_EDIT = _core_.ID_EDIT
5b5c9bc7
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
ac5d357a 223ID_FILE = _core_.ID_FILE
5b5c9bc7
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
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
274ID_HIGHEST = _core_.ID_HIGHEST
5b5c9bc7
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
5b5c9bc7
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
341BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
342BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
343BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
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
5b5c9bc7
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
5b5c9bc7
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
5b5c9bc7 482WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
5b5c9bc7
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
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
5b5c9bc7
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
5b5c9bc7
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
943e8dfd 668MOD_ALTGR = _core_.MOD_ALTGR
5b5c9bc7 669MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 670MOD_META = _core_.MOD_META
5b5c9bc7 671MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
672MOD_CMD = _core_.MOD_CMD
673MOD_ALL = _core_.MOD_ALL
5b5c9bc7
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
5b5c9bc7 682class Object(object):
d55e5bfc
RD
683 """
684 The base class for most wx objects, although in wxPython not
685 much functionality is needed nor exposed.
686 """
1bd55598
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 """
5b5c9bc7 692 GetClassName(self) -> String
d55e5bfc
RD
693
694 Returns the class name of the C++ class using wxRTTI.
695 """
5b5c9bc7 696 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
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)
5b5c9bc7 719_wxPySetDictionary = _core_._wxPySetDictionary
5b5c9bc7 720cvar = _core_.cvar
d55e5bfc
RD
721EmptyString = cvar.EmptyString
722
723#---------------------------------------------------------------------------
724
5b5c9bc7
RD
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
5b5c9bc7
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
d55e5bfc
RD
777#---------------------------------------------------------------------------
778
5b5c9bc7 779class Size(object):
d55e5bfc 780 """
15817c7e 781 wx.Size is a useful data structure used to represent the size of
1bd55598
RD
782 something. It simply contains integer width and height
783 properties. In most places in wxPython where a wx.Size is
36ed4f51 784 expected a (width, height) tuple can be used instead.
d55e5bfc 785 """
1bd55598
RD
786 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
787 __repr__ = _swig_repr
5b5c9bc7
RD
788 width = property(_core_.Size_width_get, _core_.Size_width_set)
789 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc 790 x = width; y = height
1bd55598 791 def __init__(self, *args, **kwargs):
d55e5bfc 792 """
5b5c9bc7 793 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
794
795 Creates a size object.
796 """
1bd55598
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 """
5b5c9bc7 806 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
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 813 """
5b5c9bc7 814 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
815
816 def __add__(*args, **kwargs):
817 """
5b5c9bc7 818 __add__(self, Size sz) -> Size
d55e5bfc
RD
819
820 Add sz's proprties to this and return the result.
821 """
5b5c9bc7 822 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
823
824 def __sub__(*args, **kwargs):
825 """
5b5c9bc7 826 __sub__(self, Size sz) -> Size
d55e5bfc
RD
827
828 Subtract sz's properties from this and return the result.
829 """
5b5c9bc7 830 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
831
832 def IncTo(*args, **kwargs):
833 """
5b5c9bc7 834 IncTo(self, Size sz)
d55e5bfc
RD
835
836 Increments this object so that both of its dimensions are not less
837 than the corresponding dimensions of the size.
838 """
5b5c9bc7 839 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
840
841 def DecTo(*args, **kwargs):
842 """
5b5c9bc7 843 DecTo(self, Size sz)
d55e5bfc
RD
844
845 Decrements this object so that both of its dimensions are not greater
846 than the corresponding dimensions of the size.
847 """
5b5c9bc7 848 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 872 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
873
874 def SetWidth(*args, **kwargs):
875 """SetWidth(self, int w)"""
5b5c9bc7 876 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
877
878 def SetHeight(*args, **kwargs):
879 """SetHeight(self, int h)"""
5b5c9bc7 880 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
881
882 def GetWidth(*args, **kwargs):
883 """GetWidth(self) -> int"""
5b5c9bc7 884 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
885
886 def GetHeight(*args, **kwargs):
887 """GetHeight(self) -> int"""
5b5c9bc7 888 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 896 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
897
898 def SetDefaults(*args, **kwargs):
899 """
5b5c9bc7 900 SetDefaults(self, Size size)
d55e5bfc 901
15817c7e
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 904 """
5b5c9bc7 905 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
906
907 def Get(*args, **kwargs):
908 """
909 Get() -> (width,height)
910
911 Returns the width and height properties as a tuple.
912 """
5b5c9bc7 913 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 914
15817c7e 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
5b5c9bc7 932class RealPoint(object):
d55e5bfc 933 """
15817c7e
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 """
1bd55598
RD
938 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
939 __repr__ = _swig_repr
5b5c9bc7
RD
940 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
941 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
1bd55598 942 def __init__(self, *args, **kwargs):
d55e5bfc 943 """
5b5c9bc7 944 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
945
946 Create a wx.RealPoint object
947 """
1bd55598
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 """
5b5c9bc7 957 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 965 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
966
967 def __add__(*args, **kwargs):
968 """
5b5c9bc7 969 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
970
971 Add pt's proprties to this and return the result.
972 """
5b5c9bc7 973 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
974
975 def __sub__(*args, **kwargs):
976 """
5b5c9bc7 977 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
978
979 Subtract pt's proprties from this and return the result
980 """
5b5c9bc7 981 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
982
983 def Set(*args, **kwargs):
984 """
985 Set(self, double x, double y)
986
987 Set both the x and y properties
988 """
5b5c9bc7 989 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
990
991 def Get(*args, **kwargs):
992 """
993 Get() -> (x,y)
994
995 Return the x and y properties as a tuple.
996 """
5b5c9bc7 997 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 998
15817c7e 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
5b5c9bc7 1016class Point(object):
d55e5bfc 1017 """
15817c7e
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 """
1bd55598
RD
1022 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1023 __repr__ = _swig_repr
5b5c9bc7
RD
1024 x = property(_core_.Point_x_get, _core_.Point_x_set)
1025 y = property(_core_.Point_y_get, _core_.Point_y_set)
1bd55598 1026 def __init__(self, *args, **kwargs):
d55e5bfc 1027 """
5b5c9bc7 1028 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
1029
1030 Create a wx.Point object
1031 """
1bd55598
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 """
5b5c9bc7 1041 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 1049 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1050
1051 def __add__(*args, **kwargs):
1052 """
5b5c9bc7 1053 __add__(self, Point pt) -> Point
d55e5bfc
RD
1054
1055 Add pt's proprties to this and return the result.
1056 """
5b5c9bc7 1057 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1058
1059 def __sub__(*args, **kwargs):
1060 """
5b5c9bc7 1061 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1062
1063 Subtract pt's proprties from this and return the result
1064 """
5b5c9bc7 1065 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1066
1067 def __iadd__(*args, **kwargs):
1068 """
5b5c9bc7 1069 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1070
1071 Add pt to this object.
1072 """
5b5c9bc7 1073 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1074
1075 def __isub__(*args, **kwargs):
1076 """
5b5c9bc7 1077 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1078
1079 Subtract pt from this object.
1080 """
5b5c9bc7 1081 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1082
1083 def Set(*args, **kwargs):
1084 """
1085 Set(self, long x, long y)
1086
1087 Set both the x and y properties
1088 """
5b5c9bc7 1089 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1090
1091 def Get(*args, **kwargs):
1092 """
1093 Get() -> (x,y)
1094
1095 Return the x and y properties as a tuple.
1096 """
5b5c9bc7 1097 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1098
15817c7e 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
5b5c9bc7 1116class Rect(object):
d55e5bfc 1117 """
15817c7e
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 """
1bd55598
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 1125 """
5b5c9bc7 1126 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1127
1128 Create a new Rect object.
1129 """
1bd55598
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"""
5b5c9bc7 1135 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1136
1137 def SetX(*args, **kwargs):
1138 """SetX(self, int x)"""
5b5c9bc7 1139 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1140
1141 def GetY(*args, **kwargs):
1142 """GetY(self) -> int"""
5b5c9bc7 1143 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1144
1145 def SetY(*args, **kwargs):
1146 """SetY(self, int y)"""
5b5c9bc7 1147 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1148
1149 def GetWidth(*args, **kwargs):
1150 """GetWidth(self) -> int"""
5b5c9bc7 1151 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1152
1153 def SetWidth(*args, **kwargs):
1154 """SetWidth(self, int w)"""
5b5c9bc7 1155 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1156
1157 def GetHeight(*args, **kwargs):
1158 """GetHeight(self) -> int"""
5b5c9bc7 1159 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1160
1161 def SetHeight(*args, **kwargs):
1162 """SetHeight(self, int h)"""
5b5c9bc7 1163 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1164
1165 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1166 """GetPosition(self) -> Point"""
1167 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1168
1169 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1170 """SetPosition(self, Point p)"""
1171 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1172
1173 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1174 """GetSize(self) -> Size"""
1175 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1176
1177 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1178 """SetSize(self, Size s)"""
1179 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1180
aff4cc5c
RD
1181 def IsEmpty(*args, **kwargs):
1182 """IsEmpty(self) -> bool"""
5b5c9bc7 1183 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1184
d55e5bfc 1185 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1186 """GetTopLeft(self) -> Point"""
1187 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1188
1189 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1190 """SetTopLeft(self, Point p)"""
1191 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1192
1193 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1194 """GetBottomRight(self) -> Point"""
1195 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1196
1197 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1198 """SetBottomRight(self, Point p)"""
1199 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc 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"""
5b5c9bc7 1219 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1220
1221 def GetTop(*args, **kwargs):
1222 """GetTop(self) -> int"""
5b5c9bc7 1223 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1224
1225 def GetBottom(*args, **kwargs):
1226 """GetBottom(self) -> int"""
5b5c9bc7 1227 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1228
1229 def GetRight(*args, **kwargs):
1230 """GetRight(self) -> int"""
5b5c9bc7 1231 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1232
1233 def SetLeft(*args, **kwargs):
1234 """SetLeft(self, int left)"""
5b5c9bc7 1235 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1236
1237 def SetRight(*args, **kwargs):
1238 """SetRight(self, int right)"""
5b5c9bc7 1239 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1240
1241 def SetTop(*args, **kwargs):
1242 """SetTop(self, int top)"""
5b5c9bc7 1243 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1244
1245 def SetBottom(*args, **kwargs):
1246 """SetBottom(self, int bottom)"""
5b5c9bc7 1247 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 1258 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 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 1278 """
5b5c9bc7 1279 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1280
1281 def Deflate(*args, **kwargs):
1282 """
5b5c9bc7 1283 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 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 1288 """
5b5c9bc7 1289 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1290
1291 def OffsetXY(*args, **kwargs):
1292 """
1293 OffsetXY(self, int dx, int dy)
1294
15817c7e
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 1298 """
5b5c9bc7 1299 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1300
1301 def Offset(*args, **kwargs):
1302 """
5b5c9bc7 1303 Offset(self, Point pt)
d55e5bfc 1304
b1fcee84 1305 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc 1306 """
5b5c9bc7 1307 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1308
1309 def Intersect(*args, **kwargs):
1310 """
5b5c9bc7 1311 Intersect(self, Rect rect) -> Rect
d55e5bfc 1312
5cbf236d 1313 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1314 """
5b5c9bc7 1315 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1316
5cbf236d
RD
1317 def Union(*args, **kwargs):
1318 """
5b5c9bc7 1319 Union(self, Rect rect) -> Rect
5cbf236d
RD
1320
1321 Returns the union of this rectangle and rect.
1322 """
5b5c9bc7 1323 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1324
d55e5bfc
RD
1325 def __add__(*args, **kwargs):
1326 """
5b5c9bc7 1327 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1328
1329 Add the properties of rect to this rectangle and return the result.
1330 """
5b5c9bc7 1331 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1332
1333 def __iadd__(*args, **kwargs):
1334 """
5b5c9bc7 1335 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1336
1337 Add the properties of rect to this rectangle, updating this rectangle.
1338 """
5b5c9bc7 1339 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
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 1346 """
5b5c9bc7 1347 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
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 1354 """
5b5c9bc7 1355 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 1391 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1392
1393 Returns True if the rectangles have a non empty intersection.
1394 """
5b5c9bc7 1395 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 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
5b5c9bc7
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)
d55e5bfc
RD
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 """
5b5c9bc7 1417 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1418
1419 def Get(*args, **kwargs):
1420 """
1421 Get() -> (x,y,width,height)
1422
1423 Return the rectangle properties as a tuple.
1424 """
5b5c9bc7 1425 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1426
15817c7e 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 """
5b5c9bc7 1461 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1462
1463 Create a new Rect object from Points representing two corners.
1464 """
5b5c9bc7 1465 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1466 return val
1467
1468def RectPS(*args, **kwargs):
1469 """
5b5c9bc7 1470 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1471
1472 Create a new Rect from a position and size.
1473 """
5b5c9bc7 1474 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1475 return val
1476
070c48b4
RD
1477def RectS(*args, **kwargs):
1478 """
5b5c9bc7 1479 RectS(Size size) -> Rect
070c48b4
RD
1480
1481 Create a new Rect from a size only.
1482 """
5b5c9bc7 1483 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1484 return val
1485
d55e5bfc 1486
5b5c9bc7 1487def IntersectRect(*args, **kwargs):
1bd55598 1488 """
d55e5bfc
RD
1489 IntersectRect(Rect r1, Rect r2) -> Rect
1490
1491 Calculate and return the intersection of r1 and r2.
1492 """
1bd55598 1493 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1494#---------------------------------------------------------------------------
1495
5b5c9bc7 1496class Point2D(object):
15817c7e
RD
1497 """
1498 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1499 with floating point values.
1500 """
1bd55598
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 1504 """
5b5c9bc7 1505 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1506
1507 Create a w.Point2D object.
1508 """
1bd55598 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):
fd2dc343
RD
1513 """
1514 GetFloor() -> (x,y)
1515
1516 Convert to integer
1517 """
5b5c9bc7 1518 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1519
1520 def GetRounded(*args, **kwargs):
fd2dc343
RD
1521 """
1522 GetRounded() -> (x,y)
1523
1524 Convert to integer
1525 """
5b5c9bc7 1526 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1527
1528 def GetVectorLength(*args, **kwargs):
1529 """GetVectorLength(self) -> double"""
5b5c9bc7 1530 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1531
1532 def GetVectorAngle(*args, **kwargs):
1533 """GetVectorAngle(self) -> double"""
5b5c9bc7 1534 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1535
1536 def SetVectorLength(*args, **kwargs):
1537 """SetVectorLength(self, double length)"""
5b5c9bc7 1538 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1539
1540 def SetVectorAngle(*args, **kwargs):
1541 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1542 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
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):
5b5c9bc7
RD
1551 """GetDistance(self, Point2D pt) -> double"""
1552 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1553
1554 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1555 """GetDistanceSquare(self, Point2D pt) -> double"""
1556 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1557
1558 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1559 """GetDotProduct(self, Point2D vec) -> double"""
1560 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1561
1562 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1563 """GetCrossProduct(self, Point2D vec) -> double"""
1564 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1565
1566 def __neg__(*args, **kwargs):
1567 """
5b5c9bc7 1568 __neg__(self) -> Point2D
d55e5bfc
RD
1569
1570 the reflection of this point
1571 """
5b5c9bc7 1572 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1573
1574 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1575 """__iadd__(self, Point2D pt) -> Point2D"""
1576 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1577
1578 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1579 """__isub__(self, Point2D pt) -> Point2D"""
1580 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1581
1582 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1583 """__imul__(self, Point2D pt) -> Point2D"""
1584 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1585
1586 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1587 """__idiv__(self, Point2D pt) -> Point2D"""
1588 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
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 1595 """
5b5c9bc7 1596 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
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 1603 """
5b5c9bc7 1604 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1605
5b5c9bc7
RD
1606 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1607 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1608 def Set(*args, **kwargs):
1609 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1610 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1611
1612 def Get(*args, **kwargs):
1613 """
1614 Get() -> (x,y)
1615
1616 Return x and y properties as a tuple.
1617 """
5b5c9bc7 1618 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1619
15817c7e 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 """
5b5c9bc7 1641 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1642
1643 Create a w.Point2D object.
1644 """
5b5c9bc7 1645 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1646 return val
1647
1648def Point2DFromPoint(*args, **kwargs):
1649 """
5b5c9bc7 1650 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1651
1652 Create a w.Point2D object.
1653 """
5b5c9bc7 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
5b5c9bc7
RD
1913FromStart = _core_.FromStart
1914FromCurrent = _core_.FromCurrent
1915FromEnd = _core_.FromEnd
d55e5bfc 1916class InputStream(object):
36ed4f51 1917 """Proxy of C++ InputStream class"""
1bd55598
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"""
1bd55598
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)"""
5b5c9bc7 1927 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1928
1929 def flush(*args, **kwargs):
1930 """flush(self)"""
5b5c9bc7 1931 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1932
1933 def eof(*args, **kwargs):
1934 """eof(self) -> bool"""
5b5c9bc7 1935 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1936
1937 def read(*args, **kwargs):
1938 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1939 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1940
1941 def readline(*args, **kwargs):
1942 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1943 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1944
1945 def readlines(*args, **kwargs):
1946 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1947 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1948
1949 def seek(*args, **kwargs):
1950 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1951 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1952
1953 def tell(*args, **kwargs):
1954 """tell(self) -> int"""
5b5c9bc7 1955 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1956
1957 def Peek(*args, **kwargs):
1958 """Peek(self) -> char"""
5b5c9bc7 1959 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1960
1961 def GetC(*args, **kwargs):
1962 """GetC(self) -> char"""
5b5c9bc7 1963 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1964
1965 def LastRead(*args, **kwargs):
1966 """LastRead(self) -> size_t"""
5b5c9bc7 1967 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1968
1969 def CanRead(*args, **kwargs):
1970 """CanRead(self) -> bool"""
5b5c9bc7 1971 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1972
1973 def Eof(*args, **kwargs):
1974 """Eof(self) -> bool"""
5b5c9bc7 1975 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1976
1977 def Ungetch(*args, **kwargs):
1978 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1979 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1980
1981 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1982 """SeekI(self, long pos, int mode=FromStart) -> long"""
1983 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1984
1985 def TellI(*args, **kwargs):
1986 """TellI(self) -> long"""
5b5c9bc7 1987 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc 1988
2131d850 1989_core_.InputStream_swigregister(InputStream)
5b5c9bc7
RD
1990DefaultPosition = cvar.DefaultPosition
1991DefaultSize = cvar.DefaultSize
d55e5bfc 1992
5b5c9bc7
RD
1993class OutputStream(object):
1994 """Proxy of C++ OutputStream class"""
1bd55598
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)"""
5b5c9bc7 2000 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc 2001
1bd55598
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
5b5c9bc7
RD
2010class FSFile(Object):
2011 """Proxy of C++ FSFile class"""
1bd55598
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 2015 """
5b5c9bc7
RD
2016 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
2017 DateTime modif) -> FSFile
d55e5bfc 2018 """
1bd55598 2019 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1bd55598
RD
2020 __swig_destroy__ = _core_.delete_FSFile
2021 __del__ = lambda self : None;
d55e5bfc 2022 def GetStream(*args, **kwargs):
5b5c9bc7
RD
2023 """GetStream(self) -> InputStream"""
2024 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc 2025
ac5d357a
RD
2026 def DetachStream(*args, **kwargs):
2027 """DetachStream(self)"""
2028 return _core_.FSFile_DetachStream(*args, **kwargs)
2029
d55e5bfc 2030 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
2031 """GetMimeType(self) -> String"""
2032 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
2033
2034 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
2035 """GetLocation(self) -> String"""
2036 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
2037
2038 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
2039 """GetAnchor(self) -> String"""
2040 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
2041
2042 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
2043 """GetModificationTime(self) -> DateTime"""
2044 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc 2045
ac5d357a
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):
36ed4f51 2054 """Proxy of C++ CPPFileSystemHandler class"""
1bd55598
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):
36ed4f51 2063 """Proxy of C++ FileSystemHandler class"""
1bd55598
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"""
1bd55598 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)"""
5b5c9bc7 2073 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
2074
2075 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2076 """CanOpen(self, String location) -> bool"""
2077 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2078
2079 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2080 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2081 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2082
2083 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2084 """FindFirst(self, String spec, int flags=0) -> String"""
2085 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2086
2087 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2088 """FindNext(self) -> String"""
2089 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
2090
2091 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
2092 """GetProtocol(self, String location) -> String"""
2093 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
2094
2095 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
2096 """GetLeftLocation(self, String location) -> String"""
2097 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
2098
2099 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
2100 """GetAnchor(self, String location) -> String"""
2101 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
2102
2103 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
2104 """GetRightLocation(self, String location) -> String"""
2105 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
2106
2107 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
2108 """GetMimeTypeFromExt(self, String location) -> String"""
2109 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc 2110
ac5d357a
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 2117
5b5c9bc7
RD
2118class FileSystem(Object):
2119 """Proxy of C++ FileSystem class"""
1bd55598
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):
5b5c9bc7 2123 """__init__(self) -> FileSystem"""
1bd55598
RD
2124 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
2125 __swig_destroy__ = _core_.delete_FileSystem
2126 __del__ = lambda self : None;
d55e5bfc 2127 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
2128 """ChangePathTo(self, String location, bool is_dir=False)"""
2129 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
2130
2131 def GetPath(*args, **kwargs):
5b5c9bc7
RD
2132 """GetPath(self) -> String"""
2133 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
2134
2135 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2136 """OpenFile(self, String location) -> FSFile"""
2137 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
2138
2139 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2140 """FindFirst(self, String spec, int flags=0) -> String"""
2141 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
2142
2143 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2144 """FindNext(self) -> String"""
2145 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
2146
2147 def AddHandler(*args, **kwargs):
d6c14a4c 2148 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 2149 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
2150
2151 AddHandler = staticmethod(AddHandler)
ac5d357a
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):
d6c14a4c 2158 """CleanUpHandlers()"""
5b5c9bc7 2159 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
2160
2161 CleanUpHandlers = staticmethod(CleanUpHandlers)
2162 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
2163 """FileNameToURL(String filename) -> String"""
2164 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
2165
2166 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 2167 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
2168 """URLToFileName(String url) -> String"""
2169 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
2170
2171 URLToFileName = staticmethod(URLToFileName)
ac5d357a 2172 Path = property(GetPath,doc="See `GetPath`")
2131d850 2173_core_.FileSystem_swigregister(FileSystem)
d55e5bfc 2174
5b5c9bc7 2175def FileSystem_AddHandler(*args, **kwargs):
1bd55598
RD
2176 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
2177 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 2178
ac5d357a
RD
2179def FileSystem_RemoveHandler(*args, **kwargs):
2180 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2181 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2182
1bd55598
RD
2183def FileSystem_CleanUpHandlers(*args):
2184 """FileSystem_CleanUpHandlers()"""
2185 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc 2186
5b5c9bc7 2187def FileSystem_FileNameToURL(*args, **kwargs):
1bd55598
RD
2188 """FileSystem_FileNameToURL(String filename) -> String"""
2189 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 2190
5b5c9bc7 2191def FileSystem_URLToFileName(*args, **kwargs):
1bd55598
RD
2192 """FileSystem_URLToFileName(String url) -> String"""
2193 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 2194
5b5c9bc7
RD
2195class InternetFSHandler(CPPFileSystemHandler):
2196 """Proxy of C++ InternetFSHandler class"""
1bd55598
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):
5b5c9bc7 2200 """__init__(self) -> InternetFSHandler"""
1bd55598 2201 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc 2202 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2203 """CanOpen(self, String location) -> bool"""
2204 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2205
2206 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2207 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2208 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc 2209
2131d850 2210_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc 2211
5b5c9bc7
RD
2212class ZipFSHandler(CPPFileSystemHandler):
2213 """Proxy of C++ ZipFSHandler class"""
1bd55598
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):
5b5c9bc7 2217 """__init__(self) -> ZipFSHandler"""
1bd55598 2218 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc 2219 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2220 """CanOpen(self, String location) -> bool"""
2221 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2222
2223 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2224 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2225 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2226
2227 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2228 """FindFirst(self, String spec, int flags=0) -> String"""
2229 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2230
2231 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2232 """FindNext(self) -> String"""
2233 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc 2234
2131d850 2235_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
2236
2237
2238def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1bd55598
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):
1bd55598
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):
1bd55598
RD
2247 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2248 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
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 2265
5b5c9bc7
RD
2266class MemoryFSHandler(CPPFileSystemHandler):
2267 """Proxy of C++ MemoryFSHandler class"""
1bd55598
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):
5b5c9bc7 2271 """__init__(self) -> MemoryFSHandler"""
1bd55598 2272 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 2273 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
2274 """RemoveFile(String filename)"""
2275 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
2276
2277 RemoveFile = staticmethod(RemoveFile)
2278 AddFile = staticmethod(MemoryFSHandler_AddFile)
2279 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2280 """CanOpen(self, String location) -> bool"""
2281 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2282
2283 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2284 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2285 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2286
2287 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2288 """FindFirst(self, String spec, int flags=0) -> String"""
2289 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2290
2291 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2292 """FindNext(self) -> String"""
2293 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc 2294
2131d850 2295_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc 2296
5b5c9bc7 2297def MemoryFSHandler_RemoveFile(*args, **kwargs):
1bd55598
RD
2298 """MemoryFSHandler_RemoveFile(String filename)"""
2299 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 2300
5b5c9bc7
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
5b5c9bc7 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 """
1bd55598
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 2317 def GetName(*args, **kwargs):
5b5c9bc7
RD
2318 """GetName(self) -> String"""
2319 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
2320
2321 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
2322 """GetExtension(self) -> String"""
2323 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
2324
2325 def GetType(*args, **kwargs):
2326 """GetType(self) -> long"""
5b5c9bc7 2327 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
2328
2329 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
2330 """GetMimeType(self) -> String"""
2331 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
2332
2333 def CanRead(*args, **kwargs):
5b5c9bc7
RD
2334 """CanRead(self, String name) -> bool"""
2335 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc 2336
b02396e8
RD
2337 def CanReadStream(*args, **kwargs):
2338 """CanReadStream(self, InputStream stream) -> bool"""
2339 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2340
d55e5bfc 2341 def SetName(*args, **kwargs):
5b5c9bc7
RD
2342 """SetName(self, String name)"""
2343 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
2344
2345 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2346 """SetExtension(self, String extension)"""
2347 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2348
2349 def SetType(*args, **kwargs):
2350 """SetType(self, long type)"""
5b5c9bc7 2351 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2352
2353 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2354 """SetMimeType(self, String mimetype)"""
2355 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc 2356
ac5d357a
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
943e8dfd
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 """
1bd55598
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):
943e8dfd
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 """
1bd55598 2419 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
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)
943e8dfd 2427
5b5c9bc7
RD
2428class ImageHistogram(object):
2429 """Proxy of C++ ImageHistogram class"""
1bd55598
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):
5b5c9bc7 2433 """__init__(self) -> ImageHistogram"""
1bd55598 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 """
5b5c9bc7 2441 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2442
2443 MakeKey = staticmethod(MakeKey)
2444 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
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 """
5b5c9bc7 2452 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2461 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
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 """
5b5c9bc7 2469 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2470
2471 def GetCountColour(*args, **kwargs):
2472 """
5b5c9bc7 2473 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2474
2475 Returns the pixel count for the given `wx.Colour` value.
2476 """
5b5c9bc7 2477 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2478
2131d850 2479_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc 2480
5b5c9bc7 2481def ImageHistogram_MakeKey(*args, **kwargs):
1bd55598 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 """
1bd55598 2487 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2488
943e8dfd
RD
2489class Image_RGBValue(object):
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 """
1bd55598
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):
943e8dfd
RD
2499 """
2500 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2501
2502 Constructor.
2503 """
1bd55598 2504 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
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)
943e8dfd
RD
2509
2510class Image_HSVValue(object):
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 """
1bd55598
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):
943e8dfd
RD
2520 """
2521 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2522
2523 Constructor.
2524 """
1bd55598 2525 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
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)
943e8dfd 2530
5b5c9bc7 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 """
1bd55598
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 """
1bd55598
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 """
5b5c9bc7 2576 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2600 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2645 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2656 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2672 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 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 """
5b5c9bc7 2684 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2694 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 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 """
5b5c9bc7 2702 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2710 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2718 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2728 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2742 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2750 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7
RD
2761 return _core_.Image_InitAlpha(*args, **kwargs)
2762
2763 def IsTransparent(*args, **kwargs):
2764 """
7a27cf7c 2765 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2766
7a27cf7c
RD
2767 Returns ``True`` if this pixel is masked or has an alpha value less
2768 than the spcified threshold.
5b5c9bc7
RD
2769 """
2770 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2771
d55e5bfc 2772 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
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 """
5b5c9bc7 2780 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2781
4cf4100f
RD
2782 def ConvertAlphaToMask(*args, **kwargs):
2783 """
5b5c9bc7 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 """
5b5c9bc7 2794 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 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 """
5b5c9bc7 2808 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 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 """
5b5c9bc7 2827 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2835 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2846 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2856 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2865 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2873 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2881 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2891 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2902 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2911 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2928 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2929
2930 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2931 """
2932 GetHeight(self) -> int
2933
2934 Gets the height of the image in pixels.
2935 """
5b5c9bc7 2936 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2937
2938 def GetSize(*args, **kwargs):
7a27cf7c
RD
2939 """
2940 GetSize(self) -> Size
2941
2942 Returns the size of the image in pixels.
2943 """
5b5c9bc7 2944 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2953 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2967 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2968
d55e5bfc 2969 def Copy(*args, **kwargs):
7a27cf7c
RD
2970 """
2971 Copy(self) -> Image
2972
2973 Returns an identical copy of the image.
2974 """
5b5c9bc7 2975 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2984 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2985
2986 def GetData(*args, **kwargs):
bb2ef2cc
RD
2987 """
2988 GetData(self) -> PyObject
2989
2990 Returns a string containing a copy of the RGB bytes of the image.
2991 """
5b5c9bc7 2992 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2993
2994 def SetData(*args, **kwargs):
bb2ef2cc
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 """
5b5c9bc7 3002 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
3003
3004 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
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.
bb2ef2cc 3011 """
5b5c9bc7 3012 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
3013
3014 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
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.
bb2ef2cc 3021 """
5b5c9bc7 3022 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
3023
3024 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
3025 """
3026 GetAlphaData(self) -> PyObject
3027
3028 Returns a string containing a copy of the alpha bytes of the image.
3029 """
5b5c9bc7 3030 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
3031
3032 def SetAlphaData(*args, **kwargs):
bb2ef2cc
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 """
5b5c9bc7 3040 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3050 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3060 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3069 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 3077 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 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 """
5b5c9bc7 3085 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
3086
3087 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
3088 """
3089 GetMaskGreen(self) -> byte
3090
3091 Gets the green component of the mask colour.
3092 """
5b5c9bc7 3093 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
3094
3095 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
3096 """
3097 GetMaskBlue(self) -> byte
3098
3099 Gets the blue component of the mask colour.
3100 """
5b5c9bc7 3101 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3110 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3118 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
3119
3120 def Rotate(*args, **kwargs):
3121 """
5b5c9bc7
RD
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 3132 """
5b5c9bc7 3133 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3142 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3151 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
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 3159 """
5b5c9bc7 3160 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 3161
32fe5131
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 """
5b5c9bc7 3180 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3190 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3198 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3206 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3215 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 3223 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
3224
3225 def CountColours(*args, **kwargs):
3226 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 3227 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
3228
3229 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
3230 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3231 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
3232
3233 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
3234 """AddHandler(ImageHandler handler)"""
3235 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
3236
3237 AddHandler = staticmethod(AddHandler)
3238 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
3239 """InsertHandler(ImageHandler handler)"""
3240 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
3241
3242 InsertHandler = staticmethod(InsertHandler)
3243 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
3244 """RemoveHandler(String name) -> bool"""
3245 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
3246
3247 RemoveHandler = staticmethod(RemoveHandler)
1bd55598
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 """
5b5c9bc7 3261 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
3262
3263 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3264 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
3265 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3266 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
3267
3268 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3269 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 3270 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 3271
943e8dfd
RD
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):
3282 """
3283 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3284
3285 Converts a color in RGB color space to HSV color space.
3286 """
3287 return _core_.Image_RGBtoHSV(*args, **kwargs)
3288
3289 RGBtoHSV = staticmethod(RGBtoHSV)
3290 def HSVtoRGB(*args, **kwargs):
3291 """
3292 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3293
3294 Converts a color in HSV color space to RGB color space.
3295 """
3296 return _core_.Image_HSVtoRGB(*args, **kwargs)
3297
3298 HSVtoRGB = staticmethod(HSVtoRGB)
b39fe951 3299 def __nonzero__(self): return self.IsOk()
ac5d357a
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`")
ac5d357a 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 """
5b5c9bc7 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 """
5b5c9bc7 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 """
5b5c9bc7 3338 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
3339 return val
3340
d6c14a4c 3341def EmptyImage(*args, **kwargs):
bb2ef2cc 3342 """
5b5c9bc7 3343 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
3344
3345 Construct an empty image of a given size, optionally setting all
3346 pixels to black.
3347 """
5b5c9bc7 3348 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
3349 return val
3350
3351def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 3352 """
5b5c9bc7 3353 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
3354
3355 Construct an Image from a `wx.Bitmap`.
3356 """
5b5c9bc7 3357 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
3358 return val
3359
3360def ImageFromData(*args, **kwargs):
bb2ef2cc 3361 """
5b5c9bc7 3362 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
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 """
5b5c9bc7 3368 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
3369 return val
3370
03e46024 3371def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 3372 """
5b5c9bc7 3373 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
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.
bb2ef2cc 3379 """
5b5c9bc7 3380 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
3381 return val
3382
5b5c9bc7 3383def Image_CanRead(*args, **kwargs):
1bd55598 3384 """
7a27cf7c
RD
3385 Image_CanRead(String filename) -> bool
3386
3387 Returns True if the image handlers can read this file.
3388 """
1bd55598 3389 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 3390
5b5c9bc7 3391def Image_GetImageCount(*args, **kwargs):
1bd55598 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 """
1bd55598 3399 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 3400
5b5c9bc7 3401def Image_CanReadStream(*args, **kwargs):
1bd55598 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 """
1bd55598 3409 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 3410
5b5c9bc7 3411def Image_AddHandler(*args, **kwargs):
1bd55598
RD
3412 """Image_AddHandler(ImageHandler handler)"""
3413 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 3414
5b5c9bc7 3415def Image_InsertHandler(*args, **kwargs):
1bd55598
RD
3416 """Image_InsertHandler(ImageHandler handler)"""
3417 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 3418
5b5c9bc7 3419def Image_RemoveHandler(*args, **kwargs):
1bd55598
RD
3420 """Image_RemoveHandler(String name) -> bool"""
3421 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3422
1bd55598
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 """
1bd55598 3435 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3436
943e8dfd 3437def Image_RGBtoHSV(*args, **kwargs):
1bd55598 3438 """
943e8dfd
RD
3439 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3440
3441 Converts a color in RGB color space to HSV color space.
3442 """
1bd55598 3443 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3444
3445def Image_HSVtoRGB(*args, **kwargs):
1bd55598 3446 """
943e8dfd
RD
3447 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3448
3449 Converts a color in HSV color space to RGB color space.
3450 """
1bd55598 3451 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 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
68e533f8
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
5b5c9bc7
RD
3494IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3495IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3496PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3497PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3498PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
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."""
1bd55598
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 """
1bd55598 3518 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3519_core_.BMPHandler_swigregister(BMPHandler)
5b5c9bc7 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
7fbf8399
RD
3534IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3535IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3536
5b5c9bc7 3537class ICOHandler(BMPHandler):
27fb7603 3538 """A `wx.ImageHandler` for \*.ico icon files."""
1bd55598
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 """
1bd55598 3547 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3548_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc 3549
5b5c9bc7 3550class CURHandler(ICOHandler):
27fb7603 3551 """A `wx.ImageHandler` for \*.cur cursor files."""
1bd55598
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 """
1bd55598 3560 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3561_core_.CURHandler_swigregister(CURHandler)
d55e5bfc 3562
5b5c9bc7 3563class ANIHandler(CURHandler):
27fb7603 3564 """A `wx.ImageHandler` for \*.ani animated cursor files."""
1bd55598
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 """
1bd55598 3573 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3574_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc 3575
5b5c9bc7 3576class PNGHandler(ImageHandler):
27fb7603 3577 """A `wx.ImageHandler` for PNG image files."""
1bd55598
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 """
1bd55598 3586 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3587_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc 3588
5b5c9bc7 3589class GIFHandler(ImageHandler):
27fb7603 3590 """A `wx.ImageHandler` for GIF image files."""
1bd55598
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 """
1bd55598 3599 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3600_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc 3601
5b5c9bc7 3602class PCXHandler(ImageHandler):
27fb7603 3603 """A `wx.ImageHandler` for PCX imager files."""
1bd55598
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 """
1bd55598 3612 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3613_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc 3614
5b5c9bc7 3615class JPEGHandler(ImageHandler):
27fb7603 3616 """A `wx.ImageHandler` for JPEG/JPG image files."""
1bd55598
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 """
1bd55598 3625 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3626_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc 3627
5b5c9bc7 3628class PNMHandler(ImageHandler):
27fb7603 3629 """A `wx.ImageHandler` for PNM image files."""
1bd55598
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 """
1bd55598 3638 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3639_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc 3640
5b5c9bc7 3641class XPMHandler(ImageHandler):
27fb7603 3642 """A `wx.ImageHandler` for XPM image."""
1bd55598
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 """
1bd55598 3651 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3652_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc 3653
5b5c9bc7 3654class TIFFHandler(ImageHandler):
27fb7603 3655 """A `wx.ImageHandler` for TIFF image files."""
1bd55598
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 """
1bd55598 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
5b5c9bc7
RD
3680QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3681QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3682class Quantize(object):
c0de73ae 3683 """Performs quantization, or colour reduction, on a wxImage."""
1bd55598
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 """
5b5c9bc7 3689 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
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 """
5b5c9bc7 3695 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3696
3697 Quantize = staticmethod(Quantize)
2131d850 3698_core_.Quantize_swigregister(Quantize)
c0de73ae 3699
5b5c9bc7 3700def Quantize_Quantize(*args, **kwargs):
1bd55598 3701 """
5b5c9bc7 3702 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
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 """
1bd55598 3708 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3709
d55e5bfc
RD
3710#---------------------------------------------------------------------------
3711
5b5c9bc7
RD
3712class EvtHandler(Object):
3713 """Proxy of C++ EvtHandler class"""
1bd55598
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):
5b5c9bc7 3717 """__init__(self) -> EvtHandler"""
1bd55598 3718 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d49bdf34
RD
3719 self._setOORInfo(self)
3720
d55e5bfc 3721 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3722 """GetNextHandler(self) -> EvtHandler"""
3723 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3724
3725 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3726 """GetPreviousHandler(self) -> EvtHandler"""
3727 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3728
3729 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3730 """SetNextHandler(self, EvtHandler handler)"""
3731 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3732
3733 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3734 """SetPreviousHandler(self, EvtHandler handler)"""
3735 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3736
3737 def GetEvtHandlerEnabled(*args, **kwargs):
3738 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3739 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3740
3741 def SetEvtHandlerEnabled(*args, **kwargs):
3742 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3743 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3744
3745 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3746 """ProcessEvent(self, Event event) -> bool"""
3747 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3748
3749 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3750 """AddPendingEvent(self, Event event)"""
3751 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3752
3753 def ProcessPendingEvents(*args, **kwargs):
3754 """ProcessPendingEvents(self)"""
5b5c9bc7 3755 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3756
3757 def Connect(*args, **kwargs):
3758 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3759 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3760
3761 def Disconnect(*args, **kwargs):
2131d850 3762 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3763 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3764
3765 def _setOORInfo(*args, **kwargs):
36ed4f51 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
a5ee0656
RD
3775 :param event: One of the EVT_* objects that specifies the
3776 type of event to bind,
d55e5bfc 3777
a5ee0656
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
a5ee0656
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
a5ee0656
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
d6c14a4c
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
ac5d357a
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
d6c14a4c
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
5b5c9bc7
RD
3893EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3894EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3895
1bd55598 3896def NewEventType(*args):
2131d850 3897 """NewEventType() -> EventType"""
1bd55598 3898 return _core_.NewEventType(*args)
4976f996 3899wxEVT_ANY = _core_.wxEVT_ANY
5b5c9bc7
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
4f433fef
RD
3962wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3963wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
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
5b5c9bc7
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
34e0a3bb 3985wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
5b5c9bc7
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
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
5b5c9bc7
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
d55e5bfc
RD
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 )
34e0a3bb 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,
4f433fef 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 )
4f433fef
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,
4f433fef 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)
4f433fef
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
5b5c9bc7 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 """
1bd55598
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 """
2131d850 4217 SetEventType(self, EventType typ)
27fb7603
RD
4218
4219 Sets the specific type of the event.
4220 """
5b5c9bc7 4221 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
4222
4223 def GetEventType(*args, **kwargs):
27fb7603 4224 """
2131d850 4225 GetEventType(self) -> EventType
27fb7603
RD
4226
4227 Returns the identifier of the given event type, such as
4228 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4229 """
5b5c9bc7 4230 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4239 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4248 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
4249
4250 def GetTimestamp(*args, **kwargs):
4251 """GetTimestamp(self) -> long"""
5b5c9bc7 4252 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
4253
4254 def SetTimestamp(*args, **kwargs):
4255 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 4256 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4265 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4275 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4284 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4298 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4307 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4316 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4326 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4337 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
4338
4339 def Clone(*args, **kwargs):
5b5c9bc7
RD
4340 """Clone(self) -> Event"""
4341 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc 4342
ac5d357a
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
5b5c9bc7 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 """
1bd55598
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 """
1bd55598
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 4372
5b5c9bc7 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 """
1bd55598
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 """
1bd55598
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
5b5c9bc7 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 """
1bd55598
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 """
2131d850 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 """
1bd55598 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 """
5b5c9bc7 4420 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
4421
4422 def SetString(*args, **kwargs):
5b5c9bc7
RD
4423 """SetString(self, String s)"""
4424 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4433 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4445 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4455 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
4456
4457 def SetExtraLong(*args, **kwargs):
4458 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 4459 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4472 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
4473
4474 def SetInt(*args, **kwargs):
4475 """SetInt(self, int i)"""
5b5c9bc7 4476 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
4477
4478 def GetInt(*args, **kwargs):
27fb7603 4479 """
2131d850 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 """
5b5c9bc7 4486 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc 4487
1bd55598
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 4507 def Clone(*args, **kwargs):
5b5c9bc7
RD
4508 """Clone(self) -> Event"""
4509 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc 4510
2bf58437
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
5b5c9bc7 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 """
1bd55598
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 """
2131d850 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 """
1bd55598 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 """
5b5c9bc7 4550 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4561 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4570 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc 4571
2131d850 4572_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4573
4574#---------------------------------------------------------------------------
4575
5b5c9bc7 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 """
1bd55598
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 """
2131d850 4587 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4588 int orient=0) -> ScrollEvent
d55e5bfc 4589 """
1bd55598 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 """
5b5c9bc7 4598 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4599
4600 def GetPosition(*args, **kwargs):
27fb7603
RD
4601 """
4602 GetPosition(self) -> int
4603
4604 Returns the position of the scrollbar.
4605 """
5b5c9bc7 4606 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4607
4608 def SetOrientation(*args, **kwargs):
4609 """SetOrientation(self, int orient)"""
5b5c9bc7 4610 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4611
4612 def SetPosition(*args, **kwargs):
4613 """SetPosition(self, int pos)"""
5b5c9bc7 4614 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc 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
5b5c9bc7 4622class ScrollWinEvent(Event):
27fb7603
RD
4623 """
4624 A wx.ScrollWinEvent holds information about scrolling and is sent from
4625 scrolling windows.
4626 """
1bd55598
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 """
2131d850 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 """
1bd55598 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 """
5b5c9bc7 4644 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4654 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4655
4656 def SetOrientation(*args, **kwargs):
4657 """SetOrientation(self, int orient)"""
5b5c9bc7 4658 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4659
4660 def SetPosition(*args, **kwargs):
4661 """SetPosition(self, int pos)"""
5b5c9bc7 4662 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc 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
5b5c9bc7
RD
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 """
1bd55598
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 """
2131d850 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 """
1bd55598 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 """
5b5c9bc7 4727 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4738 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4749 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4759 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4776 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4777
4778 def ButtonIsDown(*args, **kwargs):
4779 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4780 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4793 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4801 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4809 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4817 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4825 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 4839 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 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 """
5b5c9bc7 4847 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4855 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4863 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4871 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4879 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4887 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4895 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4903 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4911 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4928 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4937 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4946 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4955 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4965 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4973 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 4981 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4982
4983 def GetPosition(*args, **kwargs):
4984 """
5b5c9bc7 4985 GetPosition(self) -> Point
d55e5bfc 4986
27fb7603
RD
4987 Returns the pixel position of the mouse in window coordinates when the
4988 event happened.
d55e5bfc 4989 """
5b5c9bc7 4990 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
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 4998 """
5b5c9bc7 4999 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5009 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5017 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5025 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5039 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5049 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 5068 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7
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
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 5126 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5134 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
5135
5136 def SetCursor(*args, **kwargs):
5ba5649b
RD
5137 """
5138 SetCursor(self, Cursor cursor)
5139
5140 Sets the cursor associated with this event.
5141 """
5b5c9bc7 5142 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5150 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5158 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc 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
5b5c9bc7 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 """
1bd55598
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 """
2131d850 5234 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
5235
5236 Construct a new `wx.KeyEvent`. Valid event types are:
5237 *
5238 """
1bd55598 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 """
5b5c9bc7 5261 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5269 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5277 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5285 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 5299 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 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 """
5b5c9bc7 5312 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5328 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc 5329
bb4524c4 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 """
5b5c9bc7 5337 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 5338
bb4524c4 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 """
5b5c9bc7 5358 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5368 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
5369
5370 def GetPosition(*args, **kwargs):
5371 """
5b5c9bc7 5372 GetPosition(self) -> Point
d55e5bfc 5373
5ba5649b 5374 Find the position of the event, if applicable.
d55e5bfc 5375 """
5b5c9bc7 5376 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5377
5378 def GetPositionTuple(*args, **kwargs):
5379 """
5380 GetPositionTuple() -> (x,y)
5381
5ba5649b 5382 Find the position of the event, if applicable.
d55e5bfc 5383 """
5b5c9bc7 5384 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5393 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7
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)
ac5d357a
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
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 5460 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
5461
5462 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5463 """GetRect(self) -> Rect"""
5464 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5465
5466 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5467 """SetRect(self, Rect rect)"""
5468 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5469
5470 def SetSize(*args, **kwargs):
5b5c9bc7
RD
5471 """SetSize(self, Size size)"""
5472 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 5473
5b5c9bc7
RD
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
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 5502 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5503
5504 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5505 """GetRect(self) -> Rect"""
5506 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5507
5508 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5509 """SetRect(self, Rect rect)"""
5510 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5511
5512 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
5513 """SetPosition(self, Point pos)"""
5514 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 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
5b5c9bc7 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 """
1bd55598
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):
5b5c9bc7 5544 """__init__(self, int Id=0) -> PaintEvent"""
1bd55598 5545 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5546_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc 5547
5b5c9bc7
RD
5548class NcPaintEvent(Event):
5549 """Proxy of C++ NcPaintEvent class"""
1bd55598
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):
5b5c9bc7 5553 """__init__(self, int winid=0) -> NcPaintEvent"""
1bd55598 5554 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5555_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5556
5557#---------------------------------------------------------------------------
5558
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 5588 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc 5589
ac5d357a 5590 DC = property(GetDC,doc="See `GetDC`")
2131d850 5591_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5592
5593#---------------------------------------------------------------------------
5594
5b5c9bc7 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 """
1bd55598
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 """
2131d850 5610 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5611
5612 Constructor
5613 """
1bd55598 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 """
5b5c9bc7 5625 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5626
5627 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5628 """SetWindow(self, Window win)"""
5629 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc 5630
ac5d357a 5631 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 5632_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5633
5634#---------------------------------------------------------------------------
5635
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 5663 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc 5664
2bf58437 5665 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 5666_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5667
5668#---------------------------------------------------------------------------
5669
5b5c9bc7 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 """
1bd55598
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 """
2131d850 5691 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5692
5693 Constructor
5694 """
1bd55598 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 """
5b5c9bc7 5703 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc 5704
2bf58437 5705 Active = property(GetActive,doc="See `GetActive`")
2131d850 5706_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5707
5708#---------------------------------------------------------------------------
5709
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 5726 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5727_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5728
5729#---------------------------------------------------------------------------
5730
5b5c9bc7 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 """
1bd55598
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 """
2131d850 5744 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5745
5746 Constructor
5747 """
1bd55598 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 """
5b5c9bc7 5756 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5766 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5775 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc 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
5b5c9bc7 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 """
1bd55598
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 """
2131d850 5810 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5811
5812 Constructor.
5813 """
1bd55598 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 """
5b5c9bc7 5821 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5832 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5843 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 5855 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
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
2bf58437 5868 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
2131d850 5869_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5870
5871#---------------------------------------------------------------------------
5872
5b5c9bc7 5873class ShowEvent(Event):
5ba5649b 5874 """An EVT_SHOW event is sent when a window is shown or hidden."""
1bd55598
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 """
1bd55598 5883 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5884 def SetShow(*args, **kwargs):
5885 """SetShow(self, bool show)"""
5b5c9bc7 5886 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5887
5888 def GetShow(*args, **kwargs):
5889 """GetShow(self) -> bool"""
5b5c9bc7 5890 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc 5891
33d6fd3b 5892 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
2131d850 5893_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5894
5895#---------------------------------------------------------------------------
5896
5b5c9bc7 5897class IconizeEvent(Event):
5ba5649b
RD
5898 """
5899 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5900 restored.
5901 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 5919 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc 5920
2131d850 5921_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5922
5923#---------------------------------------------------------------------------
5924
5b5c9bc7 5925class MaximizeEvent(Event):
5ba5649b 5926 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
1bd55598
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 """
1bd55598 5935 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5936_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5937
5938#---------------------------------------------------------------------------
5939
5b5c9bc7 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 """
1bd55598
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 """
5b5c9bc7 5965 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5966
5967 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5968 """
5969 GetNumberOfFiles(self) -> int
5970
5971 Returns the number of files dropped.
5972 """
5b5c9bc7 5973 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 5981 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc 5982
2bf58437
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
5b5c9bc7
RD
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 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 6060 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6068 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc 6069
b1fcee84
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 """
5b5c9bc7 6084 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6093 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6102 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6111 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc 6112
b1fcee84
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 """
5b5c9bc7 6128 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
6129
6130 def Enable(*args, **kwargs):
5ba5649b
RD
6131 """
6132 Enable(self, bool enable)
6133
6134 Enable or disable the UI element.
6135 """
5b5c9bc7 6136 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc 6137
b1fcee84
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 """
5b5c9bc7 6152 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6168 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6178 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6199 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6210 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6231 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6242 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
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 6250
5b5c9bc7 6251def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
1bd55598 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 """
1bd55598 6265 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 6266
1bd55598
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 """
1bd55598 6274 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc 6275
5b5c9bc7 6276def UpdateUIEvent_CanUpdate(*args, **kwargs):
1bd55598 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 """
1bd55598 6294 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 6295
1bd55598
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 """
1bd55598 6304 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc 6305
5b5c9bc7 6306def UpdateUIEvent_SetMode(*args, **kwargs):
1bd55598 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 """
1bd55598 6324 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 6325
1bd55598
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 """
1bd55598 6334 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
6335
6336#---------------------------------------------------------------------------
6337
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 6359 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 6360_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
6361
6362#---------------------------------------------------------------------------
6363
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 6390 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc 6391
57332a5a 6392 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
2131d850 6393_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
6394
6395#---------------------------------------------------------------------------
6396
34e0a3bb
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
5b5c9bc7 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 """
1bd55598
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):
5b5c9bc7 6448 """__init__(self) -> DisplayChangedEvent"""
1bd55598 6449 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 6450_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
6451
6452#---------------------------------------------------------------------------
6453
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 6474 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc 6475 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6476 """SetChangedWindow(self, Window win)"""
6477 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
6478
6479 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6480 """GetChangedWindow(self) -> Window"""
6481 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc 6482
33d6fd3b 6483 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
2131d850 6484_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
6485
6486#---------------------------------------------------------------------------
6487
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 6510 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
6511
6512 def GetPaletteRealized(*args, **kwargs):
6513 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 6514 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc 6515
33d6fd3b 6516 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
2131d850 6517_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
6518
6519#---------------------------------------------------------------------------
6520
5b5c9bc7 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 """
1bd55598
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):
5b5c9bc7 6534 """__init__(self) -> NavigationKeyEvent"""
1bd55598 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 """
5b5c9bc7 6542 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6551 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
6552
6553 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6554 """
6555 IsWindowChange(self) -> bool
6556
6557 Returns ``True`` if window change is allowed.
6558 """
5b5c9bc7 6559 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6569 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 6578 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
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 """
5b5c9bc7 6587 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 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 """
5b5c9bc7 6601 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 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 """
5b5c9bc7 6610 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6611
6612 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6613 """
6614 SetCurrentFocus(self, Window win)
6615
6616 Set the window that has the focus.
6617 """
5b5c9bc7 6618 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6619
5b5c9bc7
RD
6620 IsBackward = _core_.NavigationKeyEvent_IsBackward
6621 IsForward = _core_.NavigationKeyEvent_IsForward
6622 WinChange = _core_.NavigationKeyEvent_WinChange
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
5b5c9bc7 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 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 6651 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc 6652
dba7934c 6653 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6654_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc 6655
5b5c9bc7 6656class WindowDestroyEvent(CommandEvent):
5ba5649b 6657 """
943e8dfd
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 """
1bd55598
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
943e8dfd
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 """
1bd55598 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 """
5b5c9bc7 6691 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc 6692
dba7934c 6693 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6694_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6695
6696#---------------------------------------------------------------------------
6697
5b5c9bc7 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 """
1bd55598
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 """
2131d850 6707 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6708
6709 Constructor.
6710 """
1bd55598 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 """
5b5c9bc7 6719 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6727 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc 6728
2bf58437 6729 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 6730_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6731
6732#---------------------------------------------------------------------------
6733
5b5c9bc7
RD
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 """
1bd55598
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 """
1bd55598 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 """
5b5c9bc7 6773 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6782 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6802 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6813 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 6830 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6831
6832 CanSend = staticmethod(CanSend)
2131d850 6833_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc 6834
5b5c9bc7 6835def IdleEvent_SetMode(*args, **kwargs):
1bd55598 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 """
1bd55598 6853 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6854
1bd55598
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 """
1bd55598 6863 return _core_.IdleEvent_GetMode(*args)
d55e5bfc 6864
5b5c9bc7 6865def IdleEvent_CanSend(*args, **kwargs):
1bd55598 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 """
1bd55598 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
5b5c9bc7 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 """
1bd55598
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):
2131d850 6922 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
1bd55598 6923 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6924 self._SetSelf(self)
d55e5bfc 6925
1bd55598
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 6937
5b5c9bc7 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 """
1bd55598
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):
2131d850 6953 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
1bd55598 6954 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6955 self._SetSelf(self)
d55e5bfc 6956
1bd55598
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
5b5c9bc7 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 """
1bd55598
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):
2131d850 6979 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
1bd55598 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 """
5b5c9bc7 6987 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
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 """
5b5c9bc7 6996 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709 6997
2bf58437 6998 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
2131d850 6999_core_.DateEvent_swigregister(DateEvent)
53aa7709 7000
5b5c9bc7 7001wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
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
5b5c9bc7
RD
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):
d6c14a4c
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 """
1bd55598
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 7039 """
5b5c9bc7 7040 __init__(self) -> PyApp
d55e5bfc
RD
7041
7042 Create a new application object, starting the bootstrap process.
7043 """
1bd55598 7044 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
c25f90f6 7045 self._setOORInfo(self, False);PyApp._setCallbackInfo(self, self, PyApp)
d55e5bfc 7046
1bd55598
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)"""
5b5c9bc7 7051 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
7052
7053 def GetAppName(*args, **kwargs):
7054 """
5b5c9bc7 7055 GetAppName(self) -> String
d55e5bfc
RD
7056
7057 Get the application name.
7058 """
5b5c9bc7 7059 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
7060
7061 def SetAppName(*args, **kwargs):
7062 """
5b5c9bc7 7063 SetAppName(self, String name)
d55e5bfc 7064
d6c14a4c
RD
7065 Set the application name. This value may be used automatically by
7066 `wx.Config` and such.
d55e5bfc 7067 """
5b5c9bc7 7068 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
7069
7070 def GetClassName(*args, **kwargs):
7071 """
5b5c9bc7 7072 GetClassName(self) -> String
d55e5bfc
RD
7073
7074 Get the application's class name.
7075 """
5b5c9bc7 7076 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
7077
7078 def SetClassName(*args, **kwargs):
7079 """
5b5c9bc7 7080 SetClassName(self, String name)
d55e5bfc 7081
d6c14a4c
RD
7082 Set the application's class name. This value may be used for
7083 X-resources if applicable for the platform
d55e5bfc 7084 """
5b5c9bc7 7085 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
7086
7087 def GetVendorName(*args, **kwargs):
7088 """
5b5c9bc7 7089 GetVendorName(self) -> String
d55e5bfc
RD
7090
7091 Get the application's vendor name.
7092 """
5b5c9bc7 7093 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
7094
7095 def SetVendorName(*args, **kwargs):
7096 """
5b5c9bc7 7097 SetVendorName(self, String name)
d55e5bfc 7098
d6c14a4c
RD
7099 Set the application's vendor name. This value may be used
7100 automatically by `wx.Config` and such.
d55e5bfc 7101 """
5b5c9bc7 7102 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
7103
7104 def GetTraits(*args, **kwargs):
7105 """
7106 GetTraits(self) -> wxAppTraits
7107
d6c14a4c
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 7116 """
5b5c9bc7 7117 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
7118
7119 def ProcessPendingEvents(*args, **kwargs):
7120 """
7121 ProcessPendingEvents(self)
7122
d6c14a4c
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 7126 """
5b5c9bc7 7127 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
7128
7129 def Yield(*args, **kwargs):
7130 """
7131 Yield(self, bool onlyIfNeeded=False) -> bool
7132
d6c14a4c
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
d6c14a4c 7137 :warning: This function is dangerous as it can lead to unexpected
15817c7e
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
d6c14a4c 7142 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 7143
d55e5bfc 7144 """
5b5c9bc7 7145 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
7146
7147 def WakeUpIdle(*args, **kwargs):
7148 """
7149 WakeUpIdle(self)
7150
d6c14a4c
RD
7151 Make sure that idle events are sent again.
7152 :see: `wx.WakeUpIdle`
d55e5bfc 7153 """
5b5c9bc7 7154 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 7163 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
7164
7165 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
7166 def MainLoop(*args, **kwargs):
7167 """
7168 MainLoop(self) -> int
7169
d6c14a4c
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 7172 """
5b5c9bc7 7173 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
7174
7175 def Exit(*args, **kwargs):
7176 """
7177 Exit(self)
7178
7179 Exit the main loop thus terminating the application.
d6c14a4c 7180 :see: `wx.Exit`
d55e5bfc 7181 """
5b5c9bc7 7182 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc 7183
ac5d357a
RD
7184 def GetLayoutDirection(*args, **kwargs):
7185 """
994453b8 7186 GetLayoutDirection(self) -> int
ac5d357a
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
d6c14a4c
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 7198 """
5b5c9bc7 7199 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 7207 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 7216 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
7217
7218 def ProcessIdle(*args, **kwargs):
7219 """
7220 ProcessIdle(self) -> bool
7221
d6c14a4c
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 7225 """
5b5c9bc7 7226 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
7227
7228 def SendIdleEvents(*args, **kwargs):
7229 """
5b5c9bc7 7230 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 7231
d6c14a4c
RD
7232 Send idle event to window and all subwindows. Returns True if more
7233 idle time is requested.
d55e5bfc 7234 """
5b5c9bc7 7235 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
7236
7237 def IsActive(*args, **kwargs):
7238 """
7239 IsActive(self) -> bool
7240
7241 Return True if our app has focus.
7242 """
5b5c9bc7 7243 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
7244
7245 def SetTopWindow(*args, **kwargs):
7246 """
5b5c9bc7 7247 SetTopWindow(self, Window win)
d55e5bfc 7248
d6c14a4c 7249 Set the *main* top level window
d55e5bfc 7250 """
5b5c9bc7 7251 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
7252
7253 def GetTopWindow(*args, **kwargs):
7254 """
5b5c9bc7 7255 GetTopWindow(self) -> Window
d55e5bfc 7256
d6c14a4c
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 7260 """
5b5c9bc7 7261 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
7262
7263 def SetExitOnFrameDelete(*args, **kwargs):
7264 """
7265 SetExitOnFrameDelete(self, bool flag)
7266
d6c14a4c
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 7272 """
5b5c9bc7 7273 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
7274
7275 def GetExitOnFrameDelete(*args, **kwargs):
7276 """
7277 GetExitOnFrameDelete(self) -> bool
7278
7279 Get the current exit behaviour setting.
7280 """
5b5c9bc7 7281 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
7282
7283 def SetUseBestVisual(*args, **kwargs):
7284 """
eccab1a7 7285 SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
d55e5bfc 7286
d6c14a4c
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 7289 """
5b5c9bc7 7290 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
7291
7292 def GetUseBestVisual(*args, **kwargs):
7293 """
7294 GetUseBestVisual(self) -> bool
7295
7296 Get current UseBestVisual setting.
7297 """
5b5c9bc7 7298 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
7299
7300 def SetPrintMode(*args, **kwargs):
7301 """SetPrintMode(self, int mode)"""
5b5c9bc7 7302 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
7303
7304 def GetPrintMode(*args, **kwargs):
7305 """GetPrintMode(self) -> int"""
5b5c9bc7 7306 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
7307
7308 def SetAssertMode(*args, **kwargs):
7309 """
7310 SetAssertMode(self, int mode)
7311
15817c7e 7312 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 7313 """
5b5c9bc7 7314 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
7315
7316 def GetAssertMode(*args, **kwargs):
7317 """
7318 GetAssertMode(self) -> int
7319
7320 Get the current OnAssert behaviour setting.
7321 """
5b5c9bc7 7322 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
7323
7324 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7325 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 7326 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7327
7328 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7329 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7330 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 7331 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7332
7333 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7334 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7335 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 7336 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7337
7338 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7339 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7340 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 7341 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7342
7343 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7344 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7345 """GetMacHelpMenuTitleName() -> String"""
7346 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7347
7348 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7349 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7350 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 7351 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7352
7353 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7354 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7355 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 7356 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7357
7358 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7359 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7360 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 7361 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7362
7363 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7364 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7365 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 7366 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7367
7368 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7369 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7370 """SetMacHelpMenuTitleName(String val)"""
7371 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7372
7373 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7374 def _BootstrapApp(*args, **kwargs):
7375 """
7376 _BootstrapApp(self)
7377
7378 For internal use only
7379 """
5b5c9bc7 7380 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
7381
7382 def GetComCtl32Version(*args, **kwargs):
7383 """
d6c14a4c 7384 GetComCtl32Version() -> int
d55e5bfc 7385
d6c14a4c
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 7388 """
5b5c9bc7 7389 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
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
1bd55598
RD
7427def PyApp_IsMainLoopRunning(*args):
7428 """
5b5c9bc7 7429 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
7430
7431 Returns True if we're running the main loop, i.e. if the events can
7432 currently be dispatched.
7433 """
1bd55598 7434 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 7435
1bd55598
RD
7436def PyApp_GetMacSupportPCMenuShortcuts(*args):
7437 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7438 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 7439
1bd55598
RD
7440def PyApp_GetMacAboutMenuItemId(*args):
7441 """PyApp_GetMacAboutMenuItemId() -> long"""
7442 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 7443
1bd55598
RD
7444def PyApp_GetMacPreferencesMenuItemId(*args):
7445 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7446 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 7447
1bd55598
RD
7448def PyApp_GetMacExitMenuItemId(*args):
7449 """PyApp_GetMacExitMenuItemId() -> long"""
7450 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 7451
1bd55598
RD
7452def PyApp_GetMacHelpMenuTitleName(*args):
7453 """PyApp_GetMacHelpMenuTitleName() -> String"""
7454 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc 7455
5b5c9bc7 7456def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
1bd55598
RD
7457 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7458 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 7459
5b5c9bc7 7460def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
1bd55598
RD
7461 """PyApp_SetMacAboutMenuItemId(long val)"""
7462 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 7463
5b5c9bc7 7464def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
1bd55598
RD
7465 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7466 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 7467
5b5c9bc7 7468def PyApp_SetMacExitMenuItemId(*args, **kwargs):
1bd55598
RD
7469 """PyApp_SetMacExitMenuItemId(long val)"""
7470 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 7471
5b5c9bc7 7472def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
1bd55598
RD
7473 """PyApp_SetMacHelpMenuTitleName(String val)"""
7474 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7475
1bd55598
RD
7476def PyApp_GetComCtl32Version(*args):
7477 """
5b5c9bc7 7478 PyApp_GetComCtl32Version() -> int
d55e5bfc 7479
d6c14a4c
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 """
1bd55598 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
1bd55598
RD
7509def Exit(*args):
7510 """
5b5c9bc7 7511 Exit()
d55e5bfc
RD
7512
7513 Force an exit of the application. Convenience for wx.GetApp().Exit()
7514 """
1bd55598 7515 return _core_.Exit(*args)
d55e5bfc 7516
1bd55598
RD
7517def Yield(*args):
7518 """
5b5c9bc7 7519 Yield() -> bool
d55e5bfc
RD
7520
7521 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7522 """
1bd55598 7523 return _core_.Yield(*args)
d55e5bfc 7524
1bd55598
RD
7525def YieldIfNeeded(*args):
7526 """
5b5c9bc7 7527 YieldIfNeeded() -> bool
d55e5bfc
RD
7528
7529 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7530 """
1bd55598 7531 return _core_.YieldIfNeeded(*args)
d55e5bfc 7532
5b5c9bc7 7533def SafeYield(*args, **kwargs):
1bd55598 7534 """
5b5c9bc7 7535 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 7536
d6c14a4c
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
d6c14a4c 7543 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 7544 """
1bd55598 7545 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 7546
1bd55598
RD
7547def WakeUpIdle(*args):
7548 """
5b5c9bc7 7549 WakeUpIdle()
d55e5bfc 7550
d6c14a4c
RD
7551 Cause the message queue to become empty again, so idle events will be
7552 sent.
d55e5bfc 7553 """
1bd55598 7554 return _core_.WakeUpIdle(*args)
d55e5bfc 7555
5b5c9bc7 7556def PostEvent(*args, **kwargs):
1bd55598 7557 """
5b5c9bc7 7558 PostEvent(EvtHandler dest, Event event)
d55e5bfc 7559
d6c14a4c
RD
7560 Send an event to a window or other wx.EvtHandler to be processed
7561 later.
d55e5bfc 7562 """
1bd55598 7563 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 7564
1bd55598
RD
7565def App_CleanUp(*args):
7566 """
5b5c9bc7 7567 App_CleanUp()
d55e5bfc 7568
15817c7e 7569 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 7570 Python shuts down.
d55e5bfc 7571 """
1bd55598 7572 return _core_.App_CleanUp(*args)
d55e5bfc 7573
1bd55598
RD
7574def GetApp(*args):
7575 """
5b5c9bc7 7576 GetApp() -> PyApp
d55e5bfc
RD
7577
7578 Return a reference to the current wx.App object.
7579 """
1bd55598 7580 return _core_.GetApp(*args)
5cbf236d 7581
5b5c9bc7 7582def SetDefaultPyEncoding(*args, **kwargs):
1bd55598 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 """
1bd55598 7595 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7596
1bd55598
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 """
1bd55598 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
bb4524c4
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 """
d6c14a4c
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
15817c7e 7697 directly.
d55e5bfc 7698 """
d6c14a4c 7699
d55e5bfc
RD
7700 outputWindowClass = PyOnDemandOutputWindow
7701
d6c14a4c
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.)
d6c14a4c
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
2131d850
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
7993762b 7799 def Destroy(self):
b39fe951 7800 self.this.own(False)
7993762b 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
d6c14a4c 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
d6c14a4c 7868 about OnInit. For example::
d55e5bfc 7869
d6c14a4c
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
d6c14a4c 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
d6c14a4c
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
d6c14a4c 7907# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7908# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 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...
d6c14a4c
RD
7920## import atexit
7921## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7922
7923
7924#----------------------------------------------------------------------------
7925
7926#---------------------------------------------------------------------------
7927
5b5c9bc7
RD
7928class EventLoop(object):
7929 """Proxy of C++ EventLoop class"""
1bd55598
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):
5b5c9bc7 7933 """__init__(self) -> EventLoop"""
1bd55598
RD
7934 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7935 __swig_destroy__ = _core_.delete_EventLoop
7936 __del__ = lambda self : None;
b411df4a
RD
7937 def Run(*args, **kwargs):
7938 """Run(self) -> int"""
5b5c9bc7 7939 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7940
7941 def Exit(*args, **kwargs):
7942 """Exit(self, int rc=0)"""
5b5c9bc7 7943 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7944
7945 def Pending(*args, **kwargs):
7946 """Pending(self) -> bool"""
5b5c9bc7 7947 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7948
7949 def Dispatch(*args, **kwargs):
7950 """Dispatch(self) -> bool"""
5b5c9bc7 7951 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7952
7953 def IsRunning(*args, **kwargs):
7954 """IsRunning(self) -> bool"""
5b5c9bc7 7955 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7956
7957 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7958 """GetActive() -> EventLoop"""
7959 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7960
7961 GetActive = staticmethod(GetActive)
7962 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7963 """SetActive(EventLoop loop)"""
7964 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7965
7966 SetActive = staticmethod(SetActive)
2131d850 7967_core_.EventLoop_swigregister(EventLoop)
b411df4a 7968
1bd55598
RD
7969def EventLoop_GetActive(*args):
7970 """EventLoop_GetActive() -> EventLoop"""
7971 return _core_.EventLoop_GetActive(*args)
b411df4a 7972
5b5c9bc7 7973def EventLoop_SetActive(*args, **kwargs):
1bd55598
RD
7974 """EventLoop_SetActive(EventLoop loop)"""
7975 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7976
32fe5131
RD
7977class EventLoopActivator(object):
7978 """Proxy of C++ EventLoopActivator class"""
1bd55598
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):
32fe5131 7982 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
1bd55598
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)
32fe5131 7987
b411df4a
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
5b5c9bc7 7995class AcceleratorEntry(object):
d6c14a4c
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
15817c7e 8000 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
8001
8002 :see: `wx.AcceleratorTable`
8003 """
1bd55598
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):
d6c14a4c 8007 """
5b5c9bc7 8008 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
8009
8010 Construct a wx.AcceleratorEntry.
d6c14a4c 8011 """
1bd55598
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):
d6c14a4c
RD
8016 """
8017 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 8018
d6c14a4c
RD
8019 (Re)set the attributes of a wx.AcceleratorEntry.
8020 :see `__init__`
8021 """
5b5c9bc7 8022 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc 8023
ac5d357a
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):
d6c14a4c
RD
8035 """
8036 GetFlags(self) -> int
8037
8038 Get the AcceleratorEntry's flags.
8039 """
5b5c9bc7 8040 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
8041
8042 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
8043 """
8044 GetKeyCode(self) -> int
8045
8046 Get the AcceleratorEntry's keycode.
8047 """
5b5c9bc7 8048 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
8049
8050 def GetCommand(*args, **kwargs):
d6c14a4c
RD
8051 """
8052 GetCommand(self) -> int
8053
8054 Get the AcceleratorEntry's command ID.
8055 """
5b5c9bc7 8056 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc 8057
ac5d357a
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
2bf58437
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
ac5d357a
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
5b5c9bc7 8095class AcceleratorTable(Object):
d6c14a4c
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.
d6c14a4c 8101 """
1bd55598
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
d6c14a4c
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 """
1bd55598
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
5b5c9bc7 8130class VisualAttributes(object):
d55e5bfc 8131 """struct containing all the visual attributes of a control"""
1bd55598
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 8135 """
5b5c9bc7 8136 __init__(self) -> VisualAttributes
d55e5bfc
RD
8137
8138 struct containing all the visual attributes of a control
8139 """
1bd55598
RD
8140 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
8141 __swig_destroy__ = _core_.delete_VisualAttributes
8142 __del__ = lambda self : None;
5b5c9bc7
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)
5b5c9bc7 8147NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
8148PanelNameStr = cvar.PanelNameStr
8149
5b5c9bc7
RD
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):
d55e5bfc
RD
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 """
1bd55598
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 8166 """
5b5c9bc7
RD
8167 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8168 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
8169
8170 Construct and show a generic Window.
8171 """
1bd55598 8172 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
8173 self._setOORInfo(self)
8174
8175 def Create(*args, **kwargs):
8176 """
5b5c9bc7
RD
8177 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8178 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
8179
8180 Create the GUI part of the Window for 2-phase creation mode.
8181 """
5b5c9bc7 8182 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
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 8192 """
5b5c9bc7 8193 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
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
15817c7e
RD
8215 Destroys all children of a window. Called automatically by the
8216 destructor.
d55e5bfc 8217 """
5b5c9bc7 8218 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
8219
8220 def IsBeingDeleted(*args, **kwargs):
8221 """
8222 IsBeingDeleted(self) -> bool
8223
8224 Is the window in the process of being deleted?
8225 """
5b5c9bc7 8226 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 8227
d55e5bfc
RD
8228 def SetLabel(*args, **kwargs):
8229 """
5b5c9bc7 8230 SetLabel(self, String label)
d55e5bfc
RD
8231
8232 Set the text which the window shows in its label if applicable.
8233 """
5b5c9bc7 8234 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
8235
8236 def GetLabel(*args, **kwargs):
8237 """
5b5c9bc7 8238 GetLabel(self) -> String
d55e5bfc 8239
15817c7e
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 8246 """
5b5c9bc7 8247 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
8248
8249 def SetName(*args, **kwargs):
8250 """
5b5c9bc7 8251 SetName(self, String name)
d55e5bfc 8252
15817c7e
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 8255 """
5b5c9bc7 8256 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
8257
8258 def GetName(*args, **kwargs):
8259 """
5b5c9bc7 8260 GetName(self) -> String
d55e5bfc 8261
15817c7e
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 8265 """
5b5c9bc7 8266 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
8267
8268 def SetWindowVariant(*args, **kwargs):
8269 """
8270 SetWindowVariant(self, int variant)
8271
15817c7e
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 8274 """
5b5c9bc7 8275 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
8276
8277 def GetWindowVariant(*args, **kwargs):
8278 """GetWindowVariant(self) -> int"""
5b5c9bc7 8279 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8290 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8301 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
8302
8303 def NewControlId(*args, **kwargs):
8304 """
d6c14a4c 8305 NewControlId() -> int
d55e5bfc
RD
8306
8307 Generate a control id for the controls which were not given one.
8308 """
5b5c9bc7 8309 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
8310
8311 NewControlId = staticmethod(NewControlId)
8312 def NextControlId(*args, **kwargs):
8313 """
d6c14a4c 8314 NextControlId(int winid) -> int
d55e5bfc
RD
8315
8316 Get the id of the control following the one with the given
15817c7e 8317 autogenerated) id
d55e5bfc 8318 """
5b5c9bc7 8319 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
8320
8321 NextControlId = staticmethod(NextControlId)
8322 def PrevControlId(*args, **kwargs):
8323 """
d6c14a4c 8324 PrevControlId(int winid) -> int
d55e5bfc
RD
8325
8326 Get the id of the control preceding the one with the given
15817c7e 8327 autogenerated) id
d55e5bfc 8328 """
5b5c9bc7 8329 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
8330
8331 PrevControlId = staticmethod(PrevControlId)
ac5d357a
RD
8332 def GetLayoutDirection(*args, **kwargs):
8333 """
994453b8 8334 GetLayoutDirection(self) -> int
ac5d357a
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)
ac5d357a
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 """
5b5c9bc7 8360 SetSize(self, Size size)
d55e5bfc
RD
8361
8362 Sets the size of the window in pixels.
8363 """
5b5c9bc7 8364 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
8365
8366 def SetDimensions(*args, **kwargs):
8367 """
5b5c9bc7 8368 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
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 8384 """
5b5c9bc7 8385 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
8386
8387 def SetRect(*args, **kwargs):
8388 """
5b5c9bc7 8389 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8390
8391 Sets the position and size of the window in pixels using a wx.Rect.
8392 """
5b5c9bc7 8393 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8401 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
8402
8403 def Move(*args, **kwargs):
8404 """
5b5c9bc7 8405 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8406
8407 Moves the window to the given position.
8408 """
5b5c9bc7 8409 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
8410
8411 SetPosition = Move
8412 def MoveXY(*args, **kwargs):
8413 """
5b5c9bc7 8414 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8415
8416 Moves the window to the given position.
8417 """
5b5c9bc7 8418 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 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
943e8dfd 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 8436 """
5b5c9bc7 8437 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
8438
8439 def Lower(*args, **kwargs):
8440 """
8441 Lower(self)
8442
943e8dfd 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 8445 """
5b5c9bc7 8446 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
8447
8448 def SetClientSize(*args, **kwargs):
8449 """
5b5c9bc7 8450 SetClientSize(self, Size size)
d55e5bfc
RD
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 """
5b5c9bc7 8458 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8470 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
8471
8472 def SetClientRect(*args, **kwargs):
8473 """
5b5c9bc7 8474 SetClientRect(self, Rect rect)
d55e5bfc
RD
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 """
5b5c9bc7 8482 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
8483
8484 def GetPosition(*args, **kwargs):
8485 """
5b5c9bc7 8486 GetPosition(self) -> Point
d55e5bfc 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 8492 """
5b5c9bc7 8493 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
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 8503 """
5b5c9bc7 8504 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 8533 GetSize(self) -> Size
d55e5bfc
RD
8534
8535 Get the window size.
8536 """
5b5c9bc7 8537 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
8538
8539 def GetSizeTuple(*args, **kwargs):
8540 """
8541 GetSizeTuple() -> (width, height)
8542
8543 Get the window size.
8544 """
5b5c9bc7 8545 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
8546
8547 def GetRect(*args, **kwargs):
8548 """
5b5c9bc7 8549 GetRect(self) -> Rect
d55e5bfc 8550
1c71765a 8551 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc 8552 """
5b5c9bc7 8553 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
8554
8555 def GetClientSize(*args, **kwargs):
8556 """
5b5c9bc7 8557 GetClientSize(self) -> Size
d55e5bfc
RD
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 """
5b5c9bc7 8563 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8573 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
8574
8575 def GetClientAreaOrigin(*args, **kwargs):
8576 """
5b5c9bc7 8577 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
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 """
5b5c9bc7 8583 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
8584
8585 def GetClientRect(*args, **kwargs):
8586 """
5b5c9bc7 8587 GetClientRect(self) -> Rect
d55e5bfc 8588
0439c23b 8589 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 8590 """
5b5c9bc7 8591 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
8592
8593 def GetBestSize(*args, **kwargs):
8594 """
5b5c9bc7 8595 GetBestSize(self) -> Size
d55e5bfc 8596
bfddbb17 8597 This function returns the best acceptable minimal size for the
15817c7e
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 8603 """
5b5c9bc7 8604 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
8605
8606 def GetBestSizeTuple(*args, **kwargs):
8607 """
8608 GetBestSizeTuple() -> (width, height)
8609
bfddbb17 8610 This function returns the best acceptable minimal size for the
15817c7e
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 8616 """
5b5c9bc7 8617 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 8626 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 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 """
5b5c9bc7 8657 Center(self, int direction=BOTH)
d55e5bfc
RD
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 """
5b5c9bc7 8666 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
8667
8668 Centre = Center
d55e5bfc
RD
8669 def CenterOnParent(*args, **kwargs):
8670 """
5b5c9bc7 8671 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
8672
8673 Center with respect to the the parent window
8674 """
5b5c9bc7 8675 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8690 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8702 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 8718 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8719
03837c5c
RD
8720 def SetSizeHintsSz(*args, **kwargs):
8721 """
5b5c9bc7 8722 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
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 """
5b5c9bc7 8733 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
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 """
5b5c9bc7 8744 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
8745
8746 def SetVirtualSizeHintsSz(*args, **kwargs):
8747 """
5b5c9bc7 8748 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
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 """
5b5c9bc7 8755 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8756
908b74cd 8757 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
8758 """GetMaxSize(self) -> Size"""
8759 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8760
8761 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8762 """GetMinSize(self) -> Size"""
8763 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8764
8765 def SetMinSize(*args, **kwargs):
8766 """
5b5c9bc7 8767 SetMinSize(self, Size minSize)
908b74cd
RD
8768
8769 A more convenient method than `SetSizeHints` for setting just the
8770 min size.
8771 """
5b5c9bc7 8772 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8773
8774 def SetMaxSize(*args, **kwargs):
8775 """
5b5c9bc7 8776 SetMaxSize(self, Size maxSize)
908b74cd
RD
8777
8778 A more convenient method than `SetSizeHints` for setting just the
8779 max size.
8780 """
5b5c9bc7 8781 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8782
d55e5bfc
RD
8783 def GetMinWidth(*args, **kwargs):
8784 """GetMinWidth(self) -> int"""
5b5c9bc7 8785 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8786
8787 def GetMinHeight(*args, **kwargs):
8788 """GetMinHeight(self) -> int"""
5b5c9bc7 8789 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8790
8791 def GetMaxWidth(*args, **kwargs):
8792 """GetMaxWidth(self) -> int"""
5b5c9bc7 8793 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8794
8795 def GetMaxHeight(*args, **kwargs):
8796 """GetMaxHeight(self) -> int"""
5b5c9bc7 8797 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8798
d55e5bfc
RD
8799 def SetVirtualSize(*args, **kwargs):
8800 """
5b5c9bc7 8801 SetVirtualSize(self, Size size)
d55e5bfc
RD
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 """
5b5c9bc7 8807 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8817 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8818
8819 def GetVirtualSize(*args, **kwargs):
8820 """
5b5c9bc7 8821 GetVirtualSize(self) -> Size
d55e5bfc
RD
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 """
5b5c9bc7 8827 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8837 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 8849 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8850
8851 Return the largest of ClientSize and BestSize (as determined by a
8852 sizer, interior children, or other means)
8853 """
5b5c9bc7 8854 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8866 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8867
8868 def Hide(*args, **kwargs):
8869 """
8870 Hide(self) -> bool
8871
8872 Equivalent to calling Show(False).
8873 """
5b5c9bc7 8874 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8886 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8887
8888 def Disable(*args, **kwargs):
8889 """
8890 Disable(self) -> bool
8891
8892 Disables the window, same as Enable(false).
8893 """
5b5c9bc7 8894 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8902 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
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 8911 """
5b5c9bc7 8912 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc 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
15817c7e
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 8942 """
5b5c9bc7 8943 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8952 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8961 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 8970 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 8989 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8990
8991 def GetExtraStyle(*args, **kwargs):
8992 """
8993 GetExtraStyle(self) -> long
8994
8995 Returns the extra style bits for the window.
8996 """
5b5c9bc7 8997 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9007 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9023 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
9024
9025 def GetThemeEnabled(*args, **kwargs):
9026 """
9027 GetThemeEnabled(self) -> bool
9028
9029 Return the themeEnabled flag.
9030 """
5b5c9bc7 9031 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9039 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9048 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
9049
9050 def FindFocus(*args, **kwargs):
9051 """
5b5c9bc7 9052 FindFocus() -> Window
d55e5bfc
RD
9053
9054 Returns the window or control that currently has the keyboard focus,
9055 or None.
9056 """
5b5c9bc7 9057 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
9058
9059 FindFocus = staticmethod(FindFocus)
9060 def AcceptsFocus(*args, **kwargs):
9061 """
9062 AcceptsFocus(self) -> bool
9063
9064 Can this window have focus?
9065 """
5b5c9bc7 9066 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 9084 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc 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 9108 """
5b5c9bc7 9109 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 9110
bf26d883
RD
9111 def MoveAfterInTabOrder(*args, **kwargs):
9112 """
5b5c9bc7 9113 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
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 """
5b5c9bc7 9124 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
9125
9126 def MoveBeforeInTabOrder(*args, **kwargs):
9127 """
5b5c9bc7 9128 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
9129
9130 Same as `MoveAfterInTabOrder` except that it inserts this window just
9131 before win instead of putting it right after it.
9132 """
5b5c9bc7 9133 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 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 """
5b5c9bc7 9144 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
9145
9146 def GetParent(*args, **kwargs):
9147 """
5b5c9bc7 9148 GetParent(self) -> Window
d55e5bfc
RD
9149
9150 Returns the parent window of this window, or None if there isn't one.
9151 """
5b5c9bc7 9152 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
9153
9154 def GetGrandParent(*args, **kwargs):
9155 """
5b5c9bc7 9156 GetGrandParent(self) -> Window
d55e5bfc 9157
15817c7e
RD
9158 Returns the parent of the parent of this window, or None if there
9159 isn't one.
d55e5bfc 9160 """
5b5c9bc7 9161 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 9179 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
9180
9181 def Reparent(*args, **kwargs):
9182 """
5b5c9bc7 9183 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
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 """
5b5c9bc7 9191 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
9192
9193 def AddChild(*args, **kwargs):
9194 """
5b5c9bc7 9195 AddChild(self, Window child)
d55e5bfc
RD
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 """
5b5c9bc7 9200 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
9201
9202 def RemoveChild(*args, **kwargs):
9203 """
5b5c9bc7 9204 RemoveChild(self, Window child)
d55e5bfc
RD
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 """
5b5c9bc7 9210 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 9222 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
9223
9224 Find a chld of this window by window ID
9225 """
5b5c9bc7 9226 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
9227
9228 def FindWindowByName(*args, **kwargs):
9229 """
5b5c9bc7 9230 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
9231
9232 Find a child of this window by name
9233 """
5b5c9bc7 9234 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
9235
9236 def GetEventHandler(*args, **kwargs):
9237 """
5b5c9bc7 9238 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
9239
9240 Returns the event handler for this window. By default, the window is
9241 its own event handler.
9242 """
5b5c9bc7 9243 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
9244
9245 def SetEventHandler(*args, **kwargs):
9246 """
5b5c9bc7 9247 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
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
15817c7e 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 9260 """
5b5c9bc7 9261 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
9262
9263 def PushEventHandler(*args, **kwargs):
9264 """
5b5c9bc7 9265 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
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 9282 """
5b5c9bc7 9283 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
9284
9285 def PopEventHandler(*args, **kwargs):
9286 """
5b5c9bc7 9287 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
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 9292 """
5b5c9bc7 9293 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
9294
9295 def RemoveEventHandler(*args, **kwargs):
9296 """
5b5c9bc7 9297 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 9298
15817c7e 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
15817c7e
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 9304 """
5b5c9bc7 9305 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
9306
9307 def SetValidator(*args, **kwargs):
9308 """
5b5c9bc7 9309 SetValidator(self, Validator validator)
d55e5bfc
RD
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 """
5b5c9bc7 9315 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
9316
9317 def GetValidator(*args, **kwargs):
9318 """
5b5c9bc7 9319 GetValidator(self) -> Validator
d55e5bfc
RD
9320
9321 Returns a pointer to the current validator for the window, or None if
9322 there is none.
9323 """
5b5c9bc7 9324 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
9325
9326 def Validate(*args, **kwargs):
9327 """
9328 Validate(self) -> bool
9329
9330 Validates the current values of the child controls using their
15817c7e
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 9334 """
5b5c9bc7 9335 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
9336
9337 def TransferDataToWindow(*args, **kwargs):
9338 """
9339 TransferDataToWindow(self) -> bool
9340
15817c7e
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 9345 """
5b5c9bc7 9346 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
9347
9348 def TransferDataFromWindow(*args, **kwargs):
9349 """
9350 TransferDataFromWindow(self) -> bool
9351
15817c7e
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 9356 """
5b5c9bc7 9357 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
9358
9359 def InitDialog(*args, **kwargs):
9360 """
9361 InitDialog(self)
9362
15817c7e
RD
9363 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9364 to the dialog via validators.
d55e5bfc 9365 """
5b5c9bc7 9366 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
9367
9368 def SetAcceleratorTable(*args, **kwargs):
9369 """
5b5c9bc7 9370 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
9371
9372 Sets the accelerator table for this window.
9373 """
5b5c9bc7 9374 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9375
9376 def GetAcceleratorTable(*args, **kwargs):
9377 """
5b5c9bc7 9378 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
9379
9380 Gets the accelerator table for this window.
9381 """
5b5c9bc7 9382 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9396 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
9397
9398 def UnregisterHotKey(*args, **kwargs):
9399 """
9400 UnregisterHotKey(self, int hotkeyId) -> bool
9401
9402 Unregisters a system wide hotkey.
9403 """
5b5c9bc7 9404 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
9405
9406 def ConvertDialogPointToPixels(*args, **kwargs):
9407 """
5b5c9bc7 9408 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
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 """
5b5c9bc7 9417 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
9418
9419 def ConvertDialogSizeToPixels(*args, **kwargs):
9420 """
5b5c9bc7 9421 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
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 """
5b5c9bc7 9430 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
9431
9432 def DLG_PNT(*args, **kwargs):
9433 """
5b5c9bc7 9434 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
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 """
5b5c9bc7 9443 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
9444
9445 def DLG_SZE(*args, **kwargs):
9446 """
5b5c9bc7 9447 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
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 """
5b5c9bc7 9456 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
9457
9458 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
9459 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9460 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
9461
9462 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
9463 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9464 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9475 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
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
34e0a3bb
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 9495 """
5b5c9bc7 9496 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
9497
9498 def ReleaseMouse(*args, **kwargs):
9499 """
9500 ReleaseMouse(self)
9501
9502 Releases mouse input captured with wx.Window.CaptureMouse.
9503 """
5b5c9bc7 9504 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
9505
9506 def GetCapture(*args, **kwargs):
9507 """
5b5c9bc7 9508 GetCapture() -> Window
d55e5bfc
RD
9509
9510 Returns the window which currently captures the mouse or None
9511 """
5b5c9bc7 9512 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9521 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
9522
9523 def Refresh(*args, **kwargs):
9524 """
5b5c9bc7 9525 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
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 """
5b5c9bc7 9531 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
9532
9533 def RefreshRect(*args, **kwargs):
9534 """
5b5c9bc7 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 """
5b5c9bc7 9540 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9554 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9563 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
9564
9565 def Freeze(*args, **kwargs):
9566 """
9567 Freeze(self)
9568
15817c7e
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 """
5b5c9bc7 9581 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc 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
15817c7e
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 9600 """
5b5c9bc7 9601 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
9602
9603 def PrepareDC(*args, **kwargs):
9604 """
5b5c9bc7 9605 PrepareDC(self, DC dc)
d55e5bfc
RD
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 """
5b5c9bc7 9611 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 9626 GetUpdateRegion(self) -> Region
d55e5bfc
RD
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 """
5b5c9bc7 9631 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
9632
9633 def GetUpdateClientRect(*args, **kwargs):
9634 """
5b5c9bc7 9635 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
9636
9637 Get the update rectangle region bounding box in client coords.
9638 """
5b5c9bc7 9639 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9650 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
9651
9652 def IsExposedPoint(*args, **kwargs):
9653 """
5b5c9bc7 9654 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
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 """
5b5c9bc7 9661 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
9662
9663 def IsExposedRect(*args, **kwargs):
9664 """
5b5c9bc7 9665 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
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 """
5b5c9bc7 9672 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
9673
9674 def GetDefaultAttributes(*args, **kwargs):
9675 """
5b5c9bc7 9676 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 9677
15817c7e
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
a5ee0656 9682 place on the user's system, especially if it uses themes.
d55e5bfc 9683 """
5b5c9bc7 9684 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9685
9686 def GetClassDefaultAttributes(*args, **kwargs):
9687 """
5b5c9bc7 9688 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9689
15817c7e
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
a5ee0656
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
15817c7e 9697 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9698 the returned font. See `wx.Window.SetWindowVariant` for more about
9699 this.
d55e5bfc 9700 """
5b5c9bc7 9701 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9702
9703 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9704 def SetBackgroundColour(*args, **kwargs):
9705 """
5b5c9bc7 9706 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
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
a5ee0656 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 9722 """
5b5c9bc7 9723 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 9724
412d302d 9725 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
9726 """SetOwnBackgroundColour(self, Colour colour)"""
9727 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9728
9729 def SetForegroundColour(*args, **kwargs):
9730 """
5b5c9bc7 9731 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
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 """
5b5c9bc7 9738 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 9739
fa47d7a7 9740 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
9741 """SetOwnForegroundColour(self, Colour colour)"""
9742 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9743
9744 def GetBackgroundColour(*args, **kwargs):
9745 """
5b5c9bc7 9746 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
9747
9748 Returns the background colour of the window.
9749 """
5b5c9bc7 9750 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9751
9752 def GetForegroundColour(*args, **kwargs):
9753 """
5b5c9bc7 9754 GetForegroundColour(self) -> Colour
d55e5bfc
RD
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 """
5b5c9bc7 9760 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 9761
dcb8fc74
RD
9762 def InheritsBackgroundColour(*args, **kwargs):
9763 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 9764 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
9765
9766 def UseBgCol(*args, **kwargs):
9767 """UseBgCol(self) -> bool"""
5b5c9bc7 9768 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 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 """
5b5c9bc7 9791 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
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 """
5b5c9bc7 9801 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 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 """
5b5c9bc7 9816 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 9817
d55e5bfc
RD
9818 def SetCursor(*args, **kwargs):
9819 """
5b5c9bc7 9820 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
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 """
5b5c9bc7 9828 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
9829
9830 def GetCursor(*args, **kwargs):
9831 """
5b5c9bc7 9832 GetCursor(self) -> Cursor
d55e5bfc
RD
9833
9834 Return the cursor associated with this window.
9835 """
5b5c9bc7 9836 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
9837
9838 def SetFont(*args, **kwargs):
9839 """
5b5c9bc7 9840 SetFont(self, Font font) -> bool
d55e5bfc
RD
9841
9842 Sets the font for this window.
9843 """
5b5c9bc7 9844 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9845
fa47d7a7 9846 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9847 """SetOwnFont(self, Font font)"""
9848 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9849
9850 def GetFont(*args, **kwargs):
9851 """
5b5c9bc7 9852 GetFont(self) -> Font
d55e5bfc
RD
9853
9854 Returns the default font used for this window.
9855 """
5b5c9bc7 9856 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9857
9858 def SetCaret(*args, **kwargs):
9859 """
5b5c9bc7 9860 SetCaret(self, Caret caret)
d55e5bfc
RD
9861
9862 Sets the caret associated with the window.
9863 """
5b5c9bc7 9864 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9865
9866 def GetCaret(*args, **kwargs):
9867 """
5b5c9bc7 9868 GetCaret(self) -> Caret
d55e5bfc
RD
9869
9870 Returns the caret associated with the window.
9871 """
5b5c9bc7 9872 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9873
9874 def GetCharHeight(*args, **kwargs):
9875 """
9876 GetCharHeight(self) -> int
9877
9878 Get the (average) character size for the current font.
9879 """
5b5c9bc7 9880 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9881
9882 def GetCharWidth(*args, **kwargs):
9883 """
9884 GetCharWidth(self) -> int
9885
9886 Get the (average) character size for the current font.
9887 """
5b5c9bc7 9888 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9889
9890 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9891 """
9892 GetTextExtent(String string) -> (width, height)
9893
9894 Get the width and height of the text using the current font.
9895 """
5b5c9bc7 9896 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9906 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9914 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9922 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9923
9924 def ClientToScreen(*args, **kwargs):
9925 """
5b5c9bc7 9926 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9927
9928 Converts to screen coordinates from coordinates relative to this window.
9929 """
5b5c9bc7 9930 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9931
9932 def ScreenToClient(*args, **kwargs):
9933 """
5b5c9bc7 9934 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9935
9936 Converts from screen to client window coordinates.
9937 """
5b5c9bc7 9938 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9946 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9947
9948 def HitTest(*args, **kwargs):
9949 """
5b5c9bc7 9950 HitTest(self, Point pt) -> int
d55e5bfc
RD
9951
9952 Test where the given (in client coords) point lies
9953 """
5b5c9bc7 9954 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 9963 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9964
9965 def UpdateWindowUI(*args, **kwargs):
9966 """
5b5c9bc7 9967 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
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 9979 """
5b5c9bc7 9980 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9981
9982 def PopupMenuXY(*args, **kwargs):
9983 """
5b5c9bc7 9984 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9985
b0503257
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 9991 """
5b5c9bc7 9992 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9993
9994 def PopupMenu(*args, **kwargs):
9995 """
5b5c9bc7 9996 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9997
b0503257
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 10003 """
5b5c9bc7 10004 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 10018 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 10026 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
10027
10028 def DissociateHandle(*args, **kwargs):
10029 """
10030 DissociateHandle(self)
10031
10032 Dissociate the current native handle from the window
10033 """
5b5c9bc7 10034 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 10035
d55e5bfc
RD
10036 def HasScrollbar(*args, **kwargs):
10037 """
10038 HasScrollbar(self, int orient) -> bool
10039
10040 Does the window have the scrollbar for this orientation?
10041 """
5b5c9bc7 10042 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
10043
10044 def SetScrollbar(*args, **kwargs):
10045 """
15817c7e 10046 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
10047 bool refresh=True)
10048
10049 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 10050 """
5b5c9bc7 10051 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
10052
10053 def SetScrollPos(*args, **kwargs):
10054 """
10055 SetScrollPos(self, int orientation, int pos, bool refresh=True)
10056
10057 Sets the position of one of the built-in scrollbars.
10058 """
5b5c9bc7 10059 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
10060
10061 def GetScrollPos(*args, **kwargs):
10062 """
10063 GetScrollPos(self, int orientation) -> int
10064
10065 Returns the built-in scrollbar position.
10066 """
5b5c9bc7 10067 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
10068
10069 def GetScrollThumb(*args, **kwargs):
10070 """
10071 GetScrollThumb(self, int orientation) -> int
10072
10073 Returns the built-in scrollbar thumb size.
10074 """
5b5c9bc7 10075 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
10076
10077 def GetScrollRange(*args, **kwargs):
10078 """
10079 GetScrollRange(self, int orientation) -> int
10080
10081 Returns the built-in scrollbar range.
10082 """
5b5c9bc7 10083 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
10084
10085 def ScrollWindow(*args, **kwargs):
10086 """
5b5c9bc7 10087 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
10088
10089 Physically scrolls the pixels in the window and move child windows
10090 accordingly. Use this function to optimise your scrolling
10091 implementations, to minimise the area that must be redrawn. Note that
10092 it is rarely required to call this function from a user program.
d55e5bfc 10093 """
5b5c9bc7 10094 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
10095
10096 def ScrollLines(*args, **kwargs):
10097 """
10098 ScrollLines(self, int lines) -> bool
10099
10100 If the platform and window class supports it, scrolls the window by
10101 the given number of lines down, if lines is positive, or up if lines
10102 is negative. Returns True if the window was scrolled, False if it was
10103 already on top/bottom and nothing was done.
10104 """
5b5c9bc7 10105 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
10106
10107 def ScrollPages(*args, **kwargs):
10108 """
10109 ScrollPages(self, int pages) -> bool
10110
15817c7e 10111 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
10112 the given number of pages down, if pages is positive, or up if pages
10113 is negative. Returns True if the window was scrolled, False if it was
10114 already on top/bottom and nothing was done.
10115 """
5b5c9bc7 10116 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
10117
10118 def LineUp(*args, **kwargs):
10119 """
10120 LineUp(self) -> bool
10121
10122 This is just a wrapper for ScrollLines(-1).
10123 """
5b5c9bc7 10124 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
10125
10126 def LineDown(*args, **kwargs):
10127 """
10128 LineDown(self) -> bool
10129
10130 This is just a wrapper for ScrollLines(1).
10131 """
5b5c9bc7 10132 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
10133
10134 def PageUp(*args, **kwargs):
10135 """
10136 PageUp(self) -> bool
10137
10138 This is just a wrapper for ScrollPages(-1).
10139 """
5b5c9bc7 10140 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
10141
10142 def PageDown(*args, **kwargs):
10143 """
10144 PageDown(self) -> bool
10145
10146 This is just a wrapper for ScrollPages(1).
10147 """
5b5c9bc7 10148 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
10149
10150 def SetHelpText(*args, **kwargs):
10151 """
5b5c9bc7 10152 SetHelpText(self, String text)
d55e5bfc
RD
10153
10154 Sets the help text to be used as context-sensitive help for this
10155 window. Note that the text is actually stored by the current
f52cbe90 10156 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 10157 """
5b5c9bc7 10158 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
10159
10160 def SetHelpTextForId(*args, **kwargs):
10161 """
5b5c9bc7 10162 SetHelpTextForId(self, String text)
d55e5bfc
RD
10163
10164 Associate this help text with all windows with the same id as this
10165 one.
10166 """
5b5c9bc7 10167 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc 10168
b850e7f3
RD
10169 def GetHelpTextAtPoint(*args, **kwargs):
10170 """
10171 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
10172
10173 Get the help string associated with the given position in this window.
10174
10175 Notice that pt may be invalid if event origin is keyboard or unknown
10176 and this method should return the global window help text then
10177
10178 """
10179 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
10180
d55e5bfc
RD
10181 def GetHelpText(*args, **kwargs):
10182 """
5b5c9bc7 10183 GetHelpText(self) -> String
d55e5bfc
RD
10184
10185 Gets the help text to be used as context-sensitive help for this
10186 window. Note that the text is actually stored by the current
f52cbe90 10187 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 10188 """
5b5c9bc7 10189 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
10190
10191 def SetToolTipString(*args, **kwargs):
10192 """
5b5c9bc7 10193 SetToolTipString(self, String tip)
d55e5bfc
RD
10194
10195 Attach a tooltip to the window.
10196 """
5b5c9bc7 10197 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
10198
10199 def SetToolTip(*args, **kwargs):
10200 """
5b5c9bc7 10201 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
10202
10203 Attach a tooltip to the window.
10204 """
5b5c9bc7 10205 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
10206
10207 def GetToolTip(*args, **kwargs):
10208 """
5b5c9bc7 10209 GetToolTip(self) -> ToolTip
d55e5bfc
RD
10210
10211 get the associated tooltip or None if none
10212 """
5b5c9bc7 10213 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
10214
10215 def SetDropTarget(*args, **kwargs):
10216 """
5b5c9bc7 10217 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
10218
10219 Associates a drop target with this window. If the window already has
10220 a drop target, it is deleted.
10221 """
5b5c9bc7 10222 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
10223
10224 def GetDropTarget(*args, **kwargs):
10225 """
5b5c9bc7 10226 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
10227
10228 Returns the associated drop target, which may be None.
10229 """
5b5c9bc7 10230 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 10231
5ba5649b
RD
10232 def DragAcceptFiles(*args, **kwargs):
10233 """
10234 DragAcceptFiles(self, bool accept)
10235
10236 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10237 Only functional on Windows.
10238 """
10239 return _core_.Window_DragAcceptFiles(*args, **kwargs)
10240
d55e5bfc
RD
10241 def SetConstraints(*args, **kwargs):
10242 """
5b5c9bc7 10243 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
10244
10245 Sets the window to have the given layout constraints. If an existing
10246 layout constraints object is already owned by the window, it will be
10247 deleted. Pass None to disassociate and delete the window's current
10248 constraints.
10249
10250 You must call SetAutoLayout to tell a window to use the constraints
10251 automatically in its default EVT_SIZE handler; otherwise, you must
10252 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10253 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10254 effect.
10255 """
5b5c9bc7 10256 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
10257
10258 def GetConstraints(*args, **kwargs):
10259 """
5b5c9bc7 10260 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
10261
10262 Returns a pointer to the window's layout constraints, or None if there
10263 are none.
10264 """
5b5c9bc7 10265 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
10266
10267 def SetAutoLayout(*args, **kwargs):
10268 """
10269 SetAutoLayout(self, bool autoLayout)
10270
10271 Determines whether the Layout function will be called automatically
b1fcee84
RD
10272 when the window is resized. lease note that this only happens for the
10273 windows usually used to contain children, namely `wx.Panel` and
10274 `wx.TopLevelWindow` (and the classes deriving from them).
10275
10276 This method is called implicitly by `SetSizer` but if you use
10277 `SetConstraints` you should call it manually or otherwise the window
10278 layout won't be correctly updated when its size changes.
d55e5bfc 10279 """
5b5c9bc7 10280 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
10281
10282 def GetAutoLayout(*args, **kwargs):
10283 """
10284 GetAutoLayout(self) -> bool
10285
10286 Returns the current autoLayout setting
10287 """
5b5c9bc7 10288 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
10289
10290 def Layout(*args, **kwargs):
10291 """
10292 Layout(self) -> bool
10293
10294 Invokes the constraint-based layout algorithm or the sizer-based
10295 algorithm for this window. See SetAutoLayout: when auto layout is on,
10296 this function gets called automatically by the default EVT_SIZE
10297 handler when the window is resized.
10298 """
5b5c9bc7 10299 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
10300
10301 def SetSizer(*args, **kwargs):
10302 """
5b5c9bc7 10303 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
10304
10305 Sets the window to have the given layout sizer. The window will then
10306 own the object, and will take care of its deletion. If an existing
10307 layout sizer object is already owned by the window, it will be deleted
10308 if the deleteOld parameter is true. Note that this function will also
10309 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 10310 non-None, and False otherwise.
d55e5bfc 10311 """
5b5c9bc7 10312 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
10313
10314 def SetSizerAndFit(*args, **kwargs):
10315 """
5b5c9bc7 10316 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
10317
10318 The same as SetSizer, except it also sets the size hints for the
10319 window based on the sizer's minimum size.
10320 """
5b5c9bc7 10321 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
10322
10323 def GetSizer(*args, **kwargs):
10324 """
5b5c9bc7 10325 GetSizer(self) -> Sizer
d55e5bfc
RD
10326
10327 Return the sizer associated with the window by a previous call to
10328 SetSizer or None if there isn't one.
10329 """
5b5c9bc7 10330 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
10331
10332 def SetContainingSizer(*args, **kwargs):
10333 """
5b5c9bc7 10334 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
10335
10336 This normally does not need to be called by application code. It is
10337 called internally when a window is added to a sizer, and is used so
10338 the window can remove itself from the sizer when it is destroyed.
10339 """
5b5c9bc7 10340 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
10341
10342 def GetContainingSizer(*args, **kwargs):
10343 """
5b5c9bc7 10344 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
10345
10346 Return the sizer that this window is a member of, if any, otherwise None.
10347 """
5b5c9bc7 10348 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
10349
10350 def InheritAttributes(*args, **kwargs):
10351 """
10352 InheritAttributes(self)
10353
15817c7e
RD
10354 This function is (or should be, in case of custom controls) called
10355 during window creation to intelligently set up the window visual
10356 attributes, that is the font and the foreground and background
10357 colours.
10358
10359 By 'intelligently' the following is meant: by default, all windows use
10360 their own default attributes. However if some of the parent's
10361 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10362 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
10363 explicitly set for this window itself, then this window takes the same
10364 value as used by the parent. In addition, if the window overrides
10365 ShouldInheritColours to return false, the colours will not be changed
10366 no matter what and only the font might.
10367
a7bb0a9d
RD
10368 This rather complicated logic is necessary in order to accommodate the
10369 different usage scenarios. The most common one is when all default
15817c7e
RD
10370 attributes are used and in this case, nothing should be inherited as
10371 in modern GUIs different controls use different fonts (and colours)
10372 than their siblings so they can't inherit the same value from the
10373 parent. However it was also deemed desirable to allow to simply change
10374 the attributes of all children at once by just changing the font or
10375 colour of their common parent, hence in this case we do inherit the
10376 parents attributes.
10377
d55e5bfc 10378 """
5b5c9bc7 10379 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
10380
10381 def ShouldInheritColours(*args, **kwargs):
10382 """
10383 ShouldInheritColours(self) -> bool
10384
10385 Return true from here to allow the colours of this window to be
15817c7e
RD
10386 changed by InheritAttributes, returning false forbids inheriting them
10387 from the parent window.
d55e5bfc 10388
15817c7e
RD
10389 The base class version returns false, but this method is overridden in
10390 wxControl where it returns true.
d55e5bfc 10391 """
5b5c9bc7 10392 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc 10393
fc46b7f3
RD
10394 def CanSetTransparent(*args, **kwargs):
10395 """
10396 CanSetTransparent(self) -> bool
10397
10398 Returns ``True`` if the platform supports setting the transparency for
10399 this window. Note that this method will err on the side of caution,
10400 so it is possible that this will return ``False`` when it is in fact
10401 possible to set the transparency.
10402
10403 NOTE: On X-windows systems the X server must have the composite
10404 extension loaded, and there must be a composite manager program (such
10405 as xcompmgr) running.
10406 """
10407 return _core_.Window_CanSetTransparent(*args, **kwargs)
10408
10409 def SetTransparent(*args, **kwargs):
10410 """
10411 SetTransparent(self, byte alpha) -> bool
10412
10413 Attempt to set the transparency of this window to the ``alpha`` value,
10414 returns True on success. The ``alpha`` value is an integer in the
10415 range of 0 to 255, where 0 is fully transparent and 255 is fully
10416 opaque.
10417 """
10418 return _core_.Window_SetTransparent(*args, **kwargs)
10419
d55e5bfc
RD
10420 def PostCreate(self, pre):
10421 """
10422 Phase 3 of the 2-phase create <wink!>
10423 Call this method after precreating the window with the 2-phase create method.
10424 """
10425 self.this = pre.this
10426 self.thisown = pre.thisown
10427 pre.thisown = 0
10428 if hasattr(self, '_setOORInfo'):
4976f996
RD
10429 try:
10430 self._setOORInfo(self)
10431 except TypeError:
10432 pass
d55e5bfc 10433 if hasattr(self, '_setCallbackInfo'):
4976f996
RD
10434 try:
10435 self._setCallbackInfo(self, pre.__class__)
10436 except TypeError:
10437 pass
d55e5bfc 10438
7e08d4ef 10439 def SendSizeEvent(self):
92515dfc 10440 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 10441
2bf58437 10442 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
2bf58437
RD
10443 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10444 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10445 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
580080c5 10446 EffectiveMinSize = property(GetEffectiveMinSize,doc="See `GetEffectiveMinSize`")
2bf58437
RD
10447 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10448 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10449 Border = property(GetBorder,doc="See `GetBorder`")
10450 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10451 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10452 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10453 Children = property(GetChildren,doc="See `GetChildren`")
10454 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10455 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10456 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10457 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10458 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10459 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10460 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10461 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10462 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10463 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10464 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10465 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
2bf58437 10466 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
cbfc9df6 10467 TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`")
2bf58437
RD
10468 Handle = property(GetHandle,doc="See `GetHandle`")
10469 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
2bf58437
RD
10470 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10471 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
994453b8 10472 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
2bf58437
RD
10473 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10474 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10475 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10476 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10477 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10478 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10479 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10480 Parent = property(GetParent,doc="See `GetParent`")
10481 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10482 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10483 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10484 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
2bf58437
RD
10485 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10486 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
2bf58437
RD
10487 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10488 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10489 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10490 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10491 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10492 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10493 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10494 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10495 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
ac5d357a
RD
10496 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10497 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10498 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
2131d850 10499_core_.Window_swigregister(Window)
d55e5bfc
RD
10500
10501def PreWindow(*args, **kwargs):
10502 """
5b5c9bc7 10503 PreWindow() -> Window
d55e5bfc
RD
10504
10505 Precreate a Window for 2-phase creation.
10506 """
5b5c9bc7 10507 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
10508 return val
10509
1bd55598
RD
10510def Window_NewControlId(*args):
10511 """
5b5c9bc7 10512 Window_NewControlId() -> int
d55e5bfc
RD
10513
10514 Generate a control id for the controls which were not given one.
10515 """
1bd55598 10516 return _core_.Window_NewControlId(*args)
d55e5bfc 10517
5b5c9bc7 10518def Window_NextControlId(*args, **kwargs):
1bd55598 10519 """
5b5c9bc7 10520 Window_NextControlId(int winid) -> int
d55e5bfc
RD
10521
10522 Get the id of the control following the one with the given
15817c7e 10523 autogenerated) id
d55e5bfc 10524 """
1bd55598 10525 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 10526
5b5c9bc7 10527def Window_PrevControlId(*args, **kwargs):
1bd55598 10528 """
5b5c9bc7 10529 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
10530
10531 Get the id of the control preceding the one with the given
15817c7e 10532 autogenerated) id
d55e5bfc 10533 """
1bd55598 10534 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 10535
1bd55598
RD
10536def Window_FindFocus(*args):
10537 """
5b5c9bc7 10538 Window_FindFocus() -> Window
d55e5bfc
RD
10539
10540 Returns the window or control that currently has the keyboard focus,
10541 or None.
10542 """
1bd55598 10543 return _core_.Window_FindFocus(*args)
d55e5bfc 10544
1bd55598
RD
10545def Window_GetCapture(*args):
10546 """
5b5c9bc7 10547 Window_GetCapture() -> Window
d55e5bfc
RD
10548
10549 Returns the window which currently captures the mouse or None
10550 """
1bd55598 10551 return _core_.Window_GetCapture(*args)
d55e5bfc 10552
5b5c9bc7 10553def Window_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 10554 """
5b5c9bc7 10555 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 10556
15817c7e
RD
10557 Get the default attributes for this class. This is useful if you want
10558 to use the same font or colour in your own control as in a standard
10559 control -- which is a much better idea than hard coding specific
a5ee0656
RD
10560 colours or fonts which might look completely out of place on the
10561 user's system, especially if it uses themes.
d55e5bfc
RD
10562
10563 The variant parameter is only relevant under Mac currently and is
15817c7e 10564 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
10565 the returned font. See `wx.Window.SetWindowVariant` for more about
10566 this.
d55e5bfc 10567 """
1bd55598 10568 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10569
10570def DLG_PNT(win, point_or_x, y=None):
10571 """
10572 Convenience function for converting a Point or (x,y) in
10573 dialog units to pixel units.
10574 """
10575 if y is None:
10576 return win.ConvertDialogPointToPixels(point_or_x)
10577 else:
10578 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10579
10580def DLG_SZE(win, size_width, height=None):
10581 """
10582 Convenience function for converting a Size or (w,h) in
10583 dialog units to pixel units.
10584 """
10585 if height is None:
10586 return win.ConvertDialogSizeToPixels(size_width)
10587 else:
10588 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10589
10590
5b5c9bc7 10591def FindWindowById(*args, **kwargs):
1bd55598 10592 """
5b5c9bc7 10593 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
10594
10595 Find the first window in the application with the given id. If parent
10596 is None, the search will start from all top-level frames and dialog
10597 boxes; if non-None, the search will be limited to the given window
10598 hierarchy. The search is recursive in both cases.
10599 """
1bd55598 10600 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 10601
5b5c9bc7 10602def FindWindowByName(*args, **kwargs):
1bd55598 10603 """
5b5c9bc7 10604 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
10605
10606 Find a window by its name (as given in a window constructor or Create
10607 function call). If parent is None, the search will start from all
10608 top-level frames and dialog boxes; if non-None, the search will be
10609 limited to the given window hierarchy. The search is recursive in both
10610 cases.
10611
10612 If no window with such name is found, wx.FindWindowByLabel is called.
10613 """
1bd55598 10614 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 10615
5b5c9bc7 10616def FindWindowByLabel(*args, **kwargs):
1bd55598 10617 """
5b5c9bc7 10618 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
10619
10620 Find a window by its label. Depending on the type of window, the label
10621 may be a window title or panel item label. If parent is None, the
10622 search will start from all top-level frames and dialog boxes; if
10623 non-None, the search will be limited to the given window
10624 hierarchy. The search is recursive in both cases.
10625 """
1bd55598 10626 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 10627
5b5c9bc7 10628def Window_FromHWND(*args, **kwargs):
1bd55598
RD
10629 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10630 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 10631
1bd55598
RD
10632def GetTopLevelWindows(*args):
10633 """
3215336e
RD
10634 GetTopLevelWindows() -> PyObject
10635
10636 Returns a list of the the application's top-level windows, (frames,
10637 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10638 by wxWidgets, and so it is only valid as long as no top-level windows
10639 are closed or new top-level windows are created.
10640
10641 """
1bd55598 10642 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
10643#---------------------------------------------------------------------------
10644
5b5c9bc7
RD
10645class Validator(EvtHandler):
10646 """Proxy of C++ Validator class"""
1bd55598
RD
10647 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10648 __repr__ = _swig_repr
10649 def __init__(self, *args, **kwargs):
5b5c9bc7 10650 """__init__(self) -> Validator"""
1bd55598 10651 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
10652 self._setOORInfo(self)
10653
10654 def Clone(*args, **kwargs):
5b5c9bc7
RD
10655 """Clone(self) -> Validator"""
10656 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
10657
10658 def Validate(*args, **kwargs):
5b5c9bc7
RD
10659 """Validate(self, Window parent) -> bool"""
10660 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
10661
10662 def TransferToWindow(*args, **kwargs):
10663 """TransferToWindow(self) -> bool"""
5b5c9bc7 10664 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
10665
10666 def TransferFromWindow(*args, **kwargs):
10667 """TransferFromWindow(self) -> bool"""
5b5c9bc7 10668 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
10669
10670 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
10671 """GetWindow(self) -> Window"""
10672 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
10673
10674 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
10675 """SetWindow(self, Window window)"""
10676 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
10677
10678 def IsSilent(*args, **kwargs):
d6c14a4c 10679 """IsSilent() -> bool"""
5b5c9bc7 10680 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
10681
10682 IsSilent = staticmethod(IsSilent)
10683 def SetBellOnError(*args, **kwargs):
d6c14a4c 10684 """SetBellOnError(int doIt=True)"""
5b5c9bc7 10685 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
10686
10687 SetBellOnError = staticmethod(SetBellOnError)
dba7934c 10688 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 10689_core_.Validator_swigregister(Validator)
d55e5bfc 10690
1bd55598
RD
10691def Validator_IsSilent(*args):
10692 """Validator_IsSilent() -> bool"""
10693 return _core_.Validator_IsSilent(*args)
d55e5bfc 10694
5b5c9bc7 10695def Validator_SetBellOnError(*args, **kwargs):
1bd55598
RD
10696 """Validator_SetBellOnError(int doIt=True)"""
10697 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 10698
5b5c9bc7
RD
10699class PyValidator(Validator):
10700 """Proxy of C++ PyValidator class"""
1bd55598
RD
10701 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10702 __repr__ = _swig_repr
10703 def __init__(self, *args, **kwargs):
5b5c9bc7 10704 """__init__(self) -> PyValidator"""
1bd55598 10705 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
c25f90f6 10706 self._setOORInfo(self);PyValidator._setCallbackInfo(self, self, PyValidator)
d55e5bfc
RD
10707
10708 def _setCallbackInfo(*args, **kwargs):
c25f90f6 10709 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
5b5c9bc7 10710 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc 10711
2131d850 10712_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
10713
10714#---------------------------------------------------------------------------
10715
5b5c9bc7
RD
10716class Menu(EvtHandler):
10717 """Proxy of C++ Menu class"""
1bd55598
RD
10718 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10719 __repr__ = _swig_repr
10720 def __init__(self, *args, **kwargs):
5b5c9bc7 10721 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
1bd55598 10722 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
10723 self._setOORInfo(self)
10724
10725 def Append(*args, **kwargs):
ac5d357a
RD
10726 """
10727 Append(self, int id, String text=EmptyString, String help=EmptyString,
10728 int kind=ITEM_NORMAL) -> MenuItem
10729 """
5b5c9bc7 10730 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
10731
10732 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
10733 """AppendSeparator(self) -> MenuItem"""
10734 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
10735
10736 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
10737 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10738 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
10739
10740 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
10741 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10742 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
10743
10744 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
10745 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10746 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc 10747
da91cb0f
RD
10748 def AppendSubMenu(*args, **kwargs):
10749 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10750 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10751
d55e5bfc 10752 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
10753 """AppendItem(self, MenuItem item) -> MenuItem"""
10754 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc 10755
d55e5bfc 10756 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
10757 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10758 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc 10759
1bd55598
RD
10760 def PrependItem(*args, **kwargs):
10761 """PrependItem(self, MenuItem item) -> MenuItem"""
10762 return _core_.Menu_PrependItem(*args, **kwargs)
10763
10764 def Break(*args, **kwargs):
10765 """Break(self)"""
10766 return _core_.Menu_Break(*args, **kwargs)
10767
d55e5bfc
RD
10768 def Insert(*args, **kwargs):
10769 """
ac5d357a 10770 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
5b5c9bc7 10771 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 10772 """
5b5c9bc7 10773 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
10774
10775 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
10776 """InsertSeparator(self, size_t pos) -> MenuItem"""
10777 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
10778
10779 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
10780 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10781 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
10782
10783 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
10784 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10785 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
10786
10787 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
10788 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10789 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc 10790
d55e5bfc 10791 def Prepend(*args, **kwargs):
ac5d357a
RD
10792 """
10793 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10794 int kind=ITEM_NORMAL) -> MenuItem
10795 """
5b5c9bc7 10796 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
10797
10798 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
10799 """PrependSeparator(self) -> MenuItem"""
10800 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
10801
10802 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
10803 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10804 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
10805
10806 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
10807 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10808 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
10809
10810 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
10811 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10812 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
10813
10814 def Remove(*args, **kwargs):
5b5c9bc7
RD
10815 """Remove(self, int id) -> MenuItem"""
10816 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc 10817
59ccbf7f 10818 def RemoveItem(self, item):
5b5c9bc7 10819 """RemoveItem(self, MenuItem item) -> MenuItem"""
59ccbf7f
RD
10820 #// The return object is always the parameter, so return that
10821 #// proxy instead of the new one
10822 val = _core_.Menu_RemoveItem(self, item)
10823 item.this.own(val.this.own())
10824 val.this.disown()
10825 return item
10826
d55e5bfc
RD
10827
10828 def Delete(*args, **kwargs):
10829 """Delete(self, int id) -> bool"""
5b5c9bc7 10830 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
10831
10832 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
10833 """DeleteItem(self, MenuItem item) -> bool"""
10834 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
10835
10836 def Destroy(*args, **kwargs):
10837 """
10838 Destroy(self)
10839
10840 Deletes the C++ object this Python object is a proxy for.
10841 """
b39fe951
RD
10842 args[0].this.own(False)
10843 return _core_.Menu_Destroy(*args, **kwargs)
d55e5bfc
RD
10844
10845 def DestroyId(*args, **kwargs):
b39fe951
RD
10846 """DestroyId(self, int id) -> bool"""
10847 return _core_.Menu_DestroyId(*args, **kwargs)
d55e5bfc
RD
10848
10849 def DestroyItem(*args, **kwargs):
b39fe951
RD
10850 """DestroyItem(self, MenuItem item) -> bool"""
10851 return _core_.Menu_DestroyItem(*args, **kwargs)
d55e5bfc
RD
10852
10853 def GetMenuItemCount(*args, **kwargs):
10854 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 10855 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
10856
10857 def GetMenuItems(*args, **kwargs):
10858 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 10859 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
10860
10861 def FindItem(*args, **kwargs):
5b5c9bc7
RD
10862 """FindItem(self, String item) -> int"""
10863 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
10864
10865 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10866 """FindItemById(self, int id) -> MenuItem"""
10867 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
10868
10869 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
10870 """FindItemByPosition(self, size_t position) -> MenuItem"""
10871 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
10872
10873 def Enable(*args, **kwargs):
10874 """Enable(self, int id, bool enable)"""
5b5c9bc7 10875 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
10876
10877 def IsEnabled(*args, **kwargs):
10878 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10879 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10880
10881 def Check(*args, **kwargs):
10882 """Check(self, int id, bool check)"""
5b5c9bc7 10883 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
10884
10885 def IsChecked(*args, **kwargs):
10886 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10887 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
10888
10889 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10890 """SetLabel(self, int id, String label)"""
10891 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
10892
10893 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10894 """GetLabel(self, int id) -> String"""
10895 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
10896
10897 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10898 """SetHelpString(self, int id, String helpString)"""
10899 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10900
10901 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10902 """GetHelpString(self, int id) -> String"""
10903 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10904
10905 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
10906 """SetTitle(self, String title)"""
10907 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
10908
10909 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
10910 """GetTitle(self) -> String"""
10911 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
10912
10913 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10914 """SetEventHandler(self, EvtHandler handler)"""
10915 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
10916
10917 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10918 """GetEventHandler(self) -> EvtHandler"""
10919 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
10920
10921 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10922 """SetInvokingWindow(self, Window win)"""
10923 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10924
10925 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10926 """GetInvokingWindow(self) -> Window"""
10927 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10928
10929 def GetStyle(*args, **kwargs):
10930 """GetStyle(self) -> long"""
5b5c9bc7 10931 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
10932
10933 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10934 """UpdateUI(self, EvtHandler source=None)"""
10935 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10936
10937 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10938 """GetMenuBar(self) -> MenuBar"""
10939 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10940
10941 def Attach(*args, **kwargs):
10942 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10943 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10944
10945 def Detach(*args, **kwargs):
10946 """Detach(self)"""
5b5c9bc7 10947 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10948
10949 def IsAttached(*args, **kwargs):
10950 """IsAttached(self) -> bool"""
5b5c9bc7 10951 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10952
10953 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10954 """SetParent(self, Menu parent)"""
10955 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10956
10957 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10958 """GetParent(self) -> Menu"""
10959 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc 10960
57332a5a
RD
10961 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10962 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10963 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10964 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10965 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10966 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10967 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10968 Style = property(GetStyle,doc="See `GetStyle`")
10969 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
2131d850 10970_core_.Menu_swigregister(Menu)
5b5c9bc7 10971DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10972
10973#---------------------------------------------------------------------------
10974
5b5c9bc7
RD
10975class MenuBar(Window):
10976 """Proxy of C++ MenuBar class"""
1bd55598
RD
10977 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10978 __repr__ = _swig_repr
10979 def __init__(self, *args, **kwargs):
5b5c9bc7 10980 """__init__(self, long style=0) -> MenuBar"""
1bd55598 10981 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10982 self._setOORInfo(self)
10983
10984 def Append(*args, **kwargs):
5b5c9bc7
RD
10985 """Append(self, Menu menu, String title) -> bool"""
10986 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10987
10988 def Insert(*args, **kwargs):
5b5c9bc7
RD
10989 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10990 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10991
10992 def GetMenuCount(*args, **kwargs):
10993 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10994 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10995
10996 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10997 """GetMenu(self, size_t pos) -> Menu"""
10998 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10999
11000 def Replace(*args, **kwargs):
5b5c9bc7
RD
11001 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
11002 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
11003
11004 def Remove(*args, **kwargs):
5b5c9bc7
RD
11005 """Remove(self, size_t pos) -> Menu"""
11006 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
11007
11008 def EnableTop(*args, **kwargs):
11009 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 11010 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
11011
11012 def IsEnabledTop(*args, **kwargs):
11013 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 11014 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
11015
11016 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
11017 """SetLabelTop(self, size_t pos, String label)"""
11018 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
11019
11020 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
11021 """GetLabelTop(self, size_t pos) -> String"""
11022 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
11023
11024 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
11025 """FindMenuItem(self, String menu, String item) -> int"""
11026 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
11027
11028 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
11029 """FindItemById(self, int id) -> MenuItem"""
11030 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
11031
11032 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
11033 """FindMenu(self, String title) -> int"""
11034 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
11035
11036 def Enable(*args, **kwargs):
11037 """Enable(self, int id, bool enable)"""
5b5c9bc7 11038 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
11039
11040 def Check(*args, **kwargs):
11041 """Check(self, int id, bool check)"""
5b5c9bc7 11042 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
11043
11044 def IsChecked(*args, **kwargs):
11045 """IsChecked(self, int id) -> bool"""
5b5c9bc7 11046 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
11047
11048 def IsEnabled(*args, **kwargs):
11049 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 11050 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
11051
11052 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
11053 """SetLabel(self, int id, String label)"""
11054 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
11055
11056 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
11057 """GetLabel(self, int id) -> String"""
11058 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
11059
11060 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
11061 """SetHelpString(self, int id, String helpString)"""
11062 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
11063
11064 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
11065 """GetHelpString(self, int id) -> String"""
11066 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
11067
11068 def GetFrame(*args, **kwargs):
11069 """GetFrame(self) -> wxFrame"""
5b5c9bc7 11070 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
11071
11072 def IsAttached(*args, **kwargs):
11073 """IsAttached(self) -> bool"""
5b5c9bc7 11074 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
11075
11076 def Attach(*args, **kwargs):
11077 """Attach(self, wxFrame frame)"""
5b5c9bc7 11078 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
11079
11080 def Detach(*args, **kwargs):
11081 """Detach(self)"""
5b5c9bc7 11082 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 11083
587d0f36
RD
11084 def UpdateMenus(*args, **kwargs):
11085 """UpdateMenus(self)"""
11086 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
11087
4f433fef
RD
11088 def SetAutoWindowMenu(*args, **kwargs):
11089 """SetAutoWindowMenu(bool enable)"""
11090 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
11091
11092 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
11093 def GetAutoWindowMenu(*args, **kwargs):
11094 """GetAutoWindowMenu() -> bool"""
11095 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
11096
11097 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
ac5d357a
RD
11098 def GetMenus(self):
11099 """Return a list of (menu, label) items for the menus in the MenuBar. """
11100 return [(self.GetMenu(i), self.GetLabelTop(i))
11101 for i in range(self.GetMenuCount())]
11102
11103 def SetMenus(self, items):
11104 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
11105 for i in range(self.GetMenuCount()-1, -1, -1):
11106 self.Remove(i)
11107 for m, l in items:
11108 self.Append(m, l)
11109
57332a5a 11110 Frame = property(GetFrame,doc="See `GetFrame`")
57332a5a
RD
11111 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
11112 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
2131d850 11113_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 11114
4f433fef 11115def MenuBar_SetAutoWindowMenu(*args, **kwargs):
1bd55598
RD
11116 """MenuBar_SetAutoWindowMenu(bool enable)"""
11117 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 11118
1bd55598
RD
11119def MenuBar_GetAutoWindowMenu(*args):
11120 """MenuBar_GetAutoWindowMenu() -> bool"""
11121 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 11122
d55e5bfc
RD
11123#---------------------------------------------------------------------------
11124
5b5c9bc7
RD
11125class MenuItem(Object):
11126 """Proxy of C++ MenuItem class"""
1bd55598
RD
11127 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11128 __repr__ = _swig_repr
11129 def __init__(self, *args, **kwargs):
d55e5bfc 11130 """
89d1e2ee 11131 __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString,
5b5c9bc7
RD
11132 String help=EmptyString, int kind=ITEM_NORMAL,
11133 Menu subMenu=None) -> MenuItem
d55e5bfc 11134 """
1bd55598
RD
11135 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
11136 __swig_destroy__ = _core_.delete_MenuItem
11137 __del__ = lambda self : None;
89d1e2ee 11138 def Destroy(self): pass
d55e5bfc 11139 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
11140 """GetMenu(self) -> Menu"""
11141 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
11142
11143 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
11144 """SetMenu(self, Menu menu)"""
11145 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
11146
11147 def SetId(*args, **kwargs):
11148 """SetId(self, int id)"""
5b5c9bc7 11149 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
11150
11151 def GetId(*args, **kwargs):
11152 """GetId(self) -> int"""
5b5c9bc7 11153 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
11154
11155 def IsSeparator(*args, **kwargs):
11156 """IsSeparator(self) -> bool"""
5b5c9bc7 11157 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
11158
11159 def SetText(*args, **kwargs):
5b5c9bc7
RD
11160 """SetText(self, String str)"""
11161 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
11162
11163 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
11164 """GetLabel(self) -> String"""
11165 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
11166
11167 def GetText(*args, **kwargs):
5b5c9bc7
RD
11168 """GetText(self) -> String"""
11169 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
11170
11171 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
11172 """GetLabelFromText(String text) -> String"""
11173 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
11174
11175 GetLabelFromText = staticmethod(GetLabelFromText)
11176 def GetKind(*args, **kwargs):
11177 """GetKind(self) -> int"""
5b5c9bc7 11178 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
11179
11180 def SetKind(*args, **kwargs):
11181 """SetKind(self, int kind)"""
5b5c9bc7 11182 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
11183
11184 def SetCheckable(*args, **kwargs):
11185 """SetCheckable(self, bool checkable)"""
5b5c9bc7 11186 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
11187
11188 def IsCheckable(*args, **kwargs):
11189 """IsCheckable(self) -> bool"""
5b5c9bc7 11190 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
11191
11192 def IsSubMenu(*args, **kwargs):
11193 """IsSubMenu(self) -> bool"""
5b5c9bc7 11194 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
11195
11196 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
11197 """SetSubMenu(self, Menu menu)"""
11198 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
11199
11200 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
11201 """GetSubMenu(self) -> Menu"""
11202 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
11203
11204 def Enable(*args, **kwargs):
11205 """Enable(self, bool enable=True)"""
5b5c9bc7 11206 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
11207
11208 def IsEnabled(*args, **kwargs):
11209 """IsEnabled(self) -> bool"""
5b5c9bc7 11210 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
11211
11212 def Check(*args, **kwargs):
11213 """Check(self, bool check=True)"""
5b5c9bc7 11214 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
11215
11216 def IsChecked(*args, **kwargs):
11217 """IsChecked(self) -> bool"""
5b5c9bc7 11218 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
11219
11220 def Toggle(*args, **kwargs):
11221 """Toggle(self)"""
5b5c9bc7 11222 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
11223
11224 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
11225 """SetHelp(self, String str)"""
11226 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
11227
11228 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
11229 """GetHelp(self) -> String"""
11230 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
11231
11232 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
11233 """GetAccel(self) -> AcceleratorEntry"""
11234 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
11235
11236 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
11237 """SetAccel(self, AcceleratorEntry accel)"""
11238 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 11239
32fe5131
RD
11240 def SetBitmap(*args, **kwargs):
11241 """SetBitmap(self, Bitmap bitmap)"""
11242 return _core_.MenuItem_SetBitmap(*args, **kwargs)
11243
11244 def GetBitmap(*args, **kwargs):
11245 """GetBitmap(self) -> Bitmap"""
11246 return _core_.MenuItem_GetBitmap(*args, **kwargs)
11247
c1280d1e 11248 def SetFont(*args, **kwargs):
5b5c9bc7
RD
11249 """SetFont(self, Font font)"""
11250 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
11251
11252 def GetFont(*args, **kwargs):
5b5c9bc7
RD
11253 """GetFont(self) -> Font"""
11254 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
11255
11256 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
11257 """SetTextColour(self, Colour colText)"""
11258 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
11259
11260 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
11261 """GetTextColour(self) -> Colour"""
11262 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
11263
11264 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
11265 """SetBackgroundColour(self, Colour colBack)"""
11266 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
11267
11268 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
11269 """GetBackgroundColour(self) -> Colour"""
11270 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
11271
11272 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
11273 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11274 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
11275
11276 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
11277 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11278 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
11279
11280 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
11281 """GetDisabledBitmap(self) -> Bitmap"""
11282 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
11283
11284 def SetMarginWidth(*args, **kwargs):
11285 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 11286 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
11287
11288 def GetMarginWidth(*args, **kwargs):
11289 """GetMarginWidth(self) -> int"""
5b5c9bc7 11290 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 11291
d55e5bfc 11292 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 11293 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 11294 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
11295
11296 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
11297 def IsOwnerDrawn(*args, **kwargs):
11298 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 11299 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
11300
11301 def SetOwnerDrawn(*args, **kwargs):
11302 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 11303 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
11304
11305 def ResetOwnerDrawn(*args, **kwargs):
11306 """ResetOwnerDrawn(self)"""
5b5c9bc7 11307 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 11308
57332a5a
RD
11309 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
11310 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
11311 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
11312 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
11313 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
11314 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
11315 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
11316 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
11317 Label = property(GetLabel,doc="See `GetLabel`")
11318 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
11319 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
11320 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
11321 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
11322 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
2131d850 11323_core_.MenuItem_swigregister(MenuItem)
d55e5bfc 11324
5b5c9bc7 11325def MenuItem_GetLabelFromText(*args, **kwargs):
1bd55598
RD
11326 """MenuItem_GetLabelFromText(String text) -> String"""
11327 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 11328
1bd55598
RD
11329def MenuItem_GetDefaultMarginWidth(*args):
11330 """MenuItem_GetDefaultMarginWidth() -> int"""
11331 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
11332
11333#---------------------------------------------------------------------------
11334
5b5c9bc7 11335class Control(Window):
d55e5bfc
RD
11336 """
11337 This is the base class for a control or 'widget'.
11338
15817c7e
RD
11339 A control is generally a small window which processes user input
11340 and/or displays one or more item of data.
d55e5bfc 11341 """
1bd55598
RD
11342 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11343 __repr__ = _swig_repr
11344 def __init__(self, *args, **kwargs):
d55e5bfc 11345 """
5b5c9bc7
RD
11346 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11347 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11348 String name=ControlNameStr) -> Control
d55e5bfc 11349
15817c7e
RD
11350 Create a Control. Normally you should only call this from a subclass'
11351 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 11352 """
1bd55598 11353 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
11354 self._setOORInfo(self)
11355
11356 def Create(*args, **kwargs):
11357 """
5b5c9bc7
RD
11358 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11359 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11360 String name=ControlNameStr) -> bool
d55e5bfc
RD
11361
11362 Do the 2nd phase and create the GUI control.
11363 """
5b5c9bc7 11364 return _core_.Control_Create(*args, **kwargs)
d55e5bfc 11365
1eeb270e
RD
11366 def GetAlignment(*args, **kwargs):
11367 """
11368 GetAlignment(self) -> int
11369
11370 Get the control alignment (left/right/centre, top/bottom/centre)
11371 """
11372 return _core_.Control_GetAlignment(*args, **kwargs)
11373
34e0a3bb 11374 def GetLabelText(*args, **kwargs):
1eeb270e 11375 """
1eeb270e
RD
11376 GetLabelText(self) -> String
11377
11378 Get just the text of the label, without mnemonic characters ('&')
11379 """
34e0a3bb 11380 return _core_.Control_GetLabelText(*args, **kwargs)
1eeb270e 11381
d55e5bfc
RD
11382 def Command(*args, **kwargs):
11383 """
5b5c9bc7 11384 Command(self, CommandEvent event)
d55e5bfc 11385
15817c7e
RD
11386 Simulates the effect of the user issuing a command to the item.
11387
11388 :see: `wx.CommandEvent`
11389
d55e5bfc 11390 """
5b5c9bc7 11391 return _core_.Control_Command(*args, **kwargs)
d55e5bfc 11392
ddeca22c
RD
11393 def RemoveMnemonics(*args, **kwargs):
11394 """
11395 RemoveMnemonics(String str) -> String
11396
11397 removes the mnemonics characters
11398 """
11399 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11400
11401 RemoveMnemonics = staticmethod(RemoveMnemonics)
d55e5bfc 11402 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 11403 """
5b5c9bc7 11404 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11405
11406 Get the default attributes for this class. This is useful if you want
11407 to use the same font or colour in your own control as in a standard
11408 control -- which is a much better idea than hard coding specific
11409 colours or fonts which might look completely out of place on the
11410 user's system, especially if it uses themes.
11411
11412 The variant parameter is only relevant under Mac currently and is
11413 ignore under other platforms. Under Mac, it will change the size of
11414 the returned font. See `wx.Window.SetWindowVariant` for more about
11415 this.
11416 """
5b5c9bc7 11417 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11418
11419 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2bf58437 11420 Alignment = property(GetAlignment,doc="See `GetAlignment`")
2bf58437 11421 LabelText = property(GetLabelText,doc="See `GetLabelText`")
2131d850 11422_core_.Control_swigregister(Control)
d55e5bfc
RD
11423ControlNameStr = cvar.ControlNameStr
11424
11425def PreControl(*args, **kwargs):
11426 """
5b5c9bc7 11427 PreControl() -> Control
d55e5bfc
RD
11428
11429 Precreate a Control control for 2-phase creation
11430 """
5b5c9bc7 11431 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
11432 return val
11433
ddeca22c
RD
11434def Control_RemoveMnemonics(*args, **kwargs):
11435 """
11436 Control_RemoveMnemonics(String str) -> String
11437
11438 removes the mnemonics characters
11439 """
11440 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11441
5b5c9bc7 11442def Control_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 11443 """
5b5c9bc7 11444 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11445
11446 Get the default attributes for this class. This is useful if you want
11447 to use the same font or colour in your own control as in a standard
11448 control -- which is a much better idea than hard coding specific
11449 colours or fonts which might look completely out of place on the
11450 user's system, especially if it uses themes.
11451
11452 The variant parameter is only relevant under Mac currently and is
11453 ignore under other platforms. Under Mac, it will change the size of
11454 the returned font. See `wx.Window.SetWindowVariant` for more about
11455 this.
11456 """
1bd55598 11457 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11458
11459#---------------------------------------------------------------------------
11460
5b5c9bc7 11461class ItemContainer(object):
d55e5bfc 11462 """
53aa7709
RD
11463 The wx.ItemContainer class defines an interface which is implemented
11464 by all controls which have string subitems, each of which may be
11465 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11466 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 11467 this one.
d55e5bfc 11468
15817c7e
RD
11469 It defines the methods for accessing the control's items and although
11470 each of the derived classes implements them differently, they still
11471 all conform to the same interface.
d55e5bfc 11472
15817c7e
RD
11473 The items in a wx.ItemContainer have (non empty) string labels and,
11474 optionally, client data associated with them.
d55e5bfc
RD
11475
11476 """
1bd55598
RD
11477 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11478 def __init__(self): raise AttributeError, "No constructor defined"
11479 __repr__ = _swig_repr
d55e5bfc
RD
11480 def Append(*args, **kwargs):
11481 """
5b5c9bc7 11482 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 11483
15817c7e
RD
11484 Adds the item to the control, associating the given data with the item
11485 if not None. The return value is the index of the newly added item
11486 which may be different from the last one if the control is sorted (e.g.
11487 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 11488 """
5b5c9bc7 11489 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
11490
11491 def AppendItems(*args, **kwargs):
11492 """
f5b96ee1 11493 AppendItems(self, List strings)
d55e5bfc 11494
15817c7e
RD
11495 Apend several items at once to the control. Notice that calling this
11496 method may be much faster than appending the items one by one if you
11497 need to add a lot of items.
d55e5bfc 11498 """
5b5c9bc7 11499 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
11500
11501 def Insert(*args, **kwargs):
11502 """
d359a380 11503 Insert(self, String item, int pos, PyObject clientData=None) -> int
d55e5bfc 11504
15817c7e 11505 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
11506 optionally associating some data object with the item.
11507 """
5b5c9bc7 11508 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
11509
11510 def Clear(*args, **kwargs):
11511 """
11512 Clear(self)
11513
11514 Removes all items from the control.
11515 """
5b5c9bc7 11516 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
11517
11518 def Delete(*args, **kwargs):
11519 """
d359a380 11520 Delete(self, int n)
d55e5bfc 11521
15817c7e
RD
11522 Deletes the item at the zero-based index 'n' from the control. Note
11523 that it is an error (signalled by a `wx.PyAssertionError` exception if
11524 enabled) to remove an item with the index negative or greater or equal
11525 than the number of items in the control.
d55e5bfc 11526 """
5b5c9bc7 11527 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 11528
53aa7709
RD
11529 def GetClientData(*args, **kwargs):
11530 """
d359a380 11531 GetClientData(self, int n) -> PyObject
53aa7709
RD
11532
11533 Returns the client data associated with the given item, (if any.)
11534 """
5b5c9bc7 11535 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
11536
11537 def SetClientData(*args, **kwargs):
11538 """
d359a380 11539 SetClientData(self, int n, PyObject clientData)
53aa7709
RD
11540
11541 Associate the given client data with the item at position n.
11542 """
5b5c9bc7 11543 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 11544
d55e5bfc
RD
11545 def GetCount(*args, **kwargs):
11546 """
d359a380 11547 GetCount(self) -> int
d55e5bfc
RD
11548
11549 Returns the number of items in the control.
11550 """
5b5c9bc7 11551 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
11552
11553 def IsEmpty(*args, **kwargs):
11554 """
11555 IsEmpty(self) -> bool
11556
11557 Returns True if the control is empty or False if it has some items.
11558 """
5b5c9bc7 11559 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
11560
11561 def GetString(*args, **kwargs):
11562 """
d359a380 11563 GetString(self, int n) -> String
d55e5bfc
RD
11564
11565 Returns the label of the item with the given index.
11566 """
5b5c9bc7 11567 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
11568
11569 def GetStrings(*args, **kwargs):
11570 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 11571 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
11572
11573 def SetString(*args, **kwargs):
11574 """
d359a380 11575 SetString(self, int n, String s)
d55e5bfc
RD
11576
11577 Sets the label for the given item.
11578 """
5b5c9bc7 11579 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
11580
11581 def FindString(*args, **kwargs):
11582 """
5b5c9bc7 11583 FindString(self, String s) -> int
d55e5bfc
RD
11584
11585 Finds an item whose label matches the given string. Returns the
15817c7e
RD
11586 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11587 found.
d55e5bfc 11588 """
5b5c9bc7 11589 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 11590
53aa7709 11591 def SetSelection(*args, **kwargs):
d55e5bfc 11592 """
53aa7709 11593 SetSelection(self, int n)
d55e5bfc
RD
11594
11595 Sets the item at index 'n' to be the selected item.
11596 """
5b5c9bc7 11597 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 11598
d55e5bfc
RD
11599 def GetSelection(*args, **kwargs):
11600 """
11601 GetSelection(self) -> int
11602
15817c7e
RD
11603 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11604 is selected.
d55e5bfc 11605 """
5b5c9bc7 11606 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 11607
53aa7709 11608 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
11609 """SetStringSelection(self, String s) -> bool"""
11610 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 11611
d55e5bfc
RD
11612 def GetStringSelection(*args, **kwargs):
11613 """
5b5c9bc7 11614 GetStringSelection(self) -> String
d55e5bfc 11615
15817c7e
RD
11616 Returns the label of the selected item or an empty string if no item
11617 is selected.
d55e5bfc 11618 """
5b5c9bc7 11619 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 11620
53aa7709 11621 def Select(*args, **kwargs):
d55e5bfc 11622 """
53aa7709 11623 Select(self, int n)
d55e5bfc 11624
53aa7709
RD
11625 This is the same as `SetSelection` and exists only because it is
11626 slightly more natural for controls which support multiple selection.
d55e5bfc 11627 """
5b5c9bc7 11628 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 11629
ac5d357a
RD
11630 def GetItems(self):
11631 """Return a list of the strings in the control"""
11632 return [self.GetString(i) for i in xrange(self.GetCount())]
11633
11634 def SetItems(self, items):
11635 """Clear and set the strings in the control from a list"""
11636 self.Clear()
11637 for i in items:
11638 self.Append(i)
11639
11640 Count = property(GetCount,doc="See `GetCount`")
11641 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11642 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11643 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11644 Strings = property(GetStrings,doc="See `GetStrings`")
2131d850 11645_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
11646
11647#---------------------------------------------------------------------------
11648
5b5c9bc7 11649class ControlWithItems(Control,ItemContainer):
d55e5bfc 11650 """
15817c7e
RD
11651 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11652 wx.Control class, and is used for the base class of various controls
11653 that have items.
d55e5bfc 11654 """
1bd55598
RD
11655 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11656 def __init__(self): raise AttributeError, "No constructor defined"
11657 __repr__ = _swig_repr
2131d850 11658_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
11659
11660#---------------------------------------------------------------------------
11661
cbfc9df6
RD
11662class SizerFlags(object):
11663 """
11664 Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
11665 to specify a lot of flags and parameters which can be unwieldy. This
11666 is where wx.SizerFlags comes in: it allows you to specify all
11667 parameters using the named methods instead. For example, instead of::
11668
11669 sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
11670
11671 you can now write::
11672
11673 sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
11674
11675 This is more readable and also allows you to create wx.SizerFlags
11676 objects which can be reused for several sizer items.::
11677
11678 flagsExpand = wx.SizerFlags(1)
11679 flagsExpand.Expand().Border(wx.ALL, 10)
11680 sizer.AddF(ctrl1, flagsExpand)
11681 sizer.AddF(ctrl2, flagsExpand)
11682
11683 Note that by specification, all methods of wx.SizerFlags return the
11684 wx.SizerFlags object itself allowing chaining multiple method calls
11685 like in the examples above.
11686 """
11687 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11688 __repr__ = _swig_repr
11689 def __init__(self, *args, **kwargs):
11690 """
11691 __init__(self, int proportion=0) -> SizerFlags
11692
11693 Constructs the flags object with the specified proportion.
11694 """
11695 _core_.SizerFlags_swiginit(self,_core_.new_SizerFlags(*args, **kwargs))
11696 __swig_destroy__ = _core_.delete_SizerFlags
11697 __del__ = lambda self : None;
11698 def Proportion(*args, **kwargs):
11699 """
11700 Proportion(self, int proportion) -> SizerFlags
11701
11702 Sets the item's proportion value.
11703 """
11704 return _core_.SizerFlags_Proportion(*args, **kwargs)
11705
11706 def Align(*args, **kwargs):
11707 """
11708 Align(self, int alignment) -> SizerFlags
11709
11710 Sets the item's alignment
11711 """
11712 return _core_.SizerFlags_Align(*args, **kwargs)
11713
11714 def Expand(*args, **kwargs):
11715 """
11716 Expand(self) -> SizerFlags
11717
11718 Sets the wx.EXPAND flag, which will cause the item to be expanded to
11719 fill as much space as it is given by the sizer.
11720 """
11721 return _core_.SizerFlags_Expand(*args, **kwargs)
11722
11723 def Centre(*args, **kwargs):
11724 """
11725 Centre(self) -> SizerFlags
11726
11727 Same as `Center` for those with an alternate dialect of English.
11728 """
11729 return _core_.SizerFlags_Centre(*args, **kwargs)
11730
11731 def Center(*args, **kwargs):
11732 """
11733 Center(self) -> SizerFlags
11734
11735 Sets the centering alignment flags.
11736 """
11737 return _core_.SizerFlags_Center(*args, **kwargs)
11738
11739 def Left(*args, **kwargs):
11740 """
11741 Left(self) -> SizerFlags
11742
11743 Aligns the object to the left, a shortcut for calling
11744 Align(wx.ALIGN_LEFT)
11745 """
11746 return _core_.SizerFlags_Left(*args, **kwargs)
11747
11748 def Right(*args, **kwargs):
11749 """
11750 Right(self) -> SizerFlags
11751
11752 Aligns the object to the right, a shortcut for calling
11753 Align(wx.ALIGN_RIGHT)
11754 """
11755 return _core_.SizerFlags_Right(*args, **kwargs)
11756
11757 def Top(*args, **kwargs):
11758 """
11759 Top(self) -> SizerFlags
11760
11761 Aligns the object to the top of the available space, a shortcut for
11762 calling Align(wx.ALIGN_TOP)
11763 """
11764 return _core_.SizerFlags_Top(*args, **kwargs)
11765
11766 def Bottom(*args, **kwargs):
11767 """
11768 Bottom(self) -> SizerFlags
11769
11770 Aligns the object to the bottom of the available space, a shortcut for
11771 calling Align(wx.ALIGN_BOTTOM)
11772 """
11773 return _core_.SizerFlags_Bottom(*args, **kwargs)
11774
11775 def Shaped(*args, **kwargs):
11776 """
11777 Shaped(self) -> SizerFlags
11778
11779 Sets the wx.SHAPED flag.
11780 """
11781 return _core_.SizerFlags_Shaped(*args, **kwargs)
11782
11783 def FixedMinSize(*args, **kwargs):
11784 """
11785 FixedMinSize(self) -> SizerFlags
11786
11787 Sets the wx.FIXED_MINSIZE flag.
11788 """
11789 return _core_.SizerFlags_FixedMinSize(*args, **kwargs)
11790
11791 def Border(*args, **kwargs):
11792 """
11793 Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags
11794
11795 Sets the border of the item in the direction(s) or sides given by the
11796 direction parameter. If the borderInPixels value is not given then
11797 the default border size (see `GetDefaultBorder`) will be used.
11798 """
11799 return _core_.SizerFlags_Border(*args, **kwargs)
11800
11801 def DoubleBorder(*args, **kwargs):
11802 """
11803 DoubleBorder(self, int direction=ALL) -> SizerFlags
11804
11805 Sets the border in the given direction to twice the default border
11806 size.
11807 """
11808 return _core_.SizerFlags_DoubleBorder(*args, **kwargs)
11809
11810 def TripleBorder(*args, **kwargs):
11811 """
11812 TripleBorder(self, int direction=ALL) -> SizerFlags
11813
11814 Sets the border in the given direction to three times the default
11815 border size.
11816 """
11817 return _core_.SizerFlags_TripleBorder(*args, **kwargs)
11818
11819 def HorzBorder(*args, **kwargs):
11820 """
11821 HorzBorder(self) -> SizerFlags
11822
11823 Sets the left and right borders to the default border size.
11824 """
11825 return _core_.SizerFlags_HorzBorder(*args, **kwargs)
11826
11827 def DoubleHorzBorder(*args, **kwargs):
11828 """
11829 DoubleHorzBorder(self) -> SizerFlags
11830
11831 Sets the left and right borders to twice the default border size.
11832 """
11833 return _core_.SizerFlags_DoubleHorzBorder(*args, **kwargs)
11834
11835 def GetDefaultBorder(*args, **kwargs):
11836 """
11837 GetDefaultBorder() -> int
11838
11839 Returns the default border size used by the other border methods
11840 """
11841 return _core_.SizerFlags_GetDefaultBorder(*args, **kwargs)
11842
11843 GetDefaultBorder = staticmethod(GetDefaultBorder)
11844 def GetProportion(*args, **kwargs):
11845 """
11846 GetProportion(self) -> int
11847
11848 Returns the proportion value to be used in the sizer item.
11849 """
11850 return _core_.SizerFlags_GetProportion(*args, **kwargs)
11851
11852 def GetFlags(*args, **kwargs):
11853 """
11854 GetFlags(self) -> int
11855
11856 Returns the flags value to be used in the sizer item.
11857 """
11858 return _core_.SizerFlags_GetFlags(*args, **kwargs)
11859
11860 def GetBorderInPixels(*args, **kwargs):
11861 """
11862 GetBorderInPixels(self) -> int
11863
11864 Returns the border value in pixels to be used in the sizer item.
11865 """
11866 return _core_.SizerFlags_GetBorderInPixels(*args, **kwargs)
11867
11868_core_.SizerFlags_swigregister(SizerFlags)
11869
11870def SizerFlags_GetDefaultBorder(*args):
11871 """
11872 SizerFlags_GetDefaultBorder() -> int
11873
11874 Returns the default border size used by the other border methods
11875 """
11876 return _core_.SizerFlags_GetDefaultBorder(*args)
11877
5b5c9bc7 11878class SizerItem(Object):
bfddbb17
RD
11879 """
11880 The wx.SizerItem class is used to track the position, size and other
2131d850
RD
11881 attributes of each item managed by a `wx.Sizer`. It is not usually
11882 necessary to use this class because the sizer elements can also be
11883 identified by their positions or window or sizer references but
11884 sometimes it may be more convenient to use wx.SizerItem directly.
11885 Also, custom classes derived from `wx.PySizer` will probably need to
11886 use the collection of wx.SizerItems held by wx.Sizer when calculating
11887 layout.
bfddbb17
RD
11888
11889 :see: `wx.Sizer`, `wx.GBSizerItem`
11890 """
1bd55598
RD
11891 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11892 __repr__ = _swig_repr
11893 def __init__(self, *args, **kwargs):
bfddbb17 11894 """
5b5c9bc7 11895 __init__(self) -> SizerItem
bfddbb17
RD
11896
11897 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11898 size will need to be set before this item can be used in a Sizer.
11899
11900 You will probably never need to create a wx.SizerItem directly as they
11901 are created automatically when the sizer's Add, Insert or Prepend
11902 methods are called.
11903
11904 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11905 """
1bd55598
RD
11906 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11907 __swig_destroy__ = _core_.delete_SizerItem
11908 __del__ = lambda self : None;
d55e5bfc 11909 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11910 """
11911 DeleteWindows(self)
11912
11913 Destroy the window or the windows in a subsizer, depending on the type
11914 of item.
11915 """
5b5c9bc7 11916 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11917
11918 def DetachSizer(*args, **kwargs):
bfddbb17
RD
11919 """
11920 DetachSizer(self)
11921
11922 Enable deleting the SizerItem without destroying the contained sizer.
11923 """
5b5c9bc7 11924 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
11925
11926 def GetSize(*args, **kwargs):
bfddbb17 11927 """
5b5c9bc7 11928 GetSize(self) -> Size
bfddbb17
RD
11929
11930 Get the current size of the item, as set in the last Layout.
11931 """
5b5c9bc7 11932 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
11933
11934 def CalcMin(*args, **kwargs):
bfddbb17 11935 """
5b5c9bc7 11936 CalcMin(self) -> Size
bfddbb17
RD
11937
11938 Calculates the minimum desired size for the item, including any space
11939 needed by borders.
11940 """
5b5c9bc7 11941 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
11942
11943 def SetDimension(*args, **kwargs):
bfddbb17 11944 """
5b5c9bc7 11945 SetDimension(self, Point pos, Size size)
bfddbb17
RD
11946
11947 Set the position and size of the space allocated for this item by the
11948 sizer, and adjust the position and size of the item (window or
11949 subsizer) to be within that space taking alignment and borders into
11950 account.
11951 """
5b5c9bc7 11952 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
11953
11954 def GetMinSize(*args, **kwargs):
bfddbb17 11955 """
5b5c9bc7 11956 GetMinSize(self) -> Size
bfddbb17
RD
11957
11958 Get the minimum size needed for the item.
11959 """
5b5c9bc7 11960 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 11961
a001823c
RD
11962 def GetMinSizeWithBorder(*args, **kwargs):
11963 """
5b5c9bc7 11964 GetMinSizeWithBorder(self) -> Size
a001823c
RD
11965
11966 Get the minimum size needed for the item with space for the borders
11967 added, if needed.
11968 """
5b5c9bc7 11969 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 11970
d55e5bfc
RD
11971 def SetInitSize(*args, **kwargs):
11972 """SetInitSize(self, int x, int y)"""
5b5c9bc7 11973 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
11974
11975 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
11976 """
11977 SetRatioWH(self, int width, int height)
11978
11979 Set the ratio item attribute.
11980 """
5b5c9bc7 11981 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
11982
11983 def SetRatioSize(*args, **kwargs):
bfddbb17 11984 """
5b5c9bc7 11985 SetRatioSize(self, Size size)
bfddbb17
RD
11986
11987 Set the ratio item attribute.
11988 """
5b5c9bc7 11989 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
11990
11991 def SetRatio(*args, **kwargs):
bfddbb17
RD
11992 """
11993 SetRatio(self, float ratio)
11994
11995 Set the ratio item attribute.
11996 """
5b5c9bc7 11997 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
11998
11999 def GetRatio(*args, **kwargs):
bfddbb17
RD
12000 """
12001 GetRatio(self) -> float
12002
12003 Set the ratio item attribute.
12004 """
5b5c9bc7 12005 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 12006
070c48b4
RD
12007 def GetRect(*args, **kwargs):
12008 """
5b5c9bc7 12009 GetRect(self) -> Rect
070c48b4
RD
12010
12011 Returns the rectangle that the sizer item should occupy
12012 """
5b5c9bc7 12013 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 12014
d55e5bfc 12015 def IsWindow(*args, **kwargs):
bfddbb17
RD
12016 """
12017 IsWindow(self) -> bool
12018
12019 Is this sizer item a window?
12020 """
5b5c9bc7 12021 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
12022
12023 def IsSizer(*args, **kwargs):
bfddbb17
RD
12024 """
12025 IsSizer(self) -> bool
12026
12027 Is this sizer item a subsizer?
12028 """
5b5c9bc7 12029 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
12030
12031 def IsSpacer(*args, **kwargs):
bfddbb17
RD
12032 """
12033 IsSpacer(self) -> bool
12034
12035 Is this sizer item a spacer?
12036 """
5b5c9bc7 12037 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
12038
12039 def SetProportion(*args, **kwargs):
bfddbb17
RD
12040 """
12041 SetProportion(self, int proportion)
12042
12043 Set the proportion value for this item.
12044 """
5b5c9bc7 12045 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
12046
12047 def GetProportion(*args, **kwargs):
bfddbb17
RD
12048 """
12049 GetProportion(self) -> int
12050
12051 Get the proportion value for this item.
12052 """
5b5c9bc7 12053 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 12054
bfddbb17
RD
12055 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
12056 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 12057 def SetFlag(*args, **kwargs):
bfddbb17
RD
12058 """
12059 SetFlag(self, int flag)
12060
12061 Set the flag value for this item.
12062 """
5b5c9bc7 12063 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
12064
12065 def GetFlag(*args, **kwargs):
bfddbb17
RD
12066 """
12067 GetFlag(self) -> int
12068
12069 Get the flag value for this item.
12070 """
5b5c9bc7 12071 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
12072
12073 def SetBorder(*args, **kwargs):
bfddbb17
RD
12074 """
12075 SetBorder(self, int border)
12076
12077 Set the border value for this item.
12078 """
5b5c9bc7 12079 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
12080
12081 def GetBorder(*args, **kwargs):
bfddbb17
RD
12082 """
12083 GetBorder(self) -> int
12084
12085 Get the border value for this item.
12086 """
5b5c9bc7 12087 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
12088
12089 def GetWindow(*args, **kwargs):
bfddbb17 12090 """
5b5c9bc7 12091 GetWindow(self) -> Window
bfddbb17
RD
12092
12093 Get the window (if any) that is managed by this sizer item.
12094 """
5b5c9bc7 12095 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc 12096
d55e5bfc 12097 def GetSizer(*args, **kwargs):
bfddbb17 12098 """
5b5c9bc7 12099 GetSizer(self) -> Sizer
bfddbb17
RD
12100
12101 Get the subsizer (if any) that is managed by this sizer item.
12102 """
5b5c9bc7 12103 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc 12104
ddeca22c
RD
12105 def GetSpacer(*args, **kwargs):
12106 """
12107 GetSpacer(self) -> Size
12108
12109 Get the size of the spacer managed by this sizer item.
12110 """
12111 return _core_.SizerItem_GetSpacer(*args, **kwargs)
12112
12113 def SetWindow(*args, **kwargs):
12114 """
12115 SetWindow(self, Window window)
12116
12117 Set the window to be managed by this sizer item.
12118 """
12119 return _core_.SizerItem_SetWindow(*args, **kwargs)
12120
d55e5bfc 12121 def SetSizer(*args, **kwargs):
bfddbb17 12122 """
5b5c9bc7 12123 SetSizer(self, Sizer sizer)
bfddbb17
RD
12124
12125 Set the subsizer to be managed by this sizer item.
12126 """
5b5c9bc7 12127 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc 12128
ddeca22c 12129 def SetSpacer(*args, **kwargs):
bfddbb17 12130 """
ddeca22c 12131 SetSpacer(self, Size size)
bfddbb17 12132
ddeca22c 12133 Set the size of the spacer to be managed by this sizer item.
bfddbb17 12134 """
ddeca22c 12135 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc 12136
ddeca22c
RD
12137 SetWindow = wx._deprecated(SetWindow, "Use `AssignWindow` instead.")
12138 SetSizer = wx._deprecated(SetSizer, "Use `AssignSizer` instead.")
12139 SetSpacer = wx._deprecated(SetSpacer, "Use `AssignSpacer` instead.")
12140
12141 def AssignWindow(*args, **kwargs):
bfddbb17 12142 """
ddeca22c
RD
12143 AssignWindow(self, Window window)
12144
12145 Set the window to be managed by this sizer item.
12146 """
12147 return _core_.SizerItem_AssignWindow(*args, **kwargs)
12148
12149 def AssignSizer(*args, **kwargs):
12150 """
12151 AssignSizer(self, Sizer sizer)
12152
12153 Set the subsizer to be managed by this sizer item.
12154 """
12155 return _core_.SizerItem_AssignSizer(*args, **kwargs)
12156
12157 def AssignSpacer(*args, **kwargs):
12158 """
12159 AssignSpacer(self, Size size)
bfddbb17
RD
12160
12161 Set the size of the spacer to be managed by this sizer item.
12162 """
ddeca22c 12163 return _core_.SizerItem_AssignSpacer(*args, **kwargs)
d55e5bfc
RD
12164
12165 def Show(*args, **kwargs):
bfddbb17
RD
12166 """
12167 Show(self, bool show)
12168
12169 Set the show item attribute, which sizers use to determine if the item
12170 is to be made part of the layout or not. If the item is tracking a
12171 window then it is shown or hidden as needed.
12172 """
5b5c9bc7 12173 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
12174
12175 def IsShown(*args, **kwargs):
bfddbb17
RD
12176 """
12177 IsShown(self) -> bool
12178
12179 Is the item to be shown in the layout?
12180 """
5b5c9bc7 12181 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
12182
12183 def GetPosition(*args, **kwargs):
bfddbb17 12184 """
5b5c9bc7 12185 GetPosition(self) -> Point
bfddbb17
RD
12186
12187 Returns the current position of the item, as set in the last Layout.
12188 """
5b5c9bc7 12189 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
12190
12191 def GetUserData(*args, **kwargs):
bfddbb17
RD
12192 """
12193 GetUserData(self) -> PyObject
12194
12195 Returns the userData associated with this sizer item, or None if there
12196 isn't any.
12197 """
5b5c9bc7 12198 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 12199
32fe5131
RD
12200 def SetUserData(*args, **kwargs):
12201 """
12202 SetUserData(self, PyObject userData)
12203
12204 Associate a Python object with this sizer item.
12205 """
12206 return _core_.SizerItem_SetUserData(*args, **kwargs)
12207
33d6fd3b
RD
12208 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
12209 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
12210 MinSize = property(GetMinSize,doc="See `GetMinSize`")
12211 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
12212 Position = property(GetPosition,doc="See `GetPosition`")
12213 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
12214 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
12215 Rect = property(GetRect,doc="See `GetRect`")
12216 Size = property(GetSize,doc="See `GetSize`")
ddeca22c
RD
12217 Sizer = property(GetSizer,AssignSizer,doc="See `GetSizer` and `AssignSizer`")
12218 Spacer = property(GetSpacer,AssignSpacer,doc="See `GetSpacer` and `AssignSpacer`")
33d6fd3b 12219 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
ddeca22c 12220 Window = property(GetWindow,AssignWindow,doc="See `GetWindow` and `AssignWindow`")
2131d850 12221_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 12222
bfddbb17 12223def SizerItemWindow(*args, **kwargs):
d55e5bfc 12224 """
5b5c9bc7
RD
12225 SizerItemWindow(Window window, int proportion, int flag, int border,
12226 PyObject userData=None) -> SizerItem
bfddbb17
RD
12227
12228 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 12229 """
5b5c9bc7 12230 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12231 return val
12232
bfddbb17 12233def SizerItemSpacer(*args, **kwargs):
d55e5bfc 12234 """
bfddbb17 12235 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 12236 PyObject userData=None) -> SizerItem
bfddbb17
RD
12237
12238 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 12239 """
5b5c9bc7 12240 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12241 return val
12242
12243def SizerItemSizer(*args, **kwargs):
12244 """
5b5c9bc7
RD
12245 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
12246 PyObject userData=None) -> SizerItem
bfddbb17
RD
12247
12248 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 12249 """
5b5c9bc7 12250 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12251 return val
12252
5b5c9bc7 12253class Sizer(Object):
bfddbb17
RD
12254 """
12255 wx.Sizer is the abstract base class used for laying out subwindows in
12256 a window. You cannot use wx.Sizer directly; instead, you will have to
12257 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
12258 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
12259 `wx.GridBagSizer`.
bfddbb17
RD
12260
12261 The concept implemented by sizers in wxWidgets is closely related to
12262 layout tools in other GUI toolkits, such as Java's AWT, the GTK
12263 toolkit or the Qt toolkit. It is based upon the idea of the individual
12264 subwindows reporting their minimal required size and their ability to
12265 get stretched if the size of the parent window has changed. This will
12266 most often mean that the programmer does not set the original size of
12267 a dialog in the beginning, rather the dialog will assigned a sizer and
12268 this sizer will be queried about the recommended size. The sizer in
12269 turn will query its children, which can be normal windows or contorls,
12270 empty space or other sizers, so that a hierarchy of sizers can be
12271 constructed. Note that wxSizer does not derive from wxWindow and thus
12272 do not interfere with tab ordering and requires very little resources
12273 compared to a real window on screen.
12274
12275 What makes sizers so well fitted for use in wxWidgets is the fact that
12276 every control reports its own minimal size and the algorithm can
12277 handle differences in font sizes or different window (dialog item)
12278 sizes on different platforms without problems. If for example the
12279 standard font as well as the overall design of Mac widgets requires
12280 more space than on Windows, then the initial size of a dialog using a
12281 sizer will automatically be bigger on Mac than on Windows.
12282 """
1bd55598
RD
12283 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12284 def __init__(self): raise AttributeError, "No constructor defined"
12285 __repr__ = _swig_repr
12286 __swig_destroy__ = _core_.delete_Sizer
12287 __del__ = lambda self : None;
d55e5bfc
RD
12288 def _setOORInfo(*args, **kwargs):
12289 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 12290 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
12291
12292 def Add(*args, **kwargs):
12293 """
bfddbb17 12294 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 12295 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
12296
12297 Appends a child item to the sizer.
d55e5bfc 12298 """
5b5c9bc7 12299 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc 12300
cbfc9df6
RD
12301 def AddF(*args, **kwargs):
12302 """
12303 AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12304
12305 Similar to `Add` but uses the `wx.SizerFlags` convenience class for
12306 setting the various flags, options and borders.
12307 """
12308 return _core_.Sizer_AddF(*args, **kwargs)
12309
d55e5bfc
RD
12310 def Insert(*args, **kwargs):
12311 """
bfddbb17 12312 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 12313 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
12314
12315 Inserts a new item into the list of items managed by this sizer before
12316 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 12317 """
5b5c9bc7 12318 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc 12319
cbfc9df6
RD
12320 def InsertF(*args, **kwargs):
12321 """
12322 InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
12323
12324 Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
12325 for setting the various flags, options and borders.
12326 """
12327 return _core_.Sizer_InsertF(*args, **kwargs)
12328
d55e5bfc
RD
12329 def Prepend(*args, **kwargs):
12330 """
bfddbb17 12331 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 12332 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
12333
12334 Adds a new item to the begining of the list of sizer items managed by
12335 this sizer. See `Add` for a description of the parameters.
d55e5bfc 12336 """
5b5c9bc7 12337 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc 12338
cbfc9df6
RD
12339 def PrependF(*args, **kwargs):
12340 """
12341 PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12342
12343 Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
12344 for setting the various flags, options and borders.
12345 """
12346 return _core_.Sizer_PrependF(*args, **kwargs)
12347
d55e5bfc 12348 def Remove(*args, **kwargs):
bfddbb17
RD
12349 """
12350 Remove(self, item) -> bool
12351
12352 Removes an item from the sizer and destroys it. This method does not
12353 cause any layout or resizing to take place, call `Layout` to update
12354 the layout on screen after removing a child from the sizer. The
12355 *item* parameter can be either a window, a sizer, or the zero-based
12356 index of an item to remove. Returns True if the child item was found
12357 and removed.
12358 """
5b5c9bc7 12359 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 12360
1a6bba1e 12361 def Detach(*args, **kwargs):
bfddbb17
RD
12362 """
12363 Detach(self, item) -> bool
12364
12365 Detaches an item from the sizer without destroying it. This method
12366 does not cause any layout or resizing to take place, call `Layout` to
12367 do so. The *item* parameter can be either a window, a sizer, or the
12368 zero-based index of the item to be detached. Returns True if the child item
12369 was found and detached.
12370 """
5b5c9bc7 12371 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 12372
070c48b4
RD
12373 def GetItem(*args, **kwargs):
12374 """
cbfc9df6 12375 GetItem(self, item, recursive=False) -> wx.SizerItem
070c48b4
RD
12376
12377 Returns the `wx.SizerItem` which holds the *item* given. The *item*
12378 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 12379 the item to be found.
070c48b4 12380 """
5b5c9bc7 12381 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 12382
d55e5bfc 12383 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
12384 """_SetItemMinSize(self, PyObject item, Size size)"""
12385 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 12386
ac5d357a
RD
12387 def _ReplaceWin(*args, **kwargs):
12388 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
12389 return _core_.Sizer__ReplaceWin(*args, **kwargs)
12390
12391 def _ReplaceSizer(*args, **kwargs):
12392 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
12393 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
12394
12395 def _ReplaceItem(*args, **kwargs):
12396 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
12397 return _core_.Sizer__ReplaceItem(*args, **kwargs)
12398
12399 def Replace(self, olditem, item, recursive=False):
12400 """
12401 Detaches the given ``olditem`` from the sizer and replaces it with
12402 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
12403 detached child is destroyed only if it is not a window, (because
12404 windows are owned by their parent, not the sizer.) The
12405 ``recursive`` parameter can be used to search for the given
12406 element recursivly in subsizers.
12407
12408 This method does not cause any layout or resizing to take place,
12409 call `Layout` to do so.
12410
12411 Returns ``True`` if the child item was found and removed.
12412 """
12413 if isinstance(olditem, wx.Window):
12414 return self._ReplaceWin(olditem, item, recursive)
cbfc9df6 12415 elif isinstance(olditem, wx.Sizer):
ac5d357a 12416 return self._ReplaceSizer(olditem, item, recursive)
cbfc9df6 12417 elif isinstance(olditem, int):
ac5d357a
RD
12418 return self._ReplaceItem(olditem, item)
12419 else:
12420 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
12421
12422 def SetContainingWindow(*args, **kwargs):
12423 """
12424 SetContainingWindow(self, Window window)
12425
12426 Set (or unset) the window this sizer is used in.
12427 """
12428 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
12429
12430 def GetContainingWindow(*args, **kwargs):
12431 """
12432 GetContainingWindow(self) -> Window
12433
12434 Get the window this sizer is used in.
12435 """
12436 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
12437
bfddbb17
RD
12438 def SetItemMinSize(self, item, *args):
12439 """
12440 SetItemMinSize(self, item, Size size)
12441
12442 Sets the minimum size that will be allocated for an item in the sizer.
12443 The *item* parameter can be either a window, a sizer, or the
12444 zero-based index of the item. If a window or sizer is given then it
12445 will be searched for recursivly in subsizers if neccessary.
12446 """
12447 if len(args) == 2:
12448 # for backward compatibility accept separate width,height args too
12449 return self._SetItemMinSize(item, args)
12450 else:
12451 return self._SetItemMinSize(item, args[0])
12452
d55e5bfc 12453 def AddItem(*args, **kwargs):
bfddbb17
RD
12454 """
12455 AddItem(self, SizerItem item)
12456
12457 Adds a `wx.SizerItem` to the sizer.
12458 """
5b5c9bc7 12459 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
12460
12461 def InsertItem(*args, **kwargs):
bfddbb17
RD
12462 """
12463 InsertItem(self, int index, SizerItem item)
12464
12465 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
12466 """
5b5c9bc7 12467 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
12468
12469 def PrependItem(*args, **kwargs):
bfddbb17
RD
12470 """
12471 PrependItem(self, SizerItem item)
12472
12473 Prepends a `wx.SizerItem` to the sizer.
12474 """
5b5c9bc7 12475 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 12476
bfddbb17 12477 def AddMany(self, items):
d6c14a4c
RD
12478 """
12479 AddMany is a convenience method for adding several items
12480 to a sizer at one time. Simply pass it a list of tuples,
12481 where each tuple consists of the parameters that you
12482 would normally pass to the `Add` method.
12483 """
bfddbb17
RD
12484 for item in items:
12485 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
12486 item = (item, )
12487 self.Add(*item)
d55e5bfc 12488
0d2c9713
RD
12489 def AddSpacer(self, *args, **kw):
12490 """AddSpacer(int size) --> SizerItem
12491
12492 Add a spacer that is (size,size) pixels.
12493 """
12494 if args and type(args[0]) == int:
12495 return self.Add( (args[0],args[0] ), 0)
12496 else: # otherwise stay compatible with old AddSpacer
12497 return self.Add(*args, **kw)
12498 def PrependSpacer(self, *args, **kw):
12499 """PrependSpacer(int size) --> SizerItem
12500
12501 Prepend a spacer that is (size, size) pixels."""
12502 if args and type(args[0]) == int:
12503 return self.Prepend( (args[0],args[0] ), 0)
12504 else: # otherwise stay compatible with old PrependSpacer
12505 return self.Prepend(*args, **kw)
12506 def InsertSpacer(self, index, *args, **kw):
12507 """InsertSpacer(int index, int size) --> SizerItem
12508
12509 Insert a spacer at position index that is (size, size) pixels."""
12510 if args and type(args[0]) == int:
12511 return self.Insert( index, (args[0],args[0] ), 0)
12512 else: # otherwise stay compatible with old InsertSpacer
12513 return self.Insert(index, *args, **kw)
12514
12515
12516 def AddStretchSpacer(self, prop=1):
12517 """AddStretchSpacer(int prop=1) --> SizerItem
12518
12519 Add a stretchable spacer."""
12520 return self.Add((0,0), prop)
12521 def PrependStretchSpacer(self, prop=1):
12522 """PrependStretchSpacer(int prop=1) --> SizerItem
12523
12524 Prepend a stretchable spacer."""
12525 return self.Prepend((0,0), prop)
12526 def InsertStretchSpacer(self, index, prop=1):
12527 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
12528
12529 Insert a stretchable spacer."""
12530 return self.Insert(index, (0,0), prop)
12531
12532
d55e5bfc 12533 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
12534 def AddWindow(self, *args, **kw):
12535 """Compatibility alias for `Add`."""
12536 return self.Add(*args, **kw)
12537 def AddSizer(self, *args, **kw):
12538 """Compatibility alias for `Add`."""
12539 return self.Add(*args, **kw)
7fbf8399
RD
12540
12541 def PrependWindow(self, *args, **kw):
12542 """Compatibility alias for `Prepend`."""
12543 return self.Prepend(*args, **kw)
12544 def PrependSizer(self, *args, **kw):
12545 """Compatibility alias for `Prepend`."""
12546 return self.Prepend(*args, **kw)
7fbf8399
RD
12547
12548 def InsertWindow(self, *args, **kw):
12549 """Compatibility alias for `Insert`."""
12550 return self.Insert(*args, **kw)
12551 def InsertSizer(self, *args, **kw):
12552 """Compatibility alias for `Insert`."""
7fbf8399
RD
12553 return self.Insert(*args, **kw)
12554
12555 def RemoveWindow(self, *args, **kw):
12556 """Compatibility alias for `Remove`."""
12557 return self.Remove(*args, **kw)
12558 def RemoveSizer(self, *args, **kw):
12559 """Compatibility alias for `Remove`."""
12560 return self.Remove(*args, **kw)
12561 def RemovePos(self, *args, **kw):
12562 """Compatibility alias for `Remove`."""
12563 return self.Remove(*args, **kw)
d55e5bfc
RD
12564
12565
d55e5bfc 12566 def SetDimension(*args, **kwargs):
bfddbb17
RD
12567 """
12568 SetDimension(self, int x, int y, int width, int height)
12569
12570 Call this to force the sizer to take the given dimension and thus
12571 force the items owned by the sizer to resize themselves according to
12572 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
12573 methods.
12574 """
5b5c9bc7 12575 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
12576
12577 def SetMinSize(*args, **kwargs):
bfddbb17 12578 """
5b5c9bc7 12579 SetMinSize(self, Size size)
bfddbb17
RD
12580
12581 Call this to give the sizer a minimal size. Normally, the sizer will
12582 calculate its minimal size based purely on how much space its children
12583 need. After calling this method `GetMinSize` will return either the
12584 minimal size as requested by its children or the minimal size set
12585 here, depending on which is bigger.
12586 """
5b5c9bc7 12587 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
12588
12589 def GetSize(*args, **kwargs):
bfddbb17 12590 """
5b5c9bc7 12591 GetSize(self) -> Size
bfddbb17
RD
12592
12593 Returns the current size of the space managed by the sizer.
12594 """
5b5c9bc7 12595 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
12596
12597 def GetPosition(*args, **kwargs):
bfddbb17 12598 """
5b5c9bc7 12599 GetPosition(self) -> Point
bfddbb17
RD
12600
12601 Returns the current position of the sizer's managed space.
12602 """
5b5c9bc7 12603 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
12604
12605 def GetMinSize(*args, **kwargs):
bfddbb17 12606 """
5b5c9bc7 12607 GetMinSize(self) -> Size
bfddbb17
RD
12608
12609 Returns the minimal size of the sizer. This is either the combined
12610 minimal size of all the children and their borders or the minimal size
12611 set by SetMinSize, depending on which is bigger.
12612 """
5b5c9bc7 12613 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
12614
12615 def GetSizeTuple(self):
1a6bba1e 12616 return self.GetSize().Get()
d55e5bfc 12617 def GetPositionTuple(self):
1a6bba1e 12618 return self.GetPosition().Get()
d55e5bfc 12619 def GetMinSizeTuple(self):
1a6bba1e 12620 return self.GetMinSize().Get()
d55e5bfc
RD
12621
12622 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
12623 """
12624 RecalcSizes(self)
12625
12626 Using the sizes calculated by `CalcMin` reposition and resize all the
12627 items managed by this sizer. You should not need to call this directly as
12628 it is called by `Layout`.
12629 """
5b5c9bc7 12630 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
12631
12632 def CalcMin(*args, **kwargs):
bfddbb17 12633 """
5b5c9bc7 12634 CalcMin(self) -> Size
bfddbb17
RD
12635
12636 This method is where the sizer will do the actual calculation of its
12637 children's minimal sizes. You should not need to call this directly as
12638 it is called by `Layout`.
12639 """
5b5c9bc7 12640 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
12641
12642 def Layout(*args, **kwargs):
bfddbb17
RD
12643 """
12644 Layout(self)
12645
12646 This method will force the recalculation and layout of the items
12647 controlled by the sizer using the current space allocated to the
12648 sizer. Normally this is called automatically from the owning window's
12649 EVT_SIZE handler, but it is also useful to call it from user code when
12650 one of the items in a sizer change size, or items are added or
12651 removed.
12652 """
5b5c9bc7 12653 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
12654
12655 def Fit(*args, **kwargs):
bfddbb17 12656 """
5b5c9bc7 12657 Fit(self, Window window) -> Size
bfddbb17
RD
12658
12659 Tell the sizer to resize the *window* to match the sizer's minimal
12660 size. This is commonly done in the constructor of the window itself in
12661 order to set its initial size to match the needs of the children as
12662 determined by the sizer. Returns the new size.
12663
12664 For a top level window this is the total window size, not the client size.
12665 """
5b5c9bc7 12666 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
12667
12668 def FitInside(*args, **kwargs):
bfddbb17 12669 """
5b5c9bc7 12670 FitInside(self, Window window)
bfddbb17
RD
12671
12672 Tell the sizer to resize the *virtual size* of the *window* to match the
12673 sizer's minimal size. This will not alter the on screen size of the
12674 window, but may cause the addition/removal/alteration of scrollbars
12675 required to view the virtual area in windows which manage it.
12676
12677 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12678
12679 """
5b5c9bc7 12680 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
12681
12682 def SetSizeHints(*args, **kwargs):
bfddbb17 12683 """
5b5c9bc7 12684 SetSizeHints(self, Window window)
bfddbb17
RD
12685
12686 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12687 match the sizer's minimal size. This is commonly done in the
12688 constructor of the window itself if the window is resizable (as are
12689 many dialogs under Unix and frames on probably all platforms) in order
12690 to prevent the window from being sized smaller than the minimal size
12691 required by the sizer.
12692 """
5b5c9bc7 12693 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
12694
12695 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 12696 """
5b5c9bc7 12697 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
12698
12699 Tell the sizer to set the minimal size of the window virtual area to
12700 match the sizer's minimal size. For windows with managed scrollbars
12701 this will set them appropriately.
12702
12703 :see: `wx.ScrolledWindow.SetScrollbars`
12704
12705 """
5b5c9bc7 12706 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
12707
12708 def Clear(*args, **kwargs):
bfddbb17
RD
12709 """
12710 Clear(self, bool deleteWindows=False)
12711
12712 Clear all items from the sizer, optionally destroying the window items
12713 as well.
12714 """
5b5c9bc7 12715 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
12716
12717 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
12718 """
12719 DeleteWindows(self)
12720
12721 Destroy all windows managed by the sizer.
12722 """
5b5c9bc7 12723 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
12724
12725 def GetChildren(*args, **kwargs):
bfddbb17 12726 """
51b83b37 12727 GetChildren(self) -> list
bfddbb17
RD
12728
12729 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12730 """
5b5c9bc7 12731 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
12732
12733 def Show(*args, **kwargs):
bfddbb17 12734 """
b411df4a 12735 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 12736
bfddbb17
RD
12737 Shows or hides an item managed by the sizer. To make a sizer item
12738 disappear or reappear, use Show followed by `Layout`. The *item*
12739 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
12740 the item. Use the recursive parameter to show or hide an item in a
12741 subsizer. Returns True if the item was found.
bfddbb17 12742 """
5b5c9bc7 12743 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
12744
12745 def IsShown(*args, **kwargs):
bfddbb17
RD
12746 """
12747 IsShown(self, item)
12748
b1fcee84 12749 Determines if the item is currently shown. To make a sizer
bfddbb17
RD
12750 item disappear or reappear, use Show followed by `Layout`. The *item*
12751 parameter can be either a window, a sizer, or the zero-based index of
12752 the item.
12753 """
5b5c9bc7 12754 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 12755
629e65c2 12756 def Hide(self, item, recursive=False):
bfddbb17 12757 """
27fb7603 12758 A convenience method for `Show` (item, False, recursive).
bfddbb17 12759 """
06759a38 12760 return self.Show(item, False, recursive)
bfddbb17 12761
d55e5bfc 12762 def ShowItems(*args, **kwargs):
bfddbb17
RD
12763 """
12764 ShowItems(self, bool show)
12765
84f85550 12766 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 12767 """
5b5c9bc7 12768 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc 12769
33d6fd3b
RD
12770 Children = property(GetChildren,doc="See `GetChildren`")
12771 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12772 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12773 Position = property(GetPosition,doc="See `GetPosition`")
12774 Size = property(GetSize,doc="See `GetSize`")
2131d850 12775_core_.Sizer_swigregister(Sizer)
d55e5bfc 12776
5b5c9bc7 12777class PySizer(Sizer):
bfddbb17
RD
12778 """
12779 wx.PySizer is a special version of `wx.Sizer` that has been
12780 instrumented to allow the C++ virtual methods to be overloaded in
12781 Python derived classes. You would derive from this class if you are
12782 wanting to implement a custom sizer in Python code. Simply implement
12783 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12784 For example::
12785
12786 class MySizer(wx.PySizer):
12787 def __init__(self):
12788 wx.PySizer.__init__(self)
12789
12790 def CalcMin(self):
12791 for item in self.GetChildren():
12792 # calculate the total minimum width and height needed
12793 # by all items in the sizer according to this sizer's
12794 # layout algorithm.
12795 ...
12796 return wx.Size(width, height)
12797
12798 def RecalcSizes(self):
12799 # find the space allotted to this sizer
12800 pos = self.GetPosition()
12801 size = self.GetSize()
12802 for item in self.GetChildren():
12803 # Recalculate (if necessary) the position and size of
12804 # each item and then call item.SetDimension to do the
12805 # actual positioning and sizing of the items within the
12806 # space alloted to this sizer.
12807 ...
12808 item.SetDimension(itemPos, itemSize)
12809
12810
12811 When `Layout` is called it first calls `CalcMin` followed by
12812 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 12813 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
12814
12815 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12816
12817
12818 """
1bd55598
RD
12819 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12820 __repr__ = _swig_repr
12821 def __init__(self, *args, **kwargs):
bfddbb17 12822 """
5b5c9bc7 12823 __init__(self) -> PySizer
bfddbb17
RD
12824
12825 Creates a wx.PySizer. Must be called from the __init__ in the derived
12826 class.
12827 """
1bd55598 12828 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
c25f90f6 12829 self._setOORInfo(self);PySizer._setCallbackInfo(self, self, PySizer)
d55e5bfc
RD
12830
12831 def _setCallbackInfo(*args, **kwargs):
12832 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 12833 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc 12834
2131d850 12835_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
12836
12837#---------------------------------------------------------------------------
12838
5b5c9bc7 12839class BoxSizer(Sizer):
bfddbb17
RD
12840 """
12841 The basic idea behind a box sizer is that windows will most often be
12842 laid out in rather simple basic geometry, typically in a row or a
12843 column or nested hierarchies of either. A wx.BoxSizer will lay out
12844 its items in a simple row or column, depending on the orientation
12845 parameter passed to the constructor.
12846 """
1bd55598
RD
12847 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12848 __repr__ = _swig_repr
12849 def __init__(self, *args, **kwargs):
bfddbb17 12850 """
5b5c9bc7 12851 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
12852
12853 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12854 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12855 sizer.
12856 """
1bd55598 12857 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
12858 self._setOORInfo(self)
12859
12860 def GetOrientation(*args, **kwargs):
bfddbb17
RD
12861 """
12862 GetOrientation(self) -> int
12863
12864 Returns the current orientation of the sizer.
12865 """
5b5c9bc7 12866 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
12867
12868 def SetOrientation(*args, **kwargs):
bfddbb17
RD
12869 """
12870 SetOrientation(self, int orient)
d55e5bfc 12871
bfddbb17
RD
12872 Resets the orientation of the sizer.
12873 """
5b5c9bc7 12874 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 12875
2bf58437 12876 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
2131d850 12877_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
12878
12879#---------------------------------------------------------------------------
12880
5b5c9bc7 12881class StaticBoxSizer(BoxSizer):
bfddbb17
RD
12882 """
12883 wx.StaticBoxSizer derives from and functions identically to the
12884 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12885 manages. Note that this static box must be created separately and
12886 passed to the sizer constructor.
12887 """
1bd55598
RD
12888 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12889 __repr__ = _swig_repr
12890 def __init__(self, *args, **kwargs):
bfddbb17 12891 """
5b5c9bc7 12892 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
12893
12894 Constructor. It takes an associated static box and the orientation
12895 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12896 ``wx.HORIZONTAL``.
12897 """
1bd55598 12898 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
12899 self._setOORInfo(self)
12900
12901 def GetStaticBox(*args, **kwargs):
bfddbb17 12902 """
5b5c9bc7 12903 GetStaticBox(self) -> StaticBox
d55e5bfc 12904
bfddbb17
RD
12905 Returns the static box associated with this sizer.
12906 """
5b5c9bc7 12907 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 12908
33d6fd3b 12909 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
2131d850 12910_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
12911
12912#---------------------------------------------------------------------------
12913
5b5c9bc7 12914class GridSizer(Sizer):
bfddbb17
RD
12915 """
12916 A grid sizer is a sizer which lays out its children in a
12917 two-dimensional table with all cells having the same size. In other
12918 words, the width of each cell within the grid is the width of the
12919 widest item added to the sizer and the height of each grid cell is the
12920 height of the tallest item. An optional vertical and/or horizontal
12921 gap between items can also be specified (in pixels.)
12922
12923 Items are placed in the cells of the grid in the order they are added,
12924 in row-major order. In other words, the first row is filled first,
12925 then the second, and so on until all items have been added. (If
12926 neccessary, additional rows will be added as items are added.) If you
12927 need to have greater control over the cells that items are placed in
12928 then use the `wx.GridBagSizer`.
12929
12930 """
1bd55598
RD
12931 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12932 __repr__ = _swig_repr
12933 def __init__(self, *args, **kwargs):
bfddbb17 12934 """
5b5c9bc7 12935 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
12936
12937 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12938 of columns and rows in the sizer - if either of the parameters is
12939 zero, it will be calculated to from the total number of children in
12940 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12941 define extra space between all children.
12942 """
1bd55598 12943 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
12944 self._setOORInfo(self)
12945
d55e5bfc 12946 def SetCols(*args, **kwargs):
bfddbb17
RD
12947 """
12948 SetCols(self, int cols)
12949
12950 Sets the number of columns in the sizer.
12951 """
5b5c9bc7 12952 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
12953
12954 def SetRows(*args, **kwargs):
bfddbb17
RD
12955 """
12956 SetRows(self, int rows)
12957
12958 Sets the number of rows in the sizer.
12959 """
5b5c9bc7 12960 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
12961
12962 def SetVGap(*args, **kwargs):
bfddbb17
RD
12963 """
12964 SetVGap(self, int gap)
12965
12966 Sets the vertical gap (in pixels) between the cells in the sizer.
12967 """
5b5c9bc7 12968 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
12969
12970 def SetHGap(*args, **kwargs):
bfddbb17
RD
12971 """
12972 SetHGap(self, int gap)
12973
12974 Sets the horizontal gap (in pixels) between cells in the sizer
12975 """
5b5c9bc7 12976 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
12977
12978 def GetCols(*args, **kwargs):
bfddbb17
RD
12979 """
12980 GetCols(self) -> int
12981
12982 Returns the number of columns in the sizer.
12983 """
5b5c9bc7 12984 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
12985
12986 def GetRows(*args, **kwargs):
bfddbb17
RD
12987 """
12988 GetRows(self) -> int
12989
12990 Returns the number of rows in the sizer.
12991 """
5b5c9bc7 12992 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
12993
12994 def GetVGap(*args, **kwargs):
bfddbb17
RD
12995 """
12996 GetVGap(self) -> int
12997
12998 Returns the vertical gap (in pixels) between the cells in the sizer.
12999 """
5b5c9bc7 13000 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
13001
13002 def GetHGap(*args, **kwargs):
bfddbb17
RD
13003 """
13004 GetHGap(self) -> int
13005
13006 Returns the horizontal gap (in pixels) between cells in the sizer.
13007 """
5b5c9bc7 13008 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc 13009
1bd55598
RD
13010 def CalcRowsCols(self):
13011 """
13012 CalcRowsCols() -> (rows, cols)
13013
13014 Calculates how many rows and columns will be in the sizer based
13015 on the current number of items and also the rows, cols specified
13016 in the constructor.
13017 """
13018 nitems = len(self.GetChildren())
13019 rows = self.GetRows()
13020 cols = self.GetCols()
13021 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
13022 if cols != 0:
13023 rows = (nitems + cols - 1) / cols
13024 elif rows != 0:
13025 cols = (nitems + rows - 1) / rows
13026 return (rows, cols)
d55e5bfc 13027
ac5d357a
RD
13028 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
13029 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
13030 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
13031 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
2131d850 13032_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
13033
13034#---------------------------------------------------------------------------
13035
5b5c9bc7
RD
13036FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
13037FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
13038FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
13039class FlexGridSizer(GridSizer):
bfddbb17
RD
13040 """
13041 A flex grid sizer is a sizer which lays out its children in a
13042 two-dimensional table with all table cells in one row having the same
13043 height and all cells in one column having the same width, but all
13044 rows or all columns are not necessarily the same height or width as in
13045 the `wx.GridSizer`.
13046
13047 wx.FlexGridSizer can also size items equally in one direction but
13048 unequally ("flexibly") in the other. If the sizer is only flexible
13049 in one direction (this can be changed using `SetFlexibleDirection`), it
13050 needs to be decided how the sizer should grow in the other ("non
13051 flexible") direction in order to fill the available space. The
13052 `SetNonFlexibleGrowMode` method serves this purpose.
13053
13054
13055 """
1bd55598
RD
13056 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13057 __repr__ = _swig_repr
13058 def __init__(self, *args, **kwargs):
bfddbb17 13059 """
5b5c9bc7 13060 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
13061
13062 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
13063 number of columns and rows in the sizer - if either of the parameters
13064 is zero, it will be calculated to from the total number of children in
13065 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13066 define extra space between all children.
13067 """
1bd55598 13068 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
13069 self._setOORInfo(self)
13070
bfddbb17
RD
13071 def AddGrowableRow(*args, **kwargs):
13072 """
13073 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 13074
bfddbb17
RD
13075 Specifies that row *idx* (starting from zero) should be grown if there
13076 is extra space available to the sizer.
d55e5bfc 13077
bfddbb17
RD
13078 The *proportion* parameter has the same meaning as the stretch factor
13079 for the box sizers except that if all proportions are 0, then all
13080 columns are resized equally (instead of not being resized at all).
13081 """
5b5c9bc7 13082 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
13083
13084 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
13085 """
13086 RemoveGrowableRow(self, size_t idx)
13087
13088 Specifies that row *idx* is no longer growable.
13089 """
5b5c9bc7 13090 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
13091
13092 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
13093 """
13094 AddGrowableCol(self, size_t idx, int proportion=0)
13095
13096 Specifies that column *idx* (starting from zero) should be grown if
13097 there is extra space available to the sizer.
13098
13099 The *proportion* parameter has the same meaning as the stretch factor
13100 for the box sizers except that if all proportions are 0, then all
13101 columns are resized equally (instead of not being resized at all).
13102 """
5b5c9bc7 13103 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
13104
13105 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
13106 """
13107 RemoveGrowableCol(self, size_t idx)
13108
13109 Specifies that column *idx* is no longer growable.
13110 """
5b5c9bc7 13111 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
13112
13113 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
13114 """
13115 SetFlexibleDirection(self, int direction)
13116
13117 Specifies whether the sizer should flexibly resize its columns, rows,
13118 or both. Argument *direction* can be one of the following values. Any
13119 other value is ignored.
13120
13121 ============== =======================================
13122 wx.VERTICAL Rows are flexibly sized.
13123 wx.HORIZONTAL Columns are flexibly sized.
13124 wx.BOTH Both rows and columns are flexibly sized
13125 (this is the default value).
13126 ============== =======================================
13127
13128 Note that this method does not trigger relayout.
13129
13130 """
5b5c9bc7 13131 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
13132
13133 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
13134 """
13135 GetFlexibleDirection(self) -> int
13136
13137 Returns a value that specifies whether the sizer
13138 flexibly resizes its columns, rows, or both (default).
13139
13140 :see: `SetFlexibleDirection`
13141 """
5b5c9bc7 13142 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
13143
13144 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
13145 """
13146 SetNonFlexibleGrowMode(self, int mode)
13147
13148 Specifies how the sizer should grow in the non-flexible direction if
13149 there is one (so `SetFlexibleDirection` must have been called
13150 previously). Argument *mode* can be one of the following values:
13151
13152 ========================== =================================================
13153 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
13154 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
13155 `AddGrowableCol` and `AddGrowableRow`. In this
13156 case equal sizing applies to minimum sizes of
13157 columns or rows (this is the default value).
13158 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
13159 the non flexible direction, whether they are
13160 growable or not in the flexbile direction.
13161 ========================== =================================================
13162
13163 Note that this method does not trigger relayout.
bfddbb17 13164 """
5b5c9bc7 13165 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
13166
13167 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
13168 """
13169 GetNonFlexibleGrowMode(self) -> int
13170
13171 Returns the value that specifies how the sizer grows in the
13172 non-flexible direction if there is one.
13173
13174 :see: `SetNonFlexibleGrowMode`
13175 """
5b5c9bc7 13176 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
13177
13178 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
13179 """
13180 GetRowHeights(self) -> list
13181
13182 Returns a list of integers representing the heights of each of the
13183 rows in the sizer.
13184 """
5b5c9bc7 13185 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
13186
13187 def GetColWidths(*args, **kwargs):
fd2dc343
RD
13188 """
13189 GetColWidths(self) -> list
13190
13191 Returns a list of integers representing the widths of each of the
13192 columns in the sizer.
13193 """
5b5c9bc7 13194 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc 13195
ac5d357a
RD
13196 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
13197 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
13198 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
13199 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
2131d850 13200_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 13201
5b5c9bc7 13202class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
13203 """
13204 A special sizer that knows how to order and position standard buttons
13205 in order to conform to the current platform's standards. You simply
13206 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 13207 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
13208 will take care of the rest.
13209
13210 """
1bd55598
RD
13211 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13212 __repr__ = _swig_repr
13213 def __init__(self, *args, **kwargs):
5b5c9bc7 13214 """__init__(self) -> StdDialogButtonSizer"""
1bd55598 13215 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
13216 def AddButton(*args, **kwargs):
13217 """
13218 AddButton(self, wxButton button)
13219
13220 Use this to add the buttons to this sizer. Do not use the `Add`
13221 method in the base class.
13222 """
5b5c9bc7 13223 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 13224
53aa7709 13225 def Realize(*args, **kwargs):
62d32a5f 13226 """
53aa7709 13227 Realize(self)
62d32a5f
RD
13228
13229 This funciton needs to be called after all the buttons have been added
13230 to the sizer. It will reorder them and position them in a platform
13231 specifc manner.
13232 """
5b5c9bc7 13233 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
13234
13235 def SetAffirmativeButton(*args, **kwargs):
13236 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 13237 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
13238
13239 def SetNegativeButton(*args, **kwargs):
13240 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 13241 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
13242
13243 def SetCancelButton(*args, **kwargs):
13244 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 13245 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
13246
13247 def GetAffirmativeButton(*args, **kwargs):
13248 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 13249 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
13250
13251 def GetApplyButton(*args, **kwargs):
13252 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 13253 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
13254
13255 def GetNegativeButton(*args, **kwargs):
13256 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 13257 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
13258
13259 def GetCancelButton(*args, **kwargs):
13260 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 13261 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
13262
13263 def GetHelpButton(*args, **kwargs):
13264 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 13265 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f 13266
33d6fd3b
RD
13267 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
13268 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
13269 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
13270 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
13271 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
2131d850 13272_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 13273
d55e5bfc
RD
13274#---------------------------------------------------------------------------
13275
5b5c9bc7 13276class GBPosition(object):
bfddbb17
RD
13277 """
13278 This class represents the position of an item in a virtual grid of
13279 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13280 typemaps that will automatically convert from a 2-element sequence of
13281 integers to a wx.GBPosition, so you can use the more pythonic
13282 representation of the position nearly transparently in Python code.
13283 """
1bd55598
RD
13284 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13285 __repr__ = _swig_repr
13286 def __init__(self, *args, **kwargs):
bfddbb17 13287 """
5b5c9bc7 13288 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
13289
13290 This class represents the position of an item in a virtual grid of
13291 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13292 typemaps that will automatically convert from a 2-element sequence of
13293 integers to a wx.GBPosition, so you can use the more pythonic
13294 representation of the position nearly transparently in Python code.
13295 """
1bd55598
RD
13296 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
13297 __swig_destroy__ = _core_.delete_GBPosition
13298 __del__ = lambda self : None;
d55e5bfc
RD
13299 def GetRow(*args, **kwargs):
13300 """GetRow(self) -> int"""
5b5c9bc7 13301 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
13302
13303 def GetCol(*args, **kwargs):
13304 """GetCol(self) -> int"""
5b5c9bc7 13305 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
13306
13307 def SetRow(*args, **kwargs):
13308 """SetRow(self, int row)"""
5b5c9bc7 13309 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
13310
13311 def SetCol(*args, **kwargs):
13312 """SetCol(self, int col)"""
5b5c9bc7 13313 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
13314
13315 def __eq__(*args, **kwargs):
e9d6f3a4
RD
13316 """
13317 __eq__(self, PyObject other) -> bool
13318
13319 Compare GBPosition for equality.
13320 """
5b5c9bc7 13321 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
13322
13323 def __ne__(*args, **kwargs):
e9d6f3a4
RD
13324 """
13325 __ne__(self, PyObject other) -> bool
13326
13327 Compare GBPosition for inequality.
13328 """
5b5c9bc7 13329 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
13330
13331 def Set(*args, **kwargs):
13332 """Set(self, int row=0, int col=0)"""
5b5c9bc7 13333 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
13334
13335 def Get(*args, **kwargs):
13336 """Get(self) -> PyObject"""
5b5c9bc7 13337 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 13338
15817c7e 13339 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
13340 def __str__(self): return str(self.Get())
13341 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
13342 def __len__(self): return len(self.Get())
13343 def __getitem__(self, index): return self.Get()[index]
13344 def __setitem__(self, index, val):
13345 if index == 0: self.SetRow(val)
13346 elif index == 1: self.SetCol(val)
13347 else: raise IndexError
13348 def __nonzero__(self): return self.Get() != (0,0)
13349 __safe_for_unpickling__ = True
13350 def __reduce__(self): return (wx.GBPosition, self.Get())
13351
13352 row = property(GetRow, SetRow)
13353 col = property(GetCol, SetCol)
13354
2131d850 13355_core_.GBPosition_swigregister(GBPosition)
d55e5bfc 13356
5b5c9bc7 13357class GBSpan(object):
bfddbb17
RD
13358 """
13359 This class is used to hold the row and column spanning attributes of
13360 items in a `wx.GridBagSizer`. wxPython has typemaps that will
13361 automatically convert from a 2-element sequence of integers to a
13362 wx.GBSpan, so you can use the more pythonic representation of the span
13363 nearly transparently in Python code.
13364
13365 """
1bd55598
RD
13366 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13367 __repr__ = _swig_repr
13368 def __init__(self, *args, **kwargs):
bfddbb17 13369 """
5b5c9bc7 13370 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
13371
13372 Construct a new wxGBSpan, optionally setting the rowspan and
13373 colspan. The default is (1,1). (Meaning that the item occupies one
13374 cell in each direction.
13375 """
1bd55598
RD
13376 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
13377 __swig_destroy__ = _core_.delete_GBSpan
13378 __del__ = lambda self : None;
d55e5bfc
RD
13379 def GetRowspan(*args, **kwargs):
13380 """GetRowspan(self) -> int"""
5b5c9bc7 13381 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
13382
13383 def GetColspan(*args, **kwargs):
13384 """GetColspan(self) -> int"""
5b5c9bc7 13385 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
13386
13387 def SetRowspan(*args, **kwargs):
13388 """SetRowspan(self, int rowspan)"""
5b5c9bc7 13389 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
13390
13391 def SetColspan(*args, **kwargs):
13392 """SetColspan(self, int colspan)"""
5b5c9bc7 13393 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
13394
13395 def __eq__(*args, **kwargs):
e9d6f3a4
RD
13396 """
13397 __eq__(self, PyObject other) -> bool
13398
13399 Compare wxGBSpan for equality.
13400 """
5b5c9bc7 13401 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
13402
13403 def __ne__(*args, **kwargs):
e9d6f3a4
RD
13404 """
13405 __ne__(self, PyObject other) -> bool
13406
13407 Compare GBSpan for inequality.
13408 """
5b5c9bc7 13409 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
13410
13411 def Set(*args, **kwargs):
13412 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 13413 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
13414
13415 def Get(*args, **kwargs):
13416 """Get(self) -> PyObject"""
5b5c9bc7 13417 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 13418
15817c7e 13419 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
13420 def __str__(self): return str(self.Get())
13421 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
13422 def __len__(self): return len(self.Get())
13423 def __getitem__(self, index): return self.Get()[index]
13424 def __setitem__(self, index, val):
13425 if index == 0: self.SetRowspan(val)
13426 elif index == 1: self.SetColspan(val)
13427 else: raise IndexError
13428 def __nonzero__(self): return self.Get() != (0,0)
13429 __safe_for_unpickling__ = True
13430 def __reduce__(self): return (wx.GBSpan, self.Get())
13431
13432 rowspan = property(GetRowspan, SetRowspan)
13433 colspan = property(GetColspan, SetColspan)
13434
2131d850 13435_core_.GBSpan_swigregister(GBSpan)
d55e5bfc 13436
5b5c9bc7 13437class GBSizerItem(SizerItem):
bfddbb17
RD
13438 """
13439 The wx.GBSizerItem class is used to track the additional data about
13440 items in a `wx.GridBagSizer` such as the item's position in the grid
13441 and how many rows or columns it spans.
13442
13443 """
1bd55598
RD
13444 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13445 __repr__ = _swig_repr
13446 def __init__(self, *args, **kwargs):
bfddbb17 13447 """
5b5c9bc7 13448 __init__(self) -> GBSizerItem
bfddbb17
RD
13449
13450 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
13451 size will need to be set, as well as a position and span before this
13452 item can be used in a Sizer.
13453
13454 You will probably never need to create a wx.GBSizerItem directly as they
13455 are created automatically when the sizer's Add method is called.
13456 """
1bd55598
RD
13457 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
13458 __swig_destroy__ = _core_.delete_GBSizerItem
13459 __del__ = lambda self : None;
d55e5bfc 13460 def GetPos(*args, **kwargs):
bfddbb17 13461 """
5b5c9bc7 13462 GetPos(self) -> GBPosition
bfddbb17
RD
13463
13464 Get the grid position of the item
13465 """
5b5c9bc7 13466 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
13467
13468 def GetPosTuple(self): return self.GetPos().Get()
13469 def GetSpan(*args, **kwargs):
bfddbb17 13470 """
5b5c9bc7 13471 GetSpan(self) -> GBSpan
bfddbb17
RD
13472
13473 Get the row and column spanning of the item
13474 """
5b5c9bc7 13475 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
13476
13477 def GetSpanTuple(self): return self.GetSpan().Get()
13478 def SetPos(*args, **kwargs):
bfddbb17 13479 """
5b5c9bc7 13480 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
13481
13482 If the item is already a member of a sizer then first ensure that
13483 there is no other item that would intersect with this one at the new
13484 position, then set the new position. Returns True if the change is
13485 successful and after the next Layout() the item will be moved.
13486 """
5b5c9bc7 13487 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
13488
13489 def SetSpan(*args, **kwargs):
bfddbb17 13490 """
5b5c9bc7 13491 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
13492
13493 If the item is already a member of a sizer then first ensure that
13494 there is no other item that would intersect with this one with its new
13495 spanning size, then set the new spanning. Returns True if the change
13496 is successful and after the next Layout() the item will be resized.
13497
13498 """
5b5c9bc7 13499 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 13500
bfddbb17 13501 def Intersects(*args, **kwargs):
d55e5bfc 13502 """
5b5c9bc7 13503 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
13504
13505 Returns True if this item and the other item instersect.
d55e5bfc 13506 """
5b5c9bc7 13507 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
13508
13509 def IntersectsPos(*args, **kwargs):
13510 """
5b5c9bc7 13511 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
13512
13513 Returns True if the given pos/span would intersect with this item.
13514 """
5b5c9bc7 13515 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
13516
13517 def GetEndPos(*args, **kwargs):
bfddbb17 13518 """
5b5c9bc7 13519 GetEndPos(self) -> GBPosition
bfddbb17
RD
13520
13521 Get the row and column of the endpoint of this item.
13522 """
5b5c9bc7 13523 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
13524
13525 def GetGBSizer(*args, **kwargs):
bfddbb17 13526 """
5b5c9bc7 13527 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
13528
13529 Get the sizer this item is a member of.
13530 """
5b5c9bc7 13531 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
13532
13533 def SetGBSizer(*args, **kwargs):
bfddbb17 13534 """
5b5c9bc7 13535 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
13536
13537 Set the sizer this item is a member of.
13538 """
5b5c9bc7 13539 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc 13540
ac5d357a
RD
13541 EndPos = property(GetEndPos,doc="See `GetEndPos`")
13542 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
13543 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
13544 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
2131d850 13545_core_.GBSizerItem_swigregister(GBSizerItem)
5b5c9bc7 13546DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
13547
13548def GBSizerItemWindow(*args, **kwargs):
13549 """
5b5c9bc7
RD
13550 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
13551 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
13552
13553 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 13554 """
5b5c9bc7 13555 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
13556 return val
13557
13558def GBSizerItemSizer(*args, **kwargs):
13559 """
5b5c9bc7
RD
13560 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
13561 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
13562
13563 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 13564 """
5b5c9bc7 13565 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
13566 return val
13567
13568def GBSizerItemSpacer(*args, **kwargs):
13569 """
5b5c9bc7
RD
13570 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
13571 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
13572
13573 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 13574 """
5b5c9bc7 13575 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
13576 return val
13577
5b5c9bc7 13578class GridBagSizer(FlexGridSizer):
bfddbb17
RD
13579 """
13580 A `wx.Sizer` that can lay out items in a virtual grid like a
13581 `wx.FlexGridSizer` but in this case explicit positioning of the items
13582 is allowed using `wx.GBPosition`, and items can optionally span more
13583 than one row and/or column using `wx.GBSpan`. The total size of the
13584 virtual grid is determined by the largest row and column that items are
13585 positioned at, adjusted for spanning.
13586
13587 """
1bd55598
RD
13588 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13589 __repr__ = _swig_repr
13590 def __init__(self, *args, **kwargs):
bfddbb17 13591 """
5b5c9bc7 13592 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
13593
13594 Constructor, with optional parameters to specify the gap between the
13595 rows and columns.
13596 """
1bd55598 13597 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
03e46024
RD
13598 self._setOORInfo(self)
13599
d55e5bfc
RD
13600 def Add(*args, **kwargs):
13601 """
bfddbb17 13602 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 13603 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
13604
13605 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13606 more than one row or column as specified with *span*. The remaining
13607 args behave similarly to `wx.Sizer.Add`.
13608
13609 Returns True if the item was successfully placed at the given cell
13610 position, False if something was already there.
13611
d55e5bfc 13612 """
5b5c9bc7 13613 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
13614
13615 def AddItem(*args, **kwargs):
bfddbb17 13616 """
070c48b4 13617 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
13618
13619 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13620 the item was successfully placed at its given cell position, False if
13621 something was already there.
13622 """
5b5c9bc7 13623 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 13624
84f85550
RD
13625 def GetCellSize(*args, **kwargs):
13626 """
5b5c9bc7 13627 GetCellSize(self, int row, int col) -> Size
84f85550
RD
13628
13629 Get the size of the specified cell, including hgap and
13630 vgap. Only valid after a Layout.
13631 """
5b5c9bc7 13632 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 13633
d55e5bfc 13634 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 13635 """
5b5c9bc7 13636 GetEmptyCellSize(self) -> Size
bfddbb17
RD
13637
13638 Get the size used for cells in the grid with no item.
13639 """
5b5c9bc7 13640 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
13641
13642 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 13643 """
5b5c9bc7 13644 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
13645
13646 Set the size used for cells in the grid with no item.
13647 """
5b5c9bc7 13648 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
13649
13650 def GetItemPosition(*args):
13651 """
bfddbb17
RD
13652 GetItemPosition(self, item) -> GBPosition
13653
13654 Get the grid position of the specified *item* where *item* is either a
13655 window or subsizer that is a member of this sizer, or a zero-based
13656 index of an item.
d55e5bfc 13657 """
5b5c9bc7 13658 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
13659
13660 def SetItemPosition(*args):
13661 """
bfddbb17
RD
13662 SetItemPosition(self, item, GBPosition pos) -> bool
13663
13664 Set the grid position of the specified *item* where *item* is either a
13665 window or subsizer that is a member of this sizer, or a zero-based
13666 index of an item. Returns True on success. If the move is not
13667 allowed (because an item is already there) then False is returned.
13668
d55e5bfc 13669 """
5b5c9bc7 13670 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
13671
13672 def GetItemSpan(*args):
13673 """
bfddbb17
RD
13674 GetItemSpan(self, item) -> GBSpan
13675
13676 Get the row/col spanning of the specified *item* where *item* is
13677 either a window or subsizer that is a member of this sizer, or a
13678 zero-based index of an item.
d55e5bfc 13679 """
5b5c9bc7 13680 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
13681
13682 def SetItemSpan(*args):
13683 """
bfddbb17
RD
13684 SetItemSpan(self, item, GBSpan span) -> bool
13685
13686 Set the row/col spanning of the specified *item* where *item* is
13687 either a window or subsizer that is a member of this sizer, or a
13688 zero-based index of an item. Returns True on success. If the move is
13689 not allowed (because an item is already there) then False is returned.
d55e5bfc 13690 """
5b5c9bc7 13691 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
13692
13693 def FindItem(*args):
13694 """
bfddbb17
RD
13695 FindItem(self, item) -> GBSizerItem
13696
13697 Find the sizer item for the given window or subsizer, returns None if
13698 not found. (non-recursive)
d55e5bfc 13699 """
5b5c9bc7 13700 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc 13701
b08d67c2
RD
13702 def GetItem(self, item):
13703 gbsi = None
13704 si = wx.FlexGridSizer.GetItem(self, item)
13705 if not si:
13706 return None
13707 if type(item) is not int:
13708 gbsi = self.FindItem(item)
13709 if gbsi: return gbsi
13710 return si
13711
d55e5bfc 13712 def FindItemAtPosition(*args, **kwargs):
bfddbb17 13713 """
5b5c9bc7 13714 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
13715
13716 Return the sizer item for the given grid cell, or None if there is no
13717 item at that position. (non-recursive)
13718 """
5b5c9bc7 13719 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
13720
13721 def FindItemAtPoint(*args, **kwargs):
bfddbb17 13722 """
5b5c9bc7 13723 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
13724
13725 Return the sizer item located at the point given in *pt*, or None if
13726 there is no item at that point. The (x,y) coordinates in pt correspond
13727 to the client coordinates of the window using the sizer for
13728 layout. (non-recursive)
13729 """
5b5c9bc7 13730 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 13731
bfddbb17
RD
13732 def CheckForIntersection(*args, **kwargs):
13733 """
5b5c9bc7 13734 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 13735
bfddbb17
RD
13736 Look at all items and see if any intersect (or would overlap) the
13737 given *item*. Returns True if so, False if there would be no overlap.
13738 If an *excludeItem* is given then it will not be checked for
13739 intersection, for example it may be the item we are checking the
13740 position of.
d55e5bfc 13741
bfddbb17 13742 """
5b5c9bc7 13743 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 13744
bfddbb17 13745 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 13746 """
5b5c9bc7 13747 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
13748
13749 Look at all items and see if any intersect (or would overlap) the
13750 given position and span. Returns True if so, False if there would be
13751 no overlap. If an *excludeItem* is given then it will not be checked
13752 for intersection, for example it may be the item we are checking the
13753 position of.
d55e5bfc 13754 """
5b5c9bc7 13755 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 13756
2131d850 13757_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
13758
13759#---------------------------------------------------------------------------
13760
5b5c9bc7
RD
13761Left = _core_.Left
13762Top = _core_.Top
13763Right = _core_.Right
13764Bottom = _core_.Bottom
13765Width = _core_.Width
13766Height = _core_.Height
13767Centre = _core_.Centre
13768Center = _core_.Center
13769CentreX = _core_.CentreX
13770CentreY = _core_.CentreY
13771Unconstrained = _core_.Unconstrained
13772AsIs = _core_.AsIs
13773PercentOf = _core_.PercentOf
13774Above = _core_.Above
13775Below = _core_.Below
13776LeftOf = _core_.LeftOf
13777RightOf = _core_.RightOf
13778SameAs = _core_.SameAs
13779Absolute = _core_.Absolute
13780class IndividualLayoutConstraint(Object):
d55e5bfc 13781 """
15817c7e
RD
13782 Objects of this class are stored in the `wx.LayoutConstraints` class as
13783 one of eight possible constraints that a window can be involved in.
13784 You will never need to create an instance of
13785 wx.IndividualLayoutConstraint, rather you should create a
13786 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 13787 that it contains.
d55e5bfc 13788 """
1bd55598
RD
13789 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13790 def __init__(self): raise AttributeError, "No constructor defined"
13791 __repr__ = _swig_repr
d55e5bfc 13792 def Set(*args, **kwargs):
15817c7e 13793 """
5b5c9bc7 13794 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
13795
13796 Sets the properties of the constraint. Normally called by one of the
13797 convenience functions such as Above, RightOf, SameAs.
13798 """
5b5c9bc7 13799 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
13800
13801 def LeftOf(*args, **kwargs):
13802 """
5b5c9bc7 13803 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 13804
15817c7e
RD
13805 Constrains this edge to be to the left of the given window, with an
13806 optional margin. Implicitly, this is relative to the left edge of the
13807 other window.
d55e5bfc 13808 """
5b5c9bc7 13809 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
13810
13811 def RightOf(*args, **kwargs):
13812 """
5b5c9bc7 13813 RightOf(self, Window sibling, int marg=0)
d55e5bfc 13814
15817c7e
RD
13815 Constrains this edge to be to the right of the given window, with an
13816 optional margin. Implicitly, this is relative to the right edge of the
13817 other window.
d55e5bfc 13818 """
5b5c9bc7 13819 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
13820
13821 def Above(*args, **kwargs):
13822 """
5b5c9bc7 13823 Above(self, Window sibling, int marg=0)
d55e5bfc 13824
15817c7e
RD
13825 Constrains this edge to be above the given window, with an optional
13826 margin. Implicitly, this is relative to the top edge of the other
13827 window.
d55e5bfc 13828 """
5b5c9bc7 13829 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
13830
13831 def Below(*args, **kwargs):
13832 """
5b5c9bc7 13833 Below(self, Window sibling, int marg=0)
d55e5bfc 13834
15817c7e
RD
13835 Constrains this edge to be below the given window, with an optional
13836 margin. Implicitly, this is relative to the bottom edge of the other
13837 window.
d55e5bfc 13838 """
5b5c9bc7 13839 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
13840
13841 def SameAs(*args, **kwargs):
13842 """
5b5c9bc7 13843 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 13844
15817c7e
RD
13845 Constrains this edge or dimension to be to the same as the edge of the
13846 given window, with an optional margin.
d55e5bfc 13847 """
5b5c9bc7 13848 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
13849
13850 def PercentOf(*args, **kwargs):
13851 """
5b5c9bc7 13852 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 13853
15817c7e
RD
13854 Constrains this edge or dimension to be to a percentage of the given
13855 window, with an optional margin.
d55e5bfc 13856 """
5b5c9bc7 13857 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
13858
13859 def Absolute(*args, **kwargs):
13860 """
13861 Absolute(self, int val)
13862
15817c7e 13863 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 13864 """
5b5c9bc7 13865 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
13866
13867 def Unconstrained(*args, **kwargs):
13868 """
13869 Unconstrained(self)
13870
15817c7e
RD
13871 Sets this edge or dimension to be unconstrained, that is, dependent on
13872 other edges and dimensions from which this value can be deduced.
d55e5bfc 13873 """
5b5c9bc7 13874 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
13875
13876 def AsIs(*args, **kwargs):
13877 """
13878 AsIs(self)
13879
15817c7e
RD
13880 Sets this edge or constraint to be whatever the window's value is at
13881 the moment. If either of the width and height constraints are *as is*,
13882 the window will not be resized, but moved instead. This is important
13883 when considering panel items which are intended to have a default
13884 size, such as a button, which may take its size from the size of the
13885 button label.
d55e5bfc 13886 """
5b5c9bc7 13887 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
13888
13889 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
13890 """GetOtherWindow(self) -> Window"""
13891 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
13892
13893 def GetMyEdge(*args, **kwargs):
13894 """GetMyEdge(self) -> int"""
5b5c9bc7 13895 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
13896
13897 def SetEdge(*args, **kwargs):
13898 """SetEdge(self, int which)"""
5b5c9bc7 13899 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
13900
13901 def SetValue(*args, **kwargs):
13902 """SetValue(self, int v)"""
5b5c9bc7 13903 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
13904
13905 def GetMargin(*args, **kwargs):
13906 """GetMargin(self) -> int"""
5b5c9bc7 13907 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
13908
13909 def SetMargin(*args, **kwargs):
13910 """SetMargin(self, int m)"""
5b5c9bc7 13911 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
13912
13913 def GetValue(*args, **kwargs):
13914 """GetValue(self) -> int"""
5b5c9bc7 13915 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
13916
13917 def GetPercent(*args, **kwargs):
13918 """GetPercent(self) -> int"""
5b5c9bc7 13919 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
13920
13921 def GetOtherEdge(*args, **kwargs):
13922 """GetOtherEdge(self) -> int"""
5b5c9bc7 13923 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
13924
13925 def GetDone(*args, **kwargs):
13926 """GetDone(self) -> bool"""
5b5c9bc7 13927 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
13928
13929 def SetDone(*args, **kwargs):
13930 """SetDone(self, bool d)"""
5b5c9bc7 13931 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
13932
13933 def GetRelationship(*args, **kwargs):
13934 """GetRelationship(self) -> int"""
5b5c9bc7 13935 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
13936
13937 def SetRelationship(*args, **kwargs):
13938 """SetRelationship(self, int r)"""
5b5c9bc7 13939 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
13940
13941 def ResetIfWin(*args, **kwargs):
13942 """
5b5c9bc7 13943 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
13944
13945 Reset constraint if it mentions otherWin
13946 """
5b5c9bc7 13947 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
13948
13949 def SatisfyConstraint(*args, **kwargs):
13950 """
5b5c9bc7 13951 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
13952
13953 Try to satisfy constraint
13954 """
5b5c9bc7 13955 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
13956
13957 def GetEdge(*args, **kwargs):
13958 """
5b5c9bc7 13959 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
13960
13961 Get the value of this edge or dimension, or if this
13962 is not determinable, -1.
13963 """
5b5c9bc7 13964 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc 13965
ac5d357a
RD
13966 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13967 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13968 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13969 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13970 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13971 Percent = property(GetPercent,doc="See `GetPercent`")
13972 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13973 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
2131d850 13974_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc 13975
5b5c9bc7 13976class LayoutConstraints(Object):
d55e5bfc 13977 """
15817c7e
RD
13978 **Note:** constraints are now deprecated and you should use sizers
13979 instead.
d55e5bfc 13980
15817c7e
RD
13981 Objects of this class can be associated with a window to define its
13982 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
13983
13984 The class consists of the following eight constraints of class
13985 wx.IndividualLayoutConstraint, some or all of which should be accessed
13986 directly to set the appropriate constraints.
13987
13988 * left: represents the left hand edge of the window
13989 * right: represents the right hand edge of the window
13990 * top: represents the top edge of the window
13991 * bottom: represents the bottom edge of the window
13992 * width: represents the width of the window
13993 * height: represents the height of the window
13994 * centreX: represents the horizontal centre point of the window
13995 * centreY: represents the vertical centre point of the window
13996
15817c7e
RD
13997 Most constraints are initially set to have the relationship
13998 wxUnconstrained, which means that their values should be calculated by
13999 looking at known constraints. The exceptions are width and height,
14000 which are set to wxAsIs to ensure that if the user does not specify a
14001 constraint, the existing width and height will be used, to be
14002 compatible with panel items which often have take a default size. If
14003 the constraint is ``wx.AsIs``, the dimension will not be changed.
14004
14005 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
14006
14007 """
1bd55598
RD
14008 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
14009 __repr__ = _swig_repr
5b5c9bc7
RD
14010 left = property(_core_.LayoutConstraints_left_get)
14011 top = property(_core_.LayoutConstraints_top_get)
14012 right = property(_core_.LayoutConstraints_right_get)
14013 bottom = property(_core_.LayoutConstraints_bottom_get)
14014 width = property(_core_.LayoutConstraints_width_get)
14015 height = property(_core_.LayoutConstraints_height_get)
14016 centreX = property(_core_.LayoutConstraints_centreX_get)
14017 centreY = property(_core_.LayoutConstraints_centreY_get)
1bd55598 14018 def __init__(self, *args, **kwargs):
5b5c9bc7 14019 """__init__(self) -> LayoutConstraints"""
1bd55598
RD
14020 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
14021 __swig_destroy__ = _core_.delete_LayoutConstraints
14022 __del__ = lambda self : None;
d55e5bfc
RD
14023 def SatisfyConstraints(*args, **kwargs):
14024 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 14025 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
14026
14027 def AreSatisfied(*args, **kwargs):
14028 """AreSatisfied(self) -> bool"""
5b5c9bc7 14029 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc 14030
2131d850 14031_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
14032
14033#----------------------------------------------------------------------------
14034
14035# Use Python's bool constants if available, make some if not
14036try:
14037 True
14038except NameError:
14039 __builtins__.True = 1==1
14040 __builtins__.False = 1==0
14041 def bool(value): return not not value
14042 __builtins__.bool = bool
14043
14044
14045
14046# workarounds for bad wxRTTI names
14047__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
14048__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
14049__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
14050
14051
14052#----------------------------------------------------------------------------
14053# Load version numbers from __version__... Ensure that major and minor
0f63ec68 14054# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
14055
14056from __version__ import *
14057__version__ = VERSION_STRING
14058
0f63ec68
RD
14059assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
14060assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
14061if RELEASE_VERSION != _core_.RELEASE_VERSION:
14062 import warnings
0f63ec68 14063 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc 14064
f9bf356b
RD
14065
14066def version():
14067 """Returns a string containing version and port info"""
14068 ctype = wx.USE_UNICODE and 'unicode' or 'ansi'
14069 if wx.Platform == '__WXMSW__':
14070 port = 'msw'
14071 elif wx.Platform == '__WXMAC__':
14072 port = 'mac'
14073 elif wx.Platform == '__WXGTK__':
14074 port = 'gtk'
14075 if 'gtk2' in wx.PlatformInfo:
14076 port = 'gtk2'
14077 else:
14078 port = '?'
14079
14080 return "%s (%s-%s)" % (wx.VERSION_STRING, port, ctype)
14081
14082
d55e5bfc
RD
14083#----------------------------------------------------------------------------
14084
7993762b
RD
14085# Set wxPython's default string<-->unicode conversion encoding from
14086# the locale, but only if Python's default hasn't been changed. (We
14087# assume that if the user has customized it already then that is the
14088# encoding we need to use as well.)
14089#
14090# The encoding selected here is used when string or unicode objects
14091# need to be converted in order to pass them to wxWidgets. Please be
14092# aware that the default encoding within the same locale may be
14093# slightly different on different platforms. For example, please see
62d32a5f
RD
14094# http://www.alanwood.net/demos/charsetdiffs.html for differences
14095# between the common latin/roman encodings.
3837a853
RD
14096
14097default = _sys.getdefaultencoding()
14098if default == 'ascii':
14099 import locale
14100 import codecs
14101 try:
474e2ff2
RD
14102 if hasattr(locale, 'getpreferredencoding'):
14103 default = locale.getpreferredencoding()
14104 else:
14105 default = locale.getdefaultlocale()[1]
3837a853 14106 codecs.lookup(default)
7993762b 14107 except (ValueError, LookupError, TypeError):
3837a853
RD
14108 default = _sys.getdefaultencoding()
14109 del locale
14110 del codecs
5cbf236d
RD
14111if default:
14112 wx.SetDefaultPyEncoding(default)
14113del default
5cbf236d
RD
14114
14115#----------------------------------------------------------------------------
14116
d55e5bfc
RD
14117class PyDeadObjectError(AttributeError):
14118 pass
14119
14120class _wxPyDeadObject(object):
14121 """
14122 Instances of wx objects that are OOR capable will have their __class__
14123 changed to this class when the C++ object is deleted. This should help
14124 prevent crashes due to referencing a bogus C++ pointer.
14125 """
14126 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
14127 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
14128
14129 def __repr__(self):
14130 if not hasattr(self, "_name"):
14131 self._name = "[unknown]"
14132 return self.reprStr % self._name
14133
14134 def __getattr__(self, *args):
14135 if not hasattr(self, "_name"):
14136 self._name = "[unknown]"
14137 raise PyDeadObjectError(self.attrStr % self._name)
14138
14139 def __nonzero__(self):
14140 return 0
14141
14142
14143
14144class PyUnbornObjectError(AttributeError):
14145 pass
14146
14147class _wxPyUnbornObject(object):
14148 """
14149 Some stock objects are created when the wx._core module is
14150 imported, but their C++ instance is not created until the wx.App
14151 object is created and initialized. These object instances will
14152 temporarily have their __class__ changed to this class so an
14153 exception will be raised if they are used before the C++ instance
14154 is ready.
14155 """
14156
14157 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
14158 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
14159
14160 def __repr__(self):
14161 #if not hasattr(self, "_name"):
14162 # self._name = "[unknown]"
14163 return self.reprStr #% self._name
14164
14165 def __getattr__(self, *args):
14166 #if not hasattr(self, "_name"):
14167 # self._name = "[unknown]"
14168 raise PyUnbornObjectError(self.attrStr) # % self._name )
14169
14170 def __nonzero__(self):
14171 return 0
14172
14173
14174#----------------------------------------------------------------------------
d55e5bfc
RD
14175
14176def CallAfter(callable, *args, **kw):
14177 """
14178 Call the specified function after the current and pending event
14179 handlers have been completed. This is also good for making GUI
0439c23b
RD
14180 method calls from non-GUI threads. Any extra positional or
14181 keyword args are passed on to the callable when it is called.
14182
846c181b 14183 :see: `wx.CallLater`
d55e5bfc
RD
14184 """
14185 app = wx.GetApp()
a001823c 14186 assert app is not None, 'No wx.App created yet'
d55e5bfc 14187
891bb194
RD
14188 if not hasattr(app, "_CallAfterId"):
14189 app._CallAfterId = wx.NewEventType()
14190 app.Connect(-1, -1, app._CallAfterId,
14191 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 14192 evt = wx.PyEvent()
891bb194 14193 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
14194 evt.callable = callable
14195 evt.args = args
14196 evt.kw = kw
14197 wx.PostEvent(app, evt)
14198
d55e5bfc
RD
14199#----------------------------------------------------------------------------
14200
14201
846c181b 14202class CallLater:
d55e5bfc 14203 """
6e0de3df 14204 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
14205 object once after the given amount of milliseconds, passing any
14206 positional or keyword args. The return value of the callable is
0439c23b 14207 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
14208
14209 If you don't need to get the return value or restart the timer
14210 then there is no need to hold a reference to this object. It will
14211 hold a reference to itself while the timer is running (the timer
14212 has a reference to self.Notify) but the cycle will be broken when
846c181b 14213 the timer completes, automatically cleaning up the wx.CallLater
d55e5bfc 14214 object.
0439c23b
RD
14215
14216 :see: `wx.CallAfter`
d55e5bfc
RD
14217 """
14218 def __init__(self, millis, callable, *args, **kwargs):
14219 self.millis = millis
14220 self.callable = callable
14221 self.SetArgs(*args, **kwargs)
14222 self.runCount = 0
14223 self.running = False
14224 self.hasRun = False
14225 self.result = None
14226 self.timer = None
14227 self.Start()
14228
14229 def __del__(self):
14230 self.Stop()
14231
14232
14233 def Start(self, millis=None, *args, **kwargs):
14234 """
14235 (Re)start the timer
14236 """
14237 self.hasRun = False
14238 if millis is not None:
14239 self.millis = millis
14240 if args or kwargs:
14241 self.SetArgs(*args, **kwargs)
14242 self.Stop()
14243 self.timer = wx.PyTimer(self.Notify)
14244 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
14245 self.running = True
14246 Restart = Start
14247
14248
14249 def Stop(self):
14250 """
14251 Stop and destroy the timer.
14252 """
14253 if self.timer is not None:
14254 self.timer.Stop()
14255 self.timer = None
14256
14257
14258 def GetInterval(self):
14259 if self.timer is not None:
14260 return self.timer.GetInterval()
14261 else:
14262 return 0
14263
14264
14265 def IsRunning(self):
14266 return self.timer is not None and self.timer.IsRunning()
14267
14268
14269 def SetArgs(self, *args, **kwargs):
14270 """
14271 (Re)set the args passed to the callable object. This is
14272 useful in conjunction with Restart if you want to schedule a
14273 new call to the same callable object but with different
14274 parameters.
14275 """
14276 self.args = args
14277 self.kwargs = kwargs
14278
14279
14280 def HasRun(self):
14281 return self.hasRun
14282
14283 def GetResult(self):
14284 return self.result
14285
14286 def Notify(self):
14287 """
14288 The timer has expired so call the callable.
14289 """
14290 if self.callable and getattr(self.callable, 'im_self', True):
14291 self.runCount += 1
14292 self.running = False
14293 self.result = self.callable(*self.args, **self.kwargs)
14294 self.hasRun = True
14295 if not self.running:
14296 # if it wasn't restarted, then cleanup
14297 wx.CallAfter(self.Stop)
14298
ac5d357a
RD
14299 Interval = property(GetInterval)
14300 Result = property(GetResult)
d55e5bfc
RD
14301
14302
846c181b
RD
14303class FutureCall(CallLater):
14304 """A compatibility alias for `CallLater`."""
14305
d55e5bfc
RD
14306#----------------------------------------------------------------------------
14307# Control which items in this module should be documented by epydoc.
14308# We allow only classes and functions, which will help reduce the size
14309# of the docs by filtering out the zillions of constants, EVT objects,
14310# and etc that don't make much sense by themselves, but are instead
14311# documented (or will be) as part of the classes/functions/methods
14312# where they should be used.
14313
d6c14a4c
RD
14314class __DocFilter:
14315 """
14316 A filter for epydoc that only allows non-Ptr classes and
34e0a3bb 14317 functions, in order to reduce the clutter in the API docs.
d6c14a4c
RD
14318 """
14319 def __init__(self, globals):
14320 self._globals = globals
14321
14322 def __call__(self, name):
14323 import types
14324 obj = self._globals.get(name, None)
34e0a3bb
RD
14325
14326 # only document classes and function
d6c14a4c
RD
14327 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
14328 return False
34e0a3bb
RD
14329
14330 # skip other things that are private or will be documented as part of somethign else
1bd55598 14331 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
d6c14a4c 14332 return False
34e0a3bb
RD
14333
14334 # skip functions that are duplicates of static functions in a class
14335 if name.find('_') != -1:
14336 cls = self._globals.get(name.split('_')[0], None)
14337 methname = name.split('_')[1]
14338 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
14339 return False
14340
d6c14a4c 14341 return True
d55e5bfc
RD
14342
14343#----------------------------------------------------------------------------
14344#----------------------------------------------------------------------------
14345
14346# Import other modules in this package that should show up in the
14347# "core" wx namespace
14348from _gdi import *
14349from _windows import *
14350from _controls import *
14351from _misc import *
14352
d55e5bfc
RD
14353#----------------------------------------------------------------------------
14354#----------------------------------------------------------------------------
14355
14356
32fe5131 14357