]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
fixed bug when a fixed pane is resized inside a fixed dock
[wxWidgets.git] / wxPython / src / gtk / _core.py
CommitLineData
0085ce49 1# This file was created automatically by SWIG 1.3.29.
d14a1e28
RD
2# Don't modify this file, modify the SWIG interface instead.
3
54f9ee45 4import _core_
0085ce49
RD
5import new
6new_instancemethod = new.instancemethod
093d3ff1 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
0085ce49 8 if (name == "thisown"): return self.this.own(value)
093d3ff1 9 if (name == "this"):
0085ce49
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
093d3ff1
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
0085ce49 15 if (not static) or hasattr(self,name):
093d3ff1
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
0085ce49 24 if (name == "thisown"): return self.this.own()
093d3ff1
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
0085ce49
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
093d3ff1
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
0085ce49
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
093d3ff1
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d14a1e28
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
54f9ee45 56_core_._wxPySetDictionary(vars())
d14a1e28
RD
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
66c033b4
RD
63
64#----------------------------------------------------------------------------
65
66def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81#----------------------------------------------------------------------------
82
54f9ee45
RD
83NOT_FOUND = _core_.NOT_FOUND
84VSCROLL = _core_.VSCROLL
85HSCROLL = _core_.HSCROLL
86CAPTION = _core_.CAPTION
87DOUBLE_BORDER = _core_.DOUBLE_BORDER
88SUNKEN_BORDER = _core_.SUNKEN_BORDER
89RAISED_BORDER = _core_.RAISED_BORDER
90BORDER = _core_.BORDER
91SIMPLE_BORDER = _core_.SIMPLE_BORDER
92STATIC_BORDER = _core_.STATIC_BORDER
93TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94NO_BORDER = _core_.NO_BORDER
bcd0d7b6 95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
54f9ee45
RD
97TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98WANTS_CHARS = _core_.WANTS_CHARS
99POPUP_WINDOW = _core_.POPUP_WINDOW
100CENTER_FRAME = _core_.CENTER_FRAME
101CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
54f9ee45
RD
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
092f0ed7 105WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
54f9ee45
RD
106ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107RETAINED = _core_.RETAINED
108BACKINGSTORE = _core_.BACKINGSTORE
109COLOURED = _core_.COLOURED
110FIXED_LENGTH = _core_.FIXED_LENGTH
111LB_NEEDED_SB = _core_.LB_NEEDED_SB
112LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113LB_SORT = _core_.LB_SORT
114LB_SINGLE = _core_.LB_SINGLE
115LB_MULTIPLE = _core_.LB_MULTIPLE
116LB_EXTENDED = _core_.LB_EXTENDED
117LB_OWNERDRAW = _core_.LB_OWNERDRAW
118LB_HSCROLL = _core_.LB_HSCROLL
54f9ee45
RD
119CB_SIMPLE = _core_.CB_SIMPLE
120CB_DROPDOWN = _core_.CB_DROPDOWN
121CB_SORT = _core_.CB_SORT
122CB_READONLY = _core_.CB_READONLY
123RA_HORIZONTAL = _core_.RA_HORIZONTAL
124RA_VERTICAL = _core_.RA_VERTICAL
125RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
126RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 127RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
54f9ee45
RD
128RB_GROUP = _core_.RB_GROUP
129RB_SINGLE = _core_.RB_SINGLE
54f9ee45
RD
130SB_HORIZONTAL = _core_.SB_HORIZONTAL
131SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 132RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
54f9ee45 133ST_SIZEGRIP = _core_.ST_SIZEGRIP
54f9ee45
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
a7830320
RD
149APPLY = _core_.APPLY
150CLOSE = _core_.CLOSE
54f9ee45
RD
151ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
152ICON_HAND = _core_.ICON_HAND
153ICON_QUESTION = _core_.ICON_QUESTION
154ICON_INFORMATION = _core_.ICON_INFORMATION
155ICON_STOP = _core_.ICON_STOP
156ICON_ASTERISK = _core_.ICON_ASTERISK
157ICON_MASK = _core_.ICON_MASK
158ICON_WARNING = _core_.ICON_WARNING
159ICON_ERROR = _core_.ICON_ERROR
160FORWARD = _core_.FORWARD
161BACKWARD = _core_.BACKWARD
162RESET = _core_.RESET
163HELP = _core_.HELP
164MORE = _core_.MORE
165SETUP = _core_.SETUP
166SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
167SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
168SIZE_AUTO = _core_.SIZE_AUTO
169SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
170SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 171SIZE_FORCE = _core_.SIZE_FORCE
54f9ee45
RD
172PORTRAIT = _core_.PORTRAIT
173LANDSCAPE = _core_.LANDSCAPE
174PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
175PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
176PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
177PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
178ID_ANY = _core_.ID_ANY
179ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 180ID_NONE = _core_.ID_NONE
54f9ee45
RD
181ID_LOWEST = _core_.ID_LOWEST
182ID_OPEN = _core_.ID_OPEN
183ID_CLOSE = _core_.ID_CLOSE
184ID_NEW = _core_.ID_NEW
185ID_SAVE = _core_.ID_SAVE
186ID_SAVEAS = _core_.ID_SAVEAS
187ID_REVERT = _core_.ID_REVERT
188ID_EXIT = _core_.ID_EXIT
189ID_UNDO = _core_.ID_UNDO
190ID_REDO = _core_.ID_REDO
191ID_HELP = _core_.ID_HELP
192ID_PRINT = _core_.ID_PRINT
193ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
fc46b7f3 194ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
54f9ee45
RD
195ID_PREVIEW = _core_.ID_PREVIEW
196ID_ABOUT = _core_.ID_ABOUT
197ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
198ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
199ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
200ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
10044bf1
RD
201ID_HELP_INDEX = _core_.ID_HELP_INDEX
202ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
54f9ee45
RD
203ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
204ID_PREFERENCES = _core_.ID_PREFERENCES
97ab0f6a 205ID_EDIT = _core_.ID_EDIT
54f9ee45
RD
206ID_CUT = _core_.ID_CUT
207ID_COPY = _core_.ID_COPY
208ID_PASTE = _core_.ID_PASTE
209ID_CLEAR = _core_.ID_CLEAR
210ID_FIND = _core_.ID_FIND
211ID_DUPLICATE = _core_.ID_DUPLICATE
212ID_SELECTALL = _core_.ID_SELECTALL
213ID_DELETE = _core_.ID_DELETE
214ID_REPLACE = _core_.ID_REPLACE
215ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
216ID_PROPERTIES = _core_.ID_PROPERTIES
217ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
218ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
219ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
220ID_VIEW_LIST = _core_.ID_VIEW_LIST
221ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
222ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
223ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
224ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
97ab0f6a 225ID_FILE = _core_.ID_FILE
54f9ee45
RD
226ID_FILE1 = _core_.ID_FILE1
227ID_FILE2 = _core_.ID_FILE2
228ID_FILE3 = _core_.ID_FILE3
229ID_FILE4 = _core_.ID_FILE4
230ID_FILE5 = _core_.ID_FILE5
231ID_FILE6 = _core_.ID_FILE6
232ID_FILE7 = _core_.ID_FILE7
233ID_FILE8 = _core_.ID_FILE8
234ID_FILE9 = _core_.ID_FILE9
235ID_OK = _core_.ID_OK
236ID_CANCEL = _core_.ID_CANCEL
237ID_APPLY = _core_.ID_APPLY
238ID_YES = _core_.ID_YES
239ID_NO = _core_.ID_NO
240ID_STATIC = _core_.ID_STATIC
241ID_FORWARD = _core_.ID_FORWARD
242ID_BACKWARD = _core_.ID_BACKWARD
243ID_DEFAULT = _core_.ID_DEFAULT
244ID_MORE = _core_.ID_MORE
245ID_SETUP = _core_.ID_SETUP
246ID_RESET = _core_.ID_RESET
247ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
248ID_YESTOALL = _core_.ID_YESTOALL
249ID_NOTOALL = _core_.ID_NOTOALL
250ID_ABORT = _core_.ID_ABORT
251ID_RETRY = _core_.ID_RETRY
252ID_IGNORE = _core_.ID_IGNORE
7bc1e663
RD
253ID_ADD = _core_.ID_ADD
254ID_REMOVE = _core_.ID_REMOVE
255ID_UP = _core_.ID_UP
256ID_DOWN = _core_.ID_DOWN
257ID_HOME = _core_.ID_HOME
258ID_REFRESH = _core_.ID_REFRESH
259ID_STOP = _core_.ID_STOP
260ID_INDEX = _core_.ID_INDEX
261ID_BOLD = _core_.ID_BOLD
262ID_ITALIC = _core_.ID_ITALIC
263ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
264ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
265ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
266ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
267ID_UNDERLINE = _core_.ID_UNDERLINE
268ID_INDENT = _core_.ID_INDENT
269ID_UNINDENT = _core_.ID_UNINDENT
270ID_ZOOM_100 = _core_.ID_ZOOM_100
271ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
272ID_ZOOM_IN = _core_.ID_ZOOM_IN
273ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
274ID_UNDELETE = _core_.ID_UNDELETE
275ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
54f9ee45 276ID_HIGHEST = _core_.ID_HIGHEST
54f9ee45
RD
277MENU_TEAROFF = _core_.MENU_TEAROFF
278MB_DOCKABLE = _core_.MB_DOCKABLE
279NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
280FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
281LI_HORIZONTAL = _core_.LI_HORIZONTAL
282LI_VERTICAL = _core_.LI_VERTICAL
283WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
284WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
285WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
286WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
287WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
288WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
289MM_TEXT = _core_.MM_TEXT
290MM_LOMETRIC = _core_.MM_LOMETRIC
291MM_HIMETRIC = _core_.MM_HIMETRIC
292MM_LOENGLISH = _core_.MM_LOENGLISH
293MM_HIENGLISH = _core_.MM_HIENGLISH
294MM_TWIPS = _core_.MM_TWIPS
295MM_ISOTROPIC = _core_.MM_ISOTROPIC
296MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
297MM_POINTS = _core_.MM_POINTS
298MM_METRIC = _core_.MM_METRIC
299CENTRE = _core_.CENTRE
300CENTER = _core_.CENTER
301HORIZONTAL = _core_.HORIZONTAL
302VERTICAL = _core_.VERTICAL
303BOTH = _core_.BOTH
304LEFT = _core_.LEFT
305RIGHT = _core_.RIGHT
306UP = _core_.UP
307DOWN = _core_.DOWN
308TOP = _core_.TOP
309BOTTOM = _core_.BOTTOM
310NORTH = _core_.NORTH
311SOUTH = _core_.SOUTH
312WEST = _core_.WEST
313EAST = _core_.EAST
314ALL = _core_.ALL
315ALIGN_NOT = _core_.ALIGN_NOT
316ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
317ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
318ALIGN_LEFT = _core_.ALIGN_LEFT
319ALIGN_TOP = _core_.ALIGN_TOP
320ALIGN_RIGHT = _core_.ALIGN_RIGHT
321ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
322ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
323ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
324ALIGN_CENTER = _core_.ALIGN_CENTER
325ALIGN_CENTRE = _core_.ALIGN_CENTRE
326ALIGN_MASK = _core_.ALIGN_MASK
327STRETCH_NOT = _core_.STRETCH_NOT
328SHRINK = _core_.SHRINK
329GROW = _core_.GROW
330EXPAND = _core_.EXPAND
331SHAPED = _core_.SHAPED
332FIXED_MINSIZE = _core_.FIXED_MINSIZE
333TILE = _core_.TILE
cbfc9df6 334ADJUST_MINSIZE = 0
54f9ee45
RD
335BORDER_DEFAULT = _core_.BORDER_DEFAULT
336BORDER_NONE = _core_.BORDER_NONE
337BORDER_STATIC = _core_.BORDER_STATIC
338BORDER_SIMPLE = _core_.BORDER_SIMPLE
339BORDER_RAISED = _core_.BORDER_RAISED
340BORDER_SUNKEN = _core_.BORDER_SUNKEN
341BORDER_DOUBLE = _core_.BORDER_DOUBLE
342BORDER_MASK = _core_.BORDER_MASK
7bc1e663
RD
343BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
344BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
345BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
54f9ee45
RD
346DEFAULT = _core_.DEFAULT
347DECORATIVE = _core_.DECORATIVE
348ROMAN = _core_.ROMAN
349SCRIPT = _core_.SCRIPT
350SWISS = _core_.SWISS
351MODERN = _core_.MODERN
352TELETYPE = _core_.TELETYPE
353VARIABLE = _core_.VARIABLE
354FIXED = _core_.FIXED
355NORMAL = _core_.NORMAL
356LIGHT = _core_.LIGHT
357BOLD = _core_.BOLD
358ITALIC = _core_.ITALIC
359SLANT = _core_.SLANT
360SOLID = _core_.SOLID
361DOT = _core_.DOT
362LONG_DASH = _core_.LONG_DASH
363SHORT_DASH = _core_.SHORT_DASH
364DOT_DASH = _core_.DOT_DASH
365USER_DASH = _core_.USER_DASH
366TRANSPARENT = _core_.TRANSPARENT
367STIPPLE = _core_.STIPPLE
d04418a7
RD
368STIPPLE_MASK = _core_.STIPPLE_MASK
369STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
54f9ee45
RD
370BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
371CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
372FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
373CROSS_HATCH = _core_.CROSS_HATCH
374HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
375VERTICAL_HATCH = _core_.VERTICAL_HATCH
376JOIN_BEVEL = _core_.JOIN_BEVEL
377JOIN_MITER = _core_.JOIN_MITER
378JOIN_ROUND = _core_.JOIN_ROUND
379CAP_ROUND = _core_.CAP_ROUND
380CAP_PROJECTING = _core_.CAP_PROJECTING
381CAP_BUTT = _core_.CAP_BUTT
382CLEAR = _core_.CLEAR
383XOR = _core_.XOR
384INVERT = _core_.INVERT
385OR_REVERSE = _core_.OR_REVERSE
386AND_REVERSE = _core_.AND_REVERSE
387COPY = _core_.COPY
388AND = _core_.AND
389AND_INVERT = _core_.AND_INVERT
390NO_OP = _core_.NO_OP
391NOR = _core_.NOR
392EQUIV = _core_.EQUIV
393SRC_INVERT = _core_.SRC_INVERT
394OR_INVERT = _core_.OR_INVERT
395NAND = _core_.NAND
396OR = _core_.OR
397SET = _core_.SET
398WXK_BACK = _core_.WXK_BACK
399WXK_TAB = _core_.WXK_TAB
400WXK_RETURN = _core_.WXK_RETURN
401WXK_ESCAPE = _core_.WXK_ESCAPE
402WXK_SPACE = _core_.WXK_SPACE
403WXK_DELETE = _core_.WXK_DELETE
404WXK_START = _core_.WXK_START
405WXK_LBUTTON = _core_.WXK_LBUTTON
406WXK_RBUTTON = _core_.WXK_RBUTTON
407WXK_CANCEL = _core_.WXK_CANCEL
408WXK_MBUTTON = _core_.WXK_MBUTTON
409WXK_CLEAR = _core_.WXK_CLEAR
410WXK_SHIFT = _core_.WXK_SHIFT
411WXK_ALT = _core_.WXK_ALT
412WXK_CONTROL = _core_.WXK_CONTROL
413WXK_MENU = _core_.WXK_MENU
414WXK_PAUSE = _core_.WXK_PAUSE
415WXK_CAPITAL = _core_.WXK_CAPITAL
54f9ee45
RD
416WXK_END = _core_.WXK_END
417WXK_HOME = _core_.WXK_HOME
418WXK_LEFT = _core_.WXK_LEFT
419WXK_UP = _core_.WXK_UP
420WXK_RIGHT = _core_.WXK_RIGHT
421WXK_DOWN = _core_.WXK_DOWN
422WXK_SELECT = _core_.WXK_SELECT
423WXK_PRINT = _core_.WXK_PRINT
424WXK_EXECUTE = _core_.WXK_EXECUTE
425WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
426WXK_INSERT = _core_.WXK_INSERT
427WXK_HELP = _core_.WXK_HELP
428WXK_NUMPAD0 = _core_.WXK_NUMPAD0
429WXK_NUMPAD1 = _core_.WXK_NUMPAD1
430WXK_NUMPAD2 = _core_.WXK_NUMPAD2
431WXK_NUMPAD3 = _core_.WXK_NUMPAD3
432WXK_NUMPAD4 = _core_.WXK_NUMPAD4
433WXK_NUMPAD5 = _core_.WXK_NUMPAD5
434WXK_NUMPAD6 = _core_.WXK_NUMPAD6
435WXK_NUMPAD7 = _core_.WXK_NUMPAD7
436WXK_NUMPAD8 = _core_.WXK_NUMPAD8
437WXK_NUMPAD9 = _core_.WXK_NUMPAD9
438WXK_MULTIPLY = _core_.WXK_MULTIPLY
439WXK_ADD = _core_.WXK_ADD
440WXK_SEPARATOR = _core_.WXK_SEPARATOR
441WXK_SUBTRACT = _core_.WXK_SUBTRACT
442WXK_DECIMAL = _core_.WXK_DECIMAL
443WXK_DIVIDE = _core_.WXK_DIVIDE
444WXK_F1 = _core_.WXK_F1
445WXK_F2 = _core_.WXK_F2
446WXK_F3 = _core_.WXK_F3
447WXK_F4 = _core_.WXK_F4
448WXK_F5 = _core_.WXK_F5
449WXK_F6 = _core_.WXK_F6
450WXK_F7 = _core_.WXK_F7
451WXK_F8 = _core_.WXK_F8
452WXK_F9 = _core_.WXK_F9
453WXK_F10 = _core_.WXK_F10
454WXK_F11 = _core_.WXK_F11
455WXK_F12 = _core_.WXK_F12
456WXK_F13 = _core_.WXK_F13
457WXK_F14 = _core_.WXK_F14
458WXK_F15 = _core_.WXK_F15
459WXK_F16 = _core_.WXK_F16
460WXK_F17 = _core_.WXK_F17
461WXK_F18 = _core_.WXK_F18
462WXK_F19 = _core_.WXK_F19
463WXK_F20 = _core_.WXK_F20
464WXK_F21 = _core_.WXK_F21
465WXK_F22 = _core_.WXK_F22
466WXK_F23 = _core_.WXK_F23
467WXK_F24 = _core_.WXK_F24
468WXK_NUMLOCK = _core_.WXK_NUMLOCK
469WXK_SCROLL = _core_.WXK_SCROLL
470WXK_PAGEUP = _core_.WXK_PAGEUP
471WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
472WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
473WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
474WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
475WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
476WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
477WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
478WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
479WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
480WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
481WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
482WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
483WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
54f9ee45 484WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
54f9ee45
RD
485WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
486WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
487WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
488WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
489WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
490WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
491WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
492WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
493WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
494WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
495WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
496WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
497WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
498WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
499WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
500WXK_COMMAND = _core_.WXK_COMMAND
501WXK_SPECIAL1 = _core_.WXK_SPECIAL1
502WXK_SPECIAL2 = _core_.WXK_SPECIAL2
503WXK_SPECIAL3 = _core_.WXK_SPECIAL3
504WXK_SPECIAL4 = _core_.WXK_SPECIAL4
505WXK_SPECIAL5 = _core_.WXK_SPECIAL5
506WXK_SPECIAL6 = _core_.WXK_SPECIAL6
507WXK_SPECIAL7 = _core_.WXK_SPECIAL7
508WXK_SPECIAL8 = _core_.WXK_SPECIAL8
509WXK_SPECIAL9 = _core_.WXK_SPECIAL9
510WXK_SPECIAL10 = _core_.WXK_SPECIAL10
511WXK_SPECIAL11 = _core_.WXK_SPECIAL11
512WXK_SPECIAL12 = _core_.WXK_SPECIAL12
513WXK_SPECIAL13 = _core_.WXK_SPECIAL13
514WXK_SPECIAL14 = _core_.WXK_SPECIAL14
515WXK_SPECIAL15 = _core_.WXK_SPECIAL15
516WXK_SPECIAL16 = _core_.WXK_SPECIAL16
517WXK_SPECIAL17 = _core_.WXK_SPECIAL17
518WXK_SPECIAL18 = _core_.WXK_SPECIAL18
519WXK_SPECIAL19 = _core_.WXK_SPECIAL19
520WXK_SPECIAL20 = _core_.WXK_SPECIAL20
cbfc9df6
RD
521WXK_PRIOR = WXK_PAGEUP
522WXK_NEXT = WXK_PAGEDOWN
523WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP
524WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN
525
54f9ee45
RD
526PAPER_NONE = _core_.PAPER_NONE
527PAPER_LETTER = _core_.PAPER_LETTER
528PAPER_LEGAL = _core_.PAPER_LEGAL
529PAPER_A4 = _core_.PAPER_A4
530PAPER_CSHEET = _core_.PAPER_CSHEET
531PAPER_DSHEET = _core_.PAPER_DSHEET
532PAPER_ESHEET = _core_.PAPER_ESHEET
533PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
534PAPER_TABLOID = _core_.PAPER_TABLOID
535PAPER_LEDGER = _core_.PAPER_LEDGER
536PAPER_STATEMENT = _core_.PAPER_STATEMENT
537PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
538PAPER_A3 = _core_.PAPER_A3
539PAPER_A4SMALL = _core_.PAPER_A4SMALL
540PAPER_A5 = _core_.PAPER_A5
541PAPER_B4 = _core_.PAPER_B4
542PAPER_B5 = _core_.PAPER_B5
543PAPER_FOLIO = _core_.PAPER_FOLIO
544PAPER_QUARTO = _core_.PAPER_QUARTO
545PAPER_10X14 = _core_.PAPER_10X14
546PAPER_11X17 = _core_.PAPER_11X17
547PAPER_NOTE = _core_.PAPER_NOTE
548PAPER_ENV_9 = _core_.PAPER_ENV_9
549PAPER_ENV_10 = _core_.PAPER_ENV_10
550PAPER_ENV_11 = _core_.PAPER_ENV_11
551PAPER_ENV_12 = _core_.PAPER_ENV_12
552PAPER_ENV_14 = _core_.PAPER_ENV_14
553PAPER_ENV_DL = _core_.PAPER_ENV_DL
554PAPER_ENV_C5 = _core_.PAPER_ENV_C5
555PAPER_ENV_C3 = _core_.PAPER_ENV_C3
556PAPER_ENV_C4 = _core_.PAPER_ENV_C4
557PAPER_ENV_C6 = _core_.PAPER_ENV_C6
558PAPER_ENV_C65 = _core_.PAPER_ENV_C65
559PAPER_ENV_B4 = _core_.PAPER_ENV_B4
560PAPER_ENV_B5 = _core_.PAPER_ENV_B5
561PAPER_ENV_B6 = _core_.PAPER_ENV_B6
562PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
563PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
564PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
565PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
566PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
567PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
568PAPER_ISO_B4 = _core_.PAPER_ISO_B4
569PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
570PAPER_9X11 = _core_.PAPER_9X11
571PAPER_10X11 = _core_.PAPER_10X11
572PAPER_15X11 = _core_.PAPER_15X11
573PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
574PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
575PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
576PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
577PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
578PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
579PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
580PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
581PAPER_A_PLUS = _core_.PAPER_A_PLUS
582PAPER_B_PLUS = _core_.PAPER_B_PLUS
583PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
584PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
585PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
586PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
587PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
588PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
589PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
590PAPER_A2 = _core_.PAPER_A2
591PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
592PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
6c75a4cf
RD
593PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
594PAPER_A6 = _core_.PAPER_A6
595PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
596PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
597PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
598PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
599PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
600PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
601PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
602PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
603PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
604PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
605PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
606PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
607PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
608PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
609PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
610PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
611PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
612PAPER_B6_JIS = _core_.PAPER_B6_JIS
613PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
614PAPER_12X11 = _core_.PAPER_12X11
615PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
616PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
617PAPER_P16K = _core_.PAPER_P16K
618PAPER_P32K = _core_.PAPER_P32K
619PAPER_P32KBIG = _core_.PAPER_P32KBIG
620PAPER_PENV_1 = _core_.PAPER_PENV_1
621PAPER_PENV_2 = _core_.PAPER_PENV_2
622PAPER_PENV_3 = _core_.PAPER_PENV_3
623PAPER_PENV_4 = _core_.PAPER_PENV_4
624PAPER_PENV_5 = _core_.PAPER_PENV_5
625PAPER_PENV_6 = _core_.PAPER_PENV_6
626PAPER_PENV_7 = _core_.PAPER_PENV_7
627PAPER_PENV_8 = _core_.PAPER_PENV_8
628PAPER_PENV_9 = _core_.PAPER_PENV_9
629PAPER_PENV_10 = _core_.PAPER_PENV_10
630PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
631PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
632PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
633PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
634PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
635PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
636PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
637PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
638PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
639PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
640PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
641PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
642PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
54f9ee45
RD
643DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
644DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
645DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
646ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
647ITEM_NORMAL = _core_.ITEM_NORMAL
648ITEM_CHECK = _core_.ITEM_CHECK
649ITEM_RADIO = _core_.ITEM_RADIO
650ITEM_MAX = _core_.ITEM_MAX
651HT_NOWHERE = _core_.HT_NOWHERE
652HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
653HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
654HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
655HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
656HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
657HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
658HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
659HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
660HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
661HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
662HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
663HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
664HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
665HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
666HT_MAX = _core_.HT_MAX
667MOD_NONE = _core_.MOD_NONE
668MOD_ALT = _core_.MOD_ALT
669MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 670MOD_ALTGR = _core_.MOD_ALTGR
54f9ee45 671MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 672MOD_META = _core_.MOD_META
54f9ee45 673MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
674MOD_CMD = _core_.MOD_CMD
675MOD_ALL = _core_.MOD_ALL
54f9ee45
RD
676UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
677UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
678UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
994453b8
RD
679Layout_Default = _core_.Layout_Default
680Layout_LeftToRight = _core_.Layout_LeftToRight
681Layout_RightToLeft = _core_.Layout_RightToLeft
d14a1e28
RD
682#---------------------------------------------------------------------------
683
684class Object(object):
0df68c9f
RD
685 """
686 The base class for most wx objects, although in wxPython not
687 much functionality is needed nor exposed.
688 """
0085ce49
RD
689 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
690 def __init__(self): raise AttributeError, "No constructor defined"
691 __repr__ = _swig_repr
e811c8ce 692 def GetClassName(*args, **kwargs):
0df68c9f 693 """
a95a7133 694 GetClassName(self) -> String
e811c8ce 695
a95a7133 696 Returns the class name of the C++ class using wxRTTI.
0df68c9f 697 """
54f9ee45 698 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
699
700 def Destroy(*args, **kwargs):
0df68c9f 701 """
a95a7133 702 Destroy(self)
e811c8ce 703
0df68c9f
RD
704 Deletes the C++ object this Python object is a proxy for.
705 """
b39fe951
RD
706 args[0].this.own(False)
707 return _core_.Object_Destroy(*args, **kwargs)
e811c8ce 708
8f514ab4
RD
709 def IsSameAs(*args, **kwargs):
710 """
711 IsSameAs(self, Object p) -> bool
712
713 For wx.Objects that use C++ reference counting internally, this method
714 can be used to determine if two objects are referencing the same data
715 object.
716 """
717 return _core_.Object_IsSameAs(*args, **kwargs)
718
33d6fd3b 719 ClassName = property(GetClassName,doc="See `GetClassName`")
2131d850 720_core_.Object_swigregister(Object)
54f9ee45 721_wxPySetDictionary = _core_._wxPySetDictionary
54f9ee45 722cvar = _core_.cvar
196addbf 723EmptyString = cvar.EmptyString
d14a1e28
RD
724
725#---------------------------------------------------------------------------
726
54f9ee45
RD
727BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
728BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
729BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
730BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
731BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
732BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
733BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
734BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
735BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
736BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
737BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
738BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
739BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
740BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
741BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
742BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
743BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
744BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
8f514ab4 745BITMAP_TYPE_TGA = _core_.BITMAP_TYPE_TGA
54f9ee45
RD
746BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
747BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
748CURSOR_NONE = _core_.CURSOR_NONE
749CURSOR_ARROW = _core_.CURSOR_ARROW
750CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
751CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
752CURSOR_CHAR = _core_.CURSOR_CHAR
753CURSOR_CROSS = _core_.CURSOR_CROSS
754CURSOR_HAND = _core_.CURSOR_HAND
755CURSOR_IBEAM = _core_.CURSOR_IBEAM
756CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
757CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
758CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
759CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
760CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
761CURSOR_PENCIL = _core_.CURSOR_PENCIL
762CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
763CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
764CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
765CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
766CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
767CURSOR_SIZENS = _core_.CURSOR_SIZENS
768CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
769CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
770CURSOR_SIZING = _core_.CURSOR_SIZING
771CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
772CURSOR_WAIT = _core_.CURSOR_WAIT
773CURSOR_WATCH = _core_.CURSOR_WATCH
774CURSOR_BLANK = _core_.CURSOR_BLANK
775CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
776CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
777CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
778CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
779#---------------------------------------------------------------------------
780
781class Size(object):
0df68c9f 782 """
41e2b43e 783 wx.Size is a useful data structure used to represent the size of
0085ce49
RD
784 something. It simply contains integer width and height
785 properties. In most places in wxPython where a wx.Size is
093d3ff1 786 expected a (width, height) tuple can be used instead.
0df68c9f 787 """
0085ce49
RD
788 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
789 __repr__ = _swig_repr
54f9ee45
RD
790 width = property(_core_.Size_width_get, _core_.Size_width_set)
791 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 792 x = width; y = height
0085ce49 793 def __init__(self, *args, **kwargs):
0df68c9f 794 """
a95a7133 795 __init__(self, int w=0, int h=0) -> Size
e811c8ce 796
0df68c9f
RD
797 Creates a size object.
798 """
0085ce49
RD
799 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
800 __swig_destroy__ = _core_.delete_Size
801 __del__ = lambda self : None;
e811c8ce 802 def __eq__(*args, **kwargs):
0df68c9f 803 """
e9d6f3a4 804 __eq__(self, PyObject other) -> bool
e811c8ce 805
0df68c9f
RD
806 Test for equality of wx.Size objects.
807 """
54f9ee45 808 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
809
810 def __ne__(*args, **kwargs):
0df68c9f 811 """
e9d6f3a4 812 __ne__(self, PyObject other) -> bool
e811c8ce 813
e9d6f3a4 814 Test for inequality of wx.Size objects.
0df68c9f 815 """
54f9ee45 816 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
817
818 def __add__(*args, **kwargs):
0df68c9f 819 """
a95a7133 820 __add__(self, Size sz) -> Size
e811c8ce 821
0df68c9f
RD
822 Add sz's proprties to this and return the result.
823 """
54f9ee45 824 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
825
826 def __sub__(*args, **kwargs):
0df68c9f 827 """
a95a7133 828 __sub__(self, Size sz) -> Size
e811c8ce 829
0df68c9f
RD
830 Subtract sz's properties from this and return the result.
831 """
54f9ee45 832 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
833
834 def IncTo(*args, **kwargs):
0df68c9f 835 """
a95a7133 836 IncTo(self, Size sz)
e811c8ce 837
0df68c9f
RD
838 Increments this object so that both of its dimensions are not less
839 than the corresponding dimensions of the size.
840 """
54f9ee45 841 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
842
843 def DecTo(*args, **kwargs):
0df68c9f 844 """
a95a7133 845 DecTo(self, Size sz)
e811c8ce 846
0df68c9f
RD
847 Decrements this object so that both of its dimensions are not greater
848 than the corresponding dimensions of the size.
849 """
54f9ee45 850 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce 851
f5263701
RD
852 def IncBy(*args, **kwargs):
853 """IncBy(self, int dx, int dy)"""
854 return _core_.Size_IncBy(*args, **kwargs)
855
856 def DecBy(*args, **kwargs):
857 """DecBy(self, int dx, int dy)"""
858 return _core_.Size_DecBy(*args, **kwargs)
859
10044bf1
RD
860 def Scale(*args, **kwargs):
861 """
862 Scale(self, float xscale, float yscale)
863
864 Scales the dimensions of this object by the given factors.
865 """
866 return _core_.Size_Scale(*args, **kwargs)
867
e811c8ce 868 def Set(*args, **kwargs):
0df68c9f 869 """
a95a7133 870 Set(self, int w, int h)
e811c8ce 871
0df68c9f
RD
872 Set both width and height.
873 """
54f9ee45 874 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
875
876 def SetWidth(*args, **kwargs):
a95a7133 877 """SetWidth(self, int w)"""
54f9ee45 878 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
879
880 def SetHeight(*args, **kwargs):
a95a7133 881 """SetHeight(self, int h)"""
54f9ee45 882 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
883
884 def GetWidth(*args, **kwargs):
a95a7133 885 """GetWidth(self) -> int"""
54f9ee45 886 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
887
888 def GetHeight(*args, **kwargs):
a95a7133 889 """GetHeight(self) -> int"""
54f9ee45 890 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 891
74a57fcd
RD
892 def IsFullySpecified(*args, **kwargs):
893 """
a95a7133 894 IsFullySpecified(self) -> bool
74a57fcd
RD
895
896 Returns True if both components of the size are non-default values.
897 """
54f9ee45 898 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
899
900 def SetDefaults(*args, **kwargs):
901 """
a95a7133 902 SetDefaults(self, Size size)
74a57fcd 903
41e2b43e
RD
904 Combine this size with the other one replacing the default components
905 of this object (i.e. equal to -1) with those of the other.
74a57fcd 906 """
54f9ee45 907 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 908
e811c8ce 909 def Get(*args, **kwargs):
0df68c9f
RD
910 """
911 Get() -> (width,height)
e811c8ce 912
0df68c9f
RD
913 Returns the width and height properties as a tuple.
914 """
54f9ee45 915 return _core_.Size_Get(*args, **kwargs)
e811c8ce 916
41e2b43e 917 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
918 def __str__(self): return str(self.Get())
919 def __repr__(self): return 'wx.Size'+str(self.Get())
920 def __len__(self): return len(self.Get())
921 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
922 def __setitem__(self, index, val):
923 if index == 0: self.width = val
924 elif index == 1: self.height = val
925 else: raise IndexError
e811c8ce 926 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
927 __safe_for_unpickling__ = True
928 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28 929
2131d850 930_core_.Size_swigregister(Size)
d14a1e28
RD
931
932#---------------------------------------------------------------------------
933
934class RealPoint(object):
0df68c9f 935 """
41e2b43e
RD
936 A data structure for representing a point or position with floating
937 point x and y properties. In wxPython most places that expect a
938 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 939 """
0085ce49
RD
940 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
941 __repr__ = _swig_repr
54f9ee45
RD
942 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
943 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
0085ce49 944 def __init__(self, *args, **kwargs):
0df68c9f 945 """
a95a7133 946 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 947
0df68c9f
RD
948 Create a wx.RealPoint object
949 """
0085ce49
RD
950 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
951 __swig_destroy__ = _core_.delete_RealPoint
952 __del__ = lambda self : None;
e811c8ce 953 def __eq__(*args, **kwargs):
0df68c9f 954 """
e9d6f3a4 955 __eq__(self, PyObject other) -> bool
e811c8ce 956
0df68c9f
RD
957 Test for equality of wx.RealPoint objects.
958 """
54f9ee45 959 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
960
961 def __ne__(*args, **kwargs):
0df68c9f 962 """
e9d6f3a4 963 __ne__(self, PyObject other) -> bool
e811c8ce 964
0df68c9f
RD
965 Test for inequality of wx.RealPoint objects.
966 """
54f9ee45 967 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
968
969 def __add__(*args, **kwargs):
0df68c9f 970 """
a95a7133 971 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 972
0df68c9f
RD
973 Add pt's proprties to this and return the result.
974 """
54f9ee45 975 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
976
977 def __sub__(*args, **kwargs):
0df68c9f 978 """
a95a7133 979 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 980
0df68c9f
RD
981 Subtract pt's proprties from this and return the result
982 """
54f9ee45 983 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
984
985 def Set(*args, **kwargs):
0df68c9f 986 """
a95a7133 987 Set(self, double x, double y)
e811c8ce 988
0df68c9f
RD
989 Set both the x and y properties
990 """
54f9ee45 991 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
992
993 def Get(*args, **kwargs):
0df68c9f
RD
994 """
995 Get() -> (x,y)
e811c8ce 996
0df68c9f
RD
997 Return the x and y properties as a tuple.
998 """
54f9ee45 999 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 1000
41e2b43e 1001 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1002 def __str__(self): return str(self.Get())
1003 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1004 def __len__(self): return len(self.Get())
1005 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1006 def __setitem__(self, index, val):
e811c8ce
RD
1007 if index == 0: self.x = val
1008 elif index == 1: self.y = val
d14a1e28 1009 else: raise IndexError
e811c8ce 1010 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1011 __safe_for_unpickling__ = True
1012 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28 1013
2131d850 1014_core_.RealPoint_swigregister(RealPoint)
d14a1e28
RD
1015
1016#---------------------------------------------------------------------------
1017
1018class Point(object):
0df68c9f 1019 """
41e2b43e
RD
1020 A data structure for representing a point or position with integer x
1021 and y properties. Most places in wxPython that expect a wx.Point can
1022 also accept a (x,y) tuple.
0df68c9f 1023 """
0085ce49
RD
1024 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1025 __repr__ = _swig_repr
54f9ee45
RD
1026 x = property(_core_.Point_x_get, _core_.Point_x_set)
1027 y = property(_core_.Point_y_get, _core_.Point_y_set)
0085ce49 1028 def __init__(self, *args, **kwargs):
0df68c9f 1029 """
a95a7133 1030 __init__(self, int x=0, int y=0) -> Point
e811c8ce 1031
0df68c9f
RD
1032 Create a wx.Point object
1033 """
0085ce49
RD
1034 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1035 __swig_destroy__ = _core_.delete_Point
1036 __del__ = lambda self : None;
e811c8ce 1037 def __eq__(*args, **kwargs):
0df68c9f 1038 """
e9d6f3a4 1039 __eq__(self, PyObject other) -> bool
e811c8ce 1040
0df68c9f
RD
1041 Test for equality of wx.Point objects.
1042 """
54f9ee45 1043 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
1044
1045 def __ne__(*args, **kwargs):
0df68c9f 1046 """
e9d6f3a4 1047 __ne__(self, PyObject other) -> bool
e811c8ce 1048
0df68c9f
RD
1049 Test for inequality of wx.Point objects.
1050 """
54f9ee45 1051 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
1052
1053 def __add__(*args, **kwargs):
0df68c9f 1054 """
a95a7133 1055 __add__(self, Point pt) -> Point
e811c8ce 1056
0df68c9f
RD
1057 Add pt's proprties to this and return the result.
1058 """
54f9ee45 1059 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
1060
1061 def __sub__(*args, **kwargs):
0df68c9f 1062 """
a95a7133 1063 __sub__(self, Point pt) -> Point
e811c8ce 1064
0df68c9f
RD
1065 Subtract pt's proprties from this and return the result
1066 """
54f9ee45 1067 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
1068
1069 def __iadd__(*args, **kwargs):
0df68c9f 1070 """
a95a7133 1071 __iadd__(self, Point pt) -> Point
e811c8ce 1072
0df68c9f
RD
1073 Add pt to this object.
1074 """
54f9ee45 1075 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
1076
1077 def __isub__(*args, **kwargs):
0df68c9f 1078 """
a95a7133 1079 __isub__(self, Point pt) -> Point
e811c8ce 1080
0df68c9f
RD
1081 Subtract pt from this object.
1082 """
54f9ee45 1083 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
1084
1085 def Set(*args, **kwargs):
0df68c9f 1086 """
a95a7133 1087 Set(self, long x, long y)
e811c8ce 1088
0df68c9f
RD
1089 Set both the x and y properties
1090 """
54f9ee45 1091 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
1092
1093 def Get(*args, **kwargs):
0df68c9f
RD
1094 """
1095 Get() -> (x,y)
e811c8ce 1096
0df68c9f
RD
1097 Return the x and y properties as a tuple.
1098 """
54f9ee45 1099 return _core_.Point_Get(*args, **kwargs)
e811c8ce 1100
41e2b43e 1101 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1102 def __str__(self): return str(self.Get())
1103 def __repr__(self): return 'wx.Point'+str(self.Get())
1104 def __len__(self): return len(self.Get())
1105 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1106 def __setitem__(self, index, val):
1107 if index == 0: self.x = val
1108 elif index == 1: self.y = val
1109 else: raise IndexError
e811c8ce 1110 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
1111 __safe_for_unpickling__ = True
1112 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28 1113
2131d850 1114_core_.Point_swigregister(Point)
d14a1e28
RD
1115
1116#---------------------------------------------------------------------------
1117
1118class Rect(object):
0df68c9f 1119 """
41e2b43e
RD
1120 A class for representing and manipulating rectangles. It has x, y,
1121 width and height properties. In wxPython most palces that expect a
1122 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1123 """
0085ce49
RD
1124 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1125 __repr__ = _swig_repr
1126 def __init__(self, *args, **kwargs):
0df68c9f 1127 """
a95a7133 1128 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1129
0df68c9f
RD
1130 Create a new Rect object.
1131 """
0085ce49
RD
1132 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1133 __swig_destroy__ = _core_.delete_Rect
1134 __del__ = lambda self : None;
e811c8ce 1135 def GetX(*args, **kwargs):
a95a7133 1136 """GetX(self) -> int"""
54f9ee45 1137 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1138
1139 def SetX(*args, **kwargs):
a95a7133 1140 """SetX(self, int x)"""
54f9ee45 1141 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1142
1143 def GetY(*args, **kwargs):
a95a7133 1144 """GetY(self) -> int"""
54f9ee45 1145 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1146
1147 def SetY(*args, **kwargs):
a95a7133 1148 """SetY(self, int y)"""
54f9ee45 1149 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1150
1151 def GetWidth(*args, **kwargs):
a95a7133 1152 """GetWidth(self) -> int"""
54f9ee45 1153 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1154
1155 def SetWidth(*args, **kwargs):
a95a7133 1156 """SetWidth(self, int w)"""
54f9ee45 1157 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1158
1159 def GetHeight(*args, **kwargs):
a95a7133 1160 """GetHeight(self) -> int"""
54f9ee45 1161 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1162
1163 def SetHeight(*args, **kwargs):
a95a7133 1164 """SetHeight(self, int h)"""
54f9ee45 1165 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1166
1167 def GetPosition(*args, **kwargs):
a95a7133 1168 """GetPosition(self) -> Point"""
54f9ee45 1169 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1170
1171 def SetPosition(*args, **kwargs):
a95a7133 1172 """SetPosition(self, Point p)"""
54f9ee45 1173 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1174
1175 def GetSize(*args, **kwargs):
a95a7133 1176 """GetSize(self) -> Size"""
54f9ee45 1177 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1178
1179 def SetSize(*args, **kwargs):
a95a7133 1180 """SetSize(self, Size s)"""
54f9ee45 1181 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1182
aff4cc5c
RD
1183 def IsEmpty(*args, **kwargs):
1184 """IsEmpty(self) -> bool"""
1185 return _core_.Rect_IsEmpty(*args, **kwargs)
1186
c9c7117a 1187 def GetTopLeft(*args, **kwargs):
a95a7133 1188 """GetTopLeft(self) -> Point"""
54f9ee45 1189 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1190
1191 def SetTopLeft(*args, **kwargs):
a95a7133 1192 """SetTopLeft(self, Point p)"""
54f9ee45 1193 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1194
1195 def GetBottomRight(*args, **kwargs):
a95a7133 1196 """GetBottomRight(self) -> Point"""
54f9ee45 1197 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1198
1199 def SetBottomRight(*args, **kwargs):
a95a7133 1200 """SetBottomRight(self, Point p)"""
54f9ee45 1201 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1202
5acb46e0
RD
1203 def GetTopRight(*args, **kwargs):
1204 """GetTopRight(self) -> Point"""
1205 return _core_.Rect_GetTopRight(*args, **kwargs)
1206
1207 def SetTopRight(*args, **kwargs):
1208 """SetTopRight(self, Point p)"""
1209 return _core_.Rect_SetTopRight(*args, **kwargs)
1210
1211 def GetBottomLeft(*args, **kwargs):
1212 """GetBottomLeft(self) -> Point"""
1213 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1214
1215 def SetBottomLeft(*args, **kwargs):
1216 """SetBottomLeft(self, Point p)"""
1217 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1218
e811c8ce 1219 def GetLeft(*args, **kwargs):
a95a7133 1220 """GetLeft(self) -> int"""
54f9ee45 1221 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1222
1223 def GetTop(*args, **kwargs):
a95a7133 1224 """GetTop(self) -> int"""
54f9ee45 1225 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1226
1227 def GetBottom(*args, **kwargs):
a95a7133 1228 """GetBottom(self) -> int"""
54f9ee45 1229 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1230
1231 def GetRight(*args, **kwargs):
a95a7133 1232 """GetRight(self) -> int"""
54f9ee45 1233 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1234
1235 def SetLeft(*args, **kwargs):
a95a7133 1236 """SetLeft(self, int left)"""
54f9ee45 1237 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1238
1239 def SetRight(*args, **kwargs):
a95a7133 1240 """SetRight(self, int right)"""
54f9ee45 1241 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1242
1243 def SetTop(*args, **kwargs):
a95a7133 1244 """SetTop(self, int top)"""
54f9ee45 1245 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1246
1247 def SetBottom(*args, **kwargs):
a95a7133 1248 """SetBottom(self, int bottom)"""
54f9ee45 1249 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1250
1251 position = property(GetPosition, SetPosition)
1252 size = property(GetSize, SetSize)
1253 left = property(GetLeft, SetLeft)
1254 right = property(GetRight, SetRight)
1255 top = property(GetTop, SetTop)
1256 bottom = property(GetBottom, SetBottom)
1257
1258 def Inflate(*args, **kwargs):
0df68c9f 1259 """
a95a7133 1260 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1261
8e738329
RD
1262 Increases the size of the rectangle.
1263
1264 The left border is moved farther left and the right border is moved
1265 farther right by ``dx``. The upper border is moved farther up and the
1266 bottom border is moved farther down by ``dy``. (Note the the width and
1267 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1268 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1269 opposite happens: the rectangle size decreases in the respective
1270 direction.
1271
1272 The change is made to the rectangle inplace, if instead you need a
1273 copy that is inflated, preserving the original then make the copy
1274 first::
1275
1276 copy = wx.Rect(*original)
1277 copy.Inflate(10,15)
1278
1279
0df68c9f 1280 """
54f9ee45 1281 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1282
1283 def Deflate(*args, **kwargs):
0df68c9f 1284 """
a95a7133 1285 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1286
8e738329
RD
1287 Decrease the rectangle size. This method is the opposite of `Inflate`
1288 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1289 `Inflate` for a full description.
0df68c9f 1290 """
54f9ee45 1291 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1292
1293 def OffsetXY(*args, **kwargs):
0df68c9f 1294 """
a95a7133 1295 OffsetXY(self, int dx, int dy)
e811c8ce 1296
41e2b43e
RD
1297 Moves the rectangle by the specified offset. If dx is positive, the
1298 rectangle is moved to the right, if dy is positive, it is moved to the
1299 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1300 """
54f9ee45 1301 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1302
1303 def Offset(*args, **kwargs):
0df68c9f 1304 """
a95a7133 1305 Offset(self, Point pt)
e811c8ce 1306
b1fcee84 1307 Same as `OffsetXY` but uses dx,dy from Point
0df68c9f 1308 """
54f9ee45 1309 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1310
1311 def Intersect(*args, **kwargs):
0df68c9f 1312 """
a95a7133 1313 Intersect(self, Rect rect) -> Rect
e811c8ce 1314
5cbf236d 1315 Returns the intersectsion of this rectangle and rect.
0df68c9f 1316 """
54f9ee45 1317 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce 1318
5cbf236d
RD
1319 def Union(*args, **kwargs):
1320 """
1321 Union(self, Rect rect) -> Rect
1322
1323 Returns the union of this rectangle and rect.
1324 """
1325 return _core_.Rect_Union(*args, **kwargs)
1326
e811c8ce 1327 def __add__(*args, **kwargs):
0df68c9f 1328 """
a95a7133 1329 __add__(self, Rect rect) -> Rect
e811c8ce 1330
0df68c9f
RD
1331 Add the properties of rect to this rectangle and return the result.
1332 """
54f9ee45 1333 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1334
1335 def __iadd__(*args, **kwargs):
0df68c9f 1336 """
a95a7133 1337 __iadd__(self, Rect rect) -> Rect
e811c8ce 1338
0df68c9f
RD
1339 Add the properties of rect to this rectangle, updating this rectangle.
1340 """
54f9ee45 1341 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1342
1343 def __eq__(*args, **kwargs):
0df68c9f 1344 """
e9d6f3a4 1345 __eq__(self, PyObject other) -> bool
e811c8ce 1346
e9d6f3a4 1347 Test for equality of wx.Rect objects.
0df68c9f 1348 """
54f9ee45 1349 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1350
1351 def __ne__(*args, **kwargs):
0df68c9f 1352 """
e9d6f3a4 1353 __ne__(self, PyObject other) -> bool
e811c8ce 1354
e9d6f3a4 1355 Test for inequality of wx.Rect objects.
0df68c9f 1356 """
54f9ee45 1357 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce 1358
33d6fd3b 1359 def ContainsXY(*args, **kwargs):
0df68c9f 1360 """
33d6fd3b 1361 ContainsXY(self, int x, int y) -> bool
e811c8ce 1362
33d6fd3b 1363 Return True if the point is inside the rect.
0df68c9f 1364 """
33d6fd3b 1365 return _core_.Rect_ContainsXY(*args, **kwargs)
e811c8ce 1366
33d6fd3b 1367 def Contains(*args, **kwargs):
0df68c9f 1368 """
33d6fd3b 1369 Contains(self, Point pt) -> bool
e811c8ce 1370
33d6fd3b 1371 Return True if the point is inside the rect.
0df68c9f 1372 """
33d6fd3b 1373 return _core_.Rect_Contains(*args, **kwargs)
e811c8ce 1374
33d6fd3b 1375 def ContainsRect(*args, **kwargs):
fc46b7f3 1376 """
33d6fd3b 1377 ContainsRect(self, Rect rect) -> bool
fc46b7f3
RD
1378
1379 Returns ``True`` if the given rectangle is completely inside this
1380 rectangle or touches its boundary.
1381 """
33d6fd3b
RD
1382 return _core_.Rect_ContainsRect(*args, **kwargs)
1383
72ef6efb
RD
1384 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1385 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1386 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1387 Inside = Contains
1388 InsideXY = ContainsXY
1389 InsideRect = ContainsRect
fc46b7f3 1390
e811c8ce 1391 def Intersects(*args, **kwargs):
0df68c9f 1392 """
a95a7133 1393 Intersects(self, Rect rect) -> bool
e811c8ce 1394
0df68c9f
RD
1395 Returns True if the rectangles have a non empty intersection.
1396 """
54f9ee45 1397 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1398
b1fcee84
RD
1399 def CenterIn(*args, **kwargs):
1400 """
1401 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1402
1403 Center this rectangle within the one passed to the method, which is
1404 usually, but not necessarily, the larger one.
1405 """
1406 return _core_.Rect_CenterIn(*args, **kwargs)
1407
1408 CentreIn = CenterIn
54f9ee45
RD
1409 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1410 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1411 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1412 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1413 def Set(*args, **kwargs):
0df68c9f 1414 """
a95a7133 1415 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1416
0df68c9f
RD
1417 Set all rectangle properties.
1418 """
54f9ee45 1419 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1420
1421 def Get(*args, **kwargs):
0df68c9f
RD
1422 """
1423 Get() -> (x,y,width,height)
e811c8ce 1424
0df68c9f
RD
1425 Return the rectangle properties as a tuple.
1426 """
54f9ee45 1427 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1428
41e2b43e 1429 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1430 def __str__(self): return str(self.Get())
1431 def __repr__(self): return 'wx.Rect'+str(self.Get())
1432 def __len__(self): return len(self.Get())
1433 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1434 def __setitem__(self, index, val):
1435 if index == 0: self.x = val
1436 elif index == 1: self.y = val
1437 elif index == 2: self.width = val
1438 elif index == 3: self.height = val
1439 else: raise IndexError
e811c8ce 1440 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1441 __safe_for_unpickling__ = True
1442 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28 1443
33d6fd3b
RD
1444 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1445 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
5acb46e0 1446 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
33d6fd3b
RD
1447 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1448 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1449 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1450 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1451 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1452 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1453 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
5acb46e0 1454 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
33d6fd3b
RD
1455 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1456 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1457 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1458 Empty = property(IsEmpty,doc="See `IsEmpty`")
2131d850 1459_core_.Rect_swigregister(Rect)
d14a1e28
RD
1460
1461def RectPP(*args, **kwargs):
0df68c9f
RD
1462 """
1463 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1464
0df68c9f
RD
1465 Create a new Rect object from Points representing two corners.
1466 """
54f9ee45 1467 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1468 return val
1469
1470def RectPS(*args, **kwargs):
0df68c9f
RD
1471 """
1472 RectPS(Point pos, Size size) -> Rect
e811c8ce 1473
0df68c9f
RD
1474 Create a new Rect from a position and size.
1475 """
54f9ee45 1476 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1477 return val
1478
d3b6e4ff
RD
1479def RectS(*args, **kwargs):
1480 """
1481 RectS(Size size) -> Rect
1482
1483 Create a new Rect from a size only.
1484 """
1485 val = _core_.new_RectS(*args, **kwargs)
d3b6e4ff
RD
1486 return val
1487
d14a1e28 1488
e811c8ce 1489def IntersectRect(*args, **kwargs):
0085ce49 1490 """
0df68c9f 1491 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1492
0df68c9f
RD
1493 Calculate and return the intersection of r1 and r2.
1494 """
0085ce49 1495 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1496#---------------------------------------------------------------------------
1497
1498class Point2D(object):
41e2b43e
RD
1499 """
1500 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1501 with floating point values.
1502 """
0085ce49
RD
1503 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1504 __repr__ = _swig_repr
1505 def __init__(self, *args, **kwargs):
0df68c9f 1506 """
a95a7133 1507 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1508
0df68c9f
RD
1509 Create a w.Point2D object.
1510 """
0085ce49 1511 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
b39fe951
RD
1512 __swig_destroy__ = _core_.delete_Point2D
1513 __del__ = lambda self : None;
e811c8ce 1514 def GetFloor(*args, **kwargs):
fd2dc343
RD
1515 """
1516 GetFloor() -> (x,y)
1517
1518 Convert to integer
1519 """
54f9ee45 1520 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1521
1522 def GetRounded(*args, **kwargs):
fd2dc343
RD
1523 """
1524 GetRounded() -> (x,y)
1525
1526 Convert to integer
1527 """
54f9ee45 1528 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1529
1530 def GetVectorLength(*args, **kwargs):
a95a7133 1531 """GetVectorLength(self) -> double"""
54f9ee45 1532 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1533
1534 def GetVectorAngle(*args, **kwargs):
a95a7133 1535 """GetVectorAngle(self) -> double"""
54f9ee45 1536 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1537
1538 def SetVectorLength(*args, **kwargs):
a95a7133 1539 """SetVectorLength(self, double length)"""
54f9ee45 1540 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1541
1542 def SetVectorAngle(*args, **kwargs):
a95a7133 1543 """SetVectorAngle(self, double degrees)"""
54f9ee45 1544 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1545
d14a1e28
RD
1546 def SetPolarCoordinates(self, angle, length):
1547 self.SetVectorLength(length)
1548 self.SetVectorAngle(angle)
1549 def Normalize(self):
1550 self.SetVectorLength(1.0)
1551
e811c8ce 1552 def GetDistance(*args, **kwargs):
a95a7133 1553 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1554 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1555
1556 def GetDistanceSquare(*args, **kwargs):
a95a7133 1557 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1558 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1559
1560 def GetDotProduct(*args, **kwargs):
a95a7133 1561 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1562 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1563
1564 def GetCrossProduct(*args, **kwargs):
a95a7133 1565 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1566 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1567
1568 def __neg__(*args, **kwargs):
0df68c9f 1569 """
a95a7133 1570 __neg__(self) -> Point2D
e811c8ce 1571
0df68c9f
RD
1572 the reflection of this point
1573 """
54f9ee45 1574 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1575
1576 def __iadd__(*args, **kwargs):
a95a7133 1577 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1578 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1579
1580 def __isub__(*args, **kwargs):
a95a7133 1581 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1582 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1583
1584 def __imul__(*args, **kwargs):
a95a7133 1585 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1586 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1587
1588 def __idiv__(*args, **kwargs):
a95a7133 1589 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1590 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1591
1592 def __eq__(*args, **kwargs):
0df68c9f 1593 """
e9d6f3a4 1594 __eq__(self, PyObject other) -> bool
e811c8ce 1595
e9d6f3a4 1596 Test for equality of wx.Point2D objects.
0df68c9f 1597 """
54f9ee45 1598 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1599
1600 def __ne__(*args, **kwargs):
0df68c9f 1601 """
e9d6f3a4 1602 __ne__(self, PyObject other) -> bool
e811c8ce 1603
e9d6f3a4 1604 Test for inequality of wx.Point2D objects.
0df68c9f 1605 """
54f9ee45 1606 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1607
54f9ee45
RD
1608 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1609 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1610 def Set(*args, **kwargs):
a95a7133 1611 """Set(self, double x=0, double y=0)"""
54f9ee45 1612 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1613
1614 def Get(*args, **kwargs):
0df68c9f
RD
1615 """
1616 Get() -> (x,y)
e811c8ce 1617
0df68c9f
RD
1618 Return x and y properties as a tuple.
1619 """
54f9ee45 1620 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1621
41e2b43e 1622 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1623 def __str__(self): return str(self.Get())
1624 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1625 def __len__(self): return len(self.Get())
1626 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1627 def __setitem__(self, index, val):
e811c8ce
RD
1628 if index == 0: self.x = val
1629 elif index == 1: self.y = val
d14a1e28 1630 else: raise IndexError
e811c8ce 1631 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1632 __safe_for_unpickling__ = True
1633 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28 1634
33d6fd3b
RD
1635 Floor = property(GetFloor,doc="See `GetFloor`")
1636 Rounded = property(GetRounded,doc="See `GetRounded`")
1637 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1638 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
2131d850 1639_core_.Point2D_swigregister(Point2D)
d14a1e28
RD
1640
1641def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1642 """
1643 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1644
0df68c9f
RD
1645 Create a w.Point2D object.
1646 """
54f9ee45 1647 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1648 return val
1649
1650def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1651 """
1652 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1653
0df68c9f
RD
1654 Create a w.Point2D object.
1655 """
54f9ee45 1656 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1657 return val
1658
1659#---------------------------------------------------------------------------
1660
70d7cb34
RD
1661Inside = _core_.Inside
1662OutLeft = _core_.OutLeft
1663OutRight = _core_.OutRight
1664OutTop = _core_.OutTop
1665OutBottom = _core_.OutBottom
1666class Rect2D(object):
1667 """
1668 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1669 with floating point component values.
1670 """
1671 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1672 __repr__ = _swig_repr
1673 def __init__(self, *args, **kwargs):
1674 """
1675 __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D
1676
1677 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1678 with floating point component values.
1679 """
1680 _core_.Rect2D_swiginit(self,_core_.new_Rect2D(*args, **kwargs))
1681 __swig_destroy__ = _core_.delete_Rect2D
1682 __del__ = lambda self : None;
1683 def GetPosition(*args, **kwargs):
1684 """GetPosition(self) -> Point2D"""
1685 return _core_.Rect2D_GetPosition(*args, **kwargs)
1686
1687 def GetSize(*args, **kwargs):
1688 """GetSize(self) -> Size"""
1689 return _core_.Rect2D_GetSize(*args, **kwargs)
1690
1691 def GetLeft(*args, **kwargs):
1692 """GetLeft(self) -> wxDouble"""
1693 return _core_.Rect2D_GetLeft(*args, **kwargs)
1694
1695 def SetLeft(*args, **kwargs):
1696 """SetLeft(self, wxDouble n)"""
1697 return _core_.Rect2D_SetLeft(*args, **kwargs)
1698
1699 def MoveLeftTo(*args, **kwargs):
1700 """MoveLeftTo(self, wxDouble n)"""
1701 return _core_.Rect2D_MoveLeftTo(*args, **kwargs)
1702
1703 def GetTop(*args, **kwargs):
1704 """GetTop(self) -> wxDouble"""
1705 return _core_.Rect2D_GetTop(*args, **kwargs)
1706
1707 def SetTop(*args, **kwargs):
1708 """SetTop(self, wxDouble n)"""
1709 return _core_.Rect2D_SetTop(*args, **kwargs)
1710
1711 def MoveTopTo(*args, **kwargs):
1712 """MoveTopTo(self, wxDouble n)"""
1713 return _core_.Rect2D_MoveTopTo(*args, **kwargs)
1714
1715 def GetBottom(*args, **kwargs):
1716 """GetBottom(self) -> wxDouble"""
1717 return _core_.Rect2D_GetBottom(*args, **kwargs)
1718
1719 def SetBottom(*args, **kwargs):
1720 """SetBottom(self, wxDouble n)"""
1721 return _core_.Rect2D_SetBottom(*args, **kwargs)
1722
1723 def MoveBottomTo(*args, **kwargs):
1724 """MoveBottomTo(self, wxDouble n)"""
1725 return _core_.Rect2D_MoveBottomTo(*args, **kwargs)
1726
1727 def GetRight(*args, **kwargs):
1728 """GetRight(self) -> wxDouble"""
1729 return _core_.Rect2D_GetRight(*args, **kwargs)
1730
1731 def SetRight(*args, **kwargs):
1732 """SetRight(self, wxDouble n)"""
1733 return _core_.Rect2D_SetRight(*args, **kwargs)
1734
1735 def MoveRightTo(*args, **kwargs):
1736 """MoveRightTo(self, wxDouble n)"""
1737 return _core_.Rect2D_MoveRightTo(*args, **kwargs)
1738
1739 def GetLeftTop(*args, **kwargs):
1740 """GetLeftTop(self) -> Point2D"""
1741 return _core_.Rect2D_GetLeftTop(*args, **kwargs)
1742
1743 def SetLeftTop(*args, **kwargs):
1744 """SetLeftTop(self, Point2D pt)"""
1745 return _core_.Rect2D_SetLeftTop(*args, **kwargs)
1746
1747 def MoveLeftTopTo(*args, **kwargs):
1748 """MoveLeftTopTo(self, Point2D pt)"""
1749 return _core_.Rect2D_MoveLeftTopTo(*args, **kwargs)
1750
1751 def GetLeftBottom(*args, **kwargs):
1752 """GetLeftBottom(self) -> Point2D"""
1753 return _core_.Rect2D_GetLeftBottom(*args, **kwargs)
1754
1755 def SetLeftBottom(*args, **kwargs):
1756 """SetLeftBottom(self, Point2D pt)"""
1757 return _core_.Rect2D_SetLeftBottom(*args, **kwargs)
1758
1759 def MoveLeftBottomTo(*args, **kwargs):
1760 """MoveLeftBottomTo(self, Point2D pt)"""
1761 return _core_.Rect2D_MoveLeftBottomTo(*args, **kwargs)
1762
1763 def GetRightTop(*args, **kwargs):
1764 """GetRightTop(self) -> Point2D"""
1765 return _core_.Rect2D_GetRightTop(*args, **kwargs)
1766
1767 def SetRightTop(*args, **kwargs):
1768 """SetRightTop(self, Point2D pt)"""
1769 return _core_.Rect2D_SetRightTop(*args, **kwargs)
1770
1771 def MoveRightTopTo(*args, **kwargs):
1772 """MoveRightTopTo(self, Point2D pt)"""
1773 return _core_.Rect2D_MoveRightTopTo(*args, **kwargs)
1774
1775 def GetRightBottom(*args, **kwargs):
1776 """GetRightBottom(self) -> Point2D"""
1777 return _core_.Rect2D_GetRightBottom(*args, **kwargs)
1778
1779 def SetRightBottom(*args, **kwargs):
1780 """SetRightBottom(self, Point2D pt)"""
1781 return _core_.Rect2D_SetRightBottom(*args, **kwargs)
1782
1783 def MoveRightBottomTo(*args, **kwargs):
1784 """MoveRightBottomTo(self, Point2D pt)"""
1785 return _core_.Rect2D_MoveRightBottomTo(*args, **kwargs)
1786
1787 def GetCentre(*args, **kwargs):
1788 """GetCentre(self) -> Point2D"""
1789 return _core_.Rect2D_GetCentre(*args, **kwargs)
1790
1791 def SetCentre(*args, **kwargs):
1792 """SetCentre(self, Point2D pt)"""
1793 return _core_.Rect2D_SetCentre(*args, **kwargs)
1794
1795 def MoveCentreTo(*args, **kwargs):
1796 """MoveCentreTo(self, Point2D pt)"""
1797 return _core_.Rect2D_MoveCentreTo(*args, **kwargs)
1798
1799 def GetOutcode(*args, **kwargs):
1800 """GetOutcode(self, Point2D pt) -> int"""
1801 return _core_.Rect2D_GetOutcode(*args, **kwargs)
1802
1803 def Contains(*args, **kwargs):
1804 """Contains(self, Point2D pt) -> bool"""
1805 return _core_.Rect2D_Contains(*args, **kwargs)
1806
1807 def ContainsRect(*args, **kwargs):
1808 """ContainsRect(self, Rect2D rect) -> bool"""
1809 return _core_.Rect2D_ContainsRect(*args, **kwargs)
1810
1811 def IsEmpty(*args, **kwargs):
1812 """IsEmpty(self) -> bool"""
1813 return _core_.Rect2D_IsEmpty(*args, **kwargs)
1814
1815 def HaveEqualSize(*args, **kwargs):
1816 """HaveEqualSize(self, Rect2D rect) -> bool"""
1817 return _core_.Rect2D_HaveEqualSize(*args, **kwargs)
1818
1819 def Inset(*args):
1820 """
1821 Inset(self, wxDouble x, wxDouble y)
1822 Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom)
1823 """
1824 return _core_.Rect2D_Inset(*args)
1825
1826 def Offset(*args, **kwargs):
1827 """Offset(self, Point2D pt)"""
1828 return _core_.Rect2D_Offset(*args, **kwargs)
1829
1830 def ConstrainTo(*args, **kwargs):
1831 """ConstrainTo(self, Rect2D rect)"""
1832 return _core_.Rect2D_ConstrainTo(*args, **kwargs)
1833
1834 def Interpolate(*args, **kwargs):
1835 """Interpolate(self, int widthfactor, int heightfactor) -> Point2D"""
1836 return _core_.Rect2D_Interpolate(*args, **kwargs)
1837
1838 def Intersect(*args, **kwargs):
1839 """Intersect(self, Rect2D otherRect)"""
1840 return _core_.Rect2D_Intersect(*args, **kwargs)
1841
1842 def CreateIntersection(*args, **kwargs):
1843 """CreateIntersection(self, Rect2D otherRect) -> Rect2D"""
1844 return _core_.Rect2D_CreateIntersection(*args, **kwargs)
1845
1846 def Intersects(*args, **kwargs):
1847 """Intersects(self, Rect2D rect) -> bool"""
1848 return _core_.Rect2D_Intersects(*args, **kwargs)
1849
1850 def Union(*args, **kwargs):
1851 """Union(self, Rect2D otherRect)"""
1852 return _core_.Rect2D_Union(*args, **kwargs)
1853
1854 def CreateUnion(*args, **kwargs):
1855 """CreateUnion(self, Rect2D otherRect) -> Rect2D"""
1856 return _core_.Rect2D_CreateUnion(*args, **kwargs)
1857
1858 def Scale(*args):
1859 """
1860 Scale(self, wxDouble f)
1861 Scale(self, int num, int denum)
1862 """
1863 return _core_.Rect2D_Scale(*args)
1864
1865 def __eq__(*args, **kwargs):
1866 """
1867 __eq__(self, PyObject other) -> bool
1868
1869 Test for equality of wx.Rect2D objects.
1870 """
1871 return _core_.Rect2D___eq__(*args, **kwargs)
1872
1873 def __ne__(*args, **kwargs):
1874 """
1875 __ne__(self, PyObject other) -> bool
1876
1877 Test for inequality of wx.Rect2D objects.
1878 """
1879 return _core_.Rect2D___ne__(*args, **kwargs)
1880
1881 x = property(_core_.Rect2D_x_get, _core_.Rect2D_x_set)
1882 y = property(_core_.Rect2D_y_get, _core_.Rect2D_y_set)
1883 width = property(_core_.Rect2D_width_get, _core_.Rect2D_width_set)
1884 height = property(_core_.Rect2D_height_get, _core_.Rect2D_height_set)
1885 def Set(*args, **kwargs):
1886 """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)"""
1887 return _core_.Rect2D_Set(*args, **kwargs)
1888
1889 def Get(*args, **kwargs):
1890 """
1891 Get() -> (x,y, width, height)
1892
1893 Return x, y, width and height y properties as a tuple.
1894 """
1895 return _core_.Rect2D_Get(*args, **kwargs)
1896
1897 def __str__(self): return str(self.Get())
1898 def __repr__(self): return 'wx.Rect2D'+str(self.Get())
1899 def __len__(self): return len(self.Get())
1900 def __getitem__(self, index): return self.Get()[index]
1901 def __setitem__(self, index, val):
1902 if index == 0: self.x = val
1903 elif index == 1: self.y = val
1904 elif index == 2: self.width = val
1905 elif index == 3: self.height = val
1906 else: raise IndexError
1907 def __nonzero__(self): return self.Get() != (0.0, 0.0, 0.0, 0.0)
1908 __safe_for_unpickling__ = True
1909 def __reduce__(self): return (wx.Rect2D, self.Get())
1910
1911_core_.Rect2D_swigregister(Rect2D)
1912
8c3a7183
RD
1913class Position(object):
1914 """Proxy of C++ Position class"""
1915 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1916 __repr__ = _swig_repr
1917 def __init__(self, *args, **kwargs):
1918 """__init__(self, int row=0, int col=0) -> Position"""
1919 _core_.Position_swiginit(self,_core_.new_Position(*args, **kwargs))
1920 __swig_destroy__ = _core_.delete_Position
1921 __del__ = lambda self : None;
1922 def GetRow(*args, **kwargs):
1923 """GetRow(self) -> int"""
1924 return _core_.Position_GetRow(*args, **kwargs)
1925
1926 def GetColumn(*args, **kwargs):
1927 """GetColumn(self) -> int"""
1928 return _core_.Position_GetColumn(*args, **kwargs)
1929
1930 def GetCol(*args, **kwargs):
1931 """GetCol(self) -> int"""
1932 return _core_.Position_GetCol(*args, **kwargs)
1933
1934 def SetRow(*args, **kwargs):
1935 """SetRow(self, int row)"""
1936 return _core_.Position_SetRow(*args, **kwargs)
1937
1938 def SetColumn(*args, **kwargs):
1939 """SetColumn(self, int column)"""
1940 return _core_.Position_SetColumn(*args, **kwargs)
1941
1942 def SetCol(*args, **kwargs):
1943 """SetCol(self, int column)"""
1944 return _core_.Position_SetCol(*args, **kwargs)
1945
1946 def __eq__(*args, **kwargs):
1947 """
1948 __eq__(self, PyObject other) -> bool
1949
1950 Test for equality of wx.Position objects.
1951 """
1952 return _core_.Position___eq__(*args, **kwargs)
1953
1954 def __ne__(*args, **kwargs):
1955 """
1956 __ne__(self, PyObject other) -> bool
1957
1958 Test for inequality of wx.Position objects.
1959 """
1960 return _core_.Position___ne__(*args, **kwargs)
1961
1962 def __add__(*args):
1963 """
1964 __add__(self, Position p) -> Position
1965 __add__(self, Size s) -> Position
1966 """
1967 return _core_.Position___add__(*args)
1968
1969 def __sub__(*args):
1970 """
1971 __sub__(self, Position p) -> Position
1972 __sub__(self, Size s) -> Position
1973 """
1974 return _core_.Position___sub__(*args)
1975
1976 row = property(GetRow,SetRow)
1977 col = property(GetCol,SetCol)
1978_core_.Position_swigregister(Position)
1979
70d7cb34
RD
1980#---------------------------------------------------------------------------
1981
54f9ee45
RD
1982FromStart = _core_.FromStart
1983FromCurrent = _core_.FromCurrent
1984FromEnd = _core_.FromEnd
d14a1e28 1985class InputStream(object):
093d3ff1 1986 """Proxy of C++ InputStream class"""
0085ce49
RD
1987 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1988 __repr__ = _swig_repr
1989 def __init__(self, *args, **kwargs):
a95a7133 1990 """__init__(self, PyObject p) -> InputStream"""
0085ce49
RD
1991 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1992 __swig_destroy__ = _core_.delete_InputStream
1993 __del__ = lambda self : None;
e811c8ce 1994 def close(*args, **kwargs):
a95a7133 1995 """close(self)"""
54f9ee45 1996 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1997
1998 def flush(*args, **kwargs):
a95a7133 1999 """flush(self)"""
54f9ee45 2000 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
2001
2002 def eof(*args, **kwargs):
a95a7133 2003 """eof(self) -> bool"""
54f9ee45 2004 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
2005
2006 def read(*args, **kwargs):
a95a7133 2007 """read(self, int size=-1) -> PyObject"""
54f9ee45 2008 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
2009
2010 def readline(*args, **kwargs):
a95a7133 2011 """readline(self, int size=-1) -> PyObject"""
54f9ee45 2012 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
2013
2014 def readlines(*args, **kwargs):
a95a7133 2015 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 2016 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
2017
2018 def seek(*args, **kwargs):
a95a7133 2019 """seek(self, int offset, int whence=0)"""
54f9ee45 2020 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
2021
2022 def tell(*args, **kwargs):
a95a7133 2023 """tell(self) -> int"""
54f9ee45 2024 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
2025
2026 def Peek(*args, **kwargs):
a95a7133 2027 """Peek(self) -> char"""
54f9ee45 2028 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
2029
2030 def GetC(*args, **kwargs):
a95a7133 2031 """GetC(self) -> char"""
54f9ee45 2032 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
2033
2034 def LastRead(*args, **kwargs):
a95a7133 2035 """LastRead(self) -> size_t"""
54f9ee45 2036 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
2037
2038 def CanRead(*args, **kwargs):
a95a7133 2039 """CanRead(self) -> bool"""
54f9ee45 2040 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
2041
2042 def Eof(*args, **kwargs):
a95a7133 2043 """Eof(self) -> bool"""
54f9ee45 2044 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
2045
2046 def Ungetch(*args, **kwargs):
a95a7133 2047 """Ungetch(self, char c) -> bool"""
54f9ee45 2048 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
2049
2050 def SeekI(*args, **kwargs):
a95a7133 2051 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 2052 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
2053
2054 def TellI(*args, **kwargs):
a95a7133 2055 """TellI(self) -> long"""
54f9ee45 2056 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 2057
2131d850 2058_core_.InputStream_swigregister(InputStream)
d14a1e28
RD
2059DefaultPosition = cvar.DefaultPosition
2060DefaultSize = cvar.DefaultSize
2061
2062class OutputStream(object):
093d3ff1 2063 """Proxy of C++ OutputStream class"""
0085ce49
RD
2064 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2065 def __init__(self): raise AttributeError, "No constructor defined"
2066 __repr__ = _swig_repr
e811c8ce 2067 def write(*args, **kwargs):
a95a7133 2068 """write(self, PyObject obj)"""
54f9ee45 2069 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 2070
0085ce49
RD
2071 def LastWrite(*args, **kwargs):
2072 """LastWrite(self) -> size_t"""
2073 return _core_.OutputStream_LastWrite(*args, **kwargs)
d14a1e28 2074
2131d850 2075_core_.OutputStream_swigregister(OutputStream)
d14a1e28
RD
2076
2077#---------------------------------------------------------------------------
2078
2079class FSFile(Object):
093d3ff1 2080 """Proxy of C++ FSFile class"""
0085ce49
RD
2081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2082 __repr__ = _swig_repr
2083 def __init__(self, *args, **kwargs):
0df68c9f 2084 """
a95a7133 2085 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 2086 DateTime modif) -> FSFile
0df68c9f 2087 """
0085ce49 2088 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
0085ce49
RD
2089 __swig_destroy__ = _core_.delete_FSFile
2090 __del__ = lambda self : None;
e811c8ce 2091 def GetStream(*args, **kwargs):
a95a7133 2092 """GetStream(self) -> InputStream"""
54f9ee45 2093 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce 2094
97ab0f6a
RD
2095 def DetachStream(*args, **kwargs):
2096 """DetachStream(self)"""
2097 return _core_.FSFile_DetachStream(*args, **kwargs)
2098
e811c8ce 2099 def GetMimeType(*args, **kwargs):
a95a7133 2100 """GetMimeType(self) -> String"""
54f9ee45 2101 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
2102
2103 def GetLocation(*args, **kwargs):
a95a7133 2104 """GetLocation(self) -> String"""
54f9ee45 2105 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
2106
2107 def GetAnchor(*args, **kwargs):
a95a7133 2108 """GetAnchor(self) -> String"""
54f9ee45 2109 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
2110
2111 def GetModificationTime(*args, **kwargs):
a95a7133 2112 """GetModificationTime(self) -> DateTime"""
54f9ee45 2113 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 2114
97ab0f6a
RD
2115 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2116 Location = property(GetLocation,doc="See `GetLocation`")
2117 MimeType = property(GetMimeType,doc="See `GetMimeType`")
2118 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
2119 Stream = property(GetStream,doc="See `GetStream`")
2131d850 2120_core_.FSFile_swigregister(FSFile)
d14a1e28
RD
2121
2122class CPPFileSystemHandler(object):
093d3ff1 2123 """Proxy of C++ CPPFileSystemHandler class"""
0085ce49
RD
2124 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2125 def __init__(self): raise AttributeError, "No constructor defined"
2126 __repr__ = _swig_repr
50f151d7
RD
2127 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
2128 __del__ = lambda self : None;
2131d850 2129_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d14a1e28
RD
2130
2131class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 2132 """Proxy of C++ FileSystemHandler class"""
0085ce49
RD
2133 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2134 __repr__ = _swig_repr
2135 def __init__(self, *args, **kwargs):
a95a7133 2136 """__init__(self) -> FileSystemHandler"""
0085ce49 2137 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
c25f90f6 2138 FileSystemHandler._setCallbackInfo(self, self, FileSystemHandler)
e811c8ce
RD
2139
2140 def _setCallbackInfo(*args, **kwargs):
a95a7133 2141 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 2142 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
2143
2144 def CanOpen(*args, **kwargs):
a95a7133 2145 """CanOpen(self, String location) -> bool"""
54f9ee45 2146 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2147
2148 def OpenFile(*args, **kwargs):
a95a7133 2149 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2150 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2151
2152 def FindFirst(*args, **kwargs):
a95a7133 2153 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2154 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2155
2156 def FindNext(*args, **kwargs):
a95a7133 2157 """FindNext(self) -> String"""
54f9ee45 2158 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
2159
2160 def GetProtocol(*args, **kwargs):
a95a7133 2161 """GetProtocol(self, String location) -> String"""
54f9ee45 2162 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
2163
2164 def GetLeftLocation(*args, **kwargs):
a95a7133 2165 """GetLeftLocation(self, String location) -> String"""
54f9ee45 2166 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
2167
2168 def GetAnchor(*args, **kwargs):
a95a7133 2169 """GetAnchor(self, String location) -> String"""
54f9ee45 2170 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
2171
2172 def GetRightLocation(*args, **kwargs):
a95a7133 2173 """GetRightLocation(self, String location) -> String"""
54f9ee45 2174 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
2175
2176 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 2177 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 2178 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 2179
97ab0f6a
RD
2180 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2181 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
2182 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
2183 Protocol = property(GetProtocol,doc="See `GetProtocol`")
2184 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2131d850 2185_core_.FileSystemHandler_swigregister(FileSystemHandler)
d14a1e28
RD
2186
2187class FileSystem(Object):
093d3ff1 2188 """Proxy of C++ FileSystem class"""
0085ce49
RD
2189 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2190 __repr__ = _swig_repr
2191 def __init__(self, *args, **kwargs):
a95a7133 2192 """__init__(self) -> FileSystem"""
0085ce49
RD
2193 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
2194 __swig_destroy__ = _core_.delete_FileSystem
2195 __del__ = lambda self : None;
e811c8ce 2196 def ChangePathTo(*args, **kwargs):
a95a7133 2197 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 2198 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
2199
2200 def GetPath(*args, **kwargs):
a95a7133 2201 """GetPath(self) -> String"""
54f9ee45 2202 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
2203
2204 def OpenFile(*args, **kwargs):
a95a7133 2205 """OpenFile(self, String location) -> FSFile"""
54f9ee45 2206 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
2207
2208 def FindFirst(*args, **kwargs):
a95a7133 2209 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2210 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
2211
2212 def FindNext(*args, **kwargs):
a95a7133 2213 """FindNext(self) -> String"""
54f9ee45 2214 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
2215
2216 def AddHandler(*args, **kwargs):
66c033b4 2217 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 2218 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
2219
2220 AddHandler = staticmethod(AddHandler)
97ab0f6a
RD
2221 def RemoveHandler(*args, **kwargs):
2222 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2223 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2224
2225 RemoveHandler = staticmethod(RemoveHandler)
e811c8ce 2226 def CleanUpHandlers(*args, **kwargs):
66c033b4 2227 """CleanUpHandlers()"""
54f9ee45 2228 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
2229
2230 CleanUpHandlers = staticmethod(CleanUpHandlers)
2231 def FileNameToURL(*args, **kwargs):
66c033b4 2232 """FileNameToURL(String filename) -> String"""
54f9ee45 2233 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
2234
2235 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
2236 def URLToFileName(*args, **kwargs):
2237 """URLToFileName(String url) -> String"""
2238 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2239
2240 URLToFileName = staticmethod(URLToFileName)
97ab0f6a 2241 Path = property(GetPath,doc="See `GetPath`")
2131d850 2242_core_.FileSystem_swigregister(FileSystem)
d14a1e28 2243
e811c8ce 2244def FileSystem_AddHandler(*args, **kwargs):
0085ce49
RD
2245 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
2246 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 2247
97ab0f6a
RD
2248def FileSystem_RemoveHandler(*args, **kwargs):
2249 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2250 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2251
0085ce49
RD
2252def FileSystem_CleanUpHandlers(*args):
2253 """FileSystem_CleanUpHandlers()"""
2254 return _core_.FileSystem_CleanUpHandlers(*args)
d14a1e28 2255
e811c8ce 2256def FileSystem_FileNameToURL(*args, **kwargs):
0085ce49
RD
2257 """FileSystem_FileNameToURL(String filename) -> String"""
2258 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 2259
e811c8ce 2260def FileSystem_URLToFileName(*args, **kwargs):
0085ce49
RD
2261 """FileSystem_URLToFileName(String url) -> String"""
2262 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 2263
d14a1e28 2264class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 2265 """Proxy of C++ InternetFSHandler class"""
0085ce49
RD
2266 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2267 __repr__ = _swig_repr
2268 def __init__(self, *args, **kwargs):
a95a7133 2269 """__init__(self) -> InternetFSHandler"""
0085ce49 2270 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
e811c8ce 2271 def CanOpen(*args, **kwargs):
a95a7133 2272 """CanOpen(self, String location) -> bool"""
54f9ee45 2273 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2274
2275 def OpenFile(*args, **kwargs):
a95a7133 2276 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2277 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 2278
2131d850 2279_core_.InternetFSHandler_swigregister(InternetFSHandler)
d14a1e28
RD
2280
2281class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 2282 """Proxy of C++ ZipFSHandler class"""
0085ce49
RD
2283 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2284 __repr__ = _swig_repr
2285 def __init__(self, *args, **kwargs):
a95a7133 2286 """__init__(self) -> ZipFSHandler"""
0085ce49 2287 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
e811c8ce 2288 def CanOpen(*args, **kwargs):
a95a7133 2289 """CanOpen(self, String location) -> bool"""
54f9ee45 2290 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2291
2292 def OpenFile(*args, **kwargs):
a95a7133 2293 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2294 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2295
2296 def FindFirst(*args, **kwargs):
a95a7133 2297 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2298 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2299
2300 def FindNext(*args, **kwargs):
a95a7133 2301 """FindNext(self) -> String"""
54f9ee45 2302 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 2303
2131d850 2304_core_.ZipFSHandler_swigregister(ZipFSHandler)
d14a1e28
RD
2305
2306
e811c8ce 2307def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
0085ce49
RD
2308 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2309 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 2310
e811c8ce 2311def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
0085ce49
RD
2312 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2313 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 2314
e811c8ce 2315def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
0085ce49
RD
2316 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2317 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
2318def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2319 """
2320 Add 'file' to the memory filesystem. The dataItem parameter can
2321 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2322 arbitrary data. If a bitmap or image is used then the imgType
2323 parameter should specify what kind of image file it should be
2324 written as, wx.BITMAP_TYPE_PNG, etc.
2325 """
2326 if isinstance(dataItem, wx.Image):
2327 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2328 elif isinstance(dataItem, wx.Bitmap):
2329 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2330 elif type(dataItem) == str:
2331 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2332 else:
2333 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
2334
2335class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 2336 """Proxy of C++ MemoryFSHandler class"""
0085ce49
RD
2337 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2338 __repr__ = _swig_repr
2339 def __init__(self, *args, **kwargs):
a95a7133 2340 """__init__(self) -> MemoryFSHandler"""
0085ce49 2341 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
e811c8ce 2342 def RemoveFile(*args, **kwargs):
66c033b4 2343 """RemoveFile(String filename)"""
54f9ee45 2344 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
2345
2346 RemoveFile = staticmethod(RemoveFile)
d14a1e28 2347 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 2348 def CanOpen(*args, **kwargs):
a95a7133 2349 """CanOpen(self, String location) -> bool"""
54f9ee45 2350 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2351
2352 def OpenFile(*args, **kwargs):
a95a7133 2353 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2354 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2355
2356 def FindFirst(*args, **kwargs):
a95a7133 2357 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2358 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2359
2360 def FindNext(*args, **kwargs):
a95a7133 2361 """FindNext(self) -> String"""
54f9ee45 2362 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 2363
2131d850 2364_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d14a1e28 2365
e811c8ce 2366def MemoryFSHandler_RemoveFile(*args, **kwargs):
0085ce49
RD
2367 """MemoryFSHandler_RemoveFile(String filename)"""
2368 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28 2369
bcd0d7b6
RD
2370IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2371IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2372IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
f5263701
RD
2373IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2374IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
d14a1e28
RD
2375#---------------------------------------------------------------------------
2376
2377class ImageHandler(Object):
27fb7603
RD
2378 """
2379 This is the base class for implementing image file loading/saving, and
2380 image creation from data. It is used within `wx.Image` and is not
2381 normally seen by the application.
2382 """
0085ce49
RD
2383 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2384 def __init__(self): raise AttributeError, "No constructor defined"
2385 __repr__ = _swig_repr
e811c8ce 2386 def GetName(*args, **kwargs):
a95a7133 2387 """GetName(self) -> String"""
54f9ee45 2388 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
2389
2390 def GetExtension(*args, **kwargs):
a95a7133 2391 """GetExtension(self) -> String"""
54f9ee45 2392 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
2393
2394 def GetType(*args, **kwargs):
a95a7133 2395 """GetType(self) -> long"""
54f9ee45 2396 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
2397
2398 def GetMimeType(*args, **kwargs):
a95a7133 2399 """GetMimeType(self) -> String"""
54f9ee45 2400 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
2401
2402 def CanRead(*args, **kwargs):
a95a7133 2403 """CanRead(self, String name) -> bool"""
54f9ee45 2404 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce 2405
b02396e8
RD
2406 def CanReadStream(*args, **kwargs):
2407 """CanReadStream(self, InputStream stream) -> bool"""
2408 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2409
e811c8ce 2410 def SetName(*args, **kwargs):
a95a7133 2411 """SetName(self, String name)"""
54f9ee45 2412 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
2413
2414 def SetExtension(*args, **kwargs):
a95a7133 2415 """SetExtension(self, String extension)"""
54f9ee45 2416 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
2417
2418 def SetType(*args, **kwargs):
a95a7133 2419 """SetType(self, long type)"""
54f9ee45 2420 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
2421
2422 def SetMimeType(*args, **kwargs):
a95a7133 2423 """SetMimeType(self, String mimetype)"""
54f9ee45 2424 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 2425
97ab0f6a
RD
2426 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2427 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2428 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2429 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2131d850 2430_core_.ImageHandler_swigregister(ImageHandler)
d14a1e28 2431
943e8dfd
RD
2432class PyImageHandler(ImageHandler):
2433 """
2434 This is the base class for implementing image file loading/saving, and
2435 image creation from data, all written in Python. To create a custom
2436 image handler derive a new class from wx.PyImageHandler and provide
2437 the following methods::
2438
2439 def DoCanRead(self, stream) --> bool
2440 '''Check if this handler can read the image on the stream'''
2441
2442 def LoadFile(self, image, stream, verbose, index) --> bool
2443 '''Load image data from the stream and load it into image.'''
2444
2445 def SaveFile(self, image, stream, verbose) --> bool
2446 '''Save the iamge data in image to the stream using
2447 this handler's image file format.'''
2448
2449 def GetImageCount(self, stream) --> int
2450 '''If this image format can hold more than one image,
2451 how many does the image on the stream have?'''
2452
2453 To activate your handler create an instance of it and pass it to
2454 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2455 `SetExtension` from your constructor.
2456
2457 """
0085ce49
RD
2458 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2459 __repr__ = _swig_repr
2460 def __init__(self, *args, **kwargs):
943e8dfd
RD
2461 """
2462 __init__(self) -> PyImageHandler
2463
2464 This is the base class for implementing image file loading/saving, and
2465 image creation from data, all written in Python. To create a custom
2466 image handler derive a new class from wx.PyImageHandler and provide
2467 the following methods::
2468
2469 def DoCanRead(self, stream) --> bool
2470 '''Check if this handler can read the image on the stream'''
2471
2472 def LoadFile(self, image, stream, verbose, index) --> bool
2473 '''Load image data from the stream and load it into image.'''
2474
2475 def SaveFile(self, image, stream, verbose) --> bool
2476 '''Save the iamge data in image to the stream using
2477 this handler's image file format.'''
2478
2479 def GetImageCount(self, stream) --> int
2480 '''If this image format can hold more than one image,
2481 how many does the image on the stream have?'''
2482
2483 To activate your handler create an instance of it and pass it to
2484 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2485 `SetExtension` from your constructor.
2486
2487 """
0085ce49 2488 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2489 self._SetSelf(self)
2490
2491 def _SetSelf(*args, **kwargs):
2492 """_SetSelf(self, PyObject self)"""
2493 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2494
2131d850 2495_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2496
d14a1e28 2497class ImageHistogram(object):
093d3ff1 2498 """Proxy of C++ ImageHistogram class"""
0085ce49
RD
2499 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2500 __repr__ = _swig_repr
2501 def __init__(self, *args, **kwargs):
a95a7133 2502 """__init__(self) -> ImageHistogram"""
0085ce49 2503 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
e811c8ce 2504 def MakeKey(*args, **kwargs):
0df68c9f 2505 """
7a27cf7c 2506 MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2507
0df68c9f
RD
2508 Get the key in the histogram for the given RGB values
2509 """
54f9ee45 2510 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2511
2512 MakeKey = staticmethod(MakeKey)
2513 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2514 """
2515 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2516
2517 Find first colour that is not used in the image and has higher RGB
2518 values than startR, startG, startB. Returns a tuple consisting of a
2519 success flag and rgb values.
2520 """
54f9ee45 2521 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2522
f1cbd8fa
RD
2523 def GetCount(*args, **kwargs):
2524 """
2525 GetCount(self, unsigned long key) -> unsigned long
2526
2527 Returns the pixel count for the given key. Use `MakeKey` to create a
2528 key value from a RGB tripple.
2529 """
2530 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2531
2532 def GetCountRGB(*args, **kwargs):
2533 """
7a27cf7c 2534 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2535
2536 Returns the pixel count for the given RGB values.
2537 """
2538 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2539
2540 def GetCountColour(*args, **kwargs):
2541 """
2542 GetCountColour(self, Colour colour) -> unsigned long
2543
2544 Returns the pixel count for the given `wx.Colour` value.
2545 """
2546 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2547
2131d850 2548_core_.ImageHistogram_swigregister(ImageHistogram)
d14a1e28 2549
e811c8ce 2550def ImageHistogram_MakeKey(*args, **kwargs):
0085ce49 2551 """
7a27cf7c 2552 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2553
0df68c9f
RD
2554 Get the key in the histogram for the given RGB values
2555 """
0085ce49 2556 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28 2557
943e8dfd
RD
2558class Image_RGBValue(object):
2559 """
2560 An object that contains values for red, green and blue which represent
2561 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2562 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2563 color space.
2564 """
0085ce49
RD
2565 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2566 __repr__ = _swig_repr
2567 def __init__(self, *args, **kwargs):
943e8dfd
RD
2568 """
2569 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2570
2571 Constructor.
2572 """
0085ce49 2573 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2574 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2575 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2576 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2577_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2578
2579class Image_HSVValue(object):
2580 """
2581 An object that contains values for hue, saturation and value which
2582 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2583 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2584 color space.
2585 """
0085ce49
RD
2586 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2587 __repr__ = _swig_repr
2588 def __init__(self, *args, **kwargs):
943e8dfd
RD
2589 """
2590 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2591
2592 Constructor.
2593 """
0085ce49 2594 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2595 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2596 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2597 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2598_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2599
d14a1e28 2600class Image(Object):
7a27cf7c
RD
2601 """
2602 A platform-independent image class. An image can be created from
2603 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2604 variety of formats. Functions are available to set and get image
2605 bits, so it can be used for basic image manipulation.
2606
2607 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2608 platform-specific `wx.Bitmap` object must be created from it using the
2609 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2610 device context, using `wx.DC.DrawBitmap`.
2611
2612 One colour value of the image may be used as a mask colour which will
2613 lead to the automatic creation of a `wx.Mask` object associated to the
2614 bitmap object.
2615
2616 wx.Image supports alpha channel data, that is in addition to a byte
2617 for the red, green and blue colour components for each pixel it also
2618 stores a byte representing the pixel opacity. An alpha value of 0
2619 corresponds to a transparent pixel (null opacity) while a value of 255
2620 means that the pixel is 100% opaque.
2621
2622 Unlike RGB data, not all images have an alpha channel and before using
2623 `GetAlpha` you should check if this image contains an alpha channel
2624 with `HasAlpha`. Note that currently only images loaded from PNG files
2625 with transparency information will have an alpha channel.
2626 """
0085ce49
RD
2627 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2628 __repr__ = _swig_repr
2629 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2630 """
2631 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2632
2633 Loads an image from a file.
2634 """
0085ce49
RD
2635 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2636 __swig_destroy__ = _core_.delete_Image
2637 __del__ = lambda self : None;
e811c8ce 2638 def Create(*args, **kwargs):
7a27cf7c
RD
2639 """
2640 Create(self, int width, int height, bool clear=True)
2641
2642 Creates a fresh image. If clear is ``True``, the new image will be
2643 initialized to black. Otherwise, the image data will be uninitialized.
2644 """
54f9ee45 2645 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2646
2647 def Destroy(*args, **kwargs):
0df68c9f 2648 """
a95a7133 2649 Destroy(self)
e811c8ce 2650
7a27cf7c 2651 Destroys the image data.
0df68c9f 2652 """
b39fe951
RD
2653 args[0].this.own(False)
2654 return _core_.Image_Destroy(*args, **kwargs)
e811c8ce
RD
2655
2656 def Scale(*args, **kwargs):
7a27cf7c 2657 """
f5263701 2658 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2659
2660 Returns a scaled version of the image. This is also useful for scaling
2661 bitmaps in general as the only other way to scale bitmaps is to blit a
f5263701
RD
2662 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2663 specifies what method to use for resampling the image. It can be
2664 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2665 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2666 bicubic and box averaging resampling methods for upsampling and
2667 downsampling respectively.
7a27cf7c 2668 """
54f9ee45 2669 return _core_.Image_Scale(*args, **kwargs)
e811c8ce 2670
f5263701
RD
2671 def ResampleBox(*args, **kwargs):
2672 """ResampleBox(self, int width, int height) -> Image"""
2673 return _core_.Image_ResampleBox(*args, **kwargs)
2674
2675 def ResampleBicubic(*args, **kwargs):
2676 """ResampleBicubic(self, int width, int height) -> Image"""
2677 return _core_.Image_ResampleBicubic(*args, **kwargs)
2678
2679 def Blur(*args, **kwargs):
2680 """
2681 Blur(self, int radius) -> Image
2682
2683 Blurs the image in both horizontal and vertical directions by the
2684 specified pixel ``radius``. This should not be used when using a
2685 single mask colour for transparency.
2686 """
2687 return _core_.Image_Blur(*args, **kwargs)
2688
2689 def BlurHorizontal(*args, **kwargs):
2690 """
2691 BlurHorizontal(self, int radius) -> Image
2692
2693 Blurs the image in the horizontal direction only. This should not be
2694 used when using a single mask colour for transparency.
2695
2696 """
2697 return _core_.Image_BlurHorizontal(*args, **kwargs)
2698
2699 def BlurVertical(*args, **kwargs):
2700 """
2701 BlurVertical(self, int radius) -> Image
2702
2703 Blurs the image in the vertical direction only. This should not be
2704 used when using a single mask colour for transparency.
2705 """
2706 return _core_.Image_BlurVertical(*args, **kwargs)
2707
e811c8ce 2708 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2709 """
2710 ShrinkBy(self, int xFactor, int yFactor) -> Image
2711
2712 Return a version of the image scaled smaller by the given factors.
2713 """
54f9ee45 2714 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2715
2716 def Rescale(*args, **kwargs):
7a27cf7c 2717 """
f5263701 2718 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2719
2720 Changes the size of the image in-place by scaling it: after a call to
2721 this function, the image will have the given width and height.
2722
2723 Returns the (modified) image itself.
2724 """
54f9ee45 2725 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce 2726
aff4cc5c 2727 def Resize(*args, **kwargs):
7a27cf7c
RD
2728 """
2729 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2730
2731 Changes the size of the image in-place without scaling it, by adding
2732 either a border with the given colour or cropping as necessary. The
2733 image is pasted into a new image with the given size and background
2734 colour at the position pos relative to the upper left of the new
2735 image. If red = green = blue = -1 then use either the current mask
2736 colour if set or find, use, and set a suitable mask colour for any
2737 newly exposed areas.
2738
2739 Returns the (modified) image itself.
2740 """
aff4cc5c
RD
2741 return _core_.Image_Resize(*args, **kwargs)
2742
e811c8ce 2743 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2744 """
2745 SetRGB(self, int x, int y, byte r, byte g, byte b)
2746
2747 Sets the pixel at the given coordinate. This routine performs
2748 bounds-checks for the coordinate so it can be considered a safe way to
2749 manipulate the data, but in some cases this might be too slow so that
2750 the data will have to be set directly. In that case you will have to
2751 get access to the image data using the `GetData` method.
2752 """
54f9ee45 2753 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce 2754
aff4cc5c 2755 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2756 """
2757 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2758
2759 Sets the colour of the pixels within the given rectangle. This routine
2760 performs bounds-checks for the rectangle so it can be considered a
2761 safe way to manipulate the data.
2762 """
aff4cc5c
RD
2763 return _core_.Image_SetRGBRect(*args, **kwargs)
2764
e811c8ce 2765 def GetRed(*args, **kwargs):
7a27cf7c
RD
2766 """
2767 GetRed(self, int x, int y) -> byte
2768
2769 Returns the red intensity at the given coordinate.
2770 """
54f9ee45 2771 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2772
2773 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2774 """
2775 GetGreen(self, int x, int y) -> byte
2776
2777 Returns the green intensity at the given coordinate.
2778 """
54f9ee45 2779 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2780
2781 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2782 """
2783 GetBlue(self, int x, int y) -> byte
2784
2785 Returns the blue intensity at the given coordinate.
2786 """
54f9ee45 2787 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2788
2789 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2790 """
2791 SetAlpha(self, int x, int y, byte alpha)
2792
2793 Sets the alpha value for the given pixel. This function should only be
2794 called if the image has alpha channel data, use `HasAlpha` to check
2795 for this.
2796 """
54f9ee45 2797 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2798
2799 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2800 """
2801 GetAlpha(self, int x, int y) -> byte
2802
2803 Returns the alpha value for the given pixel. This function may only be
2804 called for the images with alpha channel, use `HasAlpha` to check for
2805 this.
2806
2807 The returned value is the *opacity* of the image, i.e. the value of 0
2808 corresponds to the fully transparent pixels while the value of 255 to
2809 the fully opaque pixels.
2810 """
54f9ee45 2811 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2812
2813 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2814 """
2815 HasAlpha(self) -> bool
2816
2817 Returns true if this image has alpha channel, false otherwise.
2818 """
54f9ee45 2819 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce 2820
68350608
RD
2821 def InitAlpha(*args, **kwargs):
2822 """
2823 InitAlpha(self)
2824
2825 Initializes the image alpha channel data. It is an error to call it if
2826 the image already has alpha data. If it doesn't, alpha data will be by
2827 default initialized to all pixels being fully opaque. But if the image
2828 has a a mask colour, all mask pixels will be completely transparent.
2829 """
2830 return _core_.Image_InitAlpha(*args, **kwargs)
2831
bcd0d7b6
RD
2832 def IsTransparent(*args, **kwargs):
2833 """
7a27cf7c 2834 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
bcd0d7b6 2835
7a27cf7c
RD
2836 Returns ``True`` if this pixel is masked or has an alpha value less
2837 than the spcified threshold.
bcd0d7b6
RD
2838 """
2839 return _core_.Image_IsTransparent(*args, **kwargs)
2840
e811c8ce 2841 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2842 """
2843 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2844
2845 Find first colour that is not used in the image and has higher RGB
2846 values than startR, startG, startB. Returns a tuple consisting of a
2847 success flag and rgb values.
2848 """
54f9ee45 2849 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2850
4cf4100f
RD
2851 def ConvertAlphaToMask(*args, **kwargs):
2852 """
bcd0d7b6 2853 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2854
7a27cf7c
RD
2855 If the image has alpha channel, this method converts it to mask. All
2856 pixels with alpha value less than ``threshold`` are replaced with the
2857 mask colour and the alpha channel is removed. The mask colour is
2858 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2859
2860 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2861 nothing.
2862 """
2863 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2864
8fb0e70a
RD
2865 def ConvertColourToAlpha(*args, **kwargs):
2866 """
7a27cf7c 2867 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2868
2869 This method converts an image where the original alpha information is
2870 only available as a shades of a colour (actually shades of grey)
2871 typically when you draw anti-aliased text into a bitmap. The DC
2872 drawing routines draw grey values on the black background although
2873 they actually mean to draw white with differnt alpha values. This
2874 method reverses it, assuming a black (!) background and white text.
2875 The method will then fill up the whole image with the colour given.
2876 """
2877 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2878
e811c8ce 2879 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2880 """
2881 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2882
2883 Sets the image's mask so that the pixels that have RGB value of
2884 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2885 by first finding an unused colour in the image, setting this colour as
2886 the mask colour and then using this colour to draw all pixels in the
2887 image who corresponding pixel in mask has given RGB value.
2888
2889 Returns ``False`` if ``mask`` does not have same dimensions as the
2890 image or if there is no unused colour left. Returns ``True`` if the
2891 mask was successfully applied.
2892
2893 Note that this method involves computing the histogram, which is
2894 computationally intensive operation.
2895 """
54f9ee45 2896 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2897
2898 def CanRead(*args, **kwargs):
7a27cf7c
RD
2899 """
2900 CanRead(String filename) -> bool
2901
2902 Returns True if the image handlers can read this file.
2903 """
54f9ee45 2904 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2905
2906 CanRead = staticmethod(CanRead)
2907 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2908 """
2909 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2910
2911 If the image file contains more than one image and the image handler
2912 is capable of retrieving these individually, this function will return
2913 the number of available images.
2914 """
54f9ee45 2915 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2916
2917 GetImageCount = staticmethod(GetImageCount)
2918 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2919 """
2920 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2921
2922 Loads an image from a file. If no handler type is provided, the
2923 library will try to autodetect the format.
2924 """
54f9ee45 2925 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2926
2927 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2928 """
2929 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2930
2931 Loads an image from a file, specifying the image type with a MIME type
2932 string.
2933 """
54f9ee45 2934 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2935
2936 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2937 """
2938 SaveFile(self, String name, int type) -> bool
2939
2940 Saves an image in the named file.
2941 """
54f9ee45 2942 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2943
2944 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2945 """
2946 SaveMimeFile(self, String name, String mimetype) -> bool
2947
2948 Saves an image in the named file.
2949 """
54f9ee45 2950 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2951
2952 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2953 """
2954 CanReadStream(InputStream stream) -> bool
2955
2956 Returns True if the image handlers can read an image file from the
2957 data currently on the input stream, or a readable Python file-like
2958 object.
2959 """
54f9ee45 2960 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2961
2962 CanReadStream = staticmethod(CanReadStream)
2963 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2964 """
2965 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2966
2967 Loads an image from an input stream or a readable Python file-like
2968 object. If no handler type is provided, the library will try to
2969 autodetect the format.
2970 """
54f9ee45 2971 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2972
2973 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2974 """
2975 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2976
2977 Loads an image from an input stream or a readable Python file-like
2978 object, using a MIME type string to specify the image file format.
2979 """
54f9ee45 2980 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce 2981
b39fe951 2982 def IsOk(*args, **kwargs):
7a27cf7c 2983 """
b39fe951 2984 IsOk(self) -> bool
7a27cf7c
RD
2985
2986 Returns true if image data is present.
2987 """
b39fe951 2988 return _core_.Image_IsOk(*args, **kwargs)
e811c8ce 2989
b39fe951 2990 Ok = IsOk
e811c8ce 2991 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2992 """
2993 GetWidth(self) -> int
2994
2995 Gets the width of the image in pixels.
2996 """
54f9ee45 2997 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2998
2999 def GetHeight(*args, **kwargs):
7a27cf7c
RD
3000 """
3001 GetHeight(self) -> int
3002
3003 Gets the height of the image in pixels.
3004 """
54f9ee45 3005 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 3006
b2df227b 3007 def GetSize(*args, **kwargs):
7a27cf7c
RD
3008 """
3009 GetSize(self) -> Size
3010
3011 Returns the size of the image in pixels.
3012 """
54f9ee45 3013 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 3014
e811c8ce 3015 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
3016 """
3017 GetSubImage(self, Rect rect) -> Image
3018
3019 Returns a sub image of the current one as long as the rect belongs
3020 entirely to the image.
3021 """
54f9ee45 3022 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce 3023
aff4cc5c 3024 def Size(*args, **kwargs):
7a27cf7c
RD
3025 """
3026 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
3027
3028 Returns a resized version of this image without scaling it by adding
3029 either a border with the given colour or cropping as necessary. The
3030 image is pasted into a new image with the given size and background
3031 colour at the position ``pos`` relative to the upper left of the new
3032 image. If red = green = blue = -1 then use either the current mask
3033 colour if set or find, use, and set a suitable mask colour for any
3034 newly exposed areas.
3035 """
aff4cc5c
RD
3036 return _core_.Image_Size(*args, **kwargs)
3037
e811c8ce 3038 def Copy(*args, **kwargs):
7a27cf7c
RD
3039 """
3040 Copy(self) -> Image
3041
3042 Returns an identical copy of the image.
3043 """
54f9ee45 3044 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
3045
3046 def Paste(*args, **kwargs):
7a27cf7c
RD
3047 """
3048 Paste(self, Image image, int x, int y)
3049
3050 Pastes ``image`` into this instance and takes care of the mask colour
3051 and any out of bounds problems.
3052 """
54f9ee45 3053 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
3054
3055 def GetData(*args, **kwargs):
61d07ac7
RD
3056 """
3057 GetData(self) -> PyObject
3058
3059 Returns a string containing a copy of the RGB bytes of the image.
3060 """
54f9ee45 3061 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
3062
3063 def SetData(*args, **kwargs):
61d07ac7
RD
3064 """
3065 SetData(self, buffer data)
3066
3067 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
3068 either a string or a buffer object holding the data and the length of
3069 the data must be width*height*3.
3070 """
54f9ee45 3071 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
3072
3073 def GetDataBuffer(*args, **kwargs):
61d07ac7
RD
3074 """
3075 GetDataBuffer(self) -> PyObject
3076
3077 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
3078 image data buffer inside the wx.Image. You need to ensure that you do
3079 not use this buffer object after the image has been destroyed.
61d07ac7 3080 """
54f9ee45 3081 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
3082
3083 def SetDataBuffer(*args, **kwargs):
61d07ac7
RD
3084 """
3085 SetDataBuffer(self, buffer data)
3086
3087 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
3088 object. This can save making an extra copy of the data but you must
3089 ensure that the buffer object lives longer than the wx.Image does.
61d07ac7 3090 """
54f9ee45 3091 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
3092
3093 def GetAlphaData(*args, **kwargs):
61d07ac7
RD
3094 """
3095 GetAlphaData(self) -> PyObject
3096
3097 Returns a string containing a copy of the alpha bytes of the image.
3098 """
54f9ee45 3099 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
3100
3101 def SetAlphaData(*args, **kwargs):
61d07ac7
RD
3102 """
3103 SetAlphaData(self, buffer alpha)
3104
3105 Resets the Image's alpha data from a buffer of bytes. Accepts either
3106 a string or a buffer object holding the data and the length of the
3107 data must be width*height.
3108 """
54f9ee45 3109 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
3110
3111 def GetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
3112 """
3113 GetAlphaBuffer(self) -> PyObject
3114
3115 Returns a writable Python buffer object that is pointing at the Alpha
3116 data buffer inside the wx.Image. You need to ensure that you do not
3117 use this buffer object after the image has been destroyed.
3118 """
54f9ee45 3119 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
3120
3121 def SetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
3122 """
3123 SetAlphaBuffer(self, buffer alpha)
3124
3125 Sets the internal image alpha pointer to point at a Python buffer
3126 object. This can save making an extra copy of the data but you must
3127 ensure that the buffer object lives as long as the wx.Image does.
3128 """
54f9ee45 3129 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
3130
3131 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
3132 """
3133 SetMaskColour(self, byte r, byte g, byte b)
3134
3135 Sets the mask colour for this image (and tells the image to use the
3136 mask).
3137 """
54f9ee45 3138 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce 3139
aff4cc5c
RD
3140 def GetOrFindMaskColour(*args, **kwargs):
3141 """
3142 GetOrFindMaskColour() -> (r,g,b)
3143
3144 Get the current mask colour or find a suitable colour.
3145 """
3146 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
3147
e811c8ce 3148 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
3149 """
3150 GetMaskRed(self) -> byte
3151
3152 Gets the red component of the mask colour.
3153 """
54f9ee45 3154 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
3155
3156 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
3157 """
3158 GetMaskGreen(self) -> byte
3159
3160 Gets the green component of the mask colour.
3161 """
54f9ee45 3162 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
3163
3164 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
3165 """
3166 GetMaskBlue(self) -> byte
3167
3168 Gets the blue component of the mask colour.
3169 """
54f9ee45 3170 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
3171
3172 def SetMask(*args, **kwargs):
7a27cf7c
RD
3173 """
3174 SetMask(self, bool mask=True)
3175
3176 Specifies whether there is a mask or not. The area of the mask is
3177 determined by the current mask colour.
3178 """
54f9ee45 3179 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
3180
3181 def HasMask(*args, **kwargs):
7a27cf7c
RD
3182 """
3183 HasMask(self) -> bool
3184
3185 Returns ``True`` if there is a mask active, ``False`` otherwise.
3186 """
54f9ee45 3187 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
3188
3189 def Rotate(*args, **kwargs):
0df68c9f 3190 """
a95a7133 3191 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f 3192 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
3193
3194 Rotates the image about the given point, by ``angle`` radians. Passing
3195 ``True`` to ``interpolating`` results in better image quality, but is
3196 slower. If the image has a mask, then the mask colour is used for the
3197 uncovered pixels in the rotated image background. Otherwise, black
3198 will be used as the fill colour.
3199
3200 Returns the rotated image, leaving this image intact.
0df68c9f 3201 """
54f9ee45 3202 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
3203
3204 def Rotate90(*args, **kwargs):
7a27cf7c
RD
3205 """
3206 Rotate90(self, bool clockwise=True) -> Image
3207
3208 Returns a copy of the image rotated 90 degrees in the direction
3209 indicated by ``clockwise``.
3210 """
54f9ee45 3211 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
3212
3213 def Mirror(*args, **kwargs):
7a27cf7c
RD
3214 """
3215 Mirror(self, bool horizontally=True) -> Image
3216
3217 Returns a mirrored copy of the image. The parameter ``horizontally``
3218 indicates the orientation.
3219 """
54f9ee45 3220 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
3221
3222 def Replace(*args, **kwargs):
0df68c9f 3223 """
7a27cf7c
RD
3224 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
3225
3226 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
3227 ``(r2,g2,b2)``.
0df68c9f 3228 """
54f9ee45 3229 return _core_.Image_Replace(*args, **kwargs)
e811c8ce 3230
32fe5131
RD
3231 def ConvertToGreyscale(*args, **kwargs):
3232 """
3233 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
3234
3235 Convert to greyscale image. Uses the luminance component (Y) of the
3236 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
3237 defaults to ITU-T BT.601
3238 """
3239 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
3240
e811c8ce 3241 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
3242 """
3243 ConvertToMono(self, byte r, byte g, byte b) -> Image
3244
3245 Returns monochromatic version of the image. The returned image has
3246 white colour where the original has ``(r,g,b)`` colour and black
3247 colour everywhere else.
3248 """
54f9ee45 3249 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
3250
3251 def SetOption(*args, **kwargs):
7a27cf7c
RD
3252 """
3253 SetOption(self, String name, String value)
3254
3255 Sets an image handler defined option. For example, when saving as a
3256 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
3257 number between 0 and 100 (0 is terrible, 100 is very good).
3258 """
54f9ee45 3259 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
3260
3261 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
3262 """
3263 SetOptionInt(self, String name, int value)
3264
3265 Sets an image option as an integer.
3266 """
54f9ee45 3267 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
3268
3269 def GetOption(*args, **kwargs):
7a27cf7c
RD
3270 """
3271 GetOption(self, String name) -> String
3272
3273 Gets the value of an image handler option.
3274 """
54f9ee45 3275 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
3276
3277 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
3278 """
3279 GetOptionInt(self, String name) -> int
3280
3281 Gets the value of an image handler option as an integer. If the given
3282 option is not present, the function returns 0.
3283 """
54f9ee45 3284 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
3285
3286 def HasOption(*args, **kwargs):
7a27cf7c
RD
3287 """
3288 HasOption(self, String name) -> bool
3289
3290 Returns true if the given option is present.
3291 """
54f9ee45 3292 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
3293
3294 def CountColours(*args, **kwargs):
a95a7133 3295 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 3296 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
3297
3298 def ComputeHistogram(*args, **kwargs):
a95a7133 3299 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 3300 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
3301
3302 def AddHandler(*args, **kwargs):
66c033b4 3303 """AddHandler(ImageHandler handler)"""
54f9ee45 3304 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
3305
3306 AddHandler = staticmethod(AddHandler)
3307 def InsertHandler(*args, **kwargs):
66c033b4 3308 """InsertHandler(ImageHandler handler)"""
54f9ee45 3309 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
3310
3311 InsertHandler = staticmethod(InsertHandler)
3312 def RemoveHandler(*args, **kwargs):
66c033b4 3313 """RemoveHandler(String name) -> bool"""
54f9ee45 3314 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
3315
3316 RemoveHandler = staticmethod(RemoveHandler)
0085ce49
RD
3317 def GetHandlers(*args, **kwargs):
3318 """GetHandlers() -> PyObject"""
3319 return _core_.Image_GetHandlers(*args, **kwargs)
3320
3321 GetHandlers = staticmethod(GetHandlers)
e811c8ce 3322 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3323 """
3324 GetImageExtWildcard() -> String
3325
3326 Iterates all registered wxImageHandler objects, and returns a string
3327 containing file extension masks suitable for passing to file open/save
3328 dialog boxes.
3329 """
54f9ee45 3330 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
3331
3332 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3333 def ConvertToBitmap(*args, **kwargs):
1fbf26be 3334 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 3335 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
3336
3337 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3338 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
54f9ee45 3339 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce 3340
943e8dfd
RD
3341 def RotateHue(*args, **kwargs):
3342 """
3343 RotateHue(self, double angle)
3344
3345 Rotates the hue of each pixel of the image. Hue is a double in the
3346 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3347 """
3348 return _core_.Image_RotateHue(*args, **kwargs)
3349
3350 def RGBtoHSV(*args, **kwargs):
3351 """
3352 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3353
3354 Converts a color in RGB color space to HSV color space.
3355 """
3356 return _core_.Image_RGBtoHSV(*args, **kwargs)
3357
3358 RGBtoHSV = staticmethod(RGBtoHSV)
3359 def HSVtoRGB(*args, **kwargs):
3360 """
3361 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3362
3363 Converts a color in HSV color space to RGB color space.
3364 """
3365 return _core_.Image_HSVtoRGB(*args, **kwargs)
3366
3367 HSVtoRGB = staticmethod(HSVtoRGB)
b39fe951 3368 def __nonzero__(self): return self.IsOk()
97ab0f6a
RD
3369 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3370 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3371 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3372 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3373 Height = property(GetHeight,doc="See `GetHeight`")
3374 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3375 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3376 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
97ab0f6a 3377 Width = property(GetWidth,doc="See `GetWidth`")
2131d850 3378_core_.Image_swigregister(Image)
d14a1e28
RD
3379
3380def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3381 """
3382 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3383
3384 Loads an image from a file, using a MIME type string (such as
3385 'image/jpeg') to specify image type.
3386 """
54f9ee45 3387 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
3388 return val
3389
3390def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3391 """
3392 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3393
3394 Loads an image from an input stream, or any readable Python file-like
3395 object.
3396 """
54f9ee45 3397 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
3398 return val
3399
3400def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3401 """
3402 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3403
3404 Loads an image from an input stream, or any readable Python file-like
3405 object, specifying the image format with a MIME type string.
3406 """
54f9ee45 3407 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
3408 return val
3409
66c033b4 3410def EmptyImage(*args, **kwargs):
61d07ac7
RD
3411 """
3412 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3413
3414 Construct an empty image of a given size, optionally setting all
3415 pixels to black.
3416 """
66c033b4 3417 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
3418 return val
3419
3420def ImageFromBitmap(*args, **kwargs):
61d07ac7
RD
3421 """
3422 ImageFromBitmap(Bitmap bitmap) -> Image
3423
3424 Construct an Image from a `wx.Bitmap`.
3425 """
54f9ee45 3426 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
3427 return val
3428
3429def ImageFromData(*args, **kwargs):
61d07ac7
RD
3430 """
3431 ImageFromData(int width, int height, buffer data) -> Image
3432
3433 Construct an Image from a buffer of RGB bytes. Accepts either a
3434 string or a buffer object holding the data and the length of the data
3435 must be width*height*3.
3436 """
54f9ee45 3437 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
3438 return val
3439
1823fbb4 3440def ImageFromDataWithAlpha(*args, **kwargs):
61d07ac7
RD
3441 """
3442 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3443
3444 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3445 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3446 length of the data must be width*height*3 bytes, and the length of the
3447 alpha data must be width*height bytes.
61d07ac7 3448 """
1823fbb4 3449 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
1823fbb4
RD
3450 return val
3451
e811c8ce 3452def Image_CanRead(*args, **kwargs):
0085ce49 3453 """
7a27cf7c
RD
3454 Image_CanRead(String filename) -> bool
3455
3456 Returns True if the image handlers can read this file.
3457 """
0085ce49 3458 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 3459
e811c8ce 3460def Image_GetImageCount(*args, **kwargs):
0085ce49 3461 """
7a27cf7c
RD
3462 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3463
3464 If the image file contains more than one image and the image handler
3465 is capable of retrieving these individually, this function will return
3466 the number of available images.
3467 """
0085ce49 3468 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 3469
e811c8ce 3470def Image_CanReadStream(*args, **kwargs):
0085ce49 3471 """
7a27cf7c
RD
3472 Image_CanReadStream(InputStream stream) -> bool
3473
3474 Returns True if the image handlers can read an image file from the
3475 data currently on the input stream, or a readable Python file-like
3476 object.
3477 """
0085ce49 3478 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 3479
e811c8ce 3480def Image_AddHandler(*args, **kwargs):
0085ce49
RD
3481 """Image_AddHandler(ImageHandler handler)"""
3482 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 3483
e811c8ce 3484def Image_InsertHandler(*args, **kwargs):
0085ce49
RD
3485 """Image_InsertHandler(ImageHandler handler)"""
3486 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 3487
e811c8ce 3488def Image_RemoveHandler(*args, **kwargs):
0085ce49
RD
3489 """Image_RemoveHandler(String name) -> bool"""
3490 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 3491
0085ce49
RD
3492def Image_GetHandlers(*args):
3493 """Image_GetHandlers() -> PyObject"""
3494 return _core_.Image_GetHandlers(*args)
3495
3496def Image_GetImageExtWildcard(*args):
3497 """
7a27cf7c
RD
3498 Image_GetImageExtWildcard() -> String
3499
3500 Iterates all registered wxImageHandler objects, and returns a string
3501 containing file extension masks suitable for passing to file open/save
3502 dialog boxes.
3503 """
0085ce49 3504 return _core_.Image_GetImageExtWildcard(*args)
d14a1e28 3505
943e8dfd 3506def Image_RGBtoHSV(*args, **kwargs):
0085ce49 3507 """
943e8dfd
RD
3508 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3509
3510 Converts a color in RGB color space to HSV color space.
3511 """
0085ce49 3512 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3513
3514def Image_HSVtoRGB(*args, **kwargs):
0085ce49 3515 """
943e8dfd
RD
3516 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3517
3518 Converts a color in HSV color space to RGB color space.
3519 """
0085ce49 3520 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3521
fc46b7f3
RD
3522
3523def _ImageFromBuffer(*args, **kwargs):
3524 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3525 return _core_._ImageFromBuffer(*args, **kwargs)
3526def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3527 """
3528 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
eec1c382
RD
3529 parameter must be a Python object that implements the buffer interface,
3530 such as a string, array, etc. The dataBuffer object is expected to
3531 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3532 object can optionally be supplied for the image's alpha channel data, and
3533 it is expected to be width*height bytes long.
fc46b7f3
RD
3534
3535 The wx.Image will be created with its data and alpha pointers initialized
3536 to the memory address pointed to by the buffer objects, thus saving the
3537 time needed to copy the image data from the buffer object to the wx.Image.
3538 While this has advantages, it also has the shoot-yourself-in-the-foot
3539 risks associated with sharing a C pointer between two objects.
3540
3541 To help alleviate the risk a reference to the data and alpha buffer
3542 objects are kept with the wx.Image, so that they won't get deleted until
3543 after the wx.Image is deleted. However please be aware that it is not
3544 guaranteed that an object won't move its memory buffer to a new location
3545 when it needs to resize its contents. If that happens then the wx.Image
3546 will end up referring to an invalid memory location and could cause the
3547 application to crash. Therefore care should be taken to not manipulate
3548 the objects used for the data and alpha buffers in a way that would cause
3549 them to change size.
3550 """
fc46b7f3
RD
3551 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3552 image._buffer = dataBuffer
3553 image._alpha = alphaBuffer
3554 return image
3555
5e4ca4a8
RD
3556def InitAllImageHandlers():
3557 """
3558 The former functionality of InitAllImageHanders is now done internal to
3559 the _core_ extension module and so this function has become a simple NOP.
3560 """
3561 pass
d14a1e28 3562
54f9ee45
RD
3563IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3564IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3565PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3566PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3567PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
54f9ee45
RD
3568BMP_24BPP = _core_.BMP_24BPP
3569BMP_8BPP = _core_.BMP_8BPP
3570BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3571BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3572BMP_8BPP_RED = _core_.BMP_8BPP_RED
3573BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3574BMP_4BPP = _core_.BMP_4BPP
3575BMP_1BPP = _core_.BMP_1BPP
3576BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 3577class BMPHandler(ImageHandler):
27fb7603 3578 """A `wx.ImageHandler` for \*.bmp bitmap files."""
0085ce49
RD
3579 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3580 __repr__ = _swig_repr
3581 def __init__(self, *args, **kwargs):
27fb7603
RD
3582 """
3583 __init__(self) -> BMPHandler
3584
3585 A `wx.ImageHandler` for \*.bmp bitmap files.
3586 """
0085ce49 3587 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3588_core_.BMPHandler_swigregister(BMPHandler)
d14a1e28 3589NullImage = cvar.NullImage
0c243d93 3590IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d14a1e28
RD
3591IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3592IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3593IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3594IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
0c243d93
RD
3595IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3596IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d14a1e28 3597IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3598IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
0c243d93
RD
3599IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3600IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3601IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3602IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3603IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3604IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d14a1e28
RD
3605
3606class ICOHandler(BMPHandler):
27fb7603 3607 """A `wx.ImageHandler` for \*.ico icon files."""
0085ce49
RD
3608 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3609 __repr__ = _swig_repr
3610 def __init__(self, *args, **kwargs):
27fb7603
RD
3611 """
3612 __init__(self) -> ICOHandler
3613
3614 A `wx.ImageHandler` for \*.ico icon files.
3615 """
0085ce49 3616 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3617_core_.ICOHandler_swigregister(ICOHandler)
d14a1e28
RD
3618
3619class CURHandler(ICOHandler):
27fb7603 3620 """A `wx.ImageHandler` for \*.cur cursor files."""
0085ce49
RD
3621 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3622 __repr__ = _swig_repr
3623 def __init__(self, *args, **kwargs):
27fb7603
RD
3624 """
3625 __init__(self) -> CURHandler
3626
3627 A `wx.ImageHandler` for \*.cur cursor files.
3628 """
0085ce49 3629 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3630_core_.CURHandler_swigregister(CURHandler)
d14a1e28
RD
3631
3632class ANIHandler(CURHandler):
27fb7603 3633 """A `wx.ImageHandler` for \*.ani animated cursor files."""
0085ce49
RD
3634 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3635 __repr__ = _swig_repr
3636 def __init__(self, *args, **kwargs):
27fb7603
RD
3637 """
3638 __init__(self) -> ANIHandler
3639
3640 A `wx.ImageHandler` for \*.ani animated cursor files.
3641 """
0085ce49 3642 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3643_core_.ANIHandler_swigregister(ANIHandler)
d14a1e28
RD
3644
3645class PNGHandler(ImageHandler):
27fb7603 3646 """A `wx.ImageHandler` for PNG image files."""
0085ce49
RD
3647 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3648 __repr__ = _swig_repr
3649 def __init__(self, *args, **kwargs):
27fb7603
RD
3650 """
3651 __init__(self) -> PNGHandler
3652
3653 A `wx.ImageHandler` for PNG image files.
3654 """
0085ce49 3655 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3656_core_.PNGHandler_swigregister(PNGHandler)
d14a1e28
RD
3657
3658class GIFHandler(ImageHandler):
27fb7603 3659 """A `wx.ImageHandler` for GIF image files."""
0085ce49
RD
3660 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3661 __repr__ = _swig_repr
3662 def __init__(self, *args, **kwargs):
27fb7603
RD
3663 """
3664 __init__(self) -> GIFHandler
3665
3666 A `wx.ImageHandler` for GIF image files.
3667 """
0085ce49 3668 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3669_core_.GIFHandler_swigregister(GIFHandler)
d14a1e28
RD
3670
3671class PCXHandler(ImageHandler):
27fb7603 3672 """A `wx.ImageHandler` for PCX imager files."""
0085ce49
RD
3673 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3674 __repr__ = _swig_repr
3675 def __init__(self, *args, **kwargs):
27fb7603
RD
3676 """
3677 __init__(self) -> PCXHandler
3678
3679 A `wx.ImageHandler` for PCX imager files.
3680 """
0085ce49 3681 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3682_core_.PCXHandler_swigregister(PCXHandler)
d14a1e28
RD
3683
3684class JPEGHandler(ImageHandler):
27fb7603 3685 """A `wx.ImageHandler` for JPEG/JPG image files."""
0085ce49
RD
3686 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3687 __repr__ = _swig_repr
3688 def __init__(self, *args, **kwargs):
27fb7603
RD
3689 """
3690 __init__(self) -> JPEGHandler
3691
3692 A `wx.ImageHandler` for JPEG/JPG image files.
3693 """
0085ce49 3694 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3695_core_.JPEGHandler_swigregister(JPEGHandler)
d14a1e28
RD
3696
3697class PNMHandler(ImageHandler):
27fb7603 3698 """A `wx.ImageHandler` for PNM image files."""
0085ce49
RD
3699 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3700 __repr__ = _swig_repr
3701 def __init__(self, *args, **kwargs):
27fb7603
RD
3702 """
3703 __init__(self) -> PNMHandler
3704
3705 A `wx.ImageHandler` for PNM image files.
3706 """
0085ce49 3707 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3708_core_.PNMHandler_swigregister(PNMHandler)
d14a1e28
RD
3709
3710class XPMHandler(ImageHandler):
27fb7603 3711 """A `wx.ImageHandler` for XPM image."""
0085ce49
RD
3712 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3713 __repr__ = _swig_repr
3714 def __init__(self, *args, **kwargs):
27fb7603
RD
3715 """
3716 __init__(self) -> XPMHandler
3717
3718 A `wx.ImageHandler` for XPM image.
3719 """
0085ce49 3720 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3721_core_.XPMHandler_swigregister(XPMHandler)
d14a1e28
RD
3722
3723class TIFFHandler(ImageHandler):
27fb7603 3724 """A `wx.ImageHandler` for TIFF image files."""
0085ce49
RD
3725 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3726 __repr__ = _swig_repr
3727 def __init__(self, *args, **kwargs):
27fb7603
RD
3728 """
3729 __init__(self) -> TIFFHandler
3730
3731 A `wx.ImageHandler` for TIFF image files.
3732 """
0085ce49 3733 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3734_core_.TIFFHandler_swigregister(TIFFHandler)
d14a1e28 3735
580080c5
RD
3736class TGAHandler(ImageHandler):
3737 """A `wx.ImageHandler` for TGA image files."""
3738 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3739 __repr__ = _swig_repr
3740 def __init__(self, *args, **kwargs):
3741 """
3742 __init__(self) -> TGAHandler
3743
3744 A `wx.ImageHandler` for TGA image files.
3745 """
3746 _core_.TGAHandler_swiginit(self,_core_.new_TGAHandler(*args, **kwargs))
3747_core_.TGAHandler_swigregister(TGAHandler)
3748
c0de73ae
RD
3749QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3750QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3751class Quantize(object):
3752 """Performs quantization, or colour reduction, on a wxImage."""
0085ce49
RD
3753 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3754 def __init__(self): raise AttributeError, "No constructor defined"
3755 __repr__ = _swig_repr
c0de73ae
RD
3756 def Quantize(*args, **kwargs):
3757 """
3758 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3759
3760 Reduce the colours in the source image and put the result into the
3761 destination image, setting the palette in the destination if
3762 needed. Both images may be the same, to overwrite the source image.
3763 """
3764 return _core_.Quantize_Quantize(*args, **kwargs)
3765
3766 Quantize = staticmethod(Quantize)
2131d850 3767_core_.Quantize_swigregister(Quantize)
c0de73ae
RD
3768
3769def Quantize_Quantize(*args, **kwargs):
0085ce49 3770 """
c0de73ae
RD
3771 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3772
3773 Reduce the colours in the source image and put the result into the
3774 destination image, setting the palette in the destination if
3775 needed. Both images may be the same, to overwrite the source image.
3776 """
0085ce49 3777 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3778
d14a1e28
RD
3779#---------------------------------------------------------------------------
3780
3781class EvtHandler(Object):
093d3ff1 3782 """Proxy of C++ EvtHandler class"""
0085ce49
RD
3783 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3784 __repr__ = _swig_repr
3785 def __init__(self, *args, **kwargs):
a95a7133 3786 """__init__(self) -> EvtHandler"""
0085ce49 3787 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d49bdf34
RD
3788 self._setOORInfo(self)
3789
e811c8ce 3790 def GetNextHandler(*args, **kwargs):
a95a7133 3791 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 3792 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
3793
3794 def GetPreviousHandler(*args, **kwargs):
a95a7133 3795 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 3796 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3797
3798 def SetNextHandler(*args, **kwargs):
a95a7133 3799 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 3800 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
3801
3802 def SetPreviousHandler(*args, **kwargs):
a95a7133 3803 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 3804 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3805
3806 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3807 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 3808 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3809
3810 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3811 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 3812 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3813
3814 def ProcessEvent(*args, **kwargs):
a95a7133 3815 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 3816 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
3817
3818 def AddPendingEvent(*args, **kwargs):
a95a7133 3819 """AddPendingEvent(self, Event event)"""
54f9ee45 3820 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
3821
3822 def ProcessPendingEvents(*args, **kwargs):
a95a7133 3823 """ProcessPendingEvents(self)"""
54f9ee45 3824 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
3825
3826 def Connect(*args, **kwargs):
a95a7133 3827 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 3828 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
3829
3830 def Disconnect(*args, **kwargs):
2131d850 3831 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 3832 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
3833
3834 def _setOORInfo(*args, **kwargs):
689b42ee 3835 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef 3836 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
15665b47 3837 args[0].this.own(False)
7e08d4ef 3838 return val
e811c8ce 3839
d14a1e28
RD
3840 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3841 """
3842 Bind an event to an event handler.
3843
db3e571a
RD
3844 :param event: One of the EVT_* objects that specifies the
3845 type of event to bind,
d14a1e28 3846
db3e571a
RD
3847 :param handler: A callable object to be invoked when the
3848 event is delivered to self. Pass None to
3849 disconnect an event handler.
d14a1e28 3850
db3e571a
RD
3851 :param source: Sometimes the event originates from a
3852 different window than self, but you still
3853 want to catch it in self. (For example, a
3854 button event delivered to a frame.) By
3855 passing the source of the event, the event
3856 handling system is able to differentiate
3857 between the same event type from different
3858 controls.
d14a1e28 3859
db3e571a
RD
3860 :param id: Used to spcify the event source by ID instead
3861 of instance.
3862
3863 :param id2: Used when it is desirable to bind a handler
3864 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
3865 """
3866 if source is not None:
3867 id = source.GetId()
3868 event.Bind(self, id, id2, handler)
3869
66c033b4
RD
3870 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3871 """
3872 Disconencts the event handler binding for event from self.
3873 Returns True if successful.
3874 """
3875 if source is not None:
3876 id = source.GetId()
3877 return event.Unbind(self, id, id2)
d14a1e28 3878
97ab0f6a
RD
3879 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3880 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3881 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
2131d850 3882_core_.EvtHandler_swigregister(EvtHandler)
d14a1e28
RD
3883
3884#---------------------------------------------------------------------------
3885
3886class PyEventBinder(object):
3887 """
3888 Instances of this class are used to bind specific events to event
3889 handlers.
3890 """
3891 def __init__(self, evtType, expectedIDs=0):
3892 if expectedIDs not in [0, 1, 2]:
3893 raise ValueError, "Invalid number of expectedIDs"
3894 self.expectedIDs = expectedIDs
3895
3896 if type(evtType) == list or type(evtType) == tuple:
3897 self.evtType = evtType
3898 else:
3899 self.evtType = [evtType]
3900
3901
3902 def Bind(self, target, id1, id2, function):
3903 """Bind this set of event types to target."""
3904 for et in self.evtType:
3905 target.Connect(id1, id2, et, function)
3906
66c033b4
RD
3907
3908 def Unbind(self, target, id1, id2):
3909 """Remove an event binding."""
3910 success = 0
3911 for et in self.evtType:
3912 success += target.Disconnect(id1, id2, et)
3913 return success != 0
3914
b08d67c2
RD
3915 def _getEvtType(self):
3916 """
3917 Make it easy to get to the default wxEventType typeID for this
3918 event binder.
3919 """
3920 return self.evtType[0]
3921
3922 typeId = property(_getEvtType)
3923
d14a1e28
RD
3924
3925 def __call__(self, *args):
3926 """
3927 For backwards compatibility with the old EVT_* functions.
3928 Should be called with either (window, func), (window, ID,
3929 func) or (window, ID1, ID2, func) parameters depending on the
3930 type of the event.
3931 """
3932 assert len(args) == 2 + self.expectedIDs
3933 id1 = wx.ID_ANY
3934 id2 = wx.ID_ANY
3935 target = args[0]
3936 if self.expectedIDs == 0:
3937 func = args[1]
3938 elif self.expectedIDs == 1:
3939 id1 = args[1]
3940 func = args[2]
3941 elif self.expectedIDs == 2:
3942 id1 = args[1]
3943 id2 = args[2]
3944 func = args[3]
3945 else:
3946 raise ValueError, "Unexpected number of IDs"
3947
3948 self.Bind(target, id1, id2, func)
3949
3950
3951# These two are square pegs that don't fit the PyEventBinder hole...
3952def EVT_COMMAND(win, id, cmd, func):
3953 win.Connect(id, -1, cmd, func)
3954def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3955 win.Connect(id1, id2, cmd, func)
3956
3957
3958#---------------------------------------------------------------------------
3959
3960#---------------------------------------------------------------------------
3961
54f9ee45
RD
3962EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3963EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 3964
0085ce49 3965def NewEventType(*args):
2131d850 3966 """NewEventType() -> EventType"""
0085ce49 3967 return _core_.NewEventType(*args)
4976f996 3968wxEVT_ANY = _core_.wxEVT_ANY
54f9ee45
RD
3969wxEVT_NULL = _core_.wxEVT_NULL
3970wxEVT_FIRST = _core_.wxEVT_FIRST
3971wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3972wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3973wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3974wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3975wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3976wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3977wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3978wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3979wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3980wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3981wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3982wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3983wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3984wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3985wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3986wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3987wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3988wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3989wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3990wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3991wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3992wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3993wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3994wxEVT_MOTION = _core_.wxEVT_MOTION
3995wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3996wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3997wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3998wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3999wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
4000wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
4001wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
4002wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
4003wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
4004wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
4005wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
4006wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
4007wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
4008wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
4009wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
4010wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
4011wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
4012wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
4013wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
4014wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
4015wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
4016wxEVT_CHAR = _core_.wxEVT_CHAR
4017wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
4018wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
4019wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
4020wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
4021wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
4022wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
4023wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
4024wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
4025wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
4026wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
4027wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
4028wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
4029wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
4030wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
4031wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
4032wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
54f9ee45
RD
4033wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
4034wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
4035wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
4036wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
4037wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
4038wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
4039wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
4040wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
4041wxEVT_SIZE = _core_.wxEVT_SIZE
4042wxEVT_MOVE = _core_.wxEVT_MOVE
4043wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
4044wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
4045wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
4046wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
54f9ee45
RD
4047wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
4048wxEVT_CREATE = _core_.wxEVT_CREATE
4049wxEVT_DESTROY = _core_.wxEVT_DESTROY
4050wxEVT_SHOW = _core_.wxEVT_SHOW
4051wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
4052wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
4053wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
34e0a3bb 4054wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
54f9ee45
RD
4055wxEVT_PAINT = _core_.wxEVT_PAINT
4056wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
4057wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
4058wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
4059wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
4060wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
4061wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
4062wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
4063wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
4064wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
4065wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
4066wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
4067wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
4068wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
4069wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
4070wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
4071wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
4072wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
4073wxEVT_IDLE = _core_.wxEVT_IDLE
4074wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
4075wxEVT_SIZING = _core_.wxEVT_SIZING
4076wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 4077wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
4078wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
4079wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
4080wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
54f9ee45
RD
4081wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
4082wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
4083wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
4084wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
4085wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
4086wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
4087wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
4088#
4089# Create some event binders
4090EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
4091EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
4092EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
4093EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
4094EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
4095EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4096EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4097EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
4098EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
4099EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
4100EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
4101EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
4102EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 4103EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d14a1e28
RD
4104EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
4105EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
4106EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
4107EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
4108EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
4109EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
4110EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
4111EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
4112EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
4113EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 4114EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d14a1e28
RD
4115EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4116EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4117EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
4118EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
4119EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
4120EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
4121EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
4122EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
4123EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
4124EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
4125EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
4126EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
4127EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
4128EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
4129EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
4130EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
34e0a3bb 4131EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d14a1e28
RD
4132
4133EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
4134EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
4135EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
4136EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
4137EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
4138EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
4139EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
4140EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
4141EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
4142EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
4143EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
4144EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
4145EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
4146
4147EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
4148 wxEVT_LEFT_UP,
4149 wxEVT_MIDDLE_DOWN,
4150 wxEVT_MIDDLE_UP,
4151 wxEVT_RIGHT_DOWN,
4152 wxEVT_RIGHT_UP,
4153 wxEVT_MOTION,
4154 wxEVT_LEFT_DCLICK,
4155 wxEVT_MIDDLE_DCLICK,
4156 wxEVT_RIGHT_DCLICK,
4157 wxEVT_ENTER_WINDOW,
4158 wxEVT_LEAVE_WINDOW,
4159 wxEVT_MOUSEWHEEL
4160 ])
4161
4162
4163# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 4164EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d14a1e28
RD
4165 wxEVT_SCROLLWIN_BOTTOM,
4166 wxEVT_SCROLLWIN_LINEUP,
4167 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 4168 wxEVT_SCROLLWIN_PAGEUP,
d14a1e28
RD
4169 wxEVT_SCROLLWIN_PAGEDOWN,
4170 wxEVT_SCROLLWIN_THUMBTRACK,
4171 wxEVT_SCROLLWIN_THUMBRELEASE,
4172 ])
4173
4174EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
4175EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
4176EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
4177EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
4178EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
4179EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
4180EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
4181EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
4182
27fb7603 4183# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
4184EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4185 wxEVT_SCROLL_BOTTOM,
4186 wxEVT_SCROLL_LINEUP,
4187 wxEVT_SCROLL_LINEDOWN,
4188 wxEVT_SCROLL_PAGEUP,
4189 wxEVT_SCROLL_PAGEDOWN,
4190 wxEVT_SCROLL_THUMBTRACK,
4191 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 4192 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
4193 ])
4194
4195EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
4196EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
4197EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
4198EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
4199EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
4200EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
4201EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
4202EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
4203EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
4204EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 4205
27fb7603 4206# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
4207EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4208 wxEVT_SCROLL_BOTTOM,
4209 wxEVT_SCROLL_LINEUP,
4210 wxEVT_SCROLL_LINEDOWN,
4211 wxEVT_SCROLL_PAGEUP,
4212 wxEVT_SCROLL_PAGEDOWN,
4213 wxEVT_SCROLL_THUMBTRACK,
d14a1e28 4214 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 4215 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
4216 ], 1)
4217
4218EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
4219EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
4220EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
4221EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
4222EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
4223EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
4224EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
4225EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
4226EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
4227EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d14a1e28 4228
d14a1e28
RD
4229EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
4230EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
4231EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
4232EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
4233EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
4234EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
4235EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
4236EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
4237EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
4238EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
4239
4240EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
4241EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
4242EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
4243EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
4244EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
4245EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
4246EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
4247EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
4248EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
4249
4250
4251EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
4252EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
4253EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
4254EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
4255EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
4256EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
4257EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
4258
4259EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4260
4261EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4262EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4263
4264EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4265
2131d850
RD
4266EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
4267EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
4268EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d14a1e28
RD
4269
4270
4271#---------------------------------------------------------------------------
4272
4273class Event(Object):
27fb7603
RD
4274 """
4275 An event is a structure holding information about an event passed to a
4276 callback or member function. wx.Event is an abstract base class for
4277 other event classes
4278 """
0085ce49
RD
4279 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4280 def __init__(self): raise AttributeError, "No constructor defined"
4281 __repr__ = _swig_repr
4282 __swig_destroy__ = _core_.delete_Event
4283 __del__ = lambda self : None;
e811c8ce 4284 def SetEventType(*args, **kwargs):
27fb7603 4285 """
2131d850 4286 SetEventType(self, EventType typ)
27fb7603
RD
4287
4288 Sets the specific type of the event.
4289 """
54f9ee45 4290 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
4291
4292 def GetEventType(*args, **kwargs):
27fb7603 4293 """
2131d850 4294 GetEventType(self) -> EventType
27fb7603
RD
4295
4296 Returns the identifier of the given event type, such as
4297 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4298 """
54f9ee45 4299 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
4300
4301 def GetEventObject(*args, **kwargs):
27fb7603
RD
4302 """
4303 GetEventObject(self) -> Object
4304
4305 Returns the object (usually a window) associated with the event, if
4306 any.
4307 """
54f9ee45 4308 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
4309
4310 def SetEventObject(*args, **kwargs):
27fb7603
RD
4311 """
4312 SetEventObject(self, Object obj)
4313
4314 Sets the originating object, or in other words, obj is normally the
4315 object that is sending the event.
4316 """
54f9ee45 4317 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
4318
4319 def GetTimestamp(*args, **kwargs):
a95a7133 4320 """GetTimestamp(self) -> long"""
54f9ee45 4321 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
4322
4323 def SetTimestamp(*args, **kwargs):
a95a7133 4324 """SetTimestamp(self, long ts=0)"""
54f9ee45 4325 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
4326
4327 def GetId(*args, **kwargs):
27fb7603
RD
4328 """
4329 GetId(self) -> int
4330
4331 Returns the identifier associated with this event, such as a button
4332 command id.
4333 """
54f9ee45 4334 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
4335
4336 def SetId(*args, **kwargs):
27fb7603
RD
4337 """
4338 SetId(self, int Id)
4339
4340 Set's the ID for the event. This is usually the ID of the window that
4341 is sending the event, but it can also be a command id from a menu
4342 item, etc.
4343 """
54f9ee45 4344 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
4345
4346 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4347 """
4348 IsCommandEvent(self) -> bool
4349
4350 Returns true if the event is or is derived from `wx.CommandEvent` else
4351 it returns false. Note: Exists only for optimization purposes.
4352 """
54f9ee45 4353 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
4354
4355 def Skip(*args, **kwargs):
51b83b37
RD
4356 """
4357 Skip(self, bool skip=True)
4358
6b449b19
RD
4359 This method can be used inside an event handler to control whether
4360 further event handlers bound to this event will be called after the
4361 current one returns. Without Skip() (or equivalently if Skip(False) is
4362 used), the event will not be processed any more. If Skip(True) is
4363 called, the event processing system continues searching for a further
4364 handler function for this event, even though it has been processed
4365 already in the current handler.
51b83b37 4366 """
54f9ee45 4367 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
4368
4369 def GetSkipped(*args, **kwargs):
27fb7603
RD
4370 """
4371 GetSkipped(self) -> bool
4372
4373 Returns true if the event handler should be skipped, false otherwise.
4374 :see: `Skip`
4375 """
54f9ee45 4376 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
4377
4378 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4379 """
4380 ShouldPropagate(self) -> bool
4381
4382 Test if this event should be propagated to the parent window or not,
4383 i.e. if the propagation level is currently greater than 0.
4384 """
54f9ee45 4385 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
4386
4387 def StopPropagation(*args, **kwargs):
27fb7603
RD
4388 """
4389 StopPropagation(self) -> int
4390
4391 Stop the event from propagating to its parent window. Returns the old
4392 propagation level value which may be later passed to
4393 `ResumePropagation` to allow propagating the event again.
4394 """
54f9ee45 4395 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
4396
4397 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4398 """
4399 ResumePropagation(self, int propagationLevel)
4400
4401 Resume the event propagation by restoring the propagation level. (For
4402 example, you can use the value returned by an earlier call to
4403 `StopPropagation`.)
4404
4405 """
54f9ee45 4406 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
4407
4408 def Clone(*args, **kwargs):
a95a7133 4409 """Clone(self) -> Event"""
54f9ee45 4410 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 4411
97ab0f6a
RD
4412 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4413 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4414 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4415 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4416 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
2131d850 4417_core_.Event_swigregister(Event)
d14a1e28
RD
4418
4419#---------------------------------------------------------------------------
4420
4421class PropagationDisabler(object):
27fb7603
RD
4422 """
4423 Helper class to temporarily change an event not to propagate. Simply
4424 create an instance of this class and then whe it is destroyed the
4425 propogation of the event will be restored.
4426 """
0085ce49
RD
4427 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4428 __repr__ = _swig_repr
4429 def __init__(self, *args, **kwargs):
27fb7603
RD
4430 """
4431 __init__(self, Event event) -> PropagationDisabler
4432
4433 Helper class to temporarily change an event not to propagate. Simply
4434 create an instance of this class and then whe it is destroyed the
4435 propogation of the event will be restored.
4436 """
0085ce49
RD
4437 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4438 __swig_destroy__ = _core_.delete_PropagationDisabler
4439 __del__ = lambda self : None;
2131d850 4440_core_.PropagationDisabler_swigregister(PropagationDisabler)
d14a1e28
RD
4441
4442class PropagateOnce(object):
27fb7603
RD
4443 """
4444 A helper class that will temporarily lower propagation level of an
4445 event. Simply create an instance of this class and then whe it is
4446 destroyed the propogation of the event will be restored.
4447 """
0085ce49
RD
4448 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4449 __repr__ = _swig_repr
4450 def __init__(self, *args, **kwargs):
27fb7603
RD
4451 """
4452 __init__(self, Event event) -> PropagateOnce
4453
4454 A helper class that will temporarily lower propagation level of an
4455 event. Simply create an instance of this class and then whe it is
4456 destroyed the propogation of the event will be restored.
4457 """
0085ce49
RD
4458 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4459 __swig_destroy__ = _core_.delete_PropagateOnce
4460 __del__ = lambda self : None;
2131d850 4461_core_.PropagateOnce_swigregister(PropagateOnce)
d14a1e28
RD
4462
4463#---------------------------------------------------------------------------
4464
4465class CommandEvent(Event):
27fb7603
RD
4466 """
4467 This event class contains information about command events, which
4468 originate from a variety of simple controls, as well as menus and
4469 toolbars.
4470 """
0085ce49
RD
4471 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4472 __repr__ = _swig_repr
4473 def __init__(self, *args, **kwargs):
27fb7603 4474 """
2131d850 4475 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
4476
4477 This event class contains information about command events, which
4478 originate from a variety of simple controls, as well as menus and
4479 toolbars.
4480 """
0085ce49 4481 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
e811c8ce 4482 def GetSelection(*args, **kwargs):
27fb7603
RD
4483 """
4484 GetSelection(self) -> int
4485
4486 Returns item index for a listbox or choice selection event (not valid
4487 for a deselection).
4488 """
54f9ee45 4489 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
4490
4491 def SetString(*args, **kwargs):
a95a7133 4492 """SetString(self, String s)"""
54f9ee45 4493 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
4494
4495 def GetString(*args, **kwargs):
27fb7603
RD
4496 """
4497 GetString(self) -> String
4498
4499 Returns item string for a listbox or choice selection event (not valid
4500 for a deselection).
4501 """
54f9ee45 4502 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
4503
4504 def IsChecked(*args, **kwargs):
27fb7603
RD
4505 """
4506 IsChecked(self) -> bool
4507
4508 This method can be used with checkbox and menu events: for the
4509 checkboxes, the method returns true for a selection event and false
4510 for a deselection one. For the menu events, this method indicates if
4511 the menu item just has become checked or unchecked (and thus only
4512 makes sense for checkable menu items).
4513 """
54f9ee45 4514 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 4515
242b7b46 4516 Checked = IsChecked
e811c8ce 4517 def IsSelection(*args, **kwargs):
27fb7603
RD
4518 """
4519 IsSelection(self) -> bool
4520
4521 For a listbox or similar event, returns true if it is a selection,
4522 false if it is a deselection.
4523 """
54f9ee45 4524 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
4525
4526 def SetExtraLong(*args, **kwargs):
a95a7133 4527 """SetExtraLong(self, long extraLong)"""
54f9ee45 4528 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
4529
4530 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4531 """
4532 GetExtraLong(self) -> long
4533
5ba5649b
RD
4534 Returns extra information dependant on the event objects type. If the
4535 event comes from a listbox selection, it is a boolean determining
4536 whether the event was a selection (true) or a deselection (false). A
4537 listbox deselection only occurs for multiple-selection boxes, and in
4538 this case the index and string values are indeterminate and the
4539 listbox must be examined by the application.
27fb7603 4540 """
54f9ee45 4541 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
4542
4543 def SetInt(*args, **kwargs):
a95a7133 4544 """SetInt(self, int i)"""
54f9ee45 4545 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
4546
4547 def GetInt(*args, **kwargs):
27fb7603 4548 """
01f6b6d3 4549 GetInt(self) -> int
27fb7603 4550
5ba5649b
RD
4551 Returns the integer identifier corresponding to a listbox, choice or
4552 radiobox selection (only if the event was a selection, not a
4553 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4554 """
54f9ee45 4555 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce 4556
0085ce49
RD
4557 def GetClientData(*args, **kwargs):
4558 """
4559 GetClientData(self) -> PyObject
4560
4561 Returns the client data object for a listbox or choice selection event, (if any.)
4562 """
4563 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4564
4565 def SetClientData(*args, **kwargs):
4566 """
4567 SetClientData(self, PyObject clientData)
4568
4569 Associate the given client data with the item at position n.
4570 """
4571 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4572
4573 GetClientObject = GetClientData
4574 SetClientObject = SetClientData
4575
e811c8ce 4576 def Clone(*args, **kwargs):
a95a7133 4577 """Clone(self) -> Event"""
54f9ee45 4578 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 4579
2bf58437
RD
4580 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4581 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4582 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4583 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4584 Selection = property(GetSelection,doc="See `GetSelection`")
4585 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
2131d850 4586_core_.CommandEvent_swigregister(CommandEvent)
d14a1e28
RD
4587
4588#---------------------------------------------------------------------------
4589
4590class NotifyEvent(CommandEvent):
27fb7603
RD
4591 """
4592 An instance of this class (or one of its derived classes) is sent from
4593 a control when the control's state is being changed and the control
4594 allows that change to be prevented from happening. The event handler
4595 can call `Veto` or `Allow` to tell the control what to do.
4596 """
0085ce49
RD
4597 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4598 __repr__ = _swig_repr
4599 def __init__(self, *args, **kwargs):
27fb7603 4600 """
2131d850 4601 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4602
4603 An instance of this class (or one of its derived classes) is sent from
4604 a control when the control's state is being changed and the control
4605 allows that change to be prevented from happening. The event handler
4606 can call `Veto` or `Allow` to tell the control what to do.
4607 """
0085ce49 4608 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
e811c8ce 4609 def Veto(*args, **kwargs):
27fb7603
RD
4610 """
4611 Veto(self)
4612
4613 Prevents the change announced by this event from happening.
4614
4615 It is in general a good idea to notify the user about the reasons for
4616 vetoing the change because otherwise the applications behaviour (which
4617 just refuses to do what the user wants) might be quite surprising.
4618 """
54f9ee45 4619 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
4620
4621 def Allow(*args, **kwargs):
27fb7603
RD
4622 """
4623 Allow(self)
4624
4625 This is the opposite of `Veto`: it explicitly allows the event to be
4626 processed. For most events it is not necessary to call this method as
4627 the events are allowed anyhow but some are forbidden by default (this
4628 will be mentioned in the corresponding event description).
4629 """
54f9ee45 4630 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
4631
4632 def IsAllowed(*args, **kwargs):
27fb7603
RD
4633 """
4634 IsAllowed(self) -> bool
4635
4636 Returns true if the change is allowed (`Veto` hasn't been called) or
4637 false otherwise (if it was).
4638 """
54f9ee45 4639 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 4640
2131d850 4641_core_.NotifyEvent_swigregister(NotifyEvent)
d14a1e28
RD
4642
4643#---------------------------------------------------------------------------
4644
4645class ScrollEvent(CommandEvent):
27fb7603
RD
4646 """
4647 A scroll event holds information about events sent from stand-alone
4648 scrollbars and sliders. Note that scrolled windows do not send
cbfc9df6 4649 instances of this event class, but send the `wx.ScrollWinEvent`
27fb7603
RD
4650 instead.
4651 """
0085ce49
RD
4652 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4653 __repr__ = _swig_repr
4654 def __init__(self, *args, **kwargs):
0df68c9f 4655 """
2131d850 4656 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
4657 int orient=0) -> ScrollEvent
4658 """
0085ce49 4659 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
e811c8ce 4660 def GetOrientation(*args, **kwargs):
27fb7603
RD
4661 """
4662 GetOrientation(self) -> int
4663
4664 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4665 the scrollbar.
4666 """
54f9ee45 4667 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4668
4669 def GetPosition(*args, **kwargs):
27fb7603
RD
4670 """
4671 GetPosition(self) -> int
4672
4673 Returns the position of the scrollbar.
4674 """
54f9ee45 4675 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4676
4677 def SetOrientation(*args, **kwargs):
a95a7133 4678 """SetOrientation(self, int orient)"""
54f9ee45 4679 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4680
4681 def SetPosition(*args, **kwargs):
a95a7133 4682 """SetPosition(self, int pos)"""
54f9ee45 4683 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 4684
33d6fd3b
RD
4685 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4686 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4687_core_.ScrollEvent_swigregister(ScrollEvent)
d14a1e28
RD
4688
4689#---------------------------------------------------------------------------
4690
4691class ScrollWinEvent(Event):
27fb7603
RD
4692 """
4693 A wx.ScrollWinEvent holds information about scrolling and is sent from
4694 scrolling windows.
4695 """
0085ce49
RD
4696 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4697 __repr__ = _swig_repr
4698 def __init__(self, *args, **kwargs):
27fb7603 4699 """
2131d850 4700 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4701
4702 A wx.ScrollWinEvent holds information about scrolling and is sent from
4703 scrolling windows.
4704 """
0085ce49 4705 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
e811c8ce 4706 def GetOrientation(*args, **kwargs):
27fb7603
RD
4707 """
4708 GetOrientation(self) -> int
4709
4710 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4711 the scrollbar.
4712 """
54f9ee45 4713 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4714
4715 def GetPosition(*args, **kwargs):
27fb7603
RD
4716 """
4717 GetPosition(self) -> int
4718
4719 Returns the position of the scrollbar for the thumb track and release
4720 events. Note that this field can't be used for the other events, you
4721 need to query the window itself for the current position in that case.
4722 """
54f9ee45 4723 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4724
4725 def SetOrientation(*args, **kwargs):
a95a7133 4726 """SetOrientation(self, int orient)"""
54f9ee45 4727 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4728
4729 def SetPosition(*args, **kwargs):
a95a7133 4730 """SetPosition(self, int pos)"""
54f9ee45 4731 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 4732
33d6fd3b
RD
4733 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4734 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4735_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d14a1e28
RD
4736
4737#---------------------------------------------------------------------------
4738
54f9ee45
RD
4739MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4740MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4741MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4742MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4743MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 4744class MouseEvent(Event):
27fb7603
RD
4745 """
4746 This event class contains information about the events generated by
4747 the mouse: they include mouse buttons press and release events and
4748 mouse move events.
4749
4750 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4751 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4752 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4753 a middle button so a portable application should avoid relying on the
4754 events from it.
4755
4756 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4757 the former returns true when the event corresponds to the left mouse
4758 button click while the latter returns true if the left mouse button is
4759 currently being pressed. For example, when the user is dragging the
4760 mouse you can use `LeftIsDown` to test whether the left mouse button
4761 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4762 `LeftIsDown` will also return true in wxWidgets whatever the
4763 underlying GUI behaviour is (which is platform-dependent). The same
4764 applies, of course, to other mouse buttons as well.
4765 """
0085ce49
RD
4766 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4767 __repr__ = _swig_repr
4768 def __init__(self, *args, **kwargs):
27fb7603 4769 """
2131d850 4770 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4771
4772 Constructs a wx.MouseEvent. Valid event types are:
4773
4774 * wxEVT_ENTER_WINDOW
4775 * wxEVT_LEAVE_WINDOW
4776 * wxEVT_LEFT_DOWN
4777 * wxEVT_LEFT_UP
4778 * wxEVT_LEFT_DCLICK
4779 * wxEVT_MIDDLE_DOWN
4780 * wxEVT_MIDDLE_UP
4781 * wxEVT_MIDDLE_DCLICK
4782 * wxEVT_RIGHT_DOWN
4783 * wxEVT_RIGHT_UP
4784 * wxEVT_RIGHT_DCLICK
4785 * wxEVT_MOTION
4786 * wxEVT_MOUSEWHEEL
4787 """
0085ce49 4788 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
e811c8ce 4789 def IsButton(*args, **kwargs):
27fb7603
RD
4790 """
4791 IsButton(self) -> bool
4792
4793 Returns true if the event was a mouse button event (not necessarily a
4794 button down event - that may be tested using `ButtonDown`).
4795 """
54f9ee45 4796 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
4797
4798 def ButtonDown(*args, **kwargs):
27fb7603
RD
4799 """
4800 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4801
5ba5649b
RD
4802 If the argument is omitted, this returns true if the event was any
4803 mouse button down event. Otherwise the argument specifies which
4804 button-down event shold be checked for (see `Button` for the possible
4805 values).
27fb7603 4806 """
54f9ee45 4807 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
4808
4809 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4810 """
4811 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4812
4813 If the argument is omitted, this returns true if the event was any
4814 mouse double click event. Otherwise the argument specifies which
4815 double click event to check for (see `Button` for the possible
4816 values).
4817 """
54f9ee45 4818 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
4819
4820 def ButtonUp(*args, **kwargs):
27fb7603
RD
4821 """
4822 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4823
4824 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4825 mouse button up event. Otherwise the argument specifies which button
4826 up event to check for (see `Button` for the possible values).
27fb7603 4827 """
54f9ee45 4828 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
4829
4830 def Button(*args, **kwargs):
27fb7603
RD
4831 """
4832 Button(self, int button) -> bool
4833
4834 Returns true if the identified mouse button is changing state. Valid
4835 values of button are:
4836
4837 ==================== =====================================
4838 wx.MOUSE_BTN_LEFT check if left button was pressed
4839 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4840 wx.MOUSE_BTN_RIGHT check if right button was pressed
4841 wx.MOUSE_BTN_ANY check if any button was pressed
4842 ==================== =====================================
4843
4844 """
54f9ee45 4845 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
4846
4847 def ButtonIsDown(*args, **kwargs):
a95a7133 4848 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 4849 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
4850
4851 def GetButton(*args, **kwargs):
27fb7603
RD
4852 """
4853 GetButton(self) -> int
4854
4855 Returns the mouse button which generated this event or
4856 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4857 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4858 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4859 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4860 right buttons respectively.
4861 """
54f9ee45 4862 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
4863
4864 def ControlDown(*args, **kwargs):
27fb7603
RD
4865 """
4866 ControlDown(self) -> bool
4867
4868 Returns true if the control key was down at the time of the event.
4869 """
54f9ee45 4870 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4871
4872 def MetaDown(*args, **kwargs):
27fb7603
RD
4873 """
4874 MetaDown(self) -> bool
4875
4876 Returns true if the Meta key was down at the time of the event.
4877 """
54f9ee45 4878 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4879
4880 def AltDown(*args, **kwargs):
27fb7603
RD
4881 """
4882 AltDown(self) -> bool
4883
4884 Returns true if the Alt key was down at the time of the event.
4885 """
54f9ee45 4886 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4887
4888 def ShiftDown(*args, **kwargs):
27fb7603
RD
4889 """
4890 ShiftDown(self) -> bool
4891
4892 Returns true if the Shift key was down at the time of the event.
4893 """
54f9ee45 4894 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 4895
412d302d
RD
4896 def CmdDown(*args, **kwargs):
4897 """
4898 CmdDown(self) -> bool
4899
4900 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4901 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4902 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4903 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4904 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4905 purpose. So for non-Mac platforms this is the same as `ControlDown`
4906 and Macs this is the same as `MetaDown`.
4907 """
4908 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4909
e811c8ce 4910 def LeftDown(*args, **kwargs):
27fb7603
RD
4911 """
4912 LeftDown(self) -> bool
4913
4914 Returns true if the left mouse button state changed to down.
4915 """
54f9ee45 4916 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
4917
4918 def MiddleDown(*args, **kwargs):
27fb7603
RD
4919 """
4920 MiddleDown(self) -> bool
4921
4922 Returns true if the middle mouse button state changed to down.
4923 """
54f9ee45 4924 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
4925
4926 def RightDown(*args, **kwargs):
27fb7603
RD
4927 """
4928 RightDown(self) -> bool
4929
4930 Returns true if the right mouse button state changed to down.
4931 """
54f9ee45 4932 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
4933
4934 def LeftUp(*args, **kwargs):
27fb7603
RD
4935 """
4936 LeftUp(self) -> bool
4937
4938 Returns true if the left mouse button state changed to up.
4939 """
54f9ee45 4940 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
4941
4942 def MiddleUp(*args, **kwargs):
27fb7603
RD
4943 """
4944 MiddleUp(self) -> bool
4945
4946 Returns true if the middle mouse button state changed to up.
4947 """
54f9ee45 4948 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
4949
4950 def RightUp(*args, **kwargs):
27fb7603
RD
4951 """
4952 RightUp(self) -> bool
4953
4954 Returns true if the right mouse button state changed to up.
4955 """
54f9ee45 4956 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
4957
4958 def LeftDClick(*args, **kwargs):
27fb7603
RD
4959 """
4960 LeftDClick(self) -> bool
4961
4962 Returns true if the event was a left button double click.
4963 """
54f9ee45 4964 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
4965
4966 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4967 """
4968 MiddleDClick(self) -> bool
4969
4970 Returns true if the event was a middle button double click.
4971 """
54f9ee45 4972 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
4973
4974 def RightDClick(*args, **kwargs):
27fb7603
RD
4975 """
4976 RightDClick(self) -> bool
4977
4978 Returns true if the event was a right button double click.
4979 """
54f9ee45 4980 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
4981
4982 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4983 """
4984 LeftIsDown(self) -> bool
4985
4986 Returns true if the left mouse button is currently down, independent
4987 of the current event type.
4988
4989 Please notice that it is not the same as LeftDown which returns true
4990 if the left mouse button was just pressed. Rather, it describes the
4991 state of the mouse button before the event happened.
4992
4993 This event is usually used in the mouse event handlers which process
4994 "move mouse" messages to determine whether the user is (still)
4995 dragging the mouse.
4996 """
54f9ee45 4997 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
4998
4999 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
5000 """
5001 MiddleIsDown(self) -> bool
5002
5003 Returns true if the middle mouse button is currently down, independent
5004 of the current event type.
5005 """
54f9ee45 5006 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
5007
5008 def RightIsDown(*args, **kwargs):
27fb7603
RD
5009 """
5010 RightIsDown(self) -> bool
5011
5012 Returns true if the right mouse button is currently down, independent
5013 of the current event type.
5014 """
54f9ee45 5015 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
5016
5017 def Dragging(*args, **kwargs):
27fb7603
RD
5018 """
5019 Dragging(self) -> bool
5020
5021 Returns true if this was a dragging event (motion while a button is
5022 depressed).
5023 """
54f9ee45 5024 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
5025
5026 def Moving(*args, **kwargs):
27fb7603
RD
5027 """
5028 Moving(self) -> bool
5029
5030 Returns true if this was a motion event and no mouse buttons were
5031 pressed. If any mouse button is held pressed, then this method returns
5032 false and Dragging returns true.
5033 """
54f9ee45 5034 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
5035
5036 def Entering(*args, **kwargs):
27fb7603
RD
5037 """
5038 Entering(self) -> bool
5039
5040 Returns true if the mouse was entering the window.
5041 """
54f9ee45 5042 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
5043
5044 def Leaving(*args, **kwargs):
27fb7603
RD
5045 """
5046 Leaving(self) -> bool
5047
5048 Returns true if the mouse was leaving the window.
5049 """
54f9ee45 5050 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
5051
5052 def GetPosition(*args, **kwargs):
0df68c9f 5053 """
a95a7133 5054 GetPosition(self) -> Point
e811c8ce 5055
27fb7603
RD
5056 Returns the pixel position of the mouse in window coordinates when the
5057 event happened.
0df68c9f 5058 """
54f9ee45 5059 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5060
5061 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
5062 """
5063 GetPositionTuple() -> (x,y)
e811c8ce 5064
27fb7603
RD
5065 Returns the pixel position of the mouse in window coordinates when the
5066 event happened.
0df68c9f 5067 """
54f9ee45 5068 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
5069
5070 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
5071 """
5072 GetLogicalPosition(self, DC dc) -> Point
5073
5074 Returns the logical mouse position in pixels (i.e. translated
5075 according to the translation set for the DC, which usually indicates
5076 that the window has been scrolled).
5077 """
54f9ee45 5078 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
5079
5080 def GetX(*args, **kwargs):
27fb7603
RD
5081 """
5082 GetX(self) -> int
5083
5084 Returns X coordinate of the physical mouse event position.
5085 """
54f9ee45 5086 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
5087
5088 def GetY(*args, **kwargs):
27fb7603
RD
5089 """
5090 GetY(self) -> int
5091
5092 Returns Y coordinate of the physical mouse event position.
5093 """
54f9ee45 5094 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
5095
5096 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
5097 """
5098 GetWheelRotation(self) -> int
5099
5100 Get wheel rotation, positive or negative indicates direction of
5101 rotation. Current devices all send an event when rotation is equal to
5102 +/-WheelDelta, but this allows for finer resolution devices to be
5103 created in the future. Because of this you shouldn't assume that one
5104 event is equal to 1 line or whatever, but you should be able to either
5105 do partial line scrolling or wait until +/-WheelDelta rotation values
5106 have been accumulated before scrolling.
5107 """
54f9ee45 5108 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
5109
5110 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
5111 """
5112 GetWheelDelta(self) -> int
5113
5114 Get wheel delta, normally 120. This is the threshold for action to be
5115 taken, and one such action (for example, scrolling one increment)
5116 should occur for each delta.
5117 """
54f9ee45 5118 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce 5119
4976f996
RD
5120 def GetWheelAxis(*args, **kwargs):
5121 """
5122 GetWheelAxis(self) -> int
5123
5124 Gets the axis the wheel operation concerns, 0 being the y axis as on
5125 most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
5126 or horizontal trackpad scrolling.
5127 """
5128 return _core_.MouseEvent_GetWheelAxis(*args, **kwargs)
5129
e811c8ce 5130 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
5131 """
5132 GetLinesPerAction(self) -> int
5133
5134 Returns the configured number of lines (or whatever) to be scrolled
5135 per wheel action. Defaults to three.
5136 """
54f9ee45 5137 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
5138
5139 def IsPageScroll(*args, **kwargs):
27fb7603
RD
5140 """
5141 IsPageScroll(self) -> bool
5142
5143 Returns true if the system has been setup to do page scrolling with
5144 the mouse wheel instead of line scrolling.
5145 """
54f9ee45
RD
5146 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
5147
5148 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
5149 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
5150 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
5151 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
5152 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
5153 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
5154 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
5155 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
5156 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
5157 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
5158 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
5159 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
57332a5a
RD
5160 Button = property(GetButton,doc="See `GetButton`")
5161 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
5162 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
5163 Position = property(GetPosition,doc="See `GetPosition`")
5164 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
5165 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
5166 X = property(GetX,doc="See `GetX`")
5167 Y = property(GetY,doc="See `GetY`")
2131d850 5168_core_.MouseEvent_swigregister(MouseEvent)
d14a1e28
RD
5169
5170#---------------------------------------------------------------------------
5171
5172class SetCursorEvent(Event):
5ba5649b
RD
5173 """
5174 A SetCursorEvent is generated when the mouse cursor is about to be set
5175 as a result of mouse motion. This event gives the application the
5176 chance to perform specific mouse cursor processing based on the
5177 current position of the mouse within the window. Use the `SetCursor`
5178 method to specify the cursor you want to be displayed.
5179 """
0085ce49
RD
5180 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5181 __repr__ = _swig_repr
5182 def __init__(self, *args, **kwargs):
5ba5649b
RD
5183 """
5184 __init__(self, int x=0, int y=0) -> SetCursorEvent
5185
5186 Construct a new `wx.SetCursorEvent`.
5187 """
0085ce49 5188 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
e811c8ce 5189 def GetX(*args, **kwargs):
5ba5649b
RD
5190 """
5191 GetX(self) -> int
5192
5193 Returns the X coordinate of the mouse in client coordinates.
5194 """
54f9ee45 5195 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
5196
5197 def GetY(*args, **kwargs):
5ba5649b
RD
5198 """
5199 GetY(self) -> int
5200
5201 Returns the Y coordinate of the mouse in client coordinates.
5202 """
54f9ee45 5203 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
5204
5205 def SetCursor(*args, **kwargs):
5ba5649b
RD
5206 """
5207 SetCursor(self, Cursor cursor)
5208
5209 Sets the cursor associated with this event.
5210 """
54f9ee45 5211 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
5212
5213 def GetCursor(*args, **kwargs):
5ba5649b
RD
5214 """
5215 GetCursor(self) -> Cursor
5216
5217 Returns a reference to the cursor specified by this event.
5218 """
54f9ee45 5219 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
5220
5221 def HasCursor(*args, **kwargs):
5ba5649b
RD
5222 """
5223 HasCursor(self) -> bool
5224
5225 Returns true if the cursor specified by this event is a valid cursor.
5226 """
54f9ee45 5227 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 5228
33d6fd3b
RD
5229 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
5230 X = property(GetX,doc="See `GetX`")
5231 Y = property(GetY,doc="See `GetY`")
2131d850 5232_core_.SetCursorEvent_swigregister(SetCursorEvent)
d14a1e28
RD
5233
5234#---------------------------------------------------------------------------
5235
5236class KeyEvent(Event):
5ba5649b
RD
5237 """
5238 This event class contains information about keypress and character
5239 events. These events are only sent to the widget that currently has
5240 the keyboard focus.
5241
5242 Notice that there are three different kinds of keyboard events in
5243 wxWidgets: key down and up events and char events. The difference
5244 between the first two is clear - the first corresponds to a key press
5245 and the second to a key release - otherwise they are identical. Just
5246 note that if the key is maintained in a pressed state you will
5247 typically get a lot of (automatically generated) down events but only
5248 one up so it is wrong to assume that there is one up event
5249 corresponding to each down one.
5250
5251 Both key events provide untranslated key codes while the char event
5252 carries the translated one. The untranslated code for alphanumeric
5253 keys is always an upper case value. For the other keys it is one of
5254 WXK_XXX values from the keycodes table. The translated key is, in
5255 general, the character the user expects to appear as the result of the
5256 key combination when typing the text into a text entry zone, for
5257 example.
5258
5259 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5260 and the standard US keyboard): when the 'A' key is pressed, the key
5261 down event key code is equal to ASCII A == 65. But the char event key
5262 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5263 'A' keys simultaneously , the key code in key down event will still be
5264 just 'A' while the char event key code parameter will now be 'A' as
5265 well.
5266
5267 Although in this simple case it is clear that the correct key code
5268 could be found in the key down event handler by checking the value
5269 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5270 as for non alphanumeric keys or non-US keyboard layouts the
5271 translation is keyboard-layout dependent and can only be done properly
5272 by the system itself.
5273
5274 Another kind of translation is done when the control key is pressed:
5275 for example, for CTRL-A key press the key down event still carries the
5276 same key code 'A' as usual but the char event will have key code of 1,
5277 the ASCII value of this key combination.
5278
5279 You may discover how the other keys on your system behave
5280 interactively by running the KeyEvents sample in the wxPython demo and
5281 pressing some keys while the blue box at the top has the keyboard
5282 focus.
5283
5284 **Note**: If a key down event is caught and the event handler does not
5285 call event.Skip() then the coresponding char event will not
5286 happen. This is by design and enables the programs that handle both
5287 types of events to be a bit simpler.
5288
5289 **Note for Windows programmers**: The key and char events in wxWidgets
5290 are similar to but slightly different from Windows WM_KEYDOWN and
5291 WM_CHAR events. In particular, Alt-x combination will generate a char
5292 event in wxWidgets (unless it is used as an accelerator).
5293
5294 **Tip**: be sure to call event.Skip() for events that you don't
5295 process in key event function, otherwise menu shortcuts may cease to
5296 work under Windows.
5297
5298 """
0085ce49
RD
5299 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5300 __repr__ = _swig_repr
5301 def __init__(self, *args, **kwargs):
5ba5649b 5302 """
2131d850 5303 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
5304
5305 Construct a new `wx.KeyEvent`. Valid event types are:
5306 *
5307 """
0085ce49 5308 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
5309 def GetModifiers(*args, **kwargs):
5310 """
5311 GetModifiers(self) -> int
5312
5313 Returns a bitmask of the current modifier settings. Can be used to
5314 check if the key event has exactly the given modifiers without having
5315 to explicitly check that the other modifiers are not down. For
5316 example::
5317
5318 if event.GetModifers() == wx.MOD_CONTROL:
5319 DoSomething()
5320
5321 """
5322 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
5323
e811c8ce 5324 def ControlDown(*args, **kwargs):
5ba5649b
RD
5325 """
5326 ControlDown(self) -> bool
5327
5328 Returns ``True`` if the Control key was down at the time of the event.
5329 """
54f9ee45 5330 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
5331
5332 def MetaDown(*args, **kwargs):
5ba5649b
RD
5333 """
5334 MetaDown(self) -> bool
5335
5336 Returns ``True`` if the Meta key was down at the time of the event.
5337 """
54f9ee45 5338 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
5339
5340 def AltDown(*args, **kwargs):
5ba5649b
RD
5341 """
5342 AltDown(self) -> bool
5343
5344 Returns ``True`` if the Alt key was down at the time of the event.
5345 """
54f9ee45 5346 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
5347
5348 def ShiftDown(*args, **kwargs):
5ba5649b
RD
5349 """
5350 ShiftDown(self) -> bool
5351
5352 Returns ``True`` if the Shift key was down at the time of the event.
5353 """
54f9ee45 5354 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 5355
412d302d
RD
5356 def CmdDown(*args, **kwargs):
5357 """
5358 CmdDown(self) -> bool
5359
5360 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5361 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5362 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5363 because Cmd key is used for the same thing under Mac as Ctrl
5364 elsewhere. The Ctrl still exists, it's just not used for this
5365 purpose. So for non-Mac platforms this is the same as `ControlDown`
5366 and Macs this is the same as `MetaDown`.
5367 """
5368 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5369
e811c8ce 5370 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5371 """
5372 HasModifiers(self) -> bool
5373
5374 Returns true if either CTRL or ALT keys was down at the time of the
5375 key event. Note that this function does not take into account neither
5376 SHIFT nor META key states (the reason for ignoring the latter is that
5377 it is common for NUMLOCK key to be configured as META under X but the
5378 key presses even while NUMLOCK is on should be still processed
5379 normally).
5380 """
54f9ee45 5381 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
5382
5383 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5384 """
5385 GetKeyCode(self) -> int
5386
5387 Returns the virtual key code. ASCII events return normal ASCII values,
5388 while non-ASCII events return values such as WXK_LEFT for the left
5389 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5390 codes.
5391
5392 Note that in Unicode build, the returned value is meaningful only if
5393 the user entered a character that can be represented in current
5394 locale's default charset. You can obtain the corresponding Unicode
5395 character using `GetUnicodeKey`.
5396 """
54f9ee45 5397 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 5398
19272049 5399 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5400 """
5401 GetUnicodeKey(self) -> int
5402
5403 Returns the Unicode character corresponding to this key event. This
5404 function is only meaningfule in a Unicode build of wxPython.
5405 """
19272049 5406 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 5407
19272049 5408 GetUniChar = GetUnicodeKey
b850e7f3
RD
5409 def SetUnicodeKey(*args, **kwargs):
5410 """
5411 SetUnicodeKey(self, int uniChar)
5412
5413 Set the Unicode value of the key event, but only if this is a Unicode
5414 build of wxPython.
5415 """
5416 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5417
e811c8ce 5418 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5419 """
5420 GetRawKeyCode(self) -> unsigned int
5421
5422 Returns the raw key code for this event. This is a platform-dependent
5423 scan code which should only be used in advanced
5424 applications. Currently the raw key codes are not supported by all
5425 ports.
5426 """
54f9ee45 5427 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
5428
5429 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5430 """
5431 GetRawKeyFlags(self) -> unsigned int
5432
5433 Returns the low level key flags for this event. The flags are
5434 platform-dependent and should only be used in advanced applications.
5435 Currently the raw key flags are not supported by all ports.
5436 """
54f9ee45 5437 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
5438
5439 def GetPosition(*args, **kwargs):
0df68c9f 5440 """
a95a7133 5441 GetPosition(self) -> Point
e811c8ce 5442
5ba5649b 5443 Find the position of the event, if applicable.
0df68c9f 5444 """
54f9ee45 5445 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5446
5447 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
5448 """
5449 GetPositionTuple() -> (x,y)
e811c8ce 5450
5ba5649b 5451 Find the position of the event, if applicable.
0df68c9f 5452 """
54f9ee45 5453 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
5454
5455 def GetX(*args, **kwargs):
5ba5649b
RD
5456 """
5457 GetX(self) -> int
5458
5459 Returns the X position (in client coordinates) of the event, if
5460 applicable.
5461 """
54f9ee45 5462 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
5463
5464 def GetY(*args, **kwargs):
5ba5649b
RD
5465 """
5466 GetY(self) -> int
5467
5468 Returns the Y position (in client coordinates) of the event, if
5469 applicable.
5470 """
54f9ee45
RD
5471 return _core_.KeyEvent_GetY(*args, **kwargs)
5472
5473 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5474 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5475 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5476 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5477 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5478 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5479 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5480 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5481 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5482 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
97ab0f6a
RD
5483 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5484 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5485 Position = property(GetPosition,doc="See `GetPosition`")
5486 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5487 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5488 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5489 X = property(GetX,doc="See `GetX`")
5490 Y = property(GetY,doc="See `GetY`")
2131d850 5491_core_.KeyEvent_swigregister(KeyEvent)
d14a1e28
RD
5492
5493#---------------------------------------------------------------------------
5494
5495class SizeEvent(Event):
5ba5649b
RD
5496 """
5497 A size event holds information about size change events. The EVT_SIZE
5498 handler function will be called when the window it is bound to has
5499 been resized.
5500
5501 Note that the size passed is of the whole window: call
5502 `wx.Window.GetClientSize` for the area which may be used by the
5503 application.
5504
5505 When a window is resized, usually only a small part of the window is
5506 damaged and and that area is all that is in the update region for the
5507 next paint event. However, if your drawing depends on the size of the
5508 window, you may need to clear the DC explicitly and repaint the whole
5509 window. In which case, you may need to call `wx.Window.Refresh` to
5510 invalidate the entire window.
5511
5512 """
0085ce49
RD
5513 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5514 __repr__ = _swig_repr
5515 def __init__(self, *args, **kwargs):
5ba5649b
RD
5516 """
5517 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5518
5519 Construct a new ``wx.SizeEvent``.
5520 """
0085ce49 5521 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
e811c8ce 5522 def GetSize(*args, **kwargs):
5ba5649b
RD
5523 """
5524 GetSize(self) -> Size
5525
5526 Returns the entire size of the window generating the size change
5527 event.
5528 """
54f9ee45 5529 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
5530
5531 def GetRect(*args, **kwargs):
a95a7133 5532 """GetRect(self) -> Rect"""
54f9ee45 5533 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5534
5535 def SetRect(*args, **kwargs):
a95a7133 5536 """SetRect(self, Rect rect)"""
54f9ee45 5537 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5538
5539 def SetSize(*args, **kwargs):
a95a7133 5540 """SetSize(self, Size size)"""
54f9ee45 5541 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 5542
54f9ee45
RD
5543 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5544 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
33d6fd3b
RD
5545 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5546 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
2131d850 5547_core_.SizeEvent_swigregister(SizeEvent)
d14a1e28
RD
5548
5549#---------------------------------------------------------------------------
5550
5551class MoveEvent(Event):
5ba5649b
RD
5552 """
5553 This event object is sent for EVT_MOVE event bindings when a window is
5554 moved to a new position.
5555 """
0085ce49
RD
5556 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5557 __repr__ = _swig_repr
5558 def __init__(self, *args, **kwargs):
5ba5649b
RD
5559 """
5560 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5561
5562 Constructor.
5563 """
0085ce49 5564 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
e811c8ce 5565 def GetPosition(*args, **kwargs):
5ba5649b
RD
5566 """
5567 GetPosition(self) -> Point
5568
5569 Returns the position of the window generating the move change event.
5570 """
54f9ee45 5571 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5572
5573 def GetRect(*args, **kwargs):
a95a7133 5574 """GetRect(self) -> Rect"""
54f9ee45 5575 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5576
5577 def SetRect(*args, **kwargs):
a95a7133 5578 """SetRect(self, Rect rect)"""
54f9ee45 5579 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5580
5581 def SetPosition(*args, **kwargs):
a95a7133 5582 """SetPosition(self, Point pos)"""
54f9ee45 5583 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 5584
7557b9b5
RD
5585 m_pos = property(GetPosition, SetPosition)
5586 m_rect = property(GetRect, SetRect)
5587
57332a5a
RD
5588 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5589 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
2131d850 5590_core_.MoveEvent_swigregister(MoveEvent)
d14a1e28
RD
5591
5592#---------------------------------------------------------------------------
5593
5594class PaintEvent(Event):
5ba5649b
RD
5595 """
5596 A paint event is sent when a window's contents needs to be repainted.
5597 Note that in an EVT_PAINT handler the application must *always* create
5598 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5599 Windows assumes that the window has not been painted yet and will send
5600 the event again, causing endless refreshes.
5601
5602 You can optimize painting by retrieving the rectangles that have been
5603 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5604 and only repainting these rectangles. The rectangles are in terms of
5605 the client area, and are unscrolled, so you will need to do some
5606 calculations using the current view position to obtain logical,
5607 scrolled units.
5608
5609 """
0085ce49
RD
5610 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5611 __repr__ = _swig_repr
5612 def __init__(self, *args, **kwargs):
a95a7133 5613 """__init__(self, int Id=0) -> PaintEvent"""
0085ce49 5614 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5615_core_.PaintEvent_swigregister(PaintEvent)
d14a1e28
RD
5616
5617class NcPaintEvent(Event):
093d3ff1 5618 """Proxy of C++ NcPaintEvent class"""
0085ce49
RD
5619 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5620 __repr__ = _swig_repr
5621 def __init__(self, *args, **kwargs):
a95a7133 5622 """__init__(self, int winid=0) -> NcPaintEvent"""
0085ce49 5623 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5624_core_.NcPaintEvent_swigregister(NcPaintEvent)
d14a1e28
RD
5625
5626#---------------------------------------------------------------------------
5627
5628class EraseEvent(Event):
5ba5649b
RD
5629 """
5630 An erase event is sent whenever the background of a window needs to be
5631 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5632 binder. On some platforms, such as GTK+, this event is simulated
5633 (simply generated just before the paint event) and may cause flicker.
5634
5635 To paint a custom background use the `GetDC` method and use the returned
5636 device context if it is not ``None``, otherwise create a temporary
5637 `wx.ClientDC` and draw on that.
5638
5639 """
0085ce49
RD
5640 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5641 __repr__ = _swig_repr
5642 def __init__(self, *args, **kwargs):
5ba5649b
RD
5643 """
5644 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5645
5646 Constructor
5647 """
0085ce49 5648 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
e811c8ce 5649 def GetDC(*args, **kwargs):
5ba5649b
RD
5650 """
5651 GetDC(self) -> DC
5652
5653 Returns the device context the event handler should draw upon. If
5654 ``None`` is returned then create a temporary `wx.ClientDC` and use
5655 that instead.
5656 """
54f9ee45 5657 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 5658
97ab0f6a 5659 DC = property(GetDC,doc="See `GetDC`")
2131d850 5660_core_.EraseEvent_swigregister(EraseEvent)
d14a1e28
RD
5661
5662#---------------------------------------------------------------------------
5663
5664class FocusEvent(Event):
5ba5649b
RD
5665 """
5666 A focus event is sent when a window's focus changes. The window losing
5667 focus receives an EVT_KILL_FOCUS event while the window gaining it
5668 gets an EVT_SET_FOCUS event.
5669
5670 Notice that the set focus event happens both when the user gives focus
5671 to the window (whether using the mouse or keyboard) and when it is
5672 done from the program itself using `wx.Window.SetFocus`.
5673
5674 """
0085ce49
RD
5675 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5676 __repr__ = _swig_repr
5677 def __init__(self, *args, **kwargs):
5ba5649b 5678 """
2131d850 5679 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5680
5681 Constructor
5682 """
0085ce49 5683 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
e811c8ce 5684 def GetWindow(*args, **kwargs):
5ba5649b
RD
5685 """
5686 GetWindow(self) -> Window
5687
5688 Returns the other window associated with this event, that is the
5689 window which had the focus before for the EVT_SET_FOCUS event and the
5690 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5691
5692 Warning: the window returned may be None!
5693 """
54f9ee45 5694 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
5695
5696 def SetWindow(*args, **kwargs):
a95a7133 5697 """SetWindow(self, Window win)"""
54f9ee45 5698 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 5699
97ab0f6a 5700 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 5701_core_.FocusEvent_swigregister(FocusEvent)
d14a1e28
RD
5702
5703#---------------------------------------------------------------------------
5704
5705class ChildFocusEvent(CommandEvent):
5ba5649b 5706 """
33d6fd3b
RD
5707 A child focus event is sent to a (parent-)window when one of its child
5708 windows gains focus, so that the window could restore the focus back
5709 to its corresponding child if it loses it now and regains later.
5710
5711 Notice that child window is the direct child of the window receiving
5712 the event, and so may not be the actual widget recieving focus if it
5713 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5714 to get the widget that is actually receiving focus.
5ba5649b 5715 """
0085ce49
RD
5716 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5717 __repr__ = _swig_repr
5718 def __init__(self, *args, **kwargs):
5ba5649b
RD
5719 """
5720 __init__(self, Window win=None) -> ChildFocusEvent
5721
5722 Constructor
5723 """
0085ce49 5724 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
e811c8ce 5725 def GetWindow(*args, **kwargs):
5ba5649b
RD
5726 """
5727 GetWindow(self) -> Window
5728
33d6fd3b
RD
5729 The window, or (grand)parent of the window which has just received the
5730 focus.
5ba5649b 5731 """
54f9ee45 5732 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 5733
2bf58437 5734 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 5735_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d14a1e28
RD
5736
5737#---------------------------------------------------------------------------
5738
5739class ActivateEvent(Event):
5ba5649b
RD
5740 """
5741 An activate event is sent when a top-level window or the entire
5742 application is being activated or deactivated.
5743
5744 A top-level window (a dialog or frame) receives an activate event when
5745 is being activated or deactivated. This is indicated visually by the
5746 title bar changing colour, and a subwindow gaining the keyboard focus.
5747 An application is activated or deactivated when one of its frames
5748 becomes activated, or a frame becomes inactivate resulting in all
5749 application frames being inactive.
5750
5751 Please note that usually you should call event.Skip() in your handlers
5752 for these events so the default handlers will still be called, as not
5753 doing so can result in strange effects.
5754
5755 """
0085ce49
RD
5756 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5757 __repr__ = _swig_repr
5758 def __init__(self, *args, **kwargs):
5ba5649b 5759 """
2131d850 5760 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5761
5762 Constructor
5763 """
0085ce49 5764 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
e811c8ce 5765 def GetActive(*args, **kwargs):
5ba5649b
RD
5766 """
5767 GetActive(self) -> bool
5768
5769 Returns true if the application or window is being activated, false
5770 otherwise.
5771 """
54f9ee45 5772 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 5773
2bf58437 5774 Active = property(GetActive,doc="See `GetActive`")
2131d850 5775_core_.ActivateEvent_swigregister(ActivateEvent)
d14a1e28
RD
5776
5777#---------------------------------------------------------------------------
5778
5779class InitDialogEvent(Event):
5ba5649b
RD
5780 """
5781 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5782 any window when `wx.Window.InitDialog` is called. Handlers for this
5783 event can transfer data to the window, or anything else that should be
5784 done before the user begins editing the form. The default handler
5785 calls `wx.Window.TransferDataToWindow`.
5786 """
0085ce49
RD
5787 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5788 __repr__ = _swig_repr
5789 def __init__(self, *args, **kwargs):
5ba5649b
RD
5790 """
5791 __init__(self, int Id=0) -> InitDialogEvent
5792
5793 Constructor
5794 """
0085ce49 5795 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5796_core_.InitDialogEvent_swigregister(InitDialogEvent)
d14a1e28
RD
5797
5798#---------------------------------------------------------------------------
5799
5800class MenuEvent(Event):
5ba5649b
RD
5801 """
5802 This class is used for a variety of menu-related events. Note that
5803 these do not include menu command events, which are handled by sending
5804 `wx.CommandEvent` objects.
5805
5806 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5807 text in the first field of the status bar.
5808 """
0085ce49
RD
5809 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5810 __repr__ = _swig_repr
5811 def __init__(self, *args, **kwargs):
5ba5649b 5812 """
2131d850 5813 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5814
5815 Constructor
5816 """
0085ce49 5817 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
e811c8ce 5818 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5819 """
5820 GetMenuId(self) -> int
5821
5822 Returns the menu identifier associated with the event. This method
5823 should be only used with the HIGHLIGHT events.
5824 """
54f9ee45 5825 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
5826
5827 def IsPopup(*args, **kwargs):
5ba5649b
RD
5828 """
5829 IsPopup(self) -> bool
5830
5831 Returns ``True`` if the menu which is being opened or closed is a
5832 popup menu, ``False`` if it is a normal one. This method should only
5833 be used with the OPEN and CLOSE events.
5834 """
54f9ee45 5835 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
5836
5837 def GetMenu(*args, **kwargs):
5ba5649b
RD
5838 """
5839 GetMenu(self) -> Menu
5840
5841 Returns the menu which is being opened or closed. This method should
5842 only be used with the OPEN and CLOSE events.
5843 """
54f9ee45 5844 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 5845
57332a5a
RD
5846 Menu = property(GetMenu,doc="See `GetMenu`")
5847 MenuId = property(GetMenuId,doc="See `GetMenuId`")
2131d850 5848_core_.MenuEvent_swigregister(MenuEvent)
d14a1e28
RD
5849
5850#---------------------------------------------------------------------------
5851
5852class CloseEvent(Event):
5ba5649b
RD
5853 """
5854 This event class contains information about window and session close
5855 events.
5856
5857 The handler function for EVT_CLOSE is called when the user has tried
5858 to close a a frame or dialog box using the window manager controls or
5859 the system menu. It can also be invoked by the application itself
5860 programmatically, for example by calling the `wx.Window.Close`
5861 function.
5862
5863 You should check whether the application is forcing the deletion of
5864 the window using `CanVeto`. If it returns ``False``, you must destroy
5865 the window using `wx.Window.Destroy`. If the return value is ``True``,
5866 it is up to you whether you respond by destroying the window or not.
5867 For example you may wish to display a message dialog prompting to save
5868 files or to cancel the close.
5869
5870 If you don't destroy the window, you should call `Veto` to let the
5871 calling code know that you did not destroy the window. This allows the
5872 `wx.Window.Close` function to return ``True`` or ``False`` depending
5873 on whether the close instruction was honored or not.
5874 """
0085ce49
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 5878 """
2131d850 5879 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5880
5881 Constructor.
5882 """
0085ce49 5883 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
e811c8ce 5884 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5885 """
5886 SetLoggingOff(self, bool logOff)
5887
5888 Sets the 'logging off' flag.
5889 """
54f9ee45 5890 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
5891
5892 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5893 """
5894 GetLoggingOff(self) -> bool
5895
6c75a4cf
RD
5896 Returns ``True`` if the user is logging off or ``False`` if the
5897 system is shutting down. This method can only be called for end
5898 session and query end session events, it doesn't make sense for close
5899 window event.
5ba5649b 5900 """
54f9ee45 5901 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
5902
5903 def Veto(*args, **kwargs):
5ba5649b
RD
5904 """
5905 Veto(self, bool veto=True)
5906
5907 Call this from your event handler to veto a system shutdown or to
5908 signal to the calling application that a window close did not happen.
5909
5910 You can only veto a shutdown or close if `CanVeto` returns true.
5911 """
54f9ee45 5912 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce 5913
5ba5649b
RD
5914 def GetVeto(*args, **kwargs):
5915 """GetVeto(self) -> bool"""
5916 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5917
e811c8ce 5918 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5919 """
5920 SetCanVeto(self, bool canVeto)
5921
5922 Sets the 'can veto' flag.
5923 """
54f9ee45 5924 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
5925
5926 def CanVeto(*args, **kwargs):
5ba5649b
RD
5927 """
5928 CanVeto(self) -> bool
e811c8ce 5929
5ba5649b
RD
5930 Returns true if you can veto a system shutdown or a window close
5931 event. Vetoing a window close event is not possible if the calling
5932 code wishes to force the application to exit, and so this function
5933 must be called to check this.
5934 """
5935 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce 5936
2bf58437 5937 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
2131d850 5938_core_.CloseEvent_swigregister(CloseEvent)
d14a1e28
RD
5939
5940#---------------------------------------------------------------------------
5941
5942class ShowEvent(Event):
5ba5649b 5943 """An EVT_SHOW event is sent when a window is shown or hidden."""
0085ce49
RD
5944 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5945 __repr__ = _swig_repr
5946 def __init__(self, *args, **kwargs):
5ba5649b
RD
5947 """
5948 __init__(self, int winid=0, bool show=False) -> ShowEvent
5949
5950 An EVT_SHOW event is sent when a window is shown or hidden.
5951 """
0085ce49 5952 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
e811c8ce 5953 def SetShow(*args, **kwargs):
a95a7133 5954 """SetShow(self, bool show)"""
54f9ee45 5955 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
5956
5957 def GetShow(*args, **kwargs):
a95a7133 5958 """GetShow(self) -> bool"""
54f9ee45 5959 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 5960
33d6fd3b 5961 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
2131d850 5962_core_.ShowEvent_swigregister(ShowEvent)
d14a1e28
RD
5963
5964#---------------------------------------------------------------------------
5965
5966class IconizeEvent(Event):
5ba5649b
RD
5967 """
5968 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5969 restored.
5970 """
0085ce49
RD
5971 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5972 __repr__ = _swig_repr
5973 def __init__(self, *args, **kwargs):
5ba5649b
RD
5974 """
5975 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5976
5977 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5978 restored.
5979 """
0085ce49 5980 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
e811c8ce 5981 def Iconized(*args, **kwargs):
5ba5649b
RD
5982 """
5983 Iconized(self) -> bool
5984
5985 Returns ``True`` if the frame has been iconized, ``False`` if it has
5986 been restored.
5987 """
54f9ee45 5988 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 5989
2131d850 5990_core_.IconizeEvent_swigregister(IconizeEvent)
d14a1e28
RD
5991
5992#---------------------------------------------------------------------------
5993
5994class MaximizeEvent(Event):
5ba5649b 5995 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
0085ce49
RD
5996 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5997 __repr__ = _swig_repr
5998 def __init__(self, *args, **kwargs):
5ba5649b
RD
5999 """
6000 __init__(self, int id=0) -> MaximizeEvent
6001
6002 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
6003 """
0085ce49 6004 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 6005_core_.MaximizeEvent_swigregister(MaximizeEvent)
d14a1e28
RD
6006
6007#---------------------------------------------------------------------------
6008
6009class DropFilesEvent(Event):
5ba5649b
RD
6010 """
6011 This class is used for drop files events, that is, when files have
6012 been dropped onto the window. This functionality is only available
6013 under Windows. The window must have previously been enabled for
6014 dropping by calling `wx.Window.DragAcceptFiles`.
6015
6016 Important note: this is a separate implementation to the more general
6017 drag and drop implementation using `wx.FileDropTarget`, and etc. This
6018 implementation uses the older, Windows message-based approach of
6019 dropping files.
6020
6021 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
6022 events.
6023
6024 """
0085ce49
RD
6025 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6026 def __init__(self): raise AttributeError, "No constructor defined"
6027 __repr__ = _swig_repr
e811c8ce 6028 def GetPosition(*args, **kwargs):
5ba5649b
RD
6029 """
6030 GetPosition(self) -> Point
6031
6032 Returns the position at which the files were dropped.
6033 """
54f9ee45 6034 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
6035
6036 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
6037 """
6038 GetNumberOfFiles(self) -> int
6039
6040 Returns the number of files dropped.
6041 """
54f9ee45 6042 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
6043
6044 def GetFiles(*args, **kwargs):
5ba5649b
RD
6045 """
6046 GetFiles(self) -> PyObject
6047
6048 Returns a list of the filenames that were dropped.
6049 """
54f9ee45 6050 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 6051
2bf58437
RD
6052 Files = property(GetFiles,doc="See `GetFiles`")
6053 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
6054 Position = property(GetPosition,doc="See `GetPosition`")
2131d850 6055_core_.DropFilesEvent_swigregister(DropFilesEvent)
d14a1e28
RD
6056
6057#---------------------------------------------------------------------------
6058
54f9ee45
RD
6059UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
6060UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 6061class UpdateUIEvent(CommandEvent):
5ba5649b
RD
6062 """
6063 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
6064 wxWidgets to give an application the chance to update various user
6065 interface elements.
6066
6067 Without update UI events, an application has to work hard to
6068 check/uncheck, enable/disable, and set the text for elements such as
6069 menu items and toolbar buttons. The code for doing this has to be
6070 mixed up with the code that is invoked when an action is invoked for a
6071 menu item or button.
6072
6073 With update UI events, you define an event handler to look at the
6074 state of the application and change UI elements accordingly. wxWidgets
6075 will call your handler functions in idle time, so you don't have to
6076 worry where to call this code. In addition to being a clearer and more
6077 declarative method, it also means you don't have to worry whether
6078 you're updating a toolbar or menubar identifier. The same handler can
6079 update a menu item and toolbar button, if the ID values are the same.
6080
6081 Instead of directly manipulating the menu or button, you call
6082 functions in the event object, such as `Check`. wxWidgets will
6083 determine whether such a call has been made, and which UI element to
6084 update.
6085
6086 These events will work for popup menus as well as menubars. Just
6087 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
6088 any UI events for the window that owns the menu.
6089
6090 If you find that the overhead of UI update processing is affecting
6091 your application, you can do one or both of the following:
6092
6093 1. Call `wx.UpdateUIEvent.SetMode` with a value of
6094 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
6095 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
6096 receive update events. No other windows will receive update
6097 events.
6098
6099 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6100 value to set the delay between updates. You may need to call
6101 `wx.Window.UpdateWindowUI` at critical points, for example when
6102 a dialog is about to be shown, in case the user sees a slight
6103 delay before windows are updated.
6104
6105 Note that although events are sent in idle time, defining a EVT_IDLE
6106 handler for a window does not affect this because the events are sent
6107 from an internal idle handler.
6108
6109 wxWidgets tries to optimize update events on some platforms. On
6110 Windows and GTK+, events for menubar items are only sent when the menu
6111 is about to be shown, and not in idle time.
6112
6113 """
0085ce49
RD
6114 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6115 __repr__ = _swig_repr
6116 def __init__(self, *args, **kwargs):
5ba5649b
RD
6117 """
6118 __init__(self, int commandId=0) -> UpdateUIEvent
6119
6120 Constructor
6121 """
0085ce49 6122 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
e811c8ce 6123 def GetChecked(*args, **kwargs):
5ba5649b
RD
6124 """
6125 GetChecked(self) -> bool
6126
6127 Returns ``True`` if the UI element should be checked.
6128 """
54f9ee45 6129 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
6130
6131 def GetEnabled(*args, **kwargs):
5ba5649b
RD
6132 """
6133 GetEnabled(self) -> bool
6134
6135 Returns ``True`` if the UI element should be enabled.
6136 """
54f9ee45 6137 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce 6138
b1fcee84
RD
6139 def GetShown(*args, **kwargs):
6140 """
6141 GetShown(self) -> bool
6142
6143 Returns ``True`` if the UI element should be shown.
6144 """
6145 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
6146
e811c8ce 6147 def GetText(*args, **kwargs):
5ba5649b
RD
6148 """
6149 GetText(self) -> String
6150
6151 Returns the text that should be set for the UI element.
6152 """
54f9ee45 6153 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
6154
6155 def GetSetText(*args, **kwargs):
5ba5649b
RD
6156 """
6157 GetSetText(self) -> bool
6158
6159 Returns ``True`` if the application has called `SetText`. For
6160 wxWidgets internal use only.
6161 """
54f9ee45 6162 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
6163
6164 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
6165 """
6166 GetSetChecked(self) -> bool
6167
6168 Returns ``True`` if the application has called `Check`. For wxWidgets
6169 internal use only.
6170 """
54f9ee45 6171 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
6172
6173 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
6174 """
6175 GetSetEnabled(self) -> bool
6176
6177 Returns ``True`` if the application has called `Enable`. For wxWidgets
6178 internal use only.
6179 """
54f9ee45 6180 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce 6181
b1fcee84
RD
6182 def GetSetShown(*args, **kwargs):
6183 """
6184 GetSetShown(self) -> bool
6185
6186 Returns ``True`` if the application has called `Show`. For wxWidgets
6187 internal use only.
6188 """
6189 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
6190
e811c8ce 6191 def Check(*args, **kwargs):
5ba5649b
RD
6192 """
6193 Check(self, bool check)
6194
6195 Check or uncheck the UI element.
6196 """
54f9ee45 6197 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
6198
6199 def Enable(*args, **kwargs):
5ba5649b
RD
6200 """
6201 Enable(self, bool enable)
6202
6203 Enable or disable the UI element.
6204 """
54f9ee45 6205 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce 6206
b1fcee84
RD
6207 def Show(*args, **kwargs):
6208 """
6209 Show(self, bool show)
6210
6211 Show or hide the UI element.
6212 """
6213 return _core_.UpdateUIEvent_Show(*args, **kwargs)
6214
e811c8ce 6215 def SetText(*args, **kwargs):
5ba5649b
RD
6216 """
6217 SetText(self, String text)
6218
6219 Sets the text for this UI element.
6220 """
54f9ee45 6221 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
6222
6223 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6224 """
6225 SetUpdateInterval(long updateInterval)
6226
6227 Sets the interval between updates in milliseconds. Set to -1 to
6228 disable updates, or to 0 to update as frequently as possible. The
6229 default is 0.
6230
6231 Use this to reduce the overhead of UI update events if your
6232 application has a lot of windows. If you set the value to -1 or
6233 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6234 at appropriate points in your application, such as when a dialog is
6235 about to be shown.
6236 """
54f9ee45 6237 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
6238
6239 SetUpdateInterval = staticmethod(SetUpdateInterval)
6240 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6241 """
6242 GetUpdateInterval() -> long
6243
6244 Returns the current interval between updates in milliseconds. -1
6245 disables updates, 0 updates as frequently as possible.
6246 """
54f9ee45 6247 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
6248
6249 GetUpdateInterval = staticmethod(GetUpdateInterval)
6250 def CanUpdate(*args, **kwargs):
5ba5649b
RD
6251 """
6252 CanUpdate(Window win) -> bool
6253
6254 Returns ``True`` if it is appropriate to update (send UI update events
6255 to) this window.
6256
6257 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6258 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6259 events were last sent in idle time, and the update interval, to
6260 determine whether events should be sent to this window now. By default
6261 this will always return true because the update mode is initially
6262 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6263 events will be sent as often as possible. You can reduce the frequency
6264 that events are sent by changing the mode and/or setting an update
6265 interval.
6266
6267 """
54f9ee45 6268 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
6269
6270 CanUpdate = staticmethod(CanUpdate)
6271 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6272 """
6273 ResetUpdateTime()
6274
6275 Used internally to reset the last-updated time to the current time. It
6276 is assumed that update events are normally sent in idle time, so this
6277 is called at the end of idle processing.
6278 """
54f9ee45 6279 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
6280
6281 ResetUpdateTime = staticmethod(ResetUpdateTime)
6282 def SetMode(*args, **kwargs):
5ba5649b
RD
6283 """
6284 SetMode(int mode)
6285
6286 Specify how wxWidgets will send update events: to all windows, or only
6287 to those which specify that they will process the events.
6288
6289 The mode may be one of the following values:
6290
6291 ============================= ==========================================
6292 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6293 is the default setting.
6294 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6295 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6296 style set.
6297 ============================= ==========================================
6298
6299 """
54f9ee45 6300 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6301
6302 SetMode = staticmethod(SetMode)
6303 def GetMode(*args, **kwargs):
5ba5649b
RD
6304 """
6305 GetMode() -> int
6306
6307 Returns a value specifying how wxWidgets will send update events: to
6308 all windows, or only to those which specify that they will process the
6309 events.
6310 """
54f9ee45 6311 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6312
6313 GetMode = staticmethod(GetMode)
dba7934c
RD
6314 Checked = property(GetChecked,Check,doc="See `GetChecked`")
6315 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
6316 Shown = property(GetShown,Show,doc="See `GetShown`")
6317 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
2131d850 6318_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d14a1e28 6319
e811c8ce 6320def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
0085ce49 6321 """
5ba5649b
RD
6322 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6323
6324 Sets the interval between updates in milliseconds. Set to -1 to
6325 disable updates, or to 0 to update as frequently as possible. The
6326 default is 0.
6327
6328 Use this to reduce the overhead of UI update events if your
6329 application has a lot of windows. If you set the value to -1 or
6330 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6331 at appropriate points in your application, such as when a dialog is
6332 about to be shown.
6333 """
0085ce49 6334 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 6335
0085ce49
RD
6336def UpdateUIEvent_GetUpdateInterval(*args):
6337 """
5ba5649b
RD
6338 UpdateUIEvent_GetUpdateInterval() -> long
6339
6340 Returns the current interval between updates in milliseconds. -1
6341 disables updates, 0 updates as frequently as possible.
6342 """
0085ce49 6343 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d14a1e28 6344
e811c8ce 6345def UpdateUIEvent_CanUpdate(*args, **kwargs):
0085ce49 6346 """
5ba5649b
RD
6347 UpdateUIEvent_CanUpdate(Window win) -> bool
6348
6349 Returns ``True`` if it is appropriate to update (send UI update events
6350 to) this window.
6351
6352 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6353 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6354 events were last sent in idle time, and the update interval, to
6355 determine whether events should be sent to this window now. By default
6356 this will always return true because the update mode is initially
6357 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6358 events will be sent as often as possible. You can reduce the frequency
6359 that events are sent by changing the mode and/or setting an update
6360 interval.
6361
6362 """
0085ce49 6363 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 6364
0085ce49
RD
6365def UpdateUIEvent_ResetUpdateTime(*args):
6366 """
5ba5649b
RD
6367 UpdateUIEvent_ResetUpdateTime()
6368
6369 Used internally to reset the last-updated time to the current time. It
6370 is assumed that update events are normally sent in idle time, so this
6371 is called at the end of idle processing.
6372 """
0085ce49 6373 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d14a1e28 6374
e811c8ce 6375def UpdateUIEvent_SetMode(*args, **kwargs):
0085ce49 6376 """
5ba5649b
RD
6377 UpdateUIEvent_SetMode(int mode)
6378
6379 Specify how wxWidgets will send update events: to all windows, or only
6380 to those which specify that they will process the events.
6381
6382 The mode may be one of the following values:
6383
6384 ============================= ==========================================
6385 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6386 is the default setting.
6387 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6388 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6389 style set.
6390 ============================= ==========================================
6391
6392 """
0085ce49 6393 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 6394
0085ce49
RD
6395def UpdateUIEvent_GetMode(*args):
6396 """
5ba5649b
RD
6397 UpdateUIEvent_GetMode() -> int
6398
6399 Returns a value specifying how wxWidgets will send update events: to
6400 all windows, or only to those which specify that they will process the
6401 events.
6402 """
0085ce49 6403 return _core_.UpdateUIEvent_GetMode(*args)
d14a1e28
RD
6404
6405#---------------------------------------------------------------------------
6406
6407class SysColourChangedEvent(Event):
5ba5649b
RD
6408 """
6409 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6410 when the user changes the colour settings using the control
6411 panel. This is only applicable under Windows.
6412
6413 The default event handler for this event propagates the event to child
6414 windows, since Windows only sends the events to top-level windows. If
6415 intercepting this event for a top-level window, remember to call
6416 `Skip` so the the base class handler will still be executed, or to
6417 pass the event on to the window's children explicitly.
6418
6419 """
0085ce49
RD
6420 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6421 __repr__ = _swig_repr
6422 def __init__(self, *args, **kwargs):
5ba5649b
RD
6423 """
6424 __init__(self) -> SysColourChangedEvent
6425
6426 Constructor
6427 """
0085ce49 6428 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 6429_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d14a1e28
RD
6430
6431#---------------------------------------------------------------------------
6432
6433class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6434 """
6435 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6436 a window that loses its mouse capture. This is called even if
6437 `wx.Window.ReleaseMouse` was called by the application code. Handling
6438 this event allows an application to cater for unexpected capture
6439 releases which might otherwise confuse mouse handling code.
6440
6441 This event is implemented under Windows only.
6442 """
0085ce49
RD
6443 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6444 __repr__ = _swig_repr
6445 def __init__(self, *args, **kwargs):
5ba5649b
RD
6446 """
6447 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6448
6449 Constructor
6450 """
0085ce49 6451 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
e811c8ce 6452 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6453 """
6454 GetCapturedWindow(self) -> Window
6455
6456 Returns the window that gained the capture, or ``None`` if it was a
6457 non-wxWidgets window.
6458 """
54f9ee45 6459 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 6460
57332a5a 6461 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
2131d850 6462_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d14a1e28
RD
6463
6464#---------------------------------------------------------------------------
6465
34e0a3bb
RD
6466class MouseCaptureLostEvent(Event):
6467 """
6468 A mouse capture lost event is sent to a window that obtained mouse
6469 capture, which was subsequently loss due to "external" event, for
6470 example when a dialog box is shown or if another application captures
6471 the mouse.
6472
6473 If this happens, this event is sent to all windows that are on the
6474 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6475 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6476 if the capture changes because of a call to CaptureMouse or
6477 ReleaseMouse.
6478
6479 This event is currently emitted under Windows only.
6480
6481 """
6482 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6483 __repr__ = _swig_repr
6484 def __init__(self, *args, **kwargs):
6485 """
6486 __init__(self, int winid=0) -> MouseCaptureLostEvent
6487
6488 A mouse capture lost event is sent to a window that obtained mouse
6489 capture, which was subsequently loss due to "external" event, for
6490 example when a dialog box is shown or if another application captures
6491 the mouse.
6492
6493 If this happens, this event is sent to all windows that are on the
6494 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6495 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6496 if the capture changes because of a call to CaptureMouse or
6497 ReleaseMouse.
6498
6499 This event is currently emitted under Windows only.
6500
6501 """
6502 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6503_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6504
6505#---------------------------------------------------------------------------
6506
d14a1e28 6507class DisplayChangedEvent(Event):
5ba5649b
RD
6508 """
6509 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6510 resolution has changed.
6511
6512 This event is implemented under Windows only.
6513 """
0085ce49
RD
6514 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6515 __repr__ = _swig_repr
6516 def __init__(self, *args, **kwargs):
a95a7133 6517 """__init__(self) -> DisplayChangedEvent"""
0085ce49 6518 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 6519_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d14a1e28
RD
6520
6521#---------------------------------------------------------------------------
6522
6523class PaletteChangedEvent(Event):
5ba5649b
RD
6524 """
6525 An EVT_PALETTE_CHANGED event is sent when the system palette has
6526 changed, thereby giving each window a chance to redo their own to
6527 match.
6528
6529 This event is implemented under Windows only.
6530 """
0085ce49
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):
5ba5649b
RD
6534 """
6535 __init__(self, int id=0) -> PaletteChangedEvent
6536
6537 An EVT_PALETTE_CHANGED event is sent when the system palette has
6538 changed, thereby giving each window a chance to redo their own to
6539 match.
6540
6541 This event is implemented under Windows only.
6542 """
0085ce49 6543 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
e811c8ce 6544 def SetChangedWindow(*args, **kwargs):
a95a7133 6545 """SetChangedWindow(self, Window win)"""
54f9ee45 6546 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
6547
6548 def GetChangedWindow(*args, **kwargs):
a95a7133 6549 """GetChangedWindow(self) -> Window"""
54f9ee45 6550 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 6551
33d6fd3b 6552 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
2131d850 6553_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d14a1e28
RD
6554
6555#---------------------------------------------------------------------------
6556
6557class QueryNewPaletteEvent(Event):
5ba5649b
RD
6558 """
6559 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6560 focus and should re-do its palette.
6561
6562 This event is implemented under Windows only.
6563 """
0085ce49
RD
6564 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6565 __repr__ = _swig_repr
6566 def __init__(self, *args, **kwargs):
5ba5649b
RD
6567 """
6568 __init__(self, int winid=0) -> QueryNewPaletteEvent
6569
6570 Constructor.
6571 """
0085ce49 6572 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
e811c8ce 6573 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6574 """
6575 SetPaletteRealized(self, bool realized)
6576
6577 App should set this if it changes the palette.
6578 """
54f9ee45 6579 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
6580
6581 def GetPaletteRealized(*args, **kwargs):
a95a7133 6582 """GetPaletteRealized(self) -> bool"""
54f9ee45 6583 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 6584
33d6fd3b 6585 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
2131d850 6586_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d14a1e28
RD
6587
6588#---------------------------------------------------------------------------
6589
6590class NavigationKeyEvent(Event):
5ba5649b
RD
6591 """
6592 EVT_NAVIGATION_KEY events are used to control moving the focus between
6593 widgets, otherwise known as tab-traversal. You woudl normally not
6594 catch navigation events in applications as there are already
6595 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6596 it useful to send navigation events in certain situations to change
6597 the focus in certain ways, although it's probably easier to just call
6598 `wx.Window.Navigate`.
6599 """
0085ce49
RD
6600 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6601 __repr__ = _swig_repr
6602 def __init__(self, *args, **kwargs):
a95a7133 6603 """__init__(self) -> NavigationKeyEvent"""
0085ce49 6604 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
e811c8ce 6605 def GetDirection(*args, **kwargs):
5ba5649b
RD
6606 """
6607 GetDirection(self) -> bool
6608
6609 Returns ``True`` if the direction is forward, ``False`` otherwise.
6610 """
54f9ee45 6611 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
6612
6613 def SetDirection(*args, **kwargs):
5ba5649b
RD
6614 """
6615 SetDirection(self, bool forward)
6616
6617 Specify the direction that the navigation should take. Usually the
6618 difference between using Tab and Shift-Tab.
6619 """
54f9ee45 6620 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
6621
6622 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6623 """
6624 IsWindowChange(self) -> bool
6625
6626 Returns ``True`` if window change is allowed.
6627 """
54f9ee45 6628 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
6629
6630 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6631 """
6632 SetWindowChange(self, bool ischange)
6633
6634 Specify if the navigation should be able to change parent windows.
6635 For example, changing notebook pages, etc. This is usually implemented
6636 by using Control-Tab.
6637 """
54f9ee45 6638 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 6639
68350608 6640 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6641 """
6642 IsFromTab(self) -> bool
6643
6644 Returns ``True`` if the navigation event is originated from the Tab
6645 key.
6646 """
68350608
RD
6647 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6648
6649 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6650 """
6651 SetFromTab(self, bool bIs)
6652
6653 Set to true under MSW if the event was generated using the tab key.
6654 This is required for proper navogation over radio buttons.
6655 """
68350608
RD
6656 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6657
908b74cd 6658 def SetFlags(*args, **kwargs):
5ba5649b
RD
6659 """
6660 SetFlags(self, long flags)
6661
6662 Set the navigation flags to a combination of the following:
6663
6664 * wx.NavigationKeyEvent.IsBackward
6665 * wx.NavigationKeyEvent.IsForward
6666 * wx.NavigationKeyEvent.WinChange
6667 * wx.NavigationKeyEvent.FromTab
6668
6669 """
908b74cd
RD
6670 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6671
e811c8ce 6672 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6673 """
6674 GetCurrentFocus(self) -> Window
6675
6676 Returns the child window which currenty has the focus. May be
6677 ``None``.
6678 """
54f9ee45 6679 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
6680
6681 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6682 """
6683 SetCurrentFocus(self, Window win)
6684
6685 Set the window that has the focus.
6686 """
54f9ee45 6687 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 6688
b0f7404b 6689 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6690 IsForward = _core_.NavigationKeyEvent_IsForward
6691 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6692 FromTab = _core_.NavigationKeyEvent_FromTab
57332a5a
RD
6693 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6694 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
2131d850 6695_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d14a1e28
RD
6696
6697#---------------------------------------------------------------------------
6698
6699class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6700 """
6701 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6702 underlying GUI object) exists.
6703 """
0085ce49
RD
6704 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6705 __repr__ = _swig_repr
6706 def __init__(self, *args, **kwargs):
5ba5649b
RD
6707 """
6708 __init__(self, Window win=None) -> WindowCreateEvent
6709
6710 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6711 underlying GUI object) exists.
6712 """
0085ce49 6713 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
e811c8ce 6714 def GetWindow(*args, **kwargs):
5ba5649b
RD
6715 """
6716 GetWindow(self) -> Window
6717
6718 Returns the window that this event refers to.
6719 """
54f9ee45 6720 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 6721
dba7934c 6722 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6723_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d14a1e28
RD
6724
6725class WindowDestroyEvent(CommandEvent):
5ba5649b 6726 """
943e8dfd
RD
6727 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6728 when the GUI window is destroyed.
6729
6730 When a class derived from `wx.Window` is destroyed its destructor will
6731 have already run by the time this event is sent. Therefore this event
6732 will not usually be received at all by the window itself. Since it is
6733 received after the destructor has run, an object should not try to
6734 handle its own wx.WindowDestroyEvent, but it can be used to get
6735 notification of the destruction of another window.
5ba5649b 6736 """
0085ce49
RD
6737 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6738 __repr__ = _swig_repr
6739 def __init__(self, *args, **kwargs):
5ba5649b
RD
6740 """
6741 __init__(self, Window win=None) -> WindowDestroyEvent
6742
943e8dfd
RD
6743 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6744 when the GUI window is destroyed.
6745
6746 When a class derived from `wx.Window` is destroyed its destructor will
6747 have already run by the time this event is sent. Therefore this event
6748 will not usually be received at all by the window itself. Since it is
6749 received after the destructor has run, an object should not try to
6750 handle its own wx.WindowDestroyEvent, but it can be used to get
6751 notification of the destruction of another window.
5ba5649b 6752 """
0085ce49 6753 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
e811c8ce 6754 def GetWindow(*args, **kwargs):
5ba5649b
RD
6755 """
6756 GetWindow(self) -> Window
6757
6758 Returns the window that this event refers to.
6759 """
54f9ee45 6760 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 6761
dba7934c 6762 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6763_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d14a1e28
RD
6764
6765#---------------------------------------------------------------------------
6766
6767class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6768 """
6769 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6770 give the application a chance to show a context (popup) menu.
6771 """
0085ce49
RD
6772 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6773 __repr__ = _swig_repr
6774 def __init__(self, *args, **kwargs):
5ba5649b 6775 """
2131d850 6776 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6777
6778 Constructor.
6779 """
0085ce49 6780 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
e811c8ce 6781 def GetPosition(*args, **kwargs):
5ba5649b
RD
6782 """
6783 GetPosition(self) -> Point
6784
6785 Returns the position (in screen coordinants) at which the menu should
6786 be shown.
6787 """
54f9ee45 6788 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
6789
6790 def SetPosition(*args, **kwargs):
5ba5649b
RD
6791 """
6792 SetPosition(self, Point pos)
6793
6794 Sets the position at which the menu should be shown.
6795 """
54f9ee45 6796 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 6797
2bf58437 6798 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 6799_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d14a1e28
RD
6800
6801#---------------------------------------------------------------------------
6802
54f9ee45
RD
6803IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6804IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 6805class IdleEvent(Event):
5ba5649b
RD
6806 """
6807 This class is used for EVT_IDLE events, which are generated and sent
6808 when the application *becomes* idle. In other words, the when the
6809 event queue becomes empty then idle events are sent to all windows (by
6810 default) and as long as none of them call `RequestMore` then there are
6811 no more idle events until after the system event queue has some normal
6812 events and then becomes empty again.
6813
6814 By default, idle events are sent to all windows. If this is causing a
6815 significant overhead in your application, you can call
6816 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6817 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6818 which should receive idle events. Then idle events will only be sent
6819 to those windows and not to any others.
6820 """
0085ce49
RD
6821 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6822 __repr__ = _swig_repr
6823 def __init__(self, *args, **kwargs):
5ba5649b
RD
6824 """
6825 __init__(self) -> IdleEvent
6826
6827 Constructor
6828 """
0085ce49 6829 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
e811c8ce 6830 def RequestMore(*args, **kwargs):
5ba5649b
RD
6831 """
6832 RequestMore(self, bool needMore=True)
6833
6834 Tells wxWidgets that more processing is required. This function can be
6835 called by an EVT_IDLE handler for a window to indicate that the
6836 application should forward the EVT_IDLE event once more to the
6837 application windows. If no window calls this function during its
6838 EVT_IDLE handler, then the application will remain in a passive event
6839 loop until a new event is posted to the application by the windowing
6840 system.
6841 """
54f9ee45 6842 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
6843
6844 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6845 """
6846 MoreRequested(self) -> bool
6847
6848 Returns ``True`` if the OnIdle function processing this event
6849 requested more processing time.
6850 """
54f9ee45 6851 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
6852
6853 def SetMode(*args, **kwargs):
5ba5649b
RD
6854 """
6855 SetMode(int mode)
6856
6857 Static method for specifying how wxWidgets will send idle events: to
6858 all windows, or only to those which specify that they will process the
6859 events.
6860
6861 The mode can be one of the following values:
6862
6863 ========================= ========================================
6864 wx.IDLE_PROCESS_ALL Send idle events to all windows
6865 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6866 the wx.WS_EX_PROCESS_IDLE extra style
6867 flag set.
6868 ========================= ========================================
6869
6870 """
54f9ee45 6871 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6872
6873 SetMode = staticmethod(SetMode)
6874 def GetMode(*args, **kwargs):
5ba5649b
RD
6875 """
6876 GetMode() -> int
6877
6878 Static method returning a value specifying how wxWidgets will send
6879 idle events: to all windows, or only to those which specify that they
6880 will process the events.
6881 """
54f9ee45 6882 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6883
6884 GetMode = staticmethod(GetMode)
6885 def CanSend(*args, **kwargs):
5ba5649b
RD
6886 """
6887 CanSend(Window win) -> bool
6888
6889 Returns ``True`` if it is appropriate to send idle events to this
6890 window.
6891
6892 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6893 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6894 events should be sent to this window now. By default this will always
6895 return ``True`` because the update mode is initially
6896 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6897 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6898 """
54f9ee45 6899 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
6900
6901 CanSend = staticmethod(CanSend)
2131d850 6902_core_.IdleEvent_swigregister(IdleEvent)
d14a1e28 6903
e811c8ce 6904def IdleEvent_SetMode(*args, **kwargs):
0085ce49 6905 """
5ba5649b
RD
6906 IdleEvent_SetMode(int mode)
6907
6908 Static method for specifying how wxWidgets will send idle events: to
6909 all windows, or only to those which specify that they will process the
6910 events.
6911
6912 The mode can be one of the following values:
6913
6914 ========================= ========================================
6915 wx.IDLE_PROCESS_ALL Send idle events to all windows
6916 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6917 the wx.WS_EX_PROCESS_IDLE extra style
6918 flag set.
6919 ========================= ========================================
6920
6921 """
0085ce49 6922 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 6923
0085ce49
RD
6924def IdleEvent_GetMode(*args):
6925 """
5ba5649b
RD
6926 IdleEvent_GetMode() -> int
6927
6928 Static method returning a value specifying how wxWidgets will send
6929 idle events: to all windows, or only to those which specify that they
6930 will process the events.
6931 """
0085ce49 6932 return _core_.IdleEvent_GetMode(*args)
d14a1e28 6933
e811c8ce 6934def IdleEvent_CanSend(*args, **kwargs):
0085ce49 6935 """
5ba5649b
RD
6936 IdleEvent_CanSend(Window win) -> bool
6937
6938 Returns ``True`` if it is appropriate to send idle events to this
6939 window.
6940
6941 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6942 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6943 events should be sent to this window now. By default this will always
6944 return ``True`` because the update mode is initially
6945 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6946 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6947 """
0085ce49 6948 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
6949
6950#---------------------------------------------------------------------------
6951
2131d850
RD
6952class ClipboardTextEvent(CommandEvent):
6953 """
6954 A Clipboard Text event is sent when a window intercepts a text
6955 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6956 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6957 popup menu command, etc. NOTE : under windows these events are *NOT*
6958 generated automatically for a Rich Edit text control.
6959 """
6960 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6961 __repr__ = _swig_repr
6962 def __init__(self, *args, **kwargs):
6963 """
6964 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6965
6966 A Clipboard Text event is sent when a window intercepts a text
6967 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6968 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6969 popup menu command, etc. NOTE : under windows these events are *NOT*
6970 generated automatically for a Rich Edit text control.
6971 """
6972 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6973_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6974
6975#---------------------------------------------------------------------------
6976
d14a1e28 6977class PyEvent(Event):
5ba5649b
RD
6978 """
6979 wx.PyEvent can be used as a base class for implementing custom event
6980 types in Python. You should derived from this class instead of
6981 `wx.Event` because this class is Python-aware and is able to transport
6982 its Python bits safely through the wxWidgets event system and have
6983 them still be there when the event handler is invoked.
6984
6985 :see: `wx.PyCommandEvent`
6986
6987 """
0085ce49
RD
6988 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6989 __repr__ = _swig_repr
6990 def __init__(self, *args, **kwargs):
2131d850 6991 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
0085ce49 6992 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6993 self._SetSelf(self)
e811c8ce 6994
0085ce49
RD
6995 __swig_destroy__ = _core_.delete_PyEvent
6996 __del__ = lambda self : None;
5ba5649b
RD
6997 def _SetSelf(*args, **kwargs):
6998 """_SetSelf(self, PyObject self)"""
6999 return _core_.PyEvent__SetSelf(*args, **kwargs)
e811c8ce 7000
5ba5649b
RD
7001 def _GetSelf(*args, **kwargs):
7002 """_GetSelf(self) -> PyObject"""
7003 return _core_.PyEvent__GetSelf(*args, **kwargs)
e811c8ce 7004
2131d850 7005_core_.PyEvent_swigregister(PyEvent)
d14a1e28
RD
7006
7007class PyCommandEvent(CommandEvent):
5ba5649b
RD
7008 """
7009 wx.PyCommandEvent can be used as a base class for implementing custom
7010 event types in Python, where the event shoudl travel up to parent
7011 windows looking for a handler. You should derived from this class
7012 instead of `wx.CommandEvent` because this class is Python-aware and is
7013 able to transport its Python bits safely through the wxWidgets event
7014 system and have them still be there when the event handler is invoked.
7015
7016 :see: `wx.PyEvent`
7017
7018 """
0085ce49
RD
7019 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7020 __repr__ = _swig_repr
7021 def __init__(self, *args, **kwargs):
2131d850 7022 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
0085ce49 7023 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 7024 self._SetSelf(self)
e811c8ce 7025
0085ce49
RD
7026 __swig_destroy__ = _core_.delete_PyCommandEvent
7027 __del__ = lambda self : None;
5ba5649b
RD
7028 def _SetSelf(*args, **kwargs):
7029 """_SetSelf(self, PyObject self)"""
7030 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
e811c8ce 7031
5ba5649b
RD
7032 def _GetSelf(*args, **kwargs):
7033 """_GetSelf(self) -> PyObject"""
7034 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
e811c8ce 7035
2131d850 7036_core_.PyCommandEvent_swigregister(PyCommandEvent)
d14a1e28 7037
53aa7709 7038class DateEvent(CommandEvent):
5ba5649b
RD
7039 """
7040 This event class holds information about a date change event and is
7041 used together with `wx.DatePickerCtrl`. It also serves as a base class
7042 for `wx.calendar.CalendarEvent`. Bind these event types with
7043 EVT_DATE_CHANGED.
7044 """
0085ce49
RD
7045 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7046 __repr__ = _swig_repr
7047 def __init__(self, *args, **kwargs):
2131d850 7048 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
0085ce49 7049 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 7050 def GetDate(*args, **kwargs):
5ba5649b
RD
7051 """
7052 GetDate(self) -> DateTime
7053
7054 Returns the date.
7055 """
53aa7709
RD
7056 return _core_.DateEvent_GetDate(*args, **kwargs)
7057
7058 def SetDate(*args, **kwargs):
5ba5649b
RD
7059 """
7060 SetDate(self, DateTime date)
7061
7062 Sets the date carried by the event, normally only used by the library
7063 internally.
7064 """
53aa7709
RD
7065 return _core_.DateEvent_SetDate(*args, **kwargs)
7066
2bf58437 7067 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
2131d850 7068_core_.DateEvent_swigregister(DateEvent)
53aa7709
RD
7069
7070wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
7071EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
7072
4976f996
RD
7073class EventBlocker(EvtHandler):
7074 """Helper class to temporarily disable event handling for a window."""
7075 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7076 __repr__ = _swig_repr
7077 def __init__(self, *args, **kwargs):
7078 """
7079 __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker
7080
7081 Helper class to temporarily disable event handling for a window.
7082 """
7083 _core_.EventBlocker_swiginit(self,_core_.new_EventBlocker(*args, **kwargs))
7084 __swig_destroy__ = _core_.delete_EventBlocker
7085 __del__ = lambda self : None;
7086 def Block(*args, **kwargs):
7087 """Block(self, EventType type)"""
7088 return _core_.EventBlocker_Block(*args, **kwargs)
7089
7090_core_.EventBlocker_swigregister(EventBlocker)
7091
d14a1e28
RD
7092#---------------------------------------------------------------------------
7093
54f9ee45
RD
7094PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
7095PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
7096PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
7097PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
7098PRINT_WINDOWS = _core_.PRINT_WINDOWS
7099PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 7100class PyApp(EvtHandler):
66c033b4
RD
7101 """
7102 The ``wx.PyApp`` class is an *implementation detail*, please use the
7103 `wx.App` class (or some other derived class) instead.
7104 """
0085ce49
RD
7105 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7106 __repr__ = _swig_repr
7107 def __init__(self, *args, **kwargs):
98e665d3 7108 """
a95a7133 7109 __init__(self) -> PyApp
98e665d3
RD
7110
7111 Create a new application object, starting the bootstrap process.
7112 """
0085ce49 7113 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
c25f90f6 7114 self._setOORInfo(self, False);PyApp._setCallbackInfo(self, self, PyApp)
e811c8ce 7115
0085ce49
RD
7116 __swig_destroy__ = _core_.delete_PyApp
7117 __del__ = lambda self : None;
e811c8ce 7118 def _setCallbackInfo(*args, **kwargs):
c25f90f6 7119 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)"""
54f9ee45 7120 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
7121
7122 def GetAppName(*args, **kwargs):
0df68c9f 7123 """
a95a7133 7124 GetAppName(self) -> String
6c3b4aae 7125
0df68c9f
RD
7126 Get the application name.
7127 """
54f9ee45 7128 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
7129
7130 def SetAppName(*args, **kwargs):
0df68c9f 7131 """
a95a7133 7132 SetAppName(self, String name)
6c3b4aae 7133
66c033b4
RD
7134 Set the application name. This value may be used automatically by
7135 `wx.Config` and such.
0df68c9f 7136 """
54f9ee45 7137 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
7138
7139 def GetClassName(*args, **kwargs):
0df68c9f 7140 """
a95a7133 7141 GetClassName(self) -> String
e811c8ce 7142
0df68c9f
RD
7143 Get the application's class name.
7144 """
54f9ee45 7145 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
7146
7147 def SetClassName(*args, **kwargs):
0df68c9f 7148 """
a95a7133 7149 SetClassName(self, String name)
6c3b4aae 7150
66c033b4
RD
7151 Set the application's class name. This value may be used for
7152 X-resources if applicable for the platform
0df68c9f 7153 """
54f9ee45 7154 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
7155
7156 def GetVendorName(*args, **kwargs):
0df68c9f 7157 """
a95a7133 7158 GetVendorName(self) -> String
6c3b4aae 7159
0df68c9f
RD
7160 Get the application's vendor name.
7161 """
54f9ee45 7162 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
7163
7164 def SetVendorName(*args, **kwargs):
0df68c9f 7165 """
a95a7133 7166 SetVendorName(self, String name)
6c3b4aae 7167
66c033b4
RD
7168 Set the application's vendor name. This value may be used
7169 automatically by `wx.Config` and such.
0df68c9f 7170 """
54f9ee45 7171 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
7172
7173 def GetTraits(*args, **kwargs):
0df68c9f 7174 """
a95a7133 7175 GetTraits(self) -> wxAppTraits
6c3b4aae 7176
66c033b4
RD
7177 Return (and create if necessary) the app traits object to which we
7178 delegate for everything which either should be configurable by the
7179 user (then he can change the default behaviour simply by overriding
7180 CreateTraits() and returning his own traits object) or which is
7181 GUI/console dependent as then wx.AppTraits allows us to abstract the
7182 differences behind the common facade.
7183
7184 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 7185 """
54f9ee45 7186 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
7187
7188 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 7189 """
a95a7133 7190 ProcessPendingEvents(self)
6c3b4aae 7191
66c033b4
RD
7192 Process all events in the Pending Events list -- it is necessary to
7193 call this function to process posted events. This normally happens
7194 during each event loop iteration.
0df68c9f 7195 """
54f9ee45 7196 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
7197
7198 def Yield(*args, **kwargs):
0df68c9f 7199 """
a95a7133 7200 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 7201
66c033b4
RD
7202 Process all currently pending events right now, instead of waiting
7203 until return to the event loop. It is an error to call ``Yield``
7204 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 7205
66c033b4 7206 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
7207 reentrancies (i.e. when called from an event handler it may
7208 result in calling the same event handler again), use with
7209 extreme care or, better, don't use at all!
0df68c9f 7210
66c033b4 7211 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 7212
0df68c9f 7213 """
54f9ee45 7214 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
7215
7216 def WakeUpIdle(*args, **kwargs):
0df68c9f 7217 """
a95a7133 7218 WakeUpIdle(self)
6c3b4aae 7219
66c033b4
RD
7220 Make sure that idle events are sent again.
7221 :see: `wx.WakeUpIdle`
0df68c9f 7222 """
54f9ee45 7223 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 7224
1fc3b23a
RD
7225 def IsMainLoopRunning(*args, **kwargs):
7226 """
7227 IsMainLoopRunning() -> bool
7228
7229 Returns True if we're running the main loop, i.e. if the events can
7230 currently be dispatched.
7231 """
7232 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7233
7234 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 7235 def MainLoop(*args, **kwargs):
0df68c9f 7236 """
a95a7133 7237 MainLoop(self) -> int
6c3b4aae 7238
66c033b4
RD
7239 Execute the main GUI loop, the function doesn't normally return until
7240 all top level windows have been closed and destroyed.
0df68c9f 7241 """
54f9ee45 7242 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
7243
7244 def Exit(*args, **kwargs):
0df68c9f 7245 """
a95a7133 7246 Exit(self)
6c3b4aae 7247
0df68c9f 7248 Exit the main loop thus terminating the application.
66c033b4 7249 :see: `wx.Exit`
0df68c9f 7250 """
54f9ee45 7251 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce 7252
97ab0f6a
RD
7253 def GetLayoutDirection(*args, **kwargs):
7254 """
994453b8 7255 GetLayoutDirection(self) -> int
97ab0f6a
RD
7256
7257 Return the layout direction for the current locale.
7258 """
7259 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
7260
e811c8ce 7261 def ExitMainLoop(*args, **kwargs):
0df68c9f 7262 """
a95a7133 7263 ExitMainLoop(self)
6c3b4aae 7264
66c033b4
RD
7265 Exit the main GUI loop during the next iteration of the main
7266 loop, (i.e. it does not stop the program immediately!)
0df68c9f 7267 """
54f9ee45 7268 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
7269
7270 def Pending(*args, **kwargs):
0df68c9f 7271 """
a95a7133 7272 Pending(self) -> bool
6c3b4aae 7273
0df68c9f
RD
7274 Returns True if there are unprocessed events in the event queue.
7275 """
54f9ee45 7276 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
7277
7278 def Dispatch(*args, **kwargs):
0df68c9f 7279 """
a95a7133 7280 Dispatch(self) -> bool
6c3b4aae 7281
0df68c9f
RD
7282 Process the first event in the event queue (blocks until an event
7283 appears if there are none currently)
7284 """
54f9ee45 7285 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
7286
7287 def ProcessIdle(*args, **kwargs):
0df68c9f 7288 """
a95a7133 7289 ProcessIdle(self) -> bool
6c3b4aae 7290
66c033b4
RD
7291 Called from the MainLoop when the application becomes idle (there are
7292 no pending events) and sends a `wx.IdleEvent` to all interested
7293 parties. Returns True if more idle events are needed, False if not.
0df68c9f 7294 """
54f9ee45 7295 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
7296
7297 def SendIdleEvents(*args, **kwargs):
0df68c9f 7298 """
a95a7133 7299 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 7300
66c033b4
RD
7301 Send idle event to window and all subwindows. Returns True if more
7302 idle time is requested.
0df68c9f 7303 """
54f9ee45 7304 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
7305
7306 def IsActive(*args, **kwargs):
0df68c9f 7307 """
a95a7133 7308 IsActive(self) -> bool
6c3b4aae 7309
0df68c9f
RD
7310 Return True if our app has focus.
7311 """
54f9ee45 7312 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
7313
7314 def SetTopWindow(*args, **kwargs):
0df68c9f 7315 """
a95a7133 7316 SetTopWindow(self, Window win)
6c3b4aae 7317
66c033b4 7318 Set the *main* top level window
0df68c9f 7319 """
54f9ee45 7320 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
7321
7322 def GetTopWindow(*args, **kwargs):
0df68c9f 7323 """
a95a7133 7324 GetTopWindow(self) -> Window
6c3b4aae 7325
66c033b4
RD
7326 Return the *main* top level window (if it hadn't been set previously
7327 with SetTopWindow(), will return just some top level window and, if
7328 there not any, will return None)
0df68c9f 7329 """
54f9ee45 7330 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
7331
7332 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 7333 """
a95a7133 7334 SetExitOnFrameDelete(self, bool flag)
0df68c9f 7335
66c033b4
RD
7336 Control the exit behaviour: by default, the program will exit the main
7337 loop (and so, usually, terminate) when the last top-level program
7338 window is deleted. Beware that if you disable this behaviour (with
7339 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7340 explicitly from somewhere.
0df68c9f 7341 """
54f9ee45 7342 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
7343
7344 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 7345 """
a95a7133 7346 GetExitOnFrameDelete(self) -> bool
6c3b4aae 7347
0df68c9f
RD
7348 Get the current exit behaviour setting.
7349 """
54f9ee45 7350 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
7351
7352 def SetUseBestVisual(*args, **kwargs):
0df68c9f 7353 """
eccab1a7 7354 SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
6c3b4aae 7355
66c033b4
RD
7356 Set whether the app should try to use the best available visual on
7357 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 7358 """
54f9ee45 7359 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
7360
7361 def GetUseBestVisual(*args, **kwargs):
0df68c9f 7362 """
a95a7133 7363 GetUseBestVisual(self) -> bool
6c3b4aae 7364
0df68c9f
RD
7365 Get current UseBestVisual setting.
7366 """
54f9ee45 7367 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
7368
7369 def SetPrintMode(*args, **kwargs):
a95a7133 7370 """SetPrintMode(self, int mode)"""
54f9ee45 7371 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
7372
7373 def GetPrintMode(*args, **kwargs):
a95a7133 7374 """GetPrintMode(self) -> int"""
54f9ee45 7375 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 7376
e811c8ce 7377 def SetAssertMode(*args, **kwargs):
0df68c9f 7378 """
a95a7133 7379 SetAssertMode(self, int mode)
6c3b4aae 7380
41e2b43e 7381 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 7382 """
54f9ee45 7383 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 7384
6c3b4aae 7385 def GetAssertMode(*args, **kwargs):
0df68c9f 7386 """
a95a7133 7387 GetAssertMode(self) -> int
6c3b4aae 7388
0df68c9f
RD
7389 Get the current OnAssert behaviour setting.
7390 """
54f9ee45 7391 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 7392
e811c8ce 7393 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 7394 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 7395 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
7396
7397 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7398 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 7399 """GetMacAboutMenuItemId() -> long"""
54f9ee45 7400 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
7401
7402 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7403 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 7404 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 7405 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
7406
7407 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7408 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 7409 """GetMacExitMenuItemId() -> long"""
54f9ee45 7410 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
7411
7412 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7413 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 7414 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 7415 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
7416
7417 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7418 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 7419 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 7420 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
7421
7422 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7423 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 7424 """SetMacAboutMenuItemId(long val)"""
54f9ee45 7425 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
7426
7427 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7428 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 7429 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 7430 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
7431
7432 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7433 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 7434 """SetMacExitMenuItemId(long val)"""
54f9ee45 7435 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
7436
7437 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7438 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 7439 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 7440 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
7441
7442 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7443 def _BootstrapApp(*args, **kwargs):
0df68c9f 7444 """
a95a7133 7445 _BootstrapApp(self)
6c3b4aae 7446
0df68c9f
RD
7447 For internal use only
7448 """
54f9ee45 7449 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
7450
7451 def GetComCtl32Version(*args, **kwargs):
0df68c9f 7452 """
66c033b4 7453 GetComCtl32Version() -> int
6c3b4aae 7454
66c033b4
RD
7455 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7456 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7457 """
54f9ee45 7458 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
7459
7460 GetComCtl32Version = staticmethod(GetComCtl32Version)
33d6fd3b 7461 def IsDisplayAvailable(*args, **kwargs):
fc46b7f3 7462 """
33d6fd3b 7463 IsDisplayAvailable() -> bool
fc46b7f3
RD
7464
7465 Tests if it is possible to create a GUI in the current environment.
7466 This will mean different things on the different platforms.
7467
7468 * On X Windows systems this function will return ``False`` if it is
7469 not able to open a connection to the X display, which can happen
7470 if $DISPLAY is not set, or is not set correctly.
7471
7472 * On Mac OS X a ``False`` return value will mean that wx is not
7473 able to access the window manager, which can happen if logged in
7474 remotely or if running from the normal version of python instead
7475 of the framework version, (i.e., pythonw.)
7476
7477 * On MS Windows...
7478
7479 """
33d6fd3b
RD
7480 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7481
7482 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7483 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7484 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7485 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7486 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7487 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7488 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7489 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7490 Traits = property(GetTraits,doc="See `GetTraits`")
7491 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7492 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7493 Active = property(IsActive)
2131d850 7494_core_.PyApp_swigregister(PyApp)
d14a1e28 7495
0085ce49
RD
7496def PyApp_IsMainLoopRunning(*args):
7497 """
1fc3b23a
RD
7498 PyApp_IsMainLoopRunning() -> bool
7499
7500 Returns True if we're running the main loop, i.e. if the events can
7501 currently be dispatched.
7502 """
0085ce49 7503 return _core_.PyApp_IsMainLoopRunning(*args)
1fc3b23a 7504
0085ce49
RD
7505def PyApp_GetMacSupportPCMenuShortcuts(*args):
7506 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7507 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d14a1e28 7508
0085ce49
RD
7509def PyApp_GetMacAboutMenuItemId(*args):
7510 """PyApp_GetMacAboutMenuItemId() -> long"""
7511 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d14a1e28 7512
0085ce49
RD
7513def PyApp_GetMacPreferencesMenuItemId(*args):
7514 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7515 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d14a1e28 7516
0085ce49
RD
7517def PyApp_GetMacExitMenuItemId(*args):
7518 """PyApp_GetMacExitMenuItemId() -> long"""
7519 return _core_.PyApp_GetMacExitMenuItemId(*args)
d14a1e28 7520
0085ce49
RD
7521def PyApp_GetMacHelpMenuTitleName(*args):
7522 """PyApp_GetMacHelpMenuTitleName() -> String"""
7523 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d14a1e28 7524
e811c8ce 7525def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
0085ce49
RD
7526 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7527 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 7528
e811c8ce 7529def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
0085ce49
RD
7530 """PyApp_SetMacAboutMenuItemId(long val)"""
7531 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 7532
e811c8ce 7533def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
0085ce49
RD
7534 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7535 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 7536
e811c8ce 7537def PyApp_SetMacExitMenuItemId(*args, **kwargs):
0085ce49
RD
7538 """PyApp_SetMacExitMenuItemId(long val)"""
7539 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 7540
e811c8ce 7541def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
0085ce49
RD
7542 """PyApp_SetMacHelpMenuTitleName(String val)"""
7543 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 7544
0085ce49
RD
7545def PyApp_GetComCtl32Version(*args):
7546 """
0df68c9f 7547 PyApp_GetComCtl32Version() -> int
6c3b4aae 7548
66c033b4
RD
7549 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7550 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7551 """
0085ce49 7552 return _core_.PyApp_GetComCtl32Version(*args)
d14a1e28 7553
33d6fd3b 7554def PyApp_IsDisplayAvailable(*args):
fc46b7f3 7555 """
33d6fd3b 7556 PyApp_IsDisplayAvailable() -> bool
fc46b7f3
RD
7557
7558 Tests if it is possible to create a GUI in the current environment.
7559 This will mean different things on the different platforms.
7560
7561 * On X Windows systems this function will return ``False`` if it is
7562 not able to open a connection to the X display, which can happen
7563 if $DISPLAY is not set, or is not set correctly.
7564
7565 * On Mac OS X a ``False`` return value will mean that wx is not
7566 able to access the window manager, which can happen if logged in
7567 remotely or if running from the normal version of python instead
7568 of the framework version, (i.e., pythonw.)
7569
7570 * On MS Windows...
7571
7572 """
33d6fd3b 7573 return _core_.PyApp_IsDisplayAvailable(*args)
fc46b7f3 7574
d14a1e28
RD
7575#---------------------------------------------------------------------------
7576
7577
0085ce49
RD
7578def Exit(*args):
7579 """
0df68c9f 7580 Exit()
6c3b4aae 7581
0df68c9f
RD
7582 Force an exit of the application. Convenience for wx.GetApp().Exit()
7583 """
0085ce49 7584 return _core_.Exit(*args)
d14a1e28 7585
0085ce49
RD
7586def Yield(*args):
7587 """
0df68c9f 7588 Yield() -> bool
6c3b4aae 7589
0df68c9f
RD
7590 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7591 """
0085ce49 7592 return _core_.Yield(*args)
d14a1e28 7593
0085ce49
RD
7594def YieldIfNeeded(*args):
7595 """
0df68c9f 7596 YieldIfNeeded() -> bool
6c3b4aae 7597
0df68c9f
RD
7598 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7599 """
0085ce49 7600 return _core_.YieldIfNeeded(*args)
d14a1e28 7601
e811c8ce 7602def SafeYield(*args, **kwargs):
0085ce49 7603 """
0df68c9f 7604 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 7605
66c033b4
RD
7606 This function is similar to `wx.Yield`, except that it disables the
7607 user input to all program windows before calling `wx.Yield` and
7608 re-enables it again afterwards. If ``win`` is not None, this window
7609 will remain enabled, allowing the implementation of some limited user
7610 interaction.
6c3b4aae 7611
66c033b4 7612 :Returns: the result of the call to `wx.Yield`.
0df68c9f 7613 """
0085ce49 7614 return _core_.SafeYield(*args, **kwargs)
d14a1e28 7615
0085ce49
RD
7616def WakeUpIdle(*args):
7617 """
0df68c9f 7618 WakeUpIdle()
6c3b4aae 7619
66c033b4
RD
7620 Cause the message queue to become empty again, so idle events will be
7621 sent.
0df68c9f 7622 """
0085ce49 7623 return _core_.WakeUpIdle(*args)
d14a1e28 7624
e811c8ce 7625def PostEvent(*args, **kwargs):
0085ce49 7626 """
0df68c9f 7627 PostEvent(EvtHandler dest, Event event)
6c3b4aae 7628
66c033b4
RD
7629 Send an event to a window or other wx.EvtHandler to be processed
7630 later.
0df68c9f 7631 """
0085ce49 7632 return _core_.PostEvent(*args, **kwargs)
d14a1e28 7633
0085ce49
RD
7634def App_CleanUp(*args):
7635 """
0df68c9f 7636 App_CleanUp()
6c3b4aae 7637
41e2b43e 7638 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 7639 Python shuts down.
0df68c9f 7640 """
0085ce49 7641 return _core_.App_CleanUp(*args)
d14a1e28 7642
0085ce49
RD
7643def GetApp(*args):
7644 """
0df68c9f 7645 GetApp() -> PyApp
6c3b4aae 7646
196addbf 7647 Return a reference to the current wx.App object.
0df68c9f 7648 """
0085ce49 7649 return _core_.GetApp(*args)
5cbf236d
RD
7650
7651def SetDefaultPyEncoding(*args, **kwargs):
0085ce49 7652 """
5cbf236d
RD
7653 SetDefaultPyEncoding(string encoding)
7654
7655 Sets the encoding that wxPython will use when it needs to convert a
7656 Python string or unicode object to or from a wxString.
e505d15e
RD
7657
7658 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7659 but please be aware that the default encoding within the same locale
7660 may be slightly different on different platforms. For example, please
7661 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7662 between the common latin/roman encodings.
5cbf236d 7663 """
0085ce49 7664 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7665
0085ce49
RD
7666def GetDefaultPyEncoding(*args):
7667 """
5cbf236d
RD
7668 GetDefaultPyEncoding() -> string
7669
7670 Gets the current encoding that wxPython will use when it needs to
7671 convert a Python string or unicode object to or from a wxString.
7672 """
0085ce49 7673 return _core_.GetDefaultPyEncoding(*args)
d14a1e28
RD
7674#----------------------------------------------------------------------
7675
7676class PyOnDemandOutputWindow:
6c3b4aae
RD
7677 """
7678 A class that can be used for redirecting Python's stdout and
7679 stderr streams. It will do nothing until something is wrriten to
7680 the stream at which point it will create a Frame with a text area
7681 and write the text there.
7682 """
d14a1e28
RD
7683 def __init__(self, title = "wxPython: stdout/stderr"):
7684 self.frame = None
7685 self.title = title
412d302d
RD
7686 self.pos = wx.DefaultPosition
7687 self.size = (450, 300)
d14a1e28
RD
7688 self.parent = None
7689
7690 def SetParent(self, parent):
6c3b4aae 7691 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
7692 self.parent = parent
7693
6c3b4aae
RD
7694
7695 def CreateOutputWindow(self, st):
412d302d
RD
7696 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7697 style=wx.DEFAULT_FRAME_STYLE)
196addbf 7698 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7699 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 7700 self.text.AppendText(st)
6c3b4aae 7701 self.frame.Show(True)
2131d850 7702 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
6c3b4aae 7703
d14a1e28 7704
7409c0c6
RD
7705 def OnCloseWindow(self, event):
7706 if self.frame is not None:
7707 self.frame.Destroy()
7708 self.frame = None
7709 self.text = None
7710
7711
d14a1e28 7712 # These methods provide the file-like output behaviour.
6c3b4aae
RD
7713 def write(self, text):
7714 """
7715 Create the output window if needed and write the string to it.
7716 If not called in the context of the gui thread then uses
7717 CallAfter to do the work there.
7718 """
7719 if self.frame is None:
7720 if not wx.Thread_IsMain():
7721 wx.CallAfter(self.CreateOutputWindow, text)
7722 else:
7723 self.CreateOutputWindow(text)
7724 else:
7725 if not wx.Thread_IsMain():
7726 wx.CallAfter(self.text.AppendText, text)
7727 else:
7728 self.text.AppendText(text)
7729
d14a1e28
RD
7730
7731 def close(self):
6c3b4aae
RD
7732 if self.frame is not None:
7733 wx.CallAfter(self.frame.Close)
7734
d14a1e28 7735
19272049
RD
7736 def flush(self):
7737 pass
7738
7739
d14a1e28
RD
7740
7741#----------------------------------------------------------------------
d14a1e28
RD
7742
7743_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
fc46b7f3 7744
d14a1e28 7745class App(wx.PyApp):
6c3b4aae 7746 """
66c033b4
RD
7747 The ``wx.App`` class represents the application and is used to:
7748
7749 * bootstrap the wxPython system and initialize the underlying
7750 gui toolkit
7751 * set and get application-wide properties
7752 * implement the windowing system main message or event loop,
7753 and to dispatch events to window instances
7754 * etc.
7755
7756 Every application must have a ``wx.App`` instance, and all
7757 creation of UI objects should be delayed until after the
03e37cd5
RD
7758 ``wx.App`` object has been created in order to ensure that the gui
7759 platform and wxWidgets have been fully initialized.
66c033b4
RD
7760
7761 Normally you would derive from this class and implement an
7762 ``OnInit`` method that creates a frame and then calls
7763 ``self.SetTopWindow(frame)``.
7764
03e37cd5 7765 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 7766 directly.
6c3b4aae 7767 """
66c033b4 7768
d14a1e28
RD
7769 outputWindowClass = PyOnDemandOutputWindow
7770
03e37cd5
RD
7771 def __init__(self, redirect=_defRedirect, filename=None,
7772 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7773 """
7774 Construct a ``wx.App`` object.
7775
03e37cd5
RD
7776 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7777 redirected? Defaults to True on Windows and Mac, False
7778 otherwise. If `filename` is None then output will be
7779 redirected to a window that pops up as needed. (You can
7780 control what kind of window is created for the output by
7781 resetting the class variable ``outputWindowClass`` to a
7782 class of your choosing.)
66c033b4 7783
03e37cd5
RD
7784 :param filename: The name of a file to redirect output to, if
7785 redirect is True.
66c033b4
RD
7786
7787 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
7788 available visual provided by the system (only relevant on
7789 systems that have more than one visual.) This parameter
7790 must be used instead of calling `SetUseBestVisual` later
7791 on because it must be set before the underlying GUI
7792 toolkit is initialized.
7793
7794 :param clearSigInt: Should SIGINT be cleared? This allows the
7795 app to terminate upon a Ctrl-C in the console like other
7796 GUI apps will.
66c033b4
RD
7797
7798 :note: You should override OnInit to do applicaition
7799 initialization to ensure that the system, toolkit and
7800 wxWidgets are fully initialized.
7801 """
fc46b7f3 7802
d14a1e28
RD
7803 wx.PyApp.__init__(self)
7804
fc46b7f3 7805 # make sure we can create a GUI
33d6fd3b 7806 if not self.IsDisplayAvailable():
fc46b7f3
RD
7807
7808 if wx.Platform == "__WXMAC__":
7809 msg = """This program needs access to the screen.
7810Please run with 'pythonw', not 'python', and only when you are logged
7811in on the main display of your Mac."""
7812
7813 elif wx.Platform == "__WXGTK__":
7814 msg ="Unable to access the X Display, is $DISPLAY set properly?"
d14a1e28 7815
fc46b7f3
RD
7816 else:
7817 msg = "Unable to create GUI"
7818 # TODO: more description is needed for wxMSW...
7819
7820 raise SystemExit(msg)
7821
d14a1e28
RD
7822 # This has to be done before OnInit
7823 self.SetUseBestVisual(useBestVisual)
7824
7825 # Set the default handler for SIGINT. This fixes a problem
7826 # where if Ctrl-C is pressed in the console that started this
7827 # app then it will not appear to do anything, (not even send
7828 # KeyboardInterrupt???) but will later segfault on exit. By
7829 # setting the default handler then the app will exit, as
7830 # expected (depending on platform.)
03e37cd5
RD
7831 if clearSigInt:
7832 try:
7833 import signal
7834 signal.signal(signal.SIGINT, signal.SIG_DFL)
7835 except:
7836 pass
d14a1e28
RD
7837
7838 # Save and redirect the stdio to a window?
7839 self.stdioWin = None
7840 self.saveStdio = (_sys.stdout, _sys.stderr)
7841 if redirect:
7842 self.RedirectStdio(filename)
7843
8fb0e70a
RD
7844 # Use Python's install prefix as the default
7845 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7846
48a0c021
RD
7847 # Until the new native control for wxMac is up to par, still use the generic one.
7848 wx.SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 1)
7849
d14a1e28
RD
7850 # This finishes the initialization of wxWindows and then calls
7851 # the OnInit that should be present in the derived class
7852 self._BootstrapApp()
7853
7854
01f6b6d3
RD
7855 def OnPreInit(self):
7856 """
7857 Things that must be done after _BootstrapApp has done its
7858 thing, but would be nice if they were already done by the time
7859 that OnInit is called.
7860 """
7861 wx.StockGDI._initStockObjects()
7862
7863
02b455f2
RD
7864 def __del__(self, destroy=wx.PyApp.__del__):
7865 self.RestoreStdio() # Just in case the MainLoop was overridden
7866 destroy(self)
d14a1e28 7867
70b7a5fe 7868 def Destroy(self):
b39fe951 7869 self.this.own(False)
70b7a5fe 7870 wx.PyApp.Destroy(self)
d14a1e28
RD
7871
7872 def SetTopWindow(self, frame):
1e0c8722 7873 """Set the \"main\" top level window"""
d14a1e28
RD
7874 if self.stdioWin:
7875 self.stdioWin.SetParent(frame)
7876 wx.PyApp.SetTopWindow(self, frame)
7877
7878
7879 def MainLoop(self):
1e0c8722 7880 """Execute the main GUI event loop"""
d14a1e28
RD
7881 wx.PyApp.MainLoop(self)
7882 self.RestoreStdio()
7883
7884
7409c0c6 7885 def RedirectStdio(self, filename=None):
1e0c8722 7886 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
7887 if filename:
7888 _sys.stdout = _sys.stderr = open(filename, 'a')
7889 else:
7890 self.stdioWin = self.outputWindowClass()
7891 _sys.stdout = _sys.stderr = self.stdioWin
7892
7893
7894 def RestoreStdio(self):
02b455f2
RD
7895 try:
7896 _sys.stdout, _sys.stderr = self.saveStdio
7897 except:
7898 pass
d14a1e28
RD
7899
7900
412d302d
RD
7901 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7902 """
7903 Set the title, position and/or size of the output window if
f5b96ee1
RD
7904 the stdio has been redirected. This should be called before
7905 any output would cause the output window to be created.
412d302d
RD
7906 """
7907 if self.stdioWin:
7908 if title is not None:
7909 self.stdioWin.title = title
7910 if pos is not None:
7911 self.stdioWin.pos = pos
7912 if size is not None:
7913 self.stdioWin.size = size
7914
7915
7916
d14a1e28 7917
66c033b4 7918# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
7919App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7920App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7921App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7922App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7923App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7924App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7925App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7926App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7927App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7928App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7929App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
7930
7931#----------------------------------------------------------------------------
7932
7933class PySimpleApp(wx.App):
6c3b4aae
RD
7934 """
7935 A simple application class. You can just create one of these and
7936 then then make your top level windows later, and not have to worry
66c033b4
RD
7937 about OnInit. For example::
7938
7939 app = wx.PySimpleApp()
7940 frame = wx.Frame(None, title='Hello World')
7941 frame.Show()
7942 app.MainLoop()
7943
7944 :see: `wx.App`
7945 """
6c3b4aae 7946
03e37cd5
RD
7947 def __init__(self, redirect=False, filename=None,
7948 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7949 """
7950 :see: `wx.App.__init__`
7951 """
03e37cd5 7952 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 7953
d14a1e28 7954 def OnInit(self):
d14a1e28
RD
7955 return True
7956
7957
66c033b4 7958
6c3b4aae 7959# Is anybody using this one?
d14a1e28
RD
7960class PyWidgetTester(wx.App):
7961 def __init__(self, size = (250, 100)):
7962 self.size = size
7963 wx.App.__init__(self, 0)
7964
7965 def OnInit(self):
196addbf 7966 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
7967 self.SetTopWindow(self.frame)
7968 return True
7969
66c033b4
RD
7970 def SetWidget(self, widgetClass, *args, **kwargs):
7971 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
7972 self.frame.Show(True)
7973
7974#----------------------------------------------------------------------------
7975# DO NOT hold any other references to this object. This is how we
66c033b4 7976# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 7977# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 7978# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
7979
7980class __wxPyCleanup:
7981 def __init__(self):
54f9ee45 7982 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
7983 def __del__(self):
7984 self.cleanup()
7985
7986_sys.__wxPythonCleanup = __wxPyCleanup()
7987
7988## # another possible solution, but it gets called too early...
66c033b4
RD
7989## import atexit
7990## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
7991
7992
7993#----------------------------------------------------------------------------
7994
7995#---------------------------------------------------------------------------
2ef75293
RD
7996
7997class EventLoop(object):
093d3ff1 7998 """Proxy of C++ EventLoop class"""
0085ce49
RD
7999 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8000 __repr__ = _swig_repr
8001 def __init__(self, *args, **kwargs):
2ef75293 8002 """__init__(self) -> EventLoop"""
0085ce49
RD
8003 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
8004 __swig_destroy__ = _core_.delete_EventLoop
8005 __del__ = lambda self : None;
2ef75293
RD
8006 def Run(*args, **kwargs):
8007 """Run(self) -> int"""
8008 return _core_.EventLoop_Run(*args, **kwargs)
8009
8010 def Exit(*args, **kwargs):
8011 """Exit(self, int rc=0)"""
8012 return _core_.EventLoop_Exit(*args, **kwargs)
8013
8014 def Pending(*args, **kwargs):
8015 """Pending(self) -> bool"""
8016 return _core_.EventLoop_Pending(*args, **kwargs)
8017
8018 def Dispatch(*args, **kwargs):
8019 """Dispatch(self) -> bool"""
8020 return _core_.EventLoop_Dispatch(*args, **kwargs)
8021
8022 def IsRunning(*args, **kwargs):
8023 """IsRunning(self) -> bool"""
8024 return _core_.EventLoop_IsRunning(*args, **kwargs)
8025
8026 def GetActive(*args, **kwargs):
8027 """GetActive() -> EventLoop"""
8028 return _core_.EventLoop_GetActive(*args, **kwargs)
8029
8030 GetActive = staticmethod(GetActive)
8031 def SetActive(*args, **kwargs):
8032 """SetActive(EventLoop loop)"""
8033 return _core_.EventLoop_SetActive(*args, **kwargs)
8034
8035 SetActive = staticmethod(SetActive)
2131d850 8036_core_.EventLoop_swigregister(EventLoop)
2ef75293 8037
0085ce49
RD
8038def EventLoop_GetActive(*args):
8039 """EventLoop_GetActive() -> EventLoop"""
8040 return _core_.EventLoop_GetActive(*args)
2ef75293
RD
8041
8042def EventLoop_SetActive(*args, **kwargs):
0085ce49
RD
8043 """EventLoop_SetActive(EventLoop loop)"""
8044 return _core_.EventLoop_SetActive(*args, **kwargs)
2ef75293 8045
091f5bed
RD
8046class EventLoopActivator(object):
8047 """Proxy of C++ EventLoopActivator class"""
0085ce49
RD
8048 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8049 __repr__ = _swig_repr
8050 def __init__(self, *args, **kwargs):
091f5bed 8051 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
0085ce49
RD
8052 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
8053 __swig_destroy__ = _core_.delete_EventLoopActivator
8054 __del__ = lambda self : None;
2131d850 8055_core_.EventLoopActivator_swigregister(EventLoopActivator)
091f5bed 8056
2ef75293 8057#---------------------------------------------------------------------------
d14a1e28 8058
eec1c382
RD
8059ACCEL_ALT = _core_.ACCEL_ALT
8060ACCEL_CTRL = _core_.ACCEL_CTRL
8061ACCEL_SHIFT = _core_.ACCEL_SHIFT
8062ACCEL_NORMAL = _core_.ACCEL_NORMAL
8063ACCEL_CMD = _core_.ACCEL_CMD
1e0c8722 8064class AcceleratorEntry(object):
66c033b4
RD
8065 """
8066 A class used to define items in an `wx.AcceleratorTable`. wxPython
8067 programs can choose to use wx.AcceleratorEntry objects, but using a
8068 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 8069 as well. See `__init__` for of the tuple values.
66c033b4
RD
8070
8071 :see: `wx.AcceleratorTable`
8072 """
0085ce49
RD
8073 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8074 __repr__ = _swig_repr
8075 def __init__(self, *args, **kwargs):
66c033b4
RD
8076 """
8077 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
8078
8079 Construct a wx.AcceleratorEntry.
66c033b4 8080 """
0085ce49
RD
8081 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
8082 __swig_destroy__ = _core_.delete_AcceleratorEntry
8083 __del__ = lambda self : None;
1e0c8722 8084 def Set(*args, **kwargs):
66c033b4
RD
8085 """
8086 Set(self, int flags, int keyCode, int cmd)
1e0c8722 8087
66c033b4
RD
8088 (Re)set the attributes of a wx.AcceleratorEntry.
8089 :see `__init__`
8090 """
8091 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722 8092
97ab0f6a
RD
8093 def Create(*args, **kwargs):
8094 """
8095 Create(String str) -> AcceleratorEntry
8096
8097 Create accelerator corresponding to the specified string, or None if
8098 it coulnd't be parsed.
8099 """
8100 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8101
8102 Create = staticmethod(Create)
1e0c8722 8103 def GetFlags(*args, **kwargs):
66c033b4
RD
8104 """
8105 GetFlags(self) -> int
8106
8107 Get the AcceleratorEntry's flags.
8108 """
54f9ee45 8109 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
8110
8111 def GetKeyCode(*args, **kwargs):
66c033b4
RD
8112 """
8113 GetKeyCode(self) -> int
8114
8115 Get the AcceleratorEntry's keycode.
8116 """
54f9ee45 8117 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
8118
8119 def GetCommand(*args, **kwargs):
66c033b4
RD
8120 """
8121 GetCommand(self) -> int
8122
8123 Get the AcceleratorEntry's command ID.
8124 """
54f9ee45 8125 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722 8126
97ab0f6a
RD
8127 def IsOk(*args, **kwargs):
8128 """IsOk(self) -> bool"""
8129 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
8130
8131 def ToString(*args, **kwargs):
8132 """
8133 ToString(self) -> String
8134
8135 Returns a string representation for the this accelerator. The string
8136 is formatted using the <flags>-<keycode> format where <flags> maybe a
8137 hyphen-separed list of "shift|alt|ctrl"
8138
8139 """
8140 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
8141
8142 def FromString(*args, **kwargs):
8143 """
8144 FromString(self, String str) -> bool
8145
8146 Returns true if the given string correctly initialized this object.
8147 """
8148 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
8149
2bf58437
RD
8150 Command = property(GetCommand,doc="See `GetCommand`")
8151 Flags = property(GetFlags,doc="See `GetFlags`")
8152 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
2131d850 8153_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
1e0c8722 8154
97ab0f6a
RD
8155def AcceleratorEntry_Create(*args, **kwargs):
8156 """
8157 AcceleratorEntry_Create(String str) -> AcceleratorEntry
8158
8159 Create accelerator corresponding to the specified string, or None if
8160 it coulnd't be parsed.
8161 """
8162 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8163
1e0c8722 8164class AcceleratorTable(Object):
66c033b4
RD
8165 """
8166 An accelerator table allows the application to specify a table of
8167 keyboard shortcuts for menus or other commands. On Windows, menu or
8168 button commands are supported; on GTK, only menu commands are
8169 supported.
66c033b4 8170 """
0085ce49
RD
8171 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8172 __repr__ = _swig_repr
8173 def __init__(self, *args, **kwargs):
0df68c9f
RD
8174 """
8175 __init__(entries) -> AcceleratorTable
1e0c8722 8176
66c033b4
RD
8177 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8178 items or or of 3-tuples (flags, keyCode, cmdID)
8179
8180 :see: `wx.AcceleratorEntry`
0df68c9f 8181 """
0085ce49
RD
8182 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
8183 __swig_destroy__ = _core_.delete_AcceleratorTable
8184 __del__ = lambda self : None;
b39fe951
RD
8185 def IsOk(*args, **kwargs):
8186 """IsOk(self) -> bool"""
8187 return _core_.AcceleratorTable_IsOk(*args, **kwargs)
1e0c8722 8188
b39fe951 8189 Ok = IsOk
2131d850 8190_core_.AcceleratorTable_swigregister(AcceleratorTable)
1e0c8722 8191
cbfc9df6
RD
8192def GetAccelFromString(label):
8193 entry = AcceleratorEntry()
8194 entry.FromString(label)
8195 return entry
1e0c8722 8196
1e0c8722
RD
8197#---------------------------------------------------------------------------
8198
74a57fcd
RD
8199class VisualAttributes(object):
8200 """struct containing all the visual attributes of a control"""
0085ce49
RD
8201 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8202 __repr__ = _swig_repr
8203 def __init__(self, *args, **kwargs):
74a57fcd 8204 """
a95a7133 8205 __init__(self) -> VisualAttributes
74a57fcd
RD
8206
8207 struct containing all the visual attributes of a control
8208 """
0085ce49
RD
8209 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
8210 __swig_destroy__ = _core_.delete_VisualAttributes
8211 __del__ = lambda self : None;
8c3a7183
RD
8212 def _get_font(*args, **kwargs):
8213 """_get_font(self) -> Font"""
8214 return _core_.VisualAttributes__get_font(*args, **kwargs)
8215
8216 def _get_colFg(*args, **kwargs):
8217 """_get_colFg(self) -> Colour"""
8218 return _core_.VisualAttributes__get_colFg(*args, **kwargs)
8219
8220 def _get_colBg(*args, **kwargs):
8221 """_get_colBg(self) -> Colour"""
8222 return _core_.VisualAttributes__get_colBg(*args, **kwargs)
8223
8224 font = property(_get_font)
8225 colFg = property(_get_colFg)
8226 colBg = property(_get_colBg)
2131d850 8227_core_.VisualAttributes_swigregister(VisualAttributes)
74a57fcd
RD
8228NullAcceleratorTable = cvar.NullAcceleratorTable
8229PanelNameStr = cvar.PanelNameStr
8230
54f9ee45
RD
8231WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8232WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8233WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8234WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8235WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 8236class Window(EvtHandler):
15afbcd0
RD
8237 """
8238 wx.Window is the base class for all windows and represents any visible
8239 object on the screen. All controls, top level windows and so on are
8240 wx.Windows. Sizers and device contexts are not however, as they don't
8241 appear on screen themselves.
8242
8243 """
0085ce49
RD
8244 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8245 __repr__ = _swig_repr
8246 def __init__(self, *args, **kwargs):
0df68c9f 8247 """
a95a7133 8248 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 8249 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
8250
8251 Construct and show a generic Window.
0df68c9f 8252 """
0085ce49 8253 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d14a1e28 8254 self._setOORInfo(self)
d14a1e28 8255
e811c8ce 8256 def Create(*args, **kwargs):
0df68c9f 8257 """
a95a7133 8258 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 8259 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
8260
8261 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 8262 """
54f9ee45 8263 return _core_.Window_Create(*args, **kwargs)
d14a1e28 8264
e811c8ce 8265 def Close(*args, **kwargs):
15afbcd0 8266 """
a95a7133 8267 Close(self, bool force=False) -> bool
15afbcd0
RD
8268
8269 This function simply generates a EVT_CLOSE event whose handler usually
8270 tries to close the window. It doesn't close the window itself,
8271 however. If force is False (the default) then the window's close
8272 handler will be allowed to veto the destruction of the window.
15afbcd0 8273 """
54f9ee45 8274 return _core_.Window_Close(*args, **kwargs)
d14a1e28 8275
e811c8ce 8276 def Destroy(*args, **kwargs):
0df68c9f 8277 """
a95a7133 8278 Destroy(self) -> bool
d14a1e28 8279
15afbcd0
RD
8280 Destroys the window safely. Frames and dialogs are not destroyed
8281 immediately when this function is called -- they are added to a list
8282 of windows to be deleted on idle time, when all the window's events
8283 have been processed. This prevents problems with events being sent to
8284 non-existent windows.
8285
8286 Returns True if the window has either been successfully deleted, or it
8287 has been added to the list of windows pending real deletion.
0df68c9f 8288 """
b39fe951
RD
8289 args[0].this.own(False)
8290 return _core_.Window_Destroy(*args, **kwargs)
d14a1e28 8291
e811c8ce 8292 def DestroyChildren(*args, **kwargs):
15afbcd0 8293 """
a95a7133 8294 DestroyChildren(self) -> bool
15afbcd0 8295
41e2b43e
RD
8296 Destroys all children of a window. Called automatically by the
8297 destructor.
15afbcd0 8298 """
54f9ee45 8299 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 8300
e811c8ce 8301 def IsBeingDeleted(*args, **kwargs):
15afbcd0 8302 """
a95a7133 8303 IsBeingDeleted(self) -> bool
15afbcd0
RD
8304
8305 Is the window in the process of being deleted?
8306 """
54f9ee45 8307 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 8308
e811c8ce 8309 def SetLabel(*args, **kwargs):
15afbcd0 8310 """
a95a7133 8311 SetLabel(self, String label)
15afbcd0
RD
8312
8313 Set the text which the window shows in its label if applicable.
8314 """
54f9ee45 8315 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 8316
e811c8ce 8317 def GetLabel(*args, **kwargs):
15afbcd0 8318 """
a95a7133 8319 GetLabel(self) -> String
15afbcd0 8320
41e2b43e
RD
8321 Generic way of getting a label from any window, for identification
8322 purposes. The interpretation of this function differs from class to
8323 class. For frames and dialogs, the value returned is the title. For
8324 buttons or static text controls, it is the button text. This function
8325 can be useful for meta-programs such as testing tools or special-needs
8326 access programs)which need to identify windows by name.
15afbcd0 8327 """
54f9ee45 8328 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 8329
e811c8ce 8330 def SetName(*args, **kwargs):
15afbcd0 8331 """
a95a7133 8332 SetName(self, String name)
15afbcd0 8333
41e2b43e
RD
8334 Sets the window's name. The window name is used for ressource setting
8335 in X, it is not the same as the window title/label
15afbcd0 8336 """
54f9ee45 8337 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 8338
e811c8ce 8339 def GetName(*args, **kwargs):
15afbcd0 8340 """
a95a7133 8341 GetName(self) -> String
15afbcd0 8342
41e2b43e
RD
8343 Returns the windows name. This name is not guaranteed to be unique;
8344 it is up to the programmer to supply an appropriate name in the window
8345 constructor or via wx.Window.SetName.
15afbcd0 8346 """
54f9ee45 8347 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 8348
4276dc52
RD
8349 def SetWindowVariant(*args, **kwargs):
8350 """
a95a7133 8351 SetWindowVariant(self, int variant)
4276dc52 8352
41e2b43e
RD
8353 Sets the variant of the window/font size to use for this window, if
8354 the platform supports variants, for example, wxMac.
4276dc52 8355 """
54f9ee45 8356 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
8357
8358 def GetWindowVariant(*args, **kwargs):
a95a7133 8359 """GetWindowVariant(self) -> int"""
54f9ee45 8360 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 8361
e811c8ce 8362 def SetId(*args, **kwargs):
15afbcd0 8363 """
a95a7133 8364 SetId(self, int winid)
15afbcd0
RD
8365
8366 Sets the identifier of the window. Each window has an integer
8367 identifier. If the application has not provided one, an identifier
8368 will be generated. Normally, the identifier should be provided on
8369 creation and should not be modified subsequently.
8370 """
54f9ee45 8371 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 8372
e811c8ce 8373 def GetId(*args, **kwargs):
15afbcd0 8374 """
a95a7133 8375 GetId(self) -> int
15afbcd0
RD
8376
8377 Returns the identifier of the window. Each window has an integer
8378 identifier. If the application has not provided one (or the default Id
8379 -1 is used) then an unique identifier with a negative value will be
8380 generated.
8381 """
54f9ee45 8382 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 8383
e811c8ce 8384 def NewControlId(*args, **kwargs):
15afbcd0 8385 """
66c033b4 8386 NewControlId() -> int
15afbcd0
RD
8387
8388 Generate a control id for the controls which were not given one.
8389 """
54f9ee45 8390 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 8391
e811c8ce
RD
8392 NewControlId = staticmethod(NewControlId)
8393 def NextControlId(*args, **kwargs):
15afbcd0 8394 """
66c033b4 8395 NextControlId(int winid) -> int
15afbcd0
RD
8396
8397 Get the id of the control following the one with the given
41e2b43e 8398 autogenerated) id
15afbcd0 8399 """
54f9ee45 8400 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 8401
e811c8ce
RD
8402 NextControlId = staticmethod(NextControlId)
8403 def PrevControlId(*args, **kwargs):
15afbcd0 8404 """
66c033b4 8405 PrevControlId(int winid) -> int
15afbcd0
RD
8406
8407 Get the id of the control preceding the one with the given
41e2b43e 8408 autogenerated) id
15afbcd0 8409 """
54f9ee45 8410 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 8411
e811c8ce 8412 PrevControlId = staticmethod(PrevControlId)
97ab0f6a
RD
8413 def GetLayoutDirection(*args, **kwargs):
8414 """
994453b8 8415 GetLayoutDirection(self) -> int
97ab0f6a
RD
8416
8417 Get the layout direction (LTR or RTL) for this window. Returns
8418 ``wx.Layout_Default`` if layout direction is not supported.
8419 """
8420 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8421
8422 def SetLayoutDirection(*args, **kwargs):
8423 """
994453b8 8424 SetLayoutDirection(self, int dir)
97ab0f6a
RD
8425
8426 Set the layout direction (LTR or RTL) for this window.
8427 """
8428 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8429
8430 def AdjustForLayoutDirection(*args, **kwargs):
8431 """
8432 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8433
8434 Mirror coordinates for RTL layout if this window uses it and if the
8435 mirroring is not done automatically like Win32.
8436 """
8437 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8438
e811c8ce 8439 def SetSize(*args, **kwargs):
15afbcd0 8440 """
a95a7133 8441 SetSize(self, Size size)
15afbcd0
RD
8442
8443 Sets the size of the window in pixels.
8444 """
54f9ee45 8445 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 8446
e811c8ce 8447 def SetDimensions(*args, **kwargs):
15afbcd0 8448 """
a95a7133 8449 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
8450
8451 Sets the position and size of the window in pixels. The sizeFlags
8452 parameter indicates the interpretation of the other params if they are
e505d15e
RD
8453 equal to -1.
8454
8455 ======================== ======================================
8456 wx.SIZE_AUTO A -1 indicates that a class-specific
8457 default should be used.
8458 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8459 -1 values are supplied.
8460 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8461 interpreted as real dimensions, not
8462 default values.
8463 ======================== ======================================
8464
15afbcd0 8465 """
54f9ee45 8466 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 8467
e811c8ce 8468 def SetRect(*args, **kwargs):
15afbcd0 8469 """
a95a7133 8470 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
8471
8472 Sets the position and size of the window in pixels using a wx.Rect.
8473 """
54f9ee45 8474 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 8475
e811c8ce 8476 def SetSizeWH(*args, **kwargs):
15afbcd0 8477 """
a95a7133 8478 SetSizeWH(self, int width, int height)
15afbcd0
RD
8479
8480 Sets the size of the window in pixels.
8481 """
54f9ee45 8482 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 8483
e811c8ce 8484 def Move(*args, **kwargs):
15afbcd0 8485 """
a95a7133 8486 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
8487
8488 Moves the window to the given position.
8489 """
54f9ee45 8490 return _core_.Window_Move(*args, **kwargs)
d14a1e28 8491
e811c8ce
RD
8492 SetPosition = Move
8493 def MoveXY(*args, **kwargs):
15afbcd0 8494 """
a95a7133 8495 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
8496
8497 Moves the window to the given position.
8498 """
54f9ee45 8499 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 8500
580080c5 8501 def SetInitialSize(*args, **kwargs):
f8167d6e 8502 """
580080c5 8503 SetInitialSize(self, Size size=DefaultSize)
f8167d6e
RD
8504
8505 A 'Smart' SetSize that will fill in default size components with the
8506 window's *best size* values. Also set's the minsize for use with sizers.
8507 """
580080c5 8508 return _core_.Window_SetInitialSize(*args, **kwargs)
f8167d6e 8509
580080c5 8510 SetBestFittingSize = wx._deprecated(SetInitialSize, 'Use `SetInitialSize`')
e811c8ce 8511 def Raise(*args, **kwargs):
15afbcd0 8512 """
a95a7133 8513 Raise(self)
15afbcd0 8514
943e8dfd 8515 Raises the window to the top of the window hierarchy. In current
70b63a99 8516 version of wxWidgets this works both for managed and child windows.
15afbcd0 8517 """
54f9ee45 8518 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
8519
8520 def Lower(*args, **kwargs):
15afbcd0 8521 """
a95a7133 8522 Lower(self)
15afbcd0 8523
943e8dfd 8524 Lowers the window to the bottom of the window hierarchy. In current
70b63a99 8525 version of wxWidgets this works both for managed and child windows.
15afbcd0 8526 """
54f9ee45 8527 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
8528
8529 def SetClientSize(*args, **kwargs):
15afbcd0 8530 """
a95a7133 8531 SetClientSize(self, Size size)
15afbcd0
RD
8532
8533 This sets the size of the window client area in pixels. Using this
8534 function to size a window tends to be more device-independent than
8535 wx.Window.SetSize, since the application need not worry about what
8536 dimensions the border or title bar have when trying to fit the window
8537 around panel items, for example.
8538 """
54f9ee45 8539 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
8540
8541 def SetClientSizeWH(*args, **kwargs):
15afbcd0 8542 """
a95a7133 8543 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
8544
8545 This sets the size of the window client area in pixels. Using this
8546 function to size a window tends to be more device-independent than
8547 wx.Window.SetSize, since the application need not worry about what
8548 dimensions the border or title bar have when trying to fit the window
8549 around panel items, for example.
8550 """
54f9ee45 8551 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
8552
8553 def SetClientRect(*args, **kwargs):
15afbcd0 8554 """
a95a7133 8555 SetClientRect(self, Rect rect)
15afbcd0
RD
8556
8557 This sets the size of the window client area in pixels. Using this
8558 function to size a window tends to be more device-independent than
8559 wx.Window.SetSize, since the application need not worry about what
8560 dimensions the border or title bar have when trying to fit the window
8561 around panel items, for example.
8562 """
54f9ee45 8563 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
8564
8565 def GetPosition(*args, **kwargs):
0df68c9f 8566 """
a95a7133 8567 GetPosition(self) -> Point
e811c8ce 8568
75219dcb
RD
8569 Get the window's position. Notice that the position is in client
8570 coordinates for child windows and screen coordinates for the top level
8571 ones, use `GetScreenPosition` if you need screen coordinates for all
8572 kinds of windows.
0df68c9f 8573 """
54f9ee45 8574 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
8575
8576 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
8577 """
8578 GetPositionTuple() -> (x,y)
e811c8ce 8579
75219dcb
RD
8580 Get the window's position. Notice that the position is in client
8581 coordinates for child windows and screen coordinates for the top level
8582 ones, use `GetScreenPosition` if you need screen coordinates for all
8583 kinds of windows.
0df68c9f 8584 """
54f9ee45 8585 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce 8586
75219dcb
RD
8587 def GetScreenPosition(*args, **kwargs):
8588 """
8589 GetScreenPosition(self) -> Point
8590
8591 Get the position of the window in screen coordinantes.
8592 """
8593 return _core_.Window_GetScreenPosition(*args, **kwargs)
8594
8595 def GetScreenPositionTuple(*args, **kwargs):
8596 """
8597 GetScreenPositionTuple() -> (x,y)
8598
8599 Get the position of the window in screen coordinantes.
8600 """
8601 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8602
8603 def GetScreenRect(*args, **kwargs):
8604 """
8605 GetScreenRect(self) -> Rect
8606
8607 Returns the size and position of the window in screen coordinantes as
8608 a `wx.Rect` object.
8609 """
8610 return _core_.Window_GetScreenRect(*args, **kwargs)
8611
e811c8ce 8612 def GetSize(*args, **kwargs):
0df68c9f 8613 """
a95a7133 8614 GetSize(self) -> Size
e811c8ce 8615
0df68c9f
RD
8616 Get the window size.
8617 """
54f9ee45 8618 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
8619
8620 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
8621 """
8622 GetSizeTuple() -> (width, height)
e811c8ce 8623
0df68c9f
RD
8624 Get the window size.
8625 """
54f9ee45 8626 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
8627
8628 def GetRect(*args, **kwargs):
15afbcd0 8629 """
a95a7133 8630 GetRect(self) -> Rect
15afbcd0 8631
75219dcb 8632 Returns the size and position of the window as a `wx.Rect` object.
15afbcd0 8633 """
54f9ee45 8634 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
8635
8636 def GetClientSize(*args, **kwargs):
0df68c9f 8637 """
a95a7133 8638 GetClientSize(self) -> Size
e811c8ce 8639
15afbcd0
RD
8640 This gets the size of the window's 'client area' in pixels. The client
8641 area is the area which may be drawn on by the programmer, excluding
8642 title bar, border, scrollbars, etc.
0df68c9f 8643 """
54f9ee45 8644 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
8645
8646 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
8647 """
8648 GetClientSizeTuple() -> (width, height)
e811c8ce 8649
15afbcd0
RD
8650 This gets the size of the window's 'client area' in pixels. The client
8651 area is the area which may be drawn on by the programmer, excluding
8652 title bar, border, scrollbars, etc.
0df68c9f 8653 """
54f9ee45 8654 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
8655
8656 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 8657 """
a95a7133 8658 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
8659
8660 Get the origin of the client area of the window relative to the
8661 window's top left corner (the client area may be shifted because of
8662 the borders, scrollbars, other decorations...)
8663 """
54f9ee45 8664 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
8665
8666 def GetClientRect(*args, **kwargs):
15afbcd0 8667 """
a95a7133 8668 GetClientRect(self) -> Rect
15afbcd0 8669
61863841 8670 Get the client area position and size as a `wx.Rect` object.
15afbcd0 8671 """
54f9ee45 8672 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
8673
8674 def GetBestSize(*args, **kwargs):
0df68c9f 8675 """
a95a7133 8676 GetBestSize(self) -> Size
e811c8ce 8677
248ed943 8678 This function returns the best acceptable minimal size for the
41e2b43e
RD
8679 window, if applicable. For example, for a static text control, it will
8680 be the minimal size such that the control label is not truncated. For
8681 windows containing subwindows (suzh aswx.Panel), the size returned by
8682 this function will be the same as the size the window would have had
8683 after calling Fit.
0df68c9f 8684 """
54f9ee45 8685 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
8686
8687 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
8688 """
8689 GetBestSizeTuple() -> (width, height)
e811c8ce 8690
248ed943 8691 This function returns the best acceptable minimal size for the
41e2b43e
RD
8692 window, if applicable. For example, for a static text control, it will
8693 be the minimal size such that the control label is not truncated. For
8694 windows containing subwindows (suzh aswx.Panel), the size returned by
8695 this function will be the same as the size the window would have had
8696 after calling Fit.
0df68c9f 8697 """
54f9ee45 8698 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 8699
dfbb5885
RD
8700 def InvalidateBestSize(*args, **kwargs):
8701 """
8702 InvalidateBestSize(self)
8703
8704 Reset the cached best size value so it will be recalculated the next
8705 time it is needed.
8706 """
8707 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8708
e2813725
RD
8709 def CacheBestSize(*args, **kwargs):
8710 """
8711 CacheBestSize(self, Size size)
8712
8713 Cache the best size so it doesn't need to be calculated again, (at least until
8714 some properties of the window change.)
8715 """
8716 return _core_.Window_CacheBestSize(*args, **kwargs)
8717
580080c5 8718 def GetEffectiveMinSize(*args, **kwargs):
dfbb5885 8719 """
580080c5 8720 GetEffectiveMinSize(self) -> Size
dfbb5885
RD
8721
8722 This function will merge the window's best size into the window's
8723 minimum size, giving priority to the min size components, and returns
8724 the results.
8725
8726 """
580080c5 8727 return _core_.Window_GetEffectiveMinSize(*args, **kwargs)
dfbb5885 8728
0d82d64e 8729 GetBestFittingSize = wx._deprecated(GetEffectiveMinSize, 'Use `GetEffectiveMinSize` instead.')
8f514ab4
RD
8730 def GetAdjustedBestSize(self):
8731 s = self.GetBestSize()
8732 return wx.Size(max(s.width, self.GetMinWidth()),
8733 max(s.height, self.GetMinHeight()))
580080c5 8734 GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetEffectiveMinSize` instead.')
e811c8ce
RD
8735
8736 def Center(*args, **kwargs):
15afbcd0 8737 """
a95a7133 8738 Center(self, int direction=BOTH)
15afbcd0
RD
8739
8740 Centers the window. The parameter specifies the direction for
8741 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8742 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8743 on the entire screen and not on its parent window. If it is a
8744 top-level window and has no parent then it will always be centered
8745 relative to the screen.
8746 """
54f9ee45 8747 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
8748
8749 Centre = Center
e811c8ce 8750 def CenterOnParent(*args, **kwargs):
15afbcd0 8751 """
a95a7133 8752 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
8753
8754 Center with respect to the the parent window
8755 """
54f9ee45 8756 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
8757
8758 CentreOnParent = CenterOnParent
8759 def Fit(*args, **kwargs):
15afbcd0 8760 """
a95a7133 8761 Fit(self)
15afbcd0
RD
8762
8763 Sizes the window so that it fits around its subwindows. This function
8764 won't do anything if there are no subwindows and will only really work
8765 correctly if sizers are used for the subwindows layout. Also, if the
8766 window has exactly one subwindow it is better (faster and the result
8767 is more precise as Fit adds some margin to account for fuzziness of
8768 its calculations) to call window.SetClientSize(child.GetSize())
8769 instead of calling Fit.
8770 """
54f9ee45 8771 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
8772
8773 def FitInside(*args, **kwargs):
15afbcd0 8774 """
a95a7133 8775 FitInside(self)
15afbcd0
RD
8776
8777 Similar to Fit, but sizes the interior (virtual) size of a
8778 window. Mainly useful with scrolled windows to reset scrollbars after
8779 sizing changes that do not trigger a size event, and/or scrolled
8780 windows without an interior sizer. This function similarly won't do
8781 anything if there are no subwindows.
8782 """
54f9ee45 8783 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 8784
f16ab95d 8785 def SetSizeHints(*args, **kwargs):
0df68c9f 8786 """
a95a7133 8787 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 8788 int incH=-1)
15afbcd0
RD
8789
8790 Allows specification of minimum and maximum window sizes, and window
8791 size increments. If a pair of values is not set (or set to -1), the
8792 default values will be used. If this function is called, the user
908b74cd
RD
8793 will not be able to size the window outside the given bounds (if it is
8794 a top-level window.) Sizers will also inspect the minimum window size
8795 and will use that value if set when calculating layout.
8796
8797 The resizing increments are only significant under Motif or Xt.
0df68c9f 8798 """
f16ab95d 8799 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 8800
f16ab95d
RD
8801 def SetSizeHintsSz(*args, **kwargs):
8802 """
8803 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8804
8805 Allows specification of minimum and maximum window sizes, and window
8806 size increments. If a pair of values is not set (or set to -1), the
8807 default values will be used. If this function is called, the user
8808 will not be able to size the window outside the given bounds (if it is
8809 a top-level window.) Sizers will also inspect the minimum window size
8810 and will use that value if set when calculating layout.
8811
8812 The resizing increments are only significant under Motif or Xt.
8813 """
8814 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8815
8816 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 8817 """
908b74cd 8818 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
8819
8820 Allows specification of minimum and maximum virtual window sizes. If a
8821 pair of values is not set (or set to -1), the default values will be
8822 used. If this function is called, the user will not be able to size
8823 the virtual area of the window outside the given bounds.
8824 """
f16ab95d
RD
8825 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8826
8827 def SetVirtualSizeHintsSz(*args, **kwargs):
8828 """
8829 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8830
8831 Allows specification of minimum and maximum virtual window sizes. If a
8832 pair of values is not set (or set to -1), the default values will be
8833 used. If this function is called, the user will not be able to size
8834 the virtual area of the window outside the given bounds.
8835 """
8836 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 8837
908b74cd
RD
8838 def GetMaxSize(*args, **kwargs):
8839 """GetMaxSize(self) -> Size"""
8840 return _core_.Window_GetMaxSize(*args, **kwargs)
8841
8842 def GetMinSize(*args, **kwargs):
8843 """GetMinSize(self) -> Size"""
8844 return _core_.Window_GetMinSize(*args, **kwargs)
8845
8846 def SetMinSize(*args, **kwargs):
8847 """
8848 SetMinSize(self, Size minSize)
8849
8850 A more convenient method than `SetSizeHints` for setting just the
8851 min size.
8852 """
8853 return _core_.Window_SetMinSize(*args, **kwargs)
8854
8855 def SetMaxSize(*args, **kwargs):
8856 """
8857 SetMaxSize(self, Size maxSize)
8858
8859 A more convenient method than `SetSizeHints` for setting just the
8860 max size.
8861 """
8862 return _core_.Window_SetMaxSize(*args, **kwargs)
8863
e811c8ce 8864 def GetMinWidth(*args, **kwargs):
a95a7133 8865 """GetMinWidth(self) -> int"""
54f9ee45 8866 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
8867
8868 def GetMinHeight(*args, **kwargs):
a95a7133 8869 """GetMinHeight(self) -> int"""
54f9ee45 8870 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
8871
8872 def GetMaxWidth(*args, **kwargs):
a95a7133 8873 """GetMaxWidth(self) -> int"""
54f9ee45 8874 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
8875
8876 def GetMaxHeight(*args, **kwargs):
a95a7133 8877 """GetMaxHeight(self) -> int"""
54f9ee45 8878 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 8879
e811c8ce 8880 def SetVirtualSize(*args, **kwargs):
0df68c9f 8881 """
a95a7133 8882 SetVirtualSize(self, Size size)
e811c8ce 8883
15afbcd0
RD
8884 Set the the virtual size of a window in pixels. For most windows this
8885 is just the client area of the window, but for some like scrolled
8886 windows it is more or less independent of the screen window size.
0df68c9f 8887 """
54f9ee45 8888 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
8889
8890 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 8891 """
a95a7133 8892 SetVirtualSizeWH(self, int w, int h)
e811c8ce 8893
15afbcd0
RD
8894 Set the the virtual size of a window in pixels. For most windows this
8895 is just the client area of the window, but for some like scrolled
8896 windows it is more or less independent of the screen window size.
0df68c9f 8897 """
54f9ee45 8898 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
8899
8900 def GetVirtualSize(*args, **kwargs):
0df68c9f 8901 """
a95a7133 8902 GetVirtualSize(self) -> Size
e811c8ce 8903
15afbcd0
RD
8904 Get the the virtual size of the window in pixels. For most windows
8905 this is just the client area of the window, but for some like scrolled
8906 windows it is more or less independent of the screen window size.
0df68c9f 8907 """
54f9ee45 8908 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
8909
8910 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
8911 """
8912 GetVirtualSizeTuple() -> (width, height)
e811c8ce 8913
15afbcd0
RD
8914 Get the the virtual size of the window in pixels. For most windows
8915 this is just the client area of the window, but for some like scrolled
8916 windows it is more or less independent of the screen window size.
0df68c9f 8917 """
54f9ee45 8918 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce 8919
cbdf0fb0
RD
8920 def GetWindowBorderSize(*args, **kwargs):
8921 """
8922 GetWindowBorderSize(self) -> Size
8923
8924 Return the size of the left/right and top/bottom borders.
8925 """
8926 return _core_.Window_GetWindowBorderSize(*args, **kwargs)
8927
e811c8ce 8928 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 8929 """
a95a7133 8930 GetBestVirtualSize(self) -> Size
15afbcd0
RD
8931
8932 Return the largest of ClientSize and BestSize (as determined by a
8933 sizer, interior children, or other means)
8934 """
54f9ee45 8935 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
8936
8937 def Show(*args, **kwargs):
15afbcd0 8938 """
a95a7133 8939 Show(self, bool show=True) -> bool
15afbcd0
RD
8940
8941 Shows or hides the window. You may need to call Raise for a top level
8942 window if you want to bring it to top, although this is not needed if
8943 Show is called immediately after the frame creation. Returns True if
8944 the window has been shown or hidden or False if nothing was done
8945 because it already was in the requested state.
8946 """
54f9ee45 8947 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
8948
8949 def Hide(*args, **kwargs):
15afbcd0 8950 """
a95a7133 8951 Hide(self) -> bool
15afbcd0
RD
8952
8953 Equivalent to calling Show(False).
8954 """
54f9ee45 8955 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
8956
8957 def Enable(*args, **kwargs):
15afbcd0 8958 """
a95a7133 8959 Enable(self, bool enable=True) -> bool
15afbcd0
RD
8960
8961 Enable or disable the window for user input. Note that when a parent
8962 window is disabled, all of its children are disabled as well and they
8963 are reenabled again when the parent is. Returns true if the window
8964 has been enabled or disabled, false if nothing was done, i.e. if the
8965 window had already been in the specified state.
8966 """
54f9ee45 8967 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
8968
8969 def Disable(*args, **kwargs):
15afbcd0 8970 """
a95a7133 8971 Disable(self) -> bool
15afbcd0
RD
8972
8973 Disables the window, same as Enable(false).
8974 """
54f9ee45 8975 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
8976
8977 def IsShown(*args, **kwargs):
15afbcd0 8978 """
a95a7133 8979 IsShown(self) -> bool
15afbcd0
RD
8980
8981 Returns true if the window is shown, false if it has been hidden.
8982 """
54f9ee45 8983 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
8984
8985 def IsEnabled(*args, **kwargs):
15afbcd0 8986 """
a95a7133 8987 IsEnabled(self) -> bool
15afbcd0
RD
8988
8989 Returns true if the window is enabled for input, false otherwise.
cbfc9df6
RD
8990 This method takes into account the enabled state of parent windows up
8991 to the top-level window.
15afbcd0 8992 """
54f9ee45 8993 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce 8994
cbfc9df6
RD
8995 def IsThisEnabled(*args, **kwargs):
8996 """
8997 IsThisEnabled(self) -> bool
8998
8999 Returns the internal enabled state independent of the parent(s) state,
9000 i.e. the state in which the window would be if all of its parents are
9001 enabled. Use `IsEnabled` to get the effective window state.
9002 """
9003 return _core_.Window_IsThisEnabled(*args, **kwargs)
9004
33d6fd3b
RD
9005 def IsShownOnScreen(*args, **kwargs):
9006 """
9007 IsShownOnScreen(self) -> bool
9008
9009 Returns ``True`` if the window is physically visible on the screen,
9010 i.e. it is shown and all its parents up to the toplevel window are
9011 shown as well.
9012 """
9013 return _core_.Window_IsShownOnScreen(*args, **kwargs)
9014
e811c8ce 9015 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 9016 """
a95a7133 9017 SetWindowStyleFlag(self, long style)
15afbcd0 9018
41e2b43e
RD
9019 Sets the style of the window. Please note that some styles cannot be
9020 changed after the window creation and that Refresh() might need to be
9021 called after changing the others for the change to take place
9022 immediately.
15afbcd0 9023 """
54f9ee45 9024 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
9025
9026 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 9027 """
a95a7133 9028 GetWindowStyleFlag(self) -> long
e811c8ce 9029
15afbcd0
RD
9030 Gets the window style that was passed to the constructor or Create
9031 method.
9032 """
54f9ee45 9033 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 9034
15afbcd0 9035 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 9036 def HasFlag(*args, **kwargs):
15afbcd0 9037 """
a95a7133 9038 HasFlag(self, int flag) -> bool
15afbcd0
RD
9039
9040 Test if the given style is set for this window.
9041 """
54f9ee45 9042 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
9043
9044 def IsRetained(*args, **kwargs):
15afbcd0 9045 """
a95a7133 9046 IsRetained(self) -> bool
15afbcd0
RD
9047
9048 Returns true if the window is retained, false otherwise. Retained
9049 windows are only available on X platforms.
9050 """
54f9ee45 9051 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce 9052
5917d041
RD
9053 def ToggleWindowStyle(*args, **kwargs):
9054 """
9055 ToggleWindowStyle(self, int flag) -> bool
9056
9057 Turn the flag on if it had been turned off before and vice versa,
9058 returns True if the flag is turned on by this function call.
9059 """
9060 return _core_.Window_ToggleWindowStyle(*args, **kwargs)
9061
e811c8ce 9062 def SetExtraStyle(*args, **kwargs):
15afbcd0 9063 """
a95a7133 9064 SetExtraStyle(self, long exStyle)
15afbcd0
RD
9065
9066 Sets the extra style bits for the window. Extra styles are the less
9067 often used style bits which can't be set with the constructor or with
9068 SetWindowStyleFlag()
9069 """
54f9ee45 9070 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
9071
9072 def GetExtraStyle(*args, **kwargs):
15afbcd0 9073 """
a95a7133 9074 GetExtraStyle(self) -> long
15afbcd0
RD
9075
9076 Returns the extra style bits for the window.
9077 """
54f9ee45 9078 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
9079
9080 def MakeModal(*args, **kwargs):
15afbcd0 9081 """
a95a7133 9082 MakeModal(self, bool modal=True)
15afbcd0
RD
9083
9084 Disables all other windows in the application so that the user can
9085 only interact with this window. Passing False will reverse this
9086 effect.
9087 """
54f9ee45 9088 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
9089
9090 def SetThemeEnabled(*args, **kwargs):
15afbcd0 9091 """
a95a7133 9092 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
9093
9094 This function tells a window if it should use the system's "theme"
9095 code to draw the windows' background instead if its own background
9096 drawing code. This will only have an effect on platforms that support
9097 the notion of themes in user defined windows. One such platform is
9098 GTK+ where windows can have (very colourful) backgrounds defined by a
9099 user's selected theme.
9100
9101 Dialogs, notebook pages and the status bar have this flag set to true
9102 by default so that the default look and feel is simulated best.
9103 """
54f9ee45 9104 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
9105
9106 def GetThemeEnabled(*args, **kwargs):
15afbcd0 9107 """
a95a7133 9108 GetThemeEnabled(self) -> bool
e811c8ce 9109
15afbcd0
RD
9110 Return the themeEnabled flag.
9111 """
54f9ee45 9112 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
9113
9114 def SetFocus(*args, **kwargs):
15afbcd0 9115 """
a95a7133 9116 SetFocus(self)
15afbcd0
RD
9117
9118 Set's the focus to this window, allowing it to receive keyboard input.
9119 """
54f9ee45 9120 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
9121
9122 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 9123 """
a95a7133 9124 SetFocusFromKbd(self)
15afbcd0
RD
9125
9126 Set focus to this window as the result of a keyboard action. Normally
9127 only called internally.
9128 """
54f9ee45 9129 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
9130
9131 def FindFocus(*args, **kwargs):
15afbcd0 9132 """
66c033b4 9133 FindFocus() -> Window
15afbcd0
RD
9134
9135 Returns the window or control that currently has the keyboard focus,
9136 or None.
9137 """
54f9ee45 9138 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
9139
9140 FindFocus = staticmethod(FindFocus)
9141 def AcceptsFocus(*args, **kwargs):
15afbcd0 9142 """
a95a7133 9143 AcceptsFocus(self) -> bool
15afbcd0
RD
9144
9145 Can this window have focus?
9146 """
54f9ee45 9147 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce 9148
cbfc9df6
RD
9149 def CanAcceptFocus(*args, **kwargs):
9150 """
9151 CanAcceptFocus(self) -> bool
9152
9153 Can this window have focus right now?
9154 """
9155 return _core_.Window_CanAcceptFocus(*args, **kwargs)
9156
e811c8ce 9157 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 9158 """
a95a7133 9159 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
9160
9161 Can this window be given focus by keyboard navigation? if not, the
9162 only way to give it focus (provided it accepts it at all) is to click
9163 it.
9164 """
54f9ee45 9165 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce 9166
cbfc9df6
RD
9167 def CanAcceptFocusFromKeyboard(*args, **kwargs):
9168 """
9169 CanAcceptFocusFromKeyboard(self) -> bool
9170
9171 Can this window be assigned focus from keyboard right now?
9172 """
9173 return _core_.Window_CanAcceptFocusFromKeyboard(*args, **kwargs)
9174
8c3a7183
RD
9175 def SetCanFocus(*args, **kwargs):
9176 """SetCanFocus(self, bool canFocus)"""
9177 return _core_.Window_SetCanFocus(*args, **kwargs)
9178
ddeca22c
RD
9179 def NavigateIn(*args, **kwargs):
9180 """
9181 NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool
9182
9183 Navigates inside this window.
9184 """
9185 return _core_.Window_NavigateIn(*args, **kwargs)
9186
908b74cd
RD
9187 def Navigate(*args, **kwargs):
9188 """
9189 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
9190
ddeca22c
RD
9191 Does keyboard navigation starting from this window to another. This is
9192 equivalient to self.GetParent().NavigateIn().
908b74cd
RD
9193 """
9194 return _core_.Window_Navigate(*args, **kwargs)
9195
7f98d120
RD
9196 def MoveAfterInTabOrder(*args, **kwargs):
9197 """
9198 MoveAfterInTabOrder(self, Window win)
9199
9200 Moves this window in the tab navigation order after the specified
9201 sibling window. This means that when the user presses the TAB key on
9202 that other window, the focus switches to this window.
9203
9204 The default tab order is the same as creation order. This function
9205 and `MoveBeforeInTabOrder` allow to change it after creating all the
9206 windows.
9207
9208 """
9209 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
9210
9211 def MoveBeforeInTabOrder(*args, **kwargs):
9212 """
9213 MoveBeforeInTabOrder(self, Window win)
9214
9215 Same as `MoveAfterInTabOrder` except that it inserts this window just
9216 before win instead of putting it right after it.
9217 """
9218 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
9219
e811c8ce 9220 def GetChildren(*args, **kwargs):
15afbcd0 9221 """
a95a7133 9222 GetChildren(self) -> PyObject
15afbcd0
RD
9223
9224 Returns a list of the window's children. NOTE: Currently this is a
9225 copy of the child window list maintained by the window, so the return
9226 value of this function is only valid as long as the window's children
9227 do not change.
9228 """
54f9ee45 9229 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
9230
9231 def GetParent(*args, **kwargs):
15afbcd0 9232 """
a95a7133 9233 GetParent(self) -> Window
15afbcd0
RD
9234
9235 Returns the parent window of this window, or None if there isn't one.
9236 """
54f9ee45 9237 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
9238
9239 def GetGrandParent(*args, **kwargs):
15afbcd0 9240 """
a95a7133 9241 GetGrandParent(self) -> Window
15afbcd0 9242
41e2b43e
RD
9243 Returns the parent of the parent of this window, or None if there
9244 isn't one.
15afbcd0 9245 """
54f9ee45 9246 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce 9247
cbfc9df6
RD
9248 def GetTopLevelParent(*args, **kwargs):
9249 """
9250 GetTopLevelParent(self) -> Window
9251
9252 Returns the first frame or dialog in this window's parental hierarchy.
9253 """
9254 return _core_.Window_GetTopLevelParent(*args, **kwargs)
9255
e811c8ce 9256 def IsTopLevel(*args, **kwargs):
15afbcd0 9257 """
a95a7133 9258 IsTopLevel(self) -> bool
15afbcd0
RD
9259
9260 Returns true if the given window is a top-level one. Currently all
9261 frames and dialogs are always considered to be top-level windows (even
9262 if they have a parent window).
9263 """
54f9ee45 9264 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
9265
9266 def Reparent(*args, **kwargs):
15afbcd0 9267 """
a95a7133 9268 Reparent(self, Window newParent) -> bool
15afbcd0
RD
9269
9270 Reparents the window, i.e the window will be removed from its current
9271 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9272 re-inserted into another. Available on Windows and GTK. Returns True
9273 if the parent was changed, False otherwise (error or newParent ==
9274 oldParent)
9275 """
54f9ee45 9276 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
9277
9278 def AddChild(*args, **kwargs):
15afbcd0 9279 """
a95a7133 9280 AddChild(self, Window child)
15afbcd0
RD
9281
9282 Adds a child window. This is called automatically by window creation
9283 functions so should not be required by the application programmer.
9284 """
54f9ee45 9285 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
9286
9287 def RemoveChild(*args, **kwargs):
15afbcd0 9288 """
a95a7133 9289 RemoveChild(self, Window child)
15afbcd0
RD
9290
9291 Removes a child window. This is called automatically by window
9292 deletion functions so should not be required by the application
9293 programmer.
9294 """
54f9ee45 9295 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce 9296
704eda0c
RD
9297 def SetDoubleBuffered(*args, **kwargs):
9298 """
9299 SetDoubleBuffered(self, bool on)
9300
9301 Currently wxGTK2 only.
9302 """
9303 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
9304
e811c8ce 9305 def FindWindowById(*args, **kwargs):
15afbcd0 9306 """
a95a7133 9307 FindWindowById(self, long winid) -> Window
15afbcd0
RD
9308
9309 Find a chld of this window by window ID
9310 """
54f9ee45 9311 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
9312
9313 def FindWindowByName(*args, **kwargs):
15afbcd0 9314 """
a95a7133 9315 FindWindowByName(self, String name) -> Window
15afbcd0
RD
9316
9317 Find a child of this window by name
9318 """
54f9ee45 9319 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
9320
9321 def GetEventHandler(*args, **kwargs):
15afbcd0 9322 """
a95a7133 9323 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
9324
9325 Returns the event handler for this window. By default, the window is
9326 its own event handler.
9327 """
54f9ee45 9328 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
9329
9330 def SetEventHandler(*args, **kwargs):
15afbcd0 9331 """
a95a7133 9332 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
9333
9334 Sets the event handler for this window. An event handler is an object
d49bdf34
RD
9335 that is capable of processing the events sent to a window. (In other
9336 words, is able to dispatch the events to handler function.) By
9337 default, the window is its own event handler, but an application may
9338 wish to substitute another, for example to allow central
9339 implementation of event-handling for a variety of different window
9340 classes.
15afbcd0 9341
41e2b43e 9342 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0 9343 up a chain of event handlers, where an event not handled by one event
d49bdf34 9344 handler is handed off to the next one in the chain.
15afbcd0 9345 """
54f9ee45 9346 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
9347
9348 def PushEventHandler(*args, **kwargs):
15afbcd0 9349 """
a95a7133 9350 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
9351
9352 Pushes this event handler onto the event handler stack for the window.
9353 An event handler is an object that is capable of processing the events
d49bdf34
RD
9354 sent to a window. (In other words, is able to dispatch the events to
9355 handler function.) By default, the window is its own event handler,
9356 but an application may wish to substitute another, for example to
9357 allow central implementation of event-handling for a variety of
9358 different window classes.
15afbcd0
RD
9359
9360 wx.Window.PushEventHandler allows an application to set up a chain of
9361 event handlers, where an event not handled by one event handler is
d49bdf34
RD
9362 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
9363 to remove the event handler. Ownership of the handler is *not* given
9364 to the window, so you should be sure to pop the handler before the
9365 window is destroyed and either let PopEventHandler destroy it, or call
9366 its Destroy method yourself.
15afbcd0 9367 """
54f9ee45 9368 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
9369
9370 def PopEventHandler(*args, **kwargs):
15afbcd0 9371 """
a95a7133 9372 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
9373
9374 Removes and returns the top-most event handler on the event handler
9375 stack. If deleteHandler is True then the wx.EvtHandler object will be
d49bdf34 9376 destroyed after it is popped, and ``None`` will be returned instead.
15afbcd0 9377 """
54f9ee45 9378 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
9379
9380 def RemoveEventHandler(*args, **kwargs):
15afbcd0 9381 """
a95a7133 9382 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 9383
41e2b43e 9384 Find the given handler in the event handler chain and remove (but not
d49bdf34 9385 delete) it from the event handler chain, returns True if it was found
41e2b43e
RD
9386 and False otherwise (this also results in an assert failure so this
9387 function should only be called when the handler is supposed to be
9388 there.)
15afbcd0 9389 """
54f9ee45 9390 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
9391
9392 def SetValidator(*args, **kwargs):
15afbcd0 9393 """
a95a7133 9394 SetValidator(self, Validator validator)
15afbcd0
RD
9395
9396 Deletes the current validator (if any) and sets the window validator,
9397 having called wx.Validator.Clone to create a new validator of this
9398 type.
9399 """
54f9ee45 9400 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
9401
9402 def GetValidator(*args, **kwargs):
15afbcd0 9403 """
a95a7133 9404 GetValidator(self) -> Validator
15afbcd0
RD
9405
9406 Returns a pointer to the current validator for the window, or None if
9407 there is none.
9408 """
54f9ee45 9409 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 9410
74a57fcd
RD
9411 def Validate(*args, **kwargs):
9412 """
a95a7133 9413 Validate(self) -> bool
74a57fcd
RD
9414
9415 Validates the current values of the child controls using their
41e2b43e
RD
9416 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9417 style flag set, the method will also call Validate() of all child
9418 windows. Returns false if any of the validations failed.
74a57fcd 9419 """
54f9ee45 9420 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
9421
9422 def TransferDataToWindow(*args, **kwargs):
9423 """
a95a7133 9424 TransferDataToWindow(self) -> bool
74a57fcd 9425
41e2b43e
RD
9426 Transfers values to child controls from data areas specified by their
9427 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9428 style flag set, the method will also call TransferDataToWindow() of
9429 all child windows.
74a57fcd 9430 """
54f9ee45 9431 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
9432
9433 def TransferDataFromWindow(*args, **kwargs):
9434 """
a95a7133 9435 TransferDataFromWindow(self) -> bool
74a57fcd 9436
41e2b43e
RD
9437 Transfers values from child controls to data areas specified by their
9438 validators. Returns false if a transfer failed. If the window has
9439 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9440 also call TransferDataFromWindow() of all child windows.
74a57fcd 9441 """
54f9ee45 9442 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
9443
9444 def InitDialog(*args, **kwargs):
9445 """
a95a7133 9446 InitDialog(self)
74a57fcd 9447
41e2b43e
RD
9448 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9449 to the dialog via validators.
74a57fcd 9450 """
54f9ee45 9451 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 9452
e811c8ce 9453 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 9454 """
a95a7133 9455 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
9456
9457 Sets the accelerator table for this window.
9458 """
54f9ee45 9459 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
9460
9461 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 9462 """
a95a7133 9463 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
9464
9465 Gets the accelerator table for this window.
9466 """
54f9ee45 9467 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
9468
9469 def RegisterHotKey(*args, **kwargs):
15afbcd0 9470 """
a95a7133 9471 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
9472
9473 Registers a system wide hotkey. Every time the user presses the hotkey
9474 registered here, this window will receive a hotkey event. It will
9475 receive the event even if the application is in the background and
9476 does not have the input focus because the user is working with some
9477 other application. To bind an event handler function to this hotkey
9478 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9479 hotkey was registered successfully.
9480 """
54f9ee45 9481 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
9482
9483 def UnregisterHotKey(*args, **kwargs):
15afbcd0 9484 """
a95a7133 9485 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
9486
9487 Unregisters a system wide hotkey.
9488 """
54f9ee45 9489 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
9490
9491 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 9492 """
a95a7133 9493 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
9494
9495 Converts a point or size from dialog units to pixels. Dialog units
9496 are used for maintaining a dialog's proportions even if the font
9497 changes. For the x dimension, the dialog units are multiplied by the
9498 average character width and then divided by 4. For the y dimension,
9499 the dialog units are multiplied by the average character height and
9500 then divided by 8.
9501 """
54f9ee45 9502 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
9503
9504 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 9505 """
a95a7133 9506 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
9507
9508 Converts a point or size from dialog units to pixels. Dialog units
9509 are used for maintaining a dialog's proportions even if the font
9510 changes. For the x dimension, the dialog units are multiplied by the
9511 average character width and then divided by 4. For the y dimension,
9512 the dialog units are multiplied by the average character height and
9513 then divided by 8.
9514 """
54f9ee45 9515 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
9516
9517 def DLG_PNT(*args, **kwargs):
15afbcd0 9518 """
a95a7133 9519 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
9520
9521 Converts a point or size from dialog units to pixels. Dialog units
9522 are used for maintaining a dialog's proportions even if the font
9523 changes. For the x dimension, the dialog units are multiplied by the
9524 average character width and then divided by 4. For the y dimension,
9525 the dialog units are multiplied by the average character height and
9526 then divided by 8.
9527 """
54f9ee45 9528 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
9529
9530 def DLG_SZE(*args, **kwargs):
15afbcd0 9531 """
a95a7133 9532 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
9533
9534 Converts a point or size from dialog units to pixels. Dialog units
9535 are used for maintaining a dialog's proportions even if the font
9536 changes. For the x dimension, the dialog units are multiplied by the
9537 average character width and then divided by 4. For the y dimension,
9538 the dialog units are multiplied by the average character height and
9539 then divided by 8.
9540 """
54f9ee45 9541 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
9542
9543 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 9544 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 9545 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
9546
9547 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 9548 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 9549 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
9550
9551 def WarpPointer(*args, **kwargs):
15afbcd0 9552 """
a95a7133 9553 WarpPointer(self, int x, int y)
15afbcd0
RD
9554
9555 Moves the pointer to the given position on the window.
9556
9557 NOTE: This function is not supported under Mac because Apple Human
9558 Interface Guidelines forbid moving the mouse cursor programmatically.
9559 """
54f9ee45 9560 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
9561
9562 def CaptureMouse(*args, **kwargs):
15afbcd0 9563 """
a95a7133 9564 CaptureMouse(self)
15afbcd0
RD
9565
9566 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9567 release the capture.
9568
9569 Note that wxWindows maintains the stack of windows having captured the
9570 mouse and when the mouse is released the capture returns to the window
9571 which had had captured it previously and it is only really released if
9572 there were no previous window. In particular, this means that you must
34e0a3bb
RD
9573 release the mouse as many times as you capture it, unless the window
9574 receives the `wx.MouseCaptureLostEvent` event.
9575
9576 Any application which captures the mouse in the beginning of some
9577 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9578 operation when it receives the event. The event handler must not
9579 recapture mouse.
15afbcd0 9580 """
54f9ee45 9581 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
9582
9583 def ReleaseMouse(*args, **kwargs):
15afbcd0 9584 """
a95a7133 9585 ReleaseMouse(self)
15afbcd0
RD
9586
9587 Releases mouse input captured with wx.Window.CaptureMouse.
9588 """
54f9ee45 9589 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
9590
9591 def GetCapture(*args, **kwargs):
15afbcd0 9592 """
66c033b4 9593 GetCapture() -> Window
15afbcd0
RD
9594
9595 Returns the window which currently captures the mouse or None
9596 """
54f9ee45 9597 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
9598
9599 GetCapture = staticmethod(GetCapture)
9600 def HasCapture(*args, **kwargs):
15afbcd0 9601 """
a95a7133 9602 HasCapture(self) -> bool
15afbcd0
RD
9603
9604 Returns true if this window has the current mouse capture.
9605 """
54f9ee45 9606 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
9607
9608 def Refresh(*args, **kwargs):
15afbcd0 9609 """
a95a7133 9610 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
9611
9612 Mark the specified rectangle (or the whole window) as "dirty" so it
9613 will be repainted. Causes an EVT_PAINT event to be generated and sent
9614 to the window.
9615 """
54f9ee45 9616 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
9617
9618 def RefreshRect(*args, **kwargs):
15afbcd0 9619 """
fef4c27a 9620 RefreshRect(self, Rect rect, bool eraseBackground=True)
15afbcd0
RD
9621
9622 Redraws the contents of the given rectangle: the area inside it will
9623 be repainted. This is the same as Refresh but has a nicer syntax.
9624 """
54f9ee45 9625 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
9626
9627 def Update(*args, **kwargs):
15afbcd0 9628 """
a95a7133 9629 Update(self)
15afbcd0
RD
9630
9631 Calling this method immediately repaints the invalidated area of the
9632 window instead of waiting for the EVT_PAINT event to happen, (normally
9633 this would usually only happen when the flow of control returns to the
9634 event loop.) Notice that this function doesn't refresh the window and
9b940138 9635 does nothing if the window has been already repainted. Use `Refresh`
15afbcd0
RD
9636 first if you want to immediately redraw the window (or some portion of
9637 it) unconditionally.
9638 """
54f9ee45 9639 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
9640
9641 def ClearBackground(*args, **kwargs):
15afbcd0 9642 """
a95a7133 9643 ClearBackground(self)
15afbcd0
RD
9644
9645 Clears the window by filling it with the current background
9646 colour. Does not cause an erase background event to be generated.
9647 """
54f9ee45 9648 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
9649
9650 def Freeze(*args, **kwargs):
15afbcd0 9651 """
a95a7133 9652 Freeze(self)
15afbcd0 9653
41e2b43e
RD
9654 Freezes the window or, in other words, prevents any updates from
9655 taking place on screen, the window is not redrawn at all. Thaw must be
9656 called to reenable window redrawing. Calls to Freeze/Thaw may be
9657 nested, with the actual Thaw being delayed until all the nesting has
9658 been undone.
15afbcd0
RD
9659
9660 This method is useful for visual appearance optimization (for example,
9661 it is a good idea to use it before inserting large amount of text into
9662 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9663 for all controls so it is mostly just a hint to wxWindows and not a
9664 mandatory directive.
9665 """
54f9ee45 9666 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce 9667
33d6fd3b
RD
9668 def IsFrozen(*args, **kwargs):
9669 """
9670 IsFrozen(self) -> bool
9671
9672 Returns ``True`` if the window has been frozen and not thawed yet.
9673
9674 :see: `Freeze` and `Thaw`
9675 """
9676 return _core_.Window_IsFrozen(*args, **kwargs)
9677
e811c8ce 9678 def Thaw(*args, **kwargs):
15afbcd0 9679 """
a95a7133 9680 Thaw(self)
15afbcd0 9681
4276dc52 9682 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
9683 Freeze/Thaw may be nested, so Thaw must be called the same number of
9684 times that Freeze was before the window will be updated.
15afbcd0 9685 """
54f9ee45 9686 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
9687
9688 def PrepareDC(*args, **kwargs):
15afbcd0 9689 """
a95a7133 9690 PrepareDC(self, DC dc)
15afbcd0
RD
9691
9692 Call this function to prepare the device context for drawing a
9693 scrolled image. It sets the device origin according to the current
9694 scroll position.
9695 """
54f9ee45 9696 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce 9697
b39fe951
RD
9698 def IsDoubleBuffered(*args, **kwargs):
9699 """
9700 IsDoubleBuffered(self) -> bool
9701
9702 Returns ``True`` if the window contents is double-buffered by the
9703 system, i.e. if any drawing done on the window is really done on a
9704 temporary backing surface and transferred to the screen all at once
9705 later.
9706 """
9707 return _core_.Window_IsDoubleBuffered(*args, **kwargs)
9708
e811c8ce 9709 def GetUpdateRegion(*args, **kwargs):
15afbcd0 9710 """
a95a7133 9711 GetUpdateRegion(self) -> Region
15afbcd0
RD
9712
9713 Returns the region specifying which parts of the window have been
9714 damaged. Should only be called within an EVT_PAINT handler.
9715 """
54f9ee45 9716 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
9717
9718 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 9719 """
a95a7133 9720 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
9721
9722 Get the update rectangle region bounding box in client coords.
9723 """
54f9ee45 9724 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
9725
9726 def IsExposed(*args, **kwargs):
15afbcd0 9727 """
a95a7133 9728 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
9729
9730 Returns true if the given point or rectangle area has been exposed
9731 since the last repaint. Call this in an paint event handler to
9732 optimize redrawing by only redrawing those areas, which have been
9733 exposed.
9734 """
54f9ee45 9735 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
9736
9737 def IsExposedPoint(*args, **kwargs):
15afbcd0 9738 """
a95a7133 9739 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
9740
9741 Returns true if the given point or rectangle area has been exposed
9742 since the last repaint. Call this in an paint event handler to
9743 optimize redrawing by only redrawing those areas, which have been
9744 exposed.
9745 """
54f9ee45 9746 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 9747
4276dc52 9748 def IsExposedRect(*args, **kwargs):
15afbcd0 9749 """
a95a7133 9750 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
9751
9752 Returns true if the given point or rectangle area has been exposed
9753 since the last repaint. Call this in an paint event handler to
9754 optimize redrawing by only redrawing those areas, which have been
9755 exposed.
9756 """
54f9ee45 9757 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 9758
74a57fcd
RD
9759 def GetDefaultAttributes(*args, **kwargs):
9760 """
a95a7133 9761 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 9762
41e2b43e
RD
9763 Get the default attributes for an instance of this class. This is
9764 useful if you want to use the same font or colour in your own control
9765 as in a standard control -- which is a much better idea than hard
9766 coding specific colours or fonts which might look completely out of
db3e571a 9767 place on the user's system, especially if it uses themes.
74a57fcd 9768 """
54f9ee45 9769 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9770
9771 def GetClassDefaultAttributes(*args, **kwargs):
9772 """
66c033b4 9773 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 9774
41e2b43e
RD
9775 Get the default attributes for this class. This is useful if you want
9776 to use the same font or colour in your own control as in a standard
9777 control -- which is a much better idea than hard coding specific
db3e571a
RD
9778 colours or fonts which might look completely out of place on the
9779 user's system, especially if it uses themes.
74a57fcd
RD
9780
9781 The variant parameter is only relevant under Mac currently and is
41e2b43e 9782 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
9783 the returned font. See `wx.Window.SetWindowVariant` for more about
9784 this.
74a57fcd 9785 """
54f9ee45 9786 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9787
9788 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 9789 def SetBackgroundColour(*args, **kwargs):
15afbcd0 9790 """
a95a7133 9791 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
9792
9793 Sets the background colour of the window. Returns True if the colour
9794 was changed. The background colour is usually painted by the default
9795 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9796 automatically under GTK. Using `wx.NullColour` will reset the window
9797 to the default background colour.
15afbcd0 9798
db3e571a 9799 Note that setting the background colour may not cause an immediate
f8167d6e 9800 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
9801 calling this function.
9802
f8167d6e
RD
9803 Using this function will disable attempts to use themes for this
9804 window, if the system supports them. Use with care since usually the
9805 themes represent the appearance chosen by the user to be used for all
9806 applications on the system.
15afbcd0 9807 """
54f9ee45 9808 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 9809
412d302d
RD
9810 def SetOwnBackgroundColour(*args, **kwargs):
9811 """SetOwnBackgroundColour(self, Colour colour)"""
9812 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 9813
e811c8ce 9814 def SetForegroundColour(*args, **kwargs):
15afbcd0 9815 """
a95a7133 9816 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
9817
9818 Sets the foreground colour of the window. Returns True is the colour
9819 was changed. The interpretation of foreground colour is dependent on
9820 the window class; it may be the text colour or other colour, or it may
9821 not be used at all.
9822 """
54f9ee45 9823 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 9824
fa47d7a7
VS
9825 def SetOwnForegroundColour(*args, **kwargs):
9826 """SetOwnForegroundColour(self, Colour colour)"""
9827 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 9828
e811c8ce 9829 def GetBackgroundColour(*args, **kwargs):
15afbcd0 9830 """
a95a7133 9831 GetBackgroundColour(self) -> Colour
15afbcd0
RD
9832
9833 Returns the background colour of the window.
9834 """
54f9ee45 9835 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
9836
9837 def GetForegroundColour(*args, **kwargs):
15afbcd0 9838 """
a95a7133 9839 GetForegroundColour(self) -> Colour
15afbcd0
RD
9840
9841 Returns the foreground colour of the window. The interpretation of
9842 foreground colour is dependent on the window class; it may be the text
9843 colour or other colour, or it may not be used at all.
9844 """
54f9ee45 9845 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 9846
562ecc31
RD
9847 def InheritsBackgroundColour(*args, **kwargs):
9848 """InheritsBackgroundColour(self) -> bool"""
9849 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9850
9851 def UseBgCol(*args, **kwargs):
9852 """UseBgCol(self) -> bool"""
9853 return _core_.Window_UseBgCol(*args, **kwargs)
9854
7bc1e663
RD
9855 def SetBackgroundStyle(*args, **kwargs):
9856 """
9857 SetBackgroundStyle(self, int style) -> bool
9858
9859 Returns the background style of the window. The background style
9860 indicates how the background of the window is drawn.
9861
9862 ====================== ========================================
9863 wx.BG_STYLE_SYSTEM The background colour or pattern should
9864 be determined by the system
9865 wx.BG_STYLE_COLOUR The background should be a solid colour
9866 wx.BG_STYLE_CUSTOM The background will be implemented by the
9867 application.
9868 ====================== ========================================
9869
9870 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9871 a custom background, such as a tiled bitmap. Currently the style has
9872 no effect on other platforms.
9873
9874 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9875 """
9876 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9877
9878 def GetBackgroundStyle(*args, **kwargs):
9879 """
9880 GetBackgroundStyle(self) -> int
9881
9882 Returns the background style of the window.
9883
9884 :see: `SetBackgroundStyle`
9885 """
9886 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9887
51b83b37
RD
9888 def HasTransparentBackground(*args, **kwargs):
9889 """
9890 HasTransparentBackground(self) -> bool
9891
9892 Returns True if this window's background is transparent (as, for
9893 example, for `wx.StaticText`) and should show the parent window's
9894 background.
9895
9896 This method is mostly used internally by the library itself and you
9897 normally shouldn't have to call it. You may, however, have to override
9898 it in your custom control classes to ensure that background is painted
9899 correctly.
9900 """
9901 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9902
e811c8ce 9903 def SetCursor(*args, **kwargs):
15afbcd0 9904 """
a95a7133 9905 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
9906
9907 Sets the window's cursor. Notice that the window cursor also sets it
9908 for the children of the window implicitly.
9909
9910 The cursor may be wx.NullCursor in which case the window cursor will
9911 be reset back to default.
9912 """
54f9ee45 9913 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
9914
9915 def GetCursor(*args, **kwargs):
15afbcd0 9916 """
a95a7133 9917 GetCursor(self) -> Cursor
15afbcd0
RD
9918
9919 Return the cursor associated with this window.
9920 """
54f9ee45 9921 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
9922
9923 def SetFont(*args, **kwargs):
15afbcd0 9924 """
a95a7133 9925 SetFont(self, Font font) -> bool
15afbcd0
RD
9926
9927 Sets the font for this window.
9928 """
54f9ee45 9929 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 9930
fa47d7a7
VS
9931 def SetOwnFont(*args, **kwargs):
9932 """SetOwnFont(self, Font font)"""
9933 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 9934
e811c8ce 9935 def GetFont(*args, **kwargs):
15afbcd0 9936 """
a95a7133 9937 GetFont(self) -> Font
15afbcd0 9938
4276dc52 9939 Returns the default font used for this window.
15afbcd0 9940 """
54f9ee45 9941 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
9942
9943 def SetCaret(*args, **kwargs):
15afbcd0 9944 """
a95a7133 9945 SetCaret(self, Caret caret)
15afbcd0
RD
9946
9947 Sets the caret associated with the window.
9948 """
54f9ee45 9949 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
9950
9951 def GetCaret(*args, **kwargs):
15afbcd0 9952 """
a95a7133 9953 GetCaret(self) -> Caret
15afbcd0
RD
9954
9955 Returns the caret associated with the window.
9956 """
54f9ee45 9957 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
9958
9959 def GetCharHeight(*args, **kwargs):
15afbcd0 9960 """
a95a7133 9961 GetCharHeight(self) -> int
15afbcd0
RD
9962
9963 Get the (average) character size for the current font.
9964 """
54f9ee45 9965 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
9966
9967 def GetCharWidth(*args, **kwargs):
15afbcd0 9968 """
a95a7133 9969 GetCharWidth(self) -> int
15afbcd0
RD
9970
9971 Get the (average) character size for the current font.
9972 """
54f9ee45 9973 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
9974
9975 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9976 """
9977 GetTextExtent(String string) -> (width, height)
9978
9979 Get the width and height of the text using the current font.
9980 """
54f9ee45 9981 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
9982
9983 def GetFullTextExtent(*args, **kwargs):
0df68c9f 9984 """
196addbf 9985 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 9986 (width, height, descent, externalLeading)
e811c8ce 9987
15afbcd0
RD
9988 Get the width, height, decent and leading of the text using the
9989 current or specified font.
0df68c9f 9990 """
54f9ee45 9991 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
9992
9993 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
9994 """
9995 ClientToScreenXY(int x, int y) -> (x,y)
9996
9997 Converts to screen coordinates from coordinates relative to this window.
9998 """
54f9ee45 9999 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
10000
10001 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
10002 """
10003 ScreenToClientXY(int x, int y) -> (x,y)
10004
10005 Converts from screen to client window coordinates.
10006 """
54f9ee45 10007 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
10008
10009 def ClientToScreen(*args, **kwargs):
15afbcd0 10010 """
a95a7133 10011 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
10012
10013 Converts to screen coordinates from coordinates relative to this window.
10014 """
54f9ee45 10015 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
10016
10017 def ScreenToClient(*args, **kwargs):
15afbcd0 10018 """
a95a7133 10019 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
10020
10021 Converts from screen to client window coordinates.
10022 """
54f9ee45 10023 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
10024
10025 def HitTestXY(*args, **kwargs):
15afbcd0 10026 """
a95a7133 10027 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
10028
10029 Test where the given (in client coords) point lies
10030 """
54f9ee45 10031 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
10032
10033 def HitTest(*args, **kwargs):
15afbcd0 10034 """
a95a7133 10035 HitTest(self, Point pt) -> int
15afbcd0
RD
10036
10037 Test where the given (in client coords) point lies
10038 """
54f9ee45 10039 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 10040
15afbcd0
RD
10041 def GetBorder(*args):
10042 """
a95a7133
RD
10043 GetBorder(self, long flags) -> int
10044 GetBorder(self) -> int
e811c8ce 10045
15afbcd0
RD
10046 Get border for the flags of this window
10047 """
54f9ee45 10048 return _core_.Window_GetBorder(*args)
e811c8ce
RD
10049
10050 def UpdateWindowUI(*args, **kwargs):
15afbcd0 10051 """
a95a7133 10052 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
10053
10054 This function sends EVT_UPDATE_UI events to the window. The particular
10055 implementation depends on the window; for example a wx.ToolBar will
10056 send an update UI event for each toolbar button, and a wx.Frame will
10057 send an update UI event for each menubar menu item. You can call this
10058 function from your application to ensure that your UI is up-to-date at
10059 a particular point in time (as far as your EVT_UPDATE_UI handlers are
10060 concerned). This may be necessary if you have called
5ba5649b 10061 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
15afbcd0
RD
10062 limit the overhead that wxWindows incurs by sending update UI events
10063 in idle time.
15afbcd0 10064 """
54f9ee45 10065 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
10066
10067 def PopupMenuXY(*args, **kwargs):
15afbcd0 10068 """
b0503257 10069 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 10070
b0503257
RD
10071 Pops up the given menu at the specified coordinates, relative to this window,
10072 and returns control when the user has dismissed the menu. If a menu item is
10073 selected, the corresponding menu event is generated and will be processed as
10074 usual. If the default position is given then the current position of the
10075 mouse cursor will be used.
15afbcd0 10076 """
54f9ee45 10077 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 10078
15afbcd0
RD
10079 def PopupMenu(*args, **kwargs):
10080 """
b0503257 10081 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 10082
b0503257
RD
10083 Pops up the given menu at the specified coordinates, relative to this window,
10084 and returns control when the user has dismissed the menu. If a menu item is
10085 selected, the corresponding menu event is generated and will be processed as
10086 usual. If the default position is given then the current position of the
10087 mouse cursor will be used.
15afbcd0 10088 """
54f9ee45 10089 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0 10090
10044bf1
RD
10091 def HasMultiplePages(*args, **kwargs):
10092 """HasMultiplePages(self) -> bool"""
10093 return _core_.Window_HasMultiplePages(*args, **kwargs)
10094
15afbcd0
RD
10095 def GetHandle(*args, **kwargs):
10096 """
a95a7133 10097 GetHandle(self) -> long
15afbcd0
RD
10098
10099 Returns the platform-specific handle (as a long integer) of the
10100 physical window. Currently on wxMac it returns the handle of the
10101 toplevel parent of the window.
10102 """
54f9ee45 10103 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 10104
7e63a440
RD
10105 def AssociateHandle(*args, **kwargs):
10106 """
10107 AssociateHandle(self, long handle)
10108
10109 Associate the window with a new native handle
10110 """
10111 return _core_.Window_AssociateHandle(*args, **kwargs)
10112
10113 def DissociateHandle(*args, **kwargs):
10114 """
10115 DissociateHandle(self)
10116
10117 Dissociate the current native handle from the window
10118 """
10119 return _core_.Window_DissociateHandle(*args, **kwargs)
10120
15afbcd0
RD
10121 def HasScrollbar(*args, **kwargs):
10122 """
a95a7133 10123 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
10124
10125 Does the window have the scrollbar for this orientation?
10126 """
54f9ee45 10127 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
10128
10129 def SetScrollbar(*args, **kwargs):
10130 """
41e2b43e 10131 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
10132 bool refresh=True)
10133
10134 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 10135 """
54f9ee45 10136 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
10137
10138 def SetScrollPos(*args, **kwargs):
15afbcd0 10139 """
a95a7133 10140 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
10141
10142 Sets the position of one of the built-in scrollbars.
10143 """
54f9ee45 10144 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
10145
10146 def GetScrollPos(*args, **kwargs):
15afbcd0 10147 """
a95a7133 10148 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
10149
10150 Returns the built-in scrollbar position.
10151 """
54f9ee45 10152 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
10153
10154 def GetScrollThumb(*args, **kwargs):
15afbcd0 10155 """
a95a7133 10156 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
10157
10158 Returns the built-in scrollbar thumb size.
10159 """
54f9ee45 10160 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
10161
10162 def GetScrollRange(*args, **kwargs):
15afbcd0 10163 """
a95a7133 10164 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
10165
10166 Returns the built-in scrollbar range.
10167 """
54f9ee45 10168 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
10169
10170 def ScrollWindow(*args, **kwargs):
15afbcd0 10171 """
a95a7133 10172 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
10173
10174 Physically scrolls the pixels in the window and move child windows
10175 accordingly. Use this function to optimise your scrolling
10176 implementations, to minimise the area that must be redrawn. Note that
10177 it is rarely required to call this function from a user program.
15afbcd0 10178 """
54f9ee45 10179 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
10180
10181 def ScrollLines(*args, **kwargs):
15afbcd0 10182 """
a95a7133 10183 ScrollLines(self, int lines) -> bool
15afbcd0
RD
10184
10185 If the platform and window class supports it, scrolls the window by
10186 the given number of lines down, if lines is positive, or up if lines
10187 is negative. Returns True if the window was scrolled, False if it was
10188 already on top/bottom and nothing was done.
10189 """
54f9ee45 10190 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
10191
10192 def ScrollPages(*args, **kwargs):
15afbcd0 10193 """
a95a7133 10194 ScrollPages(self, int pages) -> bool
15afbcd0 10195
41e2b43e 10196 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
10197 the given number of pages down, if pages is positive, or up if pages
10198 is negative. Returns True if the window was scrolled, False if it was
10199 already on top/bottom and nothing was done.
10200 """
54f9ee45 10201 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
10202
10203 def LineUp(*args, **kwargs):
15afbcd0 10204 """
a95a7133 10205 LineUp(self) -> bool
15afbcd0
RD
10206
10207 This is just a wrapper for ScrollLines(-1).
10208 """
54f9ee45 10209 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
10210
10211 def LineDown(*args, **kwargs):
15afbcd0 10212 """
a95a7133 10213 LineDown(self) -> bool
15afbcd0
RD
10214
10215 This is just a wrapper for ScrollLines(1).
10216 """
54f9ee45 10217 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
10218
10219 def PageUp(*args, **kwargs):
15afbcd0 10220 """
a95a7133 10221 PageUp(self) -> bool
15afbcd0
RD
10222
10223 This is just a wrapper for ScrollPages(-1).
10224 """
54f9ee45 10225 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
10226
10227 def PageDown(*args, **kwargs):
15afbcd0 10228 """
a95a7133 10229 PageDown(self) -> bool
15afbcd0
RD
10230
10231 This is just a wrapper for ScrollPages(1).
10232 """
54f9ee45 10233 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
10234
10235 def SetHelpText(*args, **kwargs):
15afbcd0 10236 """
a95a7133 10237 SetHelpText(self, String text)
15afbcd0
RD
10238
10239 Sets the help text to be used as context-sensitive help for this
10240 window. Note that the text is actually stored by the current
f52cbe90 10241 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 10242 """
54f9ee45 10243 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
10244
10245 def SetHelpTextForId(*args, **kwargs):
15afbcd0 10246 """
a95a7133 10247 SetHelpTextForId(self, String text)
15afbcd0
RD
10248
10249 Associate this help text with all windows with the same id as this
10250 one.
10251 """
54f9ee45 10252 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce 10253
b850e7f3
RD
10254 def GetHelpTextAtPoint(*args, **kwargs):
10255 """
10256 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
10257
10258 Get the help string associated with the given position in this window.
10259
10260 Notice that pt may be invalid if event origin is keyboard or unknown
10261 and this method should return the global window help text then
10262
10263 """
10264 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
10265
e811c8ce 10266 def GetHelpText(*args, **kwargs):
15afbcd0 10267 """
a95a7133 10268 GetHelpText(self) -> String
15afbcd0
RD
10269
10270 Gets the help text to be used as context-sensitive help for this
10271 window. Note that the text is actually stored by the current
f52cbe90 10272 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 10273 """
54f9ee45 10274 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
10275
10276 def SetToolTipString(*args, **kwargs):
15afbcd0 10277 """
a95a7133 10278 SetToolTipString(self, String tip)
15afbcd0
RD
10279
10280 Attach a tooltip to the window.
10281 """
54f9ee45 10282 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
10283
10284 def SetToolTip(*args, **kwargs):
15afbcd0 10285 """
a95a7133 10286 SetToolTip(self, ToolTip tip)
15afbcd0
RD
10287
10288 Attach a tooltip to the window.
10289 """
54f9ee45 10290 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
10291
10292 def GetToolTip(*args, **kwargs):
15afbcd0 10293 """
a95a7133 10294 GetToolTip(self) -> ToolTip
15afbcd0
RD
10295
10296 get the associated tooltip or None if none
10297 """
54f9ee45 10298 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
10299
10300 def SetDropTarget(*args, **kwargs):
15afbcd0 10301 """
a95a7133 10302 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
10303
10304 Associates a drop target with this window. If the window already has
10305 a drop target, it is deleted.
10306 """
54f9ee45 10307 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
10308
10309 def GetDropTarget(*args, **kwargs):
15afbcd0 10310 """
a95a7133 10311 GetDropTarget(self) -> DropTarget
15afbcd0
RD
10312
10313 Returns the associated drop target, which may be None.
10314 """
54f9ee45 10315 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce 10316
5ba5649b
RD
10317 def DragAcceptFiles(*args, **kwargs):
10318 """
10319 DragAcceptFiles(self, bool accept)
10320
10321 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10322 Only functional on Windows.
10323 """
10324 return _core_.Window_DragAcceptFiles(*args, **kwargs)
10325
e811c8ce 10326 def SetConstraints(*args, **kwargs):
15afbcd0 10327 """
a95a7133 10328 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
10329
10330 Sets the window to have the given layout constraints. If an existing
10331 layout constraints object is already owned by the window, it will be
10332 deleted. Pass None to disassociate and delete the window's current
10333 constraints.
10334
10335 You must call SetAutoLayout to tell a window to use the constraints
10336 automatically in its default EVT_SIZE handler; otherwise, you must
10337 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10338 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10339 effect.
10340 """
54f9ee45 10341 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
10342
10343 def GetConstraints(*args, **kwargs):
15afbcd0 10344 """
a95a7133 10345 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
10346
10347 Returns a pointer to the window's layout constraints, or None if there
10348 are none.
10349 """
54f9ee45 10350 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
10351
10352 def SetAutoLayout(*args, **kwargs):
15afbcd0 10353 """
a95a7133 10354 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
10355
10356 Determines whether the Layout function will be called automatically
b1fcee84
RD
10357 when the window is resized. lease note that this only happens for the
10358 windows usually used to contain children, namely `wx.Panel` and
10359 `wx.TopLevelWindow` (and the classes deriving from them).
10360
10361 This method is called implicitly by `SetSizer` but if you use
10362 `SetConstraints` you should call it manually or otherwise the window
10363 layout won't be correctly updated when its size changes.
15afbcd0 10364 """
54f9ee45 10365 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
10366
10367 def GetAutoLayout(*args, **kwargs):
15afbcd0 10368 """
a95a7133 10369 GetAutoLayout(self) -> bool
15afbcd0
RD
10370
10371 Returns the current autoLayout setting
10372 """
54f9ee45 10373 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
10374
10375 def Layout(*args, **kwargs):
15afbcd0 10376 """
a95a7133 10377 Layout(self) -> bool
15afbcd0
RD
10378
10379 Invokes the constraint-based layout algorithm or the sizer-based
10380 algorithm for this window. See SetAutoLayout: when auto layout is on,
10381 this function gets called automatically by the default EVT_SIZE
10382 handler when the window is resized.
10383 """
54f9ee45 10384 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
10385
10386 def SetSizer(*args, **kwargs):
15afbcd0 10387 """
a95a7133 10388 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
10389
10390 Sets the window to have the given layout sizer. The window will then
10391 own the object, and will take care of its deletion. If an existing
10392 layout sizer object is already owned by the window, it will be deleted
10393 if the deleteOld parameter is true. Note that this function will also
10394 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 10395 non-None, and False otherwise.
15afbcd0 10396 """
54f9ee45 10397 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
10398
10399 def SetSizerAndFit(*args, **kwargs):
15afbcd0 10400 """
a95a7133 10401 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
10402
10403 The same as SetSizer, except it also sets the size hints for the
10404 window based on the sizer's minimum size.
10405 """
54f9ee45 10406 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
10407
10408 def GetSizer(*args, **kwargs):
15afbcd0 10409 """
a95a7133 10410 GetSizer(self) -> Sizer
15afbcd0
RD
10411
10412 Return the sizer associated with the window by a previous call to
10413 SetSizer or None if there isn't one.
10414 """
54f9ee45 10415 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
10416
10417 def SetContainingSizer(*args, **kwargs):
15afbcd0 10418 """
a95a7133 10419 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
10420
10421 This normally does not need to be called by application code. It is
10422 called internally when a window is added to a sizer, and is used so
10423 the window can remove itself from the sizer when it is destroyed.
10424 """
54f9ee45 10425 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
10426
10427 def GetContainingSizer(*args, **kwargs):
15afbcd0 10428 """
a95a7133 10429 GetContainingSizer(self) -> Sizer
15afbcd0
RD
10430
10431 Return the sizer that this window is a member of, if any, otherwise None.
10432 """
54f9ee45 10433 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 10434
a95a7133
RD
10435 def InheritAttributes(*args, **kwargs):
10436 """
10437 InheritAttributes(self)
10438
41e2b43e
RD
10439 This function is (or should be, in case of custom controls) called
10440 during window creation to intelligently set up the window visual
10441 attributes, that is the font and the foreground and background
10442 colours.
10443
10444 By 'intelligently' the following is meant: by default, all windows use
10445 their own default attributes. However if some of the parent's
10446 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10447 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
10448 explicitly set for this window itself, then this window takes the same
10449 value as used by the parent. In addition, if the window overrides
10450 ShouldInheritColours to return false, the colours will not be changed
10451 no matter what and only the font might.
10452
34621cc5 10453 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 10454 different usage scenarios. The most common one is when all default
41e2b43e
RD
10455 attributes are used and in this case, nothing should be inherited as
10456 in modern GUIs different controls use different fonts (and colours)
10457 than their siblings so they can't inherit the same value from the
10458 parent. However it was also deemed desirable to allow to simply change
10459 the attributes of all children at once by just changing the font or
10460 colour of their common parent, hence in this case we do inherit the
10461 parents attributes.
10462
a95a7133 10463 """
54f9ee45 10464 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
10465
10466 def ShouldInheritColours(*args, **kwargs):
10467 """
10468 ShouldInheritColours(self) -> bool
10469
10470 Return true from here to allow the colours of this window to be
41e2b43e
RD
10471 changed by InheritAttributes, returning false forbids inheriting them
10472 from the parent window.
a95a7133 10473
41e2b43e
RD
10474 The base class version returns false, but this method is overridden in
10475 wxControl where it returns true.
a95a7133 10476 """
54f9ee45 10477 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 10478
fc46b7f3
RD
10479 def CanSetTransparent(*args, **kwargs):
10480 """
10481 CanSetTransparent(self) -> bool
10482
10483 Returns ``True`` if the platform supports setting the transparency for
10484 this window. Note that this method will err on the side of caution,
10485 so it is possible that this will return ``False`` when it is in fact
10486 possible to set the transparency.
10487
10488 NOTE: On X-windows systems the X server must have the composite
10489 extension loaded, and there must be a composite manager program (such
10490 as xcompmgr) running.
10491 """
10492 return _core_.Window_CanSetTransparent(*args, **kwargs)
10493
10494 def SetTransparent(*args, **kwargs):
10495 """
10496 SetTransparent(self, byte alpha) -> bool
10497
10498 Attempt to set the transparency of this window to the ``alpha`` value,
10499 returns True on success. The ``alpha`` value is an integer in the
10500 range of 0 to 255, where 0 is fully transparent and 255 is fully
10501 opaque.
10502 """
10503 return _core_.Window_SetTransparent(*args, **kwargs)
10504
e811c8ce 10505 def PostCreate(self, pre):
15afbcd0
RD
10506 """
10507 Phase 3 of the 2-phase create <wink!>
10508 Call this method after precreating the window with the 2-phase create method.
10509 """
e811c8ce
RD
10510 self.this = pre.this
10511 self.thisown = pre.thisown
10512 pre.thisown = 0
10513 if hasattr(self, '_setOORInfo'):
4976f996
RD
10514 try:
10515 self._setOORInfo(self)
10516 except TypeError:
10517 pass
e811c8ce 10518 if hasattr(self, '_setCallbackInfo'):
4976f996
RD
10519 try:
10520 self._setCallbackInfo(self, pre.__class__)
10521 except TypeError:
10522 pass
e811c8ce 10523
7e08d4ef 10524 def SendSizeEvent(self):
453fb36b 10525 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 10526
2bf58437 10527 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
2bf58437
RD
10528 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10529 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10530 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
580080c5 10531 EffectiveMinSize = property(GetEffectiveMinSize,doc="See `GetEffectiveMinSize`")
2bf58437
RD
10532 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10533 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10534 Border = property(GetBorder,doc="See `GetBorder`")
10535 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10536 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10537 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10538 Children = property(GetChildren,doc="See `GetChildren`")
10539 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10540 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10541 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10542 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10543 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10544 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10545 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10546 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10547 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10548 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10549 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10550 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
2bf58437 10551 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
cbfc9df6 10552 TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`")
2bf58437
RD
10553 Handle = property(GetHandle,doc="See `GetHandle`")
10554 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
2bf58437
RD
10555 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10556 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
994453b8 10557 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
2bf58437
RD
10558 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10559 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10560 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10561 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10562 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10563 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10564 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10565 Parent = property(GetParent,doc="See `GetParent`")
10566 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10567 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10568 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10569 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
2bf58437
RD
10570 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10571 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
2bf58437
RD
10572 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10573 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10574 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10575 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10576 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10577 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10578 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10579 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10580 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
97ab0f6a
RD
10581 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10582 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10583 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
2131d850 10584_core_.Window_swigregister(Window)
e811c8ce
RD
10585
10586def PreWindow(*args, **kwargs):
15afbcd0
RD
10587 """
10588 PreWindow() -> Window
10589
10590 Precreate a Window for 2-phase creation.
10591 """
54f9ee45 10592 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
10593 return val
10594
0085ce49
RD
10595def Window_NewControlId(*args):
10596 """
15afbcd0
RD
10597 Window_NewControlId() -> int
10598
10599 Generate a control id for the controls which were not given one.
10600 """
0085ce49 10601 return _core_.Window_NewControlId(*args)
e811c8ce
RD
10602
10603def Window_NextControlId(*args, **kwargs):
0085ce49 10604 """
15afbcd0
RD
10605 Window_NextControlId(int winid) -> int
10606
10607 Get the id of the control following the one with the given
41e2b43e 10608 autogenerated) id
15afbcd0 10609 """
0085ce49 10610 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
10611
10612def Window_PrevControlId(*args, **kwargs):
0085ce49 10613 """
15afbcd0
RD
10614 Window_PrevControlId(int winid) -> int
10615
10616 Get the id of the control preceding the one with the given
41e2b43e 10617 autogenerated) id
15afbcd0 10618 """
0085ce49 10619 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce 10620
0085ce49
RD
10621def Window_FindFocus(*args):
10622 """
15afbcd0
RD
10623 Window_FindFocus() -> Window
10624
10625 Returns the window or control that currently has the keyboard focus,
10626 or None.
10627 """
0085ce49 10628 return _core_.Window_FindFocus(*args)
e811c8ce 10629
0085ce49
RD
10630def Window_GetCapture(*args):
10631 """
15afbcd0
RD
10632 Window_GetCapture() -> Window
10633
10634 Returns the window which currently captures the mouse or None
10635 """
0085ce49 10636 return _core_.Window_GetCapture(*args)
e811c8ce 10637
74a57fcd 10638def Window_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 10639 """
74a57fcd
RD
10640 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10641
41e2b43e
RD
10642 Get the default attributes for this class. This is useful if you want
10643 to use the same font or colour in your own control as in a standard
10644 control -- which is a much better idea than hard coding specific
db3e571a
RD
10645 colours or fonts which might look completely out of place on the
10646 user's system, especially if it uses themes.
74a57fcd
RD
10647
10648 The variant parameter is only relevant under Mac currently and is
41e2b43e 10649 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
10650 the returned font. See `wx.Window.SetWindowVariant` for more about
10651 this.
74a57fcd 10652 """
0085ce49 10653 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 10654
e811c8ce 10655def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
10656 """
10657 Convenience function for converting a Point or (x,y) in
10658 dialog units to pixel units.
10659 """
e811c8ce
RD
10660 if y is None:
10661 return win.ConvertDialogPointToPixels(point_or_x)
10662 else:
fd3f2efe 10663 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
10664
10665def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
10666 """
10667 Convenience function for converting a Size or (w,h) in
10668 dialog units to pixel units.
10669 """
e811c8ce
RD
10670 if height is None:
10671 return win.ConvertDialogSizeToPixels(size_width)
10672 else:
fd3f2efe 10673 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
10674
10675
10676def FindWindowById(*args, **kwargs):
0085ce49 10677 """
15afbcd0
RD
10678 FindWindowById(long id, Window parent=None) -> Window
10679
10680 Find the first window in the application with the given id. If parent
10681 is None, the search will start from all top-level frames and dialog
10682 boxes; if non-None, the search will be limited to the given window
10683 hierarchy. The search is recursive in both cases.
10684 """
0085ce49 10685 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
10686
10687def FindWindowByName(*args, **kwargs):
0085ce49 10688 """
15afbcd0
RD
10689 FindWindowByName(String name, Window parent=None) -> Window
10690
10691 Find a window by its name (as given in a window constructor or Create
10692 function call). If parent is None, the search will start from all
10693 top-level frames and dialog boxes; if non-None, the search will be
10694 limited to the given window hierarchy. The search is recursive in both
10695 cases.
10696
10697 If no window with such name is found, wx.FindWindowByLabel is called.
10698 """
0085ce49 10699 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
10700
10701def FindWindowByLabel(*args, **kwargs):
0085ce49 10702 """
15afbcd0
RD
10703 FindWindowByLabel(String label, Window parent=None) -> Window
10704
10705 Find a window by its label. Depending on the type of window, the label
10706 may be a window title or panel item label. If parent is None, the
10707 search will start from all top-level frames and dialog boxes; if
10708 non-None, the search will be limited to the given window
10709 hierarchy. The search is recursive in both cases.
10710 """
0085ce49 10711 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
10712
10713def Window_FromHWND(*args, **kwargs):
0085ce49
RD
10714 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10715 return _core_.Window_FromHWND(*args, **kwargs)
b6b0383e 10716
0085ce49
RD
10717def GetTopLevelWindows(*args):
10718 """
b6b0383e
RD
10719 GetTopLevelWindows() -> PyObject
10720
10721 Returns a list of the the application's top-level windows, (frames,
10722 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10723 by wxWidgets, and so it is only valid as long as no top-level windows
10724 are closed or new top-level windows are created.
10725
10726 """
0085ce49 10727 return _core_.GetTopLevelWindows(*args)
e811c8ce
RD
10728#---------------------------------------------------------------------------
10729
10730class Validator(EvtHandler):
093d3ff1 10731 """Proxy of C++ Validator class"""
0085ce49
RD
10732 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10733 __repr__ = _swig_repr
10734 def __init__(self, *args, **kwargs):
a95a7133 10735 """__init__(self) -> Validator"""
0085ce49 10736 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d14a1e28 10737 self._setOORInfo(self)
e811c8ce
RD
10738
10739 def Clone(*args, **kwargs):
a95a7133 10740 """Clone(self) -> Validator"""
54f9ee45 10741 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
10742
10743 def Validate(*args, **kwargs):
a95a7133 10744 """Validate(self, Window parent) -> bool"""
54f9ee45 10745 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
10746
10747 def TransferToWindow(*args, **kwargs):
a95a7133 10748 """TransferToWindow(self) -> bool"""
54f9ee45 10749 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
10750
10751 def TransferFromWindow(*args, **kwargs):
a95a7133 10752 """TransferFromWindow(self) -> bool"""
54f9ee45 10753 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
10754
10755 def GetWindow(*args, **kwargs):
a95a7133 10756 """GetWindow(self) -> Window"""
54f9ee45 10757 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
10758
10759 def SetWindow(*args, **kwargs):
a95a7133 10760 """SetWindow(self, Window window)"""
54f9ee45 10761 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
10762
10763 def IsSilent(*args, **kwargs):
66c033b4 10764 """IsSilent() -> bool"""
54f9ee45 10765 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
10766
10767 IsSilent = staticmethod(IsSilent)
10768 def SetBellOnError(*args, **kwargs):
66c033b4 10769 """SetBellOnError(int doIt=True)"""
54f9ee45 10770 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10771
10772 SetBellOnError = staticmethod(SetBellOnError)
dba7934c 10773 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 10774_core_.Validator_swigregister(Validator)
e811c8ce 10775
0085ce49
RD
10776def Validator_IsSilent(*args):
10777 """Validator_IsSilent() -> bool"""
10778 return _core_.Validator_IsSilent(*args)
e811c8ce
RD
10779
10780def Validator_SetBellOnError(*args, **kwargs):
0085ce49
RD
10781 """Validator_SetBellOnError(int doIt=True)"""
10782 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10783
10784class PyValidator(Validator):
093d3ff1 10785 """Proxy of C++ PyValidator class"""
0085ce49
RD
10786 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10787 __repr__ = _swig_repr
10788 def __init__(self, *args, **kwargs):
a95a7133 10789 """__init__(self) -> PyValidator"""
0085ce49 10790 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
c25f90f6 10791 self._setOORInfo(self);PyValidator._setCallbackInfo(self, self, PyValidator)
e811c8ce
RD
10792
10793 def _setCallbackInfo(*args, **kwargs):
c25f90f6 10794 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
54f9ee45 10795 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce 10796
2131d850 10797_core_.PyValidator_swigregister(PyValidator)
e811c8ce
RD
10798
10799#---------------------------------------------------------------------------
10800
10801class Menu(EvtHandler):
093d3ff1 10802 """Proxy of C++ Menu class"""
0085ce49
RD
10803 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10804 __repr__ = _swig_repr
10805 def __init__(self, *args, **kwargs):
a95a7133 10806 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
0085ce49 10807 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
e811c8ce
RD
10808 self._setOORInfo(self)
10809
10810 def Append(*args, **kwargs):
97ab0f6a
RD
10811 """
10812 Append(self, int id, String text=EmptyString, String help=EmptyString,
10813 int kind=ITEM_NORMAL) -> MenuItem
10814 """
54f9ee45 10815 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
10816
10817 def AppendSeparator(*args, **kwargs):
a95a7133 10818 """AppendSeparator(self) -> MenuItem"""
54f9ee45 10819 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
10820
10821 def AppendCheckItem(*args, **kwargs):
a95a7133 10822 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10823 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
10824
10825 def AppendRadioItem(*args, **kwargs):
a95a7133 10826 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10827 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
10828
10829 def AppendMenu(*args, **kwargs):
a95a7133 10830 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10831 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce 10832
50efceee
RD
10833 def AppendSubMenu(*args, **kwargs):
10834 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10835 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10836
e811c8ce 10837 def AppendItem(*args, **kwargs):
a95a7133 10838 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10839 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce 10840
e811c8ce 10841 def InsertItem(*args, **kwargs):
a95a7133 10842 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 10843 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce 10844
0085ce49
RD
10845 def PrependItem(*args, **kwargs):
10846 """PrependItem(self, MenuItem item) -> MenuItem"""
10847 return _core_.Menu_PrependItem(*args, **kwargs)
10848
10849 def Break(*args, **kwargs):
10850 """Break(self)"""
10851 return _core_.Menu_Break(*args, **kwargs)
10852
e811c8ce 10853 def Insert(*args, **kwargs):
0df68c9f 10854 """
97ab0f6a 10855 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
a41e16b6 10856 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 10857 """
54f9ee45 10858 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
10859
10860 def InsertSeparator(*args, **kwargs):
a95a7133 10861 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 10862 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
10863
10864 def InsertCheckItem(*args, **kwargs):
a95a7133 10865 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10866 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
10867
10868 def InsertRadioItem(*args, **kwargs):
a95a7133 10869 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10870 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
10871
10872 def InsertMenu(*args, **kwargs):
a95a7133 10873 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10874 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce 10875
e811c8ce 10876 def Prepend(*args, **kwargs):
97ab0f6a
RD
10877 """
10878 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10879 int kind=ITEM_NORMAL) -> MenuItem
10880 """
54f9ee45 10881 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
10882
10883 def PrependSeparator(*args, **kwargs):
a95a7133 10884 """PrependSeparator(self) -> MenuItem"""
54f9ee45 10885 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
10886
10887 def PrependCheckItem(*args, **kwargs):
a95a7133 10888 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10889 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
10890
10891 def PrependRadioItem(*args, **kwargs):
a95a7133 10892 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10893 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
10894
10895 def PrependMenu(*args, **kwargs):
a95a7133 10896 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10897 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
10898
10899 def Remove(*args, **kwargs):
a95a7133 10900 """Remove(self, int id) -> MenuItem"""
54f9ee45 10901 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce 10902
59ccbf7f 10903 def RemoveItem(self, item):
a95a7133 10904 """RemoveItem(self, MenuItem item) -> MenuItem"""
59ccbf7f
RD
10905 #// The return object is always the parameter, so return that
10906 #// proxy instead of the new one
10907 val = _core_.Menu_RemoveItem(self, item)
10908 item.this.own(val.this.own())
10909 val.this.disown()
10910 return item
10911
e811c8ce
RD
10912
10913 def Delete(*args, **kwargs):
a95a7133 10914 """Delete(self, int id) -> bool"""
54f9ee45 10915 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
10916
10917 def DeleteItem(*args, **kwargs):
a95a7133 10918 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 10919 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
10920
10921 def Destroy(*args, **kwargs):
0df68c9f 10922 """
a95a7133 10923 Destroy(self)
e811c8ce 10924
0df68c9f
RD
10925 Deletes the C++ object this Python object is a proxy for.
10926 """
b39fe951
RD
10927 args[0].this.own(False)
10928 return _core_.Menu_Destroy(*args, **kwargs)
e811c8ce
RD
10929
10930 def DestroyId(*args, **kwargs):
b39fe951
RD
10931 """DestroyId(self, int id) -> bool"""
10932 return _core_.Menu_DestroyId(*args, **kwargs)
e811c8ce
RD
10933
10934 def DestroyItem(*args, **kwargs):
b39fe951
RD
10935 """DestroyItem(self, MenuItem item) -> bool"""
10936 return _core_.Menu_DestroyItem(*args, **kwargs)
e811c8ce
RD
10937
10938 def GetMenuItemCount(*args, **kwargs):
a95a7133 10939 """GetMenuItemCount(self) -> size_t"""
54f9ee45 10940 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
10941
10942 def GetMenuItems(*args, **kwargs):
a95a7133 10943 """GetMenuItems(self) -> PyObject"""
54f9ee45 10944 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
10945
10946 def FindItem(*args, **kwargs):
a95a7133 10947 """FindItem(self, String item) -> int"""
54f9ee45 10948 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
10949
10950 def FindItemById(*args, **kwargs):
a95a7133 10951 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10952 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
10953
10954 def FindItemByPosition(*args, **kwargs):
a95a7133 10955 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 10956 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
10957
10958 def Enable(*args, **kwargs):
a95a7133 10959 """Enable(self, int id, bool enable)"""
54f9ee45 10960 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
10961
10962 def IsEnabled(*args, **kwargs):
a95a7133 10963 """IsEnabled(self, int id) -> bool"""
54f9ee45 10964 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
10965
10966 def Check(*args, **kwargs):
a95a7133 10967 """Check(self, int id, bool check)"""
54f9ee45 10968 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
10969
10970 def IsChecked(*args, **kwargs):
a95a7133 10971 """IsChecked(self, int id) -> bool"""
54f9ee45 10972 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
10973
10974 def SetLabel(*args, **kwargs):
a95a7133 10975 """SetLabel(self, int id, String label)"""
54f9ee45 10976 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
10977
10978 def GetLabel(*args, **kwargs):
a95a7133 10979 """GetLabel(self, int id) -> String"""
54f9ee45 10980 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
10981
10982 def SetHelpString(*args, **kwargs):
a95a7133 10983 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10984 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
10985
10986 def GetHelpString(*args, **kwargs):
a95a7133 10987 """GetHelpString(self, int id) -> String"""
54f9ee45 10988 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
10989
10990 def SetTitle(*args, **kwargs):
a95a7133 10991 """SetTitle(self, String title)"""
54f9ee45 10992 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
10993
10994 def GetTitle(*args, **kwargs):
a95a7133 10995 """GetTitle(self) -> String"""
54f9ee45 10996 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
10997
10998 def SetEventHandler(*args, **kwargs):
a95a7133 10999 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 11000 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
11001
11002 def GetEventHandler(*args, **kwargs):
a95a7133 11003 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 11004 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
11005
11006 def SetInvokingWindow(*args, **kwargs):
a95a7133 11007 """SetInvokingWindow(self, Window win)"""
54f9ee45 11008 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
11009
11010 def GetInvokingWindow(*args, **kwargs):
a95a7133 11011 """GetInvokingWindow(self) -> Window"""
54f9ee45 11012 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
11013
11014 def GetStyle(*args, **kwargs):
a95a7133 11015 """GetStyle(self) -> long"""
54f9ee45 11016 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
11017
11018 def UpdateUI(*args, **kwargs):
a95a7133 11019 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 11020 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
11021
11022 def GetMenuBar(*args, **kwargs):
a95a7133 11023 """GetMenuBar(self) -> MenuBar"""
54f9ee45 11024 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
11025
11026 def Attach(*args, **kwargs):
a95a7133 11027 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 11028 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
11029
11030 def Detach(*args, **kwargs):
a95a7133 11031 """Detach(self)"""
54f9ee45 11032 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
11033
11034 def IsAttached(*args, **kwargs):
a95a7133 11035 """IsAttached(self) -> bool"""
54f9ee45 11036 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
11037
11038 def SetParent(*args, **kwargs):
a95a7133 11039 """SetParent(self, Menu parent)"""
54f9ee45 11040 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
11041
11042 def GetParent(*args, **kwargs):
a95a7133 11043 """GetParent(self) -> Menu"""
54f9ee45 11044 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 11045
57332a5a
RD
11046 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
11047 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
11048 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
11049 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
11050 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
11051 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
11052 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
11053 Style = property(GetStyle,doc="See `GetStyle`")
11054 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
2131d850 11055_core_.Menu_swigregister(Menu)
d14a1e28
RD
11056DefaultValidator = cvar.DefaultValidator
11057
11058#---------------------------------------------------------------------------
11059
11060class MenuBar(Window):
093d3ff1 11061 """Proxy of C++ MenuBar class"""
0085ce49
RD
11062 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11063 __repr__ = _swig_repr
11064 def __init__(self, *args, **kwargs):
a95a7133 11065 """__init__(self, long style=0) -> MenuBar"""
0085ce49 11066 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d14a1e28 11067 self._setOORInfo(self)
e811c8ce
RD
11068
11069 def Append(*args, **kwargs):
a95a7133 11070 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 11071 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
11072
11073 def Insert(*args, **kwargs):
a95a7133 11074 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 11075 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
11076
11077 def GetMenuCount(*args, **kwargs):
a95a7133 11078 """GetMenuCount(self) -> size_t"""
54f9ee45 11079 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
11080
11081 def GetMenu(*args, **kwargs):
a95a7133 11082 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 11083 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
11084
11085 def Replace(*args, **kwargs):
a95a7133 11086 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 11087 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
11088
11089 def Remove(*args, **kwargs):
a95a7133 11090 """Remove(self, size_t pos) -> Menu"""
54f9ee45 11091 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
11092
11093 def EnableTop(*args, **kwargs):
a95a7133 11094 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 11095 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
11096
11097 def IsEnabledTop(*args, **kwargs):
a95a7133 11098 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 11099 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
11100
11101 def SetLabelTop(*args, **kwargs):
a95a7133 11102 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 11103 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
11104
11105 def GetLabelTop(*args, **kwargs):
a95a7133 11106 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 11107 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
11108
11109 def FindMenuItem(*args, **kwargs):
a95a7133 11110 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 11111 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
11112
11113 def FindItemById(*args, **kwargs):
a95a7133 11114 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 11115 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
11116
11117 def FindMenu(*args, **kwargs):
a95a7133 11118 """FindMenu(self, String title) -> int"""
54f9ee45 11119 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
11120
11121 def Enable(*args, **kwargs):
a95a7133 11122 """Enable(self, int id, bool enable)"""
54f9ee45 11123 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
11124
11125 def Check(*args, **kwargs):
a95a7133 11126 """Check(self, int id, bool check)"""
54f9ee45 11127 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
11128
11129 def IsChecked(*args, **kwargs):
a95a7133 11130 """IsChecked(self, int id) -> bool"""
54f9ee45 11131 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
11132
11133 def IsEnabled(*args, **kwargs):
a95a7133 11134 """IsEnabled(self, int id) -> bool"""
54f9ee45 11135 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
11136
11137 def SetLabel(*args, **kwargs):
a95a7133 11138 """SetLabel(self, int id, String label)"""
54f9ee45 11139 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
11140
11141 def GetLabel(*args, **kwargs):
a95a7133 11142 """GetLabel(self, int id) -> String"""
54f9ee45 11143 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
11144
11145 def SetHelpString(*args, **kwargs):
a95a7133 11146 """SetHelpString(self, int id, String helpString)"""
54f9ee45 11147 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
11148
11149 def GetHelpString(*args, **kwargs):
a95a7133 11150 """GetHelpString(self, int id) -> String"""
54f9ee45 11151 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
11152
11153 def GetFrame(*args, **kwargs):
a95a7133 11154 """GetFrame(self) -> wxFrame"""
54f9ee45 11155 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
11156
11157 def IsAttached(*args, **kwargs):
a95a7133 11158 """IsAttached(self) -> bool"""
54f9ee45 11159 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
11160
11161 def Attach(*args, **kwargs):
a95a7133 11162 """Attach(self, wxFrame frame)"""
54f9ee45 11163 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
11164
11165 def Detach(*args, **kwargs):
a95a7133 11166 """Detach(self)"""
54f9ee45 11167 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 11168
587d0f36
RD
11169 def UpdateMenus(*args, **kwargs):
11170 """UpdateMenus(self)"""
11171 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
11172
4f433fef
RD
11173 def SetAutoWindowMenu(*args, **kwargs):
11174 """SetAutoWindowMenu(bool enable)"""
11175 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
11176
11177 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
11178 def GetAutoWindowMenu(*args, **kwargs):
11179 """GetAutoWindowMenu() -> bool"""
11180 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
11181
11182 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
97ab0f6a
RD
11183 def GetMenus(self):
11184 """Return a list of (menu, label) items for the menus in the MenuBar. """
11185 return [(self.GetMenu(i), self.GetLabelTop(i))
11186 for i in range(self.GetMenuCount())]
11187
11188 def SetMenus(self, items):
11189 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
11190 for i in range(self.GetMenuCount()-1, -1, -1):
11191 self.Remove(i)
11192 for m, l in items:
11193 self.Append(m, l)
11194
57332a5a 11195 Frame = property(GetFrame,doc="See `GetFrame`")
57332a5a
RD
11196 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
11197 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
2131d850 11198_core_.MenuBar_swigregister(MenuBar)
d14a1e28 11199
4f433fef 11200def MenuBar_SetAutoWindowMenu(*args, **kwargs):
0085ce49
RD
11201 """MenuBar_SetAutoWindowMenu(bool enable)"""
11202 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 11203
0085ce49
RD
11204def MenuBar_GetAutoWindowMenu(*args):
11205 """MenuBar_GetAutoWindowMenu() -> bool"""
11206 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 11207
d14a1e28
RD
11208#---------------------------------------------------------------------------
11209
11210class MenuItem(Object):
093d3ff1 11211 """Proxy of C++ MenuItem class"""
0085ce49
RD
11212 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11213 __repr__ = _swig_repr
11214 def __init__(self, *args, **kwargs):
0df68c9f 11215 """
89d1e2ee 11216 __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString,
196addbf
RD
11217 String help=EmptyString, int kind=ITEM_NORMAL,
11218 Menu subMenu=None) -> MenuItem
0df68c9f 11219 """
0085ce49
RD
11220 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
11221 __swig_destroy__ = _core_.delete_MenuItem
11222 __del__ = lambda self : None;
89d1e2ee 11223 def Destroy(self): pass
e811c8ce 11224 def GetMenu(*args, **kwargs):
a95a7133 11225 """GetMenu(self) -> Menu"""
54f9ee45 11226 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
11227
11228 def SetMenu(*args, **kwargs):
a95a7133 11229 """SetMenu(self, Menu menu)"""
54f9ee45 11230 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
11231
11232 def SetId(*args, **kwargs):
a95a7133 11233 """SetId(self, int id)"""
54f9ee45 11234 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
11235
11236 def GetId(*args, **kwargs):
a95a7133 11237 """GetId(self) -> int"""
54f9ee45 11238 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
11239
11240 def IsSeparator(*args, **kwargs):
a95a7133 11241 """IsSeparator(self) -> bool"""
54f9ee45 11242 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
11243
11244 def SetText(*args, **kwargs):
a95a7133 11245 """SetText(self, String str)"""
54f9ee45 11246 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
11247
11248 def GetLabel(*args, **kwargs):
a95a7133 11249 """GetLabel(self) -> String"""
54f9ee45 11250 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
11251
11252 def GetText(*args, **kwargs):
a95a7133 11253 """GetText(self) -> String"""
54f9ee45 11254 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
11255
11256 def GetLabelFromText(*args, **kwargs):
66c033b4 11257 """GetLabelFromText(String text) -> String"""
54f9ee45 11258 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
11259
11260 GetLabelFromText = staticmethod(GetLabelFromText)
11261 def GetKind(*args, **kwargs):
a95a7133 11262 """GetKind(self) -> int"""
54f9ee45 11263 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 11264
a95a7133
RD
11265 def SetKind(*args, **kwargs):
11266 """SetKind(self, int kind)"""
54f9ee45 11267 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 11268
e811c8ce 11269 def SetCheckable(*args, **kwargs):
a95a7133 11270 """SetCheckable(self, bool checkable)"""
54f9ee45 11271 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
11272
11273 def IsCheckable(*args, **kwargs):
a95a7133 11274 """IsCheckable(self) -> bool"""
54f9ee45 11275 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
11276
11277 def IsSubMenu(*args, **kwargs):
a95a7133 11278 """IsSubMenu(self) -> bool"""
54f9ee45 11279 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
11280
11281 def SetSubMenu(*args, **kwargs):
a95a7133 11282 """SetSubMenu(self, Menu menu)"""
54f9ee45 11283 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
11284
11285 def GetSubMenu(*args, **kwargs):
a95a7133 11286 """GetSubMenu(self) -> Menu"""
54f9ee45 11287 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
11288
11289 def Enable(*args, **kwargs):
a95a7133 11290 """Enable(self, bool enable=True)"""
54f9ee45 11291 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
11292
11293 def IsEnabled(*args, **kwargs):
a95a7133 11294 """IsEnabled(self) -> bool"""
54f9ee45 11295 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
11296
11297 def Check(*args, **kwargs):
a95a7133 11298 """Check(self, bool check=True)"""
54f9ee45 11299 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
11300
11301 def IsChecked(*args, **kwargs):
a95a7133 11302 """IsChecked(self) -> bool"""
54f9ee45 11303 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
11304
11305 def Toggle(*args, **kwargs):
a95a7133 11306 """Toggle(self)"""
54f9ee45 11307 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
11308
11309 def SetHelp(*args, **kwargs):
a95a7133 11310 """SetHelp(self, String str)"""
54f9ee45 11311 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
11312
11313 def GetHelp(*args, **kwargs):
a95a7133 11314 """GetHelp(self) -> String"""
54f9ee45 11315 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
11316
11317 def GetAccel(*args, **kwargs):
a95a7133 11318 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 11319 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
11320
11321 def SetAccel(*args, **kwargs):
a95a7133 11322 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 11323 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce 11324
091f5bed
RD
11325 def SetBitmap(*args, **kwargs):
11326 """SetBitmap(self, Bitmap bitmap)"""
11327 return _core_.MenuItem_SetBitmap(*args, **kwargs)
11328
11329 def GetBitmap(*args, **kwargs):
11330 """GetBitmap(self) -> Bitmap"""
11331 return _core_.MenuItem_GetBitmap(*args, **kwargs)
11332
c1280d1e
RD
11333 def SetFont(*args, **kwargs):
11334 """SetFont(self, Font font)"""
11335 return _core_.MenuItem_SetFont(*args, **kwargs)
11336
11337 def GetFont(*args, **kwargs):
11338 """GetFont(self) -> Font"""
11339 return _core_.MenuItem_GetFont(*args, **kwargs)
11340
11341 def SetTextColour(*args, **kwargs):
11342 """SetTextColour(self, Colour colText)"""
11343 return _core_.MenuItem_SetTextColour(*args, **kwargs)
11344
11345 def GetTextColour(*args, **kwargs):
11346 """GetTextColour(self) -> Colour"""
11347 return _core_.MenuItem_GetTextColour(*args, **kwargs)
11348
11349 def SetBackgroundColour(*args, **kwargs):
11350 """SetBackgroundColour(self, Colour colBack)"""
11351 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
11352
11353 def GetBackgroundColour(*args, **kwargs):
11354 """GetBackgroundColour(self) -> Colour"""
11355 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
11356
11357 def SetBitmaps(*args, **kwargs):
11358 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11359 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
11360
11361 def SetDisabledBitmap(*args, **kwargs):
11362 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11363 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
11364
11365 def GetDisabledBitmap(*args, **kwargs):
11366 """GetDisabledBitmap(self) -> Bitmap"""
11367 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
11368
11369 def SetMarginWidth(*args, **kwargs):
11370 """SetMarginWidth(self, int nWidth)"""
11371 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
11372
11373 def GetMarginWidth(*args, **kwargs):
11374 """GetMarginWidth(self) -> int"""
11375 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
11376
e811c8ce 11377 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 11378 """GetDefaultMarginWidth() -> int"""
54f9ee45 11379 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
11380
11381 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
11382 def IsOwnerDrawn(*args, **kwargs):
11383 """IsOwnerDrawn(self) -> bool"""
11384 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
11385
11386 def SetOwnerDrawn(*args, **kwargs):
11387 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
11388 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
11389
11390 def ResetOwnerDrawn(*args, **kwargs):
11391 """ResetOwnerDrawn(self)"""
11392 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
11393
57332a5a
RD
11394 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
11395 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
11396 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
11397 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
11398 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
11399 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
11400 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
11401 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
11402 Label = property(GetLabel,doc="See `GetLabel`")
11403 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
11404 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
11405 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
11406 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
11407 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
2131d850 11408_core_.MenuItem_swigregister(MenuItem)
d14a1e28 11409
e811c8ce 11410def MenuItem_GetLabelFromText(*args, **kwargs):
0085ce49
RD
11411 """MenuItem_GetLabelFromText(String text) -> String"""
11412 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 11413
0085ce49
RD
11414def MenuItem_GetDefaultMarginWidth(*args):
11415 """MenuItem_GetDefaultMarginWidth() -> int"""
11416 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d14a1e28
RD
11417
11418#---------------------------------------------------------------------------
11419
11420class Control(Window):
15afbcd0
RD
11421 """
11422 This is the base class for a control or 'widget'.
11423
41e2b43e
RD
11424 A control is generally a small window which processes user input
11425 and/or displays one or more item of data.
15afbcd0 11426 """
0085ce49
RD
11427 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11428 __repr__ = _swig_repr
11429 def __init__(self, *args, **kwargs):
0df68c9f 11430 """
248ed943
RD
11431 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11432 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 11433 String name=ControlNameStr) -> Control
15afbcd0 11434
41e2b43e
RD
11435 Create a Control. Normally you should only call this from a subclass'
11436 __init__ as a plain old wx.Control is not very useful.
0df68c9f 11437 """
0085ce49 11438 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d14a1e28 11439 self._setOORInfo(self)
e811c8ce
RD
11440
11441 def Create(*args, **kwargs):
0df68c9f 11442 """
248ed943
RD
11443 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11444 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 11445 String name=ControlNameStr) -> bool
15afbcd0
RD
11446
11447 Do the 2nd phase and create the GUI control.
0df68c9f 11448 """
54f9ee45 11449 return _core_.Control_Create(*args, **kwargs)
e811c8ce 11450
10044bf1
RD
11451 def GetAlignment(*args, **kwargs):
11452 """
11453 GetAlignment(self) -> int
11454
11455 Get the control alignment (left/right/centre, top/bottom/centre)
11456 """
11457 return _core_.Control_GetAlignment(*args, **kwargs)
11458
34e0a3bb 11459 def GetLabelText(*args, **kwargs):
10044bf1 11460 """
10044bf1
RD
11461 GetLabelText(self) -> String
11462
11463 Get just the text of the label, without mnemonic characters ('&')
11464 """
34e0a3bb 11465 return _core_.Control_GetLabelText(*args, **kwargs)
10044bf1 11466
e811c8ce 11467 def Command(*args, **kwargs):
15afbcd0 11468 """
a95a7133 11469 Command(self, CommandEvent event)
15afbcd0 11470
41e2b43e
RD
11471 Simulates the effect of the user issuing a command to the item.
11472
11473 :see: `wx.CommandEvent`
11474
15afbcd0 11475 """
54f9ee45 11476 return _core_.Control_Command(*args, **kwargs)
e811c8ce 11477
ddeca22c
RD
11478 def RemoveMnemonics(*args, **kwargs):
11479 """
11480 RemoveMnemonics(String str) -> String
11481
11482 removes the mnemonics characters
11483 """
11484 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11485
11486 RemoveMnemonics = staticmethod(RemoveMnemonics)
74a57fcd 11487 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
11488 """
11489 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11490
11491 Get the default attributes for this class. This is useful if you want
11492 to use the same font or colour in your own control as in a standard
11493 control -- which is a much better idea than hard coding specific
11494 colours or fonts which might look completely out of place on the
11495 user's system, especially if it uses themes.
11496
11497 The variant parameter is only relevant under Mac currently and is
11498 ignore under other platforms. Under Mac, it will change the size of
11499 the returned font. See `wx.Window.SetWindowVariant` for more about
11500 this.
11501 """
54f9ee45 11502 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
11503
11504 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2bf58437 11505 Alignment = property(GetAlignment,doc="See `GetAlignment`")
2bf58437 11506 LabelText = property(GetLabelText,doc="See `GetLabelText`")
2131d850 11507_core_.Control_swigregister(Control)
b2dc1044 11508ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
11509
11510def PreControl(*args, **kwargs):
15afbcd0
RD
11511 """
11512 PreControl() -> Control
11513
11514 Precreate a Control control for 2-phase creation
11515 """
54f9ee45 11516 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
11517 return val
11518
ddeca22c
RD
11519def Control_RemoveMnemonics(*args, **kwargs):
11520 """
11521 Control_RemoveMnemonics(String str) -> String
11522
11523 removes the mnemonics characters
11524 """
11525 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11526
74a57fcd 11527def Control_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 11528 """
110da5b0
RD
11529 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11530
11531 Get the default attributes for this class. This is useful if you want
11532 to use the same font or colour in your own control as in a standard
11533 control -- which is a much better idea than hard coding specific
11534 colours or fonts which might look completely out of place on the
11535 user's system, especially if it uses themes.
11536
11537 The variant parameter is only relevant under Mac currently and is
11538 ignore under other platforms. Under Mac, it will change the size of
11539 the returned font. See `wx.Window.SetWindowVariant` for more about
11540 this.
11541 """
0085ce49 11542 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 11543
d14a1e28
RD
11544#---------------------------------------------------------------------------
11545
11546class ItemContainer(object):
15afbcd0 11547 """
53aa7709
RD
11548 The wx.ItemContainer class defines an interface which is implemented
11549 by all controls which have string subitems, each of which may be
11550 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11551 as `wx.ComboBox` which implements an extended interface deriving from
41e2b43e 11552 this one.
15afbcd0 11553
41e2b43e
RD
11554 It defines the methods for accessing the control's items and although
11555 each of the derived classes implements them differently, they still
11556 all conform to the same interface.
15afbcd0 11557
41e2b43e
RD
11558 The items in a wx.ItemContainer have (non empty) string labels and,
11559 optionally, client data associated with them.
15afbcd0
RD
11560
11561 """
0085ce49
RD
11562 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11563 def __init__(self): raise AttributeError, "No constructor defined"
11564 __repr__ = _swig_repr
e811c8ce 11565 def Append(*args, **kwargs):
15afbcd0 11566 """
a95a7133 11567 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 11568
41e2b43e
RD
11569 Adds the item to the control, associating the given data with the item
11570 if not None. The return value is the index of the newly added item
11571 which may be different from the last one if the control is sorted (e.g.
11572 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 11573 """
54f9ee45 11574 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
11575
11576 def AppendItems(*args, **kwargs):
15afbcd0 11577 """
f5b96ee1 11578 AppendItems(self, List strings)
15afbcd0 11579
41e2b43e
RD
11580 Apend several items at once to the control. Notice that calling this
11581 method may be much faster than appending the items one by one if you
11582 need to add a lot of items.
15afbcd0 11583 """
54f9ee45 11584 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
11585
11586 def Insert(*args, **kwargs):
15afbcd0 11587 """
d359a380 11588 Insert(self, String item, int pos, PyObject clientData=None) -> int
15afbcd0 11589
41e2b43e 11590 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
11591 optionally associating some data object with the item.
11592 """
54f9ee45 11593 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
11594
11595 def Clear(*args, **kwargs):
15afbcd0 11596 """
a95a7133 11597 Clear(self)
15afbcd0
RD
11598
11599 Removes all items from the control.
11600 """
54f9ee45 11601 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
11602
11603 def Delete(*args, **kwargs):
15afbcd0 11604 """
d359a380 11605 Delete(self, int n)
15afbcd0 11606
41e2b43e
RD
11607 Deletes the item at the zero-based index 'n' from the control. Note
11608 that it is an error (signalled by a `wx.PyAssertionError` exception if
11609 enabled) to remove an item with the index negative or greater or equal
11610 than the number of items in the control.
15afbcd0 11611 """
54f9ee45 11612 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce 11613
53aa7709
RD
11614 def GetClientData(*args, **kwargs):
11615 """
d359a380 11616 GetClientData(self, int n) -> PyObject
53aa7709
RD
11617
11618 Returns the client data associated with the given item, (if any.)
11619 """
11620 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11621
11622 def SetClientData(*args, **kwargs):
11623 """
d359a380 11624 SetClientData(self, int n, PyObject clientData)
53aa7709
RD
11625
11626 Associate the given client data with the item at position n.
11627 """
11628 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11629
e811c8ce 11630 def GetCount(*args, **kwargs):
15afbcd0 11631 """
d359a380 11632 GetCount(self) -> int
15afbcd0
RD
11633
11634 Returns the number of items in the control.
11635 """
54f9ee45 11636 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
11637
11638 def IsEmpty(*args, **kwargs):
15afbcd0 11639 """
a95a7133 11640 IsEmpty(self) -> bool
15afbcd0
RD
11641
11642 Returns True if the control is empty or False if it has some items.
11643 """
54f9ee45 11644 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
11645
11646 def GetString(*args, **kwargs):
15afbcd0 11647 """
d359a380 11648 GetString(self, int n) -> String
15afbcd0
RD
11649
11650 Returns the label of the item with the given index.
11651 """
54f9ee45 11652 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
11653
11654 def GetStrings(*args, **kwargs):
a95a7133 11655 """GetStrings(self) -> wxArrayString"""
54f9ee45 11656 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
11657
11658 def SetString(*args, **kwargs):
15afbcd0 11659 """
d359a380 11660 SetString(self, int n, String s)
15afbcd0
RD
11661
11662 Sets the label for the given item.
11663 """
54f9ee45 11664 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
11665
11666 def FindString(*args, **kwargs):
15afbcd0 11667 """
a95a7133 11668 FindString(self, String s) -> int
15afbcd0
RD
11669
11670 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
11671 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11672 found.
15afbcd0 11673 """
54f9ee45 11674 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce 11675
53aa7709 11676 def SetSelection(*args, **kwargs):
15afbcd0 11677 """
53aa7709 11678 SetSelection(self, int n)
15afbcd0
RD
11679
11680 Sets the item at index 'n' to be the selected item.
11681 """
53aa7709 11682 return _core_.ItemContainer_SetSelection(*args, **kwargs)
e811c8ce
RD
11683
11684 def GetSelection(*args, **kwargs):
15afbcd0 11685 """
a95a7133 11686 GetSelection(self) -> int
15afbcd0 11687
41e2b43e
RD
11688 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11689 is selected.
15afbcd0 11690 """
54f9ee45 11691 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce 11692
53aa7709
RD
11693 def SetStringSelection(*args, **kwargs):
11694 """SetStringSelection(self, String s) -> bool"""
11695 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11696
e811c8ce 11697 def GetStringSelection(*args, **kwargs):
15afbcd0 11698 """
a95a7133 11699 GetStringSelection(self) -> String
15afbcd0 11700
41e2b43e
RD
11701 Returns the label of the selected item or an empty string if no item
11702 is selected.
15afbcd0 11703 """
54f9ee45 11704 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce 11705
53aa7709 11706 def Select(*args, **kwargs):
15afbcd0 11707 """
53aa7709 11708 Select(self, int n)
15afbcd0 11709
53aa7709
RD
11710 This is the same as `SetSelection` and exists only because it is
11711 slightly more natural for controls which support multiple selection.
15afbcd0 11712 """
53aa7709 11713 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 11714
97ab0f6a
RD
11715 def GetItems(self):
11716 """Return a list of the strings in the control"""
11717 return [self.GetString(i) for i in xrange(self.GetCount())]
11718
11719 def SetItems(self, items):
11720 """Clear and set the strings in the control from a list"""
11721 self.Clear()
11722 for i in items:
11723 self.Append(i)
11724
11725 Count = property(GetCount,doc="See `GetCount`")
11726 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11727 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11728 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11729 Strings = property(GetStrings,doc="See `GetStrings`")
2131d850 11730_core_.ItemContainer_swigregister(ItemContainer)
d14a1e28
RD
11731
11732#---------------------------------------------------------------------------
11733
11734class ControlWithItems(Control,ItemContainer):
15afbcd0 11735 """
41e2b43e
RD
11736 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11737 wx.Control class, and is used for the base class of various controls
11738 that have items.
15afbcd0 11739 """
0085ce49
RD
11740 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11741 def __init__(self): raise AttributeError, "No constructor defined"
11742 __repr__ = _swig_repr
2131d850 11743_core_.ControlWithItems_swigregister(ControlWithItems)
d14a1e28
RD
11744
11745#---------------------------------------------------------------------------
11746
cbfc9df6
RD
11747class SizerFlags(object):
11748 """
11749 Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
11750 to specify a lot of flags and parameters which can be unwieldy. This
11751 is where wx.SizerFlags comes in: it allows you to specify all
11752 parameters using the named methods instead. For example, instead of::
11753
11754 sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
11755
11756 you can now write::
11757
11758 sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
11759
11760 This is more readable and also allows you to create wx.SizerFlags
11761 objects which can be reused for several sizer items.::
11762
11763 flagsExpand = wx.SizerFlags(1)
11764 flagsExpand.Expand().Border(wx.ALL, 10)
11765 sizer.AddF(ctrl1, flagsExpand)
11766 sizer.AddF(ctrl2, flagsExpand)
11767
11768 Note that by specification, all methods of wx.SizerFlags return the
11769 wx.SizerFlags object itself allowing chaining multiple method calls
11770 like in the examples above.
11771 """
11772 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11773 __repr__ = _swig_repr
11774 def __init__(self, *args, **kwargs):
11775 """
11776 __init__(self, int proportion=0) -> SizerFlags
11777
11778 Constructs the flags object with the specified proportion.
11779 """
11780 _core_.SizerFlags_swiginit(self,_core_.new_SizerFlags(*args, **kwargs))
11781 __swig_destroy__ = _core_.delete_SizerFlags
11782 __del__ = lambda self : None;
11783 def Proportion(*args, **kwargs):
11784 """
11785 Proportion(self, int proportion) -> SizerFlags
11786
11787 Sets the item's proportion value.
11788 """
11789 return _core_.SizerFlags_Proportion(*args, **kwargs)
11790
11791 def Align(*args, **kwargs):
11792 """
11793 Align(self, int alignment) -> SizerFlags
11794
11795 Sets the item's alignment
11796 """
11797 return _core_.SizerFlags_Align(*args, **kwargs)
11798
11799 def Expand(*args, **kwargs):
11800 """
11801 Expand(self) -> SizerFlags
11802
11803 Sets the wx.EXPAND flag, which will cause the item to be expanded to
11804 fill as much space as it is given by the sizer.
11805 """
11806 return _core_.SizerFlags_Expand(*args, **kwargs)
11807
11808 def Centre(*args, **kwargs):
11809 """
11810 Centre(self) -> SizerFlags
11811
11812 Same as `Center` for those with an alternate dialect of English.
11813 """
11814 return _core_.SizerFlags_Centre(*args, **kwargs)
11815
11816 def Center(*args, **kwargs):
11817 """
11818 Center(self) -> SizerFlags
11819
11820 Sets the centering alignment flags.
11821 """
11822 return _core_.SizerFlags_Center(*args, **kwargs)
11823
11824 def Left(*args, **kwargs):
11825 """
11826 Left(self) -> SizerFlags
11827
11828 Aligns the object to the left, a shortcut for calling
11829 Align(wx.ALIGN_LEFT)
11830 """
11831 return _core_.SizerFlags_Left(*args, **kwargs)
11832
11833 def Right(*args, **kwargs):
11834 """
11835 Right(self) -> SizerFlags
11836
11837 Aligns the object to the right, a shortcut for calling
11838 Align(wx.ALIGN_RIGHT)
11839 """
11840 return _core_.SizerFlags_Right(*args, **kwargs)
11841
11842 def Top(*args, **kwargs):
11843 """
11844 Top(self) -> SizerFlags
11845
11846 Aligns the object to the top of the available space, a shortcut for
11847 calling Align(wx.ALIGN_TOP)
11848 """
11849 return _core_.SizerFlags_Top(*args, **kwargs)
11850
11851 def Bottom(*args, **kwargs):
11852 """
11853 Bottom(self) -> SizerFlags
11854
11855 Aligns the object to the bottom of the available space, a shortcut for
11856 calling Align(wx.ALIGN_BOTTOM)
11857 """
11858 return _core_.SizerFlags_Bottom(*args, **kwargs)
11859
11860 def Shaped(*args, **kwargs):
11861 """
11862 Shaped(self) -> SizerFlags
11863
11864 Sets the wx.SHAPED flag.
11865 """
11866 return _core_.SizerFlags_Shaped(*args, **kwargs)
11867
11868 def FixedMinSize(*args, **kwargs):
11869 """
11870 FixedMinSize(self) -> SizerFlags
11871
11872 Sets the wx.FIXED_MINSIZE flag.
11873 """
11874 return _core_.SizerFlags_FixedMinSize(*args, **kwargs)
11875
11876 def Border(*args, **kwargs):
11877 """
11878 Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags
11879
11880 Sets the border of the item in the direction(s) or sides given by the
11881 direction parameter. If the borderInPixels value is not given then
11882 the default border size (see `GetDefaultBorder`) will be used.
11883 """
11884 return _core_.SizerFlags_Border(*args, **kwargs)
11885
11886 def DoubleBorder(*args, **kwargs):
11887 """
11888 DoubleBorder(self, int direction=ALL) -> SizerFlags
11889
11890 Sets the border in the given direction to twice the default border
11891 size.
11892 """
11893 return _core_.SizerFlags_DoubleBorder(*args, **kwargs)
11894
11895 def TripleBorder(*args, **kwargs):
11896 """
11897 TripleBorder(self, int direction=ALL) -> SizerFlags
11898
11899 Sets the border in the given direction to three times the default
11900 border size.
11901 """
11902 return _core_.SizerFlags_TripleBorder(*args, **kwargs)
11903
11904 def HorzBorder(*args, **kwargs):
11905 """
11906 HorzBorder(self) -> SizerFlags
11907
11908 Sets the left and right borders to the default border size.
11909 """
11910 return _core_.SizerFlags_HorzBorder(*args, **kwargs)
11911
11912 def DoubleHorzBorder(*args, **kwargs):
11913 """
11914 DoubleHorzBorder(self) -> SizerFlags
11915
11916 Sets the left and right borders to twice the default border size.
11917 """
11918 return _core_.SizerFlags_DoubleHorzBorder(*args, **kwargs)
11919
11920 def GetDefaultBorder(*args, **kwargs):
11921 """
11922 GetDefaultBorder() -> int
11923
11924 Returns the default border size used by the other border methods
11925 """
11926 return _core_.SizerFlags_GetDefaultBorder(*args, **kwargs)
11927
11928 GetDefaultBorder = staticmethod(GetDefaultBorder)
11929 def GetProportion(*args, **kwargs):
11930 """
11931 GetProportion(self) -> int
11932
11933 Returns the proportion value to be used in the sizer item.
11934 """
11935 return _core_.SizerFlags_GetProportion(*args, **kwargs)
11936
11937 def GetFlags(*args, **kwargs):
11938 """
11939 GetFlags(self) -> int
11940
11941 Returns the flags value to be used in the sizer item.
11942 """
11943 return _core_.SizerFlags_GetFlags(*args, **kwargs)
11944
11945 def GetBorderInPixels(*args, **kwargs):
11946 """
11947 GetBorderInPixels(self) -> int
11948
11949 Returns the border value in pixels to be used in the sizer item.
11950 """
11951 return _core_.SizerFlags_GetBorderInPixels(*args, **kwargs)
11952
11953_core_.SizerFlags_swigregister(SizerFlags)
11954
11955def SizerFlags_GetDefaultBorder(*args):
11956 """
11957 SizerFlags_GetDefaultBorder() -> int
11958
11959 Returns the default border size used by the other border methods
11960 """
11961 return _core_.SizerFlags_GetDefaultBorder(*args)
11962
d14a1e28 11963class SizerItem(Object):
248ed943
RD
11964 """
11965 The wx.SizerItem class is used to track the position, size and other
01f6b6d3
RD
11966 attributes of each item managed by a `wx.Sizer`. It is not usually
11967 necessary to use this class because the sizer elements can also be
11968 identified by their positions or window or sizer references but
11969 sometimes it may be more convenient to use wx.SizerItem directly.
11970 Also, custom classes derived from `wx.PySizer` will probably need to
11971 use the collection of wx.SizerItems held by wx.Sizer when calculating
11972 layout.
248ed943
RD
11973
11974 :see: `wx.Sizer`, `wx.GBSizerItem`
11975 """
0085ce49
RD
11976 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11977 __repr__ = _swig_repr
11978 def __init__(self, *args, **kwargs):
248ed943
RD
11979 """
11980 __init__(self) -> SizerItem
11981
11982 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11983 size will need to be set before this item can be used in a Sizer.
11984
11985 You will probably never need to create a wx.SizerItem directly as they
11986 are created automatically when the sizer's Add, Insert or Prepend
11987 methods are called.
11988
11989 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11990 """
0085ce49
RD
11991 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11992 __swig_destroy__ = _core_.delete_SizerItem
11993 __del__ = lambda self : None;
e811c8ce 11994 def DeleteWindows(*args, **kwargs):
248ed943
RD
11995 """
11996 DeleteWindows(self)
11997
11998 Destroy the window or the windows in a subsizer, depending on the type
11999 of item.
12000 """
54f9ee45 12001 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
12002
12003 def DetachSizer(*args, **kwargs):
248ed943
RD
12004 """
12005 DetachSizer(self)
12006
12007 Enable deleting the SizerItem without destroying the contained sizer.
12008 """
54f9ee45 12009 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
12010
12011 def GetSize(*args, **kwargs):
248ed943
RD
12012 """
12013 GetSize(self) -> Size
12014
12015 Get the current size of the item, as set in the last Layout.
12016 """
54f9ee45 12017 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
12018
12019 def CalcMin(*args, **kwargs):
248ed943
RD
12020 """
12021 CalcMin(self) -> Size
12022
12023 Calculates the minimum desired size for the item, including any space
12024 needed by borders.
12025 """
54f9ee45 12026 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
12027
12028 def SetDimension(*args, **kwargs):
248ed943
RD
12029 """
12030 SetDimension(self, Point pos, Size size)
12031
12032 Set the position and size of the space allocated for this item by the
12033 sizer, and adjust the position and size of the item (window or
12034 subsizer) to be within that space taking alignment and borders into
12035 account.
12036 """
54f9ee45 12037 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
12038
12039 def GetMinSize(*args, **kwargs):
248ed943
RD
12040 """
12041 GetMinSize(self) -> Size
12042
12043 Get the minimum size needed for the item.
12044 """
54f9ee45 12045 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 12046
dfbb5885
RD
12047 def GetMinSizeWithBorder(*args, **kwargs):
12048 """
12049 GetMinSizeWithBorder(self) -> Size
12050
12051 Get the minimum size needed for the item with space for the borders
12052 added, if needed.
12053 """
12054 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
12055
e811c8ce 12056 def SetInitSize(*args, **kwargs):
a95a7133 12057 """SetInitSize(self, int x, int y)"""
54f9ee45 12058 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
12059
12060 def SetRatioWH(*args, **kwargs):
248ed943
RD
12061 """
12062 SetRatioWH(self, int width, int height)
12063
12064 Set the ratio item attribute.
12065 """
54f9ee45 12066 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
12067
12068 def SetRatioSize(*args, **kwargs):
248ed943
RD
12069 """
12070 SetRatioSize(self, Size size)
12071
12072 Set the ratio item attribute.
12073 """
54f9ee45 12074 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
12075
12076 def SetRatio(*args, **kwargs):
248ed943
RD
12077 """
12078 SetRatio(self, float ratio)
12079
12080 Set the ratio item attribute.
12081 """
54f9ee45 12082 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
12083
12084 def GetRatio(*args, **kwargs):
248ed943
RD
12085 """
12086 GetRatio(self) -> float
12087
12088 Set the ratio item attribute.
12089 """
54f9ee45 12090 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 12091
d3b6e4ff
RD
12092 def GetRect(*args, **kwargs):
12093 """
12094 GetRect(self) -> Rect
12095
12096 Returns the rectangle that the sizer item should occupy
12097 """
12098 return _core_.SizerItem_GetRect(*args, **kwargs)
12099
e811c8ce 12100 def IsWindow(*args, **kwargs):
248ed943
RD
12101 """
12102 IsWindow(self) -> bool
12103
12104 Is this sizer item a window?
12105 """
54f9ee45 12106 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
12107
12108 def IsSizer(*args, **kwargs):
248ed943
RD
12109 """
12110 IsSizer(self) -> bool
12111
12112 Is this sizer item a subsizer?
12113 """
54f9ee45 12114 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
12115
12116 def IsSpacer(*args, **kwargs):
248ed943
RD
12117 """
12118 IsSpacer(self) -> bool
12119
12120 Is this sizer item a spacer?
12121 """
54f9ee45 12122 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
12123
12124 def SetProportion(*args, **kwargs):
248ed943
RD
12125 """
12126 SetProportion(self, int proportion)
12127
12128 Set the proportion value for this item.
12129 """
54f9ee45 12130 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
12131
12132 def GetProportion(*args, **kwargs):
248ed943
RD
12133 """
12134 GetProportion(self) -> int
12135
12136 Get the proportion value for this item.
12137 """
54f9ee45 12138 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 12139
248ed943
RD
12140 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
12141 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 12142 def SetFlag(*args, **kwargs):
248ed943
RD
12143 """
12144 SetFlag(self, int flag)
12145
12146 Set the flag value for this item.
12147 """
54f9ee45 12148 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
12149
12150 def GetFlag(*args, **kwargs):
248ed943
RD
12151 """
12152 GetFlag(self) -> int
12153
12154 Get the flag value for this item.
12155 """
54f9ee45 12156 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
12157
12158 def SetBorder(*args, **kwargs):
248ed943
RD
12159 """
12160 SetBorder(self, int border)
12161
12162 Set the border value for this item.
12163 """
54f9ee45 12164 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
12165
12166 def GetBorder(*args, **kwargs):
248ed943
RD
12167 """
12168 GetBorder(self) -> int
12169
12170 Get the border value for this item.
12171 """
54f9ee45 12172 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
12173
12174 def GetWindow(*args, **kwargs):
248ed943
RD
12175 """
12176 GetWindow(self) -> Window
12177
12178 Get the window (if any) that is managed by this sizer item.
12179 """
54f9ee45 12180 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce 12181
e811c8ce 12182 def GetSizer(*args, **kwargs):
248ed943
RD
12183 """
12184 GetSizer(self) -> Sizer
12185
12186 Get the subsizer (if any) that is managed by this sizer item.
12187 """
54f9ee45 12188 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce 12189
ddeca22c
RD
12190 def GetSpacer(*args, **kwargs):
12191 """
12192 GetSpacer(self) -> Size
12193
12194 Get the size of the spacer managed by this sizer item.
12195 """
12196 return _core_.SizerItem_GetSpacer(*args, **kwargs)
12197
12198 def SetWindow(*args, **kwargs):
12199 """
12200 SetWindow(self, Window window)
12201
12202 Set the window to be managed by this sizer item.
12203 """
12204 return _core_.SizerItem_SetWindow(*args, **kwargs)
12205
e811c8ce 12206 def SetSizer(*args, **kwargs):
248ed943
RD
12207 """
12208 SetSizer(self, Sizer sizer)
12209
12210 Set the subsizer to be managed by this sizer item.
12211 """
54f9ee45 12212 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce 12213
ddeca22c 12214 def SetSpacer(*args, **kwargs):
248ed943 12215 """
ddeca22c 12216 SetSpacer(self, Size size)
248ed943 12217
ddeca22c 12218 Set the size of the spacer to be managed by this sizer item.
248ed943 12219 """
ddeca22c 12220 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce 12221
ddeca22c
RD
12222 SetWindow = wx._deprecated(SetWindow, "Use `AssignWindow` instead.")
12223 SetSizer = wx._deprecated(SetSizer, "Use `AssignSizer` instead.")
12224 SetSpacer = wx._deprecated(SetSpacer, "Use `AssignSpacer` instead.")
12225
12226 def AssignWindow(*args, **kwargs):
248ed943 12227 """
ddeca22c
RD
12228 AssignWindow(self, Window window)
12229
12230 Set the window to be managed by this sizer item.
12231 """
12232 return _core_.SizerItem_AssignWindow(*args, **kwargs)
12233
12234 def AssignSizer(*args, **kwargs):
12235 """
12236 AssignSizer(self, Sizer sizer)
12237
12238 Set the subsizer to be managed by this sizer item.
12239 """
12240 return _core_.SizerItem_AssignSizer(*args, **kwargs)
12241
12242 def AssignSpacer(*args, **kwargs):
12243 """
12244 AssignSpacer(self, Size size)
248ed943
RD
12245
12246 Set the size of the spacer to be managed by this sizer item.
12247 """
ddeca22c 12248 return _core_.SizerItem_AssignSpacer(*args, **kwargs)
e811c8ce
RD
12249
12250 def Show(*args, **kwargs):
248ed943
RD
12251 """
12252 Show(self, bool show)
12253
12254 Set the show item attribute, which sizers use to determine if the item
12255 is to be made part of the layout or not. If the item is tracking a
12256 window then it is shown or hidden as needed.
12257 """
54f9ee45 12258 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
12259
12260 def IsShown(*args, **kwargs):
248ed943
RD
12261 """
12262 IsShown(self) -> bool
12263
12264 Is the item to be shown in the layout?
12265 """
54f9ee45 12266 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
12267
12268 def GetPosition(*args, **kwargs):
248ed943
RD
12269 """
12270 GetPosition(self) -> Point
12271
12272 Returns the current position of the item, as set in the last Layout.
12273 """
54f9ee45 12274 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
12275
12276 def GetUserData(*args, **kwargs):
248ed943
RD
12277 """
12278 GetUserData(self) -> PyObject
12279
12280 Returns the userData associated with this sizer item, or None if there
12281 isn't any.
12282 """
54f9ee45 12283 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 12284
091f5bed
RD
12285 def SetUserData(*args, **kwargs):
12286 """
12287 SetUserData(self, PyObject userData)
12288
12289 Associate a Python object with this sizer item.
12290 """
12291 return _core_.SizerItem_SetUserData(*args, **kwargs)
12292
33d6fd3b
RD
12293 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
12294 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
12295 MinSize = property(GetMinSize,doc="See `GetMinSize`")
12296 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
12297 Position = property(GetPosition,doc="See `GetPosition`")
12298 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
12299 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
12300 Rect = property(GetRect,doc="See `GetRect`")
12301 Size = property(GetSize,doc="See `GetSize`")
ddeca22c
RD
12302 Sizer = property(GetSizer,AssignSizer,doc="See `GetSizer` and `AssignSizer`")
12303 Spacer = property(GetSpacer,AssignSpacer,doc="See `GetSpacer` and `AssignSpacer`")
33d6fd3b 12304 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
ddeca22c 12305 Window = property(GetWindow,AssignWindow,doc="See `GetWindow` and `AssignWindow`")
2131d850 12306_core_.SizerItem_swigregister(SizerItem)
d14a1e28 12307
248ed943 12308def SizerItemWindow(*args, **kwargs):
0df68c9f 12309 """
248ed943
RD
12310 SizerItemWindow(Window window, int proportion, int flag, int border,
12311 PyObject userData=None) -> SizerItem
12312
12313 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 12314 """
248ed943 12315 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
12316 return val
12317
248ed943 12318def SizerItemSpacer(*args, **kwargs):
0df68c9f 12319 """
248ed943
RD
12320 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
12321 PyObject userData=None) -> SizerItem
12322
12323 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 12324 """
248ed943 12325 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
12326 return val
12327
12328def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
12329 """
12330 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
12331 PyObject userData=None) -> SizerItem
12332
12333 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 12334 """
54f9ee45 12335 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
12336 return val
12337
12338class Sizer(Object):
248ed943
RD
12339 """
12340 wx.Sizer is the abstract base class used for laying out subwindows in
12341 a window. You cannot use wx.Sizer directly; instead, you will have to
12342 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
12343 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
12344 `wx.GridBagSizer`.
248ed943
RD
12345
12346 The concept implemented by sizers in wxWidgets is closely related to
12347 layout tools in other GUI toolkits, such as Java's AWT, the GTK
12348 toolkit or the Qt toolkit. It is based upon the idea of the individual
12349 subwindows reporting their minimal required size and their ability to
12350 get stretched if the size of the parent window has changed. This will
12351 most often mean that the programmer does not set the original size of
12352 a dialog in the beginning, rather the dialog will assigned a sizer and
12353 this sizer will be queried about the recommended size. The sizer in
12354 turn will query its children, which can be normal windows or contorls,
12355 empty space or other sizers, so that a hierarchy of sizers can be
12356 constructed. Note that wxSizer does not derive from wxWindow and thus
12357 do not interfere with tab ordering and requires very little resources
12358 compared to a real window on screen.
12359
12360 What makes sizers so well fitted for use in wxWidgets is the fact that
12361 every control reports its own minimal size and the algorithm can
12362 handle differences in font sizes or different window (dialog item)
12363 sizes on different platforms without problems. If for example the
12364 standard font as well as the overall design of Mac widgets requires
12365 more space than on Windows, then the initial size of a dialog using a
12366 sizer will automatically be bigger on Mac than on Windows.
12367 """
0085ce49
RD
12368 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12369 def __init__(self): raise AttributeError, "No constructor defined"
12370 __repr__ = _swig_repr
12371 __swig_destroy__ = _core_.delete_Sizer
12372 __del__ = lambda self : None;
e811c8ce 12373 def _setOORInfo(*args, **kwargs):
a95a7133 12374 """_setOORInfo(self, PyObject _self)"""
54f9ee45 12375 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
12376
12377 def Add(*args, **kwargs):
0df68c9f 12378 """
248ed943 12379 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 12380 PyObject userData=None) -> wx.SizerItem
248ed943
RD
12381
12382 Appends a child item to the sizer.
0df68c9f 12383 """
54f9ee45 12384 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce 12385
cbfc9df6
RD
12386 def AddF(*args, **kwargs):
12387 """
12388 AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12389
12390 Similar to `Add` but uses the `wx.SizerFlags` convenience class for
12391 setting the various flags, options and borders.
12392 """
12393 return _core_.Sizer_AddF(*args, **kwargs)
12394
e811c8ce 12395 def Insert(*args, **kwargs):
0df68c9f 12396 """
248ed943 12397 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 12398 PyObject userData=None) -> wx.SizerItem
248ed943
RD
12399
12400 Inserts a new item into the list of items managed by this sizer before
12401 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 12402 """
54f9ee45 12403 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce 12404
cbfc9df6
RD
12405 def InsertF(*args, **kwargs):
12406 """
12407 InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
12408
12409 Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
12410 for setting the various flags, options and borders.
12411 """
12412 return _core_.Sizer_InsertF(*args, **kwargs)
12413
e811c8ce 12414 def Prepend(*args, **kwargs):
0df68c9f 12415 """
248ed943 12416 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 12417 PyObject userData=None) -> wx.SizerItem
248ed943
RD
12418
12419 Adds a new item to the begining of the list of sizer items managed by
12420 this sizer. See `Add` for a description of the parameters.
0df68c9f 12421 """
54f9ee45 12422 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce 12423
cbfc9df6
RD
12424 def PrependF(*args, **kwargs):
12425 """
12426 PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12427
12428 Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
12429 for setting the various flags, options and borders.
12430 """
12431 return _core_.Sizer_PrependF(*args, **kwargs)
12432
e811c8ce 12433 def Remove(*args, **kwargs):
248ed943
RD
12434 """
12435 Remove(self, item) -> bool
12436
12437 Removes an item from the sizer and destroys it. This method does not
12438 cause any layout or resizing to take place, call `Layout` to update
12439 the layout on screen after removing a child from the sizer. The
12440 *item* parameter can be either a window, a sizer, or the zero-based
12441 index of an item to remove. Returns True if the child item was found
12442 and removed.
12443 """
54f9ee45 12444 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 12445
1c0f361b 12446 def Detach(*args, **kwargs):
248ed943
RD
12447 """
12448 Detach(self, item) -> bool
12449
12450 Detaches an item from the sizer without destroying it. This method
12451 does not cause any layout or resizing to take place, call `Layout` to
12452 do so. The *item* parameter can be either a window, a sizer, or the
12453 zero-based index of the item to be detached. Returns True if the child item
12454 was found and detached.
12455 """
1c0f361b
RD
12456 return _core_.Sizer_Detach(*args, **kwargs)
12457
d3b6e4ff
RD
12458 def GetItem(*args, **kwargs):
12459 """
cbfc9df6 12460 GetItem(self, item, recursive=False) -> wx.SizerItem
d3b6e4ff
RD
12461
12462 Returns the `wx.SizerItem` which holds the *item* given. The *item*
12463 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 12464 the item to be found.
d3b6e4ff
RD
12465 """
12466 return _core_.Sizer_GetItem(*args, **kwargs)
12467
e811c8ce 12468 def _SetItemMinSize(*args, **kwargs):
a95a7133 12469 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 12470 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 12471
97ab0f6a
RD
12472 def _ReplaceWin(*args, **kwargs):
12473 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
12474 return _core_.Sizer__ReplaceWin(*args, **kwargs)
12475
12476 def _ReplaceSizer(*args, **kwargs):
12477 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
12478 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
12479
12480 def _ReplaceItem(*args, **kwargs):
12481 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
12482 return _core_.Sizer__ReplaceItem(*args, **kwargs)
12483
12484 def Replace(self, olditem, item, recursive=False):
12485 """
12486 Detaches the given ``olditem`` from the sizer and replaces it with
12487 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
12488 detached child is destroyed only if it is not a window, (because
12489 windows are owned by their parent, not the sizer.) The
12490 ``recursive`` parameter can be used to search for the given
12491 element recursivly in subsizers.
12492
12493 This method does not cause any layout or resizing to take place,
12494 call `Layout` to do so.
12495
12496 Returns ``True`` if the child item was found and removed.
12497 """
12498 if isinstance(olditem, wx.Window):
12499 return self._ReplaceWin(olditem, item, recursive)
cbfc9df6 12500 elif isinstance(olditem, wx.Sizer):
97ab0f6a 12501 return self._ReplaceSizer(olditem, item, recursive)
cbfc9df6 12502 elif isinstance(olditem, int):
97ab0f6a
RD
12503 return self._ReplaceItem(olditem, item)
12504 else:
12505 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
12506
12507 def SetContainingWindow(*args, **kwargs):
12508 """
12509 SetContainingWindow(self, Window window)
12510
12511 Set (or unset) the window this sizer is used in.
12512 """
12513 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
12514
12515 def GetContainingWindow(*args, **kwargs):
12516 """
12517 GetContainingWindow(self) -> Window
12518
12519 Get the window this sizer is used in.
12520 """
12521 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
12522
248ed943
RD
12523 def SetItemMinSize(self, item, *args):
12524 """
12525 SetItemMinSize(self, item, Size size)
12526
12527 Sets the minimum size that will be allocated for an item in the sizer.
12528 The *item* parameter can be either a window, a sizer, or the
12529 zero-based index of the item. If a window or sizer is given then it
12530 will be searched for recursivly in subsizers if neccessary.
12531 """
12532 if len(args) == 2:
12533 # for backward compatibility accept separate width,height args too
12534 return self._SetItemMinSize(item, args)
12535 else:
12536 return self._SetItemMinSize(item, args[0])
12537
e811c8ce 12538 def AddItem(*args, **kwargs):
248ed943
RD
12539 """
12540 AddItem(self, SizerItem item)
12541
12542 Adds a `wx.SizerItem` to the sizer.
12543 """
54f9ee45 12544 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
12545
12546 def InsertItem(*args, **kwargs):
248ed943
RD
12547 """
12548 InsertItem(self, int index, SizerItem item)
12549
12550 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
12551 """
54f9ee45 12552 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
12553
12554 def PrependItem(*args, **kwargs):
248ed943
RD
12555 """
12556 PrependItem(self, SizerItem item)
12557
12558 Prepends a `wx.SizerItem` to the sizer.
12559 """
54f9ee45 12560 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 12561
248ed943 12562 def AddMany(self, items):
66c033b4
RD
12563 """
12564 AddMany is a convenience method for adding several items
12565 to a sizer at one time. Simply pass it a list of tuples,
12566 where each tuple consists of the parameters that you
12567 would normally pass to the `Add` method.
12568 """
248ed943
RD
12569 for item in items:
12570 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
12571 item = (item, )
12572 self.Add(*item)
d14a1e28 12573
ae5bc7f3
RD
12574 def AddSpacer(self, *args, **kw):
12575 """AddSpacer(int size) --> SizerItem
12576
12577 Add a spacer that is (size,size) pixels.
12578 """
12579 if args and type(args[0]) == int:
12580 return self.Add( (args[0],args[0] ), 0)
12581 else: # otherwise stay compatible with old AddSpacer
12582 return self.Add(*args, **kw)
12583 def PrependSpacer(self, *args, **kw):
12584 """PrependSpacer(int size) --> SizerItem
12585
12586 Prepend a spacer that is (size, size) pixels."""
12587 if args and type(args[0]) == int:
12588 return self.Prepend( (args[0],args[0] ), 0)
12589 else: # otherwise stay compatible with old PrependSpacer
12590 return self.Prepend(*args, **kw)
12591 def InsertSpacer(self, index, *args, **kw):
12592 """InsertSpacer(int index, int size) --> SizerItem
12593
12594 Insert a spacer at position index that is (size, size) pixels."""
12595 if args and type(args[0]) == int:
12596 return self.Insert( index, (args[0],args[0] ), 0)
12597 else: # otherwise stay compatible with old InsertSpacer
12598 return self.Insert(index, *args, **kw)
12599
12600
12601 def AddStretchSpacer(self, prop=1):
12602 """AddStretchSpacer(int prop=1) --> SizerItem
12603
12604 Add a stretchable spacer."""
12605 return self.Add((0,0), prop)
12606 def PrependStretchSpacer(self, prop=1):
12607 """PrependStretchSpacer(int prop=1) --> SizerItem
12608
12609 Prepend a stretchable spacer."""
12610 return self.Prepend((0,0), prop)
12611 def InsertStretchSpacer(self, index, prop=1):
12612 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
12613
12614 Insert a stretchable spacer."""
12615 return self.Insert(index, (0,0), prop)
12616
12617
74e96f3d 12618 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
12619 def AddWindow(self, *args, **kw):
12620 """Compatibility alias for `Add`."""
12621 return self.Add(*args, **kw)
12622 def AddSizer(self, *args, **kw):
12623 """Compatibility alias for `Add`."""
12624 return self.Add(*args, **kw)
b9d6a5f3
RD
12625
12626 def PrependWindow(self, *args, **kw):
12627 """Compatibility alias for `Prepend`."""
12628 return self.Prepend(*args, **kw)
12629 def PrependSizer(self, *args, **kw):
12630 """Compatibility alias for `Prepend`."""
12631 return self.Prepend(*args, **kw)
b9d6a5f3
RD
12632
12633 def InsertWindow(self, *args, **kw):
12634 """Compatibility alias for `Insert`."""
12635 return self.Insert(*args, **kw)
12636 def InsertSizer(self, *args, **kw):
12637 """Compatibility alias for `Insert`."""
b9d6a5f3
RD
12638 return self.Insert(*args, **kw)
12639
12640 def RemoveWindow(self, *args, **kw):
12641 """Compatibility alias for `Remove`."""
12642 return self.Remove(*args, **kw)
12643 def RemoveSizer(self, *args, **kw):
12644 """Compatibility alias for `Remove`."""
12645 return self.Remove(*args, **kw)
12646 def RemovePos(self, *args, **kw):
12647 """Compatibility alias for `Remove`."""
12648 return self.Remove(*args, **kw)
d14a1e28
RD
12649
12650
e811c8ce 12651 def SetDimension(*args, **kwargs):
248ed943
RD
12652 """
12653 SetDimension(self, int x, int y, int width, int height)
12654
12655 Call this to force the sizer to take the given dimension and thus
12656 force the items owned by the sizer to resize themselves according to
12657 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
12658 methods.
12659 """
54f9ee45 12660 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
12661
12662 def SetMinSize(*args, **kwargs):
248ed943
RD
12663 """
12664 SetMinSize(self, Size size)
12665
12666 Call this to give the sizer a minimal size. Normally, the sizer will
12667 calculate its minimal size based purely on how much space its children
12668 need. After calling this method `GetMinSize` will return either the
12669 minimal size as requested by its children or the minimal size set
12670 here, depending on which is bigger.
12671 """
54f9ee45 12672 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
12673
12674 def GetSize(*args, **kwargs):
248ed943
RD
12675 """
12676 GetSize(self) -> Size
12677
12678 Returns the current size of the space managed by the sizer.
12679 """
54f9ee45 12680 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
12681
12682 def GetPosition(*args, **kwargs):
248ed943
RD
12683 """
12684 GetPosition(self) -> Point
12685
12686 Returns the current position of the sizer's managed space.
12687 """
54f9ee45 12688 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
12689
12690 def GetMinSize(*args, **kwargs):
248ed943
RD
12691 """
12692 GetMinSize(self) -> Size
12693
12694 Returns the minimal size of the sizer. This is either the combined
12695 minimal size of all the children and their borders or the minimal size
12696 set by SetMinSize, depending on which is bigger.
12697 """
54f9ee45 12698 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 12699
d14a1e28 12700 def GetSizeTuple(self):
1c0f361b 12701 return self.GetSize().Get()
d14a1e28 12702 def GetPositionTuple(self):
1c0f361b 12703 return self.GetPosition().Get()
d14a1e28 12704 def GetMinSizeTuple(self):
1c0f361b 12705 return self.GetMinSize().Get()
d14a1e28 12706
e811c8ce 12707 def RecalcSizes(*args, **kwargs):
248ed943
RD
12708 """
12709 RecalcSizes(self)
12710
12711 Using the sizes calculated by `CalcMin` reposition and resize all the
12712 items managed by this sizer. You should not need to call this directly as
12713 it is called by `Layout`.
12714 """
54f9ee45 12715 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
12716
12717 def CalcMin(*args, **kwargs):
248ed943
RD
12718 """
12719 CalcMin(self) -> Size
12720
12721 This method is where the sizer will do the actual calculation of its
12722 children's minimal sizes. You should not need to call this directly as
12723 it is called by `Layout`.
12724 """
54f9ee45 12725 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
12726
12727 def Layout(*args, **kwargs):
248ed943
RD
12728 """
12729 Layout(self)
12730
12731 This method will force the recalculation and layout of the items
12732 controlled by the sizer using the current space allocated to the
12733 sizer. Normally this is called automatically from the owning window's
12734 EVT_SIZE handler, but it is also useful to call it from user code when
12735 one of the items in a sizer change size, or items are added or
12736 removed.
12737 """
54f9ee45 12738 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
12739
12740 def Fit(*args, **kwargs):
248ed943
RD
12741 """
12742 Fit(self, Window window) -> Size
12743
12744 Tell the sizer to resize the *window* to match the sizer's minimal
12745 size. This is commonly done in the constructor of the window itself in
12746 order to set its initial size to match the needs of the children as
12747 determined by the sizer. Returns the new size.
12748
12749 For a top level window this is the total window size, not the client size.
12750 """
54f9ee45 12751 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
12752
12753 def FitInside(*args, **kwargs):
248ed943
RD
12754 """
12755 FitInside(self, Window window)
12756
12757 Tell the sizer to resize the *virtual size* of the *window* to match the
12758 sizer's minimal size. This will not alter the on screen size of the
12759 window, but may cause the addition/removal/alteration of scrollbars
12760 required to view the virtual area in windows which manage it.
12761
12762 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12763
12764 """
54f9ee45 12765 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
12766
12767 def SetSizeHints(*args, **kwargs):
248ed943
RD
12768 """
12769 SetSizeHints(self, Window window)
12770
12771 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12772 match the sizer's minimal size. This is commonly done in the
12773 constructor of the window itself if the window is resizable (as are
12774 many dialogs under Unix and frames on probably all platforms) in order
12775 to prevent the window from being sized smaller than the minimal size
12776 required by the sizer.
12777 """
54f9ee45 12778 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
12779
12780 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
12781 """
12782 SetVirtualSizeHints(self, Window window)
12783
12784 Tell the sizer to set the minimal size of the window virtual area to
12785 match the sizer's minimal size. For windows with managed scrollbars
12786 this will set them appropriately.
12787
12788 :see: `wx.ScrolledWindow.SetScrollbars`
12789
12790 """
54f9ee45 12791 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
12792
12793 def Clear(*args, **kwargs):
248ed943
RD
12794 """
12795 Clear(self, bool deleteWindows=False)
12796
12797 Clear all items from the sizer, optionally destroying the window items
12798 as well.
12799 """
54f9ee45 12800 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
12801
12802 def DeleteWindows(*args, **kwargs):
248ed943
RD
12803 """
12804 DeleteWindows(self)
12805
12806 Destroy all windows managed by the sizer.
12807 """
54f9ee45 12808 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
12809
12810 def GetChildren(*args, **kwargs):
248ed943 12811 """
51b83b37 12812 GetChildren(self) -> list
248ed943
RD
12813
12814 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12815 """
54f9ee45 12816 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
12817
12818 def Show(*args, **kwargs):
248ed943 12819 """
ae8162c8 12820 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 12821
248ed943
RD
12822 Shows or hides an item managed by the sizer. To make a sizer item
12823 disappear or reappear, use Show followed by `Layout`. The *item*
12824 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
12825 the item. Use the recursive parameter to show or hide an item in a
12826 subsizer. Returns True if the item was found.
248ed943
RD
12827 """
12828 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
12829
12830 def IsShown(*args, **kwargs):
248ed943
RD
12831 """
12832 IsShown(self, item)
12833
b1fcee84 12834 Determines if the item is currently shown. To make a sizer
248ed943
RD
12835 item disappear or reappear, use Show followed by `Layout`. The *item*
12836 parameter can be either a window, a sizer, or the zero-based index of
12837 the item.
12838 """
54f9ee45 12839 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 12840
7e63a440 12841 def Hide(self, item, recursive=False):
248ed943 12842 """
27fb7603 12843 A convenience method for `Show` (item, False, recursive).
248ed943 12844 """
06759a38 12845 return self.Show(item, False, recursive)
248ed943 12846
e811c8ce 12847 def ShowItems(*args, **kwargs):
248ed943
RD
12848 """
12849 ShowItems(self, bool show)
12850
84f85550 12851 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 12852 """
54f9ee45 12853 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 12854
33d6fd3b
RD
12855 Children = property(GetChildren,doc="See `GetChildren`")
12856 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12857 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12858 Position = property(GetPosition,doc="See `GetPosition`")
12859 Size = property(GetSize,doc="See `GetSize`")
2131d850 12860_core_.Sizer_swigregister(Sizer)
d14a1e28
RD
12861
12862class PySizer(Sizer):
248ed943
RD
12863 """
12864 wx.PySizer is a special version of `wx.Sizer` that has been
12865 instrumented to allow the C++ virtual methods to be overloaded in
12866 Python derived classes. You would derive from this class if you are
12867 wanting to implement a custom sizer in Python code. Simply implement
12868 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12869 For example::
12870
12871 class MySizer(wx.PySizer):
12872 def __init__(self):
12873 wx.PySizer.__init__(self)
12874
12875 def CalcMin(self):
12876 for item in self.GetChildren():
12877 # calculate the total minimum width and height needed
12878 # by all items in the sizer according to this sizer's
12879 # layout algorithm.
12880 ...
12881 return wx.Size(width, height)
12882
12883 def RecalcSizes(self):
12884 # find the space allotted to this sizer
12885 pos = self.GetPosition()
12886 size = self.GetSize()
12887 for item in self.GetChildren():
12888 # Recalculate (if necessary) the position and size of
12889 # each item and then call item.SetDimension to do the
12890 # actual positioning and sizing of the items within the
12891 # space alloted to this sizer.
12892 ...
12893 item.SetDimension(itemPos, itemSize)
12894
12895
12896 When `Layout` is called it first calls `CalcMin` followed by
12897 `RecalcSizes` so you can optimize a bit by saving the results of
e505d15e 12898 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
12899
12900 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12901
12902
12903 """
0085ce49
RD
12904 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12905 __repr__ = _swig_repr
12906 def __init__(self, *args, **kwargs):
248ed943
RD
12907 """
12908 __init__(self) -> PySizer
12909
12910 Creates a wx.PySizer. Must be called from the __init__ in the derived
12911 class.
12912 """
0085ce49 12913 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
c25f90f6 12914 self._setOORInfo(self);PySizer._setCallbackInfo(self, self, PySizer)
e811c8ce
RD
12915
12916 def _setCallbackInfo(*args, **kwargs):
a95a7133 12917 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 12918 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 12919
2131d850 12920_core_.PySizer_swigregister(PySizer)
d14a1e28
RD
12921
12922#---------------------------------------------------------------------------
12923
12924class BoxSizer(Sizer):
248ed943
RD
12925 """
12926 The basic idea behind a box sizer is that windows will most often be
12927 laid out in rather simple basic geometry, typically in a row or a
12928 column or nested hierarchies of either. A wx.BoxSizer will lay out
12929 its items in a simple row or column, depending on the orientation
12930 parameter passed to the constructor.
12931 """
0085ce49
RD
12932 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12933 __repr__ = _swig_repr
12934 def __init__(self, *args, **kwargs):
248ed943
RD
12935 """
12936 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12937
12938 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12939 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12940 sizer.
12941 """
0085ce49 12942 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d14a1e28 12943 self._setOORInfo(self)
e811c8ce
RD
12944
12945 def GetOrientation(*args, **kwargs):
248ed943
RD
12946 """
12947 GetOrientation(self) -> int
12948
12949 Returns the current orientation of the sizer.
12950 """
54f9ee45 12951 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
12952
12953 def SetOrientation(*args, **kwargs):
248ed943
RD
12954 """
12955 SetOrientation(self, int orient)
e811c8ce 12956
248ed943
RD
12957 Resets the orientation of the sizer.
12958 """
12959 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 12960
2bf58437 12961 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
2131d850 12962_core_.BoxSizer_swigregister(BoxSizer)
d14a1e28
RD
12963
12964#---------------------------------------------------------------------------
12965
12966class StaticBoxSizer(BoxSizer):
248ed943
RD
12967 """
12968 wx.StaticBoxSizer derives from and functions identically to the
12969 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12970 manages. Note that this static box must be created separately and
12971 passed to the sizer constructor.
12972 """
0085ce49
RD
12973 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12974 __repr__ = _swig_repr
12975 def __init__(self, *args, **kwargs):
248ed943
RD
12976 """
12977 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12978
12979 Constructor. It takes an associated static box and the orientation
12980 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12981 ``wx.HORIZONTAL``.
12982 """
0085ce49 12983 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d14a1e28 12984 self._setOORInfo(self)
e811c8ce
RD
12985
12986 def GetStaticBox(*args, **kwargs):
248ed943
RD
12987 """
12988 GetStaticBox(self) -> StaticBox
e811c8ce 12989
248ed943
RD
12990 Returns the static box associated with this sizer.
12991 """
12992 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 12993
33d6fd3b 12994 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
2131d850 12995_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d14a1e28
RD
12996
12997#---------------------------------------------------------------------------
12998
12999class GridSizer(Sizer):
248ed943
RD
13000 """
13001 A grid sizer is a sizer which lays out its children in a
13002 two-dimensional table with all cells having the same size. In other
13003 words, the width of each cell within the grid is the width of the
13004 widest item added to the sizer and the height of each grid cell is the
13005 height of the tallest item. An optional vertical and/or horizontal
13006 gap between items can also be specified (in pixels.)
13007
13008 Items are placed in the cells of the grid in the order they are added,
13009 in row-major order. In other words, the first row is filled first,
13010 then the second, and so on until all items have been added. (If
13011 neccessary, additional rows will be added as items are added.) If you
13012 need to have greater control over the cells that items are placed in
13013 then use the `wx.GridBagSizer`.
13014
13015 """
0085ce49
RD
13016 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13017 __repr__ = _swig_repr
13018 def __init__(self, *args, **kwargs):
248ed943
RD
13019 """
13020 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
13021
13022 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
13023 of columns and rows in the sizer - if either of the parameters is
13024 zero, it will be calculated to from the total number of children in
13025 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13026 define extra space between all children.
13027 """
0085ce49 13028 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d14a1e28 13029 self._setOORInfo(self)
e811c8ce 13030
e811c8ce 13031 def SetCols(*args, **kwargs):
248ed943
RD
13032 """
13033 SetCols(self, int cols)
13034
13035 Sets the number of columns in the sizer.
13036 """
54f9ee45 13037 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
13038
13039 def SetRows(*args, **kwargs):
248ed943
RD
13040 """
13041 SetRows(self, int rows)
13042
13043 Sets the number of rows in the sizer.
13044 """
54f9ee45 13045 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
13046
13047 def SetVGap(*args, **kwargs):
248ed943
RD
13048 """
13049 SetVGap(self, int gap)
13050
13051 Sets the vertical gap (in pixels) between the cells in the sizer.
13052 """
54f9ee45 13053 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
13054
13055 def SetHGap(*args, **kwargs):
248ed943
RD
13056 """
13057 SetHGap(self, int gap)
13058
13059 Sets the horizontal gap (in pixels) between cells in the sizer
13060 """
54f9ee45 13061 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
13062
13063 def GetCols(*args, **kwargs):
248ed943
RD
13064 """
13065 GetCols(self) -> int
13066
13067 Returns the number of columns in the sizer.
13068 """
54f9ee45 13069 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
13070
13071 def GetRows(*args, **kwargs):
248ed943
RD
13072 """
13073 GetRows(self) -> int
13074
13075 Returns the number of rows in the sizer.
13076 """
54f9ee45 13077 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
13078
13079 def GetVGap(*args, **kwargs):
248ed943
RD
13080 """
13081 GetVGap(self) -> int
13082
13083 Returns the vertical gap (in pixels) between the cells in the sizer.
13084 """
54f9ee45 13085 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
13086
13087 def GetHGap(*args, **kwargs):
248ed943
RD
13088 """
13089 GetHGap(self) -> int
13090
13091 Returns the horizontal gap (in pixels) between cells in the sizer.
13092 """
54f9ee45 13093 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 13094
0085ce49
RD
13095 def CalcRowsCols(self):
13096 """
13097 CalcRowsCols() -> (rows, cols)
13098
13099 Calculates how many rows and columns will be in the sizer based
13100 on the current number of items and also the rows, cols specified
13101 in the constructor.
13102 """
13103 nitems = len(self.GetChildren())
13104 rows = self.GetRows()
13105 cols = self.GetCols()
13106 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
13107 if cols != 0:
13108 rows = (nitems + cols - 1) / cols
13109 elif rows != 0:
13110 cols = (nitems + rows - 1) / rows
13111 return (rows, cols)
d14a1e28 13112
97ab0f6a
RD
13113 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
13114 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
13115 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
13116 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
2131d850 13117_core_.GridSizer_swigregister(GridSizer)
d14a1e28
RD
13118
13119#---------------------------------------------------------------------------
13120
54f9ee45
RD
13121FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
13122FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
13123FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 13124class FlexGridSizer(GridSizer):
248ed943
RD
13125 """
13126 A flex grid sizer is a sizer which lays out its children in a
13127 two-dimensional table with all table cells in one row having the same
13128 height and all cells in one column having the same width, but all
13129 rows or all columns are not necessarily the same height or width as in
13130 the `wx.GridSizer`.
13131
13132 wx.FlexGridSizer can also size items equally in one direction but
13133 unequally ("flexibly") in the other. If the sizer is only flexible
13134 in one direction (this can be changed using `SetFlexibleDirection`), it
13135 needs to be decided how the sizer should grow in the other ("non
13136 flexible") direction in order to fill the available space. The
13137 `SetNonFlexibleGrowMode` method serves this purpose.
13138
13139
13140 """
0085ce49
RD
13141 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13142 __repr__ = _swig_repr
13143 def __init__(self, *args, **kwargs):
248ed943
RD
13144 """
13145 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
13146
13147 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
13148 number of columns and rows in the sizer - if either of the parameters
13149 is zero, it will be calculated to from the total number of children in
13150 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13151 define extra space between all children.
13152 """
0085ce49 13153 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d14a1e28 13154 self._setOORInfo(self)
e811c8ce 13155
248ed943
RD
13156 def AddGrowableRow(*args, **kwargs):
13157 """
13158 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 13159
248ed943
RD
13160 Specifies that row *idx* (starting from zero) should be grown if there
13161 is extra space available to the sizer.
e811c8ce 13162
248ed943
RD
13163 The *proportion* parameter has the same meaning as the stretch factor
13164 for the box sizers except that if all proportions are 0, then all
13165 columns are resized equally (instead of not being resized at all).
13166 """
54f9ee45 13167 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
13168
13169 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
13170 """
13171 RemoveGrowableRow(self, size_t idx)
13172
13173 Specifies that row *idx* is no longer growable.
13174 """
54f9ee45 13175 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
13176
13177 def AddGrowableCol(*args, **kwargs):
248ed943
RD
13178 """
13179 AddGrowableCol(self, size_t idx, int proportion=0)
13180
13181 Specifies that column *idx* (starting from zero) should be grown if
13182 there is extra space available to the sizer.
13183
13184 The *proportion* parameter has the same meaning as the stretch factor
13185 for the box sizers except that if all proportions are 0, then all
13186 columns are resized equally (instead of not being resized at all).
13187 """
54f9ee45 13188 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
13189
13190 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
13191 """
13192 RemoveGrowableCol(self, size_t idx)
13193
13194 Specifies that column *idx* is no longer growable.
13195 """
54f9ee45 13196 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
13197
13198 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
13199 """
13200 SetFlexibleDirection(self, int direction)
13201
13202 Specifies whether the sizer should flexibly resize its columns, rows,
13203 or both. Argument *direction* can be one of the following values. Any
13204 other value is ignored.
13205
13206 ============== =======================================
13207 wx.VERTICAL Rows are flexibly sized.
13208 wx.HORIZONTAL Columns are flexibly sized.
13209 wx.BOTH Both rows and columns are flexibly sized
13210 (this is the default value).
13211 ============== =======================================
13212
13213 Note that this method does not trigger relayout.
13214
13215 """
54f9ee45 13216 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
13217
13218 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
13219 """
13220 GetFlexibleDirection(self) -> int
13221
13222 Returns a value that specifies whether the sizer
13223 flexibly resizes its columns, rows, or both (default).
13224
13225 :see: `SetFlexibleDirection`
13226 """
54f9ee45 13227 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
13228
13229 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
13230 """
13231 SetNonFlexibleGrowMode(self, int mode)
13232
13233 Specifies how the sizer should grow in the non-flexible direction if
13234 there is one (so `SetFlexibleDirection` must have been called
13235 previously). Argument *mode* can be one of the following values:
13236
13237 ========================== =================================================
13238 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
13239 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
13240 `AddGrowableCol` and `AddGrowableRow`. In this
13241 case equal sizing applies to minimum sizes of
13242 columns or rows (this is the default value).
13243 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
13244 the non flexible direction, whether they are
13245 growable or not in the flexbile direction.
13246 ========================== =================================================
13247
13248 Note that this method does not trigger relayout.
248ed943 13249 """
54f9ee45 13250 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
13251
13252 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
13253 """
13254 GetNonFlexibleGrowMode(self) -> int
13255
13256 Returns the value that specifies how the sizer grows in the
13257 non-flexible direction if there is one.
13258
13259 :see: `SetNonFlexibleGrowMode`
13260 """
54f9ee45 13261 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
13262
13263 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
13264 """
13265 GetRowHeights(self) -> list
13266
13267 Returns a list of integers representing the heights of each of the
13268 rows in the sizer.
13269 """
54f9ee45 13270 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
13271
13272 def GetColWidths(*args, **kwargs):
fd2dc343
RD
13273 """
13274 GetColWidths(self) -> list
13275
13276 Returns a list of integers representing the widths of each of the
13277 columns in the sizer.
13278 """
54f9ee45 13279 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 13280
97ab0f6a
RD
13281 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
13282 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
13283 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
13284 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
2131d850 13285_core_.FlexGridSizer_swigregister(FlexGridSizer)
d14a1e28 13286
e505d15e
RD
13287class StdDialogButtonSizer(BoxSizer):
13288 """
13289 A special sizer that knows how to order and position standard buttons
13290 in order to conform to the current platform's standards. You simply
13291 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 13292 buttons using the standard ID's. Then call `Realize` and the sizer
e505d15e
RD
13293 will take care of the rest.
13294
13295 """
0085ce49
RD
13296 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13297 __repr__ = _swig_repr
13298 def __init__(self, *args, **kwargs):
e505d15e 13299 """__init__(self) -> StdDialogButtonSizer"""
0085ce49 13300 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
e505d15e
RD
13301 def AddButton(*args, **kwargs):
13302 """
13303 AddButton(self, wxButton button)
13304
13305 Use this to add the buttons to this sizer. Do not use the `Add`
13306 method in the base class.
13307 """
13308 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
13309
53aa7709 13310 def Realize(*args, **kwargs):
e505d15e 13311 """
53aa7709 13312 Realize(self)
e505d15e
RD
13313
13314 This funciton needs to be called after all the buttons have been added
13315 to the sizer. It will reorder them and position them in a platform
13316 specifc manner.
13317 """
53aa7709 13318 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
13319
13320 def SetAffirmativeButton(*args, **kwargs):
13321 """SetAffirmativeButton(self, wxButton button)"""
13322 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
13323
13324 def SetNegativeButton(*args, **kwargs):
13325 """SetNegativeButton(self, wxButton button)"""
13326 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
13327
13328 def SetCancelButton(*args, **kwargs):
13329 """SetCancelButton(self, wxButton button)"""
13330 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
e505d15e
RD
13331
13332 def GetAffirmativeButton(*args, **kwargs):
13333 """GetAffirmativeButton(self) -> wxButton"""
13334 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
13335
13336 def GetApplyButton(*args, **kwargs):
13337 """GetApplyButton(self) -> wxButton"""
13338 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
13339
13340 def GetNegativeButton(*args, **kwargs):
13341 """GetNegativeButton(self) -> wxButton"""
13342 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
13343
13344 def GetCancelButton(*args, **kwargs):
13345 """GetCancelButton(self) -> wxButton"""
13346 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
13347
13348 def GetHelpButton(*args, **kwargs):
13349 """GetHelpButton(self) -> wxButton"""
13350 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
13351
33d6fd3b
RD
13352 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
13353 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
13354 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
13355 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
13356 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
2131d850 13357_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
e505d15e 13358
d14a1e28
RD
13359#---------------------------------------------------------------------------
13360
13361class GBPosition(object):
248ed943
RD
13362 """
13363 This class represents the position of an item in a virtual grid of
13364 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13365 typemaps that will automatically convert from a 2-element sequence of
13366 integers to a wx.GBPosition, so you can use the more pythonic
13367 representation of the position nearly transparently in Python code.
13368 """
0085ce49
RD
13369 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13370 __repr__ = _swig_repr
13371 def __init__(self, *args, **kwargs):
248ed943
RD
13372 """
13373 __init__(self, int row=0, int col=0) -> GBPosition
13374
13375 This class represents the position of an item in a virtual grid of
13376 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13377 typemaps that will automatically convert from a 2-element sequence of
13378 integers to a wx.GBPosition, so you can use the more pythonic
13379 representation of the position nearly transparently in Python code.
13380 """
0085ce49
RD
13381 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
13382 __swig_destroy__ = _core_.delete_GBPosition
13383 __del__ = lambda self : None;
e811c8ce 13384 def GetRow(*args, **kwargs):
a95a7133 13385 """GetRow(self) -> int"""
54f9ee45 13386 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
13387
13388 def GetCol(*args, **kwargs):
a95a7133 13389 """GetCol(self) -> int"""
54f9ee45 13390 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
13391
13392 def SetRow(*args, **kwargs):
a95a7133 13393 """SetRow(self, int row)"""
54f9ee45 13394 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
13395
13396 def SetCol(*args, **kwargs):
a95a7133 13397 """SetCol(self, int col)"""
54f9ee45 13398 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
13399
13400 def __eq__(*args, **kwargs):
e9d6f3a4
RD
13401 """
13402 __eq__(self, PyObject other) -> bool
13403
13404 Compare GBPosition for equality.
13405 """
54f9ee45 13406 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
13407
13408 def __ne__(*args, **kwargs):
e9d6f3a4
RD
13409 """
13410 __ne__(self, PyObject other) -> bool
13411
13412 Compare GBPosition for inequality.
13413 """
54f9ee45 13414 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
13415
13416 def Set(*args, **kwargs):
a95a7133 13417 """Set(self, int row=0, int col=0)"""
54f9ee45 13418 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
13419
13420 def Get(*args, **kwargs):
a95a7133 13421 """Get(self) -> PyObject"""
54f9ee45 13422 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 13423
41e2b43e 13424 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
13425 def __str__(self): return str(self.Get())
13426 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
13427 def __len__(self): return len(self.Get())
13428 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
13429 def __setitem__(self, index, val):
13430 if index == 0: self.SetRow(val)
13431 elif index == 1: self.SetCol(val)
13432 else: raise IndexError
e811c8ce 13433 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
13434 __safe_for_unpickling__ = True
13435 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
13436
13437 row = property(GetRow, SetRow)
13438 col = property(GetCol, SetCol)
13439
2131d850 13440_core_.GBPosition_swigregister(GBPosition)
d14a1e28
RD
13441
13442class GBSpan(object):
248ed943
RD
13443 """
13444 This class is used to hold the row and column spanning attributes of
13445 items in a `wx.GridBagSizer`. wxPython has typemaps that will
13446 automatically convert from a 2-element sequence of integers to a
13447 wx.GBSpan, so you can use the more pythonic representation of the span
13448 nearly transparently in Python code.
13449
13450 """
0085ce49
RD
13451 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13452 __repr__ = _swig_repr
13453 def __init__(self, *args, **kwargs):
248ed943
RD
13454 """
13455 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
13456
13457 Construct a new wxGBSpan, optionally setting the rowspan and
13458 colspan. The default is (1,1). (Meaning that the item occupies one
13459 cell in each direction.
13460 """
0085ce49
RD
13461 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
13462 __swig_destroy__ = _core_.delete_GBSpan
13463 __del__ = lambda self : None;
e811c8ce 13464 def GetRowspan(*args, **kwargs):
a95a7133 13465 """GetRowspan(self) -> int"""
54f9ee45 13466 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
13467
13468 def GetColspan(*args, **kwargs):
a95a7133 13469 """GetColspan(self) -> int"""
54f9ee45 13470 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
13471
13472 def SetRowspan(*args, **kwargs):
a95a7133 13473 """SetRowspan(self, int rowspan)"""
54f9ee45 13474 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
13475
13476 def SetColspan(*args, **kwargs):
a95a7133 13477 """SetColspan(self, int colspan)"""
54f9ee45 13478 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
13479
13480 def __eq__(*args, **kwargs):
e9d6f3a4
RD
13481 """
13482 __eq__(self, PyObject other) -> bool
13483
13484 Compare wxGBSpan for equality.
13485 """
54f9ee45 13486 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
13487
13488 def __ne__(*args, **kwargs):
e9d6f3a4
RD
13489 """
13490 __ne__(self, PyObject other) -> bool
13491
13492 Compare GBSpan for inequality.
13493 """
54f9ee45 13494 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
13495
13496 def Set(*args, **kwargs):
a95a7133 13497 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 13498 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
13499
13500 def Get(*args, **kwargs):
a95a7133 13501 """Get(self) -> PyObject"""
54f9ee45 13502 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 13503
41e2b43e 13504 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
13505 def __str__(self): return str(self.Get())
13506 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
13507 def __len__(self): return len(self.Get())
13508 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
13509 def __setitem__(self, index, val):
13510 if index == 0: self.SetRowspan(val)
13511 elif index == 1: self.SetColspan(val)
13512 else: raise IndexError
e811c8ce 13513 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
13514 __safe_for_unpickling__ = True
13515 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
13516
13517 rowspan = property(GetRowspan, SetRowspan)
13518 colspan = property(GetColspan, SetColspan)
13519
2131d850 13520_core_.GBSpan_swigregister(GBSpan)
d14a1e28
RD
13521
13522class GBSizerItem(SizerItem):
248ed943
RD
13523 """
13524 The wx.GBSizerItem class is used to track the additional data about
13525 items in a `wx.GridBagSizer` such as the item's position in the grid
13526 and how many rows or columns it spans.
13527
13528 """
0085ce49
RD
13529 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13530 __repr__ = _swig_repr
13531 def __init__(self, *args, **kwargs):
248ed943
RD
13532 """
13533 __init__(self) -> GBSizerItem
13534
13535 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
13536 size will need to be set, as well as a position and span before this
13537 item can be used in a Sizer.
13538
13539 You will probably never need to create a wx.GBSizerItem directly as they
13540 are created automatically when the sizer's Add method is called.
13541 """
0085ce49
RD
13542 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
13543 __swig_destroy__ = _core_.delete_GBSizerItem
13544 __del__ = lambda self : None;
e811c8ce 13545 def GetPos(*args, **kwargs):
248ed943
RD
13546 """
13547 GetPos(self) -> GBPosition
13548
13549 Get the grid position of the item
13550 """
54f9ee45 13551 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
13552
13553 def GetPosTuple(self): return self.GetPos().Get()
13554 def GetSpan(*args, **kwargs):
248ed943
RD
13555 """
13556 GetSpan(self) -> GBSpan
13557
13558 Get the row and column spanning of the item
13559 """
54f9ee45 13560 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
13561
13562 def GetSpanTuple(self): return self.GetSpan().Get()
13563 def SetPos(*args, **kwargs):
248ed943
RD
13564 """
13565 SetPos(self, GBPosition pos) -> bool
13566
13567 If the item is already a member of a sizer then first ensure that
13568 there is no other item that would intersect with this one at the new
13569 position, then set the new position. Returns True if the change is
13570 successful and after the next Layout() the item will be moved.
13571 """
54f9ee45 13572 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
13573
13574 def SetSpan(*args, **kwargs):
248ed943
RD
13575 """
13576 SetSpan(self, GBSpan span) -> bool
13577
13578 If the item is already a member of a sizer then first ensure that
13579 there is no other item that would intersect with this one with its new
13580 spanning size, then set the new spanning. Returns True if the change
13581 is successful and after the next Layout() the item will be resized.
13582
13583 """
54f9ee45 13584 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 13585
248ed943 13586 def Intersects(*args, **kwargs):
0df68c9f 13587 """
a95a7133 13588 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
13589
13590 Returns True if this item and the other item instersect.
0df68c9f 13591 """
248ed943
RD
13592 return _core_.GBSizerItem_Intersects(*args, **kwargs)
13593
13594 def IntersectsPos(*args, **kwargs):
13595 """
13596 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
13597
13598 Returns True if the given pos/span would intersect with this item.
13599 """
13600 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
13601
13602 def GetEndPos(*args, **kwargs):
248ed943
RD
13603 """
13604 GetEndPos(self) -> GBPosition
13605
13606 Get the row and column of the endpoint of this item.
13607 """
54f9ee45 13608 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
13609
13610 def GetGBSizer(*args, **kwargs):
248ed943
RD
13611 """
13612 GetGBSizer(self) -> GridBagSizer
13613
13614 Get the sizer this item is a member of.
13615 """
54f9ee45 13616 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
13617
13618 def SetGBSizer(*args, **kwargs):
248ed943
RD
13619 """
13620 SetGBSizer(self, GridBagSizer sizer)
13621
13622 Set the sizer this item is a member of.
13623 """
54f9ee45 13624 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 13625
97ab0f6a
RD
13626 EndPos = property(GetEndPos,doc="See `GetEndPos`")
13627 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
13628 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
13629 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
2131d850 13630_core_.GBSizerItem_swigregister(GBSizerItem)
d14a1e28
RD
13631DefaultSpan = cvar.DefaultSpan
13632
13633def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
13634 """
13635 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
13636 int border, PyObject userData=None) -> GBSizerItem
13637
13638 Construct a `wx.GBSizerItem` for a window.
0df68c9f 13639 """
54f9ee45 13640 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
13641 return val
13642
13643def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
13644 """
13645 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
13646 int border, PyObject userData=None) -> GBSizerItem
13647
13648 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 13649 """
54f9ee45 13650 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
13651 return val
13652
13653def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
13654 """
13655 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
13656 int flag, int border, PyObject userData=None) -> GBSizerItem
13657
13658 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 13659 """
54f9ee45 13660 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
13661 return val
13662
13663class GridBagSizer(FlexGridSizer):
248ed943
RD
13664 """
13665 A `wx.Sizer` that can lay out items in a virtual grid like a
13666 `wx.FlexGridSizer` but in this case explicit positioning of the items
13667 is allowed using `wx.GBPosition`, and items can optionally span more
13668 than one row and/or column using `wx.GBSpan`. The total size of the
13669 virtual grid is determined by the largest row and column that items are
13670 positioned at, adjusted for spanning.
13671
13672 """
0085ce49
RD
13673 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13674 __repr__ = _swig_repr
13675 def __init__(self, *args, **kwargs):
248ed943
RD
13676 """
13677 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
13678
13679 Constructor, with optional parameters to specify the gap between the
13680 rows and columns.
13681 """
0085ce49 13682 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
1823fbb4
RD
13683 self._setOORInfo(self)
13684
e811c8ce 13685 def Add(*args, **kwargs):
0df68c9f 13686 """
248ed943 13687 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 13688 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
13689
13690 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13691 more than one row or column as specified with *span*. The remaining
13692 args behave similarly to `wx.Sizer.Add`.
13693
13694 Returns True if the item was successfully placed at the given cell
13695 position, False if something was already there.
13696
0df68c9f 13697 """
54f9ee45 13698 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
13699
13700 def AddItem(*args, **kwargs):
248ed943 13701 """
d3b6e4ff 13702 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
13703
13704 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13705 the item was successfully placed at its given cell position, False if
13706 something was already there.
13707 """
54f9ee45 13708 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 13709
84f85550
RD
13710 def GetCellSize(*args, **kwargs):
13711 """
13712 GetCellSize(self, int row, int col) -> Size
13713
13714 Get the size of the specified cell, including hgap and
13715 vgap. Only valid after a Layout.
13716 """
13717 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
13718
e811c8ce 13719 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
13720 """
13721 GetEmptyCellSize(self) -> Size
13722
13723 Get the size used for cells in the grid with no item.
13724 """
54f9ee45 13725 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
13726
13727 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
13728 """
13729 SetEmptyCellSize(self, Size sz)
13730
13731 Set the size used for cells in the grid with no item.
13732 """
54f9ee45 13733 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
13734
13735 def GetItemPosition(*args):
0df68c9f 13736 """
248ed943
RD
13737 GetItemPosition(self, item) -> GBPosition
13738
13739 Get the grid position of the specified *item* where *item* is either a
13740 window or subsizer that is a member of this sizer, or a zero-based
13741 index of an item.
0df68c9f 13742 """
54f9ee45 13743 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
13744
13745 def SetItemPosition(*args):
0df68c9f 13746 """
248ed943
RD
13747 SetItemPosition(self, item, GBPosition pos) -> bool
13748
13749 Set the grid position of the specified *item* where *item* is either a
13750 window or subsizer that is a member of this sizer, or a zero-based
13751 index of an item. Returns True on success. If the move is not
13752 allowed (because an item is already there) then False is returned.
13753
0df68c9f 13754 """
54f9ee45 13755 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
13756
13757 def GetItemSpan(*args):
0df68c9f 13758 """
248ed943
RD
13759 GetItemSpan(self, item) -> GBSpan
13760
13761 Get the row/col spanning of the specified *item* where *item* is
13762 either a window or subsizer that is a member of this sizer, or a
13763 zero-based index of an item.
0df68c9f 13764 """
54f9ee45 13765 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
13766
13767 def SetItemSpan(*args):
0df68c9f 13768 """
248ed943
RD
13769 SetItemSpan(self, item, GBSpan span) -> bool
13770
13771 Set the row/col spanning of the specified *item* where *item* is
13772 either a window or subsizer that is a member of this sizer, or a
13773 zero-based index of an item. Returns True on success. If the move is
13774 not allowed (because an item is already there) then False is returned.
0df68c9f 13775 """
54f9ee45 13776 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
13777
13778 def FindItem(*args):
0df68c9f 13779 """
248ed943
RD
13780 FindItem(self, item) -> GBSizerItem
13781
13782 Find the sizer item for the given window or subsizer, returns None if
13783 not found. (non-recursive)
0df68c9f 13784 """
54f9ee45 13785 return _core_.GridBagSizer_FindItem(*args)
e811c8ce 13786
b08d67c2
RD
13787 def GetItem(self, item):
13788 gbsi = None
13789 si = wx.FlexGridSizer.GetItem(self, item)
13790 if not si:
13791 return None
13792 if type(item) is not int:
13793 gbsi = self.FindItem(item)
13794 if gbsi: return gbsi
13795 return si
13796
e811c8ce 13797 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
13798 """
13799 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13800
13801 Return the sizer item for the given grid cell, or None if there is no
13802 item at that position. (non-recursive)
13803 """
54f9ee45 13804 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
13805
13806 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
13807 """
13808 FindItemAtPoint(self, Point pt) -> GBSizerItem
13809
13810 Return the sizer item located at the point given in *pt*, or None if
13811 there is no item at that point. The (x,y) coordinates in pt correspond
13812 to the client coordinates of the window using the sizer for
13813 layout. (non-recursive)
13814 """
54f9ee45 13815 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 13816
248ed943
RD
13817 def CheckForIntersection(*args, **kwargs):
13818 """
13819 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 13820
248ed943
RD
13821 Look at all items and see if any intersect (or would overlap) the
13822 given *item*. Returns True if so, False if there would be no overlap.
13823 If an *excludeItem* is given then it will not be checked for
13824 intersection, for example it may be the item we are checking the
13825 position of.
e811c8ce 13826
248ed943
RD
13827 """
13828 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 13829
248ed943 13830 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 13831 """
248ed943
RD
13832 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13833
13834 Look at all items and see if any intersect (or would overlap) the
13835 given position and span. Returns True if so, False if there would be
13836 no overlap. If an *excludeItem* is given then it will not be checked
13837 for intersection, for example it may be the item we are checking the
13838 position of.
0df68c9f 13839 """
248ed943 13840 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 13841
2131d850 13842_core_.GridBagSizer_swigregister(GridBagSizer)
d14a1e28
RD
13843
13844#---------------------------------------------------------------------------
13845
54f9ee45
RD
13846Left = _core_.Left
13847Top = _core_.Top
13848Right = _core_.Right
13849Bottom = _core_.Bottom
13850Width = _core_.Width
13851Height = _core_.Height
13852Centre = _core_.Centre
13853Center = _core_.Center
13854CentreX = _core_.CentreX
13855CentreY = _core_.CentreY
13856Unconstrained = _core_.Unconstrained
13857AsIs = _core_.AsIs
13858PercentOf = _core_.PercentOf
13859Above = _core_.Above
13860Below = _core_.Below
13861LeftOf = _core_.LeftOf
13862RightOf = _core_.RightOf
13863SameAs = _core_.SameAs
13864Absolute = _core_.Absolute
d14a1e28 13865class IndividualLayoutConstraint(Object):
15afbcd0 13866 """
41e2b43e
RD
13867 Objects of this class are stored in the `wx.LayoutConstraints` class as
13868 one of eight possible constraints that a window can be involved in.
13869 You will never need to create an instance of
13870 wx.IndividualLayoutConstraint, rather you should create a
13871 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 13872 that it contains.
15afbcd0 13873 """
0085ce49
RD
13874 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13875 def __init__(self): raise AttributeError, "No constructor defined"
13876 __repr__ = _swig_repr
e811c8ce 13877 def Set(*args, **kwargs):
41e2b43e
RD
13878 """
13879 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13880
13881 Sets the properties of the constraint. Normally called by one of the
13882 convenience functions such as Above, RightOf, SameAs.
13883 """
54f9ee45 13884 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
13885
13886 def LeftOf(*args, **kwargs):
15afbcd0 13887 """
a95a7133 13888 LeftOf(self, Window sibling, int marg=0)
15afbcd0 13889
41e2b43e
RD
13890 Constrains this edge to be to the left of the given window, with an
13891 optional margin. Implicitly, this is relative to the left edge of the
13892 other window.
15afbcd0 13893 """
54f9ee45 13894 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
13895
13896 def RightOf(*args, **kwargs):
15afbcd0 13897 """
a95a7133 13898 RightOf(self, Window sibling, int marg=0)
15afbcd0 13899
41e2b43e
RD
13900 Constrains this edge to be to the right of the given window, with an
13901 optional margin. Implicitly, this is relative to the right edge of the
13902 other window.
15afbcd0 13903 """
54f9ee45 13904 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
13905
13906 def Above(*args, **kwargs):
15afbcd0 13907 """
a95a7133 13908 Above(self, Window sibling, int marg=0)
15afbcd0 13909
41e2b43e
RD
13910 Constrains this edge to be above the given window, with an optional
13911 margin. Implicitly, this is relative to the top edge of the other
13912 window.
15afbcd0 13913 """
54f9ee45 13914 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
13915
13916 def Below(*args, **kwargs):
15afbcd0 13917 """
a95a7133 13918 Below(self, Window sibling, int marg=0)
15afbcd0 13919
41e2b43e
RD
13920 Constrains this edge to be below the given window, with an optional
13921 margin. Implicitly, this is relative to the bottom edge of the other
13922 window.
15afbcd0 13923 """
54f9ee45 13924 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
13925
13926 def SameAs(*args, **kwargs):
15afbcd0 13927 """
a95a7133 13928 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 13929
41e2b43e
RD
13930 Constrains this edge or dimension to be to the same as the edge of the
13931 given window, with an optional margin.
15afbcd0 13932 """
54f9ee45 13933 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
13934
13935 def PercentOf(*args, **kwargs):
15afbcd0 13936 """
a95a7133 13937 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 13938
41e2b43e
RD
13939 Constrains this edge or dimension to be to a percentage of the given
13940 window, with an optional margin.
15afbcd0 13941 """
54f9ee45 13942 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
13943
13944 def Absolute(*args, **kwargs):
15afbcd0 13945 """
a95a7133 13946 Absolute(self, int val)
15afbcd0 13947
41e2b43e 13948 Constrains this edge or dimension to be the given absolute value.
15afbcd0 13949 """
54f9ee45 13950 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
13951
13952 def Unconstrained(*args, **kwargs):
15afbcd0 13953 """
a95a7133 13954 Unconstrained(self)
15afbcd0 13955
41e2b43e
RD
13956 Sets this edge or dimension to be unconstrained, that is, dependent on
13957 other edges and dimensions from which this value can be deduced.
15afbcd0 13958 """
54f9ee45 13959 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
13960
13961 def AsIs(*args, **kwargs):
15afbcd0 13962 """
a95a7133 13963 AsIs(self)
15afbcd0 13964
41e2b43e
RD
13965 Sets this edge or constraint to be whatever the window's value is at
13966 the moment. If either of the width and height constraints are *as is*,
13967 the window will not be resized, but moved instead. This is important
13968 when considering panel items which are intended to have a default
13969 size, such as a button, which may take its size from the size of the
13970 button label.
15afbcd0 13971 """
54f9ee45 13972 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
13973
13974 def GetOtherWindow(*args, **kwargs):
a95a7133 13975 """GetOtherWindow(self) -> Window"""
54f9ee45 13976 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
13977
13978 def GetMyEdge(*args, **kwargs):
a95a7133 13979 """GetMyEdge(self) -> int"""
54f9ee45 13980 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
13981
13982 def SetEdge(*args, **kwargs):
a95a7133 13983 """SetEdge(self, int which)"""
54f9ee45 13984 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
13985
13986 def SetValue(*args, **kwargs):
a95a7133 13987 """SetValue(self, int v)"""
54f9ee45 13988 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
13989
13990 def GetMargin(*args, **kwargs):
a95a7133 13991 """GetMargin(self) -> int"""
54f9ee45 13992 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
13993
13994 def SetMargin(*args, **kwargs):
a95a7133 13995 """SetMargin(self, int m)"""
54f9ee45 13996 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
13997
13998 def GetValue(*args, **kwargs):
a95a7133 13999 """GetValue(self) -> int"""
54f9ee45 14000 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
14001
14002 def GetPercent(*args, **kwargs):
a95a7133 14003 """GetPercent(self) -> int"""
54f9ee45 14004 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
14005
14006 def GetOtherEdge(*args, **kwargs):
a95a7133 14007 """GetOtherEdge(self) -> int"""
54f9ee45 14008 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
14009
14010 def GetDone(*args, **kwargs):
a95a7133 14011 """GetDone(self) -> bool"""
54f9ee45 14012 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
14013
14014 def SetDone(*args, **kwargs):
a95a7133 14015 """SetDone(self, bool d)"""
54f9ee45 14016 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
14017
14018 def GetRelationship(*args, **kwargs):
a95a7133 14019 """GetRelationship(self) -> int"""
54f9ee45 14020 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
14021
14022 def SetRelationship(*args, **kwargs):
a95a7133 14023 """SetRelationship(self, int r)"""
54f9ee45 14024 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
14025
14026 def ResetIfWin(*args, **kwargs):
15afbcd0 14027 """
a95a7133 14028 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
14029
14030 Reset constraint if it mentions otherWin
14031 """
54f9ee45 14032 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
14033
14034 def SatisfyConstraint(*args, **kwargs):
15afbcd0 14035 """
a95a7133 14036 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
14037
14038 Try to satisfy constraint
14039 """
54f9ee45 14040 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
14041
14042 def GetEdge(*args, **kwargs):
15afbcd0 14043 """
a95a7133 14044 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
14045
14046 Get the value of this edge or dimension, or if this
14047 is not determinable, -1.
14048 """
54f9ee45 14049 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 14050
97ab0f6a
RD
14051 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
14052 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
14053 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
14054 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
14055 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
14056 Percent = property(GetPercent,doc="See `GetPercent`")
14057 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
14058 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
2131d850 14059_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d14a1e28
RD
14060
14061class LayoutConstraints(Object):
15afbcd0 14062 """
41e2b43e
RD
14063 **Note:** constraints are now deprecated and you should use sizers
14064 instead.
15afbcd0 14065
41e2b43e
RD
14066 Objects of this class can be associated with a window to define its
14067 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
14068
14069 The class consists of the following eight constraints of class
14070 wx.IndividualLayoutConstraint, some or all of which should be accessed
14071 directly to set the appropriate constraints.
14072
14073 * left: represents the left hand edge of the window
14074 * right: represents the right hand edge of the window
14075 * top: represents the top edge of the window
14076 * bottom: represents the bottom edge of the window
14077 * width: represents the width of the window
14078 * height: represents the height of the window
14079 * centreX: represents the horizontal centre point of the window
14080 * centreY: represents the vertical centre point of the window
14081
41e2b43e
RD
14082 Most constraints are initially set to have the relationship
14083 wxUnconstrained, which means that their values should be calculated by
14084 looking at known constraints. The exceptions are width and height,
14085 which are set to wxAsIs to ensure that if the user does not specify a
14086 constraint, the existing width and height will be used, to be
14087 compatible with panel items which often have take a default size. If
14088 the constraint is ``wx.AsIs``, the dimension will not be changed.
14089
14090 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
14091
14092 """
0085ce49
RD
14093 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
14094 __repr__ = _swig_repr
54f9ee45
RD
14095 left = property(_core_.LayoutConstraints_left_get)
14096 top = property(_core_.LayoutConstraints_top_get)
14097 right = property(_core_.LayoutConstraints_right_get)
14098 bottom = property(_core_.LayoutConstraints_bottom_get)
14099 width = property(_core_.LayoutConstraints_width_get)
14100 height = property(_core_.LayoutConstraints_height_get)
14101 centreX = property(_core_.LayoutConstraints_centreX_get)
14102 centreY = property(_core_.LayoutConstraints_centreY_get)
0085ce49 14103 def __init__(self, *args, **kwargs):
a95a7133 14104 """__init__(self) -> LayoutConstraints"""
0085ce49
RD
14105 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
14106 __swig_destroy__ = _core_.delete_LayoutConstraints
14107 __del__ = lambda self : None;
e811c8ce 14108 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 14109 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 14110 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
14111
14112 def AreSatisfied(*args, **kwargs):
a95a7133 14113 """AreSatisfied(self) -> bool"""
54f9ee45 14114 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 14115
2131d850 14116_core_.LayoutConstraints_swigregister(LayoutConstraints)
d14a1e28
RD
14117
14118#----------------------------------------------------------------------------
14119
322913ce 14120# Use Python's bool constants if available, make some if not
d14a1e28
RD
14121try:
14122 True
14123except NameError:
322913ce
RD
14124 __builtins__.True = 1==1
14125 __builtins__.False = 1==0
4f89f6a3
RD
14126 def bool(value): return not not value
14127 __builtins__.bool = bool
d14a1e28 14128
d14a1e28
RD
14129
14130
14131# workarounds for bad wxRTTI names
14132__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
14133__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
14134__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
14135
14136
14137#----------------------------------------------------------------------------
14138# Load version numbers from __version__... Ensure that major and minor
7bc1e663 14139# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
14140
14141from __version__ import *
14142__version__ = VERSION_STRING
14143
7bc1e663
RD
14144assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
14145assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 14146if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 14147 import warnings
7bc1e663 14148 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28 14149
f9bf356b
RD
14150
14151def version():
14152 """Returns a string containing version and port info"""
14153 ctype = wx.USE_UNICODE and 'unicode' or 'ansi'
14154 if wx.Platform == '__WXMSW__':
14155 port = 'msw'
14156 elif wx.Platform == '__WXMAC__':
14157 port = 'mac'
14158 elif wx.Platform == '__WXGTK__':
14159 port = 'gtk'
14160 if 'gtk2' in wx.PlatformInfo:
14161 port = 'gtk2'
14162 else:
14163 port = '?'
14164
14165 return "%s (%s-%s)" % (wx.VERSION_STRING, port, ctype)
14166
14167
d14a1e28
RD
14168#----------------------------------------------------------------------------
14169
70b7a5fe
RD
14170# Set wxPython's default string<-->unicode conversion encoding from
14171# the locale, but only if Python's default hasn't been changed. (We
14172# assume that if the user has customized it already then that is the
14173# encoding we need to use as well.)
14174#
14175# The encoding selected here is used when string or unicode objects
14176# need to be converted in order to pass them to wxWidgets. Please be
14177# aware that the default encoding within the same locale may be
14178# slightly different on different platforms. For example, please see
e505d15e
RD
14179# http://www.alanwood.net/demos/charsetdiffs.html for differences
14180# between the common latin/roman encodings.
396fb509
RD
14181
14182default = _sys.getdefaultencoding()
14183if default == 'ascii':
14184 import locale
14185 import codecs
14186 try:
474e2ff2
RD
14187 if hasattr(locale, 'getpreferredencoding'):
14188 default = locale.getpreferredencoding()
14189 else:
14190 default = locale.getdefaultlocale()[1]
396fb509 14191 codecs.lookup(default)
70b7a5fe 14192 except (ValueError, LookupError, TypeError):
396fb509
RD
14193 default = _sys.getdefaultencoding()
14194 del locale
14195 del codecs
5cbf236d
RD
14196if default:
14197 wx.SetDefaultPyEncoding(default)
14198del default
5cbf236d
RD
14199
14200#----------------------------------------------------------------------------
14201
d14a1e28
RD
14202class PyDeadObjectError(AttributeError):
14203 pass
14204
d14a1e28
RD
14205class _wxPyDeadObject(object):
14206 """
14207 Instances of wx objects that are OOR capable will have their __class__
14208 changed to this class when the C++ object is deleted. This should help
14209 prevent crashes due to referencing a bogus C++ pointer.
14210 """
14211 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
14212 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
14213
3a04f143 14214 def __repr__(self):
d14a1e28
RD
14215 if not hasattr(self, "_name"):
14216 self._name = "[unknown]"
14217 return self.reprStr % self._name
14218
3a04f143 14219 def __getattr__(self, *args):
d14a1e28
RD
14220 if not hasattr(self, "_name"):
14221 self._name = "[unknown]"
3a04f143
RD
14222 raise PyDeadObjectError(self.attrStr % self._name)
14223
14224 def __nonzero__(self):
14225 return 0
14226
14227
14228
14229class PyUnbornObjectError(AttributeError):
14230 pass
14231
14232class _wxPyUnbornObject(object):
14233 """
54f9ee45 14234 Some stock objects are created when the wx._core module is
3a04f143
RD
14235 imported, but their C++ instance is not created until the wx.App
14236 object is created and initialized. These object instances will
14237 temporarily have their __class__ changed to this class so an
14238 exception will be raised if they are used before the C++ instance
14239 is ready.
14240 """
14241
14242 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
14243 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
14244
14245 def __repr__(self):
14246 #if not hasattr(self, "_name"):
14247 # self._name = "[unknown]"
14248 return self.reprStr #% self._name
14249
14250 def __getattr__(self, *args):
14251 #if not hasattr(self, "_name"):
14252 # self._name = "[unknown]"
14253 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
14254
14255 def __nonzero__(self):
14256 return 0
14257
14258
14259#----------------------------------------------------------------------------
d14a1e28
RD
14260
14261def CallAfter(callable, *args, **kw):
14262 """
14263 Call the specified function after the current and pending event
14264 handlers have been completed. This is also good for making GUI
61863841
RD
14265 method calls from non-GUI threads. Any extra positional or
14266 keyword args are passed on to the callable when it is called.
14267
846c181b 14268 :see: `wx.CallLater`
d14a1e28
RD
14269 """
14270 app = wx.GetApp()
dfbb5885 14271 assert app is not None, 'No wx.App created yet'
d14a1e28 14272
148275d3
RD
14273 if not hasattr(app, "_CallAfterId"):
14274 app._CallAfterId = wx.NewEventType()
14275 app.Connect(-1, -1, app._CallAfterId,
14276 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 14277 evt = wx.PyEvent()
148275d3 14278 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
14279 evt.callable = callable
14280 evt.args = args
14281 evt.kw = kw
14282 wx.PostEvent(app, evt)
14283
d14a1e28
RD
14284#----------------------------------------------------------------------------
14285
14286
846c181b 14287class CallLater:
d14a1e28 14288 """
8ac8dba0 14289 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
14290 object once after the given amount of milliseconds, passing any
14291 positional or keyword args. The return value of the callable is
61863841 14292 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
14293
14294 If you don't need to get the return value or restart the timer
14295 then there is no need to hold a reference to this object. It will
14296 hold a reference to itself while the timer is running (the timer
14297 has a reference to self.Notify) but the cycle will be broken when
846c181b 14298 the timer completes, automatically cleaning up the wx.CallLater
d14a1e28 14299 object.
61863841
RD
14300
14301 :see: `wx.CallAfter`
d14a1e28
RD
14302 """
14303 def __init__(self, millis, callable, *args, **kwargs):
14304 self.millis = millis
14305 self.callable = callable
14306 self.SetArgs(*args, **kwargs)
14307 self.runCount = 0
4276dc52 14308 self.running = False
d14a1e28
RD
14309 self.hasRun = False
14310 self.result = None
14311 self.timer = None
14312 self.Start()
14313
14314 def __del__(self):
14315 self.Stop()
14316
14317
14318 def Start(self, millis=None, *args, **kwargs):
14319 """
14320 (Re)start the timer
14321 """
14322 self.hasRun = False
14323 if millis is not None:
14324 self.millis = millis
14325 if args or kwargs:
14326 self.SetArgs(*args, **kwargs)
14327 self.Stop()
14328 self.timer = wx.PyTimer(self.Notify)
14329 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 14330 self.running = True
d14a1e28
RD
14331 Restart = Start
14332
14333
14334 def Stop(self):
14335 """
14336 Stop and destroy the timer.
14337 """
14338 if self.timer is not None:
14339 self.timer.Stop()
14340 self.timer = None
14341
14342
14343 def GetInterval(self):
14344 if self.timer is not None:
14345 return self.timer.GetInterval()
14346 else:
14347 return 0
14348
14349
14350 def IsRunning(self):
14351 return self.timer is not None and self.timer.IsRunning()
14352
14353
14354 def SetArgs(self, *args, **kwargs):
14355 """
14356 (Re)set the args passed to the callable object. This is
14357 useful in conjunction with Restart if you want to schedule a
14358 new call to the same callable object but with different
14359 parameters.
14360 """
14361 self.args = args
14362 self.kwargs = kwargs
14363
14364
14365 def HasRun(self):
14366 return self.hasRun
14367
14368 def GetResult(self):
14369 return self.result
14370
14371 def Notify(self):
14372 """
14373 The timer has expired so call the callable.
14374 """
14375 if self.callable and getattr(self.callable, 'im_self', True):
14376 self.runCount += 1
4276dc52 14377 self.running = False
d14a1e28
RD
14378 self.result = self.callable(*self.args, **self.kwargs)
14379 self.hasRun = True
4276dc52
RD
14380 if not self.running:
14381 # if it wasn't restarted, then cleanup
14382 wx.CallAfter(self.Stop)
d14a1e28 14383
97ab0f6a
RD
14384 Interval = property(GetInterval)
14385 Result = property(GetResult)
d14a1e28 14386
a95a7133 14387
846c181b 14388class FutureCall(CallLater):
b39fe951 14389 """A compatibility alias for `CallLater`."""
846c181b 14390
a95a7133
RD
14391#----------------------------------------------------------------------------
14392# Control which items in this module should be documented by epydoc.
14393# We allow only classes and functions, which will help reduce the size
14394# of the docs by filtering out the zillions of constants, EVT objects,
14395# and etc that don't make much sense by themselves, but are instead
14396# documented (or will be) as part of the classes/functions/methods
14397# where they should be used.
14398
66c033b4
RD
14399class __DocFilter:
14400 """
14401 A filter for epydoc that only allows non-Ptr classes and
34e0a3bb 14402 functions, in order to reduce the clutter in the API docs.
66c033b4
RD
14403 """
14404 def __init__(self, globals):
14405 self._globals = globals
14406
14407 def __call__(self, name):
14408 import types
14409 obj = self._globals.get(name, None)
34e0a3bb
RD
14410
14411 # only document classes and function
66c033b4
RD
14412 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
14413 return False
34e0a3bb
RD
14414
14415 # skip other things that are private or will be documented as part of somethign else
0085ce49 14416 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
66c033b4 14417 return False
34e0a3bb
RD
14418
14419 # skip functions that are duplicates of static functions in a class
14420 if name.find('_') != -1:
14421 cls = self._globals.get(name.split('_')[0], None)
14422 methname = name.split('_')[1]
14423 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
14424 return False
14425
66c033b4 14426 return True
a95a7133 14427
d14a1e28
RD
14428#----------------------------------------------------------------------------
14429#----------------------------------------------------------------------------
14430
14431# Import other modules in this package that should show up in the
14432# "core" wx namespace
54f9ee45
RD
14433from _gdi import *
14434from _windows import *
14435from _controls import *
14436from _misc import *
d14a1e28
RD
14437
14438#----------------------------------------------------------------------------
14439#----------------------------------------------------------------------------
14440
14441
32fe5131 14442