]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
Some minor tweaks
[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
105ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
106RETAINED = _core_.RETAINED
107BACKINGSTORE = _core_.BACKINGSTORE
108COLOURED = _core_.COLOURED
109FIXED_LENGTH = _core_.FIXED_LENGTH
110LB_NEEDED_SB = _core_.LB_NEEDED_SB
111LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
112LB_SORT = _core_.LB_SORT
113LB_SINGLE = _core_.LB_SINGLE
114LB_MULTIPLE = _core_.LB_MULTIPLE
115LB_EXTENDED = _core_.LB_EXTENDED
116LB_OWNERDRAW = _core_.LB_OWNERDRAW
117LB_HSCROLL = _core_.LB_HSCROLL
118PROCESS_ENTER = _core_.PROCESS_ENTER
119PASSWORD = _core_.PASSWORD
120CB_SIMPLE = _core_.CB_SIMPLE
121CB_DROPDOWN = _core_.CB_DROPDOWN
122CB_SORT = _core_.CB_SORT
123CB_READONLY = _core_.CB_READONLY
124RA_HORIZONTAL = _core_.RA_HORIZONTAL
125RA_VERTICAL = _core_.RA_VERTICAL
126RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
127RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 128RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
54f9ee45
RD
129RB_GROUP = _core_.RB_GROUP
130RB_SINGLE = _core_.RB_SINGLE
54f9ee45
RD
131SB_HORIZONTAL = _core_.SB_HORIZONTAL
132SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 133RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
54f9ee45
RD
134ST_SIZEGRIP = _core_.ST_SIZEGRIP
135ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
136ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
137ST_DOTS_END = _core_.ST_DOTS_END
54f9ee45
RD
138FLOOD_SURFACE = _core_.FLOOD_SURFACE
139FLOOD_BORDER = _core_.FLOOD_BORDER
140ODDEVEN_RULE = _core_.ODDEVEN_RULE
141WINDING_RULE = _core_.WINDING_RULE
142TOOL_TOP = _core_.TOOL_TOP
143TOOL_BOTTOM = _core_.TOOL_BOTTOM
144TOOL_LEFT = _core_.TOOL_LEFT
145TOOL_RIGHT = _core_.TOOL_RIGHT
146OK = _core_.OK
147YES_NO = _core_.YES_NO
148CANCEL = _core_.CANCEL
149YES = _core_.YES
150NO = _core_.NO
151NO_DEFAULT = _core_.NO_DEFAULT
152YES_DEFAULT = _core_.YES_DEFAULT
153ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
154ICON_HAND = _core_.ICON_HAND
155ICON_QUESTION = _core_.ICON_QUESTION
156ICON_INFORMATION = _core_.ICON_INFORMATION
157ICON_STOP = _core_.ICON_STOP
158ICON_ASTERISK = _core_.ICON_ASTERISK
159ICON_MASK = _core_.ICON_MASK
160ICON_WARNING = _core_.ICON_WARNING
161ICON_ERROR = _core_.ICON_ERROR
162FORWARD = _core_.FORWARD
163BACKWARD = _core_.BACKWARD
164RESET = _core_.RESET
165HELP = _core_.HELP
166MORE = _core_.MORE
167SETUP = _core_.SETUP
168SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
169SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
170SIZE_AUTO = _core_.SIZE_AUTO
171SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
172SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 173SIZE_FORCE = _core_.SIZE_FORCE
54f9ee45
RD
174PORTRAIT = _core_.PORTRAIT
175LANDSCAPE = _core_.LANDSCAPE
176PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
177PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
178PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
179PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
180ID_ANY = _core_.ID_ANY
181ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 182ID_NONE = _core_.ID_NONE
54f9ee45
RD
183ID_LOWEST = _core_.ID_LOWEST
184ID_OPEN = _core_.ID_OPEN
185ID_CLOSE = _core_.ID_CLOSE
186ID_NEW = _core_.ID_NEW
187ID_SAVE = _core_.ID_SAVE
188ID_SAVEAS = _core_.ID_SAVEAS
189ID_REVERT = _core_.ID_REVERT
190ID_EXIT = _core_.ID_EXIT
191ID_UNDO = _core_.ID_UNDO
192ID_REDO = _core_.ID_REDO
193ID_HELP = _core_.ID_HELP
194ID_PRINT = _core_.ID_PRINT
195ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
196ID_PREVIEW = _core_.ID_PREVIEW
197ID_ABOUT = _core_.ID_ABOUT
198ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
199ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
200ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
201ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
202ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
203ID_PREFERENCES = _core_.ID_PREFERENCES
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
223ID_FILE1 = _core_.ID_FILE1
224ID_FILE2 = _core_.ID_FILE2
225ID_FILE3 = _core_.ID_FILE3
226ID_FILE4 = _core_.ID_FILE4
227ID_FILE5 = _core_.ID_FILE5
228ID_FILE6 = _core_.ID_FILE6
229ID_FILE7 = _core_.ID_FILE7
230ID_FILE8 = _core_.ID_FILE8
231ID_FILE9 = _core_.ID_FILE9
232ID_OK = _core_.ID_OK
233ID_CANCEL = _core_.ID_CANCEL
234ID_APPLY = _core_.ID_APPLY
235ID_YES = _core_.ID_YES
236ID_NO = _core_.ID_NO
237ID_STATIC = _core_.ID_STATIC
238ID_FORWARD = _core_.ID_FORWARD
239ID_BACKWARD = _core_.ID_BACKWARD
240ID_DEFAULT = _core_.ID_DEFAULT
241ID_MORE = _core_.ID_MORE
242ID_SETUP = _core_.ID_SETUP
243ID_RESET = _core_.ID_RESET
244ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
245ID_YESTOALL = _core_.ID_YESTOALL
246ID_NOTOALL = _core_.ID_NOTOALL
247ID_ABORT = _core_.ID_ABORT
248ID_RETRY = _core_.ID_RETRY
249ID_IGNORE = _core_.ID_IGNORE
7bc1e663
RD
250ID_ADD = _core_.ID_ADD
251ID_REMOVE = _core_.ID_REMOVE
252ID_UP = _core_.ID_UP
253ID_DOWN = _core_.ID_DOWN
254ID_HOME = _core_.ID_HOME
255ID_REFRESH = _core_.ID_REFRESH
256ID_STOP = _core_.ID_STOP
257ID_INDEX = _core_.ID_INDEX
258ID_BOLD = _core_.ID_BOLD
259ID_ITALIC = _core_.ID_ITALIC
260ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
261ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
262ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
263ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
264ID_UNDERLINE = _core_.ID_UNDERLINE
265ID_INDENT = _core_.ID_INDENT
266ID_UNINDENT = _core_.ID_UNINDENT
267ID_ZOOM_100 = _core_.ID_ZOOM_100
268ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
269ID_ZOOM_IN = _core_.ID_ZOOM_IN
270ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
271ID_UNDELETE = _core_.ID_UNDELETE
272ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
54f9ee45
RD
273ID_HIGHEST = _core_.ID_HIGHEST
274OPEN = _core_.OPEN
275SAVE = _core_.SAVE
276HIDE_READONLY = _core_.HIDE_READONLY
277OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
278FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
279MULTIPLE = _core_.MULTIPLE
280CHANGE_DIR = _core_.CHANGE_DIR
281ACCEL_ALT = _core_.ACCEL_ALT
282ACCEL_CTRL = _core_.ACCEL_CTRL
283ACCEL_SHIFT = _core_.ACCEL_SHIFT
284ACCEL_NORMAL = _core_.ACCEL_NORMAL
285PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
286PD_APP_MODAL = _core_.PD_APP_MODAL
287PD_CAN_ABORT = _core_.PD_CAN_ABORT
288PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
289PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
290PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
e505d15e
RD
291PD_SMOOTH = _core_.PD_SMOOTH
292PD_CAN_SKIP = _core_.PD_CAN_SKIP
54f9ee45
RD
293DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
294DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
295MENU_TEAROFF = _core_.MENU_TEAROFF
296MB_DOCKABLE = _core_.MB_DOCKABLE
297NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
298FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
299LI_HORIZONTAL = _core_.LI_HORIZONTAL
300LI_VERTICAL = _core_.LI_VERTICAL
301WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
302WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
303WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
304WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
305WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
306WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
307MM_TEXT = _core_.MM_TEXT
308MM_LOMETRIC = _core_.MM_LOMETRIC
309MM_HIMETRIC = _core_.MM_HIMETRIC
310MM_LOENGLISH = _core_.MM_LOENGLISH
311MM_HIENGLISH = _core_.MM_HIENGLISH
312MM_TWIPS = _core_.MM_TWIPS
313MM_ISOTROPIC = _core_.MM_ISOTROPIC
314MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
315MM_POINTS = _core_.MM_POINTS
316MM_METRIC = _core_.MM_METRIC
317CENTRE = _core_.CENTRE
318CENTER = _core_.CENTER
319HORIZONTAL = _core_.HORIZONTAL
320VERTICAL = _core_.VERTICAL
321BOTH = _core_.BOTH
322LEFT = _core_.LEFT
323RIGHT = _core_.RIGHT
324UP = _core_.UP
325DOWN = _core_.DOWN
326TOP = _core_.TOP
327BOTTOM = _core_.BOTTOM
328NORTH = _core_.NORTH
329SOUTH = _core_.SOUTH
330WEST = _core_.WEST
331EAST = _core_.EAST
332ALL = _core_.ALL
333ALIGN_NOT = _core_.ALIGN_NOT
334ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
335ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
336ALIGN_LEFT = _core_.ALIGN_LEFT
337ALIGN_TOP = _core_.ALIGN_TOP
338ALIGN_RIGHT = _core_.ALIGN_RIGHT
339ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
340ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
341ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
342ALIGN_CENTER = _core_.ALIGN_CENTER
343ALIGN_CENTRE = _core_.ALIGN_CENTRE
344ALIGN_MASK = _core_.ALIGN_MASK
345STRETCH_NOT = _core_.STRETCH_NOT
346SHRINK = _core_.SHRINK
347GROW = _core_.GROW
348EXPAND = _core_.EXPAND
349SHAPED = _core_.SHAPED
350FIXED_MINSIZE = _core_.FIXED_MINSIZE
351TILE = _core_.TILE
352ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
353BORDER_DEFAULT = _core_.BORDER_DEFAULT
354BORDER_NONE = _core_.BORDER_NONE
355BORDER_STATIC = _core_.BORDER_STATIC
356BORDER_SIMPLE = _core_.BORDER_SIMPLE
357BORDER_RAISED = _core_.BORDER_RAISED
358BORDER_SUNKEN = _core_.BORDER_SUNKEN
359BORDER_DOUBLE = _core_.BORDER_DOUBLE
360BORDER_MASK = _core_.BORDER_MASK
7bc1e663
RD
361BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
362BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
363BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
54f9ee45
RD
364DEFAULT = _core_.DEFAULT
365DECORATIVE = _core_.DECORATIVE
366ROMAN = _core_.ROMAN
367SCRIPT = _core_.SCRIPT
368SWISS = _core_.SWISS
369MODERN = _core_.MODERN
370TELETYPE = _core_.TELETYPE
371VARIABLE = _core_.VARIABLE
372FIXED = _core_.FIXED
373NORMAL = _core_.NORMAL
374LIGHT = _core_.LIGHT
375BOLD = _core_.BOLD
376ITALIC = _core_.ITALIC
377SLANT = _core_.SLANT
378SOLID = _core_.SOLID
379DOT = _core_.DOT
380LONG_DASH = _core_.LONG_DASH
381SHORT_DASH = _core_.SHORT_DASH
382DOT_DASH = _core_.DOT_DASH
383USER_DASH = _core_.USER_DASH
384TRANSPARENT = _core_.TRANSPARENT
385STIPPLE = _core_.STIPPLE
d04418a7
RD
386STIPPLE_MASK = _core_.STIPPLE_MASK
387STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
54f9ee45
RD
388BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
389CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
390FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
391CROSS_HATCH = _core_.CROSS_HATCH
392HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
393VERTICAL_HATCH = _core_.VERTICAL_HATCH
394JOIN_BEVEL = _core_.JOIN_BEVEL
395JOIN_MITER = _core_.JOIN_MITER
396JOIN_ROUND = _core_.JOIN_ROUND
397CAP_ROUND = _core_.CAP_ROUND
398CAP_PROJECTING = _core_.CAP_PROJECTING
399CAP_BUTT = _core_.CAP_BUTT
400CLEAR = _core_.CLEAR
401XOR = _core_.XOR
402INVERT = _core_.INVERT
403OR_REVERSE = _core_.OR_REVERSE
404AND_REVERSE = _core_.AND_REVERSE
405COPY = _core_.COPY
406AND = _core_.AND
407AND_INVERT = _core_.AND_INVERT
408NO_OP = _core_.NO_OP
409NOR = _core_.NOR
410EQUIV = _core_.EQUIV
411SRC_INVERT = _core_.SRC_INVERT
412OR_INVERT = _core_.OR_INVERT
413NAND = _core_.NAND
414OR = _core_.OR
415SET = _core_.SET
416WXK_BACK = _core_.WXK_BACK
417WXK_TAB = _core_.WXK_TAB
418WXK_RETURN = _core_.WXK_RETURN
419WXK_ESCAPE = _core_.WXK_ESCAPE
420WXK_SPACE = _core_.WXK_SPACE
421WXK_DELETE = _core_.WXK_DELETE
422WXK_START = _core_.WXK_START
423WXK_LBUTTON = _core_.WXK_LBUTTON
424WXK_RBUTTON = _core_.WXK_RBUTTON
425WXK_CANCEL = _core_.WXK_CANCEL
426WXK_MBUTTON = _core_.WXK_MBUTTON
427WXK_CLEAR = _core_.WXK_CLEAR
428WXK_SHIFT = _core_.WXK_SHIFT
429WXK_ALT = _core_.WXK_ALT
430WXK_CONTROL = _core_.WXK_CONTROL
431WXK_MENU = _core_.WXK_MENU
432WXK_PAUSE = _core_.WXK_PAUSE
433WXK_CAPITAL = _core_.WXK_CAPITAL
434WXK_PRIOR = _core_.WXK_PRIOR
435WXK_NEXT = _core_.WXK_NEXT
436WXK_END = _core_.WXK_END
437WXK_HOME = _core_.WXK_HOME
438WXK_LEFT = _core_.WXK_LEFT
439WXK_UP = _core_.WXK_UP
440WXK_RIGHT = _core_.WXK_RIGHT
441WXK_DOWN = _core_.WXK_DOWN
442WXK_SELECT = _core_.WXK_SELECT
443WXK_PRINT = _core_.WXK_PRINT
444WXK_EXECUTE = _core_.WXK_EXECUTE
445WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
446WXK_INSERT = _core_.WXK_INSERT
447WXK_HELP = _core_.WXK_HELP
448WXK_NUMPAD0 = _core_.WXK_NUMPAD0
449WXK_NUMPAD1 = _core_.WXK_NUMPAD1
450WXK_NUMPAD2 = _core_.WXK_NUMPAD2
451WXK_NUMPAD3 = _core_.WXK_NUMPAD3
452WXK_NUMPAD4 = _core_.WXK_NUMPAD4
453WXK_NUMPAD5 = _core_.WXK_NUMPAD5
454WXK_NUMPAD6 = _core_.WXK_NUMPAD6
455WXK_NUMPAD7 = _core_.WXK_NUMPAD7
456WXK_NUMPAD8 = _core_.WXK_NUMPAD8
457WXK_NUMPAD9 = _core_.WXK_NUMPAD9
458WXK_MULTIPLY = _core_.WXK_MULTIPLY
459WXK_ADD = _core_.WXK_ADD
460WXK_SEPARATOR = _core_.WXK_SEPARATOR
461WXK_SUBTRACT = _core_.WXK_SUBTRACT
462WXK_DECIMAL = _core_.WXK_DECIMAL
463WXK_DIVIDE = _core_.WXK_DIVIDE
464WXK_F1 = _core_.WXK_F1
465WXK_F2 = _core_.WXK_F2
466WXK_F3 = _core_.WXK_F3
467WXK_F4 = _core_.WXK_F4
468WXK_F5 = _core_.WXK_F5
469WXK_F6 = _core_.WXK_F6
470WXK_F7 = _core_.WXK_F7
471WXK_F8 = _core_.WXK_F8
472WXK_F9 = _core_.WXK_F9
473WXK_F10 = _core_.WXK_F10
474WXK_F11 = _core_.WXK_F11
475WXK_F12 = _core_.WXK_F12
476WXK_F13 = _core_.WXK_F13
477WXK_F14 = _core_.WXK_F14
478WXK_F15 = _core_.WXK_F15
479WXK_F16 = _core_.WXK_F16
480WXK_F17 = _core_.WXK_F17
481WXK_F18 = _core_.WXK_F18
482WXK_F19 = _core_.WXK_F19
483WXK_F20 = _core_.WXK_F20
484WXK_F21 = _core_.WXK_F21
485WXK_F22 = _core_.WXK_F22
486WXK_F23 = _core_.WXK_F23
487WXK_F24 = _core_.WXK_F24
488WXK_NUMLOCK = _core_.WXK_NUMLOCK
489WXK_SCROLL = _core_.WXK_SCROLL
490WXK_PAGEUP = _core_.WXK_PAGEUP
491WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
492WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
493WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
494WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
495WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
496WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
497WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
498WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
499WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
500WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
501WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
502WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
503WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
504WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
505WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
506WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
507WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
508WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
509WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
510WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
511WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
512WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
513WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
514WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
515WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
516WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
517WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
518WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
519WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
520WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
521WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
522WXK_COMMAND = _core_.WXK_COMMAND
523WXK_SPECIAL1 = _core_.WXK_SPECIAL1
524WXK_SPECIAL2 = _core_.WXK_SPECIAL2
525WXK_SPECIAL3 = _core_.WXK_SPECIAL3
526WXK_SPECIAL4 = _core_.WXK_SPECIAL4
527WXK_SPECIAL5 = _core_.WXK_SPECIAL5
528WXK_SPECIAL6 = _core_.WXK_SPECIAL6
529WXK_SPECIAL7 = _core_.WXK_SPECIAL7
530WXK_SPECIAL8 = _core_.WXK_SPECIAL8
531WXK_SPECIAL9 = _core_.WXK_SPECIAL9
532WXK_SPECIAL10 = _core_.WXK_SPECIAL10
533WXK_SPECIAL11 = _core_.WXK_SPECIAL11
534WXK_SPECIAL12 = _core_.WXK_SPECIAL12
535WXK_SPECIAL13 = _core_.WXK_SPECIAL13
536WXK_SPECIAL14 = _core_.WXK_SPECIAL14
537WXK_SPECIAL15 = _core_.WXK_SPECIAL15
538WXK_SPECIAL16 = _core_.WXK_SPECIAL16
539WXK_SPECIAL17 = _core_.WXK_SPECIAL17
540WXK_SPECIAL18 = _core_.WXK_SPECIAL18
541WXK_SPECIAL19 = _core_.WXK_SPECIAL19
542WXK_SPECIAL20 = _core_.WXK_SPECIAL20
54f9ee45
RD
543PAPER_NONE = _core_.PAPER_NONE
544PAPER_LETTER = _core_.PAPER_LETTER
545PAPER_LEGAL = _core_.PAPER_LEGAL
546PAPER_A4 = _core_.PAPER_A4
547PAPER_CSHEET = _core_.PAPER_CSHEET
548PAPER_DSHEET = _core_.PAPER_DSHEET
549PAPER_ESHEET = _core_.PAPER_ESHEET
550PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
551PAPER_TABLOID = _core_.PAPER_TABLOID
552PAPER_LEDGER = _core_.PAPER_LEDGER
553PAPER_STATEMENT = _core_.PAPER_STATEMENT
554PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
555PAPER_A3 = _core_.PAPER_A3
556PAPER_A4SMALL = _core_.PAPER_A4SMALL
557PAPER_A5 = _core_.PAPER_A5
558PAPER_B4 = _core_.PAPER_B4
559PAPER_B5 = _core_.PAPER_B5
560PAPER_FOLIO = _core_.PAPER_FOLIO
561PAPER_QUARTO = _core_.PAPER_QUARTO
562PAPER_10X14 = _core_.PAPER_10X14
563PAPER_11X17 = _core_.PAPER_11X17
564PAPER_NOTE = _core_.PAPER_NOTE
565PAPER_ENV_9 = _core_.PAPER_ENV_9
566PAPER_ENV_10 = _core_.PAPER_ENV_10
567PAPER_ENV_11 = _core_.PAPER_ENV_11
568PAPER_ENV_12 = _core_.PAPER_ENV_12
569PAPER_ENV_14 = _core_.PAPER_ENV_14
570PAPER_ENV_DL = _core_.PAPER_ENV_DL
571PAPER_ENV_C5 = _core_.PAPER_ENV_C5
572PAPER_ENV_C3 = _core_.PAPER_ENV_C3
573PAPER_ENV_C4 = _core_.PAPER_ENV_C4
574PAPER_ENV_C6 = _core_.PAPER_ENV_C6
575PAPER_ENV_C65 = _core_.PAPER_ENV_C65
576PAPER_ENV_B4 = _core_.PAPER_ENV_B4
577PAPER_ENV_B5 = _core_.PAPER_ENV_B5
578PAPER_ENV_B6 = _core_.PAPER_ENV_B6
579PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
580PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
581PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
582PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
583PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
584PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
585PAPER_ISO_B4 = _core_.PAPER_ISO_B4
586PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
587PAPER_9X11 = _core_.PAPER_9X11
588PAPER_10X11 = _core_.PAPER_10X11
589PAPER_15X11 = _core_.PAPER_15X11
590PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
591PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
592PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
593PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
594PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
595PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
596PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
597PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
598PAPER_A_PLUS = _core_.PAPER_A_PLUS
599PAPER_B_PLUS = _core_.PAPER_B_PLUS
600PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
601PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
602PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
603PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
604PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
605PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
606PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
607PAPER_A2 = _core_.PAPER_A2
608PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
609PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
6c75a4cf
RD
610PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
611PAPER_A6 = _core_.PAPER_A6
612PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
613PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
614PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
615PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
616PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
617PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
618PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
619PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
620PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
621PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
622PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
623PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
624PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
625PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
626PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
627PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
628PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
629PAPER_B6_JIS = _core_.PAPER_B6_JIS
630PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
631PAPER_12X11 = _core_.PAPER_12X11
632PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
633PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
634PAPER_P16K = _core_.PAPER_P16K
635PAPER_P32K = _core_.PAPER_P32K
636PAPER_P32KBIG = _core_.PAPER_P32KBIG
637PAPER_PENV_1 = _core_.PAPER_PENV_1
638PAPER_PENV_2 = _core_.PAPER_PENV_2
639PAPER_PENV_3 = _core_.PAPER_PENV_3
640PAPER_PENV_4 = _core_.PAPER_PENV_4
641PAPER_PENV_5 = _core_.PAPER_PENV_5
642PAPER_PENV_6 = _core_.PAPER_PENV_6
643PAPER_PENV_7 = _core_.PAPER_PENV_7
644PAPER_PENV_8 = _core_.PAPER_PENV_8
645PAPER_PENV_9 = _core_.PAPER_PENV_9
646PAPER_PENV_10 = _core_.PAPER_PENV_10
647PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
648PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
649PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
650PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
651PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
652PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
653PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
654PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
655PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
656PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
657PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
658PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
659PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
54f9ee45
RD
660DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
661DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
662DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
663ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
664ITEM_NORMAL = _core_.ITEM_NORMAL
665ITEM_CHECK = _core_.ITEM_CHECK
666ITEM_RADIO = _core_.ITEM_RADIO
667ITEM_MAX = _core_.ITEM_MAX
668HT_NOWHERE = _core_.HT_NOWHERE
669HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
670HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
671HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
672HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
673HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
674HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
675HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
676HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
677HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
678HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
679HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
680HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
681HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
682HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
683HT_MAX = _core_.HT_MAX
684MOD_NONE = _core_.MOD_NONE
685MOD_ALT = _core_.MOD_ALT
686MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 687MOD_ALTGR = _core_.MOD_ALTGR
54f9ee45 688MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 689MOD_META = _core_.MOD_META
54f9ee45 690MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
691MOD_CMD = _core_.MOD_CMD
692MOD_ALL = _core_.MOD_ALL
54f9ee45
RD
693UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
694UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
695UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d14a1e28
RD
696#---------------------------------------------------------------------------
697
698class Object(object):
0df68c9f
RD
699 """
700 The base class for most wx objects, although in wxPython not
701 much functionality is needed nor exposed.
702 """
0085ce49
RD
703 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
704 def __init__(self): raise AttributeError, "No constructor defined"
705 __repr__ = _swig_repr
e811c8ce 706 def GetClassName(*args, **kwargs):
0df68c9f 707 """
a95a7133 708 GetClassName(self) -> String
e811c8ce 709
a95a7133 710 Returns the class name of the C++ class using wxRTTI.
0df68c9f 711 """
54f9ee45 712 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
713
714 def Destroy(*args, **kwargs):
0df68c9f 715 """
a95a7133 716 Destroy(self)
e811c8ce 717
0df68c9f
RD
718 Deletes the C++ object this Python object is a proxy for.
719 """
7e08d4ef
RD
720 val = _core_.Object_Destroy(*args, **kwargs)
721 args[0].thisown = 0
722 return val
e811c8ce 723
0085ce49
RD
724Object_swigregister = _core_.Object_swigregister
725Object_swigregister(Object)
54f9ee45 726_wxPySetDictionary = _core_._wxPySetDictionary
54f9ee45 727_wxPyFixStockObjects = _core_._wxPyFixStockObjects
54f9ee45 728cvar = _core_.cvar
196addbf 729EmptyString = cvar.EmptyString
d14a1e28
RD
730
731#---------------------------------------------------------------------------
732
54f9ee45
RD
733BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
734BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
735BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
736BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
737BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
738BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
739BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
740BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
741BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
742BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
743BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
744BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
745BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
746BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
747BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
748BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
749BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
750BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
751BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
752BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
753CURSOR_NONE = _core_.CURSOR_NONE
754CURSOR_ARROW = _core_.CURSOR_ARROW
755CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
756CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
757CURSOR_CHAR = _core_.CURSOR_CHAR
758CURSOR_CROSS = _core_.CURSOR_CROSS
759CURSOR_HAND = _core_.CURSOR_HAND
760CURSOR_IBEAM = _core_.CURSOR_IBEAM
761CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
762CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
763CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
764CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
765CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
766CURSOR_PENCIL = _core_.CURSOR_PENCIL
767CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
768CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
769CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
770CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
771CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
772CURSOR_SIZENS = _core_.CURSOR_SIZENS
773CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
774CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
775CURSOR_SIZING = _core_.CURSOR_SIZING
776CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
777CURSOR_WAIT = _core_.CURSOR_WAIT
778CURSOR_WATCH = _core_.CURSOR_WATCH
779CURSOR_BLANK = _core_.CURSOR_BLANK
780CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
781CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
782CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
783CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
784#---------------------------------------------------------------------------
785
786class Size(object):
0df68c9f 787 """
41e2b43e 788 wx.Size is a useful data structure used to represent the size of
0085ce49
RD
789 something. It simply contains integer width and height
790 properties. In most places in wxPython where a wx.Size is
093d3ff1 791 expected a (width, height) tuple can be used instead.
0df68c9f 792 """
0085ce49
RD
793 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
794 __repr__ = _swig_repr
54f9ee45
RD
795 width = property(_core_.Size_width_get, _core_.Size_width_set)
796 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 797 x = width; y = height
0085ce49 798 def __init__(self, *args, **kwargs):
0df68c9f 799 """
a95a7133 800 __init__(self, int w=0, int h=0) -> Size
e811c8ce 801
0df68c9f
RD
802 Creates a size object.
803 """
0085ce49
RD
804 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
805 __swig_destroy__ = _core_.delete_Size
806 __del__ = lambda self : None;
e811c8ce 807 def __eq__(*args, **kwargs):
0df68c9f 808 """
e9d6f3a4 809 __eq__(self, PyObject other) -> bool
e811c8ce 810
0df68c9f
RD
811 Test for equality of wx.Size objects.
812 """
54f9ee45 813 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
814
815 def __ne__(*args, **kwargs):
0df68c9f 816 """
e9d6f3a4 817 __ne__(self, PyObject other) -> bool
e811c8ce 818
e9d6f3a4 819 Test for inequality of wx.Size objects.
0df68c9f 820 """
54f9ee45 821 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
822
823 def __add__(*args, **kwargs):
0df68c9f 824 """
a95a7133 825 __add__(self, Size sz) -> Size
e811c8ce 826
0df68c9f
RD
827 Add sz's proprties to this and return the result.
828 """
54f9ee45 829 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
830
831 def __sub__(*args, **kwargs):
0df68c9f 832 """
a95a7133 833 __sub__(self, Size sz) -> Size
e811c8ce 834
0df68c9f
RD
835 Subtract sz's properties from this and return the result.
836 """
54f9ee45 837 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
838
839 def IncTo(*args, **kwargs):
0df68c9f 840 """
a95a7133 841 IncTo(self, Size sz)
e811c8ce 842
0df68c9f
RD
843 Increments this object so that both of its dimensions are not less
844 than the corresponding dimensions of the size.
845 """
54f9ee45 846 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
847
848 def DecTo(*args, **kwargs):
0df68c9f 849 """
a95a7133 850 DecTo(self, Size sz)
e811c8ce 851
0df68c9f
RD
852 Decrements this object so that both of its dimensions are not greater
853 than the corresponding dimensions of the size.
854 """
54f9ee45 855 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce
RD
856
857 def Set(*args, **kwargs):
0df68c9f 858 """
a95a7133 859 Set(self, int w, int h)
e811c8ce 860
0df68c9f
RD
861 Set both width and height.
862 """
54f9ee45 863 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
864
865 def SetWidth(*args, **kwargs):
a95a7133 866 """SetWidth(self, int w)"""
54f9ee45 867 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
868
869 def SetHeight(*args, **kwargs):
a95a7133 870 """SetHeight(self, int h)"""
54f9ee45 871 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
872
873 def GetWidth(*args, **kwargs):
a95a7133 874 """GetWidth(self) -> int"""
54f9ee45 875 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
876
877 def GetHeight(*args, **kwargs):
a95a7133 878 """GetHeight(self) -> int"""
54f9ee45 879 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 880
74a57fcd
RD
881 def IsFullySpecified(*args, **kwargs):
882 """
a95a7133 883 IsFullySpecified(self) -> bool
74a57fcd
RD
884
885 Returns True if both components of the size are non-default values.
886 """
54f9ee45 887 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
888
889 def SetDefaults(*args, **kwargs):
890 """
a95a7133 891 SetDefaults(self, Size size)
74a57fcd 892
41e2b43e
RD
893 Combine this size with the other one replacing the default components
894 of this object (i.e. equal to -1) with those of the other.
74a57fcd 895 """
54f9ee45 896 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 897
e811c8ce 898 def Get(*args, **kwargs):
0df68c9f
RD
899 """
900 Get() -> (width,height)
e811c8ce 901
0df68c9f
RD
902 Returns the width and height properties as a tuple.
903 """
54f9ee45 904 return _core_.Size_Get(*args, **kwargs)
e811c8ce 905
41e2b43e 906 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
907 def __str__(self): return str(self.Get())
908 def __repr__(self): return 'wx.Size'+str(self.Get())
909 def __len__(self): return len(self.Get())
910 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
911 def __setitem__(self, index, val):
912 if index == 0: self.width = val
913 elif index == 1: self.height = val
914 else: raise IndexError
e811c8ce 915 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
916 __safe_for_unpickling__ = True
917 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28 918
0085ce49
RD
919Size_swigregister = _core_.Size_swigregister
920Size_swigregister(Size)
d14a1e28
RD
921
922#---------------------------------------------------------------------------
923
924class RealPoint(object):
0df68c9f 925 """
41e2b43e
RD
926 A data structure for representing a point or position with floating
927 point x and y properties. In wxPython most places that expect a
928 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 929 """
0085ce49
RD
930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
931 __repr__ = _swig_repr
54f9ee45
RD
932 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
933 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
0085ce49 934 def __init__(self, *args, **kwargs):
0df68c9f 935 """
a95a7133 936 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 937
0df68c9f
RD
938 Create a wx.RealPoint object
939 """
0085ce49
RD
940 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
941 __swig_destroy__ = _core_.delete_RealPoint
942 __del__ = lambda self : None;
e811c8ce 943 def __eq__(*args, **kwargs):
0df68c9f 944 """
e9d6f3a4 945 __eq__(self, PyObject other) -> bool
e811c8ce 946
0df68c9f
RD
947 Test for equality of wx.RealPoint objects.
948 """
54f9ee45 949 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
950
951 def __ne__(*args, **kwargs):
0df68c9f 952 """
e9d6f3a4 953 __ne__(self, PyObject other) -> bool
e811c8ce 954
0df68c9f
RD
955 Test for inequality of wx.RealPoint objects.
956 """
54f9ee45 957 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
958
959 def __add__(*args, **kwargs):
0df68c9f 960 """
a95a7133 961 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 962
0df68c9f
RD
963 Add pt's proprties to this and return the result.
964 """
54f9ee45 965 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
966
967 def __sub__(*args, **kwargs):
0df68c9f 968 """
a95a7133 969 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 970
0df68c9f
RD
971 Subtract pt's proprties from this and return the result
972 """
54f9ee45 973 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
974
975 def Set(*args, **kwargs):
0df68c9f 976 """
a95a7133 977 Set(self, double x, double y)
e811c8ce 978
0df68c9f
RD
979 Set both the x and y properties
980 """
54f9ee45 981 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
982
983 def Get(*args, **kwargs):
0df68c9f
RD
984 """
985 Get() -> (x,y)
e811c8ce 986
0df68c9f
RD
987 Return the x and y properties as a tuple.
988 """
54f9ee45 989 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 990
41e2b43e 991 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
992 def __str__(self): return str(self.Get())
993 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
994 def __len__(self): return len(self.Get())
995 def __getitem__(self, index): return self.Get()[index]
d14a1e28 996 def __setitem__(self, index, val):
e811c8ce
RD
997 if index == 0: self.x = val
998 elif index == 1: self.y = val
d14a1e28 999 else: raise IndexError
e811c8ce 1000 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1001 __safe_for_unpickling__ = True
1002 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28 1003
0085ce49
RD
1004RealPoint_swigregister = _core_.RealPoint_swigregister
1005RealPoint_swigregister(RealPoint)
d14a1e28
RD
1006
1007#---------------------------------------------------------------------------
1008
1009class Point(object):
0df68c9f 1010 """
41e2b43e
RD
1011 A data structure for representing a point or position with integer x
1012 and y properties. Most places in wxPython that expect a wx.Point can
1013 also accept a (x,y) tuple.
0df68c9f 1014 """
0085ce49
RD
1015 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1016 __repr__ = _swig_repr
54f9ee45
RD
1017 x = property(_core_.Point_x_get, _core_.Point_x_set)
1018 y = property(_core_.Point_y_get, _core_.Point_y_set)
0085ce49 1019 def __init__(self, *args, **kwargs):
0df68c9f 1020 """
a95a7133 1021 __init__(self, int x=0, int y=0) -> Point
e811c8ce 1022
0df68c9f
RD
1023 Create a wx.Point object
1024 """
0085ce49
RD
1025 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1026 __swig_destroy__ = _core_.delete_Point
1027 __del__ = lambda self : None;
e811c8ce 1028 def __eq__(*args, **kwargs):
0df68c9f 1029 """
e9d6f3a4 1030 __eq__(self, PyObject other) -> bool
e811c8ce 1031
0df68c9f
RD
1032 Test for equality of wx.Point objects.
1033 """
54f9ee45 1034 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
1035
1036 def __ne__(*args, **kwargs):
0df68c9f 1037 """
e9d6f3a4 1038 __ne__(self, PyObject other) -> bool
e811c8ce 1039
0df68c9f
RD
1040 Test for inequality of wx.Point objects.
1041 """
54f9ee45 1042 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
1043
1044 def __add__(*args, **kwargs):
0df68c9f 1045 """
a95a7133 1046 __add__(self, Point pt) -> Point
e811c8ce 1047
0df68c9f
RD
1048 Add pt's proprties to this and return the result.
1049 """
54f9ee45 1050 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
1051
1052 def __sub__(*args, **kwargs):
0df68c9f 1053 """
a95a7133 1054 __sub__(self, Point pt) -> Point
e811c8ce 1055
0df68c9f
RD
1056 Subtract pt's proprties from this and return the result
1057 """
54f9ee45 1058 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
1059
1060 def __iadd__(*args, **kwargs):
0df68c9f 1061 """
a95a7133 1062 __iadd__(self, Point pt) -> Point
e811c8ce 1063
0df68c9f
RD
1064 Add pt to this object.
1065 """
54f9ee45 1066 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
1067
1068 def __isub__(*args, **kwargs):
0df68c9f 1069 """
a95a7133 1070 __isub__(self, Point pt) -> Point
e811c8ce 1071
0df68c9f
RD
1072 Subtract pt from this object.
1073 """
54f9ee45 1074 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
1075
1076 def Set(*args, **kwargs):
0df68c9f 1077 """
a95a7133 1078 Set(self, long x, long y)
e811c8ce 1079
0df68c9f
RD
1080 Set both the x and y properties
1081 """
54f9ee45 1082 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
1083
1084 def Get(*args, **kwargs):
0df68c9f
RD
1085 """
1086 Get() -> (x,y)
e811c8ce 1087
0df68c9f
RD
1088 Return the x and y properties as a tuple.
1089 """
54f9ee45 1090 return _core_.Point_Get(*args, **kwargs)
e811c8ce 1091
41e2b43e 1092 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1093 def __str__(self): return str(self.Get())
1094 def __repr__(self): return 'wx.Point'+str(self.Get())
1095 def __len__(self): return len(self.Get())
1096 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1097 def __setitem__(self, index, val):
1098 if index == 0: self.x = val
1099 elif index == 1: self.y = val
1100 else: raise IndexError
e811c8ce 1101 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
1102 __safe_for_unpickling__ = True
1103 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28 1104
0085ce49
RD
1105Point_swigregister = _core_.Point_swigregister
1106Point_swigregister(Point)
d14a1e28
RD
1107
1108#---------------------------------------------------------------------------
1109
1110class Rect(object):
0df68c9f 1111 """
41e2b43e
RD
1112 A class for representing and manipulating rectangles. It has x, y,
1113 width and height properties. In wxPython most palces that expect a
1114 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1115 """
0085ce49
RD
1116 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1117 __repr__ = _swig_repr
1118 def __init__(self, *args, **kwargs):
0df68c9f 1119 """
a95a7133 1120 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1121
0df68c9f
RD
1122 Create a new Rect object.
1123 """
0085ce49
RD
1124 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1125 __swig_destroy__ = _core_.delete_Rect
1126 __del__ = lambda self : None;
e811c8ce 1127 def GetX(*args, **kwargs):
a95a7133 1128 """GetX(self) -> int"""
54f9ee45 1129 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1130
1131 def SetX(*args, **kwargs):
a95a7133 1132 """SetX(self, int x)"""
54f9ee45 1133 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1134
1135 def GetY(*args, **kwargs):
a95a7133 1136 """GetY(self) -> int"""
54f9ee45 1137 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1138
1139 def SetY(*args, **kwargs):
a95a7133 1140 """SetY(self, int y)"""
54f9ee45 1141 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1142
1143 def GetWidth(*args, **kwargs):
a95a7133 1144 """GetWidth(self) -> int"""
54f9ee45 1145 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1146
1147 def SetWidth(*args, **kwargs):
a95a7133 1148 """SetWidth(self, int w)"""
54f9ee45 1149 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1150
1151 def GetHeight(*args, **kwargs):
a95a7133 1152 """GetHeight(self) -> int"""
54f9ee45 1153 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1154
1155 def SetHeight(*args, **kwargs):
a95a7133 1156 """SetHeight(self, int h)"""
54f9ee45 1157 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1158
1159 def GetPosition(*args, **kwargs):
a95a7133 1160 """GetPosition(self) -> Point"""
54f9ee45 1161 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1162
1163 def SetPosition(*args, **kwargs):
a95a7133 1164 """SetPosition(self, Point p)"""
54f9ee45 1165 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1166
1167 def GetSize(*args, **kwargs):
a95a7133 1168 """GetSize(self) -> Size"""
54f9ee45 1169 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1170
1171 def SetSize(*args, **kwargs):
a95a7133 1172 """SetSize(self, Size s)"""
54f9ee45 1173 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1174
aff4cc5c
RD
1175 def IsEmpty(*args, **kwargs):
1176 """IsEmpty(self) -> bool"""
1177 return _core_.Rect_IsEmpty(*args, **kwargs)
1178
c9c7117a 1179 def GetTopLeft(*args, **kwargs):
a95a7133 1180 """GetTopLeft(self) -> Point"""
54f9ee45 1181 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1182
1183 def SetTopLeft(*args, **kwargs):
a95a7133 1184 """SetTopLeft(self, Point p)"""
54f9ee45 1185 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1186
1187 def GetBottomRight(*args, **kwargs):
a95a7133 1188 """GetBottomRight(self) -> Point"""
54f9ee45 1189 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1190
1191 def SetBottomRight(*args, **kwargs):
a95a7133 1192 """SetBottomRight(self, Point p)"""
54f9ee45 1193 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1194
e811c8ce 1195 def GetLeft(*args, **kwargs):
a95a7133 1196 """GetLeft(self) -> int"""
54f9ee45 1197 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1198
1199 def GetTop(*args, **kwargs):
a95a7133 1200 """GetTop(self) -> int"""
54f9ee45 1201 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1202
1203 def GetBottom(*args, **kwargs):
a95a7133 1204 """GetBottom(self) -> int"""
54f9ee45 1205 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1206
1207 def GetRight(*args, **kwargs):
a95a7133 1208 """GetRight(self) -> int"""
54f9ee45 1209 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1210
1211 def SetLeft(*args, **kwargs):
a95a7133 1212 """SetLeft(self, int left)"""
54f9ee45 1213 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1214
1215 def SetRight(*args, **kwargs):
a95a7133 1216 """SetRight(self, int right)"""
54f9ee45 1217 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1218
1219 def SetTop(*args, **kwargs):
a95a7133 1220 """SetTop(self, int top)"""
54f9ee45 1221 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1222
1223 def SetBottom(*args, **kwargs):
a95a7133 1224 """SetBottom(self, int bottom)"""
54f9ee45 1225 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1226
1227 position = property(GetPosition, SetPosition)
1228 size = property(GetSize, SetSize)
1229 left = property(GetLeft, SetLeft)
1230 right = property(GetRight, SetRight)
1231 top = property(GetTop, SetTop)
1232 bottom = property(GetBottom, SetBottom)
1233
1234 def Inflate(*args, **kwargs):
0df68c9f 1235 """
a95a7133 1236 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1237
8e738329
RD
1238 Increases the size of the rectangle.
1239
1240 The left border is moved farther left and the right border is moved
1241 farther right by ``dx``. The upper border is moved farther up and the
1242 bottom border is moved farther down by ``dy``. (Note the the width and
1243 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1244 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1245 opposite happens: the rectangle size decreases in the respective
1246 direction.
1247
1248 The change is made to the rectangle inplace, if instead you need a
1249 copy that is inflated, preserving the original then make the copy
1250 first::
1251
1252 copy = wx.Rect(*original)
1253 copy.Inflate(10,15)
1254
1255
0df68c9f 1256 """
54f9ee45 1257 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1258
1259 def Deflate(*args, **kwargs):
0df68c9f 1260 """
a95a7133 1261 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1262
8e738329
RD
1263 Decrease the rectangle size. This method is the opposite of `Inflate`
1264 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1265 `Inflate` for a full description.
0df68c9f 1266 """
54f9ee45 1267 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1268
1269 def OffsetXY(*args, **kwargs):
0df68c9f 1270 """
a95a7133 1271 OffsetXY(self, int dx, int dy)
e811c8ce 1272
41e2b43e
RD
1273 Moves the rectangle by the specified offset. If dx is positive, the
1274 rectangle is moved to the right, if dy is positive, it is moved to the
1275 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1276 """
54f9ee45 1277 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1278
1279 def Offset(*args, **kwargs):
0df68c9f 1280 """
a95a7133 1281 Offset(self, Point pt)
e811c8ce 1282
b1fcee84 1283 Same as `OffsetXY` but uses dx,dy from Point
0df68c9f 1284 """
54f9ee45 1285 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1286
1287 def Intersect(*args, **kwargs):
0df68c9f 1288 """
a95a7133 1289 Intersect(self, Rect rect) -> Rect
e811c8ce 1290
5cbf236d 1291 Returns the intersectsion of this rectangle and rect.
0df68c9f 1292 """
54f9ee45 1293 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce 1294
5cbf236d
RD
1295 def Union(*args, **kwargs):
1296 """
1297 Union(self, Rect rect) -> Rect
1298
1299 Returns the union of this rectangle and rect.
1300 """
1301 return _core_.Rect_Union(*args, **kwargs)
1302
e811c8ce 1303 def __add__(*args, **kwargs):
0df68c9f 1304 """
a95a7133 1305 __add__(self, Rect rect) -> Rect
e811c8ce 1306
0df68c9f
RD
1307 Add the properties of rect to this rectangle and return the result.
1308 """
54f9ee45 1309 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1310
1311 def __iadd__(*args, **kwargs):
0df68c9f 1312 """
a95a7133 1313 __iadd__(self, Rect rect) -> Rect
e811c8ce 1314
0df68c9f
RD
1315 Add the properties of rect to this rectangle, updating this rectangle.
1316 """
54f9ee45 1317 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1318
1319 def __eq__(*args, **kwargs):
0df68c9f 1320 """
e9d6f3a4 1321 __eq__(self, PyObject other) -> bool
e811c8ce 1322
e9d6f3a4 1323 Test for equality of wx.Rect objects.
0df68c9f 1324 """
54f9ee45 1325 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1326
1327 def __ne__(*args, **kwargs):
0df68c9f 1328 """
e9d6f3a4 1329 __ne__(self, PyObject other) -> bool
e811c8ce 1330
e9d6f3a4 1331 Test for inequality of wx.Rect objects.
0df68c9f 1332 """
54f9ee45 1333 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce
RD
1334
1335 def InsideXY(*args, **kwargs):
0df68c9f 1336 """
a95a7133 1337 InsideXY(self, int x, int y) -> bool
e811c8ce 1338
0df68c9f
RD
1339 Return True if the point is (not strcitly) inside the rect.
1340 """
54f9ee45 1341 return _core_.Rect_InsideXY(*args, **kwargs)
e811c8ce
RD
1342
1343 def Inside(*args, **kwargs):
0df68c9f 1344 """
a95a7133 1345 Inside(self, Point pt) -> bool
e811c8ce 1346
0df68c9f
RD
1347 Return True if the point is (not strcitly) inside the rect.
1348 """
54f9ee45 1349 return _core_.Rect_Inside(*args, **kwargs)
e811c8ce
RD
1350
1351 def Intersects(*args, **kwargs):
0df68c9f 1352 """
a95a7133 1353 Intersects(self, Rect rect) -> bool
e811c8ce 1354
0df68c9f
RD
1355 Returns True if the rectangles have a non empty intersection.
1356 """
54f9ee45 1357 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1358
b1fcee84
RD
1359 def CenterIn(*args, **kwargs):
1360 """
1361 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1362
1363 Center this rectangle within the one passed to the method, which is
1364 usually, but not necessarily, the larger one.
1365 """
1366 return _core_.Rect_CenterIn(*args, **kwargs)
1367
1368 CentreIn = CenterIn
54f9ee45
RD
1369 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1370 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1371 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1372 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1373 def Set(*args, **kwargs):
0df68c9f 1374 """
a95a7133 1375 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1376
0df68c9f
RD
1377 Set all rectangle properties.
1378 """
54f9ee45 1379 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1380
1381 def Get(*args, **kwargs):
0df68c9f
RD
1382 """
1383 Get() -> (x,y,width,height)
e811c8ce 1384
0df68c9f
RD
1385 Return the rectangle properties as a tuple.
1386 """
54f9ee45 1387 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1388
41e2b43e 1389 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1390 def __str__(self): return str(self.Get())
1391 def __repr__(self): return 'wx.Rect'+str(self.Get())
1392 def __len__(self): return len(self.Get())
1393 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1394 def __setitem__(self, index, val):
1395 if index == 0: self.x = val
1396 elif index == 1: self.y = val
1397 elif index == 2: self.width = val
1398 elif index == 3: self.height = val
1399 else: raise IndexError
e811c8ce 1400 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1401 __safe_for_unpickling__ = True
1402 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28 1403
0085ce49
RD
1404Rect_swigregister = _core_.Rect_swigregister
1405Rect_swigregister(Rect)
d14a1e28
RD
1406
1407def RectPP(*args, **kwargs):
0df68c9f
RD
1408 """
1409 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1410
0df68c9f
RD
1411 Create a new Rect object from Points representing two corners.
1412 """
54f9ee45 1413 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1414 return val
1415
1416def RectPS(*args, **kwargs):
0df68c9f
RD
1417 """
1418 RectPS(Point pos, Size size) -> Rect
e811c8ce 1419
0df68c9f
RD
1420 Create a new Rect from a position and size.
1421 """
54f9ee45 1422 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1423 return val
1424
d3b6e4ff
RD
1425def RectS(*args, **kwargs):
1426 """
1427 RectS(Size size) -> Rect
1428
1429 Create a new Rect from a size only.
1430 """
1431 val = _core_.new_RectS(*args, **kwargs)
d3b6e4ff
RD
1432 return val
1433
d14a1e28 1434
e811c8ce 1435def IntersectRect(*args, **kwargs):
0085ce49 1436 """
0df68c9f 1437 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1438
0df68c9f
RD
1439 Calculate and return the intersection of r1 and r2.
1440 """
0085ce49 1441 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1442#---------------------------------------------------------------------------
1443
1444class Point2D(object):
41e2b43e
RD
1445 """
1446 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1447 with floating point values.
1448 """
0085ce49
RD
1449 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1450 __repr__ = _swig_repr
1451 def __init__(self, *args, **kwargs):
0df68c9f 1452 """
a95a7133 1453 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1454
0df68c9f
RD
1455 Create a w.Point2D object.
1456 """
0085ce49 1457 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
e811c8ce 1458 def GetFloor(*args, **kwargs):
fd2dc343
RD
1459 """
1460 GetFloor() -> (x,y)
1461
1462 Convert to integer
1463 """
54f9ee45 1464 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1465
1466 def GetRounded(*args, **kwargs):
fd2dc343
RD
1467 """
1468 GetRounded() -> (x,y)
1469
1470 Convert to integer
1471 """
54f9ee45 1472 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1473
1474 def GetVectorLength(*args, **kwargs):
a95a7133 1475 """GetVectorLength(self) -> double"""
54f9ee45 1476 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1477
1478 def GetVectorAngle(*args, **kwargs):
a95a7133 1479 """GetVectorAngle(self) -> double"""
54f9ee45 1480 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1481
1482 def SetVectorLength(*args, **kwargs):
a95a7133 1483 """SetVectorLength(self, double length)"""
54f9ee45 1484 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1485
1486 def SetVectorAngle(*args, **kwargs):
a95a7133 1487 """SetVectorAngle(self, double degrees)"""
54f9ee45 1488 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1489
d14a1e28
RD
1490 def SetPolarCoordinates(self, angle, length):
1491 self.SetVectorLength(length)
1492 self.SetVectorAngle(angle)
1493 def Normalize(self):
1494 self.SetVectorLength(1.0)
1495
e811c8ce 1496 def GetDistance(*args, **kwargs):
a95a7133 1497 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1498 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1499
1500 def GetDistanceSquare(*args, **kwargs):
a95a7133 1501 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1502 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1503
1504 def GetDotProduct(*args, **kwargs):
a95a7133 1505 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1506 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1507
1508 def GetCrossProduct(*args, **kwargs):
a95a7133 1509 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1510 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1511
1512 def __neg__(*args, **kwargs):
0df68c9f 1513 """
a95a7133 1514 __neg__(self) -> Point2D
e811c8ce 1515
0df68c9f
RD
1516 the reflection of this point
1517 """
54f9ee45 1518 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1519
1520 def __iadd__(*args, **kwargs):
a95a7133 1521 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1522 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1523
1524 def __isub__(*args, **kwargs):
a95a7133 1525 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1526 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1527
1528 def __imul__(*args, **kwargs):
a95a7133 1529 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1530 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1531
1532 def __idiv__(*args, **kwargs):
a95a7133 1533 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1534 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1535
1536 def __eq__(*args, **kwargs):
0df68c9f 1537 """
e9d6f3a4 1538 __eq__(self, PyObject other) -> bool
e811c8ce 1539
e9d6f3a4 1540 Test for equality of wx.Point2D objects.
0df68c9f 1541 """
54f9ee45 1542 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1543
1544 def __ne__(*args, **kwargs):
0df68c9f 1545 """
e9d6f3a4 1546 __ne__(self, PyObject other) -> bool
e811c8ce 1547
e9d6f3a4 1548 Test for inequality of wx.Point2D objects.
0df68c9f 1549 """
54f9ee45 1550 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1551
54f9ee45
RD
1552 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1553 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1554 def Set(*args, **kwargs):
a95a7133 1555 """Set(self, double x=0, double y=0)"""
54f9ee45 1556 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1557
1558 def Get(*args, **kwargs):
0df68c9f
RD
1559 """
1560 Get() -> (x,y)
e811c8ce 1561
0df68c9f
RD
1562 Return x and y properties as a tuple.
1563 """
54f9ee45 1564 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1565
41e2b43e 1566 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1567 def __str__(self): return str(self.Get())
1568 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1569 def __len__(self): return len(self.Get())
1570 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1571 def __setitem__(self, index, val):
e811c8ce
RD
1572 if index == 0: self.x = val
1573 elif index == 1: self.y = val
d14a1e28 1574 else: raise IndexError
e811c8ce 1575 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1576 __safe_for_unpickling__ = True
1577 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28 1578
0085ce49
RD
1579Point2D_swigregister = _core_.Point2D_swigregister
1580Point2D_swigregister(Point2D)
d14a1e28
RD
1581
1582def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1583 """
1584 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1585
0df68c9f
RD
1586 Create a w.Point2D object.
1587 """
54f9ee45 1588 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1589 return val
1590
1591def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1592 """
1593 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1594
0df68c9f
RD
1595 Create a w.Point2D object.
1596 """
54f9ee45 1597 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1598 return val
1599
1600#---------------------------------------------------------------------------
1601
54f9ee45
RD
1602FromStart = _core_.FromStart
1603FromCurrent = _core_.FromCurrent
1604FromEnd = _core_.FromEnd
d14a1e28 1605class InputStream(object):
093d3ff1 1606 """Proxy of C++ InputStream class"""
0085ce49
RD
1607 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1608 __repr__ = _swig_repr
1609 def __init__(self, *args, **kwargs):
a95a7133 1610 """__init__(self, PyObject p) -> InputStream"""
0085ce49
RD
1611 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1612 __swig_destroy__ = _core_.delete_InputStream
1613 __del__ = lambda self : None;
e811c8ce 1614 def close(*args, **kwargs):
a95a7133 1615 """close(self)"""
54f9ee45 1616 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1617
1618 def flush(*args, **kwargs):
a95a7133 1619 """flush(self)"""
54f9ee45 1620 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1621
1622 def eof(*args, **kwargs):
a95a7133 1623 """eof(self) -> bool"""
54f9ee45 1624 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1625
1626 def read(*args, **kwargs):
a95a7133 1627 """read(self, int size=-1) -> PyObject"""
54f9ee45 1628 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1629
1630 def readline(*args, **kwargs):
a95a7133 1631 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1632 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1633
1634 def readlines(*args, **kwargs):
a95a7133 1635 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1636 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1637
1638 def seek(*args, **kwargs):
a95a7133 1639 """seek(self, int offset, int whence=0)"""
54f9ee45 1640 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1641
1642 def tell(*args, **kwargs):
a95a7133 1643 """tell(self) -> int"""
54f9ee45 1644 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1645
1646 def Peek(*args, **kwargs):
a95a7133 1647 """Peek(self) -> char"""
54f9ee45 1648 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1649
1650 def GetC(*args, **kwargs):
a95a7133 1651 """GetC(self) -> char"""
54f9ee45 1652 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1653
1654 def LastRead(*args, **kwargs):
a95a7133 1655 """LastRead(self) -> size_t"""
54f9ee45 1656 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1657
1658 def CanRead(*args, **kwargs):
a95a7133 1659 """CanRead(self) -> bool"""
54f9ee45 1660 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1661
1662 def Eof(*args, **kwargs):
a95a7133 1663 """Eof(self) -> bool"""
54f9ee45 1664 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1665
1666 def Ungetch(*args, **kwargs):
a95a7133 1667 """Ungetch(self, char c) -> bool"""
54f9ee45 1668 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1669
1670 def SeekI(*args, **kwargs):
a95a7133 1671 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1672 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1673
1674 def TellI(*args, **kwargs):
a95a7133 1675 """TellI(self) -> long"""
54f9ee45 1676 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1677
0085ce49
RD
1678InputStream_swigregister = _core_.InputStream_swigregister
1679InputStream_swigregister(InputStream)
d14a1e28
RD
1680DefaultPosition = cvar.DefaultPosition
1681DefaultSize = cvar.DefaultSize
1682
1683class OutputStream(object):
093d3ff1 1684 """Proxy of C++ OutputStream class"""
0085ce49
RD
1685 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1686 def __init__(self): raise AttributeError, "No constructor defined"
1687 __repr__ = _swig_repr
e811c8ce 1688 def write(*args, **kwargs):
a95a7133 1689 """write(self, PyObject obj)"""
54f9ee45 1690 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 1691
0085ce49
RD
1692 def LastWrite(*args, **kwargs):
1693 """LastWrite(self) -> size_t"""
1694 return _core_.OutputStream_LastWrite(*args, **kwargs)
d14a1e28 1695
0085ce49
RD
1696OutputStream_swigregister = _core_.OutputStream_swigregister
1697OutputStream_swigregister(OutputStream)
d14a1e28
RD
1698
1699#---------------------------------------------------------------------------
1700
1701class FSFile(Object):
093d3ff1 1702 """Proxy of C++ FSFile class"""
0085ce49
RD
1703 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1704 __repr__ = _swig_repr
1705 def __init__(self, *args, **kwargs):
0df68c9f 1706 """
a95a7133 1707 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 1708 DateTime modif) -> FSFile
0df68c9f 1709 """
0085ce49 1710 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
e2950dbb 1711 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1712
0085ce49
RD
1713 __swig_destroy__ = _core_.delete_FSFile
1714 __del__ = lambda self : None;
e811c8ce 1715 def GetStream(*args, **kwargs):
a95a7133 1716 """GetStream(self) -> InputStream"""
54f9ee45 1717 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce
RD
1718
1719 def GetMimeType(*args, **kwargs):
a95a7133 1720 """GetMimeType(self) -> String"""
54f9ee45 1721 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
1722
1723 def GetLocation(*args, **kwargs):
a95a7133 1724 """GetLocation(self) -> String"""
54f9ee45 1725 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
1726
1727 def GetAnchor(*args, **kwargs):
a95a7133 1728 """GetAnchor(self) -> String"""
54f9ee45 1729 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
1730
1731 def GetModificationTime(*args, **kwargs):
a95a7133 1732 """GetModificationTime(self) -> DateTime"""
54f9ee45 1733 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 1734
0085ce49
RD
1735FSFile_swigregister = _core_.FSFile_swigregister
1736FSFile_swigregister(FSFile)
d14a1e28
RD
1737
1738class CPPFileSystemHandler(object):
093d3ff1 1739 """Proxy of C++ CPPFileSystemHandler class"""
0085ce49
RD
1740 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1741 def __init__(self): raise AttributeError, "No constructor defined"
1742 __repr__ = _swig_repr
50f151d7
RD
1743 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1744 __del__ = lambda self : None;
0085ce49
RD
1745CPPFileSystemHandler_swigregister = _core_.CPPFileSystemHandler_swigregister
1746CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d14a1e28
RD
1747
1748class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1749 """Proxy of C++ FileSystemHandler class"""
0085ce49
RD
1750 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1751 __repr__ = _swig_repr
1752 def __init__(self, *args, **kwargs):
a95a7133 1753 """__init__(self) -> FileSystemHandler"""
0085ce49 1754 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d14a1e28 1755 self._setCallbackInfo(self, FileSystemHandler)
e811c8ce
RD
1756
1757 def _setCallbackInfo(*args, **kwargs):
a95a7133 1758 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 1759 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
1760
1761 def CanOpen(*args, **kwargs):
a95a7133 1762 """CanOpen(self, String location) -> bool"""
54f9ee45 1763 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1764
1765 def OpenFile(*args, **kwargs):
a95a7133 1766 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1767 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1768
1769 def FindFirst(*args, **kwargs):
a95a7133 1770 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1771 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1772
1773 def FindNext(*args, **kwargs):
a95a7133 1774 """FindNext(self) -> String"""
54f9ee45 1775 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
1776
1777 def GetProtocol(*args, **kwargs):
a95a7133 1778 """GetProtocol(self, String location) -> String"""
54f9ee45 1779 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
1780
1781 def GetLeftLocation(*args, **kwargs):
a95a7133 1782 """GetLeftLocation(self, String location) -> String"""
54f9ee45 1783 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
1784
1785 def GetAnchor(*args, **kwargs):
a95a7133 1786 """GetAnchor(self, String location) -> String"""
54f9ee45 1787 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
1788
1789 def GetRightLocation(*args, **kwargs):
a95a7133 1790 """GetRightLocation(self, String location) -> String"""
54f9ee45 1791 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
1792
1793 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 1794 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 1795 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 1796
0085ce49
RD
1797FileSystemHandler_swigregister = _core_.FileSystemHandler_swigregister
1798FileSystemHandler_swigregister(FileSystemHandler)
d14a1e28
RD
1799
1800class FileSystem(Object):
093d3ff1 1801 """Proxy of C++ FileSystem class"""
0085ce49
RD
1802 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1803 __repr__ = _swig_repr
1804 def __init__(self, *args, **kwargs):
a95a7133 1805 """__init__(self) -> FileSystem"""
0085ce49
RD
1806 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1807 __swig_destroy__ = _core_.delete_FileSystem
1808 __del__ = lambda self : None;
e811c8ce 1809 def ChangePathTo(*args, **kwargs):
a95a7133 1810 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 1811 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
1812
1813 def GetPath(*args, **kwargs):
a95a7133 1814 """GetPath(self) -> String"""
54f9ee45 1815 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
1816
1817 def OpenFile(*args, **kwargs):
a95a7133 1818 """OpenFile(self, String location) -> FSFile"""
54f9ee45 1819 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
1820
1821 def FindFirst(*args, **kwargs):
a95a7133 1822 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1823 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
1824
1825 def FindNext(*args, **kwargs):
a95a7133 1826 """FindNext(self) -> String"""
54f9ee45 1827 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
1828
1829 def AddHandler(*args, **kwargs):
66c033b4 1830 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1831 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
1832
1833 AddHandler = staticmethod(AddHandler)
1834 def CleanUpHandlers(*args, **kwargs):
66c033b4 1835 """CleanUpHandlers()"""
54f9ee45 1836 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
1837
1838 CleanUpHandlers = staticmethod(CleanUpHandlers)
1839 def FileNameToURL(*args, **kwargs):
66c033b4 1840 """FileNameToURL(String filename) -> String"""
54f9ee45 1841 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
1842
1843 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
1844 def URLToFileName(*args, **kwargs):
1845 """URLToFileName(String url) -> String"""
1846 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1847
1848 URLToFileName = staticmethod(URLToFileName)
0085ce49
RD
1849FileSystem_swigregister = _core_.FileSystem_swigregister
1850FileSystem_swigregister(FileSystem)
d14a1e28 1851
e811c8ce 1852def FileSystem_AddHandler(*args, **kwargs):
0085ce49
RD
1853 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1854 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 1855
0085ce49
RD
1856def FileSystem_CleanUpHandlers(*args):
1857 """FileSystem_CleanUpHandlers()"""
1858 return _core_.FileSystem_CleanUpHandlers(*args)
d14a1e28 1859
e811c8ce 1860def FileSystem_FileNameToURL(*args, **kwargs):
0085ce49
RD
1861 """FileSystem_FileNameToURL(String filename) -> String"""
1862 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 1863
e811c8ce 1864def FileSystem_URLToFileName(*args, **kwargs):
0085ce49
RD
1865 """FileSystem_URLToFileName(String url) -> String"""
1866 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 1867
d14a1e28 1868class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1869 """Proxy of C++ InternetFSHandler class"""
0085ce49
RD
1870 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1871 __repr__ = _swig_repr
1872 def __init__(self, *args, **kwargs):
a95a7133 1873 """__init__(self) -> InternetFSHandler"""
0085ce49 1874 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
e811c8ce 1875 def CanOpen(*args, **kwargs):
a95a7133 1876 """CanOpen(self, String location) -> bool"""
54f9ee45 1877 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1878
1879 def OpenFile(*args, **kwargs):
a95a7133 1880 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1881 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 1882
0085ce49
RD
1883InternetFSHandler_swigregister = _core_.InternetFSHandler_swigregister
1884InternetFSHandler_swigregister(InternetFSHandler)
d14a1e28
RD
1885
1886class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1887 """Proxy of C++ ZipFSHandler class"""
0085ce49
RD
1888 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1889 __repr__ = _swig_repr
1890 def __init__(self, *args, **kwargs):
a95a7133 1891 """__init__(self) -> ZipFSHandler"""
0085ce49 1892 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
e811c8ce 1893 def CanOpen(*args, **kwargs):
a95a7133 1894 """CanOpen(self, String location) -> bool"""
54f9ee45 1895 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1896
1897 def OpenFile(*args, **kwargs):
a95a7133 1898 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1899 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1900
1901 def FindFirst(*args, **kwargs):
a95a7133 1902 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1903 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1904
1905 def FindNext(*args, **kwargs):
a95a7133 1906 """FindNext(self) -> String"""
54f9ee45 1907 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 1908
0085ce49
RD
1909ZipFSHandler_swigregister = _core_.ZipFSHandler_swigregister
1910ZipFSHandler_swigregister(ZipFSHandler)
d14a1e28
RD
1911
1912
e811c8ce 1913def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
0085ce49
RD
1914 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1915 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 1916
e811c8ce 1917def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
0085ce49
RD
1918 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1919 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 1920
e811c8ce 1921def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
0085ce49
RD
1922 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1923 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
1924def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1925 """
1926 Add 'file' to the memory filesystem. The dataItem parameter can
1927 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1928 arbitrary data. If a bitmap or image is used then the imgType
1929 parameter should specify what kind of image file it should be
1930 written as, wx.BITMAP_TYPE_PNG, etc.
1931 """
1932 if isinstance(dataItem, wx.Image):
1933 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1934 elif isinstance(dataItem, wx.Bitmap):
1935 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1936 elif type(dataItem) == str:
1937 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1938 else:
1939 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
1940
1941class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 1942 """Proxy of C++ MemoryFSHandler class"""
0085ce49
RD
1943 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1944 __repr__ = _swig_repr
1945 def __init__(self, *args, **kwargs):
a95a7133 1946 """__init__(self) -> MemoryFSHandler"""
0085ce49 1947 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
e811c8ce 1948 def RemoveFile(*args, **kwargs):
66c033b4 1949 """RemoveFile(String filename)"""
54f9ee45 1950 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
1951
1952 RemoveFile = staticmethod(RemoveFile)
d14a1e28 1953 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 1954 def CanOpen(*args, **kwargs):
a95a7133 1955 """CanOpen(self, String location) -> bool"""
54f9ee45 1956 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1957
1958 def OpenFile(*args, **kwargs):
a95a7133 1959 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1960 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1961
1962 def FindFirst(*args, **kwargs):
a95a7133 1963 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1964 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1965
1966 def FindNext(*args, **kwargs):
a95a7133 1967 """FindNext(self) -> String"""
54f9ee45 1968 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 1969
0085ce49
RD
1970MemoryFSHandler_swigregister = _core_.MemoryFSHandler_swigregister
1971MemoryFSHandler_swigregister(MemoryFSHandler)
d14a1e28 1972
e811c8ce 1973def MemoryFSHandler_RemoveFile(*args, **kwargs):
0085ce49
RD
1974 """MemoryFSHandler_RemoveFile(String filename)"""
1975 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28 1976
bcd0d7b6
RD
1977IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1978IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1979IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d14a1e28
RD
1980#---------------------------------------------------------------------------
1981
1982class ImageHandler(Object):
27fb7603
RD
1983 """
1984 This is the base class for implementing image file loading/saving, and
1985 image creation from data. It is used within `wx.Image` and is not
1986 normally seen by the application.
1987 """
0085ce49
RD
1988 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1989 def __init__(self): raise AttributeError, "No constructor defined"
1990 __repr__ = _swig_repr
e811c8ce 1991 def GetName(*args, **kwargs):
a95a7133 1992 """GetName(self) -> String"""
54f9ee45 1993 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
1994
1995 def GetExtension(*args, **kwargs):
a95a7133 1996 """GetExtension(self) -> String"""
54f9ee45 1997 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
1998
1999 def GetType(*args, **kwargs):
a95a7133 2000 """GetType(self) -> long"""
54f9ee45 2001 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
2002
2003 def GetMimeType(*args, **kwargs):
a95a7133 2004 """GetMimeType(self) -> String"""
54f9ee45 2005 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
2006
2007 def CanRead(*args, **kwargs):
a95a7133 2008 """CanRead(self, String name) -> bool"""
54f9ee45 2009 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce
RD
2010
2011 def SetName(*args, **kwargs):
a95a7133 2012 """SetName(self, String name)"""
54f9ee45 2013 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
2014
2015 def SetExtension(*args, **kwargs):
a95a7133 2016 """SetExtension(self, String extension)"""
54f9ee45 2017 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
2018
2019 def SetType(*args, **kwargs):
a95a7133 2020 """SetType(self, long type)"""
54f9ee45 2021 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
2022
2023 def SetMimeType(*args, **kwargs):
a95a7133 2024 """SetMimeType(self, String mimetype)"""
54f9ee45 2025 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 2026
0085ce49
RD
2027ImageHandler_swigregister = _core_.ImageHandler_swigregister
2028ImageHandler_swigregister(ImageHandler)
d14a1e28 2029
943e8dfd
RD
2030class PyImageHandler(ImageHandler):
2031 """
2032 This is the base class for implementing image file loading/saving, and
2033 image creation from data, all written in Python. To create a custom
2034 image handler derive a new class from wx.PyImageHandler and provide
2035 the following methods::
2036
2037 def DoCanRead(self, stream) --> bool
2038 '''Check if this handler can read the image on the stream'''
2039
2040 def LoadFile(self, image, stream, verbose, index) --> bool
2041 '''Load image data from the stream and load it into image.'''
2042
2043 def SaveFile(self, image, stream, verbose) --> bool
2044 '''Save the iamge data in image to the stream using
2045 this handler's image file format.'''
2046
2047 def GetImageCount(self, stream) --> int
2048 '''If this image format can hold more than one image,
2049 how many does the image on the stream have?'''
2050
2051 To activate your handler create an instance of it and pass it to
2052 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2053 `SetExtension` from your constructor.
2054
2055 """
0085ce49
RD
2056 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2057 __repr__ = _swig_repr
2058 def __init__(self, *args, **kwargs):
943e8dfd
RD
2059 """
2060 __init__(self) -> PyImageHandler
2061
2062 This is the base class for implementing image file loading/saving, and
2063 image creation from data, all written in Python. To create a custom
2064 image handler derive a new class from wx.PyImageHandler and provide
2065 the following methods::
2066
2067 def DoCanRead(self, stream) --> bool
2068 '''Check if this handler can read the image on the stream'''
2069
2070 def LoadFile(self, image, stream, verbose, index) --> bool
2071 '''Load image data from the stream and load it into image.'''
2072
2073 def SaveFile(self, image, stream, verbose) --> bool
2074 '''Save the iamge data in image to the stream using
2075 this handler's image file format.'''
2076
2077 def GetImageCount(self, stream) --> int
2078 '''If this image format can hold more than one image,
2079 how many does the image on the stream have?'''
2080
2081 To activate your handler create an instance of it and pass it to
2082 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2083 `SetExtension` from your constructor.
2084
2085 """
0085ce49 2086 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2087 self._SetSelf(self)
2088
2089 def _SetSelf(*args, **kwargs):
2090 """_SetSelf(self, PyObject self)"""
2091 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2092
0085ce49
RD
2093PyImageHandler_swigregister = _core_.PyImageHandler_swigregister
2094PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2095
d14a1e28 2096class ImageHistogram(object):
093d3ff1 2097 """Proxy of C++ ImageHistogram class"""
0085ce49
RD
2098 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2099 __repr__ = _swig_repr
2100 def __init__(self, *args, **kwargs):
a95a7133 2101 """__init__(self) -> ImageHistogram"""
0085ce49 2102 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
e811c8ce 2103 def MakeKey(*args, **kwargs):
0df68c9f 2104 """
7a27cf7c 2105 MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2106
0df68c9f
RD
2107 Get the key in the histogram for the given RGB values
2108 """
54f9ee45 2109 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2110
2111 MakeKey = staticmethod(MakeKey)
2112 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2113 """
2114 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2115
2116 Find first colour that is not used in the image and has higher RGB
2117 values than startR, startG, startB. Returns a tuple consisting of a
2118 success flag and rgb values.
2119 """
54f9ee45 2120 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2121
f1cbd8fa
RD
2122 def GetCount(*args, **kwargs):
2123 """
2124 GetCount(self, unsigned long key) -> unsigned long
2125
2126 Returns the pixel count for the given key. Use `MakeKey` to create a
2127 key value from a RGB tripple.
2128 """
2129 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2130
2131 def GetCountRGB(*args, **kwargs):
2132 """
7a27cf7c 2133 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2134
2135 Returns the pixel count for the given RGB values.
2136 """
2137 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2138
2139 def GetCountColour(*args, **kwargs):
2140 """
2141 GetCountColour(self, Colour colour) -> unsigned long
2142
2143 Returns the pixel count for the given `wx.Colour` value.
2144 """
2145 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2146
0085ce49
RD
2147ImageHistogram_swigregister = _core_.ImageHistogram_swigregister
2148ImageHistogram_swigregister(ImageHistogram)
d14a1e28 2149
e811c8ce 2150def ImageHistogram_MakeKey(*args, **kwargs):
0085ce49 2151 """
7a27cf7c 2152 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2153
0df68c9f
RD
2154 Get the key in the histogram for the given RGB values
2155 """
0085ce49 2156 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28 2157
943e8dfd
RD
2158class Image_RGBValue(object):
2159 """
2160 An object that contains values for red, green and blue which represent
2161 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2162 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2163 color space.
2164 """
0085ce49
RD
2165 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2166 __repr__ = _swig_repr
2167 def __init__(self, *args, **kwargs):
943e8dfd
RD
2168 """
2169 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2170
2171 Constructor.
2172 """
0085ce49 2173 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2174 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2175 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2176 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
0085ce49
RD
2177Image_RGBValue_swigregister = _core_.Image_RGBValue_swigregister
2178Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2179
2180class Image_HSVValue(object):
2181 """
2182 An object that contains values for hue, saturation and value which
2183 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2184 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2185 color space.
2186 """
0085ce49
RD
2187 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2188 __repr__ = _swig_repr
2189 def __init__(self, *args, **kwargs):
943e8dfd
RD
2190 """
2191 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2192
2193 Constructor.
2194 """
0085ce49 2195 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2196 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2197 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2198 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
0085ce49
RD
2199Image_HSVValue_swigregister = _core_.Image_HSVValue_swigregister
2200Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2201
d14a1e28 2202class Image(Object):
7a27cf7c
RD
2203 """
2204 A platform-independent image class. An image can be created from
2205 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2206 variety of formats. Functions are available to set and get image
2207 bits, so it can be used for basic image manipulation.
2208
2209 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2210 platform-specific `wx.Bitmap` object must be created from it using the
2211 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2212 device context, using `wx.DC.DrawBitmap`.
2213
2214 One colour value of the image may be used as a mask colour which will
2215 lead to the automatic creation of a `wx.Mask` object associated to the
2216 bitmap object.
2217
2218 wx.Image supports alpha channel data, that is in addition to a byte
2219 for the red, green and blue colour components for each pixel it also
2220 stores a byte representing the pixel opacity. An alpha value of 0
2221 corresponds to a transparent pixel (null opacity) while a value of 255
2222 means that the pixel is 100% opaque.
2223
2224 Unlike RGB data, not all images have an alpha channel and before using
2225 `GetAlpha` you should check if this image contains an alpha channel
2226 with `HasAlpha`. Note that currently only images loaded from PNG files
2227 with transparency information will have an alpha channel.
2228 """
0085ce49
RD
2229 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2230 __repr__ = _swig_repr
2231 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2232 """
2233 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2234
2235 Loads an image from a file.
2236 """
0085ce49
RD
2237 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2238 __swig_destroy__ = _core_.delete_Image
2239 __del__ = lambda self : None;
e811c8ce 2240 def Create(*args, **kwargs):
7a27cf7c
RD
2241 """
2242 Create(self, int width, int height, bool clear=True)
2243
2244 Creates a fresh image. If clear is ``True``, the new image will be
2245 initialized to black. Otherwise, the image data will be uninitialized.
2246 """
54f9ee45 2247 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2248
2249 def Destroy(*args, **kwargs):
0df68c9f 2250 """
a95a7133 2251 Destroy(self)
e811c8ce 2252
7a27cf7c 2253 Destroys the image data.
0df68c9f 2254 """
7e08d4ef
RD
2255 val = _core_.Image_Destroy(*args, **kwargs)
2256 args[0].thisown = 0
2257 return val
e811c8ce
RD
2258
2259 def Scale(*args, **kwargs):
7a27cf7c
RD
2260 """
2261 Scale(self, int width, int height) -> Image
2262
2263 Returns a scaled version of the image. This is also useful for scaling
2264 bitmaps in general as the only other way to scale bitmaps is to blit a
2265 `wx.MemoryDC` into another `wx.MemoryDC`.
2266 """
54f9ee45 2267 return _core_.Image_Scale(*args, **kwargs)
e811c8ce
RD
2268
2269 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2270 """
2271 ShrinkBy(self, int xFactor, int yFactor) -> Image
2272
2273 Return a version of the image scaled smaller by the given factors.
2274 """
54f9ee45 2275 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2276
2277 def Rescale(*args, **kwargs):
7a27cf7c
RD
2278 """
2279 Rescale(self, int width, int height) -> Image
2280
2281 Changes the size of the image in-place by scaling it: after a call to
2282 this function, the image will have the given width and height.
2283
2284 Returns the (modified) image itself.
2285 """
54f9ee45 2286 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce 2287
aff4cc5c 2288 def Resize(*args, **kwargs):
7a27cf7c
RD
2289 """
2290 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2291
2292 Changes the size of the image in-place without scaling it, by adding
2293 either a border with the given colour or cropping as necessary. The
2294 image is pasted into a new image with the given size and background
2295 colour at the position pos relative to the upper left of the new
2296 image. If red = green = blue = -1 then use either the current mask
2297 colour if set or find, use, and set a suitable mask colour for any
2298 newly exposed areas.
2299
2300 Returns the (modified) image itself.
2301 """
aff4cc5c
RD
2302 return _core_.Image_Resize(*args, **kwargs)
2303
e811c8ce 2304 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2305 """
2306 SetRGB(self, int x, int y, byte r, byte g, byte b)
2307
2308 Sets the pixel at the given coordinate. This routine performs
2309 bounds-checks for the coordinate so it can be considered a safe way to
2310 manipulate the data, but in some cases this might be too slow so that
2311 the data will have to be set directly. In that case you will have to
2312 get access to the image data using the `GetData` method.
2313 """
54f9ee45 2314 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce 2315
aff4cc5c 2316 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2317 """
2318 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2319
2320 Sets the colour of the pixels within the given rectangle. This routine
2321 performs bounds-checks for the rectangle so it can be considered a
2322 safe way to manipulate the data.
2323 """
aff4cc5c
RD
2324 return _core_.Image_SetRGBRect(*args, **kwargs)
2325
e811c8ce 2326 def GetRed(*args, **kwargs):
7a27cf7c
RD
2327 """
2328 GetRed(self, int x, int y) -> byte
2329
2330 Returns the red intensity at the given coordinate.
2331 """
54f9ee45 2332 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2333
2334 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2335 """
2336 GetGreen(self, int x, int y) -> byte
2337
2338 Returns the green intensity at the given coordinate.
2339 """
54f9ee45 2340 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2341
2342 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2343 """
2344 GetBlue(self, int x, int y) -> byte
2345
2346 Returns the blue intensity at the given coordinate.
2347 """
54f9ee45 2348 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2349
2350 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2351 """
2352 SetAlpha(self, int x, int y, byte alpha)
2353
2354 Sets the alpha value for the given pixel. This function should only be
2355 called if the image has alpha channel data, use `HasAlpha` to check
2356 for this.
2357 """
54f9ee45 2358 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2359
2360 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2361 """
2362 GetAlpha(self, int x, int y) -> byte
2363
2364 Returns the alpha value for the given pixel. This function may only be
2365 called for the images with alpha channel, use `HasAlpha` to check for
2366 this.
2367
2368 The returned value is the *opacity* of the image, i.e. the value of 0
2369 corresponds to the fully transparent pixels while the value of 255 to
2370 the fully opaque pixels.
2371 """
54f9ee45 2372 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2373
2374 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2375 """
2376 HasAlpha(self) -> bool
2377
2378 Returns true if this image has alpha channel, false otherwise.
2379 """
54f9ee45 2380 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce 2381
68350608
RD
2382 def InitAlpha(*args, **kwargs):
2383 """
2384 InitAlpha(self)
2385
2386 Initializes the image alpha channel data. It is an error to call it if
2387 the image already has alpha data. If it doesn't, alpha data will be by
2388 default initialized to all pixels being fully opaque. But if the image
2389 has a a mask colour, all mask pixels will be completely transparent.
2390 """
2391 return _core_.Image_InitAlpha(*args, **kwargs)
2392
bcd0d7b6
RD
2393 def IsTransparent(*args, **kwargs):
2394 """
7a27cf7c 2395 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
bcd0d7b6 2396
7a27cf7c
RD
2397 Returns ``True`` if this pixel is masked or has an alpha value less
2398 than the spcified threshold.
bcd0d7b6
RD
2399 """
2400 return _core_.Image_IsTransparent(*args, **kwargs)
2401
e811c8ce 2402 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2403 """
2404 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2405
2406 Find first colour that is not used in the image and has higher RGB
2407 values than startR, startG, startB. Returns a tuple consisting of a
2408 success flag and rgb values.
2409 """
54f9ee45 2410 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2411
4cf4100f
RD
2412 def ConvertAlphaToMask(*args, **kwargs):
2413 """
bcd0d7b6 2414 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2415
7a27cf7c
RD
2416 If the image has alpha channel, this method converts it to mask. All
2417 pixels with alpha value less than ``threshold`` are replaced with the
2418 mask colour and the alpha channel is removed. The mask colour is
2419 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2420
2421 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2422 nothing.
2423 """
2424 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2425
8fb0e70a
RD
2426 def ConvertColourToAlpha(*args, **kwargs):
2427 """
7a27cf7c 2428 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2429
2430 This method converts an image where the original alpha information is
2431 only available as a shades of a colour (actually shades of grey)
2432 typically when you draw anti-aliased text into a bitmap. The DC
2433 drawing routines draw grey values on the black background although
2434 they actually mean to draw white with differnt alpha values. This
2435 method reverses it, assuming a black (!) background and white text.
2436 The method will then fill up the whole image with the colour given.
2437 """
2438 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2439
e811c8ce 2440 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2441 """
2442 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2443
2444 Sets the image's mask so that the pixels that have RGB value of
2445 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2446 by first finding an unused colour in the image, setting this colour as
2447 the mask colour and then using this colour to draw all pixels in the
2448 image who corresponding pixel in mask has given RGB value.
2449
2450 Returns ``False`` if ``mask`` does not have same dimensions as the
2451 image or if there is no unused colour left. Returns ``True`` if the
2452 mask was successfully applied.
2453
2454 Note that this method involves computing the histogram, which is
2455 computationally intensive operation.
2456 """
54f9ee45 2457 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2458
2459 def CanRead(*args, **kwargs):
7a27cf7c
RD
2460 """
2461 CanRead(String filename) -> bool
2462
2463 Returns True if the image handlers can read this file.
2464 """
54f9ee45 2465 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2466
2467 CanRead = staticmethod(CanRead)
2468 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2469 """
2470 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2471
2472 If the image file contains more than one image and the image handler
2473 is capable of retrieving these individually, this function will return
2474 the number of available images.
2475 """
54f9ee45 2476 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2477
2478 GetImageCount = staticmethod(GetImageCount)
2479 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2480 """
2481 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2482
2483 Loads an image from a file. If no handler type is provided, the
2484 library will try to autodetect the format.
2485 """
54f9ee45 2486 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2487
2488 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2489 """
2490 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2491
2492 Loads an image from a file, specifying the image type with a MIME type
2493 string.
2494 """
54f9ee45 2495 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2496
2497 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2498 """
2499 SaveFile(self, String name, int type) -> bool
2500
2501 Saves an image in the named file.
2502 """
54f9ee45 2503 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2504
2505 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2506 """
2507 SaveMimeFile(self, String name, String mimetype) -> bool
2508
2509 Saves an image in the named file.
2510 """
54f9ee45 2511 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2512
2513 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2514 """
2515 CanReadStream(InputStream stream) -> bool
2516
2517 Returns True if the image handlers can read an image file from the
2518 data currently on the input stream, or a readable Python file-like
2519 object.
2520 """
54f9ee45 2521 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2522
2523 CanReadStream = staticmethod(CanReadStream)
2524 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2525 """
2526 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2527
2528 Loads an image from an input stream or a readable Python file-like
2529 object. If no handler type is provided, the library will try to
2530 autodetect the format.
2531 """
54f9ee45 2532 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2533
2534 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2535 """
2536 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2537
2538 Loads an image from an input stream or a readable Python file-like
2539 object, using a MIME type string to specify the image file format.
2540 """
54f9ee45 2541 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce
RD
2542
2543 def Ok(*args, **kwargs):
7a27cf7c
RD
2544 """
2545 Ok(self) -> bool
2546
2547 Returns true if image data is present.
2548 """
54f9ee45 2549 return _core_.Image_Ok(*args, **kwargs)
e811c8ce
RD
2550
2551 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2552 """
2553 GetWidth(self) -> int
2554
2555 Gets the width of the image in pixels.
2556 """
54f9ee45 2557 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2558
2559 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2560 """
2561 GetHeight(self) -> int
2562
2563 Gets the height of the image in pixels.
2564 """
54f9ee45 2565 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2566
b2df227b 2567 def GetSize(*args, **kwargs):
7a27cf7c
RD
2568 """
2569 GetSize(self) -> Size
2570
2571 Returns the size of the image in pixels.
2572 """
54f9ee45 2573 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2574
e811c8ce 2575 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2576 """
2577 GetSubImage(self, Rect rect) -> Image
2578
2579 Returns a sub image of the current one as long as the rect belongs
2580 entirely to the image.
2581 """
54f9ee45 2582 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce 2583
aff4cc5c 2584 def Size(*args, **kwargs):
7a27cf7c
RD
2585 """
2586 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2587
2588 Returns a resized version of this image without scaling it by adding
2589 either a border with the given colour or cropping as necessary. The
2590 image is pasted into a new image with the given size and background
2591 colour at the position ``pos`` relative to the upper left of the new
2592 image. If red = green = blue = -1 then use either the current mask
2593 colour if set or find, use, and set a suitable mask colour for any
2594 newly exposed areas.
2595 """
aff4cc5c
RD
2596 return _core_.Image_Size(*args, **kwargs)
2597
e811c8ce 2598 def Copy(*args, **kwargs):
7a27cf7c
RD
2599 """
2600 Copy(self) -> Image
2601
2602 Returns an identical copy of the image.
2603 """
54f9ee45 2604 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2605
2606 def Paste(*args, **kwargs):
7a27cf7c
RD
2607 """
2608 Paste(self, Image image, int x, int y)
2609
2610 Pastes ``image`` into this instance and takes care of the mask colour
2611 and any out of bounds problems.
2612 """
54f9ee45 2613 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2614
2615 def GetData(*args, **kwargs):
61d07ac7
RD
2616 """
2617 GetData(self) -> PyObject
2618
2619 Returns a string containing a copy of the RGB bytes of the image.
2620 """
54f9ee45 2621 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2622
2623 def SetData(*args, **kwargs):
61d07ac7
RD
2624 """
2625 SetData(self, buffer data)
2626
2627 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2628 either a string or a buffer object holding the data and the length of
2629 the data must be width*height*3.
2630 """
54f9ee45 2631 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
2632
2633 def GetDataBuffer(*args, **kwargs):
61d07ac7
RD
2634 """
2635 GetDataBuffer(self) -> PyObject
2636
2637 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2638 image data buffer inside the wx.Image. You need to ensure that you do
2639 not use this buffer object after the image has been destroyed.
61d07ac7 2640 """
54f9ee45 2641 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
2642
2643 def SetDataBuffer(*args, **kwargs):
61d07ac7
RD
2644 """
2645 SetDataBuffer(self, buffer data)
2646
2647 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2648 object. This can save making an extra copy of the data but you must
2649 ensure that the buffer object lives longer than the wx.Image does.
61d07ac7 2650 """
54f9ee45 2651 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
2652
2653 def GetAlphaData(*args, **kwargs):
61d07ac7
RD
2654 """
2655 GetAlphaData(self) -> PyObject
2656
2657 Returns a string containing a copy of the alpha bytes of the image.
2658 """
54f9ee45 2659 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
2660
2661 def SetAlphaData(*args, **kwargs):
61d07ac7
RD
2662 """
2663 SetAlphaData(self, buffer alpha)
2664
2665 Resets the Image's alpha data from a buffer of bytes. Accepts either
2666 a string or a buffer object holding the data and the length of the
2667 data must be width*height.
2668 """
54f9ee45 2669 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
2670
2671 def GetAlphaBuffer(*args, **kwargs):
a95a7133 2672 """GetAlphaBuffer(self) -> PyObject"""
54f9ee45 2673 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2674
2675 def SetAlphaBuffer(*args, **kwargs):
61d07ac7 2676 """SetAlphaBuffer(self, buffer alpha)"""
54f9ee45 2677 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2678
2679 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2680 """
2681 SetMaskColour(self, byte r, byte g, byte b)
2682
2683 Sets the mask colour for this image (and tells the image to use the
2684 mask).
2685 """
54f9ee45 2686 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce 2687
aff4cc5c
RD
2688 def GetOrFindMaskColour(*args, **kwargs):
2689 """
2690 GetOrFindMaskColour() -> (r,g,b)
2691
2692 Get the current mask colour or find a suitable colour.
2693 """
2694 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2695
e811c8ce 2696 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2697 """
2698 GetMaskRed(self) -> byte
2699
2700 Gets the red component of the mask colour.
2701 """
54f9ee45 2702 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
2703
2704 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2705 """
2706 GetMaskGreen(self) -> byte
2707
2708 Gets the green component of the mask colour.
2709 """
54f9ee45 2710 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
2711
2712 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2713 """
2714 GetMaskBlue(self) -> byte
2715
2716 Gets the blue component of the mask colour.
2717 """
54f9ee45 2718 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
2719
2720 def SetMask(*args, **kwargs):
7a27cf7c
RD
2721 """
2722 SetMask(self, bool mask=True)
2723
2724 Specifies whether there is a mask or not. The area of the mask is
2725 determined by the current mask colour.
2726 """
54f9ee45 2727 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
2728
2729 def HasMask(*args, **kwargs):
7a27cf7c
RD
2730 """
2731 HasMask(self) -> bool
2732
2733 Returns ``True`` if there is a mask active, ``False`` otherwise.
2734 """
54f9ee45 2735 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
2736
2737 def Rotate(*args, **kwargs):
0df68c9f 2738 """
a95a7133 2739 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f 2740 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2741
2742 Rotates the image about the given point, by ``angle`` radians. Passing
2743 ``True`` to ``interpolating`` results in better image quality, but is
2744 slower. If the image has a mask, then the mask colour is used for the
2745 uncovered pixels in the rotated image background. Otherwise, black
2746 will be used as the fill colour.
2747
2748 Returns the rotated image, leaving this image intact.
0df68c9f 2749 """
54f9ee45 2750 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
2751
2752 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2753 """
2754 Rotate90(self, bool clockwise=True) -> Image
2755
2756 Returns a copy of the image rotated 90 degrees in the direction
2757 indicated by ``clockwise``.
2758 """
54f9ee45 2759 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
2760
2761 def Mirror(*args, **kwargs):
7a27cf7c
RD
2762 """
2763 Mirror(self, bool horizontally=True) -> Image
2764
2765 Returns a mirrored copy of the image. The parameter ``horizontally``
2766 indicates the orientation.
2767 """
54f9ee45 2768 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
2769
2770 def Replace(*args, **kwargs):
0df68c9f 2771 """
7a27cf7c
RD
2772 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2773
2774 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2775 ``(r2,g2,b2)``.
0df68c9f 2776 """
54f9ee45 2777 return _core_.Image_Replace(*args, **kwargs)
e811c8ce 2778
32fe5131
RD
2779 def ConvertToGreyscale(*args, **kwargs):
2780 """
2781 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2782
2783 Convert to greyscale image. Uses the luminance component (Y) of the
2784 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2785 defaults to ITU-T BT.601
2786 """
2787 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2788
e811c8ce 2789 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2790 """
2791 ConvertToMono(self, byte r, byte g, byte b) -> Image
2792
2793 Returns monochromatic version of the image. The returned image has
2794 white colour where the original has ``(r,g,b)`` colour and black
2795 colour everywhere else.
2796 """
54f9ee45 2797 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
2798
2799 def SetOption(*args, **kwargs):
7a27cf7c
RD
2800 """
2801 SetOption(self, String name, String value)
2802
2803 Sets an image handler defined option. For example, when saving as a
2804 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2805 number between 0 and 100 (0 is terrible, 100 is very good).
2806 """
54f9ee45 2807 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
2808
2809 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2810 """
2811 SetOptionInt(self, String name, int value)
2812
2813 Sets an image option as an integer.
2814 """
54f9ee45 2815 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
2816
2817 def GetOption(*args, **kwargs):
7a27cf7c
RD
2818 """
2819 GetOption(self, String name) -> String
2820
2821 Gets the value of an image handler option.
2822 """
54f9ee45 2823 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
2824
2825 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2826 """
2827 GetOptionInt(self, String name) -> int
2828
2829 Gets the value of an image handler option as an integer. If the given
2830 option is not present, the function returns 0.
2831 """
54f9ee45 2832 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
2833
2834 def HasOption(*args, **kwargs):
7a27cf7c
RD
2835 """
2836 HasOption(self, String name) -> bool
2837
2838 Returns true if the given option is present.
2839 """
54f9ee45 2840 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
2841
2842 def CountColours(*args, **kwargs):
a95a7133 2843 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 2844 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
2845
2846 def ComputeHistogram(*args, **kwargs):
a95a7133 2847 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 2848 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
2849
2850 def AddHandler(*args, **kwargs):
66c033b4 2851 """AddHandler(ImageHandler handler)"""
54f9ee45 2852 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
2853
2854 AddHandler = staticmethod(AddHandler)
2855 def InsertHandler(*args, **kwargs):
66c033b4 2856 """InsertHandler(ImageHandler handler)"""
54f9ee45 2857 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
2858
2859 InsertHandler = staticmethod(InsertHandler)
2860 def RemoveHandler(*args, **kwargs):
66c033b4 2861 """RemoveHandler(String name) -> bool"""
54f9ee45 2862 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
2863
2864 RemoveHandler = staticmethod(RemoveHandler)
0085ce49
RD
2865 def GetHandlers(*args, **kwargs):
2866 """GetHandlers() -> PyObject"""
2867 return _core_.Image_GetHandlers(*args, **kwargs)
2868
2869 GetHandlers = staticmethod(GetHandlers)
e811c8ce 2870 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2871 """
2872 GetImageExtWildcard() -> String
2873
2874 Iterates all registered wxImageHandler objects, and returns a string
2875 containing file extension masks suitable for passing to file open/save
2876 dialog boxes.
2877 """
54f9ee45 2878 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
2879
2880 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2881 def ConvertToBitmap(*args, **kwargs):
1fbf26be 2882 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 2883 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
2884
2885 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2886 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
54f9ee45 2887 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce 2888
943e8dfd
RD
2889 def RotateHue(*args, **kwargs):
2890 """
2891 RotateHue(self, double angle)
2892
2893 Rotates the hue of each pixel of the image. Hue is a double in the
2894 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2895 """
2896 return _core_.Image_RotateHue(*args, **kwargs)
2897
2898 def RGBtoHSV(*args, **kwargs):
2899 """
2900 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2901
2902 Converts a color in RGB color space to HSV color space.
2903 """
2904 return _core_.Image_RGBtoHSV(*args, **kwargs)
2905
2906 RGBtoHSV = staticmethod(RGBtoHSV)
2907 def HSVtoRGB(*args, **kwargs):
2908 """
2909 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2910
2911 Converts a color in HSV color space to RGB color space.
2912 """
2913 return _core_.Image_HSVtoRGB(*args, **kwargs)
2914
2915 HSVtoRGB = staticmethod(HSVtoRGB)
e811c8ce 2916 def __nonzero__(self): return self.Ok()
0085ce49
RD
2917Image_swigregister = _core_.Image_swigregister
2918Image_swigregister(Image)
d14a1e28
RD
2919
2920def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2921 """
2922 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2923
2924 Loads an image from a file, using a MIME type string (such as
2925 'image/jpeg') to specify image type.
2926 """
54f9ee45 2927 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
2928 return val
2929
2930def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2931 """
2932 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2933
2934 Loads an image from an input stream, or any readable Python file-like
2935 object.
2936 """
54f9ee45 2937 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
2938 return val
2939
2940def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2941 """
2942 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2943
2944 Loads an image from an input stream, or any readable Python file-like
2945 object, specifying the image format with a MIME type string.
2946 """
54f9ee45 2947 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
2948 return val
2949
66c033b4 2950def EmptyImage(*args, **kwargs):
61d07ac7
RD
2951 """
2952 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2953
2954 Construct an empty image of a given size, optionally setting all
2955 pixels to black.
2956 """
66c033b4 2957 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
2958 return val
2959
2960def ImageFromBitmap(*args, **kwargs):
61d07ac7
RD
2961 """
2962 ImageFromBitmap(Bitmap bitmap) -> Image
2963
2964 Construct an Image from a `wx.Bitmap`.
2965 """
54f9ee45 2966 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
2967 return val
2968
2969def ImageFromData(*args, **kwargs):
61d07ac7
RD
2970 """
2971 ImageFromData(int width, int height, buffer data) -> Image
2972
2973 Construct an Image from a buffer of RGB bytes. Accepts either a
2974 string or a buffer object holding the data and the length of the data
2975 must be width*height*3.
2976 """
54f9ee45 2977 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
2978 return val
2979
1823fbb4 2980def ImageFromDataWithAlpha(*args, **kwargs):
61d07ac7
RD
2981 """
2982 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2983
2984 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2985 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2986 length of the data must be width*height*3 bytes, and the length of the
2987 alpha data must be width*height bytes.
61d07ac7 2988 """
1823fbb4 2989 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
1823fbb4
RD
2990 return val
2991
e811c8ce 2992def Image_CanRead(*args, **kwargs):
0085ce49 2993 """
7a27cf7c
RD
2994 Image_CanRead(String filename) -> bool
2995
2996 Returns True if the image handlers can read this file.
2997 """
0085ce49 2998 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 2999
e811c8ce 3000def Image_GetImageCount(*args, **kwargs):
0085ce49 3001 """
7a27cf7c
RD
3002 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3003
3004 If the image file contains more than one image and the image handler
3005 is capable of retrieving these individually, this function will return
3006 the number of available images.
3007 """
0085ce49 3008 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 3009
e811c8ce 3010def Image_CanReadStream(*args, **kwargs):
0085ce49 3011 """
7a27cf7c
RD
3012 Image_CanReadStream(InputStream stream) -> bool
3013
3014 Returns True if the image handlers can read an image file from the
3015 data currently on the input stream, or a readable Python file-like
3016 object.
3017 """
0085ce49 3018 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 3019
e811c8ce 3020def Image_AddHandler(*args, **kwargs):
0085ce49
RD
3021 """Image_AddHandler(ImageHandler handler)"""
3022 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 3023
e811c8ce 3024def Image_InsertHandler(*args, **kwargs):
0085ce49
RD
3025 """Image_InsertHandler(ImageHandler handler)"""
3026 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 3027
e811c8ce 3028def Image_RemoveHandler(*args, **kwargs):
0085ce49
RD
3029 """Image_RemoveHandler(String name) -> bool"""
3030 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 3031
0085ce49
RD
3032def Image_GetHandlers(*args):
3033 """Image_GetHandlers() -> PyObject"""
3034 return _core_.Image_GetHandlers(*args)
3035
3036def Image_GetImageExtWildcard(*args):
3037 """
7a27cf7c
RD
3038 Image_GetImageExtWildcard() -> String
3039
3040 Iterates all registered wxImageHandler objects, and returns a string
3041 containing file extension masks suitable for passing to file open/save
3042 dialog boxes.
3043 """
0085ce49 3044 return _core_.Image_GetImageExtWildcard(*args)
d14a1e28 3045
943e8dfd 3046def Image_RGBtoHSV(*args, **kwargs):
0085ce49 3047 """
943e8dfd
RD
3048 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3049
3050 Converts a color in RGB color space to HSV color space.
3051 """
0085ce49 3052 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3053
3054def Image_HSVtoRGB(*args, **kwargs):
0085ce49 3055 """
943e8dfd
RD
3056 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3057
3058 Converts a color in HSV color space to RGB color space.
3059 """
0085ce49 3060 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3061
5e4ca4a8
RD
3062def InitAllImageHandlers():
3063 """
3064 The former functionality of InitAllImageHanders is now done internal to
3065 the _core_ extension module and so this function has become a simple NOP.
3066 """
3067 pass
d14a1e28 3068
54f9ee45
RD
3069IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3070IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3071PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3072PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3073PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
54f9ee45
RD
3074BMP_24BPP = _core_.BMP_24BPP
3075BMP_8BPP = _core_.BMP_8BPP
3076BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3077BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3078BMP_8BPP_RED = _core_.BMP_8BPP_RED
3079BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3080BMP_4BPP = _core_.BMP_4BPP
3081BMP_1BPP = _core_.BMP_1BPP
3082BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 3083class BMPHandler(ImageHandler):
27fb7603 3084 """A `wx.ImageHandler` for \*.bmp bitmap files."""
0085ce49
RD
3085 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3086 __repr__ = _swig_repr
3087 def __init__(self, *args, **kwargs):
27fb7603
RD
3088 """
3089 __init__(self) -> BMPHandler
3090
3091 A `wx.ImageHandler` for \*.bmp bitmap files.
3092 """
0085ce49
RD
3093 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3094BMPHandler_swigregister = _core_.BMPHandler_swigregister
3095BMPHandler_swigregister(BMPHandler)
d14a1e28 3096NullImage = cvar.NullImage
0c243d93 3097IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d14a1e28
RD
3098IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3099IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3100IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3101IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
0c243d93
RD
3102IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3103IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d14a1e28 3104IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3105IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
0c243d93
RD
3106IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3107IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3108IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3109IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3110IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3111IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d14a1e28
RD
3112
3113class ICOHandler(BMPHandler):
27fb7603 3114 """A `wx.ImageHandler` for \*.ico icon files."""
0085ce49
RD
3115 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3116 __repr__ = _swig_repr
3117 def __init__(self, *args, **kwargs):
27fb7603
RD
3118 """
3119 __init__(self) -> ICOHandler
3120
3121 A `wx.ImageHandler` for \*.ico icon files.
3122 """
0085ce49
RD
3123 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3124ICOHandler_swigregister = _core_.ICOHandler_swigregister
3125ICOHandler_swigregister(ICOHandler)
d14a1e28
RD
3126
3127class CURHandler(ICOHandler):
27fb7603 3128 """A `wx.ImageHandler` for \*.cur cursor files."""
0085ce49
RD
3129 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3130 __repr__ = _swig_repr
3131 def __init__(self, *args, **kwargs):
27fb7603
RD
3132 """
3133 __init__(self) -> CURHandler
3134
3135 A `wx.ImageHandler` for \*.cur cursor files.
3136 """
0085ce49
RD
3137 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3138CURHandler_swigregister = _core_.CURHandler_swigregister
3139CURHandler_swigregister(CURHandler)
d14a1e28
RD
3140
3141class ANIHandler(CURHandler):
27fb7603 3142 """A `wx.ImageHandler` for \*.ani animated cursor files."""
0085ce49
RD
3143 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3144 __repr__ = _swig_repr
3145 def __init__(self, *args, **kwargs):
27fb7603
RD
3146 """
3147 __init__(self) -> ANIHandler
3148
3149 A `wx.ImageHandler` for \*.ani animated cursor files.
3150 """
0085ce49
RD
3151 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3152ANIHandler_swigregister = _core_.ANIHandler_swigregister
3153ANIHandler_swigregister(ANIHandler)
d14a1e28
RD
3154
3155class PNGHandler(ImageHandler):
27fb7603 3156 """A `wx.ImageHandler` for PNG image files."""
0085ce49
RD
3157 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3158 __repr__ = _swig_repr
3159 def __init__(self, *args, **kwargs):
27fb7603
RD
3160 """
3161 __init__(self) -> PNGHandler
3162
3163 A `wx.ImageHandler` for PNG image files.
3164 """
0085ce49
RD
3165 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3166PNGHandler_swigregister = _core_.PNGHandler_swigregister
3167PNGHandler_swigregister(PNGHandler)
d14a1e28
RD
3168
3169class GIFHandler(ImageHandler):
27fb7603 3170 """A `wx.ImageHandler` for GIF image files."""
0085ce49
RD
3171 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3172 __repr__ = _swig_repr
3173 def __init__(self, *args, **kwargs):
27fb7603
RD
3174 """
3175 __init__(self) -> GIFHandler
3176
3177 A `wx.ImageHandler` for GIF image files.
3178 """
0085ce49
RD
3179 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3180GIFHandler_swigregister = _core_.GIFHandler_swigregister
3181GIFHandler_swigregister(GIFHandler)
d14a1e28
RD
3182
3183class PCXHandler(ImageHandler):
27fb7603 3184 """A `wx.ImageHandler` for PCX imager files."""
0085ce49
RD
3185 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3186 __repr__ = _swig_repr
3187 def __init__(self, *args, **kwargs):
27fb7603
RD
3188 """
3189 __init__(self) -> PCXHandler
3190
3191 A `wx.ImageHandler` for PCX imager files.
3192 """
0085ce49
RD
3193 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3194PCXHandler_swigregister = _core_.PCXHandler_swigregister
3195PCXHandler_swigregister(PCXHandler)
d14a1e28
RD
3196
3197class JPEGHandler(ImageHandler):
27fb7603 3198 """A `wx.ImageHandler` for JPEG/JPG image files."""
0085ce49
RD
3199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3200 __repr__ = _swig_repr
3201 def __init__(self, *args, **kwargs):
27fb7603
RD
3202 """
3203 __init__(self) -> JPEGHandler
3204
3205 A `wx.ImageHandler` for JPEG/JPG image files.
3206 """
0085ce49
RD
3207 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3208JPEGHandler_swigregister = _core_.JPEGHandler_swigregister
3209JPEGHandler_swigregister(JPEGHandler)
d14a1e28
RD
3210
3211class PNMHandler(ImageHandler):
27fb7603 3212 """A `wx.ImageHandler` for PNM image files."""
0085ce49
RD
3213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3214 __repr__ = _swig_repr
3215 def __init__(self, *args, **kwargs):
27fb7603
RD
3216 """
3217 __init__(self) -> PNMHandler
3218
3219 A `wx.ImageHandler` for PNM image files.
3220 """
0085ce49
RD
3221 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3222PNMHandler_swigregister = _core_.PNMHandler_swigregister
3223PNMHandler_swigregister(PNMHandler)
d14a1e28
RD
3224
3225class XPMHandler(ImageHandler):
27fb7603 3226 """A `wx.ImageHandler` for XPM image."""
0085ce49
RD
3227 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3228 __repr__ = _swig_repr
3229 def __init__(self, *args, **kwargs):
27fb7603
RD
3230 """
3231 __init__(self) -> XPMHandler
3232
3233 A `wx.ImageHandler` for XPM image.
3234 """
0085ce49
RD
3235 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3236XPMHandler_swigregister = _core_.XPMHandler_swigregister
3237XPMHandler_swigregister(XPMHandler)
d14a1e28
RD
3238
3239class TIFFHandler(ImageHandler):
27fb7603 3240 """A `wx.ImageHandler` for TIFF image files."""
0085ce49
RD
3241 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3242 __repr__ = _swig_repr
3243 def __init__(self, *args, **kwargs):
27fb7603
RD
3244 """
3245 __init__(self) -> TIFFHandler
3246
3247 A `wx.ImageHandler` for TIFF image files.
3248 """
0085ce49
RD
3249 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3250TIFFHandler_swigregister = _core_.TIFFHandler_swigregister
3251TIFFHandler_swigregister(TIFFHandler)
d14a1e28 3252
c0de73ae
RD
3253QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3254QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3255class Quantize(object):
3256 """Performs quantization, or colour reduction, on a wxImage."""
0085ce49
RD
3257 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3258 def __init__(self): raise AttributeError, "No constructor defined"
3259 __repr__ = _swig_repr
c0de73ae
RD
3260 def Quantize(*args, **kwargs):
3261 """
3262 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3263
3264 Reduce the colours in the source image and put the result into the
3265 destination image, setting the palette in the destination if
3266 needed. Both images may be the same, to overwrite the source image.
3267 """
3268 return _core_.Quantize_Quantize(*args, **kwargs)
3269
3270 Quantize = staticmethod(Quantize)
0085ce49
RD
3271Quantize_swigregister = _core_.Quantize_swigregister
3272Quantize_swigregister(Quantize)
c0de73ae
RD
3273
3274def Quantize_Quantize(*args, **kwargs):
0085ce49 3275 """
c0de73ae
RD
3276 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3277
3278 Reduce the colours in the source image and put the result into the
3279 destination image, setting the palette in the destination if
3280 needed. Both images may be the same, to overwrite the source image.
3281 """
0085ce49 3282 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3283
d14a1e28
RD
3284#---------------------------------------------------------------------------
3285
3286class EvtHandler(Object):
093d3ff1 3287 """Proxy of C++ EvtHandler class"""
0085ce49
RD
3288 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3289 __repr__ = _swig_repr
3290 def __init__(self, *args, **kwargs):
a95a7133 3291 """__init__(self) -> EvtHandler"""
0085ce49 3292 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
e811c8ce 3293 def GetNextHandler(*args, **kwargs):
a95a7133 3294 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 3295 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
3296
3297 def GetPreviousHandler(*args, **kwargs):
a95a7133 3298 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 3299 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3300
3301 def SetNextHandler(*args, **kwargs):
a95a7133 3302 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 3303 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
3304
3305 def SetPreviousHandler(*args, **kwargs):
a95a7133 3306 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 3307 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3308
3309 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3310 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 3311 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3312
3313 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3314 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 3315 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3316
3317 def ProcessEvent(*args, **kwargs):
a95a7133 3318 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 3319 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
3320
3321 def AddPendingEvent(*args, **kwargs):
a95a7133 3322 """AddPendingEvent(self, Event event)"""
54f9ee45 3323 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
3324
3325 def ProcessPendingEvents(*args, **kwargs):
a95a7133 3326 """ProcessPendingEvents(self)"""
54f9ee45 3327 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
3328
3329 def Connect(*args, **kwargs):
a95a7133 3330 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 3331 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
3332
3333 def Disconnect(*args, **kwargs):
a95a7133 3334 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 3335 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
3336
3337 def _setOORInfo(*args, **kwargs):
689b42ee 3338 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3339 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3340 args[0].thisown = 0
3341 return val
e811c8ce 3342
d14a1e28
RD
3343 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3344 """
3345 Bind an event to an event handler.
3346
db3e571a
RD
3347 :param event: One of the EVT_* objects that specifies the
3348 type of event to bind,
d14a1e28 3349
db3e571a
RD
3350 :param handler: A callable object to be invoked when the
3351 event is delivered to self. Pass None to
3352 disconnect an event handler.
d14a1e28 3353
db3e571a
RD
3354 :param source: Sometimes the event originates from a
3355 different window than self, but you still
3356 want to catch it in self. (For example, a
3357 button event delivered to a frame.) By
3358 passing the source of the event, the event
3359 handling system is able to differentiate
3360 between the same event type from different
3361 controls.
d14a1e28 3362
db3e571a
RD
3363 :param id: Used to spcify the event source by ID instead
3364 of instance.
3365
3366 :param id2: Used when it is desirable to bind a handler
3367 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
3368 """
3369 if source is not None:
3370 id = source.GetId()
3371 event.Bind(self, id, id2, handler)
3372
66c033b4
RD
3373 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3374 """
3375 Disconencts the event handler binding for event from self.
3376 Returns True if successful.
3377 """
3378 if source is not None:
3379 id = source.GetId()
3380 return event.Unbind(self, id, id2)
d14a1e28 3381
0085ce49
RD
3382EvtHandler_swigregister = _core_.EvtHandler_swigregister
3383EvtHandler_swigregister(EvtHandler)
d14a1e28
RD
3384
3385#---------------------------------------------------------------------------
3386
3387class PyEventBinder(object):
3388 """
3389 Instances of this class are used to bind specific events to event
3390 handlers.
3391 """
3392 def __init__(self, evtType, expectedIDs=0):
3393 if expectedIDs not in [0, 1, 2]:
3394 raise ValueError, "Invalid number of expectedIDs"
3395 self.expectedIDs = expectedIDs
3396
3397 if type(evtType) == list or type(evtType) == tuple:
3398 self.evtType = evtType
3399 else:
3400 self.evtType = [evtType]
3401
3402
3403 def Bind(self, target, id1, id2, function):
3404 """Bind this set of event types to target."""
3405 for et in self.evtType:
3406 target.Connect(id1, id2, et, function)
3407
66c033b4
RD
3408
3409 def Unbind(self, target, id1, id2):
3410 """Remove an event binding."""
3411 success = 0
3412 for et in self.evtType:
3413 success += target.Disconnect(id1, id2, et)
3414 return success != 0
3415
d14a1e28
RD
3416
3417 def __call__(self, *args):
3418 """
3419 For backwards compatibility with the old EVT_* functions.
3420 Should be called with either (window, func), (window, ID,
3421 func) or (window, ID1, ID2, func) parameters depending on the
3422 type of the event.
3423 """
3424 assert len(args) == 2 + self.expectedIDs
3425 id1 = wx.ID_ANY
3426 id2 = wx.ID_ANY
3427 target = args[0]
3428 if self.expectedIDs == 0:
3429 func = args[1]
3430 elif self.expectedIDs == 1:
3431 id1 = args[1]
3432 func = args[2]
3433 elif self.expectedIDs == 2:
3434 id1 = args[1]
3435 id2 = args[2]
3436 func = args[3]
3437 else:
3438 raise ValueError, "Unexpected number of IDs"
3439
3440 self.Bind(target, id1, id2, func)
3441
3442
3443# These two are square pegs that don't fit the PyEventBinder hole...
3444def EVT_COMMAND(win, id, cmd, func):
3445 win.Connect(id, -1, cmd, func)
3446def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3447 win.Connect(id1, id2, cmd, func)
3448
3449
3450#---------------------------------------------------------------------------
3451
3452#---------------------------------------------------------------------------
3453
54f9ee45
RD
3454EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3455EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 3456
0085ce49
RD
3457def NewEventType(*args):
3458 """NewEventType() -> wxEventType"""
3459 return _core_.NewEventType(*args)
54f9ee45
RD
3460wxEVT_NULL = _core_.wxEVT_NULL
3461wxEVT_FIRST = _core_.wxEVT_FIRST
3462wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3463wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3464wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3465wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3466wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3467wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3468wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3469wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3470wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3471wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3472wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3473wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3474wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3475wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3476wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3477wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3478wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3479wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3480wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3481wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3482wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3483wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3484wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3485wxEVT_MOTION = _core_.wxEVT_MOTION
3486wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3487wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3488wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3489wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3490wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3491wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3492wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3493wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3494wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3495wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3496wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3497wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3498wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3499wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3500wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3501wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3502wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3503wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3504wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3505wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3506wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3507wxEVT_CHAR = _core_.wxEVT_CHAR
3508wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3509wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3510wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3511wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3512wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3513wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3514wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3515wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3516wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3517wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3518wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3519wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3520wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3521wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3522wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3523wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
54f9ee45
RD
3524wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3525wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3526wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3527wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3528wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3529wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3530wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3531wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3532wxEVT_SIZE = _core_.wxEVT_SIZE
3533wxEVT_MOVE = _core_.wxEVT_MOVE
3534wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3535wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3536wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3537wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3538wxEVT_POWER = _core_.wxEVT_POWER
3539wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3540wxEVT_CREATE = _core_.wxEVT_CREATE
3541wxEVT_DESTROY = _core_.wxEVT_DESTROY
3542wxEVT_SHOW = _core_.wxEVT_SHOW
3543wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3544wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3545wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3546wxEVT_PAINT = _core_.wxEVT_PAINT
3547wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3548wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3549wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3550wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3551wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3552wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3553wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3554wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3555wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3556wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3557wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3558wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3559wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3560wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3561wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3562wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3563wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3564wxEVT_IDLE = _core_.wxEVT_IDLE
3565wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3566wxEVT_SIZING = _core_.wxEVT_SIZING
3567wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3568wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
54f9ee45
RD
3569wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3570wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3571wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3572wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3573wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3574wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3575wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
3576#
3577# Create some event binders
3578EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3579EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3580EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3581EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3582EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3583EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3584EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3585EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3586EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3587EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3588EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3589EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3590EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3591EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3592EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3593EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3594EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3595EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3596EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3597EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3598EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3599EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3600EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3601EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3602EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d14a1e28
RD
3603EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3604EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3605EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3606EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3607EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3608EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3609EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3610EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3611EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3612EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3613EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3614EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3615EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3616EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3617EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3618EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3619
3620EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3621EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3622EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3623EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3624EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3625EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3626EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3627EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3628EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3629EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3630EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3631EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3632EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3633
3634EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3635 wxEVT_LEFT_UP,
3636 wxEVT_MIDDLE_DOWN,
3637 wxEVT_MIDDLE_UP,
3638 wxEVT_RIGHT_DOWN,
3639 wxEVT_RIGHT_UP,
3640 wxEVT_MOTION,
3641 wxEVT_LEFT_DCLICK,
3642 wxEVT_MIDDLE_DCLICK,
3643 wxEVT_RIGHT_DCLICK,
3644 wxEVT_ENTER_WINDOW,
3645 wxEVT_LEAVE_WINDOW,
3646 wxEVT_MOUSEWHEEL
3647 ])
3648
3649
3650# Scrolling from wxWindow (sent to wxScrolledWindow)
3651EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3652 wxEVT_SCROLLWIN_BOTTOM,
3653 wxEVT_SCROLLWIN_LINEUP,
3654 wxEVT_SCROLLWIN_LINEDOWN,
3655 wxEVT_SCROLLWIN_PAGEUP,
3656 wxEVT_SCROLLWIN_PAGEDOWN,
3657 wxEVT_SCROLLWIN_THUMBTRACK,
3658 wxEVT_SCROLLWIN_THUMBRELEASE,
3659 ])
3660
3661EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3662EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3663EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3664EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3665EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3666EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3667EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3668EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3669
27fb7603 3670# Scrolling from wx.Slider and wx.ScrollBar
d14a1e28
RD
3671EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3672 wxEVT_SCROLL_BOTTOM,
3673 wxEVT_SCROLL_LINEUP,
3674 wxEVT_SCROLL_LINEDOWN,
3675 wxEVT_SCROLL_PAGEUP,
3676 wxEVT_SCROLL_PAGEDOWN,
3677 wxEVT_SCROLL_THUMBTRACK,
3678 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3679 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3680 ])
3681
3682EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3683EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3684EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3685EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3686EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3687EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3688EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3689EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3690EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3691EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3692
27fb7603 3693# Scrolling from wx.Slider and wx.ScrollBar, with an id
d14a1e28
RD
3694EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3695 wxEVT_SCROLL_BOTTOM,
3696 wxEVT_SCROLL_LINEUP,
3697 wxEVT_SCROLL_LINEDOWN,
3698 wxEVT_SCROLL_PAGEUP,
3699 wxEVT_SCROLL_PAGEDOWN,
3700 wxEVT_SCROLL_THUMBTRACK,
3701 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3702 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3703 ], 1)
3704
3705EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3706EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3707EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3708EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3709EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3710EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3711EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3712EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3713EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3714EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d14a1e28 3715
d14a1e28
RD
3716EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3717EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3718EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3719EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3720EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3721EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3722EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3723EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3724EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3725EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3726
3727EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3728EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3729EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3730EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3731EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3732EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3733EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3734EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3735EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3736
3737
3738EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3739EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3740EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3741EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3742EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3743EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3744EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3745
3746EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3747
3748EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3749EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3750
3751EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3752
3753
3754
3755#---------------------------------------------------------------------------
3756
3757class Event(Object):
27fb7603
RD
3758 """
3759 An event is a structure holding information about an event passed to a
3760 callback or member function. wx.Event is an abstract base class for
3761 other event classes
3762 """
0085ce49
RD
3763 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3764 def __init__(self): raise AttributeError, "No constructor defined"
3765 __repr__ = _swig_repr
3766 __swig_destroy__ = _core_.delete_Event
3767 __del__ = lambda self : None;
e811c8ce 3768 def SetEventType(*args, **kwargs):
27fb7603
RD
3769 """
3770 SetEventType(self, wxEventType typ)
3771
3772 Sets the specific type of the event.
3773 """
54f9ee45 3774 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
3775
3776 def GetEventType(*args, **kwargs):
27fb7603
RD
3777 """
3778 GetEventType(self) -> wxEventType
3779
3780 Returns the identifier of the given event type, such as
3781 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3782 """
54f9ee45 3783 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
3784
3785 def GetEventObject(*args, **kwargs):
27fb7603
RD
3786 """
3787 GetEventObject(self) -> Object
3788
3789 Returns the object (usually a window) associated with the event, if
3790 any.
3791 """
54f9ee45 3792 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
3793
3794 def SetEventObject(*args, **kwargs):
27fb7603
RD
3795 """
3796 SetEventObject(self, Object obj)
3797
3798 Sets the originating object, or in other words, obj is normally the
3799 object that is sending the event.
3800 """
54f9ee45 3801 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
3802
3803 def GetTimestamp(*args, **kwargs):
a95a7133 3804 """GetTimestamp(self) -> long"""
54f9ee45 3805 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
3806
3807 def SetTimestamp(*args, **kwargs):
a95a7133 3808 """SetTimestamp(self, long ts=0)"""
54f9ee45 3809 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
3810
3811 def GetId(*args, **kwargs):
27fb7603
RD
3812 """
3813 GetId(self) -> int
3814
3815 Returns the identifier associated with this event, such as a button
3816 command id.
3817 """
54f9ee45 3818 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
3819
3820 def SetId(*args, **kwargs):
27fb7603
RD
3821 """
3822 SetId(self, int Id)
3823
3824 Set's the ID for the event. This is usually the ID of the window that
3825 is sending the event, but it can also be a command id from a menu
3826 item, etc.
3827 """
54f9ee45 3828 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
3829
3830 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3831 """
3832 IsCommandEvent(self) -> bool
3833
3834 Returns true if the event is or is derived from `wx.CommandEvent` else
3835 it returns false. Note: Exists only for optimization purposes.
3836 """
54f9ee45 3837 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
3838
3839 def Skip(*args, **kwargs):
51b83b37
RD
3840 """
3841 Skip(self, bool skip=True)
3842
3843 Called by an event handler, it controls whether additional event
3844 handlers bound to this event will be called after the current event
3845 handler returns. Skip(false) (the default setting) will prevent
3846 additional event handlers from being called and control will be
3847 returned to the sender of the event immediately after the current
3848 handler has finished. Skip(True) will cause the event processing
3849 system to continue searching for a handler function for this event.
3850
3851 """
54f9ee45 3852 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
3853
3854 def GetSkipped(*args, **kwargs):
27fb7603
RD
3855 """
3856 GetSkipped(self) -> bool
3857
3858 Returns true if the event handler should be skipped, false otherwise.
3859 :see: `Skip`
3860 """
54f9ee45 3861 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
3862
3863 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3864 """
3865 ShouldPropagate(self) -> bool
3866
3867 Test if this event should be propagated to the parent window or not,
3868 i.e. if the propagation level is currently greater than 0.
3869 """
54f9ee45 3870 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
3871
3872 def StopPropagation(*args, **kwargs):
27fb7603
RD
3873 """
3874 StopPropagation(self) -> int
3875
3876 Stop the event from propagating to its parent window. Returns the old
3877 propagation level value which may be later passed to
3878 `ResumePropagation` to allow propagating the event again.
3879 """
54f9ee45 3880 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
3881
3882 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3883 """
3884 ResumePropagation(self, int propagationLevel)
3885
3886 Resume the event propagation by restoring the propagation level. (For
3887 example, you can use the value returned by an earlier call to
3888 `StopPropagation`.)
3889
3890 """
54f9ee45 3891 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
3892
3893 def Clone(*args, **kwargs):
a95a7133 3894 """Clone(self) -> Event"""
54f9ee45 3895 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 3896
0085ce49
RD
3897Event_swigregister = _core_.Event_swigregister
3898Event_swigregister(Event)
d14a1e28
RD
3899
3900#---------------------------------------------------------------------------
3901
3902class PropagationDisabler(object):
27fb7603
RD
3903 """
3904 Helper class to temporarily change an event not to propagate. Simply
3905 create an instance of this class and then whe it is destroyed the
3906 propogation of the event will be restored.
3907 """
0085ce49
RD
3908 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3909 __repr__ = _swig_repr
3910 def __init__(self, *args, **kwargs):
27fb7603
RD
3911 """
3912 __init__(self, Event event) -> PropagationDisabler
3913
3914 Helper class to temporarily change an event not to propagate. Simply
3915 create an instance of this class and then whe it is destroyed the
3916 propogation of the event will be restored.
3917 """
0085ce49
RD
3918 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3919 __swig_destroy__ = _core_.delete_PropagationDisabler
3920 __del__ = lambda self : None;
3921PropagationDisabler_swigregister = _core_.PropagationDisabler_swigregister
3922PropagationDisabler_swigregister(PropagationDisabler)
d14a1e28
RD
3923
3924class PropagateOnce(object):
27fb7603
RD
3925 """
3926 A helper class that will temporarily lower propagation level of an
3927 event. Simply create an instance of this class and then whe it is
3928 destroyed the propogation of the event will be restored.
3929 """
0085ce49
RD
3930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3931 __repr__ = _swig_repr
3932 def __init__(self, *args, **kwargs):
27fb7603
RD
3933 """
3934 __init__(self, Event event) -> PropagateOnce
3935
3936 A helper class that will temporarily lower propagation level of an
3937 event. Simply create an instance of this class and then whe it is
3938 destroyed the propogation of the event will be restored.
3939 """
0085ce49
RD
3940 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3941 __swig_destroy__ = _core_.delete_PropagateOnce
3942 __del__ = lambda self : None;
3943PropagateOnce_swigregister = _core_.PropagateOnce_swigregister
3944PropagateOnce_swigregister(PropagateOnce)
d14a1e28
RD
3945
3946#---------------------------------------------------------------------------
3947
3948class CommandEvent(Event):
27fb7603
RD
3949 """
3950 This event class contains information about command events, which
3951 originate from a variety of simple controls, as well as menus and
3952 toolbars.
3953 """
0085ce49
RD
3954 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3955 __repr__ = _swig_repr
3956 def __init__(self, *args, **kwargs):
27fb7603
RD
3957 """
3958 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3959
3960 This event class contains information about command events, which
3961 originate from a variety of simple controls, as well as menus and
3962 toolbars.
3963 """
0085ce49 3964 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
e811c8ce 3965 def GetSelection(*args, **kwargs):
27fb7603
RD
3966 """
3967 GetSelection(self) -> int
3968
3969 Returns item index for a listbox or choice selection event (not valid
3970 for a deselection).
3971 """
54f9ee45 3972 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
3973
3974 def SetString(*args, **kwargs):
a95a7133 3975 """SetString(self, String s)"""
54f9ee45 3976 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
3977
3978 def GetString(*args, **kwargs):
27fb7603
RD
3979 """
3980 GetString(self) -> String
3981
3982 Returns item string for a listbox or choice selection event (not valid
3983 for a deselection).
3984 """
54f9ee45 3985 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
3986
3987 def IsChecked(*args, **kwargs):
27fb7603
RD
3988 """
3989 IsChecked(self) -> bool
3990
3991 This method can be used with checkbox and menu events: for the
3992 checkboxes, the method returns true for a selection event and false
3993 for a deselection one. For the menu events, this method indicates if
3994 the menu item just has become checked or unchecked (and thus only
3995 makes sense for checkable menu items).
3996 """
54f9ee45 3997 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 3998
242b7b46 3999 Checked = IsChecked
e811c8ce 4000 def IsSelection(*args, **kwargs):
27fb7603
RD
4001 """
4002 IsSelection(self) -> bool
4003
4004 For a listbox or similar event, returns true if it is a selection,
4005 false if it is a deselection.
4006 """
54f9ee45 4007 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
4008
4009 def SetExtraLong(*args, **kwargs):
a95a7133 4010 """SetExtraLong(self, long extraLong)"""
54f9ee45 4011 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
4012
4013 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4014 """
4015 GetExtraLong(self) -> long
4016
5ba5649b
RD
4017 Returns extra information dependant on the event objects type. If the
4018 event comes from a listbox selection, it is a boolean determining
4019 whether the event was a selection (true) or a deselection (false). A
4020 listbox deselection only occurs for multiple-selection boxes, and in
4021 this case the index and string values are indeterminate and the
4022 listbox must be examined by the application.
27fb7603 4023 """
54f9ee45 4024 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
4025
4026 def SetInt(*args, **kwargs):
a95a7133 4027 """SetInt(self, int i)"""
54f9ee45 4028 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
4029
4030 def GetInt(*args, **kwargs):
27fb7603
RD
4031 """
4032 GetInt(self) -> long
4033
5ba5649b
RD
4034 Returns the integer identifier corresponding to a listbox, choice or
4035 radiobox selection (only if the event was a selection, not a
4036 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4037 """
54f9ee45 4038 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce 4039
0085ce49
RD
4040 def GetClientData(*args, **kwargs):
4041 """
4042 GetClientData(self) -> PyObject
4043
4044 Returns the client data object for a listbox or choice selection event, (if any.)
4045 """
4046 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4047
4048 def SetClientData(*args, **kwargs):
4049 """
4050 SetClientData(self, PyObject clientData)
4051
4052 Associate the given client data with the item at position n.
4053 """
4054 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4055
4056 GetClientObject = GetClientData
4057 SetClientObject = SetClientData
4058
e811c8ce 4059 def Clone(*args, **kwargs):
a95a7133 4060 """Clone(self) -> Event"""
54f9ee45 4061 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 4062
0085ce49
RD
4063CommandEvent_swigregister = _core_.CommandEvent_swigregister
4064CommandEvent_swigregister(CommandEvent)
d14a1e28
RD
4065
4066#---------------------------------------------------------------------------
4067
4068class NotifyEvent(CommandEvent):
27fb7603
RD
4069 """
4070 An instance of this class (or one of its derived classes) is sent from
4071 a control when the control's state is being changed and the control
4072 allows that change to be prevented from happening. The event handler
4073 can call `Veto` or `Allow` to tell the control what to do.
4074 """
0085ce49
RD
4075 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4076 __repr__ = _swig_repr
4077 def __init__(self, *args, **kwargs):
27fb7603
RD
4078 """
4079 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4080
4081 An instance of this class (or one of its derived classes) is sent from
4082 a control when the control's state is being changed and the control
4083 allows that change to be prevented from happening. The event handler
4084 can call `Veto` or `Allow` to tell the control what to do.
4085 """
0085ce49 4086 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
e811c8ce 4087 def Veto(*args, **kwargs):
27fb7603
RD
4088 """
4089 Veto(self)
4090
4091 Prevents the change announced by this event from happening.
4092
4093 It is in general a good idea to notify the user about the reasons for
4094 vetoing the change because otherwise the applications behaviour (which
4095 just refuses to do what the user wants) might be quite surprising.
4096 """
54f9ee45 4097 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
4098
4099 def Allow(*args, **kwargs):
27fb7603
RD
4100 """
4101 Allow(self)
4102
4103 This is the opposite of `Veto`: it explicitly allows the event to be
4104 processed. For most events it is not necessary to call this method as
4105 the events are allowed anyhow but some are forbidden by default (this
4106 will be mentioned in the corresponding event description).
4107 """
54f9ee45 4108 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
4109
4110 def IsAllowed(*args, **kwargs):
27fb7603
RD
4111 """
4112 IsAllowed(self) -> bool
4113
4114 Returns true if the change is allowed (`Veto` hasn't been called) or
4115 false otherwise (if it was).
4116 """
54f9ee45 4117 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 4118
0085ce49
RD
4119NotifyEvent_swigregister = _core_.NotifyEvent_swigregister
4120NotifyEvent_swigregister(NotifyEvent)
d14a1e28
RD
4121
4122#---------------------------------------------------------------------------
4123
4124class ScrollEvent(CommandEvent):
27fb7603
RD
4125 """
4126 A scroll event holds information about events sent from stand-alone
4127 scrollbars and sliders. Note that scrolled windows do not send
4128 instnaces of this event class, but send the `wx.ScrollWinEvent`
4129 instead.
4130 """
0085ce49
RD
4131 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4132 __repr__ = _swig_repr
4133 def __init__(self, *args, **kwargs):
0df68c9f 4134 """
a95a7133 4135 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
4136 int orient=0) -> ScrollEvent
4137 """
0085ce49 4138 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
e811c8ce 4139 def GetOrientation(*args, **kwargs):
27fb7603
RD
4140 """
4141 GetOrientation(self) -> int
4142
4143 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4144 the scrollbar.
4145 """
54f9ee45 4146 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4147
4148 def GetPosition(*args, **kwargs):
27fb7603
RD
4149 """
4150 GetPosition(self) -> int
4151
4152 Returns the position of the scrollbar.
4153 """
54f9ee45 4154 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4155
4156 def SetOrientation(*args, **kwargs):
a95a7133 4157 """SetOrientation(self, int orient)"""
54f9ee45 4158 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4159
4160 def SetPosition(*args, **kwargs):
a95a7133 4161 """SetPosition(self, int pos)"""
54f9ee45 4162 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 4163
0085ce49
RD
4164ScrollEvent_swigregister = _core_.ScrollEvent_swigregister
4165ScrollEvent_swigregister(ScrollEvent)
d14a1e28
RD
4166
4167#---------------------------------------------------------------------------
4168
4169class ScrollWinEvent(Event):
27fb7603
RD
4170 """
4171 A wx.ScrollWinEvent holds information about scrolling and is sent from
4172 scrolling windows.
4173 """
0085ce49
RD
4174 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4175 __repr__ = _swig_repr
4176 def __init__(self, *args, **kwargs):
27fb7603
RD
4177 """
4178 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4179
4180 A wx.ScrollWinEvent holds information about scrolling and is sent from
4181 scrolling windows.
4182 """
0085ce49 4183 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
e811c8ce 4184 def GetOrientation(*args, **kwargs):
27fb7603
RD
4185 """
4186 GetOrientation(self) -> int
4187
4188 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4189 the scrollbar.
4190 """
54f9ee45 4191 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4192
4193 def GetPosition(*args, **kwargs):
27fb7603
RD
4194 """
4195 GetPosition(self) -> int
4196
4197 Returns the position of the scrollbar for the thumb track and release
4198 events. Note that this field can't be used for the other events, you
4199 need to query the window itself for the current position in that case.
4200 """
54f9ee45 4201 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4202
4203 def SetOrientation(*args, **kwargs):
a95a7133 4204 """SetOrientation(self, int orient)"""
54f9ee45 4205 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4206
4207 def SetPosition(*args, **kwargs):
a95a7133 4208 """SetPosition(self, int pos)"""
54f9ee45 4209 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 4210
0085ce49
RD
4211ScrollWinEvent_swigregister = _core_.ScrollWinEvent_swigregister
4212ScrollWinEvent_swigregister(ScrollWinEvent)
d14a1e28
RD
4213
4214#---------------------------------------------------------------------------
4215
54f9ee45
RD
4216MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4217MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4218MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4219MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4220MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 4221class MouseEvent(Event):
27fb7603
RD
4222 """
4223 This event class contains information about the events generated by
4224 the mouse: they include mouse buttons press and release events and
4225 mouse move events.
4226
4227 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4228 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4229 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4230 a middle button so a portable application should avoid relying on the
4231 events from it.
4232
4233 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4234 the former returns true when the event corresponds to the left mouse
4235 button click while the latter returns true if the left mouse button is
4236 currently being pressed. For example, when the user is dragging the
4237 mouse you can use `LeftIsDown` to test whether the left mouse button
4238 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4239 `LeftIsDown` will also return true in wxWidgets whatever the
4240 underlying GUI behaviour is (which is platform-dependent). The same
4241 applies, of course, to other mouse buttons as well.
4242 """
0085ce49
RD
4243 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4244 __repr__ = _swig_repr
4245 def __init__(self, *args, **kwargs):
27fb7603
RD
4246 """
4247 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4248
4249 Constructs a wx.MouseEvent. Valid event types are:
4250
4251 * wxEVT_ENTER_WINDOW
4252 * wxEVT_LEAVE_WINDOW
4253 * wxEVT_LEFT_DOWN
4254 * wxEVT_LEFT_UP
4255 * wxEVT_LEFT_DCLICK
4256 * wxEVT_MIDDLE_DOWN
4257 * wxEVT_MIDDLE_UP
4258 * wxEVT_MIDDLE_DCLICK
4259 * wxEVT_RIGHT_DOWN
4260 * wxEVT_RIGHT_UP
4261 * wxEVT_RIGHT_DCLICK
4262 * wxEVT_MOTION
4263 * wxEVT_MOUSEWHEEL
4264 """
0085ce49 4265 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
e811c8ce 4266 def IsButton(*args, **kwargs):
27fb7603
RD
4267 """
4268 IsButton(self) -> bool
4269
4270 Returns true if the event was a mouse button event (not necessarily a
4271 button down event - that may be tested using `ButtonDown`).
4272 """
54f9ee45 4273 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
4274
4275 def ButtonDown(*args, **kwargs):
27fb7603
RD
4276 """
4277 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4278
5ba5649b
RD
4279 If the argument is omitted, this returns true if the event was any
4280 mouse button down event. Otherwise the argument specifies which
4281 button-down event shold be checked for (see `Button` for the possible
4282 values).
27fb7603 4283 """
54f9ee45 4284 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
4285
4286 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4287 """
4288 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4289
4290 If the argument is omitted, this returns true if the event was any
4291 mouse double click event. Otherwise the argument specifies which
4292 double click event to check for (see `Button` for the possible
4293 values).
4294 """
54f9ee45 4295 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
4296
4297 def ButtonUp(*args, **kwargs):
27fb7603
RD
4298 """
4299 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4300
4301 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4302 mouse button up event. Otherwise the argument specifies which button
4303 up event to check for (see `Button` for the possible values).
27fb7603 4304 """
54f9ee45 4305 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
4306
4307 def Button(*args, **kwargs):
27fb7603
RD
4308 """
4309 Button(self, int button) -> bool
4310
4311 Returns true if the identified mouse button is changing state. Valid
4312 values of button are:
4313
4314 ==================== =====================================
4315 wx.MOUSE_BTN_LEFT check if left button was pressed
4316 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4317 wx.MOUSE_BTN_RIGHT check if right button was pressed
4318 wx.MOUSE_BTN_ANY check if any button was pressed
4319 ==================== =====================================
4320
4321 """
54f9ee45 4322 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
4323
4324 def ButtonIsDown(*args, **kwargs):
a95a7133 4325 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 4326 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
4327
4328 def GetButton(*args, **kwargs):
27fb7603
RD
4329 """
4330 GetButton(self) -> int
4331
4332 Returns the mouse button which generated this event or
4333 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4334 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4335 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4336 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4337 right buttons respectively.
4338 """
54f9ee45 4339 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
4340
4341 def ControlDown(*args, **kwargs):
27fb7603
RD
4342 """
4343 ControlDown(self) -> bool
4344
4345 Returns true if the control key was down at the time of the event.
4346 """
54f9ee45 4347 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4348
4349 def MetaDown(*args, **kwargs):
27fb7603
RD
4350 """
4351 MetaDown(self) -> bool
4352
4353 Returns true if the Meta key was down at the time of the event.
4354 """
54f9ee45 4355 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4356
4357 def AltDown(*args, **kwargs):
27fb7603
RD
4358 """
4359 AltDown(self) -> bool
4360
4361 Returns true if the Alt key was down at the time of the event.
4362 """
54f9ee45 4363 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4364
4365 def ShiftDown(*args, **kwargs):
27fb7603
RD
4366 """
4367 ShiftDown(self) -> bool
4368
4369 Returns true if the Shift key was down at the time of the event.
4370 """
54f9ee45 4371 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 4372
412d302d
RD
4373 def CmdDown(*args, **kwargs):
4374 """
4375 CmdDown(self) -> bool
4376
4377 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4378 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4379 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4380 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4381 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4382 purpose. So for non-Mac platforms this is the same as `ControlDown`
4383 and Macs this is the same as `MetaDown`.
4384 """
4385 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4386
e811c8ce 4387 def LeftDown(*args, **kwargs):
27fb7603
RD
4388 """
4389 LeftDown(self) -> bool
4390
4391 Returns true if the left mouse button state changed to down.
4392 """
54f9ee45 4393 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
4394
4395 def MiddleDown(*args, **kwargs):
27fb7603
RD
4396 """
4397 MiddleDown(self) -> bool
4398
4399 Returns true if the middle mouse button state changed to down.
4400 """
54f9ee45 4401 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
4402
4403 def RightDown(*args, **kwargs):
27fb7603
RD
4404 """
4405 RightDown(self) -> bool
4406
4407 Returns true if the right mouse button state changed to down.
4408 """
54f9ee45 4409 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
4410
4411 def LeftUp(*args, **kwargs):
27fb7603
RD
4412 """
4413 LeftUp(self) -> bool
4414
4415 Returns true if the left mouse button state changed to up.
4416 """
54f9ee45 4417 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
4418
4419 def MiddleUp(*args, **kwargs):
27fb7603
RD
4420 """
4421 MiddleUp(self) -> bool
4422
4423 Returns true if the middle mouse button state changed to up.
4424 """
54f9ee45 4425 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
4426
4427 def RightUp(*args, **kwargs):
27fb7603
RD
4428 """
4429 RightUp(self) -> bool
4430
4431 Returns true if the right mouse button state changed to up.
4432 """
54f9ee45 4433 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
4434
4435 def LeftDClick(*args, **kwargs):
27fb7603
RD
4436 """
4437 LeftDClick(self) -> bool
4438
4439 Returns true if the event was a left button double click.
4440 """
54f9ee45 4441 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
4442
4443 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4444 """
4445 MiddleDClick(self) -> bool
4446
4447 Returns true if the event was a middle button double click.
4448 """
54f9ee45 4449 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
4450
4451 def RightDClick(*args, **kwargs):
27fb7603
RD
4452 """
4453 RightDClick(self) -> bool
4454
4455 Returns true if the event was a right button double click.
4456 """
54f9ee45 4457 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
4458
4459 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4460 """
4461 LeftIsDown(self) -> bool
4462
4463 Returns true if the left mouse button is currently down, independent
4464 of the current event type.
4465
4466 Please notice that it is not the same as LeftDown which returns true
4467 if the left mouse button was just pressed. Rather, it describes the
4468 state of the mouse button before the event happened.
4469
4470 This event is usually used in the mouse event handlers which process
4471 "move mouse" messages to determine whether the user is (still)
4472 dragging the mouse.
4473 """
54f9ee45 4474 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
4475
4476 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4477 """
4478 MiddleIsDown(self) -> bool
4479
4480 Returns true if the middle mouse button is currently down, independent
4481 of the current event type.
4482 """
54f9ee45 4483 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
4484
4485 def RightIsDown(*args, **kwargs):
27fb7603
RD
4486 """
4487 RightIsDown(self) -> bool
4488
4489 Returns true if the right mouse button is currently down, independent
4490 of the current event type.
4491 """
54f9ee45 4492 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
4493
4494 def Dragging(*args, **kwargs):
27fb7603
RD
4495 """
4496 Dragging(self) -> bool
4497
4498 Returns true if this was a dragging event (motion while a button is
4499 depressed).
4500 """
54f9ee45 4501 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
4502
4503 def Moving(*args, **kwargs):
27fb7603
RD
4504 """
4505 Moving(self) -> bool
4506
4507 Returns true if this was a motion event and no mouse buttons were
4508 pressed. If any mouse button is held pressed, then this method returns
4509 false and Dragging returns true.
4510 """
54f9ee45 4511 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
4512
4513 def Entering(*args, **kwargs):
27fb7603
RD
4514 """
4515 Entering(self) -> bool
4516
4517 Returns true if the mouse was entering the window.
4518 """
54f9ee45 4519 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
4520
4521 def Leaving(*args, **kwargs):
27fb7603
RD
4522 """
4523 Leaving(self) -> bool
4524
4525 Returns true if the mouse was leaving the window.
4526 """
54f9ee45 4527 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
4528
4529 def GetPosition(*args, **kwargs):
0df68c9f 4530 """
a95a7133 4531 GetPosition(self) -> Point
e811c8ce 4532
27fb7603
RD
4533 Returns the pixel position of the mouse in window coordinates when the
4534 event happened.
0df68c9f 4535 """
54f9ee45 4536 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4537
4538 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4539 """
4540 GetPositionTuple() -> (x,y)
e811c8ce 4541
27fb7603
RD
4542 Returns the pixel position of the mouse in window coordinates when the
4543 event happened.
0df68c9f 4544 """
54f9ee45 4545 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4546
4547 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4548 """
4549 GetLogicalPosition(self, DC dc) -> Point
4550
4551 Returns the logical mouse position in pixels (i.e. translated
4552 according to the translation set for the DC, which usually indicates
4553 that the window has been scrolled).
4554 """
54f9ee45 4555 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
4556
4557 def GetX(*args, **kwargs):
27fb7603
RD
4558 """
4559 GetX(self) -> int
4560
4561 Returns X coordinate of the physical mouse event position.
4562 """
54f9ee45 4563 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
4564
4565 def GetY(*args, **kwargs):
27fb7603
RD
4566 """
4567 GetY(self) -> int
4568
4569 Returns Y coordinate of the physical mouse event position.
4570 """
54f9ee45 4571 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
4572
4573 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4574 """
4575 GetWheelRotation(self) -> int
4576
4577 Get wheel rotation, positive or negative indicates direction of
4578 rotation. Current devices all send an event when rotation is equal to
4579 +/-WheelDelta, but this allows for finer resolution devices to be
4580 created in the future. Because of this you shouldn't assume that one
4581 event is equal to 1 line or whatever, but you should be able to either
4582 do partial line scrolling or wait until +/-WheelDelta rotation values
4583 have been accumulated before scrolling.
4584 """
54f9ee45 4585 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
4586
4587 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4588 """
4589 GetWheelDelta(self) -> int
4590
4591 Get wheel delta, normally 120. This is the threshold for action to be
4592 taken, and one such action (for example, scrolling one increment)
4593 should occur for each delta.
4594 """
54f9ee45 4595 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce
RD
4596
4597 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4598 """
4599 GetLinesPerAction(self) -> int
4600
4601 Returns the configured number of lines (or whatever) to be scrolled
4602 per wheel action. Defaults to three.
4603 """
54f9ee45 4604 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
4605
4606 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4607 """
4608 IsPageScroll(self) -> bool
4609
4610 Returns true if the system has been setup to do page scrolling with
4611 the mouse wheel instead of line scrolling.
4612 """
54f9ee45
RD
4613 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4614
4615 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4616 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4617 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4618 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4619 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4620 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4621 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4622 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4623 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4624 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4625 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4626 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
0085ce49
RD
4627MouseEvent_swigregister = _core_.MouseEvent_swigregister
4628MouseEvent_swigregister(MouseEvent)
d14a1e28
RD
4629
4630#---------------------------------------------------------------------------
4631
4632class SetCursorEvent(Event):
5ba5649b
RD
4633 """
4634 A SetCursorEvent is generated when the mouse cursor is about to be set
4635 as a result of mouse motion. This event gives the application the
4636 chance to perform specific mouse cursor processing based on the
4637 current position of the mouse within the window. Use the `SetCursor`
4638 method to specify the cursor you want to be displayed.
4639 """
0085ce49
RD
4640 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4641 __repr__ = _swig_repr
4642 def __init__(self, *args, **kwargs):
5ba5649b
RD
4643 """
4644 __init__(self, int x=0, int y=0) -> SetCursorEvent
4645
4646 Construct a new `wx.SetCursorEvent`.
4647 """
0085ce49 4648 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
e811c8ce 4649 def GetX(*args, **kwargs):
5ba5649b
RD
4650 """
4651 GetX(self) -> int
4652
4653 Returns the X coordinate of the mouse in client coordinates.
4654 """
54f9ee45 4655 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
4656
4657 def GetY(*args, **kwargs):
5ba5649b
RD
4658 """
4659 GetY(self) -> int
4660
4661 Returns the Y coordinate of the mouse in client coordinates.
4662 """
54f9ee45 4663 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
4664
4665 def SetCursor(*args, **kwargs):
5ba5649b
RD
4666 """
4667 SetCursor(self, Cursor cursor)
4668
4669 Sets the cursor associated with this event.
4670 """
54f9ee45 4671 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
4672
4673 def GetCursor(*args, **kwargs):
5ba5649b
RD
4674 """
4675 GetCursor(self) -> Cursor
4676
4677 Returns a reference to the cursor specified by this event.
4678 """
54f9ee45 4679 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
4680
4681 def HasCursor(*args, **kwargs):
5ba5649b
RD
4682 """
4683 HasCursor(self) -> bool
4684
4685 Returns true if the cursor specified by this event is a valid cursor.
4686 """
54f9ee45 4687 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 4688
0085ce49
RD
4689SetCursorEvent_swigregister = _core_.SetCursorEvent_swigregister
4690SetCursorEvent_swigregister(SetCursorEvent)
d14a1e28
RD
4691
4692#---------------------------------------------------------------------------
4693
4694class KeyEvent(Event):
5ba5649b
RD
4695 """
4696 This event class contains information about keypress and character
4697 events. These events are only sent to the widget that currently has
4698 the keyboard focus.
4699
4700 Notice that there are three different kinds of keyboard events in
4701 wxWidgets: key down and up events and char events. The difference
4702 between the first two is clear - the first corresponds to a key press
4703 and the second to a key release - otherwise they are identical. Just
4704 note that if the key is maintained in a pressed state you will
4705 typically get a lot of (automatically generated) down events but only
4706 one up so it is wrong to assume that there is one up event
4707 corresponding to each down one.
4708
4709 Both key events provide untranslated key codes while the char event
4710 carries the translated one. The untranslated code for alphanumeric
4711 keys is always an upper case value. For the other keys it is one of
4712 WXK_XXX values from the keycodes table. The translated key is, in
4713 general, the character the user expects to appear as the result of the
4714 key combination when typing the text into a text entry zone, for
4715 example.
4716
4717 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4718 and the standard US keyboard): when the 'A' key is pressed, the key
4719 down event key code is equal to ASCII A == 65. But the char event key
4720 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4721 'A' keys simultaneously , the key code in key down event will still be
4722 just 'A' while the char event key code parameter will now be 'A' as
4723 well.
4724
4725 Although in this simple case it is clear that the correct key code
4726 could be found in the key down event handler by checking the value
4727 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4728 as for non alphanumeric keys or non-US keyboard layouts the
4729 translation is keyboard-layout dependent and can only be done properly
4730 by the system itself.
4731
4732 Another kind of translation is done when the control key is pressed:
4733 for example, for CTRL-A key press the key down event still carries the
4734 same key code 'A' as usual but the char event will have key code of 1,
4735 the ASCII value of this key combination.
4736
4737 You may discover how the other keys on your system behave
4738 interactively by running the KeyEvents sample in the wxPython demo and
4739 pressing some keys while the blue box at the top has the keyboard
4740 focus.
4741
4742 **Note**: If a key down event is caught and the event handler does not
4743 call event.Skip() then the coresponding char event will not
4744 happen. This is by design and enables the programs that handle both
4745 types of events to be a bit simpler.
4746
4747 **Note for Windows programmers**: The key and char events in wxWidgets
4748 are similar to but slightly different from Windows WM_KEYDOWN and
4749 WM_CHAR events. In particular, Alt-x combination will generate a char
4750 event in wxWidgets (unless it is used as an accelerator).
4751
4752 **Tip**: be sure to call event.Skip() for events that you don't
4753 process in key event function, otherwise menu shortcuts may cease to
4754 work under Windows.
4755
4756 """
0085ce49
RD
4757 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4758 __repr__ = _swig_repr
4759 def __init__(self, *args, **kwargs):
5ba5649b
RD
4760 """
4761 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
4762
4763 Construct a new `wx.KeyEvent`. Valid event types are:
4764 *
4765 """
0085ce49 4766 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4767 def GetModifiers(*args, **kwargs):
4768 """
4769 GetModifiers(self) -> int
4770
4771 Returns a bitmask of the current modifier settings. Can be used to
4772 check if the key event has exactly the given modifiers without having
4773 to explicitly check that the other modifiers are not down. For
4774 example::
4775
4776 if event.GetModifers() == wx.MOD_CONTROL:
4777 DoSomething()
4778
4779 """
4780 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4781
e811c8ce 4782 def ControlDown(*args, **kwargs):
5ba5649b
RD
4783 """
4784 ControlDown(self) -> bool
4785
4786 Returns ``True`` if the Control key was down at the time of the event.
4787 """
54f9ee45 4788 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4789
4790 def MetaDown(*args, **kwargs):
5ba5649b
RD
4791 """
4792 MetaDown(self) -> bool
4793
4794 Returns ``True`` if the Meta key was down at the time of the event.
4795 """
54f9ee45 4796 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4797
4798 def AltDown(*args, **kwargs):
5ba5649b
RD
4799 """
4800 AltDown(self) -> bool
4801
4802 Returns ``True`` if the Alt key was down at the time of the event.
4803 """
54f9ee45 4804 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4805
4806 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4807 """
4808 ShiftDown(self) -> bool
4809
4810 Returns ``True`` if the Shift key was down at the time of the event.
4811 """
54f9ee45 4812 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 4813
412d302d
RD
4814 def CmdDown(*args, **kwargs):
4815 """
4816 CmdDown(self) -> bool
4817
4818 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4819 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4820 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4821 because Cmd key is used for the same thing under Mac as Ctrl
4822 elsewhere. The Ctrl still exists, it's just not used for this
4823 purpose. So for non-Mac platforms this is the same as `ControlDown`
4824 and Macs this is the same as `MetaDown`.
4825 """
4826 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4827
e811c8ce 4828 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4829 """
4830 HasModifiers(self) -> bool
4831
4832 Returns true if either CTRL or ALT keys was down at the time of the
4833 key event. Note that this function does not take into account neither
4834 SHIFT nor META key states (the reason for ignoring the latter is that
4835 it is common for NUMLOCK key to be configured as META under X but the
4836 key presses even while NUMLOCK is on should be still processed
4837 normally).
4838 """
54f9ee45 4839 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
4840
4841 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4842 """
4843 GetKeyCode(self) -> int
4844
4845 Returns the virtual key code. ASCII events return normal ASCII values,
4846 while non-ASCII events return values such as WXK_LEFT for the left
4847 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4848 codes.
4849
4850 Note that in Unicode build, the returned value is meaningful only if
4851 the user entered a character that can be represented in current
4852 locale's default charset. You can obtain the corresponding Unicode
4853 character using `GetUnicodeKey`.
4854 """
54f9ee45 4855 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 4856
d14a1e28 4857 KeyCode = GetKeyCode
19272049 4858 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4859 """
4860 GetUnicodeKey(self) -> int
4861
4862 Returns the Unicode character corresponding to this key event. This
4863 function is only meaningfule in a Unicode build of wxPython.
4864 """
19272049 4865 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 4866
19272049 4867 GetUniChar = GetUnicodeKey
e811c8ce 4868 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4869 """
4870 GetRawKeyCode(self) -> unsigned int
4871
4872 Returns the raw key code for this event. This is a platform-dependent
4873 scan code which should only be used in advanced
4874 applications. Currently the raw key codes are not supported by all
4875 ports.
4876 """
54f9ee45 4877 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
4878
4879 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4880 """
4881 GetRawKeyFlags(self) -> unsigned int
4882
4883 Returns the low level key flags for this event. The flags are
4884 platform-dependent and should only be used in advanced applications.
4885 Currently the raw key flags are not supported by all ports.
4886 """
54f9ee45 4887 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
4888
4889 def GetPosition(*args, **kwargs):
0df68c9f 4890 """
a95a7133 4891 GetPosition(self) -> Point
e811c8ce 4892
5ba5649b 4893 Find the position of the event, if applicable.
0df68c9f 4894 """
54f9ee45 4895 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4896
4897 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4898 """
4899 GetPositionTuple() -> (x,y)
e811c8ce 4900
5ba5649b 4901 Find the position of the event, if applicable.
0df68c9f 4902 """
54f9ee45 4903 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4904
4905 def GetX(*args, **kwargs):
5ba5649b
RD
4906 """
4907 GetX(self) -> int
4908
4909 Returns the X position (in client coordinates) of the event, if
4910 applicable.
4911 """
54f9ee45 4912 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
4913
4914 def GetY(*args, **kwargs):
5ba5649b
RD
4915 """
4916 GetY(self) -> int
4917
4918 Returns the Y position (in client coordinates) of the event, if
4919 applicable.
4920 """
54f9ee45
RD
4921 return _core_.KeyEvent_GetY(*args, **kwargs)
4922
4923 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4924 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4925 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4926 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4927 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4928 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4929 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4930 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4931 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4932 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
0085ce49
RD
4933KeyEvent_swigregister = _core_.KeyEvent_swigregister
4934KeyEvent_swigregister(KeyEvent)
d14a1e28
RD
4935
4936#---------------------------------------------------------------------------
4937
4938class SizeEvent(Event):
5ba5649b
RD
4939 """
4940 A size event holds information about size change events. The EVT_SIZE
4941 handler function will be called when the window it is bound to has
4942 been resized.
4943
4944 Note that the size passed is of the whole window: call
4945 `wx.Window.GetClientSize` for the area which may be used by the
4946 application.
4947
4948 When a window is resized, usually only a small part of the window is
4949 damaged and and that area is all that is in the update region for the
4950 next paint event. However, if your drawing depends on the size of the
4951 window, you may need to clear the DC explicitly and repaint the whole
4952 window. In which case, you may need to call `wx.Window.Refresh` to
4953 invalidate the entire window.
4954
4955 """
0085ce49
RD
4956 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4957 __repr__ = _swig_repr
4958 def __init__(self, *args, **kwargs):
5ba5649b
RD
4959 """
4960 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4961
4962 Construct a new ``wx.SizeEvent``.
4963 """
0085ce49 4964 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
e811c8ce 4965 def GetSize(*args, **kwargs):
5ba5649b
RD
4966 """
4967 GetSize(self) -> Size
4968
4969 Returns the entire size of the window generating the size change
4970 event.
4971 """
54f9ee45 4972 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
4973
4974 def GetRect(*args, **kwargs):
a95a7133 4975 """GetRect(self) -> Rect"""
54f9ee45 4976 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
4977
4978 def SetRect(*args, **kwargs):
a95a7133 4979 """SetRect(self, Rect rect)"""
54f9ee45 4980 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
4981
4982 def SetSize(*args, **kwargs):
a95a7133 4983 """SetSize(self, Size size)"""
54f9ee45 4984 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 4985
54f9ee45
RD
4986 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4987 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
0085ce49
RD
4988SizeEvent_swigregister = _core_.SizeEvent_swigregister
4989SizeEvent_swigregister(SizeEvent)
d14a1e28
RD
4990
4991#---------------------------------------------------------------------------
4992
4993class MoveEvent(Event):
5ba5649b
RD
4994 """
4995 This event object is sent for EVT_MOVE event bindings when a window is
4996 moved to a new position.
4997 """
0085ce49
RD
4998 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4999 __repr__ = _swig_repr
5000 def __init__(self, *args, **kwargs):
5ba5649b
RD
5001 """
5002 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5003
5004 Constructor.
5005 """
0085ce49 5006 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
e811c8ce 5007 def GetPosition(*args, **kwargs):
5ba5649b
RD
5008 """
5009 GetPosition(self) -> Point
5010
5011 Returns the position of the window generating the move change event.
5012 """
54f9ee45 5013 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5014
5015 def GetRect(*args, **kwargs):
a95a7133 5016 """GetRect(self) -> Rect"""
54f9ee45 5017 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5018
5019 def SetRect(*args, **kwargs):
a95a7133 5020 """SetRect(self, Rect rect)"""
54f9ee45 5021 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5022
5023 def SetPosition(*args, **kwargs):
a95a7133 5024 """SetPosition(self, Point pos)"""
54f9ee45 5025 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 5026
7557b9b5
RD
5027 m_pos = property(GetPosition, SetPosition)
5028 m_rect = property(GetRect, SetRect)
5029
0085ce49
RD
5030MoveEvent_swigregister = _core_.MoveEvent_swigregister
5031MoveEvent_swigregister(MoveEvent)
d14a1e28
RD
5032
5033#---------------------------------------------------------------------------
5034
5035class PaintEvent(Event):
5ba5649b
RD
5036 """
5037 A paint event is sent when a window's contents needs to be repainted.
5038 Note that in an EVT_PAINT handler the application must *always* create
5039 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5040 Windows assumes that the window has not been painted yet and will send
5041 the event again, causing endless refreshes.
5042
5043 You can optimize painting by retrieving the rectangles that have been
5044 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5045 and only repainting these rectangles. The rectangles are in terms of
5046 the client area, and are unscrolled, so you will need to do some
5047 calculations using the current view position to obtain logical,
5048 scrolled units.
5049
5050 """
0085ce49
RD
5051 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5052 __repr__ = _swig_repr
5053 def __init__(self, *args, **kwargs):
a95a7133 5054 """__init__(self, int Id=0) -> PaintEvent"""
0085ce49
RD
5055 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5056PaintEvent_swigregister = _core_.PaintEvent_swigregister
5057PaintEvent_swigregister(PaintEvent)
d14a1e28
RD
5058
5059class NcPaintEvent(Event):
093d3ff1 5060 """Proxy of C++ NcPaintEvent class"""
0085ce49
RD
5061 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5062 __repr__ = _swig_repr
5063 def __init__(self, *args, **kwargs):
a95a7133 5064 """__init__(self, int winid=0) -> NcPaintEvent"""
0085ce49
RD
5065 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5066NcPaintEvent_swigregister = _core_.NcPaintEvent_swigregister
5067NcPaintEvent_swigregister(NcPaintEvent)
d14a1e28
RD
5068
5069#---------------------------------------------------------------------------
5070
5071class EraseEvent(Event):
5ba5649b
RD
5072 """
5073 An erase event is sent whenever the background of a window needs to be
5074 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5075 binder. On some platforms, such as GTK+, this event is simulated
5076 (simply generated just before the paint event) and may cause flicker.
5077
5078 To paint a custom background use the `GetDC` method and use the returned
5079 device context if it is not ``None``, otherwise create a temporary
5080 `wx.ClientDC` and draw on that.
5081
5082 """
0085ce49
RD
5083 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5084 __repr__ = _swig_repr
5085 def __init__(self, *args, **kwargs):
5ba5649b
RD
5086 """
5087 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5088
5089 Constructor
5090 """
0085ce49 5091 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
e811c8ce 5092 def GetDC(*args, **kwargs):
5ba5649b
RD
5093 """
5094 GetDC(self) -> DC
5095
5096 Returns the device context the event handler should draw upon. If
5097 ``None`` is returned then create a temporary `wx.ClientDC` and use
5098 that instead.
5099 """
54f9ee45 5100 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 5101
0085ce49
RD
5102EraseEvent_swigregister = _core_.EraseEvent_swigregister
5103EraseEvent_swigregister(EraseEvent)
d14a1e28
RD
5104
5105#---------------------------------------------------------------------------
5106
5107class FocusEvent(Event):
5ba5649b
RD
5108 """
5109 A focus event is sent when a window's focus changes. The window losing
5110 focus receives an EVT_KILL_FOCUS event while the window gaining it
5111 gets an EVT_SET_FOCUS event.
5112
5113 Notice that the set focus event happens both when the user gives focus
5114 to the window (whether using the mouse or keyboard) and when it is
5115 done from the program itself using `wx.Window.SetFocus`.
5116
5117 """
0085ce49
RD
5118 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5119 __repr__ = _swig_repr
5120 def __init__(self, *args, **kwargs):
5ba5649b
RD
5121 """
5122 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5123
5124 Constructor
5125 """
0085ce49 5126 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
e811c8ce 5127 def GetWindow(*args, **kwargs):
5ba5649b
RD
5128 """
5129 GetWindow(self) -> Window
5130
5131 Returns the other window associated with this event, that is the
5132 window which had the focus before for the EVT_SET_FOCUS event and the
5133 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5134
5135 Warning: the window returned may be None!
5136 """
54f9ee45 5137 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
5138
5139 def SetWindow(*args, **kwargs):
a95a7133 5140 """SetWindow(self, Window win)"""
54f9ee45 5141 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 5142
0085ce49
RD
5143FocusEvent_swigregister = _core_.FocusEvent_swigregister
5144FocusEvent_swigregister(FocusEvent)
d14a1e28
RD
5145
5146#---------------------------------------------------------------------------
5147
5148class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5149 """
5150 wx.ChildFocusEvent notifies the parent that a child has received the
5151 focus. Unlike `wx.FocusEvent` it is propagated up the window
5152 heirarchy.
5153 """
0085ce49
RD
5154 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5155 __repr__ = _swig_repr
5156 def __init__(self, *args, **kwargs):
5ba5649b
RD
5157 """
5158 __init__(self, Window win=None) -> ChildFocusEvent
5159
5160 Constructor
5161 """
0085ce49 5162 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
e811c8ce 5163 def GetWindow(*args, **kwargs):
5ba5649b
RD
5164 """
5165 GetWindow(self) -> Window
5166
5167 The window which has just received the focus.
5168 """
54f9ee45 5169 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 5170
0085ce49
RD
5171ChildFocusEvent_swigregister = _core_.ChildFocusEvent_swigregister
5172ChildFocusEvent_swigregister(ChildFocusEvent)
d14a1e28
RD
5173
5174#---------------------------------------------------------------------------
5175
5176class ActivateEvent(Event):
5ba5649b
RD
5177 """
5178 An activate event is sent when a top-level window or the entire
5179 application is being activated or deactivated.
5180
5181 A top-level window (a dialog or frame) receives an activate event when
5182 is being activated or deactivated. This is indicated visually by the
5183 title bar changing colour, and a subwindow gaining the keyboard focus.
5184 An application is activated or deactivated when one of its frames
5185 becomes activated, or a frame becomes inactivate resulting in all
5186 application frames being inactive.
5187
5188 Please note that usually you should call event.Skip() in your handlers
5189 for these events so the default handlers will still be called, as not
5190 doing so can result in strange effects.
5191
5192 """
0085ce49
RD
5193 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5194 __repr__ = _swig_repr
5195 def __init__(self, *args, **kwargs):
5ba5649b
RD
5196 """
5197 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5198
5199 Constructor
5200 """
0085ce49 5201 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
e811c8ce 5202 def GetActive(*args, **kwargs):
5ba5649b
RD
5203 """
5204 GetActive(self) -> bool
5205
5206 Returns true if the application or window is being activated, false
5207 otherwise.
5208 """
54f9ee45 5209 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 5210
0085ce49
RD
5211ActivateEvent_swigregister = _core_.ActivateEvent_swigregister
5212ActivateEvent_swigregister(ActivateEvent)
d14a1e28
RD
5213
5214#---------------------------------------------------------------------------
5215
5216class InitDialogEvent(Event):
5ba5649b
RD
5217 """
5218 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5219 any window when `wx.Window.InitDialog` is called. Handlers for this
5220 event can transfer data to the window, or anything else that should be
5221 done before the user begins editing the form. The default handler
5222 calls `wx.Window.TransferDataToWindow`.
5223 """
0085ce49
RD
5224 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5225 __repr__ = _swig_repr
5226 def __init__(self, *args, **kwargs):
5ba5649b
RD
5227 """
5228 __init__(self, int Id=0) -> InitDialogEvent
5229
5230 Constructor
5231 """
0085ce49
RD
5232 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5233InitDialogEvent_swigregister = _core_.InitDialogEvent_swigregister
5234InitDialogEvent_swigregister(InitDialogEvent)
d14a1e28
RD
5235
5236#---------------------------------------------------------------------------
5237
5238class MenuEvent(Event):
5ba5649b
RD
5239 """
5240 This class is used for a variety of menu-related events. Note that
5241 these do not include menu command events, which are handled by sending
5242 `wx.CommandEvent` objects.
5243
5244 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5245 text in the first field of the status bar.
5246 """
0085ce49
RD
5247 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5248 __repr__ = _swig_repr
5249 def __init__(self, *args, **kwargs):
5ba5649b
RD
5250 """
5251 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5252
5253 Constructor
5254 """
0085ce49 5255 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
e811c8ce 5256 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5257 """
5258 GetMenuId(self) -> int
5259
5260 Returns the menu identifier associated with the event. This method
5261 should be only used with the HIGHLIGHT events.
5262 """
54f9ee45 5263 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
5264
5265 def IsPopup(*args, **kwargs):
5ba5649b
RD
5266 """
5267 IsPopup(self) -> bool
5268
5269 Returns ``True`` if the menu which is being opened or closed is a
5270 popup menu, ``False`` if it is a normal one. This method should only
5271 be used with the OPEN and CLOSE events.
5272 """
54f9ee45 5273 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
5274
5275 def GetMenu(*args, **kwargs):
5ba5649b
RD
5276 """
5277 GetMenu(self) -> Menu
5278
5279 Returns the menu which is being opened or closed. This method should
5280 only be used with the OPEN and CLOSE events.
5281 """
54f9ee45 5282 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 5283
0085ce49
RD
5284MenuEvent_swigregister = _core_.MenuEvent_swigregister
5285MenuEvent_swigregister(MenuEvent)
d14a1e28
RD
5286
5287#---------------------------------------------------------------------------
5288
5289class CloseEvent(Event):
5ba5649b
RD
5290 """
5291 This event class contains information about window and session close
5292 events.
5293
5294 The handler function for EVT_CLOSE is called when the user has tried
5295 to close a a frame or dialog box using the window manager controls or
5296 the system menu. It can also be invoked by the application itself
5297 programmatically, for example by calling the `wx.Window.Close`
5298 function.
5299
5300 You should check whether the application is forcing the deletion of
5301 the window using `CanVeto`. If it returns ``False``, you must destroy
5302 the window using `wx.Window.Destroy`. If the return value is ``True``,
5303 it is up to you whether you respond by destroying the window or not.
5304 For example you may wish to display a message dialog prompting to save
5305 files or to cancel the close.
5306
5307 If you don't destroy the window, you should call `Veto` to let the
5308 calling code know that you did not destroy the window. This allows the
5309 `wx.Window.Close` function to return ``True`` or ``False`` depending
5310 on whether the close instruction was honored or not.
5311 """
0085ce49
RD
5312 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5313 __repr__ = _swig_repr
5314 def __init__(self, *args, **kwargs):
5ba5649b
RD
5315 """
5316 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5317
5318 Constructor.
5319 """
0085ce49 5320 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
e811c8ce 5321 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5322 """
5323 SetLoggingOff(self, bool logOff)
5324
5325 Sets the 'logging off' flag.
5326 """
54f9ee45 5327 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
5328
5329 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5330 """
5331 GetLoggingOff(self) -> bool
5332
6c75a4cf
RD
5333 Returns ``True`` if the user is logging off or ``False`` if the
5334 system is shutting down. This method can only be called for end
5335 session and query end session events, it doesn't make sense for close
5336 window event.
5ba5649b 5337 """
54f9ee45 5338 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
5339
5340 def Veto(*args, **kwargs):
5ba5649b
RD
5341 """
5342 Veto(self, bool veto=True)
5343
5344 Call this from your event handler to veto a system shutdown or to
5345 signal to the calling application that a window close did not happen.
5346
5347 You can only veto a shutdown or close if `CanVeto` returns true.
5348 """
54f9ee45 5349 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce 5350
5ba5649b
RD
5351 def GetVeto(*args, **kwargs):
5352 """GetVeto(self) -> bool"""
5353 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5354
e811c8ce 5355 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5356 """
5357 SetCanVeto(self, bool canVeto)
5358
5359 Sets the 'can veto' flag.
5360 """
54f9ee45 5361 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
5362
5363 def CanVeto(*args, **kwargs):
5ba5649b
RD
5364 """
5365 CanVeto(self) -> bool
e811c8ce 5366
5ba5649b
RD
5367 Returns true if you can veto a system shutdown or a window close
5368 event. Vetoing a window close event is not possible if the calling
5369 code wishes to force the application to exit, and so this function
5370 must be called to check this.
5371 """
5372 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce 5373
0085ce49
RD
5374CloseEvent_swigregister = _core_.CloseEvent_swigregister
5375CloseEvent_swigregister(CloseEvent)
d14a1e28
RD
5376
5377#---------------------------------------------------------------------------
5378
5379class ShowEvent(Event):
5ba5649b 5380 """An EVT_SHOW event is sent when a window is shown or hidden."""
0085ce49
RD
5381 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5382 __repr__ = _swig_repr
5383 def __init__(self, *args, **kwargs):
5ba5649b
RD
5384 """
5385 __init__(self, int winid=0, bool show=False) -> ShowEvent
5386
5387 An EVT_SHOW event is sent when a window is shown or hidden.
5388 """
0085ce49 5389 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
e811c8ce 5390 def SetShow(*args, **kwargs):
a95a7133 5391 """SetShow(self, bool show)"""
54f9ee45 5392 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
5393
5394 def GetShow(*args, **kwargs):
a95a7133 5395 """GetShow(self) -> bool"""
54f9ee45 5396 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 5397
0085ce49
RD
5398ShowEvent_swigregister = _core_.ShowEvent_swigregister
5399ShowEvent_swigregister(ShowEvent)
d14a1e28
RD
5400
5401#---------------------------------------------------------------------------
5402
5403class IconizeEvent(Event):
5ba5649b
RD
5404 """
5405 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5406 restored.
5407 """
0085ce49
RD
5408 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5409 __repr__ = _swig_repr
5410 def __init__(self, *args, **kwargs):
5ba5649b
RD
5411 """
5412 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5413
5414 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5415 restored.
5416 """
0085ce49 5417 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
e811c8ce 5418 def Iconized(*args, **kwargs):
5ba5649b
RD
5419 """
5420 Iconized(self) -> bool
5421
5422 Returns ``True`` if the frame has been iconized, ``False`` if it has
5423 been restored.
5424 """
54f9ee45 5425 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 5426
0085ce49
RD
5427IconizeEvent_swigregister = _core_.IconizeEvent_swigregister
5428IconizeEvent_swigregister(IconizeEvent)
d14a1e28
RD
5429
5430#---------------------------------------------------------------------------
5431
5432class MaximizeEvent(Event):
5ba5649b 5433 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
0085ce49
RD
5434 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5435 __repr__ = _swig_repr
5436 def __init__(self, *args, **kwargs):
5ba5649b
RD
5437 """
5438 __init__(self, int id=0) -> MaximizeEvent
5439
5440 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5441 """
0085ce49
RD
5442 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5443MaximizeEvent_swigregister = _core_.MaximizeEvent_swigregister
5444MaximizeEvent_swigregister(MaximizeEvent)
d14a1e28
RD
5445
5446#---------------------------------------------------------------------------
5447
5448class DropFilesEvent(Event):
5ba5649b
RD
5449 """
5450 This class is used for drop files events, that is, when files have
5451 been dropped onto the window. This functionality is only available
5452 under Windows. The window must have previously been enabled for
5453 dropping by calling `wx.Window.DragAcceptFiles`.
5454
5455 Important note: this is a separate implementation to the more general
5456 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5457 implementation uses the older, Windows message-based approach of
5458 dropping files.
5459
5460 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5461 events.
5462
5463 """
0085ce49
RD
5464 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5465 def __init__(self): raise AttributeError, "No constructor defined"
5466 __repr__ = _swig_repr
e811c8ce 5467 def GetPosition(*args, **kwargs):
5ba5649b
RD
5468 """
5469 GetPosition(self) -> Point
5470
5471 Returns the position at which the files were dropped.
5472 """
54f9ee45 5473 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5474
5475 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5476 """
5477 GetNumberOfFiles(self) -> int
5478
5479 Returns the number of files dropped.
5480 """
54f9ee45 5481 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
5482
5483 def GetFiles(*args, **kwargs):
5ba5649b
RD
5484 """
5485 GetFiles(self) -> PyObject
5486
5487 Returns a list of the filenames that were dropped.
5488 """
54f9ee45 5489 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 5490
0085ce49
RD
5491DropFilesEvent_swigregister = _core_.DropFilesEvent_swigregister
5492DropFilesEvent_swigregister(DropFilesEvent)
d14a1e28
RD
5493
5494#---------------------------------------------------------------------------
5495
54f9ee45
RD
5496UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5497UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 5498class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5499 """
5500 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5501 wxWidgets to give an application the chance to update various user
5502 interface elements.
5503
5504 Without update UI events, an application has to work hard to
5505 check/uncheck, enable/disable, and set the text for elements such as
5506 menu items and toolbar buttons. The code for doing this has to be
5507 mixed up with the code that is invoked when an action is invoked for a
5508 menu item or button.
5509
5510 With update UI events, you define an event handler to look at the
5511 state of the application and change UI elements accordingly. wxWidgets
5512 will call your handler functions in idle time, so you don't have to
5513 worry where to call this code. In addition to being a clearer and more
5514 declarative method, it also means you don't have to worry whether
5515 you're updating a toolbar or menubar identifier. The same handler can
5516 update a menu item and toolbar button, if the ID values are the same.
5517
5518 Instead of directly manipulating the menu or button, you call
5519 functions in the event object, such as `Check`. wxWidgets will
5520 determine whether such a call has been made, and which UI element to
5521 update.
5522
5523 These events will work for popup menus as well as menubars. Just
5524 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5525 any UI events for the window that owns the menu.
5526
5527 If you find that the overhead of UI update processing is affecting
5528 your application, you can do one or both of the following:
5529
5530 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5531 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5532 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5533 receive update events. No other windows will receive update
5534 events.
5535
5536 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5537 value to set the delay between updates. You may need to call
5538 `wx.Window.UpdateWindowUI` at critical points, for example when
5539 a dialog is about to be shown, in case the user sees a slight
5540 delay before windows are updated.
5541
5542 Note that although events are sent in idle time, defining a EVT_IDLE
5543 handler for a window does not affect this because the events are sent
5544 from an internal idle handler.
5545
5546 wxWidgets tries to optimize update events on some platforms. On
5547 Windows and GTK+, events for menubar items are only sent when the menu
5548 is about to be shown, and not in idle time.
5549
5550 """
0085ce49
RD
5551 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5552 __repr__ = _swig_repr
5553 def __init__(self, *args, **kwargs):
5ba5649b
RD
5554 """
5555 __init__(self, int commandId=0) -> UpdateUIEvent
5556
5557 Constructor
5558 """
0085ce49 5559 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
e811c8ce 5560 def GetChecked(*args, **kwargs):
5ba5649b
RD
5561 """
5562 GetChecked(self) -> bool
5563
5564 Returns ``True`` if the UI element should be checked.
5565 """
54f9ee45 5566 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
5567
5568 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5569 """
5570 GetEnabled(self) -> bool
5571
5572 Returns ``True`` if the UI element should be enabled.
5573 """
54f9ee45 5574 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce 5575
b1fcee84
RD
5576 def GetShown(*args, **kwargs):
5577 """
5578 GetShown(self) -> bool
5579
5580 Returns ``True`` if the UI element should be shown.
5581 """
5582 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5583
e811c8ce 5584 def GetText(*args, **kwargs):
5ba5649b
RD
5585 """
5586 GetText(self) -> String
5587
5588 Returns the text that should be set for the UI element.
5589 """
54f9ee45 5590 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
5591
5592 def GetSetText(*args, **kwargs):
5ba5649b
RD
5593 """
5594 GetSetText(self) -> bool
5595
5596 Returns ``True`` if the application has called `SetText`. For
5597 wxWidgets internal use only.
5598 """
54f9ee45 5599 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
5600
5601 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5602 """
5603 GetSetChecked(self) -> bool
5604
5605 Returns ``True`` if the application has called `Check`. For wxWidgets
5606 internal use only.
5607 """
54f9ee45 5608 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
5609
5610 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5611 """
5612 GetSetEnabled(self) -> bool
5613
5614 Returns ``True`` if the application has called `Enable`. For wxWidgets
5615 internal use only.
5616 """
54f9ee45 5617 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce 5618
b1fcee84
RD
5619 def GetSetShown(*args, **kwargs):
5620 """
5621 GetSetShown(self) -> bool
5622
5623 Returns ``True`` if the application has called `Show`. For wxWidgets
5624 internal use only.
5625 """
5626 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5627
e811c8ce 5628 def Check(*args, **kwargs):
5ba5649b
RD
5629 """
5630 Check(self, bool check)
5631
5632 Check or uncheck the UI element.
5633 """
54f9ee45 5634 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
5635
5636 def Enable(*args, **kwargs):
5ba5649b
RD
5637 """
5638 Enable(self, bool enable)
5639
5640 Enable or disable the UI element.
5641 """
54f9ee45 5642 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce 5643
b1fcee84
RD
5644 def Show(*args, **kwargs):
5645 """
5646 Show(self, bool show)
5647
5648 Show or hide the UI element.
5649 """
5650 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5651
e811c8ce 5652 def SetText(*args, **kwargs):
5ba5649b
RD
5653 """
5654 SetText(self, String text)
5655
5656 Sets the text for this UI element.
5657 """
54f9ee45 5658 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
5659
5660 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5661 """
5662 SetUpdateInterval(long updateInterval)
5663
5664 Sets the interval between updates in milliseconds. Set to -1 to
5665 disable updates, or to 0 to update as frequently as possible. The
5666 default is 0.
5667
5668 Use this to reduce the overhead of UI update events if your
5669 application has a lot of windows. If you set the value to -1 or
5670 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5671 at appropriate points in your application, such as when a dialog is
5672 about to be shown.
5673 """
54f9ee45 5674 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
5675
5676 SetUpdateInterval = staticmethod(SetUpdateInterval)
5677 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5678 """
5679 GetUpdateInterval() -> long
5680
5681 Returns the current interval between updates in milliseconds. -1
5682 disables updates, 0 updates as frequently as possible.
5683 """
54f9ee45 5684 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
5685
5686 GetUpdateInterval = staticmethod(GetUpdateInterval)
5687 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5688 """
5689 CanUpdate(Window win) -> bool
5690
5691 Returns ``True`` if it is appropriate to update (send UI update events
5692 to) this window.
5693
5694 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5695 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5696 events were last sent in idle time, and the update interval, to
5697 determine whether events should be sent to this window now. By default
5698 this will always return true because the update mode is initially
5699 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5700 events will be sent as often as possible. You can reduce the frequency
5701 that events are sent by changing the mode and/or setting an update
5702 interval.
5703
5704 """
54f9ee45 5705 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
5706
5707 CanUpdate = staticmethod(CanUpdate)
5708 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5709 """
5710 ResetUpdateTime()
5711
5712 Used internally to reset the last-updated time to the current time. It
5713 is assumed that update events are normally sent in idle time, so this
5714 is called at the end of idle processing.
5715 """
54f9ee45 5716 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
5717
5718 ResetUpdateTime = staticmethod(ResetUpdateTime)
5719 def SetMode(*args, **kwargs):
5ba5649b
RD
5720 """
5721 SetMode(int mode)
5722
5723 Specify how wxWidgets will send update events: to all windows, or only
5724 to those which specify that they will process the events.
5725
5726 The mode may be one of the following values:
5727
5728 ============================= ==========================================
5729 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5730 is the default setting.
5731 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5732 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5733 style set.
5734 ============================= ==========================================
5735
5736 """
54f9ee45 5737 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
5738
5739 SetMode = staticmethod(SetMode)
5740 def GetMode(*args, **kwargs):
5ba5649b
RD
5741 """
5742 GetMode() -> int
5743
5744 Returns a value specifying how wxWidgets will send update events: to
5745 all windows, or only to those which specify that they will process the
5746 events.
5747 """
54f9ee45 5748 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
5749
5750 GetMode = staticmethod(GetMode)
0085ce49
RD
5751UpdateUIEvent_swigregister = _core_.UpdateUIEvent_swigregister
5752UpdateUIEvent_swigregister(UpdateUIEvent)
d14a1e28 5753
e811c8ce 5754def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
0085ce49 5755 """
5ba5649b
RD
5756 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5757
5758 Sets the interval between updates in milliseconds. Set to -1 to
5759 disable updates, or to 0 to update as frequently as possible. The
5760 default is 0.
5761
5762 Use this to reduce the overhead of UI update events if your
5763 application has a lot of windows. If you set the value to -1 or
5764 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5765 at appropriate points in your application, such as when a dialog is
5766 about to be shown.
5767 """
0085ce49 5768 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 5769
0085ce49
RD
5770def UpdateUIEvent_GetUpdateInterval(*args):
5771 """
5ba5649b
RD
5772 UpdateUIEvent_GetUpdateInterval() -> long
5773
5774 Returns the current interval between updates in milliseconds. -1
5775 disables updates, 0 updates as frequently as possible.
5776 """
0085ce49 5777 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d14a1e28 5778
e811c8ce 5779def UpdateUIEvent_CanUpdate(*args, **kwargs):
0085ce49 5780 """
5ba5649b
RD
5781 UpdateUIEvent_CanUpdate(Window win) -> bool
5782
5783 Returns ``True`` if it is appropriate to update (send UI update events
5784 to) this window.
5785
5786 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5787 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5788 events were last sent in idle time, and the update interval, to
5789 determine whether events should be sent to this window now. By default
5790 this will always return true because the update mode is initially
5791 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5792 events will be sent as often as possible. You can reduce the frequency
5793 that events are sent by changing the mode and/or setting an update
5794 interval.
5795
5796 """
0085ce49 5797 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 5798
0085ce49
RD
5799def UpdateUIEvent_ResetUpdateTime(*args):
5800 """
5ba5649b
RD
5801 UpdateUIEvent_ResetUpdateTime()
5802
5803 Used internally to reset the last-updated time to the current time. It
5804 is assumed that update events are normally sent in idle time, so this
5805 is called at the end of idle processing.
5806 """
0085ce49 5807 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d14a1e28 5808
e811c8ce 5809def UpdateUIEvent_SetMode(*args, **kwargs):
0085ce49 5810 """
5ba5649b
RD
5811 UpdateUIEvent_SetMode(int mode)
5812
5813 Specify how wxWidgets will send update events: to all windows, or only
5814 to those which specify that they will process the events.
5815
5816 The mode may be one of the following values:
5817
5818 ============================= ==========================================
5819 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5820 is the default setting.
5821 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5822 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5823 style set.
5824 ============================= ==========================================
5825
5826 """
0085ce49 5827 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 5828
0085ce49
RD
5829def UpdateUIEvent_GetMode(*args):
5830 """
5ba5649b
RD
5831 UpdateUIEvent_GetMode() -> int
5832
5833 Returns a value specifying how wxWidgets will send update events: to
5834 all windows, or only to those which specify that they will process the
5835 events.
5836 """
0085ce49 5837 return _core_.UpdateUIEvent_GetMode(*args)
d14a1e28
RD
5838
5839#---------------------------------------------------------------------------
5840
5841class SysColourChangedEvent(Event):
5ba5649b
RD
5842 """
5843 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5844 when the user changes the colour settings using the control
5845 panel. This is only applicable under Windows.
5846
5847 The default event handler for this event propagates the event to child
5848 windows, since Windows only sends the events to top-level windows. If
5849 intercepting this event for a top-level window, remember to call
5850 `Skip` so the the base class handler will still be executed, or to
5851 pass the event on to the window's children explicitly.
5852
5853 """
0085ce49
RD
5854 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5855 __repr__ = _swig_repr
5856 def __init__(self, *args, **kwargs):
5ba5649b
RD
5857 """
5858 __init__(self) -> SysColourChangedEvent
5859
5860 Constructor
5861 """
0085ce49
RD
5862 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5863SysColourChangedEvent_swigregister = _core_.SysColourChangedEvent_swigregister
5864SysColourChangedEvent_swigregister(SysColourChangedEvent)
d14a1e28
RD
5865
5866#---------------------------------------------------------------------------
5867
5868class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5869 """
5870 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5871 a window that loses its mouse capture. This is called even if
5872 `wx.Window.ReleaseMouse` was called by the application code. Handling
5873 this event allows an application to cater for unexpected capture
5874 releases which might otherwise confuse mouse handling code.
5875
5876 This event is implemented under Windows only.
5877 """
0085ce49
RD
5878 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5879 __repr__ = _swig_repr
5880 def __init__(self, *args, **kwargs):
5ba5649b
RD
5881 """
5882 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5883
5884 Constructor
5885 """
0085ce49 5886 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
e811c8ce 5887 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5888 """
5889 GetCapturedWindow(self) -> Window
5890
5891 Returns the window that gained the capture, or ``None`` if it was a
5892 non-wxWidgets window.
5893 """
54f9ee45 5894 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 5895
0085ce49
RD
5896MouseCaptureChangedEvent_swigregister = _core_.MouseCaptureChangedEvent_swigregister
5897MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d14a1e28
RD
5898
5899#---------------------------------------------------------------------------
5900
5901class DisplayChangedEvent(Event):
5ba5649b
RD
5902 """
5903 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5904 resolution has changed.
5905
5906 This event is implemented under Windows only.
5907 """
0085ce49
RD
5908 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5909 __repr__ = _swig_repr
5910 def __init__(self, *args, **kwargs):
a95a7133 5911 """__init__(self) -> DisplayChangedEvent"""
0085ce49
RD
5912 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
5913DisplayChangedEvent_swigregister = _core_.DisplayChangedEvent_swigregister
5914DisplayChangedEvent_swigregister(DisplayChangedEvent)
d14a1e28
RD
5915
5916#---------------------------------------------------------------------------
5917
5918class PaletteChangedEvent(Event):
5ba5649b
RD
5919 """
5920 An EVT_PALETTE_CHANGED event is sent when the system palette has
5921 changed, thereby giving each window a chance to redo their own to
5922 match.
5923
5924 This event is implemented under Windows only.
5925 """
0085ce49
RD
5926 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5927 __repr__ = _swig_repr
5928 def __init__(self, *args, **kwargs):
5ba5649b
RD
5929 """
5930 __init__(self, int id=0) -> PaletteChangedEvent
5931
5932 An EVT_PALETTE_CHANGED event is sent when the system palette has
5933 changed, thereby giving each window a chance to redo their own to
5934 match.
5935
5936 This event is implemented under Windows only.
5937 """
0085ce49 5938 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
e811c8ce 5939 def SetChangedWindow(*args, **kwargs):
a95a7133 5940 """SetChangedWindow(self, Window win)"""
54f9ee45 5941 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
5942
5943 def GetChangedWindow(*args, **kwargs):
a95a7133 5944 """GetChangedWindow(self) -> Window"""
54f9ee45 5945 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 5946
0085ce49
RD
5947PaletteChangedEvent_swigregister = _core_.PaletteChangedEvent_swigregister
5948PaletteChangedEvent_swigregister(PaletteChangedEvent)
d14a1e28
RD
5949
5950#---------------------------------------------------------------------------
5951
5952class QueryNewPaletteEvent(Event):
5ba5649b
RD
5953 """
5954 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5955 focus and should re-do its palette.
5956
5957 This event is implemented under Windows only.
5958 """
0085ce49
RD
5959 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5960 __repr__ = _swig_repr
5961 def __init__(self, *args, **kwargs):
5ba5649b
RD
5962 """
5963 __init__(self, int winid=0) -> QueryNewPaletteEvent
5964
5965 Constructor.
5966 """
0085ce49 5967 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
e811c8ce 5968 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
5969 """
5970 SetPaletteRealized(self, bool realized)
5971
5972 App should set this if it changes the palette.
5973 """
54f9ee45 5974 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
5975
5976 def GetPaletteRealized(*args, **kwargs):
a95a7133 5977 """GetPaletteRealized(self) -> bool"""
54f9ee45 5978 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 5979
0085ce49
RD
5980QueryNewPaletteEvent_swigregister = _core_.QueryNewPaletteEvent_swigregister
5981QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d14a1e28
RD
5982
5983#---------------------------------------------------------------------------
5984
5985class NavigationKeyEvent(Event):
5ba5649b
RD
5986 """
5987 EVT_NAVIGATION_KEY events are used to control moving the focus between
5988 widgets, otherwise known as tab-traversal. You woudl normally not
5989 catch navigation events in applications as there are already
5990 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5991 it useful to send navigation events in certain situations to change
5992 the focus in certain ways, although it's probably easier to just call
5993 `wx.Window.Navigate`.
5994 """
0085ce49
RD
5995 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5996 __repr__ = _swig_repr
5997 def __init__(self, *args, **kwargs):
a95a7133 5998 """__init__(self) -> NavigationKeyEvent"""
0085ce49 5999 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
e811c8ce 6000 def GetDirection(*args, **kwargs):
5ba5649b
RD
6001 """
6002 GetDirection(self) -> bool
6003
6004 Returns ``True`` if the direction is forward, ``False`` otherwise.
6005 """
54f9ee45 6006 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
6007
6008 def SetDirection(*args, **kwargs):
5ba5649b
RD
6009 """
6010 SetDirection(self, bool forward)
6011
6012 Specify the direction that the navigation should take. Usually the
6013 difference between using Tab and Shift-Tab.
6014 """
54f9ee45 6015 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
6016
6017 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6018 """
6019 IsWindowChange(self) -> bool
6020
6021 Returns ``True`` if window change is allowed.
6022 """
54f9ee45 6023 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
6024
6025 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6026 """
6027 SetWindowChange(self, bool ischange)
6028
6029 Specify if the navigation should be able to change parent windows.
6030 For example, changing notebook pages, etc. This is usually implemented
6031 by using Control-Tab.
6032 """
54f9ee45 6033 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 6034
68350608 6035 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6036 """
6037 IsFromTab(self) -> bool
6038
6039 Returns ``True`` if the navigation event is originated from the Tab
6040 key.
6041 """
68350608
RD
6042 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6043
6044 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6045 """
6046 SetFromTab(self, bool bIs)
6047
6048 Set to true under MSW if the event was generated using the tab key.
6049 This is required for proper navogation over radio buttons.
6050 """
68350608
RD
6051 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6052
908b74cd 6053 def SetFlags(*args, **kwargs):
5ba5649b
RD
6054 """
6055 SetFlags(self, long flags)
6056
6057 Set the navigation flags to a combination of the following:
6058
6059 * wx.NavigationKeyEvent.IsBackward
6060 * wx.NavigationKeyEvent.IsForward
6061 * wx.NavigationKeyEvent.WinChange
6062 * wx.NavigationKeyEvent.FromTab
6063
6064 """
908b74cd
RD
6065 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6066
e811c8ce 6067 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6068 """
6069 GetCurrentFocus(self) -> Window
6070
6071 Returns the child window which currenty has the focus. May be
6072 ``None``.
6073 """
54f9ee45 6074 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
6075
6076 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6077 """
6078 SetCurrentFocus(self, Window win)
6079
6080 Set the window that has the focus.
6081 """
54f9ee45 6082 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 6083
b0f7404b 6084 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6085 IsForward = _core_.NavigationKeyEvent_IsForward
6086 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6087 FromTab = _core_.NavigationKeyEvent_FromTab
0085ce49
RD
6088NavigationKeyEvent_swigregister = _core_.NavigationKeyEvent_swigregister
6089NavigationKeyEvent_swigregister(NavigationKeyEvent)
d14a1e28
RD
6090
6091#---------------------------------------------------------------------------
6092
6093class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6094 """
6095 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6096 underlying GUI object) exists.
6097 """
0085ce49
RD
6098 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6099 __repr__ = _swig_repr
6100 def __init__(self, *args, **kwargs):
5ba5649b
RD
6101 """
6102 __init__(self, Window win=None) -> WindowCreateEvent
6103
6104 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6105 underlying GUI object) exists.
6106 """
0085ce49 6107 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
e811c8ce 6108 def GetWindow(*args, **kwargs):
5ba5649b
RD
6109 """
6110 GetWindow(self) -> Window
6111
6112 Returns the window that this event refers to.
6113 """
54f9ee45 6114 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 6115
0085ce49
RD
6116WindowCreateEvent_swigregister = _core_.WindowCreateEvent_swigregister
6117WindowCreateEvent_swigregister(WindowCreateEvent)
d14a1e28
RD
6118
6119class WindowDestroyEvent(CommandEvent):
5ba5649b 6120 """
943e8dfd
RD
6121 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6122 when the GUI window is destroyed.
6123
6124 When a class derived from `wx.Window` is destroyed its destructor will
6125 have already run by the time this event is sent. Therefore this event
6126 will not usually be received at all by the window itself. Since it is
6127 received after the destructor has run, an object should not try to
6128 handle its own wx.WindowDestroyEvent, but it can be used to get
6129 notification of the destruction of another window.
5ba5649b 6130 """
0085ce49
RD
6131 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6132 __repr__ = _swig_repr
6133 def __init__(self, *args, **kwargs):
5ba5649b
RD
6134 """
6135 __init__(self, Window win=None) -> WindowDestroyEvent
6136
943e8dfd
RD
6137 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6138 when the GUI window is destroyed.
6139
6140 When a class derived from `wx.Window` is destroyed its destructor will
6141 have already run by the time this event is sent. Therefore this event
6142 will not usually be received at all by the window itself. Since it is
6143 received after the destructor has run, an object should not try to
6144 handle its own wx.WindowDestroyEvent, but it can be used to get
6145 notification of the destruction of another window.
5ba5649b 6146 """
0085ce49 6147 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
e811c8ce 6148 def GetWindow(*args, **kwargs):
5ba5649b
RD
6149 """
6150 GetWindow(self) -> Window
6151
6152 Returns the window that this event refers to.
6153 """
54f9ee45 6154 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 6155
0085ce49
RD
6156WindowDestroyEvent_swigregister = _core_.WindowDestroyEvent_swigregister
6157WindowDestroyEvent_swigregister(WindowDestroyEvent)
d14a1e28
RD
6158
6159#---------------------------------------------------------------------------
6160
6161class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6162 """
6163 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6164 give the application a chance to show a context (popup) menu.
6165 """
0085ce49
RD
6166 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6167 __repr__ = _swig_repr
6168 def __init__(self, *args, **kwargs):
5ba5649b
RD
6169 """
6170 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6171
6172 Constructor.
6173 """
0085ce49 6174 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
e811c8ce 6175 def GetPosition(*args, **kwargs):
5ba5649b
RD
6176 """
6177 GetPosition(self) -> Point
6178
6179 Returns the position (in screen coordinants) at which the menu should
6180 be shown.
6181 """
54f9ee45 6182 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
6183
6184 def SetPosition(*args, **kwargs):
5ba5649b
RD
6185 """
6186 SetPosition(self, Point pos)
6187
6188 Sets the position at which the menu should be shown.
6189 """
54f9ee45 6190 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 6191
0085ce49
RD
6192ContextMenuEvent_swigregister = _core_.ContextMenuEvent_swigregister
6193ContextMenuEvent_swigregister(ContextMenuEvent)
d14a1e28
RD
6194
6195#---------------------------------------------------------------------------
6196
54f9ee45
RD
6197IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6198IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 6199class IdleEvent(Event):
5ba5649b
RD
6200 """
6201 This class is used for EVT_IDLE events, which are generated and sent
6202 when the application *becomes* idle. In other words, the when the
6203 event queue becomes empty then idle events are sent to all windows (by
6204 default) and as long as none of them call `RequestMore` then there are
6205 no more idle events until after the system event queue has some normal
6206 events and then becomes empty again.
6207
6208 By default, idle events are sent to all windows. If this is causing a
6209 significant overhead in your application, you can call
6210 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6211 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6212 which should receive idle events. Then idle events will only be sent
6213 to those windows and not to any others.
6214 """
0085ce49
RD
6215 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6216 __repr__ = _swig_repr
6217 def __init__(self, *args, **kwargs):
5ba5649b
RD
6218 """
6219 __init__(self) -> IdleEvent
6220
6221 Constructor
6222 """
0085ce49 6223 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
e811c8ce 6224 def RequestMore(*args, **kwargs):
5ba5649b
RD
6225 """
6226 RequestMore(self, bool needMore=True)
6227
6228 Tells wxWidgets that more processing is required. This function can be
6229 called by an EVT_IDLE handler for a window to indicate that the
6230 application should forward the EVT_IDLE event once more to the
6231 application windows. If no window calls this function during its
6232 EVT_IDLE handler, then the application will remain in a passive event
6233 loop until a new event is posted to the application by the windowing
6234 system.
6235 """
54f9ee45 6236 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
6237
6238 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6239 """
6240 MoreRequested(self) -> bool
6241
6242 Returns ``True`` if the OnIdle function processing this event
6243 requested more processing time.
6244 """
54f9ee45 6245 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
6246
6247 def SetMode(*args, **kwargs):
5ba5649b
RD
6248 """
6249 SetMode(int mode)
6250
6251 Static method for specifying how wxWidgets will send idle events: to
6252 all windows, or only to those which specify that they will process the
6253 events.
6254
6255 The mode can be one of the following values:
6256
6257 ========================= ========================================
6258 wx.IDLE_PROCESS_ALL Send idle events to all windows
6259 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6260 the wx.WS_EX_PROCESS_IDLE extra style
6261 flag set.
6262 ========================= ========================================
6263
6264 """
54f9ee45 6265 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6266
6267 SetMode = staticmethod(SetMode)
6268 def GetMode(*args, **kwargs):
5ba5649b
RD
6269 """
6270 GetMode() -> int
6271
6272 Static method returning a value specifying how wxWidgets will send
6273 idle events: to all windows, or only to those which specify that they
6274 will process the events.
6275 """
54f9ee45 6276 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6277
6278 GetMode = staticmethod(GetMode)
6279 def CanSend(*args, **kwargs):
5ba5649b
RD
6280 """
6281 CanSend(Window win) -> bool
6282
6283 Returns ``True`` if it is appropriate to send idle events to this
6284 window.
6285
6286 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6287 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6288 events should be sent to this window now. By default this will always
6289 return ``True`` because the update mode is initially
6290 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6291 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6292 """
54f9ee45 6293 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
6294
6295 CanSend = staticmethod(CanSend)
0085ce49
RD
6296IdleEvent_swigregister = _core_.IdleEvent_swigregister
6297IdleEvent_swigregister(IdleEvent)
d14a1e28 6298
e811c8ce 6299def IdleEvent_SetMode(*args, **kwargs):
0085ce49 6300 """
5ba5649b
RD
6301 IdleEvent_SetMode(int mode)
6302
6303 Static method for specifying how wxWidgets will send idle events: to
6304 all windows, or only to those which specify that they will process the
6305 events.
6306
6307 The mode can be one of the following values:
6308
6309 ========================= ========================================
6310 wx.IDLE_PROCESS_ALL Send idle events to all windows
6311 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6312 the wx.WS_EX_PROCESS_IDLE extra style
6313 flag set.
6314 ========================= ========================================
6315
6316 """
0085ce49 6317 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 6318
0085ce49
RD
6319def IdleEvent_GetMode(*args):
6320 """
5ba5649b
RD
6321 IdleEvent_GetMode() -> int
6322
6323 Static method returning a value specifying how wxWidgets will send
6324 idle events: to all windows, or only to those which specify that they
6325 will process the events.
6326 """
0085ce49 6327 return _core_.IdleEvent_GetMode(*args)
d14a1e28 6328
e811c8ce 6329def IdleEvent_CanSend(*args, **kwargs):
0085ce49 6330 """
5ba5649b
RD
6331 IdleEvent_CanSend(Window win) -> bool
6332
6333 Returns ``True`` if it is appropriate to send idle events to this
6334 window.
6335
6336 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6337 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6338 events should be sent to this window now. By default this will always
6339 return ``True`` because the update mode is initially
6340 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6341 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6342 """
0085ce49 6343 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
6344
6345#---------------------------------------------------------------------------
6346
6347class PyEvent(Event):
5ba5649b
RD
6348 """
6349 wx.PyEvent can be used as a base class for implementing custom event
6350 types in Python. You should derived from this class instead of
6351 `wx.Event` because this class is Python-aware and is able to transport
6352 its Python bits safely through the wxWidgets event system and have
6353 them still be there when the event handler is invoked.
6354
6355 :see: `wx.PyCommandEvent`
6356
6357 """
0085ce49
RD
6358 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6359 __repr__ = _swig_repr
6360 def __init__(self, *args, **kwargs):
5ba5649b 6361 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
0085ce49 6362 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6363 self._SetSelf(self)
e811c8ce 6364
0085ce49
RD
6365 __swig_destroy__ = _core_.delete_PyEvent
6366 __del__ = lambda self : None;
5ba5649b
RD
6367 def _SetSelf(*args, **kwargs):
6368 """_SetSelf(self, PyObject self)"""
6369 return _core_.PyEvent__SetSelf(*args, **kwargs)
e811c8ce 6370
5ba5649b
RD
6371 def _GetSelf(*args, **kwargs):
6372 """_GetSelf(self) -> PyObject"""
6373 return _core_.PyEvent__GetSelf(*args, **kwargs)
e811c8ce 6374
0085ce49
RD
6375PyEvent_swigregister = _core_.PyEvent_swigregister
6376PyEvent_swigregister(PyEvent)
d14a1e28
RD
6377
6378class PyCommandEvent(CommandEvent):
5ba5649b
RD
6379 """
6380 wx.PyCommandEvent can be used as a base class for implementing custom
6381 event types in Python, where the event shoudl travel up to parent
6382 windows looking for a handler. You should derived from this class
6383 instead of `wx.CommandEvent` because this class is Python-aware and is
6384 able to transport its Python bits safely through the wxWidgets event
6385 system and have them still be there when the event handler is invoked.
6386
6387 :see: `wx.PyEvent`
6388
6389 """
0085ce49
RD
6390 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6391 __repr__ = _swig_repr
6392 def __init__(self, *args, **kwargs):
5ba5649b 6393 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
0085ce49 6394 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6395 self._SetSelf(self)
e811c8ce 6396
0085ce49
RD
6397 __swig_destroy__ = _core_.delete_PyCommandEvent
6398 __del__ = lambda self : None;
5ba5649b
RD
6399 def _SetSelf(*args, **kwargs):
6400 """_SetSelf(self, PyObject self)"""
6401 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
e811c8ce 6402
5ba5649b
RD
6403 def _GetSelf(*args, **kwargs):
6404 """_GetSelf(self) -> PyObject"""
6405 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
e811c8ce 6406
0085ce49
RD
6407PyCommandEvent_swigregister = _core_.PyCommandEvent_swigregister
6408PyCommandEvent_swigregister(PyCommandEvent)
d14a1e28 6409
53aa7709 6410class DateEvent(CommandEvent):
5ba5649b
RD
6411 """
6412 This event class holds information about a date change event and is
6413 used together with `wx.DatePickerCtrl`. It also serves as a base class
6414 for `wx.calendar.CalendarEvent`. Bind these event types with
6415 EVT_DATE_CHANGED.
6416 """
0085ce49
RD
6417 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6418 __repr__ = _swig_repr
6419 def __init__(self, *args, **kwargs):
53aa7709 6420 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
0085ce49 6421 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6422 def GetDate(*args, **kwargs):
5ba5649b
RD
6423 """
6424 GetDate(self) -> DateTime
6425
6426 Returns the date.
6427 """
53aa7709
RD
6428 return _core_.DateEvent_GetDate(*args, **kwargs)
6429
6430 def SetDate(*args, **kwargs):
5ba5649b
RD
6431 """
6432 SetDate(self, DateTime date)
6433
6434 Sets the date carried by the event, normally only used by the library
6435 internally.
6436 """
53aa7709
RD
6437 return _core_.DateEvent_SetDate(*args, **kwargs)
6438
0085ce49
RD
6439DateEvent_swigregister = _core_.DateEvent_swigregister
6440DateEvent_swigregister(DateEvent)
53aa7709
RD
6441
6442wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6443EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6444
d14a1e28
RD
6445#---------------------------------------------------------------------------
6446
54f9ee45
RD
6447PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6448PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6449PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6450PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6451PRINT_WINDOWS = _core_.PRINT_WINDOWS
6452PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 6453class PyApp(EvtHandler):
66c033b4
RD
6454 """
6455 The ``wx.PyApp`` class is an *implementation detail*, please use the
6456 `wx.App` class (or some other derived class) instead.
6457 """
0085ce49
RD
6458 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6459 __repr__ = _swig_repr
6460 def __init__(self, *args, **kwargs):
98e665d3 6461 """
a95a7133 6462 __init__(self) -> PyApp
98e665d3
RD
6463
6464 Create a new application object, starting the bootstrap process.
6465 """
0085ce49 6466 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
70b7a5fe
RD
6467 self._setCallbackInfo(self, PyApp, False)
6468 self._setOORInfo(self, False)
e811c8ce 6469
0085ce49
RD
6470 __swig_destroy__ = _core_.delete_PyApp
6471 __del__ = lambda self : None;
e811c8ce 6472 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 6473 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
54f9ee45 6474 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
6475
6476 def GetAppName(*args, **kwargs):
0df68c9f 6477 """
a95a7133 6478 GetAppName(self) -> String
6c3b4aae 6479
0df68c9f
RD
6480 Get the application name.
6481 """
54f9ee45 6482 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
6483
6484 def SetAppName(*args, **kwargs):
0df68c9f 6485 """
a95a7133 6486 SetAppName(self, String name)
6c3b4aae 6487
66c033b4
RD
6488 Set the application name. This value may be used automatically by
6489 `wx.Config` and such.
0df68c9f 6490 """
54f9ee45 6491 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
6492
6493 def GetClassName(*args, **kwargs):
0df68c9f 6494 """
a95a7133 6495 GetClassName(self) -> String
e811c8ce 6496
0df68c9f
RD
6497 Get the application's class name.
6498 """
54f9ee45 6499 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
6500
6501 def SetClassName(*args, **kwargs):
0df68c9f 6502 """
a95a7133 6503 SetClassName(self, String name)
6c3b4aae 6504
66c033b4
RD
6505 Set the application's class name. This value may be used for
6506 X-resources if applicable for the platform
0df68c9f 6507 """
54f9ee45 6508 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
6509
6510 def GetVendorName(*args, **kwargs):
0df68c9f 6511 """
a95a7133 6512 GetVendorName(self) -> String
6c3b4aae 6513
0df68c9f
RD
6514 Get the application's vendor name.
6515 """
54f9ee45 6516 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
6517
6518 def SetVendorName(*args, **kwargs):
0df68c9f 6519 """
a95a7133 6520 SetVendorName(self, String name)
6c3b4aae 6521
66c033b4
RD
6522 Set the application's vendor name. This value may be used
6523 automatically by `wx.Config` and such.
0df68c9f 6524 """
54f9ee45 6525 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
6526
6527 def GetTraits(*args, **kwargs):
0df68c9f 6528 """
a95a7133 6529 GetTraits(self) -> wxAppTraits
6c3b4aae 6530
66c033b4
RD
6531 Return (and create if necessary) the app traits object to which we
6532 delegate for everything which either should be configurable by the
6533 user (then he can change the default behaviour simply by overriding
6534 CreateTraits() and returning his own traits object) or which is
6535 GUI/console dependent as then wx.AppTraits allows us to abstract the
6536 differences behind the common facade.
6537
6538 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 6539 """
54f9ee45 6540 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
6541
6542 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 6543 """
a95a7133 6544 ProcessPendingEvents(self)
6c3b4aae 6545
66c033b4
RD
6546 Process all events in the Pending Events list -- it is necessary to
6547 call this function to process posted events. This normally happens
6548 during each event loop iteration.
0df68c9f 6549 """
54f9ee45 6550 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
6551
6552 def Yield(*args, **kwargs):
0df68c9f 6553 """
a95a7133 6554 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 6555
66c033b4
RD
6556 Process all currently pending events right now, instead of waiting
6557 until return to the event loop. It is an error to call ``Yield``
6558 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 6559
66c033b4 6560 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
6561 reentrancies (i.e. when called from an event handler it may
6562 result in calling the same event handler again), use with
6563 extreme care or, better, don't use at all!
0df68c9f 6564
66c033b4 6565 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 6566
0df68c9f 6567 """
54f9ee45 6568 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
6569
6570 def WakeUpIdle(*args, **kwargs):
0df68c9f 6571 """
a95a7133 6572 WakeUpIdle(self)
6c3b4aae 6573
66c033b4
RD
6574 Make sure that idle events are sent again.
6575 :see: `wx.WakeUpIdle`
0df68c9f 6576 """
54f9ee45 6577 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 6578
1fc3b23a
RD
6579 def IsMainLoopRunning(*args, **kwargs):
6580 """
6581 IsMainLoopRunning() -> bool
6582
6583 Returns True if we're running the main loop, i.e. if the events can
6584 currently be dispatched.
6585 """
6586 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6587
6588 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 6589 def MainLoop(*args, **kwargs):
0df68c9f 6590 """
a95a7133 6591 MainLoop(self) -> int
6c3b4aae 6592
66c033b4
RD
6593 Execute the main GUI loop, the function doesn't normally return until
6594 all top level windows have been closed and destroyed.
0df68c9f 6595 """
54f9ee45 6596 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
6597
6598 def Exit(*args, **kwargs):
0df68c9f 6599 """
a95a7133 6600 Exit(self)
6c3b4aae 6601
0df68c9f 6602 Exit the main loop thus terminating the application.
66c033b4 6603 :see: `wx.Exit`
0df68c9f 6604 """
54f9ee45 6605 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce
RD
6606
6607 def ExitMainLoop(*args, **kwargs):
0df68c9f 6608 """
a95a7133 6609 ExitMainLoop(self)
6c3b4aae 6610
66c033b4
RD
6611 Exit the main GUI loop during the next iteration of the main
6612 loop, (i.e. it does not stop the program immediately!)
0df68c9f 6613 """
54f9ee45 6614 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
6615
6616 def Pending(*args, **kwargs):
0df68c9f 6617 """
a95a7133 6618 Pending(self) -> bool
6c3b4aae 6619
0df68c9f
RD
6620 Returns True if there are unprocessed events in the event queue.
6621 """
54f9ee45 6622 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
6623
6624 def Dispatch(*args, **kwargs):
0df68c9f 6625 """
a95a7133 6626 Dispatch(self) -> bool
6c3b4aae 6627
0df68c9f
RD
6628 Process the first event in the event queue (blocks until an event
6629 appears if there are none currently)
6630 """
54f9ee45 6631 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
6632
6633 def ProcessIdle(*args, **kwargs):
0df68c9f 6634 """
a95a7133 6635 ProcessIdle(self) -> bool
6c3b4aae 6636
66c033b4
RD
6637 Called from the MainLoop when the application becomes idle (there are
6638 no pending events) and sends a `wx.IdleEvent` to all interested
6639 parties. Returns True if more idle events are needed, False if not.
0df68c9f 6640 """
54f9ee45 6641 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
6642
6643 def SendIdleEvents(*args, **kwargs):
0df68c9f 6644 """
a95a7133 6645 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 6646
66c033b4
RD
6647 Send idle event to window and all subwindows. Returns True if more
6648 idle time is requested.
0df68c9f 6649 """
54f9ee45 6650 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
6651
6652 def IsActive(*args, **kwargs):
0df68c9f 6653 """
a95a7133 6654 IsActive(self) -> bool
6c3b4aae 6655
0df68c9f
RD
6656 Return True if our app has focus.
6657 """
54f9ee45 6658 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
6659
6660 def SetTopWindow(*args, **kwargs):
0df68c9f 6661 """
a95a7133 6662 SetTopWindow(self, Window win)
6c3b4aae 6663
66c033b4 6664 Set the *main* top level window
0df68c9f 6665 """
54f9ee45 6666 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
6667
6668 def GetTopWindow(*args, **kwargs):
0df68c9f 6669 """
a95a7133 6670 GetTopWindow(self) -> Window
6c3b4aae 6671
66c033b4
RD
6672 Return the *main* top level window (if it hadn't been set previously
6673 with SetTopWindow(), will return just some top level window and, if
6674 there not any, will return None)
0df68c9f 6675 """
54f9ee45 6676 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
6677
6678 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 6679 """
a95a7133 6680 SetExitOnFrameDelete(self, bool flag)
0df68c9f 6681
66c033b4
RD
6682 Control the exit behaviour: by default, the program will exit the main
6683 loop (and so, usually, terminate) when the last top-level program
6684 window is deleted. Beware that if you disable this behaviour (with
6685 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6686 explicitly from somewhere.
0df68c9f 6687 """
54f9ee45 6688 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
6689
6690 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 6691 """
a95a7133 6692 GetExitOnFrameDelete(self) -> bool
6c3b4aae 6693
0df68c9f
RD
6694 Get the current exit behaviour setting.
6695 """
54f9ee45 6696 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
6697
6698 def SetUseBestVisual(*args, **kwargs):
0df68c9f 6699 """
a95a7133 6700 SetUseBestVisual(self, bool flag)
6c3b4aae 6701
66c033b4
RD
6702 Set whether the app should try to use the best available visual on
6703 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 6704 """
54f9ee45 6705 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
6706
6707 def GetUseBestVisual(*args, **kwargs):
0df68c9f 6708 """
a95a7133 6709 GetUseBestVisual(self) -> bool
6c3b4aae 6710
0df68c9f
RD
6711 Get current UseBestVisual setting.
6712 """
54f9ee45 6713 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
6714
6715 def SetPrintMode(*args, **kwargs):
a95a7133 6716 """SetPrintMode(self, int mode)"""
54f9ee45 6717 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
6718
6719 def GetPrintMode(*args, **kwargs):
a95a7133 6720 """GetPrintMode(self) -> int"""
54f9ee45 6721 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 6722
e811c8ce 6723 def SetAssertMode(*args, **kwargs):
0df68c9f 6724 """
a95a7133 6725 SetAssertMode(self, int mode)
6c3b4aae 6726
41e2b43e 6727 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 6728 """
54f9ee45 6729 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 6730
6c3b4aae 6731 def GetAssertMode(*args, **kwargs):
0df68c9f 6732 """
a95a7133 6733 GetAssertMode(self) -> int
6c3b4aae 6734
0df68c9f
RD
6735 Get the current OnAssert behaviour setting.
6736 """
54f9ee45 6737 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 6738
e811c8ce 6739 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 6740 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 6741 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
6742
6743 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6744 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 6745 """GetMacAboutMenuItemId() -> long"""
54f9ee45 6746 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
6747
6748 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6749 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 6750 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 6751 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
6752
6753 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6754 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 6755 """GetMacExitMenuItemId() -> long"""
54f9ee45 6756 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
6757
6758 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6759 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 6760 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 6761 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
6762
6763 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6764 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 6765 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 6766 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
6767
6768 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6769 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 6770 """SetMacAboutMenuItemId(long val)"""
54f9ee45 6771 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
6772
6773 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6774 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 6775 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 6776 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
6777
6778 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6779 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 6780 """SetMacExitMenuItemId(long val)"""
54f9ee45 6781 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
6782
6783 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6784 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 6785 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 6786 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
6787
6788 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6789 def _BootstrapApp(*args, **kwargs):
0df68c9f 6790 """
a95a7133 6791 _BootstrapApp(self)
6c3b4aae 6792
0df68c9f
RD
6793 For internal use only
6794 """
54f9ee45 6795 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
6796
6797 def GetComCtl32Version(*args, **kwargs):
0df68c9f 6798 """
66c033b4 6799 GetComCtl32Version() -> int
6c3b4aae 6800
66c033b4
RD
6801 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6802 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 6803 """
54f9ee45 6804 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
6805
6806 GetComCtl32Version = staticmethod(GetComCtl32Version)
0085ce49
RD
6807PyApp_swigregister = _core_.PyApp_swigregister
6808PyApp_swigregister(PyApp)
d14a1e28 6809
0085ce49
RD
6810def PyApp_IsMainLoopRunning(*args):
6811 """
1fc3b23a
RD
6812 PyApp_IsMainLoopRunning() -> bool
6813
6814 Returns True if we're running the main loop, i.e. if the events can
6815 currently be dispatched.
6816 """
0085ce49 6817 return _core_.PyApp_IsMainLoopRunning(*args)
1fc3b23a 6818
0085ce49
RD
6819def PyApp_GetMacSupportPCMenuShortcuts(*args):
6820 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6821 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d14a1e28 6822
0085ce49
RD
6823def PyApp_GetMacAboutMenuItemId(*args):
6824 """PyApp_GetMacAboutMenuItemId() -> long"""
6825 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d14a1e28 6826
0085ce49
RD
6827def PyApp_GetMacPreferencesMenuItemId(*args):
6828 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6829 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d14a1e28 6830
0085ce49
RD
6831def PyApp_GetMacExitMenuItemId(*args):
6832 """PyApp_GetMacExitMenuItemId() -> long"""
6833 return _core_.PyApp_GetMacExitMenuItemId(*args)
d14a1e28 6834
0085ce49
RD
6835def PyApp_GetMacHelpMenuTitleName(*args):
6836 """PyApp_GetMacHelpMenuTitleName() -> String"""
6837 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d14a1e28 6838
e811c8ce 6839def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
0085ce49
RD
6840 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6841 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 6842
e811c8ce 6843def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
0085ce49
RD
6844 """PyApp_SetMacAboutMenuItemId(long val)"""
6845 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 6846
e811c8ce 6847def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
0085ce49
RD
6848 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6849 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 6850
e811c8ce 6851def PyApp_SetMacExitMenuItemId(*args, **kwargs):
0085ce49
RD
6852 """PyApp_SetMacExitMenuItemId(long val)"""
6853 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 6854
e811c8ce 6855def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
0085ce49
RD
6856 """PyApp_SetMacHelpMenuTitleName(String val)"""
6857 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 6858
0085ce49
RD
6859def PyApp_GetComCtl32Version(*args):
6860 """
0df68c9f 6861 PyApp_GetComCtl32Version() -> int
6c3b4aae 6862
66c033b4
RD
6863 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6864 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 6865 """
0085ce49 6866 return _core_.PyApp_GetComCtl32Version(*args)
d14a1e28
RD
6867
6868#---------------------------------------------------------------------------
6869
6870
0085ce49
RD
6871def Exit(*args):
6872 """
0df68c9f 6873 Exit()
6c3b4aae 6874
0df68c9f
RD
6875 Force an exit of the application. Convenience for wx.GetApp().Exit()
6876 """
0085ce49 6877 return _core_.Exit(*args)
d14a1e28 6878
0085ce49
RD
6879def Yield(*args):
6880 """
0df68c9f 6881 Yield() -> bool
6c3b4aae 6882
0df68c9f
RD
6883 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6884 """
0085ce49 6885 return _core_.Yield(*args)
d14a1e28 6886
0085ce49
RD
6887def YieldIfNeeded(*args):
6888 """
0df68c9f 6889 YieldIfNeeded() -> bool
6c3b4aae 6890
0df68c9f
RD
6891 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6892 """
0085ce49 6893 return _core_.YieldIfNeeded(*args)
d14a1e28 6894
e811c8ce 6895def SafeYield(*args, **kwargs):
0085ce49 6896 """
0df68c9f 6897 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 6898
66c033b4
RD
6899 This function is similar to `wx.Yield`, except that it disables the
6900 user input to all program windows before calling `wx.Yield` and
6901 re-enables it again afterwards. If ``win`` is not None, this window
6902 will remain enabled, allowing the implementation of some limited user
6903 interaction.
6c3b4aae 6904
66c033b4 6905 :Returns: the result of the call to `wx.Yield`.
0df68c9f 6906 """
0085ce49 6907 return _core_.SafeYield(*args, **kwargs)
d14a1e28 6908
0085ce49
RD
6909def WakeUpIdle(*args):
6910 """
0df68c9f 6911 WakeUpIdle()
6c3b4aae 6912
66c033b4
RD
6913 Cause the message queue to become empty again, so idle events will be
6914 sent.
0df68c9f 6915 """
0085ce49 6916 return _core_.WakeUpIdle(*args)
d14a1e28 6917
e811c8ce 6918def PostEvent(*args, **kwargs):
0085ce49 6919 """
0df68c9f 6920 PostEvent(EvtHandler dest, Event event)
6c3b4aae 6921
66c033b4
RD
6922 Send an event to a window or other wx.EvtHandler to be processed
6923 later.
0df68c9f 6924 """
0085ce49 6925 return _core_.PostEvent(*args, **kwargs)
d14a1e28 6926
0085ce49
RD
6927def App_CleanUp(*args):
6928 """
0df68c9f 6929 App_CleanUp()
6c3b4aae 6930
41e2b43e 6931 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 6932 Python shuts down.
0df68c9f 6933 """
0085ce49 6934 return _core_.App_CleanUp(*args)
d14a1e28 6935
0085ce49
RD
6936def GetApp(*args):
6937 """
0df68c9f 6938 GetApp() -> PyApp
6c3b4aae 6939
196addbf 6940 Return a reference to the current wx.App object.
0df68c9f 6941 """
0085ce49 6942 return _core_.GetApp(*args)
5cbf236d
RD
6943
6944def SetDefaultPyEncoding(*args, **kwargs):
0085ce49 6945 """
5cbf236d
RD
6946 SetDefaultPyEncoding(string encoding)
6947
6948 Sets the encoding that wxPython will use when it needs to convert a
6949 Python string or unicode object to or from a wxString.
e505d15e
RD
6950
6951 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6952 but please be aware that the default encoding within the same locale
6953 may be slightly different on different platforms. For example, please
6954 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6955 between the common latin/roman encodings.
5cbf236d 6956 """
0085ce49 6957 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 6958
0085ce49
RD
6959def GetDefaultPyEncoding(*args):
6960 """
5cbf236d
RD
6961 GetDefaultPyEncoding() -> string
6962
6963 Gets the current encoding that wxPython will use when it needs to
6964 convert a Python string or unicode object to or from a wxString.
6965 """
0085ce49 6966 return _core_.GetDefaultPyEncoding(*args)
d14a1e28
RD
6967#----------------------------------------------------------------------
6968
6969class PyOnDemandOutputWindow:
6c3b4aae
RD
6970 """
6971 A class that can be used for redirecting Python's stdout and
6972 stderr streams. It will do nothing until something is wrriten to
6973 the stream at which point it will create a Frame with a text area
6974 and write the text there.
6975 """
d14a1e28
RD
6976 def __init__(self, title = "wxPython: stdout/stderr"):
6977 self.frame = None
6978 self.title = title
412d302d
RD
6979 self.pos = wx.DefaultPosition
6980 self.size = (450, 300)
d14a1e28
RD
6981 self.parent = None
6982
6983 def SetParent(self, parent):
6c3b4aae 6984 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
6985 self.parent = parent
6986
6c3b4aae
RD
6987
6988 def CreateOutputWindow(self, st):
412d302d
RD
6989 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6990 style=wx.DEFAULT_FRAME_STYLE)
196addbf 6991 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 6992 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 6993 self.text.AppendText(st)
6c3b4aae
RD
6994 self.frame.Show(True)
6995 EVT_CLOSE(self.frame, self.OnCloseWindow)
6996
d14a1e28 6997
7409c0c6
RD
6998 def OnCloseWindow(self, event):
6999 if self.frame is not None:
7000 self.frame.Destroy()
7001 self.frame = None
7002 self.text = None
7003
7004
d14a1e28 7005 # These methods provide the file-like output behaviour.
6c3b4aae
RD
7006 def write(self, text):
7007 """
7008 Create the output window if needed and write the string to it.
7009 If not called in the context of the gui thread then uses
7010 CallAfter to do the work there.
7011 """
7012 if self.frame is None:
7013 if not wx.Thread_IsMain():
7014 wx.CallAfter(self.CreateOutputWindow, text)
7015 else:
7016 self.CreateOutputWindow(text)
7017 else:
7018 if not wx.Thread_IsMain():
7019 wx.CallAfter(self.text.AppendText, text)
7020 else:
7021 self.text.AppendText(text)
7022
d14a1e28
RD
7023
7024 def close(self):
6c3b4aae
RD
7025 if self.frame is not None:
7026 wx.CallAfter(self.frame.Close)
7027
d14a1e28 7028
19272049
RD
7029 def flush(self):
7030 pass
7031
7032
d14a1e28
RD
7033
7034#----------------------------------------------------------------------
d14a1e28
RD
7035
7036_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7037
7038class App(wx.PyApp):
6c3b4aae 7039 """
66c033b4
RD
7040 The ``wx.App`` class represents the application and is used to:
7041
7042 * bootstrap the wxPython system and initialize the underlying
7043 gui toolkit
7044 * set and get application-wide properties
7045 * implement the windowing system main message or event loop,
7046 and to dispatch events to window instances
7047 * etc.
7048
7049 Every application must have a ``wx.App`` instance, and all
7050 creation of UI objects should be delayed until after the
03e37cd5
RD
7051 ``wx.App`` object has been created in order to ensure that the gui
7052 platform and wxWidgets have been fully initialized.
66c033b4
RD
7053
7054 Normally you would derive from this class and implement an
7055 ``OnInit`` method that creates a frame and then calls
7056 ``self.SetTopWindow(frame)``.
7057
03e37cd5 7058 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 7059 directly.
6c3b4aae 7060 """
66c033b4 7061
d14a1e28
RD
7062 outputWindowClass = PyOnDemandOutputWindow
7063
03e37cd5
RD
7064 def __init__(self, redirect=_defRedirect, filename=None,
7065 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7066 """
7067 Construct a ``wx.App`` object.
7068
03e37cd5
RD
7069 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7070 redirected? Defaults to True on Windows and Mac, False
7071 otherwise. If `filename` is None then output will be
7072 redirected to a window that pops up as needed. (You can
7073 control what kind of window is created for the output by
7074 resetting the class variable ``outputWindowClass`` to a
7075 class of your choosing.)
66c033b4 7076
03e37cd5
RD
7077 :param filename: The name of a file to redirect output to, if
7078 redirect is True.
66c033b4
RD
7079
7080 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
7081 available visual provided by the system (only relevant on
7082 systems that have more than one visual.) This parameter
7083 must be used instead of calling `SetUseBestVisual` later
7084 on because it must be set before the underlying GUI
7085 toolkit is initialized.
7086
7087 :param clearSigInt: Should SIGINT be cleared? This allows the
7088 app to terminate upon a Ctrl-C in the console like other
7089 GUI apps will.
66c033b4
RD
7090
7091 :note: You should override OnInit to do applicaition
7092 initialization to ensure that the system, toolkit and
7093 wxWidgets are fully initialized.
7094 """
d14a1e28
RD
7095 wx.PyApp.__init__(self)
7096
7097 if wx.Platform == "__WXMAC__":
7098 try:
7099 import MacOS
7100 if not MacOS.WMAvailable():
7101 print """\
7102This program needs access to the screen. Please run with 'pythonw',
7103not 'python', and only when you are logged in on the main display of
7104your Mac."""
7105 _sys.exit(1)
36cadbf7
RD
7106 except SystemExit:
7107 raise
d14a1e28
RD
7108 except:
7109 pass
7110
7111 # This has to be done before OnInit
7112 self.SetUseBestVisual(useBestVisual)
7113
7114 # Set the default handler for SIGINT. This fixes a problem
7115 # where if Ctrl-C is pressed in the console that started this
7116 # app then it will not appear to do anything, (not even send
7117 # KeyboardInterrupt???) but will later segfault on exit. By
7118 # setting the default handler then the app will exit, as
7119 # expected (depending on platform.)
03e37cd5
RD
7120 if clearSigInt:
7121 try:
7122 import signal
7123 signal.signal(signal.SIGINT, signal.SIG_DFL)
7124 except:
7125 pass
d14a1e28
RD
7126
7127 # Save and redirect the stdio to a window?
7128 self.stdioWin = None
7129 self.saveStdio = (_sys.stdout, _sys.stderr)
7130 if redirect:
7131 self.RedirectStdio(filename)
7132
8fb0e70a
RD
7133 # Use Python's install prefix as the default
7134 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7135
d14a1e28
RD
7136 # This finishes the initialization of wxWindows and then calls
7137 # the OnInit that should be present in the derived class
7138 self._BootstrapApp()
7139
7140
02b455f2
RD
7141 def __del__(self, destroy=wx.PyApp.__del__):
7142 self.RestoreStdio() # Just in case the MainLoop was overridden
7143 destroy(self)
d14a1e28 7144
70b7a5fe
RD
7145 def Destroy(self):
7146 wx.PyApp.Destroy(self)
7147 self.thisown = 0
d14a1e28
RD
7148
7149 def SetTopWindow(self, frame):
1e0c8722 7150 """Set the \"main\" top level window"""
d14a1e28
RD
7151 if self.stdioWin:
7152 self.stdioWin.SetParent(frame)
7153 wx.PyApp.SetTopWindow(self, frame)
7154
7155
7156 def MainLoop(self):
1e0c8722 7157 """Execute the main GUI event loop"""
d14a1e28
RD
7158 wx.PyApp.MainLoop(self)
7159 self.RestoreStdio()
7160
7161
7409c0c6 7162 def RedirectStdio(self, filename=None):
1e0c8722 7163 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
7164 if filename:
7165 _sys.stdout = _sys.stderr = open(filename, 'a')
7166 else:
7167 self.stdioWin = self.outputWindowClass()
7168 _sys.stdout = _sys.stderr = self.stdioWin
7169
7170
7171 def RestoreStdio(self):
02b455f2
RD
7172 try:
7173 _sys.stdout, _sys.stderr = self.saveStdio
7174 except:
7175 pass
d14a1e28
RD
7176
7177
412d302d
RD
7178 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7179 """
7180 Set the title, position and/or size of the output window if
f5b96ee1
RD
7181 the stdio has been redirected. This should be called before
7182 any output would cause the output window to be created.
412d302d
RD
7183 """
7184 if self.stdioWin:
7185 if title is not None:
7186 self.stdioWin.title = title
7187 if pos is not None:
7188 self.stdioWin.pos = pos
7189 if size is not None:
7190 self.stdioWin.size = size
7191
7192
7193
d14a1e28 7194
66c033b4 7195# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
7196App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7197App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7198App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7199App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7200App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7201App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7202App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7203App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7204App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7205App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7206App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
7207
7208#----------------------------------------------------------------------------
7209
7210class PySimpleApp(wx.App):
6c3b4aae
RD
7211 """
7212 A simple application class. You can just create one of these and
7213 then then make your top level windows later, and not have to worry
66c033b4
RD
7214 about OnInit. For example::
7215
7216 app = wx.PySimpleApp()
7217 frame = wx.Frame(None, title='Hello World')
7218 frame.Show()
7219 app.MainLoop()
7220
7221 :see: `wx.App`
7222 """
6c3b4aae 7223
03e37cd5
RD
7224 def __init__(self, redirect=False, filename=None,
7225 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7226 """
7227 :see: `wx.App.__init__`
7228 """
03e37cd5 7229 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 7230
d14a1e28 7231 def OnInit(self):
d14a1e28
RD
7232 return True
7233
7234
66c033b4 7235
6c3b4aae 7236# Is anybody using this one?
d14a1e28
RD
7237class PyWidgetTester(wx.App):
7238 def __init__(self, size = (250, 100)):
7239 self.size = size
7240 wx.App.__init__(self, 0)
7241
7242 def OnInit(self):
196addbf 7243 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
7244 self.SetTopWindow(self.frame)
7245 return True
7246
66c033b4
RD
7247 def SetWidget(self, widgetClass, *args, **kwargs):
7248 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
7249 self.frame.Show(True)
7250
7251#----------------------------------------------------------------------------
7252# DO NOT hold any other references to this object. This is how we
66c033b4 7253# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 7254# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 7255# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
7256
7257class __wxPyCleanup:
7258 def __init__(self):
54f9ee45 7259 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
7260 def __del__(self):
7261 self.cleanup()
7262
7263_sys.__wxPythonCleanup = __wxPyCleanup()
7264
7265## # another possible solution, but it gets called too early...
66c033b4
RD
7266## import atexit
7267## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
7268
7269
7270#----------------------------------------------------------------------------
7271
7272#---------------------------------------------------------------------------
2ef75293
RD
7273
7274class EventLoop(object):
093d3ff1 7275 """Proxy of C++ EventLoop class"""
0085ce49
RD
7276 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7277 __repr__ = _swig_repr
7278 def __init__(self, *args, **kwargs):
2ef75293 7279 """__init__(self) -> EventLoop"""
0085ce49
RD
7280 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7281 __swig_destroy__ = _core_.delete_EventLoop
7282 __del__ = lambda self : None;
2ef75293
RD
7283 def Run(*args, **kwargs):
7284 """Run(self) -> int"""
7285 return _core_.EventLoop_Run(*args, **kwargs)
7286
7287 def Exit(*args, **kwargs):
7288 """Exit(self, int rc=0)"""
7289 return _core_.EventLoop_Exit(*args, **kwargs)
7290
7291 def Pending(*args, **kwargs):
7292 """Pending(self) -> bool"""
7293 return _core_.EventLoop_Pending(*args, **kwargs)
7294
7295 def Dispatch(*args, **kwargs):
7296 """Dispatch(self) -> bool"""
7297 return _core_.EventLoop_Dispatch(*args, **kwargs)
7298
7299 def IsRunning(*args, **kwargs):
7300 """IsRunning(self) -> bool"""
7301 return _core_.EventLoop_IsRunning(*args, **kwargs)
7302
7303 def GetActive(*args, **kwargs):
7304 """GetActive() -> EventLoop"""
7305 return _core_.EventLoop_GetActive(*args, **kwargs)
7306
7307 GetActive = staticmethod(GetActive)
7308 def SetActive(*args, **kwargs):
7309 """SetActive(EventLoop loop)"""
7310 return _core_.EventLoop_SetActive(*args, **kwargs)
7311
7312 SetActive = staticmethod(SetActive)
0085ce49
RD
7313EventLoop_swigregister = _core_.EventLoop_swigregister
7314EventLoop_swigregister(EventLoop)
2ef75293 7315
0085ce49
RD
7316def EventLoop_GetActive(*args):
7317 """EventLoop_GetActive() -> EventLoop"""
7318 return _core_.EventLoop_GetActive(*args)
2ef75293
RD
7319
7320def EventLoop_SetActive(*args, **kwargs):
0085ce49
RD
7321 """EventLoop_SetActive(EventLoop loop)"""
7322 return _core_.EventLoop_SetActive(*args, **kwargs)
2ef75293 7323
091f5bed
RD
7324class EventLoopActivator(object):
7325 """Proxy of C++ EventLoopActivator class"""
0085ce49
RD
7326 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7327 __repr__ = _swig_repr
7328 def __init__(self, *args, **kwargs):
091f5bed 7329 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
0085ce49
RD
7330 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7331 __swig_destroy__ = _core_.delete_EventLoopActivator
7332 __del__ = lambda self : None;
7333EventLoopActivator_swigregister = _core_.EventLoopActivator_swigregister
7334EventLoopActivator_swigregister(EventLoopActivator)
091f5bed 7335
2ef75293 7336#---------------------------------------------------------------------------
d14a1e28 7337
1e0c8722 7338class AcceleratorEntry(object):
66c033b4
RD
7339 """
7340 A class used to define items in an `wx.AcceleratorTable`. wxPython
7341 programs can choose to use wx.AcceleratorEntry objects, but using a
7342 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 7343 as well. See `__init__` for of the tuple values.
66c033b4
RD
7344
7345 :see: `wx.AcceleratorTable`
7346 """
0085ce49
RD
7347 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7348 __repr__ = _swig_repr
7349 def __init__(self, *args, **kwargs):
66c033b4
RD
7350 """
7351 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7352
7353 Construct a wx.AcceleratorEntry.
66c033b4 7354 """
0085ce49
RD
7355 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7356 __swig_destroy__ = _core_.delete_AcceleratorEntry
7357 __del__ = lambda self : None;
1e0c8722 7358 def Set(*args, **kwargs):
66c033b4
RD
7359 """
7360 Set(self, int flags, int keyCode, int cmd)
1e0c8722 7361
66c033b4
RD
7362 (Re)set the attributes of a wx.AcceleratorEntry.
7363 :see `__init__`
7364 """
7365 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722
RD
7366
7367 def GetFlags(*args, **kwargs):
66c033b4
RD
7368 """
7369 GetFlags(self) -> int
7370
7371 Get the AcceleratorEntry's flags.
7372 """
54f9ee45 7373 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
7374
7375 def GetKeyCode(*args, **kwargs):
66c033b4
RD
7376 """
7377 GetKeyCode(self) -> int
7378
7379 Get the AcceleratorEntry's keycode.
7380 """
54f9ee45 7381 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
7382
7383 def GetCommand(*args, **kwargs):
66c033b4
RD
7384 """
7385 GetCommand(self) -> int
7386
7387 Get the AcceleratorEntry's command ID.
7388 """
54f9ee45 7389 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722 7390
0085ce49
RD
7391AcceleratorEntry_swigregister = _core_.AcceleratorEntry_swigregister
7392AcceleratorEntry_swigregister(AcceleratorEntry)
1e0c8722
RD
7393
7394class AcceleratorTable(Object):
66c033b4
RD
7395 """
7396 An accelerator table allows the application to specify a table of
7397 keyboard shortcuts for menus or other commands. On Windows, menu or
7398 button commands are supported; on GTK, only menu commands are
7399 supported.
66c033b4 7400 """
0085ce49
RD
7401 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7402 __repr__ = _swig_repr
7403 def __init__(self, *args, **kwargs):
0df68c9f
RD
7404 """
7405 __init__(entries) -> AcceleratorTable
1e0c8722 7406
66c033b4
RD
7407 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7408 items or or of 3-tuples (flags, keyCode, cmdID)
7409
7410 :see: `wx.AcceleratorEntry`
0df68c9f 7411 """
0085ce49
RD
7412 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7413 __swig_destroy__ = _core_.delete_AcceleratorTable
7414 __del__ = lambda self : None;
1e0c8722 7415 def Ok(*args, **kwargs):
a95a7133 7416 """Ok(self) -> bool"""
54f9ee45 7417 return _core_.AcceleratorTable_Ok(*args, **kwargs)
1e0c8722 7418
0085ce49
RD
7419AcceleratorTable_swigregister = _core_.AcceleratorTable_swigregister
7420AcceleratorTable_swigregister(AcceleratorTable)
1e0c8722
RD
7421
7422
7423def GetAccelFromString(*args, **kwargs):
0085ce49
RD
7424 """GetAccelFromString(String label) -> AcceleratorEntry"""
7425 return _core_.GetAccelFromString(*args, **kwargs)
1e0c8722
RD
7426#---------------------------------------------------------------------------
7427
74a57fcd
RD
7428class VisualAttributes(object):
7429 """struct containing all the visual attributes of a control"""
0085ce49
RD
7430 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7431 __repr__ = _swig_repr
7432 def __init__(self, *args, **kwargs):
74a57fcd 7433 """
a95a7133 7434 __init__(self) -> VisualAttributes
74a57fcd
RD
7435
7436 struct containing all the visual attributes of a control
7437 """
0085ce49
RD
7438 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7439 __swig_destroy__ = _core_.delete_VisualAttributes
7440 __del__ = lambda self : None;
54f9ee45
RD
7441 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7442 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7443 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
0085ce49
RD
7444VisualAttributes_swigregister = _core_.VisualAttributes_swigregister
7445VisualAttributes_swigregister(VisualAttributes)
74a57fcd
RD
7446NullAcceleratorTable = cvar.NullAcceleratorTable
7447PanelNameStr = cvar.PanelNameStr
7448
54f9ee45
RD
7449WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7450WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7451WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7452WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7453WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 7454class Window(EvtHandler):
15afbcd0
RD
7455 """
7456 wx.Window is the base class for all windows and represents any visible
7457 object on the screen. All controls, top level windows and so on are
7458 wx.Windows. Sizers and device contexts are not however, as they don't
7459 appear on screen themselves.
7460
7461 """
0085ce49
RD
7462 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7463 __repr__ = _swig_repr
7464 def __init__(self, *args, **kwargs):
0df68c9f 7465 """
a95a7133 7466 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 7467 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
7468
7469 Construct and show a generic Window.
0df68c9f 7470 """
0085ce49 7471 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d14a1e28 7472 self._setOORInfo(self)
d14a1e28 7473
e811c8ce 7474 def Create(*args, **kwargs):
0df68c9f 7475 """
a95a7133 7476 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 7477 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
7478
7479 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 7480 """
54f9ee45 7481 return _core_.Window_Create(*args, **kwargs)
d14a1e28 7482
e811c8ce 7483 def Close(*args, **kwargs):
15afbcd0 7484 """
a95a7133 7485 Close(self, bool force=False) -> bool
15afbcd0
RD
7486
7487 This function simply generates a EVT_CLOSE event whose handler usually
7488 tries to close the window. It doesn't close the window itself,
7489 however. If force is False (the default) then the window's close
7490 handler will be allowed to veto the destruction of the window.
15afbcd0 7491 """
54f9ee45 7492 return _core_.Window_Close(*args, **kwargs)
d14a1e28 7493
e811c8ce 7494 def Destroy(*args, **kwargs):
0df68c9f 7495 """
a95a7133 7496 Destroy(self) -> bool
d14a1e28 7497
15afbcd0
RD
7498 Destroys the window safely. Frames and dialogs are not destroyed
7499 immediately when this function is called -- they are added to a list
7500 of windows to be deleted on idle time, when all the window's events
7501 have been processed. This prevents problems with events being sent to
7502 non-existent windows.
7503
7504 Returns True if the window has either been successfully deleted, or it
7505 has been added to the list of windows pending real deletion.
0df68c9f 7506 """
7e08d4ef
RD
7507 val = _core_.Window_Destroy(*args, **kwargs)
7508 args[0].thisown = 0
7509 return val
d14a1e28 7510
e811c8ce 7511 def DestroyChildren(*args, **kwargs):
15afbcd0 7512 """
a95a7133 7513 DestroyChildren(self) -> bool
15afbcd0 7514
41e2b43e
RD
7515 Destroys all children of a window. Called automatically by the
7516 destructor.
15afbcd0 7517 """
54f9ee45 7518 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 7519
e811c8ce 7520 def IsBeingDeleted(*args, **kwargs):
15afbcd0 7521 """
a95a7133 7522 IsBeingDeleted(self) -> bool
15afbcd0
RD
7523
7524 Is the window in the process of being deleted?
7525 """
54f9ee45 7526 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 7527
e811c8ce 7528 def SetLabel(*args, **kwargs):
15afbcd0 7529 """
a95a7133 7530 SetLabel(self, String label)
15afbcd0
RD
7531
7532 Set the text which the window shows in its label if applicable.
7533 """
54f9ee45 7534 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 7535
e811c8ce 7536 def GetLabel(*args, **kwargs):
15afbcd0 7537 """
a95a7133 7538 GetLabel(self) -> String
15afbcd0 7539
41e2b43e
RD
7540 Generic way of getting a label from any window, for identification
7541 purposes. The interpretation of this function differs from class to
7542 class. For frames and dialogs, the value returned is the title. For
7543 buttons or static text controls, it is the button text. This function
7544 can be useful for meta-programs such as testing tools or special-needs
7545 access programs)which need to identify windows by name.
15afbcd0 7546 """
54f9ee45 7547 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 7548
e811c8ce 7549 def SetName(*args, **kwargs):
15afbcd0 7550 """
a95a7133 7551 SetName(self, String name)
15afbcd0 7552
41e2b43e
RD
7553 Sets the window's name. The window name is used for ressource setting
7554 in X, it is not the same as the window title/label
15afbcd0 7555 """
54f9ee45 7556 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 7557
e811c8ce 7558 def GetName(*args, **kwargs):
15afbcd0 7559 """
a95a7133 7560 GetName(self) -> String
15afbcd0 7561
41e2b43e
RD
7562 Returns the windows name. This name is not guaranteed to be unique;
7563 it is up to the programmer to supply an appropriate name in the window
7564 constructor or via wx.Window.SetName.
15afbcd0 7565 """
54f9ee45 7566 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 7567
4276dc52
RD
7568 def SetWindowVariant(*args, **kwargs):
7569 """
a95a7133 7570 SetWindowVariant(self, int variant)
4276dc52 7571
41e2b43e
RD
7572 Sets the variant of the window/font size to use for this window, if
7573 the platform supports variants, for example, wxMac.
4276dc52 7574 """
54f9ee45 7575 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
7576
7577 def GetWindowVariant(*args, **kwargs):
a95a7133 7578 """GetWindowVariant(self) -> int"""
54f9ee45 7579 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 7580
e811c8ce 7581 def SetId(*args, **kwargs):
15afbcd0 7582 """
a95a7133 7583 SetId(self, int winid)
15afbcd0
RD
7584
7585 Sets the identifier of the window. Each window has an integer
7586 identifier. If the application has not provided one, an identifier
7587 will be generated. Normally, the identifier should be provided on
7588 creation and should not be modified subsequently.
7589 """
54f9ee45 7590 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 7591
e811c8ce 7592 def GetId(*args, **kwargs):
15afbcd0 7593 """
a95a7133 7594 GetId(self) -> int
15afbcd0
RD
7595
7596 Returns the identifier of the window. Each window has an integer
7597 identifier. If the application has not provided one (or the default Id
7598 -1 is used) then an unique identifier with a negative value will be
7599 generated.
7600 """
54f9ee45 7601 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 7602
e811c8ce 7603 def NewControlId(*args, **kwargs):
15afbcd0 7604 """
66c033b4 7605 NewControlId() -> int
15afbcd0
RD
7606
7607 Generate a control id for the controls which were not given one.
7608 """
54f9ee45 7609 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 7610
e811c8ce
RD
7611 NewControlId = staticmethod(NewControlId)
7612 def NextControlId(*args, **kwargs):
15afbcd0 7613 """
66c033b4 7614 NextControlId(int winid) -> int
15afbcd0
RD
7615
7616 Get the id of the control following the one with the given
41e2b43e 7617 autogenerated) id
15afbcd0 7618 """
54f9ee45 7619 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 7620
e811c8ce
RD
7621 NextControlId = staticmethod(NextControlId)
7622 def PrevControlId(*args, **kwargs):
15afbcd0 7623 """
66c033b4 7624 PrevControlId(int winid) -> int
15afbcd0
RD
7625
7626 Get the id of the control preceding the one with the given
41e2b43e 7627 autogenerated) id
15afbcd0 7628 """
54f9ee45 7629 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 7630
e811c8ce
RD
7631 PrevControlId = staticmethod(PrevControlId)
7632 def SetSize(*args, **kwargs):
15afbcd0 7633 """
a95a7133 7634 SetSize(self, Size size)
15afbcd0
RD
7635
7636 Sets the size of the window in pixels.
7637 """
54f9ee45 7638 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 7639
e811c8ce 7640 def SetDimensions(*args, **kwargs):
15afbcd0 7641 """
a95a7133 7642 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
7643
7644 Sets the position and size of the window in pixels. The sizeFlags
7645 parameter indicates the interpretation of the other params if they are
e505d15e
RD
7646 equal to -1.
7647
7648 ======================== ======================================
7649 wx.SIZE_AUTO A -1 indicates that a class-specific
7650 default should be used.
7651 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7652 -1 values are supplied.
7653 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7654 interpreted as real dimensions, not
7655 default values.
7656 ======================== ======================================
7657
15afbcd0 7658 """
54f9ee45 7659 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 7660
e811c8ce 7661 def SetRect(*args, **kwargs):
15afbcd0 7662 """
a95a7133 7663 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
7664
7665 Sets the position and size of the window in pixels using a wx.Rect.
7666 """
54f9ee45 7667 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 7668
e811c8ce 7669 def SetSizeWH(*args, **kwargs):
15afbcd0 7670 """
a95a7133 7671 SetSizeWH(self, int width, int height)
15afbcd0
RD
7672
7673 Sets the size of the window in pixels.
7674 """
54f9ee45 7675 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 7676
e811c8ce 7677 def Move(*args, **kwargs):
15afbcd0 7678 """
a95a7133 7679 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
7680
7681 Moves the window to the given position.
7682 """
54f9ee45 7683 return _core_.Window_Move(*args, **kwargs)
d14a1e28 7684
e811c8ce
RD
7685 SetPosition = Move
7686 def MoveXY(*args, **kwargs):
15afbcd0 7687 """
a95a7133 7688 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
7689
7690 Moves the window to the given position.
7691 """
54f9ee45 7692 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 7693
f8167d6e
RD
7694 def SetBestFittingSize(*args, **kwargs):
7695 """
7696 SetBestFittingSize(self, Size size=DefaultSize)
7697
7698 A 'Smart' SetSize that will fill in default size components with the
7699 window's *best size* values. Also set's the minsize for use with sizers.
7700 """
7701 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7702
e811c8ce 7703 def Raise(*args, **kwargs):
15afbcd0 7704 """
a95a7133 7705 Raise(self)
15afbcd0 7706
943e8dfd
RD
7707 Raises the window to the top of the window hierarchy. In current
7708 version of wxWidgets this works both for manage and child windows.
15afbcd0 7709 """
54f9ee45 7710 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
7711
7712 def Lower(*args, **kwargs):
15afbcd0 7713 """
a95a7133 7714 Lower(self)
15afbcd0 7715
943e8dfd
RD
7716 Lowers the window to the bottom of the window hierarchy. In current
7717 version of wxWidgets this works both for manage and child windows.
15afbcd0 7718 """
54f9ee45 7719 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
7720
7721 def SetClientSize(*args, **kwargs):
15afbcd0 7722 """
a95a7133 7723 SetClientSize(self, Size size)
15afbcd0
RD
7724
7725 This sets the size of the window client area in pixels. Using this
7726 function to size a window tends to be more device-independent than
7727 wx.Window.SetSize, since the application need not worry about what
7728 dimensions the border or title bar have when trying to fit the window
7729 around panel items, for example.
7730 """
54f9ee45 7731 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
7732
7733 def SetClientSizeWH(*args, **kwargs):
15afbcd0 7734 """
a95a7133 7735 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
7736
7737 This sets the size of the window client area in pixels. Using this
7738 function to size a window tends to be more device-independent than
7739 wx.Window.SetSize, since the application need not worry about what
7740 dimensions the border or title bar have when trying to fit the window
7741 around panel items, for example.
7742 """
54f9ee45 7743 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
7744
7745 def SetClientRect(*args, **kwargs):
15afbcd0 7746 """
a95a7133 7747 SetClientRect(self, Rect rect)
15afbcd0
RD
7748
7749 This sets the size of the window client area in pixels. Using this
7750 function to size a window tends to be more device-independent than
7751 wx.Window.SetSize, since the application need not worry about what
7752 dimensions the border or title bar have when trying to fit the window
7753 around panel items, for example.
7754 """
54f9ee45 7755 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
7756
7757 def GetPosition(*args, **kwargs):
0df68c9f 7758 """
a95a7133 7759 GetPosition(self) -> Point
e811c8ce 7760
75219dcb
RD
7761 Get the window's position. Notice that the position is in client
7762 coordinates for child windows and screen coordinates for the top level
7763 ones, use `GetScreenPosition` if you need screen coordinates for all
7764 kinds of windows.
0df68c9f 7765 """
54f9ee45 7766 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
7767
7768 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
7769 """
7770 GetPositionTuple() -> (x,y)
e811c8ce 7771
75219dcb
RD
7772 Get the window's position. Notice that the position is in client
7773 coordinates for child windows and screen coordinates for the top level
7774 ones, use `GetScreenPosition` if you need screen coordinates for all
7775 kinds of windows.
0df68c9f 7776 """
54f9ee45 7777 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce 7778
75219dcb
RD
7779 def GetScreenPosition(*args, **kwargs):
7780 """
7781 GetScreenPosition(self) -> Point
7782
7783 Get the position of the window in screen coordinantes.
7784 """
7785 return _core_.Window_GetScreenPosition(*args, **kwargs)
7786
7787 def GetScreenPositionTuple(*args, **kwargs):
7788 """
7789 GetScreenPositionTuple() -> (x,y)
7790
7791 Get the position of the window in screen coordinantes.
7792 """
7793 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7794
7795 def GetScreenRect(*args, **kwargs):
7796 """
7797 GetScreenRect(self) -> Rect
7798
7799 Returns the size and position of the window in screen coordinantes as
7800 a `wx.Rect` object.
7801 """
7802 return _core_.Window_GetScreenRect(*args, **kwargs)
7803
e811c8ce 7804 def GetSize(*args, **kwargs):
0df68c9f 7805 """
a95a7133 7806 GetSize(self) -> Size
e811c8ce 7807
0df68c9f
RD
7808 Get the window size.
7809 """
54f9ee45 7810 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
7811
7812 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
7813 """
7814 GetSizeTuple() -> (width, height)
e811c8ce 7815
0df68c9f
RD
7816 Get the window size.
7817 """
54f9ee45 7818 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
7819
7820 def GetRect(*args, **kwargs):
15afbcd0 7821 """
a95a7133 7822 GetRect(self) -> Rect
15afbcd0 7823
75219dcb 7824 Returns the size and position of the window as a `wx.Rect` object.
15afbcd0 7825 """
54f9ee45 7826 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
7827
7828 def GetClientSize(*args, **kwargs):
0df68c9f 7829 """
a95a7133 7830 GetClientSize(self) -> Size
e811c8ce 7831
15afbcd0
RD
7832 This gets the size of the window's 'client area' in pixels. The client
7833 area is the area which may be drawn on by the programmer, excluding
7834 title bar, border, scrollbars, etc.
0df68c9f 7835 """
54f9ee45 7836 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
7837
7838 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
7839 """
7840 GetClientSizeTuple() -> (width, height)
e811c8ce 7841
15afbcd0
RD
7842 This gets the size of the window's 'client area' in pixels. The client
7843 area is the area which may be drawn on by the programmer, excluding
7844 title bar, border, scrollbars, etc.
0df68c9f 7845 """
54f9ee45 7846 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
7847
7848 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 7849 """
a95a7133 7850 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
7851
7852 Get the origin of the client area of the window relative to the
7853 window's top left corner (the client area may be shifted because of
7854 the borders, scrollbars, other decorations...)
7855 """
54f9ee45 7856 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
7857
7858 def GetClientRect(*args, **kwargs):
15afbcd0 7859 """
a95a7133 7860 GetClientRect(self) -> Rect
15afbcd0 7861
61863841 7862 Get the client area position and size as a `wx.Rect` object.
15afbcd0 7863 """
54f9ee45 7864 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
7865
7866 def GetBestSize(*args, **kwargs):
0df68c9f 7867 """
a95a7133 7868 GetBestSize(self) -> Size
e811c8ce 7869
248ed943 7870 This function returns the best acceptable minimal size for the
41e2b43e
RD
7871 window, if applicable. For example, for a static text control, it will
7872 be the minimal size such that the control label is not truncated. For
7873 windows containing subwindows (suzh aswx.Panel), the size returned by
7874 this function will be the same as the size the window would have had
7875 after calling Fit.
0df68c9f 7876 """
54f9ee45 7877 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
7878
7879 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
7880 """
7881 GetBestSizeTuple() -> (width, height)
e811c8ce 7882
248ed943 7883 This function returns the best acceptable minimal size for the
41e2b43e
RD
7884 window, if applicable. For example, for a static text control, it will
7885 be the minimal size such that the control label is not truncated. For
7886 windows containing subwindows (suzh aswx.Panel), the size returned by
7887 this function will be the same as the size the window would have had
7888 after calling Fit.
0df68c9f 7889 """
54f9ee45 7890 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 7891
dfbb5885
RD
7892 def InvalidateBestSize(*args, **kwargs):
7893 """
7894 InvalidateBestSize(self)
7895
7896 Reset the cached best size value so it will be recalculated the next
7897 time it is needed.
7898 """
7899 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7900
e2813725
RD
7901 def CacheBestSize(*args, **kwargs):
7902 """
7903 CacheBestSize(self, Size size)
7904
7905 Cache the best size so it doesn't need to be calculated again, (at least until
7906 some properties of the window change.)
7907 """
7908 return _core_.Window_CacheBestSize(*args, **kwargs)
7909
dfbb5885
RD
7910 def GetBestFittingSize(*args, **kwargs):
7911 """
7912 GetBestFittingSize(self) -> Size
7913
7914 This function will merge the window's best size into the window's
7915 minimum size, giving priority to the min size components, and returns
7916 the results.
7917
7918 """
7919 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7920
e811c8ce 7921 def GetAdjustedBestSize(*args, **kwargs):
15afbcd0 7922 """
a95a7133 7923 GetAdjustedBestSize(self) -> Size
15afbcd0
RD
7924
7925 This method is similar to GetBestSize, except in one
7926 thing. GetBestSize should return the minimum untruncated size of the
7927 window, while this method will return the largest of BestSize and any
7928 user specified minimum size. ie. it is the minimum size the window
7929 should currently be drawn at, not the minimal size it can possibly
7930 tolerate.
7931 """
54f9ee45 7932 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
e811c8ce
RD
7933
7934 def Center(*args, **kwargs):
15afbcd0 7935 """
a95a7133 7936 Center(self, int direction=BOTH)
15afbcd0
RD
7937
7938 Centers the window. The parameter specifies the direction for
7939 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7940 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7941 on the entire screen and not on its parent window. If it is a
7942 top-level window and has no parent then it will always be centered
7943 relative to the screen.
7944 """
54f9ee45 7945 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
7946
7947 Centre = Center
e811c8ce 7948 def CenterOnParent(*args, **kwargs):
15afbcd0 7949 """
a95a7133 7950 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
7951
7952 Center with respect to the the parent window
7953 """
54f9ee45 7954 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
7955
7956 CentreOnParent = CenterOnParent
7957 def Fit(*args, **kwargs):
15afbcd0 7958 """
a95a7133 7959 Fit(self)
15afbcd0
RD
7960
7961 Sizes the window so that it fits around its subwindows. This function
7962 won't do anything if there are no subwindows and will only really work
7963 correctly if sizers are used for the subwindows layout. Also, if the
7964 window has exactly one subwindow it is better (faster and the result
7965 is more precise as Fit adds some margin to account for fuzziness of
7966 its calculations) to call window.SetClientSize(child.GetSize())
7967 instead of calling Fit.
7968 """
54f9ee45 7969 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
7970
7971 def FitInside(*args, **kwargs):
15afbcd0 7972 """
a95a7133 7973 FitInside(self)
15afbcd0
RD
7974
7975 Similar to Fit, but sizes the interior (virtual) size of a
7976 window. Mainly useful with scrolled windows to reset scrollbars after
7977 sizing changes that do not trigger a size event, and/or scrolled
7978 windows without an interior sizer. This function similarly won't do
7979 anything if there are no subwindows.
7980 """
54f9ee45 7981 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 7982
f16ab95d 7983 def SetSizeHints(*args, **kwargs):
0df68c9f 7984 """
a95a7133 7985 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 7986 int incH=-1)
15afbcd0
RD
7987
7988 Allows specification of minimum and maximum window sizes, and window
7989 size increments. If a pair of values is not set (or set to -1), the
7990 default values will be used. If this function is called, the user
908b74cd
RD
7991 will not be able to size the window outside the given bounds (if it is
7992 a top-level window.) Sizers will also inspect the minimum window size
7993 and will use that value if set when calculating layout.
7994
7995 The resizing increments are only significant under Motif or Xt.
0df68c9f 7996 """
f16ab95d 7997 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 7998
f16ab95d
RD
7999 def SetSizeHintsSz(*args, **kwargs):
8000 """
8001 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8002
8003 Allows specification of minimum and maximum window sizes, and window
8004 size increments. If a pair of values is not set (or set to -1), the
8005 default values will be used. If this function is called, the user
8006 will not be able to size the window outside the given bounds (if it is
8007 a top-level window.) Sizers will also inspect the minimum window size
8008 and will use that value if set when calculating layout.
8009
8010 The resizing increments are only significant under Motif or Xt.
8011 """
8012 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8013
8014 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 8015 """
908b74cd 8016 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
8017
8018 Allows specification of minimum and maximum virtual window sizes. If a
8019 pair of values is not set (or set to -1), the default values will be
8020 used. If this function is called, the user will not be able to size
8021 the virtual area of the window outside the given bounds.
8022 """
f16ab95d
RD
8023 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8024
8025 def SetVirtualSizeHintsSz(*args, **kwargs):
8026 """
8027 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8028
8029 Allows specification of minimum and maximum virtual window sizes. If a
8030 pair of values is not set (or set to -1), the default values will be
8031 used. If this function is called, the user will not be able to size
8032 the virtual area of the window outside the given bounds.
8033 """
8034 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 8035
908b74cd
RD
8036 def GetMaxSize(*args, **kwargs):
8037 """GetMaxSize(self) -> Size"""
8038 return _core_.Window_GetMaxSize(*args, **kwargs)
8039
8040 def GetMinSize(*args, **kwargs):
8041 """GetMinSize(self) -> Size"""
8042 return _core_.Window_GetMinSize(*args, **kwargs)
8043
8044 def SetMinSize(*args, **kwargs):
8045 """
8046 SetMinSize(self, Size minSize)
8047
8048 A more convenient method than `SetSizeHints` for setting just the
8049 min size.
8050 """
8051 return _core_.Window_SetMinSize(*args, **kwargs)
8052
8053 def SetMaxSize(*args, **kwargs):
8054 """
8055 SetMaxSize(self, Size maxSize)
8056
8057 A more convenient method than `SetSizeHints` for setting just the
8058 max size.
8059 """
8060 return _core_.Window_SetMaxSize(*args, **kwargs)
8061
e811c8ce 8062 def GetMinWidth(*args, **kwargs):
a95a7133 8063 """GetMinWidth(self) -> int"""
54f9ee45 8064 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
8065
8066 def GetMinHeight(*args, **kwargs):
a95a7133 8067 """GetMinHeight(self) -> int"""
54f9ee45 8068 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
8069
8070 def GetMaxWidth(*args, **kwargs):
a95a7133 8071 """GetMaxWidth(self) -> int"""
54f9ee45 8072 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
8073
8074 def GetMaxHeight(*args, **kwargs):
a95a7133 8075 """GetMaxHeight(self) -> int"""
54f9ee45 8076 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 8077
e811c8ce 8078 def SetVirtualSize(*args, **kwargs):
0df68c9f 8079 """
a95a7133 8080 SetVirtualSize(self, Size size)
e811c8ce 8081
15afbcd0
RD
8082 Set the the virtual size of a window in pixels. For most windows this
8083 is just the client area of the window, but for some like scrolled
8084 windows it is more or less independent of the screen window size.
0df68c9f 8085 """
54f9ee45 8086 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
8087
8088 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 8089 """
a95a7133 8090 SetVirtualSizeWH(self, int w, int h)
e811c8ce 8091
15afbcd0
RD
8092 Set the the virtual size of a window in pixels. For most windows this
8093 is just the client area of the window, but for some like scrolled
8094 windows it is more or less independent of the screen window size.
0df68c9f 8095 """
54f9ee45 8096 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
8097
8098 def GetVirtualSize(*args, **kwargs):
0df68c9f 8099 """
a95a7133 8100 GetVirtualSize(self) -> Size
e811c8ce 8101
15afbcd0
RD
8102 Get the the virtual size of the window in pixels. For most windows
8103 this is just the client area of the window, but for some like scrolled
8104 windows it is more or less independent of the screen window size.
0df68c9f 8105 """
54f9ee45 8106 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
8107
8108 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
8109 """
8110 GetVirtualSizeTuple() -> (width, height)
e811c8ce 8111
15afbcd0
RD
8112 Get the the virtual size of the window in pixels. For most windows
8113 this is just the client area of the window, but for some like scrolled
8114 windows it is more or less independent of the screen window size.
0df68c9f 8115 """
54f9ee45 8116 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce
RD
8117
8118 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 8119 """
a95a7133 8120 GetBestVirtualSize(self) -> Size
15afbcd0
RD
8121
8122 Return the largest of ClientSize and BestSize (as determined by a
8123 sizer, interior children, or other means)
8124 """
54f9ee45 8125 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
8126
8127 def Show(*args, **kwargs):
15afbcd0 8128 """
a95a7133 8129 Show(self, bool show=True) -> bool
15afbcd0
RD
8130
8131 Shows or hides the window. You may need to call Raise for a top level
8132 window if you want to bring it to top, although this is not needed if
8133 Show is called immediately after the frame creation. Returns True if
8134 the window has been shown or hidden or False if nothing was done
8135 because it already was in the requested state.
8136 """
54f9ee45 8137 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
8138
8139 def Hide(*args, **kwargs):
15afbcd0 8140 """
a95a7133 8141 Hide(self) -> bool
15afbcd0
RD
8142
8143 Equivalent to calling Show(False).
8144 """
54f9ee45 8145 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
8146
8147 def Enable(*args, **kwargs):
15afbcd0 8148 """
a95a7133 8149 Enable(self, bool enable=True) -> bool
15afbcd0
RD
8150
8151 Enable or disable the window for user input. Note that when a parent
8152 window is disabled, all of its children are disabled as well and they
8153 are reenabled again when the parent is. Returns true if the window
8154 has been enabled or disabled, false if nothing was done, i.e. if the
8155 window had already been in the specified state.
8156 """
54f9ee45 8157 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
8158
8159 def Disable(*args, **kwargs):
15afbcd0 8160 """
a95a7133 8161 Disable(self) -> bool
15afbcd0
RD
8162
8163 Disables the window, same as Enable(false).
8164 """
54f9ee45 8165 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
8166
8167 def IsShown(*args, **kwargs):
15afbcd0 8168 """
a95a7133 8169 IsShown(self) -> bool
15afbcd0
RD
8170
8171 Returns true if the window is shown, false if it has been hidden.
8172 """
54f9ee45 8173 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
8174
8175 def IsEnabled(*args, **kwargs):
15afbcd0 8176 """
a95a7133 8177 IsEnabled(self) -> bool
15afbcd0
RD
8178
8179 Returns true if the window is enabled for input, false otherwise.
8180 """
54f9ee45 8181 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce
RD
8182
8183 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 8184 """
a95a7133 8185 SetWindowStyleFlag(self, long style)
15afbcd0 8186
41e2b43e
RD
8187 Sets the style of the window. Please note that some styles cannot be
8188 changed after the window creation and that Refresh() might need to be
8189 called after changing the others for the change to take place
8190 immediately.
15afbcd0 8191 """
54f9ee45 8192 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
8193
8194 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 8195 """
a95a7133 8196 GetWindowStyleFlag(self) -> long
e811c8ce 8197
15afbcd0
RD
8198 Gets the window style that was passed to the constructor or Create
8199 method.
8200 """
54f9ee45 8201 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 8202
15afbcd0 8203 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 8204 def HasFlag(*args, **kwargs):
15afbcd0 8205 """
a95a7133 8206 HasFlag(self, int flag) -> bool
15afbcd0
RD
8207
8208 Test if the given style is set for this window.
8209 """
54f9ee45 8210 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
8211
8212 def IsRetained(*args, **kwargs):
15afbcd0 8213 """
a95a7133 8214 IsRetained(self) -> bool
15afbcd0
RD
8215
8216 Returns true if the window is retained, false otherwise. Retained
8217 windows are only available on X platforms.
8218 """
54f9ee45 8219 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce
RD
8220
8221 def SetExtraStyle(*args, **kwargs):
15afbcd0 8222 """
a95a7133 8223 SetExtraStyle(self, long exStyle)
15afbcd0
RD
8224
8225 Sets the extra style bits for the window. Extra styles are the less
8226 often used style bits which can't be set with the constructor or with
8227 SetWindowStyleFlag()
8228 """
54f9ee45 8229 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
8230
8231 def GetExtraStyle(*args, **kwargs):
15afbcd0 8232 """
a95a7133 8233 GetExtraStyle(self) -> long
15afbcd0
RD
8234
8235 Returns the extra style bits for the window.
8236 """
54f9ee45 8237 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
8238
8239 def MakeModal(*args, **kwargs):
15afbcd0 8240 """
a95a7133 8241 MakeModal(self, bool modal=True)
15afbcd0
RD
8242
8243 Disables all other windows in the application so that the user can
8244 only interact with this window. Passing False will reverse this
8245 effect.
8246 """
54f9ee45 8247 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
8248
8249 def SetThemeEnabled(*args, **kwargs):
15afbcd0 8250 """
a95a7133 8251 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
8252
8253 This function tells a window if it should use the system's "theme"
8254 code to draw the windows' background instead if its own background
8255 drawing code. This will only have an effect on platforms that support
8256 the notion of themes in user defined windows. One such platform is
8257 GTK+ where windows can have (very colourful) backgrounds defined by a
8258 user's selected theme.
8259
8260 Dialogs, notebook pages and the status bar have this flag set to true
8261 by default so that the default look and feel is simulated best.
8262 """
54f9ee45 8263 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8264
8265 def GetThemeEnabled(*args, **kwargs):
15afbcd0 8266 """
a95a7133 8267 GetThemeEnabled(self) -> bool
e811c8ce 8268
15afbcd0
RD
8269 Return the themeEnabled flag.
8270 """
54f9ee45 8271 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8272
8273 def SetFocus(*args, **kwargs):
15afbcd0 8274 """
a95a7133 8275 SetFocus(self)
15afbcd0
RD
8276
8277 Set's the focus to this window, allowing it to receive keyboard input.
8278 """
54f9ee45 8279 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
8280
8281 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 8282 """
a95a7133 8283 SetFocusFromKbd(self)
15afbcd0
RD
8284
8285 Set focus to this window as the result of a keyboard action. Normally
8286 only called internally.
8287 """
54f9ee45 8288 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
8289
8290 def FindFocus(*args, **kwargs):
15afbcd0 8291 """
66c033b4 8292 FindFocus() -> Window
15afbcd0
RD
8293
8294 Returns the window or control that currently has the keyboard focus,
8295 or None.
8296 """
54f9ee45 8297 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
8298
8299 FindFocus = staticmethod(FindFocus)
8300 def AcceptsFocus(*args, **kwargs):
15afbcd0 8301 """
a95a7133 8302 AcceptsFocus(self) -> bool
15afbcd0
RD
8303
8304 Can this window have focus?
8305 """
54f9ee45 8306 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce
RD
8307
8308 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 8309 """
a95a7133 8310 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
8311
8312 Can this window be given focus by keyboard navigation? if not, the
8313 only way to give it focus (provided it accepts it at all) is to click
8314 it.
8315 """
54f9ee45 8316 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce
RD
8317
8318 def GetDefaultItem(*args, **kwargs):
15afbcd0 8319 """
a95a7133 8320 GetDefaultItem(self) -> Window
15afbcd0
RD
8321
8322 Get the default child of this parent, i.e. the one which is activated
8323 by pressing <Enter> such as the OK button on a wx.Dialog.
8324 """
54f9ee45 8325 return _core_.Window_GetDefaultItem(*args, **kwargs)
e811c8ce
RD
8326
8327 def SetDefaultItem(*args, **kwargs):
15afbcd0 8328 """
a95a7133 8329 SetDefaultItem(self, Window child) -> Window
15afbcd0
RD
8330
8331 Set this child as default, return the old default.
8332 """
54f9ee45 8333 return _core_.Window_SetDefaultItem(*args, **kwargs)
e811c8ce
RD
8334
8335 def SetTmpDefaultItem(*args, **kwargs):
15afbcd0 8336 """
a95a7133 8337 SetTmpDefaultItem(self, Window win)
15afbcd0
RD
8338
8339 Set this child as temporary default
8340 """
54f9ee45 8341 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
e811c8ce 8342
908b74cd
RD
8343 def Navigate(*args, **kwargs):
8344 """
8345 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8346
fd2dc343
RD
8347 Does keyboard navigation from this window to another, by sending a
8348 `wx.NavigationKeyEvent`.
908b74cd
RD
8349 """
8350 return _core_.Window_Navigate(*args, **kwargs)
8351
7f98d120
RD
8352 def MoveAfterInTabOrder(*args, **kwargs):
8353 """
8354 MoveAfterInTabOrder(self, Window win)
8355
8356 Moves this window in the tab navigation order after the specified
8357 sibling window. This means that when the user presses the TAB key on
8358 that other window, the focus switches to this window.
8359
8360 The default tab order is the same as creation order. This function
8361 and `MoveBeforeInTabOrder` allow to change it after creating all the
8362 windows.
8363
8364 """
8365 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8366
8367 def MoveBeforeInTabOrder(*args, **kwargs):
8368 """
8369 MoveBeforeInTabOrder(self, Window win)
8370
8371 Same as `MoveAfterInTabOrder` except that it inserts this window just
8372 before win instead of putting it right after it.
8373 """
8374 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8375
e811c8ce 8376 def GetChildren(*args, **kwargs):
15afbcd0 8377 """
a95a7133 8378 GetChildren(self) -> PyObject
15afbcd0
RD
8379
8380 Returns a list of the window's children. NOTE: Currently this is a
8381 copy of the child window list maintained by the window, so the return
8382 value of this function is only valid as long as the window's children
8383 do not change.
8384 """
54f9ee45 8385 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
8386
8387 def GetParent(*args, **kwargs):
15afbcd0 8388 """
a95a7133 8389 GetParent(self) -> Window
15afbcd0
RD
8390
8391 Returns the parent window of this window, or None if there isn't one.
8392 """
54f9ee45 8393 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
8394
8395 def GetGrandParent(*args, **kwargs):
15afbcd0 8396 """
a95a7133 8397 GetGrandParent(self) -> Window
15afbcd0 8398
41e2b43e
RD
8399 Returns the parent of the parent of this window, or None if there
8400 isn't one.
15afbcd0 8401 """
54f9ee45 8402 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce
RD
8403
8404 def IsTopLevel(*args, **kwargs):
15afbcd0 8405 """
a95a7133 8406 IsTopLevel(self) -> bool
15afbcd0
RD
8407
8408 Returns true if the given window is a top-level one. Currently all
8409 frames and dialogs are always considered to be top-level windows (even
8410 if they have a parent window).
8411 """
54f9ee45 8412 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
8413
8414 def Reparent(*args, **kwargs):
15afbcd0 8415 """
a95a7133 8416 Reparent(self, Window newParent) -> bool
15afbcd0
RD
8417
8418 Reparents the window, i.e the window will be removed from its current
8419 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8420 re-inserted into another. Available on Windows and GTK. Returns True
8421 if the parent was changed, False otherwise (error or newParent ==
8422 oldParent)
8423 """
54f9ee45 8424 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
8425
8426 def AddChild(*args, **kwargs):
15afbcd0 8427 """
a95a7133 8428 AddChild(self, Window child)
15afbcd0
RD
8429
8430 Adds a child window. This is called automatically by window creation
8431 functions so should not be required by the application programmer.
8432 """
54f9ee45 8433 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
8434
8435 def RemoveChild(*args, **kwargs):
15afbcd0 8436 """
a95a7133 8437 RemoveChild(self, Window child)
15afbcd0
RD
8438
8439 Removes a child window. This is called automatically by window
8440 deletion functions so should not be required by the application
8441 programmer.
8442 """
54f9ee45 8443 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce
RD
8444
8445 def FindWindowById(*args, **kwargs):
15afbcd0 8446 """
a95a7133 8447 FindWindowById(self, long winid) -> Window
15afbcd0
RD
8448
8449 Find a chld of this window by window ID
8450 """
54f9ee45 8451 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
8452
8453 def FindWindowByName(*args, **kwargs):
15afbcd0 8454 """
a95a7133 8455 FindWindowByName(self, String name) -> Window
15afbcd0
RD
8456
8457 Find a child of this window by name
8458 """
54f9ee45 8459 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
8460
8461 def GetEventHandler(*args, **kwargs):
15afbcd0 8462 """
a95a7133 8463 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
8464
8465 Returns the event handler for this window. By default, the window is
8466 its own event handler.
8467 """
54f9ee45 8468 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
8469
8470 def SetEventHandler(*args, **kwargs):
15afbcd0 8471 """
a95a7133 8472 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
8473
8474 Sets the event handler for this window. An event handler is an object
8475 that is capable of processing the events sent to a window. By default,
8476 the window is its own event handler, but an application may wish to
8477 substitute another, for example to allow central implementation of
8478 event-handling for a variety of different window classes.
8479
41e2b43e 8480 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0
RD
8481 up a chain of event handlers, where an event not handled by one event
8482 handler is handed to the next one in the chain.
8483 """
54f9ee45 8484 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
8485
8486 def PushEventHandler(*args, **kwargs):
15afbcd0 8487 """
a95a7133 8488 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
8489
8490 Pushes this event handler onto the event handler stack for the window.
8491 An event handler is an object that is capable of processing the events
8492 sent to a window. By default, the window is its own event handler, but
8493 an application may wish to substitute another, for example to allow
8494 central implementation of event-handling for a variety of different
8495 window classes.
8496
8497 wx.Window.PushEventHandler allows an application to set up a chain of
8498 event handlers, where an event not handled by one event handler is
41e2b43e 8499 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
15afbcd0
RD
8500 remove the event handler.
8501 """
54f9ee45 8502 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
8503
8504 def PopEventHandler(*args, **kwargs):
15afbcd0 8505 """
a95a7133 8506 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
8507
8508 Removes and returns the top-most event handler on the event handler
8509 stack. If deleteHandler is True then the wx.EvtHandler object will be
8510 destroyed after it is popped.
8511 """
54f9ee45 8512 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
8513
8514 def RemoveEventHandler(*args, **kwargs):
15afbcd0 8515 """
a95a7133 8516 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 8517
41e2b43e
RD
8518 Find the given handler in the event handler chain and remove (but not
8519 delete) it from the event handler chain, return True if it was found
8520 and False otherwise (this also results in an assert failure so this
8521 function should only be called when the handler is supposed to be
8522 there.)
15afbcd0 8523 """
54f9ee45 8524 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
8525
8526 def SetValidator(*args, **kwargs):
15afbcd0 8527 """
a95a7133 8528 SetValidator(self, Validator validator)
15afbcd0
RD
8529
8530 Deletes the current validator (if any) and sets the window validator,
8531 having called wx.Validator.Clone to create a new validator of this
8532 type.
8533 """
54f9ee45 8534 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
8535
8536 def GetValidator(*args, **kwargs):
15afbcd0 8537 """
a95a7133 8538 GetValidator(self) -> Validator
15afbcd0
RD
8539
8540 Returns a pointer to the current validator for the window, or None if
8541 there is none.
8542 """
54f9ee45 8543 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 8544
74a57fcd
RD
8545 def Validate(*args, **kwargs):
8546 """
a95a7133 8547 Validate(self) -> bool
74a57fcd
RD
8548
8549 Validates the current values of the child controls using their
41e2b43e
RD
8550 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8551 style flag set, the method will also call Validate() of all child
8552 windows. Returns false if any of the validations failed.
74a57fcd 8553 """
54f9ee45 8554 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
8555
8556 def TransferDataToWindow(*args, **kwargs):
8557 """
a95a7133 8558 TransferDataToWindow(self) -> bool
74a57fcd 8559
41e2b43e
RD
8560 Transfers values to child controls from data areas specified by their
8561 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8562 style flag set, the method will also call TransferDataToWindow() of
8563 all child windows.
74a57fcd 8564 """
54f9ee45 8565 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
8566
8567 def TransferDataFromWindow(*args, **kwargs):
8568 """
a95a7133 8569 TransferDataFromWindow(self) -> bool
74a57fcd 8570
41e2b43e
RD
8571 Transfers values from child controls to data areas specified by their
8572 validators. Returns false if a transfer failed. If the window has
8573 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8574 also call TransferDataFromWindow() of all child windows.
74a57fcd 8575 """
54f9ee45 8576 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
8577
8578 def InitDialog(*args, **kwargs):
8579 """
a95a7133 8580 InitDialog(self)
74a57fcd 8581
41e2b43e
RD
8582 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8583 to the dialog via validators.
74a57fcd 8584 """
54f9ee45 8585 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 8586
e811c8ce 8587 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 8588 """
a95a7133 8589 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
8590
8591 Sets the accelerator table for this window.
8592 """
54f9ee45 8593 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
8594
8595 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 8596 """
a95a7133 8597 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
8598
8599 Gets the accelerator table for this window.
8600 """
54f9ee45 8601 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
8602
8603 def RegisterHotKey(*args, **kwargs):
15afbcd0 8604 """
a95a7133 8605 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
8606
8607 Registers a system wide hotkey. Every time the user presses the hotkey
8608 registered here, this window will receive a hotkey event. It will
8609 receive the event even if the application is in the background and
8610 does not have the input focus because the user is working with some
8611 other application. To bind an event handler function to this hotkey
8612 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8613 hotkey was registered successfully.
8614 """
54f9ee45 8615 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
8616
8617 def UnregisterHotKey(*args, **kwargs):
15afbcd0 8618 """
a95a7133 8619 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
8620
8621 Unregisters a system wide hotkey.
8622 """
54f9ee45 8623 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
8624
8625 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 8626 """
a95a7133 8627 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
8628
8629 Converts a point or size from dialog units to pixels. Dialog units
8630 are used for maintaining a dialog's proportions even if the font
8631 changes. For the x dimension, the dialog units are multiplied by the
8632 average character width and then divided by 4. For the y dimension,
8633 the dialog units are multiplied by the average character height and
8634 then divided by 8.
8635 """
54f9ee45 8636 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
8637
8638 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 8639 """
a95a7133 8640 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
8641
8642 Converts a point or size from dialog units to pixels. Dialog units
8643 are used for maintaining a dialog's proportions even if the font
8644 changes. For the x dimension, the dialog units are multiplied by the
8645 average character width and then divided by 4. For the y dimension,
8646 the dialog units are multiplied by the average character height and
8647 then divided by 8.
8648 """
54f9ee45 8649 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
8650
8651 def DLG_PNT(*args, **kwargs):
15afbcd0 8652 """
a95a7133 8653 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
8654
8655 Converts a point or size from dialog units to pixels. Dialog units
8656 are used for maintaining a dialog's proportions even if the font
8657 changes. For the x dimension, the dialog units are multiplied by the
8658 average character width and then divided by 4. For the y dimension,
8659 the dialog units are multiplied by the average character height and
8660 then divided by 8.
8661 """
54f9ee45 8662 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
8663
8664 def DLG_SZE(*args, **kwargs):
15afbcd0 8665 """
a95a7133 8666 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
8667
8668 Converts a point or size from dialog units to pixels. Dialog units
8669 are used for maintaining a dialog's proportions even if the font
8670 changes. For the x dimension, the dialog units are multiplied by the
8671 average character width and then divided by 4. For the y dimension,
8672 the dialog units are multiplied by the average character height and
8673 then divided by 8.
8674 """
54f9ee45 8675 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
8676
8677 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 8678 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 8679 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
8680
8681 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 8682 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 8683 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
8684
8685 def WarpPointer(*args, **kwargs):
15afbcd0 8686 """
a95a7133 8687 WarpPointer(self, int x, int y)
15afbcd0
RD
8688
8689 Moves the pointer to the given position on the window.
8690
8691 NOTE: This function is not supported under Mac because Apple Human
8692 Interface Guidelines forbid moving the mouse cursor programmatically.
8693 """
54f9ee45 8694 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
8695
8696 def CaptureMouse(*args, **kwargs):
15afbcd0 8697 """
a95a7133 8698 CaptureMouse(self)
15afbcd0
RD
8699
8700 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8701 release the capture.
8702
8703 Note that wxWindows maintains the stack of windows having captured the
8704 mouse and when the mouse is released the capture returns to the window
8705 which had had captured it previously and it is only really released if
8706 there were no previous window. In particular, this means that you must
8707 release the mouse as many times as you capture it.
8708 """
54f9ee45 8709 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
8710
8711 def ReleaseMouse(*args, **kwargs):
15afbcd0 8712 """
a95a7133 8713 ReleaseMouse(self)
15afbcd0
RD
8714
8715 Releases mouse input captured with wx.Window.CaptureMouse.
8716 """
54f9ee45 8717 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
8718
8719 def GetCapture(*args, **kwargs):
15afbcd0 8720 """
66c033b4 8721 GetCapture() -> Window
15afbcd0
RD
8722
8723 Returns the window which currently captures the mouse or None
8724 """
54f9ee45 8725 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
8726
8727 GetCapture = staticmethod(GetCapture)
8728 def HasCapture(*args, **kwargs):
15afbcd0 8729 """
a95a7133 8730 HasCapture(self) -> bool
15afbcd0
RD
8731
8732 Returns true if this window has the current mouse capture.
8733 """
54f9ee45 8734 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
8735
8736 def Refresh(*args, **kwargs):
15afbcd0 8737 """
a95a7133 8738 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
8739
8740 Mark the specified rectangle (or the whole window) as "dirty" so it
8741 will be repainted. Causes an EVT_PAINT event to be generated and sent
8742 to the window.
8743 """
54f9ee45 8744 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
8745
8746 def RefreshRect(*args, **kwargs):
15afbcd0 8747 """
fef4c27a 8748 RefreshRect(self, Rect rect, bool eraseBackground=True)
15afbcd0
RD
8749
8750 Redraws the contents of the given rectangle: the area inside it will
8751 be repainted. This is the same as Refresh but has a nicer syntax.
8752 """
54f9ee45 8753 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
8754
8755 def Update(*args, **kwargs):
15afbcd0 8756 """
a95a7133 8757 Update(self)
15afbcd0
RD
8758
8759 Calling this method immediately repaints the invalidated area of the
8760 window instead of waiting for the EVT_PAINT event to happen, (normally
8761 this would usually only happen when the flow of control returns to the
8762 event loop.) Notice that this function doesn't refresh the window and
8763 does nothing if the window has been already repainted. Use Refresh
8764 first if you want to immediately redraw the window (or some portion of
8765 it) unconditionally.
8766 """
54f9ee45 8767 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
8768
8769 def ClearBackground(*args, **kwargs):
15afbcd0 8770 """
a95a7133 8771 ClearBackground(self)
15afbcd0
RD
8772
8773 Clears the window by filling it with the current background
8774 colour. Does not cause an erase background event to be generated.
8775 """
54f9ee45 8776 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
8777
8778 def Freeze(*args, **kwargs):
15afbcd0 8779 """
a95a7133 8780 Freeze(self)
15afbcd0 8781
41e2b43e
RD
8782 Freezes the window or, in other words, prevents any updates from
8783 taking place on screen, the window is not redrawn at all. Thaw must be
8784 called to reenable window redrawing. Calls to Freeze/Thaw may be
8785 nested, with the actual Thaw being delayed until all the nesting has
8786 been undone.
15afbcd0
RD
8787
8788 This method is useful for visual appearance optimization (for example,
8789 it is a good idea to use it before inserting large amount of text into
8790 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8791 for all controls so it is mostly just a hint to wxWindows and not a
8792 mandatory directive.
8793 """
54f9ee45 8794 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce
RD
8795
8796 def Thaw(*args, **kwargs):
15afbcd0 8797 """
a95a7133 8798 Thaw(self)
15afbcd0 8799
4276dc52 8800 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
8801 Freeze/Thaw may be nested, so Thaw must be called the same number of
8802 times that Freeze was before the window will be updated.
15afbcd0 8803 """
54f9ee45 8804 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
8805
8806 def PrepareDC(*args, **kwargs):
15afbcd0 8807 """
a95a7133 8808 PrepareDC(self, DC dc)
15afbcd0
RD
8809
8810 Call this function to prepare the device context for drawing a
8811 scrolled image. It sets the device origin according to the current
8812 scroll position.
8813 """
54f9ee45 8814 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce
RD
8815
8816 def GetUpdateRegion(*args, **kwargs):
15afbcd0 8817 """
a95a7133 8818 GetUpdateRegion(self) -> Region
15afbcd0
RD
8819
8820 Returns the region specifying which parts of the window have been
8821 damaged. Should only be called within an EVT_PAINT handler.
8822 """
54f9ee45 8823 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
8824
8825 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 8826 """
a95a7133 8827 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
8828
8829 Get the update rectangle region bounding box in client coords.
8830 """
54f9ee45 8831 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
8832
8833 def IsExposed(*args, **kwargs):
15afbcd0 8834 """
a95a7133 8835 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
8836
8837 Returns true if the given point or rectangle area has been exposed
8838 since the last repaint. Call this in an paint event handler to
8839 optimize redrawing by only redrawing those areas, which have been
8840 exposed.
8841 """
54f9ee45 8842 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
8843
8844 def IsExposedPoint(*args, **kwargs):
15afbcd0 8845 """
a95a7133 8846 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
8847
8848 Returns true if the given point or rectangle area has been exposed
8849 since the last repaint. Call this in an paint event handler to
8850 optimize redrawing by only redrawing those areas, which have been
8851 exposed.
8852 """
54f9ee45 8853 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 8854
4276dc52 8855 def IsExposedRect(*args, **kwargs):
15afbcd0 8856 """
a95a7133 8857 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
8858
8859 Returns true if the given point or rectangle area has been exposed
8860 since the last repaint. Call this in an paint event handler to
8861 optimize redrawing by only redrawing those areas, which have been
8862 exposed.
8863 """
54f9ee45 8864 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 8865
74a57fcd
RD
8866 def GetDefaultAttributes(*args, **kwargs):
8867 """
a95a7133 8868 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 8869
41e2b43e
RD
8870 Get the default attributes for an instance of this class. This is
8871 useful if you want to use the same font or colour in your own control
8872 as in a standard control -- which is a much better idea than hard
8873 coding specific colours or fonts which might look completely out of
db3e571a 8874 place on the user's system, especially if it uses themes.
74a57fcd 8875 """
54f9ee45 8876 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
8877
8878 def GetClassDefaultAttributes(*args, **kwargs):
8879 """
66c033b4 8880 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 8881
41e2b43e
RD
8882 Get the default attributes for this class. This is useful if you want
8883 to use the same font or colour in your own control as in a standard
8884 control -- which is a much better idea than hard coding specific
db3e571a
RD
8885 colours or fonts which might look completely out of place on the
8886 user's system, especially if it uses themes.
74a57fcd
RD
8887
8888 The variant parameter is only relevant under Mac currently and is
41e2b43e 8889 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
8890 the returned font. See `wx.Window.SetWindowVariant` for more about
8891 this.
74a57fcd 8892 """
54f9ee45 8893 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
8894
8895 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 8896 def SetBackgroundColour(*args, **kwargs):
15afbcd0 8897 """
a95a7133 8898 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
8899
8900 Sets the background colour of the window. Returns True if the colour
8901 was changed. The background colour is usually painted by the default
8902 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
8903 automatically under GTK. Using `wx.NullColour` will reset the window
8904 to the default background colour.
15afbcd0 8905
db3e571a 8906 Note that setting the background colour may not cause an immediate
f8167d6e 8907 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
8908 calling this function.
8909
f8167d6e
RD
8910 Using this function will disable attempts to use themes for this
8911 window, if the system supports them. Use with care since usually the
8912 themes represent the appearance chosen by the user to be used for all
8913 applications on the system.
15afbcd0 8914 """
54f9ee45 8915 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 8916
412d302d
RD
8917 def SetOwnBackgroundColour(*args, **kwargs):
8918 """SetOwnBackgroundColour(self, Colour colour)"""
8919 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 8920
e811c8ce 8921 def SetForegroundColour(*args, **kwargs):
15afbcd0 8922 """
a95a7133 8923 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
8924
8925 Sets the foreground colour of the window. Returns True is the colour
8926 was changed. The interpretation of foreground colour is dependent on
8927 the window class; it may be the text colour or other colour, or it may
8928 not be used at all.
8929 """
54f9ee45 8930 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 8931
fa47d7a7
VS
8932 def SetOwnForegroundColour(*args, **kwargs):
8933 """SetOwnForegroundColour(self, Colour colour)"""
8934 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 8935
e811c8ce 8936 def GetBackgroundColour(*args, **kwargs):
15afbcd0 8937 """
a95a7133 8938 GetBackgroundColour(self) -> Colour
15afbcd0
RD
8939
8940 Returns the background colour of the window.
8941 """
54f9ee45 8942 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
8943
8944 def GetForegroundColour(*args, **kwargs):
15afbcd0 8945 """
a95a7133 8946 GetForegroundColour(self) -> Colour
15afbcd0
RD
8947
8948 Returns the foreground colour of the window. The interpretation of
8949 foreground colour is dependent on the window class; it may be the text
8950 colour or other colour, or it may not be used at all.
8951 """
54f9ee45 8952 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 8953
562ecc31
RD
8954 def InheritsBackgroundColour(*args, **kwargs):
8955 """InheritsBackgroundColour(self) -> bool"""
8956 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8957
8958 def UseBgCol(*args, **kwargs):
8959 """UseBgCol(self) -> bool"""
8960 return _core_.Window_UseBgCol(*args, **kwargs)
8961
7bc1e663
RD
8962 def SetBackgroundStyle(*args, **kwargs):
8963 """
8964 SetBackgroundStyle(self, int style) -> bool
8965
8966 Returns the background style of the window. The background style
8967 indicates how the background of the window is drawn.
8968
8969 ====================== ========================================
8970 wx.BG_STYLE_SYSTEM The background colour or pattern should
8971 be determined by the system
8972 wx.BG_STYLE_COLOUR The background should be a solid colour
8973 wx.BG_STYLE_CUSTOM The background will be implemented by the
8974 application.
8975 ====================== ========================================
8976
8977 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8978 a custom background, such as a tiled bitmap. Currently the style has
8979 no effect on other platforms.
8980
8981 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8982 """
8983 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8984
8985 def GetBackgroundStyle(*args, **kwargs):
8986 """
8987 GetBackgroundStyle(self) -> int
8988
8989 Returns the background style of the window.
8990
8991 :see: `SetBackgroundStyle`
8992 """
8993 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
8994
51b83b37
RD
8995 def HasTransparentBackground(*args, **kwargs):
8996 """
8997 HasTransparentBackground(self) -> bool
8998
8999 Returns True if this window's background is transparent (as, for
9000 example, for `wx.StaticText`) and should show the parent window's
9001 background.
9002
9003 This method is mostly used internally by the library itself and you
9004 normally shouldn't have to call it. You may, however, have to override
9005 it in your custom control classes to ensure that background is painted
9006 correctly.
9007 """
9008 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9009
e811c8ce 9010 def SetCursor(*args, **kwargs):
15afbcd0 9011 """
a95a7133 9012 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
9013
9014 Sets the window's cursor. Notice that the window cursor also sets it
9015 for the children of the window implicitly.
9016
9017 The cursor may be wx.NullCursor in which case the window cursor will
9018 be reset back to default.
9019 """
54f9ee45 9020 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
9021
9022 def GetCursor(*args, **kwargs):
15afbcd0 9023 """
a95a7133 9024 GetCursor(self) -> Cursor
15afbcd0
RD
9025
9026 Return the cursor associated with this window.
9027 """
54f9ee45 9028 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
9029
9030 def SetFont(*args, **kwargs):
15afbcd0 9031 """
a95a7133 9032 SetFont(self, Font font) -> bool
15afbcd0
RD
9033
9034 Sets the font for this window.
9035 """
54f9ee45 9036 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 9037
fa47d7a7
VS
9038 def SetOwnFont(*args, **kwargs):
9039 """SetOwnFont(self, Font font)"""
9040 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 9041
e811c8ce 9042 def GetFont(*args, **kwargs):
15afbcd0 9043 """
a95a7133 9044 GetFont(self) -> Font
15afbcd0 9045
4276dc52 9046 Returns the default font used for this window.
15afbcd0 9047 """
54f9ee45 9048 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
9049
9050 def SetCaret(*args, **kwargs):
15afbcd0 9051 """
a95a7133 9052 SetCaret(self, Caret caret)
15afbcd0
RD
9053
9054 Sets the caret associated with the window.
9055 """
54f9ee45 9056 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
9057
9058 def GetCaret(*args, **kwargs):
15afbcd0 9059 """
a95a7133 9060 GetCaret(self) -> Caret
15afbcd0
RD
9061
9062 Returns the caret associated with the window.
9063 """
54f9ee45 9064 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
9065
9066 def GetCharHeight(*args, **kwargs):
15afbcd0 9067 """
a95a7133 9068 GetCharHeight(self) -> int
15afbcd0
RD
9069
9070 Get the (average) character size for the current font.
9071 """
54f9ee45 9072 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
9073
9074 def GetCharWidth(*args, **kwargs):
15afbcd0 9075 """
a95a7133 9076 GetCharWidth(self) -> int
15afbcd0
RD
9077
9078 Get the (average) character size for the current font.
9079 """
54f9ee45 9080 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
9081
9082 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9083 """
9084 GetTextExtent(String string) -> (width, height)
9085
9086 Get the width and height of the text using the current font.
9087 """
54f9ee45 9088 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
9089
9090 def GetFullTextExtent(*args, **kwargs):
0df68c9f 9091 """
196addbf 9092 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 9093 (width, height, descent, externalLeading)
e811c8ce 9094
15afbcd0
RD
9095 Get the width, height, decent and leading of the text using the
9096 current or specified font.
0df68c9f 9097 """
54f9ee45 9098 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
9099
9100 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
9101 """
9102 ClientToScreenXY(int x, int y) -> (x,y)
9103
9104 Converts to screen coordinates from coordinates relative to this window.
9105 """
54f9ee45 9106 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
9107
9108 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
9109 """
9110 ScreenToClientXY(int x, int y) -> (x,y)
9111
9112 Converts from screen to client window coordinates.
9113 """
54f9ee45 9114 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
9115
9116 def ClientToScreen(*args, **kwargs):
15afbcd0 9117 """
a95a7133 9118 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
9119
9120 Converts to screen coordinates from coordinates relative to this window.
9121 """
54f9ee45 9122 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
9123
9124 def ScreenToClient(*args, **kwargs):
15afbcd0 9125 """
a95a7133 9126 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
9127
9128 Converts from screen to client window coordinates.
9129 """
54f9ee45 9130 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
9131
9132 def HitTestXY(*args, **kwargs):
15afbcd0 9133 """
a95a7133 9134 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
9135
9136 Test where the given (in client coords) point lies
9137 """
54f9ee45 9138 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
9139
9140 def HitTest(*args, **kwargs):
15afbcd0 9141 """
a95a7133 9142 HitTest(self, Point pt) -> int
15afbcd0
RD
9143
9144 Test where the given (in client coords) point lies
9145 """
54f9ee45 9146 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 9147
15afbcd0
RD
9148 def GetBorder(*args):
9149 """
a95a7133
RD
9150 GetBorder(self, long flags) -> int
9151 GetBorder(self) -> int
e811c8ce 9152
15afbcd0
RD
9153 Get border for the flags of this window
9154 """
54f9ee45 9155 return _core_.Window_GetBorder(*args)
e811c8ce
RD
9156
9157 def UpdateWindowUI(*args, **kwargs):
15afbcd0 9158 """
a95a7133 9159 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
9160
9161 This function sends EVT_UPDATE_UI events to the window. The particular
9162 implementation depends on the window; for example a wx.ToolBar will
9163 send an update UI event for each toolbar button, and a wx.Frame will
9164 send an update UI event for each menubar menu item. You can call this
9165 function from your application to ensure that your UI is up-to-date at
9166 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9167 concerned). This may be necessary if you have called
5ba5649b 9168 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
15afbcd0
RD
9169 limit the overhead that wxWindows incurs by sending update UI events
9170 in idle time.
15afbcd0 9171 """
54f9ee45 9172 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
9173
9174 def PopupMenuXY(*args, **kwargs):
15afbcd0 9175 """
b0503257 9176 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 9177
b0503257
RD
9178 Pops up the given menu at the specified coordinates, relative to this window,
9179 and returns control when the user has dismissed the menu. If a menu item is
9180 selected, the corresponding menu event is generated and will be processed as
9181 usual. If the default position is given then the current position of the
9182 mouse cursor will be used.
15afbcd0 9183 """
54f9ee45 9184 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 9185
15afbcd0
RD
9186 def PopupMenu(*args, **kwargs):
9187 """
b0503257 9188 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 9189
b0503257
RD
9190 Pops up the given menu at the specified coordinates, relative to this window,
9191 and returns control when the user has dismissed the menu. If a menu item is
9192 selected, the corresponding menu event is generated and will be processed as
9193 usual. If the default position is given then the current position of the
9194 mouse cursor will be used.
15afbcd0 9195 """
54f9ee45 9196 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0
RD
9197
9198 def GetHandle(*args, **kwargs):
9199 """
a95a7133 9200 GetHandle(self) -> long
15afbcd0
RD
9201
9202 Returns the platform-specific handle (as a long integer) of the
9203 physical window. Currently on wxMac it returns the handle of the
9204 toplevel parent of the window.
9205 """
54f9ee45 9206 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 9207
7e63a440
RD
9208 def AssociateHandle(*args, **kwargs):
9209 """
9210 AssociateHandle(self, long handle)
9211
9212 Associate the window with a new native handle
9213 """
9214 return _core_.Window_AssociateHandle(*args, **kwargs)
9215
9216 def DissociateHandle(*args, **kwargs):
9217 """
9218 DissociateHandle(self)
9219
9220 Dissociate the current native handle from the window
9221 """
9222 return _core_.Window_DissociateHandle(*args, **kwargs)
9223
15afbcd0
RD
9224 def HasScrollbar(*args, **kwargs):
9225 """
a95a7133 9226 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
9227
9228 Does the window have the scrollbar for this orientation?
9229 """
54f9ee45 9230 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
9231
9232 def SetScrollbar(*args, **kwargs):
9233 """
41e2b43e 9234 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
9235 bool refresh=True)
9236
9237 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 9238 """
54f9ee45 9239 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
9240
9241 def SetScrollPos(*args, **kwargs):
15afbcd0 9242 """
a95a7133 9243 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
9244
9245 Sets the position of one of the built-in scrollbars.
9246 """
54f9ee45 9247 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
9248
9249 def GetScrollPos(*args, **kwargs):
15afbcd0 9250 """
a95a7133 9251 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
9252
9253 Returns the built-in scrollbar position.
9254 """
54f9ee45 9255 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
9256
9257 def GetScrollThumb(*args, **kwargs):
15afbcd0 9258 """
a95a7133 9259 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
9260
9261 Returns the built-in scrollbar thumb size.
9262 """
54f9ee45 9263 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
9264
9265 def GetScrollRange(*args, **kwargs):
15afbcd0 9266 """
a95a7133 9267 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
9268
9269 Returns the built-in scrollbar range.
9270 """
54f9ee45 9271 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
9272
9273 def ScrollWindow(*args, **kwargs):
15afbcd0 9274 """
a95a7133 9275 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
9276
9277 Physically scrolls the pixels in the window and move child windows
9278 accordingly. Use this function to optimise your scrolling
9279 implementations, to minimise the area that must be redrawn. Note that
9280 it is rarely required to call this function from a user program.
15afbcd0 9281 """
54f9ee45 9282 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
9283
9284 def ScrollLines(*args, **kwargs):
15afbcd0 9285 """
a95a7133 9286 ScrollLines(self, int lines) -> bool
15afbcd0
RD
9287
9288 If the platform and window class supports it, scrolls the window by
9289 the given number of lines down, if lines is positive, or up if lines
9290 is negative. Returns True if the window was scrolled, False if it was
9291 already on top/bottom and nothing was done.
9292 """
54f9ee45 9293 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
9294
9295 def ScrollPages(*args, **kwargs):
15afbcd0 9296 """
a95a7133 9297 ScrollPages(self, int pages) -> bool
15afbcd0 9298
41e2b43e 9299 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
9300 the given number of pages down, if pages is positive, or up if pages
9301 is negative. Returns True if the window was scrolled, False if it was
9302 already on top/bottom and nothing was done.
9303 """
54f9ee45 9304 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
9305
9306 def LineUp(*args, **kwargs):
15afbcd0 9307 """
a95a7133 9308 LineUp(self) -> bool
15afbcd0
RD
9309
9310 This is just a wrapper for ScrollLines(-1).
9311 """
54f9ee45 9312 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
9313
9314 def LineDown(*args, **kwargs):
15afbcd0 9315 """
a95a7133 9316 LineDown(self) -> bool
15afbcd0
RD
9317
9318 This is just a wrapper for ScrollLines(1).
9319 """
54f9ee45 9320 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
9321
9322 def PageUp(*args, **kwargs):
15afbcd0 9323 """
a95a7133 9324 PageUp(self) -> bool
15afbcd0
RD
9325
9326 This is just a wrapper for ScrollPages(-1).
9327 """
54f9ee45 9328 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
9329
9330 def PageDown(*args, **kwargs):
15afbcd0 9331 """
a95a7133 9332 PageDown(self) -> bool
15afbcd0
RD
9333
9334 This is just a wrapper for ScrollPages(1).
9335 """
54f9ee45 9336 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
9337
9338 def SetHelpText(*args, **kwargs):
15afbcd0 9339 """
a95a7133 9340 SetHelpText(self, String text)
15afbcd0
RD
9341
9342 Sets the help text to be used as context-sensitive help for this
9343 window. Note that the text is actually stored by the current
f52cbe90 9344 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 9345 """
54f9ee45 9346 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
9347
9348 def SetHelpTextForId(*args, **kwargs):
15afbcd0 9349 """
a95a7133 9350 SetHelpTextForId(self, String text)
15afbcd0
RD
9351
9352 Associate this help text with all windows with the same id as this
9353 one.
9354 """
54f9ee45 9355 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce
RD
9356
9357 def GetHelpText(*args, **kwargs):
15afbcd0 9358 """
a95a7133 9359 GetHelpText(self) -> String
15afbcd0
RD
9360
9361 Gets the help text to be used as context-sensitive help for this
9362 window. Note that the text is actually stored by the current
f52cbe90 9363 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 9364 """
54f9ee45 9365 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
9366
9367 def SetToolTipString(*args, **kwargs):
15afbcd0 9368 """
a95a7133 9369 SetToolTipString(self, String tip)
15afbcd0
RD
9370
9371 Attach a tooltip to the window.
9372 """
54f9ee45 9373 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
9374
9375 def SetToolTip(*args, **kwargs):
15afbcd0 9376 """
a95a7133 9377 SetToolTip(self, ToolTip tip)
15afbcd0
RD
9378
9379 Attach a tooltip to the window.
9380 """
54f9ee45 9381 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
9382
9383 def GetToolTip(*args, **kwargs):
15afbcd0 9384 """
a95a7133 9385 GetToolTip(self) -> ToolTip
15afbcd0
RD
9386
9387 get the associated tooltip or None if none
9388 """
54f9ee45 9389 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
9390
9391 def SetDropTarget(*args, **kwargs):
15afbcd0 9392 """
a95a7133 9393 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
9394
9395 Associates a drop target with this window. If the window already has
9396 a drop target, it is deleted.
9397 """
54f9ee45 9398 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
9399
9400 def GetDropTarget(*args, **kwargs):
15afbcd0 9401 """
a95a7133 9402 GetDropTarget(self) -> DropTarget
15afbcd0
RD
9403
9404 Returns the associated drop target, which may be None.
9405 """
54f9ee45 9406 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce 9407
5ba5649b
RD
9408 def DragAcceptFiles(*args, **kwargs):
9409 """
9410 DragAcceptFiles(self, bool accept)
9411
9412 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9413 Only functional on Windows.
9414 """
9415 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9416
e811c8ce 9417 def SetConstraints(*args, **kwargs):
15afbcd0 9418 """
a95a7133 9419 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
9420
9421 Sets the window to have the given layout constraints. If an existing
9422 layout constraints object is already owned by the window, it will be
9423 deleted. Pass None to disassociate and delete the window's current
9424 constraints.
9425
9426 You must call SetAutoLayout to tell a window to use the constraints
9427 automatically in its default EVT_SIZE handler; otherwise, you must
9428 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9429 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9430 effect.
9431 """
54f9ee45 9432 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
9433
9434 def GetConstraints(*args, **kwargs):
15afbcd0 9435 """
a95a7133 9436 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
9437
9438 Returns a pointer to the window's layout constraints, or None if there
9439 are none.
9440 """
54f9ee45 9441 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
9442
9443 def SetAutoLayout(*args, **kwargs):
15afbcd0 9444 """
a95a7133 9445 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
9446
9447 Determines whether the Layout function will be called automatically
b1fcee84
RD
9448 when the window is resized. lease note that this only happens for the
9449 windows usually used to contain children, namely `wx.Panel` and
9450 `wx.TopLevelWindow` (and the classes deriving from them).
9451
9452 This method is called implicitly by `SetSizer` but if you use
9453 `SetConstraints` you should call it manually or otherwise the window
9454 layout won't be correctly updated when its size changes.
15afbcd0 9455 """
54f9ee45 9456 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
9457
9458 def GetAutoLayout(*args, **kwargs):
15afbcd0 9459 """
a95a7133 9460 GetAutoLayout(self) -> bool
15afbcd0
RD
9461
9462 Returns the current autoLayout setting
9463 """
54f9ee45 9464 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
9465
9466 def Layout(*args, **kwargs):
15afbcd0 9467 """
a95a7133 9468 Layout(self) -> bool
15afbcd0
RD
9469
9470 Invokes the constraint-based layout algorithm or the sizer-based
9471 algorithm for this window. See SetAutoLayout: when auto layout is on,
9472 this function gets called automatically by the default EVT_SIZE
9473 handler when the window is resized.
9474 """
54f9ee45 9475 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
9476
9477 def SetSizer(*args, **kwargs):
15afbcd0 9478 """
a95a7133 9479 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
9480
9481 Sets the window to have the given layout sizer. The window will then
9482 own the object, and will take care of its deletion. If an existing
9483 layout sizer object is already owned by the window, it will be deleted
9484 if the deleteOld parameter is true. Note that this function will also
9485 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 9486 non-None, and False otherwise.
15afbcd0 9487 """
54f9ee45 9488 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
9489
9490 def SetSizerAndFit(*args, **kwargs):
15afbcd0 9491 """
a95a7133 9492 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
9493
9494 The same as SetSizer, except it also sets the size hints for the
9495 window based on the sizer's minimum size.
9496 """
54f9ee45 9497 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
9498
9499 def GetSizer(*args, **kwargs):
15afbcd0 9500 """
a95a7133 9501 GetSizer(self) -> Sizer
15afbcd0
RD
9502
9503 Return the sizer associated with the window by a previous call to
9504 SetSizer or None if there isn't one.
9505 """
54f9ee45 9506 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
9507
9508 def SetContainingSizer(*args, **kwargs):
15afbcd0 9509 """
a95a7133 9510 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
9511
9512 This normally does not need to be called by application code. It is
9513 called internally when a window is added to a sizer, and is used so
9514 the window can remove itself from the sizer when it is destroyed.
9515 """
54f9ee45 9516 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
9517
9518 def GetContainingSizer(*args, **kwargs):
15afbcd0 9519 """
a95a7133 9520 GetContainingSizer(self) -> Sizer
15afbcd0
RD
9521
9522 Return the sizer that this window is a member of, if any, otherwise None.
9523 """
54f9ee45 9524 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 9525
a95a7133
RD
9526 def InheritAttributes(*args, **kwargs):
9527 """
9528 InheritAttributes(self)
9529
41e2b43e
RD
9530 This function is (or should be, in case of custom controls) called
9531 during window creation to intelligently set up the window visual
9532 attributes, that is the font and the foreground and background
9533 colours.
9534
9535 By 'intelligently' the following is meant: by default, all windows use
9536 their own default attributes. However if some of the parent's
9537 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9538 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
9539 explicitly set for this window itself, then this window takes the same
9540 value as used by the parent. In addition, if the window overrides
9541 ShouldInheritColours to return false, the colours will not be changed
9542 no matter what and only the font might.
9543
34621cc5 9544 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 9545 different usage scenarios. The most common one is when all default
41e2b43e
RD
9546 attributes are used and in this case, nothing should be inherited as
9547 in modern GUIs different controls use different fonts (and colours)
9548 than their siblings so they can't inherit the same value from the
9549 parent. However it was also deemed desirable to allow to simply change
9550 the attributes of all children at once by just changing the font or
9551 colour of their common parent, hence in this case we do inherit the
9552 parents attributes.
9553
a95a7133 9554 """
54f9ee45 9555 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
9556
9557 def ShouldInheritColours(*args, **kwargs):
9558 """
9559 ShouldInheritColours(self) -> bool
9560
9561 Return true from here to allow the colours of this window to be
41e2b43e
RD
9562 changed by InheritAttributes, returning false forbids inheriting them
9563 from the parent window.
a95a7133 9564
41e2b43e
RD
9565 The base class version returns false, but this method is overridden in
9566 wxControl where it returns true.
a95a7133 9567 """
54f9ee45 9568 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 9569
e811c8ce 9570 def PostCreate(self, pre):
15afbcd0
RD
9571 """
9572 Phase 3 of the 2-phase create <wink!>
9573 Call this method after precreating the window with the 2-phase create method.
9574 """
e811c8ce
RD
9575 self.this = pre.this
9576 self.thisown = pre.thisown
9577 pre.thisown = 0
9578 if hasattr(self, '_setOORInfo'):
9579 self._setOORInfo(self)
9580 if hasattr(self, '_setCallbackInfo'):
9581 self._setCallbackInfo(self, self.__class__)
9582
7e08d4ef
RD
9583 def SendSizeEvent(self):
9584 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9585
0085ce49
RD
9586Window_swigregister = _core_.Window_swigregister
9587Window_swigregister(Window)
e811c8ce
RD
9588
9589def PreWindow(*args, **kwargs):
15afbcd0
RD
9590 """
9591 PreWindow() -> Window
9592
9593 Precreate a Window for 2-phase creation.
9594 """
54f9ee45 9595 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
9596 return val
9597
0085ce49
RD
9598def Window_NewControlId(*args):
9599 """
15afbcd0
RD
9600 Window_NewControlId() -> int
9601
9602 Generate a control id for the controls which were not given one.
9603 """
0085ce49 9604 return _core_.Window_NewControlId(*args)
e811c8ce
RD
9605
9606def Window_NextControlId(*args, **kwargs):
0085ce49 9607 """
15afbcd0
RD
9608 Window_NextControlId(int winid) -> int
9609
9610 Get the id of the control following the one with the given
41e2b43e 9611 autogenerated) id
15afbcd0 9612 """
0085ce49 9613 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
9614
9615def Window_PrevControlId(*args, **kwargs):
0085ce49 9616 """
15afbcd0
RD
9617 Window_PrevControlId(int winid) -> int
9618
9619 Get the id of the control preceding the one with the given
41e2b43e 9620 autogenerated) id
15afbcd0 9621 """
0085ce49 9622 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce 9623
0085ce49
RD
9624def Window_FindFocus(*args):
9625 """
15afbcd0
RD
9626 Window_FindFocus() -> Window
9627
9628 Returns the window or control that currently has the keyboard focus,
9629 or None.
9630 """
0085ce49 9631 return _core_.Window_FindFocus(*args)
e811c8ce 9632
0085ce49
RD
9633def Window_GetCapture(*args):
9634 """
15afbcd0
RD
9635 Window_GetCapture() -> Window
9636
9637 Returns the window which currently captures the mouse or None
9638 """
0085ce49 9639 return _core_.Window_GetCapture(*args)
e811c8ce 9640
74a57fcd 9641def Window_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 9642 """
74a57fcd
RD
9643 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9644
41e2b43e
RD
9645 Get the default attributes for this class. This is useful if you want
9646 to use the same font or colour in your own control as in a standard
9647 control -- which is a much better idea than hard coding specific
db3e571a
RD
9648 colours or fonts which might look completely out of place on the
9649 user's system, especially if it uses themes.
74a57fcd
RD
9650
9651 The variant parameter is only relevant under Mac currently and is
41e2b43e 9652 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
9653 the returned font. See `wx.Window.SetWindowVariant` for more about
9654 this.
74a57fcd 9655 """
0085ce49 9656 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 9657
e811c8ce 9658def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
9659 """
9660 Convenience function for converting a Point or (x,y) in
9661 dialog units to pixel units.
9662 """
e811c8ce
RD
9663 if y is None:
9664 return win.ConvertDialogPointToPixels(point_or_x)
9665 else:
fd3f2efe 9666 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
9667
9668def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
9669 """
9670 Convenience function for converting a Size or (w,h) in
9671 dialog units to pixel units.
9672 """
e811c8ce
RD
9673 if height is None:
9674 return win.ConvertDialogSizeToPixels(size_width)
9675 else:
fd3f2efe 9676 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
9677
9678
9679def FindWindowById(*args, **kwargs):
0085ce49 9680 """
15afbcd0
RD
9681 FindWindowById(long id, Window parent=None) -> Window
9682
9683 Find the first window in the application with the given id. If parent
9684 is None, the search will start from all top-level frames and dialog
9685 boxes; if non-None, the search will be limited to the given window
9686 hierarchy. The search is recursive in both cases.
9687 """
0085ce49 9688 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
9689
9690def FindWindowByName(*args, **kwargs):
0085ce49 9691 """
15afbcd0
RD
9692 FindWindowByName(String name, Window parent=None) -> Window
9693
9694 Find a window by its name (as given in a window constructor or Create
9695 function call). If parent is None, the search will start from all
9696 top-level frames and dialog boxes; if non-None, the search will be
9697 limited to the given window hierarchy. The search is recursive in both
9698 cases.
9699
9700 If no window with such name is found, wx.FindWindowByLabel is called.
9701 """
0085ce49 9702 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
9703
9704def FindWindowByLabel(*args, **kwargs):
0085ce49 9705 """
15afbcd0
RD
9706 FindWindowByLabel(String label, Window parent=None) -> Window
9707
9708 Find a window by its label. Depending on the type of window, the label
9709 may be a window title or panel item label. If parent is None, the
9710 search will start from all top-level frames and dialog boxes; if
9711 non-None, the search will be limited to the given window
9712 hierarchy. The search is recursive in both cases.
9713 """
0085ce49 9714 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
9715
9716def Window_FromHWND(*args, **kwargs):
0085ce49
RD
9717 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9718 return _core_.Window_FromHWND(*args, **kwargs)
b6b0383e 9719
0085ce49
RD
9720def GetTopLevelWindows(*args):
9721 """
b6b0383e
RD
9722 GetTopLevelWindows() -> PyObject
9723
9724 Returns a list of the the application's top-level windows, (frames,
9725 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9726 by wxWidgets, and so it is only valid as long as no top-level windows
9727 are closed or new top-level windows are created.
9728
9729 """
0085ce49 9730 return _core_.GetTopLevelWindows(*args)
e811c8ce
RD
9731#---------------------------------------------------------------------------
9732
9733class Validator(EvtHandler):
093d3ff1 9734 """Proxy of C++ Validator class"""
0085ce49
RD
9735 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9736 __repr__ = _swig_repr
9737 def __init__(self, *args, **kwargs):
a95a7133 9738 """__init__(self) -> Validator"""
0085ce49 9739 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d14a1e28 9740 self._setOORInfo(self)
e811c8ce
RD
9741
9742 def Clone(*args, **kwargs):
a95a7133 9743 """Clone(self) -> Validator"""
54f9ee45 9744 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
9745
9746 def Validate(*args, **kwargs):
a95a7133 9747 """Validate(self, Window parent) -> bool"""
54f9ee45 9748 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
9749
9750 def TransferToWindow(*args, **kwargs):
a95a7133 9751 """TransferToWindow(self) -> bool"""
54f9ee45 9752 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
9753
9754 def TransferFromWindow(*args, **kwargs):
a95a7133 9755 """TransferFromWindow(self) -> bool"""
54f9ee45 9756 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
9757
9758 def GetWindow(*args, **kwargs):
a95a7133 9759 """GetWindow(self) -> Window"""
54f9ee45 9760 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
9761
9762 def SetWindow(*args, **kwargs):
a95a7133 9763 """SetWindow(self, Window window)"""
54f9ee45 9764 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
9765
9766 def IsSilent(*args, **kwargs):
66c033b4 9767 """IsSilent() -> bool"""
54f9ee45 9768 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
9769
9770 IsSilent = staticmethod(IsSilent)
9771 def SetBellOnError(*args, **kwargs):
66c033b4 9772 """SetBellOnError(int doIt=True)"""
54f9ee45 9773 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
9774
9775 SetBellOnError = staticmethod(SetBellOnError)
0085ce49
RD
9776Validator_swigregister = _core_.Validator_swigregister
9777Validator_swigregister(Validator)
e811c8ce 9778
0085ce49
RD
9779def Validator_IsSilent(*args):
9780 """Validator_IsSilent() -> bool"""
9781 return _core_.Validator_IsSilent(*args)
e811c8ce
RD
9782
9783def Validator_SetBellOnError(*args, **kwargs):
0085ce49
RD
9784 """Validator_SetBellOnError(int doIt=True)"""
9785 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
9786
9787class PyValidator(Validator):
093d3ff1 9788 """Proxy of C++ PyValidator class"""
0085ce49
RD
9789 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9790 __repr__ = _swig_repr
9791 def __init__(self, *args, **kwargs):
a95a7133 9792 """__init__(self) -> PyValidator"""
0085ce49 9793 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
e811c8ce
RD
9794
9795 self._setCallbackInfo(self, PyValidator, 1)
9796 self._setOORInfo(self)
9797
9798 def _setCallbackInfo(*args, **kwargs):
a95a7133 9799 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
54f9ee45 9800 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce 9801
0085ce49
RD
9802PyValidator_swigregister = _core_.PyValidator_swigregister
9803PyValidator_swigregister(PyValidator)
e811c8ce
RD
9804
9805#---------------------------------------------------------------------------
9806
9807class Menu(EvtHandler):
093d3ff1 9808 """Proxy of C++ Menu class"""
0085ce49
RD
9809 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9810 __repr__ = _swig_repr
9811 def __init__(self, *args, **kwargs):
a95a7133 9812 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
0085ce49 9813 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
e811c8ce
RD
9814 self._setOORInfo(self)
9815
9816 def Append(*args, **kwargs):
a95a7133 9817 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 9818 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
9819
9820 def AppendSeparator(*args, **kwargs):
a95a7133 9821 """AppendSeparator(self) -> MenuItem"""
54f9ee45 9822 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
9823
9824 def AppendCheckItem(*args, **kwargs):
a95a7133 9825 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9826 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
9827
9828 def AppendRadioItem(*args, **kwargs):
a95a7133 9829 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9830 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
9831
9832 def AppendMenu(*args, **kwargs):
a95a7133 9833 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 9834 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce
RD
9835
9836 def AppendItem(*args, **kwargs):
a95a7133 9837 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 9838 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce 9839
e811c8ce 9840 def InsertItem(*args, **kwargs):
a95a7133 9841 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 9842 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce 9843
0085ce49
RD
9844 def PrependItem(*args, **kwargs):
9845 """PrependItem(self, MenuItem item) -> MenuItem"""
9846 return _core_.Menu_PrependItem(*args, **kwargs)
9847
9848 def Break(*args, **kwargs):
9849 """Break(self)"""
9850 return _core_.Menu_Break(*args, **kwargs)
9851
e811c8ce 9852 def Insert(*args, **kwargs):
0df68c9f 9853 """
a95a7133 9854 Insert(self, size_t pos, int id, String text, String help=EmptyString,
a41e16b6 9855 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 9856 """
54f9ee45 9857 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
9858
9859 def InsertSeparator(*args, **kwargs):
a95a7133 9860 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 9861 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
9862
9863 def InsertCheckItem(*args, **kwargs):
a95a7133 9864 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9865 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
9866
9867 def InsertRadioItem(*args, **kwargs):
a95a7133 9868 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9869 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
9870
9871 def InsertMenu(*args, **kwargs):
a95a7133 9872 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 9873 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce 9874
e811c8ce 9875 def Prepend(*args, **kwargs):
a95a7133 9876 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 9877 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
9878
9879 def PrependSeparator(*args, **kwargs):
a95a7133 9880 """PrependSeparator(self) -> MenuItem"""
54f9ee45 9881 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
9882
9883 def PrependCheckItem(*args, **kwargs):
a95a7133 9884 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9885 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
9886
9887 def PrependRadioItem(*args, **kwargs):
a95a7133 9888 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9889 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
9890
9891 def PrependMenu(*args, **kwargs):
a95a7133 9892 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 9893 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
9894
9895 def Remove(*args, **kwargs):
a95a7133 9896 """Remove(self, int id) -> MenuItem"""
54f9ee45 9897 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce
RD
9898
9899 def RemoveItem(*args, **kwargs):
a95a7133 9900 """RemoveItem(self, MenuItem item) -> MenuItem"""
54f9ee45 9901 return _core_.Menu_RemoveItem(*args, **kwargs)
e811c8ce
RD
9902
9903 def Delete(*args, **kwargs):
a95a7133 9904 """Delete(self, int id) -> bool"""
54f9ee45 9905 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
9906
9907 def DeleteItem(*args, **kwargs):
a95a7133 9908 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 9909 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
9910
9911 def Destroy(*args, **kwargs):
0df68c9f 9912 """
a95a7133 9913 Destroy(self)
e811c8ce 9914
0df68c9f
RD
9915 Deletes the C++ object this Python object is a proxy for.
9916 """
7e08d4ef
RD
9917 val = _core_.Menu_Destroy(*args, **kwargs)
9918 args[0].thisown = 0
9919 return val
e811c8ce
RD
9920
9921 def DestroyId(*args, **kwargs):
0df68c9f 9922 """
a95a7133 9923 DestroyId(self, int id) -> bool
e811c8ce 9924
0df68c9f
RD
9925 Deletes the C++ object this Python object is a proxy for.
9926 """
7e08d4ef
RD
9927 val = _core_.Menu_DestroyId(*args, **kwargs)
9928 args[0].thisown = 0
9929 return val
e811c8ce
RD
9930
9931 def DestroyItem(*args, **kwargs):
0df68c9f 9932 """
a95a7133 9933 DestroyItem(self, MenuItem item) -> bool
e811c8ce 9934
0df68c9f
RD
9935 Deletes the C++ object this Python object is a proxy for.
9936 """
7e08d4ef
RD
9937 val = _core_.Menu_DestroyItem(*args, **kwargs)
9938 args[0].thisown = 0
9939 return val
e811c8ce
RD
9940
9941 def GetMenuItemCount(*args, **kwargs):
a95a7133 9942 """GetMenuItemCount(self) -> size_t"""
54f9ee45 9943 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
9944
9945 def GetMenuItems(*args, **kwargs):
a95a7133 9946 """GetMenuItems(self) -> PyObject"""
54f9ee45 9947 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
9948
9949 def FindItem(*args, **kwargs):
a95a7133 9950 """FindItem(self, String item) -> int"""
54f9ee45 9951 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
9952
9953 def FindItemById(*args, **kwargs):
a95a7133 9954 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 9955 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
9956
9957 def FindItemByPosition(*args, **kwargs):
a95a7133 9958 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 9959 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
9960
9961 def Enable(*args, **kwargs):
a95a7133 9962 """Enable(self, int id, bool enable)"""
54f9ee45 9963 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
9964
9965 def IsEnabled(*args, **kwargs):
a95a7133 9966 """IsEnabled(self, int id) -> bool"""
54f9ee45 9967 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
9968
9969 def Check(*args, **kwargs):
a95a7133 9970 """Check(self, int id, bool check)"""
54f9ee45 9971 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
9972
9973 def IsChecked(*args, **kwargs):
a95a7133 9974 """IsChecked(self, int id) -> bool"""
54f9ee45 9975 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
9976
9977 def SetLabel(*args, **kwargs):
a95a7133 9978 """SetLabel(self, int id, String label)"""
54f9ee45 9979 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
9980
9981 def GetLabel(*args, **kwargs):
a95a7133 9982 """GetLabel(self, int id) -> String"""
54f9ee45 9983 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
9984
9985 def SetHelpString(*args, **kwargs):
a95a7133 9986 """SetHelpString(self, int id, String helpString)"""
54f9ee45 9987 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
9988
9989 def GetHelpString(*args, **kwargs):
a95a7133 9990 """GetHelpString(self, int id) -> String"""
54f9ee45 9991 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
9992
9993 def SetTitle(*args, **kwargs):
a95a7133 9994 """SetTitle(self, String title)"""
54f9ee45 9995 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
9996
9997 def GetTitle(*args, **kwargs):
a95a7133 9998 """GetTitle(self) -> String"""
54f9ee45 9999 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
10000
10001 def SetEventHandler(*args, **kwargs):
a95a7133 10002 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 10003 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
10004
10005 def GetEventHandler(*args, **kwargs):
a95a7133 10006 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 10007 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
10008
10009 def SetInvokingWindow(*args, **kwargs):
a95a7133 10010 """SetInvokingWindow(self, Window win)"""
54f9ee45 10011 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10012
10013 def GetInvokingWindow(*args, **kwargs):
a95a7133 10014 """GetInvokingWindow(self) -> Window"""
54f9ee45 10015 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10016
10017 def GetStyle(*args, **kwargs):
a95a7133 10018 """GetStyle(self) -> long"""
54f9ee45 10019 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
10020
10021 def UpdateUI(*args, **kwargs):
a95a7133 10022 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 10023 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
10024
10025 def GetMenuBar(*args, **kwargs):
a95a7133 10026 """GetMenuBar(self) -> MenuBar"""
54f9ee45 10027 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
10028
10029 def Attach(*args, **kwargs):
a95a7133 10030 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 10031 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
10032
10033 def Detach(*args, **kwargs):
a95a7133 10034 """Detach(self)"""
54f9ee45 10035 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
10036
10037 def IsAttached(*args, **kwargs):
a95a7133 10038 """IsAttached(self) -> bool"""
54f9ee45 10039 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
10040
10041 def SetParent(*args, **kwargs):
a95a7133 10042 """SetParent(self, Menu parent)"""
54f9ee45 10043 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
10044
10045 def GetParent(*args, **kwargs):
a95a7133 10046 """GetParent(self) -> Menu"""
54f9ee45 10047 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 10048
0085ce49
RD
10049Menu_swigregister = _core_.Menu_swigregister
10050Menu_swigregister(Menu)
d14a1e28
RD
10051DefaultValidator = cvar.DefaultValidator
10052
10053#---------------------------------------------------------------------------
10054
10055class MenuBar(Window):
093d3ff1 10056 """Proxy of C++ MenuBar class"""
0085ce49
RD
10057 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10058 __repr__ = _swig_repr
10059 def __init__(self, *args, **kwargs):
a95a7133 10060 """__init__(self, long style=0) -> MenuBar"""
0085ce49 10061 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d14a1e28 10062 self._setOORInfo(self)
e811c8ce
RD
10063
10064 def Append(*args, **kwargs):
a95a7133 10065 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 10066 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
10067
10068 def Insert(*args, **kwargs):
a95a7133 10069 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 10070 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
10071
10072 def GetMenuCount(*args, **kwargs):
a95a7133 10073 """GetMenuCount(self) -> size_t"""
54f9ee45 10074 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
10075
10076 def GetMenu(*args, **kwargs):
a95a7133 10077 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 10078 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
10079
10080 def Replace(*args, **kwargs):
a95a7133 10081 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 10082 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
10083
10084 def Remove(*args, **kwargs):
a95a7133 10085 """Remove(self, size_t pos) -> Menu"""
54f9ee45 10086 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
10087
10088 def EnableTop(*args, **kwargs):
a95a7133 10089 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 10090 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
10091
10092 def IsEnabledTop(*args, **kwargs):
a95a7133 10093 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 10094 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
10095
10096 def SetLabelTop(*args, **kwargs):
a95a7133 10097 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 10098 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
10099
10100 def GetLabelTop(*args, **kwargs):
a95a7133 10101 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 10102 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
10103
10104 def FindMenuItem(*args, **kwargs):
a95a7133 10105 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 10106 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
10107
10108 def FindItemById(*args, **kwargs):
a95a7133 10109 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10110 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
10111
10112 def FindMenu(*args, **kwargs):
a95a7133 10113 """FindMenu(self, String title) -> int"""
54f9ee45 10114 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
10115
10116 def Enable(*args, **kwargs):
a95a7133 10117 """Enable(self, int id, bool enable)"""
54f9ee45 10118 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
10119
10120 def Check(*args, **kwargs):
a95a7133 10121 """Check(self, int id, bool check)"""
54f9ee45 10122 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
10123
10124 def IsChecked(*args, **kwargs):
a95a7133 10125 """IsChecked(self, int id) -> bool"""
54f9ee45 10126 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
10127
10128 def IsEnabled(*args, **kwargs):
a95a7133 10129 """IsEnabled(self, int id) -> bool"""
54f9ee45 10130 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
10131
10132 def SetLabel(*args, **kwargs):
a95a7133 10133 """SetLabel(self, int id, String label)"""
54f9ee45 10134 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
10135
10136 def GetLabel(*args, **kwargs):
a95a7133 10137 """GetLabel(self, int id) -> String"""
54f9ee45 10138 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
10139
10140 def SetHelpString(*args, **kwargs):
a95a7133 10141 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10142 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
10143
10144 def GetHelpString(*args, **kwargs):
a95a7133 10145 """GetHelpString(self, int id) -> String"""
54f9ee45 10146 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
10147
10148 def GetFrame(*args, **kwargs):
a95a7133 10149 """GetFrame(self) -> wxFrame"""
54f9ee45 10150 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
10151
10152 def IsAttached(*args, **kwargs):
a95a7133 10153 """IsAttached(self) -> bool"""
54f9ee45 10154 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
10155
10156 def Attach(*args, **kwargs):
a95a7133 10157 """Attach(self, wxFrame frame)"""
54f9ee45 10158 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
10159
10160 def Detach(*args, **kwargs):
a95a7133 10161 """Detach(self)"""
54f9ee45 10162 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 10163
4f433fef
RD
10164 def SetAutoWindowMenu(*args, **kwargs):
10165 """SetAutoWindowMenu(bool enable)"""
10166 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10167
10168 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10169 def GetAutoWindowMenu(*args, **kwargs):
10170 """GetAutoWindowMenu() -> bool"""
10171 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10172
10173 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
0085ce49
RD
10174MenuBar_swigregister = _core_.MenuBar_swigregister
10175MenuBar_swigregister(MenuBar)
d14a1e28 10176
4f433fef 10177def MenuBar_SetAutoWindowMenu(*args, **kwargs):
0085ce49
RD
10178 """MenuBar_SetAutoWindowMenu(bool enable)"""
10179 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10180
0085ce49
RD
10181def MenuBar_GetAutoWindowMenu(*args):
10182 """MenuBar_GetAutoWindowMenu() -> bool"""
10183 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10184
d14a1e28
RD
10185#---------------------------------------------------------------------------
10186
10187class MenuItem(Object):
093d3ff1 10188 """Proxy of C++ MenuItem class"""
0085ce49
RD
10189 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10190 __repr__ = _swig_repr
10191 def __init__(self, *args, **kwargs):
0df68c9f 10192 """
a95a7133 10193 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
196addbf
RD
10194 String help=EmptyString, int kind=ITEM_NORMAL,
10195 Menu subMenu=None) -> MenuItem
0df68c9f 10196 """
0085ce49
RD
10197 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10198 __swig_destroy__ = _core_.delete_MenuItem
10199 __del__ = lambda self : None;
e811c8ce 10200 def GetMenu(*args, **kwargs):
a95a7133 10201 """GetMenu(self) -> Menu"""
54f9ee45 10202 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
10203
10204 def SetMenu(*args, **kwargs):
a95a7133 10205 """SetMenu(self, Menu menu)"""
54f9ee45 10206 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
10207
10208 def SetId(*args, **kwargs):
a95a7133 10209 """SetId(self, int id)"""
54f9ee45 10210 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
10211
10212 def GetId(*args, **kwargs):
a95a7133 10213 """GetId(self) -> int"""
54f9ee45 10214 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
10215
10216 def IsSeparator(*args, **kwargs):
a95a7133 10217 """IsSeparator(self) -> bool"""
54f9ee45 10218 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
10219
10220 def SetText(*args, **kwargs):
a95a7133 10221 """SetText(self, String str)"""
54f9ee45 10222 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
10223
10224 def GetLabel(*args, **kwargs):
a95a7133 10225 """GetLabel(self) -> String"""
54f9ee45 10226 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
10227
10228 def GetText(*args, **kwargs):
a95a7133 10229 """GetText(self) -> String"""
54f9ee45 10230 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
10231
10232 def GetLabelFromText(*args, **kwargs):
66c033b4 10233 """GetLabelFromText(String text) -> String"""
54f9ee45 10234 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
10235
10236 GetLabelFromText = staticmethod(GetLabelFromText)
10237 def GetKind(*args, **kwargs):
a95a7133 10238 """GetKind(self) -> int"""
54f9ee45 10239 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 10240
a95a7133
RD
10241 def SetKind(*args, **kwargs):
10242 """SetKind(self, int kind)"""
54f9ee45 10243 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 10244
e811c8ce 10245 def SetCheckable(*args, **kwargs):
a95a7133 10246 """SetCheckable(self, bool checkable)"""
54f9ee45 10247 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
10248
10249 def IsCheckable(*args, **kwargs):
a95a7133 10250 """IsCheckable(self) -> bool"""
54f9ee45 10251 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
10252
10253 def IsSubMenu(*args, **kwargs):
a95a7133 10254 """IsSubMenu(self) -> bool"""
54f9ee45 10255 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
10256
10257 def SetSubMenu(*args, **kwargs):
a95a7133 10258 """SetSubMenu(self, Menu menu)"""
54f9ee45 10259 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
10260
10261 def GetSubMenu(*args, **kwargs):
a95a7133 10262 """GetSubMenu(self) -> Menu"""
54f9ee45 10263 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
10264
10265 def Enable(*args, **kwargs):
a95a7133 10266 """Enable(self, bool enable=True)"""
54f9ee45 10267 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
10268
10269 def IsEnabled(*args, **kwargs):
a95a7133 10270 """IsEnabled(self) -> bool"""
54f9ee45 10271 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
10272
10273 def Check(*args, **kwargs):
a95a7133 10274 """Check(self, bool check=True)"""
54f9ee45 10275 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
10276
10277 def IsChecked(*args, **kwargs):
a95a7133 10278 """IsChecked(self) -> bool"""
54f9ee45 10279 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
10280
10281 def Toggle(*args, **kwargs):
a95a7133 10282 """Toggle(self)"""
54f9ee45 10283 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
10284
10285 def SetHelp(*args, **kwargs):
a95a7133 10286 """SetHelp(self, String str)"""
54f9ee45 10287 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
10288
10289 def GetHelp(*args, **kwargs):
a95a7133 10290 """GetHelp(self) -> String"""
54f9ee45 10291 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
10292
10293 def GetAccel(*args, **kwargs):
a95a7133 10294 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 10295 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
10296
10297 def SetAccel(*args, **kwargs):
a95a7133 10298 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 10299 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce 10300
091f5bed
RD
10301 def SetBitmap(*args, **kwargs):
10302 """SetBitmap(self, Bitmap bitmap)"""
10303 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10304
10305 def GetBitmap(*args, **kwargs):
10306 """GetBitmap(self) -> Bitmap"""
10307 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10308
c1280d1e
RD
10309 def SetFont(*args, **kwargs):
10310 """SetFont(self, Font font)"""
10311 return _core_.MenuItem_SetFont(*args, **kwargs)
10312
10313 def GetFont(*args, **kwargs):
10314 """GetFont(self) -> Font"""
10315 return _core_.MenuItem_GetFont(*args, **kwargs)
10316
10317 def SetTextColour(*args, **kwargs):
10318 """SetTextColour(self, Colour colText)"""
10319 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10320
10321 def GetTextColour(*args, **kwargs):
10322 """GetTextColour(self) -> Colour"""
10323 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10324
10325 def SetBackgroundColour(*args, **kwargs):
10326 """SetBackgroundColour(self, Colour colBack)"""
10327 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10328
10329 def GetBackgroundColour(*args, **kwargs):
10330 """GetBackgroundColour(self) -> Colour"""
10331 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10332
10333 def SetBitmaps(*args, **kwargs):
10334 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10335 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10336
10337 def SetDisabledBitmap(*args, **kwargs):
10338 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10339 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10340
10341 def GetDisabledBitmap(*args, **kwargs):
10342 """GetDisabledBitmap(self) -> Bitmap"""
10343 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10344
10345 def SetMarginWidth(*args, **kwargs):
10346 """SetMarginWidth(self, int nWidth)"""
10347 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10348
10349 def GetMarginWidth(*args, **kwargs):
10350 """GetMarginWidth(self) -> int"""
10351 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10352
e811c8ce 10353 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 10354 """GetDefaultMarginWidth() -> int"""
54f9ee45 10355 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
10356
10357 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10358 def IsOwnerDrawn(*args, **kwargs):
10359 """IsOwnerDrawn(self) -> bool"""
10360 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10361
10362 def SetOwnerDrawn(*args, **kwargs):
10363 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10364 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10365
10366 def ResetOwnerDrawn(*args, **kwargs):
10367 """ResetOwnerDrawn(self)"""
10368 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10369
0085ce49
RD
10370MenuItem_swigregister = _core_.MenuItem_swigregister
10371MenuItem_swigregister(MenuItem)
d14a1e28 10372
e811c8ce 10373def MenuItem_GetLabelFromText(*args, **kwargs):
0085ce49
RD
10374 """MenuItem_GetLabelFromText(String text) -> String"""
10375 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 10376
0085ce49
RD
10377def MenuItem_GetDefaultMarginWidth(*args):
10378 """MenuItem_GetDefaultMarginWidth() -> int"""
10379 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d14a1e28
RD
10380
10381#---------------------------------------------------------------------------
10382
10383class Control(Window):
15afbcd0
RD
10384 """
10385 This is the base class for a control or 'widget'.
10386
41e2b43e
RD
10387 A control is generally a small window which processes user input
10388 and/or displays one or more item of data.
15afbcd0 10389 """
0085ce49
RD
10390 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10391 __repr__ = _swig_repr
10392 def __init__(self, *args, **kwargs):
0df68c9f 10393 """
248ed943
RD
10394 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10395 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10396 String name=ControlNameStr) -> Control
15afbcd0 10397
41e2b43e
RD
10398 Create a Control. Normally you should only call this from a subclass'
10399 __init__ as a plain old wx.Control is not very useful.
0df68c9f 10400 """
0085ce49 10401 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d14a1e28 10402 self._setOORInfo(self)
e811c8ce
RD
10403
10404 def Create(*args, **kwargs):
0df68c9f 10405 """
248ed943
RD
10406 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10407 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10408 String name=ControlNameStr) -> bool
15afbcd0
RD
10409
10410 Do the 2nd phase and create the GUI control.
0df68c9f 10411 """
54f9ee45 10412 return _core_.Control_Create(*args, **kwargs)
e811c8ce
RD
10413
10414 def Command(*args, **kwargs):
15afbcd0 10415 """
a95a7133 10416 Command(self, CommandEvent event)
15afbcd0 10417
41e2b43e
RD
10418 Simulates the effect of the user issuing a command to the item.
10419
10420 :see: `wx.CommandEvent`
10421
15afbcd0 10422 """
54f9ee45 10423 return _core_.Control_Command(*args, **kwargs)
e811c8ce
RD
10424
10425 def GetLabel(*args, **kwargs):
15afbcd0 10426 """
a95a7133 10427 GetLabel(self) -> String
15afbcd0
RD
10428
10429 Return a control's text.
10430 """
54f9ee45 10431 return _core_.Control_GetLabel(*args, **kwargs)
e811c8ce 10432
74a57fcd 10433 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
10434 """
10435 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10436
10437 Get the default attributes for this class. This is useful if you want
10438 to use the same font or colour in your own control as in a standard
10439 control -- which is a much better idea than hard coding specific
10440 colours or fonts which might look completely out of place on the
10441 user's system, especially if it uses themes.
10442
10443 The variant parameter is only relevant under Mac currently and is
10444 ignore under other platforms. Under Mac, it will change the size of
10445 the returned font. See `wx.Window.SetWindowVariant` for more about
10446 this.
10447 """
54f9ee45 10448 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
10449
10450 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
0085ce49
RD
10451Control_swigregister = _core_.Control_swigregister
10452Control_swigregister(Control)
b2dc1044 10453ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
10454
10455def PreControl(*args, **kwargs):
15afbcd0
RD
10456 """
10457 PreControl() -> Control
10458
10459 Precreate a Control control for 2-phase creation
10460 """
54f9ee45 10461 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
10462 return val
10463
74a57fcd 10464def Control_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 10465 """
110da5b0
RD
10466 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10467
10468 Get the default attributes for this class. This is useful if you want
10469 to use the same font or colour in your own control as in a standard
10470 control -- which is a much better idea than hard coding specific
10471 colours or fonts which might look completely out of place on the
10472 user's system, especially if it uses themes.
10473
10474 The variant parameter is only relevant under Mac currently and is
10475 ignore under other platforms. Under Mac, it will change the size of
10476 the returned font. See `wx.Window.SetWindowVariant` for more about
10477 this.
10478 """
0085ce49 10479 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 10480
d14a1e28
RD
10481#---------------------------------------------------------------------------
10482
10483class ItemContainer(object):
15afbcd0 10484 """
53aa7709
RD
10485 The wx.ItemContainer class defines an interface which is implemented
10486 by all controls which have string subitems, each of which may be
10487 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10488 as `wx.ComboBox` which implements an extended interface deriving from
41e2b43e 10489 this one.
15afbcd0 10490
41e2b43e
RD
10491 It defines the methods for accessing the control's items and although
10492 each of the derived classes implements them differently, they still
10493 all conform to the same interface.
15afbcd0 10494
41e2b43e
RD
10495 The items in a wx.ItemContainer have (non empty) string labels and,
10496 optionally, client data associated with them.
15afbcd0
RD
10497
10498 """
0085ce49
RD
10499 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10500 def __init__(self): raise AttributeError, "No constructor defined"
10501 __repr__ = _swig_repr
e811c8ce 10502 def Append(*args, **kwargs):
15afbcd0 10503 """
a95a7133 10504 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 10505
41e2b43e
RD
10506 Adds the item to the control, associating the given data with the item
10507 if not None. The return value is the index of the newly added item
10508 which may be different from the last one if the control is sorted (e.g.
10509 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 10510 """
54f9ee45 10511 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
10512
10513 def AppendItems(*args, **kwargs):
15afbcd0 10514 """
f5b96ee1 10515 AppendItems(self, List strings)
15afbcd0 10516
41e2b43e
RD
10517 Apend several items at once to the control. Notice that calling this
10518 method may be much faster than appending the items one by one if you
10519 need to add a lot of items.
15afbcd0 10520 """
54f9ee45 10521 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
10522
10523 def Insert(*args, **kwargs):
15afbcd0 10524 """
50f151d7 10525 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
15afbcd0 10526
41e2b43e 10527 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
10528 optionally associating some data object with the item.
10529 """
54f9ee45 10530 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
10531
10532 def Clear(*args, **kwargs):
15afbcd0 10533 """
a95a7133 10534 Clear(self)
15afbcd0
RD
10535
10536 Removes all items from the control.
10537 """
54f9ee45 10538 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
10539
10540 def Delete(*args, **kwargs):
15afbcd0 10541 """
50f151d7 10542 Delete(self, unsigned int n)
15afbcd0 10543
41e2b43e
RD
10544 Deletes the item at the zero-based index 'n' from the control. Note
10545 that it is an error (signalled by a `wx.PyAssertionError` exception if
10546 enabled) to remove an item with the index negative or greater or equal
10547 than the number of items in the control.
15afbcd0 10548 """
54f9ee45 10549 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce 10550
53aa7709
RD
10551 def GetClientData(*args, **kwargs):
10552 """
50f151d7 10553 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
10554
10555 Returns the client data associated with the given item, (if any.)
10556 """
10557 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10558
10559 def SetClientData(*args, **kwargs):
10560 """
50f151d7 10561 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
10562
10563 Associate the given client data with the item at position n.
10564 """
10565 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10566
e811c8ce 10567 def GetCount(*args, **kwargs):
15afbcd0 10568 """
50f151d7 10569 GetCount(self) -> unsigned int
15afbcd0
RD
10570
10571 Returns the number of items in the control.
10572 """
54f9ee45 10573 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
10574
10575 def IsEmpty(*args, **kwargs):
15afbcd0 10576 """
a95a7133 10577 IsEmpty(self) -> bool
15afbcd0
RD
10578
10579 Returns True if the control is empty or False if it has some items.
10580 """
54f9ee45 10581 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
10582
10583 def GetString(*args, **kwargs):
15afbcd0 10584 """
50f151d7 10585 GetString(self, unsigned int n) -> String
15afbcd0
RD
10586
10587 Returns the label of the item with the given index.
10588 """
54f9ee45 10589 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
10590
10591 def GetStrings(*args, **kwargs):
a95a7133 10592 """GetStrings(self) -> wxArrayString"""
54f9ee45 10593 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
10594
10595 def SetString(*args, **kwargs):
15afbcd0 10596 """
50f151d7 10597 SetString(self, unsigned int n, String s)
15afbcd0
RD
10598
10599 Sets the label for the given item.
10600 """
54f9ee45 10601 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
10602
10603 def FindString(*args, **kwargs):
15afbcd0 10604 """
a95a7133 10605 FindString(self, String s) -> int
15afbcd0
RD
10606
10607 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
10608 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10609 found.
15afbcd0 10610 """
54f9ee45 10611 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce 10612
53aa7709 10613 def SetSelection(*args, **kwargs):
15afbcd0 10614 """
53aa7709 10615 SetSelection(self, int n)
15afbcd0
RD
10616
10617 Sets the item at index 'n' to be the selected item.
10618 """
53aa7709 10619 return _core_.ItemContainer_SetSelection(*args, **kwargs)
e811c8ce
RD
10620
10621 def GetSelection(*args, **kwargs):
15afbcd0 10622 """
a95a7133 10623 GetSelection(self) -> int
15afbcd0 10624
41e2b43e
RD
10625 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10626 is selected.
15afbcd0 10627 """
54f9ee45 10628 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce 10629
53aa7709
RD
10630 def SetStringSelection(*args, **kwargs):
10631 """SetStringSelection(self, String s) -> bool"""
10632 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10633
e811c8ce 10634 def GetStringSelection(*args, **kwargs):
15afbcd0 10635 """
a95a7133 10636 GetStringSelection(self) -> String
15afbcd0 10637
41e2b43e
RD
10638 Returns the label of the selected item or an empty string if no item
10639 is selected.
15afbcd0 10640 """
54f9ee45 10641 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce 10642
53aa7709 10643 def Select(*args, **kwargs):
15afbcd0 10644 """
53aa7709 10645 Select(self, int n)
15afbcd0 10646
53aa7709
RD
10647 This is the same as `SetSelection` and exists only because it is
10648 slightly more natural for controls which support multiple selection.
15afbcd0 10649 """
53aa7709 10650 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 10651
0085ce49
RD
10652ItemContainer_swigregister = _core_.ItemContainer_swigregister
10653ItemContainer_swigregister(ItemContainer)
d14a1e28
RD
10654
10655#---------------------------------------------------------------------------
10656
10657class ControlWithItems(Control,ItemContainer):
15afbcd0 10658 """
41e2b43e
RD
10659 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10660 wx.Control class, and is used for the base class of various controls
10661 that have items.
15afbcd0 10662 """
0085ce49
RD
10663 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10664 def __init__(self): raise AttributeError, "No constructor defined"
10665 __repr__ = _swig_repr
10666ControlWithItems_swigregister = _core_.ControlWithItems_swigregister
10667ControlWithItems_swigregister(ControlWithItems)
d14a1e28
RD
10668
10669#---------------------------------------------------------------------------
10670
10671class SizerItem(Object):
248ed943
RD
10672 """
10673 The wx.SizerItem class is used to track the position, size and other
10674 attributes of each item managed by a `wx.Sizer`. In normal usage user
10675 code should never need to deal directly with a wx.SizerItem, but
10676 custom classes derived from `wx.PySizer` will probably need to use the
10677 collection of wx.SizerItems held by wx.Sizer when calculating layout.
10678
10679 :see: `wx.Sizer`, `wx.GBSizerItem`
10680 """
0085ce49
RD
10681 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10682 __repr__ = _swig_repr
10683 def __init__(self, *args, **kwargs):
248ed943
RD
10684 """
10685 __init__(self) -> SizerItem
10686
10687 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10688 size will need to be set before this item can be used in a Sizer.
10689
10690 You will probably never need to create a wx.SizerItem directly as they
10691 are created automatically when the sizer's Add, Insert or Prepend
10692 methods are called.
10693
10694 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10695 """
0085ce49
RD
10696 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10697 __swig_destroy__ = _core_.delete_SizerItem
10698 __del__ = lambda self : None;
e811c8ce 10699 def DeleteWindows(*args, **kwargs):
248ed943
RD
10700 """
10701 DeleteWindows(self)
10702
10703 Destroy the window or the windows in a subsizer, depending on the type
10704 of item.
10705 """
54f9ee45 10706 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
10707
10708 def DetachSizer(*args, **kwargs):
248ed943
RD
10709 """
10710 DetachSizer(self)
10711
10712 Enable deleting the SizerItem without destroying the contained sizer.
10713 """
54f9ee45 10714 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
10715
10716 def GetSize(*args, **kwargs):
248ed943
RD
10717 """
10718 GetSize(self) -> Size
10719
10720 Get the current size of the item, as set in the last Layout.
10721 """
54f9ee45 10722 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
10723
10724 def CalcMin(*args, **kwargs):
248ed943
RD
10725 """
10726 CalcMin(self) -> Size
10727
10728 Calculates the minimum desired size for the item, including any space
10729 needed by borders.
10730 """
54f9ee45 10731 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
10732
10733 def SetDimension(*args, **kwargs):
248ed943
RD
10734 """
10735 SetDimension(self, Point pos, Size size)
10736
10737 Set the position and size of the space allocated for this item by the
10738 sizer, and adjust the position and size of the item (window or
10739 subsizer) to be within that space taking alignment and borders into
10740 account.
10741 """
54f9ee45 10742 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
10743
10744 def GetMinSize(*args, **kwargs):
248ed943
RD
10745 """
10746 GetMinSize(self) -> Size
10747
10748 Get the minimum size needed for the item.
10749 """
54f9ee45 10750 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 10751
dfbb5885
RD
10752 def GetMinSizeWithBorder(*args, **kwargs):
10753 """
10754 GetMinSizeWithBorder(self) -> Size
10755
10756 Get the minimum size needed for the item with space for the borders
10757 added, if needed.
10758 """
10759 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10760
e811c8ce 10761 def SetInitSize(*args, **kwargs):
a95a7133 10762 """SetInitSize(self, int x, int y)"""
54f9ee45 10763 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
10764
10765 def SetRatioWH(*args, **kwargs):
248ed943
RD
10766 """
10767 SetRatioWH(self, int width, int height)
10768
10769 Set the ratio item attribute.
10770 """
54f9ee45 10771 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
10772
10773 def SetRatioSize(*args, **kwargs):
248ed943
RD
10774 """
10775 SetRatioSize(self, Size size)
10776
10777 Set the ratio item attribute.
10778 """
54f9ee45 10779 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
10780
10781 def SetRatio(*args, **kwargs):
248ed943
RD
10782 """
10783 SetRatio(self, float ratio)
10784
10785 Set the ratio item attribute.
10786 """
54f9ee45 10787 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
10788
10789 def GetRatio(*args, **kwargs):
248ed943
RD
10790 """
10791 GetRatio(self) -> float
10792
10793 Set the ratio item attribute.
10794 """
54f9ee45 10795 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 10796
d3b6e4ff
RD
10797 def GetRect(*args, **kwargs):
10798 """
10799 GetRect(self) -> Rect
10800
10801 Returns the rectangle that the sizer item should occupy
10802 """
10803 return _core_.SizerItem_GetRect(*args, **kwargs)
10804
e811c8ce 10805 def IsWindow(*args, **kwargs):
248ed943
RD
10806 """
10807 IsWindow(self) -> bool
10808
10809 Is this sizer item a window?
10810 """
54f9ee45 10811 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
10812
10813 def IsSizer(*args, **kwargs):
248ed943
RD
10814 """
10815 IsSizer(self) -> bool
10816
10817 Is this sizer item a subsizer?
10818 """
54f9ee45 10819 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
10820
10821 def IsSpacer(*args, **kwargs):
248ed943
RD
10822 """
10823 IsSpacer(self) -> bool
10824
10825 Is this sizer item a spacer?
10826 """
54f9ee45 10827 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
10828
10829 def SetProportion(*args, **kwargs):
248ed943
RD
10830 """
10831 SetProportion(self, int proportion)
10832
10833 Set the proportion value for this item.
10834 """
54f9ee45 10835 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
10836
10837 def GetProportion(*args, **kwargs):
248ed943
RD
10838 """
10839 GetProportion(self) -> int
10840
10841 Get the proportion value for this item.
10842 """
54f9ee45 10843 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 10844
248ed943
RD
10845 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10846 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 10847 def SetFlag(*args, **kwargs):
248ed943
RD
10848 """
10849 SetFlag(self, int flag)
10850
10851 Set the flag value for this item.
10852 """
54f9ee45 10853 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
10854
10855 def GetFlag(*args, **kwargs):
248ed943
RD
10856 """
10857 GetFlag(self) -> int
10858
10859 Get the flag value for this item.
10860 """
54f9ee45 10861 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
10862
10863 def SetBorder(*args, **kwargs):
248ed943
RD
10864 """
10865 SetBorder(self, int border)
10866
10867 Set the border value for this item.
10868 """
54f9ee45 10869 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
10870
10871 def GetBorder(*args, **kwargs):
248ed943
RD
10872 """
10873 GetBorder(self) -> int
10874
10875 Get the border value for this item.
10876 """
54f9ee45 10877 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
10878
10879 def GetWindow(*args, **kwargs):
248ed943
RD
10880 """
10881 GetWindow(self) -> Window
10882
10883 Get the window (if any) that is managed by this sizer item.
10884 """
54f9ee45 10885 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce
RD
10886
10887 def SetWindow(*args, **kwargs):
248ed943
RD
10888 """
10889 SetWindow(self, Window window)
10890
10891 Set the window to be managed by this sizer item.
10892 """
54f9ee45 10893 return _core_.SizerItem_SetWindow(*args, **kwargs)
e811c8ce
RD
10894
10895 def GetSizer(*args, **kwargs):
248ed943
RD
10896 """
10897 GetSizer(self) -> Sizer
10898
10899 Get the subsizer (if any) that is managed by this sizer item.
10900 """
54f9ee45 10901 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce
RD
10902
10903 def SetSizer(*args, **kwargs):
248ed943
RD
10904 """
10905 SetSizer(self, Sizer sizer)
10906
10907 Set the subsizer to be managed by this sizer item.
10908 """
54f9ee45 10909 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce
RD
10910
10911 def GetSpacer(*args, **kwargs):
248ed943
RD
10912 """
10913 GetSpacer(self) -> Size
10914
10915 Get the size of the spacer managed by this sizer item.
10916 """
54f9ee45 10917 return _core_.SizerItem_GetSpacer(*args, **kwargs)
e811c8ce
RD
10918
10919 def SetSpacer(*args, **kwargs):
248ed943
RD
10920 """
10921 SetSpacer(self, Size size)
10922
10923 Set the size of the spacer to be managed by this sizer item.
10924 """
54f9ee45 10925 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce
RD
10926
10927 def Show(*args, **kwargs):
248ed943
RD
10928 """
10929 Show(self, bool show)
10930
10931 Set the show item attribute, which sizers use to determine if the item
10932 is to be made part of the layout or not. If the item is tracking a
10933 window then it is shown or hidden as needed.
10934 """
54f9ee45 10935 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
10936
10937 def IsShown(*args, **kwargs):
248ed943
RD
10938 """
10939 IsShown(self) -> bool
10940
10941 Is the item to be shown in the layout?
10942 """
54f9ee45 10943 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
10944
10945 def GetPosition(*args, **kwargs):
248ed943
RD
10946 """
10947 GetPosition(self) -> Point
10948
10949 Returns the current position of the item, as set in the last Layout.
10950 """
54f9ee45 10951 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
10952
10953 def GetUserData(*args, **kwargs):
248ed943
RD
10954 """
10955 GetUserData(self) -> PyObject
10956
10957 Returns the userData associated with this sizer item, or None if there
10958 isn't any.
10959 """
54f9ee45 10960 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 10961
091f5bed
RD
10962 def SetUserData(*args, **kwargs):
10963 """
10964 SetUserData(self, PyObject userData)
10965
10966 Associate a Python object with this sizer item.
10967 """
10968 return _core_.SizerItem_SetUserData(*args, **kwargs)
10969
0085ce49
RD
10970SizerItem_swigregister = _core_.SizerItem_swigregister
10971SizerItem_swigregister(SizerItem)
d14a1e28 10972
248ed943 10973def SizerItemWindow(*args, **kwargs):
0df68c9f 10974 """
248ed943
RD
10975 SizerItemWindow(Window window, int proportion, int flag, int border,
10976 PyObject userData=None) -> SizerItem
10977
10978 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 10979 """
248ed943 10980 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
10981 return val
10982
248ed943 10983def SizerItemSpacer(*args, **kwargs):
0df68c9f 10984 """
248ed943
RD
10985 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10986 PyObject userData=None) -> SizerItem
10987
10988 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 10989 """
248ed943 10990 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
10991 return val
10992
10993def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
10994 """
10995 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
10996 PyObject userData=None) -> SizerItem
10997
10998 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 10999 """
54f9ee45 11000 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
11001 return val
11002
11003class Sizer(Object):
248ed943
RD
11004 """
11005 wx.Sizer is the abstract base class used for laying out subwindows in
11006 a window. You cannot use wx.Sizer directly; instead, you will have to
11007 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11008 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11009 and `wx.GridBagSizer`.
11010
11011 The concept implemented by sizers in wxWidgets is closely related to
11012 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11013 toolkit or the Qt toolkit. It is based upon the idea of the individual
11014 subwindows reporting their minimal required size and their ability to
11015 get stretched if the size of the parent window has changed. This will
11016 most often mean that the programmer does not set the original size of
11017 a dialog in the beginning, rather the dialog will assigned a sizer and
11018 this sizer will be queried about the recommended size. The sizer in
11019 turn will query its children, which can be normal windows or contorls,
11020 empty space or other sizers, so that a hierarchy of sizers can be
11021 constructed. Note that wxSizer does not derive from wxWindow and thus
11022 do not interfere with tab ordering and requires very little resources
11023 compared to a real window on screen.
11024
11025 What makes sizers so well fitted for use in wxWidgets is the fact that
11026 every control reports its own minimal size and the algorithm can
11027 handle differences in font sizes or different window (dialog item)
11028 sizes on different platforms without problems. If for example the
11029 standard font as well as the overall design of Mac widgets requires
11030 more space than on Windows, then the initial size of a dialog using a
11031 sizer will automatically be bigger on Mac than on Windows.
11032 """
0085ce49
RD
11033 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11034 def __init__(self): raise AttributeError, "No constructor defined"
11035 __repr__ = _swig_repr
11036 __swig_destroy__ = _core_.delete_Sizer
11037 __del__ = lambda self : None;
e811c8ce 11038 def _setOORInfo(*args, **kwargs):
a95a7133 11039 """_setOORInfo(self, PyObject _self)"""
54f9ee45 11040 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
11041
11042 def Add(*args, **kwargs):
0df68c9f 11043 """
248ed943 11044 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11045 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11046
11047 Appends a child item to the sizer.
0df68c9f 11048 """
54f9ee45 11049 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce
RD
11050
11051 def Insert(*args, **kwargs):
0df68c9f 11052 """
248ed943 11053 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11054 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11055
11056 Inserts a new item into the list of items managed by this sizer before
11057 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 11058 """
54f9ee45 11059 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce
RD
11060
11061 def Prepend(*args, **kwargs):
0df68c9f 11062 """
248ed943 11063 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11064 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11065
11066 Adds a new item to the begining of the list of sizer items managed by
11067 this sizer. See `Add` for a description of the parameters.
0df68c9f 11068 """
54f9ee45 11069 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce
RD
11070
11071 def Remove(*args, **kwargs):
248ed943
RD
11072 """
11073 Remove(self, item) -> bool
11074
11075 Removes an item from the sizer and destroys it. This method does not
11076 cause any layout or resizing to take place, call `Layout` to update
11077 the layout on screen after removing a child from the sizer. The
11078 *item* parameter can be either a window, a sizer, or the zero-based
11079 index of an item to remove. Returns True if the child item was found
11080 and removed.
11081 """
54f9ee45 11082 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 11083
1c0f361b 11084 def Detach(*args, **kwargs):
248ed943
RD
11085 """
11086 Detach(self, item) -> bool
11087
11088 Detaches an item from the sizer without destroying it. This method
11089 does not cause any layout or resizing to take place, call `Layout` to
11090 do so. The *item* parameter can be either a window, a sizer, or the
11091 zero-based index of the item to be detached. Returns True if the child item
11092 was found and detached.
11093 """
1c0f361b
RD
11094 return _core_.Sizer_Detach(*args, **kwargs)
11095
d3b6e4ff
RD
11096 def GetItem(*args, **kwargs):
11097 """
11098 GetItem(self, item) -> wx.SizerItem
11099
11100 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11101 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11102 the item to be found.
d3b6e4ff
RD
11103 """
11104 return _core_.Sizer_GetItem(*args, **kwargs)
11105
e811c8ce 11106 def _SetItemMinSize(*args, **kwargs):
a95a7133 11107 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 11108 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 11109
248ed943
RD
11110 def SetItemMinSize(self, item, *args):
11111 """
11112 SetItemMinSize(self, item, Size size)
11113
11114 Sets the minimum size that will be allocated for an item in the sizer.
11115 The *item* parameter can be either a window, a sizer, or the
11116 zero-based index of the item. If a window or sizer is given then it
11117 will be searched for recursivly in subsizers if neccessary.
11118 """
11119 if len(args) == 2:
11120 # for backward compatibility accept separate width,height args too
11121 return self._SetItemMinSize(item, args)
11122 else:
11123 return self._SetItemMinSize(item, args[0])
11124
e811c8ce 11125 def AddItem(*args, **kwargs):
248ed943
RD
11126 """
11127 AddItem(self, SizerItem item)
11128
11129 Adds a `wx.SizerItem` to the sizer.
11130 """
54f9ee45 11131 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
11132
11133 def InsertItem(*args, **kwargs):
248ed943
RD
11134 """
11135 InsertItem(self, int index, SizerItem item)
11136
11137 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11138 """
54f9ee45 11139 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
11140
11141 def PrependItem(*args, **kwargs):
248ed943
RD
11142 """
11143 PrependItem(self, SizerItem item)
11144
11145 Prepends a `wx.SizerItem` to the sizer.
11146 """
54f9ee45 11147 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 11148
248ed943 11149 def AddMany(self, items):
66c033b4
RD
11150 """
11151 AddMany is a convenience method for adding several items
11152 to a sizer at one time. Simply pass it a list of tuples,
11153 where each tuple consists of the parameters that you
11154 would normally pass to the `Add` method.
11155 """
248ed943
RD
11156 for item in items:
11157 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11158 item = (item, )
11159 self.Add(*item)
d14a1e28 11160
74e96f3d 11161 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11162 def AddWindow(self, *args, **kw):
11163 """Compatibility alias for `Add`."""
11164 return self.Add(*args, **kw)
11165 def AddSizer(self, *args, **kw):
11166 """Compatibility alias for `Add`."""
11167 return self.Add(*args, **kw)
11168 def AddSpacer(self, *args, **kw):
11169 """Compatibility alias for `Add`."""
11170 return self.Add(*args, **kw)
11171
11172 def PrependWindow(self, *args, **kw):
11173 """Compatibility alias for `Prepend`."""
11174 return self.Prepend(*args, **kw)
11175 def PrependSizer(self, *args, **kw):
11176 """Compatibility alias for `Prepend`."""
11177 return self.Prepend(*args, **kw)
11178 def PrependSpacer(self, *args, **kw):
11179 """Compatibility alias for `Prepend`."""
11180 return self.Prepend(*args, **kw)
11181
11182 def InsertWindow(self, *args, **kw):
11183 """Compatibility alias for `Insert`."""
11184 return self.Insert(*args, **kw)
11185 def InsertSizer(self, *args, **kw):
11186 """Compatibility alias for `Insert`."""
11187 return self.Insert(*args, **kw)
11188 def InsertSpacer(self, *args, **kw):
11189 """Compatibility alias for `Insert`."""
11190 return self.Insert(*args, **kw)
11191
11192 def RemoveWindow(self, *args, **kw):
11193 """Compatibility alias for `Remove`."""
11194 return self.Remove(*args, **kw)
11195 def RemoveSizer(self, *args, **kw):
11196 """Compatibility alias for `Remove`."""
11197 return self.Remove(*args, **kw)
11198 def RemovePos(self, *args, **kw):
11199 """Compatibility alias for `Remove`."""
11200 return self.Remove(*args, **kw)
d14a1e28
RD
11201
11202
e811c8ce 11203 def SetDimension(*args, **kwargs):
248ed943
RD
11204 """
11205 SetDimension(self, int x, int y, int width, int height)
11206
11207 Call this to force the sizer to take the given dimension and thus
11208 force the items owned by the sizer to resize themselves according to
11209 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11210 methods.
11211 """
54f9ee45 11212 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
11213
11214 def SetMinSize(*args, **kwargs):
248ed943
RD
11215 """
11216 SetMinSize(self, Size size)
11217
11218 Call this to give the sizer a minimal size. Normally, the sizer will
11219 calculate its minimal size based purely on how much space its children
11220 need. After calling this method `GetMinSize` will return either the
11221 minimal size as requested by its children or the minimal size set
11222 here, depending on which is bigger.
11223 """
54f9ee45 11224 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
11225
11226 def GetSize(*args, **kwargs):
248ed943
RD
11227 """
11228 GetSize(self) -> Size
11229
11230 Returns the current size of the space managed by the sizer.
11231 """
54f9ee45 11232 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
11233
11234 def GetPosition(*args, **kwargs):
248ed943
RD
11235 """
11236 GetPosition(self) -> Point
11237
11238 Returns the current position of the sizer's managed space.
11239 """
54f9ee45 11240 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
11241
11242 def GetMinSize(*args, **kwargs):
248ed943
RD
11243 """
11244 GetMinSize(self) -> Size
11245
11246 Returns the minimal size of the sizer. This is either the combined
11247 minimal size of all the children and their borders or the minimal size
11248 set by SetMinSize, depending on which is bigger.
11249 """
54f9ee45 11250 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 11251
d14a1e28 11252 def GetSizeTuple(self):
1c0f361b 11253 return self.GetSize().Get()
d14a1e28 11254 def GetPositionTuple(self):
1c0f361b 11255 return self.GetPosition().Get()
d14a1e28 11256 def GetMinSizeTuple(self):
1c0f361b 11257 return self.GetMinSize().Get()
d14a1e28 11258
e811c8ce 11259 def RecalcSizes(*args, **kwargs):
248ed943
RD
11260 """
11261 RecalcSizes(self)
11262
11263 Using the sizes calculated by `CalcMin` reposition and resize all the
11264 items managed by this sizer. You should not need to call this directly as
11265 it is called by `Layout`.
11266 """
54f9ee45 11267 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
11268
11269 def CalcMin(*args, **kwargs):
248ed943
RD
11270 """
11271 CalcMin(self) -> Size
11272
11273 This method is where the sizer will do the actual calculation of its
11274 children's minimal sizes. You should not need to call this directly as
11275 it is called by `Layout`.
11276 """
54f9ee45 11277 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
11278
11279 def Layout(*args, **kwargs):
248ed943
RD
11280 """
11281 Layout(self)
11282
11283 This method will force the recalculation and layout of the items
11284 controlled by the sizer using the current space allocated to the
11285 sizer. Normally this is called automatically from the owning window's
11286 EVT_SIZE handler, but it is also useful to call it from user code when
11287 one of the items in a sizer change size, or items are added or
11288 removed.
11289 """
54f9ee45 11290 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
11291
11292 def Fit(*args, **kwargs):
248ed943
RD
11293 """
11294 Fit(self, Window window) -> Size
11295
11296 Tell the sizer to resize the *window* to match the sizer's minimal
11297 size. This is commonly done in the constructor of the window itself in
11298 order to set its initial size to match the needs of the children as
11299 determined by the sizer. Returns the new size.
11300
11301 For a top level window this is the total window size, not the client size.
11302 """
54f9ee45 11303 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
11304
11305 def FitInside(*args, **kwargs):
248ed943
RD
11306 """
11307 FitInside(self, Window window)
11308
11309 Tell the sizer to resize the *virtual size* of the *window* to match the
11310 sizer's minimal size. This will not alter the on screen size of the
11311 window, but may cause the addition/removal/alteration of scrollbars
11312 required to view the virtual area in windows which manage it.
11313
11314 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11315
11316 """
54f9ee45 11317 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
11318
11319 def SetSizeHints(*args, **kwargs):
248ed943
RD
11320 """
11321 SetSizeHints(self, Window window)
11322
11323 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11324 match the sizer's minimal size. This is commonly done in the
11325 constructor of the window itself if the window is resizable (as are
11326 many dialogs under Unix and frames on probably all platforms) in order
11327 to prevent the window from being sized smaller than the minimal size
11328 required by the sizer.
11329 """
54f9ee45 11330 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
11331
11332 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
11333 """
11334 SetVirtualSizeHints(self, Window window)
11335
11336 Tell the sizer to set the minimal size of the window virtual area to
11337 match the sizer's minimal size. For windows with managed scrollbars
11338 this will set them appropriately.
11339
11340 :see: `wx.ScrolledWindow.SetScrollbars`
11341
11342 """
54f9ee45 11343 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
11344
11345 def Clear(*args, **kwargs):
248ed943
RD
11346 """
11347 Clear(self, bool deleteWindows=False)
11348
11349 Clear all items from the sizer, optionally destroying the window items
11350 as well.
11351 """
54f9ee45 11352 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
11353
11354 def DeleteWindows(*args, **kwargs):
248ed943
RD
11355 """
11356 DeleteWindows(self)
11357
11358 Destroy all windows managed by the sizer.
11359 """
54f9ee45 11360 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
11361
11362 def GetChildren(*args, **kwargs):
248ed943 11363 """
51b83b37 11364 GetChildren(self) -> list
248ed943
RD
11365
11366 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11367 """
54f9ee45 11368 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
11369
11370 def Show(*args, **kwargs):
248ed943 11371 """
ae8162c8 11372 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 11373
248ed943
RD
11374 Shows or hides an item managed by the sizer. To make a sizer item
11375 disappear or reappear, use Show followed by `Layout`. The *item*
11376 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
11377 the item. Use the recursive parameter to show or hide an item in a
11378 subsizer. Returns True if the item was found.
248ed943
RD
11379 """
11380 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
11381
11382 def IsShown(*args, **kwargs):
248ed943
RD
11383 """
11384 IsShown(self, item)
11385
b1fcee84 11386 Determines if the item is currently shown. To make a sizer
248ed943
RD
11387 item disappear or reappear, use Show followed by `Layout`. The *item*
11388 parameter can be either a window, a sizer, or the zero-based index of
11389 the item.
11390 """
54f9ee45 11391 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 11392
7e63a440 11393 def Hide(self, item, recursive=False):
248ed943 11394 """
27fb7603 11395 A convenience method for `Show` (item, False, recursive).
248ed943 11396 """
06759a38 11397 return self.Show(item, False, recursive)
248ed943 11398
e811c8ce 11399 def ShowItems(*args, **kwargs):
248ed943
RD
11400 """
11401 ShowItems(self, bool show)
11402
84f85550 11403 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 11404 """
54f9ee45 11405 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 11406
0085ce49
RD
11407Sizer_swigregister = _core_.Sizer_swigregister
11408Sizer_swigregister(Sizer)
d14a1e28
RD
11409
11410class PySizer(Sizer):
248ed943
RD
11411 """
11412 wx.PySizer is a special version of `wx.Sizer` that has been
11413 instrumented to allow the C++ virtual methods to be overloaded in
11414 Python derived classes. You would derive from this class if you are
11415 wanting to implement a custom sizer in Python code. Simply implement
11416 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11417 For example::
11418
11419 class MySizer(wx.PySizer):
11420 def __init__(self):
11421 wx.PySizer.__init__(self)
11422
11423 def CalcMin(self):
11424 for item in self.GetChildren():
11425 # calculate the total minimum width and height needed
11426 # by all items in the sizer according to this sizer's
11427 # layout algorithm.
11428 ...
11429 return wx.Size(width, height)
11430
11431 def RecalcSizes(self):
11432 # find the space allotted to this sizer
11433 pos = self.GetPosition()
11434 size = self.GetSize()
11435 for item in self.GetChildren():
11436 # Recalculate (if necessary) the position and size of
11437 # each item and then call item.SetDimension to do the
11438 # actual positioning and sizing of the items within the
11439 # space alloted to this sizer.
11440 ...
11441 item.SetDimension(itemPos, itemSize)
11442
11443
11444 When `Layout` is called it first calls `CalcMin` followed by
11445 `RecalcSizes` so you can optimize a bit by saving the results of
e505d15e 11446 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
11447
11448 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11449
11450
11451 """
0085ce49
RD
11452 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11453 __repr__ = _swig_repr
11454 def __init__(self, *args, **kwargs):
248ed943
RD
11455 """
11456 __init__(self) -> PySizer
11457
11458 Creates a wx.PySizer. Must be called from the __init__ in the derived
11459 class.
11460 """
0085ce49 11461 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d14a1e28 11462 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
e811c8ce
RD
11463
11464 def _setCallbackInfo(*args, **kwargs):
a95a7133 11465 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 11466 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 11467
0085ce49
RD
11468PySizer_swigregister = _core_.PySizer_swigregister
11469PySizer_swigregister(PySizer)
d14a1e28
RD
11470
11471#---------------------------------------------------------------------------
11472
11473class BoxSizer(Sizer):
248ed943
RD
11474 """
11475 The basic idea behind a box sizer is that windows will most often be
11476 laid out in rather simple basic geometry, typically in a row or a
11477 column or nested hierarchies of either. A wx.BoxSizer will lay out
11478 its items in a simple row or column, depending on the orientation
11479 parameter passed to the constructor.
11480 """
0085ce49
RD
11481 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11482 __repr__ = _swig_repr
11483 def __init__(self, *args, **kwargs):
248ed943
RD
11484 """
11485 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11486
11487 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11488 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11489 sizer.
11490 """
0085ce49 11491 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d14a1e28 11492 self._setOORInfo(self)
e811c8ce
RD
11493
11494 def GetOrientation(*args, **kwargs):
248ed943
RD
11495 """
11496 GetOrientation(self) -> int
11497
11498 Returns the current orientation of the sizer.
11499 """
54f9ee45 11500 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
11501
11502 def SetOrientation(*args, **kwargs):
248ed943
RD
11503 """
11504 SetOrientation(self, int orient)
e811c8ce 11505
248ed943
RD
11506 Resets the orientation of the sizer.
11507 """
11508 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 11509
0085ce49
RD
11510BoxSizer_swigregister = _core_.BoxSizer_swigregister
11511BoxSizer_swigregister(BoxSizer)
d14a1e28
RD
11512
11513#---------------------------------------------------------------------------
11514
11515class StaticBoxSizer(BoxSizer):
248ed943
RD
11516 """
11517 wx.StaticBoxSizer derives from and functions identically to the
11518 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11519 manages. Note that this static box must be created separately and
11520 passed to the sizer constructor.
11521 """
0085ce49
RD
11522 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11523 __repr__ = _swig_repr
11524 def __init__(self, *args, **kwargs):
248ed943
RD
11525 """
11526 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11527
11528 Constructor. It takes an associated static box and the orientation
11529 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11530 ``wx.HORIZONTAL``.
11531 """
0085ce49 11532 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d14a1e28 11533 self._setOORInfo(self)
e811c8ce
RD
11534
11535 def GetStaticBox(*args, **kwargs):
248ed943
RD
11536 """
11537 GetStaticBox(self) -> StaticBox
e811c8ce 11538
248ed943
RD
11539 Returns the static box associated with this sizer.
11540 """
11541 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 11542
0085ce49
RD
11543StaticBoxSizer_swigregister = _core_.StaticBoxSizer_swigregister
11544StaticBoxSizer_swigregister(StaticBoxSizer)
d14a1e28
RD
11545
11546#---------------------------------------------------------------------------
11547
11548class GridSizer(Sizer):
248ed943
RD
11549 """
11550 A grid sizer is a sizer which lays out its children in a
11551 two-dimensional table with all cells having the same size. In other
11552 words, the width of each cell within the grid is the width of the
11553 widest item added to the sizer and the height of each grid cell is the
11554 height of the tallest item. An optional vertical and/or horizontal
11555 gap between items can also be specified (in pixels.)
11556
11557 Items are placed in the cells of the grid in the order they are added,
11558 in row-major order. In other words, the first row is filled first,
11559 then the second, and so on until all items have been added. (If
11560 neccessary, additional rows will be added as items are added.) If you
11561 need to have greater control over the cells that items are placed in
11562 then use the `wx.GridBagSizer`.
11563
11564 """
0085ce49
RD
11565 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11566 __repr__ = _swig_repr
11567 def __init__(self, *args, **kwargs):
248ed943
RD
11568 """
11569 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11570
11571 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11572 of columns and rows in the sizer - if either of the parameters is
11573 zero, it will be calculated to from the total number of children in
11574 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11575 define extra space between all children.
11576 """
0085ce49 11577 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d14a1e28 11578 self._setOORInfo(self)
e811c8ce 11579
e811c8ce 11580 def SetCols(*args, **kwargs):
248ed943
RD
11581 """
11582 SetCols(self, int cols)
11583
11584 Sets the number of columns in the sizer.
11585 """
54f9ee45 11586 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
11587
11588 def SetRows(*args, **kwargs):
248ed943
RD
11589 """
11590 SetRows(self, int rows)
11591
11592 Sets the number of rows in the sizer.
11593 """
54f9ee45 11594 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
11595
11596 def SetVGap(*args, **kwargs):
248ed943
RD
11597 """
11598 SetVGap(self, int gap)
11599
11600 Sets the vertical gap (in pixels) between the cells in the sizer.
11601 """
54f9ee45 11602 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
11603
11604 def SetHGap(*args, **kwargs):
248ed943
RD
11605 """
11606 SetHGap(self, int gap)
11607
11608 Sets the horizontal gap (in pixels) between cells in the sizer
11609 """
54f9ee45 11610 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
11611
11612 def GetCols(*args, **kwargs):
248ed943
RD
11613 """
11614 GetCols(self) -> int
11615
11616 Returns the number of columns in the sizer.
11617 """
54f9ee45 11618 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
11619
11620 def GetRows(*args, **kwargs):
248ed943
RD
11621 """
11622 GetRows(self) -> int
11623
11624 Returns the number of rows in the sizer.
11625 """
54f9ee45 11626 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
11627
11628 def GetVGap(*args, **kwargs):
248ed943
RD
11629 """
11630 GetVGap(self) -> int
11631
11632 Returns the vertical gap (in pixels) between the cells in the sizer.
11633 """
54f9ee45 11634 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
11635
11636 def GetHGap(*args, **kwargs):
248ed943
RD
11637 """
11638 GetHGap(self) -> int
11639
11640 Returns the horizontal gap (in pixels) between cells in the sizer.
11641 """
54f9ee45 11642 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 11643
0085ce49
RD
11644 def CalcRowsCols(self):
11645 """
11646 CalcRowsCols() -> (rows, cols)
11647
11648 Calculates how many rows and columns will be in the sizer based
11649 on the current number of items and also the rows, cols specified
11650 in the constructor.
11651 """
11652 nitems = len(self.GetChildren())
11653 rows = self.GetRows()
11654 cols = self.GetCols()
11655 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11656 if cols != 0:
11657 rows = (nitems + cols - 1) / cols
11658 elif rows != 0:
11659 cols = (nitems + rows - 1) / rows
11660 return (rows, cols)
d14a1e28 11661
0085ce49
RD
11662GridSizer_swigregister = _core_.GridSizer_swigregister
11663GridSizer_swigregister(GridSizer)
d14a1e28
RD
11664
11665#---------------------------------------------------------------------------
11666
54f9ee45
RD
11667FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11668FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11669FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 11670class FlexGridSizer(GridSizer):
248ed943
RD
11671 """
11672 A flex grid sizer is a sizer which lays out its children in a
11673 two-dimensional table with all table cells in one row having the same
11674 height and all cells in one column having the same width, but all
11675 rows or all columns are not necessarily the same height or width as in
11676 the `wx.GridSizer`.
11677
11678 wx.FlexGridSizer can also size items equally in one direction but
11679 unequally ("flexibly") in the other. If the sizer is only flexible
11680 in one direction (this can be changed using `SetFlexibleDirection`), it
11681 needs to be decided how the sizer should grow in the other ("non
11682 flexible") direction in order to fill the available space. The
11683 `SetNonFlexibleGrowMode` method serves this purpose.
11684
11685
11686 """
0085ce49
RD
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):
248ed943
RD
11690 """
11691 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11692
11693 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11694 number of columns and rows in the sizer - if either of the parameters
11695 is zero, it will be calculated to from the total number of children in
11696 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11697 define extra space between all children.
11698 """
0085ce49 11699 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d14a1e28 11700 self._setOORInfo(self)
e811c8ce 11701
248ed943
RD
11702 def AddGrowableRow(*args, **kwargs):
11703 """
11704 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 11705
248ed943
RD
11706 Specifies that row *idx* (starting from zero) should be grown if there
11707 is extra space available to the sizer.
e811c8ce 11708
248ed943
RD
11709 The *proportion* parameter has the same meaning as the stretch factor
11710 for the box sizers except that if all proportions are 0, then all
11711 columns are resized equally (instead of not being resized at all).
11712 """
54f9ee45 11713 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
11714
11715 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
11716 """
11717 RemoveGrowableRow(self, size_t idx)
11718
11719 Specifies that row *idx* is no longer growable.
11720 """
54f9ee45 11721 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
11722
11723 def AddGrowableCol(*args, **kwargs):
248ed943
RD
11724 """
11725 AddGrowableCol(self, size_t idx, int proportion=0)
11726
11727 Specifies that column *idx* (starting from zero) should be grown if
11728 there is extra space available to the sizer.
11729
11730 The *proportion* parameter has the same meaning as the stretch factor
11731 for the box sizers except that if all proportions are 0, then all
11732 columns are resized equally (instead of not being resized at all).
11733 """
54f9ee45 11734 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
11735
11736 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
11737 """
11738 RemoveGrowableCol(self, size_t idx)
11739
11740 Specifies that column *idx* is no longer growable.
11741 """
54f9ee45 11742 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
11743
11744 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
11745 """
11746 SetFlexibleDirection(self, int direction)
11747
11748 Specifies whether the sizer should flexibly resize its columns, rows,
11749 or both. Argument *direction* can be one of the following values. Any
11750 other value is ignored.
11751
11752 ============== =======================================
11753 wx.VERTICAL Rows are flexibly sized.
11754 wx.HORIZONTAL Columns are flexibly sized.
11755 wx.BOTH Both rows and columns are flexibly sized
11756 (this is the default value).
11757 ============== =======================================
11758
11759 Note that this method does not trigger relayout.
11760
11761 """
54f9ee45 11762 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
11763
11764 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
11765 """
11766 GetFlexibleDirection(self) -> int
11767
11768 Returns a value that specifies whether the sizer
11769 flexibly resizes its columns, rows, or both (default).
11770
11771 :see: `SetFlexibleDirection`
11772 """
54f9ee45 11773 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
11774
11775 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
11776 """
11777 SetNonFlexibleGrowMode(self, int mode)
11778
11779 Specifies how the sizer should grow in the non-flexible direction if
11780 there is one (so `SetFlexibleDirection` must have been called
11781 previously). Argument *mode* can be one of the following values:
11782
11783 ========================== =================================================
11784 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11785 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11786 `AddGrowableCol` and `AddGrowableRow`. In this
11787 case equal sizing applies to minimum sizes of
11788 columns or rows (this is the default value).
11789 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11790 the non flexible direction, whether they are
11791 growable or not in the flexbile direction.
11792 ========================== =================================================
11793
11794 Note that this method does not trigger relayout.
11795
11796
11797 """
54f9ee45 11798 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
11799
11800 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
11801 """
11802 GetNonFlexibleGrowMode(self) -> int
11803
11804 Returns the value that specifies how the sizer grows in the
11805 non-flexible direction if there is one.
11806
11807 :see: `SetNonFlexibleGrowMode`
11808 """
54f9ee45 11809 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
11810
11811 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
11812 """
11813 GetRowHeights(self) -> list
11814
11815 Returns a list of integers representing the heights of each of the
11816 rows in the sizer.
11817 """
54f9ee45 11818 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
11819
11820 def GetColWidths(*args, **kwargs):
fd2dc343
RD
11821 """
11822 GetColWidths(self) -> list
11823
11824 Returns a list of integers representing the widths of each of the
11825 columns in the sizer.
11826 """
54f9ee45 11827 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 11828
0085ce49
RD
11829FlexGridSizer_swigregister = _core_.FlexGridSizer_swigregister
11830FlexGridSizer_swigregister(FlexGridSizer)
d14a1e28 11831
e505d15e
RD
11832class StdDialogButtonSizer(BoxSizer):
11833 """
11834 A special sizer that knows how to order and position standard buttons
11835 in order to conform to the current platform's standards. You simply
11836 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 11837 buttons using the standard ID's. Then call `Realize` and the sizer
e505d15e
RD
11838 will take care of the rest.
11839
11840 """
0085ce49
RD
11841 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11842 __repr__ = _swig_repr
11843 def __init__(self, *args, **kwargs):
e505d15e 11844 """__init__(self) -> StdDialogButtonSizer"""
0085ce49 11845 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
e505d15e
RD
11846 def AddButton(*args, **kwargs):
11847 """
11848 AddButton(self, wxButton button)
11849
11850 Use this to add the buttons to this sizer. Do not use the `Add`
11851 method in the base class.
11852 """
11853 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11854
53aa7709 11855 def Realize(*args, **kwargs):
e505d15e 11856 """
53aa7709 11857 Realize(self)
e505d15e
RD
11858
11859 This funciton needs to be called after all the buttons have been added
11860 to the sizer. It will reorder them and position them in a platform
11861 specifc manner.
11862 """
53aa7709 11863 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
11864
11865 def SetAffirmativeButton(*args, **kwargs):
11866 """SetAffirmativeButton(self, wxButton button)"""
11867 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11868
11869 def SetNegativeButton(*args, **kwargs):
11870 """SetNegativeButton(self, wxButton button)"""
11871 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11872
11873 def SetCancelButton(*args, **kwargs):
11874 """SetCancelButton(self, wxButton button)"""
11875 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
e505d15e
RD
11876
11877 def GetAffirmativeButton(*args, **kwargs):
11878 """GetAffirmativeButton(self) -> wxButton"""
11879 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11880
11881 def GetApplyButton(*args, **kwargs):
11882 """GetApplyButton(self) -> wxButton"""
11883 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11884
11885 def GetNegativeButton(*args, **kwargs):
11886 """GetNegativeButton(self) -> wxButton"""
11887 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11888
11889 def GetCancelButton(*args, **kwargs):
11890 """GetCancelButton(self) -> wxButton"""
11891 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11892
11893 def GetHelpButton(*args, **kwargs):
11894 """GetHelpButton(self) -> wxButton"""
11895 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11896
0085ce49
RD
11897StdDialogButtonSizer_swigregister = _core_.StdDialogButtonSizer_swigregister
11898StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
e505d15e 11899
d14a1e28
RD
11900#---------------------------------------------------------------------------
11901
11902class GBPosition(object):
248ed943
RD
11903 """
11904 This class represents the position of an item in a virtual grid of
11905 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11906 typemaps that will automatically convert from a 2-element sequence of
11907 integers to a wx.GBPosition, so you can use the more pythonic
11908 representation of the position nearly transparently in Python code.
11909 """
0085ce49
RD
11910 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11911 __repr__ = _swig_repr
11912 def __init__(self, *args, **kwargs):
248ed943
RD
11913 """
11914 __init__(self, int row=0, int col=0) -> GBPosition
11915
11916 This class represents the position of an item in a virtual grid of
11917 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11918 typemaps that will automatically convert from a 2-element sequence of
11919 integers to a wx.GBPosition, so you can use the more pythonic
11920 representation of the position nearly transparently in Python code.
11921 """
0085ce49
RD
11922 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11923 __swig_destroy__ = _core_.delete_GBPosition
11924 __del__ = lambda self : None;
e811c8ce 11925 def GetRow(*args, **kwargs):
a95a7133 11926 """GetRow(self) -> int"""
54f9ee45 11927 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
11928
11929 def GetCol(*args, **kwargs):
a95a7133 11930 """GetCol(self) -> int"""
54f9ee45 11931 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
11932
11933 def SetRow(*args, **kwargs):
a95a7133 11934 """SetRow(self, int row)"""
54f9ee45 11935 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
11936
11937 def SetCol(*args, **kwargs):
a95a7133 11938 """SetCol(self, int col)"""
54f9ee45 11939 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
11940
11941 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11942 """
11943 __eq__(self, PyObject other) -> bool
11944
11945 Compare GBPosition for equality.
11946 """
54f9ee45 11947 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
11948
11949 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11950 """
11951 __ne__(self, PyObject other) -> bool
11952
11953 Compare GBPosition for inequality.
11954 """
54f9ee45 11955 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
11956
11957 def Set(*args, **kwargs):
a95a7133 11958 """Set(self, int row=0, int col=0)"""
54f9ee45 11959 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
11960
11961 def Get(*args, **kwargs):
a95a7133 11962 """Get(self) -> PyObject"""
54f9ee45 11963 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 11964
41e2b43e 11965 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
11966 def __str__(self): return str(self.Get())
11967 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11968 def __len__(self): return len(self.Get())
11969 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
11970 def __setitem__(self, index, val):
11971 if index == 0: self.SetRow(val)
11972 elif index == 1: self.SetCol(val)
11973 else: raise IndexError
e811c8ce 11974 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
11975 __safe_for_unpickling__ = True
11976 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
11977
11978 row = property(GetRow, SetRow)
11979 col = property(GetCol, SetCol)
11980
0085ce49
RD
11981GBPosition_swigregister = _core_.GBPosition_swigregister
11982GBPosition_swigregister(GBPosition)
d14a1e28
RD
11983
11984class GBSpan(object):
248ed943
RD
11985 """
11986 This class is used to hold the row and column spanning attributes of
11987 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11988 automatically convert from a 2-element sequence of integers to a
11989 wx.GBSpan, so you can use the more pythonic representation of the span
11990 nearly transparently in Python code.
11991
11992 """
0085ce49
RD
11993 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11994 __repr__ = _swig_repr
11995 def __init__(self, *args, **kwargs):
248ed943
RD
11996 """
11997 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11998
11999 Construct a new wxGBSpan, optionally setting the rowspan and
12000 colspan. The default is (1,1). (Meaning that the item occupies one
12001 cell in each direction.
12002 """
0085ce49
RD
12003 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12004 __swig_destroy__ = _core_.delete_GBSpan
12005 __del__ = lambda self : None;
e811c8ce 12006 def GetRowspan(*args, **kwargs):
a95a7133 12007 """GetRowspan(self) -> int"""
54f9ee45 12008 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
12009
12010 def GetColspan(*args, **kwargs):
a95a7133 12011 """GetColspan(self) -> int"""
54f9ee45 12012 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
12013
12014 def SetRowspan(*args, **kwargs):
a95a7133 12015 """SetRowspan(self, int rowspan)"""
54f9ee45 12016 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
12017
12018 def SetColspan(*args, **kwargs):
a95a7133 12019 """SetColspan(self, int colspan)"""
54f9ee45 12020 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
12021
12022 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12023 """
12024 __eq__(self, PyObject other) -> bool
12025
12026 Compare wxGBSpan for equality.
12027 """
54f9ee45 12028 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
12029
12030 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12031 """
12032 __ne__(self, PyObject other) -> bool
12033
12034 Compare GBSpan for inequality.
12035 """
54f9ee45 12036 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
12037
12038 def Set(*args, **kwargs):
a95a7133 12039 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 12040 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
12041
12042 def Get(*args, **kwargs):
a95a7133 12043 """Get(self) -> PyObject"""
54f9ee45 12044 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 12045
41e2b43e 12046 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
12047 def __str__(self): return str(self.Get())
12048 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12049 def __len__(self): return len(self.Get())
12050 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
12051 def __setitem__(self, index, val):
12052 if index == 0: self.SetRowspan(val)
12053 elif index == 1: self.SetColspan(val)
12054 else: raise IndexError
e811c8ce 12055 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12056 __safe_for_unpickling__ = True
12057 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
12058
12059 rowspan = property(GetRowspan, SetRowspan)
12060 colspan = property(GetColspan, SetColspan)
12061
0085ce49
RD
12062GBSpan_swigregister = _core_.GBSpan_swigregister
12063GBSpan_swigregister(GBSpan)
d14a1e28
RD
12064
12065class GBSizerItem(SizerItem):
248ed943
RD
12066 """
12067 The wx.GBSizerItem class is used to track the additional data about
12068 items in a `wx.GridBagSizer` such as the item's position in the grid
12069 and how many rows or columns it spans.
12070
12071 """
0085ce49
RD
12072 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12073 __repr__ = _swig_repr
12074 def __init__(self, *args, **kwargs):
248ed943
RD
12075 """
12076 __init__(self) -> GBSizerItem
12077
12078 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12079 size will need to be set, as well as a position and span before this
12080 item can be used in a Sizer.
12081
12082 You will probably never need to create a wx.GBSizerItem directly as they
12083 are created automatically when the sizer's Add method is called.
12084 """
0085ce49
RD
12085 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12086 __swig_destroy__ = _core_.delete_GBSizerItem
12087 __del__ = lambda self : None;
e811c8ce 12088 def GetPos(*args, **kwargs):
248ed943
RD
12089 """
12090 GetPos(self) -> GBPosition
12091
12092 Get the grid position of the item
12093 """
54f9ee45 12094 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
12095
12096 def GetPosTuple(self): return self.GetPos().Get()
12097 def GetSpan(*args, **kwargs):
248ed943
RD
12098 """
12099 GetSpan(self) -> GBSpan
12100
12101 Get the row and column spanning of the item
12102 """
54f9ee45 12103 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
12104
12105 def GetSpanTuple(self): return self.GetSpan().Get()
12106 def SetPos(*args, **kwargs):
248ed943
RD
12107 """
12108 SetPos(self, GBPosition pos) -> bool
12109
12110 If the item is already a member of a sizer then first ensure that
12111 there is no other item that would intersect with this one at the new
12112 position, then set the new position. Returns True if the change is
12113 successful and after the next Layout() the item will be moved.
12114 """
54f9ee45 12115 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
12116
12117 def SetSpan(*args, **kwargs):
248ed943
RD
12118 """
12119 SetSpan(self, GBSpan span) -> bool
12120
12121 If the item is already a member of a sizer then first ensure that
12122 there is no other item that would intersect with this one with its new
12123 spanning size, then set the new spanning. Returns True if the change
12124 is successful and after the next Layout() the item will be resized.
12125
12126 """
54f9ee45 12127 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 12128
248ed943 12129 def Intersects(*args, **kwargs):
0df68c9f 12130 """
a95a7133 12131 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12132
12133 Returns True if this item and the other item instersect.
0df68c9f 12134 """
248ed943
RD
12135 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12136
12137 def IntersectsPos(*args, **kwargs):
12138 """
12139 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12140
12141 Returns True if the given pos/span would intersect with this item.
12142 """
12143 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
12144
12145 def GetEndPos(*args, **kwargs):
248ed943
RD
12146 """
12147 GetEndPos(self) -> GBPosition
12148
12149 Get the row and column of the endpoint of this item.
12150 """
54f9ee45 12151 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
12152
12153 def GetGBSizer(*args, **kwargs):
248ed943
RD
12154 """
12155 GetGBSizer(self) -> GridBagSizer
12156
12157 Get the sizer this item is a member of.
12158 """
54f9ee45 12159 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
12160
12161 def SetGBSizer(*args, **kwargs):
248ed943
RD
12162 """
12163 SetGBSizer(self, GridBagSizer sizer)
12164
12165 Set the sizer this item is a member of.
12166 """
54f9ee45 12167 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 12168
0085ce49
RD
12169GBSizerItem_swigregister = _core_.GBSizerItem_swigregister
12170GBSizerItem_swigregister(GBSizerItem)
d14a1e28
RD
12171DefaultSpan = cvar.DefaultSpan
12172
12173def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
12174 """
12175 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12176 int border, PyObject userData=None) -> GBSizerItem
12177
12178 Construct a `wx.GBSizerItem` for a window.
0df68c9f 12179 """
54f9ee45 12180 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
12181 return val
12182
12183def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
12184 """
12185 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12186 int border, PyObject userData=None) -> GBSizerItem
12187
12188 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 12189 """
54f9ee45 12190 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
12191 return val
12192
12193def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
12194 """
12195 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12196 int flag, int border, PyObject userData=None) -> GBSizerItem
12197
12198 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 12199 """
54f9ee45 12200 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
12201 return val
12202
12203class GridBagSizer(FlexGridSizer):
248ed943
RD
12204 """
12205 A `wx.Sizer` that can lay out items in a virtual grid like a
12206 `wx.FlexGridSizer` but in this case explicit positioning of the items
12207 is allowed using `wx.GBPosition`, and items can optionally span more
12208 than one row and/or column using `wx.GBSpan`. The total size of the
12209 virtual grid is determined by the largest row and column that items are
12210 positioned at, adjusted for spanning.
12211
12212 """
0085ce49
RD
12213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12214 __repr__ = _swig_repr
12215 def __init__(self, *args, **kwargs):
248ed943
RD
12216 """
12217 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12218
12219 Constructor, with optional parameters to specify the gap between the
12220 rows and columns.
12221 """
0085ce49 12222 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
1823fbb4
RD
12223 self._setOORInfo(self)
12224
e811c8ce 12225 def Add(*args, **kwargs):
0df68c9f 12226 """
248ed943 12227 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 12228 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12229
12230 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12231 more than one row or column as specified with *span*. The remaining
12232 args behave similarly to `wx.Sizer.Add`.
12233
12234 Returns True if the item was successfully placed at the given cell
12235 position, False if something was already there.
12236
0df68c9f 12237 """
54f9ee45 12238 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
12239
12240 def AddItem(*args, **kwargs):
248ed943 12241 """
d3b6e4ff 12242 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
12243
12244 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12245 the item was successfully placed at its given cell position, False if
12246 something was already there.
12247 """
54f9ee45 12248 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 12249
84f85550
RD
12250 def GetCellSize(*args, **kwargs):
12251 """
12252 GetCellSize(self, int row, int col) -> Size
12253
12254 Get the size of the specified cell, including hgap and
12255 vgap. Only valid after a Layout.
12256 """
12257 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12258
e811c8ce 12259 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
12260 """
12261 GetEmptyCellSize(self) -> Size
12262
12263 Get the size used for cells in the grid with no item.
12264 """
54f9ee45 12265 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12266
12267 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
12268 """
12269 SetEmptyCellSize(self, Size sz)
12270
12271 Set the size used for cells in the grid with no item.
12272 """
54f9ee45 12273 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12274
12275 def GetItemPosition(*args):
0df68c9f 12276 """
248ed943
RD
12277 GetItemPosition(self, item) -> GBPosition
12278
12279 Get the grid position of the specified *item* where *item* is either a
12280 window or subsizer that is a member of this sizer, or a zero-based
12281 index of an item.
0df68c9f 12282 """
54f9ee45 12283 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
12284
12285 def SetItemPosition(*args):
0df68c9f 12286 """
248ed943
RD
12287 SetItemPosition(self, item, GBPosition pos) -> bool
12288
12289 Set the grid position of the specified *item* where *item* is either a
12290 window or subsizer that is a member of this sizer, or a zero-based
12291 index of an item. Returns True on success. If the move is not
12292 allowed (because an item is already there) then False is returned.
12293
0df68c9f 12294 """
54f9ee45 12295 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
12296
12297 def GetItemSpan(*args):
0df68c9f 12298 """
248ed943
RD
12299 GetItemSpan(self, item) -> GBSpan
12300
12301 Get the row/col spanning of the specified *item* where *item* is
12302 either a window or subsizer that is a member of this sizer, or a
12303 zero-based index of an item.
0df68c9f 12304 """
54f9ee45 12305 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
12306
12307 def SetItemSpan(*args):
0df68c9f 12308 """
248ed943
RD
12309 SetItemSpan(self, item, GBSpan span) -> bool
12310
12311 Set the row/col spanning of the specified *item* where *item* is
12312 either a window or subsizer that is a member of this sizer, or a
12313 zero-based index of an item. Returns True on success. If the move is
12314 not allowed (because an item is already there) then False is returned.
0df68c9f 12315 """
54f9ee45 12316 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
12317
12318 def FindItem(*args):
0df68c9f 12319 """
248ed943
RD
12320 FindItem(self, item) -> GBSizerItem
12321
12322 Find the sizer item for the given window or subsizer, returns None if
12323 not found. (non-recursive)
0df68c9f 12324 """
54f9ee45 12325 return _core_.GridBagSizer_FindItem(*args)
e811c8ce
RD
12326
12327 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
12328 """
12329 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12330
12331 Return the sizer item for the given grid cell, or None if there is no
12332 item at that position. (non-recursive)
12333 """
54f9ee45 12334 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
12335
12336 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
12337 """
12338 FindItemAtPoint(self, Point pt) -> GBSizerItem
12339
12340 Return the sizer item located at the point given in *pt*, or None if
12341 there is no item at that point. The (x,y) coordinates in pt correspond
12342 to the client coordinates of the window using the sizer for
12343 layout. (non-recursive)
12344 """
54f9ee45 12345 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 12346
248ed943
RD
12347 def CheckForIntersection(*args, **kwargs):
12348 """
12349 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 12350
248ed943
RD
12351 Look at all items and see if any intersect (or would overlap) the
12352 given *item*. Returns True if so, False if there would be no overlap.
12353 If an *excludeItem* is given then it will not be checked for
12354 intersection, for example it may be the item we are checking the
12355 position of.
e811c8ce 12356
248ed943
RD
12357 """
12358 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 12359
248ed943 12360 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 12361 """
248ed943
RD
12362 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12363
12364 Look at all items and see if any intersect (or would overlap) the
12365 given position and span. Returns True if so, False if there would be
12366 no overlap. If an *excludeItem* is given then it will not be checked
12367 for intersection, for example it may be the item we are checking the
12368 position of.
0df68c9f 12369 """
248ed943 12370 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 12371
0085ce49
RD
12372GridBagSizer_swigregister = _core_.GridBagSizer_swigregister
12373GridBagSizer_swigregister(GridBagSizer)
d14a1e28
RD
12374
12375#---------------------------------------------------------------------------
12376
54f9ee45
RD
12377Left = _core_.Left
12378Top = _core_.Top
12379Right = _core_.Right
12380Bottom = _core_.Bottom
12381Width = _core_.Width
12382Height = _core_.Height
12383Centre = _core_.Centre
12384Center = _core_.Center
12385CentreX = _core_.CentreX
12386CentreY = _core_.CentreY
12387Unconstrained = _core_.Unconstrained
12388AsIs = _core_.AsIs
12389PercentOf = _core_.PercentOf
12390Above = _core_.Above
12391Below = _core_.Below
12392LeftOf = _core_.LeftOf
12393RightOf = _core_.RightOf
12394SameAs = _core_.SameAs
12395Absolute = _core_.Absolute
d14a1e28 12396class IndividualLayoutConstraint(Object):
15afbcd0 12397 """
41e2b43e
RD
12398 Objects of this class are stored in the `wx.LayoutConstraints` class as
12399 one of eight possible constraints that a window can be involved in.
12400 You will never need to create an instance of
12401 wx.IndividualLayoutConstraint, rather you should create a
12402 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 12403 that it contains.
15afbcd0 12404 """
0085ce49
RD
12405 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12406 def __init__(self): raise AttributeError, "No constructor defined"
12407 __repr__ = _swig_repr
e811c8ce 12408 def Set(*args, **kwargs):
41e2b43e
RD
12409 """
12410 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12411
12412 Sets the properties of the constraint. Normally called by one of the
12413 convenience functions such as Above, RightOf, SameAs.
12414 """
54f9ee45 12415 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
12416
12417 def LeftOf(*args, **kwargs):
15afbcd0 12418 """
a95a7133 12419 LeftOf(self, Window sibling, int marg=0)
15afbcd0 12420
41e2b43e
RD
12421 Constrains this edge to be to the left of the given window, with an
12422 optional margin. Implicitly, this is relative to the left edge of the
12423 other window.
15afbcd0 12424 """
54f9ee45 12425 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
12426
12427 def RightOf(*args, **kwargs):
15afbcd0 12428 """
a95a7133 12429 RightOf(self, Window sibling, int marg=0)
15afbcd0 12430
41e2b43e
RD
12431 Constrains this edge to be to the right of the given window, with an
12432 optional margin. Implicitly, this is relative to the right edge of the
12433 other window.
15afbcd0 12434 """
54f9ee45 12435 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
12436
12437 def Above(*args, **kwargs):
15afbcd0 12438 """
a95a7133 12439 Above(self, Window sibling, int marg=0)
15afbcd0 12440
41e2b43e
RD
12441 Constrains this edge to be above the given window, with an optional
12442 margin. Implicitly, this is relative to the top edge of the other
12443 window.
15afbcd0 12444 """
54f9ee45 12445 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
12446
12447 def Below(*args, **kwargs):
15afbcd0 12448 """
a95a7133 12449 Below(self, Window sibling, int marg=0)
15afbcd0 12450
41e2b43e
RD
12451 Constrains this edge to be below the given window, with an optional
12452 margin. Implicitly, this is relative to the bottom edge of the other
12453 window.
15afbcd0 12454 """
54f9ee45 12455 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
12456
12457 def SameAs(*args, **kwargs):
15afbcd0 12458 """
a95a7133 12459 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 12460
41e2b43e
RD
12461 Constrains this edge or dimension to be to the same as the edge of the
12462 given window, with an optional margin.
15afbcd0 12463 """
54f9ee45 12464 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
12465
12466 def PercentOf(*args, **kwargs):
15afbcd0 12467 """
a95a7133 12468 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 12469
41e2b43e
RD
12470 Constrains this edge or dimension to be to a percentage of the given
12471 window, with an optional margin.
15afbcd0 12472 """
54f9ee45 12473 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
12474
12475 def Absolute(*args, **kwargs):
15afbcd0 12476 """
a95a7133 12477 Absolute(self, int val)
15afbcd0 12478
41e2b43e 12479 Constrains this edge or dimension to be the given absolute value.
15afbcd0 12480 """
54f9ee45 12481 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
12482
12483 def Unconstrained(*args, **kwargs):
15afbcd0 12484 """
a95a7133 12485 Unconstrained(self)
15afbcd0 12486
41e2b43e
RD
12487 Sets this edge or dimension to be unconstrained, that is, dependent on
12488 other edges and dimensions from which this value can be deduced.
15afbcd0 12489 """
54f9ee45 12490 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
12491
12492 def AsIs(*args, **kwargs):
15afbcd0 12493 """
a95a7133 12494 AsIs(self)
15afbcd0 12495
41e2b43e
RD
12496 Sets this edge or constraint to be whatever the window's value is at
12497 the moment. If either of the width and height constraints are *as is*,
12498 the window will not be resized, but moved instead. This is important
12499 when considering panel items which are intended to have a default
12500 size, such as a button, which may take its size from the size of the
12501 button label.
15afbcd0 12502 """
54f9ee45 12503 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
12504
12505 def GetOtherWindow(*args, **kwargs):
a95a7133 12506 """GetOtherWindow(self) -> Window"""
54f9ee45 12507 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
12508
12509 def GetMyEdge(*args, **kwargs):
a95a7133 12510 """GetMyEdge(self) -> int"""
54f9ee45 12511 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
12512
12513 def SetEdge(*args, **kwargs):
a95a7133 12514 """SetEdge(self, int which)"""
54f9ee45 12515 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
12516
12517 def SetValue(*args, **kwargs):
a95a7133 12518 """SetValue(self, int v)"""
54f9ee45 12519 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
12520
12521 def GetMargin(*args, **kwargs):
a95a7133 12522 """GetMargin(self) -> int"""
54f9ee45 12523 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
12524
12525 def SetMargin(*args, **kwargs):
a95a7133 12526 """SetMargin(self, int m)"""
54f9ee45 12527 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
12528
12529 def GetValue(*args, **kwargs):
a95a7133 12530 """GetValue(self) -> int"""
54f9ee45 12531 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
12532
12533 def GetPercent(*args, **kwargs):
a95a7133 12534 """GetPercent(self) -> int"""
54f9ee45 12535 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
12536
12537 def GetOtherEdge(*args, **kwargs):
a95a7133 12538 """GetOtherEdge(self) -> int"""
54f9ee45 12539 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
12540
12541 def GetDone(*args, **kwargs):
a95a7133 12542 """GetDone(self) -> bool"""
54f9ee45 12543 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
12544
12545 def SetDone(*args, **kwargs):
a95a7133 12546 """SetDone(self, bool d)"""
54f9ee45 12547 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
12548
12549 def GetRelationship(*args, **kwargs):
a95a7133 12550 """GetRelationship(self) -> int"""
54f9ee45 12551 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
12552
12553 def SetRelationship(*args, **kwargs):
a95a7133 12554 """SetRelationship(self, int r)"""
54f9ee45 12555 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
12556
12557 def ResetIfWin(*args, **kwargs):
15afbcd0 12558 """
a95a7133 12559 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
12560
12561 Reset constraint if it mentions otherWin
12562 """
54f9ee45 12563 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
12564
12565 def SatisfyConstraint(*args, **kwargs):
15afbcd0 12566 """
a95a7133 12567 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
12568
12569 Try to satisfy constraint
12570 """
54f9ee45 12571 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
12572
12573 def GetEdge(*args, **kwargs):
15afbcd0 12574 """
a95a7133 12575 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
12576
12577 Get the value of this edge or dimension, or if this
12578 is not determinable, -1.
12579 """
54f9ee45 12580 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 12581
0085ce49
RD
12582IndividualLayoutConstraint_swigregister = _core_.IndividualLayoutConstraint_swigregister
12583IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d14a1e28
RD
12584
12585class LayoutConstraints(Object):
15afbcd0 12586 """
41e2b43e
RD
12587 **Note:** constraints are now deprecated and you should use sizers
12588 instead.
15afbcd0 12589
41e2b43e
RD
12590 Objects of this class can be associated with a window to define its
12591 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
12592
12593 The class consists of the following eight constraints of class
12594 wx.IndividualLayoutConstraint, some or all of which should be accessed
12595 directly to set the appropriate constraints.
12596
12597 * left: represents the left hand edge of the window
12598 * right: represents the right hand edge of the window
12599 * top: represents the top edge of the window
12600 * bottom: represents the bottom edge of the window
12601 * width: represents the width of the window
12602 * height: represents the height of the window
12603 * centreX: represents the horizontal centre point of the window
12604 * centreY: represents the vertical centre point of the window
12605
41e2b43e
RD
12606 Most constraints are initially set to have the relationship
12607 wxUnconstrained, which means that their values should be calculated by
12608 looking at known constraints. The exceptions are width and height,
12609 which are set to wxAsIs to ensure that if the user does not specify a
12610 constraint, the existing width and height will be used, to be
12611 compatible with panel items which often have take a default size. If
12612 the constraint is ``wx.AsIs``, the dimension will not be changed.
12613
12614 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
12615
12616 """
0085ce49
RD
12617 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12618 __repr__ = _swig_repr
54f9ee45
RD
12619 left = property(_core_.LayoutConstraints_left_get)
12620 top = property(_core_.LayoutConstraints_top_get)
12621 right = property(_core_.LayoutConstraints_right_get)
12622 bottom = property(_core_.LayoutConstraints_bottom_get)
12623 width = property(_core_.LayoutConstraints_width_get)
12624 height = property(_core_.LayoutConstraints_height_get)
12625 centreX = property(_core_.LayoutConstraints_centreX_get)
12626 centreY = property(_core_.LayoutConstraints_centreY_get)
0085ce49 12627 def __init__(self, *args, **kwargs):
a95a7133 12628 """__init__(self) -> LayoutConstraints"""
0085ce49
RD
12629 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12630 __swig_destroy__ = _core_.delete_LayoutConstraints
12631 __del__ = lambda self : None;
e811c8ce 12632 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 12633 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 12634 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
12635
12636 def AreSatisfied(*args, **kwargs):
a95a7133 12637 """AreSatisfied(self) -> bool"""
54f9ee45 12638 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 12639
0085ce49
RD
12640LayoutConstraints_swigregister = _core_.LayoutConstraints_swigregister
12641LayoutConstraints_swigregister(LayoutConstraints)
d14a1e28
RD
12642
12643#----------------------------------------------------------------------------
12644
322913ce 12645# Use Python's bool constants if available, make some if not
d14a1e28
RD
12646try:
12647 True
12648except NameError:
322913ce
RD
12649 __builtins__.True = 1==1
12650 __builtins__.False = 1==0
4f89f6a3
RD
12651 def bool(value): return not not value
12652 __builtins__.bool = bool
d14a1e28 12653
d14a1e28
RD
12654
12655
12656# workarounds for bad wxRTTI names
12657__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12658__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12659__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12660
12661
12662#----------------------------------------------------------------------------
12663# Load version numbers from __version__... Ensure that major and minor
7bc1e663 12664# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
12665
12666from __version__ import *
12667__version__ = VERSION_STRING
12668
7bc1e663
RD
12669assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12670assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 12671if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 12672 import warnings
7bc1e663 12673 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28
RD
12674
12675#----------------------------------------------------------------------------
12676
70b7a5fe
RD
12677# Set wxPython's default string<-->unicode conversion encoding from
12678# the locale, but only if Python's default hasn't been changed. (We
12679# assume that if the user has customized it already then that is the
12680# encoding we need to use as well.)
12681#
12682# The encoding selected here is used when string or unicode objects
12683# need to be converted in order to pass them to wxWidgets. Please be
12684# aware that the default encoding within the same locale may be
12685# slightly different on different platforms. For example, please see
e505d15e
RD
12686# http://www.alanwood.net/demos/charsetdiffs.html for differences
12687# between the common latin/roman encodings.
396fb509
RD
12688
12689default = _sys.getdefaultencoding()
12690if default == 'ascii':
12691 import locale
12692 import codecs
12693 try:
12694 default = locale.getdefaultlocale()[1]
12695 codecs.lookup(default)
70b7a5fe 12696 except (ValueError, LookupError, TypeError):
396fb509
RD
12697 default = _sys.getdefaultencoding()
12698 del locale
12699 del codecs
5cbf236d
RD
12700if default:
12701 wx.SetDefaultPyEncoding(default)
12702del default
5cbf236d
RD
12703
12704#----------------------------------------------------------------------------
12705
d14a1e28
RD
12706class PyDeadObjectError(AttributeError):
12707 pass
12708
d14a1e28
RD
12709class _wxPyDeadObject(object):
12710 """
12711 Instances of wx objects that are OOR capable will have their __class__
12712 changed to this class when the C++ object is deleted. This should help
12713 prevent crashes due to referencing a bogus C++ pointer.
12714 """
12715 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12716 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12717
3a04f143 12718 def __repr__(self):
d14a1e28
RD
12719 if not hasattr(self, "_name"):
12720 self._name = "[unknown]"
12721 return self.reprStr % self._name
12722
3a04f143 12723 def __getattr__(self, *args):
d14a1e28
RD
12724 if not hasattr(self, "_name"):
12725 self._name = "[unknown]"
3a04f143
RD
12726 raise PyDeadObjectError(self.attrStr % self._name)
12727
12728 def __nonzero__(self):
12729 return 0
12730
12731
12732
12733class PyUnbornObjectError(AttributeError):
12734 pass
12735
12736class _wxPyUnbornObject(object):
12737 """
54f9ee45 12738 Some stock objects are created when the wx._core module is
3a04f143
RD
12739 imported, but their C++ instance is not created until the wx.App
12740 object is created and initialized. These object instances will
12741 temporarily have their __class__ changed to this class so an
12742 exception will be raised if they are used before the C++ instance
12743 is ready.
12744 """
12745
12746 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12747 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12748
12749 def __repr__(self):
12750 #if not hasattr(self, "_name"):
12751 # self._name = "[unknown]"
12752 return self.reprStr #% self._name
12753
12754 def __getattr__(self, *args):
12755 #if not hasattr(self, "_name"):
12756 # self._name = "[unknown]"
12757 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
12758
12759 def __nonzero__(self):
12760 return 0
12761
12762
12763#----------------------------------------------------------------------------
d14a1e28
RD
12764
12765def CallAfter(callable, *args, **kw):
12766 """
12767 Call the specified function after the current and pending event
12768 handlers have been completed. This is also good for making GUI
61863841
RD
12769 method calls from non-GUI threads. Any extra positional or
12770 keyword args are passed on to the callable when it is called.
12771
12772 :see: `wx.FutureCall`
d14a1e28
RD
12773 """
12774 app = wx.GetApp()
dfbb5885 12775 assert app is not None, 'No wx.App created yet'
d14a1e28 12776
148275d3
RD
12777 if not hasattr(app, "_CallAfterId"):
12778 app._CallAfterId = wx.NewEventType()
12779 app.Connect(-1, -1, app._CallAfterId,
12780 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 12781 evt = wx.PyEvent()
148275d3 12782 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
12783 evt.callable = callable
12784 evt.args = args
12785 evt.kw = kw
12786 wx.PostEvent(app, evt)
12787
d14a1e28
RD
12788#----------------------------------------------------------------------------
12789
12790
12791class FutureCall:
12792 """
8ac8dba0 12793 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
12794 object once after the given amount of milliseconds, passing any
12795 positional or keyword args. The return value of the callable is
61863841 12796 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
12797
12798 If you don't need to get the return value or restart the timer
12799 then there is no need to hold a reference to this object. It will
12800 hold a reference to itself while the timer is running (the timer
12801 has a reference to self.Notify) but the cycle will be broken when
12802 the timer completes, automatically cleaning up the wx.FutureCall
12803 object.
61863841
RD
12804
12805 :see: `wx.CallAfter`
d14a1e28
RD
12806 """
12807 def __init__(self, millis, callable, *args, **kwargs):
12808 self.millis = millis
12809 self.callable = callable
12810 self.SetArgs(*args, **kwargs)
12811 self.runCount = 0
4276dc52 12812 self.running = False
d14a1e28
RD
12813 self.hasRun = False
12814 self.result = None
12815 self.timer = None
12816 self.Start()
12817
12818 def __del__(self):
12819 self.Stop()
12820
12821
12822 def Start(self, millis=None, *args, **kwargs):
12823 """
12824 (Re)start the timer
12825 """
12826 self.hasRun = False
12827 if millis is not None:
12828 self.millis = millis
12829 if args or kwargs:
12830 self.SetArgs(*args, **kwargs)
12831 self.Stop()
12832 self.timer = wx.PyTimer(self.Notify)
12833 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 12834 self.running = True
d14a1e28
RD
12835 Restart = Start
12836
12837
12838 def Stop(self):
12839 """
12840 Stop and destroy the timer.
12841 """
12842 if self.timer is not None:
12843 self.timer.Stop()
12844 self.timer = None
12845
12846
12847 def GetInterval(self):
12848 if self.timer is not None:
12849 return self.timer.GetInterval()
12850 else:
12851 return 0
12852
12853
12854 def IsRunning(self):
12855 return self.timer is not None and self.timer.IsRunning()
12856
12857
12858 def SetArgs(self, *args, **kwargs):
12859 """
12860 (Re)set the args passed to the callable object. This is
12861 useful in conjunction with Restart if you want to schedule a
12862 new call to the same callable object but with different
12863 parameters.
12864 """
12865 self.args = args
12866 self.kwargs = kwargs
12867
12868
12869 def HasRun(self):
12870 return self.hasRun
12871
12872 def GetResult(self):
12873 return self.result
12874
12875 def Notify(self):
12876 """
12877 The timer has expired so call the callable.
12878 """
12879 if self.callable and getattr(self.callable, 'im_self', True):
12880 self.runCount += 1
4276dc52 12881 self.running = False
d14a1e28
RD
12882 self.result = self.callable(*self.args, **self.kwargs)
12883 self.hasRun = True
4276dc52
RD
12884 if not self.running:
12885 # if it wasn't restarted, then cleanup
12886 wx.CallAfter(self.Stop)
d14a1e28
RD
12887
12888
a95a7133
RD
12889
12890#----------------------------------------------------------------------------
12891# Control which items in this module should be documented by epydoc.
12892# We allow only classes and functions, which will help reduce the size
12893# of the docs by filtering out the zillions of constants, EVT objects,
12894# and etc that don't make much sense by themselves, but are instead
12895# documented (or will be) as part of the classes/functions/methods
12896# where they should be used.
12897
66c033b4
RD
12898class __DocFilter:
12899 """
12900 A filter for epydoc that only allows non-Ptr classes and
12901 fucntions, in order to reduce the clutter in the API docs.
12902 """
12903 def __init__(self, globals):
12904 self._globals = globals
12905
12906 def __call__(self, name):
12907 import types
12908 obj = self._globals.get(name, None)
12909 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12910 return False
0085ce49 12911 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
66c033b4
RD
12912 return False
12913 return True
a95a7133 12914
d14a1e28
RD
12915#----------------------------------------------------------------------------
12916#----------------------------------------------------------------------------
12917
12918# Import other modules in this package that should show up in the
12919# "core" wx namespace
54f9ee45
RD
12920from _gdi import *
12921from _windows import *
12922from _controls import *
12923from _misc import *
d14a1e28 12924
3a04f143
RD
12925
12926# Fixup the stock objects since they can't be used yet. (They will be
12927# restored in wx.PyApp.OnInit.)
54f9ee45 12928_core_._wxPyFixStockObjects()
3a04f143 12929
d14a1e28
RD
12930#----------------------------------------------------------------------------
12931#----------------------------------------------------------------------------
12932
12933
32fe5131 12934