]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
wxNullIconBundle
[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
149ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
150ICON_HAND = _core_.ICON_HAND
151ICON_QUESTION = _core_.ICON_QUESTION
152ICON_INFORMATION = _core_.ICON_INFORMATION
153ICON_STOP = _core_.ICON_STOP
154ICON_ASTERISK = _core_.ICON_ASTERISK
155ICON_MASK = _core_.ICON_MASK
156ICON_WARNING = _core_.ICON_WARNING
157ICON_ERROR = _core_.ICON_ERROR
158FORWARD = _core_.FORWARD
159BACKWARD = _core_.BACKWARD
160RESET = _core_.RESET
161HELP = _core_.HELP
162MORE = _core_.MORE
163SETUP = _core_.SETUP
164SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
165SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
166SIZE_AUTO = _core_.SIZE_AUTO
167SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
168SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 169SIZE_FORCE = _core_.SIZE_FORCE
54f9ee45
RD
170PORTRAIT = _core_.PORTRAIT
171LANDSCAPE = _core_.LANDSCAPE
172PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
173PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
174PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
175PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
176ID_ANY = _core_.ID_ANY
177ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 178ID_NONE = _core_.ID_NONE
54f9ee45
RD
179ID_LOWEST = _core_.ID_LOWEST
180ID_OPEN = _core_.ID_OPEN
181ID_CLOSE = _core_.ID_CLOSE
182ID_NEW = _core_.ID_NEW
183ID_SAVE = _core_.ID_SAVE
184ID_SAVEAS = _core_.ID_SAVEAS
185ID_REVERT = _core_.ID_REVERT
186ID_EXIT = _core_.ID_EXIT
187ID_UNDO = _core_.ID_UNDO
188ID_REDO = _core_.ID_REDO
189ID_HELP = _core_.ID_HELP
190ID_PRINT = _core_.ID_PRINT
191ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
fc46b7f3 192ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
54f9ee45
RD
193ID_PREVIEW = _core_.ID_PREVIEW
194ID_ABOUT = _core_.ID_ABOUT
195ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
196ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
197ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
198ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
10044bf1
RD
199ID_HELP_INDEX = _core_.ID_HELP_INDEX
200ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
54f9ee45
RD
201ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
202ID_PREFERENCES = _core_.ID_PREFERENCES
97ab0f6a 203ID_EDIT = _core_.ID_EDIT
54f9ee45
RD
204ID_CUT = _core_.ID_CUT
205ID_COPY = _core_.ID_COPY
206ID_PASTE = _core_.ID_PASTE
207ID_CLEAR = _core_.ID_CLEAR
208ID_FIND = _core_.ID_FIND
209ID_DUPLICATE = _core_.ID_DUPLICATE
210ID_SELECTALL = _core_.ID_SELECTALL
211ID_DELETE = _core_.ID_DELETE
212ID_REPLACE = _core_.ID_REPLACE
213ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
214ID_PROPERTIES = _core_.ID_PROPERTIES
215ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
216ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
217ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
218ID_VIEW_LIST = _core_.ID_VIEW_LIST
219ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
220ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
221ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
222ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
97ab0f6a 223ID_FILE = _core_.ID_FILE
54f9ee45
RD
224ID_FILE1 = _core_.ID_FILE1
225ID_FILE2 = _core_.ID_FILE2
226ID_FILE3 = _core_.ID_FILE3
227ID_FILE4 = _core_.ID_FILE4
228ID_FILE5 = _core_.ID_FILE5
229ID_FILE6 = _core_.ID_FILE6
230ID_FILE7 = _core_.ID_FILE7
231ID_FILE8 = _core_.ID_FILE8
232ID_FILE9 = _core_.ID_FILE9
233ID_OK = _core_.ID_OK
234ID_CANCEL = _core_.ID_CANCEL
235ID_APPLY = _core_.ID_APPLY
236ID_YES = _core_.ID_YES
237ID_NO = _core_.ID_NO
238ID_STATIC = _core_.ID_STATIC
239ID_FORWARD = _core_.ID_FORWARD
240ID_BACKWARD = _core_.ID_BACKWARD
241ID_DEFAULT = _core_.ID_DEFAULT
242ID_MORE = _core_.ID_MORE
243ID_SETUP = _core_.ID_SETUP
244ID_RESET = _core_.ID_RESET
245ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
246ID_YESTOALL = _core_.ID_YESTOALL
247ID_NOTOALL = _core_.ID_NOTOALL
248ID_ABORT = _core_.ID_ABORT
249ID_RETRY = _core_.ID_RETRY
250ID_IGNORE = _core_.ID_IGNORE
7bc1e663
RD
251ID_ADD = _core_.ID_ADD
252ID_REMOVE = _core_.ID_REMOVE
253ID_UP = _core_.ID_UP
254ID_DOWN = _core_.ID_DOWN
255ID_HOME = _core_.ID_HOME
256ID_REFRESH = _core_.ID_REFRESH
257ID_STOP = _core_.ID_STOP
258ID_INDEX = _core_.ID_INDEX
259ID_BOLD = _core_.ID_BOLD
260ID_ITALIC = _core_.ID_ITALIC
261ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
262ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
263ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
264ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
265ID_UNDERLINE = _core_.ID_UNDERLINE
266ID_INDENT = _core_.ID_INDENT
267ID_UNINDENT = _core_.ID_UNINDENT
268ID_ZOOM_100 = _core_.ID_ZOOM_100
269ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
270ID_ZOOM_IN = _core_.ID_ZOOM_IN
271ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
272ID_UNDELETE = _core_.ID_UNDELETE
273ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
54f9ee45 274ID_HIGHEST = _core_.ID_HIGHEST
54f9ee45
RD
275MENU_TEAROFF = _core_.MENU_TEAROFF
276MB_DOCKABLE = _core_.MB_DOCKABLE
277NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
278FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
279LI_HORIZONTAL = _core_.LI_HORIZONTAL
280LI_VERTICAL = _core_.LI_VERTICAL
281WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
282WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
283WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
284WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
285WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
286WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
287MM_TEXT = _core_.MM_TEXT
288MM_LOMETRIC = _core_.MM_LOMETRIC
289MM_HIMETRIC = _core_.MM_HIMETRIC
290MM_LOENGLISH = _core_.MM_LOENGLISH
291MM_HIENGLISH = _core_.MM_HIENGLISH
292MM_TWIPS = _core_.MM_TWIPS
293MM_ISOTROPIC = _core_.MM_ISOTROPIC
294MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
295MM_POINTS = _core_.MM_POINTS
296MM_METRIC = _core_.MM_METRIC
297CENTRE = _core_.CENTRE
298CENTER = _core_.CENTER
299HORIZONTAL = _core_.HORIZONTAL
300VERTICAL = _core_.VERTICAL
301BOTH = _core_.BOTH
302LEFT = _core_.LEFT
303RIGHT = _core_.RIGHT
304UP = _core_.UP
305DOWN = _core_.DOWN
306TOP = _core_.TOP
307BOTTOM = _core_.BOTTOM
308NORTH = _core_.NORTH
309SOUTH = _core_.SOUTH
310WEST = _core_.WEST
311EAST = _core_.EAST
312ALL = _core_.ALL
313ALIGN_NOT = _core_.ALIGN_NOT
314ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
315ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
316ALIGN_LEFT = _core_.ALIGN_LEFT
317ALIGN_TOP = _core_.ALIGN_TOP
318ALIGN_RIGHT = _core_.ALIGN_RIGHT
319ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
320ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
321ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
322ALIGN_CENTER = _core_.ALIGN_CENTER
323ALIGN_CENTRE = _core_.ALIGN_CENTRE
324ALIGN_MASK = _core_.ALIGN_MASK
325STRETCH_NOT = _core_.STRETCH_NOT
326SHRINK = _core_.SHRINK
327GROW = _core_.GROW
328EXPAND = _core_.EXPAND
329SHAPED = _core_.SHAPED
330FIXED_MINSIZE = _core_.FIXED_MINSIZE
331TILE = _core_.TILE
cbfc9df6 332ADJUST_MINSIZE = 0
54f9ee45
RD
333BORDER_DEFAULT = _core_.BORDER_DEFAULT
334BORDER_NONE = _core_.BORDER_NONE
335BORDER_STATIC = _core_.BORDER_STATIC
336BORDER_SIMPLE = _core_.BORDER_SIMPLE
337BORDER_RAISED = _core_.BORDER_RAISED
338BORDER_SUNKEN = _core_.BORDER_SUNKEN
339BORDER_DOUBLE = _core_.BORDER_DOUBLE
340BORDER_MASK = _core_.BORDER_MASK
7bc1e663
RD
341BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
342BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
343BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
54f9ee45
RD
344DEFAULT = _core_.DEFAULT
345DECORATIVE = _core_.DECORATIVE
346ROMAN = _core_.ROMAN
347SCRIPT = _core_.SCRIPT
348SWISS = _core_.SWISS
349MODERN = _core_.MODERN
350TELETYPE = _core_.TELETYPE
351VARIABLE = _core_.VARIABLE
352FIXED = _core_.FIXED
353NORMAL = _core_.NORMAL
354LIGHT = _core_.LIGHT
355BOLD = _core_.BOLD
356ITALIC = _core_.ITALIC
357SLANT = _core_.SLANT
358SOLID = _core_.SOLID
359DOT = _core_.DOT
360LONG_DASH = _core_.LONG_DASH
361SHORT_DASH = _core_.SHORT_DASH
362DOT_DASH = _core_.DOT_DASH
363USER_DASH = _core_.USER_DASH
364TRANSPARENT = _core_.TRANSPARENT
365STIPPLE = _core_.STIPPLE
d04418a7
RD
366STIPPLE_MASK = _core_.STIPPLE_MASK
367STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
54f9ee45
RD
368BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
369CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
370FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
371CROSS_HATCH = _core_.CROSS_HATCH
372HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
373VERTICAL_HATCH = _core_.VERTICAL_HATCH
374JOIN_BEVEL = _core_.JOIN_BEVEL
375JOIN_MITER = _core_.JOIN_MITER
376JOIN_ROUND = _core_.JOIN_ROUND
377CAP_ROUND = _core_.CAP_ROUND
378CAP_PROJECTING = _core_.CAP_PROJECTING
379CAP_BUTT = _core_.CAP_BUTT
380CLEAR = _core_.CLEAR
381XOR = _core_.XOR
382INVERT = _core_.INVERT
383OR_REVERSE = _core_.OR_REVERSE
384AND_REVERSE = _core_.AND_REVERSE
385COPY = _core_.COPY
386AND = _core_.AND
387AND_INVERT = _core_.AND_INVERT
388NO_OP = _core_.NO_OP
389NOR = _core_.NOR
390EQUIV = _core_.EQUIV
391SRC_INVERT = _core_.SRC_INVERT
392OR_INVERT = _core_.OR_INVERT
393NAND = _core_.NAND
394OR = _core_.OR
395SET = _core_.SET
396WXK_BACK = _core_.WXK_BACK
397WXK_TAB = _core_.WXK_TAB
398WXK_RETURN = _core_.WXK_RETURN
399WXK_ESCAPE = _core_.WXK_ESCAPE
400WXK_SPACE = _core_.WXK_SPACE
401WXK_DELETE = _core_.WXK_DELETE
402WXK_START = _core_.WXK_START
403WXK_LBUTTON = _core_.WXK_LBUTTON
404WXK_RBUTTON = _core_.WXK_RBUTTON
405WXK_CANCEL = _core_.WXK_CANCEL
406WXK_MBUTTON = _core_.WXK_MBUTTON
407WXK_CLEAR = _core_.WXK_CLEAR
408WXK_SHIFT = _core_.WXK_SHIFT
409WXK_ALT = _core_.WXK_ALT
410WXK_CONTROL = _core_.WXK_CONTROL
411WXK_MENU = _core_.WXK_MENU
412WXK_PAUSE = _core_.WXK_PAUSE
413WXK_CAPITAL = _core_.WXK_CAPITAL
54f9ee45
RD
414WXK_END = _core_.WXK_END
415WXK_HOME = _core_.WXK_HOME
416WXK_LEFT = _core_.WXK_LEFT
417WXK_UP = _core_.WXK_UP
418WXK_RIGHT = _core_.WXK_RIGHT
419WXK_DOWN = _core_.WXK_DOWN
420WXK_SELECT = _core_.WXK_SELECT
421WXK_PRINT = _core_.WXK_PRINT
422WXK_EXECUTE = _core_.WXK_EXECUTE
423WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
424WXK_INSERT = _core_.WXK_INSERT
425WXK_HELP = _core_.WXK_HELP
426WXK_NUMPAD0 = _core_.WXK_NUMPAD0
427WXK_NUMPAD1 = _core_.WXK_NUMPAD1
428WXK_NUMPAD2 = _core_.WXK_NUMPAD2
429WXK_NUMPAD3 = _core_.WXK_NUMPAD3
430WXK_NUMPAD4 = _core_.WXK_NUMPAD4
431WXK_NUMPAD5 = _core_.WXK_NUMPAD5
432WXK_NUMPAD6 = _core_.WXK_NUMPAD6
433WXK_NUMPAD7 = _core_.WXK_NUMPAD7
434WXK_NUMPAD8 = _core_.WXK_NUMPAD8
435WXK_NUMPAD9 = _core_.WXK_NUMPAD9
436WXK_MULTIPLY = _core_.WXK_MULTIPLY
437WXK_ADD = _core_.WXK_ADD
438WXK_SEPARATOR = _core_.WXK_SEPARATOR
439WXK_SUBTRACT = _core_.WXK_SUBTRACT
440WXK_DECIMAL = _core_.WXK_DECIMAL
441WXK_DIVIDE = _core_.WXK_DIVIDE
442WXK_F1 = _core_.WXK_F1
443WXK_F2 = _core_.WXK_F2
444WXK_F3 = _core_.WXK_F3
445WXK_F4 = _core_.WXK_F4
446WXK_F5 = _core_.WXK_F5
447WXK_F6 = _core_.WXK_F6
448WXK_F7 = _core_.WXK_F7
449WXK_F8 = _core_.WXK_F8
450WXK_F9 = _core_.WXK_F9
451WXK_F10 = _core_.WXK_F10
452WXK_F11 = _core_.WXK_F11
453WXK_F12 = _core_.WXK_F12
454WXK_F13 = _core_.WXK_F13
455WXK_F14 = _core_.WXK_F14
456WXK_F15 = _core_.WXK_F15
457WXK_F16 = _core_.WXK_F16
458WXK_F17 = _core_.WXK_F17
459WXK_F18 = _core_.WXK_F18
460WXK_F19 = _core_.WXK_F19
461WXK_F20 = _core_.WXK_F20
462WXK_F21 = _core_.WXK_F21
463WXK_F22 = _core_.WXK_F22
464WXK_F23 = _core_.WXK_F23
465WXK_F24 = _core_.WXK_F24
466WXK_NUMLOCK = _core_.WXK_NUMLOCK
467WXK_SCROLL = _core_.WXK_SCROLL
468WXK_PAGEUP = _core_.WXK_PAGEUP
469WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
470WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
471WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
472WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
473WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
474WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
475WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
476WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
477WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
478WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
479WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
480WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
481WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
54f9ee45 482WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
54f9ee45
RD
483WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
484WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
485WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
486WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
487WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
488WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
489WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
490WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
491WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
492WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
493WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
494WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
495WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
496WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
497WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
498WXK_COMMAND = _core_.WXK_COMMAND
499WXK_SPECIAL1 = _core_.WXK_SPECIAL1
500WXK_SPECIAL2 = _core_.WXK_SPECIAL2
501WXK_SPECIAL3 = _core_.WXK_SPECIAL3
502WXK_SPECIAL4 = _core_.WXK_SPECIAL4
503WXK_SPECIAL5 = _core_.WXK_SPECIAL5
504WXK_SPECIAL6 = _core_.WXK_SPECIAL6
505WXK_SPECIAL7 = _core_.WXK_SPECIAL7
506WXK_SPECIAL8 = _core_.WXK_SPECIAL8
507WXK_SPECIAL9 = _core_.WXK_SPECIAL9
508WXK_SPECIAL10 = _core_.WXK_SPECIAL10
509WXK_SPECIAL11 = _core_.WXK_SPECIAL11
510WXK_SPECIAL12 = _core_.WXK_SPECIAL12
511WXK_SPECIAL13 = _core_.WXK_SPECIAL13
512WXK_SPECIAL14 = _core_.WXK_SPECIAL14
513WXK_SPECIAL15 = _core_.WXK_SPECIAL15
514WXK_SPECIAL16 = _core_.WXK_SPECIAL16
515WXK_SPECIAL17 = _core_.WXK_SPECIAL17
516WXK_SPECIAL18 = _core_.WXK_SPECIAL18
517WXK_SPECIAL19 = _core_.WXK_SPECIAL19
518WXK_SPECIAL20 = _core_.WXK_SPECIAL20
cbfc9df6
RD
519WXK_PRIOR = WXK_PAGEUP
520WXK_NEXT = WXK_PAGEDOWN
521WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP
522WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN
523
54f9ee45
RD
524PAPER_NONE = _core_.PAPER_NONE
525PAPER_LETTER = _core_.PAPER_LETTER
526PAPER_LEGAL = _core_.PAPER_LEGAL
527PAPER_A4 = _core_.PAPER_A4
528PAPER_CSHEET = _core_.PAPER_CSHEET
529PAPER_DSHEET = _core_.PAPER_DSHEET
530PAPER_ESHEET = _core_.PAPER_ESHEET
531PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
532PAPER_TABLOID = _core_.PAPER_TABLOID
533PAPER_LEDGER = _core_.PAPER_LEDGER
534PAPER_STATEMENT = _core_.PAPER_STATEMENT
535PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
536PAPER_A3 = _core_.PAPER_A3
537PAPER_A4SMALL = _core_.PAPER_A4SMALL
538PAPER_A5 = _core_.PAPER_A5
539PAPER_B4 = _core_.PAPER_B4
540PAPER_B5 = _core_.PAPER_B5
541PAPER_FOLIO = _core_.PAPER_FOLIO
542PAPER_QUARTO = _core_.PAPER_QUARTO
543PAPER_10X14 = _core_.PAPER_10X14
544PAPER_11X17 = _core_.PAPER_11X17
545PAPER_NOTE = _core_.PAPER_NOTE
546PAPER_ENV_9 = _core_.PAPER_ENV_9
547PAPER_ENV_10 = _core_.PAPER_ENV_10
548PAPER_ENV_11 = _core_.PAPER_ENV_11
549PAPER_ENV_12 = _core_.PAPER_ENV_12
550PAPER_ENV_14 = _core_.PAPER_ENV_14
551PAPER_ENV_DL = _core_.PAPER_ENV_DL
552PAPER_ENV_C5 = _core_.PAPER_ENV_C5
553PAPER_ENV_C3 = _core_.PAPER_ENV_C3
554PAPER_ENV_C4 = _core_.PAPER_ENV_C4
555PAPER_ENV_C6 = _core_.PAPER_ENV_C6
556PAPER_ENV_C65 = _core_.PAPER_ENV_C65
557PAPER_ENV_B4 = _core_.PAPER_ENV_B4
558PAPER_ENV_B5 = _core_.PAPER_ENV_B5
559PAPER_ENV_B6 = _core_.PAPER_ENV_B6
560PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
561PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
562PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
563PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
564PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
565PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
566PAPER_ISO_B4 = _core_.PAPER_ISO_B4
567PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
568PAPER_9X11 = _core_.PAPER_9X11
569PAPER_10X11 = _core_.PAPER_10X11
570PAPER_15X11 = _core_.PAPER_15X11
571PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
572PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
573PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
574PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
575PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
576PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
577PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
578PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
579PAPER_A_PLUS = _core_.PAPER_A_PLUS
580PAPER_B_PLUS = _core_.PAPER_B_PLUS
581PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
582PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
583PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
584PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
585PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
586PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
587PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
588PAPER_A2 = _core_.PAPER_A2
589PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
590PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
6c75a4cf
RD
591PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
592PAPER_A6 = _core_.PAPER_A6
593PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
594PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
595PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
596PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
597PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
598PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
599PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
600PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
601PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
602PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
603PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
604PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
605PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
606PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
607PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
608PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
609PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
610PAPER_B6_JIS = _core_.PAPER_B6_JIS
611PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
612PAPER_12X11 = _core_.PAPER_12X11
613PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
614PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
615PAPER_P16K = _core_.PAPER_P16K
616PAPER_P32K = _core_.PAPER_P32K
617PAPER_P32KBIG = _core_.PAPER_P32KBIG
618PAPER_PENV_1 = _core_.PAPER_PENV_1
619PAPER_PENV_2 = _core_.PAPER_PENV_2
620PAPER_PENV_3 = _core_.PAPER_PENV_3
621PAPER_PENV_4 = _core_.PAPER_PENV_4
622PAPER_PENV_5 = _core_.PAPER_PENV_5
623PAPER_PENV_6 = _core_.PAPER_PENV_6
624PAPER_PENV_7 = _core_.PAPER_PENV_7
625PAPER_PENV_8 = _core_.PAPER_PENV_8
626PAPER_PENV_9 = _core_.PAPER_PENV_9
627PAPER_PENV_10 = _core_.PAPER_PENV_10
628PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
629PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
630PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
631PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
632PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
633PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
634PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
635PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
636PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
637PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
638PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
639PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
640PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
54f9ee45
RD
641DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
642DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
643DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
644ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
645ITEM_NORMAL = _core_.ITEM_NORMAL
646ITEM_CHECK = _core_.ITEM_CHECK
647ITEM_RADIO = _core_.ITEM_RADIO
648ITEM_MAX = _core_.ITEM_MAX
649HT_NOWHERE = _core_.HT_NOWHERE
650HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
651HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
652HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
653HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
654HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
655HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
656HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
657HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
658HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
659HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
660HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
661HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
662HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
663HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
664HT_MAX = _core_.HT_MAX
665MOD_NONE = _core_.MOD_NONE
666MOD_ALT = _core_.MOD_ALT
667MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 668MOD_ALTGR = _core_.MOD_ALTGR
54f9ee45 669MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 670MOD_META = _core_.MOD_META
54f9ee45 671MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
672MOD_CMD = _core_.MOD_CMD
673MOD_ALL = _core_.MOD_ALL
54f9ee45
RD
674UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
675UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
676UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
994453b8
RD
677Layout_Default = _core_.Layout_Default
678Layout_LeftToRight = _core_.Layout_LeftToRight
679Layout_RightToLeft = _core_.Layout_RightToLeft
d14a1e28
RD
680#---------------------------------------------------------------------------
681
682class Object(object):
0df68c9f
RD
683 """
684 The base class for most wx objects, although in wxPython not
685 much functionality is needed nor exposed.
686 """
0085ce49
RD
687 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
688 def __init__(self): raise AttributeError, "No constructor defined"
689 __repr__ = _swig_repr
e811c8ce 690 def GetClassName(*args, **kwargs):
0df68c9f 691 """
a95a7133 692 GetClassName(self) -> String
e811c8ce 693
a95a7133 694 Returns the class name of the C++ class using wxRTTI.
0df68c9f 695 """
54f9ee45 696 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
697
698 def Destroy(*args, **kwargs):
0df68c9f 699 """
a95a7133 700 Destroy(self)
e811c8ce 701
0df68c9f
RD
702 Deletes the C++ object this Python object is a proxy for.
703 """
b39fe951
RD
704 args[0].this.own(False)
705 return _core_.Object_Destroy(*args, **kwargs)
e811c8ce 706
8f514ab4
RD
707 def IsSameAs(*args, **kwargs):
708 """
709 IsSameAs(self, Object p) -> bool
710
711 For wx.Objects that use C++ reference counting internally, this method
712 can be used to determine if two objects are referencing the same data
713 object.
714 """
715 return _core_.Object_IsSameAs(*args, **kwargs)
716
33d6fd3b 717 ClassName = property(GetClassName,doc="See `GetClassName`")
2131d850 718_core_.Object_swigregister(Object)
54f9ee45 719_wxPySetDictionary = _core_._wxPySetDictionary
54f9ee45 720cvar = _core_.cvar
196addbf 721EmptyString = cvar.EmptyString
d14a1e28
RD
722
723#---------------------------------------------------------------------------
724
54f9ee45
RD
725BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
726BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
727BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
728BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
729BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
730BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
731BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
732BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
733BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
734BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
735BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
736BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
737BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
738BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
739BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
740BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
741BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
742BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
8f514ab4 743BITMAP_TYPE_TGA = _core_.BITMAP_TYPE_TGA
54f9ee45
RD
744BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
745BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
746CURSOR_NONE = _core_.CURSOR_NONE
747CURSOR_ARROW = _core_.CURSOR_ARROW
748CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
749CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
750CURSOR_CHAR = _core_.CURSOR_CHAR
751CURSOR_CROSS = _core_.CURSOR_CROSS
752CURSOR_HAND = _core_.CURSOR_HAND
753CURSOR_IBEAM = _core_.CURSOR_IBEAM
754CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
755CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
756CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
757CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
758CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
759CURSOR_PENCIL = _core_.CURSOR_PENCIL
760CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
761CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
762CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
763CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
764CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
765CURSOR_SIZENS = _core_.CURSOR_SIZENS
766CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
767CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
768CURSOR_SIZING = _core_.CURSOR_SIZING
769CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
770CURSOR_WAIT = _core_.CURSOR_WAIT
771CURSOR_WATCH = _core_.CURSOR_WATCH
772CURSOR_BLANK = _core_.CURSOR_BLANK
773CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
774CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
775CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
776CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
777#---------------------------------------------------------------------------
778
779class Size(object):
0df68c9f 780 """
41e2b43e 781 wx.Size is a useful data structure used to represent the size of
0085ce49
RD
782 something. It simply contains integer width and height
783 properties. In most places in wxPython where a wx.Size is
093d3ff1 784 expected a (width, height) tuple can be used instead.
0df68c9f 785 """
0085ce49
RD
786 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
787 __repr__ = _swig_repr
54f9ee45
RD
788 width = property(_core_.Size_width_get, _core_.Size_width_set)
789 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 790 x = width; y = height
0085ce49 791 def __init__(self, *args, **kwargs):
0df68c9f 792 """
a95a7133 793 __init__(self, int w=0, int h=0) -> Size
e811c8ce 794
0df68c9f
RD
795 Creates a size object.
796 """
0085ce49
RD
797 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
798 __swig_destroy__ = _core_.delete_Size
799 __del__ = lambda self : None;
e811c8ce 800 def __eq__(*args, **kwargs):
0df68c9f 801 """
e9d6f3a4 802 __eq__(self, PyObject other) -> bool
e811c8ce 803
0df68c9f
RD
804 Test for equality of wx.Size objects.
805 """
54f9ee45 806 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
807
808 def __ne__(*args, **kwargs):
0df68c9f 809 """
e9d6f3a4 810 __ne__(self, PyObject other) -> bool
e811c8ce 811
e9d6f3a4 812 Test for inequality of wx.Size objects.
0df68c9f 813 """
54f9ee45 814 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
815
816 def __add__(*args, **kwargs):
0df68c9f 817 """
a95a7133 818 __add__(self, Size sz) -> Size
e811c8ce 819
0df68c9f
RD
820 Add sz's proprties to this and return the result.
821 """
54f9ee45 822 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
823
824 def __sub__(*args, **kwargs):
0df68c9f 825 """
a95a7133 826 __sub__(self, Size sz) -> Size
e811c8ce 827
0df68c9f
RD
828 Subtract sz's properties from this and return the result.
829 """
54f9ee45 830 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
831
832 def IncTo(*args, **kwargs):
0df68c9f 833 """
a95a7133 834 IncTo(self, Size sz)
e811c8ce 835
0df68c9f
RD
836 Increments this object so that both of its dimensions are not less
837 than the corresponding dimensions of the size.
838 """
54f9ee45 839 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
840
841 def DecTo(*args, **kwargs):
0df68c9f 842 """
a95a7133 843 DecTo(self, Size sz)
e811c8ce 844
0df68c9f
RD
845 Decrements this object so that both of its dimensions are not greater
846 than the corresponding dimensions of the size.
847 """
54f9ee45 848 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce 849
f5263701
RD
850 def IncBy(*args, **kwargs):
851 """IncBy(self, int dx, int dy)"""
852 return _core_.Size_IncBy(*args, **kwargs)
853
854 def DecBy(*args, **kwargs):
855 """DecBy(self, int dx, int dy)"""
856 return _core_.Size_DecBy(*args, **kwargs)
857
10044bf1
RD
858 def Scale(*args, **kwargs):
859 """
860 Scale(self, float xscale, float yscale)
861
862 Scales the dimensions of this object by the given factors.
863 """
864 return _core_.Size_Scale(*args, **kwargs)
865
e811c8ce 866 def Set(*args, **kwargs):
0df68c9f 867 """
a95a7133 868 Set(self, int w, int h)
e811c8ce 869
0df68c9f
RD
870 Set both width and height.
871 """
54f9ee45 872 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
873
874 def SetWidth(*args, **kwargs):
a95a7133 875 """SetWidth(self, int w)"""
54f9ee45 876 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
877
878 def SetHeight(*args, **kwargs):
a95a7133 879 """SetHeight(self, int h)"""
54f9ee45 880 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
881
882 def GetWidth(*args, **kwargs):
a95a7133 883 """GetWidth(self) -> int"""
54f9ee45 884 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
885
886 def GetHeight(*args, **kwargs):
a95a7133 887 """GetHeight(self) -> int"""
54f9ee45 888 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 889
74a57fcd
RD
890 def IsFullySpecified(*args, **kwargs):
891 """
a95a7133 892 IsFullySpecified(self) -> bool
74a57fcd
RD
893
894 Returns True if both components of the size are non-default values.
895 """
54f9ee45 896 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
897
898 def SetDefaults(*args, **kwargs):
899 """
a95a7133 900 SetDefaults(self, Size size)
74a57fcd 901
41e2b43e
RD
902 Combine this size with the other one replacing the default components
903 of this object (i.e. equal to -1) with those of the other.
74a57fcd 904 """
54f9ee45 905 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 906
e811c8ce 907 def Get(*args, **kwargs):
0df68c9f
RD
908 """
909 Get() -> (width,height)
e811c8ce 910
0df68c9f
RD
911 Returns the width and height properties as a tuple.
912 """
54f9ee45 913 return _core_.Size_Get(*args, **kwargs)
e811c8ce 914
41e2b43e 915 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
916 def __str__(self): return str(self.Get())
917 def __repr__(self): return 'wx.Size'+str(self.Get())
918 def __len__(self): return len(self.Get())
919 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
920 def __setitem__(self, index, val):
921 if index == 0: self.width = val
922 elif index == 1: self.height = val
923 else: raise IndexError
e811c8ce 924 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
925 __safe_for_unpickling__ = True
926 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28 927
2131d850 928_core_.Size_swigregister(Size)
d14a1e28
RD
929
930#---------------------------------------------------------------------------
931
932class RealPoint(object):
0df68c9f 933 """
41e2b43e
RD
934 A data structure for representing a point or position with floating
935 point x and y properties. In wxPython most places that expect a
936 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 937 """
0085ce49
RD
938 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
939 __repr__ = _swig_repr
54f9ee45
RD
940 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
941 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
0085ce49 942 def __init__(self, *args, **kwargs):
0df68c9f 943 """
a95a7133 944 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 945
0df68c9f
RD
946 Create a wx.RealPoint object
947 """
0085ce49
RD
948 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
949 __swig_destroy__ = _core_.delete_RealPoint
950 __del__ = lambda self : None;
e811c8ce 951 def __eq__(*args, **kwargs):
0df68c9f 952 """
e9d6f3a4 953 __eq__(self, PyObject other) -> bool
e811c8ce 954
0df68c9f
RD
955 Test for equality of wx.RealPoint objects.
956 """
54f9ee45 957 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
958
959 def __ne__(*args, **kwargs):
0df68c9f 960 """
e9d6f3a4 961 __ne__(self, PyObject other) -> bool
e811c8ce 962
0df68c9f
RD
963 Test for inequality of wx.RealPoint objects.
964 """
54f9ee45 965 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
966
967 def __add__(*args, **kwargs):
0df68c9f 968 """
a95a7133 969 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 970
0df68c9f
RD
971 Add pt's proprties to this and return the result.
972 """
54f9ee45 973 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
974
975 def __sub__(*args, **kwargs):
0df68c9f 976 """
a95a7133 977 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 978
0df68c9f
RD
979 Subtract pt's proprties from this and return the result
980 """
54f9ee45 981 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
982
983 def Set(*args, **kwargs):
0df68c9f 984 """
a95a7133 985 Set(self, double x, double y)
e811c8ce 986
0df68c9f
RD
987 Set both the x and y properties
988 """
54f9ee45 989 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
990
991 def Get(*args, **kwargs):
0df68c9f
RD
992 """
993 Get() -> (x,y)
e811c8ce 994
0df68c9f
RD
995 Return the x and y properties as a tuple.
996 """
54f9ee45 997 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 998
41e2b43e 999 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1000 def __str__(self): return str(self.Get())
1001 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1002 def __len__(self): return len(self.Get())
1003 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1004 def __setitem__(self, index, val):
e811c8ce
RD
1005 if index == 0: self.x = val
1006 elif index == 1: self.y = val
d14a1e28 1007 else: raise IndexError
e811c8ce 1008 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1009 __safe_for_unpickling__ = True
1010 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28 1011
2131d850 1012_core_.RealPoint_swigregister(RealPoint)
d14a1e28
RD
1013
1014#---------------------------------------------------------------------------
1015
1016class Point(object):
0df68c9f 1017 """
41e2b43e
RD
1018 A data structure for representing a point or position with integer x
1019 and y properties. Most places in wxPython that expect a wx.Point can
1020 also accept a (x,y) tuple.
0df68c9f 1021 """
0085ce49
RD
1022 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1023 __repr__ = _swig_repr
54f9ee45
RD
1024 x = property(_core_.Point_x_get, _core_.Point_x_set)
1025 y = property(_core_.Point_y_get, _core_.Point_y_set)
0085ce49 1026 def __init__(self, *args, **kwargs):
0df68c9f 1027 """
a95a7133 1028 __init__(self, int x=0, int y=0) -> Point
e811c8ce 1029
0df68c9f
RD
1030 Create a wx.Point object
1031 """
0085ce49
RD
1032 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1033 __swig_destroy__ = _core_.delete_Point
1034 __del__ = lambda self : None;
e811c8ce 1035 def __eq__(*args, **kwargs):
0df68c9f 1036 """
e9d6f3a4 1037 __eq__(self, PyObject other) -> bool
e811c8ce 1038
0df68c9f
RD
1039 Test for equality of wx.Point objects.
1040 """
54f9ee45 1041 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
1042
1043 def __ne__(*args, **kwargs):
0df68c9f 1044 """
e9d6f3a4 1045 __ne__(self, PyObject other) -> bool
e811c8ce 1046
0df68c9f
RD
1047 Test for inequality of wx.Point objects.
1048 """
54f9ee45 1049 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
1050
1051 def __add__(*args, **kwargs):
0df68c9f 1052 """
a95a7133 1053 __add__(self, Point pt) -> Point
e811c8ce 1054
0df68c9f
RD
1055 Add pt's proprties to this and return the result.
1056 """
54f9ee45 1057 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
1058
1059 def __sub__(*args, **kwargs):
0df68c9f 1060 """
a95a7133 1061 __sub__(self, Point pt) -> Point
e811c8ce 1062
0df68c9f
RD
1063 Subtract pt's proprties from this and return the result
1064 """
54f9ee45 1065 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
1066
1067 def __iadd__(*args, **kwargs):
0df68c9f 1068 """
a95a7133 1069 __iadd__(self, Point pt) -> Point
e811c8ce 1070
0df68c9f
RD
1071 Add pt to this object.
1072 """
54f9ee45 1073 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
1074
1075 def __isub__(*args, **kwargs):
0df68c9f 1076 """
a95a7133 1077 __isub__(self, Point pt) -> Point
e811c8ce 1078
0df68c9f
RD
1079 Subtract pt from this object.
1080 """
54f9ee45 1081 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
1082
1083 def Set(*args, **kwargs):
0df68c9f 1084 """
a95a7133 1085 Set(self, long x, long y)
e811c8ce 1086
0df68c9f
RD
1087 Set both the x and y properties
1088 """
54f9ee45 1089 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
1090
1091 def Get(*args, **kwargs):
0df68c9f
RD
1092 """
1093 Get() -> (x,y)
e811c8ce 1094
0df68c9f
RD
1095 Return the x and y properties as a tuple.
1096 """
54f9ee45 1097 return _core_.Point_Get(*args, **kwargs)
e811c8ce 1098
41e2b43e 1099 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1100 def __str__(self): return str(self.Get())
1101 def __repr__(self): return 'wx.Point'+str(self.Get())
1102 def __len__(self): return len(self.Get())
1103 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1104 def __setitem__(self, index, val):
1105 if index == 0: self.x = val
1106 elif index == 1: self.y = val
1107 else: raise IndexError
e811c8ce 1108 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
1109 __safe_for_unpickling__ = True
1110 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28 1111
2131d850 1112_core_.Point_swigregister(Point)
d14a1e28
RD
1113
1114#---------------------------------------------------------------------------
1115
1116class Rect(object):
0df68c9f 1117 """
41e2b43e
RD
1118 A class for representing and manipulating rectangles. It has x, y,
1119 width and height properties. In wxPython most palces that expect a
1120 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1121 """
0085ce49
RD
1122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1123 __repr__ = _swig_repr
1124 def __init__(self, *args, **kwargs):
0df68c9f 1125 """
a95a7133 1126 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1127
0df68c9f
RD
1128 Create a new Rect object.
1129 """
0085ce49
RD
1130 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1131 __swig_destroy__ = _core_.delete_Rect
1132 __del__ = lambda self : None;
e811c8ce 1133 def GetX(*args, **kwargs):
a95a7133 1134 """GetX(self) -> int"""
54f9ee45 1135 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1136
1137 def SetX(*args, **kwargs):
a95a7133 1138 """SetX(self, int x)"""
54f9ee45 1139 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1140
1141 def GetY(*args, **kwargs):
a95a7133 1142 """GetY(self) -> int"""
54f9ee45 1143 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1144
1145 def SetY(*args, **kwargs):
a95a7133 1146 """SetY(self, int y)"""
54f9ee45 1147 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1148
1149 def GetWidth(*args, **kwargs):
a95a7133 1150 """GetWidth(self) -> int"""
54f9ee45 1151 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1152
1153 def SetWidth(*args, **kwargs):
a95a7133 1154 """SetWidth(self, int w)"""
54f9ee45 1155 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1156
1157 def GetHeight(*args, **kwargs):
a95a7133 1158 """GetHeight(self) -> int"""
54f9ee45 1159 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1160
1161 def SetHeight(*args, **kwargs):
a95a7133 1162 """SetHeight(self, int h)"""
54f9ee45 1163 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1164
1165 def GetPosition(*args, **kwargs):
a95a7133 1166 """GetPosition(self) -> Point"""
54f9ee45 1167 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1168
1169 def SetPosition(*args, **kwargs):
a95a7133 1170 """SetPosition(self, Point p)"""
54f9ee45 1171 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1172
1173 def GetSize(*args, **kwargs):
a95a7133 1174 """GetSize(self) -> Size"""
54f9ee45 1175 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1176
1177 def SetSize(*args, **kwargs):
a95a7133 1178 """SetSize(self, Size s)"""
54f9ee45 1179 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1180
aff4cc5c
RD
1181 def IsEmpty(*args, **kwargs):
1182 """IsEmpty(self) -> bool"""
1183 return _core_.Rect_IsEmpty(*args, **kwargs)
1184
c9c7117a 1185 def GetTopLeft(*args, **kwargs):
a95a7133 1186 """GetTopLeft(self) -> Point"""
54f9ee45 1187 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1188
1189 def SetTopLeft(*args, **kwargs):
a95a7133 1190 """SetTopLeft(self, Point p)"""
54f9ee45 1191 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1192
1193 def GetBottomRight(*args, **kwargs):
a95a7133 1194 """GetBottomRight(self) -> Point"""
54f9ee45 1195 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1196
1197 def SetBottomRight(*args, **kwargs):
a95a7133 1198 """SetBottomRight(self, Point p)"""
54f9ee45 1199 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1200
5acb46e0
RD
1201 def GetTopRight(*args, **kwargs):
1202 """GetTopRight(self) -> Point"""
1203 return _core_.Rect_GetTopRight(*args, **kwargs)
1204
1205 def SetTopRight(*args, **kwargs):
1206 """SetTopRight(self, Point p)"""
1207 return _core_.Rect_SetTopRight(*args, **kwargs)
1208
1209 def GetBottomLeft(*args, **kwargs):
1210 """GetBottomLeft(self) -> Point"""
1211 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1212
1213 def SetBottomLeft(*args, **kwargs):
1214 """SetBottomLeft(self, Point p)"""
1215 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1216
e811c8ce 1217 def GetLeft(*args, **kwargs):
a95a7133 1218 """GetLeft(self) -> int"""
54f9ee45 1219 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1220
1221 def GetTop(*args, **kwargs):
a95a7133 1222 """GetTop(self) -> int"""
54f9ee45 1223 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1224
1225 def GetBottom(*args, **kwargs):
a95a7133 1226 """GetBottom(self) -> int"""
54f9ee45 1227 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1228
1229 def GetRight(*args, **kwargs):
a95a7133 1230 """GetRight(self) -> int"""
54f9ee45 1231 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1232
1233 def SetLeft(*args, **kwargs):
a95a7133 1234 """SetLeft(self, int left)"""
54f9ee45 1235 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1236
1237 def SetRight(*args, **kwargs):
a95a7133 1238 """SetRight(self, int right)"""
54f9ee45 1239 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1240
1241 def SetTop(*args, **kwargs):
a95a7133 1242 """SetTop(self, int top)"""
54f9ee45 1243 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1244
1245 def SetBottom(*args, **kwargs):
a95a7133 1246 """SetBottom(self, int bottom)"""
54f9ee45 1247 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1248
1249 position = property(GetPosition, SetPosition)
1250 size = property(GetSize, SetSize)
1251 left = property(GetLeft, SetLeft)
1252 right = property(GetRight, SetRight)
1253 top = property(GetTop, SetTop)
1254 bottom = property(GetBottom, SetBottom)
1255
1256 def Inflate(*args, **kwargs):
0df68c9f 1257 """
a95a7133 1258 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1259
8e738329
RD
1260 Increases the size of the rectangle.
1261
1262 The left border is moved farther left and the right border is moved
1263 farther right by ``dx``. The upper border is moved farther up and the
1264 bottom border is moved farther down by ``dy``. (Note the the width and
1265 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1266 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1267 opposite happens: the rectangle size decreases in the respective
1268 direction.
1269
1270 The change is made to the rectangle inplace, if instead you need a
1271 copy that is inflated, preserving the original then make the copy
1272 first::
1273
1274 copy = wx.Rect(*original)
1275 copy.Inflate(10,15)
1276
1277
0df68c9f 1278 """
54f9ee45 1279 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1280
1281 def Deflate(*args, **kwargs):
0df68c9f 1282 """
a95a7133 1283 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1284
8e738329
RD
1285 Decrease the rectangle size. This method is the opposite of `Inflate`
1286 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1287 `Inflate` for a full description.
0df68c9f 1288 """
54f9ee45 1289 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1290
1291 def OffsetXY(*args, **kwargs):
0df68c9f 1292 """
a95a7133 1293 OffsetXY(self, int dx, int dy)
e811c8ce 1294
41e2b43e
RD
1295 Moves the rectangle by the specified offset. If dx is positive, the
1296 rectangle is moved to the right, if dy is positive, it is moved to the
1297 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1298 """
54f9ee45 1299 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1300
1301 def Offset(*args, **kwargs):
0df68c9f 1302 """
a95a7133 1303 Offset(self, Point pt)
e811c8ce 1304
b1fcee84 1305 Same as `OffsetXY` but uses dx,dy from Point
0df68c9f 1306 """
54f9ee45 1307 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1308
1309 def Intersect(*args, **kwargs):
0df68c9f 1310 """
a95a7133 1311 Intersect(self, Rect rect) -> Rect
e811c8ce 1312
5cbf236d 1313 Returns the intersectsion of this rectangle and rect.
0df68c9f 1314 """
54f9ee45 1315 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce 1316
5cbf236d
RD
1317 def Union(*args, **kwargs):
1318 """
1319 Union(self, Rect rect) -> Rect
1320
1321 Returns the union of this rectangle and rect.
1322 """
1323 return _core_.Rect_Union(*args, **kwargs)
1324
e811c8ce 1325 def __add__(*args, **kwargs):
0df68c9f 1326 """
a95a7133 1327 __add__(self, Rect rect) -> Rect
e811c8ce 1328
0df68c9f
RD
1329 Add the properties of rect to this rectangle and return the result.
1330 """
54f9ee45 1331 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1332
1333 def __iadd__(*args, **kwargs):
0df68c9f 1334 """
a95a7133 1335 __iadd__(self, Rect rect) -> Rect
e811c8ce 1336
0df68c9f
RD
1337 Add the properties of rect to this rectangle, updating this rectangle.
1338 """
54f9ee45 1339 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1340
1341 def __eq__(*args, **kwargs):
0df68c9f 1342 """
e9d6f3a4 1343 __eq__(self, PyObject other) -> bool
e811c8ce 1344
e9d6f3a4 1345 Test for equality of wx.Rect objects.
0df68c9f 1346 """
54f9ee45 1347 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1348
1349 def __ne__(*args, **kwargs):
0df68c9f 1350 """
e9d6f3a4 1351 __ne__(self, PyObject other) -> bool
e811c8ce 1352
e9d6f3a4 1353 Test for inequality of wx.Rect objects.
0df68c9f 1354 """
54f9ee45 1355 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce 1356
33d6fd3b 1357 def ContainsXY(*args, **kwargs):
0df68c9f 1358 """
33d6fd3b 1359 ContainsXY(self, int x, int y) -> bool
e811c8ce 1360
33d6fd3b 1361 Return True if the point is inside the rect.
0df68c9f 1362 """
33d6fd3b 1363 return _core_.Rect_ContainsXY(*args, **kwargs)
e811c8ce 1364
33d6fd3b 1365 def Contains(*args, **kwargs):
0df68c9f 1366 """
33d6fd3b 1367 Contains(self, Point pt) -> bool
e811c8ce 1368
33d6fd3b 1369 Return True if the point is inside the rect.
0df68c9f 1370 """
33d6fd3b 1371 return _core_.Rect_Contains(*args, **kwargs)
e811c8ce 1372
33d6fd3b 1373 def ContainsRect(*args, **kwargs):
fc46b7f3 1374 """
33d6fd3b 1375 ContainsRect(self, Rect rect) -> bool
fc46b7f3
RD
1376
1377 Returns ``True`` if the given rectangle is completely inside this
1378 rectangle or touches its boundary.
1379 """
33d6fd3b
RD
1380 return _core_.Rect_ContainsRect(*args, **kwargs)
1381
72ef6efb
RD
1382 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1383 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1384 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1385 Inside = Contains
1386 InsideXY = ContainsXY
1387 InsideRect = ContainsRect
fc46b7f3 1388
e811c8ce 1389 def Intersects(*args, **kwargs):
0df68c9f 1390 """
a95a7133 1391 Intersects(self, Rect rect) -> bool
e811c8ce 1392
0df68c9f
RD
1393 Returns True if the rectangles have a non empty intersection.
1394 """
54f9ee45 1395 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1396
b1fcee84
RD
1397 def CenterIn(*args, **kwargs):
1398 """
1399 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1400
1401 Center this rectangle within the one passed to the method, which is
1402 usually, but not necessarily, the larger one.
1403 """
1404 return _core_.Rect_CenterIn(*args, **kwargs)
1405
1406 CentreIn = CenterIn
54f9ee45
RD
1407 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1408 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1409 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1410 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1411 def Set(*args, **kwargs):
0df68c9f 1412 """
a95a7133 1413 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1414
0df68c9f
RD
1415 Set all rectangle properties.
1416 """
54f9ee45 1417 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1418
1419 def Get(*args, **kwargs):
0df68c9f
RD
1420 """
1421 Get() -> (x,y,width,height)
e811c8ce 1422
0df68c9f
RD
1423 Return the rectangle properties as a tuple.
1424 """
54f9ee45 1425 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1426
41e2b43e 1427 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1428 def __str__(self): return str(self.Get())
1429 def __repr__(self): return 'wx.Rect'+str(self.Get())
1430 def __len__(self): return len(self.Get())
1431 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1432 def __setitem__(self, index, val):
1433 if index == 0: self.x = val
1434 elif index == 1: self.y = val
1435 elif index == 2: self.width = val
1436 elif index == 3: self.height = val
1437 else: raise IndexError
e811c8ce 1438 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1439 __safe_for_unpickling__ = True
1440 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28 1441
33d6fd3b
RD
1442 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1443 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
5acb46e0 1444 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
33d6fd3b
RD
1445 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1446 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1447 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1448 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1449 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1450 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1451 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
5acb46e0 1452 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
33d6fd3b
RD
1453 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1454 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1455 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1456 Empty = property(IsEmpty,doc="See `IsEmpty`")
2131d850 1457_core_.Rect_swigregister(Rect)
d14a1e28
RD
1458
1459def RectPP(*args, **kwargs):
0df68c9f
RD
1460 """
1461 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1462
0df68c9f
RD
1463 Create a new Rect object from Points representing two corners.
1464 """
54f9ee45 1465 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1466 return val
1467
1468def RectPS(*args, **kwargs):
0df68c9f
RD
1469 """
1470 RectPS(Point pos, Size size) -> Rect
e811c8ce 1471
0df68c9f
RD
1472 Create a new Rect from a position and size.
1473 """
54f9ee45 1474 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1475 return val
1476
d3b6e4ff
RD
1477def RectS(*args, **kwargs):
1478 """
1479 RectS(Size size) -> Rect
1480
1481 Create a new Rect from a size only.
1482 """
1483 val = _core_.new_RectS(*args, **kwargs)
d3b6e4ff
RD
1484 return val
1485
d14a1e28 1486
e811c8ce 1487def IntersectRect(*args, **kwargs):
0085ce49 1488 """
0df68c9f 1489 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1490
0df68c9f
RD
1491 Calculate and return the intersection of r1 and r2.
1492 """
0085ce49 1493 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1494#---------------------------------------------------------------------------
1495
1496class Point2D(object):
41e2b43e
RD
1497 """
1498 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1499 with floating point values.
1500 """
0085ce49
RD
1501 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1502 __repr__ = _swig_repr
1503 def __init__(self, *args, **kwargs):
0df68c9f 1504 """
a95a7133 1505 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1506
0df68c9f
RD
1507 Create a w.Point2D object.
1508 """
0085ce49 1509 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
b39fe951
RD
1510 __swig_destroy__ = _core_.delete_Point2D
1511 __del__ = lambda self : None;
e811c8ce 1512 def GetFloor(*args, **kwargs):
fd2dc343
RD
1513 """
1514 GetFloor() -> (x,y)
1515
1516 Convert to integer
1517 """
54f9ee45 1518 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1519
1520 def GetRounded(*args, **kwargs):
fd2dc343
RD
1521 """
1522 GetRounded() -> (x,y)
1523
1524 Convert to integer
1525 """
54f9ee45 1526 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1527
1528 def GetVectorLength(*args, **kwargs):
a95a7133 1529 """GetVectorLength(self) -> double"""
54f9ee45 1530 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1531
1532 def GetVectorAngle(*args, **kwargs):
a95a7133 1533 """GetVectorAngle(self) -> double"""
54f9ee45 1534 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1535
1536 def SetVectorLength(*args, **kwargs):
a95a7133 1537 """SetVectorLength(self, double length)"""
54f9ee45 1538 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1539
1540 def SetVectorAngle(*args, **kwargs):
a95a7133 1541 """SetVectorAngle(self, double degrees)"""
54f9ee45 1542 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1543
d14a1e28
RD
1544 def SetPolarCoordinates(self, angle, length):
1545 self.SetVectorLength(length)
1546 self.SetVectorAngle(angle)
1547 def Normalize(self):
1548 self.SetVectorLength(1.0)
1549
e811c8ce 1550 def GetDistance(*args, **kwargs):
a95a7133 1551 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1552 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1553
1554 def GetDistanceSquare(*args, **kwargs):
a95a7133 1555 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1556 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1557
1558 def GetDotProduct(*args, **kwargs):
a95a7133 1559 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1560 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1561
1562 def GetCrossProduct(*args, **kwargs):
a95a7133 1563 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1564 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1565
1566 def __neg__(*args, **kwargs):
0df68c9f 1567 """
a95a7133 1568 __neg__(self) -> Point2D
e811c8ce 1569
0df68c9f
RD
1570 the reflection of this point
1571 """
54f9ee45 1572 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1573
1574 def __iadd__(*args, **kwargs):
a95a7133 1575 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1576 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1577
1578 def __isub__(*args, **kwargs):
a95a7133 1579 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1580 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1581
1582 def __imul__(*args, **kwargs):
a95a7133 1583 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1584 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1585
1586 def __idiv__(*args, **kwargs):
a95a7133 1587 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1588 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1589
1590 def __eq__(*args, **kwargs):
0df68c9f 1591 """
e9d6f3a4 1592 __eq__(self, PyObject other) -> bool
e811c8ce 1593
e9d6f3a4 1594 Test for equality of wx.Point2D objects.
0df68c9f 1595 """
54f9ee45 1596 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1597
1598 def __ne__(*args, **kwargs):
0df68c9f 1599 """
e9d6f3a4 1600 __ne__(self, PyObject other) -> bool
e811c8ce 1601
e9d6f3a4 1602 Test for inequality of wx.Point2D objects.
0df68c9f 1603 """
54f9ee45 1604 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1605
54f9ee45
RD
1606 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1607 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1608 def Set(*args, **kwargs):
a95a7133 1609 """Set(self, double x=0, double y=0)"""
54f9ee45 1610 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1611
1612 def Get(*args, **kwargs):
0df68c9f
RD
1613 """
1614 Get() -> (x,y)
e811c8ce 1615
0df68c9f
RD
1616 Return x and y properties as a tuple.
1617 """
54f9ee45 1618 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1619
41e2b43e 1620 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1621 def __str__(self): return str(self.Get())
1622 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1623 def __len__(self): return len(self.Get())
1624 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1625 def __setitem__(self, index, val):
e811c8ce
RD
1626 if index == 0: self.x = val
1627 elif index == 1: self.y = val
d14a1e28 1628 else: raise IndexError
e811c8ce 1629 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1630 __safe_for_unpickling__ = True
1631 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28 1632
33d6fd3b
RD
1633 Floor = property(GetFloor,doc="See `GetFloor`")
1634 Rounded = property(GetRounded,doc="See `GetRounded`")
1635 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1636 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
2131d850 1637_core_.Point2D_swigregister(Point2D)
d14a1e28
RD
1638
1639def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1640 """
1641 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1642
0df68c9f
RD
1643 Create a w.Point2D object.
1644 """
54f9ee45 1645 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1646 return val
1647
1648def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1649 """
1650 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1651
0df68c9f
RD
1652 Create a w.Point2D object.
1653 """
54f9ee45 1654 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1655 return val
1656
1657#---------------------------------------------------------------------------
1658
70d7cb34
RD
1659Inside = _core_.Inside
1660OutLeft = _core_.OutLeft
1661OutRight = _core_.OutRight
1662OutTop = _core_.OutTop
1663OutBottom = _core_.OutBottom
1664class Rect2D(object):
1665 """
1666 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1667 with floating point component values.
1668 """
1669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1670 __repr__ = _swig_repr
1671 def __init__(self, *args, **kwargs):
1672 """
1673 __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D
1674
1675 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1676 with floating point component values.
1677 """
1678 _core_.Rect2D_swiginit(self,_core_.new_Rect2D(*args, **kwargs))
1679 __swig_destroy__ = _core_.delete_Rect2D
1680 __del__ = lambda self : None;
1681 def GetPosition(*args, **kwargs):
1682 """GetPosition(self) -> Point2D"""
1683 return _core_.Rect2D_GetPosition(*args, **kwargs)
1684
1685 def GetSize(*args, **kwargs):
1686 """GetSize(self) -> Size"""
1687 return _core_.Rect2D_GetSize(*args, **kwargs)
1688
1689 def GetLeft(*args, **kwargs):
1690 """GetLeft(self) -> wxDouble"""
1691 return _core_.Rect2D_GetLeft(*args, **kwargs)
1692
1693 def SetLeft(*args, **kwargs):
1694 """SetLeft(self, wxDouble n)"""
1695 return _core_.Rect2D_SetLeft(*args, **kwargs)
1696
1697 def MoveLeftTo(*args, **kwargs):
1698 """MoveLeftTo(self, wxDouble n)"""
1699 return _core_.Rect2D_MoveLeftTo(*args, **kwargs)
1700
1701 def GetTop(*args, **kwargs):
1702 """GetTop(self) -> wxDouble"""
1703 return _core_.Rect2D_GetTop(*args, **kwargs)
1704
1705 def SetTop(*args, **kwargs):
1706 """SetTop(self, wxDouble n)"""
1707 return _core_.Rect2D_SetTop(*args, **kwargs)
1708
1709 def MoveTopTo(*args, **kwargs):
1710 """MoveTopTo(self, wxDouble n)"""
1711 return _core_.Rect2D_MoveTopTo(*args, **kwargs)
1712
1713 def GetBottom(*args, **kwargs):
1714 """GetBottom(self) -> wxDouble"""
1715 return _core_.Rect2D_GetBottom(*args, **kwargs)
1716
1717 def SetBottom(*args, **kwargs):
1718 """SetBottom(self, wxDouble n)"""
1719 return _core_.Rect2D_SetBottom(*args, **kwargs)
1720
1721 def MoveBottomTo(*args, **kwargs):
1722 """MoveBottomTo(self, wxDouble n)"""
1723 return _core_.Rect2D_MoveBottomTo(*args, **kwargs)
1724
1725 def GetRight(*args, **kwargs):
1726 """GetRight(self) -> wxDouble"""
1727 return _core_.Rect2D_GetRight(*args, **kwargs)
1728
1729 def SetRight(*args, **kwargs):
1730 """SetRight(self, wxDouble n)"""
1731 return _core_.Rect2D_SetRight(*args, **kwargs)
1732
1733 def MoveRightTo(*args, **kwargs):
1734 """MoveRightTo(self, wxDouble n)"""
1735 return _core_.Rect2D_MoveRightTo(*args, **kwargs)
1736
1737 def GetLeftTop(*args, **kwargs):
1738 """GetLeftTop(self) -> Point2D"""
1739 return _core_.Rect2D_GetLeftTop(*args, **kwargs)
1740
1741 def SetLeftTop(*args, **kwargs):
1742 """SetLeftTop(self, Point2D pt)"""
1743 return _core_.Rect2D_SetLeftTop(*args, **kwargs)
1744
1745 def MoveLeftTopTo(*args, **kwargs):
1746 """MoveLeftTopTo(self, Point2D pt)"""
1747 return _core_.Rect2D_MoveLeftTopTo(*args, **kwargs)
1748
1749 def GetLeftBottom(*args, **kwargs):
1750 """GetLeftBottom(self) -> Point2D"""
1751 return _core_.Rect2D_GetLeftBottom(*args, **kwargs)
1752
1753 def SetLeftBottom(*args, **kwargs):
1754 """SetLeftBottom(self, Point2D pt)"""
1755 return _core_.Rect2D_SetLeftBottom(*args, **kwargs)
1756
1757 def MoveLeftBottomTo(*args, **kwargs):
1758 """MoveLeftBottomTo(self, Point2D pt)"""
1759 return _core_.Rect2D_MoveLeftBottomTo(*args, **kwargs)
1760
1761 def GetRightTop(*args, **kwargs):
1762 """GetRightTop(self) -> Point2D"""
1763 return _core_.Rect2D_GetRightTop(*args, **kwargs)
1764
1765 def SetRightTop(*args, **kwargs):
1766 """SetRightTop(self, Point2D pt)"""
1767 return _core_.Rect2D_SetRightTop(*args, **kwargs)
1768
1769 def MoveRightTopTo(*args, **kwargs):
1770 """MoveRightTopTo(self, Point2D pt)"""
1771 return _core_.Rect2D_MoveRightTopTo(*args, **kwargs)
1772
1773 def GetRightBottom(*args, **kwargs):
1774 """GetRightBottom(self) -> Point2D"""
1775 return _core_.Rect2D_GetRightBottom(*args, **kwargs)
1776
1777 def SetRightBottom(*args, **kwargs):
1778 """SetRightBottom(self, Point2D pt)"""
1779 return _core_.Rect2D_SetRightBottom(*args, **kwargs)
1780
1781 def MoveRightBottomTo(*args, **kwargs):
1782 """MoveRightBottomTo(self, Point2D pt)"""
1783 return _core_.Rect2D_MoveRightBottomTo(*args, **kwargs)
1784
1785 def GetCentre(*args, **kwargs):
1786 """GetCentre(self) -> Point2D"""
1787 return _core_.Rect2D_GetCentre(*args, **kwargs)
1788
1789 def SetCentre(*args, **kwargs):
1790 """SetCentre(self, Point2D pt)"""
1791 return _core_.Rect2D_SetCentre(*args, **kwargs)
1792
1793 def MoveCentreTo(*args, **kwargs):
1794 """MoveCentreTo(self, Point2D pt)"""
1795 return _core_.Rect2D_MoveCentreTo(*args, **kwargs)
1796
1797 def GetOutcode(*args, **kwargs):
1798 """GetOutcode(self, Point2D pt) -> int"""
1799 return _core_.Rect2D_GetOutcode(*args, **kwargs)
1800
1801 def Contains(*args, **kwargs):
1802 """Contains(self, Point2D pt) -> bool"""
1803 return _core_.Rect2D_Contains(*args, **kwargs)
1804
1805 def ContainsRect(*args, **kwargs):
1806 """ContainsRect(self, Rect2D rect) -> bool"""
1807 return _core_.Rect2D_ContainsRect(*args, **kwargs)
1808
1809 def IsEmpty(*args, **kwargs):
1810 """IsEmpty(self) -> bool"""
1811 return _core_.Rect2D_IsEmpty(*args, **kwargs)
1812
1813 def HaveEqualSize(*args, **kwargs):
1814 """HaveEqualSize(self, Rect2D rect) -> bool"""
1815 return _core_.Rect2D_HaveEqualSize(*args, **kwargs)
1816
1817 def Inset(*args):
1818 """
1819 Inset(self, wxDouble x, wxDouble y)
1820 Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom)
1821 """
1822 return _core_.Rect2D_Inset(*args)
1823
1824 def Offset(*args, **kwargs):
1825 """Offset(self, Point2D pt)"""
1826 return _core_.Rect2D_Offset(*args, **kwargs)
1827
1828 def ConstrainTo(*args, **kwargs):
1829 """ConstrainTo(self, Rect2D rect)"""
1830 return _core_.Rect2D_ConstrainTo(*args, **kwargs)
1831
1832 def Interpolate(*args, **kwargs):
1833 """Interpolate(self, int widthfactor, int heightfactor) -> Point2D"""
1834 return _core_.Rect2D_Interpolate(*args, **kwargs)
1835
1836 def Intersect(*args, **kwargs):
1837 """Intersect(self, Rect2D otherRect)"""
1838 return _core_.Rect2D_Intersect(*args, **kwargs)
1839
1840 def CreateIntersection(*args, **kwargs):
1841 """CreateIntersection(self, Rect2D otherRect) -> Rect2D"""
1842 return _core_.Rect2D_CreateIntersection(*args, **kwargs)
1843
1844 def Intersects(*args, **kwargs):
1845 """Intersects(self, Rect2D rect) -> bool"""
1846 return _core_.Rect2D_Intersects(*args, **kwargs)
1847
1848 def Union(*args, **kwargs):
1849 """Union(self, Rect2D otherRect)"""
1850 return _core_.Rect2D_Union(*args, **kwargs)
1851
1852 def CreateUnion(*args, **kwargs):
1853 """CreateUnion(self, Rect2D otherRect) -> Rect2D"""
1854 return _core_.Rect2D_CreateUnion(*args, **kwargs)
1855
1856 def Scale(*args):
1857 """
1858 Scale(self, wxDouble f)
1859 Scale(self, int num, int denum)
1860 """
1861 return _core_.Rect2D_Scale(*args)
1862
1863 def __eq__(*args, **kwargs):
1864 """
1865 __eq__(self, PyObject other) -> bool
1866
1867 Test for equality of wx.Rect2D objects.
1868 """
1869 return _core_.Rect2D___eq__(*args, **kwargs)
1870
1871 def __ne__(*args, **kwargs):
1872 """
1873 __ne__(self, PyObject other) -> bool
1874
1875 Test for inequality of wx.Rect2D objects.
1876 """
1877 return _core_.Rect2D___ne__(*args, **kwargs)
1878
1879 x = property(_core_.Rect2D_x_get, _core_.Rect2D_x_set)
1880 y = property(_core_.Rect2D_y_get, _core_.Rect2D_y_set)
1881 width = property(_core_.Rect2D_width_get, _core_.Rect2D_width_set)
1882 height = property(_core_.Rect2D_height_get, _core_.Rect2D_height_set)
1883 def Set(*args, **kwargs):
1884 """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)"""
1885 return _core_.Rect2D_Set(*args, **kwargs)
1886
1887 def Get(*args, **kwargs):
1888 """
1889 Get() -> (x,y, width, height)
1890
1891 Return x, y, width and height y properties as a tuple.
1892 """
1893 return _core_.Rect2D_Get(*args, **kwargs)
1894
1895 def __str__(self): return str(self.Get())
1896 def __repr__(self): return 'wx.Rect2D'+str(self.Get())
1897 def __len__(self): return len(self.Get())
1898 def __getitem__(self, index): return self.Get()[index]
1899 def __setitem__(self, index, val):
1900 if index == 0: self.x = val
1901 elif index == 1: self.y = val
1902 elif index == 2: self.width = val
1903 elif index == 3: self.height = val
1904 else: raise IndexError
1905 def __nonzero__(self): return self.Get() != (0.0, 0.0, 0.0, 0.0)
1906 __safe_for_unpickling__ = True
1907 def __reduce__(self): return (wx.Rect2D, self.Get())
1908
1909_core_.Rect2D_swigregister(Rect2D)
1910
1911#---------------------------------------------------------------------------
1912
54f9ee45
RD
1913FromStart = _core_.FromStart
1914FromCurrent = _core_.FromCurrent
1915FromEnd = _core_.FromEnd
d14a1e28 1916class InputStream(object):
093d3ff1 1917 """Proxy of C++ InputStream class"""
0085ce49
RD
1918 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1919 __repr__ = _swig_repr
1920 def __init__(self, *args, **kwargs):
a95a7133 1921 """__init__(self, PyObject p) -> InputStream"""
0085ce49
RD
1922 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1923 __swig_destroy__ = _core_.delete_InputStream
1924 __del__ = lambda self : None;
e811c8ce 1925 def close(*args, **kwargs):
a95a7133 1926 """close(self)"""
54f9ee45 1927 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1928
1929 def flush(*args, **kwargs):
a95a7133 1930 """flush(self)"""
54f9ee45 1931 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1932
1933 def eof(*args, **kwargs):
a95a7133 1934 """eof(self) -> bool"""
54f9ee45 1935 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1936
1937 def read(*args, **kwargs):
a95a7133 1938 """read(self, int size=-1) -> PyObject"""
54f9ee45 1939 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1940
1941 def readline(*args, **kwargs):
a95a7133 1942 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1943 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1944
1945 def readlines(*args, **kwargs):
a95a7133 1946 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1947 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1948
1949 def seek(*args, **kwargs):
a95a7133 1950 """seek(self, int offset, int whence=0)"""
54f9ee45 1951 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1952
1953 def tell(*args, **kwargs):
a95a7133 1954 """tell(self) -> int"""
54f9ee45 1955 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1956
1957 def Peek(*args, **kwargs):
a95a7133 1958 """Peek(self) -> char"""
54f9ee45 1959 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1960
1961 def GetC(*args, **kwargs):
a95a7133 1962 """GetC(self) -> char"""
54f9ee45 1963 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1964
1965 def LastRead(*args, **kwargs):
a95a7133 1966 """LastRead(self) -> size_t"""
54f9ee45 1967 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1968
1969 def CanRead(*args, **kwargs):
a95a7133 1970 """CanRead(self) -> bool"""
54f9ee45 1971 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1972
1973 def Eof(*args, **kwargs):
a95a7133 1974 """Eof(self) -> bool"""
54f9ee45 1975 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1976
1977 def Ungetch(*args, **kwargs):
a95a7133 1978 """Ungetch(self, char c) -> bool"""
54f9ee45 1979 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1980
1981 def SeekI(*args, **kwargs):
a95a7133 1982 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1983 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1984
1985 def TellI(*args, **kwargs):
a95a7133 1986 """TellI(self) -> long"""
54f9ee45 1987 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1988
2131d850 1989_core_.InputStream_swigregister(InputStream)
d14a1e28
RD
1990DefaultPosition = cvar.DefaultPosition
1991DefaultSize = cvar.DefaultSize
1992
1993class OutputStream(object):
093d3ff1 1994 """Proxy of C++ OutputStream class"""
0085ce49
RD
1995 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1996 def __init__(self): raise AttributeError, "No constructor defined"
1997 __repr__ = _swig_repr
e811c8ce 1998 def write(*args, **kwargs):
a95a7133 1999 """write(self, PyObject obj)"""
54f9ee45 2000 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 2001
0085ce49
RD
2002 def LastWrite(*args, **kwargs):
2003 """LastWrite(self) -> size_t"""
2004 return _core_.OutputStream_LastWrite(*args, **kwargs)
d14a1e28 2005
2131d850 2006_core_.OutputStream_swigregister(OutputStream)
d14a1e28
RD
2007
2008#---------------------------------------------------------------------------
2009
2010class FSFile(Object):
093d3ff1 2011 """Proxy of C++ FSFile class"""
0085ce49
RD
2012 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2013 __repr__ = _swig_repr
2014 def __init__(self, *args, **kwargs):
0df68c9f 2015 """
a95a7133 2016 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 2017 DateTime modif) -> FSFile
0df68c9f 2018 """
0085ce49 2019 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
0085ce49
RD
2020 __swig_destroy__ = _core_.delete_FSFile
2021 __del__ = lambda self : None;
e811c8ce 2022 def GetStream(*args, **kwargs):
a95a7133 2023 """GetStream(self) -> InputStream"""
54f9ee45 2024 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce 2025
97ab0f6a
RD
2026 def DetachStream(*args, **kwargs):
2027 """DetachStream(self)"""
2028 return _core_.FSFile_DetachStream(*args, **kwargs)
2029
e811c8ce 2030 def GetMimeType(*args, **kwargs):
a95a7133 2031 """GetMimeType(self) -> String"""
54f9ee45 2032 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
2033
2034 def GetLocation(*args, **kwargs):
a95a7133 2035 """GetLocation(self) -> String"""
54f9ee45 2036 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
2037
2038 def GetAnchor(*args, **kwargs):
a95a7133 2039 """GetAnchor(self) -> String"""
54f9ee45 2040 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
2041
2042 def GetModificationTime(*args, **kwargs):
a95a7133 2043 """GetModificationTime(self) -> DateTime"""
54f9ee45 2044 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 2045
97ab0f6a
RD
2046 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2047 Location = property(GetLocation,doc="See `GetLocation`")
2048 MimeType = property(GetMimeType,doc="See `GetMimeType`")
2049 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
2050 Stream = property(GetStream,doc="See `GetStream`")
2131d850 2051_core_.FSFile_swigregister(FSFile)
d14a1e28
RD
2052
2053class CPPFileSystemHandler(object):
093d3ff1 2054 """Proxy of C++ CPPFileSystemHandler class"""
0085ce49
RD
2055 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2056 def __init__(self): raise AttributeError, "No constructor defined"
2057 __repr__ = _swig_repr
50f151d7
RD
2058 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
2059 __del__ = lambda self : None;
2131d850 2060_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d14a1e28
RD
2061
2062class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 2063 """Proxy of C++ FileSystemHandler class"""
0085ce49
RD
2064 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2065 __repr__ = _swig_repr
2066 def __init__(self, *args, **kwargs):
a95a7133 2067 """__init__(self) -> FileSystemHandler"""
0085ce49 2068 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
c25f90f6 2069 FileSystemHandler._setCallbackInfo(self, self, FileSystemHandler)
e811c8ce
RD
2070
2071 def _setCallbackInfo(*args, **kwargs):
a95a7133 2072 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 2073 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
2074
2075 def CanOpen(*args, **kwargs):
a95a7133 2076 """CanOpen(self, String location) -> bool"""
54f9ee45 2077 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2078
2079 def OpenFile(*args, **kwargs):
a95a7133 2080 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2081 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2082
2083 def FindFirst(*args, **kwargs):
a95a7133 2084 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2085 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2086
2087 def FindNext(*args, **kwargs):
a95a7133 2088 """FindNext(self) -> String"""
54f9ee45 2089 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
2090
2091 def GetProtocol(*args, **kwargs):
a95a7133 2092 """GetProtocol(self, String location) -> String"""
54f9ee45 2093 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
2094
2095 def GetLeftLocation(*args, **kwargs):
a95a7133 2096 """GetLeftLocation(self, String location) -> String"""
54f9ee45 2097 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
2098
2099 def GetAnchor(*args, **kwargs):
a95a7133 2100 """GetAnchor(self, String location) -> String"""
54f9ee45 2101 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
2102
2103 def GetRightLocation(*args, **kwargs):
a95a7133 2104 """GetRightLocation(self, String location) -> String"""
54f9ee45 2105 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
2106
2107 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 2108 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 2109 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 2110
97ab0f6a
RD
2111 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2112 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
2113 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
2114 Protocol = property(GetProtocol,doc="See `GetProtocol`")
2115 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2131d850 2116_core_.FileSystemHandler_swigregister(FileSystemHandler)
d14a1e28
RD
2117
2118class FileSystem(Object):
093d3ff1 2119 """Proxy of C++ FileSystem class"""
0085ce49
RD
2120 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2121 __repr__ = _swig_repr
2122 def __init__(self, *args, **kwargs):
a95a7133 2123 """__init__(self) -> FileSystem"""
0085ce49
RD
2124 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
2125 __swig_destroy__ = _core_.delete_FileSystem
2126 __del__ = lambda self : None;
e811c8ce 2127 def ChangePathTo(*args, **kwargs):
a95a7133 2128 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 2129 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
2130
2131 def GetPath(*args, **kwargs):
a95a7133 2132 """GetPath(self) -> String"""
54f9ee45 2133 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
2134
2135 def OpenFile(*args, **kwargs):
a95a7133 2136 """OpenFile(self, String location) -> FSFile"""
54f9ee45 2137 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
2138
2139 def FindFirst(*args, **kwargs):
a95a7133 2140 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2141 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
2142
2143 def FindNext(*args, **kwargs):
a95a7133 2144 """FindNext(self) -> String"""
54f9ee45 2145 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
2146
2147 def AddHandler(*args, **kwargs):
66c033b4 2148 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 2149 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
2150
2151 AddHandler = staticmethod(AddHandler)
97ab0f6a
RD
2152 def RemoveHandler(*args, **kwargs):
2153 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2154 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2155
2156 RemoveHandler = staticmethod(RemoveHandler)
e811c8ce 2157 def CleanUpHandlers(*args, **kwargs):
66c033b4 2158 """CleanUpHandlers()"""
54f9ee45 2159 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
2160
2161 CleanUpHandlers = staticmethod(CleanUpHandlers)
2162 def FileNameToURL(*args, **kwargs):
66c033b4 2163 """FileNameToURL(String filename) -> String"""
54f9ee45 2164 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
2165
2166 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
2167 def URLToFileName(*args, **kwargs):
2168 """URLToFileName(String url) -> String"""
2169 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2170
2171 URLToFileName = staticmethod(URLToFileName)
97ab0f6a 2172 Path = property(GetPath,doc="See `GetPath`")
2131d850 2173_core_.FileSystem_swigregister(FileSystem)
d14a1e28 2174
e811c8ce 2175def FileSystem_AddHandler(*args, **kwargs):
0085ce49
RD
2176 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
2177 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 2178
97ab0f6a
RD
2179def FileSystem_RemoveHandler(*args, **kwargs):
2180 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2181 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2182
0085ce49
RD
2183def FileSystem_CleanUpHandlers(*args):
2184 """FileSystem_CleanUpHandlers()"""
2185 return _core_.FileSystem_CleanUpHandlers(*args)
d14a1e28 2186
e811c8ce 2187def FileSystem_FileNameToURL(*args, **kwargs):
0085ce49
RD
2188 """FileSystem_FileNameToURL(String filename) -> String"""
2189 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 2190
e811c8ce 2191def FileSystem_URLToFileName(*args, **kwargs):
0085ce49
RD
2192 """FileSystem_URLToFileName(String url) -> String"""
2193 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 2194
d14a1e28 2195class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 2196 """Proxy of C++ InternetFSHandler class"""
0085ce49
RD
2197 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2198 __repr__ = _swig_repr
2199 def __init__(self, *args, **kwargs):
a95a7133 2200 """__init__(self) -> InternetFSHandler"""
0085ce49 2201 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
e811c8ce 2202 def CanOpen(*args, **kwargs):
a95a7133 2203 """CanOpen(self, String location) -> bool"""
54f9ee45 2204 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2205
2206 def OpenFile(*args, **kwargs):
a95a7133 2207 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2208 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 2209
2131d850 2210_core_.InternetFSHandler_swigregister(InternetFSHandler)
d14a1e28
RD
2211
2212class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 2213 """Proxy of C++ ZipFSHandler class"""
0085ce49
RD
2214 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2215 __repr__ = _swig_repr
2216 def __init__(self, *args, **kwargs):
a95a7133 2217 """__init__(self) -> ZipFSHandler"""
0085ce49 2218 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
e811c8ce 2219 def CanOpen(*args, **kwargs):
a95a7133 2220 """CanOpen(self, String location) -> bool"""
54f9ee45 2221 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2222
2223 def OpenFile(*args, **kwargs):
a95a7133 2224 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2225 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2226
2227 def FindFirst(*args, **kwargs):
a95a7133 2228 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2229 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2230
2231 def FindNext(*args, **kwargs):
a95a7133 2232 """FindNext(self) -> String"""
54f9ee45 2233 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 2234
2131d850 2235_core_.ZipFSHandler_swigregister(ZipFSHandler)
d14a1e28
RD
2236
2237
e811c8ce 2238def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
0085ce49
RD
2239 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2240 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 2241
e811c8ce 2242def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
0085ce49
RD
2243 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2244 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 2245
e811c8ce 2246def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
0085ce49
RD
2247 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2248 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
2249def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2250 """
2251 Add 'file' to the memory filesystem. The dataItem parameter can
2252 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2253 arbitrary data. If a bitmap or image is used then the imgType
2254 parameter should specify what kind of image file it should be
2255 written as, wx.BITMAP_TYPE_PNG, etc.
2256 """
2257 if isinstance(dataItem, wx.Image):
2258 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2259 elif isinstance(dataItem, wx.Bitmap):
2260 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2261 elif type(dataItem) == str:
2262 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2263 else:
2264 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
2265
2266class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 2267 """Proxy of C++ MemoryFSHandler class"""
0085ce49
RD
2268 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2269 __repr__ = _swig_repr
2270 def __init__(self, *args, **kwargs):
a95a7133 2271 """__init__(self) -> MemoryFSHandler"""
0085ce49 2272 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
e811c8ce 2273 def RemoveFile(*args, **kwargs):
66c033b4 2274 """RemoveFile(String filename)"""
54f9ee45 2275 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
2276
2277 RemoveFile = staticmethod(RemoveFile)
d14a1e28 2278 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 2279 def CanOpen(*args, **kwargs):
a95a7133 2280 """CanOpen(self, String location) -> bool"""
54f9ee45 2281 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2282
2283 def OpenFile(*args, **kwargs):
a95a7133 2284 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2285 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2286
2287 def FindFirst(*args, **kwargs):
a95a7133 2288 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2289 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2290
2291 def FindNext(*args, **kwargs):
a95a7133 2292 """FindNext(self) -> String"""
54f9ee45 2293 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 2294
2131d850 2295_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d14a1e28 2296
e811c8ce 2297def MemoryFSHandler_RemoveFile(*args, **kwargs):
0085ce49
RD
2298 """MemoryFSHandler_RemoveFile(String filename)"""
2299 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28 2300
bcd0d7b6
RD
2301IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2302IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2303IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
f5263701
RD
2304IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2305IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
d14a1e28
RD
2306#---------------------------------------------------------------------------
2307
2308class ImageHandler(Object):
27fb7603
RD
2309 """
2310 This is the base class for implementing image file loading/saving, and
2311 image creation from data. It is used within `wx.Image` and is not
2312 normally seen by the application.
2313 """
0085ce49
RD
2314 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2315 def __init__(self): raise AttributeError, "No constructor defined"
2316 __repr__ = _swig_repr
e811c8ce 2317 def GetName(*args, **kwargs):
a95a7133 2318 """GetName(self) -> String"""
54f9ee45 2319 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
2320
2321 def GetExtension(*args, **kwargs):
a95a7133 2322 """GetExtension(self) -> String"""
54f9ee45 2323 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
2324
2325 def GetType(*args, **kwargs):
a95a7133 2326 """GetType(self) -> long"""
54f9ee45 2327 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
2328
2329 def GetMimeType(*args, **kwargs):
a95a7133 2330 """GetMimeType(self) -> String"""
54f9ee45 2331 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
2332
2333 def CanRead(*args, **kwargs):
a95a7133 2334 """CanRead(self, String name) -> bool"""
54f9ee45 2335 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce 2336
b02396e8
RD
2337 def CanReadStream(*args, **kwargs):
2338 """CanReadStream(self, InputStream stream) -> bool"""
2339 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2340
e811c8ce 2341 def SetName(*args, **kwargs):
a95a7133 2342 """SetName(self, String name)"""
54f9ee45 2343 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
2344
2345 def SetExtension(*args, **kwargs):
a95a7133 2346 """SetExtension(self, String extension)"""
54f9ee45 2347 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
2348
2349 def SetType(*args, **kwargs):
a95a7133 2350 """SetType(self, long type)"""
54f9ee45 2351 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
2352
2353 def SetMimeType(*args, **kwargs):
a95a7133 2354 """SetMimeType(self, String mimetype)"""
54f9ee45 2355 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 2356
97ab0f6a
RD
2357 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2358 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2359 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2360 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2131d850 2361_core_.ImageHandler_swigregister(ImageHandler)
d14a1e28 2362
943e8dfd
RD
2363class PyImageHandler(ImageHandler):
2364 """
2365 This is the base class for implementing image file loading/saving, and
2366 image creation from data, all written in Python. To create a custom
2367 image handler derive a new class from wx.PyImageHandler and provide
2368 the following methods::
2369
2370 def DoCanRead(self, stream) --> bool
2371 '''Check if this handler can read the image on the stream'''
2372
2373 def LoadFile(self, image, stream, verbose, index) --> bool
2374 '''Load image data from the stream and load it into image.'''
2375
2376 def SaveFile(self, image, stream, verbose) --> bool
2377 '''Save the iamge data in image to the stream using
2378 this handler's image file format.'''
2379
2380 def GetImageCount(self, stream) --> int
2381 '''If this image format can hold more than one image,
2382 how many does the image on the stream have?'''
2383
2384 To activate your handler create an instance of it and pass it to
2385 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2386 `SetExtension` from your constructor.
2387
2388 """
0085ce49
RD
2389 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2390 __repr__ = _swig_repr
2391 def __init__(self, *args, **kwargs):
943e8dfd
RD
2392 """
2393 __init__(self) -> PyImageHandler
2394
2395 This is the base class for implementing image file loading/saving, and
2396 image creation from data, all written in Python. To create a custom
2397 image handler derive a new class from wx.PyImageHandler and provide
2398 the following methods::
2399
2400 def DoCanRead(self, stream) --> bool
2401 '''Check if this handler can read the image on the stream'''
2402
2403 def LoadFile(self, image, stream, verbose, index) --> bool
2404 '''Load image data from the stream and load it into image.'''
2405
2406 def SaveFile(self, image, stream, verbose) --> bool
2407 '''Save the iamge data in image to the stream using
2408 this handler's image file format.'''
2409
2410 def GetImageCount(self, stream) --> int
2411 '''If this image format can hold more than one image,
2412 how many does the image on the stream have?'''
2413
2414 To activate your handler create an instance of it and pass it to
2415 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2416 `SetExtension` from your constructor.
2417
2418 """
0085ce49 2419 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2420 self._SetSelf(self)
2421
2422 def _SetSelf(*args, **kwargs):
2423 """_SetSelf(self, PyObject self)"""
2424 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2425
2131d850 2426_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2427
d14a1e28 2428class ImageHistogram(object):
093d3ff1 2429 """Proxy of C++ ImageHistogram class"""
0085ce49
RD
2430 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2431 __repr__ = _swig_repr
2432 def __init__(self, *args, **kwargs):
a95a7133 2433 """__init__(self) -> ImageHistogram"""
0085ce49 2434 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
e811c8ce 2435 def MakeKey(*args, **kwargs):
0df68c9f 2436 """
7a27cf7c 2437 MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2438
0df68c9f
RD
2439 Get the key in the histogram for the given RGB values
2440 """
54f9ee45 2441 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2442
2443 MakeKey = staticmethod(MakeKey)
2444 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2445 """
2446 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2447
2448 Find first colour that is not used in the image and has higher RGB
2449 values than startR, startG, startB. Returns a tuple consisting of a
2450 success flag and rgb values.
2451 """
54f9ee45 2452 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2453
f1cbd8fa
RD
2454 def GetCount(*args, **kwargs):
2455 """
2456 GetCount(self, unsigned long key) -> unsigned long
2457
2458 Returns the pixel count for the given key. Use `MakeKey` to create a
2459 key value from a RGB tripple.
2460 """
2461 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2462
2463 def GetCountRGB(*args, **kwargs):
2464 """
7a27cf7c 2465 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2466
2467 Returns the pixel count for the given RGB values.
2468 """
2469 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2470
2471 def GetCountColour(*args, **kwargs):
2472 """
2473 GetCountColour(self, Colour colour) -> unsigned long
2474
2475 Returns the pixel count for the given `wx.Colour` value.
2476 """
2477 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2478
2131d850 2479_core_.ImageHistogram_swigregister(ImageHistogram)
d14a1e28 2480
e811c8ce 2481def ImageHistogram_MakeKey(*args, **kwargs):
0085ce49 2482 """
7a27cf7c 2483 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2484
0df68c9f
RD
2485 Get the key in the histogram for the given RGB values
2486 """
0085ce49 2487 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28 2488
943e8dfd
RD
2489class Image_RGBValue(object):
2490 """
2491 An object that contains values for red, green and blue which represent
2492 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2493 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2494 color space.
2495 """
0085ce49
RD
2496 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2497 __repr__ = _swig_repr
2498 def __init__(self, *args, **kwargs):
943e8dfd
RD
2499 """
2500 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2501
2502 Constructor.
2503 """
0085ce49 2504 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2505 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2506 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2507 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2508_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2509
2510class Image_HSVValue(object):
2511 """
2512 An object that contains values for hue, saturation and value which
2513 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2514 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2515 color space.
2516 """
0085ce49
RD
2517 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2518 __repr__ = _swig_repr
2519 def __init__(self, *args, **kwargs):
943e8dfd
RD
2520 """
2521 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2522
2523 Constructor.
2524 """
0085ce49 2525 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2526 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2527 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2528 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2529_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2530
d14a1e28 2531class Image(Object):
7a27cf7c
RD
2532 """
2533 A platform-independent image class. An image can be created from
2534 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2535 variety of formats. Functions are available to set and get image
2536 bits, so it can be used for basic image manipulation.
2537
2538 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2539 platform-specific `wx.Bitmap` object must be created from it using the
2540 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2541 device context, using `wx.DC.DrawBitmap`.
2542
2543 One colour value of the image may be used as a mask colour which will
2544 lead to the automatic creation of a `wx.Mask` object associated to the
2545 bitmap object.
2546
2547 wx.Image supports alpha channel data, that is in addition to a byte
2548 for the red, green and blue colour components for each pixel it also
2549 stores a byte representing the pixel opacity. An alpha value of 0
2550 corresponds to a transparent pixel (null opacity) while a value of 255
2551 means that the pixel is 100% opaque.
2552
2553 Unlike RGB data, not all images have an alpha channel and before using
2554 `GetAlpha` you should check if this image contains an alpha channel
2555 with `HasAlpha`. Note that currently only images loaded from PNG files
2556 with transparency information will have an alpha channel.
2557 """
0085ce49
RD
2558 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2559 __repr__ = _swig_repr
2560 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2561 """
2562 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2563
2564 Loads an image from a file.
2565 """
0085ce49
RD
2566 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2567 __swig_destroy__ = _core_.delete_Image
2568 __del__ = lambda self : None;
e811c8ce 2569 def Create(*args, **kwargs):
7a27cf7c
RD
2570 """
2571 Create(self, int width, int height, bool clear=True)
2572
2573 Creates a fresh image. If clear is ``True``, the new image will be
2574 initialized to black. Otherwise, the image data will be uninitialized.
2575 """
54f9ee45 2576 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2577
2578 def Destroy(*args, **kwargs):
0df68c9f 2579 """
a95a7133 2580 Destroy(self)
e811c8ce 2581
7a27cf7c 2582 Destroys the image data.
0df68c9f 2583 """
b39fe951
RD
2584 args[0].this.own(False)
2585 return _core_.Image_Destroy(*args, **kwargs)
e811c8ce
RD
2586
2587 def Scale(*args, **kwargs):
7a27cf7c 2588 """
f5263701 2589 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2590
2591 Returns a scaled version of the image. This is also useful for scaling
2592 bitmaps in general as the only other way to scale bitmaps is to blit a
f5263701
RD
2593 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2594 specifies what method to use for resampling the image. It can be
2595 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2596 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2597 bicubic and box averaging resampling methods for upsampling and
2598 downsampling respectively.
7a27cf7c 2599 """
54f9ee45 2600 return _core_.Image_Scale(*args, **kwargs)
e811c8ce 2601
f5263701
RD
2602 def ResampleBox(*args, **kwargs):
2603 """ResampleBox(self, int width, int height) -> Image"""
2604 return _core_.Image_ResampleBox(*args, **kwargs)
2605
2606 def ResampleBicubic(*args, **kwargs):
2607 """ResampleBicubic(self, int width, int height) -> Image"""
2608 return _core_.Image_ResampleBicubic(*args, **kwargs)
2609
2610 def Blur(*args, **kwargs):
2611 """
2612 Blur(self, int radius) -> Image
2613
2614 Blurs the image in both horizontal and vertical directions by the
2615 specified pixel ``radius``. This should not be used when using a
2616 single mask colour for transparency.
2617 """
2618 return _core_.Image_Blur(*args, **kwargs)
2619
2620 def BlurHorizontal(*args, **kwargs):
2621 """
2622 BlurHorizontal(self, int radius) -> Image
2623
2624 Blurs the image in the horizontal direction only. This should not be
2625 used when using a single mask colour for transparency.
2626
2627 """
2628 return _core_.Image_BlurHorizontal(*args, **kwargs)
2629
2630 def BlurVertical(*args, **kwargs):
2631 """
2632 BlurVertical(self, int radius) -> Image
2633
2634 Blurs the image in the vertical direction only. This should not be
2635 used when using a single mask colour for transparency.
2636 """
2637 return _core_.Image_BlurVertical(*args, **kwargs)
2638
e811c8ce 2639 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2640 """
2641 ShrinkBy(self, int xFactor, int yFactor) -> Image
2642
2643 Return a version of the image scaled smaller by the given factors.
2644 """
54f9ee45 2645 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2646
2647 def Rescale(*args, **kwargs):
7a27cf7c 2648 """
f5263701 2649 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2650
2651 Changes the size of the image in-place by scaling it: after a call to
2652 this function, the image will have the given width and height.
2653
2654 Returns the (modified) image itself.
2655 """
54f9ee45 2656 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce 2657
aff4cc5c 2658 def Resize(*args, **kwargs):
7a27cf7c
RD
2659 """
2660 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2661
2662 Changes the size of the image in-place without scaling it, by adding
2663 either a border with the given colour or cropping as necessary. The
2664 image is pasted into a new image with the given size and background
2665 colour at the position pos relative to the upper left of the new
2666 image. If red = green = blue = -1 then use either the current mask
2667 colour if set or find, use, and set a suitable mask colour for any
2668 newly exposed areas.
2669
2670 Returns the (modified) image itself.
2671 """
aff4cc5c
RD
2672 return _core_.Image_Resize(*args, **kwargs)
2673
e811c8ce 2674 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2675 """
2676 SetRGB(self, int x, int y, byte r, byte g, byte b)
2677
2678 Sets the pixel at the given coordinate. This routine performs
2679 bounds-checks for the coordinate so it can be considered a safe way to
2680 manipulate the data, but in some cases this might be too slow so that
2681 the data will have to be set directly. In that case you will have to
2682 get access to the image data using the `GetData` method.
2683 """
54f9ee45 2684 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce 2685
aff4cc5c 2686 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2687 """
2688 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2689
2690 Sets the colour of the pixels within the given rectangle. This routine
2691 performs bounds-checks for the rectangle so it can be considered a
2692 safe way to manipulate the data.
2693 """
aff4cc5c
RD
2694 return _core_.Image_SetRGBRect(*args, **kwargs)
2695
e811c8ce 2696 def GetRed(*args, **kwargs):
7a27cf7c
RD
2697 """
2698 GetRed(self, int x, int y) -> byte
2699
2700 Returns the red intensity at the given coordinate.
2701 """
54f9ee45 2702 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2703
2704 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2705 """
2706 GetGreen(self, int x, int y) -> byte
2707
2708 Returns the green intensity at the given coordinate.
2709 """
54f9ee45 2710 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2711
2712 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2713 """
2714 GetBlue(self, int x, int y) -> byte
2715
2716 Returns the blue intensity at the given coordinate.
2717 """
54f9ee45 2718 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2719
2720 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2721 """
2722 SetAlpha(self, int x, int y, byte alpha)
2723
2724 Sets the alpha value for the given pixel. This function should only be
2725 called if the image has alpha channel data, use `HasAlpha` to check
2726 for this.
2727 """
54f9ee45 2728 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2729
2730 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2731 """
2732 GetAlpha(self, int x, int y) -> byte
2733
2734 Returns the alpha value for the given pixel. This function may only be
2735 called for the images with alpha channel, use `HasAlpha` to check for
2736 this.
2737
2738 The returned value is the *opacity* of the image, i.e. the value of 0
2739 corresponds to the fully transparent pixels while the value of 255 to
2740 the fully opaque pixels.
2741 """
54f9ee45 2742 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2743
2744 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2745 """
2746 HasAlpha(self) -> bool
2747
2748 Returns true if this image has alpha channel, false otherwise.
2749 """
54f9ee45 2750 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce 2751
68350608
RD
2752 def InitAlpha(*args, **kwargs):
2753 """
2754 InitAlpha(self)
2755
2756 Initializes the image alpha channel data. It is an error to call it if
2757 the image already has alpha data. If it doesn't, alpha data will be by
2758 default initialized to all pixels being fully opaque. But if the image
2759 has a a mask colour, all mask pixels will be completely transparent.
2760 """
2761 return _core_.Image_InitAlpha(*args, **kwargs)
2762
bcd0d7b6
RD
2763 def IsTransparent(*args, **kwargs):
2764 """
7a27cf7c 2765 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
bcd0d7b6 2766
7a27cf7c
RD
2767 Returns ``True`` if this pixel is masked or has an alpha value less
2768 than the spcified threshold.
bcd0d7b6
RD
2769 """
2770 return _core_.Image_IsTransparent(*args, **kwargs)
2771
e811c8ce 2772 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2773 """
2774 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2775
2776 Find first colour that is not used in the image and has higher RGB
2777 values than startR, startG, startB. Returns a tuple consisting of a
2778 success flag and rgb values.
2779 """
54f9ee45 2780 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2781
4cf4100f
RD
2782 def ConvertAlphaToMask(*args, **kwargs):
2783 """
bcd0d7b6 2784 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2785
7a27cf7c
RD
2786 If the image has alpha channel, this method converts it to mask. All
2787 pixels with alpha value less than ``threshold`` are replaced with the
2788 mask colour and the alpha channel is removed. The mask colour is
2789 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2790
2791 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2792 nothing.
2793 """
2794 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2795
8fb0e70a
RD
2796 def ConvertColourToAlpha(*args, **kwargs):
2797 """
7a27cf7c 2798 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2799
2800 This method converts an image where the original alpha information is
2801 only available as a shades of a colour (actually shades of grey)
2802 typically when you draw anti-aliased text into a bitmap. The DC
2803 drawing routines draw grey values on the black background although
2804 they actually mean to draw white with differnt alpha values. This
2805 method reverses it, assuming a black (!) background and white text.
2806 The method will then fill up the whole image with the colour given.
2807 """
2808 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2809
e811c8ce 2810 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2811 """
2812 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2813
2814 Sets the image's mask so that the pixels that have RGB value of
2815 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2816 by first finding an unused colour in the image, setting this colour as
2817 the mask colour and then using this colour to draw all pixels in the
2818 image who corresponding pixel in mask has given RGB value.
2819
2820 Returns ``False`` if ``mask`` does not have same dimensions as the
2821 image or if there is no unused colour left. Returns ``True`` if the
2822 mask was successfully applied.
2823
2824 Note that this method involves computing the histogram, which is
2825 computationally intensive operation.
2826 """
54f9ee45 2827 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2828
2829 def CanRead(*args, **kwargs):
7a27cf7c
RD
2830 """
2831 CanRead(String filename) -> bool
2832
2833 Returns True if the image handlers can read this file.
2834 """
54f9ee45 2835 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2836
2837 CanRead = staticmethod(CanRead)
2838 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2839 """
2840 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2841
2842 If the image file contains more than one image and the image handler
2843 is capable of retrieving these individually, this function will return
2844 the number of available images.
2845 """
54f9ee45 2846 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2847
2848 GetImageCount = staticmethod(GetImageCount)
2849 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2850 """
2851 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2852
2853 Loads an image from a file. If no handler type is provided, the
2854 library will try to autodetect the format.
2855 """
54f9ee45 2856 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2857
2858 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2859 """
2860 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2861
2862 Loads an image from a file, specifying the image type with a MIME type
2863 string.
2864 """
54f9ee45 2865 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2866
2867 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2868 """
2869 SaveFile(self, String name, int type) -> bool
2870
2871 Saves an image in the named file.
2872 """
54f9ee45 2873 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2874
2875 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2876 """
2877 SaveMimeFile(self, String name, String mimetype) -> bool
2878
2879 Saves an image in the named file.
2880 """
54f9ee45 2881 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2882
2883 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2884 """
2885 CanReadStream(InputStream stream) -> bool
2886
2887 Returns True if the image handlers can read an image file from the
2888 data currently on the input stream, or a readable Python file-like
2889 object.
2890 """
54f9ee45 2891 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2892
2893 CanReadStream = staticmethod(CanReadStream)
2894 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2895 """
2896 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2897
2898 Loads an image from an input stream or a readable Python file-like
2899 object. If no handler type is provided, the library will try to
2900 autodetect the format.
2901 """
54f9ee45 2902 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2903
2904 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2905 """
2906 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2907
2908 Loads an image from an input stream or a readable Python file-like
2909 object, using a MIME type string to specify the image file format.
2910 """
54f9ee45 2911 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce 2912
b39fe951 2913 def IsOk(*args, **kwargs):
7a27cf7c 2914 """
b39fe951 2915 IsOk(self) -> bool
7a27cf7c
RD
2916
2917 Returns true if image data is present.
2918 """
b39fe951 2919 return _core_.Image_IsOk(*args, **kwargs)
e811c8ce 2920
b39fe951 2921 Ok = IsOk
e811c8ce 2922 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2923 """
2924 GetWidth(self) -> int
2925
2926 Gets the width of the image in pixels.
2927 """
54f9ee45 2928 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2929
2930 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2931 """
2932 GetHeight(self) -> int
2933
2934 Gets the height of the image in pixels.
2935 """
54f9ee45 2936 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2937
b2df227b 2938 def GetSize(*args, **kwargs):
7a27cf7c
RD
2939 """
2940 GetSize(self) -> Size
2941
2942 Returns the size of the image in pixels.
2943 """
54f9ee45 2944 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2945
e811c8ce 2946 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2947 """
2948 GetSubImage(self, Rect rect) -> Image
2949
2950 Returns a sub image of the current one as long as the rect belongs
2951 entirely to the image.
2952 """
54f9ee45 2953 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce 2954
aff4cc5c 2955 def Size(*args, **kwargs):
7a27cf7c
RD
2956 """
2957 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2958
2959 Returns a resized version of this image without scaling it by adding
2960 either a border with the given colour or cropping as necessary. The
2961 image is pasted into a new image with the given size and background
2962 colour at the position ``pos`` relative to the upper left of the new
2963 image. If red = green = blue = -1 then use either the current mask
2964 colour if set or find, use, and set a suitable mask colour for any
2965 newly exposed areas.
2966 """
aff4cc5c
RD
2967 return _core_.Image_Size(*args, **kwargs)
2968
e811c8ce 2969 def Copy(*args, **kwargs):
7a27cf7c
RD
2970 """
2971 Copy(self) -> Image
2972
2973 Returns an identical copy of the image.
2974 """
54f9ee45 2975 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2976
2977 def Paste(*args, **kwargs):
7a27cf7c
RD
2978 """
2979 Paste(self, Image image, int x, int y)
2980
2981 Pastes ``image`` into this instance and takes care of the mask colour
2982 and any out of bounds problems.
2983 """
54f9ee45 2984 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2985
2986 def GetData(*args, **kwargs):
61d07ac7
RD
2987 """
2988 GetData(self) -> PyObject
2989
2990 Returns a string containing a copy of the RGB bytes of the image.
2991 """
54f9ee45 2992 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2993
2994 def SetData(*args, **kwargs):
61d07ac7
RD
2995 """
2996 SetData(self, buffer data)
2997
2998 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2999 either a string or a buffer object holding the data and the length of
3000 the data must be width*height*3.
3001 """
54f9ee45 3002 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
3003
3004 def GetDataBuffer(*args, **kwargs):
61d07ac7
RD
3005 """
3006 GetDataBuffer(self) -> PyObject
3007
3008 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
3009 image data buffer inside the wx.Image. You need to ensure that you do
3010 not use this buffer object after the image has been destroyed.
61d07ac7 3011 """
54f9ee45 3012 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
3013
3014 def SetDataBuffer(*args, **kwargs):
61d07ac7
RD
3015 """
3016 SetDataBuffer(self, buffer data)
3017
3018 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
3019 object. This can save making an extra copy of the data but you must
3020 ensure that the buffer object lives longer than the wx.Image does.
61d07ac7 3021 """
54f9ee45 3022 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
3023
3024 def GetAlphaData(*args, **kwargs):
61d07ac7
RD
3025 """
3026 GetAlphaData(self) -> PyObject
3027
3028 Returns a string containing a copy of the alpha bytes of the image.
3029 """
54f9ee45 3030 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
3031
3032 def SetAlphaData(*args, **kwargs):
61d07ac7
RD
3033 """
3034 SetAlphaData(self, buffer alpha)
3035
3036 Resets the Image's alpha data from a buffer of bytes. Accepts either
3037 a string or a buffer object holding the data and the length of the
3038 data must be width*height.
3039 """
54f9ee45 3040 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
3041
3042 def GetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
3043 """
3044 GetAlphaBuffer(self) -> PyObject
3045
3046 Returns a writable Python buffer object that is pointing at the Alpha
3047 data buffer inside the wx.Image. You need to ensure that you do not
3048 use this buffer object after the image has been destroyed.
3049 """
54f9ee45 3050 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
3051
3052 def SetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
3053 """
3054 SetAlphaBuffer(self, buffer alpha)
3055
3056 Sets the internal image alpha pointer to point at a Python buffer
3057 object. This can save making an extra copy of the data but you must
3058 ensure that the buffer object lives as long as the wx.Image does.
3059 """
54f9ee45 3060 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
3061
3062 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
3063 """
3064 SetMaskColour(self, byte r, byte g, byte b)
3065
3066 Sets the mask colour for this image (and tells the image to use the
3067 mask).
3068 """
54f9ee45 3069 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce 3070
aff4cc5c
RD
3071 def GetOrFindMaskColour(*args, **kwargs):
3072 """
3073 GetOrFindMaskColour() -> (r,g,b)
3074
3075 Get the current mask colour or find a suitable colour.
3076 """
3077 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
3078
e811c8ce 3079 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
3080 """
3081 GetMaskRed(self) -> byte
3082
3083 Gets the red component of the mask colour.
3084 """
54f9ee45 3085 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
3086
3087 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
3088 """
3089 GetMaskGreen(self) -> byte
3090
3091 Gets the green component of the mask colour.
3092 """
54f9ee45 3093 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
3094
3095 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
3096 """
3097 GetMaskBlue(self) -> byte
3098
3099 Gets the blue component of the mask colour.
3100 """
54f9ee45 3101 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
3102
3103 def SetMask(*args, **kwargs):
7a27cf7c
RD
3104 """
3105 SetMask(self, bool mask=True)
3106
3107 Specifies whether there is a mask or not. The area of the mask is
3108 determined by the current mask colour.
3109 """
54f9ee45 3110 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
3111
3112 def HasMask(*args, **kwargs):
7a27cf7c
RD
3113 """
3114 HasMask(self) -> bool
3115
3116 Returns ``True`` if there is a mask active, ``False`` otherwise.
3117 """
54f9ee45 3118 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
3119
3120 def Rotate(*args, **kwargs):
0df68c9f 3121 """
a95a7133 3122 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f 3123 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
3124
3125 Rotates the image about the given point, by ``angle`` radians. Passing
3126 ``True`` to ``interpolating`` results in better image quality, but is
3127 slower. If the image has a mask, then the mask colour is used for the
3128 uncovered pixels in the rotated image background. Otherwise, black
3129 will be used as the fill colour.
3130
3131 Returns the rotated image, leaving this image intact.
0df68c9f 3132 """
54f9ee45 3133 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
3134
3135 def Rotate90(*args, **kwargs):
7a27cf7c
RD
3136 """
3137 Rotate90(self, bool clockwise=True) -> Image
3138
3139 Returns a copy of the image rotated 90 degrees in the direction
3140 indicated by ``clockwise``.
3141 """
54f9ee45 3142 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
3143
3144 def Mirror(*args, **kwargs):
7a27cf7c
RD
3145 """
3146 Mirror(self, bool horizontally=True) -> Image
3147
3148 Returns a mirrored copy of the image. The parameter ``horizontally``
3149 indicates the orientation.
3150 """
54f9ee45 3151 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
3152
3153 def Replace(*args, **kwargs):
0df68c9f 3154 """
7a27cf7c
RD
3155 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
3156
3157 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
3158 ``(r2,g2,b2)``.
0df68c9f 3159 """
54f9ee45 3160 return _core_.Image_Replace(*args, **kwargs)
e811c8ce 3161
32fe5131
RD
3162 def ConvertToGreyscale(*args, **kwargs):
3163 """
3164 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
3165
3166 Convert to greyscale image. Uses the luminance component (Y) of the
3167 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
3168 defaults to ITU-T BT.601
3169 """
3170 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
3171
e811c8ce 3172 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
3173 """
3174 ConvertToMono(self, byte r, byte g, byte b) -> Image
3175
3176 Returns monochromatic version of the image. The returned image has
3177 white colour where the original has ``(r,g,b)`` colour and black
3178 colour everywhere else.
3179 """
54f9ee45 3180 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
3181
3182 def SetOption(*args, **kwargs):
7a27cf7c
RD
3183 """
3184 SetOption(self, String name, String value)
3185
3186 Sets an image handler defined option. For example, when saving as a
3187 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
3188 number between 0 and 100 (0 is terrible, 100 is very good).
3189 """
54f9ee45 3190 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
3191
3192 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
3193 """
3194 SetOptionInt(self, String name, int value)
3195
3196 Sets an image option as an integer.
3197 """
54f9ee45 3198 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
3199
3200 def GetOption(*args, **kwargs):
7a27cf7c
RD
3201 """
3202 GetOption(self, String name) -> String
3203
3204 Gets the value of an image handler option.
3205 """
54f9ee45 3206 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
3207
3208 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
3209 """
3210 GetOptionInt(self, String name) -> int
3211
3212 Gets the value of an image handler option as an integer. If the given
3213 option is not present, the function returns 0.
3214 """
54f9ee45 3215 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
3216
3217 def HasOption(*args, **kwargs):
7a27cf7c
RD
3218 """
3219 HasOption(self, String name) -> bool
3220
3221 Returns true if the given option is present.
3222 """
54f9ee45 3223 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
3224
3225 def CountColours(*args, **kwargs):
a95a7133 3226 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 3227 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
3228
3229 def ComputeHistogram(*args, **kwargs):
a95a7133 3230 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 3231 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
3232
3233 def AddHandler(*args, **kwargs):
66c033b4 3234 """AddHandler(ImageHandler handler)"""
54f9ee45 3235 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
3236
3237 AddHandler = staticmethod(AddHandler)
3238 def InsertHandler(*args, **kwargs):
66c033b4 3239 """InsertHandler(ImageHandler handler)"""
54f9ee45 3240 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
3241
3242 InsertHandler = staticmethod(InsertHandler)
3243 def RemoveHandler(*args, **kwargs):
66c033b4 3244 """RemoveHandler(String name) -> bool"""
54f9ee45 3245 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
3246
3247 RemoveHandler = staticmethod(RemoveHandler)
0085ce49
RD
3248 def GetHandlers(*args, **kwargs):
3249 """GetHandlers() -> PyObject"""
3250 return _core_.Image_GetHandlers(*args, **kwargs)
3251
3252 GetHandlers = staticmethod(GetHandlers)
e811c8ce 3253 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3254 """
3255 GetImageExtWildcard() -> String
3256
3257 Iterates all registered wxImageHandler objects, and returns a string
3258 containing file extension masks suitable for passing to file open/save
3259 dialog boxes.
3260 """
54f9ee45 3261 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
3262
3263 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3264 def ConvertToBitmap(*args, **kwargs):
1fbf26be 3265 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 3266 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
3267
3268 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3269 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
54f9ee45 3270 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce 3271
943e8dfd
RD
3272 def RotateHue(*args, **kwargs):
3273 """
3274 RotateHue(self, double angle)
3275
3276 Rotates the hue of each pixel of the image. Hue is a double in the
3277 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3278 """
3279 return _core_.Image_RotateHue(*args, **kwargs)
3280
3281 def RGBtoHSV(*args, **kwargs):
3282 """
3283 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3284
3285 Converts a color in RGB color space to HSV color space.
3286 """
3287 return _core_.Image_RGBtoHSV(*args, **kwargs)
3288
3289 RGBtoHSV = staticmethod(RGBtoHSV)
3290 def HSVtoRGB(*args, **kwargs):
3291 """
3292 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3293
3294 Converts a color in HSV color space to RGB color space.
3295 """
3296 return _core_.Image_HSVtoRGB(*args, **kwargs)
3297
3298 HSVtoRGB = staticmethod(HSVtoRGB)
b39fe951 3299 def __nonzero__(self): return self.IsOk()
97ab0f6a
RD
3300 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3301 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3302 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3303 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3304 Height = property(GetHeight,doc="See `GetHeight`")
3305 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3306 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3307 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
97ab0f6a 3308 Width = property(GetWidth,doc="See `GetWidth`")
2131d850 3309_core_.Image_swigregister(Image)
d14a1e28
RD
3310
3311def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3312 """
3313 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3314
3315 Loads an image from a file, using a MIME type string (such as
3316 'image/jpeg') to specify image type.
3317 """
54f9ee45 3318 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
3319 return val
3320
3321def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3322 """
3323 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3324
3325 Loads an image from an input stream, or any readable Python file-like
3326 object.
3327 """
54f9ee45 3328 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
3329 return val
3330
3331def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3332 """
3333 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3334
3335 Loads an image from an input stream, or any readable Python file-like
3336 object, specifying the image format with a MIME type string.
3337 """
54f9ee45 3338 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
3339 return val
3340
66c033b4 3341def EmptyImage(*args, **kwargs):
61d07ac7
RD
3342 """
3343 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3344
3345 Construct an empty image of a given size, optionally setting all
3346 pixels to black.
3347 """
66c033b4 3348 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
3349 return val
3350
3351def ImageFromBitmap(*args, **kwargs):
61d07ac7
RD
3352 """
3353 ImageFromBitmap(Bitmap bitmap) -> Image
3354
3355 Construct an Image from a `wx.Bitmap`.
3356 """
54f9ee45 3357 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
3358 return val
3359
3360def ImageFromData(*args, **kwargs):
61d07ac7
RD
3361 """
3362 ImageFromData(int width, int height, buffer data) -> Image
3363
3364 Construct an Image from a buffer of RGB bytes. Accepts either a
3365 string or a buffer object holding the data and the length of the data
3366 must be width*height*3.
3367 """
54f9ee45 3368 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
3369 return val
3370
1823fbb4 3371def ImageFromDataWithAlpha(*args, **kwargs):
61d07ac7
RD
3372 """
3373 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3374
3375 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3376 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3377 length of the data must be width*height*3 bytes, and the length of the
3378 alpha data must be width*height bytes.
61d07ac7 3379 """
1823fbb4 3380 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
1823fbb4
RD
3381 return val
3382
e811c8ce 3383def Image_CanRead(*args, **kwargs):
0085ce49 3384 """
7a27cf7c
RD
3385 Image_CanRead(String filename) -> bool
3386
3387 Returns True if the image handlers can read this file.
3388 """
0085ce49 3389 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 3390
e811c8ce 3391def Image_GetImageCount(*args, **kwargs):
0085ce49 3392 """
7a27cf7c
RD
3393 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3394
3395 If the image file contains more than one image and the image handler
3396 is capable of retrieving these individually, this function will return
3397 the number of available images.
3398 """
0085ce49 3399 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 3400
e811c8ce 3401def Image_CanReadStream(*args, **kwargs):
0085ce49 3402 """
7a27cf7c
RD
3403 Image_CanReadStream(InputStream stream) -> bool
3404
3405 Returns True if the image handlers can read an image file from the
3406 data currently on the input stream, or a readable Python file-like
3407 object.
3408 """
0085ce49 3409 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 3410
e811c8ce 3411def Image_AddHandler(*args, **kwargs):
0085ce49
RD
3412 """Image_AddHandler(ImageHandler handler)"""
3413 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 3414
e811c8ce 3415def Image_InsertHandler(*args, **kwargs):
0085ce49
RD
3416 """Image_InsertHandler(ImageHandler handler)"""
3417 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 3418
e811c8ce 3419def Image_RemoveHandler(*args, **kwargs):
0085ce49
RD
3420 """Image_RemoveHandler(String name) -> bool"""
3421 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 3422
0085ce49
RD
3423def Image_GetHandlers(*args):
3424 """Image_GetHandlers() -> PyObject"""
3425 return _core_.Image_GetHandlers(*args)
3426
3427def Image_GetImageExtWildcard(*args):
3428 """
7a27cf7c
RD
3429 Image_GetImageExtWildcard() -> String
3430
3431 Iterates all registered wxImageHandler objects, and returns a string
3432 containing file extension masks suitable for passing to file open/save
3433 dialog boxes.
3434 """
0085ce49 3435 return _core_.Image_GetImageExtWildcard(*args)
d14a1e28 3436
943e8dfd 3437def Image_RGBtoHSV(*args, **kwargs):
0085ce49 3438 """
943e8dfd
RD
3439 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3440
3441 Converts a color in RGB color space to HSV color space.
3442 """
0085ce49 3443 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3444
3445def Image_HSVtoRGB(*args, **kwargs):
0085ce49 3446 """
943e8dfd
RD
3447 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3448
3449 Converts a color in HSV color space to RGB color space.
3450 """
0085ce49 3451 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3452
fc46b7f3
RD
3453
3454def _ImageFromBuffer(*args, **kwargs):
3455 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3456 return _core_._ImageFromBuffer(*args, **kwargs)
3457def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3458 """
3459 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
eec1c382
RD
3460 parameter must be a Python object that implements the buffer interface,
3461 such as a string, array, etc. The dataBuffer object is expected to
3462 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3463 object can optionally be supplied for the image's alpha channel data, and
3464 it is expected to be width*height bytes long.
fc46b7f3
RD
3465
3466 The wx.Image will be created with its data and alpha pointers initialized
3467 to the memory address pointed to by the buffer objects, thus saving the
3468 time needed to copy the image data from the buffer object to the wx.Image.
3469 While this has advantages, it also has the shoot-yourself-in-the-foot
3470 risks associated with sharing a C pointer between two objects.
3471
3472 To help alleviate the risk a reference to the data and alpha buffer
3473 objects are kept with the wx.Image, so that they won't get deleted until
3474 after the wx.Image is deleted. However please be aware that it is not
3475 guaranteed that an object won't move its memory buffer to a new location
3476 when it needs to resize its contents. If that happens then the wx.Image
3477 will end up referring to an invalid memory location and could cause the
3478 application to crash. Therefore care should be taken to not manipulate
3479 the objects used for the data and alpha buffers in a way that would cause
3480 them to change size.
3481 """
fc46b7f3
RD
3482 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3483 image._buffer = dataBuffer
3484 image._alpha = alphaBuffer
3485 return image
3486
5e4ca4a8
RD
3487def InitAllImageHandlers():
3488 """
3489 The former functionality of InitAllImageHanders is now done internal to
3490 the _core_ extension module and so this function has become a simple NOP.
3491 """
3492 pass
d14a1e28 3493
54f9ee45
RD
3494IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3495IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3496PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3497PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3498PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
54f9ee45
RD
3499BMP_24BPP = _core_.BMP_24BPP
3500BMP_8BPP = _core_.BMP_8BPP
3501BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3502BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3503BMP_8BPP_RED = _core_.BMP_8BPP_RED
3504BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3505BMP_4BPP = _core_.BMP_4BPP
3506BMP_1BPP = _core_.BMP_1BPP
3507BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 3508class BMPHandler(ImageHandler):
27fb7603 3509 """A `wx.ImageHandler` for \*.bmp bitmap files."""
0085ce49
RD
3510 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3511 __repr__ = _swig_repr
3512 def __init__(self, *args, **kwargs):
27fb7603
RD
3513 """
3514 __init__(self) -> BMPHandler
3515
3516 A `wx.ImageHandler` for \*.bmp bitmap files.
3517 """
0085ce49 3518 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3519_core_.BMPHandler_swigregister(BMPHandler)
d14a1e28 3520NullImage = cvar.NullImage
0c243d93 3521IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d14a1e28
RD
3522IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3523IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3524IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3525IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
0c243d93
RD
3526IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3527IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d14a1e28 3528IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3529IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
0c243d93
RD
3530IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3531IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3532IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3533IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3534IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3535IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d14a1e28
RD
3536
3537class ICOHandler(BMPHandler):
27fb7603 3538 """A `wx.ImageHandler` for \*.ico icon files."""
0085ce49
RD
3539 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3540 __repr__ = _swig_repr
3541 def __init__(self, *args, **kwargs):
27fb7603
RD
3542 """
3543 __init__(self) -> ICOHandler
3544
3545 A `wx.ImageHandler` for \*.ico icon files.
3546 """
0085ce49 3547 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3548_core_.ICOHandler_swigregister(ICOHandler)
d14a1e28
RD
3549
3550class CURHandler(ICOHandler):
27fb7603 3551 """A `wx.ImageHandler` for \*.cur cursor files."""
0085ce49
RD
3552 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3553 __repr__ = _swig_repr
3554 def __init__(self, *args, **kwargs):
27fb7603
RD
3555 """
3556 __init__(self) -> CURHandler
3557
3558 A `wx.ImageHandler` for \*.cur cursor files.
3559 """
0085ce49 3560 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3561_core_.CURHandler_swigregister(CURHandler)
d14a1e28
RD
3562
3563class ANIHandler(CURHandler):
27fb7603 3564 """A `wx.ImageHandler` for \*.ani animated cursor files."""
0085ce49
RD
3565 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3566 __repr__ = _swig_repr
3567 def __init__(self, *args, **kwargs):
27fb7603
RD
3568 """
3569 __init__(self) -> ANIHandler
3570
3571 A `wx.ImageHandler` for \*.ani animated cursor files.
3572 """
0085ce49 3573 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3574_core_.ANIHandler_swigregister(ANIHandler)
d14a1e28
RD
3575
3576class PNGHandler(ImageHandler):
27fb7603 3577 """A `wx.ImageHandler` for PNG image files."""
0085ce49
RD
3578 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3579 __repr__ = _swig_repr
3580 def __init__(self, *args, **kwargs):
27fb7603
RD
3581 """
3582 __init__(self) -> PNGHandler
3583
3584 A `wx.ImageHandler` for PNG image files.
3585 """
0085ce49 3586 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3587_core_.PNGHandler_swigregister(PNGHandler)
d14a1e28
RD
3588
3589class GIFHandler(ImageHandler):
27fb7603 3590 """A `wx.ImageHandler` for GIF image files."""
0085ce49
RD
3591 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3592 __repr__ = _swig_repr
3593 def __init__(self, *args, **kwargs):
27fb7603
RD
3594 """
3595 __init__(self) -> GIFHandler
3596
3597 A `wx.ImageHandler` for GIF image files.
3598 """
0085ce49 3599 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3600_core_.GIFHandler_swigregister(GIFHandler)
d14a1e28
RD
3601
3602class PCXHandler(ImageHandler):
27fb7603 3603 """A `wx.ImageHandler` for PCX imager files."""
0085ce49
RD
3604 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3605 __repr__ = _swig_repr
3606 def __init__(self, *args, **kwargs):
27fb7603
RD
3607 """
3608 __init__(self) -> PCXHandler
3609
3610 A `wx.ImageHandler` for PCX imager files.
3611 """
0085ce49 3612 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3613_core_.PCXHandler_swigregister(PCXHandler)
d14a1e28
RD
3614
3615class JPEGHandler(ImageHandler):
27fb7603 3616 """A `wx.ImageHandler` for JPEG/JPG image files."""
0085ce49
RD
3617 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3618 __repr__ = _swig_repr
3619 def __init__(self, *args, **kwargs):
27fb7603
RD
3620 """
3621 __init__(self) -> JPEGHandler
3622
3623 A `wx.ImageHandler` for JPEG/JPG image files.
3624 """
0085ce49 3625 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3626_core_.JPEGHandler_swigregister(JPEGHandler)
d14a1e28
RD
3627
3628class PNMHandler(ImageHandler):
27fb7603 3629 """A `wx.ImageHandler` for PNM image files."""
0085ce49
RD
3630 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3631 __repr__ = _swig_repr
3632 def __init__(self, *args, **kwargs):
27fb7603
RD
3633 """
3634 __init__(self) -> PNMHandler
3635
3636 A `wx.ImageHandler` for PNM image files.
3637 """
0085ce49 3638 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3639_core_.PNMHandler_swigregister(PNMHandler)
d14a1e28
RD
3640
3641class XPMHandler(ImageHandler):
27fb7603 3642 """A `wx.ImageHandler` for XPM image."""
0085ce49
RD
3643 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3644 __repr__ = _swig_repr
3645 def __init__(self, *args, **kwargs):
27fb7603
RD
3646 """
3647 __init__(self) -> XPMHandler
3648
3649 A `wx.ImageHandler` for XPM image.
3650 """
0085ce49 3651 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3652_core_.XPMHandler_swigregister(XPMHandler)
d14a1e28
RD
3653
3654class TIFFHandler(ImageHandler):
27fb7603 3655 """A `wx.ImageHandler` for TIFF image files."""
0085ce49
RD
3656 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3657 __repr__ = _swig_repr
3658 def __init__(self, *args, **kwargs):
27fb7603
RD
3659 """
3660 __init__(self) -> TIFFHandler
3661
3662 A `wx.ImageHandler` for TIFF image files.
3663 """
0085ce49 3664 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3665_core_.TIFFHandler_swigregister(TIFFHandler)
d14a1e28 3666
580080c5
RD
3667class TGAHandler(ImageHandler):
3668 """A `wx.ImageHandler` for TGA image files."""
3669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3670 __repr__ = _swig_repr
3671 def __init__(self, *args, **kwargs):
3672 """
3673 __init__(self) -> TGAHandler
3674
3675 A `wx.ImageHandler` for TGA image files.
3676 """
3677 _core_.TGAHandler_swiginit(self,_core_.new_TGAHandler(*args, **kwargs))
3678_core_.TGAHandler_swigregister(TGAHandler)
3679
c0de73ae
RD
3680QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3681QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3682class Quantize(object):
3683 """Performs quantization, or colour reduction, on a wxImage."""
0085ce49
RD
3684 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3685 def __init__(self): raise AttributeError, "No constructor defined"
3686 __repr__ = _swig_repr
c0de73ae
RD
3687 def Quantize(*args, **kwargs):
3688 """
3689 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3690
3691 Reduce the colours in the source image and put the result into the
3692 destination image, setting the palette in the destination if
3693 needed. Both images may be the same, to overwrite the source image.
3694 """
3695 return _core_.Quantize_Quantize(*args, **kwargs)
3696
3697 Quantize = staticmethod(Quantize)
2131d850 3698_core_.Quantize_swigregister(Quantize)
c0de73ae
RD
3699
3700def Quantize_Quantize(*args, **kwargs):
0085ce49 3701 """
c0de73ae
RD
3702 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3703
3704 Reduce the colours in the source image and put the result into the
3705 destination image, setting the palette in the destination if
3706 needed. Both images may be the same, to overwrite the source image.
3707 """
0085ce49 3708 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3709
d14a1e28
RD
3710#---------------------------------------------------------------------------
3711
3712class EvtHandler(Object):
093d3ff1 3713 """Proxy of C++ EvtHandler class"""
0085ce49
RD
3714 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3715 __repr__ = _swig_repr
3716 def __init__(self, *args, **kwargs):
a95a7133 3717 """__init__(self) -> EvtHandler"""
0085ce49 3718 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d49bdf34
RD
3719 self._setOORInfo(self)
3720
e811c8ce 3721 def GetNextHandler(*args, **kwargs):
a95a7133 3722 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 3723 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
3724
3725 def GetPreviousHandler(*args, **kwargs):
a95a7133 3726 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 3727 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3728
3729 def SetNextHandler(*args, **kwargs):
a95a7133 3730 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 3731 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
3732
3733 def SetPreviousHandler(*args, **kwargs):
a95a7133 3734 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 3735 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3736
3737 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3738 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 3739 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3740
3741 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3742 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 3743 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3744
3745 def ProcessEvent(*args, **kwargs):
a95a7133 3746 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 3747 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
3748
3749 def AddPendingEvent(*args, **kwargs):
a95a7133 3750 """AddPendingEvent(self, Event event)"""
54f9ee45 3751 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
3752
3753 def ProcessPendingEvents(*args, **kwargs):
a95a7133 3754 """ProcessPendingEvents(self)"""
54f9ee45 3755 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
3756
3757 def Connect(*args, **kwargs):
a95a7133 3758 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 3759 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
3760
3761 def Disconnect(*args, **kwargs):
2131d850 3762 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 3763 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
3764
3765 def _setOORInfo(*args, **kwargs):
689b42ee 3766 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef 3767 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
15665b47 3768 args[0].this.own(False)
7e08d4ef 3769 return val
e811c8ce 3770
d14a1e28
RD
3771 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3772 """
3773 Bind an event to an event handler.
3774
db3e571a
RD
3775 :param event: One of the EVT_* objects that specifies the
3776 type of event to bind,
d14a1e28 3777
db3e571a
RD
3778 :param handler: A callable object to be invoked when the
3779 event is delivered to self. Pass None to
3780 disconnect an event handler.
d14a1e28 3781
db3e571a
RD
3782 :param source: Sometimes the event originates from a
3783 different window than self, but you still
3784 want to catch it in self. (For example, a
3785 button event delivered to a frame.) By
3786 passing the source of the event, the event
3787 handling system is able to differentiate
3788 between the same event type from different
3789 controls.
d14a1e28 3790
db3e571a
RD
3791 :param id: Used to spcify the event source by ID instead
3792 of instance.
3793
3794 :param id2: Used when it is desirable to bind a handler
3795 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
3796 """
3797 if source is not None:
3798 id = source.GetId()
3799 event.Bind(self, id, id2, handler)
3800
66c033b4
RD
3801 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3802 """
3803 Disconencts the event handler binding for event from self.
3804 Returns True if successful.
3805 """
3806 if source is not None:
3807 id = source.GetId()
3808 return event.Unbind(self, id, id2)
d14a1e28 3809
97ab0f6a
RD
3810 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3811 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3812 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
2131d850 3813_core_.EvtHandler_swigregister(EvtHandler)
d14a1e28
RD
3814
3815#---------------------------------------------------------------------------
3816
3817class PyEventBinder(object):
3818 """
3819 Instances of this class are used to bind specific events to event
3820 handlers.
3821 """
3822 def __init__(self, evtType, expectedIDs=0):
3823 if expectedIDs not in [0, 1, 2]:
3824 raise ValueError, "Invalid number of expectedIDs"
3825 self.expectedIDs = expectedIDs
3826
3827 if type(evtType) == list or type(evtType) == tuple:
3828 self.evtType = evtType
3829 else:
3830 self.evtType = [evtType]
3831
3832
3833 def Bind(self, target, id1, id2, function):
3834 """Bind this set of event types to target."""
3835 for et in self.evtType:
3836 target.Connect(id1, id2, et, function)
3837
66c033b4
RD
3838
3839 def Unbind(self, target, id1, id2):
3840 """Remove an event binding."""
3841 success = 0
3842 for et in self.evtType:
3843 success += target.Disconnect(id1, id2, et)
3844 return success != 0
3845
b08d67c2
RD
3846 def _getEvtType(self):
3847 """
3848 Make it easy to get to the default wxEventType typeID for this
3849 event binder.
3850 """
3851 return self.evtType[0]
3852
3853 typeId = property(_getEvtType)
3854
d14a1e28
RD
3855
3856 def __call__(self, *args):
3857 """
3858 For backwards compatibility with the old EVT_* functions.
3859 Should be called with either (window, func), (window, ID,
3860 func) or (window, ID1, ID2, func) parameters depending on the
3861 type of the event.
3862 """
3863 assert len(args) == 2 + self.expectedIDs
3864 id1 = wx.ID_ANY
3865 id2 = wx.ID_ANY
3866 target = args[0]
3867 if self.expectedIDs == 0:
3868 func = args[1]
3869 elif self.expectedIDs == 1:
3870 id1 = args[1]
3871 func = args[2]
3872 elif self.expectedIDs == 2:
3873 id1 = args[1]
3874 id2 = args[2]
3875 func = args[3]
3876 else:
3877 raise ValueError, "Unexpected number of IDs"
3878
3879 self.Bind(target, id1, id2, func)
3880
3881
3882# These two are square pegs that don't fit the PyEventBinder hole...
3883def EVT_COMMAND(win, id, cmd, func):
3884 win.Connect(id, -1, cmd, func)
3885def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3886 win.Connect(id1, id2, cmd, func)
3887
3888
3889#---------------------------------------------------------------------------
3890
3891#---------------------------------------------------------------------------
3892
54f9ee45
RD
3893EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3894EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 3895
0085ce49 3896def NewEventType(*args):
2131d850 3897 """NewEventType() -> EventType"""
0085ce49 3898 return _core_.NewEventType(*args)
4976f996 3899wxEVT_ANY = _core_.wxEVT_ANY
54f9ee45
RD
3900wxEVT_NULL = _core_.wxEVT_NULL
3901wxEVT_FIRST = _core_.wxEVT_FIRST
3902wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3903wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3904wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3905wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3906wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3907wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3908wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3909wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3910wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3911wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3912wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3913wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3914wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3915wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3916wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3917wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3918wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3919wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3920wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3921wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3922wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3923wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3924wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3925wxEVT_MOTION = _core_.wxEVT_MOTION
3926wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3927wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3928wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3929wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3930wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3931wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3932wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3933wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3934wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3935wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3936wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3937wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3938wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3939wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3940wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3941wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3942wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3943wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3944wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3945wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3946wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3947wxEVT_CHAR = _core_.wxEVT_CHAR
3948wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3949wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3950wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3951wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3952wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3953wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3954wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3955wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3956wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3957wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3958wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3959wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3960wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3961wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3962wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3963wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
54f9ee45
RD
3964wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3965wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3966wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3967wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3968wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3969wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3970wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3971wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3972wxEVT_SIZE = _core_.wxEVT_SIZE
3973wxEVT_MOVE = _core_.wxEVT_MOVE
3974wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3975wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3976wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3977wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
54f9ee45
RD
3978wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3979wxEVT_CREATE = _core_.wxEVT_CREATE
3980wxEVT_DESTROY = _core_.wxEVT_DESTROY
3981wxEVT_SHOW = _core_.wxEVT_SHOW
3982wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3983wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3984wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
34e0a3bb 3985wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
54f9ee45
RD
3986wxEVT_PAINT = _core_.wxEVT_PAINT
3987wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3988wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3989wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3990wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3991wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3992wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3993wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3994wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3995wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3996wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3997wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3998wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3999wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
4000wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
4001wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
4002wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
4003wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
4004wxEVT_IDLE = _core_.wxEVT_IDLE
4005wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
4006wxEVT_SIZING = _core_.wxEVT_SIZING
4007wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 4008wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
4009wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
4010wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
4011wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
54f9ee45
RD
4012wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
4013wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
4014wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
4015wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
4016wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
4017wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
4018wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
4019#
4020# Create some event binders
4021EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
4022EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
4023EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
4024EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
4025EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
4026EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4027EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4028EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
4029EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
4030EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
4031EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
4032EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
4033EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 4034EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d14a1e28
RD
4035EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
4036EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
4037EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
4038EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
4039EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
4040EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
4041EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
4042EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
4043EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
4044EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 4045EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d14a1e28
RD
4046EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4047EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4048EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
4049EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
4050EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
4051EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
4052EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
4053EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
4054EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
4055EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
4056EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
4057EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
4058EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
4059EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
4060EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
4061EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
34e0a3bb 4062EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d14a1e28
RD
4063
4064EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
4065EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
4066EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
4067EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
4068EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
4069EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
4070EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
4071EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
4072EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
4073EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
4074EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
4075EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
4076EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
4077
4078EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
4079 wxEVT_LEFT_UP,
4080 wxEVT_MIDDLE_DOWN,
4081 wxEVT_MIDDLE_UP,
4082 wxEVT_RIGHT_DOWN,
4083 wxEVT_RIGHT_UP,
4084 wxEVT_MOTION,
4085 wxEVT_LEFT_DCLICK,
4086 wxEVT_MIDDLE_DCLICK,
4087 wxEVT_RIGHT_DCLICK,
4088 wxEVT_ENTER_WINDOW,
4089 wxEVT_LEAVE_WINDOW,
4090 wxEVT_MOUSEWHEEL
4091 ])
4092
4093
4094# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 4095EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d14a1e28
RD
4096 wxEVT_SCROLLWIN_BOTTOM,
4097 wxEVT_SCROLLWIN_LINEUP,
4098 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 4099 wxEVT_SCROLLWIN_PAGEUP,
d14a1e28
RD
4100 wxEVT_SCROLLWIN_PAGEDOWN,
4101 wxEVT_SCROLLWIN_THUMBTRACK,
4102 wxEVT_SCROLLWIN_THUMBRELEASE,
4103 ])
4104
4105EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
4106EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
4107EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
4108EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
4109EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
4110EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
4111EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
4112EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
4113
27fb7603 4114# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
4115EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4116 wxEVT_SCROLL_BOTTOM,
4117 wxEVT_SCROLL_LINEUP,
4118 wxEVT_SCROLL_LINEDOWN,
4119 wxEVT_SCROLL_PAGEUP,
4120 wxEVT_SCROLL_PAGEDOWN,
4121 wxEVT_SCROLL_THUMBTRACK,
4122 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 4123 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
4124 ])
4125
4126EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
4127EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
4128EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
4129EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
4130EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
4131EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
4132EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
4133EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
4134EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
4135EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 4136
27fb7603 4137# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
4138EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4139 wxEVT_SCROLL_BOTTOM,
4140 wxEVT_SCROLL_LINEUP,
4141 wxEVT_SCROLL_LINEDOWN,
4142 wxEVT_SCROLL_PAGEUP,
4143 wxEVT_SCROLL_PAGEDOWN,
4144 wxEVT_SCROLL_THUMBTRACK,
d14a1e28 4145 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 4146 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
4147 ], 1)
4148
4149EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
4150EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
4151EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
4152EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
4153EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
4154EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
4155EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
4156EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
4157EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
4158EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d14a1e28 4159
d14a1e28
RD
4160EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
4161EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
4162EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
4163EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
4164EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
4165EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
4166EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
4167EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
4168EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
4169EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
4170
4171EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
4172EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
4173EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
4174EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
4175EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
4176EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
4177EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
4178EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
4179EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
4180
4181
4182EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
4183EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
4184EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
4185EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
4186EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
4187EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
4188EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
4189
4190EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4191
4192EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4193EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4194
4195EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4196
2131d850
RD
4197EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
4198EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
4199EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d14a1e28
RD
4200
4201
4202#---------------------------------------------------------------------------
4203
4204class Event(Object):
27fb7603
RD
4205 """
4206 An event is a structure holding information about an event passed to a
4207 callback or member function. wx.Event is an abstract base class for
4208 other event classes
4209 """
0085ce49
RD
4210 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4211 def __init__(self): raise AttributeError, "No constructor defined"
4212 __repr__ = _swig_repr
4213 __swig_destroy__ = _core_.delete_Event
4214 __del__ = lambda self : None;
e811c8ce 4215 def SetEventType(*args, **kwargs):
27fb7603 4216 """
2131d850 4217 SetEventType(self, EventType typ)
27fb7603
RD
4218
4219 Sets the specific type of the event.
4220 """
54f9ee45 4221 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
4222
4223 def GetEventType(*args, **kwargs):
27fb7603 4224 """
2131d850 4225 GetEventType(self) -> EventType
27fb7603
RD
4226
4227 Returns the identifier of the given event type, such as
4228 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4229 """
54f9ee45 4230 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
4231
4232 def GetEventObject(*args, **kwargs):
27fb7603
RD
4233 """
4234 GetEventObject(self) -> Object
4235
4236 Returns the object (usually a window) associated with the event, if
4237 any.
4238 """
54f9ee45 4239 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
4240
4241 def SetEventObject(*args, **kwargs):
27fb7603
RD
4242 """
4243 SetEventObject(self, Object obj)
4244
4245 Sets the originating object, or in other words, obj is normally the
4246 object that is sending the event.
4247 """
54f9ee45 4248 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
4249
4250 def GetTimestamp(*args, **kwargs):
a95a7133 4251 """GetTimestamp(self) -> long"""
54f9ee45 4252 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
4253
4254 def SetTimestamp(*args, **kwargs):
a95a7133 4255 """SetTimestamp(self, long ts=0)"""
54f9ee45 4256 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
4257
4258 def GetId(*args, **kwargs):
27fb7603
RD
4259 """
4260 GetId(self) -> int
4261
4262 Returns the identifier associated with this event, such as a button
4263 command id.
4264 """
54f9ee45 4265 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
4266
4267 def SetId(*args, **kwargs):
27fb7603
RD
4268 """
4269 SetId(self, int Id)
4270
4271 Set's the ID for the event. This is usually the ID of the window that
4272 is sending the event, but it can also be a command id from a menu
4273 item, etc.
4274 """
54f9ee45 4275 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
4276
4277 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4278 """
4279 IsCommandEvent(self) -> bool
4280
4281 Returns true if the event is or is derived from `wx.CommandEvent` else
4282 it returns false. Note: Exists only for optimization purposes.
4283 """
54f9ee45 4284 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
4285
4286 def Skip(*args, **kwargs):
51b83b37
RD
4287 """
4288 Skip(self, bool skip=True)
4289
6b449b19
RD
4290 This method can be used inside an event handler to control whether
4291 further event handlers bound to this event will be called after the
4292 current one returns. Without Skip() (or equivalently if Skip(False) is
4293 used), the event will not be processed any more. If Skip(True) is
4294 called, the event processing system continues searching for a further
4295 handler function for this event, even though it has been processed
4296 already in the current handler.
51b83b37 4297 """
54f9ee45 4298 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
4299
4300 def GetSkipped(*args, **kwargs):
27fb7603
RD
4301 """
4302 GetSkipped(self) -> bool
4303
4304 Returns true if the event handler should be skipped, false otherwise.
4305 :see: `Skip`
4306 """
54f9ee45 4307 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
4308
4309 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4310 """
4311 ShouldPropagate(self) -> bool
4312
4313 Test if this event should be propagated to the parent window or not,
4314 i.e. if the propagation level is currently greater than 0.
4315 """
54f9ee45 4316 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
4317
4318 def StopPropagation(*args, **kwargs):
27fb7603
RD
4319 """
4320 StopPropagation(self) -> int
4321
4322 Stop the event from propagating to its parent window. Returns the old
4323 propagation level value which may be later passed to
4324 `ResumePropagation` to allow propagating the event again.
4325 """
54f9ee45 4326 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
4327
4328 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4329 """
4330 ResumePropagation(self, int propagationLevel)
4331
4332 Resume the event propagation by restoring the propagation level. (For
4333 example, you can use the value returned by an earlier call to
4334 `StopPropagation`.)
4335
4336 """
54f9ee45 4337 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
4338
4339 def Clone(*args, **kwargs):
a95a7133 4340 """Clone(self) -> Event"""
54f9ee45 4341 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 4342
97ab0f6a
RD
4343 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4344 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4345 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4346 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4347 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
2131d850 4348_core_.Event_swigregister(Event)
d14a1e28
RD
4349
4350#---------------------------------------------------------------------------
4351
4352class PropagationDisabler(object):
27fb7603
RD
4353 """
4354 Helper class to temporarily change an event not to propagate. Simply
4355 create an instance of this class and then whe it is destroyed the
4356 propogation of the event will be restored.
4357 """
0085ce49
RD
4358 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4359 __repr__ = _swig_repr
4360 def __init__(self, *args, **kwargs):
27fb7603
RD
4361 """
4362 __init__(self, Event event) -> PropagationDisabler
4363
4364 Helper class to temporarily change an event not to propagate. Simply
4365 create an instance of this class and then whe it is destroyed the
4366 propogation of the event will be restored.
4367 """
0085ce49
RD
4368 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4369 __swig_destroy__ = _core_.delete_PropagationDisabler
4370 __del__ = lambda self : None;
2131d850 4371_core_.PropagationDisabler_swigregister(PropagationDisabler)
d14a1e28
RD
4372
4373class PropagateOnce(object):
27fb7603
RD
4374 """
4375 A helper class that will temporarily lower propagation level of an
4376 event. Simply create an instance of this class and then whe it is
4377 destroyed the propogation of the event will be restored.
4378 """
0085ce49
RD
4379 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4380 __repr__ = _swig_repr
4381 def __init__(self, *args, **kwargs):
27fb7603
RD
4382 """
4383 __init__(self, Event event) -> PropagateOnce
4384
4385 A helper class that will temporarily lower propagation level of an
4386 event. Simply create an instance of this class and then whe it is
4387 destroyed the propogation of the event will be restored.
4388 """
0085ce49
RD
4389 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4390 __swig_destroy__ = _core_.delete_PropagateOnce
4391 __del__ = lambda self : None;
2131d850 4392_core_.PropagateOnce_swigregister(PropagateOnce)
d14a1e28
RD
4393
4394#---------------------------------------------------------------------------
4395
4396class CommandEvent(Event):
27fb7603
RD
4397 """
4398 This event class contains information about command events, which
4399 originate from a variety of simple controls, as well as menus and
4400 toolbars.
4401 """
0085ce49
RD
4402 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4403 __repr__ = _swig_repr
4404 def __init__(self, *args, **kwargs):
27fb7603 4405 """
2131d850 4406 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
4407
4408 This event class contains information about command events, which
4409 originate from a variety of simple controls, as well as menus and
4410 toolbars.
4411 """
0085ce49 4412 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
e811c8ce 4413 def GetSelection(*args, **kwargs):
27fb7603
RD
4414 """
4415 GetSelection(self) -> int
4416
4417 Returns item index for a listbox or choice selection event (not valid
4418 for a deselection).
4419 """
54f9ee45 4420 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
4421
4422 def SetString(*args, **kwargs):
a95a7133 4423 """SetString(self, String s)"""
54f9ee45 4424 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
4425
4426 def GetString(*args, **kwargs):
27fb7603
RD
4427 """
4428 GetString(self) -> String
4429
4430 Returns item string for a listbox or choice selection event (not valid
4431 for a deselection).
4432 """
54f9ee45 4433 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
4434
4435 def IsChecked(*args, **kwargs):
27fb7603
RD
4436 """
4437 IsChecked(self) -> bool
4438
4439 This method can be used with checkbox and menu events: for the
4440 checkboxes, the method returns true for a selection event and false
4441 for a deselection one. For the menu events, this method indicates if
4442 the menu item just has become checked or unchecked (and thus only
4443 makes sense for checkable menu items).
4444 """
54f9ee45 4445 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 4446
242b7b46 4447 Checked = IsChecked
e811c8ce 4448 def IsSelection(*args, **kwargs):
27fb7603
RD
4449 """
4450 IsSelection(self) -> bool
4451
4452 For a listbox or similar event, returns true if it is a selection,
4453 false if it is a deselection.
4454 """
54f9ee45 4455 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
4456
4457 def SetExtraLong(*args, **kwargs):
a95a7133 4458 """SetExtraLong(self, long extraLong)"""
54f9ee45 4459 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
4460
4461 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4462 """
4463 GetExtraLong(self) -> long
4464
5ba5649b
RD
4465 Returns extra information dependant on the event objects type. If the
4466 event comes from a listbox selection, it is a boolean determining
4467 whether the event was a selection (true) or a deselection (false). A
4468 listbox deselection only occurs for multiple-selection boxes, and in
4469 this case the index and string values are indeterminate and the
4470 listbox must be examined by the application.
27fb7603 4471 """
54f9ee45 4472 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
4473
4474 def SetInt(*args, **kwargs):
a95a7133 4475 """SetInt(self, int i)"""
54f9ee45 4476 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
4477
4478 def GetInt(*args, **kwargs):
27fb7603 4479 """
01f6b6d3 4480 GetInt(self) -> int
27fb7603 4481
5ba5649b
RD
4482 Returns the integer identifier corresponding to a listbox, choice or
4483 radiobox selection (only if the event was a selection, not a
4484 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4485 """
54f9ee45 4486 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce 4487
0085ce49
RD
4488 def GetClientData(*args, **kwargs):
4489 """
4490 GetClientData(self) -> PyObject
4491
4492 Returns the client data object for a listbox or choice selection event, (if any.)
4493 """
4494 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4495
4496 def SetClientData(*args, **kwargs):
4497 """
4498 SetClientData(self, PyObject clientData)
4499
4500 Associate the given client data with the item at position n.
4501 """
4502 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4503
4504 GetClientObject = GetClientData
4505 SetClientObject = SetClientData
4506
e811c8ce 4507 def Clone(*args, **kwargs):
a95a7133 4508 """Clone(self) -> Event"""
54f9ee45 4509 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 4510
2bf58437
RD
4511 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4512 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4513 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4514 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4515 Selection = property(GetSelection,doc="See `GetSelection`")
4516 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
2131d850 4517_core_.CommandEvent_swigregister(CommandEvent)
d14a1e28
RD
4518
4519#---------------------------------------------------------------------------
4520
4521class NotifyEvent(CommandEvent):
27fb7603
RD
4522 """
4523 An instance of this class (or one of its derived classes) is sent from
4524 a control when the control's state is being changed and the control
4525 allows that change to be prevented from happening. The event handler
4526 can call `Veto` or `Allow` to tell the control what to do.
4527 """
0085ce49
RD
4528 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4529 __repr__ = _swig_repr
4530 def __init__(self, *args, **kwargs):
27fb7603 4531 """
2131d850 4532 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4533
4534 An instance of this class (or one of its derived classes) is sent from
4535 a control when the control's state is being changed and the control
4536 allows that change to be prevented from happening. The event handler
4537 can call `Veto` or `Allow` to tell the control what to do.
4538 """
0085ce49 4539 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
e811c8ce 4540 def Veto(*args, **kwargs):
27fb7603
RD
4541 """
4542 Veto(self)
4543
4544 Prevents the change announced by this event from happening.
4545
4546 It is in general a good idea to notify the user about the reasons for
4547 vetoing the change because otherwise the applications behaviour (which
4548 just refuses to do what the user wants) might be quite surprising.
4549 """
54f9ee45 4550 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
4551
4552 def Allow(*args, **kwargs):
27fb7603
RD
4553 """
4554 Allow(self)
4555
4556 This is the opposite of `Veto`: it explicitly allows the event to be
4557 processed. For most events it is not necessary to call this method as
4558 the events are allowed anyhow but some are forbidden by default (this
4559 will be mentioned in the corresponding event description).
4560 """
54f9ee45 4561 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
4562
4563 def IsAllowed(*args, **kwargs):
27fb7603
RD
4564 """
4565 IsAllowed(self) -> bool
4566
4567 Returns true if the change is allowed (`Veto` hasn't been called) or
4568 false otherwise (if it was).
4569 """
54f9ee45 4570 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 4571
2131d850 4572_core_.NotifyEvent_swigregister(NotifyEvent)
d14a1e28
RD
4573
4574#---------------------------------------------------------------------------
4575
4576class ScrollEvent(CommandEvent):
27fb7603
RD
4577 """
4578 A scroll event holds information about events sent from stand-alone
4579 scrollbars and sliders. Note that scrolled windows do not send
cbfc9df6 4580 instances of this event class, but send the `wx.ScrollWinEvent`
27fb7603
RD
4581 instead.
4582 """
0085ce49
RD
4583 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4584 __repr__ = _swig_repr
4585 def __init__(self, *args, **kwargs):
0df68c9f 4586 """
2131d850 4587 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
4588 int orient=0) -> ScrollEvent
4589 """
0085ce49 4590 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
e811c8ce 4591 def GetOrientation(*args, **kwargs):
27fb7603
RD
4592 """
4593 GetOrientation(self) -> int
4594
4595 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4596 the scrollbar.
4597 """
54f9ee45 4598 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4599
4600 def GetPosition(*args, **kwargs):
27fb7603
RD
4601 """
4602 GetPosition(self) -> int
4603
4604 Returns the position of the scrollbar.
4605 """
54f9ee45 4606 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4607
4608 def SetOrientation(*args, **kwargs):
a95a7133 4609 """SetOrientation(self, int orient)"""
54f9ee45 4610 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4611
4612 def SetPosition(*args, **kwargs):
a95a7133 4613 """SetPosition(self, int pos)"""
54f9ee45 4614 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 4615
33d6fd3b
RD
4616 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4617 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4618_core_.ScrollEvent_swigregister(ScrollEvent)
d14a1e28
RD
4619
4620#---------------------------------------------------------------------------
4621
4622class ScrollWinEvent(Event):
27fb7603
RD
4623 """
4624 A wx.ScrollWinEvent holds information about scrolling and is sent from
4625 scrolling windows.
4626 """
0085ce49
RD
4627 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4628 __repr__ = _swig_repr
4629 def __init__(self, *args, **kwargs):
27fb7603 4630 """
2131d850 4631 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4632
4633 A wx.ScrollWinEvent holds information about scrolling and is sent from
4634 scrolling windows.
4635 """
0085ce49 4636 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
e811c8ce 4637 def GetOrientation(*args, **kwargs):
27fb7603
RD
4638 """
4639 GetOrientation(self) -> int
4640
4641 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4642 the scrollbar.
4643 """
54f9ee45 4644 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4645
4646 def GetPosition(*args, **kwargs):
27fb7603
RD
4647 """
4648 GetPosition(self) -> int
4649
4650 Returns the position of the scrollbar for the thumb track and release
4651 events. Note that this field can't be used for the other events, you
4652 need to query the window itself for the current position in that case.
4653 """
54f9ee45 4654 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4655
4656 def SetOrientation(*args, **kwargs):
a95a7133 4657 """SetOrientation(self, int orient)"""
54f9ee45 4658 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4659
4660 def SetPosition(*args, **kwargs):
a95a7133 4661 """SetPosition(self, int pos)"""
54f9ee45 4662 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 4663
33d6fd3b
RD
4664 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4665 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4666_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d14a1e28
RD
4667
4668#---------------------------------------------------------------------------
4669
54f9ee45
RD
4670MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4671MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4672MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4673MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4674MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 4675class MouseEvent(Event):
27fb7603
RD
4676 """
4677 This event class contains information about the events generated by
4678 the mouse: they include mouse buttons press and release events and
4679 mouse move events.
4680
4681 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4682 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4683 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4684 a middle button so a portable application should avoid relying on the
4685 events from it.
4686
4687 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4688 the former returns true when the event corresponds to the left mouse
4689 button click while the latter returns true if the left mouse button is
4690 currently being pressed. For example, when the user is dragging the
4691 mouse you can use `LeftIsDown` to test whether the left mouse button
4692 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4693 `LeftIsDown` will also return true in wxWidgets whatever the
4694 underlying GUI behaviour is (which is platform-dependent). The same
4695 applies, of course, to other mouse buttons as well.
4696 """
0085ce49
RD
4697 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4698 __repr__ = _swig_repr
4699 def __init__(self, *args, **kwargs):
27fb7603 4700 """
2131d850 4701 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4702
4703 Constructs a wx.MouseEvent. Valid event types are:
4704
4705 * wxEVT_ENTER_WINDOW
4706 * wxEVT_LEAVE_WINDOW
4707 * wxEVT_LEFT_DOWN
4708 * wxEVT_LEFT_UP
4709 * wxEVT_LEFT_DCLICK
4710 * wxEVT_MIDDLE_DOWN
4711 * wxEVT_MIDDLE_UP
4712 * wxEVT_MIDDLE_DCLICK
4713 * wxEVT_RIGHT_DOWN
4714 * wxEVT_RIGHT_UP
4715 * wxEVT_RIGHT_DCLICK
4716 * wxEVT_MOTION
4717 * wxEVT_MOUSEWHEEL
4718 """
0085ce49 4719 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
e811c8ce 4720 def IsButton(*args, **kwargs):
27fb7603
RD
4721 """
4722 IsButton(self) -> bool
4723
4724 Returns true if the event was a mouse button event (not necessarily a
4725 button down event - that may be tested using `ButtonDown`).
4726 """
54f9ee45 4727 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
4728
4729 def ButtonDown(*args, **kwargs):
27fb7603
RD
4730 """
4731 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4732
5ba5649b
RD
4733 If the argument is omitted, this returns true if the event was any
4734 mouse button down event. Otherwise the argument specifies which
4735 button-down event shold be checked for (see `Button` for the possible
4736 values).
27fb7603 4737 """
54f9ee45 4738 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
4739
4740 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4741 """
4742 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4743
4744 If the argument is omitted, this returns true if the event was any
4745 mouse double click event. Otherwise the argument specifies which
4746 double click event to check for (see `Button` for the possible
4747 values).
4748 """
54f9ee45 4749 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
4750
4751 def ButtonUp(*args, **kwargs):
27fb7603
RD
4752 """
4753 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4754
4755 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4756 mouse button up event. Otherwise the argument specifies which button
4757 up event to check for (see `Button` for the possible values).
27fb7603 4758 """
54f9ee45 4759 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
4760
4761 def Button(*args, **kwargs):
27fb7603
RD
4762 """
4763 Button(self, int button) -> bool
4764
4765 Returns true if the identified mouse button is changing state. Valid
4766 values of button are:
4767
4768 ==================== =====================================
4769 wx.MOUSE_BTN_LEFT check if left button was pressed
4770 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4771 wx.MOUSE_BTN_RIGHT check if right button was pressed
4772 wx.MOUSE_BTN_ANY check if any button was pressed
4773 ==================== =====================================
4774
4775 """
54f9ee45 4776 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
4777
4778 def ButtonIsDown(*args, **kwargs):
a95a7133 4779 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 4780 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
4781
4782 def GetButton(*args, **kwargs):
27fb7603
RD
4783 """
4784 GetButton(self) -> int
4785
4786 Returns the mouse button which generated this event or
4787 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4788 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4789 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4790 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4791 right buttons respectively.
4792 """
54f9ee45 4793 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
4794
4795 def ControlDown(*args, **kwargs):
27fb7603
RD
4796 """
4797 ControlDown(self) -> bool
4798
4799 Returns true if the control key was down at the time of the event.
4800 """
54f9ee45 4801 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4802
4803 def MetaDown(*args, **kwargs):
27fb7603
RD
4804 """
4805 MetaDown(self) -> bool
4806
4807 Returns true if the Meta key was down at the time of the event.
4808 """
54f9ee45 4809 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4810
4811 def AltDown(*args, **kwargs):
27fb7603
RD
4812 """
4813 AltDown(self) -> bool
4814
4815 Returns true if the Alt key was down at the time of the event.
4816 """
54f9ee45 4817 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4818
4819 def ShiftDown(*args, **kwargs):
27fb7603
RD
4820 """
4821 ShiftDown(self) -> bool
4822
4823 Returns true if the Shift key was down at the time of the event.
4824 """
54f9ee45 4825 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 4826
412d302d
RD
4827 def CmdDown(*args, **kwargs):
4828 """
4829 CmdDown(self) -> bool
4830
4831 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4832 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4833 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4834 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4835 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4836 purpose. So for non-Mac platforms this is the same as `ControlDown`
4837 and Macs this is the same as `MetaDown`.
4838 """
4839 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4840
e811c8ce 4841 def LeftDown(*args, **kwargs):
27fb7603
RD
4842 """
4843 LeftDown(self) -> bool
4844
4845 Returns true if the left mouse button state changed to down.
4846 """
54f9ee45 4847 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
4848
4849 def MiddleDown(*args, **kwargs):
27fb7603
RD
4850 """
4851 MiddleDown(self) -> bool
4852
4853 Returns true if the middle mouse button state changed to down.
4854 """
54f9ee45 4855 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
4856
4857 def RightDown(*args, **kwargs):
27fb7603
RD
4858 """
4859 RightDown(self) -> bool
4860
4861 Returns true if the right mouse button state changed to down.
4862 """
54f9ee45 4863 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
4864
4865 def LeftUp(*args, **kwargs):
27fb7603
RD
4866 """
4867 LeftUp(self) -> bool
4868
4869 Returns true if the left mouse button state changed to up.
4870 """
54f9ee45 4871 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
4872
4873 def MiddleUp(*args, **kwargs):
27fb7603
RD
4874 """
4875 MiddleUp(self) -> bool
4876
4877 Returns true if the middle mouse button state changed to up.
4878 """
54f9ee45 4879 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
4880
4881 def RightUp(*args, **kwargs):
27fb7603
RD
4882 """
4883 RightUp(self) -> bool
4884
4885 Returns true if the right mouse button state changed to up.
4886 """
54f9ee45 4887 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
4888
4889 def LeftDClick(*args, **kwargs):
27fb7603
RD
4890 """
4891 LeftDClick(self) -> bool
4892
4893 Returns true if the event was a left button double click.
4894 """
54f9ee45 4895 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
4896
4897 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4898 """
4899 MiddleDClick(self) -> bool
4900
4901 Returns true if the event was a middle button double click.
4902 """
54f9ee45 4903 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
4904
4905 def RightDClick(*args, **kwargs):
27fb7603
RD
4906 """
4907 RightDClick(self) -> bool
4908
4909 Returns true if the event was a right button double click.
4910 """
54f9ee45 4911 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
4912
4913 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4914 """
4915 LeftIsDown(self) -> bool
4916
4917 Returns true if the left mouse button is currently down, independent
4918 of the current event type.
4919
4920 Please notice that it is not the same as LeftDown which returns true
4921 if the left mouse button was just pressed. Rather, it describes the
4922 state of the mouse button before the event happened.
4923
4924 This event is usually used in the mouse event handlers which process
4925 "move mouse" messages to determine whether the user is (still)
4926 dragging the mouse.
4927 """
54f9ee45 4928 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
4929
4930 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4931 """
4932 MiddleIsDown(self) -> bool
4933
4934 Returns true if the middle mouse button is currently down, independent
4935 of the current event type.
4936 """
54f9ee45 4937 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
4938
4939 def RightIsDown(*args, **kwargs):
27fb7603
RD
4940 """
4941 RightIsDown(self) -> bool
4942
4943 Returns true if the right mouse button is currently down, independent
4944 of the current event type.
4945 """
54f9ee45 4946 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
4947
4948 def Dragging(*args, **kwargs):
27fb7603
RD
4949 """
4950 Dragging(self) -> bool
4951
4952 Returns true if this was a dragging event (motion while a button is
4953 depressed).
4954 """
54f9ee45 4955 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
4956
4957 def Moving(*args, **kwargs):
27fb7603
RD
4958 """
4959 Moving(self) -> bool
4960
4961 Returns true if this was a motion event and no mouse buttons were
4962 pressed. If any mouse button is held pressed, then this method returns
4963 false and Dragging returns true.
4964 """
54f9ee45 4965 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
4966
4967 def Entering(*args, **kwargs):
27fb7603
RD
4968 """
4969 Entering(self) -> bool
4970
4971 Returns true if the mouse was entering the window.
4972 """
54f9ee45 4973 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
4974
4975 def Leaving(*args, **kwargs):
27fb7603
RD
4976 """
4977 Leaving(self) -> bool
4978
4979 Returns true if the mouse was leaving the window.
4980 """
54f9ee45 4981 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
4982
4983 def GetPosition(*args, **kwargs):
0df68c9f 4984 """
a95a7133 4985 GetPosition(self) -> Point
e811c8ce 4986
27fb7603
RD
4987 Returns the pixel position of the mouse in window coordinates when the
4988 event happened.
0df68c9f 4989 """
54f9ee45 4990 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4991
4992 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4993 """
4994 GetPositionTuple() -> (x,y)
e811c8ce 4995
27fb7603
RD
4996 Returns the pixel position of the mouse in window coordinates when the
4997 event happened.
0df68c9f 4998 """
54f9ee45 4999 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
5000
5001 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
5002 """
5003 GetLogicalPosition(self, DC dc) -> Point
5004
5005 Returns the logical mouse position in pixels (i.e. translated
5006 according to the translation set for the DC, which usually indicates
5007 that the window has been scrolled).
5008 """
54f9ee45 5009 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
5010
5011 def GetX(*args, **kwargs):
27fb7603
RD
5012 """
5013 GetX(self) -> int
5014
5015 Returns X coordinate of the physical mouse event position.
5016 """
54f9ee45 5017 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
5018
5019 def GetY(*args, **kwargs):
27fb7603
RD
5020 """
5021 GetY(self) -> int
5022
5023 Returns Y coordinate of the physical mouse event position.
5024 """
54f9ee45 5025 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
5026
5027 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
5028 """
5029 GetWheelRotation(self) -> int
5030
5031 Get wheel rotation, positive or negative indicates direction of
5032 rotation. Current devices all send an event when rotation is equal to
5033 +/-WheelDelta, but this allows for finer resolution devices to be
5034 created in the future. Because of this you shouldn't assume that one
5035 event is equal to 1 line or whatever, but you should be able to either
5036 do partial line scrolling or wait until +/-WheelDelta rotation values
5037 have been accumulated before scrolling.
5038 """
54f9ee45 5039 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
5040
5041 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
5042 """
5043 GetWheelDelta(self) -> int
5044
5045 Get wheel delta, normally 120. This is the threshold for action to be
5046 taken, and one such action (for example, scrolling one increment)
5047 should occur for each delta.
5048 """
54f9ee45 5049 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce 5050
4976f996
RD
5051 def GetWheelAxis(*args, **kwargs):
5052 """
5053 GetWheelAxis(self) -> int
5054
5055 Gets the axis the wheel operation concerns, 0 being the y axis as on
5056 most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
5057 or horizontal trackpad scrolling.
5058 """
5059 return _core_.MouseEvent_GetWheelAxis(*args, **kwargs)
5060
e811c8ce 5061 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
5062 """
5063 GetLinesPerAction(self) -> int
5064
5065 Returns the configured number of lines (or whatever) to be scrolled
5066 per wheel action. Defaults to three.
5067 """
54f9ee45 5068 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
5069
5070 def IsPageScroll(*args, **kwargs):
27fb7603
RD
5071 """
5072 IsPageScroll(self) -> bool
5073
5074 Returns true if the system has been setup to do page scrolling with
5075 the mouse wheel instead of line scrolling.
5076 """
54f9ee45
RD
5077 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
5078
5079 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
5080 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
5081 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
5082 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
5083 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
5084 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
5085 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
5086 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
5087 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
5088 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
5089 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
5090 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
57332a5a
RD
5091 Button = property(GetButton,doc="See `GetButton`")
5092 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
5093 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
5094 Position = property(GetPosition,doc="See `GetPosition`")
5095 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
5096 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
5097 X = property(GetX,doc="See `GetX`")
5098 Y = property(GetY,doc="See `GetY`")
2131d850 5099_core_.MouseEvent_swigregister(MouseEvent)
d14a1e28
RD
5100
5101#---------------------------------------------------------------------------
5102
5103class SetCursorEvent(Event):
5ba5649b
RD
5104 """
5105 A SetCursorEvent is generated when the mouse cursor is about to be set
5106 as a result of mouse motion. This event gives the application the
5107 chance to perform specific mouse cursor processing based on the
5108 current position of the mouse within the window. Use the `SetCursor`
5109 method to specify the cursor you want to be displayed.
5110 """
0085ce49
RD
5111 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5112 __repr__ = _swig_repr
5113 def __init__(self, *args, **kwargs):
5ba5649b
RD
5114 """
5115 __init__(self, int x=0, int y=0) -> SetCursorEvent
5116
5117 Construct a new `wx.SetCursorEvent`.
5118 """
0085ce49 5119 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
e811c8ce 5120 def GetX(*args, **kwargs):
5ba5649b
RD
5121 """
5122 GetX(self) -> int
5123
5124 Returns the X coordinate of the mouse in client coordinates.
5125 """
54f9ee45 5126 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
5127
5128 def GetY(*args, **kwargs):
5ba5649b
RD
5129 """
5130 GetY(self) -> int
5131
5132 Returns the Y coordinate of the mouse in client coordinates.
5133 """
54f9ee45 5134 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
5135
5136 def SetCursor(*args, **kwargs):
5ba5649b
RD
5137 """
5138 SetCursor(self, Cursor cursor)
5139
5140 Sets the cursor associated with this event.
5141 """
54f9ee45 5142 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
5143
5144 def GetCursor(*args, **kwargs):
5ba5649b
RD
5145 """
5146 GetCursor(self) -> Cursor
5147
5148 Returns a reference to the cursor specified by this event.
5149 """
54f9ee45 5150 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
5151
5152 def HasCursor(*args, **kwargs):
5ba5649b
RD
5153 """
5154 HasCursor(self) -> bool
5155
5156 Returns true if the cursor specified by this event is a valid cursor.
5157 """
54f9ee45 5158 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 5159
33d6fd3b
RD
5160 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
5161 X = property(GetX,doc="See `GetX`")
5162 Y = property(GetY,doc="See `GetY`")
2131d850 5163_core_.SetCursorEvent_swigregister(SetCursorEvent)
d14a1e28
RD
5164
5165#---------------------------------------------------------------------------
5166
5167class KeyEvent(Event):
5ba5649b
RD
5168 """
5169 This event class contains information about keypress and character
5170 events. These events are only sent to the widget that currently has
5171 the keyboard focus.
5172
5173 Notice that there are three different kinds of keyboard events in
5174 wxWidgets: key down and up events and char events. The difference
5175 between the first two is clear - the first corresponds to a key press
5176 and the second to a key release - otherwise they are identical. Just
5177 note that if the key is maintained in a pressed state you will
5178 typically get a lot of (automatically generated) down events but only
5179 one up so it is wrong to assume that there is one up event
5180 corresponding to each down one.
5181
5182 Both key events provide untranslated key codes while the char event
5183 carries the translated one. The untranslated code for alphanumeric
5184 keys is always an upper case value. For the other keys it is one of
5185 WXK_XXX values from the keycodes table. The translated key is, in
5186 general, the character the user expects to appear as the result of the
5187 key combination when typing the text into a text entry zone, for
5188 example.
5189
5190 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5191 and the standard US keyboard): when the 'A' key is pressed, the key
5192 down event key code is equal to ASCII A == 65. But the char event key
5193 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5194 'A' keys simultaneously , the key code in key down event will still be
5195 just 'A' while the char event key code parameter will now be 'A' as
5196 well.
5197
5198 Although in this simple case it is clear that the correct key code
5199 could be found in the key down event handler by checking the value
5200 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5201 as for non alphanumeric keys or non-US keyboard layouts the
5202 translation is keyboard-layout dependent and can only be done properly
5203 by the system itself.
5204
5205 Another kind of translation is done when the control key is pressed:
5206 for example, for CTRL-A key press the key down event still carries the
5207 same key code 'A' as usual but the char event will have key code of 1,
5208 the ASCII value of this key combination.
5209
5210 You may discover how the other keys on your system behave
5211 interactively by running the KeyEvents sample in the wxPython demo and
5212 pressing some keys while the blue box at the top has the keyboard
5213 focus.
5214
5215 **Note**: If a key down event is caught and the event handler does not
5216 call event.Skip() then the coresponding char event will not
5217 happen. This is by design and enables the programs that handle both
5218 types of events to be a bit simpler.
5219
5220 **Note for Windows programmers**: The key and char events in wxWidgets
5221 are similar to but slightly different from Windows WM_KEYDOWN and
5222 WM_CHAR events. In particular, Alt-x combination will generate a char
5223 event in wxWidgets (unless it is used as an accelerator).
5224
5225 **Tip**: be sure to call event.Skip() for events that you don't
5226 process in key event function, otherwise menu shortcuts may cease to
5227 work under Windows.
5228
5229 """
0085ce49
RD
5230 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5231 __repr__ = _swig_repr
5232 def __init__(self, *args, **kwargs):
5ba5649b 5233 """
2131d850 5234 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
5235
5236 Construct a new `wx.KeyEvent`. Valid event types are:
5237 *
5238 """
0085ce49 5239 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
5240 def GetModifiers(*args, **kwargs):
5241 """
5242 GetModifiers(self) -> int
5243
5244 Returns a bitmask of the current modifier settings. Can be used to
5245 check if the key event has exactly the given modifiers without having
5246 to explicitly check that the other modifiers are not down. For
5247 example::
5248
5249 if event.GetModifers() == wx.MOD_CONTROL:
5250 DoSomething()
5251
5252 """
5253 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
5254
e811c8ce 5255 def ControlDown(*args, **kwargs):
5ba5649b
RD
5256 """
5257 ControlDown(self) -> bool
5258
5259 Returns ``True`` if the Control key was down at the time of the event.
5260 """
54f9ee45 5261 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
5262
5263 def MetaDown(*args, **kwargs):
5ba5649b
RD
5264 """
5265 MetaDown(self) -> bool
5266
5267 Returns ``True`` if the Meta key was down at the time of the event.
5268 """
54f9ee45 5269 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
5270
5271 def AltDown(*args, **kwargs):
5ba5649b
RD
5272 """
5273 AltDown(self) -> bool
5274
5275 Returns ``True`` if the Alt key was down at the time of the event.
5276 """
54f9ee45 5277 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
5278
5279 def ShiftDown(*args, **kwargs):
5ba5649b
RD
5280 """
5281 ShiftDown(self) -> bool
5282
5283 Returns ``True`` if the Shift key was down at the time of the event.
5284 """
54f9ee45 5285 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 5286
412d302d
RD
5287 def CmdDown(*args, **kwargs):
5288 """
5289 CmdDown(self) -> bool
5290
5291 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5292 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5293 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5294 because Cmd key is used for the same thing under Mac as Ctrl
5295 elsewhere. The Ctrl still exists, it's just not used for this
5296 purpose. So for non-Mac platforms this is the same as `ControlDown`
5297 and Macs this is the same as `MetaDown`.
5298 """
5299 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5300
e811c8ce 5301 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5302 """
5303 HasModifiers(self) -> bool
5304
5305 Returns true if either CTRL or ALT keys was down at the time of the
5306 key event. Note that this function does not take into account neither
5307 SHIFT nor META key states (the reason for ignoring the latter is that
5308 it is common for NUMLOCK key to be configured as META under X but the
5309 key presses even while NUMLOCK is on should be still processed
5310 normally).
5311 """
54f9ee45 5312 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
5313
5314 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5315 """
5316 GetKeyCode(self) -> int
5317
5318 Returns the virtual key code. ASCII events return normal ASCII values,
5319 while non-ASCII events return values such as WXK_LEFT for the left
5320 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5321 codes.
5322
5323 Note that in Unicode build, the returned value is meaningful only if
5324 the user entered a character that can be represented in current
5325 locale's default charset. You can obtain the corresponding Unicode
5326 character using `GetUnicodeKey`.
5327 """
54f9ee45 5328 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 5329
19272049 5330 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5331 """
5332 GetUnicodeKey(self) -> int
5333
5334 Returns the Unicode character corresponding to this key event. This
5335 function is only meaningfule in a Unicode build of wxPython.
5336 """
19272049 5337 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 5338
19272049 5339 GetUniChar = GetUnicodeKey
b850e7f3
RD
5340 def SetUnicodeKey(*args, **kwargs):
5341 """
5342 SetUnicodeKey(self, int uniChar)
5343
5344 Set the Unicode value of the key event, but only if this is a Unicode
5345 build of wxPython.
5346 """
5347 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5348
e811c8ce 5349 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5350 """
5351 GetRawKeyCode(self) -> unsigned int
5352
5353 Returns the raw key code for this event. This is a platform-dependent
5354 scan code which should only be used in advanced
5355 applications. Currently the raw key codes are not supported by all
5356 ports.
5357 """
54f9ee45 5358 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
5359
5360 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5361 """
5362 GetRawKeyFlags(self) -> unsigned int
5363
5364 Returns the low level key flags for this event. The flags are
5365 platform-dependent and should only be used in advanced applications.
5366 Currently the raw key flags are not supported by all ports.
5367 """
54f9ee45 5368 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
5369
5370 def GetPosition(*args, **kwargs):
0df68c9f 5371 """
a95a7133 5372 GetPosition(self) -> Point
e811c8ce 5373
5ba5649b 5374 Find the position of the event, if applicable.
0df68c9f 5375 """
54f9ee45 5376 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5377
5378 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
5379 """
5380 GetPositionTuple() -> (x,y)
e811c8ce 5381
5ba5649b 5382 Find the position of the event, if applicable.
0df68c9f 5383 """
54f9ee45 5384 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
5385
5386 def GetX(*args, **kwargs):
5ba5649b
RD
5387 """
5388 GetX(self) -> int
5389
5390 Returns the X position (in client coordinates) of the event, if
5391 applicable.
5392 """
54f9ee45 5393 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
5394
5395 def GetY(*args, **kwargs):
5ba5649b
RD
5396 """
5397 GetY(self) -> int
5398
5399 Returns the Y position (in client coordinates) of the event, if
5400 applicable.
5401 """
54f9ee45
RD
5402 return _core_.KeyEvent_GetY(*args, **kwargs)
5403
5404 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5405 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5406 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5407 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5408 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5409 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5410 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5411 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5412 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5413 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
97ab0f6a
RD
5414 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5415 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5416 Position = property(GetPosition,doc="See `GetPosition`")
5417 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5418 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5419 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5420 X = property(GetX,doc="See `GetX`")
5421 Y = property(GetY,doc="See `GetY`")
2131d850 5422_core_.KeyEvent_swigregister(KeyEvent)
d14a1e28
RD
5423
5424#---------------------------------------------------------------------------
5425
5426class SizeEvent(Event):
5ba5649b
RD
5427 """
5428 A size event holds information about size change events. The EVT_SIZE
5429 handler function will be called when the window it is bound to has
5430 been resized.
5431
5432 Note that the size passed is of the whole window: call
5433 `wx.Window.GetClientSize` for the area which may be used by the
5434 application.
5435
5436 When a window is resized, usually only a small part of the window is
5437 damaged and and that area is all that is in the update region for the
5438 next paint event. However, if your drawing depends on the size of the
5439 window, you may need to clear the DC explicitly and repaint the whole
5440 window. In which case, you may need to call `wx.Window.Refresh` to
5441 invalidate the entire window.
5442
5443 """
0085ce49
RD
5444 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5445 __repr__ = _swig_repr
5446 def __init__(self, *args, **kwargs):
5ba5649b
RD
5447 """
5448 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5449
5450 Construct a new ``wx.SizeEvent``.
5451 """
0085ce49 5452 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
e811c8ce 5453 def GetSize(*args, **kwargs):
5ba5649b
RD
5454 """
5455 GetSize(self) -> Size
5456
5457 Returns the entire size of the window generating the size change
5458 event.
5459 """
54f9ee45 5460 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
5461
5462 def GetRect(*args, **kwargs):
a95a7133 5463 """GetRect(self) -> Rect"""
54f9ee45 5464 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5465
5466 def SetRect(*args, **kwargs):
a95a7133 5467 """SetRect(self, Rect rect)"""
54f9ee45 5468 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5469
5470 def SetSize(*args, **kwargs):
a95a7133 5471 """SetSize(self, Size size)"""
54f9ee45 5472 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 5473
54f9ee45
RD
5474 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5475 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
33d6fd3b
RD
5476 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5477 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
2131d850 5478_core_.SizeEvent_swigregister(SizeEvent)
d14a1e28
RD
5479
5480#---------------------------------------------------------------------------
5481
5482class MoveEvent(Event):
5ba5649b
RD
5483 """
5484 This event object is sent for EVT_MOVE event bindings when a window is
5485 moved to a new position.
5486 """
0085ce49
RD
5487 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5488 __repr__ = _swig_repr
5489 def __init__(self, *args, **kwargs):
5ba5649b
RD
5490 """
5491 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5492
5493 Constructor.
5494 """
0085ce49 5495 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
e811c8ce 5496 def GetPosition(*args, **kwargs):
5ba5649b
RD
5497 """
5498 GetPosition(self) -> Point
5499
5500 Returns the position of the window generating the move change event.
5501 """
54f9ee45 5502 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5503
5504 def GetRect(*args, **kwargs):
a95a7133 5505 """GetRect(self) -> Rect"""
54f9ee45 5506 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5507
5508 def SetRect(*args, **kwargs):
a95a7133 5509 """SetRect(self, Rect rect)"""
54f9ee45 5510 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5511
5512 def SetPosition(*args, **kwargs):
a95a7133 5513 """SetPosition(self, Point pos)"""
54f9ee45 5514 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 5515
7557b9b5
RD
5516 m_pos = property(GetPosition, SetPosition)
5517 m_rect = property(GetRect, SetRect)
5518
57332a5a
RD
5519 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5520 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
2131d850 5521_core_.MoveEvent_swigregister(MoveEvent)
d14a1e28
RD
5522
5523#---------------------------------------------------------------------------
5524
5525class PaintEvent(Event):
5ba5649b
RD
5526 """
5527 A paint event is sent when a window's contents needs to be repainted.
5528 Note that in an EVT_PAINT handler the application must *always* create
5529 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5530 Windows assumes that the window has not been painted yet and will send
5531 the event again, causing endless refreshes.
5532
5533 You can optimize painting by retrieving the rectangles that have been
5534 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5535 and only repainting these rectangles. The rectangles are in terms of
5536 the client area, and are unscrolled, so you will need to do some
5537 calculations using the current view position to obtain logical,
5538 scrolled units.
5539
5540 """
0085ce49
RD
5541 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5542 __repr__ = _swig_repr
5543 def __init__(self, *args, **kwargs):
a95a7133 5544 """__init__(self, int Id=0) -> PaintEvent"""
0085ce49 5545 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5546_core_.PaintEvent_swigregister(PaintEvent)
d14a1e28
RD
5547
5548class NcPaintEvent(Event):
093d3ff1 5549 """Proxy of C++ NcPaintEvent class"""
0085ce49
RD
5550 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5551 __repr__ = _swig_repr
5552 def __init__(self, *args, **kwargs):
a95a7133 5553 """__init__(self, int winid=0) -> NcPaintEvent"""
0085ce49 5554 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5555_core_.NcPaintEvent_swigregister(NcPaintEvent)
d14a1e28
RD
5556
5557#---------------------------------------------------------------------------
5558
5559class EraseEvent(Event):
5ba5649b
RD
5560 """
5561 An erase event is sent whenever the background of a window needs to be
5562 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5563 binder. On some platforms, such as GTK+, this event is simulated
5564 (simply generated just before the paint event) and may cause flicker.
5565
5566 To paint a custom background use the `GetDC` method and use the returned
5567 device context if it is not ``None``, otherwise create a temporary
5568 `wx.ClientDC` and draw on that.
5569
5570 """
0085ce49
RD
5571 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5572 __repr__ = _swig_repr
5573 def __init__(self, *args, **kwargs):
5ba5649b
RD
5574 """
5575 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5576
5577 Constructor
5578 """
0085ce49 5579 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
e811c8ce 5580 def GetDC(*args, **kwargs):
5ba5649b
RD
5581 """
5582 GetDC(self) -> DC
5583
5584 Returns the device context the event handler should draw upon. If
5585 ``None`` is returned then create a temporary `wx.ClientDC` and use
5586 that instead.
5587 """
54f9ee45 5588 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 5589
97ab0f6a 5590 DC = property(GetDC,doc="See `GetDC`")
2131d850 5591_core_.EraseEvent_swigregister(EraseEvent)
d14a1e28
RD
5592
5593#---------------------------------------------------------------------------
5594
5595class FocusEvent(Event):
5ba5649b
RD
5596 """
5597 A focus event is sent when a window's focus changes. The window losing
5598 focus receives an EVT_KILL_FOCUS event while the window gaining it
5599 gets an EVT_SET_FOCUS event.
5600
5601 Notice that the set focus event happens both when the user gives focus
5602 to the window (whether using the mouse or keyboard) and when it is
5603 done from the program itself using `wx.Window.SetFocus`.
5604
5605 """
0085ce49
RD
5606 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5607 __repr__ = _swig_repr
5608 def __init__(self, *args, **kwargs):
5ba5649b 5609 """
2131d850 5610 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5611
5612 Constructor
5613 """
0085ce49 5614 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
e811c8ce 5615 def GetWindow(*args, **kwargs):
5ba5649b
RD
5616 """
5617 GetWindow(self) -> Window
5618
5619 Returns the other window associated with this event, that is the
5620 window which had the focus before for the EVT_SET_FOCUS event and the
5621 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5622
5623 Warning: the window returned may be None!
5624 """
54f9ee45 5625 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
5626
5627 def SetWindow(*args, **kwargs):
a95a7133 5628 """SetWindow(self, Window win)"""
54f9ee45 5629 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 5630
97ab0f6a 5631 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 5632_core_.FocusEvent_swigregister(FocusEvent)
d14a1e28
RD
5633
5634#---------------------------------------------------------------------------
5635
5636class ChildFocusEvent(CommandEvent):
5ba5649b 5637 """
33d6fd3b
RD
5638 A child focus event is sent to a (parent-)window when one of its child
5639 windows gains focus, so that the window could restore the focus back
5640 to its corresponding child if it loses it now and regains later.
5641
5642 Notice that child window is the direct child of the window receiving
5643 the event, and so may not be the actual widget recieving focus if it
5644 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5645 to get the widget that is actually receiving focus.
5ba5649b 5646 """
0085ce49
RD
5647 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5648 __repr__ = _swig_repr
5649 def __init__(self, *args, **kwargs):
5ba5649b
RD
5650 """
5651 __init__(self, Window win=None) -> ChildFocusEvent
5652
5653 Constructor
5654 """
0085ce49 5655 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
e811c8ce 5656 def GetWindow(*args, **kwargs):
5ba5649b
RD
5657 """
5658 GetWindow(self) -> Window
5659
33d6fd3b
RD
5660 The window, or (grand)parent of the window which has just received the
5661 focus.
5ba5649b 5662 """
54f9ee45 5663 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 5664
2bf58437 5665 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 5666_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d14a1e28
RD
5667
5668#---------------------------------------------------------------------------
5669
5670class ActivateEvent(Event):
5ba5649b
RD
5671 """
5672 An activate event is sent when a top-level window or the entire
5673 application is being activated or deactivated.
5674
5675 A top-level window (a dialog or frame) receives an activate event when
5676 is being activated or deactivated. This is indicated visually by the
5677 title bar changing colour, and a subwindow gaining the keyboard focus.
5678 An application is activated or deactivated when one of its frames
5679 becomes activated, or a frame becomes inactivate resulting in all
5680 application frames being inactive.
5681
5682 Please note that usually you should call event.Skip() in your handlers
5683 for these events so the default handlers will still be called, as not
5684 doing so can result in strange effects.
5685
5686 """
0085ce49
RD
5687 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5688 __repr__ = _swig_repr
5689 def __init__(self, *args, **kwargs):
5ba5649b 5690 """
2131d850 5691 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5692
5693 Constructor
5694 """
0085ce49 5695 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
e811c8ce 5696 def GetActive(*args, **kwargs):
5ba5649b
RD
5697 """
5698 GetActive(self) -> bool
5699
5700 Returns true if the application or window is being activated, false
5701 otherwise.
5702 """
54f9ee45 5703 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 5704
2bf58437 5705 Active = property(GetActive,doc="See `GetActive`")
2131d850 5706_core_.ActivateEvent_swigregister(ActivateEvent)
d14a1e28
RD
5707
5708#---------------------------------------------------------------------------
5709
5710class InitDialogEvent(Event):
5ba5649b
RD
5711 """
5712 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5713 any window when `wx.Window.InitDialog` is called. Handlers for this
5714 event can transfer data to the window, or anything else that should be
5715 done before the user begins editing the form. The default handler
5716 calls `wx.Window.TransferDataToWindow`.
5717 """
0085ce49
RD
5718 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5719 __repr__ = _swig_repr
5720 def __init__(self, *args, **kwargs):
5ba5649b
RD
5721 """
5722 __init__(self, int Id=0) -> InitDialogEvent
5723
5724 Constructor
5725 """
0085ce49 5726 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5727_core_.InitDialogEvent_swigregister(InitDialogEvent)
d14a1e28
RD
5728
5729#---------------------------------------------------------------------------
5730
5731class MenuEvent(Event):
5ba5649b
RD
5732 """
5733 This class is used for a variety of menu-related events. Note that
5734 these do not include menu command events, which are handled by sending
5735 `wx.CommandEvent` objects.
5736
5737 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5738 text in the first field of the status bar.
5739 """
0085ce49
RD
5740 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5741 __repr__ = _swig_repr
5742 def __init__(self, *args, **kwargs):
5ba5649b 5743 """
2131d850 5744 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5745
5746 Constructor
5747 """
0085ce49 5748 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
e811c8ce 5749 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5750 """
5751 GetMenuId(self) -> int
5752
5753 Returns the menu identifier associated with the event. This method
5754 should be only used with the HIGHLIGHT events.
5755 """
54f9ee45 5756 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
5757
5758 def IsPopup(*args, **kwargs):
5ba5649b
RD
5759 """
5760 IsPopup(self) -> bool
5761
5762 Returns ``True`` if the menu which is being opened or closed is a
5763 popup menu, ``False`` if it is a normal one. This method should only
5764 be used with the OPEN and CLOSE events.
5765 """
54f9ee45 5766 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
5767
5768 def GetMenu(*args, **kwargs):
5ba5649b
RD
5769 """
5770 GetMenu(self) -> Menu
5771
5772 Returns the menu which is being opened or closed. This method should
5773 only be used with the OPEN and CLOSE events.
5774 """
54f9ee45 5775 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 5776
57332a5a
RD
5777 Menu = property(GetMenu,doc="See `GetMenu`")
5778 MenuId = property(GetMenuId,doc="See `GetMenuId`")
2131d850 5779_core_.MenuEvent_swigregister(MenuEvent)
d14a1e28
RD
5780
5781#---------------------------------------------------------------------------
5782
5783class CloseEvent(Event):
5ba5649b
RD
5784 """
5785 This event class contains information about window and session close
5786 events.
5787
5788 The handler function for EVT_CLOSE is called when the user has tried
5789 to close a a frame or dialog box using the window manager controls or
5790 the system menu. It can also be invoked by the application itself
5791 programmatically, for example by calling the `wx.Window.Close`
5792 function.
5793
5794 You should check whether the application is forcing the deletion of
5795 the window using `CanVeto`. If it returns ``False``, you must destroy
5796 the window using `wx.Window.Destroy`. If the return value is ``True``,
5797 it is up to you whether you respond by destroying the window or not.
5798 For example you may wish to display a message dialog prompting to save
5799 files or to cancel the close.
5800
5801 If you don't destroy the window, you should call `Veto` to let the
5802 calling code know that you did not destroy the window. This allows the
5803 `wx.Window.Close` function to return ``True`` or ``False`` depending
5804 on whether the close instruction was honored or not.
5805 """
0085ce49
RD
5806 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5807 __repr__ = _swig_repr
5808 def __init__(self, *args, **kwargs):
5ba5649b 5809 """
2131d850 5810 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5811
5812 Constructor.
5813 """
0085ce49 5814 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
e811c8ce 5815 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5816 """
5817 SetLoggingOff(self, bool logOff)
5818
5819 Sets the 'logging off' flag.
5820 """
54f9ee45 5821 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
5822
5823 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5824 """
5825 GetLoggingOff(self) -> bool
5826
6c75a4cf
RD
5827 Returns ``True`` if the user is logging off or ``False`` if the
5828 system is shutting down. This method can only be called for end
5829 session and query end session events, it doesn't make sense for close
5830 window event.
5ba5649b 5831 """
54f9ee45 5832 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
5833
5834 def Veto(*args, **kwargs):
5ba5649b
RD
5835 """
5836 Veto(self, bool veto=True)
5837
5838 Call this from your event handler to veto a system shutdown or to
5839 signal to the calling application that a window close did not happen.
5840
5841 You can only veto a shutdown or close if `CanVeto` returns true.
5842 """
54f9ee45 5843 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce 5844
5ba5649b
RD
5845 def GetVeto(*args, **kwargs):
5846 """GetVeto(self) -> bool"""
5847 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5848
e811c8ce 5849 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5850 """
5851 SetCanVeto(self, bool canVeto)
5852
5853 Sets the 'can veto' flag.
5854 """
54f9ee45 5855 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
5856
5857 def CanVeto(*args, **kwargs):
5ba5649b
RD
5858 """
5859 CanVeto(self) -> bool
e811c8ce 5860
5ba5649b
RD
5861 Returns true if you can veto a system shutdown or a window close
5862 event. Vetoing a window close event is not possible if the calling
5863 code wishes to force the application to exit, and so this function
5864 must be called to check this.
5865 """
5866 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce 5867
2bf58437 5868 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
2131d850 5869_core_.CloseEvent_swigregister(CloseEvent)
d14a1e28
RD
5870
5871#---------------------------------------------------------------------------
5872
5873class ShowEvent(Event):
5ba5649b 5874 """An EVT_SHOW event is sent when a window is shown or hidden."""
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
RD
5878 """
5879 __init__(self, int winid=0, bool show=False) -> ShowEvent
5880
5881 An EVT_SHOW event is sent when a window is shown or hidden.
5882 """
0085ce49 5883 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
e811c8ce 5884 def SetShow(*args, **kwargs):
a95a7133 5885 """SetShow(self, bool show)"""
54f9ee45 5886 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
5887
5888 def GetShow(*args, **kwargs):
a95a7133 5889 """GetShow(self) -> bool"""
54f9ee45 5890 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 5891
33d6fd3b 5892 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
2131d850 5893_core_.ShowEvent_swigregister(ShowEvent)
d14a1e28
RD
5894
5895#---------------------------------------------------------------------------
5896
5897class IconizeEvent(Event):
5ba5649b
RD
5898 """
5899 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5900 restored.
5901 """
0085ce49
RD
5902 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5903 __repr__ = _swig_repr
5904 def __init__(self, *args, **kwargs):
5ba5649b
RD
5905 """
5906 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5907
5908 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5909 restored.
5910 """
0085ce49 5911 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
e811c8ce 5912 def Iconized(*args, **kwargs):
5ba5649b
RD
5913 """
5914 Iconized(self) -> bool
5915
5916 Returns ``True`` if the frame has been iconized, ``False`` if it has
5917 been restored.
5918 """
54f9ee45 5919 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 5920
2131d850 5921_core_.IconizeEvent_swigregister(IconizeEvent)
d14a1e28
RD
5922
5923#---------------------------------------------------------------------------
5924
5925class MaximizeEvent(Event):
5ba5649b 5926 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
0085ce49
RD
5927 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5928 __repr__ = _swig_repr
5929 def __init__(self, *args, **kwargs):
5ba5649b
RD
5930 """
5931 __init__(self, int id=0) -> MaximizeEvent
5932
5933 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5934 """
0085ce49 5935 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5936_core_.MaximizeEvent_swigregister(MaximizeEvent)
d14a1e28
RD
5937
5938#---------------------------------------------------------------------------
5939
5940class DropFilesEvent(Event):
5ba5649b
RD
5941 """
5942 This class is used for drop files events, that is, when files have
5943 been dropped onto the window. This functionality is only available
5944 under Windows. The window must have previously been enabled for
5945 dropping by calling `wx.Window.DragAcceptFiles`.
5946
5947 Important note: this is a separate implementation to the more general
5948 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5949 implementation uses the older, Windows message-based approach of
5950 dropping files.
5951
5952 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5953 events.
5954
5955 """
0085ce49
RD
5956 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5957 def __init__(self): raise AttributeError, "No constructor defined"
5958 __repr__ = _swig_repr
e811c8ce 5959 def GetPosition(*args, **kwargs):
5ba5649b
RD
5960 """
5961 GetPosition(self) -> Point
5962
5963 Returns the position at which the files were dropped.
5964 """
54f9ee45 5965 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5966
5967 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5968 """
5969 GetNumberOfFiles(self) -> int
5970
5971 Returns the number of files dropped.
5972 """
54f9ee45 5973 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
5974
5975 def GetFiles(*args, **kwargs):
5ba5649b
RD
5976 """
5977 GetFiles(self) -> PyObject
5978
5979 Returns a list of the filenames that were dropped.
5980 """
54f9ee45 5981 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 5982
2bf58437
RD
5983 Files = property(GetFiles,doc="See `GetFiles`")
5984 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5985 Position = property(GetPosition,doc="See `GetPosition`")
2131d850 5986_core_.DropFilesEvent_swigregister(DropFilesEvent)
d14a1e28
RD
5987
5988#---------------------------------------------------------------------------
5989
54f9ee45
RD
5990UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5991UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 5992class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5993 """
5994 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5995 wxWidgets to give an application the chance to update various user
5996 interface elements.
5997
5998 Without update UI events, an application has to work hard to
5999 check/uncheck, enable/disable, and set the text for elements such as
6000 menu items and toolbar buttons. The code for doing this has to be
6001 mixed up with the code that is invoked when an action is invoked for a
6002 menu item or button.
6003
6004 With update UI events, you define an event handler to look at the
6005 state of the application and change UI elements accordingly. wxWidgets
6006 will call your handler functions in idle time, so you don't have to
6007 worry where to call this code. In addition to being a clearer and more
6008 declarative method, it also means you don't have to worry whether
6009 you're updating a toolbar or menubar identifier. The same handler can
6010 update a menu item and toolbar button, if the ID values are the same.
6011
6012 Instead of directly manipulating the menu or button, you call
6013 functions in the event object, such as `Check`. wxWidgets will
6014 determine whether such a call has been made, and which UI element to
6015 update.
6016
6017 These events will work for popup menus as well as menubars. Just
6018 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
6019 any UI events for the window that owns the menu.
6020
6021 If you find that the overhead of UI update processing is affecting
6022 your application, you can do one or both of the following:
6023
6024 1. Call `wx.UpdateUIEvent.SetMode` with a value of
6025 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
6026 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
6027 receive update events. No other windows will receive update
6028 events.
6029
6030 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6031 value to set the delay between updates. You may need to call
6032 `wx.Window.UpdateWindowUI` at critical points, for example when
6033 a dialog is about to be shown, in case the user sees a slight
6034 delay before windows are updated.
6035
6036 Note that although events are sent in idle time, defining a EVT_IDLE
6037 handler for a window does not affect this because the events are sent
6038 from an internal idle handler.
6039
6040 wxWidgets tries to optimize update events on some platforms. On
6041 Windows and GTK+, events for menubar items are only sent when the menu
6042 is about to be shown, and not in idle time.
6043
6044 """
0085ce49
RD
6045 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6046 __repr__ = _swig_repr
6047 def __init__(self, *args, **kwargs):
5ba5649b
RD
6048 """
6049 __init__(self, int commandId=0) -> UpdateUIEvent
6050
6051 Constructor
6052 """
0085ce49 6053 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
e811c8ce 6054 def GetChecked(*args, **kwargs):
5ba5649b
RD
6055 """
6056 GetChecked(self) -> bool
6057
6058 Returns ``True`` if the UI element should be checked.
6059 """
54f9ee45 6060 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
6061
6062 def GetEnabled(*args, **kwargs):
5ba5649b
RD
6063 """
6064 GetEnabled(self) -> bool
6065
6066 Returns ``True`` if the UI element should be enabled.
6067 """
54f9ee45 6068 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce 6069
b1fcee84
RD
6070 def GetShown(*args, **kwargs):
6071 """
6072 GetShown(self) -> bool
6073
6074 Returns ``True`` if the UI element should be shown.
6075 """
6076 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
6077
e811c8ce 6078 def GetText(*args, **kwargs):
5ba5649b
RD
6079 """
6080 GetText(self) -> String
6081
6082 Returns the text that should be set for the UI element.
6083 """
54f9ee45 6084 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
6085
6086 def GetSetText(*args, **kwargs):
5ba5649b
RD
6087 """
6088 GetSetText(self) -> bool
6089
6090 Returns ``True`` if the application has called `SetText`. For
6091 wxWidgets internal use only.
6092 """
54f9ee45 6093 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
6094
6095 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
6096 """
6097 GetSetChecked(self) -> bool
6098
6099 Returns ``True`` if the application has called `Check`. For wxWidgets
6100 internal use only.
6101 """
54f9ee45 6102 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
6103
6104 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
6105 """
6106 GetSetEnabled(self) -> bool
6107
6108 Returns ``True`` if the application has called `Enable`. For wxWidgets
6109 internal use only.
6110 """
54f9ee45 6111 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce 6112
b1fcee84
RD
6113 def GetSetShown(*args, **kwargs):
6114 """
6115 GetSetShown(self) -> bool
6116
6117 Returns ``True`` if the application has called `Show`. For wxWidgets
6118 internal use only.
6119 """
6120 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
6121
e811c8ce 6122 def Check(*args, **kwargs):
5ba5649b
RD
6123 """
6124 Check(self, bool check)
6125
6126 Check or uncheck the UI element.
6127 """
54f9ee45 6128 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
6129
6130 def Enable(*args, **kwargs):
5ba5649b
RD
6131 """
6132 Enable(self, bool enable)
6133
6134 Enable or disable the UI element.
6135 """
54f9ee45 6136 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce 6137
b1fcee84
RD
6138 def Show(*args, **kwargs):
6139 """
6140 Show(self, bool show)
6141
6142 Show or hide the UI element.
6143 """
6144 return _core_.UpdateUIEvent_Show(*args, **kwargs)
6145
e811c8ce 6146 def SetText(*args, **kwargs):
5ba5649b
RD
6147 """
6148 SetText(self, String text)
6149
6150 Sets the text for this UI element.
6151 """
54f9ee45 6152 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
6153
6154 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6155 """
6156 SetUpdateInterval(long updateInterval)
6157
6158 Sets the interval between updates in milliseconds. Set to -1 to
6159 disable updates, or to 0 to update as frequently as possible. The
6160 default is 0.
6161
6162 Use this to reduce the overhead of UI update events if your
6163 application has a lot of windows. If you set the value to -1 or
6164 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6165 at appropriate points in your application, such as when a dialog is
6166 about to be shown.
6167 """
54f9ee45 6168 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
6169
6170 SetUpdateInterval = staticmethod(SetUpdateInterval)
6171 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6172 """
6173 GetUpdateInterval() -> long
6174
6175 Returns the current interval between updates in milliseconds. -1
6176 disables updates, 0 updates as frequently as possible.
6177 """
54f9ee45 6178 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
6179
6180 GetUpdateInterval = staticmethod(GetUpdateInterval)
6181 def CanUpdate(*args, **kwargs):
5ba5649b
RD
6182 """
6183 CanUpdate(Window win) -> bool
6184
6185 Returns ``True`` if it is appropriate to update (send UI update events
6186 to) this window.
6187
6188 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6189 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6190 events were last sent in idle time, and the update interval, to
6191 determine whether events should be sent to this window now. By default
6192 this will always return true because the update mode is initially
6193 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6194 events will be sent as often as possible. You can reduce the frequency
6195 that events are sent by changing the mode and/or setting an update
6196 interval.
6197
6198 """
54f9ee45 6199 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
6200
6201 CanUpdate = staticmethod(CanUpdate)
6202 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6203 """
6204 ResetUpdateTime()
6205
6206 Used internally to reset the last-updated time to the current time. It
6207 is assumed that update events are normally sent in idle time, so this
6208 is called at the end of idle processing.
6209 """
54f9ee45 6210 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
6211
6212 ResetUpdateTime = staticmethod(ResetUpdateTime)
6213 def SetMode(*args, **kwargs):
5ba5649b
RD
6214 """
6215 SetMode(int mode)
6216
6217 Specify how wxWidgets will send update events: to all windows, or only
6218 to those which specify that they will process the events.
6219
6220 The mode may be one of the following values:
6221
6222 ============================= ==========================================
6223 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6224 is the default setting.
6225 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6226 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6227 style set.
6228 ============================= ==========================================
6229
6230 """
54f9ee45 6231 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6232
6233 SetMode = staticmethod(SetMode)
6234 def GetMode(*args, **kwargs):
5ba5649b
RD
6235 """
6236 GetMode() -> int
6237
6238 Returns a value specifying how wxWidgets will send update events: to
6239 all windows, or only to those which specify that they will process the
6240 events.
6241 """
54f9ee45 6242 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6243
6244 GetMode = staticmethod(GetMode)
dba7934c
RD
6245 Checked = property(GetChecked,Check,doc="See `GetChecked`")
6246 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
6247 Shown = property(GetShown,Show,doc="See `GetShown`")
6248 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
2131d850 6249_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d14a1e28 6250
e811c8ce 6251def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
0085ce49 6252 """
5ba5649b
RD
6253 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6254
6255 Sets the interval between updates in milliseconds. Set to -1 to
6256 disable updates, or to 0 to update as frequently as possible. The
6257 default is 0.
6258
6259 Use this to reduce the overhead of UI update events if your
6260 application has a lot of windows. If you set the value to -1 or
6261 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6262 at appropriate points in your application, such as when a dialog is
6263 about to be shown.
6264 """
0085ce49 6265 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 6266
0085ce49
RD
6267def UpdateUIEvent_GetUpdateInterval(*args):
6268 """
5ba5649b
RD
6269 UpdateUIEvent_GetUpdateInterval() -> long
6270
6271 Returns the current interval between updates in milliseconds. -1
6272 disables updates, 0 updates as frequently as possible.
6273 """
0085ce49 6274 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d14a1e28 6275
e811c8ce 6276def UpdateUIEvent_CanUpdate(*args, **kwargs):
0085ce49 6277 """
5ba5649b
RD
6278 UpdateUIEvent_CanUpdate(Window win) -> bool
6279
6280 Returns ``True`` if it is appropriate to update (send UI update events
6281 to) this window.
6282
6283 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6284 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6285 events were last sent in idle time, and the update interval, to
6286 determine whether events should be sent to this window now. By default
6287 this will always return true because the update mode is initially
6288 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6289 events will be sent as often as possible. You can reduce the frequency
6290 that events are sent by changing the mode and/or setting an update
6291 interval.
6292
6293 """
0085ce49 6294 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 6295
0085ce49
RD
6296def UpdateUIEvent_ResetUpdateTime(*args):
6297 """
5ba5649b
RD
6298 UpdateUIEvent_ResetUpdateTime()
6299
6300 Used internally to reset the last-updated time to the current time. It
6301 is assumed that update events are normally sent in idle time, so this
6302 is called at the end of idle processing.
6303 """
0085ce49 6304 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d14a1e28 6305
e811c8ce 6306def UpdateUIEvent_SetMode(*args, **kwargs):
0085ce49 6307 """
5ba5649b
RD
6308 UpdateUIEvent_SetMode(int mode)
6309
6310 Specify how wxWidgets will send update events: to all windows, or only
6311 to those which specify that they will process the events.
6312
6313 The mode may be one of the following values:
6314
6315 ============================= ==========================================
6316 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6317 is the default setting.
6318 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6319 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6320 style set.
6321 ============================= ==========================================
6322
6323 """
0085ce49 6324 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 6325
0085ce49
RD
6326def UpdateUIEvent_GetMode(*args):
6327 """
5ba5649b
RD
6328 UpdateUIEvent_GetMode() -> int
6329
6330 Returns a value specifying how wxWidgets will send update events: to
6331 all windows, or only to those which specify that they will process the
6332 events.
6333 """
0085ce49 6334 return _core_.UpdateUIEvent_GetMode(*args)
d14a1e28
RD
6335
6336#---------------------------------------------------------------------------
6337
6338class SysColourChangedEvent(Event):
5ba5649b
RD
6339 """
6340 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6341 when the user changes the colour settings using the control
6342 panel. This is only applicable under Windows.
6343
6344 The default event handler for this event propagates the event to child
6345 windows, since Windows only sends the events to top-level windows. If
6346 intercepting this event for a top-level window, remember to call
6347 `Skip` so the the base class handler will still be executed, or to
6348 pass the event on to the window's children explicitly.
6349
6350 """
0085ce49
RD
6351 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6352 __repr__ = _swig_repr
6353 def __init__(self, *args, **kwargs):
5ba5649b
RD
6354 """
6355 __init__(self) -> SysColourChangedEvent
6356
6357 Constructor
6358 """
0085ce49 6359 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 6360_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d14a1e28
RD
6361
6362#---------------------------------------------------------------------------
6363
6364class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6365 """
6366 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6367 a window that loses its mouse capture. This is called even if
6368 `wx.Window.ReleaseMouse` was called by the application code. Handling
6369 this event allows an application to cater for unexpected capture
6370 releases which might otherwise confuse mouse handling code.
6371
6372 This event is implemented under Windows only.
6373 """
0085ce49
RD
6374 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6375 __repr__ = _swig_repr
6376 def __init__(self, *args, **kwargs):
5ba5649b
RD
6377 """
6378 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6379
6380 Constructor
6381 """
0085ce49 6382 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
e811c8ce 6383 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6384 """
6385 GetCapturedWindow(self) -> Window
6386
6387 Returns the window that gained the capture, or ``None`` if it was a
6388 non-wxWidgets window.
6389 """
54f9ee45 6390 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 6391
57332a5a 6392 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
2131d850 6393_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d14a1e28
RD
6394
6395#---------------------------------------------------------------------------
6396
34e0a3bb
RD
6397class MouseCaptureLostEvent(Event):
6398 """
6399 A mouse capture lost event is sent to a window that obtained mouse
6400 capture, which was subsequently loss due to "external" event, for
6401 example when a dialog box is shown or if another application captures
6402 the mouse.
6403
6404 If this happens, this event is sent to all windows that are on the
6405 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6406 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6407 if the capture changes because of a call to CaptureMouse or
6408 ReleaseMouse.
6409
6410 This event is currently emitted under Windows only.
6411
6412 """
6413 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6414 __repr__ = _swig_repr
6415 def __init__(self, *args, **kwargs):
6416 """
6417 __init__(self, int winid=0) -> MouseCaptureLostEvent
6418
6419 A mouse capture lost event is sent to a window that obtained mouse
6420 capture, which was subsequently loss due to "external" event, for
6421 example when a dialog box is shown or if another application captures
6422 the mouse.
6423
6424 If this happens, this event is sent to all windows that are on the
6425 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6426 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6427 if the capture changes because of a call to CaptureMouse or
6428 ReleaseMouse.
6429
6430 This event is currently emitted under Windows only.
6431
6432 """
6433 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6434_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6435
6436#---------------------------------------------------------------------------
6437
d14a1e28 6438class DisplayChangedEvent(Event):
5ba5649b
RD
6439 """
6440 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6441 resolution has changed.
6442
6443 This event is implemented under Windows only.
6444 """
0085ce49
RD
6445 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6446 __repr__ = _swig_repr
6447 def __init__(self, *args, **kwargs):
a95a7133 6448 """__init__(self) -> DisplayChangedEvent"""
0085ce49 6449 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 6450_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d14a1e28
RD
6451
6452#---------------------------------------------------------------------------
6453
6454class PaletteChangedEvent(Event):
5ba5649b
RD
6455 """
6456 An EVT_PALETTE_CHANGED event is sent when the system palette has
6457 changed, thereby giving each window a chance to redo their own to
6458 match.
6459
6460 This event is implemented under Windows only.
6461 """
0085ce49
RD
6462 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6463 __repr__ = _swig_repr
6464 def __init__(self, *args, **kwargs):
5ba5649b
RD
6465 """
6466 __init__(self, int id=0) -> PaletteChangedEvent
6467
6468 An EVT_PALETTE_CHANGED event is sent when the system palette has
6469 changed, thereby giving each window a chance to redo their own to
6470 match.
6471
6472 This event is implemented under Windows only.
6473 """
0085ce49 6474 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
e811c8ce 6475 def SetChangedWindow(*args, **kwargs):
a95a7133 6476 """SetChangedWindow(self, Window win)"""
54f9ee45 6477 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
6478
6479 def GetChangedWindow(*args, **kwargs):
a95a7133 6480 """GetChangedWindow(self) -> Window"""
54f9ee45 6481 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 6482
33d6fd3b 6483 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
2131d850 6484_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d14a1e28
RD
6485
6486#---------------------------------------------------------------------------
6487
6488class QueryNewPaletteEvent(Event):
5ba5649b
RD
6489 """
6490 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6491 focus and should re-do its palette.
6492
6493 This event is implemented under Windows only.
6494 """
0085ce49
RD
6495 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6496 __repr__ = _swig_repr
6497 def __init__(self, *args, **kwargs):
5ba5649b
RD
6498 """
6499 __init__(self, int winid=0) -> QueryNewPaletteEvent
6500
6501 Constructor.
6502 """
0085ce49 6503 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
e811c8ce 6504 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6505 """
6506 SetPaletteRealized(self, bool realized)
6507
6508 App should set this if it changes the palette.
6509 """
54f9ee45 6510 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
6511
6512 def GetPaletteRealized(*args, **kwargs):
a95a7133 6513 """GetPaletteRealized(self) -> bool"""
54f9ee45 6514 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 6515
33d6fd3b 6516 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
2131d850 6517_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d14a1e28
RD
6518
6519#---------------------------------------------------------------------------
6520
6521class NavigationKeyEvent(Event):
5ba5649b
RD
6522 """
6523 EVT_NAVIGATION_KEY events are used to control moving the focus between
6524 widgets, otherwise known as tab-traversal. You woudl normally not
6525 catch navigation events in applications as there are already
6526 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6527 it useful to send navigation events in certain situations to change
6528 the focus in certain ways, although it's probably easier to just call
6529 `wx.Window.Navigate`.
6530 """
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):
a95a7133 6534 """__init__(self) -> NavigationKeyEvent"""
0085ce49 6535 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
e811c8ce 6536 def GetDirection(*args, **kwargs):
5ba5649b
RD
6537 """
6538 GetDirection(self) -> bool
6539
6540 Returns ``True`` if the direction is forward, ``False`` otherwise.
6541 """
54f9ee45 6542 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
6543
6544 def SetDirection(*args, **kwargs):
5ba5649b
RD
6545 """
6546 SetDirection(self, bool forward)
6547
6548 Specify the direction that the navigation should take. Usually the
6549 difference between using Tab and Shift-Tab.
6550 """
54f9ee45 6551 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
6552
6553 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6554 """
6555 IsWindowChange(self) -> bool
6556
6557 Returns ``True`` if window change is allowed.
6558 """
54f9ee45 6559 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
6560
6561 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6562 """
6563 SetWindowChange(self, bool ischange)
6564
6565 Specify if the navigation should be able to change parent windows.
6566 For example, changing notebook pages, etc. This is usually implemented
6567 by using Control-Tab.
6568 """
54f9ee45 6569 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 6570
68350608 6571 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6572 """
6573 IsFromTab(self) -> bool
6574
6575 Returns ``True`` if the navigation event is originated from the Tab
6576 key.
6577 """
68350608
RD
6578 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6579
6580 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6581 """
6582 SetFromTab(self, bool bIs)
6583
6584 Set to true under MSW if the event was generated using the tab key.
6585 This is required for proper navogation over radio buttons.
6586 """
68350608
RD
6587 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6588
908b74cd 6589 def SetFlags(*args, **kwargs):
5ba5649b
RD
6590 """
6591 SetFlags(self, long flags)
6592
6593 Set the navigation flags to a combination of the following:
6594
6595 * wx.NavigationKeyEvent.IsBackward
6596 * wx.NavigationKeyEvent.IsForward
6597 * wx.NavigationKeyEvent.WinChange
6598 * wx.NavigationKeyEvent.FromTab
6599
6600 """
908b74cd
RD
6601 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6602
e811c8ce 6603 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6604 """
6605 GetCurrentFocus(self) -> Window
6606
6607 Returns the child window which currenty has the focus. May be
6608 ``None``.
6609 """
54f9ee45 6610 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
6611
6612 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6613 """
6614 SetCurrentFocus(self, Window win)
6615
6616 Set the window that has the focus.
6617 """
54f9ee45 6618 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 6619
b0f7404b 6620 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6621 IsForward = _core_.NavigationKeyEvent_IsForward
6622 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6623 FromTab = _core_.NavigationKeyEvent_FromTab
57332a5a
RD
6624 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6625 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
2131d850 6626_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d14a1e28
RD
6627
6628#---------------------------------------------------------------------------
6629
6630class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6631 """
6632 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6633 underlying GUI object) exists.
6634 """
0085ce49
RD
6635 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6636 __repr__ = _swig_repr
6637 def __init__(self, *args, **kwargs):
5ba5649b
RD
6638 """
6639 __init__(self, Window win=None) -> WindowCreateEvent
6640
6641 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6642 underlying GUI object) exists.
6643 """
0085ce49 6644 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
e811c8ce 6645 def GetWindow(*args, **kwargs):
5ba5649b
RD
6646 """
6647 GetWindow(self) -> Window
6648
6649 Returns the window that this event refers to.
6650 """
54f9ee45 6651 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 6652
dba7934c 6653 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6654_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d14a1e28
RD
6655
6656class WindowDestroyEvent(CommandEvent):
5ba5649b 6657 """
943e8dfd
RD
6658 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6659 when the GUI window is destroyed.
6660
6661 When a class derived from `wx.Window` is destroyed its destructor will
6662 have already run by the time this event is sent. Therefore this event
6663 will not usually be received at all by the window itself. Since it is
6664 received after the destructor has run, an object should not try to
6665 handle its own wx.WindowDestroyEvent, but it can be used to get
6666 notification of the destruction of another window.
5ba5649b 6667 """
0085ce49
RD
6668 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6669 __repr__ = _swig_repr
6670 def __init__(self, *args, **kwargs):
5ba5649b
RD
6671 """
6672 __init__(self, Window win=None) -> WindowDestroyEvent
6673
943e8dfd
RD
6674 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6675 when the GUI window is destroyed.
6676
6677 When a class derived from `wx.Window` is destroyed its destructor will
6678 have already run by the time this event is sent. Therefore this event
6679 will not usually be received at all by the window itself. Since it is
6680 received after the destructor has run, an object should not try to
6681 handle its own wx.WindowDestroyEvent, but it can be used to get
6682 notification of the destruction of another window.
5ba5649b 6683 """
0085ce49 6684 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
e811c8ce 6685 def GetWindow(*args, **kwargs):
5ba5649b
RD
6686 """
6687 GetWindow(self) -> Window
6688
6689 Returns the window that this event refers to.
6690 """
54f9ee45 6691 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 6692
dba7934c 6693 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6694_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d14a1e28
RD
6695
6696#---------------------------------------------------------------------------
6697
6698class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6699 """
6700 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6701 give the application a chance to show a context (popup) menu.
6702 """
0085ce49
RD
6703 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6704 __repr__ = _swig_repr
6705 def __init__(self, *args, **kwargs):
5ba5649b 6706 """
2131d850 6707 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6708
6709 Constructor.
6710 """
0085ce49 6711 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
e811c8ce 6712 def GetPosition(*args, **kwargs):
5ba5649b
RD
6713 """
6714 GetPosition(self) -> Point
6715
6716 Returns the position (in screen coordinants) at which the menu should
6717 be shown.
6718 """
54f9ee45 6719 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
6720
6721 def SetPosition(*args, **kwargs):
5ba5649b
RD
6722 """
6723 SetPosition(self, Point pos)
6724
6725 Sets the position at which the menu should be shown.
6726 """
54f9ee45 6727 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 6728
2bf58437 6729 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 6730_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d14a1e28
RD
6731
6732#---------------------------------------------------------------------------
6733
54f9ee45
RD
6734IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6735IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 6736class IdleEvent(Event):
5ba5649b
RD
6737 """
6738 This class is used for EVT_IDLE events, which are generated and sent
6739 when the application *becomes* idle. In other words, the when the
6740 event queue becomes empty then idle events are sent to all windows (by
6741 default) and as long as none of them call `RequestMore` then there are
6742 no more idle events until after the system event queue has some normal
6743 events and then becomes empty again.
6744
6745 By default, idle events are sent to all windows. If this is causing a
6746 significant overhead in your application, you can call
6747 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6748 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6749 which should receive idle events. Then idle events will only be sent
6750 to those windows and not to any others.
6751 """
0085ce49
RD
6752 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6753 __repr__ = _swig_repr
6754 def __init__(self, *args, **kwargs):
5ba5649b
RD
6755 """
6756 __init__(self) -> IdleEvent
6757
6758 Constructor
6759 """
0085ce49 6760 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
e811c8ce 6761 def RequestMore(*args, **kwargs):
5ba5649b
RD
6762 """
6763 RequestMore(self, bool needMore=True)
6764
6765 Tells wxWidgets that more processing is required. This function can be
6766 called by an EVT_IDLE handler for a window to indicate that the
6767 application should forward the EVT_IDLE event once more to the
6768 application windows. If no window calls this function during its
6769 EVT_IDLE handler, then the application will remain in a passive event
6770 loop until a new event is posted to the application by the windowing
6771 system.
6772 """
54f9ee45 6773 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
6774
6775 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6776 """
6777 MoreRequested(self) -> bool
6778
6779 Returns ``True`` if the OnIdle function processing this event
6780 requested more processing time.
6781 """
54f9ee45 6782 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
6783
6784 def SetMode(*args, **kwargs):
5ba5649b
RD
6785 """
6786 SetMode(int mode)
6787
6788 Static method for specifying how wxWidgets will send idle events: to
6789 all windows, or only to those which specify that they will process the
6790 events.
6791
6792 The mode can be one of the following values:
6793
6794 ========================= ========================================
6795 wx.IDLE_PROCESS_ALL Send idle events to all windows
6796 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6797 the wx.WS_EX_PROCESS_IDLE extra style
6798 flag set.
6799 ========================= ========================================
6800
6801 """
54f9ee45 6802 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6803
6804 SetMode = staticmethod(SetMode)
6805 def GetMode(*args, **kwargs):
5ba5649b
RD
6806 """
6807 GetMode() -> int
6808
6809 Static method returning a value specifying how wxWidgets will send
6810 idle events: to all windows, or only to those which specify that they
6811 will process the events.
6812 """
54f9ee45 6813 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6814
6815 GetMode = staticmethod(GetMode)
6816 def CanSend(*args, **kwargs):
5ba5649b
RD
6817 """
6818 CanSend(Window win) -> bool
6819
6820 Returns ``True`` if it is appropriate to send idle events to this
6821 window.
6822
6823 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6824 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6825 events should be sent to this window now. By default this will always
6826 return ``True`` because the update mode is initially
6827 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6828 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6829 """
54f9ee45 6830 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
6831
6832 CanSend = staticmethod(CanSend)
2131d850 6833_core_.IdleEvent_swigregister(IdleEvent)
d14a1e28 6834
e811c8ce 6835def IdleEvent_SetMode(*args, **kwargs):
0085ce49 6836 """
5ba5649b
RD
6837 IdleEvent_SetMode(int mode)
6838
6839 Static method for specifying how wxWidgets will send idle events: to
6840 all windows, or only to those which specify that they will process the
6841 events.
6842
6843 The mode can be one of the following values:
6844
6845 ========================= ========================================
6846 wx.IDLE_PROCESS_ALL Send idle events to all windows
6847 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6848 the wx.WS_EX_PROCESS_IDLE extra style
6849 flag set.
6850 ========================= ========================================
6851
6852 """
0085ce49 6853 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 6854
0085ce49
RD
6855def IdleEvent_GetMode(*args):
6856 """
5ba5649b
RD
6857 IdleEvent_GetMode() -> int
6858
6859 Static method returning a value specifying how wxWidgets will send
6860 idle events: to all windows, or only to those which specify that they
6861 will process the events.
6862 """
0085ce49 6863 return _core_.IdleEvent_GetMode(*args)
d14a1e28 6864
e811c8ce 6865def IdleEvent_CanSend(*args, **kwargs):
0085ce49 6866 """
5ba5649b
RD
6867 IdleEvent_CanSend(Window win) -> bool
6868
6869 Returns ``True`` if it is appropriate to send idle events to this
6870 window.
6871
6872 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6873 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6874 events should be sent to this window now. By default this will always
6875 return ``True`` because the update mode is initially
6876 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6877 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6878 """
0085ce49 6879 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
6880
6881#---------------------------------------------------------------------------
6882
2131d850
RD
6883class ClipboardTextEvent(CommandEvent):
6884 """
6885 A Clipboard Text event is sent when a window intercepts a text
6886 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6887 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6888 popup menu command, etc. NOTE : under windows these events are *NOT*
6889 generated automatically for a Rich Edit text control.
6890 """
6891 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6892 __repr__ = _swig_repr
6893 def __init__(self, *args, **kwargs):
6894 """
6895 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6896
6897 A Clipboard Text event is sent when a window intercepts a text
6898 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6899 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6900 popup menu command, etc. NOTE : under windows these events are *NOT*
6901 generated automatically for a Rich Edit text control.
6902 """
6903 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6904_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6905
6906#---------------------------------------------------------------------------
6907
d14a1e28 6908class PyEvent(Event):
5ba5649b
RD
6909 """
6910 wx.PyEvent can be used as a base class for implementing custom event
6911 types in Python. You should derived from this class instead of
6912 `wx.Event` because this class is Python-aware and is able to transport
6913 its Python bits safely through the wxWidgets event system and have
6914 them still be there when the event handler is invoked.
6915
6916 :see: `wx.PyCommandEvent`
6917
6918 """
0085ce49
RD
6919 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6920 __repr__ = _swig_repr
6921 def __init__(self, *args, **kwargs):
2131d850 6922 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
0085ce49 6923 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6924 self._SetSelf(self)
e811c8ce 6925
0085ce49
RD
6926 __swig_destroy__ = _core_.delete_PyEvent
6927 __del__ = lambda self : None;
5ba5649b
RD
6928 def _SetSelf(*args, **kwargs):
6929 """_SetSelf(self, PyObject self)"""
6930 return _core_.PyEvent__SetSelf(*args, **kwargs)
e811c8ce 6931
5ba5649b
RD
6932 def _GetSelf(*args, **kwargs):
6933 """_GetSelf(self) -> PyObject"""
6934 return _core_.PyEvent__GetSelf(*args, **kwargs)
e811c8ce 6935
2131d850 6936_core_.PyEvent_swigregister(PyEvent)
d14a1e28
RD
6937
6938class PyCommandEvent(CommandEvent):
5ba5649b
RD
6939 """
6940 wx.PyCommandEvent can be used as a base class for implementing custom
6941 event types in Python, where the event shoudl travel up to parent
6942 windows looking for a handler. You should derived from this class
6943 instead of `wx.CommandEvent` because this class is Python-aware and is
6944 able to transport its Python bits safely through the wxWidgets event
6945 system and have them still be there when the event handler is invoked.
6946
6947 :see: `wx.PyEvent`
6948
6949 """
0085ce49
RD
6950 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6951 __repr__ = _swig_repr
6952 def __init__(self, *args, **kwargs):
2131d850 6953 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
0085ce49 6954 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6955 self._SetSelf(self)
e811c8ce 6956
0085ce49
RD
6957 __swig_destroy__ = _core_.delete_PyCommandEvent
6958 __del__ = lambda self : None;
5ba5649b
RD
6959 def _SetSelf(*args, **kwargs):
6960 """_SetSelf(self, PyObject self)"""
6961 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
e811c8ce 6962
5ba5649b
RD
6963 def _GetSelf(*args, **kwargs):
6964 """_GetSelf(self) -> PyObject"""
6965 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
e811c8ce 6966
2131d850 6967_core_.PyCommandEvent_swigregister(PyCommandEvent)
d14a1e28 6968
53aa7709 6969class DateEvent(CommandEvent):
5ba5649b
RD
6970 """
6971 This event class holds information about a date change event and is
6972 used together with `wx.DatePickerCtrl`. It also serves as a base class
6973 for `wx.calendar.CalendarEvent`. Bind these event types with
6974 EVT_DATE_CHANGED.
6975 """
0085ce49
RD
6976 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6977 __repr__ = _swig_repr
6978 def __init__(self, *args, **kwargs):
2131d850 6979 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
0085ce49 6980 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6981 def GetDate(*args, **kwargs):
5ba5649b
RD
6982 """
6983 GetDate(self) -> DateTime
6984
6985 Returns the date.
6986 """
53aa7709
RD
6987 return _core_.DateEvent_GetDate(*args, **kwargs)
6988
6989 def SetDate(*args, **kwargs):
5ba5649b
RD
6990 """
6991 SetDate(self, DateTime date)
6992
6993 Sets the date carried by the event, normally only used by the library
6994 internally.
6995 """
53aa7709
RD
6996 return _core_.DateEvent_SetDate(*args, **kwargs)
6997
2bf58437 6998 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
2131d850 6999_core_.DateEvent_swigregister(DateEvent)
53aa7709
RD
7000
7001wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
7002EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
7003
4976f996
RD
7004class EventBlocker(EvtHandler):
7005 """Helper class to temporarily disable event handling for a window."""
7006 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7007 __repr__ = _swig_repr
7008 def __init__(self, *args, **kwargs):
7009 """
7010 __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker
7011
7012 Helper class to temporarily disable event handling for a window.
7013 """
7014 _core_.EventBlocker_swiginit(self,_core_.new_EventBlocker(*args, **kwargs))
7015 __swig_destroy__ = _core_.delete_EventBlocker
7016 __del__ = lambda self : None;
7017 def Block(*args, **kwargs):
7018 """Block(self, EventType type)"""
7019 return _core_.EventBlocker_Block(*args, **kwargs)
7020
7021_core_.EventBlocker_swigregister(EventBlocker)
7022
d14a1e28
RD
7023#---------------------------------------------------------------------------
7024
54f9ee45
RD
7025PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
7026PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
7027PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
7028PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
7029PRINT_WINDOWS = _core_.PRINT_WINDOWS
7030PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 7031class PyApp(EvtHandler):
66c033b4
RD
7032 """
7033 The ``wx.PyApp`` class is an *implementation detail*, please use the
7034 `wx.App` class (or some other derived class) instead.
7035 """
0085ce49
RD
7036 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7037 __repr__ = _swig_repr
7038 def __init__(self, *args, **kwargs):
98e665d3 7039 """
a95a7133 7040 __init__(self) -> PyApp
98e665d3
RD
7041
7042 Create a new application object, starting the bootstrap process.
7043 """
0085ce49 7044 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
c25f90f6 7045 self._setOORInfo(self, False);PyApp._setCallbackInfo(self, self, PyApp)
e811c8ce 7046
0085ce49
RD
7047 __swig_destroy__ = _core_.delete_PyApp
7048 __del__ = lambda self : None;
e811c8ce 7049 def _setCallbackInfo(*args, **kwargs):
c25f90f6 7050 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)"""
54f9ee45 7051 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
7052
7053 def GetAppName(*args, **kwargs):
0df68c9f 7054 """
a95a7133 7055 GetAppName(self) -> String
6c3b4aae 7056
0df68c9f
RD
7057 Get the application name.
7058 """
54f9ee45 7059 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
7060
7061 def SetAppName(*args, **kwargs):
0df68c9f 7062 """
a95a7133 7063 SetAppName(self, String name)
6c3b4aae 7064
66c033b4
RD
7065 Set the application name. This value may be used automatically by
7066 `wx.Config` and such.
0df68c9f 7067 """
54f9ee45 7068 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
7069
7070 def GetClassName(*args, **kwargs):
0df68c9f 7071 """
a95a7133 7072 GetClassName(self) -> String
e811c8ce 7073
0df68c9f
RD
7074 Get the application's class name.
7075 """
54f9ee45 7076 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
7077
7078 def SetClassName(*args, **kwargs):
0df68c9f 7079 """
a95a7133 7080 SetClassName(self, String name)
6c3b4aae 7081
66c033b4
RD
7082 Set the application's class name. This value may be used for
7083 X-resources if applicable for the platform
0df68c9f 7084 """
54f9ee45 7085 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
7086
7087 def GetVendorName(*args, **kwargs):
0df68c9f 7088 """
a95a7133 7089 GetVendorName(self) -> String
6c3b4aae 7090
0df68c9f
RD
7091 Get the application's vendor name.
7092 """
54f9ee45 7093 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
7094
7095 def SetVendorName(*args, **kwargs):
0df68c9f 7096 """
a95a7133 7097 SetVendorName(self, String name)
6c3b4aae 7098
66c033b4
RD
7099 Set the application's vendor name. This value may be used
7100 automatically by `wx.Config` and such.
0df68c9f 7101 """
54f9ee45 7102 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
7103
7104 def GetTraits(*args, **kwargs):
0df68c9f 7105 """
a95a7133 7106 GetTraits(self) -> wxAppTraits
6c3b4aae 7107
66c033b4
RD
7108 Return (and create if necessary) the app traits object to which we
7109 delegate for everything which either should be configurable by the
7110 user (then he can change the default behaviour simply by overriding
7111 CreateTraits() and returning his own traits object) or which is
7112 GUI/console dependent as then wx.AppTraits allows us to abstract the
7113 differences behind the common facade.
7114
7115 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 7116 """
54f9ee45 7117 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
7118
7119 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 7120 """
a95a7133 7121 ProcessPendingEvents(self)
6c3b4aae 7122
66c033b4
RD
7123 Process all events in the Pending Events list -- it is necessary to
7124 call this function to process posted events. This normally happens
7125 during each event loop iteration.
0df68c9f 7126 """
54f9ee45 7127 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
7128
7129 def Yield(*args, **kwargs):
0df68c9f 7130 """
a95a7133 7131 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 7132
66c033b4
RD
7133 Process all currently pending events right now, instead of waiting
7134 until return to the event loop. It is an error to call ``Yield``
7135 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 7136
66c033b4 7137 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
7138 reentrancies (i.e. when called from an event handler it may
7139 result in calling the same event handler again), use with
7140 extreme care or, better, don't use at all!
0df68c9f 7141
66c033b4 7142 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 7143
0df68c9f 7144 """
54f9ee45 7145 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
7146
7147 def WakeUpIdle(*args, **kwargs):
0df68c9f 7148 """
a95a7133 7149 WakeUpIdle(self)
6c3b4aae 7150
66c033b4
RD
7151 Make sure that idle events are sent again.
7152 :see: `wx.WakeUpIdle`
0df68c9f 7153 """
54f9ee45 7154 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 7155
1fc3b23a
RD
7156 def IsMainLoopRunning(*args, **kwargs):
7157 """
7158 IsMainLoopRunning() -> bool
7159
7160 Returns True if we're running the main loop, i.e. if the events can
7161 currently be dispatched.
7162 """
7163 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7164
7165 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 7166 def MainLoop(*args, **kwargs):
0df68c9f 7167 """
a95a7133 7168 MainLoop(self) -> int
6c3b4aae 7169
66c033b4
RD
7170 Execute the main GUI loop, the function doesn't normally return until
7171 all top level windows have been closed and destroyed.
0df68c9f 7172 """
54f9ee45 7173 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
7174
7175 def Exit(*args, **kwargs):
0df68c9f 7176 """
a95a7133 7177 Exit(self)
6c3b4aae 7178
0df68c9f 7179 Exit the main loop thus terminating the application.
66c033b4 7180 :see: `wx.Exit`
0df68c9f 7181 """
54f9ee45 7182 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce 7183
97ab0f6a
RD
7184 def GetLayoutDirection(*args, **kwargs):
7185 """
994453b8 7186 GetLayoutDirection(self) -> int
97ab0f6a
RD
7187
7188 Return the layout direction for the current locale.
7189 """
7190 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
7191
e811c8ce 7192 def ExitMainLoop(*args, **kwargs):
0df68c9f 7193 """
a95a7133 7194 ExitMainLoop(self)
6c3b4aae 7195
66c033b4
RD
7196 Exit the main GUI loop during the next iteration of the main
7197 loop, (i.e. it does not stop the program immediately!)
0df68c9f 7198 """
54f9ee45 7199 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
7200
7201 def Pending(*args, **kwargs):
0df68c9f 7202 """
a95a7133 7203 Pending(self) -> bool
6c3b4aae 7204
0df68c9f
RD
7205 Returns True if there are unprocessed events in the event queue.
7206 """
54f9ee45 7207 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
7208
7209 def Dispatch(*args, **kwargs):
0df68c9f 7210 """
a95a7133 7211 Dispatch(self) -> bool
6c3b4aae 7212
0df68c9f
RD
7213 Process the first event in the event queue (blocks until an event
7214 appears if there are none currently)
7215 """
54f9ee45 7216 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
7217
7218 def ProcessIdle(*args, **kwargs):
0df68c9f 7219 """
a95a7133 7220 ProcessIdle(self) -> bool
6c3b4aae 7221
66c033b4
RD
7222 Called from the MainLoop when the application becomes idle (there are
7223 no pending events) and sends a `wx.IdleEvent` to all interested
7224 parties. Returns True if more idle events are needed, False if not.
0df68c9f 7225 """
54f9ee45 7226 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
7227
7228 def SendIdleEvents(*args, **kwargs):
0df68c9f 7229 """
a95a7133 7230 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 7231
66c033b4
RD
7232 Send idle event to window and all subwindows. Returns True if more
7233 idle time is requested.
0df68c9f 7234 """
54f9ee45 7235 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
7236
7237 def IsActive(*args, **kwargs):
0df68c9f 7238 """
a95a7133 7239 IsActive(self) -> bool
6c3b4aae 7240
0df68c9f
RD
7241 Return True if our app has focus.
7242 """
54f9ee45 7243 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
7244
7245 def SetTopWindow(*args, **kwargs):
0df68c9f 7246 """
a95a7133 7247 SetTopWindow(self, Window win)
6c3b4aae 7248
66c033b4 7249 Set the *main* top level window
0df68c9f 7250 """
54f9ee45 7251 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
7252
7253 def GetTopWindow(*args, **kwargs):
0df68c9f 7254 """
a95a7133 7255 GetTopWindow(self) -> Window
6c3b4aae 7256
66c033b4
RD
7257 Return the *main* top level window (if it hadn't been set previously
7258 with SetTopWindow(), will return just some top level window and, if
7259 there not any, will return None)
0df68c9f 7260 """
54f9ee45 7261 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
7262
7263 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 7264 """
a95a7133 7265 SetExitOnFrameDelete(self, bool flag)
0df68c9f 7266
66c033b4
RD
7267 Control the exit behaviour: by default, the program will exit the main
7268 loop (and so, usually, terminate) when the last top-level program
7269 window is deleted. Beware that if you disable this behaviour (with
7270 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7271 explicitly from somewhere.
0df68c9f 7272 """
54f9ee45 7273 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
7274
7275 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 7276 """
a95a7133 7277 GetExitOnFrameDelete(self) -> bool
6c3b4aae 7278
0df68c9f
RD
7279 Get the current exit behaviour setting.
7280 """
54f9ee45 7281 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
7282
7283 def SetUseBestVisual(*args, **kwargs):
0df68c9f 7284 """
eccab1a7 7285 SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
6c3b4aae 7286
66c033b4
RD
7287 Set whether the app should try to use the best available visual on
7288 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 7289 """
54f9ee45 7290 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
7291
7292 def GetUseBestVisual(*args, **kwargs):
0df68c9f 7293 """
a95a7133 7294 GetUseBestVisual(self) -> bool
6c3b4aae 7295
0df68c9f
RD
7296 Get current UseBestVisual setting.
7297 """
54f9ee45 7298 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
7299
7300 def SetPrintMode(*args, **kwargs):
a95a7133 7301 """SetPrintMode(self, int mode)"""
54f9ee45 7302 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
7303
7304 def GetPrintMode(*args, **kwargs):
a95a7133 7305 """GetPrintMode(self) -> int"""
54f9ee45 7306 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 7307
e811c8ce 7308 def SetAssertMode(*args, **kwargs):
0df68c9f 7309 """
a95a7133 7310 SetAssertMode(self, int mode)
6c3b4aae 7311
41e2b43e 7312 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 7313 """
54f9ee45 7314 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 7315
6c3b4aae 7316 def GetAssertMode(*args, **kwargs):
0df68c9f 7317 """
a95a7133 7318 GetAssertMode(self) -> int
6c3b4aae 7319
0df68c9f
RD
7320 Get the current OnAssert behaviour setting.
7321 """
54f9ee45 7322 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 7323
e811c8ce 7324 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 7325 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 7326 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
7327
7328 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7329 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 7330 """GetMacAboutMenuItemId() -> long"""
54f9ee45 7331 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
7332
7333 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7334 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 7335 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 7336 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
7337
7338 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7339 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 7340 """GetMacExitMenuItemId() -> long"""
54f9ee45 7341 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
7342
7343 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7344 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 7345 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 7346 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
7347
7348 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7349 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 7350 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 7351 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
7352
7353 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7354 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 7355 """SetMacAboutMenuItemId(long val)"""
54f9ee45 7356 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
7357
7358 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7359 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 7360 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 7361 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
7362
7363 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7364 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 7365 """SetMacExitMenuItemId(long val)"""
54f9ee45 7366 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
7367
7368 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7369 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 7370 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 7371 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
7372
7373 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7374 def _BootstrapApp(*args, **kwargs):
0df68c9f 7375 """
a95a7133 7376 _BootstrapApp(self)
6c3b4aae 7377
0df68c9f
RD
7378 For internal use only
7379 """
54f9ee45 7380 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
7381
7382 def GetComCtl32Version(*args, **kwargs):
0df68c9f 7383 """
66c033b4 7384 GetComCtl32Version() -> int
6c3b4aae 7385
66c033b4
RD
7386 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7387 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7388 """
54f9ee45 7389 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
7390
7391 GetComCtl32Version = staticmethod(GetComCtl32Version)
33d6fd3b 7392 def IsDisplayAvailable(*args, **kwargs):
fc46b7f3 7393 """
33d6fd3b 7394 IsDisplayAvailable() -> bool
fc46b7f3
RD
7395
7396 Tests if it is possible to create a GUI in the current environment.
7397 This will mean different things on the different platforms.
7398
7399 * On X Windows systems this function will return ``False`` if it is
7400 not able to open a connection to the X display, which can happen
7401 if $DISPLAY is not set, or is not set correctly.
7402
7403 * On Mac OS X a ``False`` return value will mean that wx is not
7404 able to access the window manager, which can happen if logged in
7405 remotely or if running from the normal version of python instead
7406 of the framework version, (i.e., pythonw.)
7407
7408 * On MS Windows...
7409
7410 """
33d6fd3b
RD
7411 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7412
7413 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7414 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7415 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7416 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7417 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7418 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7419 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7420 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7421 Traits = property(GetTraits,doc="See `GetTraits`")
7422 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7423 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7424 Active = property(IsActive)
2131d850 7425_core_.PyApp_swigregister(PyApp)
d14a1e28 7426
0085ce49
RD
7427def PyApp_IsMainLoopRunning(*args):
7428 """
1fc3b23a
RD
7429 PyApp_IsMainLoopRunning() -> bool
7430
7431 Returns True if we're running the main loop, i.e. if the events can
7432 currently be dispatched.
7433 """
0085ce49 7434 return _core_.PyApp_IsMainLoopRunning(*args)
1fc3b23a 7435
0085ce49
RD
7436def PyApp_GetMacSupportPCMenuShortcuts(*args):
7437 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7438 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d14a1e28 7439
0085ce49
RD
7440def PyApp_GetMacAboutMenuItemId(*args):
7441 """PyApp_GetMacAboutMenuItemId() -> long"""
7442 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d14a1e28 7443
0085ce49
RD
7444def PyApp_GetMacPreferencesMenuItemId(*args):
7445 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7446 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d14a1e28 7447
0085ce49
RD
7448def PyApp_GetMacExitMenuItemId(*args):
7449 """PyApp_GetMacExitMenuItemId() -> long"""
7450 return _core_.PyApp_GetMacExitMenuItemId(*args)
d14a1e28 7451
0085ce49
RD
7452def PyApp_GetMacHelpMenuTitleName(*args):
7453 """PyApp_GetMacHelpMenuTitleName() -> String"""
7454 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d14a1e28 7455
e811c8ce 7456def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
0085ce49
RD
7457 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7458 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 7459
e811c8ce 7460def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
0085ce49
RD
7461 """PyApp_SetMacAboutMenuItemId(long val)"""
7462 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 7463
e811c8ce 7464def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
0085ce49
RD
7465 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7466 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 7467
e811c8ce 7468def PyApp_SetMacExitMenuItemId(*args, **kwargs):
0085ce49
RD
7469 """PyApp_SetMacExitMenuItemId(long val)"""
7470 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 7471
e811c8ce 7472def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
0085ce49
RD
7473 """PyApp_SetMacHelpMenuTitleName(String val)"""
7474 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 7475
0085ce49
RD
7476def PyApp_GetComCtl32Version(*args):
7477 """
0df68c9f 7478 PyApp_GetComCtl32Version() -> int
6c3b4aae 7479
66c033b4
RD
7480 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7481 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7482 """
0085ce49 7483 return _core_.PyApp_GetComCtl32Version(*args)
d14a1e28 7484
33d6fd3b 7485def PyApp_IsDisplayAvailable(*args):
fc46b7f3 7486 """
33d6fd3b 7487 PyApp_IsDisplayAvailable() -> bool
fc46b7f3
RD
7488
7489 Tests if it is possible to create a GUI in the current environment.
7490 This will mean different things on the different platforms.
7491
7492 * On X Windows systems this function will return ``False`` if it is
7493 not able to open a connection to the X display, which can happen
7494 if $DISPLAY is not set, or is not set correctly.
7495
7496 * On Mac OS X a ``False`` return value will mean that wx is not
7497 able to access the window manager, which can happen if logged in
7498 remotely or if running from the normal version of python instead
7499 of the framework version, (i.e., pythonw.)
7500
7501 * On MS Windows...
7502
7503 """
33d6fd3b 7504 return _core_.PyApp_IsDisplayAvailable(*args)
fc46b7f3 7505
d14a1e28
RD
7506#---------------------------------------------------------------------------
7507
7508
0085ce49
RD
7509def Exit(*args):
7510 """
0df68c9f 7511 Exit()
6c3b4aae 7512
0df68c9f
RD
7513 Force an exit of the application. Convenience for wx.GetApp().Exit()
7514 """
0085ce49 7515 return _core_.Exit(*args)
d14a1e28 7516
0085ce49
RD
7517def Yield(*args):
7518 """
0df68c9f 7519 Yield() -> bool
6c3b4aae 7520
0df68c9f
RD
7521 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7522 """
0085ce49 7523 return _core_.Yield(*args)
d14a1e28 7524
0085ce49
RD
7525def YieldIfNeeded(*args):
7526 """
0df68c9f 7527 YieldIfNeeded() -> bool
6c3b4aae 7528
0df68c9f
RD
7529 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7530 """
0085ce49 7531 return _core_.YieldIfNeeded(*args)
d14a1e28 7532
e811c8ce 7533def SafeYield(*args, **kwargs):
0085ce49 7534 """
0df68c9f 7535 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 7536
66c033b4
RD
7537 This function is similar to `wx.Yield`, except that it disables the
7538 user input to all program windows before calling `wx.Yield` and
7539 re-enables it again afterwards. If ``win`` is not None, this window
7540 will remain enabled, allowing the implementation of some limited user
7541 interaction.
6c3b4aae 7542
66c033b4 7543 :Returns: the result of the call to `wx.Yield`.
0df68c9f 7544 """
0085ce49 7545 return _core_.SafeYield(*args, **kwargs)
d14a1e28 7546
0085ce49
RD
7547def WakeUpIdle(*args):
7548 """
0df68c9f 7549 WakeUpIdle()
6c3b4aae 7550
66c033b4
RD
7551 Cause the message queue to become empty again, so idle events will be
7552 sent.
0df68c9f 7553 """
0085ce49 7554 return _core_.WakeUpIdle(*args)
d14a1e28 7555
e811c8ce 7556def PostEvent(*args, **kwargs):
0085ce49 7557 """
0df68c9f 7558 PostEvent(EvtHandler dest, Event event)
6c3b4aae 7559
66c033b4
RD
7560 Send an event to a window or other wx.EvtHandler to be processed
7561 later.
0df68c9f 7562 """
0085ce49 7563 return _core_.PostEvent(*args, **kwargs)
d14a1e28 7564
0085ce49
RD
7565def App_CleanUp(*args):
7566 """
0df68c9f 7567 App_CleanUp()
6c3b4aae 7568
41e2b43e 7569 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 7570 Python shuts down.
0df68c9f 7571 """
0085ce49 7572 return _core_.App_CleanUp(*args)
d14a1e28 7573
0085ce49
RD
7574def GetApp(*args):
7575 """
0df68c9f 7576 GetApp() -> PyApp
6c3b4aae 7577
196addbf 7578 Return a reference to the current wx.App object.
0df68c9f 7579 """
0085ce49 7580 return _core_.GetApp(*args)
5cbf236d
RD
7581
7582def SetDefaultPyEncoding(*args, **kwargs):
0085ce49 7583 """
5cbf236d
RD
7584 SetDefaultPyEncoding(string encoding)
7585
7586 Sets the encoding that wxPython will use when it needs to convert a
7587 Python string or unicode object to or from a wxString.
e505d15e
RD
7588
7589 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7590 but please be aware that the default encoding within the same locale
7591 may be slightly different on different platforms. For example, please
7592 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7593 between the common latin/roman encodings.
5cbf236d 7594 """
0085ce49 7595 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7596
0085ce49
RD
7597def GetDefaultPyEncoding(*args):
7598 """
5cbf236d
RD
7599 GetDefaultPyEncoding() -> string
7600
7601 Gets the current encoding that wxPython will use when it needs to
7602 convert a Python string or unicode object to or from a wxString.
7603 """
0085ce49 7604 return _core_.GetDefaultPyEncoding(*args)
d14a1e28
RD
7605#----------------------------------------------------------------------
7606
7607class PyOnDemandOutputWindow:
6c3b4aae
RD
7608 """
7609 A class that can be used for redirecting Python's stdout and
7610 stderr streams. It will do nothing until something is wrriten to
7611 the stream at which point it will create a Frame with a text area
7612 and write the text there.
7613 """
d14a1e28
RD
7614 def __init__(self, title = "wxPython: stdout/stderr"):
7615 self.frame = None
7616 self.title = title
412d302d
RD
7617 self.pos = wx.DefaultPosition
7618 self.size = (450, 300)
d14a1e28
RD
7619 self.parent = None
7620
7621 def SetParent(self, parent):
6c3b4aae 7622 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
7623 self.parent = parent
7624
6c3b4aae
RD
7625
7626 def CreateOutputWindow(self, st):
412d302d
RD
7627 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7628 style=wx.DEFAULT_FRAME_STYLE)
196addbf 7629 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7630 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 7631 self.text.AppendText(st)
6c3b4aae 7632 self.frame.Show(True)
2131d850 7633 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
6c3b4aae 7634
d14a1e28 7635
7409c0c6
RD
7636 def OnCloseWindow(self, event):
7637 if self.frame is not None:
7638 self.frame.Destroy()
7639 self.frame = None
7640 self.text = None
7641
7642
d14a1e28 7643 # These methods provide the file-like output behaviour.
6c3b4aae
RD
7644 def write(self, text):
7645 """
7646 Create the output window if needed and write the string to it.
7647 If not called in the context of the gui thread then uses
7648 CallAfter to do the work there.
7649 """
7650 if self.frame is None:
7651 if not wx.Thread_IsMain():
7652 wx.CallAfter(self.CreateOutputWindow, text)
7653 else:
7654 self.CreateOutputWindow(text)
7655 else:
7656 if not wx.Thread_IsMain():
7657 wx.CallAfter(self.text.AppendText, text)
7658 else:
7659 self.text.AppendText(text)
7660
d14a1e28
RD
7661
7662 def close(self):
6c3b4aae
RD
7663 if self.frame is not None:
7664 wx.CallAfter(self.frame.Close)
7665
d14a1e28 7666
19272049
RD
7667 def flush(self):
7668 pass
7669
7670
d14a1e28
RD
7671
7672#----------------------------------------------------------------------
d14a1e28
RD
7673
7674_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
fc46b7f3 7675
d14a1e28 7676class App(wx.PyApp):
6c3b4aae 7677 """
66c033b4
RD
7678 The ``wx.App`` class represents the application and is used to:
7679
7680 * bootstrap the wxPython system and initialize the underlying
7681 gui toolkit
7682 * set and get application-wide properties
7683 * implement the windowing system main message or event loop,
7684 and to dispatch events to window instances
7685 * etc.
7686
7687 Every application must have a ``wx.App`` instance, and all
7688 creation of UI objects should be delayed until after the
03e37cd5
RD
7689 ``wx.App`` object has been created in order to ensure that the gui
7690 platform and wxWidgets have been fully initialized.
66c033b4
RD
7691
7692 Normally you would derive from this class and implement an
7693 ``OnInit`` method that creates a frame and then calls
7694 ``self.SetTopWindow(frame)``.
7695
03e37cd5 7696 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 7697 directly.
6c3b4aae 7698 """
66c033b4 7699
d14a1e28
RD
7700 outputWindowClass = PyOnDemandOutputWindow
7701
03e37cd5
RD
7702 def __init__(self, redirect=_defRedirect, filename=None,
7703 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7704 """
7705 Construct a ``wx.App`` object.
7706
03e37cd5
RD
7707 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7708 redirected? Defaults to True on Windows and Mac, False
7709 otherwise. If `filename` is None then output will be
7710 redirected to a window that pops up as needed. (You can
7711 control what kind of window is created for the output by
7712 resetting the class variable ``outputWindowClass`` to a
7713 class of your choosing.)
66c033b4 7714
03e37cd5
RD
7715 :param filename: The name of a file to redirect output to, if
7716 redirect is True.
66c033b4
RD
7717
7718 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
7719 available visual provided by the system (only relevant on
7720 systems that have more than one visual.) This parameter
7721 must be used instead of calling `SetUseBestVisual` later
7722 on because it must be set before the underlying GUI
7723 toolkit is initialized.
7724
7725 :param clearSigInt: Should SIGINT be cleared? This allows the
7726 app to terminate upon a Ctrl-C in the console like other
7727 GUI apps will.
66c033b4
RD
7728
7729 :note: You should override OnInit to do applicaition
7730 initialization to ensure that the system, toolkit and
7731 wxWidgets are fully initialized.
7732 """
fc46b7f3 7733
d14a1e28
RD
7734 wx.PyApp.__init__(self)
7735
fc46b7f3 7736 # make sure we can create a GUI
33d6fd3b 7737 if not self.IsDisplayAvailable():
fc46b7f3
RD
7738
7739 if wx.Platform == "__WXMAC__":
7740 msg = """This program needs access to the screen.
7741Please run with 'pythonw', not 'python', and only when you are logged
7742in on the main display of your Mac."""
7743
7744 elif wx.Platform == "__WXGTK__":
7745 msg ="Unable to access the X Display, is $DISPLAY set properly?"
d14a1e28 7746
fc46b7f3
RD
7747 else:
7748 msg = "Unable to create GUI"
7749 # TODO: more description is needed for wxMSW...
7750
7751 raise SystemExit(msg)
7752
d14a1e28
RD
7753 # This has to be done before OnInit
7754 self.SetUseBestVisual(useBestVisual)
7755
7756 # Set the default handler for SIGINT. This fixes a problem
7757 # where if Ctrl-C is pressed in the console that started this
7758 # app then it will not appear to do anything, (not even send
7759 # KeyboardInterrupt???) but will later segfault on exit. By
7760 # setting the default handler then the app will exit, as
7761 # expected (depending on platform.)
03e37cd5
RD
7762 if clearSigInt:
7763 try:
7764 import signal
7765 signal.signal(signal.SIGINT, signal.SIG_DFL)
7766 except:
7767 pass
d14a1e28
RD
7768
7769 # Save and redirect the stdio to a window?
7770 self.stdioWin = None
7771 self.saveStdio = (_sys.stdout, _sys.stderr)
7772 if redirect:
7773 self.RedirectStdio(filename)
7774
8fb0e70a
RD
7775 # Use Python's install prefix as the default
7776 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7777
48a0c021
RD
7778 # Until the new native control for wxMac is up to par, still use the generic one.
7779 wx.SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 1)
7780
d14a1e28
RD
7781 # This finishes the initialization of wxWindows and then calls
7782 # the OnInit that should be present in the derived class
7783 self._BootstrapApp()
7784
7785
01f6b6d3
RD
7786 def OnPreInit(self):
7787 """
7788 Things that must be done after _BootstrapApp has done its
7789 thing, but would be nice if they were already done by the time
7790 that OnInit is called.
7791 """
7792 wx.StockGDI._initStockObjects()
7793
7794
02b455f2
RD
7795 def __del__(self, destroy=wx.PyApp.__del__):
7796 self.RestoreStdio() # Just in case the MainLoop was overridden
7797 destroy(self)
d14a1e28 7798
70b7a5fe 7799 def Destroy(self):
b39fe951 7800 self.this.own(False)
70b7a5fe 7801 wx.PyApp.Destroy(self)
d14a1e28
RD
7802
7803 def SetTopWindow(self, frame):
1e0c8722 7804 """Set the \"main\" top level window"""
d14a1e28
RD
7805 if self.stdioWin:
7806 self.stdioWin.SetParent(frame)
7807 wx.PyApp.SetTopWindow(self, frame)
7808
7809
7810 def MainLoop(self):
1e0c8722 7811 """Execute the main GUI event loop"""
d14a1e28
RD
7812 wx.PyApp.MainLoop(self)
7813 self.RestoreStdio()
7814
7815
7409c0c6 7816 def RedirectStdio(self, filename=None):
1e0c8722 7817 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
7818 if filename:
7819 _sys.stdout = _sys.stderr = open(filename, 'a')
7820 else:
7821 self.stdioWin = self.outputWindowClass()
7822 _sys.stdout = _sys.stderr = self.stdioWin
7823
7824
7825 def RestoreStdio(self):
02b455f2
RD
7826 try:
7827 _sys.stdout, _sys.stderr = self.saveStdio
7828 except:
7829 pass
d14a1e28
RD
7830
7831
412d302d
RD
7832 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7833 """
7834 Set the title, position and/or size of the output window if
f5b96ee1
RD
7835 the stdio has been redirected. This should be called before
7836 any output would cause the output window to be created.
412d302d
RD
7837 """
7838 if self.stdioWin:
7839 if title is not None:
7840 self.stdioWin.title = title
7841 if pos is not None:
7842 self.stdioWin.pos = pos
7843 if size is not None:
7844 self.stdioWin.size = size
7845
7846
7847
d14a1e28 7848
66c033b4 7849# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
7850App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7851App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7852App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7853App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7854App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7855App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7856App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7857App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7858App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7859App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7860App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
7861
7862#----------------------------------------------------------------------------
7863
7864class PySimpleApp(wx.App):
6c3b4aae
RD
7865 """
7866 A simple application class. You can just create one of these and
7867 then then make your top level windows later, and not have to worry
66c033b4
RD
7868 about OnInit. For example::
7869
7870 app = wx.PySimpleApp()
7871 frame = wx.Frame(None, title='Hello World')
7872 frame.Show()
7873 app.MainLoop()
7874
7875 :see: `wx.App`
7876 """
6c3b4aae 7877
03e37cd5
RD
7878 def __init__(self, redirect=False, filename=None,
7879 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7880 """
7881 :see: `wx.App.__init__`
7882 """
03e37cd5 7883 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 7884
d14a1e28 7885 def OnInit(self):
d14a1e28
RD
7886 return True
7887
7888
66c033b4 7889
6c3b4aae 7890# Is anybody using this one?
d14a1e28
RD
7891class PyWidgetTester(wx.App):
7892 def __init__(self, size = (250, 100)):
7893 self.size = size
7894 wx.App.__init__(self, 0)
7895
7896 def OnInit(self):
196addbf 7897 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
7898 self.SetTopWindow(self.frame)
7899 return True
7900
66c033b4
RD
7901 def SetWidget(self, widgetClass, *args, **kwargs):
7902 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
7903 self.frame.Show(True)
7904
7905#----------------------------------------------------------------------------
7906# DO NOT hold any other references to this object. This is how we
66c033b4 7907# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 7908# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 7909# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
7910
7911class __wxPyCleanup:
7912 def __init__(self):
54f9ee45 7913 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
7914 def __del__(self):
7915 self.cleanup()
7916
7917_sys.__wxPythonCleanup = __wxPyCleanup()
7918
7919## # another possible solution, but it gets called too early...
66c033b4
RD
7920## import atexit
7921## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
7922
7923
7924#----------------------------------------------------------------------------
7925
7926#---------------------------------------------------------------------------
2ef75293
RD
7927
7928class EventLoop(object):
093d3ff1 7929 """Proxy of C++ EventLoop class"""
0085ce49
RD
7930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7931 __repr__ = _swig_repr
7932 def __init__(self, *args, **kwargs):
2ef75293 7933 """__init__(self) -> EventLoop"""
0085ce49
RD
7934 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7935 __swig_destroy__ = _core_.delete_EventLoop
7936 __del__ = lambda self : None;
2ef75293
RD
7937 def Run(*args, **kwargs):
7938 """Run(self) -> int"""
7939 return _core_.EventLoop_Run(*args, **kwargs)
7940
7941 def Exit(*args, **kwargs):
7942 """Exit(self, int rc=0)"""
7943 return _core_.EventLoop_Exit(*args, **kwargs)
7944
7945 def Pending(*args, **kwargs):
7946 """Pending(self) -> bool"""
7947 return _core_.EventLoop_Pending(*args, **kwargs)
7948
7949 def Dispatch(*args, **kwargs):
7950 """Dispatch(self) -> bool"""
7951 return _core_.EventLoop_Dispatch(*args, **kwargs)
7952
7953 def IsRunning(*args, **kwargs):
7954 """IsRunning(self) -> bool"""
7955 return _core_.EventLoop_IsRunning(*args, **kwargs)
7956
7957 def GetActive(*args, **kwargs):
7958 """GetActive() -> EventLoop"""
7959 return _core_.EventLoop_GetActive(*args, **kwargs)
7960
7961 GetActive = staticmethod(GetActive)
7962 def SetActive(*args, **kwargs):
7963 """SetActive(EventLoop loop)"""
7964 return _core_.EventLoop_SetActive(*args, **kwargs)
7965
7966 SetActive = staticmethod(SetActive)
2131d850 7967_core_.EventLoop_swigregister(EventLoop)
2ef75293 7968
0085ce49
RD
7969def EventLoop_GetActive(*args):
7970 """EventLoop_GetActive() -> EventLoop"""
7971 return _core_.EventLoop_GetActive(*args)
2ef75293
RD
7972
7973def EventLoop_SetActive(*args, **kwargs):
0085ce49
RD
7974 """EventLoop_SetActive(EventLoop loop)"""
7975 return _core_.EventLoop_SetActive(*args, **kwargs)
2ef75293 7976
091f5bed
RD
7977class EventLoopActivator(object):
7978 """Proxy of C++ EventLoopActivator class"""
0085ce49
RD
7979 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7980 __repr__ = _swig_repr
7981 def __init__(self, *args, **kwargs):
091f5bed 7982 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
0085ce49
RD
7983 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7984 __swig_destroy__ = _core_.delete_EventLoopActivator
7985 __del__ = lambda self : None;
2131d850 7986_core_.EventLoopActivator_swigregister(EventLoopActivator)
091f5bed 7987
2ef75293 7988#---------------------------------------------------------------------------
d14a1e28 7989
eec1c382
RD
7990ACCEL_ALT = _core_.ACCEL_ALT
7991ACCEL_CTRL = _core_.ACCEL_CTRL
7992ACCEL_SHIFT = _core_.ACCEL_SHIFT
7993ACCEL_NORMAL = _core_.ACCEL_NORMAL
7994ACCEL_CMD = _core_.ACCEL_CMD
1e0c8722 7995class AcceleratorEntry(object):
66c033b4
RD
7996 """
7997 A class used to define items in an `wx.AcceleratorTable`. wxPython
7998 programs can choose to use wx.AcceleratorEntry objects, but using a
7999 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 8000 as well. See `__init__` for of the tuple values.
66c033b4
RD
8001
8002 :see: `wx.AcceleratorTable`
8003 """
0085ce49
RD
8004 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8005 __repr__ = _swig_repr
8006 def __init__(self, *args, **kwargs):
66c033b4
RD
8007 """
8008 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
8009
8010 Construct a wx.AcceleratorEntry.
66c033b4 8011 """
0085ce49
RD
8012 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
8013 __swig_destroy__ = _core_.delete_AcceleratorEntry
8014 __del__ = lambda self : None;
1e0c8722 8015 def Set(*args, **kwargs):
66c033b4
RD
8016 """
8017 Set(self, int flags, int keyCode, int cmd)
1e0c8722 8018
66c033b4
RD
8019 (Re)set the attributes of a wx.AcceleratorEntry.
8020 :see `__init__`
8021 """
8022 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722 8023
97ab0f6a
RD
8024 def Create(*args, **kwargs):
8025 """
8026 Create(String str) -> AcceleratorEntry
8027
8028 Create accelerator corresponding to the specified string, or None if
8029 it coulnd't be parsed.
8030 """
8031 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8032
8033 Create = staticmethod(Create)
1e0c8722 8034 def GetFlags(*args, **kwargs):
66c033b4
RD
8035 """
8036 GetFlags(self) -> int
8037
8038 Get the AcceleratorEntry's flags.
8039 """
54f9ee45 8040 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
8041
8042 def GetKeyCode(*args, **kwargs):
66c033b4
RD
8043 """
8044 GetKeyCode(self) -> int
8045
8046 Get the AcceleratorEntry's keycode.
8047 """
54f9ee45 8048 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
8049
8050 def GetCommand(*args, **kwargs):
66c033b4
RD
8051 """
8052 GetCommand(self) -> int
8053
8054 Get the AcceleratorEntry's command ID.
8055 """
54f9ee45 8056 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722 8057
97ab0f6a
RD
8058 def IsOk(*args, **kwargs):
8059 """IsOk(self) -> bool"""
8060 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
8061
8062 def ToString(*args, **kwargs):
8063 """
8064 ToString(self) -> String
8065
8066 Returns a string representation for the this accelerator. The string
8067 is formatted using the <flags>-<keycode> format where <flags> maybe a
8068 hyphen-separed list of "shift|alt|ctrl"
8069
8070 """
8071 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
8072
8073 def FromString(*args, **kwargs):
8074 """
8075 FromString(self, String str) -> bool
8076
8077 Returns true if the given string correctly initialized this object.
8078 """
8079 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
8080
2bf58437
RD
8081 Command = property(GetCommand,doc="See `GetCommand`")
8082 Flags = property(GetFlags,doc="See `GetFlags`")
8083 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
2131d850 8084_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
1e0c8722 8085
97ab0f6a
RD
8086def AcceleratorEntry_Create(*args, **kwargs):
8087 """
8088 AcceleratorEntry_Create(String str) -> AcceleratorEntry
8089
8090 Create accelerator corresponding to the specified string, or None if
8091 it coulnd't be parsed.
8092 """
8093 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8094
1e0c8722 8095class AcceleratorTable(Object):
66c033b4
RD
8096 """
8097 An accelerator table allows the application to specify a table of
8098 keyboard shortcuts for menus or other commands. On Windows, menu or
8099 button commands are supported; on GTK, only menu commands are
8100 supported.
66c033b4 8101 """
0085ce49
RD
8102 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8103 __repr__ = _swig_repr
8104 def __init__(self, *args, **kwargs):
0df68c9f
RD
8105 """
8106 __init__(entries) -> AcceleratorTable
1e0c8722 8107
66c033b4
RD
8108 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8109 items or or of 3-tuples (flags, keyCode, cmdID)
8110
8111 :see: `wx.AcceleratorEntry`
0df68c9f 8112 """
0085ce49
RD
8113 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
8114 __swig_destroy__ = _core_.delete_AcceleratorTable
8115 __del__ = lambda self : None;
b39fe951
RD
8116 def IsOk(*args, **kwargs):
8117 """IsOk(self) -> bool"""
8118 return _core_.AcceleratorTable_IsOk(*args, **kwargs)
1e0c8722 8119
b39fe951 8120 Ok = IsOk
2131d850 8121_core_.AcceleratorTable_swigregister(AcceleratorTable)
1e0c8722 8122
cbfc9df6
RD
8123def GetAccelFromString(label):
8124 entry = AcceleratorEntry()
8125 entry.FromString(label)
8126 return entry
1e0c8722 8127
1e0c8722
RD
8128#---------------------------------------------------------------------------
8129
74a57fcd
RD
8130class VisualAttributes(object):
8131 """struct containing all the visual attributes of a control"""
0085ce49
RD
8132 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8133 __repr__ = _swig_repr
8134 def __init__(self, *args, **kwargs):
74a57fcd 8135 """
a95a7133 8136 __init__(self) -> VisualAttributes
74a57fcd
RD
8137
8138 struct containing all the visual attributes of a control
8139 """
0085ce49
RD
8140 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
8141 __swig_destroy__ = _core_.delete_VisualAttributes
8142 __del__ = lambda self : None;
54f9ee45
RD
8143 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
8144 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
8145 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 8146_core_.VisualAttributes_swigregister(VisualAttributes)
74a57fcd
RD
8147NullAcceleratorTable = cvar.NullAcceleratorTable
8148PanelNameStr = cvar.PanelNameStr
8149
54f9ee45
RD
8150WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8151WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8152WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8153WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8154WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 8155class Window(EvtHandler):
15afbcd0
RD
8156 """
8157 wx.Window is the base class for all windows and represents any visible
8158 object on the screen. All controls, top level windows and so on are
8159 wx.Windows. Sizers and device contexts are not however, as they don't
8160 appear on screen themselves.
8161
8162 """
0085ce49
RD
8163 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8164 __repr__ = _swig_repr
8165 def __init__(self, *args, **kwargs):
0df68c9f 8166 """
a95a7133 8167 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 8168 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
8169
8170 Construct and show a generic Window.
0df68c9f 8171 """
0085ce49 8172 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d14a1e28 8173 self._setOORInfo(self)
d14a1e28 8174
e811c8ce 8175 def Create(*args, **kwargs):
0df68c9f 8176 """
a95a7133 8177 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 8178 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
8179
8180 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 8181 """
54f9ee45 8182 return _core_.Window_Create(*args, **kwargs)
d14a1e28 8183
e811c8ce 8184 def Close(*args, **kwargs):
15afbcd0 8185 """
a95a7133 8186 Close(self, bool force=False) -> bool
15afbcd0
RD
8187
8188 This function simply generates a EVT_CLOSE event whose handler usually
8189 tries to close the window. It doesn't close the window itself,
8190 however. If force is False (the default) then the window's close
8191 handler will be allowed to veto the destruction of the window.
15afbcd0 8192 """
54f9ee45 8193 return _core_.Window_Close(*args, **kwargs)
d14a1e28 8194
e811c8ce 8195 def Destroy(*args, **kwargs):
0df68c9f 8196 """
a95a7133 8197 Destroy(self) -> bool
d14a1e28 8198
15afbcd0
RD
8199 Destroys the window safely. Frames and dialogs are not destroyed
8200 immediately when this function is called -- they are added to a list
8201 of windows to be deleted on idle time, when all the window's events
8202 have been processed. This prevents problems with events being sent to
8203 non-existent windows.
8204
8205 Returns True if the window has either been successfully deleted, or it
8206 has been added to the list of windows pending real deletion.
0df68c9f 8207 """
b39fe951
RD
8208 args[0].this.own(False)
8209 return _core_.Window_Destroy(*args, **kwargs)
d14a1e28 8210
e811c8ce 8211 def DestroyChildren(*args, **kwargs):
15afbcd0 8212 """
a95a7133 8213 DestroyChildren(self) -> bool
15afbcd0 8214
41e2b43e
RD
8215 Destroys all children of a window. Called automatically by the
8216 destructor.
15afbcd0 8217 """
54f9ee45 8218 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 8219
e811c8ce 8220 def IsBeingDeleted(*args, **kwargs):
15afbcd0 8221 """
a95a7133 8222 IsBeingDeleted(self) -> bool
15afbcd0
RD
8223
8224 Is the window in the process of being deleted?
8225 """
54f9ee45 8226 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 8227
e811c8ce 8228 def SetLabel(*args, **kwargs):
15afbcd0 8229 """
a95a7133 8230 SetLabel(self, String label)
15afbcd0
RD
8231
8232 Set the text which the window shows in its label if applicable.
8233 """
54f9ee45 8234 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 8235
e811c8ce 8236 def GetLabel(*args, **kwargs):
15afbcd0 8237 """
a95a7133 8238 GetLabel(self) -> String
15afbcd0 8239
41e2b43e
RD
8240 Generic way of getting a label from any window, for identification
8241 purposes. The interpretation of this function differs from class to
8242 class. For frames and dialogs, the value returned is the title. For
8243 buttons or static text controls, it is the button text. This function
8244 can be useful for meta-programs such as testing tools or special-needs
8245 access programs)which need to identify windows by name.
15afbcd0 8246 """
54f9ee45 8247 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 8248
e811c8ce 8249 def SetName(*args, **kwargs):
15afbcd0 8250 """
a95a7133 8251 SetName(self, String name)
15afbcd0 8252
41e2b43e
RD
8253 Sets the window's name. The window name is used for ressource setting
8254 in X, it is not the same as the window title/label
15afbcd0 8255 """
54f9ee45 8256 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 8257
e811c8ce 8258 def GetName(*args, **kwargs):
15afbcd0 8259 """
a95a7133 8260 GetName(self) -> String
15afbcd0 8261
41e2b43e
RD
8262 Returns the windows name. This name is not guaranteed to be unique;
8263 it is up to the programmer to supply an appropriate name in the window
8264 constructor or via wx.Window.SetName.
15afbcd0 8265 """
54f9ee45 8266 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 8267
4276dc52
RD
8268 def SetWindowVariant(*args, **kwargs):
8269 """
a95a7133 8270 SetWindowVariant(self, int variant)
4276dc52 8271
41e2b43e
RD
8272 Sets the variant of the window/font size to use for this window, if
8273 the platform supports variants, for example, wxMac.
4276dc52 8274 """
54f9ee45 8275 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
8276
8277 def GetWindowVariant(*args, **kwargs):
a95a7133 8278 """GetWindowVariant(self) -> int"""
54f9ee45 8279 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 8280
e811c8ce 8281 def SetId(*args, **kwargs):
15afbcd0 8282 """
a95a7133 8283 SetId(self, int winid)
15afbcd0
RD
8284
8285 Sets the identifier of the window. Each window has an integer
8286 identifier. If the application has not provided one, an identifier
8287 will be generated. Normally, the identifier should be provided on
8288 creation and should not be modified subsequently.
8289 """
54f9ee45 8290 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 8291
e811c8ce 8292 def GetId(*args, **kwargs):
15afbcd0 8293 """
a95a7133 8294 GetId(self) -> int
15afbcd0
RD
8295
8296 Returns the identifier of the window. Each window has an integer
8297 identifier. If the application has not provided one (or the default Id
8298 -1 is used) then an unique identifier with a negative value will be
8299 generated.
8300 """
54f9ee45 8301 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 8302
e811c8ce 8303 def NewControlId(*args, **kwargs):
15afbcd0 8304 """
66c033b4 8305 NewControlId() -> int
15afbcd0
RD
8306
8307 Generate a control id for the controls which were not given one.
8308 """
54f9ee45 8309 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 8310
e811c8ce
RD
8311 NewControlId = staticmethod(NewControlId)
8312 def NextControlId(*args, **kwargs):
15afbcd0 8313 """
66c033b4 8314 NextControlId(int winid) -> int
15afbcd0
RD
8315
8316 Get the id of the control following the one with the given
41e2b43e 8317 autogenerated) id
15afbcd0 8318 """
54f9ee45 8319 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 8320
e811c8ce
RD
8321 NextControlId = staticmethod(NextControlId)
8322 def PrevControlId(*args, **kwargs):
15afbcd0 8323 """
66c033b4 8324 PrevControlId(int winid) -> int
15afbcd0
RD
8325
8326 Get the id of the control preceding the one with the given
41e2b43e 8327 autogenerated) id
15afbcd0 8328 """
54f9ee45 8329 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 8330
e811c8ce 8331 PrevControlId = staticmethod(PrevControlId)
97ab0f6a
RD
8332 def GetLayoutDirection(*args, **kwargs):
8333 """
994453b8 8334 GetLayoutDirection(self) -> int
97ab0f6a
RD
8335
8336 Get the layout direction (LTR or RTL) for this window. Returns
8337 ``wx.Layout_Default`` if layout direction is not supported.
8338 """
8339 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8340
8341 def SetLayoutDirection(*args, **kwargs):
8342 """
994453b8 8343 SetLayoutDirection(self, int dir)
97ab0f6a
RD
8344
8345 Set the layout direction (LTR or RTL) for this window.
8346 """
8347 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8348
8349 def AdjustForLayoutDirection(*args, **kwargs):
8350 """
8351 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8352
8353 Mirror coordinates for RTL layout if this window uses it and if the
8354 mirroring is not done automatically like Win32.
8355 """
8356 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8357
e811c8ce 8358 def SetSize(*args, **kwargs):
15afbcd0 8359 """
a95a7133 8360 SetSize(self, Size size)
15afbcd0
RD
8361
8362 Sets the size of the window in pixels.
8363 """
54f9ee45 8364 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 8365
e811c8ce 8366 def SetDimensions(*args, **kwargs):
15afbcd0 8367 """
a95a7133 8368 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
8369
8370 Sets the position and size of the window in pixels. The sizeFlags
8371 parameter indicates the interpretation of the other params if they are
e505d15e
RD
8372 equal to -1.
8373
8374 ======================== ======================================
8375 wx.SIZE_AUTO A -1 indicates that a class-specific
8376 default should be used.
8377 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8378 -1 values are supplied.
8379 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8380 interpreted as real dimensions, not
8381 default values.
8382 ======================== ======================================
8383
15afbcd0 8384 """
54f9ee45 8385 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 8386
e811c8ce 8387 def SetRect(*args, **kwargs):
15afbcd0 8388 """
a95a7133 8389 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
8390
8391 Sets the position and size of the window in pixels using a wx.Rect.
8392 """
54f9ee45 8393 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 8394
e811c8ce 8395 def SetSizeWH(*args, **kwargs):
15afbcd0 8396 """
a95a7133 8397 SetSizeWH(self, int width, int height)
15afbcd0
RD
8398
8399 Sets the size of the window in pixels.
8400 """
54f9ee45 8401 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 8402
e811c8ce 8403 def Move(*args, **kwargs):
15afbcd0 8404 """
a95a7133 8405 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
8406
8407 Moves the window to the given position.
8408 """
54f9ee45 8409 return _core_.Window_Move(*args, **kwargs)
d14a1e28 8410
e811c8ce
RD
8411 SetPosition = Move
8412 def MoveXY(*args, **kwargs):
15afbcd0 8413 """
a95a7133 8414 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
8415
8416 Moves the window to the given position.
8417 """
54f9ee45 8418 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 8419
580080c5 8420 def SetInitialSize(*args, **kwargs):
f8167d6e 8421 """
580080c5 8422 SetInitialSize(self, Size size=DefaultSize)
f8167d6e
RD
8423
8424 A 'Smart' SetSize that will fill in default size components with the
8425 window's *best size* values. Also set's the minsize for use with sizers.
8426 """
580080c5 8427 return _core_.Window_SetInitialSize(*args, **kwargs)
f8167d6e 8428
580080c5 8429 SetBestFittingSize = wx._deprecated(SetInitialSize, 'Use `SetInitialSize`')
e811c8ce 8430 def Raise(*args, **kwargs):
15afbcd0 8431 """
a95a7133 8432 Raise(self)
15afbcd0 8433
943e8dfd 8434 Raises the window to the top of the window hierarchy. In current
70b63a99 8435 version of wxWidgets this works both for managed and child windows.
15afbcd0 8436 """
54f9ee45 8437 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
8438
8439 def Lower(*args, **kwargs):
15afbcd0 8440 """
a95a7133 8441 Lower(self)
15afbcd0 8442
943e8dfd 8443 Lowers the window to the bottom of the window hierarchy. In current
70b63a99 8444 version of wxWidgets this works both for managed and child windows.
15afbcd0 8445 """
54f9ee45 8446 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
8447
8448 def SetClientSize(*args, **kwargs):
15afbcd0 8449 """
a95a7133 8450 SetClientSize(self, Size size)
15afbcd0
RD
8451
8452 This sets the size of the window client area in pixels. Using this
8453 function to size a window tends to be more device-independent than
8454 wx.Window.SetSize, since the application need not worry about what
8455 dimensions the border or title bar have when trying to fit the window
8456 around panel items, for example.
8457 """
54f9ee45 8458 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
8459
8460 def SetClientSizeWH(*args, **kwargs):
15afbcd0 8461 """
a95a7133 8462 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
8463
8464 This sets the size of the window client area in pixels. Using this
8465 function to size a window tends to be more device-independent than
8466 wx.Window.SetSize, since the application need not worry about what
8467 dimensions the border or title bar have when trying to fit the window
8468 around panel items, for example.
8469 """
54f9ee45 8470 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
8471
8472 def SetClientRect(*args, **kwargs):
15afbcd0 8473 """
a95a7133 8474 SetClientRect(self, Rect rect)
15afbcd0
RD
8475
8476 This sets the size of the window client area in pixels. Using this
8477 function to size a window tends to be more device-independent than
8478 wx.Window.SetSize, since the application need not worry about what
8479 dimensions the border or title bar have when trying to fit the window
8480 around panel items, for example.
8481 """
54f9ee45 8482 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
8483
8484 def GetPosition(*args, **kwargs):
0df68c9f 8485 """
a95a7133 8486 GetPosition(self) -> Point
e811c8ce 8487
75219dcb
RD
8488 Get the window's position. Notice that the position is in client
8489 coordinates for child windows and screen coordinates for the top level
8490 ones, use `GetScreenPosition` if you need screen coordinates for all
8491 kinds of windows.
0df68c9f 8492 """
54f9ee45 8493 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
8494
8495 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
8496 """
8497 GetPositionTuple() -> (x,y)
e811c8ce 8498
75219dcb
RD
8499 Get the window's position. Notice that the position is in client
8500 coordinates for child windows and screen coordinates for the top level
8501 ones, use `GetScreenPosition` if you need screen coordinates for all
8502 kinds of windows.
0df68c9f 8503 """
54f9ee45 8504 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce 8505
75219dcb
RD
8506 def GetScreenPosition(*args, **kwargs):
8507 """
8508 GetScreenPosition(self) -> Point
8509
8510 Get the position of the window in screen coordinantes.
8511 """
8512 return _core_.Window_GetScreenPosition(*args, **kwargs)
8513
8514 def GetScreenPositionTuple(*args, **kwargs):
8515 """
8516 GetScreenPositionTuple() -> (x,y)
8517
8518 Get the position of the window in screen coordinantes.
8519 """
8520 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8521
8522 def GetScreenRect(*args, **kwargs):
8523 """
8524 GetScreenRect(self) -> Rect
8525
8526 Returns the size and position of the window in screen coordinantes as
8527 a `wx.Rect` object.
8528 """
8529 return _core_.Window_GetScreenRect(*args, **kwargs)
8530
e811c8ce 8531 def GetSize(*args, **kwargs):
0df68c9f 8532 """
a95a7133 8533 GetSize(self) -> Size
e811c8ce 8534
0df68c9f
RD
8535 Get the window size.
8536 """
54f9ee45 8537 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
8538
8539 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
8540 """
8541 GetSizeTuple() -> (width, height)
e811c8ce 8542
0df68c9f
RD
8543 Get the window size.
8544 """
54f9ee45 8545 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
8546
8547 def GetRect(*args, **kwargs):
15afbcd0 8548 """
a95a7133 8549 GetRect(self) -> Rect
15afbcd0 8550
75219dcb 8551 Returns the size and position of the window as a `wx.Rect` object.
15afbcd0 8552 """
54f9ee45 8553 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
8554
8555 def GetClientSize(*args, **kwargs):
0df68c9f 8556 """
a95a7133 8557 GetClientSize(self) -> Size
e811c8ce 8558
15afbcd0
RD
8559 This gets the size of the window's 'client area' in pixels. The client
8560 area is the area which may be drawn on by the programmer, excluding
8561 title bar, border, scrollbars, etc.
0df68c9f 8562 """
54f9ee45 8563 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
8564
8565 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
8566 """
8567 GetClientSizeTuple() -> (width, height)
e811c8ce 8568
15afbcd0
RD
8569 This gets the size of the window's 'client area' in pixels. The client
8570 area is the area which may be drawn on by the programmer, excluding
8571 title bar, border, scrollbars, etc.
0df68c9f 8572 """
54f9ee45 8573 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
8574
8575 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 8576 """
a95a7133 8577 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
8578
8579 Get the origin of the client area of the window relative to the
8580 window's top left corner (the client area may be shifted because of
8581 the borders, scrollbars, other decorations...)
8582 """
54f9ee45 8583 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
8584
8585 def GetClientRect(*args, **kwargs):
15afbcd0 8586 """
a95a7133 8587 GetClientRect(self) -> Rect
15afbcd0 8588
61863841 8589 Get the client area position and size as a `wx.Rect` object.
15afbcd0 8590 """
54f9ee45 8591 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
8592
8593 def GetBestSize(*args, **kwargs):
0df68c9f 8594 """
a95a7133 8595 GetBestSize(self) -> Size
e811c8ce 8596
248ed943 8597 This function returns the best acceptable minimal size for the
41e2b43e
RD
8598 window, if applicable. For example, for a static text control, it will
8599 be the minimal size such that the control label is not truncated. For
8600 windows containing subwindows (suzh aswx.Panel), the size returned by
8601 this function will be the same as the size the window would have had
8602 after calling Fit.
0df68c9f 8603 """
54f9ee45 8604 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
8605
8606 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
8607 """
8608 GetBestSizeTuple() -> (width, height)
e811c8ce 8609
248ed943 8610 This function returns the best acceptable minimal size for the
41e2b43e
RD
8611 window, if applicable. For example, for a static text control, it will
8612 be the minimal size such that the control label is not truncated. For
8613 windows containing subwindows (suzh aswx.Panel), the size returned by
8614 this function will be the same as the size the window would have had
8615 after calling Fit.
0df68c9f 8616 """
54f9ee45 8617 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 8618
dfbb5885
RD
8619 def InvalidateBestSize(*args, **kwargs):
8620 """
8621 InvalidateBestSize(self)
8622
8623 Reset the cached best size value so it will be recalculated the next
8624 time it is needed.
8625 """
8626 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8627
e2813725
RD
8628 def CacheBestSize(*args, **kwargs):
8629 """
8630 CacheBestSize(self, Size size)
8631
8632 Cache the best size so it doesn't need to be calculated again, (at least until
8633 some properties of the window change.)
8634 """
8635 return _core_.Window_CacheBestSize(*args, **kwargs)
8636
580080c5 8637 def GetEffectiveMinSize(*args, **kwargs):
dfbb5885 8638 """
580080c5 8639 GetEffectiveMinSize(self) -> Size
dfbb5885
RD
8640
8641 This function will merge the window's best size into the window's
8642 minimum size, giving priority to the min size components, and returns
8643 the results.
8644
8645 """
580080c5 8646 return _core_.Window_GetEffectiveMinSize(*args, **kwargs)
dfbb5885 8647
0d82d64e 8648 GetBestFittingSize = wx._deprecated(GetEffectiveMinSize, 'Use `GetEffectiveMinSize` instead.')
8f514ab4
RD
8649 def GetAdjustedBestSize(self):
8650 s = self.GetBestSize()
8651 return wx.Size(max(s.width, self.GetMinWidth()),
8652 max(s.height, self.GetMinHeight()))
580080c5 8653 GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetEffectiveMinSize` instead.')
e811c8ce
RD
8654
8655 def Center(*args, **kwargs):
15afbcd0 8656 """
a95a7133 8657 Center(self, int direction=BOTH)
15afbcd0
RD
8658
8659 Centers the window. The parameter specifies the direction for
8660 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8661 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8662 on the entire screen and not on its parent window. If it is a
8663 top-level window and has no parent then it will always be centered
8664 relative to the screen.
8665 """
54f9ee45 8666 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
8667
8668 Centre = Center
e811c8ce 8669 def CenterOnParent(*args, **kwargs):
15afbcd0 8670 """
a95a7133 8671 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
8672
8673 Center with respect to the the parent window
8674 """
54f9ee45 8675 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
8676
8677 CentreOnParent = CenterOnParent
8678 def Fit(*args, **kwargs):
15afbcd0 8679 """
a95a7133 8680 Fit(self)
15afbcd0
RD
8681
8682 Sizes the window so that it fits around its subwindows. This function
8683 won't do anything if there are no subwindows and will only really work
8684 correctly if sizers are used for the subwindows layout. Also, if the
8685 window has exactly one subwindow it is better (faster and the result
8686 is more precise as Fit adds some margin to account for fuzziness of
8687 its calculations) to call window.SetClientSize(child.GetSize())
8688 instead of calling Fit.
8689 """
54f9ee45 8690 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
8691
8692 def FitInside(*args, **kwargs):
15afbcd0 8693 """
a95a7133 8694 FitInside(self)
15afbcd0
RD
8695
8696 Similar to Fit, but sizes the interior (virtual) size of a
8697 window. Mainly useful with scrolled windows to reset scrollbars after
8698 sizing changes that do not trigger a size event, and/or scrolled
8699 windows without an interior sizer. This function similarly won't do
8700 anything if there are no subwindows.
8701 """
54f9ee45 8702 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 8703
f16ab95d 8704 def SetSizeHints(*args, **kwargs):
0df68c9f 8705 """
a95a7133 8706 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 8707 int incH=-1)
15afbcd0
RD
8708
8709 Allows specification of minimum and maximum window sizes, and window
8710 size increments. If a pair of values is not set (or set to -1), the
8711 default values will be used. If this function is called, the user
908b74cd
RD
8712 will not be able to size the window outside the given bounds (if it is
8713 a top-level window.) Sizers will also inspect the minimum window size
8714 and will use that value if set when calculating layout.
8715
8716 The resizing increments are only significant under Motif or Xt.
0df68c9f 8717 """
f16ab95d 8718 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 8719
f16ab95d
RD
8720 def SetSizeHintsSz(*args, **kwargs):
8721 """
8722 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8723
8724 Allows specification of minimum and maximum window sizes, and window
8725 size increments. If a pair of values is not set (or set to -1), the
8726 default values will be used. If this function is called, the user
8727 will not be able to size the window outside the given bounds (if it is
8728 a top-level window.) Sizers will also inspect the minimum window size
8729 and will use that value if set when calculating layout.
8730
8731 The resizing increments are only significant under Motif or Xt.
8732 """
8733 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8734
8735 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 8736 """
908b74cd 8737 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
8738
8739 Allows specification of minimum and maximum virtual window sizes. If a
8740 pair of values is not set (or set to -1), the default values will be
8741 used. If this function is called, the user will not be able to size
8742 the virtual area of the window outside the given bounds.
8743 """
f16ab95d
RD
8744 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8745
8746 def SetVirtualSizeHintsSz(*args, **kwargs):
8747 """
8748 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8749
8750 Allows specification of minimum and maximum virtual window sizes. If a
8751 pair of values is not set (or set to -1), the default values will be
8752 used. If this function is called, the user will not be able to size
8753 the virtual area of the window outside the given bounds.
8754 """
8755 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 8756
908b74cd
RD
8757 def GetMaxSize(*args, **kwargs):
8758 """GetMaxSize(self) -> Size"""
8759 return _core_.Window_GetMaxSize(*args, **kwargs)
8760
8761 def GetMinSize(*args, **kwargs):
8762 """GetMinSize(self) -> Size"""
8763 return _core_.Window_GetMinSize(*args, **kwargs)
8764
8765 def SetMinSize(*args, **kwargs):
8766 """
8767 SetMinSize(self, Size minSize)
8768
8769 A more convenient method than `SetSizeHints` for setting just the
8770 min size.
8771 """
8772 return _core_.Window_SetMinSize(*args, **kwargs)
8773
8774 def SetMaxSize(*args, **kwargs):
8775 """
8776 SetMaxSize(self, Size maxSize)
8777
8778 A more convenient method than `SetSizeHints` for setting just the
8779 max size.
8780 """
8781 return _core_.Window_SetMaxSize(*args, **kwargs)
8782
e811c8ce 8783 def GetMinWidth(*args, **kwargs):
a95a7133 8784 """GetMinWidth(self) -> int"""
54f9ee45 8785 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
8786
8787 def GetMinHeight(*args, **kwargs):
a95a7133 8788 """GetMinHeight(self) -> int"""
54f9ee45 8789 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
8790
8791 def GetMaxWidth(*args, **kwargs):
a95a7133 8792 """GetMaxWidth(self) -> int"""
54f9ee45 8793 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
8794
8795 def GetMaxHeight(*args, **kwargs):
a95a7133 8796 """GetMaxHeight(self) -> int"""
54f9ee45 8797 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 8798
e811c8ce 8799 def SetVirtualSize(*args, **kwargs):
0df68c9f 8800 """
a95a7133 8801 SetVirtualSize(self, Size size)
e811c8ce 8802
15afbcd0
RD
8803 Set the the virtual size of a window in pixels. For most windows this
8804 is just the client area of the window, but for some like scrolled
8805 windows it is more or less independent of the screen window size.
0df68c9f 8806 """
54f9ee45 8807 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
8808
8809 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 8810 """
a95a7133 8811 SetVirtualSizeWH(self, int w, int h)
e811c8ce 8812
15afbcd0
RD
8813 Set the the virtual size of a window in pixels. For most windows this
8814 is just the client area of the window, but for some like scrolled
8815 windows it is more or less independent of the screen window size.
0df68c9f 8816 """
54f9ee45 8817 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
8818
8819 def GetVirtualSize(*args, **kwargs):
0df68c9f 8820 """
a95a7133 8821 GetVirtualSize(self) -> Size
e811c8ce 8822
15afbcd0
RD
8823 Get the the virtual size of the window in pixels. For most windows
8824 this is just the client area of the window, but for some like scrolled
8825 windows it is more or less independent of the screen window size.
0df68c9f 8826 """
54f9ee45 8827 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
8828
8829 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
8830 """
8831 GetVirtualSizeTuple() -> (width, height)
e811c8ce 8832
15afbcd0
RD
8833 Get the the virtual size of the window in pixels. For most windows
8834 this is just the client area of the window, but for some like scrolled
8835 windows it is more or less independent of the screen window size.
0df68c9f 8836 """
54f9ee45 8837 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce 8838
cbdf0fb0
RD
8839 def GetWindowBorderSize(*args, **kwargs):
8840 """
8841 GetWindowBorderSize(self) -> Size
8842
8843 Return the size of the left/right and top/bottom borders.
8844 """
8845 return _core_.Window_GetWindowBorderSize(*args, **kwargs)
8846
e811c8ce 8847 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 8848 """
a95a7133 8849 GetBestVirtualSize(self) -> Size
15afbcd0
RD
8850
8851 Return the largest of ClientSize and BestSize (as determined by a
8852 sizer, interior children, or other means)
8853 """
54f9ee45 8854 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
8855
8856 def Show(*args, **kwargs):
15afbcd0 8857 """
a95a7133 8858 Show(self, bool show=True) -> bool
15afbcd0
RD
8859
8860 Shows or hides the window. You may need to call Raise for a top level
8861 window if you want to bring it to top, although this is not needed if
8862 Show is called immediately after the frame creation. Returns True if
8863 the window has been shown or hidden or False if nothing was done
8864 because it already was in the requested state.
8865 """
54f9ee45 8866 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
8867
8868 def Hide(*args, **kwargs):
15afbcd0 8869 """
a95a7133 8870 Hide(self) -> bool
15afbcd0
RD
8871
8872 Equivalent to calling Show(False).
8873 """
54f9ee45 8874 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
8875
8876 def Enable(*args, **kwargs):
15afbcd0 8877 """
a95a7133 8878 Enable(self, bool enable=True) -> bool
15afbcd0
RD
8879
8880 Enable or disable the window for user input. Note that when a parent
8881 window is disabled, all of its children are disabled as well and they
8882 are reenabled again when the parent is. Returns true if the window
8883 has been enabled or disabled, false if nothing was done, i.e. if the
8884 window had already been in the specified state.
8885 """
54f9ee45 8886 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
8887
8888 def Disable(*args, **kwargs):
15afbcd0 8889 """
a95a7133 8890 Disable(self) -> bool
15afbcd0
RD
8891
8892 Disables the window, same as Enable(false).
8893 """
54f9ee45 8894 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
8895
8896 def IsShown(*args, **kwargs):
15afbcd0 8897 """
a95a7133 8898 IsShown(self) -> bool
15afbcd0
RD
8899
8900 Returns true if the window is shown, false if it has been hidden.
8901 """
54f9ee45 8902 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
8903
8904 def IsEnabled(*args, **kwargs):
15afbcd0 8905 """
a95a7133 8906 IsEnabled(self) -> bool
15afbcd0
RD
8907
8908 Returns true if the window is enabled for input, false otherwise.
cbfc9df6
RD
8909 This method takes into account the enabled state of parent windows up
8910 to the top-level window.
15afbcd0 8911 """
54f9ee45 8912 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce 8913
cbfc9df6
RD
8914 def IsThisEnabled(*args, **kwargs):
8915 """
8916 IsThisEnabled(self) -> bool
8917
8918 Returns the internal enabled state independent of the parent(s) state,
8919 i.e. the state in which the window would be if all of its parents are
8920 enabled. Use `IsEnabled` to get the effective window state.
8921 """
8922 return _core_.Window_IsThisEnabled(*args, **kwargs)
8923
33d6fd3b
RD
8924 def IsShownOnScreen(*args, **kwargs):
8925 """
8926 IsShownOnScreen(self) -> bool
8927
8928 Returns ``True`` if the window is physically visible on the screen,
8929 i.e. it is shown and all its parents up to the toplevel window are
8930 shown as well.
8931 """
8932 return _core_.Window_IsShownOnScreen(*args, **kwargs)
8933
e811c8ce 8934 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 8935 """
a95a7133 8936 SetWindowStyleFlag(self, long style)
15afbcd0 8937
41e2b43e
RD
8938 Sets the style of the window. Please note that some styles cannot be
8939 changed after the window creation and that Refresh() might need to be
8940 called after changing the others for the change to take place
8941 immediately.
15afbcd0 8942 """
54f9ee45 8943 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
8944
8945 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 8946 """
a95a7133 8947 GetWindowStyleFlag(self) -> long
e811c8ce 8948
15afbcd0
RD
8949 Gets the window style that was passed to the constructor or Create
8950 method.
8951 """
54f9ee45 8952 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 8953
15afbcd0 8954 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 8955 def HasFlag(*args, **kwargs):
15afbcd0 8956 """
a95a7133 8957 HasFlag(self, int flag) -> bool
15afbcd0
RD
8958
8959 Test if the given style is set for this window.
8960 """
54f9ee45 8961 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
8962
8963 def IsRetained(*args, **kwargs):
15afbcd0 8964 """
a95a7133 8965 IsRetained(self) -> bool
15afbcd0
RD
8966
8967 Returns true if the window is retained, false otherwise. Retained
8968 windows are only available on X platforms.
8969 """
54f9ee45 8970 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce 8971
5917d041
RD
8972 def ToggleWindowStyle(*args, **kwargs):
8973 """
8974 ToggleWindowStyle(self, int flag) -> bool
8975
8976 Turn the flag on if it had been turned off before and vice versa,
8977 returns True if the flag is turned on by this function call.
8978 """
8979 return _core_.Window_ToggleWindowStyle(*args, **kwargs)
8980
e811c8ce 8981 def SetExtraStyle(*args, **kwargs):
15afbcd0 8982 """
a95a7133 8983 SetExtraStyle(self, long exStyle)
15afbcd0
RD
8984
8985 Sets the extra style bits for the window. Extra styles are the less
8986 often used style bits which can't be set with the constructor or with
8987 SetWindowStyleFlag()
8988 """
54f9ee45 8989 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
8990
8991 def GetExtraStyle(*args, **kwargs):
15afbcd0 8992 """
a95a7133 8993 GetExtraStyle(self) -> long
15afbcd0
RD
8994
8995 Returns the extra style bits for the window.
8996 """
54f9ee45 8997 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
8998
8999 def MakeModal(*args, **kwargs):
15afbcd0 9000 """
a95a7133 9001 MakeModal(self, bool modal=True)
15afbcd0
RD
9002
9003 Disables all other windows in the application so that the user can
9004 only interact with this window. Passing False will reverse this
9005 effect.
9006 """
54f9ee45 9007 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
9008
9009 def SetThemeEnabled(*args, **kwargs):
15afbcd0 9010 """
a95a7133 9011 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
9012
9013 This function tells a window if it should use the system's "theme"
9014 code to draw the windows' background instead if its own background
9015 drawing code. This will only have an effect on platforms that support
9016 the notion of themes in user defined windows. One such platform is
9017 GTK+ where windows can have (very colourful) backgrounds defined by a
9018 user's selected theme.
9019
9020 Dialogs, notebook pages and the status bar have this flag set to true
9021 by default so that the default look and feel is simulated best.
9022 """
54f9ee45 9023 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
9024
9025 def GetThemeEnabled(*args, **kwargs):
15afbcd0 9026 """
a95a7133 9027 GetThemeEnabled(self) -> bool
e811c8ce 9028
15afbcd0
RD
9029 Return the themeEnabled flag.
9030 """
54f9ee45 9031 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
9032
9033 def SetFocus(*args, **kwargs):
15afbcd0 9034 """
a95a7133 9035 SetFocus(self)
15afbcd0
RD
9036
9037 Set's the focus to this window, allowing it to receive keyboard input.
9038 """
54f9ee45 9039 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
9040
9041 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 9042 """
a95a7133 9043 SetFocusFromKbd(self)
15afbcd0
RD
9044
9045 Set focus to this window as the result of a keyboard action. Normally
9046 only called internally.
9047 """
54f9ee45 9048 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
9049
9050 def FindFocus(*args, **kwargs):
15afbcd0 9051 """
66c033b4 9052 FindFocus() -> Window
15afbcd0
RD
9053
9054 Returns the window or control that currently has the keyboard focus,
9055 or None.
9056 """
54f9ee45 9057 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
9058
9059 FindFocus = staticmethod(FindFocus)
9060 def AcceptsFocus(*args, **kwargs):
15afbcd0 9061 """
a95a7133 9062 AcceptsFocus(self) -> bool
15afbcd0
RD
9063
9064 Can this window have focus?
9065 """
54f9ee45 9066 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce 9067
cbfc9df6
RD
9068 def CanAcceptFocus(*args, **kwargs):
9069 """
9070 CanAcceptFocus(self) -> bool
9071
9072 Can this window have focus right now?
9073 """
9074 return _core_.Window_CanAcceptFocus(*args, **kwargs)
9075
e811c8ce 9076 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 9077 """
a95a7133 9078 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
9079
9080 Can this window be given focus by keyboard navigation? if not, the
9081 only way to give it focus (provided it accepts it at all) is to click
9082 it.
9083 """
54f9ee45 9084 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce 9085
cbfc9df6
RD
9086 def CanAcceptFocusFromKeyboard(*args, **kwargs):
9087 """
9088 CanAcceptFocusFromKeyboard(self) -> bool
9089
9090 Can this window be assigned focus from keyboard right now?
9091 """
9092 return _core_.Window_CanAcceptFocusFromKeyboard(*args, **kwargs)
9093
ddeca22c
RD
9094 def NavigateIn(*args, **kwargs):
9095 """
9096 NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool
9097
9098 Navigates inside this window.
9099 """
9100 return _core_.Window_NavigateIn(*args, **kwargs)
9101
908b74cd
RD
9102 def Navigate(*args, **kwargs):
9103 """
9104 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
9105
ddeca22c
RD
9106 Does keyboard navigation starting from this window to another. This is
9107 equivalient to self.GetParent().NavigateIn().
908b74cd
RD
9108 """
9109 return _core_.Window_Navigate(*args, **kwargs)
9110
7f98d120
RD
9111 def MoveAfterInTabOrder(*args, **kwargs):
9112 """
9113 MoveAfterInTabOrder(self, Window win)
9114
9115 Moves this window in the tab navigation order after the specified
9116 sibling window. This means that when the user presses the TAB key on
9117 that other window, the focus switches to this window.
9118
9119 The default tab order is the same as creation order. This function
9120 and `MoveBeforeInTabOrder` allow to change it after creating all the
9121 windows.
9122
9123 """
9124 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
9125
9126 def MoveBeforeInTabOrder(*args, **kwargs):
9127 """
9128 MoveBeforeInTabOrder(self, Window win)
9129
9130 Same as `MoveAfterInTabOrder` except that it inserts this window just
9131 before win instead of putting it right after it.
9132 """
9133 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
9134
e811c8ce 9135 def GetChildren(*args, **kwargs):
15afbcd0 9136 """
a95a7133 9137 GetChildren(self) -> PyObject
15afbcd0
RD
9138
9139 Returns a list of the window's children. NOTE: Currently this is a
9140 copy of the child window list maintained by the window, so the return
9141 value of this function is only valid as long as the window's children
9142 do not change.
9143 """
54f9ee45 9144 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
9145
9146 def GetParent(*args, **kwargs):
15afbcd0 9147 """
a95a7133 9148 GetParent(self) -> Window
15afbcd0
RD
9149
9150 Returns the parent window of this window, or None if there isn't one.
9151 """
54f9ee45 9152 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
9153
9154 def GetGrandParent(*args, **kwargs):
15afbcd0 9155 """
a95a7133 9156 GetGrandParent(self) -> Window
15afbcd0 9157
41e2b43e
RD
9158 Returns the parent of the parent of this window, or None if there
9159 isn't one.
15afbcd0 9160 """
54f9ee45 9161 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce 9162
cbfc9df6
RD
9163 def GetTopLevelParent(*args, **kwargs):
9164 """
9165 GetTopLevelParent(self) -> Window
9166
9167 Returns the first frame or dialog in this window's parental hierarchy.
9168 """
9169 return _core_.Window_GetTopLevelParent(*args, **kwargs)
9170
e811c8ce 9171 def IsTopLevel(*args, **kwargs):
15afbcd0 9172 """
a95a7133 9173 IsTopLevel(self) -> bool
15afbcd0
RD
9174
9175 Returns true if the given window is a top-level one. Currently all
9176 frames and dialogs are always considered to be top-level windows (even
9177 if they have a parent window).
9178 """
54f9ee45 9179 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
9180
9181 def Reparent(*args, **kwargs):
15afbcd0 9182 """
a95a7133 9183 Reparent(self, Window newParent) -> bool
15afbcd0
RD
9184
9185 Reparents the window, i.e the window will be removed from its current
9186 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9187 re-inserted into another. Available on Windows and GTK. Returns True
9188 if the parent was changed, False otherwise (error or newParent ==
9189 oldParent)
9190 """
54f9ee45 9191 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
9192
9193 def AddChild(*args, **kwargs):
15afbcd0 9194 """
a95a7133 9195 AddChild(self, Window child)
15afbcd0
RD
9196
9197 Adds a child window. This is called automatically by window creation
9198 functions so should not be required by the application programmer.
9199 """
54f9ee45 9200 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
9201
9202 def RemoveChild(*args, **kwargs):
15afbcd0 9203 """
a95a7133 9204 RemoveChild(self, Window child)
15afbcd0
RD
9205
9206 Removes a child window. This is called automatically by window
9207 deletion functions so should not be required by the application
9208 programmer.
9209 """
54f9ee45 9210 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce 9211
704eda0c
RD
9212 def SetDoubleBuffered(*args, **kwargs):
9213 """
9214 SetDoubleBuffered(self, bool on)
9215
9216 Currently wxGTK2 only.
9217 """
9218 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
9219
e811c8ce 9220 def FindWindowById(*args, **kwargs):
15afbcd0 9221 """
a95a7133 9222 FindWindowById(self, long winid) -> Window
15afbcd0
RD
9223
9224 Find a chld of this window by window ID
9225 """
54f9ee45 9226 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
9227
9228 def FindWindowByName(*args, **kwargs):
15afbcd0 9229 """
a95a7133 9230 FindWindowByName(self, String name) -> Window
15afbcd0
RD
9231
9232 Find a child of this window by name
9233 """
54f9ee45 9234 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
9235
9236 def GetEventHandler(*args, **kwargs):
15afbcd0 9237 """
a95a7133 9238 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
9239
9240 Returns the event handler for this window. By default, the window is
9241 its own event handler.
9242 """
54f9ee45 9243 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
9244
9245 def SetEventHandler(*args, **kwargs):
15afbcd0 9246 """
a95a7133 9247 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
9248
9249 Sets the event handler for this window. An event handler is an object
d49bdf34
RD
9250 that is capable of processing the events sent to a window. (In other
9251 words, is able to dispatch the events to handler function.) By
9252 default, the window is its own event handler, but an application may
9253 wish to substitute another, for example to allow central
9254 implementation of event-handling for a variety of different window
9255 classes.
15afbcd0 9256
41e2b43e 9257 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0 9258 up a chain of event handlers, where an event not handled by one event
d49bdf34 9259 handler is handed off to the next one in the chain.
15afbcd0 9260 """
54f9ee45 9261 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
9262
9263 def PushEventHandler(*args, **kwargs):
15afbcd0 9264 """
a95a7133 9265 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
9266
9267 Pushes this event handler onto the event handler stack for the window.
9268 An event handler is an object that is capable of processing the events
d49bdf34
RD
9269 sent to a window. (In other words, is able to dispatch the events to
9270 handler function.) By default, the window is its own event handler,
9271 but an application may wish to substitute another, for example to
9272 allow central implementation of event-handling for a variety of
9273 different window classes.
15afbcd0
RD
9274
9275 wx.Window.PushEventHandler allows an application to set up a chain of
9276 event handlers, where an event not handled by one event handler is
d49bdf34
RD
9277 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
9278 to remove the event handler. Ownership of the handler is *not* given
9279 to the window, so you should be sure to pop the handler before the
9280 window is destroyed and either let PopEventHandler destroy it, or call
9281 its Destroy method yourself.
15afbcd0 9282 """
54f9ee45 9283 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
9284
9285 def PopEventHandler(*args, **kwargs):
15afbcd0 9286 """
a95a7133 9287 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
9288
9289 Removes and returns the top-most event handler on the event handler
9290 stack. If deleteHandler is True then the wx.EvtHandler object will be
d49bdf34 9291 destroyed after it is popped, and ``None`` will be returned instead.
15afbcd0 9292 """
54f9ee45 9293 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
9294
9295 def RemoveEventHandler(*args, **kwargs):
15afbcd0 9296 """
a95a7133 9297 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 9298
41e2b43e 9299 Find the given handler in the event handler chain and remove (but not
d49bdf34 9300 delete) it from the event handler chain, returns True if it was found
41e2b43e
RD
9301 and False otherwise (this also results in an assert failure so this
9302 function should only be called when the handler is supposed to be
9303 there.)
15afbcd0 9304 """
54f9ee45 9305 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
9306
9307 def SetValidator(*args, **kwargs):
15afbcd0 9308 """
a95a7133 9309 SetValidator(self, Validator validator)
15afbcd0
RD
9310
9311 Deletes the current validator (if any) and sets the window validator,
9312 having called wx.Validator.Clone to create a new validator of this
9313 type.
9314 """
54f9ee45 9315 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
9316
9317 def GetValidator(*args, **kwargs):
15afbcd0 9318 """
a95a7133 9319 GetValidator(self) -> Validator
15afbcd0
RD
9320
9321 Returns a pointer to the current validator for the window, or None if
9322 there is none.
9323 """
54f9ee45 9324 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 9325
74a57fcd
RD
9326 def Validate(*args, **kwargs):
9327 """
a95a7133 9328 Validate(self) -> bool
74a57fcd
RD
9329
9330 Validates the current values of the child controls using their
41e2b43e
RD
9331 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9332 style flag set, the method will also call Validate() of all child
9333 windows. Returns false if any of the validations failed.
74a57fcd 9334 """
54f9ee45 9335 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
9336
9337 def TransferDataToWindow(*args, **kwargs):
9338 """
a95a7133 9339 TransferDataToWindow(self) -> bool
74a57fcd 9340
41e2b43e
RD
9341 Transfers values to child controls from data areas specified by their
9342 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9343 style flag set, the method will also call TransferDataToWindow() of
9344 all child windows.
74a57fcd 9345 """
54f9ee45 9346 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
9347
9348 def TransferDataFromWindow(*args, **kwargs):
9349 """
a95a7133 9350 TransferDataFromWindow(self) -> bool
74a57fcd 9351
41e2b43e
RD
9352 Transfers values from child controls to data areas specified by their
9353 validators. Returns false if a transfer failed. If the window has
9354 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9355 also call TransferDataFromWindow() of all child windows.
74a57fcd 9356 """
54f9ee45 9357 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
9358
9359 def InitDialog(*args, **kwargs):
9360 """
a95a7133 9361 InitDialog(self)
74a57fcd 9362
41e2b43e
RD
9363 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9364 to the dialog via validators.
74a57fcd 9365 """
54f9ee45 9366 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 9367
e811c8ce 9368 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 9369 """
a95a7133 9370 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
9371
9372 Sets the accelerator table for this window.
9373 """
54f9ee45 9374 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
9375
9376 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 9377 """
a95a7133 9378 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
9379
9380 Gets the accelerator table for this window.
9381 """
54f9ee45 9382 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
9383
9384 def RegisterHotKey(*args, **kwargs):
15afbcd0 9385 """
a95a7133 9386 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
9387
9388 Registers a system wide hotkey. Every time the user presses the hotkey
9389 registered here, this window will receive a hotkey event. It will
9390 receive the event even if the application is in the background and
9391 does not have the input focus because the user is working with some
9392 other application. To bind an event handler function to this hotkey
9393 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9394 hotkey was registered successfully.
9395 """
54f9ee45 9396 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
9397
9398 def UnregisterHotKey(*args, **kwargs):
15afbcd0 9399 """
a95a7133 9400 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
9401
9402 Unregisters a system wide hotkey.
9403 """
54f9ee45 9404 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
9405
9406 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 9407 """
a95a7133 9408 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
9409
9410 Converts a point or size from dialog units to pixels. Dialog units
9411 are used for maintaining a dialog's proportions even if the font
9412 changes. For the x dimension, the dialog units are multiplied by the
9413 average character width and then divided by 4. For the y dimension,
9414 the dialog units are multiplied by the average character height and
9415 then divided by 8.
9416 """
54f9ee45 9417 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
9418
9419 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 9420 """
a95a7133 9421 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
9422
9423 Converts a point or size from dialog units to pixels. Dialog units
9424 are used for maintaining a dialog's proportions even if the font
9425 changes. For the x dimension, the dialog units are multiplied by the
9426 average character width and then divided by 4. For the y dimension,
9427 the dialog units are multiplied by the average character height and
9428 then divided by 8.
9429 """
54f9ee45 9430 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
9431
9432 def DLG_PNT(*args, **kwargs):
15afbcd0 9433 """
a95a7133 9434 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
9435
9436 Converts a point or size from dialog units to pixels. Dialog units
9437 are used for maintaining a dialog's proportions even if the font
9438 changes. For the x dimension, the dialog units are multiplied by the
9439 average character width and then divided by 4. For the y dimension,
9440 the dialog units are multiplied by the average character height and
9441 then divided by 8.
9442 """
54f9ee45 9443 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
9444
9445 def DLG_SZE(*args, **kwargs):
15afbcd0 9446 """
a95a7133 9447 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
9448
9449 Converts a point or size from dialog units to pixels. Dialog units
9450 are used for maintaining a dialog's proportions even if the font
9451 changes. For the x dimension, the dialog units are multiplied by the
9452 average character width and then divided by 4. For the y dimension,
9453 the dialog units are multiplied by the average character height and
9454 then divided by 8.
9455 """
54f9ee45 9456 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
9457
9458 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 9459 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 9460 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
9461
9462 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 9463 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 9464 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
9465
9466 def WarpPointer(*args, **kwargs):
15afbcd0 9467 """
a95a7133 9468 WarpPointer(self, int x, int y)
15afbcd0
RD
9469
9470 Moves the pointer to the given position on the window.
9471
9472 NOTE: This function is not supported under Mac because Apple Human
9473 Interface Guidelines forbid moving the mouse cursor programmatically.
9474 """
54f9ee45 9475 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
9476
9477 def CaptureMouse(*args, **kwargs):
15afbcd0 9478 """
a95a7133 9479 CaptureMouse(self)
15afbcd0
RD
9480
9481 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9482 release the capture.
9483
9484 Note that wxWindows maintains the stack of windows having captured the
9485 mouse and when the mouse is released the capture returns to the window
9486 which had had captured it previously and it is only really released if
9487 there were no previous window. In particular, this means that you must
34e0a3bb
RD
9488 release the mouse as many times as you capture it, unless the window
9489 receives the `wx.MouseCaptureLostEvent` event.
9490
9491 Any application which captures the mouse in the beginning of some
9492 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9493 operation when it receives the event. The event handler must not
9494 recapture mouse.
15afbcd0 9495 """
54f9ee45 9496 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
9497
9498 def ReleaseMouse(*args, **kwargs):
15afbcd0 9499 """
a95a7133 9500 ReleaseMouse(self)
15afbcd0
RD
9501
9502 Releases mouse input captured with wx.Window.CaptureMouse.
9503 """
54f9ee45 9504 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
9505
9506 def GetCapture(*args, **kwargs):
15afbcd0 9507 """
66c033b4 9508 GetCapture() -> Window
15afbcd0
RD
9509
9510 Returns the window which currently captures the mouse or None
9511 """
54f9ee45 9512 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
9513
9514 GetCapture = staticmethod(GetCapture)
9515 def HasCapture(*args, **kwargs):
15afbcd0 9516 """
a95a7133 9517 HasCapture(self) -> bool
15afbcd0
RD
9518
9519 Returns true if this window has the current mouse capture.
9520 """
54f9ee45 9521 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
9522
9523 def Refresh(*args, **kwargs):
15afbcd0 9524 """
a95a7133 9525 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
9526
9527 Mark the specified rectangle (or the whole window) as "dirty" so it
9528 will be repainted. Causes an EVT_PAINT event to be generated and sent
9529 to the window.
9530 """
54f9ee45 9531 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
9532
9533 def RefreshRect(*args, **kwargs):
15afbcd0 9534 """
fef4c27a 9535 RefreshRect(self, Rect rect, bool eraseBackground=True)
15afbcd0
RD
9536
9537 Redraws the contents of the given rectangle: the area inside it will
9538 be repainted. This is the same as Refresh but has a nicer syntax.
9539 """
54f9ee45 9540 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
9541
9542 def Update(*args, **kwargs):
15afbcd0 9543 """
a95a7133 9544 Update(self)
15afbcd0
RD
9545
9546 Calling this method immediately repaints the invalidated area of the
9547 window instead of waiting for the EVT_PAINT event to happen, (normally
9548 this would usually only happen when the flow of control returns to the
9549 event loop.) Notice that this function doesn't refresh the window and
9b940138 9550 does nothing if the window has been already repainted. Use `Refresh`
15afbcd0
RD
9551 first if you want to immediately redraw the window (or some portion of
9552 it) unconditionally.
9553 """
54f9ee45 9554 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
9555
9556 def ClearBackground(*args, **kwargs):
15afbcd0 9557 """
a95a7133 9558 ClearBackground(self)
15afbcd0
RD
9559
9560 Clears the window by filling it with the current background
9561 colour. Does not cause an erase background event to be generated.
9562 """
54f9ee45 9563 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
9564
9565 def Freeze(*args, **kwargs):
15afbcd0 9566 """
a95a7133 9567 Freeze(self)
15afbcd0 9568
41e2b43e
RD
9569 Freezes the window or, in other words, prevents any updates from
9570 taking place on screen, the window is not redrawn at all. Thaw must be
9571 called to reenable window redrawing. Calls to Freeze/Thaw may be
9572 nested, with the actual Thaw being delayed until all the nesting has
9573 been undone.
15afbcd0
RD
9574
9575 This method is useful for visual appearance optimization (for example,
9576 it is a good idea to use it before inserting large amount of text into
9577 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9578 for all controls so it is mostly just a hint to wxWindows and not a
9579 mandatory directive.
9580 """
54f9ee45 9581 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce 9582
33d6fd3b
RD
9583 def IsFrozen(*args, **kwargs):
9584 """
9585 IsFrozen(self) -> bool
9586
9587 Returns ``True`` if the window has been frozen and not thawed yet.
9588
9589 :see: `Freeze` and `Thaw`
9590 """
9591 return _core_.Window_IsFrozen(*args, **kwargs)
9592
e811c8ce 9593 def Thaw(*args, **kwargs):
15afbcd0 9594 """
a95a7133 9595 Thaw(self)
15afbcd0 9596
4276dc52 9597 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
9598 Freeze/Thaw may be nested, so Thaw must be called the same number of
9599 times that Freeze was before the window will be updated.
15afbcd0 9600 """
54f9ee45 9601 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
9602
9603 def PrepareDC(*args, **kwargs):
15afbcd0 9604 """
a95a7133 9605 PrepareDC(self, DC dc)
15afbcd0
RD
9606
9607 Call this function to prepare the device context for drawing a
9608 scrolled image. It sets the device origin according to the current
9609 scroll position.
9610 """
54f9ee45 9611 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce 9612
b39fe951
RD
9613 def IsDoubleBuffered(*args, **kwargs):
9614 """
9615 IsDoubleBuffered(self) -> bool
9616
9617 Returns ``True`` if the window contents is double-buffered by the
9618 system, i.e. if any drawing done on the window is really done on a
9619 temporary backing surface and transferred to the screen all at once
9620 later.
9621 """
9622 return _core_.Window_IsDoubleBuffered(*args, **kwargs)
9623
e811c8ce 9624 def GetUpdateRegion(*args, **kwargs):
15afbcd0 9625 """
a95a7133 9626 GetUpdateRegion(self) -> Region
15afbcd0
RD
9627
9628 Returns the region specifying which parts of the window have been
9629 damaged. Should only be called within an EVT_PAINT handler.
9630 """
54f9ee45 9631 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
9632
9633 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 9634 """
a95a7133 9635 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
9636
9637 Get the update rectangle region bounding box in client coords.
9638 """
54f9ee45 9639 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
9640
9641 def IsExposed(*args, **kwargs):
15afbcd0 9642 """
a95a7133 9643 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
9644
9645 Returns true if the given point or rectangle area has been exposed
9646 since the last repaint. Call this in an paint event handler to
9647 optimize redrawing by only redrawing those areas, which have been
9648 exposed.
9649 """
54f9ee45 9650 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
9651
9652 def IsExposedPoint(*args, **kwargs):
15afbcd0 9653 """
a95a7133 9654 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
9655
9656 Returns true if the given point or rectangle area has been exposed
9657 since the last repaint. Call this in an paint event handler to
9658 optimize redrawing by only redrawing those areas, which have been
9659 exposed.
9660 """
54f9ee45 9661 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 9662
4276dc52 9663 def IsExposedRect(*args, **kwargs):
15afbcd0 9664 """
a95a7133 9665 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
9666
9667 Returns true if the given point or rectangle area has been exposed
9668 since the last repaint. Call this in an paint event handler to
9669 optimize redrawing by only redrawing those areas, which have been
9670 exposed.
9671 """
54f9ee45 9672 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 9673
74a57fcd
RD
9674 def GetDefaultAttributes(*args, **kwargs):
9675 """
a95a7133 9676 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 9677
41e2b43e
RD
9678 Get the default attributes for an instance of this class. This is
9679 useful if you want to use the same font or colour in your own control
9680 as in a standard control -- which is a much better idea than hard
9681 coding specific colours or fonts which might look completely out of
db3e571a 9682 place on the user's system, especially if it uses themes.
74a57fcd 9683 """
54f9ee45 9684 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9685
9686 def GetClassDefaultAttributes(*args, **kwargs):
9687 """
66c033b4 9688 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 9689
41e2b43e
RD
9690 Get the default attributes for this class. This is useful if you want
9691 to use the same font or colour in your own control as in a standard
9692 control -- which is a much better idea than hard coding specific
db3e571a
RD
9693 colours or fonts which might look completely out of place on the
9694 user's system, especially if it uses themes.
74a57fcd
RD
9695
9696 The variant parameter is only relevant under Mac currently and is
41e2b43e 9697 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
9698 the returned font. See `wx.Window.SetWindowVariant` for more about
9699 this.
74a57fcd 9700 """
54f9ee45 9701 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9702
9703 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 9704 def SetBackgroundColour(*args, **kwargs):
15afbcd0 9705 """
a95a7133 9706 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
9707
9708 Sets the background colour of the window. Returns True if the colour
9709 was changed. The background colour is usually painted by the default
9710 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9711 automatically under GTK. Using `wx.NullColour` will reset the window
9712 to the default background colour.
15afbcd0 9713
db3e571a 9714 Note that setting the background colour may not cause an immediate
f8167d6e 9715 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
9716 calling this function.
9717
f8167d6e
RD
9718 Using this function will disable attempts to use themes for this
9719 window, if the system supports them. Use with care since usually the
9720 themes represent the appearance chosen by the user to be used for all
9721 applications on the system.
15afbcd0 9722 """
54f9ee45 9723 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 9724
412d302d
RD
9725 def SetOwnBackgroundColour(*args, **kwargs):
9726 """SetOwnBackgroundColour(self, Colour colour)"""
9727 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 9728
e811c8ce 9729 def SetForegroundColour(*args, **kwargs):
15afbcd0 9730 """
a95a7133 9731 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
9732
9733 Sets the foreground colour of the window. Returns True is the colour
9734 was changed. The interpretation of foreground colour is dependent on
9735 the window class; it may be the text colour or other colour, or it may
9736 not be used at all.
9737 """
54f9ee45 9738 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 9739
fa47d7a7
VS
9740 def SetOwnForegroundColour(*args, **kwargs):
9741 """SetOwnForegroundColour(self, Colour colour)"""
9742 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 9743
e811c8ce 9744 def GetBackgroundColour(*args, **kwargs):
15afbcd0 9745 """
a95a7133 9746 GetBackgroundColour(self) -> Colour
15afbcd0
RD
9747
9748 Returns the background colour of the window.
9749 """
54f9ee45 9750 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
9751
9752 def GetForegroundColour(*args, **kwargs):
15afbcd0 9753 """
a95a7133 9754 GetForegroundColour(self) -> Colour
15afbcd0
RD
9755
9756 Returns the foreground colour of the window. The interpretation of
9757 foreground colour is dependent on the window class; it may be the text
9758 colour or other colour, or it may not be used at all.
9759 """
54f9ee45 9760 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 9761
562ecc31
RD
9762 def InheritsBackgroundColour(*args, **kwargs):
9763 """InheritsBackgroundColour(self) -> bool"""
9764 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9765
9766 def UseBgCol(*args, **kwargs):
9767 """UseBgCol(self) -> bool"""
9768 return _core_.Window_UseBgCol(*args, **kwargs)
9769
7bc1e663
RD
9770 def SetBackgroundStyle(*args, **kwargs):
9771 """
9772 SetBackgroundStyle(self, int style) -> bool
9773
9774 Returns the background style of the window. The background style
9775 indicates how the background of the window is drawn.
9776
9777 ====================== ========================================
9778 wx.BG_STYLE_SYSTEM The background colour or pattern should
9779 be determined by the system
9780 wx.BG_STYLE_COLOUR The background should be a solid colour
9781 wx.BG_STYLE_CUSTOM The background will be implemented by the
9782 application.
9783 ====================== ========================================
9784
9785 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9786 a custom background, such as a tiled bitmap. Currently the style has
9787 no effect on other platforms.
9788
9789 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9790 """
9791 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9792
9793 def GetBackgroundStyle(*args, **kwargs):
9794 """
9795 GetBackgroundStyle(self) -> int
9796
9797 Returns the background style of the window.
9798
9799 :see: `SetBackgroundStyle`
9800 """
9801 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9802
51b83b37
RD
9803 def HasTransparentBackground(*args, **kwargs):
9804 """
9805 HasTransparentBackground(self) -> bool
9806
9807 Returns True if this window's background is transparent (as, for
9808 example, for `wx.StaticText`) and should show the parent window's
9809 background.
9810
9811 This method is mostly used internally by the library itself and you
9812 normally shouldn't have to call it. You may, however, have to override
9813 it in your custom control classes to ensure that background is painted
9814 correctly.
9815 """
9816 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9817
e811c8ce 9818 def SetCursor(*args, **kwargs):
15afbcd0 9819 """
a95a7133 9820 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
9821
9822 Sets the window's cursor. Notice that the window cursor also sets it
9823 for the children of the window implicitly.
9824
9825 The cursor may be wx.NullCursor in which case the window cursor will
9826 be reset back to default.
9827 """
54f9ee45 9828 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
9829
9830 def GetCursor(*args, **kwargs):
15afbcd0 9831 """
a95a7133 9832 GetCursor(self) -> Cursor
15afbcd0
RD
9833
9834 Return the cursor associated with this window.
9835 """
54f9ee45 9836 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
9837
9838 def SetFont(*args, **kwargs):
15afbcd0 9839 """
a95a7133 9840 SetFont(self, Font font) -> bool
15afbcd0
RD
9841
9842 Sets the font for this window.
9843 """
54f9ee45 9844 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 9845
fa47d7a7
VS
9846 def SetOwnFont(*args, **kwargs):
9847 """SetOwnFont(self, Font font)"""
9848 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 9849
e811c8ce 9850 def GetFont(*args, **kwargs):
15afbcd0 9851 """
a95a7133 9852 GetFont(self) -> Font
15afbcd0 9853
4276dc52 9854 Returns the default font used for this window.
15afbcd0 9855 """
54f9ee45 9856 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
9857
9858 def SetCaret(*args, **kwargs):
15afbcd0 9859 """
a95a7133 9860 SetCaret(self, Caret caret)
15afbcd0
RD
9861
9862 Sets the caret associated with the window.
9863 """
54f9ee45 9864 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
9865
9866 def GetCaret(*args, **kwargs):
15afbcd0 9867 """
a95a7133 9868 GetCaret(self) -> Caret
15afbcd0
RD
9869
9870 Returns the caret associated with the window.
9871 """
54f9ee45 9872 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
9873
9874 def GetCharHeight(*args, **kwargs):
15afbcd0 9875 """
a95a7133 9876 GetCharHeight(self) -> int
15afbcd0
RD
9877
9878 Get the (average) character size for the current font.
9879 """
54f9ee45 9880 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
9881
9882 def GetCharWidth(*args, **kwargs):
15afbcd0 9883 """
a95a7133 9884 GetCharWidth(self) -> int
15afbcd0
RD
9885
9886 Get the (average) character size for the current font.
9887 """
54f9ee45 9888 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
9889
9890 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9891 """
9892 GetTextExtent(String string) -> (width, height)
9893
9894 Get the width and height of the text using the current font.
9895 """
54f9ee45 9896 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
9897
9898 def GetFullTextExtent(*args, **kwargs):
0df68c9f 9899 """
196addbf 9900 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 9901 (width, height, descent, externalLeading)
e811c8ce 9902
15afbcd0
RD
9903 Get the width, height, decent and leading of the text using the
9904 current or specified font.
0df68c9f 9905 """
54f9ee45 9906 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
9907
9908 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
9909 """
9910 ClientToScreenXY(int x, int y) -> (x,y)
9911
9912 Converts to screen coordinates from coordinates relative to this window.
9913 """
54f9ee45 9914 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
9915
9916 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
9917 """
9918 ScreenToClientXY(int x, int y) -> (x,y)
9919
9920 Converts from screen to client window coordinates.
9921 """
54f9ee45 9922 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
9923
9924 def ClientToScreen(*args, **kwargs):
15afbcd0 9925 """
a95a7133 9926 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
9927
9928 Converts to screen coordinates from coordinates relative to this window.
9929 """
54f9ee45 9930 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
9931
9932 def ScreenToClient(*args, **kwargs):
15afbcd0 9933 """
a95a7133 9934 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
9935
9936 Converts from screen to client window coordinates.
9937 """
54f9ee45 9938 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
9939
9940 def HitTestXY(*args, **kwargs):
15afbcd0 9941 """
a95a7133 9942 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
9943
9944 Test where the given (in client coords) point lies
9945 """
54f9ee45 9946 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
9947
9948 def HitTest(*args, **kwargs):
15afbcd0 9949 """
a95a7133 9950 HitTest(self, Point pt) -> int
15afbcd0
RD
9951
9952 Test where the given (in client coords) point lies
9953 """
54f9ee45 9954 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 9955
15afbcd0
RD
9956 def GetBorder(*args):
9957 """
a95a7133
RD
9958 GetBorder(self, long flags) -> int
9959 GetBorder(self) -> int
e811c8ce 9960
15afbcd0
RD
9961 Get border for the flags of this window
9962 """
54f9ee45 9963 return _core_.Window_GetBorder(*args)
e811c8ce
RD
9964
9965 def UpdateWindowUI(*args, **kwargs):
15afbcd0 9966 """
a95a7133 9967 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
9968
9969 This function sends EVT_UPDATE_UI events to the window. The particular
9970 implementation depends on the window; for example a wx.ToolBar will
9971 send an update UI event for each toolbar button, and a wx.Frame will
9972 send an update UI event for each menubar menu item. You can call this
9973 function from your application to ensure that your UI is up-to-date at
9974 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9975 concerned). This may be necessary if you have called
5ba5649b 9976 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
15afbcd0
RD
9977 limit the overhead that wxWindows incurs by sending update UI events
9978 in idle time.
15afbcd0 9979 """
54f9ee45 9980 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
9981
9982 def PopupMenuXY(*args, **kwargs):
15afbcd0 9983 """
b0503257 9984 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 9985
b0503257
RD
9986 Pops up the given menu at the specified coordinates, relative to this window,
9987 and returns control when the user has dismissed the menu. If a menu item is
9988 selected, the corresponding menu event is generated and will be processed as
9989 usual. If the default position is given then the current position of the
9990 mouse cursor will be used.
15afbcd0 9991 """
54f9ee45 9992 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 9993
15afbcd0
RD
9994 def PopupMenu(*args, **kwargs):
9995 """
b0503257 9996 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 9997
b0503257
RD
9998 Pops up the given menu at the specified coordinates, relative to this window,
9999 and returns control when the user has dismissed the menu. If a menu item is
10000 selected, the corresponding menu event is generated and will be processed as
10001 usual. If the default position is given then the current position of the
10002 mouse cursor will be used.
15afbcd0 10003 """
54f9ee45 10004 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0 10005
10044bf1
RD
10006 def HasMultiplePages(*args, **kwargs):
10007 """HasMultiplePages(self) -> bool"""
10008 return _core_.Window_HasMultiplePages(*args, **kwargs)
10009
15afbcd0
RD
10010 def GetHandle(*args, **kwargs):
10011 """
a95a7133 10012 GetHandle(self) -> long
15afbcd0
RD
10013
10014 Returns the platform-specific handle (as a long integer) of the
10015 physical window. Currently on wxMac it returns the handle of the
10016 toplevel parent of the window.
10017 """
54f9ee45 10018 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 10019
7e63a440
RD
10020 def AssociateHandle(*args, **kwargs):
10021 """
10022 AssociateHandle(self, long handle)
10023
10024 Associate the window with a new native handle
10025 """
10026 return _core_.Window_AssociateHandle(*args, **kwargs)
10027
10028 def DissociateHandle(*args, **kwargs):
10029 """
10030 DissociateHandle(self)
10031
10032 Dissociate the current native handle from the window
10033 """
10034 return _core_.Window_DissociateHandle(*args, **kwargs)
10035
15afbcd0
RD
10036 def HasScrollbar(*args, **kwargs):
10037 """
a95a7133 10038 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
10039
10040 Does the window have the scrollbar for this orientation?
10041 """
54f9ee45 10042 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
10043
10044 def SetScrollbar(*args, **kwargs):
10045 """
41e2b43e 10046 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
10047 bool refresh=True)
10048
10049 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 10050 """
54f9ee45 10051 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
10052
10053 def SetScrollPos(*args, **kwargs):
15afbcd0 10054 """
a95a7133 10055 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
10056
10057 Sets the position of one of the built-in scrollbars.
10058 """
54f9ee45 10059 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
10060
10061 def GetScrollPos(*args, **kwargs):
15afbcd0 10062 """
a95a7133 10063 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
10064
10065 Returns the built-in scrollbar position.
10066 """
54f9ee45 10067 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
10068
10069 def GetScrollThumb(*args, **kwargs):
15afbcd0 10070 """
a95a7133 10071 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
10072
10073 Returns the built-in scrollbar thumb size.
10074 """
54f9ee45 10075 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
10076
10077 def GetScrollRange(*args, **kwargs):
15afbcd0 10078 """
a95a7133 10079 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
10080
10081 Returns the built-in scrollbar range.
10082 """
54f9ee45 10083 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
10084
10085 def ScrollWindow(*args, **kwargs):
15afbcd0 10086 """
a95a7133 10087 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
10088
10089 Physically scrolls the pixels in the window and move child windows
10090 accordingly. Use this function to optimise your scrolling
10091 implementations, to minimise the area that must be redrawn. Note that
10092 it is rarely required to call this function from a user program.
15afbcd0 10093 """
54f9ee45 10094 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
10095
10096 def ScrollLines(*args, **kwargs):
15afbcd0 10097 """
a95a7133 10098 ScrollLines(self, int lines) -> bool
15afbcd0
RD
10099
10100 If the platform and window class supports it, scrolls the window by
10101 the given number of lines down, if lines is positive, or up if lines
10102 is negative. Returns True if the window was scrolled, False if it was
10103 already on top/bottom and nothing was done.
10104 """
54f9ee45 10105 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
10106
10107 def ScrollPages(*args, **kwargs):
15afbcd0 10108 """
a95a7133 10109 ScrollPages(self, int pages) -> bool
15afbcd0 10110
41e2b43e 10111 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
10112 the given number of pages down, if pages is positive, or up if pages
10113 is negative. Returns True if the window was scrolled, False if it was
10114 already on top/bottom and nothing was done.
10115 """
54f9ee45 10116 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
10117
10118 def LineUp(*args, **kwargs):
15afbcd0 10119 """
a95a7133 10120 LineUp(self) -> bool
15afbcd0
RD
10121
10122 This is just a wrapper for ScrollLines(-1).
10123 """
54f9ee45 10124 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
10125
10126 def LineDown(*args, **kwargs):
15afbcd0 10127 """
a95a7133 10128 LineDown(self) -> bool
15afbcd0
RD
10129
10130 This is just a wrapper for ScrollLines(1).
10131 """
54f9ee45 10132 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
10133
10134 def PageUp(*args, **kwargs):
15afbcd0 10135 """
a95a7133 10136 PageUp(self) -> bool
15afbcd0
RD
10137
10138 This is just a wrapper for ScrollPages(-1).
10139 """
54f9ee45 10140 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
10141
10142 def PageDown(*args, **kwargs):
15afbcd0 10143 """
a95a7133 10144 PageDown(self) -> bool
15afbcd0
RD
10145
10146 This is just a wrapper for ScrollPages(1).
10147 """
54f9ee45 10148 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
10149
10150 def SetHelpText(*args, **kwargs):
15afbcd0 10151 """
a95a7133 10152 SetHelpText(self, String text)
15afbcd0
RD
10153
10154 Sets the help text to be used as context-sensitive help for this
10155 window. Note that the text is actually stored by the current
f52cbe90 10156 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 10157 """
54f9ee45 10158 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
10159
10160 def SetHelpTextForId(*args, **kwargs):
15afbcd0 10161 """
a95a7133 10162 SetHelpTextForId(self, String text)
15afbcd0
RD
10163
10164 Associate this help text with all windows with the same id as this
10165 one.
10166 """
54f9ee45 10167 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce 10168
b850e7f3
RD
10169 def GetHelpTextAtPoint(*args, **kwargs):
10170 """
10171 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
10172
10173 Get the help string associated with the given position in this window.
10174
10175 Notice that pt may be invalid if event origin is keyboard or unknown
10176 and this method should return the global window help text then
10177
10178 """
10179 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
10180
e811c8ce 10181 def GetHelpText(*args, **kwargs):
15afbcd0 10182 """
a95a7133 10183 GetHelpText(self) -> String
15afbcd0
RD
10184
10185 Gets the help text to be used as context-sensitive help for this
10186 window. Note that the text is actually stored by the current
f52cbe90 10187 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 10188 """
54f9ee45 10189 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
10190
10191 def SetToolTipString(*args, **kwargs):
15afbcd0 10192 """
a95a7133 10193 SetToolTipString(self, String tip)
15afbcd0
RD
10194
10195 Attach a tooltip to the window.
10196 """
54f9ee45 10197 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
10198
10199 def SetToolTip(*args, **kwargs):
15afbcd0 10200 """
a95a7133 10201 SetToolTip(self, ToolTip tip)
15afbcd0
RD
10202
10203 Attach a tooltip to the window.
10204 """
54f9ee45 10205 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
10206
10207 def GetToolTip(*args, **kwargs):
15afbcd0 10208 """
a95a7133 10209 GetToolTip(self) -> ToolTip
15afbcd0
RD
10210
10211 get the associated tooltip or None if none
10212 """
54f9ee45 10213 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
10214
10215 def SetDropTarget(*args, **kwargs):
15afbcd0 10216 """
a95a7133 10217 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
10218
10219 Associates a drop target with this window. If the window already has
10220 a drop target, it is deleted.
10221 """
54f9ee45 10222 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
10223
10224 def GetDropTarget(*args, **kwargs):
15afbcd0 10225 """
a95a7133 10226 GetDropTarget(self) -> DropTarget
15afbcd0
RD
10227
10228 Returns the associated drop target, which may be None.
10229 """
54f9ee45 10230 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce 10231
5ba5649b
RD
10232 def DragAcceptFiles(*args, **kwargs):
10233 """
10234 DragAcceptFiles(self, bool accept)
10235
10236 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10237 Only functional on Windows.
10238 """
10239 return _core_.Window_DragAcceptFiles(*args, **kwargs)
10240
e811c8ce 10241 def SetConstraints(*args, **kwargs):
15afbcd0 10242 """
a95a7133 10243 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
10244
10245 Sets the window to have the given layout constraints. If an existing
10246 layout constraints object is already owned by the window, it will be
10247 deleted. Pass None to disassociate and delete the window's current
10248 constraints.
10249
10250 You must call SetAutoLayout to tell a window to use the constraints
10251 automatically in its default EVT_SIZE handler; otherwise, you must
10252 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10253 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10254 effect.
10255 """
54f9ee45 10256 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
10257
10258 def GetConstraints(*args, **kwargs):
15afbcd0 10259 """
a95a7133 10260 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
10261
10262 Returns a pointer to the window's layout constraints, or None if there
10263 are none.
10264 """
54f9ee45 10265 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
10266
10267 def SetAutoLayout(*args, **kwargs):
15afbcd0 10268 """
a95a7133 10269 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
10270
10271 Determines whether the Layout function will be called automatically
b1fcee84
RD
10272 when the window is resized. lease note that this only happens for the
10273 windows usually used to contain children, namely `wx.Panel` and
10274 `wx.TopLevelWindow` (and the classes deriving from them).
10275
10276 This method is called implicitly by `SetSizer` but if you use
10277 `SetConstraints` you should call it manually or otherwise the window
10278 layout won't be correctly updated when its size changes.
15afbcd0 10279 """
54f9ee45 10280 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
10281
10282 def GetAutoLayout(*args, **kwargs):
15afbcd0 10283 """
a95a7133 10284 GetAutoLayout(self) -> bool
15afbcd0
RD
10285
10286 Returns the current autoLayout setting
10287 """
54f9ee45 10288 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
10289
10290 def Layout(*args, **kwargs):
15afbcd0 10291 """
a95a7133 10292 Layout(self) -> bool
15afbcd0
RD
10293
10294 Invokes the constraint-based layout algorithm or the sizer-based
10295 algorithm for this window. See SetAutoLayout: when auto layout is on,
10296 this function gets called automatically by the default EVT_SIZE
10297 handler when the window is resized.
10298 """
54f9ee45 10299 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
10300
10301 def SetSizer(*args, **kwargs):
15afbcd0 10302 """
a95a7133 10303 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
10304
10305 Sets the window to have the given layout sizer. The window will then
10306 own the object, and will take care of its deletion. If an existing
10307 layout sizer object is already owned by the window, it will be deleted
10308 if the deleteOld parameter is true. Note that this function will also
10309 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 10310 non-None, and False otherwise.
15afbcd0 10311 """
54f9ee45 10312 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
10313
10314 def SetSizerAndFit(*args, **kwargs):
15afbcd0 10315 """
a95a7133 10316 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
10317
10318 The same as SetSizer, except it also sets the size hints for the
10319 window based on the sizer's minimum size.
10320 """
54f9ee45 10321 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
10322
10323 def GetSizer(*args, **kwargs):
15afbcd0 10324 """
a95a7133 10325 GetSizer(self) -> Sizer
15afbcd0
RD
10326
10327 Return the sizer associated with the window by a previous call to
10328 SetSizer or None if there isn't one.
10329 """
54f9ee45 10330 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
10331
10332 def SetContainingSizer(*args, **kwargs):
15afbcd0 10333 """
a95a7133 10334 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
10335
10336 This normally does not need to be called by application code. It is
10337 called internally when a window is added to a sizer, and is used so
10338 the window can remove itself from the sizer when it is destroyed.
10339 """
54f9ee45 10340 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
10341
10342 def GetContainingSizer(*args, **kwargs):
15afbcd0 10343 """
a95a7133 10344 GetContainingSizer(self) -> Sizer
15afbcd0
RD
10345
10346 Return the sizer that this window is a member of, if any, otherwise None.
10347 """
54f9ee45 10348 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 10349
a95a7133
RD
10350 def InheritAttributes(*args, **kwargs):
10351 """
10352 InheritAttributes(self)
10353
41e2b43e
RD
10354 This function is (or should be, in case of custom controls) called
10355 during window creation to intelligently set up the window visual
10356 attributes, that is the font and the foreground and background
10357 colours.
10358
10359 By 'intelligently' the following is meant: by default, all windows use
10360 their own default attributes. However if some of the parent's
10361 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10362 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
10363 explicitly set for this window itself, then this window takes the same
10364 value as used by the parent. In addition, if the window overrides
10365 ShouldInheritColours to return false, the colours will not be changed
10366 no matter what and only the font might.
10367
34621cc5 10368 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 10369 different usage scenarios. The most common one is when all default
41e2b43e
RD
10370 attributes are used and in this case, nothing should be inherited as
10371 in modern GUIs different controls use different fonts (and colours)
10372 than their siblings so they can't inherit the same value from the
10373 parent. However it was also deemed desirable to allow to simply change
10374 the attributes of all children at once by just changing the font or
10375 colour of their common parent, hence in this case we do inherit the
10376 parents attributes.
10377
a95a7133 10378 """
54f9ee45 10379 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
10380
10381 def ShouldInheritColours(*args, **kwargs):
10382 """
10383 ShouldInheritColours(self) -> bool
10384
10385 Return true from here to allow the colours of this window to be
41e2b43e
RD
10386 changed by InheritAttributes, returning false forbids inheriting them
10387 from the parent window.
a95a7133 10388
41e2b43e
RD
10389 The base class version returns false, but this method is overridden in
10390 wxControl where it returns true.
a95a7133 10391 """
54f9ee45 10392 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 10393
fc46b7f3
RD
10394 def CanSetTransparent(*args, **kwargs):
10395 """
10396 CanSetTransparent(self) -> bool
10397
10398 Returns ``True`` if the platform supports setting the transparency for
10399 this window. Note that this method will err on the side of caution,
10400 so it is possible that this will return ``False`` when it is in fact
10401 possible to set the transparency.
10402
10403 NOTE: On X-windows systems the X server must have the composite
10404 extension loaded, and there must be a composite manager program (such
10405 as xcompmgr) running.
10406 """
10407 return _core_.Window_CanSetTransparent(*args, **kwargs)
10408
10409 def SetTransparent(*args, **kwargs):
10410 """
10411 SetTransparent(self, byte alpha) -> bool
10412
10413 Attempt to set the transparency of this window to the ``alpha`` value,
10414 returns True on success. The ``alpha`` value is an integer in the
10415 range of 0 to 255, where 0 is fully transparent and 255 is fully
10416 opaque.
10417 """
10418 return _core_.Window_SetTransparent(*args, **kwargs)
10419
e811c8ce 10420 def PostCreate(self, pre):
15afbcd0
RD
10421 """
10422 Phase 3 of the 2-phase create <wink!>
10423 Call this method after precreating the window with the 2-phase create method.
10424 """
e811c8ce
RD
10425 self.this = pre.this
10426 self.thisown = pre.thisown
10427 pre.thisown = 0
10428 if hasattr(self, '_setOORInfo'):
4976f996
RD
10429 try:
10430 self._setOORInfo(self)
10431 except TypeError:
10432 pass
e811c8ce 10433 if hasattr(self, '_setCallbackInfo'):
4976f996
RD
10434 try:
10435 self._setCallbackInfo(self, pre.__class__)
10436 except TypeError:
10437 pass
e811c8ce 10438
7e08d4ef 10439 def SendSizeEvent(self):
453fb36b 10440 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 10441
2bf58437 10442 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
2bf58437
RD
10443 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10444 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10445 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
580080c5 10446 EffectiveMinSize = property(GetEffectiveMinSize,doc="See `GetEffectiveMinSize`")
2bf58437
RD
10447 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10448 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10449 Border = property(GetBorder,doc="See `GetBorder`")
10450 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10451 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10452 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10453 Children = property(GetChildren,doc="See `GetChildren`")
10454 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10455 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10456 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10457 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10458 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10459 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10460 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10461 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10462 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10463 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10464 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10465 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
2bf58437 10466 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
cbfc9df6 10467 TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`")
2bf58437
RD
10468 Handle = property(GetHandle,doc="See `GetHandle`")
10469 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
2bf58437
RD
10470 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10471 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
994453b8 10472 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
2bf58437
RD
10473 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10474 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10475 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10476 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10477 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10478 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10479 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10480 Parent = property(GetParent,doc="See `GetParent`")
10481 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10482 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10483 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10484 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
2bf58437
RD
10485 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10486 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
2bf58437
RD
10487 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10488 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10489 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10490 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10491 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10492 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10493 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10494 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10495 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
97ab0f6a
RD
10496 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10497 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10498 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
2131d850 10499_core_.Window_swigregister(Window)
e811c8ce
RD
10500
10501def PreWindow(*args, **kwargs):
15afbcd0
RD
10502 """
10503 PreWindow() -> Window
10504
10505 Precreate a Window for 2-phase creation.
10506 """
54f9ee45 10507 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
10508 return val
10509
0085ce49
RD
10510def Window_NewControlId(*args):
10511 """
15afbcd0
RD
10512 Window_NewControlId() -> int
10513
10514 Generate a control id for the controls which were not given one.
10515 """
0085ce49 10516 return _core_.Window_NewControlId(*args)
e811c8ce
RD
10517
10518def Window_NextControlId(*args, **kwargs):
0085ce49 10519 """
15afbcd0
RD
10520 Window_NextControlId(int winid) -> int
10521
10522 Get the id of the control following the one with the given
41e2b43e 10523 autogenerated) id
15afbcd0 10524 """
0085ce49 10525 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
10526
10527def Window_PrevControlId(*args, **kwargs):
0085ce49 10528 """
15afbcd0
RD
10529 Window_PrevControlId(int winid) -> int
10530
10531 Get the id of the control preceding the one with the given
41e2b43e 10532 autogenerated) id
15afbcd0 10533 """
0085ce49 10534 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce 10535
0085ce49
RD
10536def Window_FindFocus(*args):
10537 """
15afbcd0
RD
10538 Window_FindFocus() -> Window
10539
10540 Returns the window or control that currently has the keyboard focus,
10541 or None.
10542 """
0085ce49 10543 return _core_.Window_FindFocus(*args)
e811c8ce 10544
0085ce49
RD
10545def Window_GetCapture(*args):
10546 """
15afbcd0
RD
10547 Window_GetCapture() -> Window
10548
10549 Returns the window which currently captures the mouse or None
10550 """
0085ce49 10551 return _core_.Window_GetCapture(*args)
e811c8ce 10552
74a57fcd 10553def Window_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 10554 """
74a57fcd
RD
10555 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10556
41e2b43e
RD
10557 Get the default attributes for this class. This is useful if you want
10558 to use the same font or colour in your own control as in a standard
10559 control -- which is a much better idea than hard coding specific
db3e571a
RD
10560 colours or fonts which might look completely out of place on the
10561 user's system, especially if it uses themes.
74a57fcd
RD
10562
10563 The variant parameter is only relevant under Mac currently and is
41e2b43e 10564 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
10565 the returned font. See `wx.Window.SetWindowVariant` for more about
10566 this.
74a57fcd 10567 """
0085ce49 10568 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 10569
e811c8ce 10570def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
10571 """
10572 Convenience function for converting a Point or (x,y) in
10573 dialog units to pixel units.
10574 """
e811c8ce
RD
10575 if y is None:
10576 return win.ConvertDialogPointToPixels(point_or_x)
10577 else:
fd3f2efe 10578 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
10579
10580def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
10581 """
10582 Convenience function for converting a Size or (w,h) in
10583 dialog units to pixel units.
10584 """
e811c8ce
RD
10585 if height is None:
10586 return win.ConvertDialogSizeToPixels(size_width)
10587 else:
fd3f2efe 10588 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
10589
10590
10591def FindWindowById(*args, **kwargs):
0085ce49 10592 """
15afbcd0
RD
10593 FindWindowById(long id, Window parent=None) -> Window
10594
10595 Find the first window in the application with the given id. If parent
10596 is None, the search will start from all top-level frames and dialog
10597 boxes; if non-None, the search will be limited to the given window
10598 hierarchy. The search is recursive in both cases.
10599 """
0085ce49 10600 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
10601
10602def FindWindowByName(*args, **kwargs):
0085ce49 10603 """
15afbcd0
RD
10604 FindWindowByName(String name, Window parent=None) -> Window
10605
10606 Find a window by its name (as given in a window constructor or Create
10607 function call). If parent is None, the search will start from all
10608 top-level frames and dialog boxes; if non-None, the search will be
10609 limited to the given window hierarchy. The search is recursive in both
10610 cases.
10611
10612 If no window with such name is found, wx.FindWindowByLabel is called.
10613 """
0085ce49 10614 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
10615
10616def FindWindowByLabel(*args, **kwargs):
0085ce49 10617 """
15afbcd0
RD
10618 FindWindowByLabel(String label, Window parent=None) -> Window
10619
10620 Find a window by its label. Depending on the type of window, the label
10621 may be a window title or panel item label. If parent is None, the
10622 search will start from all top-level frames and dialog boxes; if
10623 non-None, the search will be limited to the given window
10624 hierarchy. The search is recursive in both cases.
10625 """
0085ce49 10626 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
10627
10628def Window_FromHWND(*args, **kwargs):
0085ce49
RD
10629 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10630 return _core_.Window_FromHWND(*args, **kwargs)
b6b0383e 10631
0085ce49
RD
10632def GetTopLevelWindows(*args):
10633 """
b6b0383e
RD
10634 GetTopLevelWindows() -> PyObject
10635
10636 Returns a list of the the application's top-level windows, (frames,
10637 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10638 by wxWidgets, and so it is only valid as long as no top-level windows
10639 are closed or new top-level windows are created.
10640
10641 """
0085ce49 10642 return _core_.GetTopLevelWindows(*args)
e811c8ce
RD
10643#---------------------------------------------------------------------------
10644
10645class Validator(EvtHandler):
093d3ff1 10646 """Proxy of C++ Validator class"""
0085ce49
RD
10647 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10648 __repr__ = _swig_repr
10649 def __init__(self, *args, **kwargs):
a95a7133 10650 """__init__(self) -> Validator"""
0085ce49 10651 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d14a1e28 10652 self._setOORInfo(self)
e811c8ce
RD
10653
10654 def Clone(*args, **kwargs):
a95a7133 10655 """Clone(self) -> Validator"""
54f9ee45 10656 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
10657
10658 def Validate(*args, **kwargs):
a95a7133 10659 """Validate(self, Window parent) -> bool"""
54f9ee45 10660 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
10661
10662 def TransferToWindow(*args, **kwargs):
a95a7133 10663 """TransferToWindow(self) -> bool"""
54f9ee45 10664 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
10665
10666 def TransferFromWindow(*args, **kwargs):
a95a7133 10667 """TransferFromWindow(self) -> bool"""
54f9ee45 10668 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
10669
10670 def GetWindow(*args, **kwargs):
a95a7133 10671 """GetWindow(self) -> Window"""
54f9ee45 10672 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
10673
10674 def SetWindow(*args, **kwargs):
a95a7133 10675 """SetWindow(self, Window window)"""
54f9ee45 10676 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
10677
10678 def IsSilent(*args, **kwargs):
66c033b4 10679 """IsSilent() -> bool"""
54f9ee45 10680 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
10681
10682 IsSilent = staticmethod(IsSilent)
10683 def SetBellOnError(*args, **kwargs):
66c033b4 10684 """SetBellOnError(int doIt=True)"""
54f9ee45 10685 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10686
10687 SetBellOnError = staticmethod(SetBellOnError)
dba7934c 10688 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 10689_core_.Validator_swigregister(Validator)
e811c8ce 10690
0085ce49
RD
10691def Validator_IsSilent(*args):
10692 """Validator_IsSilent() -> bool"""
10693 return _core_.Validator_IsSilent(*args)
e811c8ce
RD
10694
10695def Validator_SetBellOnError(*args, **kwargs):
0085ce49
RD
10696 """Validator_SetBellOnError(int doIt=True)"""
10697 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10698
10699class PyValidator(Validator):
093d3ff1 10700 """Proxy of C++ PyValidator class"""
0085ce49
RD
10701 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10702 __repr__ = _swig_repr
10703 def __init__(self, *args, **kwargs):
a95a7133 10704 """__init__(self) -> PyValidator"""
0085ce49 10705 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
c25f90f6 10706 self._setOORInfo(self);PyValidator._setCallbackInfo(self, self, PyValidator)
e811c8ce
RD
10707
10708 def _setCallbackInfo(*args, **kwargs):
c25f90f6 10709 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
54f9ee45 10710 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce 10711
2131d850 10712_core_.PyValidator_swigregister(PyValidator)
e811c8ce
RD
10713
10714#---------------------------------------------------------------------------
10715
10716class Menu(EvtHandler):
093d3ff1 10717 """Proxy of C++ Menu class"""
0085ce49
RD
10718 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10719 __repr__ = _swig_repr
10720 def __init__(self, *args, **kwargs):
a95a7133 10721 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
0085ce49 10722 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
e811c8ce
RD
10723 self._setOORInfo(self)
10724
10725 def Append(*args, **kwargs):
97ab0f6a
RD
10726 """
10727 Append(self, int id, String text=EmptyString, String help=EmptyString,
10728 int kind=ITEM_NORMAL) -> MenuItem
10729 """
54f9ee45 10730 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
10731
10732 def AppendSeparator(*args, **kwargs):
a95a7133 10733 """AppendSeparator(self) -> MenuItem"""
54f9ee45 10734 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
10735
10736 def AppendCheckItem(*args, **kwargs):
a95a7133 10737 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10738 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
10739
10740 def AppendRadioItem(*args, **kwargs):
a95a7133 10741 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10742 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
10743
10744 def AppendMenu(*args, **kwargs):
a95a7133 10745 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10746 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce 10747
50efceee
RD
10748 def AppendSubMenu(*args, **kwargs):
10749 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10750 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10751
e811c8ce 10752 def AppendItem(*args, **kwargs):
a95a7133 10753 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10754 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce 10755
e811c8ce 10756 def InsertItem(*args, **kwargs):
a95a7133 10757 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 10758 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce 10759
0085ce49
RD
10760 def PrependItem(*args, **kwargs):
10761 """PrependItem(self, MenuItem item) -> MenuItem"""
10762 return _core_.Menu_PrependItem(*args, **kwargs)
10763
10764 def Break(*args, **kwargs):
10765 """Break(self)"""
10766 return _core_.Menu_Break(*args, **kwargs)
10767
e811c8ce 10768 def Insert(*args, **kwargs):
0df68c9f 10769 """
97ab0f6a 10770 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
a41e16b6 10771 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 10772 """
54f9ee45 10773 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
10774
10775 def InsertSeparator(*args, **kwargs):
a95a7133 10776 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 10777 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
10778
10779 def InsertCheckItem(*args, **kwargs):
a95a7133 10780 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10781 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
10782
10783 def InsertRadioItem(*args, **kwargs):
a95a7133 10784 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10785 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
10786
10787 def InsertMenu(*args, **kwargs):
a95a7133 10788 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10789 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce 10790
e811c8ce 10791 def Prepend(*args, **kwargs):
97ab0f6a
RD
10792 """
10793 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10794 int kind=ITEM_NORMAL) -> MenuItem
10795 """
54f9ee45 10796 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
10797
10798 def PrependSeparator(*args, **kwargs):
a95a7133 10799 """PrependSeparator(self) -> MenuItem"""
54f9ee45 10800 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
10801
10802 def PrependCheckItem(*args, **kwargs):
a95a7133 10803 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10804 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
10805
10806 def PrependRadioItem(*args, **kwargs):
a95a7133 10807 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10808 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
10809
10810 def PrependMenu(*args, **kwargs):
a95a7133 10811 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10812 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
10813
10814 def Remove(*args, **kwargs):
a95a7133 10815 """Remove(self, int id) -> MenuItem"""
54f9ee45 10816 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce 10817
59ccbf7f 10818 def RemoveItem(self, item):
a95a7133 10819 """RemoveItem(self, MenuItem item) -> MenuItem"""
59ccbf7f
RD
10820 #// The return object is always the parameter, so return that
10821 #// proxy instead of the new one
10822 val = _core_.Menu_RemoveItem(self, item)
10823 item.this.own(val.this.own())
10824 val.this.disown()
10825 return item
10826
e811c8ce
RD
10827
10828 def Delete(*args, **kwargs):
a95a7133 10829 """Delete(self, int id) -> bool"""
54f9ee45 10830 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
10831
10832 def DeleteItem(*args, **kwargs):
a95a7133 10833 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 10834 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
10835
10836 def Destroy(*args, **kwargs):
0df68c9f 10837 """
a95a7133 10838 Destroy(self)
e811c8ce 10839
0df68c9f
RD
10840 Deletes the C++ object this Python object is a proxy for.
10841 """
b39fe951
RD
10842 args[0].this.own(False)
10843 return _core_.Menu_Destroy(*args, **kwargs)
e811c8ce
RD
10844
10845 def DestroyId(*args, **kwargs):
b39fe951
RD
10846 """DestroyId(self, int id) -> bool"""
10847 return _core_.Menu_DestroyId(*args, **kwargs)
e811c8ce
RD
10848
10849 def DestroyItem(*args, **kwargs):
b39fe951
RD
10850 """DestroyItem(self, MenuItem item) -> bool"""
10851 return _core_.Menu_DestroyItem(*args, **kwargs)
e811c8ce
RD
10852
10853 def GetMenuItemCount(*args, **kwargs):
a95a7133 10854 """GetMenuItemCount(self) -> size_t"""
54f9ee45 10855 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
10856
10857 def GetMenuItems(*args, **kwargs):
a95a7133 10858 """GetMenuItems(self) -> PyObject"""
54f9ee45 10859 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
10860
10861 def FindItem(*args, **kwargs):
a95a7133 10862 """FindItem(self, String item) -> int"""
54f9ee45 10863 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
10864
10865 def FindItemById(*args, **kwargs):
a95a7133 10866 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10867 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
10868
10869 def FindItemByPosition(*args, **kwargs):
a95a7133 10870 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 10871 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
10872
10873 def Enable(*args, **kwargs):
a95a7133 10874 """Enable(self, int id, bool enable)"""
54f9ee45 10875 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
10876
10877 def IsEnabled(*args, **kwargs):
a95a7133 10878 """IsEnabled(self, int id) -> bool"""
54f9ee45 10879 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
10880
10881 def Check(*args, **kwargs):
a95a7133 10882 """Check(self, int id, bool check)"""
54f9ee45 10883 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
10884
10885 def IsChecked(*args, **kwargs):
a95a7133 10886 """IsChecked(self, int id) -> bool"""
54f9ee45 10887 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
10888
10889 def SetLabel(*args, **kwargs):
a95a7133 10890 """SetLabel(self, int id, String label)"""
54f9ee45 10891 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
10892
10893 def GetLabel(*args, **kwargs):
a95a7133 10894 """GetLabel(self, int id) -> String"""
54f9ee45 10895 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
10896
10897 def SetHelpString(*args, **kwargs):
a95a7133 10898 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10899 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
10900
10901 def GetHelpString(*args, **kwargs):
a95a7133 10902 """GetHelpString(self, int id) -> String"""
54f9ee45 10903 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
10904
10905 def SetTitle(*args, **kwargs):
a95a7133 10906 """SetTitle(self, String title)"""
54f9ee45 10907 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
10908
10909 def GetTitle(*args, **kwargs):
a95a7133 10910 """GetTitle(self) -> String"""
54f9ee45 10911 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
10912
10913 def SetEventHandler(*args, **kwargs):
a95a7133 10914 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 10915 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
10916
10917 def GetEventHandler(*args, **kwargs):
a95a7133 10918 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 10919 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
10920
10921 def SetInvokingWindow(*args, **kwargs):
a95a7133 10922 """SetInvokingWindow(self, Window win)"""
54f9ee45 10923 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10924
10925 def GetInvokingWindow(*args, **kwargs):
a95a7133 10926 """GetInvokingWindow(self) -> Window"""
54f9ee45 10927 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10928
10929 def GetStyle(*args, **kwargs):
a95a7133 10930 """GetStyle(self) -> long"""
54f9ee45 10931 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
10932
10933 def UpdateUI(*args, **kwargs):
a95a7133 10934 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 10935 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
10936
10937 def GetMenuBar(*args, **kwargs):
a95a7133 10938 """GetMenuBar(self) -> MenuBar"""
54f9ee45 10939 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
10940
10941 def Attach(*args, **kwargs):
a95a7133 10942 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 10943 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
10944
10945 def Detach(*args, **kwargs):
a95a7133 10946 """Detach(self)"""
54f9ee45 10947 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
10948
10949 def IsAttached(*args, **kwargs):
a95a7133 10950 """IsAttached(self) -> bool"""
54f9ee45 10951 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
10952
10953 def SetParent(*args, **kwargs):
a95a7133 10954 """SetParent(self, Menu parent)"""
54f9ee45 10955 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
10956
10957 def GetParent(*args, **kwargs):
a95a7133 10958 """GetParent(self) -> Menu"""
54f9ee45 10959 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 10960
57332a5a
RD
10961 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10962 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10963 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10964 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10965 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10966 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10967 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10968 Style = property(GetStyle,doc="See `GetStyle`")
10969 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
2131d850 10970_core_.Menu_swigregister(Menu)
d14a1e28
RD
10971DefaultValidator = cvar.DefaultValidator
10972
10973#---------------------------------------------------------------------------
10974
10975class MenuBar(Window):
093d3ff1 10976 """Proxy of C++ MenuBar class"""
0085ce49
RD
10977 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10978 __repr__ = _swig_repr
10979 def __init__(self, *args, **kwargs):
a95a7133 10980 """__init__(self, long style=0) -> MenuBar"""
0085ce49 10981 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d14a1e28 10982 self._setOORInfo(self)
e811c8ce
RD
10983
10984 def Append(*args, **kwargs):
a95a7133 10985 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 10986 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
10987
10988 def Insert(*args, **kwargs):
a95a7133 10989 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 10990 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
10991
10992 def GetMenuCount(*args, **kwargs):
a95a7133 10993 """GetMenuCount(self) -> size_t"""
54f9ee45 10994 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
10995
10996 def GetMenu(*args, **kwargs):
a95a7133 10997 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 10998 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
10999
11000 def Replace(*args, **kwargs):
a95a7133 11001 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 11002 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
11003
11004 def Remove(*args, **kwargs):
a95a7133 11005 """Remove(self, size_t pos) -> Menu"""
54f9ee45 11006 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
11007
11008 def EnableTop(*args, **kwargs):
a95a7133 11009 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 11010 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
11011
11012 def IsEnabledTop(*args, **kwargs):
a95a7133 11013 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 11014 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
11015
11016 def SetLabelTop(*args, **kwargs):
a95a7133 11017 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 11018 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
11019
11020 def GetLabelTop(*args, **kwargs):
a95a7133 11021 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 11022 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
11023
11024 def FindMenuItem(*args, **kwargs):
a95a7133 11025 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 11026 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
11027
11028 def FindItemById(*args, **kwargs):
a95a7133 11029 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 11030 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
11031
11032 def FindMenu(*args, **kwargs):
a95a7133 11033 """FindMenu(self, String title) -> int"""
54f9ee45 11034 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
11035
11036 def Enable(*args, **kwargs):
a95a7133 11037 """Enable(self, int id, bool enable)"""
54f9ee45 11038 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
11039
11040 def Check(*args, **kwargs):
a95a7133 11041 """Check(self, int id, bool check)"""
54f9ee45 11042 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
11043
11044 def IsChecked(*args, **kwargs):
a95a7133 11045 """IsChecked(self, int id) -> bool"""
54f9ee45 11046 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
11047
11048 def IsEnabled(*args, **kwargs):
a95a7133 11049 """IsEnabled(self, int id) -> bool"""
54f9ee45 11050 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
11051
11052 def SetLabel(*args, **kwargs):
a95a7133 11053 """SetLabel(self, int id, String label)"""
54f9ee45 11054 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
11055
11056 def GetLabel(*args, **kwargs):
a95a7133 11057 """GetLabel(self, int id) -> String"""
54f9ee45 11058 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
11059
11060 def SetHelpString(*args, **kwargs):
a95a7133 11061 """SetHelpString(self, int id, String helpString)"""
54f9ee45 11062 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
11063
11064 def GetHelpString(*args, **kwargs):
a95a7133 11065 """GetHelpString(self, int id) -> String"""
54f9ee45 11066 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
11067
11068 def GetFrame(*args, **kwargs):
a95a7133 11069 """GetFrame(self) -> wxFrame"""
54f9ee45 11070 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
11071
11072 def IsAttached(*args, **kwargs):
a95a7133 11073 """IsAttached(self) -> bool"""
54f9ee45 11074 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
11075
11076 def Attach(*args, **kwargs):
a95a7133 11077 """Attach(self, wxFrame frame)"""
54f9ee45 11078 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
11079
11080 def Detach(*args, **kwargs):
a95a7133 11081 """Detach(self)"""
54f9ee45 11082 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 11083
587d0f36
RD
11084 def UpdateMenus(*args, **kwargs):
11085 """UpdateMenus(self)"""
11086 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
11087
4f433fef
RD
11088 def SetAutoWindowMenu(*args, **kwargs):
11089 """SetAutoWindowMenu(bool enable)"""
11090 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
11091
11092 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
11093 def GetAutoWindowMenu(*args, **kwargs):
11094 """GetAutoWindowMenu() -> bool"""
11095 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
11096
11097 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
97ab0f6a
RD
11098 def GetMenus(self):
11099 """Return a list of (menu, label) items for the menus in the MenuBar. """
11100 return [(self.GetMenu(i), self.GetLabelTop(i))
11101 for i in range(self.GetMenuCount())]
11102
11103 def SetMenus(self, items):
11104 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
11105 for i in range(self.GetMenuCount()-1, -1, -1):
11106 self.Remove(i)
11107 for m, l in items:
11108 self.Append(m, l)
11109
57332a5a 11110 Frame = property(GetFrame,doc="See `GetFrame`")
57332a5a
RD
11111 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
11112 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
2131d850 11113_core_.MenuBar_swigregister(MenuBar)
d14a1e28 11114
4f433fef 11115def MenuBar_SetAutoWindowMenu(*args, **kwargs):
0085ce49
RD
11116 """MenuBar_SetAutoWindowMenu(bool enable)"""
11117 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 11118
0085ce49
RD
11119def MenuBar_GetAutoWindowMenu(*args):
11120 """MenuBar_GetAutoWindowMenu() -> bool"""
11121 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 11122
d14a1e28
RD
11123#---------------------------------------------------------------------------
11124
11125class MenuItem(Object):
093d3ff1 11126 """Proxy of C++ MenuItem class"""
0085ce49
RD
11127 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11128 __repr__ = _swig_repr
11129 def __init__(self, *args, **kwargs):
0df68c9f 11130 """
89d1e2ee 11131 __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString,
196addbf
RD
11132 String help=EmptyString, int kind=ITEM_NORMAL,
11133 Menu subMenu=None) -> MenuItem
0df68c9f 11134 """
0085ce49
RD
11135 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
11136 __swig_destroy__ = _core_.delete_MenuItem
11137 __del__ = lambda self : None;
89d1e2ee 11138 def Destroy(self): pass
e811c8ce 11139 def GetMenu(*args, **kwargs):
a95a7133 11140 """GetMenu(self) -> Menu"""
54f9ee45 11141 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
11142
11143 def SetMenu(*args, **kwargs):
a95a7133 11144 """SetMenu(self, Menu menu)"""
54f9ee45 11145 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
11146
11147 def SetId(*args, **kwargs):
a95a7133 11148 """SetId(self, int id)"""
54f9ee45 11149 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
11150
11151 def GetId(*args, **kwargs):
a95a7133 11152 """GetId(self) -> int"""
54f9ee45 11153 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
11154
11155 def IsSeparator(*args, **kwargs):
a95a7133 11156 """IsSeparator(self) -> bool"""
54f9ee45 11157 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
11158
11159 def SetText(*args, **kwargs):
a95a7133 11160 """SetText(self, String str)"""
54f9ee45 11161 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
11162
11163 def GetLabel(*args, **kwargs):
a95a7133 11164 """GetLabel(self) -> String"""
54f9ee45 11165 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
11166
11167 def GetText(*args, **kwargs):
a95a7133 11168 """GetText(self) -> String"""
54f9ee45 11169 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
11170
11171 def GetLabelFromText(*args, **kwargs):
66c033b4 11172 """GetLabelFromText(String text) -> String"""
54f9ee45 11173 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
11174
11175 GetLabelFromText = staticmethod(GetLabelFromText)
11176 def GetKind(*args, **kwargs):
a95a7133 11177 """GetKind(self) -> int"""
54f9ee45 11178 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 11179
a95a7133
RD
11180 def SetKind(*args, **kwargs):
11181 """SetKind(self, int kind)"""
54f9ee45 11182 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 11183
e811c8ce 11184 def SetCheckable(*args, **kwargs):
a95a7133 11185 """SetCheckable(self, bool checkable)"""
54f9ee45 11186 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
11187
11188 def IsCheckable(*args, **kwargs):
a95a7133 11189 """IsCheckable(self) -> bool"""
54f9ee45 11190 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
11191
11192 def IsSubMenu(*args, **kwargs):
a95a7133 11193 """IsSubMenu(self) -> bool"""
54f9ee45 11194 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
11195
11196 def SetSubMenu(*args, **kwargs):
a95a7133 11197 """SetSubMenu(self, Menu menu)"""
54f9ee45 11198 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
11199
11200 def GetSubMenu(*args, **kwargs):
a95a7133 11201 """GetSubMenu(self) -> Menu"""
54f9ee45 11202 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
11203
11204 def Enable(*args, **kwargs):
a95a7133 11205 """Enable(self, bool enable=True)"""
54f9ee45 11206 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
11207
11208 def IsEnabled(*args, **kwargs):
a95a7133 11209 """IsEnabled(self) -> bool"""
54f9ee45 11210 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
11211
11212 def Check(*args, **kwargs):
a95a7133 11213 """Check(self, bool check=True)"""
54f9ee45 11214 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
11215
11216 def IsChecked(*args, **kwargs):
a95a7133 11217 """IsChecked(self) -> bool"""
54f9ee45 11218 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
11219
11220 def Toggle(*args, **kwargs):
a95a7133 11221 """Toggle(self)"""
54f9ee45 11222 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
11223
11224 def SetHelp(*args, **kwargs):
a95a7133 11225 """SetHelp(self, String str)"""
54f9ee45 11226 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
11227
11228 def GetHelp(*args, **kwargs):
a95a7133 11229 """GetHelp(self) -> String"""
54f9ee45 11230 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
11231
11232 def GetAccel(*args, **kwargs):
a95a7133 11233 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 11234 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
11235
11236 def SetAccel(*args, **kwargs):
a95a7133 11237 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 11238 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce 11239
091f5bed
RD
11240 def SetBitmap(*args, **kwargs):
11241 """SetBitmap(self, Bitmap bitmap)"""
11242 return _core_.MenuItem_SetBitmap(*args, **kwargs)
11243
11244 def GetBitmap(*args, **kwargs):
11245 """GetBitmap(self) -> Bitmap"""
11246 return _core_.MenuItem_GetBitmap(*args, **kwargs)
11247
c1280d1e
RD
11248 def SetFont(*args, **kwargs):
11249 """SetFont(self, Font font)"""
11250 return _core_.MenuItem_SetFont(*args, **kwargs)
11251
11252 def GetFont(*args, **kwargs):
11253 """GetFont(self) -> Font"""
11254 return _core_.MenuItem_GetFont(*args, **kwargs)
11255
11256 def SetTextColour(*args, **kwargs):
11257 """SetTextColour(self, Colour colText)"""
11258 return _core_.MenuItem_SetTextColour(*args, **kwargs)
11259
11260 def GetTextColour(*args, **kwargs):
11261 """GetTextColour(self) -> Colour"""
11262 return _core_.MenuItem_GetTextColour(*args, **kwargs)
11263
11264 def SetBackgroundColour(*args, **kwargs):
11265 """SetBackgroundColour(self, Colour colBack)"""
11266 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
11267
11268 def GetBackgroundColour(*args, **kwargs):
11269 """GetBackgroundColour(self) -> Colour"""
11270 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
11271
11272 def SetBitmaps(*args, **kwargs):
11273 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11274 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
11275
11276 def SetDisabledBitmap(*args, **kwargs):
11277 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11278 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
11279
11280 def GetDisabledBitmap(*args, **kwargs):
11281 """GetDisabledBitmap(self) -> Bitmap"""
11282 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
11283
11284 def SetMarginWidth(*args, **kwargs):
11285 """SetMarginWidth(self, int nWidth)"""
11286 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
11287
11288 def GetMarginWidth(*args, **kwargs):
11289 """GetMarginWidth(self) -> int"""
11290 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
11291
e811c8ce 11292 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 11293 """GetDefaultMarginWidth() -> int"""
54f9ee45 11294 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
11295
11296 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
11297 def IsOwnerDrawn(*args, **kwargs):
11298 """IsOwnerDrawn(self) -> bool"""
11299 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
11300
11301 def SetOwnerDrawn(*args, **kwargs):
11302 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
11303 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
11304
11305 def ResetOwnerDrawn(*args, **kwargs):
11306 """ResetOwnerDrawn(self)"""
11307 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
11308
57332a5a
RD
11309 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
11310 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
11311 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
11312 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
11313 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
11314 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
11315 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
11316 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
11317 Label = property(GetLabel,doc="See `GetLabel`")
11318 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
11319 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
11320 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
11321 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
11322 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
2131d850 11323_core_.MenuItem_swigregister(MenuItem)
d14a1e28 11324
e811c8ce 11325def MenuItem_GetLabelFromText(*args, **kwargs):
0085ce49
RD
11326 """MenuItem_GetLabelFromText(String text) -> String"""
11327 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 11328
0085ce49
RD
11329def MenuItem_GetDefaultMarginWidth(*args):
11330 """MenuItem_GetDefaultMarginWidth() -> int"""
11331 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d14a1e28
RD
11332
11333#---------------------------------------------------------------------------
11334
11335class Control(Window):
15afbcd0
RD
11336 """
11337 This is the base class for a control or 'widget'.
11338
41e2b43e
RD
11339 A control is generally a small window which processes user input
11340 and/or displays one or more item of data.
15afbcd0 11341 """
0085ce49
RD
11342 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11343 __repr__ = _swig_repr
11344 def __init__(self, *args, **kwargs):
0df68c9f 11345 """
248ed943
RD
11346 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11347 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 11348 String name=ControlNameStr) -> Control
15afbcd0 11349
41e2b43e
RD
11350 Create a Control. Normally you should only call this from a subclass'
11351 __init__ as a plain old wx.Control is not very useful.
0df68c9f 11352 """
0085ce49 11353 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d14a1e28 11354 self._setOORInfo(self)
e811c8ce
RD
11355
11356 def Create(*args, **kwargs):
0df68c9f 11357 """
248ed943
RD
11358 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11359 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 11360 String name=ControlNameStr) -> bool
15afbcd0
RD
11361
11362 Do the 2nd phase and create the GUI control.
0df68c9f 11363 """
54f9ee45 11364 return _core_.Control_Create(*args, **kwargs)
e811c8ce 11365
10044bf1
RD
11366 def GetAlignment(*args, **kwargs):
11367 """
11368 GetAlignment(self) -> int
11369
11370 Get the control alignment (left/right/centre, top/bottom/centre)
11371 """
11372 return _core_.Control_GetAlignment(*args, **kwargs)
11373
34e0a3bb 11374 def GetLabelText(*args, **kwargs):
10044bf1 11375 """
10044bf1
RD
11376 GetLabelText(self) -> String
11377
11378 Get just the text of the label, without mnemonic characters ('&')
11379 """
34e0a3bb 11380 return _core_.Control_GetLabelText(*args, **kwargs)
10044bf1 11381
e811c8ce 11382 def Command(*args, **kwargs):
15afbcd0 11383 """
a95a7133 11384 Command(self, CommandEvent event)
15afbcd0 11385
41e2b43e
RD
11386 Simulates the effect of the user issuing a command to the item.
11387
11388 :see: `wx.CommandEvent`
11389
15afbcd0 11390 """
54f9ee45 11391 return _core_.Control_Command(*args, **kwargs)
e811c8ce 11392
ddeca22c
RD
11393 def RemoveMnemonics(*args, **kwargs):
11394 """
11395 RemoveMnemonics(String str) -> String
11396
11397 removes the mnemonics characters
11398 """
11399 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11400
11401 RemoveMnemonics = staticmethod(RemoveMnemonics)
74a57fcd 11402 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
11403 """
11404 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11405
11406 Get the default attributes for this class. This is useful if you want
11407 to use the same font or colour in your own control as in a standard
11408 control -- which is a much better idea than hard coding specific
11409 colours or fonts which might look completely out of place on the
11410 user's system, especially if it uses themes.
11411
11412 The variant parameter is only relevant under Mac currently and is
11413 ignore under other platforms. Under Mac, it will change the size of
11414 the returned font. See `wx.Window.SetWindowVariant` for more about
11415 this.
11416 """
54f9ee45 11417 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
11418
11419 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2bf58437 11420 Alignment = property(GetAlignment,doc="See `GetAlignment`")
2bf58437 11421 LabelText = property(GetLabelText,doc="See `GetLabelText`")
2131d850 11422_core_.Control_swigregister(Control)
b2dc1044 11423ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
11424
11425def PreControl(*args, **kwargs):
15afbcd0
RD
11426 """
11427 PreControl() -> Control
11428
11429 Precreate a Control control for 2-phase creation
11430 """
54f9ee45 11431 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
11432 return val
11433
ddeca22c
RD
11434def Control_RemoveMnemonics(*args, **kwargs):
11435 """
11436 Control_RemoveMnemonics(String str) -> String
11437
11438 removes the mnemonics characters
11439 """
11440 return _core_.Control_RemoveMnemonics(*args, **kwargs)
11441
74a57fcd 11442def Control_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 11443 """
110da5b0
RD
11444 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11445
11446 Get the default attributes for this class. This is useful if you want
11447 to use the same font or colour in your own control as in a standard
11448 control -- which is a much better idea than hard coding specific
11449 colours or fonts which might look completely out of place on the
11450 user's system, especially if it uses themes.
11451
11452 The variant parameter is only relevant under Mac currently and is
11453 ignore under other platforms. Under Mac, it will change the size of
11454 the returned font. See `wx.Window.SetWindowVariant` for more about
11455 this.
11456 """
0085ce49 11457 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 11458
d14a1e28
RD
11459#---------------------------------------------------------------------------
11460
11461class ItemContainer(object):
15afbcd0 11462 """
53aa7709
RD
11463 The wx.ItemContainer class defines an interface which is implemented
11464 by all controls which have string subitems, each of which may be
11465 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11466 as `wx.ComboBox` which implements an extended interface deriving from
41e2b43e 11467 this one.
15afbcd0 11468
41e2b43e
RD
11469 It defines the methods for accessing the control's items and although
11470 each of the derived classes implements them differently, they still
11471 all conform to the same interface.
15afbcd0 11472
41e2b43e
RD
11473 The items in a wx.ItemContainer have (non empty) string labels and,
11474 optionally, client data associated with them.
15afbcd0
RD
11475
11476 """
0085ce49
RD
11477 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11478 def __init__(self): raise AttributeError, "No constructor defined"
11479 __repr__ = _swig_repr
e811c8ce 11480 def Append(*args, **kwargs):
15afbcd0 11481 """
a95a7133 11482 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 11483
41e2b43e
RD
11484 Adds the item to the control, associating the given data with the item
11485 if not None. The return value is the index of the newly added item
11486 which may be different from the last one if the control is sorted (e.g.
11487 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 11488 """
54f9ee45 11489 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
11490
11491 def AppendItems(*args, **kwargs):
15afbcd0 11492 """
f5b96ee1 11493 AppendItems(self, List strings)
15afbcd0 11494
41e2b43e
RD
11495 Apend several items at once to the control. Notice that calling this
11496 method may be much faster than appending the items one by one if you
11497 need to add a lot of items.
15afbcd0 11498 """
54f9ee45 11499 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
11500
11501 def Insert(*args, **kwargs):
15afbcd0 11502 """
d359a380 11503 Insert(self, String item, int pos, PyObject clientData=None) -> int
15afbcd0 11504
41e2b43e 11505 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
11506 optionally associating some data object with the item.
11507 """
54f9ee45 11508 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
11509
11510 def Clear(*args, **kwargs):
15afbcd0 11511 """
a95a7133 11512 Clear(self)
15afbcd0
RD
11513
11514 Removes all items from the control.
11515 """
54f9ee45 11516 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
11517
11518 def Delete(*args, **kwargs):
15afbcd0 11519 """
d359a380 11520 Delete(self, int n)
15afbcd0 11521
41e2b43e
RD
11522 Deletes the item at the zero-based index 'n' from the control. Note
11523 that it is an error (signalled by a `wx.PyAssertionError` exception if
11524 enabled) to remove an item with the index negative or greater or equal
11525 than the number of items in the control.
15afbcd0 11526 """
54f9ee45 11527 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce 11528
53aa7709
RD
11529 def GetClientData(*args, **kwargs):
11530 """
d359a380 11531 GetClientData(self, int n) -> PyObject
53aa7709
RD
11532
11533 Returns the client data associated with the given item, (if any.)
11534 """
11535 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11536
11537 def SetClientData(*args, **kwargs):
11538 """
d359a380 11539 SetClientData(self, int n, PyObject clientData)
53aa7709
RD
11540
11541 Associate the given client data with the item at position n.
11542 """
11543 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11544
e811c8ce 11545 def GetCount(*args, **kwargs):
15afbcd0 11546 """
d359a380 11547 GetCount(self) -> int
15afbcd0
RD
11548
11549 Returns the number of items in the control.
11550 """
54f9ee45 11551 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
11552
11553 def IsEmpty(*args, **kwargs):
15afbcd0 11554 """
a95a7133 11555 IsEmpty(self) -> bool
15afbcd0
RD
11556
11557 Returns True if the control is empty or False if it has some items.
11558 """
54f9ee45 11559 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
11560
11561 def GetString(*args, **kwargs):
15afbcd0 11562 """
d359a380 11563 GetString(self, int n) -> String
15afbcd0
RD
11564
11565 Returns the label of the item with the given index.
11566 """
54f9ee45 11567 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
11568
11569 def GetStrings(*args, **kwargs):
a95a7133 11570 """GetStrings(self) -> wxArrayString"""
54f9ee45 11571 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
11572
11573 def SetString(*args, **kwargs):
15afbcd0 11574 """
d359a380 11575 SetString(self, int n, String s)
15afbcd0
RD
11576
11577 Sets the label for the given item.
11578 """
54f9ee45 11579 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
11580
11581 def FindString(*args, **kwargs):
15afbcd0 11582 """
a95a7133 11583 FindString(self, String s) -> int
15afbcd0
RD
11584
11585 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
11586 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11587 found.
15afbcd0 11588 """
54f9ee45 11589 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce 11590
53aa7709 11591 def SetSelection(*args, **kwargs):
15afbcd0 11592 """
53aa7709 11593 SetSelection(self, int n)
15afbcd0
RD
11594
11595 Sets the item at index 'n' to be the selected item.
11596 """
53aa7709 11597 return _core_.ItemContainer_SetSelection(*args, **kwargs)
e811c8ce
RD
11598
11599 def GetSelection(*args, **kwargs):
15afbcd0 11600 """
a95a7133 11601 GetSelection(self) -> int
15afbcd0 11602
41e2b43e
RD
11603 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11604 is selected.
15afbcd0 11605 """
54f9ee45 11606 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce 11607
53aa7709
RD
11608 def SetStringSelection(*args, **kwargs):
11609 """SetStringSelection(self, String s) -> bool"""
11610 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11611
e811c8ce 11612 def GetStringSelection(*args, **kwargs):
15afbcd0 11613 """
a95a7133 11614 GetStringSelection(self) -> String
15afbcd0 11615
41e2b43e
RD
11616 Returns the label of the selected item or an empty string if no item
11617 is selected.
15afbcd0 11618 """
54f9ee45 11619 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce 11620
53aa7709 11621 def Select(*args, **kwargs):
15afbcd0 11622 """
53aa7709 11623 Select(self, int n)
15afbcd0 11624
53aa7709
RD
11625 This is the same as `SetSelection` and exists only because it is
11626 slightly more natural for controls which support multiple selection.
15afbcd0 11627 """
53aa7709 11628 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 11629
97ab0f6a
RD
11630 def GetItems(self):
11631 """Return a list of the strings in the control"""
11632 return [self.GetString(i) for i in xrange(self.GetCount())]
11633
11634 def SetItems(self, items):
11635 """Clear and set the strings in the control from a list"""
11636 self.Clear()
11637 for i in items:
11638 self.Append(i)
11639
11640 Count = property(GetCount,doc="See `GetCount`")
11641 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11642 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11643 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11644 Strings = property(GetStrings,doc="See `GetStrings`")
2131d850 11645_core_.ItemContainer_swigregister(ItemContainer)
d14a1e28
RD
11646
11647#---------------------------------------------------------------------------
11648
11649class ControlWithItems(Control,ItemContainer):
15afbcd0 11650 """
41e2b43e
RD
11651 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11652 wx.Control class, and is used for the base class of various controls
11653 that have items.
15afbcd0 11654 """
0085ce49
RD
11655 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11656 def __init__(self): raise AttributeError, "No constructor defined"
11657 __repr__ = _swig_repr
2131d850 11658_core_.ControlWithItems_swigregister(ControlWithItems)
d14a1e28
RD
11659
11660#---------------------------------------------------------------------------
11661
cbfc9df6
RD
11662class SizerFlags(object):
11663 """
11664 Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
11665 to specify a lot of flags and parameters which can be unwieldy. This
11666 is where wx.SizerFlags comes in: it allows you to specify all
11667 parameters using the named methods instead. For example, instead of::
11668
11669 sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
11670
11671 you can now write::
11672
11673 sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
11674
11675 This is more readable and also allows you to create wx.SizerFlags
11676 objects which can be reused for several sizer items.::
11677
11678 flagsExpand = wx.SizerFlags(1)
11679 flagsExpand.Expand().Border(wx.ALL, 10)
11680 sizer.AddF(ctrl1, flagsExpand)
11681 sizer.AddF(ctrl2, flagsExpand)
11682
11683 Note that by specification, all methods of wx.SizerFlags return the
11684 wx.SizerFlags object itself allowing chaining multiple method calls
11685 like in the examples above.
11686 """
11687 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11688 __repr__ = _swig_repr
11689 def __init__(self, *args, **kwargs):
11690 """
11691 __init__(self, int proportion=0) -> SizerFlags
11692
11693 Constructs the flags object with the specified proportion.
11694 """
11695 _core_.SizerFlags_swiginit(self,_core_.new_SizerFlags(*args, **kwargs))
11696 __swig_destroy__ = _core_.delete_SizerFlags
11697 __del__ = lambda self : None;
11698 def Proportion(*args, **kwargs):
11699 """
11700 Proportion(self, int proportion) -> SizerFlags
11701
11702 Sets the item's proportion value.
11703 """
11704 return _core_.SizerFlags_Proportion(*args, **kwargs)
11705
11706 def Align(*args, **kwargs):
11707 """
11708 Align(self, int alignment) -> SizerFlags
11709
11710 Sets the item's alignment
11711 """
11712 return _core_.SizerFlags_Align(*args, **kwargs)
11713
11714 def Expand(*args, **kwargs):
11715 """
11716 Expand(self) -> SizerFlags
11717
11718 Sets the wx.EXPAND flag, which will cause the item to be expanded to
11719 fill as much space as it is given by the sizer.
11720 """
11721 return _core_.SizerFlags_Expand(*args, **kwargs)
11722
11723 def Centre(*args, **kwargs):
11724 """
11725 Centre(self) -> SizerFlags
11726
11727 Same as `Center` for those with an alternate dialect of English.
11728 """
11729 return _core_.SizerFlags_Centre(*args, **kwargs)
11730
11731 def Center(*args, **kwargs):
11732 """
11733 Center(self) -> SizerFlags
11734
11735 Sets the centering alignment flags.
11736 """
11737 return _core_.SizerFlags_Center(*args, **kwargs)
11738
11739 def Left(*args, **kwargs):
11740 """
11741 Left(self) -> SizerFlags
11742
11743 Aligns the object to the left, a shortcut for calling
11744 Align(wx.ALIGN_LEFT)
11745 """
11746 return _core_.SizerFlags_Left(*args, **kwargs)
11747
11748 def Right(*args, **kwargs):
11749 """
11750 Right(self) -> SizerFlags
11751
11752 Aligns the object to the right, a shortcut for calling
11753 Align(wx.ALIGN_RIGHT)
11754 """
11755 return _core_.SizerFlags_Right(*args, **kwargs)
11756
11757 def Top(*args, **kwargs):
11758 """
11759 Top(self) -> SizerFlags
11760
11761 Aligns the object to the top of the available space, a shortcut for
11762 calling Align(wx.ALIGN_TOP)
11763 """
11764 return _core_.SizerFlags_Top(*args, **kwargs)
11765
11766 def Bottom(*args, **kwargs):
11767 """
11768 Bottom(self) -> SizerFlags
11769
11770 Aligns the object to the bottom of the available space, a shortcut for
11771 calling Align(wx.ALIGN_BOTTOM)
11772 """
11773 return _core_.SizerFlags_Bottom(*args, **kwargs)
11774
11775 def Shaped(*args, **kwargs):
11776 """
11777 Shaped(self) -> SizerFlags
11778
11779 Sets the wx.SHAPED flag.
11780 """
11781 return _core_.SizerFlags_Shaped(*args, **kwargs)
11782
11783 def FixedMinSize(*args, **kwargs):
11784 """
11785 FixedMinSize(self) -> SizerFlags
11786
11787 Sets the wx.FIXED_MINSIZE flag.
11788 """
11789 return _core_.SizerFlags_FixedMinSize(*args, **kwargs)
11790
11791 def Border(*args, **kwargs):
11792 """
11793 Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags
11794
11795 Sets the border of the item in the direction(s) or sides given by the
11796 direction parameter. If the borderInPixels value is not given then
11797 the default border size (see `GetDefaultBorder`) will be used.
11798 """
11799 return _core_.SizerFlags_Border(*args, **kwargs)
11800
11801 def DoubleBorder(*args, **kwargs):
11802 """
11803 DoubleBorder(self, int direction=ALL) -> SizerFlags
11804
11805 Sets the border in the given direction to twice the default border
11806 size.
11807 """
11808 return _core_.SizerFlags_DoubleBorder(*args, **kwargs)
11809
11810 def TripleBorder(*args, **kwargs):
11811 """
11812 TripleBorder(self, int direction=ALL) -> SizerFlags
11813
11814 Sets the border in the given direction to three times the default
11815 border size.
11816 """
11817 return _core_.SizerFlags_TripleBorder(*args, **kwargs)
11818
11819 def HorzBorder(*args, **kwargs):
11820 """
11821 HorzBorder(self) -> SizerFlags
11822
11823 Sets the left and right borders to the default border size.
11824 """
11825 return _core_.SizerFlags_HorzBorder(*args, **kwargs)
11826
11827 def DoubleHorzBorder(*args, **kwargs):
11828 """
11829 DoubleHorzBorder(self) -> SizerFlags
11830
11831 Sets the left and right borders to twice the default border size.
11832 """
11833 return _core_.SizerFlags_DoubleHorzBorder(*args, **kwargs)
11834
11835 def GetDefaultBorder(*args, **kwargs):
11836 """
11837 GetDefaultBorder() -> int
11838
11839 Returns the default border size used by the other border methods
11840 """
11841 return _core_.SizerFlags_GetDefaultBorder(*args, **kwargs)
11842
11843 GetDefaultBorder = staticmethod(GetDefaultBorder)
11844 def GetProportion(*args, **kwargs):
11845 """
11846 GetProportion(self) -> int
11847
11848 Returns the proportion value to be used in the sizer item.
11849 """
11850 return _core_.SizerFlags_GetProportion(*args, **kwargs)
11851
11852 def GetFlags(*args, **kwargs):
11853 """
11854 GetFlags(self) -> int
11855
11856 Returns the flags value to be used in the sizer item.
11857 """
11858 return _core_.SizerFlags_GetFlags(*args, **kwargs)
11859
11860 def GetBorderInPixels(*args, **kwargs):
11861 """
11862 GetBorderInPixels(self) -> int
11863
11864 Returns the border value in pixels to be used in the sizer item.
11865 """
11866 return _core_.SizerFlags_GetBorderInPixels(*args, **kwargs)
11867
11868_core_.SizerFlags_swigregister(SizerFlags)
11869
11870def SizerFlags_GetDefaultBorder(*args):
11871 """
11872 SizerFlags_GetDefaultBorder() -> int
11873
11874 Returns the default border size used by the other border methods
11875 """
11876 return _core_.SizerFlags_GetDefaultBorder(*args)
11877
d14a1e28 11878class SizerItem(Object):
248ed943
RD
11879 """
11880 The wx.SizerItem class is used to track the position, size and other
01f6b6d3
RD
11881 attributes of each item managed by a `wx.Sizer`. It is not usually
11882 necessary to use this class because the sizer elements can also be
11883 identified by their positions or window or sizer references but
11884 sometimes it may be more convenient to use wx.SizerItem directly.
11885 Also, custom classes derived from `wx.PySizer` will probably need to
11886 use the collection of wx.SizerItems held by wx.Sizer when calculating
11887 layout.
248ed943
RD
11888
11889 :see: `wx.Sizer`, `wx.GBSizerItem`
11890 """
0085ce49
RD
11891 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11892 __repr__ = _swig_repr
11893 def __init__(self, *args, **kwargs):
248ed943
RD
11894 """
11895 __init__(self) -> SizerItem
11896
11897 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11898 size will need to be set before this item can be used in a Sizer.
11899
11900 You will probably never need to create a wx.SizerItem directly as they
11901 are created automatically when the sizer's Add, Insert or Prepend
11902 methods are called.
11903
11904 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11905 """
0085ce49
RD
11906 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11907 __swig_destroy__ = _core_.delete_SizerItem
11908 __del__ = lambda self : None;
e811c8ce 11909 def DeleteWindows(*args, **kwargs):
248ed943
RD
11910 """
11911 DeleteWindows(self)
11912
11913 Destroy the window or the windows in a subsizer, depending on the type
11914 of item.
11915 """
54f9ee45 11916 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
11917
11918 def DetachSizer(*args, **kwargs):
248ed943
RD
11919 """
11920 DetachSizer(self)
11921
11922 Enable deleting the SizerItem without destroying the contained sizer.
11923 """
54f9ee45 11924 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
11925
11926 def GetSize(*args, **kwargs):
248ed943
RD
11927 """
11928 GetSize(self) -> Size
11929
11930 Get the current size of the item, as set in the last Layout.
11931 """
54f9ee45 11932 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
11933
11934 def CalcMin(*args, **kwargs):
248ed943
RD
11935 """
11936 CalcMin(self) -> Size
11937
11938 Calculates the minimum desired size for the item, including any space
11939 needed by borders.
11940 """
54f9ee45 11941 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
11942
11943 def SetDimension(*args, **kwargs):
248ed943
RD
11944 """
11945 SetDimension(self, Point pos, Size size)
11946
11947 Set the position and size of the space allocated for this item by the
11948 sizer, and adjust the position and size of the item (window or
11949 subsizer) to be within that space taking alignment and borders into
11950 account.
11951 """
54f9ee45 11952 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
11953
11954 def GetMinSize(*args, **kwargs):
248ed943
RD
11955 """
11956 GetMinSize(self) -> Size
11957
11958 Get the minimum size needed for the item.
11959 """
54f9ee45 11960 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 11961
dfbb5885
RD
11962 def GetMinSizeWithBorder(*args, **kwargs):
11963 """
11964 GetMinSizeWithBorder(self) -> Size
11965
11966 Get the minimum size needed for the item with space for the borders
11967 added, if needed.
11968 """
11969 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11970
e811c8ce 11971 def SetInitSize(*args, **kwargs):
a95a7133 11972 """SetInitSize(self, int x, int y)"""
54f9ee45 11973 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
11974
11975 def SetRatioWH(*args, **kwargs):
248ed943
RD
11976 """
11977 SetRatioWH(self, int width, int height)
11978
11979 Set the ratio item attribute.
11980 """
54f9ee45 11981 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
11982
11983 def SetRatioSize(*args, **kwargs):
248ed943
RD
11984 """
11985 SetRatioSize(self, Size size)
11986
11987 Set the ratio item attribute.
11988 """
54f9ee45 11989 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
11990
11991 def SetRatio(*args, **kwargs):
248ed943
RD
11992 """
11993 SetRatio(self, float ratio)
11994
11995 Set the ratio item attribute.
11996 """
54f9ee45 11997 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
11998
11999 def GetRatio(*args, **kwargs):
248ed943
RD
12000 """
12001 GetRatio(self) -> float
12002
12003 Set the ratio item attribute.
12004 """
54f9ee45 12005 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 12006
d3b6e4ff
RD
12007 def GetRect(*args, **kwargs):
12008 """
12009 GetRect(self) -> Rect
12010
12011 Returns the rectangle that the sizer item should occupy
12012 """
12013 return _core_.SizerItem_GetRect(*args, **kwargs)
12014
e811c8ce 12015 def IsWindow(*args, **kwargs):
248ed943
RD
12016 """
12017 IsWindow(self) -> bool
12018
12019 Is this sizer item a window?
12020 """
54f9ee45 12021 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
12022
12023 def IsSizer(*args, **kwargs):
248ed943
RD
12024 """
12025 IsSizer(self) -> bool
12026
12027 Is this sizer item a subsizer?
12028 """
54f9ee45 12029 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
12030
12031 def IsSpacer(*args, **kwargs):
248ed943
RD
12032 """
12033 IsSpacer(self) -> bool
12034
12035 Is this sizer item a spacer?
12036 """
54f9ee45 12037 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
12038
12039 def SetProportion(*args, **kwargs):
248ed943
RD
12040 """
12041 SetProportion(self, int proportion)
12042
12043 Set the proportion value for this item.
12044 """
54f9ee45 12045 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
12046
12047 def GetProportion(*args, **kwargs):
248ed943
RD
12048 """
12049 GetProportion(self) -> int
12050
12051 Get the proportion value for this item.
12052 """
54f9ee45 12053 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 12054
248ed943
RD
12055 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
12056 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 12057 def SetFlag(*args, **kwargs):
248ed943
RD
12058 """
12059 SetFlag(self, int flag)
12060
12061 Set the flag value for this item.
12062 """
54f9ee45 12063 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
12064
12065 def GetFlag(*args, **kwargs):
248ed943
RD
12066 """
12067 GetFlag(self) -> int
12068
12069 Get the flag value for this item.
12070 """
54f9ee45 12071 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
12072
12073 def SetBorder(*args, **kwargs):
248ed943
RD
12074 """
12075 SetBorder(self, int border)
12076
12077 Set the border value for this item.
12078 """
54f9ee45 12079 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
12080
12081 def GetBorder(*args, **kwargs):
248ed943
RD
12082 """
12083 GetBorder(self) -> int
12084
12085 Get the border value for this item.
12086 """
54f9ee45 12087 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
12088
12089 def GetWindow(*args, **kwargs):
248ed943
RD
12090 """
12091 GetWindow(self) -> Window
12092
12093 Get the window (if any) that is managed by this sizer item.
12094 """
54f9ee45 12095 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce 12096
e811c8ce 12097 def GetSizer(*args, **kwargs):
248ed943
RD
12098 """
12099 GetSizer(self) -> Sizer
12100
12101 Get the subsizer (if any) that is managed by this sizer item.
12102 """
54f9ee45 12103 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce 12104
ddeca22c
RD
12105 def GetSpacer(*args, **kwargs):
12106 """
12107 GetSpacer(self) -> Size
12108
12109 Get the size of the spacer managed by this sizer item.
12110 """
12111 return _core_.SizerItem_GetSpacer(*args, **kwargs)
12112
12113 def SetWindow(*args, **kwargs):
12114 """
12115 SetWindow(self, Window window)
12116
12117 Set the window to be managed by this sizer item.
12118 """
12119 return _core_.SizerItem_SetWindow(*args, **kwargs)
12120
e811c8ce 12121 def SetSizer(*args, **kwargs):
248ed943
RD
12122 """
12123 SetSizer(self, Sizer sizer)
12124
12125 Set the subsizer to be managed by this sizer item.
12126 """
54f9ee45 12127 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce 12128
ddeca22c 12129 def SetSpacer(*args, **kwargs):
248ed943 12130 """
ddeca22c 12131 SetSpacer(self, Size size)
248ed943 12132
ddeca22c 12133 Set the size of the spacer to be managed by this sizer item.
248ed943 12134 """
ddeca22c 12135 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce 12136
ddeca22c
RD
12137 SetWindow = wx._deprecated(SetWindow, "Use `AssignWindow` instead.")
12138 SetSizer = wx._deprecated(SetSizer, "Use `AssignSizer` instead.")
12139 SetSpacer = wx._deprecated(SetSpacer, "Use `AssignSpacer` instead.")
12140
12141 def AssignWindow(*args, **kwargs):
248ed943 12142 """
ddeca22c
RD
12143 AssignWindow(self, Window window)
12144
12145 Set the window to be managed by this sizer item.
12146 """
12147 return _core_.SizerItem_AssignWindow(*args, **kwargs)
12148
12149 def AssignSizer(*args, **kwargs):
12150 """
12151 AssignSizer(self, Sizer sizer)
12152
12153 Set the subsizer to be managed by this sizer item.
12154 """
12155 return _core_.SizerItem_AssignSizer(*args, **kwargs)
12156
12157 def AssignSpacer(*args, **kwargs):
12158 """
12159 AssignSpacer(self, Size size)
248ed943
RD
12160
12161 Set the size of the spacer to be managed by this sizer item.
12162 """
ddeca22c 12163 return _core_.SizerItem_AssignSpacer(*args, **kwargs)
e811c8ce
RD
12164
12165 def Show(*args, **kwargs):
248ed943
RD
12166 """
12167 Show(self, bool show)
12168
12169 Set the show item attribute, which sizers use to determine if the item
12170 is to be made part of the layout or not. If the item is tracking a
12171 window then it is shown or hidden as needed.
12172 """
54f9ee45 12173 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
12174
12175 def IsShown(*args, **kwargs):
248ed943
RD
12176 """
12177 IsShown(self) -> bool
12178
12179 Is the item to be shown in the layout?
12180 """
54f9ee45 12181 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
12182
12183 def GetPosition(*args, **kwargs):
248ed943
RD
12184 """
12185 GetPosition(self) -> Point
12186
12187 Returns the current position of the item, as set in the last Layout.
12188 """
54f9ee45 12189 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
12190
12191 def GetUserData(*args, **kwargs):
248ed943
RD
12192 """
12193 GetUserData(self) -> PyObject
12194
12195 Returns the userData associated with this sizer item, or None if there
12196 isn't any.
12197 """
54f9ee45 12198 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 12199
091f5bed
RD
12200 def SetUserData(*args, **kwargs):
12201 """
12202 SetUserData(self, PyObject userData)
12203
12204 Associate a Python object with this sizer item.
12205 """
12206 return _core_.SizerItem_SetUserData(*args, **kwargs)
12207
33d6fd3b
RD
12208 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
12209 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
12210 MinSize = property(GetMinSize,doc="See `GetMinSize`")
12211 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
12212 Position = property(GetPosition,doc="See `GetPosition`")
12213 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
12214 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
12215 Rect = property(GetRect,doc="See `GetRect`")
12216 Size = property(GetSize,doc="See `GetSize`")
ddeca22c
RD
12217 Sizer = property(GetSizer,AssignSizer,doc="See `GetSizer` and `AssignSizer`")
12218 Spacer = property(GetSpacer,AssignSpacer,doc="See `GetSpacer` and `AssignSpacer`")
33d6fd3b 12219 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
ddeca22c 12220 Window = property(GetWindow,AssignWindow,doc="See `GetWindow` and `AssignWindow`")
2131d850 12221_core_.SizerItem_swigregister(SizerItem)
d14a1e28 12222
248ed943 12223def SizerItemWindow(*args, **kwargs):
0df68c9f 12224 """
248ed943
RD
12225 SizerItemWindow(Window window, int proportion, int flag, int border,
12226 PyObject userData=None) -> SizerItem
12227
12228 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 12229 """
248ed943 12230 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
12231 return val
12232
248ed943 12233def SizerItemSpacer(*args, **kwargs):
0df68c9f 12234 """
248ed943
RD
12235 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
12236 PyObject userData=None) -> SizerItem
12237
12238 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 12239 """
248ed943 12240 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
12241 return val
12242
12243def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
12244 """
12245 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
12246 PyObject userData=None) -> SizerItem
12247
12248 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 12249 """
54f9ee45 12250 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
12251 return val
12252
12253class Sizer(Object):
248ed943
RD
12254 """
12255 wx.Sizer is the abstract base class used for laying out subwindows in
12256 a window. You cannot use wx.Sizer directly; instead, you will have to
12257 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
12258 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
12259 `wx.GridBagSizer`.
248ed943
RD
12260
12261 The concept implemented by sizers in wxWidgets is closely related to
12262 layout tools in other GUI toolkits, such as Java's AWT, the GTK
12263 toolkit or the Qt toolkit. It is based upon the idea of the individual
12264 subwindows reporting their minimal required size and their ability to
12265 get stretched if the size of the parent window has changed. This will
12266 most often mean that the programmer does not set the original size of
12267 a dialog in the beginning, rather the dialog will assigned a sizer and
12268 this sizer will be queried about the recommended size. The sizer in
12269 turn will query its children, which can be normal windows or contorls,
12270 empty space or other sizers, so that a hierarchy of sizers can be
12271 constructed. Note that wxSizer does not derive from wxWindow and thus
12272 do not interfere with tab ordering and requires very little resources
12273 compared to a real window on screen.
12274
12275 What makes sizers so well fitted for use in wxWidgets is the fact that
12276 every control reports its own minimal size and the algorithm can
12277 handle differences in font sizes or different window (dialog item)
12278 sizes on different platforms without problems. If for example the
12279 standard font as well as the overall design of Mac widgets requires
12280 more space than on Windows, then the initial size of a dialog using a
12281 sizer will automatically be bigger on Mac than on Windows.
12282 """
0085ce49
RD
12283 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12284 def __init__(self): raise AttributeError, "No constructor defined"
12285 __repr__ = _swig_repr
12286 __swig_destroy__ = _core_.delete_Sizer
12287 __del__ = lambda self : None;
e811c8ce 12288 def _setOORInfo(*args, **kwargs):
a95a7133 12289 """_setOORInfo(self, PyObject _self)"""
54f9ee45 12290 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
12291
12292 def Add(*args, **kwargs):
0df68c9f 12293 """
248ed943 12294 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 12295 PyObject userData=None) -> wx.SizerItem
248ed943
RD
12296
12297 Appends a child item to the sizer.
0df68c9f 12298 """
54f9ee45 12299 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce 12300
cbfc9df6
RD
12301 def AddF(*args, **kwargs):
12302 """
12303 AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12304
12305 Similar to `Add` but uses the `wx.SizerFlags` convenience class for
12306 setting the various flags, options and borders.
12307 """
12308 return _core_.Sizer_AddF(*args, **kwargs)
12309
e811c8ce 12310 def Insert(*args, **kwargs):
0df68c9f 12311 """
248ed943 12312 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 12313 PyObject userData=None) -> wx.SizerItem
248ed943
RD
12314
12315 Inserts a new item into the list of items managed by this sizer before
12316 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 12317 """
54f9ee45 12318 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce 12319
cbfc9df6
RD
12320 def InsertF(*args, **kwargs):
12321 """
12322 InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
12323
12324 Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
12325 for setting the various flags, options and borders.
12326 """
12327 return _core_.Sizer_InsertF(*args, **kwargs)
12328
e811c8ce 12329 def Prepend(*args, **kwargs):
0df68c9f 12330 """
248ed943 12331 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 12332 PyObject userData=None) -> wx.SizerItem
248ed943
RD
12333
12334 Adds a new item to the begining of the list of sizer items managed by
12335 this sizer. See `Add` for a description of the parameters.
0df68c9f 12336 """
54f9ee45 12337 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce 12338
cbfc9df6
RD
12339 def PrependF(*args, **kwargs):
12340 """
12341 PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12342
12343 Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
12344 for setting the various flags, options and borders.
12345 """
12346 return _core_.Sizer_PrependF(*args, **kwargs)
12347
e811c8ce 12348 def Remove(*args, **kwargs):
248ed943
RD
12349 """
12350 Remove(self, item) -> bool
12351
12352 Removes an item from the sizer and destroys it. This method does not
12353 cause any layout or resizing to take place, call `Layout` to update
12354 the layout on screen after removing a child from the sizer. The
12355 *item* parameter can be either a window, a sizer, or the zero-based
12356 index of an item to remove. Returns True if the child item was found
12357 and removed.
12358 """
54f9ee45 12359 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 12360
1c0f361b 12361 def Detach(*args, **kwargs):
248ed943
RD
12362 """
12363 Detach(self, item) -> bool
12364
12365 Detaches an item from the sizer without destroying it. This method
12366 does not cause any layout or resizing to take place, call `Layout` to
12367 do so. The *item* parameter can be either a window, a sizer, or the
12368 zero-based index of the item to be detached. Returns True if the child item
12369 was found and detached.
12370 """
1c0f361b
RD
12371 return _core_.Sizer_Detach(*args, **kwargs)
12372
d3b6e4ff
RD
12373 def GetItem(*args, **kwargs):
12374 """
cbfc9df6 12375 GetItem(self, item, recursive=False) -> wx.SizerItem
d3b6e4ff
RD
12376
12377 Returns the `wx.SizerItem` which holds the *item* given. The *item*
12378 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 12379 the item to be found.
d3b6e4ff
RD
12380 """
12381 return _core_.Sizer_GetItem(*args, **kwargs)
12382
e811c8ce 12383 def _SetItemMinSize(*args, **kwargs):
a95a7133 12384 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 12385 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 12386
97ab0f6a
RD
12387 def _ReplaceWin(*args, **kwargs):
12388 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
12389 return _core_.Sizer__ReplaceWin(*args, **kwargs)
12390
12391 def _ReplaceSizer(*args, **kwargs):
12392 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
12393 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
12394
12395 def _ReplaceItem(*args, **kwargs):
12396 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
12397 return _core_.Sizer__ReplaceItem(*args, **kwargs)
12398
12399 def Replace(self, olditem, item, recursive=False):
12400 """
12401 Detaches the given ``olditem`` from the sizer and replaces it with
12402 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
12403 detached child is destroyed only if it is not a window, (because
12404 windows are owned by their parent, not the sizer.) The
12405 ``recursive`` parameter can be used to search for the given
12406 element recursivly in subsizers.
12407
12408 This method does not cause any layout or resizing to take place,
12409 call `Layout` to do so.
12410
12411 Returns ``True`` if the child item was found and removed.
12412 """
12413 if isinstance(olditem, wx.Window):
12414 return self._ReplaceWin(olditem, item, recursive)
cbfc9df6 12415 elif isinstance(olditem, wx.Sizer):
97ab0f6a 12416 return self._ReplaceSizer(olditem, item, recursive)
cbfc9df6 12417 elif isinstance(olditem, int):
97ab0f6a
RD
12418 return self._ReplaceItem(olditem, item)
12419 else:
12420 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
12421
12422 def SetContainingWindow(*args, **kwargs):
12423 """
12424 SetContainingWindow(self, Window window)
12425
12426 Set (or unset) the window this sizer is used in.
12427 """
12428 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
12429
12430 def GetContainingWindow(*args, **kwargs):
12431 """
12432 GetContainingWindow(self) -> Window
12433
12434 Get the window this sizer is used in.
12435 """
12436 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
12437
248ed943
RD
12438 def SetItemMinSize(self, item, *args):
12439 """
12440 SetItemMinSize(self, item, Size size)
12441
12442 Sets the minimum size that will be allocated for an item in the sizer.
12443 The *item* parameter can be either a window, a sizer, or the
12444 zero-based index of the item. If a window or sizer is given then it
12445 will be searched for recursivly in subsizers if neccessary.
12446 """
12447 if len(args) == 2:
12448 # for backward compatibility accept separate width,height args too
12449 return self._SetItemMinSize(item, args)
12450 else:
12451 return self._SetItemMinSize(item, args[0])
12452
e811c8ce 12453 def AddItem(*args, **kwargs):
248ed943
RD
12454 """
12455 AddItem(self, SizerItem item)
12456
12457 Adds a `wx.SizerItem` to the sizer.
12458 """
54f9ee45 12459 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
12460
12461 def InsertItem(*args, **kwargs):
248ed943
RD
12462 """
12463 InsertItem(self, int index, SizerItem item)
12464
12465 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
12466 """
54f9ee45 12467 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
12468
12469 def PrependItem(*args, **kwargs):
248ed943
RD
12470 """
12471 PrependItem(self, SizerItem item)
12472
12473 Prepends a `wx.SizerItem` to the sizer.
12474 """
54f9ee45 12475 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 12476
248ed943 12477 def AddMany(self, items):
66c033b4
RD
12478 """
12479 AddMany is a convenience method for adding several items
12480 to a sizer at one time. Simply pass it a list of tuples,
12481 where each tuple consists of the parameters that you
12482 would normally pass to the `Add` method.
12483 """
248ed943
RD
12484 for item in items:
12485 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
12486 item = (item, )
12487 self.Add(*item)
d14a1e28 12488
ae5bc7f3
RD
12489 def AddSpacer(self, *args, **kw):
12490 """AddSpacer(int size) --> SizerItem
12491
12492 Add a spacer that is (size,size) pixels.
12493 """
12494 if args and type(args[0]) == int:
12495 return self.Add( (args[0],args[0] ), 0)
12496 else: # otherwise stay compatible with old AddSpacer
12497 return self.Add(*args, **kw)
12498 def PrependSpacer(self, *args, **kw):
12499 """PrependSpacer(int size) --> SizerItem
12500
12501 Prepend a spacer that is (size, size) pixels."""
12502 if args and type(args[0]) == int:
12503 return self.Prepend( (args[0],args[0] ), 0)
12504 else: # otherwise stay compatible with old PrependSpacer
12505 return self.Prepend(*args, **kw)
12506 def InsertSpacer(self, index, *args, **kw):
12507 """InsertSpacer(int index, int size) --> SizerItem
12508
12509 Insert a spacer at position index that is (size, size) pixels."""
12510 if args and type(args[0]) == int:
12511 return self.Insert( index, (args[0],args[0] ), 0)
12512 else: # otherwise stay compatible with old InsertSpacer
12513 return self.Insert(index, *args, **kw)
12514
12515
12516 def AddStretchSpacer(self, prop=1):
12517 """AddStretchSpacer(int prop=1) --> SizerItem
12518
12519 Add a stretchable spacer."""
12520 return self.Add((0,0), prop)
12521 def PrependStretchSpacer(self, prop=1):
12522 """PrependStretchSpacer(int prop=1) --> SizerItem
12523
12524 Prepend a stretchable spacer."""
12525 return self.Prepend((0,0), prop)
12526 def InsertStretchSpacer(self, index, prop=1):
12527 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
12528
12529 Insert a stretchable spacer."""
12530 return self.Insert(index, (0,0), prop)
12531
12532
74e96f3d 12533 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
12534 def AddWindow(self, *args, **kw):
12535 """Compatibility alias for `Add`."""
12536 return self.Add(*args, **kw)
12537 def AddSizer(self, *args, **kw):
12538 """Compatibility alias for `Add`."""
12539 return self.Add(*args, **kw)
b9d6a5f3
RD
12540
12541 def PrependWindow(self, *args, **kw):
12542 """Compatibility alias for `Prepend`."""
12543 return self.Prepend(*args, **kw)
12544 def PrependSizer(self, *args, **kw):
12545 """Compatibility alias for `Prepend`."""
12546 return self.Prepend(*args, **kw)
b9d6a5f3
RD
12547
12548 def InsertWindow(self, *args, **kw):
12549 """Compatibility alias for `Insert`."""
12550 return self.Insert(*args, **kw)
12551 def InsertSizer(self, *args, **kw):
12552 """Compatibility alias for `Insert`."""
b9d6a5f3
RD
12553 return self.Insert(*args, **kw)
12554
12555 def RemoveWindow(self, *args, **kw):
12556 """Compatibility alias for `Remove`."""
12557 return self.Remove(*args, **kw)
12558 def RemoveSizer(self, *args, **kw):
12559 """Compatibility alias for `Remove`."""
12560 return self.Remove(*args, **kw)
12561 def RemovePos(self, *args, **kw):
12562 """Compatibility alias for `Remove`."""
12563 return self.Remove(*args, **kw)
d14a1e28
RD
12564
12565
e811c8ce 12566 def SetDimension(*args, **kwargs):
248ed943
RD
12567 """
12568 SetDimension(self, int x, int y, int width, int height)
12569
12570 Call this to force the sizer to take the given dimension and thus
12571 force the items owned by the sizer to resize themselves according to
12572 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
12573 methods.
12574 """
54f9ee45 12575 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
12576
12577 def SetMinSize(*args, **kwargs):
248ed943
RD
12578 """
12579 SetMinSize(self, Size size)
12580
12581 Call this to give the sizer a minimal size. Normally, the sizer will
12582 calculate its minimal size based purely on how much space its children
12583 need. After calling this method `GetMinSize` will return either the
12584 minimal size as requested by its children or the minimal size set
12585 here, depending on which is bigger.
12586 """
54f9ee45 12587 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
12588
12589 def GetSize(*args, **kwargs):
248ed943
RD
12590 """
12591 GetSize(self) -> Size
12592
12593 Returns the current size of the space managed by the sizer.
12594 """
54f9ee45 12595 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
12596
12597 def GetPosition(*args, **kwargs):
248ed943
RD
12598 """
12599 GetPosition(self) -> Point
12600
12601 Returns the current position of the sizer's managed space.
12602 """
54f9ee45 12603 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
12604
12605 def GetMinSize(*args, **kwargs):
248ed943
RD
12606 """
12607 GetMinSize(self) -> Size
12608
12609 Returns the minimal size of the sizer. This is either the combined
12610 minimal size of all the children and their borders or the minimal size
12611 set by SetMinSize, depending on which is bigger.
12612 """
54f9ee45 12613 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 12614
d14a1e28 12615 def GetSizeTuple(self):
1c0f361b 12616 return self.GetSize().Get()
d14a1e28 12617 def GetPositionTuple(self):
1c0f361b 12618 return self.GetPosition().Get()
d14a1e28 12619 def GetMinSizeTuple(self):
1c0f361b 12620 return self.GetMinSize().Get()
d14a1e28 12621
e811c8ce 12622 def RecalcSizes(*args, **kwargs):
248ed943
RD
12623 """
12624 RecalcSizes(self)
12625
12626 Using the sizes calculated by `CalcMin` reposition and resize all the
12627 items managed by this sizer. You should not need to call this directly as
12628 it is called by `Layout`.
12629 """
54f9ee45 12630 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
12631
12632 def CalcMin(*args, **kwargs):
248ed943
RD
12633 """
12634 CalcMin(self) -> Size
12635
12636 This method is where the sizer will do the actual calculation of its
12637 children's minimal sizes. You should not need to call this directly as
12638 it is called by `Layout`.
12639 """
54f9ee45 12640 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
12641
12642 def Layout(*args, **kwargs):
248ed943
RD
12643 """
12644 Layout(self)
12645
12646 This method will force the recalculation and layout of the items
12647 controlled by the sizer using the current space allocated to the
12648 sizer. Normally this is called automatically from the owning window's
12649 EVT_SIZE handler, but it is also useful to call it from user code when
12650 one of the items in a sizer change size, or items are added or
12651 removed.
12652 """
54f9ee45 12653 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
12654
12655 def Fit(*args, **kwargs):
248ed943
RD
12656 """
12657 Fit(self, Window window) -> Size
12658
12659 Tell the sizer to resize the *window* to match the sizer's minimal
12660 size. This is commonly done in the constructor of the window itself in
12661 order to set its initial size to match the needs of the children as
12662 determined by the sizer. Returns the new size.
12663
12664 For a top level window this is the total window size, not the client size.
12665 """
54f9ee45 12666 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
12667
12668 def FitInside(*args, **kwargs):
248ed943
RD
12669 """
12670 FitInside(self, Window window)
12671
12672 Tell the sizer to resize the *virtual size* of the *window* to match the
12673 sizer's minimal size. This will not alter the on screen size of the
12674 window, but may cause the addition/removal/alteration of scrollbars
12675 required to view the virtual area in windows which manage it.
12676
12677 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12678
12679 """
54f9ee45 12680 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
12681
12682 def SetSizeHints(*args, **kwargs):
248ed943
RD
12683 """
12684 SetSizeHints(self, Window window)
12685
12686 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12687 match the sizer's minimal size. This is commonly done in the
12688 constructor of the window itself if the window is resizable (as are
12689 many dialogs under Unix and frames on probably all platforms) in order
12690 to prevent the window from being sized smaller than the minimal size
12691 required by the sizer.
12692 """
54f9ee45 12693 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
12694
12695 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
12696 """
12697 SetVirtualSizeHints(self, Window window)
12698
12699 Tell the sizer to set the minimal size of the window virtual area to
12700 match the sizer's minimal size. For windows with managed scrollbars
12701 this will set them appropriately.
12702
12703 :see: `wx.ScrolledWindow.SetScrollbars`
12704
12705 """
54f9ee45 12706 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
12707
12708 def Clear(*args, **kwargs):
248ed943
RD
12709 """
12710 Clear(self, bool deleteWindows=False)
12711
12712 Clear all items from the sizer, optionally destroying the window items
12713 as well.
12714 """
54f9ee45 12715 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
12716
12717 def DeleteWindows(*args, **kwargs):
248ed943
RD
12718 """
12719 DeleteWindows(self)
12720
12721 Destroy all windows managed by the sizer.
12722 """
54f9ee45 12723 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
12724
12725 def GetChildren(*args, **kwargs):
248ed943 12726 """
51b83b37 12727 GetChildren(self) -> list
248ed943
RD
12728
12729 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12730 """
54f9ee45 12731 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
12732
12733 def Show(*args, **kwargs):
248ed943 12734 """
ae8162c8 12735 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 12736
248ed943
RD
12737 Shows or hides an item managed by the sizer. To make a sizer item
12738 disappear or reappear, use Show followed by `Layout`. The *item*
12739 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
12740 the item. Use the recursive parameter to show or hide an item in a
12741 subsizer. Returns True if the item was found.
248ed943
RD
12742 """
12743 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
12744
12745 def IsShown(*args, **kwargs):
248ed943
RD
12746 """
12747 IsShown(self, item)
12748
b1fcee84 12749 Determines if the item is currently shown. To make a sizer
248ed943
RD
12750 item disappear or reappear, use Show followed by `Layout`. The *item*
12751 parameter can be either a window, a sizer, or the zero-based index of
12752 the item.
12753 """
54f9ee45 12754 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 12755
7e63a440 12756 def Hide(self, item, recursive=False):
248ed943 12757 """
27fb7603 12758 A convenience method for `Show` (item, False, recursive).
248ed943 12759 """
06759a38 12760 return self.Show(item, False, recursive)
248ed943 12761
e811c8ce 12762 def ShowItems(*args, **kwargs):
248ed943
RD
12763 """
12764 ShowItems(self, bool show)
12765
84f85550 12766 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 12767 """
54f9ee45 12768 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 12769
33d6fd3b
RD
12770 Children = property(GetChildren,doc="See `GetChildren`")
12771 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12772 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12773 Position = property(GetPosition,doc="See `GetPosition`")
12774 Size = property(GetSize,doc="See `GetSize`")
2131d850 12775_core_.Sizer_swigregister(Sizer)
d14a1e28
RD
12776
12777class PySizer(Sizer):
248ed943
RD
12778 """
12779 wx.PySizer is a special version of `wx.Sizer` that has been
12780 instrumented to allow the C++ virtual methods to be overloaded in
12781 Python derived classes. You would derive from this class if you are
12782 wanting to implement a custom sizer in Python code. Simply implement
12783 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12784 For example::
12785
12786 class MySizer(wx.PySizer):
12787 def __init__(self):
12788 wx.PySizer.__init__(self)
12789
12790 def CalcMin(self):
12791 for item in self.GetChildren():
12792 # calculate the total minimum width and height needed
12793 # by all items in the sizer according to this sizer's
12794 # layout algorithm.
12795 ...
12796 return wx.Size(width, height)
12797
12798 def RecalcSizes(self):
12799 # find the space allotted to this sizer
12800 pos = self.GetPosition()
12801 size = self.GetSize()
12802 for item in self.GetChildren():
12803 # Recalculate (if necessary) the position and size of
12804 # each item and then call item.SetDimension to do the
12805 # actual positioning and sizing of the items within the
12806 # space alloted to this sizer.
12807 ...
12808 item.SetDimension(itemPos, itemSize)
12809
12810
12811 When `Layout` is called it first calls `CalcMin` followed by
12812 `RecalcSizes` so you can optimize a bit by saving the results of
e505d15e 12813 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
12814
12815 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12816
12817
12818 """
0085ce49
RD
12819 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12820 __repr__ = _swig_repr
12821 def __init__(self, *args, **kwargs):
248ed943
RD
12822 """
12823 __init__(self) -> PySizer
12824
12825 Creates a wx.PySizer. Must be called from the __init__ in the derived
12826 class.
12827 """
0085ce49 12828 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
c25f90f6 12829 self._setOORInfo(self);PySizer._setCallbackInfo(self, self, PySizer)
e811c8ce
RD
12830
12831 def _setCallbackInfo(*args, **kwargs):
a95a7133 12832 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 12833 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 12834
2131d850 12835_core_.PySizer_swigregister(PySizer)
d14a1e28
RD
12836
12837#---------------------------------------------------------------------------
12838
12839class BoxSizer(Sizer):
248ed943
RD
12840 """
12841 The basic idea behind a box sizer is that windows will most often be
12842 laid out in rather simple basic geometry, typically in a row or a
12843 column or nested hierarchies of either. A wx.BoxSizer will lay out
12844 its items in a simple row or column, depending on the orientation
12845 parameter passed to the constructor.
12846 """
0085ce49
RD
12847 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12848 __repr__ = _swig_repr
12849 def __init__(self, *args, **kwargs):
248ed943
RD
12850 """
12851 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12852
12853 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12854 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12855 sizer.
12856 """
0085ce49 12857 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d14a1e28 12858 self._setOORInfo(self)
e811c8ce
RD
12859
12860 def GetOrientation(*args, **kwargs):
248ed943
RD
12861 """
12862 GetOrientation(self) -> int
12863
12864 Returns the current orientation of the sizer.
12865 """
54f9ee45 12866 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
12867
12868 def SetOrientation(*args, **kwargs):
248ed943
RD
12869 """
12870 SetOrientation(self, int orient)
e811c8ce 12871
248ed943
RD
12872 Resets the orientation of the sizer.
12873 """
12874 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 12875
2bf58437 12876 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
2131d850 12877_core_.BoxSizer_swigregister(BoxSizer)
d14a1e28
RD
12878
12879#---------------------------------------------------------------------------
12880
12881class StaticBoxSizer(BoxSizer):
248ed943
RD
12882 """
12883 wx.StaticBoxSizer derives from and functions identically to the
12884 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12885 manages. Note that this static box must be created separately and
12886 passed to the sizer constructor.
12887 """
0085ce49
RD
12888 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12889 __repr__ = _swig_repr
12890 def __init__(self, *args, **kwargs):
248ed943
RD
12891 """
12892 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12893
12894 Constructor. It takes an associated static box and the orientation
12895 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12896 ``wx.HORIZONTAL``.
12897 """
0085ce49 12898 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d14a1e28 12899 self._setOORInfo(self)
e811c8ce
RD
12900
12901 def GetStaticBox(*args, **kwargs):
248ed943
RD
12902 """
12903 GetStaticBox(self) -> StaticBox
e811c8ce 12904
248ed943
RD
12905 Returns the static box associated with this sizer.
12906 """
12907 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 12908
33d6fd3b 12909 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
2131d850 12910_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d14a1e28
RD
12911
12912#---------------------------------------------------------------------------
12913
12914class GridSizer(Sizer):
248ed943
RD
12915 """
12916 A grid sizer is a sizer which lays out its children in a
12917 two-dimensional table with all cells having the same size. In other
12918 words, the width of each cell within the grid is the width of the
12919 widest item added to the sizer and the height of each grid cell is the
12920 height of the tallest item. An optional vertical and/or horizontal
12921 gap between items can also be specified (in pixels.)
12922
12923 Items are placed in the cells of the grid in the order they are added,
12924 in row-major order. In other words, the first row is filled first,
12925 then the second, and so on until all items have been added. (If
12926 neccessary, additional rows will be added as items are added.) If you
12927 need to have greater control over the cells that items are placed in
12928 then use the `wx.GridBagSizer`.
12929
12930 """
0085ce49
RD
12931 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12932 __repr__ = _swig_repr
12933 def __init__(self, *args, **kwargs):
248ed943
RD
12934 """
12935 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12936
12937 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12938 of columns and rows in the sizer - if either of the parameters is
12939 zero, it will be calculated to from the total number of children in
12940 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12941 define extra space between all children.
12942 """
0085ce49 12943 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d14a1e28 12944 self._setOORInfo(self)
e811c8ce 12945
e811c8ce 12946 def SetCols(*args, **kwargs):
248ed943
RD
12947 """
12948 SetCols(self, int cols)
12949
12950 Sets the number of columns in the sizer.
12951 """
54f9ee45 12952 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
12953
12954 def SetRows(*args, **kwargs):
248ed943
RD
12955 """
12956 SetRows(self, int rows)
12957
12958 Sets the number of rows in the sizer.
12959 """
54f9ee45 12960 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
12961
12962 def SetVGap(*args, **kwargs):
248ed943
RD
12963 """
12964 SetVGap(self, int gap)
12965
12966 Sets the vertical gap (in pixels) between the cells in the sizer.
12967 """
54f9ee45 12968 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
12969
12970 def SetHGap(*args, **kwargs):
248ed943
RD
12971 """
12972 SetHGap(self, int gap)
12973
12974 Sets the horizontal gap (in pixels) between cells in the sizer
12975 """
54f9ee45 12976 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
12977
12978 def GetCols(*args, **kwargs):
248ed943
RD
12979 """
12980 GetCols(self) -> int
12981
12982 Returns the number of columns in the sizer.
12983 """
54f9ee45 12984 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
12985
12986 def GetRows(*args, **kwargs):
248ed943
RD
12987 """
12988 GetRows(self) -> int
12989
12990 Returns the number of rows in the sizer.
12991 """
54f9ee45 12992 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
12993
12994 def GetVGap(*args, **kwargs):
248ed943
RD
12995 """
12996 GetVGap(self) -> int
12997
12998 Returns the vertical gap (in pixels) between the cells in the sizer.
12999 """
54f9ee45 13000 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
13001
13002 def GetHGap(*args, **kwargs):
248ed943
RD
13003 """
13004 GetHGap(self) -> int
13005
13006 Returns the horizontal gap (in pixels) between cells in the sizer.
13007 """
54f9ee45 13008 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 13009
0085ce49
RD
13010 def CalcRowsCols(self):
13011 """
13012 CalcRowsCols() -> (rows, cols)
13013
13014 Calculates how many rows and columns will be in the sizer based
13015 on the current number of items and also the rows, cols specified
13016 in the constructor.
13017 """
13018 nitems = len(self.GetChildren())
13019 rows = self.GetRows()
13020 cols = self.GetCols()
13021 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
13022 if cols != 0:
13023 rows = (nitems + cols - 1) / cols
13024 elif rows != 0:
13025 cols = (nitems + rows - 1) / rows
13026 return (rows, cols)
d14a1e28 13027
97ab0f6a
RD
13028 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
13029 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
13030 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
13031 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
2131d850 13032_core_.GridSizer_swigregister(GridSizer)
d14a1e28
RD
13033
13034#---------------------------------------------------------------------------
13035
54f9ee45
RD
13036FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
13037FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
13038FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 13039class FlexGridSizer(GridSizer):
248ed943
RD
13040 """
13041 A flex grid sizer is a sizer which lays out its children in a
13042 two-dimensional table with all table cells in one row having the same
13043 height and all cells in one column having the same width, but all
13044 rows or all columns are not necessarily the same height or width as in
13045 the `wx.GridSizer`.
13046
13047 wx.FlexGridSizer can also size items equally in one direction but
13048 unequally ("flexibly") in the other. If the sizer is only flexible
13049 in one direction (this can be changed using `SetFlexibleDirection`), it
13050 needs to be decided how the sizer should grow in the other ("non
13051 flexible") direction in order to fill the available space. The
13052 `SetNonFlexibleGrowMode` method serves this purpose.
13053
13054
13055 """
0085ce49
RD
13056 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13057 __repr__ = _swig_repr
13058 def __init__(self, *args, **kwargs):
248ed943
RD
13059 """
13060 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
13061
13062 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
13063 number of columns and rows in the sizer - if either of the parameters
13064 is zero, it will be calculated to from the total number of children in
13065 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13066 define extra space between all children.
13067 """
0085ce49 13068 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d14a1e28 13069 self._setOORInfo(self)
e811c8ce 13070
248ed943
RD
13071 def AddGrowableRow(*args, **kwargs):
13072 """
13073 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 13074
248ed943
RD
13075 Specifies that row *idx* (starting from zero) should be grown if there
13076 is extra space available to the sizer.
e811c8ce 13077
248ed943
RD
13078 The *proportion* parameter has the same meaning as the stretch factor
13079 for the box sizers except that if all proportions are 0, then all
13080 columns are resized equally (instead of not being resized at all).
13081 """
54f9ee45 13082 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
13083
13084 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
13085 """
13086 RemoveGrowableRow(self, size_t idx)
13087
13088 Specifies that row *idx* is no longer growable.
13089 """
54f9ee45 13090 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
13091
13092 def AddGrowableCol(*args, **kwargs):
248ed943
RD
13093 """
13094 AddGrowableCol(self, size_t idx, int proportion=0)
13095
13096 Specifies that column *idx* (starting from zero) should be grown if
13097 there is extra space available to the sizer.
13098
13099 The *proportion* parameter has the same meaning as the stretch factor
13100 for the box sizers except that if all proportions are 0, then all
13101 columns are resized equally (instead of not being resized at all).
13102 """
54f9ee45 13103 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
13104
13105 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
13106 """
13107 RemoveGrowableCol(self, size_t idx)
13108
13109 Specifies that column *idx* is no longer growable.
13110 """
54f9ee45 13111 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
13112
13113 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
13114 """
13115 SetFlexibleDirection(self, int direction)
13116
13117 Specifies whether the sizer should flexibly resize its columns, rows,
13118 or both. Argument *direction* can be one of the following values. Any
13119 other value is ignored.
13120
13121 ============== =======================================
13122 wx.VERTICAL Rows are flexibly sized.
13123 wx.HORIZONTAL Columns are flexibly sized.
13124 wx.BOTH Both rows and columns are flexibly sized
13125 (this is the default value).
13126 ============== =======================================
13127
13128 Note that this method does not trigger relayout.
13129
13130 """
54f9ee45 13131 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
13132
13133 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
13134 """
13135 GetFlexibleDirection(self) -> int
13136
13137 Returns a value that specifies whether the sizer
13138 flexibly resizes its columns, rows, or both (default).
13139
13140 :see: `SetFlexibleDirection`
13141 """
54f9ee45 13142 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
13143
13144 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
13145 """
13146 SetNonFlexibleGrowMode(self, int mode)
13147
13148 Specifies how the sizer should grow in the non-flexible direction if
13149 there is one (so `SetFlexibleDirection` must have been called
13150 previously). Argument *mode* can be one of the following values:
13151
13152 ========================== =================================================
13153 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
13154 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
13155 `AddGrowableCol` and `AddGrowableRow`. In this
13156 case equal sizing applies to minimum sizes of
13157 columns or rows (this is the default value).
13158 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
13159 the non flexible direction, whether they are
13160 growable or not in the flexbile direction.
13161 ========================== =================================================
13162
13163 Note that this method does not trigger relayout.
248ed943 13164 """
54f9ee45 13165 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
13166
13167 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
13168 """
13169 GetNonFlexibleGrowMode(self) -> int
13170
13171 Returns the value that specifies how the sizer grows in the
13172 non-flexible direction if there is one.
13173
13174 :see: `SetNonFlexibleGrowMode`
13175 """
54f9ee45 13176 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
13177
13178 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
13179 """
13180 GetRowHeights(self) -> list
13181
13182 Returns a list of integers representing the heights of each of the
13183 rows in the sizer.
13184 """
54f9ee45 13185 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
13186
13187 def GetColWidths(*args, **kwargs):
fd2dc343
RD
13188 """
13189 GetColWidths(self) -> list
13190
13191 Returns a list of integers representing the widths of each of the
13192 columns in the sizer.
13193 """
54f9ee45 13194 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 13195
97ab0f6a
RD
13196 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
13197 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
13198 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
13199 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
2131d850 13200_core_.FlexGridSizer_swigregister(FlexGridSizer)
d14a1e28 13201
e505d15e
RD
13202class StdDialogButtonSizer(BoxSizer):
13203 """
13204 A special sizer that knows how to order and position standard buttons
13205 in order to conform to the current platform's standards. You simply
13206 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 13207 buttons using the standard ID's. Then call `Realize` and the sizer
e505d15e
RD
13208 will take care of the rest.
13209
13210 """
0085ce49
RD
13211 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13212 __repr__ = _swig_repr
13213 def __init__(self, *args, **kwargs):
e505d15e 13214 """__init__(self) -> StdDialogButtonSizer"""
0085ce49 13215 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
e505d15e
RD
13216 def AddButton(*args, **kwargs):
13217 """
13218 AddButton(self, wxButton button)
13219
13220 Use this to add the buttons to this sizer. Do not use the `Add`
13221 method in the base class.
13222 """
13223 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
13224
53aa7709 13225 def Realize(*args, **kwargs):
e505d15e 13226 """
53aa7709 13227 Realize(self)
e505d15e
RD
13228
13229 This funciton needs to be called after all the buttons have been added
13230 to the sizer. It will reorder them and position them in a platform
13231 specifc manner.
13232 """
53aa7709 13233 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
13234
13235 def SetAffirmativeButton(*args, **kwargs):
13236 """SetAffirmativeButton(self, wxButton button)"""
13237 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
13238
13239 def SetNegativeButton(*args, **kwargs):
13240 """SetNegativeButton(self, wxButton button)"""
13241 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
13242
13243 def SetCancelButton(*args, **kwargs):
13244 """SetCancelButton(self, wxButton button)"""
13245 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
e505d15e
RD
13246
13247 def GetAffirmativeButton(*args, **kwargs):
13248 """GetAffirmativeButton(self) -> wxButton"""
13249 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
13250
13251 def GetApplyButton(*args, **kwargs):
13252 """GetApplyButton(self) -> wxButton"""
13253 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
13254
13255 def GetNegativeButton(*args, **kwargs):
13256 """GetNegativeButton(self) -> wxButton"""
13257 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
13258
13259 def GetCancelButton(*args, **kwargs):
13260 """GetCancelButton(self) -> wxButton"""
13261 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
13262
13263 def GetHelpButton(*args, **kwargs):
13264 """GetHelpButton(self) -> wxButton"""
13265 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
13266
33d6fd3b
RD
13267 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
13268 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
13269 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
13270 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
13271 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
2131d850 13272_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
e505d15e 13273
d14a1e28
RD
13274#---------------------------------------------------------------------------
13275
13276class GBPosition(object):
248ed943
RD
13277 """
13278 This class represents the position of an item in a virtual grid of
13279 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13280 typemaps that will automatically convert from a 2-element sequence of
13281 integers to a wx.GBPosition, so you can use the more pythonic
13282 representation of the position nearly transparently in Python code.
13283 """
0085ce49
RD
13284 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13285 __repr__ = _swig_repr
13286 def __init__(self, *args, **kwargs):
248ed943
RD
13287 """
13288 __init__(self, int row=0, int col=0) -> GBPosition
13289
13290 This class represents the position of an item in a virtual grid of
13291 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13292 typemaps that will automatically convert from a 2-element sequence of
13293 integers to a wx.GBPosition, so you can use the more pythonic
13294 representation of the position nearly transparently in Python code.
13295 """
0085ce49
RD
13296 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
13297 __swig_destroy__ = _core_.delete_GBPosition
13298 __del__ = lambda self : None;
e811c8ce 13299 def GetRow(*args, **kwargs):
a95a7133 13300 """GetRow(self) -> int"""
54f9ee45 13301 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
13302
13303 def GetCol(*args, **kwargs):
a95a7133 13304 """GetCol(self) -> int"""
54f9ee45 13305 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
13306
13307 def SetRow(*args, **kwargs):
a95a7133 13308 """SetRow(self, int row)"""
54f9ee45 13309 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
13310
13311 def SetCol(*args, **kwargs):
a95a7133 13312 """SetCol(self, int col)"""
54f9ee45 13313 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
13314
13315 def __eq__(*args, **kwargs):
e9d6f3a4
RD
13316 """
13317 __eq__(self, PyObject other) -> bool
13318
13319 Compare GBPosition for equality.
13320 """
54f9ee45 13321 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
13322
13323 def __ne__(*args, **kwargs):
e9d6f3a4
RD
13324 """
13325 __ne__(self, PyObject other) -> bool
13326
13327 Compare GBPosition for inequality.
13328 """
54f9ee45 13329 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
13330
13331 def Set(*args, **kwargs):
a95a7133 13332 """Set(self, int row=0, int col=0)"""
54f9ee45 13333 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
13334
13335 def Get(*args, **kwargs):
a95a7133 13336 """Get(self) -> PyObject"""
54f9ee45 13337 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 13338
41e2b43e 13339 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
13340 def __str__(self): return str(self.Get())
13341 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
13342 def __len__(self): return len(self.Get())
13343 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
13344 def __setitem__(self, index, val):
13345 if index == 0: self.SetRow(val)
13346 elif index == 1: self.SetCol(val)
13347 else: raise IndexError
e811c8ce 13348 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
13349 __safe_for_unpickling__ = True
13350 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
13351
13352 row = property(GetRow, SetRow)
13353 col = property(GetCol, SetCol)
13354
2131d850 13355_core_.GBPosition_swigregister(GBPosition)
d14a1e28
RD
13356
13357class GBSpan(object):
248ed943
RD
13358 """
13359 This class is used to hold the row and column spanning attributes of
13360 items in a `wx.GridBagSizer`. wxPython has typemaps that will
13361 automatically convert from a 2-element sequence of integers to a
13362 wx.GBSpan, so you can use the more pythonic representation of the span
13363 nearly transparently in Python code.
13364
13365 """
0085ce49
RD
13366 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13367 __repr__ = _swig_repr
13368 def __init__(self, *args, **kwargs):
248ed943
RD
13369 """
13370 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
13371
13372 Construct a new wxGBSpan, optionally setting the rowspan and
13373 colspan. The default is (1,1). (Meaning that the item occupies one
13374 cell in each direction.
13375 """
0085ce49
RD
13376 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
13377 __swig_destroy__ = _core_.delete_GBSpan
13378 __del__ = lambda self : None;
e811c8ce 13379 def GetRowspan(*args, **kwargs):
a95a7133 13380 """GetRowspan(self) -> int"""
54f9ee45 13381 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
13382
13383 def GetColspan(*args, **kwargs):
a95a7133 13384 """GetColspan(self) -> int"""
54f9ee45 13385 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
13386
13387 def SetRowspan(*args, **kwargs):
a95a7133 13388 """SetRowspan(self, int rowspan)"""
54f9ee45 13389 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
13390
13391 def SetColspan(*args, **kwargs):
a95a7133 13392 """SetColspan(self, int colspan)"""
54f9ee45 13393 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
13394
13395 def __eq__(*args, **kwargs):
e9d6f3a4
RD
13396 """
13397 __eq__(self, PyObject other) -> bool
13398
13399 Compare wxGBSpan for equality.
13400 """
54f9ee45 13401 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
13402
13403 def __ne__(*args, **kwargs):
e9d6f3a4
RD
13404 """
13405 __ne__(self, PyObject other) -> bool
13406
13407 Compare GBSpan for inequality.
13408 """
54f9ee45 13409 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
13410
13411 def Set(*args, **kwargs):
a95a7133 13412 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 13413 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
13414
13415 def Get(*args, **kwargs):
a95a7133 13416 """Get(self) -> PyObject"""
54f9ee45 13417 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 13418
41e2b43e 13419 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
13420 def __str__(self): return str(self.Get())
13421 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
13422 def __len__(self): return len(self.Get())
13423 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
13424 def __setitem__(self, index, val):
13425 if index == 0: self.SetRowspan(val)
13426 elif index == 1: self.SetColspan(val)
13427 else: raise IndexError
e811c8ce 13428 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
13429 __safe_for_unpickling__ = True
13430 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
13431
13432 rowspan = property(GetRowspan, SetRowspan)
13433 colspan = property(GetColspan, SetColspan)
13434
2131d850 13435_core_.GBSpan_swigregister(GBSpan)
d14a1e28
RD
13436
13437class GBSizerItem(SizerItem):
248ed943
RD
13438 """
13439 The wx.GBSizerItem class is used to track the additional data about
13440 items in a `wx.GridBagSizer` such as the item's position in the grid
13441 and how many rows or columns it spans.
13442
13443 """
0085ce49
RD
13444 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13445 __repr__ = _swig_repr
13446 def __init__(self, *args, **kwargs):
248ed943
RD
13447 """
13448 __init__(self) -> GBSizerItem
13449
13450 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
13451 size will need to be set, as well as a position and span before this
13452 item can be used in a Sizer.
13453
13454 You will probably never need to create a wx.GBSizerItem directly as they
13455 are created automatically when the sizer's Add method is called.
13456 """
0085ce49
RD
13457 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
13458 __swig_destroy__ = _core_.delete_GBSizerItem
13459 __del__ = lambda self : None;
e811c8ce 13460 def GetPos(*args, **kwargs):
248ed943
RD
13461 """
13462 GetPos(self) -> GBPosition
13463
13464 Get the grid position of the item
13465 """
54f9ee45 13466 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
13467
13468 def GetPosTuple(self): return self.GetPos().Get()
13469 def GetSpan(*args, **kwargs):
248ed943
RD
13470 """
13471 GetSpan(self) -> GBSpan
13472
13473 Get the row and column spanning of the item
13474 """
54f9ee45 13475 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
13476
13477 def GetSpanTuple(self): return self.GetSpan().Get()
13478 def SetPos(*args, **kwargs):
248ed943
RD
13479 """
13480 SetPos(self, GBPosition pos) -> bool
13481
13482 If the item is already a member of a sizer then first ensure that
13483 there is no other item that would intersect with this one at the new
13484 position, then set the new position. Returns True if the change is
13485 successful and after the next Layout() the item will be moved.
13486 """
54f9ee45 13487 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
13488
13489 def SetSpan(*args, **kwargs):
248ed943
RD
13490 """
13491 SetSpan(self, GBSpan span) -> bool
13492
13493 If the item is already a member of a sizer then first ensure that
13494 there is no other item that would intersect with this one with its new
13495 spanning size, then set the new spanning. Returns True if the change
13496 is successful and after the next Layout() the item will be resized.
13497
13498 """
54f9ee45 13499 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 13500
248ed943 13501 def Intersects(*args, **kwargs):
0df68c9f 13502 """
a95a7133 13503 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
13504
13505 Returns True if this item and the other item instersect.
0df68c9f 13506 """
248ed943
RD
13507 return _core_.GBSizerItem_Intersects(*args, **kwargs)
13508
13509 def IntersectsPos(*args, **kwargs):
13510 """
13511 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
13512
13513 Returns True if the given pos/span would intersect with this item.
13514 """
13515 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
13516
13517 def GetEndPos(*args, **kwargs):
248ed943
RD
13518 """
13519 GetEndPos(self) -> GBPosition
13520
13521 Get the row and column of the endpoint of this item.
13522 """
54f9ee45 13523 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
13524
13525 def GetGBSizer(*args, **kwargs):
248ed943
RD
13526 """
13527 GetGBSizer(self) -> GridBagSizer
13528
13529 Get the sizer this item is a member of.
13530 """
54f9ee45 13531 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
13532
13533 def SetGBSizer(*args, **kwargs):
248ed943
RD
13534 """
13535 SetGBSizer(self, GridBagSizer sizer)
13536
13537 Set the sizer this item is a member of.
13538 """
54f9ee45 13539 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 13540
97ab0f6a
RD
13541 EndPos = property(GetEndPos,doc="See `GetEndPos`")
13542 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
13543 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
13544 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
2131d850 13545_core_.GBSizerItem_swigregister(GBSizerItem)
d14a1e28
RD
13546DefaultSpan = cvar.DefaultSpan
13547
13548def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
13549 """
13550 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
13551 int border, PyObject userData=None) -> GBSizerItem
13552
13553 Construct a `wx.GBSizerItem` for a window.
0df68c9f 13554 """
54f9ee45 13555 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
13556 return val
13557
13558def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
13559 """
13560 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
13561 int border, PyObject userData=None) -> GBSizerItem
13562
13563 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 13564 """
54f9ee45 13565 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
13566 return val
13567
13568def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
13569 """
13570 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
13571 int flag, int border, PyObject userData=None) -> GBSizerItem
13572
13573 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 13574 """
54f9ee45 13575 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
13576 return val
13577
13578class GridBagSizer(FlexGridSizer):
248ed943
RD
13579 """
13580 A `wx.Sizer` that can lay out items in a virtual grid like a
13581 `wx.FlexGridSizer` but in this case explicit positioning of the items
13582 is allowed using `wx.GBPosition`, and items can optionally span more
13583 than one row and/or column using `wx.GBSpan`. The total size of the
13584 virtual grid is determined by the largest row and column that items are
13585 positioned at, adjusted for spanning.
13586
13587 """
0085ce49
RD
13588 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13589 __repr__ = _swig_repr
13590 def __init__(self, *args, **kwargs):
248ed943
RD
13591 """
13592 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
13593
13594 Constructor, with optional parameters to specify the gap between the
13595 rows and columns.
13596 """
0085ce49 13597 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
1823fbb4
RD
13598 self._setOORInfo(self)
13599
e811c8ce 13600 def Add(*args, **kwargs):
0df68c9f 13601 """
248ed943 13602 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 13603 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
13604
13605 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13606 more than one row or column as specified with *span*. The remaining
13607 args behave similarly to `wx.Sizer.Add`.
13608
13609 Returns True if the item was successfully placed at the given cell
13610 position, False if something was already there.
13611
0df68c9f 13612 """
54f9ee45 13613 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
13614
13615 def AddItem(*args, **kwargs):
248ed943 13616 """
d3b6e4ff 13617 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
13618
13619 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13620 the item was successfully placed at its given cell position, False if
13621 something was already there.
13622 """
54f9ee45 13623 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 13624
84f85550
RD
13625 def GetCellSize(*args, **kwargs):
13626 """
13627 GetCellSize(self, int row, int col) -> Size
13628
13629 Get the size of the specified cell, including hgap and
13630 vgap. Only valid after a Layout.
13631 """
13632 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
13633
e811c8ce 13634 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
13635 """
13636 GetEmptyCellSize(self) -> Size
13637
13638 Get the size used for cells in the grid with no item.
13639 """
54f9ee45 13640 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
13641
13642 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
13643 """
13644 SetEmptyCellSize(self, Size sz)
13645
13646 Set the size used for cells in the grid with no item.
13647 """
54f9ee45 13648 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
13649
13650 def GetItemPosition(*args):
0df68c9f 13651 """
248ed943
RD
13652 GetItemPosition(self, item) -> GBPosition
13653
13654 Get the grid position of the specified *item* where *item* is either a
13655 window or subsizer that is a member of this sizer, or a zero-based
13656 index of an item.
0df68c9f 13657 """
54f9ee45 13658 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
13659
13660 def SetItemPosition(*args):
0df68c9f 13661 """
248ed943
RD
13662 SetItemPosition(self, item, GBPosition pos) -> bool
13663
13664 Set the grid position of the specified *item* where *item* is either a
13665 window or subsizer that is a member of this sizer, or a zero-based
13666 index of an item. Returns True on success. If the move is not
13667 allowed (because an item is already there) then False is returned.
13668
0df68c9f 13669 """
54f9ee45 13670 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
13671
13672 def GetItemSpan(*args):
0df68c9f 13673 """
248ed943
RD
13674 GetItemSpan(self, item) -> GBSpan
13675
13676 Get the row/col spanning of the specified *item* where *item* is
13677 either a window or subsizer that is a member of this sizer, or a
13678 zero-based index of an item.
0df68c9f 13679 """
54f9ee45 13680 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
13681
13682 def SetItemSpan(*args):
0df68c9f 13683 """
248ed943
RD
13684 SetItemSpan(self, item, GBSpan span) -> bool
13685
13686 Set the row/col spanning of the specified *item* where *item* is
13687 either a window or subsizer that is a member of this sizer, or a
13688 zero-based index of an item. Returns True on success. If the move is
13689 not allowed (because an item is already there) then False is returned.
0df68c9f 13690 """
54f9ee45 13691 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
13692
13693 def FindItem(*args):
0df68c9f 13694 """
248ed943
RD
13695 FindItem(self, item) -> GBSizerItem
13696
13697 Find the sizer item for the given window or subsizer, returns None if
13698 not found. (non-recursive)
0df68c9f 13699 """
54f9ee45 13700 return _core_.GridBagSizer_FindItem(*args)
e811c8ce 13701
b08d67c2
RD
13702 def GetItem(self, item):
13703 gbsi = None
13704 si = wx.FlexGridSizer.GetItem(self, item)
13705 if not si:
13706 return None
13707 if type(item) is not int:
13708 gbsi = self.FindItem(item)
13709 if gbsi: return gbsi
13710 return si
13711
e811c8ce 13712 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
13713 """
13714 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13715
13716 Return the sizer item for the given grid cell, or None if there is no
13717 item at that position. (non-recursive)
13718 """
54f9ee45 13719 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
13720
13721 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
13722 """
13723 FindItemAtPoint(self, Point pt) -> GBSizerItem
13724
13725 Return the sizer item located at the point given in *pt*, or None if
13726 there is no item at that point. The (x,y) coordinates in pt correspond
13727 to the client coordinates of the window using the sizer for
13728 layout. (non-recursive)
13729 """
54f9ee45 13730 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 13731
248ed943
RD
13732 def CheckForIntersection(*args, **kwargs):
13733 """
13734 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 13735
248ed943
RD
13736 Look at all items and see if any intersect (or would overlap) the
13737 given *item*. Returns True if so, False if there would be no overlap.
13738 If an *excludeItem* is given then it will not be checked for
13739 intersection, for example it may be the item we are checking the
13740 position of.
e811c8ce 13741
248ed943
RD
13742 """
13743 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 13744
248ed943 13745 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 13746 """
248ed943
RD
13747 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13748
13749 Look at all items and see if any intersect (or would overlap) the
13750 given position and span. Returns True if so, False if there would be
13751 no overlap. If an *excludeItem* is given then it will not be checked
13752 for intersection, for example it may be the item we are checking the
13753 position of.
0df68c9f 13754 """
248ed943 13755 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 13756
2131d850 13757_core_.GridBagSizer_swigregister(GridBagSizer)
d14a1e28
RD
13758
13759#---------------------------------------------------------------------------
13760
54f9ee45
RD
13761Left = _core_.Left
13762Top = _core_.Top
13763Right = _core_.Right
13764Bottom = _core_.Bottom
13765Width = _core_.Width
13766Height = _core_.Height
13767Centre = _core_.Centre
13768Center = _core_.Center
13769CentreX = _core_.CentreX
13770CentreY = _core_.CentreY
13771Unconstrained = _core_.Unconstrained
13772AsIs = _core_.AsIs
13773PercentOf = _core_.PercentOf
13774Above = _core_.Above
13775Below = _core_.Below
13776LeftOf = _core_.LeftOf
13777RightOf = _core_.RightOf
13778SameAs = _core_.SameAs
13779Absolute = _core_.Absolute
d14a1e28 13780class IndividualLayoutConstraint(Object):
15afbcd0 13781 """
41e2b43e
RD
13782 Objects of this class are stored in the `wx.LayoutConstraints` class as
13783 one of eight possible constraints that a window can be involved in.
13784 You will never need to create an instance of
13785 wx.IndividualLayoutConstraint, rather you should create a
13786 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 13787 that it contains.
15afbcd0 13788 """
0085ce49
RD
13789 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13790 def __init__(self): raise AttributeError, "No constructor defined"
13791 __repr__ = _swig_repr
e811c8ce 13792 def Set(*args, **kwargs):
41e2b43e
RD
13793 """
13794 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13795
13796 Sets the properties of the constraint. Normally called by one of the
13797 convenience functions such as Above, RightOf, SameAs.
13798 """
54f9ee45 13799 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
13800
13801 def LeftOf(*args, **kwargs):
15afbcd0 13802 """
a95a7133 13803 LeftOf(self, Window sibling, int marg=0)
15afbcd0 13804
41e2b43e
RD
13805 Constrains this edge to be to the left of the given window, with an
13806 optional margin. Implicitly, this is relative to the left edge of the
13807 other window.
15afbcd0 13808 """
54f9ee45 13809 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
13810
13811 def RightOf(*args, **kwargs):
15afbcd0 13812 """
a95a7133 13813 RightOf(self, Window sibling, int marg=0)
15afbcd0 13814
41e2b43e
RD
13815 Constrains this edge to be to the right of the given window, with an
13816 optional margin. Implicitly, this is relative to the right edge of the
13817 other window.
15afbcd0 13818 """
54f9ee45 13819 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
13820
13821 def Above(*args, **kwargs):
15afbcd0 13822 """
a95a7133 13823 Above(self, Window sibling, int marg=0)
15afbcd0 13824
41e2b43e
RD
13825 Constrains this edge to be above the given window, with an optional
13826 margin. Implicitly, this is relative to the top edge of the other
13827 window.
15afbcd0 13828 """
54f9ee45 13829 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
13830
13831 def Below(*args, **kwargs):
15afbcd0 13832 """
a95a7133 13833 Below(self, Window sibling, int marg=0)
15afbcd0 13834
41e2b43e
RD
13835 Constrains this edge to be below the given window, with an optional
13836 margin. Implicitly, this is relative to the bottom edge of the other
13837 window.
15afbcd0 13838 """
54f9ee45 13839 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
13840
13841 def SameAs(*args, **kwargs):
15afbcd0 13842 """
a95a7133 13843 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 13844
41e2b43e
RD
13845 Constrains this edge or dimension to be to the same as the edge of the
13846 given window, with an optional margin.
15afbcd0 13847 """
54f9ee45 13848 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
13849
13850 def PercentOf(*args, **kwargs):
15afbcd0 13851 """
a95a7133 13852 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 13853
41e2b43e
RD
13854 Constrains this edge or dimension to be to a percentage of the given
13855 window, with an optional margin.
15afbcd0 13856 """
54f9ee45 13857 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
13858
13859 def Absolute(*args, **kwargs):
15afbcd0 13860 """
a95a7133 13861 Absolute(self, int val)
15afbcd0 13862
41e2b43e 13863 Constrains this edge or dimension to be the given absolute value.
15afbcd0 13864 """
54f9ee45 13865 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
13866
13867 def Unconstrained(*args, **kwargs):
15afbcd0 13868 """
a95a7133 13869 Unconstrained(self)
15afbcd0 13870
41e2b43e
RD
13871 Sets this edge or dimension to be unconstrained, that is, dependent on
13872 other edges and dimensions from which this value can be deduced.
15afbcd0 13873 """
54f9ee45 13874 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
13875
13876 def AsIs(*args, **kwargs):
15afbcd0 13877 """
a95a7133 13878 AsIs(self)
15afbcd0 13879
41e2b43e
RD
13880 Sets this edge or constraint to be whatever the window's value is at
13881 the moment. If either of the width and height constraints are *as is*,
13882 the window will not be resized, but moved instead. This is important
13883 when considering panel items which are intended to have a default
13884 size, such as a button, which may take its size from the size of the
13885 button label.
15afbcd0 13886 """
54f9ee45 13887 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
13888
13889 def GetOtherWindow(*args, **kwargs):
a95a7133 13890 """GetOtherWindow(self) -> Window"""
54f9ee45 13891 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
13892
13893 def GetMyEdge(*args, **kwargs):
a95a7133 13894 """GetMyEdge(self) -> int"""
54f9ee45 13895 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
13896
13897 def SetEdge(*args, **kwargs):
a95a7133 13898 """SetEdge(self, int which)"""
54f9ee45 13899 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
13900
13901 def SetValue(*args, **kwargs):
a95a7133 13902 """SetValue(self, int v)"""
54f9ee45 13903 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
13904
13905 def GetMargin(*args, **kwargs):
a95a7133 13906 """GetMargin(self) -> int"""
54f9ee45 13907 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
13908
13909 def SetMargin(*args, **kwargs):
a95a7133 13910 """SetMargin(self, int m)"""
54f9ee45 13911 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
13912
13913 def GetValue(*args, **kwargs):
a95a7133 13914 """GetValue(self) -> int"""
54f9ee45 13915 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
13916
13917 def GetPercent(*args, **kwargs):
a95a7133 13918 """GetPercent(self) -> int"""
54f9ee45 13919 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
13920
13921 def GetOtherEdge(*args, **kwargs):
a95a7133 13922 """GetOtherEdge(self) -> int"""
54f9ee45 13923 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
13924
13925 def GetDone(*args, **kwargs):
a95a7133 13926 """GetDone(self) -> bool"""
54f9ee45 13927 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
13928
13929 def SetDone(*args, **kwargs):
a95a7133 13930 """SetDone(self, bool d)"""
54f9ee45 13931 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
13932
13933 def GetRelationship(*args, **kwargs):
a95a7133 13934 """GetRelationship(self) -> int"""
54f9ee45 13935 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
13936
13937 def SetRelationship(*args, **kwargs):
a95a7133 13938 """SetRelationship(self, int r)"""
54f9ee45 13939 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
13940
13941 def ResetIfWin(*args, **kwargs):
15afbcd0 13942 """
a95a7133 13943 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
13944
13945 Reset constraint if it mentions otherWin
13946 """
54f9ee45 13947 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
13948
13949 def SatisfyConstraint(*args, **kwargs):
15afbcd0 13950 """
a95a7133 13951 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
13952
13953 Try to satisfy constraint
13954 """
54f9ee45 13955 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
13956
13957 def GetEdge(*args, **kwargs):
15afbcd0 13958 """
a95a7133 13959 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
13960
13961 Get the value of this edge or dimension, or if this
13962 is not determinable, -1.
13963 """
54f9ee45 13964 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 13965
97ab0f6a
RD
13966 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13967 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13968 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13969 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13970 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13971 Percent = property(GetPercent,doc="See `GetPercent`")
13972 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13973 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
2131d850 13974_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d14a1e28
RD
13975
13976class LayoutConstraints(Object):
15afbcd0 13977 """
41e2b43e
RD
13978 **Note:** constraints are now deprecated and you should use sizers
13979 instead.
15afbcd0 13980
41e2b43e
RD
13981 Objects of this class can be associated with a window to define its
13982 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
13983
13984 The class consists of the following eight constraints of class
13985 wx.IndividualLayoutConstraint, some or all of which should be accessed
13986 directly to set the appropriate constraints.
13987
13988 * left: represents the left hand edge of the window
13989 * right: represents the right hand edge of the window
13990 * top: represents the top edge of the window
13991 * bottom: represents the bottom edge of the window
13992 * width: represents the width of the window
13993 * height: represents the height of the window
13994 * centreX: represents the horizontal centre point of the window
13995 * centreY: represents the vertical centre point of the window
13996
41e2b43e
RD
13997 Most constraints are initially set to have the relationship
13998 wxUnconstrained, which means that their values should be calculated by
13999 looking at known constraints. The exceptions are width and height,
14000 which are set to wxAsIs to ensure that if the user does not specify a
14001 constraint, the existing width and height will be used, to be
14002 compatible with panel items which often have take a default size. If
14003 the constraint is ``wx.AsIs``, the dimension will not be changed.
14004
14005 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
14006
14007 """
0085ce49
RD
14008 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
14009 __repr__ = _swig_repr
54f9ee45
RD
14010 left = property(_core_.LayoutConstraints_left_get)
14011 top = property(_core_.LayoutConstraints_top_get)
14012 right = property(_core_.LayoutConstraints_right_get)
14013 bottom = property(_core_.LayoutConstraints_bottom_get)
14014 width = property(_core_.LayoutConstraints_width_get)
14015 height = property(_core_.LayoutConstraints_height_get)
14016 centreX = property(_core_.LayoutConstraints_centreX_get)
14017 centreY = property(_core_.LayoutConstraints_centreY_get)
0085ce49 14018 def __init__(self, *args, **kwargs):
a95a7133 14019 """__init__(self) -> LayoutConstraints"""
0085ce49
RD
14020 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
14021 __swig_destroy__ = _core_.delete_LayoutConstraints
14022 __del__ = lambda self : None;
e811c8ce 14023 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 14024 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 14025 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
14026
14027 def AreSatisfied(*args, **kwargs):
a95a7133 14028 """AreSatisfied(self) -> bool"""
54f9ee45 14029 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 14030
2131d850 14031_core_.LayoutConstraints_swigregister(LayoutConstraints)
d14a1e28
RD
14032
14033#----------------------------------------------------------------------------
14034
322913ce 14035# Use Python's bool constants if available, make some if not
d14a1e28
RD
14036try:
14037 True
14038except NameError:
322913ce
RD
14039 __builtins__.True = 1==1
14040 __builtins__.False = 1==0
4f89f6a3
RD
14041 def bool(value): return not not value
14042 __builtins__.bool = bool
d14a1e28 14043
d14a1e28
RD
14044
14045
14046# workarounds for bad wxRTTI names
14047__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
14048__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
14049__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
14050
14051
14052#----------------------------------------------------------------------------
14053# Load version numbers from __version__... Ensure that major and minor
7bc1e663 14054# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
14055
14056from __version__ import *
14057__version__ = VERSION_STRING
14058
7bc1e663
RD
14059assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
14060assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 14061if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 14062 import warnings
7bc1e663 14063 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28 14064
f9bf356b
RD
14065
14066def version():
14067 """Returns a string containing version and port info"""
14068 ctype = wx.USE_UNICODE and 'unicode' or 'ansi'
14069 if wx.Platform == '__WXMSW__':
14070 port = 'msw'
14071 elif wx.Platform == '__WXMAC__':
14072 port = 'mac'
14073 elif wx.Platform == '__WXGTK__':
14074 port = 'gtk'
14075 if 'gtk2' in wx.PlatformInfo:
14076 port = 'gtk2'
14077 else:
14078 port = '?'
14079
14080 return "%s (%s-%s)" % (wx.VERSION_STRING, port, ctype)
14081
14082
d14a1e28
RD
14083#----------------------------------------------------------------------------
14084
70b7a5fe
RD
14085# Set wxPython's default string<-->unicode conversion encoding from
14086# the locale, but only if Python's default hasn't been changed. (We
14087# assume that if the user has customized it already then that is the
14088# encoding we need to use as well.)
14089#
14090# The encoding selected here is used when string or unicode objects
14091# need to be converted in order to pass them to wxWidgets. Please be
14092# aware that the default encoding within the same locale may be
14093# slightly different on different platforms. For example, please see
e505d15e
RD
14094# http://www.alanwood.net/demos/charsetdiffs.html for differences
14095# between the common latin/roman encodings.
396fb509
RD
14096
14097default = _sys.getdefaultencoding()
14098if default == 'ascii':
14099 import locale
14100 import codecs
14101 try:
474e2ff2
RD
14102 if hasattr(locale, 'getpreferredencoding'):
14103 default = locale.getpreferredencoding()
14104 else:
14105 default = locale.getdefaultlocale()[1]
396fb509 14106 codecs.lookup(default)
70b7a5fe 14107 except (ValueError, LookupError, TypeError):
396fb509
RD
14108 default = _sys.getdefaultencoding()
14109 del locale
14110 del codecs
5cbf236d
RD
14111if default:
14112 wx.SetDefaultPyEncoding(default)
14113del default
5cbf236d
RD
14114
14115#----------------------------------------------------------------------------
14116
d14a1e28
RD
14117class PyDeadObjectError(AttributeError):
14118 pass
14119
d14a1e28
RD
14120class _wxPyDeadObject(object):
14121 """
14122 Instances of wx objects that are OOR capable will have their __class__
14123 changed to this class when the C++ object is deleted. This should help
14124 prevent crashes due to referencing a bogus C++ pointer.
14125 """
14126 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
14127 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
14128
3a04f143 14129 def __repr__(self):
d14a1e28
RD
14130 if not hasattr(self, "_name"):
14131 self._name = "[unknown]"
14132 return self.reprStr % self._name
14133
3a04f143 14134 def __getattr__(self, *args):
d14a1e28
RD
14135 if not hasattr(self, "_name"):
14136 self._name = "[unknown]"
3a04f143
RD
14137 raise PyDeadObjectError(self.attrStr % self._name)
14138
14139 def __nonzero__(self):
14140 return 0
14141
14142
14143
14144class PyUnbornObjectError(AttributeError):
14145 pass
14146
14147class _wxPyUnbornObject(object):
14148 """
54f9ee45 14149 Some stock objects are created when the wx._core module is
3a04f143
RD
14150 imported, but their C++ instance is not created until the wx.App
14151 object is created and initialized. These object instances will
14152 temporarily have their __class__ changed to this class so an
14153 exception will be raised if they are used before the C++ instance
14154 is ready.
14155 """
14156
14157 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
14158 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
14159
14160 def __repr__(self):
14161 #if not hasattr(self, "_name"):
14162 # self._name = "[unknown]"
14163 return self.reprStr #% self._name
14164
14165 def __getattr__(self, *args):
14166 #if not hasattr(self, "_name"):
14167 # self._name = "[unknown]"
14168 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
14169
14170 def __nonzero__(self):
14171 return 0
14172
14173
14174#----------------------------------------------------------------------------
d14a1e28
RD
14175
14176def CallAfter(callable, *args, **kw):
14177 """
14178 Call the specified function after the current and pending event
14179 handlers have been completed. This is also good for making GUI
61863841
RD
14180 method calls from non-GUI threads. Any extra positional or
14181 keyword args are passed on to the callable when it is called.
14182
846c181b 14183 :see: `wx.CallLater`
d14a1e28
RD
14184 """
14185 app = wx.GetApp()
dfbb5885 14186 assert app is not None, 'No wx.App created yet'
d14a1e28 14187
148275d3
RD
14188 if not hasattr(app, "_CallAfterId"):
14189 app._CallAfterId = wx.NewEventType()
14190 app.Connect(-1, -1, app._CallAfterId,
14191 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 14192 evt = wx.PyEvent()
148275d3 14193 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
14194 evt.callable = callable
14195 evt.args = args
14196 evt.kw = kw
14197 wx.PostEvent(app, evt)
14198
d14a1e28
RD
14199#----------------------------------------------------------------------------
14200
14201
846c181b 14202class CallLater:
d14a1e28 14203 """
8ac8dba0 14204 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
14205 object once after the given amount of milliseconds, passing any
14206 positional or keyword args. The return value of the callable is
61863841 14207 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
14208
14209 If you don't need to get the return value or restart the timer
14210 then there is no need to hold a reference to this object. It will
14211 hold a reference to itself while the timer is running (the timer
14212 has a reference to self.Notify) but the cycle will be broken when
846c181b 14213 the timer completes, automatically cleaning up the wx.CallLater
d14a1e28 14214 object.
61863841
RD
14215
14216 :see: `wx.CallAfter`
d14a1e28
RD
14217 """
14218 def __init__(self, millis, callable, *args, **kwargs):
14219 self.millis = millis
14220 self.callable = callable
14221 self.SetArgs(*args, **kwargs)
14222 self.runCount = 0
4276dc52 14223 self.running = False
d14a1e28
RD
14224 self.hasRun = False
14225 self.result = None
14226 self.timer = None
14227 self.Start()
14228
14229 def __del__(self):
14230 self.Stop()
14231
14232
14233 def Start(self, millis=None, *args, **kwargs):
14234 """
14235 (Re)start the timer
14236 """
14237 self.hasRun = False
14238 if millis is not None:
14239 self.millis = millis
14240 if args or kwargs:
14241 self.SetArgs(*args, **kwargs)
14242 self.Stop()
14243 self.timer = wx.PyTimer(self.Notify)
14244 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 14245 self.running = True
d14a1e28
RD
14246 Restart = Start
14247
14248
14249 def Stop(self):
14250 """
14251 Stop and destroy the timer.
14252 """
14253 if self.timer is not None:
14254 self.timer.Stop()
14255 self.timer = None
14256
14257
14258 def GetInterval(self):
14259 if self.timer is not None:
14260 return self.timer.GetInterval()
14261 else:
14262 return 0
14263
14264
14265 def IsRunning(self):
14266 return self.timer is not None and self.timer.IsRunning()
14267
14268
14269 def SetArgs(self, *args, **kwargs):
14270 """
14271 (Re)set the args passed to the callable object. This is
14272 useful in conjunction with Restart if you want to schedule a
14273 new call to the same callable object but with different
14274 parameters.
14275 """
14276 self.args = args
14277 self.kwargs = kwargs
14278
14279
14280 def HasRun(self):
14281 return self.hasRun
14282
14283 def GetResult(self):
14284 return self.result
14285
14286 def Notify(self):
14287 """
14288 The timer has expired so call the callable.
14289 """
14290 if self.callable and getattr(self.callable, 'im_self', True):
14291 self.runCount += 1
4276dc52 14292 self.running = False
d14a1e28
RD
14293 self.result = self.callable(*self.args, **self.kwargs)
14294 self.hasRun = True
4276dc52
RD
14295 if not self.running:
14296 # if it wasn't restarted, then cleanup
14297 wx.CallAfter(self.Stop)
d14a1e28 14298
97ab0f6a
RD
14299 Interval = property(GetInterval)
14300 Result = property(GetResult)
d14a1e28 14301
a95a7133 14302
846c181b 14303class FutureCall(CallLater):
b39fe951 14304 """A compatibility alias for `CallLater`."""
846c181b 14305
a95a7133
RD
14306#----------------------------------------------------------------------------
14307# Control which items in this module should be documented by epydoc.
14308# We allow only classes and functions, which will help reduce the size
14309# of the docs by filtering out the zillions of constants, EVT objects,
14310# and etc that don't make much sense by themselves, but are instead
14311# documented (or will be) as part of the classes/functions/methods
14312# where they should be used.
14313
66c033b4
RD
14314class __DocFilter:
14315 """
14316 A filter for epydoc that only allows non-Ptr classes and
34e0a3bb 14317 functions, in order to reduce the clutter in the API docs.
66c033b4
RD
14318 """
14319 def __init__(self, globals):
14320 self._globals = globals
14321
14322 def __call__(self, name):
14323 import types
14324 obj = self._globals.get(name, None)
34e0a3bb
RD
14325
14326 # only document classes and function
66c033b4
RD
14327 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
14328 return False
34e0a3bb
RD
14329
14330 # skip other things that are private or will be documented as part of somethign else
0085ce49 14331 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
66c033b4 14332 return False
34e0a3bb
RD
14333
14334 # skip functions that are duplicates of static functions in a class
14335 if name.find('_') != -1:
14336 cls = self._globals.get(name.split('_')[0], None)
14337 methname = name.split('_')[1]
14338 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
14339 return False
14340
66c033b4 14341 return True
a95a7133 14342
d14a1e28
RD
14343#----------------------------------------------------------------------------
14344#----------------------------------------------------------------------------
14345
14346# Import other modules in this package that should show up in the
14347# "core" wx namespace
54f9ee45
RD
14348from _gdi import *
14349from _windows import *
14350from _controls import *
14351from _misc import *
d14a1e28
RD
14352
14353#----------------------------------------------------------------------------
14354#----------------------------------------------------------------------------
14355
14356
32fe5131 14357