]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
Added typemap for wxIndex*
[wxWidgets.git] / wxPython / src / mac / _core.py
CommitLineData
d55e5bfc
RD
1# This file was created automatically by SWIG.
2# Don't modify this file, modify the SWIG interface instead.
3
5b5c9bc7 4import _core_
d55e5bfc 5
36ed4f51
RD
6def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name) or (name == "thisown"):
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):
24 method = class_type.__swig_getmethods__.get(name,None)
25 if method: return method(self)
26 raise AttributeError,name
27
28import types
29try:
30 _object = types.ObjectType
31 _newclass = 1
32except AttributeError:
33 class _object : pass
34 _newclass = 0
35del types
36
37
38def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
d55e5bfc
RD
47#// Give a reference to the dictionary of this module to the C++ extension
48#// code.
49_core_._wxPySetDictionary(vars())
50
51#// A little trick to make 'wx' be a reference to this module so wx.Names can
52#// be used here.
53import sys as _sys
54wx = _sys.modules[__name__]
55
d6c14a4c
RD
56
57#----------------------------------------------------------------------------
58
59def _deprecated(callable, msg=None):
60 """
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
63 """
64 if msg is None:
65 msg = "%s is deprecated" % callable
66 def deprecatedWrapper(*args, **kwargs):
67 import warnings
68 warnings.warn(msg, DeprecationWarning, stacklevel=2)
69 return callable(*args, **kwargs)
70 deprecatedWrapper.__doc__ = msg
71 return deprecatedWrapper
72
73
74#----------------------------------------------------------------------------
75
5b5c9bc7
RD
76NOT_FOUND = _core_.NOT_FOUND
77VSCROLL = _core_.VSCROLL
78HSCROLL = _core_.HSCROLL
79CAPTION = _core_.CAPTION
80DOUBLE_BORDER = _core_.DOUBLE_BORDER
81SUNKEN_BORDER = _core_.SUNKEN_BORDER
82RAISED_BORDER = _core_.RAISED_BORDER
83BORDER = _core_.BORDER
84SIMPLE_BORDER = _core_.SIMPLE_BORDER
85STATIC_BORDER = _core_.STATIC_BORDER
86TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
87NO_BORDER = _core_.NO_BORDER
88DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 89DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
5b5c9bc7
RD
90TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
91WANTS_CHARS = _core_.WANTS_CHARS
92POPUP_WINDOW = _core_.POPUP_WINDOW
93CENTER_FRAME = _core_.CENTER_FRAME
94CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
95CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
96CLIP_CHILDREN = _core_.CLIP_CHILDREN
97CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
98ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
99RETAINED = _core_.RETAINED
100BACKINGSTORE = _core_.BACKINGSTORE
101COLOURED = _core_.COLOURED
102FIXED_LENGTH = _core_.FIXED_LENGTH
103LB_NEEDED_SB = _core_.LB_NEEDED_SB
104LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
105LB_SORT = _core_.LB_SORT
106LB_SINGLE = _core_.LB_SINGLE
107LB_MULTIPLE = _core_.LB_MULTIPLE
108LB_EXTENDED = _core_.LB_EXTENDED
109LB_OWNERDRAW = _core_.LB_OWNERDRAW
110LB_HSCROLL = _core_.LB_HSCROLL
111PROCESS_ENTER = _core_.PROCESS_ENTER
112PASSWORD = _core_.PASSWORD
113CB_SIMPLE = _core_.CB_SIMPLE
114CB_DROPDOWN = _core_.CB_DROPDOWN
115CB_SORT = _core_.CB_SORT
116CB_READONLY = _core_.CB_READONLY
117RA_HORIZONTAL = _core_.RA_HORIZONTAL
118RA_VERTICAL = _core_.RA_VERTICAL
119RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
120RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
121RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
122RB_GROUP = _core_.RB_GROUP
123RB_SINGLE = _core_.RB_SINGLE
124SB_HORIZONTAL = _core_.SB_HORIZONTAL
125SB_VERTICAL = _core_.SB_VERTICAL
126RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
127ST_SIZEGRIP = _core_.ST_SIZEGRIP
128ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
129FLOOD_SURFACE = _core_.FLOOD_SURFACE
130FLOOD_BORDER = _core_.FLOOD_BORDER
131ODDEVEN_RULE = _core_.ODDEVEN_RULE
132WINDING_RULE = _core_.WINDING_RULE
133TOOL_TOP = _core_.TOOL_TOP
134TOOL_BOTTOM = _core_.TOOL_BOTTOM
135TOOL_LEFT = _core_.TOOL_LEFT
136TOOL_RIGHT = _core_.TOOL_RIGHT
137OK = _core_.OK
138YES_NO = _core_.YES_NO
139CANCEL = _core_.CANCEL
140YES = _core_.YES
141NO = _core_.NO
142NO_DEFAULT = _core_.NO_DEFAULT
143YES_DEFAULT = _core_.YES_DEFAULT
144ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
145ICON_HAND = _core_.ICON_HAND
146ICON_QUESTION = _core_.ICON_QUESTION
147ICON_INFORMATION = _core_.ICON_INFORMATION
148ICON_STOP = _core_.ICON_STOP
149ICON_ASTERISK = _core_.ICON_ASTERISK
150ICON_MASK = _core_.ICON_MASK
151ICON_WARNING = _core_.ICON_WARNING
152ICON_ERROR = _core_.ICON_ERROR
153FORWARD = _core_.FORWARD
154BACKWARD = _core_.BACKWARD
155RESET = _core_.RESET
156HELP = _core_.HELP
157MORE = _core_.MORE
158SETUP = _core_.SETUP
159SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
160SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
161SIZE_AUTO = _core_.SIZE_AUTO
162SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
163SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
164PORTRAIT = _core_.PORTRAIT
165LANDSCAPE = _core_.LANDSCAPE
166PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
167PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
168PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
169PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
170ID_ANY = _core_.ID_ANY
171ID_SEPARATOR = _core_.ID_SEPARATOR
172ID_LOWEST = _core_.ID_LOWEST
173ID_OPEN = _core_.ID_OPEN
174ID_CLOSE = _core_.ID_CLOSE
175ID_NEW = _core_.ID_NEW
176ID_SAVE = _core_.ID_SAVE
177ID_SAVEAS = _core_.ID_SAVEAS
178ID_REVERT = _core_.ID_REVERT
179ID_EXIT = _core_.ID_EXIT
180ID_UNDO = _core_.ID_UNDO
181ID_REDO = _core_.ID_REDO
182ID_HELP = _core_.ID_HELP
183ID_PRINT = _core_.ID_PRINT
184ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
185ID_PREVIEW = _core_.ID_PREVIEW
186ID_ABOUT = _core_.ID_ABOUT
187ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
188ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
189ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
190ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
191ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
192ID_PREFERENCES = _core_.ID_PREFERENCES
193ID_CUT = _core_.ID_CUT
194ID_COPY = _core_.ID_COPY
195ID_PASTE = _core_.ID_PASTE
196ID_CLEAR = _core_.ID_CLEAR
197ID_FIND = _core_.ID_FIND
198ID_DUPLICATE = _core_.ID_DUPLICATE
199ID_SELECTALL = _core_.ID_SELECTALL
200ID_DELETE = _core_.ID_DELETE
201ID_REPLACE = _core_.ID_REPLACE
202ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
203ID_PROPERTIES = _core_.ID_PROPERTIES
204ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
205ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
206ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
207ID_VIEW_LIST = _core_.ID_VIEW_LIST
208ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
209ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
210ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
211ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
212ID_FILE1 = _core_.ID_FILE1
213ID_FILE2 = _core_.ID_FILE2
214ID_FILE3 = _core_.ID_FILE3
215ID_FILE4 = _core_.ID_FILE4
216ID_FILE5 = _core_.ID_FILE5
217ID_FILE6 = _core_.ID_FILE6
218ID_FILE7 = _core_.ID_FILE7
219ID_FILE8 = _core_.ID_FILE8
220ID_FILE9 = _core_.ID_FILE9
221ID_OK = _core_.ID_OK
222ID_CANCEL = _core_.ID_CANCEL
223ID_APPLY = _core_.ID_APPLY
224ID_YES = _core_.ID_YES
225ID_NO = _core_.ID_NO
226ID_STATIC = _core_.ID_STATIC
227ID_FORWARD = _core_.ID_FORWARD
228ID_BACKWARD = _core_.ID_BACKWARD
229ID_DEFAULT = _core_.ID_DEFAULT
230ID_MORE = _core_.ID_MORE
231ID_SETUP = _core_.ID_SETUP
232ID_RESET = _core_.ID_RESET
233ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
234ID_YESTOALL = _core_.ID_YESTOALL
235ID_NOTOALL = _core_.ID_NOTOALL
236ID_ABORT = _core_.ID_ABORT
237ID_RETRY = _core_.ID_RETRY
238ID_IGNORE = _core_.ID_IGNORE
239ID_ADD = _core_.ID_ADD
240ID_REMOVE = _core_.ID_REMOVE
241ID_UP = _core_.ID_UP
242ID_DOWN = _core_.ID_DOWN
243ID_HOME = _core_.ID_HOME
244ID_REFRESH = _core_.ID_REFRESH
245ID_STOP = _core_.ID_STOP
246ID_INDEX = _core_.ID_INDEX
247ID_BOLD = _core_.ID_BOLD
248ID_ITALIC = _core_.ID_ITALIC
249ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
250ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
251ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
252ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
253ID_UNDERLINE = _core_.ID_UNDERLINE
254ID_INDENT = _core_.ID_INDENT
255ID_UNINDENT = _core_.ID_UNINDENT
256ID_ZOOM_100 = _core_.ID_ZOOM_100
257ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
258ID_ZOOM_IN = _core_.ID_ZOOM_IN
259ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
260ID_UNDELETE = _core_.ID_UNDELETE
261ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
262ID_HIGHEST = _core_.ID_HIGHEST
263OPEN = _core_.OPEN
264SAVE = _core_.SAVE
265HIDE_READONLY = _core_.HIDE_READONLY
266OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
267FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
268MULTIPLE = _core_.MULTIPLE
269CHANGE_DIR = _core_.CHANGE_DIR
270ACCEL_ALT = _core_.ACCEL_ALT
271ACCEL_CTRL = _core_.ACCEL_CTRL
272ACCEL_SHIFT = _core_.ACCEL_SHIFT
273ACCEL_NORMAL = _core_.ACCEL_NORMAL
274PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
275PD_APP_MODAL = _core_.PD_APP_MODAL
276PD_CAN_ABORT = _core_.PD_CAN_ABORT
277PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
278PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
279PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
280PD_SMOOTH = _core_.PD_SMOOTH
281PD_CAN_SKIP = _core_.PD_CAN_SKIP
282DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
283DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
284MENU_TEAROFF = _core_.MENU_TEAROFF
285MB_DOCKABLE = _core_.MB_DOCKABLE
286NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
287FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
288LI_HORIZONTAL = _core_.LI_HORIZONTAL
289LI_VERTICAL = _core_.LI_VERTICAL
290WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
291WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
292WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
293WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
294WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
295WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
296MM_TEXT = _core_.MM_TEXT
297MM_LOMETRIC = _core_.MM_LOMETRIC
298MM_HIMETRIC = _core_.MM_HIMETRIC
299MM_LOENGLISH = _core_.MM_LOENGLISH
300MM_HIENGLISH = _core_.MM_HIENGLISH
301MM_TWIPS = _core_.MM_TWIPS
302MM_ISOTROPIC = _core_.MM_ISOTROPIC
303MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
304MM_POINTS = _core_.MM_POINTS
305MM_METRIC = _core_.MM_METRIC
306CENTRE = _core_.CENTRE
307CENTER = _core_.CENTER
308HORIZONTAL = _core_.HORIZONTAL
309VERTICAL = _core_.VERTICAL
310BOTH = _core_.BOTH
311LEFT = _core_.LEFT
312RIGHT = _core_.RIGHT
313UP = _core_.UP
314DOWN = _core_.DOWN
315TOP = _core_.TOP
316BOTTOM = _core_.BOTTOM
317NORTH = _core_.NORTH
318SOUTH = _core_.SOUTH
319WEST = _core_.WEST
320EAST = _core_.EAST
321ALL = _core_.ALL
322ALIGN_NOT = _core_.ALIGN_NOT
323ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
324ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
325ALIGN_LEFT = _core_.ALIGN_LEFT
326ALIGN_TOP = _core_.ALIGN_TOP
327ALIGN_RIGHT = _core_.ALIGN_RIGHT
328ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
329ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
330ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
331ALIGN_CENTER = _core_.ALIGN_CENTER
332ALIGN_CENTRE = _core_.ALIGN_CENTRE
333ALIGN_MASK = _core_.ALIGN_MASK
334STRETCH_NOT = _core_.STRETCH_NOT
335SHRINK = _core_.SHRINK
336GROW = _core_.GROW
337EXPAND = _core_.EXPAND
338SHAPED = _core_.SHAPED
339FIXED_MINSIZE = _core_.FIXED_MINSIZE
340TILE = _core_.TILE
341ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
342BORDER_DEFAULT = _core_.BORDER_DEFAULT
343BORDER_NONE = _core_.BORDER_NONE
344BORDER_STATIC = _core_.BORDER_STATIC
345BORDER_SIMPLE = _core_.BORDER_SIMPLE
346BORDER_RAISED = _core_.BORDER_RAISED
347BORDER_SUNKEN = _core_.BORDER_SUNKEN
348BORDER_DOUBLE = _core_.BORDER_DOUBLE
349BORDER_MASK = _core_.BORDER_MASK
350BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
351BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
352BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
353DEFAULT = _core_.DEFAULT
354DECORATIVE = _core_.DECORATIVE
355ROMAN = _core_.ROMAN
356SCRIPT = _core_.SCRIPT
357SWISS = _core_.SWISS
358MODERN = _core_.MODERN
359TELETYPE = _core_.TELETYPE
360VARIABLE = _core_.VARIABLE
361FIXED = _core_.FIXED
362NORMAL = _core_.NORMAL
363LIGHT = _core_.LIGHT
364BOLD = _core_.BOLD
365ITALIC = _core_.ITALIC
366SLANT = _core_.SLANT
367SOLID = _core_.SOLID
368DOT = _core_.DOT
369LONG_DASH = _core_.LONG_DASH
370SHORT_DASH = _core_.SHORT_DASH
371DOT_DASH = _core_.DOT_DASH
372USER_DASH = _core_.USER_DASH
373TRANSPARENT = _core_.TRANSPARENT
374STIPPLE = _core_.STIPPLE
375BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
376CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
377FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
378CROSS_HATCH = _core_.CROSS_HATCH
379HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
380VERTICAL_HATCH = _core_.VERTICAL_HATCH
381JOIN_BEVEL = _core_.JOIN_BEVEL
382JOIN_MITER = _core_.JOIN_MITER
383JOIN_ROUND = _core_.JOIN_ROUND
384CAP_ROUND = _core_.CAP_ROUND
385CAP_PROJECTING = _core_.CAP_PROJECTING
386CAP_BUTT = _core_.CAP_BUTT
387CLEAR = _core_.CLEAR
388XOR = _core_.XOR
389INVERT = _core_.INVERT
390OR_REVERSE = _core_.OR_REVERSE
391AND_REVERSE = _core_.AND_REVERSE
392COPY = _core_.COPY
393AND = _core_.AND
394AND_INVERT = _core_.AND_INVERT
395NO_OP = _core_.NO_OP
396NOR = _core_.NOR
397EQUIV = _core_.EQUIV
398SRC_INVERT = _core_.SRC_INVERT
399OR_INVERT = _core_.OR_INVERT
400NAND = _core_.NAND
401OR = _core_.OR
402SET = _core_.SET
403WXK_BACK = _core_.WXK_BACK
404WXK_TAB = _core_.WXK_TAB
405WXK_RETURN = _core_.WXK_RETURN
406WXK_ESCAPE = _core_.WXK_ESCAPE
407WXK_SPACE = _core_.WXK_SPACE
408WXK_DELETE = _core_.WXK_DELETE
409WXK_START = _core_.WXK_START
410WXK_LBUTTON = _core_.WXK_LBUTTON
411WXK_RBUTTON = _core_.WXK_RBUTTON
412WXK_CANCEL = _core_.WXK_CANCEL
413WXK_MBUTTON = _core_.WXK_MBUTTON
414WXK_CLEAR = _core_.WXK_CLEAR
415WXK_SHIFT = _core_.WXK_SHIFT
416WXK_ALT = _core_.WXK_ALT
417WXK_CONTROL = _core_.WXK_CONTROL
418WXK_MENU = _core_.WXK_MENU
419WXK_PAUSE = _core_.WXK_PAUSE
420WXK_CAPITAL = _core_.WXK_CAPITAL
421WXK_PRIOR = _core_.WXK_PRIOR
422WXK_NEXT = _core_.WXK_NEXT
423WXK_END = _core_.WXK_END
424WXK_HOME = _core_.WXK_HOME
425WXK_LEFT = _core_.WXK_LEFT
426WXK_UP = _core_.WXK_UP
427WXK_RIGHT = _core_.WXK_RIGHT
428WXK_DOWN = _core_.WXK_DOWN
429WXK_SELECT = _core_.WXK_SELECT
430WXK_PRINT = _core_.WXK_PRINT
431WXK_EXECUTE = _core_.WXK_EXECUTE
432WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
433WXK_INSERT = _core_.WXK_INSERT
434WXK_HELP = _core_.WXK_HELP
435WXK_NUMPAD0 = _core_.WXK_NUMPAD0
436WXK_NUMPAD1 = _core_.WXK_NUMPAD1
437WXK_NUMPAD2 = _core_.WXK_NUMPAD2
438WXK_NUMPAD3 = _core_.WXK_NUMPAD3
439WXK_NUMPAD4 = _core_.WXK_NUMPAD4
440WXK_NUMPAD5 = _core_.WXK_NUMPAD5
441WXK_NUMPAD6 = _core_.WXK_NUMPAD6
442WXK_NUMPAD7 = _core_.WXK_NUMPAD7
443WXK_NUMPAD8 = _core_.WXK_NUMPAD8
444WXK_NUMPAD9 = _core_.WXK_NUMPAD9
445WXK_MULTIPLY = _core_.WXK_MULTIPLY
446WXK_ADD = _core_.WXK_ADD
447WXK_SEPARATOR = _core_.WXK_SEPARATOR
448WXK_SUBTRACT = _core_.WXK_SUBTRACT
449WXK_DECIMAL = _core_.WXK_DECIMAL
450WXK_DIVIDE = _core_.WXK_DIVIDE
451WXK_F1 = _core_.WXK_F1
452WXK_F2 = _core_.WXK_F2
453WXK_F3 = _core_.WXK_F3
454WXK_F4 = _core_.WXK_F4
455WXK_F5 = _core_.WXK_F5
456WXK_F6 = _core_.WXK_F6
457WXK_F7 = _core_.WXK_F7
458WXK_F8 = _core_.WXK_F8
459WXK_F9 = _core_.WXK_F9
460WXK_F10 = _core_.WXK_F10
461WXK_F11 = _core_.WXK_F11
462WXK_F12 = _core_.WXK_F12
463WXK_F13 = _core_.WXK_F13
464WXK_F14 = _core_.WXK_F14
465WXK_F15 = _core_.WXK_F15
466WXK_F16 = _core_.WXK_F16
467WXK_F17 = _core_.WXK_F17
468WXK_F18 = _core_.WXK_F18
469WXK_F19 = _core_.WXK_F19
470WXK_F20 = _core_.WXK_F20
471WXK_F21 = _core_.WXK_F21
472WXK_F22 = _core_.WXK_F22
473WXK_F23 = _core_.WXK_F23
474WXK_F24 = _core_.WXK_F24
475WXK_NUMLOCK = _core_.WXK_NUMLOCK
476WXK_SCROLL = _core_.WXK_SCROLL
477WXK_PAGEUP = _core_.WXK_PAGEUP
478WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
479WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
480WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
481WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
482WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
483WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
484WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
485WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
486WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
487WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
488WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
489WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
490WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
491WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
492WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
493WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
494WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
495WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
496WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
497WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
498WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
499WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
500WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
501WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
502WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
503WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
504WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
505WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
506WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
507WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
508WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
509WXK_COMMAND = _core_.WXK_COMMAND
510WXK_SPECIAL1 = _core_.WXK_SPECIAL1
511WXK_SPECIAL2 = _core_.WXK_SPECIAL2
512WXK_SPECIAL3 = _core_.WXK_SPECIAL3
513WXK_SPECIAL4 = _core_.WXK_SPECIAL4
514WXK_SPECIAL5 = _core_.WXK_SPECIAL5
515WXK_SPECIAL6 = _core_.WXK_SPECIAL6
516WXK_SPECIAL7 = _core_.WXK_SPECIAL7
517WXK_SPECIAL8 = _core_.WXK_SPECIAL8
518WXK_SPECIAL9 = _core_.WXK_SPECIAL9
519WXK_SPECIAL10 = _core_.WXK_SPECIAL10
520WXK_SPECIAL11 = _core_.WXK_SPECIAL11
521WXK_SPECIAL12 = _core_.WXK_SPECIAL12
522WXK_SPECIAL13 = _core_.WXK_SPECIAL13
523WXK_SPECIAL14 = _core_.WXK_SPECIAL14
524WXK_SPECIAL15 = _core_.WXK_SPECIAL15
525WXK_SPECIAL16 = _core_.WXK_SPECIAL16
526WXK_SPECIAL17 = _core_.WXK_SPECIAL17
527WXK_SPECIAL18 = _core_.WXK_SPECIAL18
528WXK_SPECIAL19 = _core_.WXK_SPECIAL19
529WXK_SPECIAL20 = _core_.WXK_SPECIAL20
530PAPER_NONE = _core_.PAPER_NONE
531PAPER_LETTER = _core_.PAPER_LETTER
532PAPER_LEGAL = _core_.PAPER_LEGAL
533PAPER_A4 = _core_.PAPER_A4
534PAPER_CSHEET = _core_.PAPER_CSHEET
535PAPER_DSHEET = _core_.PAPER_DSHEET
536PAPER_ESHEET = _core_.PAPER_ESHEET
537PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
538PAPER_TABLOID = _core_.PAPER_TABLOID
539PAPER_LEDGER = _core_.PAPER_LEDGER
540PAPER_STATEMENT = _core_.PAPER_STATEMENT
541PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
542PAPER_A3 = _core_.PAPER_A3
543PAPER_A4SMALL = _core_.PAPER_A4SMALL
544PAPER_A5 = _core_.PAPER_A5
545PAPER_B4 = _core_.PAPER_B4
546PAPER_B5 = _core_.PAPER_B5
547PAPER_FOLIO = _core_.PAPER_FOLIO
548PAPER_QUARTO = _core_.PAPER_QUARTO
549PAPER_10X14 = _core_.PAPER_10X14
550PAPER_11X17 = _core_.PAPER_11X17
551PAPER_NOTE = _core_.PAPER_NOTE
552PAPER_ENV_9 = _core_.PAPER_ENV_9
553PAPER_ENV_10 = _core_.PAPER_ENV_10
554PAPER_ENV_11 = _core_.PAPER_ENV_11
555PAPER_ENV_12 = _core_.PAPER_ENV_12
556PAPER_ENV_14 = _core_.PAPER_ENV_14
557PAPER_ENV_DL = _core_.PAPER_ENV_DL
558PAPER_ENV_C5 = _core_.PAPER_ENV_C5
559PAPER_ENV_C3 = _core_.PAPER_ENV_C3
560PAPER_ENV_C4 = _core_.PAPER_ENV_C4
561PAPER_ENV_C6 = _core_.PAPER_ENV_C6
562PAPER_ENV_C65 = _core_.PAPER_ENV_C65
563PAPER_ENV_B4 = _core_.PAPER_ENV_B4
564PAPER_ENV_B5 = _core_.PAPER_ENV_B5
565PAPER_ENV_B6 = _core_.PAPER_ENV_B6
566PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
567PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
568PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
569PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
570PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
571PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
572PAPER_ISO_B4 = _core_.PAPER_ISO_B4
573PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
574PAPER_9X11 = _core_.PAPER_9X11
575PAPER_10X11 = _core_.PAPER_10X11
576PAPER_15X11 = _core_.PAPER_15X11
577PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
578PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
579PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
580PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
581PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
582PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
583PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
584PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
585PAPER_A_PLUS = _core_.PAPER_A_PLUS
586PAPER_B_PLUS = _core_.PAPER_B_PLUS
587PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
588PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
589PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
590PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
591PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
592PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
593PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
594PAPER_A2 = _core_.PAPER_A2
595PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
596PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
597DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
598DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
599DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
600ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
601ITEM_NORMAL = _core_.ITEM_NORMAL
602ITEM_CHECK = _core_.ITEM_CHECK
603ITEM_RADIO = _core_.ITEM_RADIO
604ITEM_MAX = _core_.ITEM_MAX
605HT_NOWHERE = _core_.HT_NOWHERE
606HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
607HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
608HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
609HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
610HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
611HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
612HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
613HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
614HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
615HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
616HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
617HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
618HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
619HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
620HT_MAX = _core_.HT_MAX
621MOD_NONE = _core_.MOD_NONE
622MOD_ALT = _core_.MOD_ALT
623MOD_CONTROL = _core_.MOD_CONTROL
624MOD_SHIFT = _core_.MOD_SHIFT
625MOD_WIN = _core_.MOD_WIN
626UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
627UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
628UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d55e5bfc
RD
629#---------------------------------------------------------------------------
630
5b5c9bc7 631class Object(object):
d55e5bfc
RD
632 """
633 The base class for most wx objects, although in wxPython not
634 much functionality is needed nor exposed.
635 """
636 def __init__(self): raise RuntimeError, "No constructor defined"
637 def __repr__(self):
638 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
639 def GetClassName(*args, **kwargs):
640 """
5b5c9bc7 641 GetClassName(self) -> String
d55e5bfc
RD
642
643 Returns the class name of the C++ class using wxRTTI.
644 """
5b5c9bc7 645 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
646
647 def Destroy(*args, **kwargs):
648 """
649 Destroy(self)
650
651 Deletes the C++ object this Python object is a proxy for.
652 """
5b5c9bc7 653 return _core_.Object_Destroy(*args, **kwargs)
d55e5bfc
RD
654
655
5b5c9bc7 656class ObjectPtr(Object):
d55e5bfc
RD
657 def __init__(self, this):
658 self.this = this
659 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
660 self.__class__ = Object
661_core_.Object_swigregister(ObjectPtr)
662_wxPySetDictionary = _core_._wxPySetDictionary
d55e5bfc 663
5b5c9bc7 664_wxPyFixStockObjects = _core_._wxPyFixStockObjects
d55e5bfc 665
5b5c9bc7 666cvar = _core_.cvar
d55e5bfc
RD
667EmptyString = cvar.EmptyString
668
669#---------------------------------------------------------------------------
670
5b5c9bc7
RD
671BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
672BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
673BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
674BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
675BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
676BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
677BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
678BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
679BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
680BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
681BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
682BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
683BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
684BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
685BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
686BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
687BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
688BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
689BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
690BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
691CURSOR_NONE = _core_.CURSOR_NONE
692CURSOR_ARROW = _core_.CURSOR_ARROW
693CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
694CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
695CURSOR_CHAR = _core_.CURSOR_CHAR
696CURSOR_CROSS = _core_.CURSOR_CROSS
697CURSOR_HAND = _core_.CURSOR_HAND
698CURSOR_IBEAM = _core_.CURSOR_IBEAM
699CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
700CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
701CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
702CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
703CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
704CURSOR_PENCIL = _core_.CURSOR_PENCIL
705CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
706CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
707CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
708CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
709CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
710CURSOR_SIZENS = _core_.CURSOR_SIZENS
711CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
712CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
713CURSOR_SIZING = _core_.CURSOR_SIZING
714CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
715CURSOR_WAIT = _core_.CURSOR_WAIT
716CURSOR_WATCH = _core_.CURSOR_WATCH
717CURSOR_BLANK = _core_.CURSOR_BLANK
718CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
719CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
720CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
721CURSOR_MAX = _core_.CURSOR_MAX
d55e5bfc
RD
722#---------------------------------------------------------------------------
723
5b5c9bc7 724class Size(object):
d55e5bfc 725 """
15817c7e 726 wx.Size is a useful data structure used to represent the size of
36ed4f51
RD
727 something. It simply contians integer width and height
728 proprtites. In most places in wxPython where a wx.Size is
729 expected a (width, height) tuple can be used instead.
d55e5bfc
RD
730 """
731 def __repr__(self):
732 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
733 width = property(_core_.Size_width_get, _core_.Size_width_set)
734 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc
RD
735 x = width; y = height
736 def __init__(self, *args, **kwargs):
737 """
5b5c9bc7 738 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
739
740 Creates a size object.
741 """
5b5c9bc7 742 newobj = _core_.new_Size(*args, **kwargs)
d55e5bfc
RD
743 self.this = newobj.this
744 self.thisown = 1
745 del newobj.thisown
5b5c9bc7 746 def __del__(self, destroy=_core_.delete_Size):
d55e5bfc
RD
747 """__del__(self)"""
748 try:
749 if self.thisown: destroy(self)
750 except: pass
751
752 def __eq__(*args, **kwargs):
753 """
5b5c9bc7 754 __eq__(self, Size sz) -> bool
d55e5bfc
RD
755
756 Test for equality of wx.Size objects.
757 """
5b5c9bc7 758 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
759
760 def __ne__(*args, **kwargs):
761 """
5b5c9bc7 762 __ne__(self, Size sz) -> bool
d55e5bfc
RD
763
764 Test for inequality.
765 """
5b5c9bc7 766 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
767
768 def __add__(*args, **kwargs):
769 """
5b5c9bc7 770 __add__(self, Size sz) -> Size
d55e5bfc
RD
771
772 Add sz's proprties to this and return the result.
773 """
5b5c9bc7 774 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
775
776 def __sub__(*args, **kwargs):
777 """
5b5c9bc7 778 __sub__(self, Size sz) -> Size
d55e5bfc
RD
779
780 Subtract sz's properties from this and return the result.
781 """
5b5c9bc7 782 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
783
784 def IncTo(*args, **kwargs):
785 """
5b5c9bc7 786 IncTo(self, Size sz)
d55e5bfc
RD
787
788 Increments this object so that both of its dimensions are not less
789 than the corresponding dimensions of the size.
790 """
5b5c9bc7 791 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
792
793 def DecTo(*args, **kwargs):
794 """
5b5c9bc7 795 DecTo(self, Size sz)
d55e5bfc
RD
796
797 Decrements this object so that both of its dimensions are not greater
798 than the corresponding dimensions of the size.
799 """
5b5c9bc7 800 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc
RD
801
802 def Set(*args, **kwargs):
803 """
804 Set(self, int w, int h)
805
806 Set both width and height.
807 """
5b5c9bc7 808 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
809
810 def SetWidth(*args, **kwargs):
811 """SetWidth(self, int w)"""
5b5c9bc7 812 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
813
814 def SetHeight(*args, **kwargs):
815 """SetHeight(self, int h)"""
5b5c9bc7 816 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
817
818 def GetWidth(*args, **kwargs):
819 """GetWidth(self) -> int"""
5b5c9bc7 820 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
821
822 def GetHeight(*args, **kwargs):
823 """GetHeight(self) -> int"""
5b5c9bc7 824 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
825
826 def IsFullySpecified(*args, **kwargs):
827 """
828 IsFullySpecified(self) -> bool
829
830 Returns True if both components of the size are non-default values.
831 """
5b5c9bc7 832 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
833
834 def SetDefaults(*args, **kwargs):
835 """
5b5c9bc7 836 SetDefaults(self, Size size)
d55e5bfc 837
15817c7e
RD
838 Combine this size with the other one replacing the default components
839 of this object (i.e. equal to -1) with those of the other.
d55e5bfc 840 """
5b5c9bc7 841 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
842
843 def Get(*args, **kwargs):
844 """
845 Get() -> (width,height)
846
847 Returns the width and height properties as a tuple.
848 """
5b5c9bc7 849 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 850
15817c7e 851 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
852 def __str__(self): return str(self.Get())
853 def __repr__(self): return 'wx.Size'+str(self.Get())
854 def __len__(self): return len(self.Get())
855 def __getitem__(self, index): return self.Get()[index]
856 def __setitem__(self, index, val):
857 if index == 0: self.width = val
858 elif index == 1: self.height = val
859 else: raise IndexError
860 def __nonzero__(self): return self.Get() != (0,0)
861 __safe_for_unpickling__ = True
862 def __reduce__(self): return (wx.Size, self.Get())
863
864
5b5c9bc7 865class SizePtr(Size):
d55e5bfc
RD
866 def __init__(self, this):
867 self.this = this
868 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
869 self.__class__ = Size
870_core_.Size_swigregister(SizePtr)
d55e5bfc
RD
871
872#---------------------------------------------------------------------------
873
5b5c9bc7 874class RealPoint(object):
d55e5bfc 875 """
15817c7e
RD
876 A data structure for representing a point or position with floating
877 point x and y properties. In wxPython most places that expect a
878 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc
RD
879 """
880 def __repr__(self):
881 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
882 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
883 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
d55e5bfc
RD
884 def __init__(self, *args, **kwargs):
885 """
5b5c9bc7 886 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
887
888 Create a wx.RealPoint object
889 """
5b5c9bc7 890 newobj = _core_.new_RealPoint(*args, **kwargs)
d55e5bfc
RD
891 self.this = newobj.this
892 self.thisown = 1
893 del newobj.thisown
5b5c9bc7 894 def __del__(self, destroy=_core_.delete_RealPoint):
d55e5bfc
RD
895 """__del__(self)"""
896 try:
897 if self.thisown: destroy(self)
898 except: pass
899
900 def __eq__(*args, **kwargs):
901 """
5b5c9bc7 902 __eq__(self, RealPoint pt) -> bool
d55e5bfc
RD
903
904 Test for equality of wx.RealPoint objects.
905 """
5b5c9bc7 906 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
907
908 def __ne__(*args, **kwargs):
909 """
5b5c9bc7 910 __ne__(self, RealPoint pt) -> bool
d55e5bfc
RD
911
912 Test for inequality of wx.RealPoint objects.
913 """
5b5c9bc7 914 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
915
916 def __add__(*args, **kwargs):
917 """
5b5c9bc7 918 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
919
920 Add pt's proprties to this and return the result.
921 """
5b5c9bc7 922 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
923
924 def __sub__(*args, **kwargs):
925 """
5b5c9bc7 926 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
927
928 Subtract pt's proprties from this and return the result
929 """
5b5c9bc7 930 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
931
932 def Set(*args, **kwargs):
933 """
934 Set(self, double x, double y)
935
936 Set both the x and y properties
937 """
5b5c9bc7 938 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
939
940 def Get(*args, **kwargs):
941 """
942 Get() -> (x,y)
943
944 Return the x and y properties as a tuple.
945 """
5b5c9bc7 946 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 947
15817c7e 948 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
949 def __str__(self): return str(self.Get())
950 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
951 def __len__(self): return len(self.Get())
952 def __getitem__(self, index): return self.Get()[index]
953 def __setitem__(self, index, val):
954 if index == 0: self.x = val
955 elif index == 1: self.y = val
956 else: raise IndexError
957 def __nonzero__(self): return self.Get() != (0.0, 0.0)
958 __safe_for_unpickling__ = True
959 def __reduce__(self): return (wx.RealPoint, self.Get())
960
961
5b5c9bc7 962class RealPointPtr(RealPoint):
d55e5bfc
RD
963 def __init__(self, this):
964 self.this = this
965 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
966 self.__class__ = RealPoint
967_core_.RealPoint_swigregister(RealPointPtr)
d55e5bfc
RD
968
969#---------------------------------------------------------------------------
970
5b5c9bc7 971class Point(object):
d55e5bfc 972 """
15817c7e
RD
973 A data structure for representing a point or position with integer x
974 and y properties. Most places in wxPython that expect a wx.Point can
975 also accept a (x,y) tuple.
d55e5bfc
RD
976 """
977 def __repr__(self):
978 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
979 x = property(_core_.Point_x_get, _core_.Point_x_set)
980 y = property(_core_.Point_y_get, _core_.Point_y_set)
d55e5bfc
RD
981 def __init__(self, *args, **kwargs):
982 """
5b5c9bc7 983 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
984
985 Create a wx.Point object
986 """
5b5c9bc7 987 newobj = _core_.new_Point(*args, **kwargs)
d55e5bfc
RD
988 self.this = newobj.this
989 self.thisown = 1
990 del newobj.thisown
5b5c9bc7 991 def __del__(self, destroy=_core_.delete_Point):
d55e5bfc
RD
992 """__del__(self)"""
993 try:
994 if self.thisown: destroy(self)
995 except: pass
996
997 def __eq__(*args, **kwargs):
998 """
5b5c9bc7 999 __eq__(self, Point pt) -> bool
d55e5bfc
RD
1000
1001 Test for equality of wx.Point objects.
1002 """
5b5c9bc7 1003 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1004
1005 def __ne__(*args, **kwargs):
1006 """
5b5c9bc7 1007 __ne__(self, Point pt) -> bool
d55e5bfc
RD
1008
1009 Test for inequality of wx.Point objects.
1010 """
5b5c9bc7 1011 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1012
1013 def __add__(*args, **kwargs):
1014 """
5b5c9bc7 1015 __add__(self, Point pt) -> Point
d55e5bfc
RD
1016
1017 Add pt's proprties to this and return the result.
1018 """
5b5c9bc7 1019 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1020
1021 def __sub__(*args, **kwargs):
1022 """
5b5c9bc7 1023 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1024
1025 Subtract pt's proprties from this and return the result
1026 """
5b5c9bc7 1027 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1028
1029 def __iadd__(*args, **kwargs):
1030 """
5b5c9bc7 1031 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1032
1033 Add pt to this object.
1034 """
5b5c9bc7 1035 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1036
1037 def __isub__(*args, **kwargs):
1038 """
5b5c9bc7 1039 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1040
1041 Subtract pt from this object.
1042 """
5b5c9bc7 1043 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1044
1045 def Set(*args, **kwargs):
1046 """
1047 Set(self, long x, long y)
1048
1049 Set both the x and y properties
1050 """
5b5c9bc7 1051 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1052
1053 def Get(*args, **kwargs):
1054 """
1055 Get() -> (x,y)
1056
1057 Return the x and y properties as a tuple.
1058 """
5b5c9bc7 1059 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1060
15817c7e 1061 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1062 def __str__(self): return str(self.Get())
1063 def __repr__(self): return 'wx.Point'+str(self.Get())
1064 def __len__(self): return len(self.Get())
1065 def __getitem__(self, index): return self.Get()[index]
1066 def __setitem__(self, index, val):
1067 if index == 0: self.x = val
1068 elif index == 1: self.y = val
1069 else: raise IndexError
1070 def __nonzero__(self): return self.Get() != (0,0)
1071 __safe_for_unpickling__ = True
1072 def __reduce__(self): return (wx.Point, self.Get())
1073
1074
5b5c9bc7 1075class PointPtr(Point):
d55e5bfc
RD
1076 def __init__(self, this):
1077 self.this = this
1078 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1079 self.__class__ = Point
1080_core_.Point_swigregister(PointPtr)
d55e5bfc
RD
1081
1082#---------------------------------------------------------------------------
1083
5b5c9bc7 1084class Rect(object):
d55e5bfc 1085 """
15817c7e
RD
1086 A class for representing and manipulating rectangles. It has x, y,
1087 width and height properties. In wxPython most palces that expect a
1088 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc
RD
1089 """
1090 def __repr__(self):
1091 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1092 def __init__(self, *args, **kwargs):
1093 """
5b5c9bc7 1094 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1095
1096 Create a new Rect object.
1097 """
5b5c9bc7 1098 newobj = _core_.new_Rect(*args, **kwargs)
d55e5bfc
RD
1099 self.this = newobj.this
1100 self.thisown = 1
1101 del newobj.thisown
5b5c9bc7 1102 def __del__(self, destroy=_core_.delete_Rect):
d55e5bfc
RD
1103 """__del__(self)"""
1104 try:
1105 if self.thisown: destroy(self)
1106 except: pass
1107
1108 def GetX(*args, **kwargs):
1109 """GetX(self) -> int"""
5b5c9bc7 1110 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1111
1112 def SetX(*args, **kwargs):
1113 """SetX(self, int x)"""
5b5c9bc7 1114 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1115
1116 def GetY(*args, **kwargs):
1117 """GetY(self) -> int"""
5b5c9bc7 1118 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1119
1120 def SetY(*args, **kwargs):
1121 """SetY(self, int y)"""
5b5c9bc7 1122 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1123
1124 def GetWidth(*args, **kwargs):
1125 """GetWidth(self) -> int"""
5b5c9bc7 1126 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1127
1128 def SetWidth(*args, **kwargs):
1129 """SetWidth(self, int w)"""
5b5c9bc7 1130 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1131
1132 def GetHeight(*args, **kwargs):
1133 """GetHeight(self) -> int"""
5b5c9bc7 1134 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1135
1136 def SetHeight(*args, **kwargs):
1137 """SetHeight(self, int h)"""
5b5c9bc7 1138 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1139
1140 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1141 """GetPosition(self) -> Point"""
1142 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1143
1144 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1145 """SetPosition(self, Point p)"""
1146 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1147
1148 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1149 """GetSize(self) -> Size"""
1150 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1151
1152 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1153 """SetSize(self, Size s)"""
1154 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1155
aff4cc5c
RD
1156 def IsEmpty(*args, **kwargs):
1157 """IsEmpty(self) -> bool"""
5b5c9bc7 1158 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1159
d55e5bfc 1160 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1161 """GetTopLeft(self) -> Point"""
1162 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1163
1164 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1165 """SetTopLeft(self, Point p)"""
1166 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1167
1168 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1169 """GetBottomRight(self) -> Point"""
1170 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1171
1172 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1173 """SetBottomRight(self, Point p)"""
1174 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc
RD
1175
1176 def GetLeft(*args, **kwargs):
1177 """GetLeft(self) -> int"""
5b5c9bc7 1178 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1179
1180 def GetTop(*args, **kwargs):
1181 """GetTop(self) -> int"""
5b5c9bc7 1182 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1183
1184 def GetBottom(*args, **kwargs):
1185 """GetBottom(self) -> int"""
5b5c9bc7 1186 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1187
1188 def GetRight(*args, **kwargs):
1189 """GetRight(self) -> int"""
5b5c9bc7 1190 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1191
1192 def SetLeft(*args, **kwargs):
1193 """SetLeft(self, int left)"""
5b5c9bc7 1194 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1195
1196 def SetRight(*args, **kwargs):
1197 """SetRight(self, int right)"""
5b5c9bc7 1198 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1199
1200 def SetTop(*args, **kwargs):
1201 """SetTop(self, int top)"""
5b5c9bc7 1202 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1203
1204 def SetBottom(*args, **kwargs):
1205 """SetBottom(self, int bottom)"""
5b5c9bc7 1206 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
1207
1208 position = property(GetPosition, SetPosition)
1209 size = property(GetSize, SetSize)
1210 left = property(GetLeft, SetLeft)
1211 right = property(GetRight, SetRight)
1212 top = property(GetTop, SetTop)
1213 bottom = property(GetBottom, SetBottom)
1214
1215 def Inflate(*args, **kwargs):
1216 """
5b5c9bc7 1217 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1218
091fdbfa
RD
1219 Increases the size of the rectangle.
1220
1221 The left border is moved farther left and the right border is moved
1222 farther right by ``dx``. The upper border is moved farther up and the
1223 bottom border is moved farther down by ``dy``. (Note the the width and
1224 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1225 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1226 opposite happens: the rectangle size decreases in the respective
1227 direction.
1228
1229 The change is made to the rectangle inplace, if instead you need a
1230 copy that is inflated, preserving the original then make the copy
1231 first::
1232
1233 copy = wx.Rect(*original)
1234 copy.Inflate(10,15)
1235
1236
d55e5bfc 1237 """
5b5c9bc7 1238 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1239
1240 def Deflate(*args, **kwargs):
1241 """
5b5c9bc7 1242 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1243
091fdbfa
RD
1244 Decrease the rectangle size. This method is the opposite of `Inflate`
1245 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1246 `Inflate` for a full description.
d55e5bfc 1247 """
5b5c9bc7 1248 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1249
1250 def OffsetXY(*args, **kwargs):
1251 """
1252 OffsetXY(self, int dx, int dy)
1253
15817c7e
RD
1254 Moves the rectangle by the specified offset. If dx is positive, the
1255 rectangle is moved to the right, if dy is positive, it is moved to the
1256 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc 1257 """
5b5c9bc7 1258 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1259
1260 def Offset(*args, **kwargs):
1261 """
5b5c9bc7 1262 Offset(self, Point pt)
d55e5bfc
RD
1263
1264 Same as OffsetXY but uses dx,dy from Point
1265 """
5b5c9bc7 1266 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1267
1268 def Intersect(*args, **kwargs):
1269 """
5b5c9bc7 1270 Intersect(self, Rect rect) -> Rect
d55e5bfc 1271
5cbf236d 1272 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1273 """
5b5c9bc7 1274 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1275
5cbf236d
RD
1276 def Union(*args, **kwargs):
1277 """
5b5c9bc7 1278 Union(self, Rect rect) -> Rect
5cbf236d
RD
1279
1280 Returns the union of this rectangle and rect.
1281 """
5b5c9bc7 1282 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1283
d55e5bfc
RD
1284 def __add__(*args, **kwargs):
1285 """
5b5c9bc7 1286 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1287
1288 Add the properties of rect to this rectangle and return the result.
1289 """
5b5c9bc7 1290 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1291
1292 def __iadd__(*args, **kwargs):
1293 """
5b5c9bc7 1294 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1295
1296 Add the properties of rect to this rectangle, updating this rectangle.
1297 """
5b5c9bc7 1298 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1299
1300 def __eq__(*args, **kwargs):
1301 """
5b5c9bc7 1302 __eq__(self, Rect rect) -> bool
d55e5bfc
RD
1303
1304 Test for equality.
1305 """
5b5c9bc7 1306 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1307
1308 def __ne__(*args, **kwargs):
1309 """
5b5c9bc7 1310 __ne__(self, Rect rect) -> bool
d55e5bfc
RD
1311
1312 Test for inequality.
1313 """
5b5c9bc7 1314 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc
RD
1315
1316 def InsideXY(*args, **kwargs):
1317 """
1318 InsideXY(self, int x, int y) -> bool
1319
1320 Return True if the point is (not strcitly) inside the rect.
1321 """
5b5c9bc7 1322 return _core_.Rect_InsideXY(*args, **kwargs)
d55e5bfc
RD
1323
1324 def Inside(*args, **kwargs):
1325 """
5b5c9bc7 1326 Inside(self, Point pt) -> bool
d55e5bfc
RD
1327
1328 Return True if the point is (not strcitly) inside the rect.
1329 """
5b5c9bc7 1330 return _core_.Rect_Inside(*args, **kwargs)
d55e5bfc
RD
1331
1332 def Intersects(*args, **kwargs):
1333 """
5b5c9bc7 1334 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1335
1336 Returns True if the rectangles have a non empty intersection.
1337 """
5b5c9bc7 1338 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1339
5b5c9bc7
RD
1340 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1341 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1342 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1343 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
d55e5bfc
RD
1344 def Set(*args, **kwargs):
1345 """
1346 Set(self, int x=0, int y=0, int width=0, int height=0)
1347
1348 Set all rectangle properties.
1349 """
5b5c9bc7 1350 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1351
1352 def Get(*args, **kwargs):
1353 """
1354 Get() -> (x,y,width,height)
1355
1356 Return the rectangle properties as a tuple.
1357 """
5b5c9bc7 1358 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1359
15817c7e 1360 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1361 def __str__(self): return str(self.Get())
1362 def __repr__(self): return 'wx.Rect'+str(self.Get())
1363 def __len__(self): return len(self.Get())
1364 def __getitem__(self, index): return self.Get()[index]
1365 def __setitem__(self, index, val):
1366 if index == 0: self.x = val
1367 elif index == 1: self.y = val
1368 elif index == 2: self.width = val
1369 elif index == 3: self.height = val
1370 else: raise IndexError
1371 def __nonzero__(self): return self.Get() != (0,0,0,0)
1372 __safe_for_unpickling__ = True
1373 def __reduce__(self): return (wx.Rect, self.Get())
1374
1375
5b5c9bc7 1376class RectPtr(Rect):
d55e5bfc
RD
1377 def __init__(self, this):
1378 self.this = this
1379 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1380 self.__class__ = Rect
1381_core_.Rect_swigregister(RectPtr)
d55e5bfc
RD
1382
1383def RectPP(*args, **kwargs):
1384 """
5b5c9bc7 1385 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1386
1387 Create a new Rect object from Points representing two corners.
1388 """
5b5c9bc7 1389 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1390 val.thisown = 1
1391 return val
1392
1393def RectPS(*args, **kwargs):
1394 """
5b5c9bc7 1395 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1396
1397 Create a new Rect from a position and size.
1398 """
5b5c9bc7 1399 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1400 val.thisown = 1
1401 return val
1402
070c48b4
RD
1403def RectS(*args, **kwargs):
1404 """
5b5c9bc7 1405 RectS(Size size) -> Rect
070c48b4
RD
1406
1407 Create a new Rect from a size only.
1408 """
5b5c9bc7 1409 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1410 val.thisown = 1
1411 return val
1412
d55e5bfc 1413
5b5c9bc7 1414def IntersectRect(*args, **kwargs):
d55e5bfc
RD
1415 """
1416 IntersectRect(Rect r1, Rect r2) -> Rect
1417
1418 Calculate and return the intersection of r1 and r2.
1419 """
5b5c9bc7 1420 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1421#---------------------------------------------------------------------------
1422
5b5c9bc7 1423class Point2D(object):
15817c7e
RD
1424 """
1425 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1426 with floating point values.
1427 """
d55e5bfc
RD
1428 def __repr__(self):
1429 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1430 def __init__(self, *args, **kwargs):
1431 """
5b5c9bc7 1432 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1433
1434 Create a w.Point2D object.
1435 """
5b5c9bc7 1436 newobj = _core_.new_Point2D(*args, **kwargs)
d55e5bfc
RD
1437 self.this = newobj.this
1438 self.thisown = 1
1439 del newobj.thisown
1440 def GetFloor(*args, **kwargs):
fd2dc343
RD
1441 """
1442 GetFloor() -> (x,y)
1443
1444 Convert to integer
1445 """
5b5c9bc7 1446 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1447
1448 def GetRounded(*args, **kwargs):
fd2dc343
RD
1449 """
1450 GetRounded() -> (x,y)
1451
1452 Convert to integer
1453 """
5b5c9bc7 1454 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1455
1456 def GetVectorLength(*args, **kwargs):
1457 """GetVectorLength(self) -> double"""
5b5c9bc7 1458 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1459
1460 def GetVectorAngle(*args, **kwargs):
1461 """GetVectorAngle(self) -> double"""
5b5c9bc7 1462 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1463
1464 def SetVectorLength(*args, **kwargs):
1465 """SetVectorLength(self, double length)"""
5b5c9bc7 1466 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1467
1468 def SetVectorAngle(*args, **kwargs):
1469 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1470 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1471
1472 def SetPolarCoordinates(self, angle, length):
1473 self.SetVectorLength(length)
1474 self.SetVectorAngle(angle)
1475 def Normalize(self):
1476 self.SetVectorLength(1.0)
1477
1478 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1479 """GetDistance(self, Point2D pt) -> double"""
1480 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1481
1482 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1483 """GetDistanceSquare(self, Point2D pt) -> double"""
1484 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1485
1486 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1487 """GetDotProduct(self, Point2D vec) -> double"""
1488 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1489
1490 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1491 """GetCrossProduct(self, Point2D vec) -> double"""
1492 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1493
1494 def __neg__(*args, **kwargs):
1495 """
5b5c9bc7 1496 __neg__(self) -> Point2D
d55e5bfc
RD
1497
1498 the reflection of this point
1499 """
5b5c9bc7 1500 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1501
1502 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1503 """__iadd__(self, Point2D pt) -> Point2D"""
1504 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1505
1506 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1507 """__isub__(self, Point2D pt) -> Point2D"""
1508 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1509
1510 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1511 """__imul__(self, Point2D pt) -> Point2D"""
1512 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1513
1514 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1515 """__idiv__(self, Point2D pt) -> Point2D"""
1516 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1517
1518 def __eq__(*args, **kwargs):
1519 """
5b5c9bc7 1520 __eq__(self, Point2D pt) -> bool
d55e5bfc
RD
1521
1522 Test for equality
1523 """
5b5c9bc7 1524 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1525
1526 def __ne__(*args, **kwargs):
1527 """
5b5c9bc7 1528 __ne__(self, Point2D pt) -> bool
d55e5bfc
RD
1529
1530 Test for inequality
1531 """
5b5c9bc7 1532 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1533
5b5c9bc7
RD
1534 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1535 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1536 def Set(*args, **kwargs):
1537 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1538 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1539
1540 def Get(*args, **kwargs):
1541 """
1542 Get() -> (x,y)
1543
1544 Return x and y properties as a tuple.
1545 """
5b5c9bc7 1546 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1547
15817c7e 1548 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1549 def __str__(self): return str(self.Get())
1550 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1551 def __len__(self): return len(self.Get())
1552 def __getitem__(self, index): return self.Get()[index]
1553 def __setitem__(self, index, val):
1554 if index == 0: self.x = val
1555 elif index == 1: self.y = val
1556 else: raise IndexError
1557 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1558 __safe_for_unpickling__ = True
1559 def __reduce__(self): return (wx.Point2D, self.Get())
1560
1561
5b5c9bc7 1562class Point2DPtr(Point2D):
d55e5bfc
RD
1563 def __init__(self, this):
1564 self.this = this
1565 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1566 self.__class__ = Point2D
1567_core_.Point2D_swigregister(Point2DPtr)
d55e5bfc
RD
1568
1569def Point2DCopy(*args, **kwargs):
1570 """
5b5c9bc7 1571 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1572
1573 Create a w.Point2D object.
1574 """
5b5c9bc7 1575 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1576 val.thisown = 1
1577 return val
1578
1579def Point2DFromPoint(*args, **kwargs):
1580 """
5b5c9bc7 1581 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1582
1583 Create a w.Point2D object.
1584 """
5b5c9bc7 1585 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1586 val.thisown = 1
1587 return val
1588
1589#---------------------------------------------------------------------------
1590
5b5c9bc7
RD
1591FromStart = _core_.FromStart
1592FromCurrent = _core_.FromCurrent
1593FromEnd = _core_.FromEnd
d55e5bfc 1594class InputStream(object):
36ed4f51 1595 """Proxy of C++ InputStream class"""
d55e5bfc
RD
1596 def __repr__(self):
1597 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1598 def __init__(self, *args, **kwargs):
1599 """__init__(self, PyObject p) -> InputStream"""
5b5c9bc7 1600 newobj = _core_.new_InputStream(*args, **kwargs)
d55e5bfc
RD
1601 self.this = newobj.this
1602 self.thisown = 1
1603 del newobj.thisown
5b5c9bc7 1604 def __del__(self, destroy=_core_.delete_InputStream):
8fb0e70a
RD
1605 """__del__(self)"""
1606 try:
1607 if self.thisown: destroy(self)
1608 except: pass
1609
d55e5bfc
RD
1610 def close(*args, **kwargs):
1611 """close(self)"""
5b5c9bc7 1612 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1613
1614 def flush(*args, **kwargs):
1615 """flush(self)"""
5b5c9bc7 1616 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1617
1618 def eof(*args, **kwargs):
1619 """eof(self) -> bool"""
5b5c9bc7 1620 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1621
1622 def read(*args, **kwargs):
1623 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1624 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1625
1626 def readline(*args, **kwargs):
1627 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1628 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1629
1630 def readlines(*args, **kwargs):
1631 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1632 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1633
1634 def seek(*args, **kwargs):
1635 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1636 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1637
1638 def tell(*args, **kwargs):
1639 """tell(self) -> int"""
5b5c9bc7 1640 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1641
1642 def Peek(*args, **kwargs):
1643 """Peek(self) -> char"""
5b5c9bc7 1644 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1645
1646 def GetC(*args, **kwargs):
1647 """GetC(self) -> char"""
5b5c9bc7 1648 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1649
1650 def LastRead(*args, **kwargs):
1651 """LastRead(self) -> size_t"""
5b5c9bc7 1652 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1653
1654 def CanRead(*args, **kwargs):
1655 """CanRead(self) -> bool"""
5b5c9bc7 1656 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1657
1658 def Eof(*args, **kwargs):
1659 """Eof(self) -> bool"""
5b5c9bc7 1660 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1661
1662 def Ungetch(*args, **kwargs):
1663 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1664 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1665
1666 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1667 """SeekI(self, long pos, int mode=FromStart) -> long"""
1668 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1669
1670 def TellI(*args, **kwargs):
1671 """TellI(self) -> long"""
5b5c9bc7 1672 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc
RD
1673
1674
1675class InputStreamPtr(InputStream):
1676 def __init__(self, this):
1677 self.this = this
1678 if not hasattr(self,"thisown"): self.thisown = 0
1679 self.__class__ = InputStream
5b5c9bc7
RD
1680_core_.InputStream_swigregister(InputStreamPtr)
1681DefaultPosition = cvar.DefaultPosition
1682DefaultSize = cvar.DefaultSize
d55e5bfc 1683
5b5c9bc7
RD
1684class OutputStream(object):
1685 """Proxy of C++ OutputStream class"""
d55e5bfc
RD
1686 def __init__(self): raise RuntimeError, "No constructor defined"
1687 def __repr__(self):
1688 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1689 def write(*args, **kwargs):
1690 """write(self, PyObject obj)"""
5b5c9bc7 1691 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc
RD
1692
1693
5b5c9bc7 1694class OutputStreamPtr(OutputStream):
d55e5bfc
RD
1695 def __init__(self, this):
1696 self.this = this
1697 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1698 self.__class__ = OutputStream
1699_core_.OutputStream_swigregister(OutputStreamPtr)
d55e5bfc
RD
1700
1701#---------------------------------------------------------------------------
1702
5b5c9bc7
RD
1703class FSFile(Object):
1704 """Proxy of C++ FSFile class"""
d55e5bfc
RD
1705 def __repr__(self):
1706 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1707 def __init__(self, *args, **kwargs):
1708 """
5b5c9bc7
RD
1709 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1710 DateTime modif) -> FSFile
d55e5bfc 1711 """
5b5c9bc7 1712 newobj = _core_.new_FSFile(*args, **kwargs)
d55e5bfc
RD
1713 self.this = newobj.this
1714 self.thisown = 1
1715 del newobj.thisown
e2950dbb 1716 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1717
5b5c9bc7 1718 def __del__(self, destroy=_core_.delete_FSFile):
d55e5bfc
RD
1719 """__del__(self)"""
1720 try:
1721 if self.thisown: destroy(self)
1722 except: pass
1723
1724 def GetStream(*args, **kwargs):
5b5c9bc7
RD
1725 """GetStream(self) -> InputStream"""
1726 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc
RD
1727
1728 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1729 """GetMimeType(self) -> String"""
1730 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1731
1732 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
1733 """GetLocation(self) -> String"""
1734 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
1735
1736 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1737 """GetAnchor(self) -> String"""
1738 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1739
1740 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
1741 """GetModificationTime(self) -> DateTime"""
1742 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc
RD
1743
1744
5b5c9bc7 1745class FSFilePtr(FSFile):
d55e5bfc
RD
1746 def __init__(self, this):
1747 self.this = this
1748 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1749 self.__class__ = FSFile
1750_core_.FSFile_swigregister(FSFilePtr)
d55e5bfc
RD
1751
1752class CPPFileSystemHandler(object):
36ed4f51 1753 """Proxy of C++ CPPFileSystemHandler class"""
d55e5bfc
RD
1754 def __init__(self): raise RuntimeError, "No constructor defined"
1755 def __repr__(self):
1756 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1757
1758class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1759 def __init__(self, this):
1760 self.this = this
1761 if not hasattr(self,"thisown"): self.thisown = 0
1762 self.__class__ = CPPFileSystemHandler
5b5c9bc7 1763_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
d55e5bfc
RD
1764
1765class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1766 """Proxy of C++ FileSystemHandler class"""
d55e5bfc
RD
1767 def __repr__(self):
1768 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1769 def __init__(self, *args, **kwargs):
1770 """__init__(self) -> FileSystemHandler"""
5b5c9bc7 1771 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
d55e5bfc
RD
1772 self.this = newobj.this
1773 self.thisown = 1
1774 del newobj.thisown
1775 self._setCallbackInfo(self, FileSystemHandler)
1776
1777 def _setCallbackInfo(*args, **kwargs):
1778 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 1779 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
1780
1781 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1782 """CanOpen(self, String location) -> bool"""
1783 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1784
1785 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1786 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1787 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1788
1789 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1790 """FindFirst(self, String spec, int flags=0) -> String"""
1791 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1792
1793 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1794 """FindNext(self) -> String"""
1795 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1796
1797 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
1798 """GetProtocol(self, String location) -> String"""
1799 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
1800
1801 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
1802 """GetLeftLocation(self, String location) -> String"""
1803 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
1804
1805 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1806 """GetAnchor(self, String location) -> String"""
1807 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1808
1809 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
1810 """GetRightLocation(self, String location) -> String"""
1811 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
1812
1813 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
1814 """GetMimeTypeFromExt(self, String location) -> String"""
1815 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc
RD
1816
1817
1818class FileSystemHandlerPtr(FileSystemHandler):
1819 def __init__(self, this):
1820 self.this = this
1821 if not hasattr(self,"thisown"): self.thisown = 0
1822 self.__class__ = FileSystemHandler
5b5c9bc7 1823_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
d55e5bfc 1824
5b5c9bc7
RD
1825class FileSystem(Object):
1826 """Proxy of C++ FileSystem class"""
d55e5bfc
RD
1827 def __repr__(self):
1828 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1829 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1830 """__init__(self) -> FileSystem"""
1831 newobj = _core_.new_FileSystem(*args, **kwargs)
d55e5bfc
RD
1832 self.this = newobj.this
1833 self.thisown = 1
1834 del newobj.thisown
5b5c9bc7 1835 def __del__(self, destroy=_core_.delete_FileSystem):
d55e5bfc
RD
1836 """__del__(self)"""
1837 try:
1838 if self.thisown: destroy(self)
1839 except: pass
1840
1841 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
1842 """ChangePathTo(self, String location, bool is_dir=False)"""
1843 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
1844
1845 def GetPath(*args, **kwargs):
5b5c9bc7
RD
1846 """GetPath(self) -> String"""
1847 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
1848
1849 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1850 """OpenFile(self, String location) -> FSFile"""
1851 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
1852
1853 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1854 """FindFirst(self, String spec, int flags=0) -> String"""
1855 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
1856
1857 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1858 """FindNext(self) -> String"""
1859 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
1860
1861 def AddHandler(*args, **kwargs):
d6c14a4c 1862 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 1863 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
1864
1865 AddHandler = staticmethod(AddHandler)
1866 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1867 """CleanUpHandlers()"""
5b5c9bc7 1868 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
1869
1870 CleanUpHandlers = staticmethod(CleanUpHandlers)
1871 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
1872 """FileNameToURL(String filename) -> String"""
1873 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
1874
1875 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 1876 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
1877 """URLToFileName(String url) -> String"""
1878 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
1879
1880 URLToFileName = staticmethod(URLToFileName)
d55e5bfc 1881
5b5c9bc7 1882class FileSystemPtr(FileSystem):
d55e5bfc
RD
1883 def __init__(self, this):
1884 self.this = this
1885 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1886 self.__class__ = FileSystem
1887_core_.FileSystem_swigregister(FileSystemPtr)
d55e5bfc 1888
5b5c9bc7
RD
1889def FileSystem_AddHandler(*args, **kwargs):
1890 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1891 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1892
5b5c9bc7
RD
1893def FileSystem_CleanUpHandlers(*args, **kwargs):
1894 """FileSystem_CleanUpHandlers()"""
1895 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc 1896
5b5c9bc7
RD
1897def FileSystem_FileNameToURL(*args, **kwargs):
1898 """FileSystem_FileNameToURL(String filename) -> String"""
1899 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1900
5b5c9bc7
RD
1901def FileSystem_URLToFileName(*args, **kwargs):
1902 """FileSystem_URLToFileName(String url) -> String"""
1903 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1904
5b5c9bc7
RD
1905class InternetFSHandler(CPPFileSystemHandler):
1906 """Proxy of C++ InternetFSHandler class"""
d55e5bfc
RD
1907 def __repr__(self):
1908 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1909 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1910 """__init__(self) -> InternetFSHandler"""
1911 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
d55e5bfc
RD
1912 self.this = newobj.this
1913 self.thisown = 1
1914 del newobj.thisown
1915 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1916 """CanOpen(self, String location) -> bool"""
1917 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1918
1919 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1920 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1921 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1922
1923
5b5c9bc7 1924class InternetFSHandlerPtr(InternetFSHandler):
d55e5bfc
RD
1925 def __init__(self, this):
1926 self.this = this
1927 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1928 self.__class__ = InternetFSHandler
1929_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
d55e5bfc 1930
5b5c9bc7
RD
1931class ZipFSHandler(CPPFileSystemHandler):
1932 """Proxy of C++ ZipFSHandler class"""
d55e5bfc
RD
1933 def __repr__(self):
1934 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1935 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1936 """__init__(self) -> ZipFSHandler"""
1937 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
d55e5bfc
RD
1938 self.this = newobj.this
1939 self.thisown = 1
1940 del newobj.thisown
1941 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1942 """CanOpen(self, String location) -> bool"""
1943 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1944
1945 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1946 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1947 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1948
1949 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1950 """FindFirst(self, String spec, int flags=0) -> String"""
1951 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1952
1953 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1954 """FindNext(self) -> String"""
1955 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1956
1957
5b5c9bc7 1958class ZipFSHandlerPtr(ZipFSHandler):
d55e5bfc
RD
1959 def __init__(self, this):
1960 self.this = this
1961 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1962 self.__class__ = ZipFSHandler
1963_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
d55e5bfc
RD
1964
1965
1966def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
5b5c9bc7
RD
1967 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1968 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1969
1970def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
5b5c9bc7
RD
1971 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1972 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1973
1974def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
5b5c9bc7
RD
1975 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1976 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
1977def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1978 """
1979 Add 'file' to the memory filesystem. The dataItem parameter can
1980 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1981 arbitrary data. If a bitmap or image is used then the imgType
1982 parameter should specify what kind of image file it should be
1983 written as, wx.BITMAP_TYPE_PNG, etc.
1984 """
1985 if isinstance(dataItem, wx.Image):
1986 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1987 elif isinstance(dataItem, wx.Bitmap):
1988 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1989 elif type(dataItem) == str:
1990 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1991 else:
1992 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc 1993
5b5c9bc7
RD
1994class MemoryFSHandler(CPPFileSystemHandler):
1995 """Proxy of C++ MemoryFSHandler class"""
d55e5bfc
RD
1996 def __repr__(self):
1997 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1998 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1999 """__init__(self) -> MemoryFSHandler"""
2000 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
d55e5bfc
RD
2001 self.this = newobj.this
2002 self.thisown = 1
2003 del newobj.thisown
2004 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
2005 """RemoveFile(String filename)"""
2006 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
2007
2008 RemoveFile = staticmethod(RemoveFile)
2009 AddFile = staticmethod(MemoryFSHandler_AddFile)
2010 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2011 """CanOpen(self, String location) -> bool"""
2012 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2013
2014 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2015 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2016 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2017
2018 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2019 """FindFirst(self, String spec, int flags=0) -> String"""
2020 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2021
2022 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2023 """FindNext(self) -> String"""
2024 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
2025
2026
5b5c9bc7 2027class MemoryFSHandlerPtr(MemoryFSHandler):
d55e5bfc
RD
2028 def __init__(self, this):
2029 self.this = this
2030 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2031 self.__class__ = MemoryFSHandler
2032_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
d55e5bfc 2033
5b5c9bc7
RD
2034def MemoryFSHandler_RemoveFile(*args, **kwargs):
2035 """MemoryFSHandler_RemoveFile(String filename)"""
2036 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 2037
5b5c9bc7
RD
2038IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2039IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2040IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
2041#---------------------------------------------------------------------------
2042
5b5c9bc7
RD
2043class ImageHandler(Object):
2044 """Proxy of C++ ImageHandler class"""
d55e5bfc
RD
2045 def __init__(self): raise RuntimeError, "No constructor defined"
2046 def __repr__(self):
2047 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2048 def GetName(*args, **kwargs):
5b5c9bc7
RD
2049 """GetName(self) -> String"""
2050 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
2051
2052 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
2053 """GetExtension(self) -> String"""
2054 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
2055
2056 def GetType(*args, **kwargs):
2057 """GetType(self) -> long"""
5b5c9bc7 2058 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
2059
2060 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
2061 """GetMimeType(self) -> String"""
2062 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
2063
2064 def CanRead(*args, **kwargs):
5b5c9bc7
RD
2065 """CanRead(self, String name) -> bool"""
2066 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc
RD
2067
2068 def SetName(*args, **kwargs):
5b5c9bc7
RD
2069 """SetName(self, String name)"""
2070 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
2071
2072 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2073 """SetExtension(self, String extension)"""
2074 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2075
2076 def SetType(*args, **kwargs):
2077 """SetType(self, long type)"""
5b5c9bc7 2078 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2079
2080 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2081 """SetMimeType(self, String mimetype)"""
2082 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc
RD
2083
2084
5b5c9bc7 2085class ImageHandlerPtr(ImageHandler):
d55e5bfc
RD
2086 def __init__(self, this):
2087 self.this = this
2088 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2089 self.__class__ = ImageHandler
2090_core_.ImageHandler_swigregister(ImageHandlerPtr)
d55e5bfc 2091
5b5c9bc7
RD
2092class ImageHistogram(object):
2093 """Proxy of C++ ImageHistogram class"""
d55e5bfc
RD
2094 def __repr__(self):
2095 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2096 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2097 """__init__(self) -> ImageHistogram"""
2098 newobj = _core_.new_ImageHistogram(*args, **kwargs)
d55e5bfc
RD
2099 self.this = newobj.this
2100 self.thisown = 1
2101 del newobj.thisown
2102 def MakeKey(*args, **kwargs):
2103 """
d6c14a4c 2104 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
d55e5bfc
RD
2105
2106 Get the key in the histogram for the given RGB values
2107 """
5b5c9bc7 2108 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2109
2110 MakeKey = staticmethod(MakeKey)
2111 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2112 """
2113 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2114
2115 Find first colour that is not used in the image and has higher RGB
2116 values than startR, startG, startB. Returns a tuple consisting of a
2117 success flag and rgb values.
2118 """
5b5c9bc7 2119 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2120
f1cbd8fa
RD
2121 def GetCount(*args, **kwargs):
2122 """
2123 GetCount(self, unsigned long key) -> unsigned long
2124
2125 Returns the pixel count for the given key. Use `MakeKey` to create a
2126 key value from a RGB tripple.
2127 """
5b5c9bc7 2128 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2129
2130 def GetCountRGB(*args, **kwargs):
2131 """
2132 GetCountRGB(self, unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2133
2134 Returns the pixel count for the given RGB values.
2135 """
5b5c9bc7 2136 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2137
2138 def GetCountColour(*args, **kwargs):
2139 """
5b5c9bc7 2140 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2141
2142 Returns the pixel count for the given `wx.Colour` value.
2143 """
5b5c9bc7 2144 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2145
d55e5bfc 2146
5b5c9bc7 2147class ImageHistogramPtr(ImageHistogram):
d55e5bfc
RD
2148 def __init__(self, this):
2149 self.this = this
2150 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2151 self.__class__ = ImageHistogram
2152_core_.ImageHistogram_swigregister(ImageHistogramPtr)
d55e5bfc 2153
5b5c9bc7 2154def ImageHistogram_MakeKey(*args, **kwargs):
d55e5bfc 2155 """
5b5c9bc7 2156 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
d55e5bfc
RD
2157
2158 Get the key in the histogram for the given RGB values
2159 """
5b5c9bc7 2160 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2161
5b5c9bc7
RD
2162class Image(Object):
2163 """Proxy of C++ Image class"""
d55e5bfc
RD
2164 def __repr__(self):
2165 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2166 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2167 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2168 newobj = _core_.new_Image(*args, **kwargs)
d55e5bfc
RD
2169 self.this = newobj.this
2170 self.thisown = 1
2171 del newobj.thisown
5b5c9bc7 2172 def __del__(self, destroy=_core_.delete_Image):
d55e5bfc
RD
2173 """__del__(self)"""
2174 try:
2175 if self.thisown: destroy(self)
2176 except: pass
2177
2178 def Create(*args, **kwargs):
2179 """Create(self, int width, int height)"""
5b5c9bc7 2180 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2181
2182 def Destroy(*args, **kwargs):
2183 """
2184 Destroy(self)
2185
2186 Deletes the C++ object this Python object is a proxy for.
2187 """
5b5c9bc7 2188 return _core_.Image_Destroy(*args, **kwargs)
d55e5bfc
RD
2189
2190 def Scale(*args, **kwargs):
5b5c9bc7
RD
2191 """Scale(self, int width, int height) -> Image"""
2192 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc
RD
2193
2194 def ShrinkBy(*args, **kwargs):
5b5c9bc7
RD
2195 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
2196 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
2197
2198 def Rescale(*args, **kwargs):
5b5c9bc7
RD
2199 """Rescale(self, int width, int height) -> Image"""
2200 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 2201
aff4cc5c 2202 def Resize(*args, **kwargs):
5b5c9bc7
RD
2203 """Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image"""
2204 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 2205
d55e5bfc
RD
2206 def SetRGB(*args, **kwargs):
2207 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
5b5c9bc7 2208 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 2209
aff4cc5c 2210 def SetRGBRect(*args, **kwargs):
5b5c9bc7
RD
2211 """SetRGBRect(self, Rect rect, unsigned char r, unsigned char g, unsigned char b)"""
2212 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 2213
d55e5bfc
RD
2214 def GetRed(*args, **kwargs):
2215 """GetRed(self, int x, int y) -> unsigned char"""
5b5c9bc7 2216 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
2217
2218 def GetGreen(*args, **kwargs):
2219 """GetGreen(self, int x, int y) -> unsigned char"""
5b5c9bc7 2220 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
2221
2222 def GetBlue(*args, **kwargs):
2223 """GetBlue(self, int x, int y) -> unsigned char"""
5b5c9bc7 2224 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
2225
2226 def SetAlpha(*args, **kwargs):
2227 """SetAlpha(self, int x, int y, unsigned char alpha)"""
5b5c9bc7 2228 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
2229
2230 def GetAlpha(*args, **kwargs):
2231 """GetAlpha(self, int x, int y) -> unsigned char"""
5b5c9bc7 2232 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
2233
2234 def HasAlpha(*args, **kwargs):
2235 """HasAlpha(self) -> bool"""
5b5c9bc7 2236 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 2237
68350608
RD
2238 def InitAlpha(*args, **kwargs):
2239 """
2240 InitAlpha(self)
2241
2242 Initializes the image alpha channel data. It is an error to call it if
2243 the image already has alpha data. If it doesn't, alpha data will be by
2244 default initialized to all pixels being fully opaque. But if the image
2245 has a a mask colour, all mask pixels will be completely transparent.
2246 """
5b5c9bc7
RD
2247 return _core_.Image_InitAlpha(*args, **kwargs)
2248
2249 def IsTransparent(*args, **kwargs):
2250 """
2251 IsTransparent(self, int x, int y, unsigned char threshold=IMAGE_ALPHA_THRESHOLD) -> bool
2252
2253 Returns True if this pixel is masked or has an alpha value less than
2254 the spcified threshold.
2255 """
2256 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2257
d55e5bfc 2258 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2259 """
2260 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2261
2262 Find first colour that is not used in the image and has higher RGB
2263 values than startR, startG, startB. Returns a tuple consisting of a
2264 success flag and rgb values.
2265 """
5b5c9bc7 2266 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2267
4cf4100f
RD
2268 def ConvertAlphaToMask(*args, **kwargs):
2269 """
5b5c9bc7 2270 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f
RD
2271
2272 If the image has alpha channel, this method converts it to mask. All pixels
2273 with alpha value less than ``threshold`` are replaced with mask colour and the
2274 alpha channel is removed. Mask colour is chosen automatically using
2275 `FindFirstUnusedColour`.
2276
2277 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2278 nothing.
2279 """
5b5c9bc7 2280 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 2281
8fb0e70a
RD
2282 def ConvertColourToAlpha(*args, **kwargs):
2283 """
2284 ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool
2285
2286 This method converts an image where the original alpha information is
2287 only available as a shades of a colour (actually shades of grey)
2288 typically when you draw anti-aliased text into a bitmap. The DC
2289 drawing routines draw grey values on the black background although
2290 they actually mean to draw white with differnt alpha values. This
2291 method reverses it, assuming a black (!) background and white text.
2292 The method will then fill up the whole image with the colour given.
2293 """
5b5c9bc7 2294 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 2295
d55e5bfc 2296 def SetMaskFromImage(*args, **kwargs):
5b5c9bc7
RD
2297 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
2298 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
2299
2300 def CanRead(*args, **kwargs):
5b5c9bc7
RD
2301 """CanRead(String name) -> bool"""
2302 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2303
2304 CanRead = staticmethod(CanRead)
2305 def GetImageCount(*args, **kwargs):
5b5c9bc7
RD
2306 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2307 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2308
2309 GetImageCount = staticmethod(GetImageCount)
2310 def LoadFile(*args, **kwargs):
5b5c9bc7
RD
2311 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2312 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
2313
2314 def LoadMimeFile(*args, **kwargs):
5b5c9bc7
RD
2315 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
2316 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
2317
2318 def SaveFile(*args, **kwargs):
5b5c9bc7
RD
2319 """SaveFile(self, String name, int type) -> bool"""
2320 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
2321
2322 def SaveMimeFile(*args, **kwargs):
5b5c9bc7
RD
2323 """SaveMimeFile(self, String name, String mimetype) -> bool"""
2324 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
2325
2326 def CanReadStream(*args, **kwargs):
5b5c9bc7
RD
2327 """CanReadStream(InputStream stream) -> bool"""
2328 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2329
2330 CanReadStream = staticmethod(CanReadStream)
2331 def LoadStream(*args, **kwargs):
5b5c9bc7
RD
2332 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2333 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
2334
2335 def LoadMimeStream(*args, **kwargs):
5b5c9bc7
RD
2336 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
2337 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc
RD
2338
2339 def Ok(*args, **kwargs):
2340 """Ok(self) -> bool"""
5b5c9bc7 2341 return _core_.Image_Ok(*args, **kwargs)
d55e5bfc
RD
2342
2343 def GetWidth(*args, **kwargs):
2344 """GetWidth(self) -> int"""
5b5c9bc7 2345 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2346
2347 def GetHeight(*args, **kwargs):
2348 """GetHeight(self) -> int"""
5b5c9bc7 2349 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2350
2351 def GetSize(*args, **kwargs):
5b5c9bc7
RD
2352 """GetSize(self) -> Size"""
2353 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2354
2355 def GetSubImage(*args, **kwargs):
5b5c9bc7
RD
2356 """GetSubImage(self, Rect rect) -> Image"""
2357 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2358
aff4cc5c 2359 def Size(*args, **kwargs):
5b5c9bc7
RD
2360 """Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image"""
2361 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2362
d55e5bfc 2363 def Copy(*args, **kwargs):
5b5c9bc7
RD
2364 """Copy(self) -> Image"""
2365 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2366
2367 def Paste(*args, **kwargs):
5b5c9bc7
RD
2368 """Paste(self, Image image, int x, int y)"""
2369 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2370
2371 def GetData(*args, **kwargs):
bb2ef2cc
RD
2372 """
2373 GetData(self) -> PyObject
2374
2375 Returns a string containing a copy of the RGB bytes of the image.
2376 """
5b5c9bc7 2377 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2378
2379 def SetData(*args, **kwargs):
bb2ef2cc
RD
2380 """
2381 SetData(self, buffer data)
2382
2383 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2384 either a string or a buffer object holding the data and the length of
2385 the data must be width*height*3.
2386 """
5b5c9bc7 2387 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2388
2389 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2390 """
2391 GetDataBuffer(self) -> PyObject
2392
2393 Returns a writable Python buffer object that is pointing at the RGB
2394 image data buffer inside the wx.Image.
2395 """
5b5c9bc7 2396 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2397
2398 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2399 """
2400 SetDataBuffer(self, buffer data)
2401
2402 Sets the internal image data pointer to point at a Python buffer
2403 object. This can save a copy of the data but you must ensure that the
2404 buffer object lives longer than the wx.Image does.
2405 """
5b5c9bc7 2406 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2407
2408 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2409 """
2410 GetAlphaData(self) -> PyObject
2411
2412 Returns a string containing a copy of the alpha bytes of the image.
2413 """
5b5c9bc7 2414 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2415
2416 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2417 """
2418 SetAlphaData(self, buffer alpha)
2419
2420 Resets the Image's alpha data from a buffer of bytes. Accepts either
2421 a string or a buffer object holding the data and the length of the
2422 data must be width*height.
2423 """
5b5c9bc7 2424 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2425
2426 def GetAlphaBuffer(*args, **kwargs):
2427 """GetAlphaBuffer(self) -> PyObject"""
5b5c9bc7 2428 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2429
2430 def SetAlphaBuffer(*args, **kwargs):
bb2ef2cc 2431 """SetAlphaBuffer(self, buffer alpha)"""
5b5c9bc7 2432 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2433
2434 def SetMaskColour(*args, **kwargs):
2435 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
5b5c9bc7 2436 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 2437
aff4cc5c
RD
2438 def GetOrFindMaskColour(*args, **kwargs):
2439 """
2440 GetOrFindMaskColour() -> (r,g,b)
2441
2442 Get the current mask colour or find a suitable colour.
2443 """
5b5c9bc7 2444 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2445
d55e5bfc
RD
2446 def GetMaskRed(*args, **kwargs):
2447 """GetMaskRed(self) -> unsigned char"""
5b5c9bc7 2448 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
2449
2450 def GetMaskGreen(*args, **kwargs):
2451 """GetMaskGreen(self) -> unsigned char"""
5b5c9bc7 2452 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
2453
2454 def GetMaskBlue(*args, **kwargs):
2455 """GetMaskBlue(self) -> unsigned char"""
5b5c9bc7 2456 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
2457
2458 def SetMask(*args, **kwargs):
2459 """SetMask(self, bool mask=True)"""
5b5c9bc7 2460 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
2461
2462 def HasMask(*args, **kwargs):
2463 """HasMask(self) -> bool"""
5b5c9bc7 2464 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2465
2466 def Rotate(*args, **kwargs):
2467 """
5b5c9bc7
RD
2468 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2469 Point offset_after_rotation=None) -> Image
d55e5bfc 2470 """
5b5c9bc7 2471 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
2472
2473 def Rotate90(*args, **kwargs):
5b5c9bc7
RD
2474 """Rotate90(self, bool clockwise=True) -> Image"""
2475 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
2476
2477 def Mirror(*args, **kwargs):
5b5c9bc7
RD
2478 """Mirror(self, bool horizontally=True) -> Image"""
2479 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2480
2481 def Replace(*args, **kwargs):
2482 """
2483 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
2484 unsigned char r2, unsigned char g2, unsigned char b2)
2485 """
5b5c9bc7 2486 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc
RD
2487
2488 def ConvertToMono(*args, **kwargs):
5b5c9bc7
RD
2489 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
2490 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2491
2492 def SetOption(*args, **kwargs):
5b5c9bc7
RD
2493 """SetOption(self, String name, String value)"""
2494 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2495
2496 def SetOptionInt(*args, **kwargs):
5b5c9bc7
RD
2497 """SetOptionInt(self, String name, int value)"""
2498 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2499
2500 def GetOption(*args, **kwargs):
5b5c9bc7
RD
2501 """GetOption(self, String name) -> String"""
2502 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2503
2504 def GetOptionInt(*args, **kwargs):
5b5c9bc7
RD
2505 """GetOptionInt(self, String name) -> int"""
2506 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2507
2508 def HasOption(*args, **kwargs):
5b5c9bc7
RD
2509 """HasOption(self, String name) -> bool"""
2510 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
2511
2512 def CountColours(*args, **kwargs):
2513 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 2514 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
2515
2516 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
2517 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2518 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
2519
2520 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
2521 """AddHandler(ImageHandler handler)"""
2522 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2523
2524 AddHandler = staticmethod(AddHandler)
2525 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
2526 """InsertHandler(ImageHandler handler)"""
2527 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2528
2529 InsertHandler = staticmethod(InsertHandler)
2530 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
2531 """RemoveHandler(String name) -> bool"""
2532 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
2533
2534 RemoveHandler = staticmethod(RemoveHandler)
2535 def GetImageExtWildcard(*args, **kwargs):
5b5c9bc7
RD
2536 """GetImageExtWildcard() -> String"""
2537 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
2538
2539 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2540 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
2541 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2542 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
2543
2544 def ConvertToMonoBitmap(*args, **kwargs):
5b5c9bc7
RD
2545 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
2546 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc
RD
2547
2548 def __nonzero__(self): return self.Ok()
2549
5b5c9bc7 2550class ImagePtr(Image):
d55e5bfc
RD
2551 def __init__(self, this):
2552 self.this = this
2553 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2554 self.__class__ = Image
2555_core_.Image_swigregister(ImagePtr)
d55e5bfc
RD
2556
2557def ImageFromMime(*args, **kwargs):
5b5c9bc7
RD
2558 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
2559 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
2560 val.thisown = 1
2561 return val
2562
2563def ImageFromStream(*args, **kwargs):
5b5c9bc7
RD
2564 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2565 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
2566 val.thisown = 1
2567 return val
2568
2569def ImageFromStreamMime(*args, **kwargs):
5b5c9bc7
RD
2570 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
2571 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
2572 val.thisown = 1
2573 return val
2574
d6c14a4c 2575def EmptyImage(*args, **kwargs):
bb2ef2cc 2576 """
5b5c9bc7 2577 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
2578
2579 Construct an empty image of a given size, optionally setting all
2580 pixels to black.
2581 """
5b5c9bc7 2582 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2583 val.thisown = 1
2584 return val
2585
2586def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 2587 """
5b5c9bc7 2588 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
2589
2590 Construct an Image from a `wx.Bitmap`.
2591 """
5b5c9bc7 2592 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
2593 val.thisown = 1
2594 return val
2595
2596def ImageFromData(*args, **kwargs):
bb2ef2cc 2597 """
5b5c9bc7 2598 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
2599
2600 Construct an Image from a buffer of RGB bytes. Accepts either a
2601 string or a buffer object holding the data and the length of the data
2602 must be width*height*3.
2603 """
5b5c9bc7 2604 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
2605 val.thisown = 1
2606 return val
2607
03e46024 2608def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 2609 """
5b5c9bc7 2610 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
2611
2612 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2613 Accepts either a string or a buffer object holding the data and the
2614 length of the data must be width*height*3.
2615 """
5b5c9bc7 2616 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
2617 val.thisown = 1
2618 return val
2619
5b5c9bc7
RD
2620def Image_CanRead(*args, **kwargs):
2621 """Image_CanRead(String name) -> bool"""
2622 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 2623
5b5c9bc7
RD
2624def Image_GetImageCount(*args, **kwargs):
2625 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2626 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 2627
5b5c9bc7
RD
2628def Image_CanReadStream(*args, **kwargs):
2629 """Image_CanReadStream(InputStream stream) -> bool"""
2630 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 2631
5b5c9bc7
RD
2632def Image_AddHandler(*args, **kwargs):
2633 """Image_AddHandler(ImageHandler handler)"""
2634 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 2635
5b5c9bc7
RD
2636def Image_InsertHandler(*args, **kwargs):
2637 """Image_InsertHandler(ImageHandler handler)"""
2638 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 2639
5b5c9bc7
RD
2640def Image_RemoveHandler(*args, **kwargs):
2641 """Image_RemoveHandler(String name) -> bool"""
2642 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 2643
5b5c9bc7
RD
2644def Image_GetImageExtWildcard(*args, **kwargs):
2645 """Image_GetImageExtWildcard() -> String"""
2646 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc 2647
68e533f8
RD
2648def InitAllImageHandlers():
2649 """
2650 The former functionality of InitAllImageHanders is now done internal to
2651 the _core_ extension module and so this function has become a simple NOP.
2652 """
2653 pass
d55e5bfc 2654
5b5c9bc7
RD
2655IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2656IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2657PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
2658PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
2659PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
2660BMP_24BPP = _core_.BMP_24BPP
2661BMP_8BPP = _core_.BMP_8BPP
2662BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2663BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2664BMP_8BPP_RED = _core_.BMP_8BPP_RED
2665BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2666BMP_4BPP = _core_.BMP_4BPP
2667BMP_1BPP = _core_.BMP_1BPP
2668BMP_1BPP_BW = _core_.BMP_1BPP_BW
2669class BMPHandler(ImageHandler):
2670 """Proxy of C++ BMPHandler class"""
d55e5bfc
RD
2671 def __repr__(self):
2672 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2673 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2674 """__init__(self) -> BMPHandler"""
2675 newobj = _core_.new_BMPHandler(*args, **kwargs)
d55e5bfc
RD
2676 self.this = newobj.this
2677 self.thisown = 1
2678 del newobj.thisown
2679
5b5c9bc7 2680class BMPHandlerPtr(BMPHandler):
d55e5bfc
RD
2681 def __init__(self, this):
2682 self.this = this
2683 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2684 self.__class__ = BMPHandler
2685_core_.BMPHandler_swigregister(BMPHandlerPtr)
2686NullImage = cvar.NullImage
68350608 2687IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
2688IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2689IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2690IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2691IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
2692IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
2693IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 2694IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 2695IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
2696IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
2697IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
2698IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
2699IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
2700IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
2701IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 2702
5b5c9bc7
RD
2703class ICOHandler(BMPHandler):
2704 """Proxy of C++ ICOHandler class"""
d55e5bfc
RD
2705 def __repr__(self):
2706 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2707 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2708 """__init__(self) -> ICOHandler"""
2709 newobj = _core_.new_ICOHandler(*args, **kwargs)
d55e5bfc
RD
2710 self.this = newobj.this
2711 self.thisown = 1
2712 del newobj.thisown
2713
5b5c9bc7 2714class ICOHandlerPtr(ICOHandler):
d55e5bfc
RD
2715 def __init__(self, this):
2716 self.this = this
2717 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2718 self.__class__ = ICOHandler
2719_core_.ICOHandler_swigregister(ICOHandlerPtr)
d55e5bfc 2720
5b5c9bc7
RD
2721class CURHandler(ICOHandler):
2722 """Proxy of C++ CURHandler class"""
d55e5bfc
RD
2723 def __repr__(self):
2724 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2725 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2726 """__init__(self) -> CURHandler"""
2727 newobj = _core_.new_CURHandler(*args, **kwargs)
d55e5bfc
RD
2728 self.this = newobj.this
2729 self.thisown = 1
2730 del newobj.thisown
2731
5b5c9bc7 2732class CURHandlerPtr(CURHandler):
d55e5bfc
RD
2733 def __init__(self, this):
2734 self.this = this
2735 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2736 self.__class__ = CURHandler
2737_core_.CURHandler_swigregister(CURHandlerPtr)
d55e5bfc 2738
5b5c9bc7
RD
2739class ANIHandler(CURHandler):
2740 """Proxy of C++ ANIHandler class"""
d55e5bfc
RD
2741 def __repr__(self):
2742 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2743 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2744 """__init__(self) -> ANIHandler"""
2745 newobj = _core_.new_ANIHandler(*args, **kwargs)
d55e5bfc
RD
2746 self.this = newobj.this
2747 self.thisown = 1
2748 del newobj.thisown
2749
5b5c9bc7 2750class ANIHandlerPtr(ANIHandler):
d55e5bfc
RD
2751 def __init__(self, this):
2752 self.this = this
2753 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2754 self.__class__ = ANIHandler
2755_core_.ANIHandler_swigregister(ANIHandlerPtr)
d55e5bfc 2756
5b5c9bc7
RD
2757class PNGHandler(ImageHandler):
2758 """Proxy of C++ PNGHandler class"""
d55e5bfc
RD
2759 def __repr__(self):
2760 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2761 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2762 """__init__(self) -> PNGHandler"""
2763 newobj = _core_.new_PNGHandler(*args, **kwargs)
d55e5bfc
RD
2764 self.this = newobj.this
2765 self.thisown = 1
2766 del newobj.thisown
2767
5b5c9bc7 2768class PNGHandlerPtr(PNGHandler):
d55e5bfc
RD
2769 def __init__(self, this):
2770 self.this = this
2771 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2772 self.__class__ = PNGHandler
2773_core_.PNGHandler_swigregister(PNGHandlerPtr)
d55e5bfc 2774
5b5c9bc7
RD
2775class GIFHandler(ImageHandler):
2776 """Proxy of C++ GIFHandler class"""
d55e5bfc
RD
2777 def __repr__(self):
2778 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2779 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2780 """__init__(self) -> GIFHandler"""
2781 newobj = _core_.new_GIFHandler(*args, **kwargs)
d55e5bfc
RD
2782 self.this = newobj.this
2783 self.thisown = 1
2784 del newobj.thisown
2785
5b5c9bc7 2786class GIFHandlerPtr(GIFHandler):
d55e5bfc
RD
2787 def __init__(self, this):
2788 self.this = this
2789 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2790 self.__class__ = GIFHandler
2791_core_.GIFHandler_swigregister(GIFHandlerPtr)
d55e5bfc 2792
5b5c9bc7
RD
2793class PCXHandler(ImageHandler):
2794 """Proxy of C++ PCXHandler class"""
d55e5bfc
RD
2795 def __repr__(self):
2796 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2797 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2798 """__init__(self) -> PCXHandler"""
2799 newobj = _core_.new_PCXHandler(*args, **kwargs)
d55e5bfc
RD
2800 self.this = newobj.this
2801 self.thisown = 1
2802 del newobj.thisown
2803
5b5c9bc7 2804class PCXHandlerPtr(PCXHandler):
d55e5bfc
RD
2805 def __init__(self, this):
2806 self.this = this
2807 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2808 self.__class__ = PCXHandler
2809_core_.PCXHandler_swigregister(PCXHandlerPtr)
d55e5bfc 2810
5b5c9bc7
RD
2811class JPEGHandler(ImageHandler):
2812 """Proxy of C++ JPEGHandler class"""
d55e5bfc
RD
2813 def __repr__(self):
2814 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2815 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2816 """__init__(self) -> JPEGHandler"""
2817 newobj = _core_.new_JPEGHandler(*args, **kwargs)
d55e5bfc
RD
2818 self.this = newobj.this
2819 self.thisown = 1
2820 del newobj.thisown
2821
5b5c9bc7 2822class JPEGHandlerPtr(JPEGHandler):
d55e5bfc
RD
2823 def __init__(self, this):
2824 self.this = this
2825 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2826 self.__class__ = JPEGHandler
2827_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
d55e5bfc 2828
5b5c9bc7
RD
2829class PNMHandler(ImageHandler):
2830 """Proxy of C++ PNMHandler class"""
d55e5bfc
RD
2831 def __repr__(self):
2832 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2833 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2834 """__init__(self) -> PNMHandler"""
2835 newobj = _core_.new_PNMHandler(*args, **kwargs)
d55e5bfc
RD
2836 self.this = newobj.this
2837 self.thisown = 1
2838 del newobj.thisown
2839
5b5c9bc7 2840class PNMHandlerPtr(PNMHandler):
d55e5bfc
RD
2841 def __init__(self, this):
2842 self.this = this
2843 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2844 self.__class__ = PNMHandler
2845_core_.PNMHandler_swigregister(PNMHandlerPtr)
d55e5bfc 2846
5b5c9bc7
RD
2847class XPMHandler(ImageHandler):
2848 """Proxy of C++ XPMHandler class"""
d55e5bfc
RD
2849 def __repr__(self):
2850 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2851 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2852 """__init__(self) -> XPMHandler"""
2853 newobj = _core_.new_XPMHandler(*args, **kwargs)
d55e5bfc
RD
2854 self.this = newobj.this
2855 self.thisown = 1
2856 del newobj.thisown
2857
5b5c9bc7 2858class XPMHandlerPtr(XPMHandler):
d55e5bfc
RD
2859 def __init__(self, this):
2860 self.this = this
2861 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2862 self.__class__ = XPMHandler
2863_core_.XPMHandler_swigregister(XPMHandlerPtr)
d55e5bfc 2864
5b5c9bc7
RD
2865class TIFFHandler(ImageHandler):
2866 """Proxy of C++ TIFFHandler class"""
d55e5bfc
RD
2867 def __repr__(self):
2868 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2869 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2870 """__init__(self) -> TIFFHandler"""
2871 newobj = _core_.new_TIFFHandler(*args, **kwargs)
d55e5bfc
RD
2872 self.this = newobj.this
2873 self.thisown = 1
2874 del newobj.thisown
2875
5b5c9bc7 2876class TIFFHandlerPtr(TIFFHandler):
d55e5bfc
RD
2877 def __init__(self, this):
2878 self.this = this
2879 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2880 self.__class__ = TIFFHandler
2881_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
d55e5bfc 2882
5b5c9bc7
RD
2883QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
2884QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
2885class Quantize(object):
c0de73ae
RD
2886 """Performs quantization, or colour reduction, on a wxImage."""
2887 def __init__(self): raise RuntimeError, "No constructor defined"
2888 def __repr__(self):
2889 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2890 def Quantize(*args, **kwargs):
2891 """
5b5c9bc7 2892 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
2893
2894 Reduce the colours in the source image and put the result into the
2895 destination image, setting the palette in the destination if
2896 needed. Both images may be the same, to overwrite the source image.
2897 """
5b5c9bc7 2898 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
2899
2900 Quantize = staticmethod(Quantize)
2901
5b5c9bc7 2902class QuantizePtr(Quantize):
c0de73ae
RD
2903 def __init__(self, this):
2904 self.this = this
2905 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2906 self.__class__ = Quantize
2907_core_.Quantize_swigregister(QuantizePtr)
c0de73ae 2908
5b5c9bc7 2909def Quantize_Quantize(*args, **kwargs):
c0de73ae 2910 """
5b5c9bc7 2911 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
2912
2913 Reduce the colours in the source image and put the result into the
2914 destination image, setting the palette in the destination if
2915 needed. Both images may be the same, to overwrite the source image.
2916 """
5b5c9bc7 2917 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 2918
d55e5bfc
RD
2919#---------------------------------------------------------------------------
2920
5b5c9bc7
RD
2921class EvtHandler(Object):
2922 """Proxy of C++ EvtHandler class"""
d55e5bfc
RD
2923 def __repr__(self):
2924 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2925 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2926 """__init__(self) -> EvtHandler"""
2927 newobj = _core_.new_EvtHandler(*args, **kwargs)
d55e5bfc
RD
2928 self.this = newobj.this
2929 self.thisown = 1
2930 del newobj.thisown
2931 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
2932 """GetNextHandler(self) -> EvtHandler"""
2933 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
2934
2935 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
2936 """GetPreviousHandler(self) -> EvtHandler"""
2937 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
2938
2939 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
2940 """SetNextHandler(self, EvtHandler handler)"""
2941 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
2942
2943 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
2944 """SetPreviousHandler(self, EvtHandler handler)"""
2945 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
2946
2947 def GetEvtHandlerEnabled(*args, **kwargs):
2948 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 2949 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
2950
2951 def SetEvtHandlerEnabled(*args, **kwargs):
2952 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 2953 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
2954
2955 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
2956 """ProcessEvent(self, Event event) -> bool"""
2957 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
2958
2959 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
2960 """AddPendingEvent(self, Event event)"""
2961 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
2962
2963 def ProcessPendingEvents(*args, **kwargs):
2964 """ProcessPendingEvents(self)"""
5b5c9bc7 2965 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
2966
2967 def Connect(*args, **kwargs):
2968 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 2969 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
2970
2971 def Disconnect(*args, **kwargs):
2972 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 2973 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
2974
2975 def _setOORInfo(*args, **kwargs):
36ed4f51 2976 """_setOORInfo(self, PyObject _self, bool incref=True)"""
5b5c9bc7 2977 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
d55e5bfc
RD
2978
2979 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2980 """
2981 Bind an event to an event handler.
2982
a5ee0656
RD
2983 :param event: One of the EVT_* objects that specifies the
2984 type of event to bind,
d55e5bfc 2985
a5ee0656
RD
2986 :param handler: A callable object to be invoked when the
2987 event is delivered to self. Pass None to
2988 disconnect an event handler.
d55e5bfc 2989
a5ee0656
RD
2990 :param source: Sometimes the event originates from a
2991 different window than self, but you still
2992 want to catch it in self. (For example, a
2993 button event delivered to a frame.) By
2994 passing the source of the event, the event
2995 handling system is able to differentiate
2996 between the same event type from different
2997 controls.
d55e5bfc 2998
a5ee0656
RD
2999 :param id: Used to spcify the event source by ID instead
3000 of instance.
3001
3002 :param id2: Used when it is desirable to bind a handler
3003 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3004 """
3005 if source is not None:
3006 id = source.GetId()
3007 event.Bind(self, id, id2, handler)
3008
d6c14a4c
RD
3009 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3010 """
3011 Disconencts the event handler binding for event from self.
3012 Returns True if successful.
3013 """
3014 if source is not None:
3015 id = source.GetId()
3016 return event.Unbind(self, id, id2)
d55e5bfc
RD
3017
3018
5b5c9bc7 3019class EvtHandlerPtr(EvtHandler):
d55e5bfc
RD
3020 def __init__(self, this):
3021 self.this = this
3022 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3023 self.__class__ = EvtHandler
3024_core_.EvtHandler_swigregister(EvtHandlerPtr)
d55e5bfc
RD
3025
3026#---------------------------------------------------------------------------
3027
3028class PyEventBinder(object):
3029 """
3030 Instances of this class are used to bind specific events to event
3031 handlers.
3032 """
3033 def __init__(self, evtType, expectedIDs=0):
3034 if expectedIDs not in [0, 1, 2]:
3035 raise ValueError, "Invalid number of expectedIDs"
3036 self.expectedIDs = expectedIDs
3037
3038 if type(evtType) == list or type(evtType) == tuple:
3039 self.evtType = evtType
3040 else:
3041 self.evtType = [evtType]
3042
3043
3044 def Bind(self, target, id1, id2, function):
3045 """Bind this set of event types to target."""
3046 for et in self.evtType:
3047 target.Connect(id1, id2, et, function)
3048
d6c14a4c
RD
3049
3050 def Unbind(self, target, id1, id2):
3051 """Remove an event binding."""
3052 success = 0
3053 for et in self.evtType:
3054 success += target.Disconnect(id1, id2, et)
3055 return success != 0
3056
d55e5bfc
RD
3057
3058 def __call__(self, *args):
3059 """
3060 For backwards compatibility with the old EVT_* functions.
3061 Should be called with either (window, func), (window, ID,
3062 func) or (window, ID1, ID2, func) parameters depending on the
3063 type of the event.
3064 """
3065 assert len(args) == 2 + self.expectedIDs
3066 id1 = wx.ID_ANY
3067 id2 = wx.ID_ANY
3068 target = args[0]
3069 if self.expectedIDs == 0:
3070 func = args[1]
3071 elif self.expectedIDs == 1:
3072 id1 = args[1]
3073 func = args[2]
3074 elif self.expectedIDs == 2:
3075 id1 = args[1]
3076 id2 = args[2]
3077 func = args[3]
3078 else:
3079 raise ValueError, "Unexpected number of IDs"
3080
3081 self.Bind(target, id1, id2, func)
3082
3083
3084# These two are square pegs that don't fit the PyEventBinder hole...
3085def EVT_COMMAND(win, id, cmd, func):
3086 win.Connect(id, -1, cmd, func)
3087def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3088 win.Connect(id1, id2, cmd, func)
3089
3090
3091#---------------------------------------------------------------------------
3092
3093#---------------------------------------------------------------------------
3094
5b5c9bc7
RD
3095EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3096EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3097
3098def NewEventType(*args, **kwargs):
3099 """NewEventType() -> wxEventType"""
3100 return _core_.NewEventType(*args, **kwargs)
3101wxEVT_NULL = _core_.wxEVT_NULL
3102wxEVT_FIRST = _core_.wxEVT_FIRST
3103wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3104wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3105wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3106wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3107wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3108wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3109wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3110wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3111wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3112wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3113wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3114wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3115wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3116wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3117wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3118wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3119wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3120wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3121wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3122wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3123wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3124wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3125wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3126wxEVT_MOTION = _core_.wxEVT_MOTION
3127wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3128wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3129wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3130wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3131wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3132wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3133wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3134wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3135wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3136wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3137wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3138wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3139wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3140wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3141wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3142wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3143wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3144wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3145wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3146wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3147wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3148wxEVT_CHAR = _core_.wxEVT_CHAR
3149wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3150wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3151wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3152wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3153wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3154wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3155wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3156wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3157wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3158wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3159wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3160wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3161wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3162wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3163wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
3164wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3165wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3166wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3167wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3168wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3169wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3170wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3171wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3172wxEVT_SIZE = _core_.wxEVT_SIZE
3173wxEVT_MOVE = _core_.wxEVT_MOVE
3174wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3175wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3176wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3177wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3178wxEVT_POWER = _core_.wxEVT_POWER
3179wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3180wxEVT_CREATE = _core_.wxEVT_CREATE
3181wxEVT_DESTROY = _core_.wxEVT_DESTROY
3182wxEVT_SHOW = _core_.wxEVT_SHOW
3183wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3184wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3185wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3186wxEVT_PAINT = _core_.wxEVT_PAINT
3187wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3188wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3189wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3190wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3191wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3192wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3193wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3194wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3195wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3196wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3197wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3198wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3199wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3200wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3201wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3202wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3203wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3204wxEVT_IDLE = _core_.wxEVT_IDLE
3205wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3206wxEVT_SIZING = _core_.wxEVT_SIZING
3207wxEVT_MOVING = _core_.wxEVT_MOVING
3208wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3209wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3210wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3211wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3212wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3213wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3214wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3215wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3216#
3217# Create some event binders
3218EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3219EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3220EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3221EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3222EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3223EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3224EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3225EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3226EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3227EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3228EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3229EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3230EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3231EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3232EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3233EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3234EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3235EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3236EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3237EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3238EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3239EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3240EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3241EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3242EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3243EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3244EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3245EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3246EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3247EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3248EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3249EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3250EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3251EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3252EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3253EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3254EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3255EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3256EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3257EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3258EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3259
3260EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3261EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3262EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3263EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3264EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3265EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3266EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3267EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3268EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3269EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3270EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3271EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3272EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3273
3274EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3275 wxEVT_LEFT_UP,
3276 wxEVT_MIDDLE_DOWN,
3277 wxEVT_MIDDLE_UP,
3278 wxEVT_RIGHT_DOWN,
3279 wxEVT_RIGHT_UP,
3280 wxEVT_MOTION,
3281 wxEVT_LEFT_DCLICK,
3282 wxEVT_MIDDLE_DCLICK,
3283 wxEVT_RIGHT_DCLICK,
3284 wxEVT_ENTER_WINDOW,
3285 wxEVT_LEAVE_WINDOW,
3286 wxEVT_MOUSEWHEEL
3287 ])
3288
3289
3290# Scrolling from wxWindow (sent to wxScrolledWindow)
3291EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3292 wxEVT_SCROLLWIN_BOTTOM,
3293 wxEVT_SCROLLWIN_LINEUP,
3294 wxEVT_SCROLLWIN_LINEDOWN,
3295 wxEVT_SCROLLWIN_PAGEUP,
3296 wxEVT_SCROLLWIN_PAGEDOWN,
3297 wxEVT_SCROLLWIN_THUMBTRACK,
3298 wxEVT_SCROLLWIN_THUMBRELEASE,
3299 ])
3300
3301EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3302EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3303EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3304EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3305EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3306EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3307EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3308EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3309
3310# Scrolling from wxSlider and wxScrollBar
3311EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3312 wxEVT_SCROLL_BOTTOM,
3313 wxEVT_SCROLL_LINEUP,
3314 wxEVT_SCROLL_LINEDOWN,
3315 wxEVT_SCROLL_PAGEUP,
3316 wxEVT_SCROLL_PAGEDOWN,
3317 wxEVT_SCROLL_THUMBTRACK,
3318 wxEVT_SCROLL_THUMBRELEASE,
3319 wxEVT_SCROLL_ENDSCROLL,
3320 ])
3321
3322EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3323EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3324EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3325EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3326EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3327EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3328EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3329EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3330EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3331
3332# Scrolling from wxSlider and wxScrollBar, with an id
3333EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3334 wxEVT_SCROLL_BOTTOM,
3335 wxEVT_SCROLL_LINEUP,
3336 wxEVT_SCROLL_LINEDOWN,
3337 wxEVT_SCROLL_PAGEUP,
3338 wxEVT_SCROLL_PAGEDOWN,
3339 wxEVT_SCROLL_THUMBTRACK,
3340 wxEVT_SCROLL_THUMBRELEASE,
3341 wxEVT_SCROLL_ENDSCROLL,
3342 ], 1)
3343
3344EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3345EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3346EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3347EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3348EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3349EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3350EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3351EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3352EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3353
3354EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3355EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3356EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3357EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3358EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3359EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3360EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3361EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3362EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3363EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3364
3365EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3366EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3367EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3368EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3369EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3370EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3371EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3372EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3373EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3374
3375
3376EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3377EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3378EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3379EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3380EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3381EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3382EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3383
3384EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3385
3386EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3387EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3388
3389EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3390
3391
3392
3393#---------------------------------------------------------------------------
3394
5b5c9bc7
RD
3395class Event(Object):
3396 """Proxy of C++ Event class"""
d55e5bfc
RD
3397 def __init__(self): raise RuntimeError, "No constructor defined"
3398 def __repr__(self):
3399 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7 3400 def __del__(self, destroy=_core_.delete_Event):
d55e5bfc
RD
3401 """__del__(self)"""
3402 try:
3403 if self.thisown: destroy(self)
3404 except: pass
3405
3406 def SetEventType(*args, **kwargs):
3407 """SetEventType(self, wxEventType typ)"""
5b5c9bc7 3408 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
3409
3410 def GetEventType(*args, **kwargs):
3411 """GetEventType(self) -> wxEventType"""
5b5c9bc7 3412 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
3413
3414 def GetEventObject(*args, **kwargs):
5b5c9bc7
RD
3415 """GetEventObject(self) -> Object"""
3416 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
3417
3418 def SetEventObject(*args, **kwargs):
5b5c9bc7
RD
3419 """SetEventObject(self, Object obj)"""
3420 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
3421
3422 def GetTimestamp(*args, **kwargs):
3423 """GetTimestamp(self) -> long"""
5b5c9bc7 3424 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
3425
3426 def SetTimestamp(*args, **kwargs):
3427 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 3428 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
3429
3430 def GetId(*args, **kwargs):
3431 """GetId(self) -> int"""
5b5c9bc7 3432 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
3433
3434 def SetId(*args, **kwargs):
3435 """SetId(self, int Id)"""
5b5c9bc7 3436 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
3437
3438 def IsCommandEvent(*args, **kwargs):
3439 """IsCommandEvent(self) -> bool"""
5b5c9bc7 3440 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
3441
3442 def Skip(*args, **kwargs):
51b83b37
RD
3443 """
3444 Skip(self, bool skip=True)
3445
3446 Called by an event handler, it controls whether additional event
3447 handlers bound to this event will be called after the current event
3448 handler returns. Skip(false) (the default setting) will prevent
3449 additional event handlers from being called and control will be
3450 returned to the sender of the event immediately after the current
3451 handler has finished. Skip(True) will cause the event processing
3452 system to continue searching for a handler function for this event.
3453
3454 """
5b5c9bc7 3455 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
3456
3457 def GetSkipped(*args, **kwargs):
3458 """GetSkipped(self) -> bool"""
5b5c9bc7 3459 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
3460
3461 def ShouldPropagate(*args, **kwargs):
3462 """ShouldPropagate(self) -> bool"""
5b5c9bc7 3463 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
3464
3465 def StopPropagation(*args, **kwargs):
3466 """StopPropagation(self) -> int"""
5b5c9bc7 3467 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
3468
3469 def ResumePropagation(*args, **kwargs):
3470 """ResumePropagation(self, int propagationLevel)"""
5b5c9bc7 3471 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
3472
3473 def Clone(*args, **kwargs):
5b5c9bc7
RD
3474 """Clone(self) -> Event"""
3475 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc
RD
3476
3477
5b5c9bc7 3478class EventPtr(Event):
d55e5bfc
RD
3479 def __init__(self, this):
3480 self.this = this
3481 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3482 self.__class__ = Event
3483_core_.Event_swigregister(EventPtr)
d55e5bfc
RD
3484
3485#---------------------------------------------------------------------------
3486
5b5c9bc7
RD
3487class PropagationDisabler(object):
3488 """Proxy of C++ PropagationDisabler class"""
d55e5bfc
RD
3489 def __repr__(self):
3490 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3491 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3492 """__init__(self, Event event) -> PropagationDisabler"""
3493 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
d55e5bfc
RD
3494 self.this = newobj.this
3495 self.thisown = 1
3496 del newobj.thisown
5b5c9bc7 3497 def __del__(self, destroy=_core_.delete_PropagationDisabler):
d55e5bfc
RD
3498 """__del__(self)"""
3499 try:
3500 if self.thisown: destroy(self)
3501 except: pass
3502
3503
5b5c9bc7 3504class PropagationDisablerPtr(PropagationDisabler):
d55e5bfc
RD
3505 def __init__(self, this):
3506 self.this = this
3507 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3508 self.__class__ = PropagationDisabler
3509_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
d55e5bfc 3510
5b5c9bc7
RD
3511class PropagateOnce(object):
3512 """Proxy of C++ PropagateOnce class"""
d55e5bfc
RD
3513 def __repr__(self):
3514 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3515 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3516 """__init__(self, Event event) -> PropagateOnce"""
3517 newobj = _core_.new_PropagateOnce(*args, **kwargs)
d55e5bfc
RD
3518 self.this = newobj.this
3519 self.thisown = 1
3520 del newobj.thisown
5b5c9bc7 3521 def __del__(self, destroy=_core_.delete_PropagateOnce):
d55e5bfc
RD
3522 """__del__(self)"""
3523 try:
3524 if self.thisown: destroy(self)
3525 except: pass
3526
3527
5b5c9bc7 3528class PropagateOncePtr(PropagateOnce):
d55e5bfc
RD
3529 def __init__(self, this):
3530 self.this = this
3531 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3532 self.__class__ = PropagateOnce
3533_core_.PropagateOnce_swigregister(PropagateOncePtr)
d55e5bfc
RD
3534
3535#---------------------------------------------------------------------------
3536
5b5c9bc7
RD
3537class CommandEvent(Event):
3538 """Proxy of C++ CommandEvent class"""
d55e5bfc
RD
3539 def __repr__(self):
3540 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3541 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3542 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
3543 newobj = _core_.new_CommandEvent(*args, **kwargs)
d55e5bfc
RD
3544 self.this = newobj.this
3545 self.thisown = 1
3546 del newobj.thisown
3547 def GetSelection(*args, **kwargs):
3548 """GetSelection(self) -> int"""
5b5c9bc7 3549 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
3550
3551 def SetString(*args, **kwargs):
5b5c9bc7
RD
3552 """SetString(self, String s)"""
3553 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
3554
3555 def GetString(*args, **kwargs):
5b5c9bc7
RD
3556 """GetString(self) -> String"""
3557 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
3558
3559 def IsChecked(*args, **kwargs):
3560 """IsChecked(self) -> bool"""
5b5c9bc7 3561 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
3562
3563 Checked = IsChecked
3564 def IsSelection(*args, **kwargs):
3565 """IsSelection(self) -> bool"""
5b5c9bc7 3566 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
3567
3568 def SetExtraLong(*args, **kwargs):
3569 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 3570 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
3571
3572 def GetExtraLong(*args, **kwargs):
3573 """GetExtraLong(self) -> long"""
5b5c9bc7 3574 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
3575
3576 def SetInt(*args, **kwargs):
3577 """SetInt(self, int i)"""
5b5c9bc7 3578 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
3579
3580 def GetInt(*args, **kwargs):
3581 """GetInt(self) -> long"""
5b5c9bc7 3582 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc
RD
3583
3584 def Clone(*args, **kwargs):
5b5c9bc7
RD
3585 """Clone(self) -> Event"""
3586 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc
RD
3587
3588
5b5c9bc7 3589class CommandEventPtr(CommandEvent):
d55e5bfc
RD
3590 def __init__(self, this):
3591 self.this = this
3592 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3593 self.__class__ = CommandEvent
3594_core_.CommandEvent_swigregister(CommandEventPtr)
d55e5bfc
RD
3595
3596#---------------------------------------------------------------------------
3597
5b5c9bc7
RD
3598class NotifyEvent(CommandEvent):
3599 """Proxy of C++ NotifyEvent class"""
d55e5bfc
RD
3600 def __repr__(self):
3601 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3602 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3603 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
3604 newobj = _core_.new_NotifyEvent(*args, **kwargs)
d55e5bfc
RD
3605 self.this = newobj.this
3606 self.thisown = 1
3607 del newobj.thisown
3608 def Veto(*args, **kwargs):
3609 """Veto(self)"""
5b5c9bc7 3610 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
3611
3612 def Allow(*args, **kwargs):
3613 """Allow(self)"""
5b5c9bc7 3614 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
3615
3616 def IsAllowed(*args, **kwargs):
3617 """IsAllowed(self) -> bool"""
5b5c9bc7 3618 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc
RD
3619
3620
5b5c9bc7 3621class NotifyEventPtr(NotifyEvent):
d55e5bfc
RD
3622 def __init__(self, this):
3623 self.this = this
3624 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3625 self.__class__ = NotifyEvent
3626_core_.NotifyEvent_swigregister(NotifyEventPtr)
d55e5bfc
RD
3627
3628#---------------------------------------------------------------------------
3629
5b5c9bc7
RD
3630class ScrollEvent(CommandEvent):
3631 """Proxy of C++ ScrollEvent class"""
d55e5bfc
RD
3632 def __repr__(self):
3633 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3634 def __init__(self, *args, **kwargs):
3635 """
3636 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 3637 int orient=0) -> ScrollEvent
d55e5bfc 3638 """
5b5c9bc7 3639 newobj = _core_.new_ScrollEvent(*args, **kwargs)
d55e5bfc
RD
3640 self.this = newobj.this
3641 self.thisown = 1
3642 del newobj.thisown
3643 def GetOrientation(*args, **kwargs):
3644 """GetOrientation(self) -> int"""
5b5c9bc7 3645 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
3646
3647 def GetPosition(*args, **kwargs):
3648 """GetPosition(self) -> int"""
5b5c9bc7 3649 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
3650
3651 def SetOrientation(*args, **kwargs):
3652 """SetOrientation(self, int orient)"""
5b5c9bc7 3653 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
3654
3655 def SetPosition(*args, **kwargs):
3656 """SetPosition(self, int pos)"""
5b5c9bc7 3657 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
3658
3659
5b5c9bc7 3660class ScrollEventPtr(ScrollEvent):
d55e5bfc
RD
3661 def __init__(self, this):
3662 self.this = this
3663 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3664 self.__class__ = ScrollEvent
3665_core_.ScrollEvent_swigregister(ScrollEventPtr)
d55e5bfc
RD
3666
3667#---------------------------------------------------------------------------
3668
5b5c9bc7
RD
3669class ScrollWinEvent(Event):
3670 """Proxy of C++ ScrollWinEvent class"""
d55e5bfc
RD
3671 def __repr__(self):
3672 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3673 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3674 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
3675 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
d55e5bfc
RD
3676 self.this = newobj.this
3677 self.thisown = 1
3678 del newobj.thisown
3679 def GetOrientation(*args, **kwargs):
3680 """GetOrientation(self) -> int"""
5b5c9bc7 3681 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
3682
3683 def GetPosition(*args, **kwargs):
3684 """GetPosition(self) -> int"""
5b5c9bc7 3685 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
3686
3687 def SetOrientation(*args, **kwargs):
3688 """SetOrientation(self, int orient)"""
5b5c9bc7 3689 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
3690
3691 def SetPosition(*args, **kwargs):
3692 """SetPosition(self, int pos)"""
5b5c9bc7 3693 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
3694
3695
5b5c9bc7 3696class ScrollWinEventPtr(ScrollWinEvent):
d55e5bfc
RD
3697 def __init__(self, this):
3698 self.this = this
3699 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3700 self.__class__ = ScrollWinEvent
3701_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
d55e5bfc
RD
3702
3703#---------------------------------------------------------------------------
3704
5b5c9bc7
RD
3705MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3706MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3707MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3708MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3709MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
3710class MouseEvent(Event):
3711 """Proxy of C++ MouseEvent class"""
d55e5bfc
RD
3712 def __repr__(self):
3713 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3714 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3715 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
3716 newobj = _core_.new_MouseEvent(*args, **kwargs)
d55e5bfc
RD
3717 self.this = newobj.this
3718 self.thisown = 1
3719 del newobj.thisown
3720 def IsButton(*args, **kwargs):
3721 """IsButton(self) -> bool"""
5b5c9bc7 3722 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
3723
3724 def ButtonDown(*args, **kwargs):
5b5c9bc7
RD
3725 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
3726 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
3727
3728 def ButtonDClick(*args, **kwargs):
5b5c9bc7
RD
3729 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
3730 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
3731
3732 def ButtonUp(*args, **kwargs):
5b5c9bc7
RD
3733 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
3734 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
3735
3736 def Button(*args, **kwargs):
3737 """Button(self, int but) -> bool"""
5b5c9bc7 3738 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
3739
3740 def ButtonIsDown(*args, **kwargs):
3741 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 3742 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
3743
3744 def GetButton(*args, **kwargs):
3745 """GetButton(self) -> int"""
5b5c9bc7 3746 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
3747
3748 def ControlDown(*args, **kwargs):
3749 """ControlDown(self) -> bool"""
5b5c9bc7 3750 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
3751
3752 def MetaDown(*args, **kwargs):
3753 """MetaDown(self) -> bool"""
5b5c9bc7 3754 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
3755
3756 def AltDown(*args, **kwargs):
3757 """AltDown(self) -> bool"""
5b5c9bc7 3758 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
3759
3760 def ShiftDown(*args, **kwargs):
3761 """ShiftDown(self) -> bool"""
5b5c9bc7 3762 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 3763
412d302d
RD
3764 def CmdDown(*args, **kwargs):
3765 """
3766 CmdDown(self) -> bool
3767
3768 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3769 platforms but the special "Apple" (a.k.a as "Command") key on
3770 Macs: it makes often sense to use it instead of, say, `ControlDown`
3771 because Cmd key is used for the same thing under Mac as Ctrl
3772 elsewhere. The Ctrl still exists, it's just not used for this
3773 purpose. So for non-Mac platforms this is the same as `ControlDown`
3774 and Macs this is the same as `MetaDown`.
3775 """
5b5c9bc7 3776 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 3777
d55e5bfc
RD
3778 def LeftDown(*args, **kwargs):
3779 """LeftDown(self) -> bool"""
5b5c9bc7 3780 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
3781
3782 def MiddleDown(*args, **kwargs):
3783 """MiddleDown(self) -> bool"""
5b5c9bc7 3784 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
3785
3786 def RightDown(*args, **kwargs):
3787 """RightDown(self) -> bool"""
5b5c9bc7 3788 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
3789
3790 def LeftUp(*args, **kwargs):
3791 """LeftUp(self) -> bool"""
5b5c9bc7 3792 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
3793
3794 def MiddleUp(*args, **kwargs):
3795 """MiddleUp(self) -> bool"""
5b5c9bc7 3796 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
3797
3798 def RightUp(*args, **kwargs):
3799 """RightUp(self) -> bool"""
5b5c9bc7 3800 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
3801
3802 def LeftDClick(*args, **kwargs):
3803 """LeftDClick(self) -> bool"""
5b5c9bc7 3804 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
3805
3806 def MiddleDClick(*args, **kwargs):
3807 """MiddleDClick(self) -> bool"""
5b5c9bc7 3808 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
3809
3810 def RightDClick(*args, **kwargs):
3811 """RightDClick(self) -> bool"""
5b5c9bc7 3812 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
3813
3814 def LeftIsDown(*args, **kwargs):
3815 """LeftIsDown(self) -> bool"""
5b5c9bc7 3816 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
3817
3818 def MiddleIsDown(*args, **kwargs):
3819 """MiddleIsDown(self) -> bool"""
5b5c9bc7 3820 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
3821
3822 def RightIsDown(*args, **kwargs):
3823 """RightIsDown(self) -> bool"""
5b5c9bc7 3824 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
3825
3826 def Dragging(*args, **kwargs):
3827 """Dragging(self) -> bool"""
5b5c9bc7 3828 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
3829
3830 def Moving(*args, **kwargs):
3831 """Moving(self) -> bool"""
5b5c9bc7 3832 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
3833
3834 def Entering(*args, **kwargs):
3835 """Entering(self) -> bool"""
5b5c9bc7 3836 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
3837
3838 def Leaving(*args, **kwargs):
3839 """Leaving(self) -> bool"""
5b5c9bc7 3840 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
3841
3842 def GetPosition(*args, **kwargs):
3843 """
5b5c9bc7 3844 GetPosition(self) -> Point
d55e5bfc 3845
15817c7e
RD
3846 Returns the position of the mouse in window coordinates when the event
3847 happened.
d55e5bfc 3848 """
5b5c9bc7 3849 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
3850
3851 def GetPositionTuple(*args, **kwargs):
3852 """
3853 GetPositionTuple() -> (x,y)
3854
15817c7e
RD
3855 Returns the position of the mouse in window coordinates when the event
3856 happened.
d55e5bfc 3857 """
5b5c9bc7 3858 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
3859
3860 def GetLogicalPosition(*args, **kwargs):
5b5c9bc7
RD
3861 """GetLogicalPosition(self, DC dc) -> Point"""
3862 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
3863
3864 def GetX(*args, **kwargs):
3865 """GetX(self) -> int"""
5b5c9bc7 3866 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
3867
3868 def GetY(*args, **kwargs):
3869 """GetY(self) -> int"""
5b5c9bc7 3870 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
3871
3872 def GetWheelRotation(*args, **kwargs):
3873 """GetWheelRotation(self) -> int"""
5b5c9bc7 3874 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
3875
3876 def GetWheelDelta(*args, **kwargs):
3877 """GetWheelDelta(self) -> int"""
5b5c9bc7 3878 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
3879
3880 def GetLinesPerAction(*args, **kwargs):
3881 """GetLinesPerAction(self) -> int"""
5b5c9bc7 3882 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
3883
3884 def IsPageScroll(*args, **kwargs):
3885 """IsPageScroll(self) -> bool"""
5b5c9bc7
RD
3886 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3887
3888 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3889 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3890 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3891 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3892 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3893 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3894 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3895 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3896 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3897 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3898 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3899 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
3900
3901class MouseEventPtr(MouseEvent):
d55e5bfc
RD
3902 def __init__(self, this):
3903 self.this = this
3904 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3905 self.__class__ = MouseEvent
3906_core_.MouseEvent_swigregister(MouseEventPtr)
d55e5bfc
RD
3907
3908#---------------------------------------------------------------------------
3909
5b5c9bc7
RD
3910class SetCursorEvent(Event):
3911 """Proxy of C++ SetCursorEvent class"""
d55e5bfc
RD
3912 def __repr__(self):
3913 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3914 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3915 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
3916 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
d55e5bfc
RD
3917 self.this = newobj.this
3918 self.thisown = 1
3919 del newobj.thisown
3920 def GetX(*args, **kwargs):
3921 """GetX(self) -> int"""
5b5c9bc7 3922 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
3923
3924 def GetY(*args, **kwargs):
3925 """GetY(self) -> int"""
5b5c9bc7 3926 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
3927
3928 def SetCursor(*args, **kwargs):
5b5c9bc7
RD
3929 """SetCursor(self, Cursor cursor)"""
3930 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
3931
3932 def GetCursor(*args, **kwargs):
5b5c9bc7
RD
3933 """GetCursor(self) -> Cursor"""
3934 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
3935
3936 def HasCursor(*args, **kwargs):
3937 """HasCursor(self) -> bool"""
5b5c9bc7 3938 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc
RD
3939
3940
5b5c9bc7 3941class SetCursorEventPtr(SetCursorEvent):
d55e5bfc
RD
3942 def __init__(self, this):
3943 self.this = this
3944 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3945 self.__class__ = SetCursorEvent
3946_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
d55e5bfc
RD
3947
3948#---------------------------------------------------------------------------
3949
5b5c9bc7
RD
3950class KeyEvent(Event):
3951 """Proxy of C++ KeyEvent class"""
d55e5bfc
RD
3952 def __repr__(self):
3953 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3954 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3955 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
3956 newobj = _core_.new_KeyEvent(*args, **kwargs)
d55e5bfc
RD
3957 self.this = newobj.this
3958 self.thisown = 1
3959 del newobj.thisown
3960 def ControlDown(*args, **kwargs):
3961 """ControlDown(self) -> bool"""
5b5c9bc7 3962 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
3963
3964 def MetaDown(*args, **kwargs):
3965 """MetaDown(self) -> bool"""
5b5c9bc7 3966 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
3967
3968 def AltDown(*args, **kwargs):
3969 """AltDown(self) -> bool"""
5b5c9bc7 3970 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
3971
3972 def ShiftDown(*args, **kwargs):
3973 """ShiftDown(self) -> bool"""
5b5c9bc7 3974 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 3975
412d302d
RD
3976 def CmdDown(*args, **kwargs):
3977 """
3978 CmdDown(self) -> bool
3979
3980 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3981 platforms but the special "Apple" (a.k.a as "Command") key on
3982 Macs: it makes often sense to use it instead of, say, `ControlDown`
3983 because Cmd key is used for the same thing under Mac as Ctrl
3984 elsewhere. The Ctrl still exists, it's just not used for this
3985 purpose. So for non-Mac platforms this is the same as `ControlDown`
3986 and Macs this is the same as `MetaDown`.
3987 """
5b5c9bc7 3988 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 3989
d55e5bfc
RD
3990 def HasModifiers(*args, **kwargs):
3991 """HasModifiers(self) -> bool"""
5b5c9bc7 3992 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
3993
3994 def GetKeyCode(*args, **kwargs):
3995 """GetKeyCode(self) -> int"""
5b5c9bc7 3996 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
3997
3998 KeyCode = GetKeyCode
bb4524c4
RD
3999 def GetUnicodeKey(*args, **kwargs):
4000 """GetUnicodeKey(self) -> int"""
5b5c9bc7 4001 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 4002
bb4524c4 4003 GetUniChar = GetUnicodeKey
d55e5bfc
RD
4004 def GetRawKeyCode(*args, **kwargs):
4005 """GetRawKeyCode(self) -> unsigned int"""
5b5c9bc7 4006 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
4007
4008 def GetRawKeyFlags(*args, **kwargs):
4009 """GetRawKeyFlags(self) -> unsigned int"""
5b5c9bc7 4010 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
4011
4012 def GetPosition(*args, **kwargs):
4013 """
5b5c9bc7 4014 GetPosition(self) -> Point
d55e5bfc
RD
4015
4016 Find the position of the event.
4017 """
5b5c9bc7 4018 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4019
4020 def GetPositionTuple(*args, **kwargs):
4021 """
4022 GetPositionTuple() -> (x,y)
4023
4024 Find the position of the event.
4025 """
5b5c9bc7 4026 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4027
4028 def GetX(*args, **kwargs):
4029 """GetX(self) -> int"""
5b5c9bc7 4030 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4031
4032 def GetY(*args, **kwargs):
4033 """GetY(self) -> int"""
5b5c9bc7
RD
4034 return _core_.KeyEvent_GetY(*args, **kwargs)
4035
4036 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4037 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4038 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4039 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4040 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4041 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4042 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4043 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4044 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4045 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
4046
4047class KeyEventPtr(KeyEvent):
d55e5bfc
RD
4048 def __init__(self, this):
4049 self.this = this
4050 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4051 self.__class__ = KeyEvent
4052_core_.KeyEvent_swigregister(KeyEventPtr)
d55e5bfc
RD
4053
4054#---------------------------------------------------------------------------
4055
5b5c9bc7
RD
4056class SizeEvent(Event):
4057 """Proxy of C++ SizeEvent class"""
d55e5bfc
RD
4058 def __repr__(self):
4059 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4060 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4061 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
4062 newobj = _core_.new_SizeEvent(*args, **kwargs)
d55e5bfc
RD
4063 self.this = newobj.this
4064 self.thisown = 1
4065 del newobj.thisown
4066 def GetSize(*args, **kwargs):
5b5c9bc7
RD
4067 """GetSize(self) -> Size"""
4068 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
4069
4070 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4071 """GetRect(self) -> Rect"""
4072 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4073
4074 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4075 """SetRect(self, Rect rect)"""
4076 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4077
4078 def SetSize(*args, **kwargs):
5b5c9bc7
RD
4079 """SetSize(self, Size size)"""
4080 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 4081
5b5c9bc7
RD
4082 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4083 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
d55e5bfc 4084
5b5c9bc7 4085class SizeEventPtr(SizeEvent):
d55e5bfc
RD
4086 def __init__(self, this):
4087 self.this = this
4088 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4089 self.__class__ = SizeEvent
4090_core_.SizeEvent_swigregister(SizeEventPtr)
d55e5bfc
RD
4091
4092#---------------------------------------------------------------------------
4093
5b5c9bc7
RD
4094class MoveEvent(Event):
4095 """Proxy of C++ MoveEvent class"""
d55e5bfc
RD
4096 def __repr__(self):
4097 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4098 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4099 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
4100 newobj = _core_.new_MoveEvent(*args, **kwargs)
d55e5bfc
RD
4101 self.this = newobj.this
4102 self.thisown = 1
4103 del newobj.thisown
4104 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
4105 """GetPosition(self) -> Point"""
4106 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4107
4108 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4109 """GetRect(self) -> Rect"""
4110 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4111
4112 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4113 """SetRect(self, Rect rect)"""
4114 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4115
4116 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
4117 """SetPosition(self, Point pos)"""
4118 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 4119
fef4c27a
RD
4120 m_pos = property(GetPosition, SetPosition)
4121 m_rect = property(GetRect, SetRect)
4122
d55e5bfc 4123
5b5c9bc7 4124class MoveEventPtr(MoveEvent):
d55e5bfc
RD
4125 def __init__(self, this):
4126 self.this = this
4127 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4128 self.__class__ = MoveEvent
4129_core_.MoveEvent_swigregister(MoveEventPtr)
d55e5bfc
RD
4130
4131#---------------------------------------------------------------------------
4132
5b5c9bc7
RD
4133class PaintEvent(Event):
4134 """Proxy of C++ PaintEvent class"""
d55e5bfc
RD
4135 def __repr__(self):
4136 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4137 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4138 """__init__(self, int Id=0) -> PaintEvent"""
4139 newobj = _core_.new_PaintEvent(*args, **kwargs)
d55e5bfc
RD
4140 self.this = newobj.this
4141 self.thisown = 1
4142 del newobj.thisown
4143
5b5c9bc7 4144class PaintEventPtr(PaintEvent):
d55e5bfc
RD
4145 def __init__(self, this):
4146 self.this = this
4147 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4148 self.__class__ = PaintEvent
4149_core_.PaintEvent_swigregister(PaintEventPtr)
d55e5bfc 4150
5b5c9bc7
RD
4151class NcPaintEvent(Event):
4152 """Proxy of C++ NcPaintEvent class"""
d55e5bfc
RD
4153 def __repr__(self):
4154 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4155 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4156 """__init__(self, int winid=0) -> NcPaintEvent"""
4157 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
d55e5bfc
RD
4158 self.this = newobj.this
4159 self.thisown = 1
4160 del newobj.thisown
4161
5b5c9bc7 4162class NcPaintEventPtr(NcPaintEvent):
d55e5bfc
RD
4163 def __init__(self, this):
4164 self.this = this
4165 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4166 self.__class__ = NcPaintEvent
4167_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
d55e5bfc
RD
4168
4169#---------------------------------------------------------------------------
4170
5b5c9bc7
RD
4171class EraseEvent(Event):
4172 """Proxy of C++ EraseEvent class"""
d55e5bfc
RD
4173 def __repr__(self):
4174 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4175 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4176 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
4177 newobj = _core_.new_EraseEvent(*args, **kwargs)
d55e5bfc
RD
4178 self.this = newobj.this
4179 self.thisown = 1
4180 del newobj.thisown
4181 def GetDC(*args, **kwargs):
5b5c9bc7
RD
4182 """GetDC(self) -> DC"""
4183 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc
RD
4184
4185
5b5c9bc7 4186class EraseEventPtr(EraseEvent):
d55e5bfc
RD
4187 def __init__(self, this):
4188 self.this = this
4189 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4190 self.__class__ = EraseEvent
4191_core_.EraseEvent_swigregister(EraseEventPtr)
d55e5bfc
RD
4192
4193#---------------------------------------------------------------------------
4194
5b5c9bc7
RD
4195class FocusEvent(Event):
4196 """Proxy of C++ FocusEvent class"""
d55e5bfc
RD
4197 def __repr__(self):
4198 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4199 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4200 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
4201 newobj = _core_.new_FocusEvent(*args, **kwargs)
d55e5bfc
RD
4202 self.this = newobj.this
4203 self.thisown = 1
4204 del newobj.thisown
4205 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
4206 """GetWindow(self) -> Window"""
4207 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
4208
4209 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
4210 """SetWindow(self, Window win)"""
4211 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc
RD
4212
4213
5b5c9bc7 4214class FocusEventPtr(FocusEvent):
d55e5bfc
RD
4215 def __init__(self, this):
4216 self.this = this
4217 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4218 self.__class__ = FocusEvent
4219_core_.FocusEvent_swigregister(FocusEventPtr)
d55e5bfc
RD
4220
4221#---------------------------------------------------------------------------
4222
5b5c9bc7
RD
4223class ChildFocusEvent(CommandEvent):
4224 """Proxy of C++ ChildFocusEvent class"""
d55e5bfc
RD
4225 def __repr__(self):
4226 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4227 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4228 """__init__(self, Window win=None) -> ChildFocusEvent"""
4229 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
d55e5bfc
RD
4230 self.this = newobj.this
4231 self.thisown = 1
4232 del newobj.thisown
4233 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
4234 """GetWindow(self) -> Window"""
4235 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
4236
4237
5b5c9bc7 4238class ChildFocusEventPtr(ChildFocusEvent):
d55e5bfc
RD
4239 def __init__(self, this):
4240 self.this = this
4241 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4242 self.__class__ = ChildFocusEvent
4243_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
d55e5bfc
RD
4244
4245#---------------------------------------------------------------------------
4246
5b5c9bc7
RD
4247class ActivateEvent(Event):
4248 """Proxy of C++ ActivateEvent class"""
d55e5bfc
RD
4249 def __repr__(self):
4250 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4251 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4252 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
4253 newobj = _core_.new_ActivateEvent(*args, **kwargs)
d55e5bfc
RD
4254 self.this = newobj.this
4255 self.thisown = 1
4256 del newobj.thisown
4257 def GetActive(*args, **kwargs):
4258 """GetActive(self) -> bool"""
5b5c9bc7 4259 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc
RD
4260
4261
5b5c9bc7 4262class ActivateEventPtr(ActivateEvent):
d55e5bfc
RD
4263 def __init__(self, this):
4264 self.this = this
4265 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4266 self.__class__ = ActivateEvent
4267_core_.ActivateEvent_swigregister(ActivateEventPtr)
d55e5bfc
RD
4268
4269#---------------------------------------------------------------------------
4270
5b5c9bc7
RD
4271class InitDialogEvent(Event):
4272 """Proxy of C++ InitDialogEvent class"""
d55e5bfc
RD
4273 def __repr__(self):
4274 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4275 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4276 """__init__(self, int Id=0) -> InitDialogEvent"""
4277 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
d55e5bfc
RD
4278 self.this = newobj.this
4279 self.thisown = 1
4280 del newobj.thisown
4281
5b5c9bc7 4282class InitDialogEventPtr(InitDialogEvent):
d55e5bfc
RD
4283 def __init__(self, this):
4284 self.this = this
4285 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4286 self.__class__ = InitDialogEvent
4287_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
d55e5bfc
RD
4288
4289#---------------------------------------------------------------------------
4290
5b5c9bc7
RD
4291class MenuEvent(Event):
4292 """Proxy of C++ MenuEvent class"""
d55e5bfc
RD
4293 def __repr__(self):
4294 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4295 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4296 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
4297 newobj = _core_.new_MenuEvent(*args, **kwargs)
d55e5bfc
RD
4298 self.this = newobj.this
4299 self.thisown = 1
4300 del newobj.thisown
4301 def GetMenuId(*args, **kwargs):
4302 """GetMenuId(self) -> int"""
5b5c9bc7 4303 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
4304
4305 def IsPopup(*args, **kwargs):
4306 """IsPopup(self) -> bool"""
5b5c9bc7 4307 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
4308
4309 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
4310 """GetMenu(self) -> Menu"""
4311 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc
RD
4312
4313
5b5c9bc7 4314class MenuEventPtr(MenuEvent):
d55e5bfc
RD
4315 def __init__(self, this):
4316 self.this = this
4317 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4318 self.__class__ = MenuEvent
4319_core_.MenuEvent_swigregister(MenuEventPtr)
d55e5bfc
RD
4320
4321#---------------------------------------------------------------------------
4322
5b5c9bc7
RD
4323class CloseEvent(Event):
4324 """Proxy of C++ CloseEvent class"""
d55e5bfc
RD
4325 def __repr__(self):
4326 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4327 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4328 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
4329 newobj = _core_.new_CloseEvent(*args, **kwargs)
d55e5bfc
RD
4330 self.this = newobj.this
4331 self.thisown = 1
4332 del newobj.thisown
4333 def SetLoggingOff(*args, **kwargs):
4334 """SetLoggingOff(self, bool logOff)"""
5b5c9bc7 4335 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
4336
4337 def GetLoggingOff(*args, **kwargs):
4338 """GetLoggingOff(self) -> bool"""
5b5c9bc7 4339 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
4340
4341 def Veto(*args, **kwargs):
4342 """Veto(self, bool veto=True)"""
5b5c9bc7 4343 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4344
4345 def SetCanVeto(*args, **kwargs):
4346 """SetCanVeto(self, bool canVeto)"""
5b5c9bc7 4347 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
4348
4349 def CanVeto(*args, **kwargs):
4350 """CanVeto(self) -> bool"""
5b5c9bc7 4351 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc
RD
4352
4353 def GetVeto(*args, **kwargs):
4354 """GetVeto(self) -> bool"""
5b5c9bc7 4355 return _core_.CloseEvent_GetVeto(*args, **kwargs)
d55e5bfc
RD
4356
4357
5b5c9bc7 4358class CloseEventPtr(CloseEvent):
d55e5bfc
RD
4359 def __init__(self, this):
4360 self.this = this
4361 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4362 self.__class__ = CloseEvent
4363_core_.CloseEvent_swigregister(CloseEventPtr)
d55e5bfc
RD
4364
4365#---------------------------------------------------------------------------
4366
5b5c9bc7
RD
4367class ShowEvent(Event):
4368 """Proxy of C++ ShowEvent class"""
d55e5bfc
RD
4369 def __repr__(self):
4370 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4371 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4372 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
4373 newobj = _core_.new_ShowEvent(*args, **kwargs)
d55e5bfc
RD
4374 self.this = newobj.this
4375 self.thisown = 1
4376 del newobj.thisown
4377 def SetShow(*args, **kwargs):
4378 """SetShow(self, bool show)"""
5b5c9bc7 4379 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
4380
4381 def GetShow(*args, **kwargs):
4382 """GetShow(self) -> bool"""
5b5c9bc7 4383 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc
RD
4384
4385
5b5c9bc7 4386class ShowEventPtr(ShowEvent):
d55e5bfc
RD
4387 def __init__(self, this):
4388 self.this = this
4389 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4390 self.__class__ = ShowEvent
4391_core_.ShowEvent_swigregister(ShowEventPtr)
d55e5bfc
RD
4392
4393#---------------------------------------------------------------------------
4394
5b5c9bc7
RD
4395class IconizeEvent(Event):
4396 """Proxy of C++ IconizeEvent class"""
d55e5bfc
RD
4397 def __repr__(self):
4398 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4399 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4400 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
4401 newobj = _core_.new_IconizeEvent(*args, **kwargs)
d55e5bfc
RD
4402 self.this = newobj.this
4403 self.thisown = 1
4404 del newobj.thisown
4405 def Iconized(*args, **kwargs):
4406 """Iconized(self) -> bool"""
5b5c9bc7 4407 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc
RD
4408
4409
5b5c9bc7 4410class IconizeEventPtr(IconizeEvent):
d55e5bfc
RD
4411 def __init__(self, this):
4412 self.this = this
4413 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4414 self.__class__ = IconizeEvent
4415_core_.IconizeEvent_swigregister(IconizeEventPtr)
d55e5bfc
RD
4416
4417#---------------------------------------------------------------------------
4418
5b5c9bc7
RD
4419class MaximizeEvent(Event):
4420 """Proxy of C++ MaximizeEvent class"""
d55e5bfc
RD
4421 def __repr__(self):
4422 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4423 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4424 """__init__(self, int id=0) -> MaximizeEvent"""
4425 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
d55e5bfc
RD
4426 self.this = newobj.this
4427 self.thisown = 1
4428 del newobj.thisown
4429
5b5c9bc7 4430class MaximizeEventPtr(MaximizeEvent):
d55e5bfc
RD
4431 def __init__(self, this):
4432 self.this = this
4433 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4434 self.__class__ = MaximizeEvent
4435_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
d55e5bfc
RD
4436
4437#---------------------------------------------------------------------------
4438
5b5c9bc7
RD
4439class DropFilesEvent(Event):
4440 """Proxy of C++ DropFilesEvent class"""
d55e5bfc
RD
4441 def __init__(self): raise RuntimeError, "No constructor defined"
4442 def __repr__(self):
4443 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4444 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
4445 """GetPosition(self) -> Point"""
4446 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4447
4448 def GetNumberOfFiles(*args, **kwargs):
4449 """GetNumberOfFiles(self) -> int"""
5b5c9bc7 4450 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
4451
4452 def GetFiles(*args, **kwargs):
4453 """GetFiles(self) -> PyObject"""
5b5c9bc7 4454 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc
RD
4455
4456
5b5c9bc7 4457class DropFilesEventPtr(DropFilesEvent):
d55e5bfc
RD
4458 def __init__(self, this):
4459 self.this = this
4460 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4461 self.__class__ = DropFilesEvent
4462_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
d55e5bfc
RD
4463
4464#---------------------------------------------------------------------------
4465
5b5c9bc7
RD
4466UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4467UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
4468class UpdateUIEvent(CommandEvent):
4469 """Proxy of C++ UpdateUIEvent class"""
d55e5bfc
RD
4470 def __repr__(self):
4471 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4472 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4473 """__init__(self, int commandId=0) -> UpdateUIEvent"""
4474 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
d55e5bfc
RD
4475 self.this = newobj.this
4476 self.thisown = 1
4477 del newobj.thisown
4478 def GetChecked(*args, **kwargs):
4479 """GetChecked(self) -> bool"""
5b5c9bc7 4480 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
4481
4482 def GetEnabled(*args, **kwargs):
4483 """GetEnabled(self) -> bool"""
5b5c9bc7 4484 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc
RD
4485
4486 def GetText(*args, **kwargs):
5b5c9bc7
RD
4487 """GetText(self) -> String"""
4488 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
4489
4490 def GetSetText(*args, **kwargs):
4491 """GetSetText(self) -> bool"""
5b5c9bc7 4492 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
4493
4494 def GetSetChecked(*args, **kwargs):
4495 """GetSetChecked(self) -> bool"""
5b5c9bc7 4496 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
4497
4498 def GetSetEnabled(*args, **kwargs):
4499 """GetSetEnabled(self) -> bool"""
5b5c9bc7 4500 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc
RD
4501
4502 def Check(*args, **kwargs):
4503 """Check(self, bool check)"""
5b5c9bc7 4504 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
4505
4506 def Enable(*args, **kwargs):
4507 """Enable(self, bool enable)"""
5b5c9bc7 4508 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc
RD
4509
4510 def SetText(*args, **kwargs):
5b5c9bc7
RD
4511 """SetText(self, String text)"""
4512 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
4513
4514 def SetUpdateInterval(*args, **kwargs):
d6c14a4c 4515 """SetUpdateInterval(long updateInterval)"""
5b5c9bc7 4516 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
4517
4518 SetUpdateInterval = staticmethod(SetUpdateInterval)
4519 def GetUpdateInterval(*args, **kwargs):
d6c14a4c 4520 """GetUpdateInterval() -> long"""
5b5c9bc7 4521 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
4522
4523 GetUpdateInterval = staticmethod(GetUpdateInterval)
4524 def CanUpdate(*args, **kwargs):
5b5c9bc7
RD
4525 """CanUpdate(Window win) -> bool"""
4526 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
4527
4528 CanUpdate = staticmethod(CanUpdate)
4529 def ResetUpdateTime(*args, **kwargs):
d6c14a4c 4530 """ResetUpdateTime()"""
5b5c9bc7 4531 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
4532
4533 ResetUpdateTime = staticmethod(ResetUpdateTime)
4534 def SetMode(*args, **kwargs):
d6c14a4c 4535 """SetMode(int mode)"""
5b5c9bc7 4536 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
4537
4538 SetMode = staticmethod(SetMode)
4539 def GetMode(*args, **kwargs):
d6c14a4c 4540 """GetMode() -> int"""
5b5c9bc7 4541 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
4542
4543 GetMode = staticmethod(GetMode)
4544
5b5c9bc7 4545class UpdateUIEventPtr(UpdateUIEvent):
d55e5bfc
RD
4546 def __init__(self, this):
4547 self.this = this
4548 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4549 self.__class__ = UpdateUIEvent
4550_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
d55e5bfc 4551
5b5c9bc7
RD
4552def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4553 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
4554 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 4555
5b5c9bc7
RD
4556def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4557 """UpdateUIEvent_GetUpdateInterval() -> long"""
4558 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc 4559
5b5c9bc7
RD
4560def UpdateUIEvent_CanUpdate(*args, **kwargs):
4561 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
4562 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 4563
5b5c9bc7
RD
4564def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4565 """UpdateUIEvent_ResetUpdateTime()"""
4566 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc 4567
5b5c9bc7
RD
4568def UpdateUIEvent_SetMode(*args, **kwargs):
4569 """UpdateUIEvent_SetMode(int mode)"""
4570 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 4571
5b5c9bc7
RD
4572def UpdateUIEvent_GetMode(*args, **kwargs):
4573 """UpdateUIEvent_GetMode() -> int"""
4574 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
4575
4576#---------------------------------------------------------------------------
4577
5b5c9bc7
RD
4578class SysColourChangedEvent(Event):
4579 """Proxy of C++ SysColourChangedEvent class"""
d55e5bfc
RD
4580 def __repr__(self):
4581 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4582 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4583 """__init__(self) -> SysColourChangedEvent"""
4584 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
d55e5bfc
RD
4585 self.this = newobj.this
4586 self.thisown = 1
4587 del newobj.thisown
4588
5b5c9bc7 4589class SysColourChangedEventPtr(SysColourChangedEvent):
d55e5bfc
RD
4590 def __init__(self, this):
4591 self.this = this
4592 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4593 self.__class__ = SysColourChangedEvent
4594_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
d55e5bfc
RD
4595
4596#---------------------------------------------------------------------------
4597
5b5c9bc7
RD
4598class MouseCaptureChangedEvent(Event):
4599 """Proxy of C++ MouseCaptureChangedEvent class"""
d55e5bfc
RD
4600 def __repr__(self):
4601 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4602 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4603 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
4604 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
d55e5bfc
RD
4605 self.this = newobj.this
4606 self.thisown = 1
4607 del newobj.thisown
4608 def GetCapturedWindow(*args, **kwargs):
5b5c9bc7
RD
4609 """GetCapturedWindow(self) -> Window"""
4610 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc
RD
4611
4612
5b5c9bc7 4613class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
d55e5bfc
RD
4614 def __init__(self, this):
4615 self.this = this
4616 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4617 self.__class__ = MouseCaptureChangedEvent
4618_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
d55e5bfc
RD
4619
4620#---------------------------------------------------------------------------
4621
5b5c9bc7
RD
4622class DisplayChangedEvent(Event):
4623 """Proxy of C++ DisplayChangedEvent class"""
d55e5bfc
RD
4624 def __repr__(self):
4625 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4626 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4627 """__init__(self) -> DisplayChangedEvent"""
4628 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
d55e5bfc
RD
4629 self.this = newobj.this
4630 self.thisown = 1
4631 del newobj.thisown
4632
5b5c9bc7 4633class DisplayChangedEventPtr(DisplayChangedEvent):
d55e5bfc
RD
4634 def __init__(self, this):
4635 self.this = this
4636 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4637 self.__class__ = DisplayChangedEvent
4638_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
d55e5bfc
RD
4639
4640#---------------------------------------------------------------------------
4641
5b5c9bc7
RD
4642class PaletteChangedEvent(Event):
4643 """Proxy of C++ PaletteChangedEvent class"""
d55e5bfc
RD
4644 def __repr__(self):
4645 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4646 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4647 """__init__(self, int id=0) -> PaletteChangedEvent"""
4648 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
d55e5bfc
RD
4649 self.this = newobj.this
4650 self.thisown = 1
4651 del newobj.thisown
4652 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
4653 """SetChangedWindow(self, Window win)"""
4654 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
4655
4656 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
4657 """GetChangedWindow(self) -> Window"""
4658 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc
RD
4659
4660
5b5c9bc7 4661class PaletteChangedEventPtr(PaletteChangedEvent):
d55e5bfc
RD
4662 def __init__(self, this):
4663 self.this = this
4664 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4665 self.__class__ = PaletteChangedEvent
4666_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
d55e5bfc
RD
4667
4668#---------------------------------------------------------------------------
4669
5b5c9bc7
RD
4670class QueryNewPaletteEvent(Event):
4671 """Proxy of C++ QueryNewPaletteEvent class"""
d55e5bfc
RD
4672 def __repr__(self):
4673 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4674 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4675 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
4676 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
d55e5bfc
RD
4677 self.this = newobj.this
4678 self.thisown = 1
4679 del newobj.thisown
4680 def SetPaletteRealized(*args, **kwargs):
4681 """SetPaletteRealized(self, bool realized)"""
5b5c9bc7 4682 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
4683
4684 def GetPaletteRealized(*args, **kwargs):
4685 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 4686 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
4687
4688
5b5c9bc7 4689class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
d55e5bfc
RD
4690 def __init__(self, this):
4691 self.this = this
4692 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4693 self.__class__ = QueryNewPaletteEvent
4694_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
d55e5bfc
RD
4695
4696#---------------------------------------------------------------------------
4697
5b5c9bc7
RD
4698class NavigationKeyEvent(Event):
4699 """Proxy of C++ NavigationKeyEvent class"""
d55e5bfc
RD
4700 def __repr__(self):
4701 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4702 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4703 """__init__(self) -> NavigationKeyEvent"""
4704 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
d55e5bfc
RD
4705 self.this = newobj.this
4706 self.thisown = 1
4707 del newobj.thisown
4708 def GetDirection(*args, **kwargs):
4709 """GetDirection(self) -> bool"""
5b5c9bc7 4710 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
4711
4712 def SetDirection(*args, **kwargs):
908b74cd 4713 """SetDirection(self, bool forward)"""
5b5c9bc7 4714 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
4715
4716 def IsWindowChange(*args, **kwargs):
4717 """IsWindowChange(self) -> bool"""
5b5c9bc7 4718 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
4719
4720 def SetWindowChange(*args, **kwargs):
908b74cd 4721 """SetWindowChange(self, bool ischange)"""
5b5c9bc7 4722 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 4723
68350608
RD
4724 def IsFromTab(*args, **kwargs):
4725 """IsFromTab(self) -> bool"""
5b5c9bc7 4726 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
4727
4728 def SetFromTab(*args, **kwargs):
4729 """SetFromTab(self, bool bIs)"""
5b5c9bc7 4730 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 4731
908b74cd
RD
4732 def SetFlags(*args, **kwargs):
4733 """SetFlags(self, long flags)"""
5b5c9bc7 4734 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 4735
d55e5bfc 4736 def GetCurrentFocus(*args, **kwargs):
5b5c9bc7
RD
4737 """GetCurrentFocus(self) -> Window"""
4738 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
4739
4740 def SetCurrentFocus(*args, **kwargs):
5b5c9bc7
RD
4741 """SetCurrentFocus(self, Window win)"""
4742 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 4743
5b5c9bc7
RD
4744 IsBackward = _core_.NavigationKeyEvent_IsBackward
4745 IsForward = _core_.NavigationKeyEvent_IsForward
4746 WinChange = _core_.NavigationKeyEvent_WinChange
4747 FromTab = _core_.NavigationKeyEvent_FromTab
d55e5bfc 4748
5b5c9bc7 4749class NavigationKeyEventPtr(NavigationKeyEvent):
d55e5bfc
RD
4750 def __init__(self, this):
4751 self.this = this
4752 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4753 self.__class__ = NavigationKeyEvent
4754_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
d55e5bfc
RD
4755
4756#---------------------------------------------------------------------------
4757
5b5c9bc7
RD
4758class WindowCreateEvent(CommandEvent):
4759 """Proxy of C++ WindowCreateEvent class"""
d55e5bfc
RD
4760 def __repr__(self):
4761 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4762 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4763 """__init__(self, Window win=None) -> WindowCreateEvent"""
4764 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
d55e5bfc
RD
4765 self.this = newobj.this
4766 self.thisown = 1
4767 del newobj.thisown
4768 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
4769 """GetWindow(self) -> Window"""
4770 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
4771
4772
5b5c9bc7 4773class WindowCreateEventPtr(WindowCreateEvent):
d55e5bfc
RD
4774 def __init__(self, this):
4775 self.this = this
4776 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4777 self.__class__ = WindowCreateEvent
4778_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
d55e5bfc 4779
5b5c9bc7
RD
4780class WindowDestroyEvent(CommandEvent):
4781 """Proxy of C++ WindowDestroyEvent class"""
d55e5bfc
RD
4782 def __repr__(self):
4783 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4784 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4785 """__init__(self, Window win=None) -> WindowDestroyEvent"""
4786 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
d55e5bfc
RD
4787 self.this = newobj.this
4788 self.thisown = 1
4789 del newobj.thisown
4790 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
4791 """GetWindow(self) -> Window"""
4792 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
4793
4794
5b5c9bc7 4795class WindowDestroyEventPtr(WindowDestroyEvent):
d55e5bfc
RD
4796 def __init__(self, this):
4797 self.this = this
4798 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4799 self.__class__ = WindowDestroyEvent
4800_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
d55e5bfc
RD
4801
4802#---------------------------------------------------------------------------
4803
5b5c9bc7
RD
4804class ContextMenuEvent(CommandEvent):
4805 """Proxy of C++ ContextMenuEvent class"""
d55e5bfc
RD
4806 def __repr__(self):
4807 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4808 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4809 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
4810 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
d55e5bfc
RD
4811 self.this = newobj.this
4812 self.thisown = 1
4813 del newobj.thisown
4814 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
4815 """GetPosition(self) -> Point"""
4816 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4817
4818 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
4819 """SetPosition(self, Point pos)"""
4820 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
4821
4822
5b5c9bc7 4823class ContextMenuEventPtr(ContextMenuEvent):
d55e5bfc
RD
4824 def __init__(self, this):
4825 self.this = this
4826 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4827 self.__class__ = ContextMenuEvent
4828_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
d55e5bfc
RD
4829
4830#---------------------------------------------------------------------------
4831
5b5c9bc7
RD
4832IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4833IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
4834class IdleEvent(Event):
4835 """Proxy of C++ IdleEvent class"""
d55e5bfc
RD
4836 def __repr__(self):
4837 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4838 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4839 """__init__(self) -> IdleEvent"""
4840 newobj = _core_.new_IdleEvent(*args, **kwargs)
d55e5bfc
RD
4841 self.this = newobj.this
4842 self.thisown = 1
4843 del newobj.thisown
4844 def RequestMore(*args, **kwargs):
4845 """RequestMore(self, bool needMore=True)"""
5b5c9bc7 4846 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
4847
4848 def MoreRequested(*args, **kwargs):
4849 """MoreRequested(self) -> bool"""
5b5c9bc7 4850 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
4851
4852 def SetMode(*args, **kwargs):
d6c14a4c 4853 """SetMode(int mode)"""
5b5c9bc7 4854 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
4855
4856 SetMode = staticmethod(SetMode)
4857 def GetMode(*args, **kwargs):
d6c14a4c 4858 """GetMode() -> int"""
5b5c9bc7 4859 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
4860
4861 GetMode = staticmethod(GetMode)
4862 def CanSend(*args, **kwargs):
5b5c9bc7
RD
4863 """CanSend(Window win) -> bool"""
4864 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
4865
4866 CanSend = staticmethod(CanSend)
4867
5b5c9bc7 4868class IdleEventPtr(IdleEvent):
d55e5bfc
RD
4869 def __init__(self, this):
4870 self.this = this
4871 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4872 self.__class__ = IdleEvent
4873_core_.IdleEvent_swigregister(IdleEventPtr)
d55e5bfc 4874
5b5c9bc7
RD
4875def IdleEvent_SetMode(*args, **kwargs):
4876 """IdleEvent_SetMode(int mode)"""
4877 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 4878
5b5c9bc7
RD
4879def IdleEvent_GetMode(*args, **kwargs):
4880 """IdleEvent_GetMode() -> int"""
4881 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc 4882
5b5c9bc7
RD
4883def IdleEvent_CanSend(*args, **kwargs):
4884 """IdleEvent_CanSend(Window win) -> bool"""
4885 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
4886
4887#---------------------------------------------------------------------------
4888
5b5c9bc7
RD
4889class PyEvent(Event):
4890 """Proxy of C++ PyEvent class"""
d55e5bfc
RD
4891 def __repr__(self):
4892 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4893 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4894 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
4895 newobj = _core_.new_PyEvent(*args, **kwargs)
d55e5bfc
RD
4896 self.this = newobj.this
4897 self.thisown = 1
4898 del newobj.thisown
4899 self.SetSelf(self)
4900
5b5c9bc7 4901 def __del__(self, destroy=_core_.delete_PyEvent):
d55e5bfc
RD
4902 """__del__(self)"""
4903 try:
4904 if self.thisown: destroy(self)
4905 except: pass
4906
4907 def SetSelf(*args, **kwargs):
4908 """SetSelf(self, PyObject self)"""
5b5c9bc7 4909 return _core_.PyEvent_SetSelf(*args, **kwargs)
d55e5bfc
RD
4910
4911 def GetSelf(*args, **kwargs):
4912 """GetSelf(self) -> PyObject"""
5b5c9bc7 4913 return _core_.PyEvent_GetSelf(*args, **kwargs)
d55e5bfc
RD
4914
4915
5b5c9bc7 4916class PyEventPtr(PyEvent):
d55e5bfc
RD
4917 def __init__(self, this):
4918 self.this = this
4919 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4920 self.__class__ = PyEvent
4921_core_.PyEvent_swigregister(PyEventPtr)
d55e5bfc 4922
5b5c9bc7
RD
4923class PyCommandEvent(CommandEvent):
4924 """Proxy of C++ PyCommandEvent class"""
d55e5bfc
RD
4925 def __repr__(self):
4926 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4927 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4928 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
4929 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
d55e5bfc
RD
4930 self.this = newobj.this
4931 self.thisown = 1
4932 del newobj.thisown
4933 self.SetSelf(self)
4934
5b5c9bc7 4935 def __del__(self, destroy=_core_.delete_PyCommandEvent):
d55e5bfc
RD
4936 """__del__(self)"""
4937 try:
4938 if self.thisown: destroy(self)
4939 except: pass
4940
4941 def SetSelf(*args, **kwargs):
4942 """SetSelf(self, PyObject self)"""
5b5c9bc7 4943 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
d55e5bfc
RD
4944
4945 def GetSelf(*args, **kwargs):
4946 """GetSelf(self) -> PyObject"""
5b5c9bc7 4947 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
d55e5bfc
RD
4948
4949
5b5c9bc7 4950class PyCommandEventPtr(PyCommandEvent):
d55e5bfc
RD
4951 def __init__(self, this):
4952 self.this = this
4953 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4954 self.__class__ = PyCommandEvent
4955_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
d55e5bfc 4956
5b5c9bc7
RD
4957class DateEvent(CommandEvent):
4958 """Proxy of C++ DateEvent class"""
53aa7709
RD
4959 def __repr__(self):
4960 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4961 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
4962 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
4963 newobj = _core_.new_DateEvent(*args, **kwargs)
53aa7709
RD
4964 self.this = newobj.this
4965 self.thisown = 1
4966 del newobj.thisown
4967 def GetDate(*args, **kwargs):
5b5c9bc7
RD
4968 """GetDate(self) -> DateTime"""
4969 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
4970
4971 def SetDate(*args, **kwargs):
5b5c9bc7
RD
4972 """SetDate(self, DateTime date)"""
4973 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709
RD
4974
4975
5b5c9bc7 4976class DateEventPtr(DateEvent):
53aa7709
RD
4977 def __init__(self, this):
4978 self.this = this
4979 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4980 self.__class__ = DateEvent
4981_core_.DateEvent_swigregister(DateEventPtr)
53aa7709 4982
5b5c9bc7 4983wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
4984EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
4985
d55e5bfc
RD
4986#---------------------------------------------------------------------------
4987
5b5c9bc7
RD
4988PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4989PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4990PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4991PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4992PRINT_WINDOWS = _core_.PRINT_WINDOWS
4993PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
4994class PyApp(EvtHandler):
d6c14a4c
RD
4995 """
4996 The ``wx.PyApp`` class is an *implementation detail*, please use the
4997 `wx.App` class (or some other derived class) instead.
4998 """
d55e5bfc
RD
4999 def __repr__(self):
5000 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5001 def __init__(self, *args, **kwargs):
5002 """
5b5c9bc7 5003 __init__(self) -> PyApp
d55e5bfc
RD
5004
5005 Create a new application object, starting the bootstrap process.
5006 """
5b5c9bc7 5007 newobj = _core_.new_PyApp(*args, **kwargs)
d55e5bfc
RD
5008 self.this = newobj.this
5009 self.thisown = 1
5010 del newobj.thisown
5011 self._setCallbackInfo(self, PyApp)
5012 self._setOORInfo(self)
5013
5b5c9bc7 5014 def __del__(self, destroy=_core_.delete_PyApp):
d55e5bfc
RD
5015 """__del__(self)"""
5016 try:
5017 if self.thisown: destroy(self)
5018 except: pass
5019
5020 def _setCallbackInfo(*args, **kwargs):
5021 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 5022 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
5023
5024 def GetAppName(*args, **kwargs):
5025 """
5b5c9bc7 5026 GetAppName(self) -> String
d55e5bfc
RD
5027
5028 Get the application name.
5029 """
5b5c9bc7 5030 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
5031
5032 def SetAppName(*args, **kwargs):
5033 """
5b5c9bc7 5034 SetAppName(self, String name)
d55e5bfc 5035
d6c14a4c
RD
5036 Set the application name. This value may be used automatically by
5037 `wx.Config` and such.
d55e5bfc 5038 """
5b5c9bc7 5039 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
5040
5041 def GetClassName(*args, **kwargs):
5042 """
5b5c9bc7 5043 GetClassName(self) -> String
d55e5bfc
RD
5044
5045 Get the application's class name.
5046 """
5b5c9bc7 5047 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
5048
5049 def SetClassName(*args, **kwargs):
5050 """
5b5c9bc7 5051 SetClassName(self, String name)
d55e5bfc 5052
d6c14a4c
RD
5053 Set the application's class name. This value may be used for
5054 X-resources if applicable for the platform
d55e5bfc 5055 """
5b5c9bc7 5056 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
5057
5058 def GetVendorName(*args, **kwargs):
5059 """
5b5c9bc7 5060 GetVendorName(self) -> String
d55e5bfc
RD
5061
5062 Get the application's vendor name.
5063 """
5b5c9bc7 5064 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
5065
5066 def SetVendorName(*args, **kwargs):
5067 """
5b5c9bc7 5068 SetVendorName(self, String name)
d55e5bfc 5069
d6c14a4c
RD
5070 Set the application's vendor name. This value may be used
5071 automatically by `wx.Config` and such.
d55e5bfc 5072 """
5b5c9bc7 5073 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
5074
5075 def GetTraits(*args, **kwargs):
5076 """
5077 GetTraits(self) -> wxAppTraits
5078
d6c14a4c
RD
5079 Return (and create if necessary) the app traits object to which we
5080 delegate for everything which either should be configurable by the
5081 user (then he can change the default behaviour simply by overriding
5082 CreateTraits() and returning his own traits object) or which is
5083 GUI/console dependent as then wx.AppTraits allows us to abstract the
5084 differences behind the common facade.
5085
5086 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 5087 """
5b5c9bc7 5088 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
5089
5090 def ProcessPendingEvents(*args, **kwargs):
5091 """
5092 ProcessPendingEvents(self)
5093
d6c14a4c
RD
5094 Process all events in the Pending Events list -- it is necessary to
5095 call this function to process posted events. This normally happens
5096 during each event loop iteration.
d55e5bfc 5097 """
5b5c9bc7 5098 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
5099
5100 def Yield(*args, **kwargs):
5101 """
5102 Yield(self, bool onlyIfNeeded=False) -> bool
5103
d6c14a4c
RD
5104 Process all currently pending events right now, instead of waiting
5105 until return to the event loop. It is an error to call ``Yield``
5106 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 5107
d6c14a4c 5108 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
5109 reentrancies (i.e. when called from an event handler it may
5110 result in calling the same event handler again), use with
5111 extreme care or, better, don't use at all!
d55e5bfc 5112
d6c14a4c 5113 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 5114
d55e5bfc 5115 """
5b5c9bc7 5116 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
5117
5118 def WakeUpIdle(*args, **kwargs):
5119 """
5120 WakeUpIdle(self)
5121
d6c14a4c
RD
5122 Make sure that idle events are sent again.
5123 :see: `wx.WakeUpIdle`
d55e5bfc 5124 """
5b5c9bc7 5125 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 5126
84f85550
RD
5127 def IsMainLoopRunning(*args, **kwargs):
5128 """
5129 IsMainLoopRunning() -> bool
5130
5131 Returns True if we're running the main loop, i.e. if the events can
5132 currently be dispatched.
5133 """
5b5c9bc7 5134 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
5135
5136 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
5137 def MainLoop(*args, **kwargs):
5138 """
5139 MainLoop(self) -> int
5140
d6c14a4c
RD
5141 Execute the main GUI loop, the function doesn't normally return until
5142 all top level windows have been closed and destroyed.
d55e5bfc 5143 """
5b5c9bc7 5144 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
5145
5146 def Exit(*args, **kwargs):
5147 """
5148 Exit(self)
5149
5150 Exit the main loop thus terminating the application.
d6c14a4c 5151 :see: `wx.Exit`
d55e5bfc 5152 """
5b5c9bc7 5153 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc
RD
5154
5155 def ExitMainLoop(*args, **kwargs):
5156 """
5157 ExitMainLoop(self)
5158
d6c14a4c
RD
5159 Exit the main GUI loop during the next iteration of the main
5160 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 5161 """
5b5c9bc7 5162 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
5163
5164 def Pending(*args, **kwargs):
5165 """
5166 Pending(self) -> bool
5167
5168 Returns True if there are unprocessed events in the event queue.
5169 """
5b5c9bc7 5170 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
5171
5172 def Dispatch(*args, **kwargs):
5173 """
5174 Dispatch(self) -> bool
5175
5176 Process the first event in the event queue (blocks until an event
5177 appears if there are none currently)
5178 """
5b5c9bc7 5179 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
5180
5181 def ProcessIdle(*args, **kwargs):
5182 """
5183 ProcessIdle(self) -> bool
5184
d6c14a4c
RD
5185 Called from the MainLoop when the application becomes idle (there are
5186 no pending events) and sends a `wx.IdleEvent` to all interested
5187 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 5188 """
5b5c9bc7 5189 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
5190
5191 def SendIdleEvents(*args, **kwargs):
5192 """
5b5c9bc7 5193 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 5194
d6c14a4c
RD
5195 Send idle event to window and all subwindows. Returns True if more
5196 idle time is requested.
d55e5bfc 5197 """
5b5c9bc7 5198 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
5199
5200 def IsActive(*args, **kwargs):
5201 """
5202 IsActive(self) -> bool
5203
5204 Return True if our app has focus.
5205 """
5b5c9bc7 5206 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
5207
5208 def SetTopWindow(*args, **kwargs):
5209 """
5b5c9bc7 5210 SetTopWindow(self, Window win)
d55e5bfc 5211
d6c14a4c 5212 Set the *main* top level window
d55e5bfc 5213 """
5b5c9bc7 5214 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
5215
5216 def GetTopWindow(*args, **kwargs):
5217 """
5b5c9bc7 5218 GetTopWindow(self) -> Window
d55e5bfc 5219
d6c14a4c
RD
5220 Return the *main* top level window (if it hadn't been set previously
5221 with SetTopWindow(), will return just some top level window and, if
5222 there not any, will return None)
d55e5bfc 5223 """
5b5c9bc7 5224 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
5225
5226 def SetExitOnFrameDelete(*args, **kwargs):
5227 """
5228 SetExitOnFrameDelete(self, bool flag)
5229
d6c14a4c
RD
5230 Control the exit behaviour: by default, the program will exit the main
5231 loop (and so, usually, terminate) when the last top-level program
5232 window is deleted. Beware that if you disable this behaviour (with
5233 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
5234 explicitly from somewhere.
d55e5bfc 5235 """
5b5c9bc7 5236 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
5237
5238 def GetExitOnFrameDelete(*args, **kwargs):
5239 """
5240 GetExitOnFrameDelete(self) -> bool
5241
5242 Get the current exit behaviour setting.
5243 """
5b5c9bc7 5244 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
5245
5246 def SetUseBestVisual(*args, **kwargs):
5247 """
5248 SetUseBestVisual(self, bool flag)
5249
d6c14a4c
RD
5250 Set whether the app should try to use the best available visual on
5251 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 5252 """
5b5c9bc7 5253 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
5254
5255 def GetUseBestVisual(*args, **kwargs):
5256 """
5257 GetUseBestVisual(self) -> bool
5258
5259 Get current UseBestVisual setting.
5260 """
5b5c9bc7 5261 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
5262
5263 def SetPrintMode(*args, **kwargs):
5264 """SetPrintMode(self, int mode)"""
5b5c9bc7 5265 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
5266
5267 def GetPrintMode(*args, **kwargs):
5268 """GetPrintMode(self) -> int"""
5b5c9bc7 5269 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
5270
5271 def SetAssertMode(*args, **kwargs):
5272 """
5273 SetAssertMode(self, int mode)
5274
15817c7e 5275 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 5276 """
5b5c9bc7 5277 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
5278
5279 def GetAssertMode(*args, **kwargs):
5280 """
5281 GetAssertMode(self) -> int
5282
5283 Get the current OnAssert behaviour setting.
5284 """
5b5c9bc7 5285 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
5286
5287 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 5288 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 5289 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
5290
5291 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
5292 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 5293 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 5294 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
5295
5296 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
5297 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 5298 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 5299 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
5300
5301 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
5302 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 5303 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 5304 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
5305
5306 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
5307 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
5308 """GetMacHelpMenuTitleName() -> String"""
5309 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
5310
5311 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
5312 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 5313 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 5314 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
5315
5316 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
5317 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 5318 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 5319 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
5320
5321 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
5322 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 5323 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 5324 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
5325
5326 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
5327 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 5328 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 5329 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
5330
5331 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
5332 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
5333 """SetMacHelpMenuTitleName(String val)"""
5334 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
5335
5336 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
5337 def _BootstrapApp(*args, **kwargs):
5338 """
5339 _BootstrapApp(self)
5340
5341 For internal use only
5342 """
5b5c9bc7 5343 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
5344
5345 def GetComCtl32Version(*args, **kwargs):
5346 """
d6c14a4c 5347 GetComCtl32Version() -> int
d55e5bfc 5348
d6c14a4c
RD
5349 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5350 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 5351 """
5b5c9bc7 5352 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
5353
5354 GetComCtl32Version = staticmethod(GetComCtl32Version)
5355
5b5c9bc7 5356class PyAppPtr(PyApp):
d55e5bfc
RD
5357 def __init__(self, this):
5358 self.this = this
5359 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5360 self.__class__ = PyApp
5361_core_.PyApp_swigregister(PyAppPtr)
d55e5bfc 5362
5b5c9bc7 5363def PyApp_IsMainLoopRunning(*args, **kwargs):
84f85550 5364 """
5b5c9bc7 5365 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
5366
5367 Returns True if we're running the main loop, i.e. if the events can
5368 currently be dispatched.
5369 """
5b5c9bc7 5370 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550 5371
5b5c9bc7
RD
5372def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
5373 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
5374 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 5375
5b5c9bc7
RD
5376def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
5377 """PyApp_GetMacAboutMenuItemId() -> long"""
5378 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 5379
5b5c9bc7
RD
5380def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
5381 """PyApp_GetMacPreferencesMenuItemId() -> long"""
5382 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 5383
5b5c9bc7
RD
5384def PyApp_GetMacExitMenuItemId(*args, **kwargs):
5385 """PyApp_GetMacExitMenuItemId() -> long"""
5386 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 5387
5b5c9bc7
RD
5388def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
5389 """PyApp_GetMacHelpMenuTitleName() -> String"""
5390 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 5391
5b5c9bc7
RD
5392def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
5393 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
5394 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 5395
5b5c9bc7
RD
5396def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
5397 """PyApp_SetMacAboutMenuItemId(long val)"""
5398 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 5399
5b5c9bc7
RD
5400def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
5401 """PyApp_SetMacPreferencesMenuItemId(long val)"""
5402 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 5403
5b5c9bc7
RD
5404def PyApp_SetMacExitMenuItemId(*args, **kwargs):
5405 """PyApp_SetMacExitMenuItemId(long val)"""
5406 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 5407
5b5c9bc7
RD
5408def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
5409 """PyApp_SetMacHelpMenuTitleName(String val)"""
5410 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 5411
5b5c9bc7 5412def PyApp_GetComCtl32Version(*args, **kwargs):
d55e5bfc 5413 """
5b5c9bc7 5414 PyApp_GetComCtl32Version() -> int
d55e5bfc 5415
d6c14a4c
RD
5416 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5417 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 5418 """
5b5c9bc7 5419 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
5420
5421#---------------------------------------------------------------------------
5422
5423
5b5c9bc7 5424def Exit(*args, **kwargs):
d55e5bfc 5425 """
5b5c9bc7 5426 Exit()
d55e5bfc
RD
5427
5428 Force an exit of the application. Convenience for wx.GetApp().Exit()
5429 """
5b5c9bc7 5430 return _core_.Exit(*args, **kwargs)
d55e5bfc 5431
5b5c9bc7 5432def Yield(*args, **kwargs):
d55e5bfc 5433 """
5b5c9bc7 5434 Yield() -> bool
d55e5bfc
RD
5435
5436 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
5437 """
5b5c9bc7 5438 return _core_.Yield(*args, **kwargs)
d55e5bfc 5439
5b5c9bc7 5440def YieldIfNeeded(*args, **kwargs):
d55e5bfc 5441 """
5b5c9bc7 5442 YieldIfNeeded() -> bool
d55e5bfc
RD
5443
5444 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
5445 """
5b5c9bc7 5446 return _core_.YieldIfNeeded(*args, **kwargs)
d55e5bfc 5447
5b5c9bc7 5448def SafeYield(*args, **kwargs):
d55e5bfc 5449 """
5b5c9bc7 5450 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 5451
d6c14a4c
RD
5452 This function is similar to `wx.Yield`, except that it disables the
5453 user input to all program windows before calling `wx.Yield` and
5454 re-enables it again afterwards. If ``win`` is not None, this window
5455 will remain enabled, allowing the implementation of some limited user
5456 interaction.
d55e5bfc 5457
d6c14a4c 5458 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 5459 """
5b5c9bc7 5460 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 5461
5b5c9bc7 5462def WakeUpIdle(*args, **kwargs):
d55e5bfc 5463 """
5b5c9bc7 5464 WakeUpIdle()
d55e5bfc 5465
d6c14a4c
RD
5466 Cause the message queue to become empty again, so idle events will be
5467 sent.
d55e5bfc 5468 """
5b5c9bc7 5469 return _core_.WakeUpIdle(*args, **kwargs)
d55e5bfc 5470
5b5c9bc7 5471def PostEvent(*args, **kwargs):
d55e5bfc 5472 """
5b5c9bc7 5473 PostEvent(EvtHandler dest, Event event)
d55e5bfc 5474
d6c14a4c
RD
5475 Send an event to a window or other wx.EvtHandler to be processed
5476 later.
d55e5bfc 5477 """
5b5c9bc7 5478 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 5479
5b5c9bc7 5480def App_CleanUp(*args, **kwargs):
d55e5bfc 5481 """
5b5c9bc7 5482 App_CleanUp()
d55e5bfc 5483
15817c7e 5484 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 5485 Python shuts down.
d55e5bfc 5486 """
5b5c9bc7 5487 return _core_.App_CleanUp(*args, **kwargs)
d55e5bfc
RD
5488
5489def GetApp(*args, **kwargs):
5490 """
5b5c9bc7 5491 GetApp() -> PyApp
d55e5bfc
RD
5492
5493 Return a reference to the current wx.App object.
5494 """
5b5c9bc7 5495 return _core_.GetApp(*args, **kwargs)
5cbf236d 5496
5b5c9bc7 5497def SetDefaultPyEncoding(*args, **kwargs):
5cbf236d
RD
5498 """
5499 SetDefaultPyEncoding(string encoding)
5500
5501 Sets the encoding that wxPython will use when it needs to convert a
5502 Python string or unicode object to or from a wxString.
62d32a5f
RD
5503
5504 The default encoding is the value of ``locale.getdefaultlocale()[1]``
5505 but please be aware that the default encoding within the same locale
5506 may be slightly different on different platforms. For example, please
5507 see http://www.alanwood.net/demos/charsetdiffs.html for differences
5508 between the common latin/roman encodings.
5cbf236d 5509 """
5b5c9bc7 5510 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 5511
5b5c9bc7 5512def GetDefaultPyEncoding(*args, **kwargs):
5cbf236d
RD
5513 """
5514 GetDefaultPyEncoding() -> string
5515
5516 Gets the current encoding that wxPython will use when it needs to
5517 convert a Python string or unicode object to or from a wxString.
5518 """
5b5c9bc7 5519 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d55e5bfc
RD
5520#----------------------------------------------------------------------
5521
5522class PyOnDemandOutputWindow:
5523 """
5524 A class that can be used for redirecting Python's stdout and
5525 stderr streams. It will do nothing until something is wrriten to
5526 the stream at which point it will create a Frame with a text area
5527 and write the text there.
5528 """
5529 def __init__(self, title = "wxPython: stdout/stderr"):
5530 self.frame = None
5531 self.title = title
412d302d
RD
5532 self.pos = wx.DefaultPosition
5533 self.size = (450, 300)
d55e5bfc
RD
5534 self.parent = None
5535
5536 def SetParent(self, parent):
5537 """Set the window to be used as the popup Frame's parent."""
5538 self.parent = parent
5539
5540
5541 def CreateOutputWindow(self, st):
412d302d
RD
5542 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
5543 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 5544 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 5545 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 5546 self.text.AppendText(st)
d55e5bfc
RD
5547 self.frame.Show(True)
5548 EVT_CLOSE(self.frame, self.OnCloseWindow)
5549
5550
5551 def OnCloseWindow(self, event):
5552 if self.frame is not None:
5553 self.frame.Destroy()
5554 self.frame = None
5555 self.text = None
5556
5557
5558 # These methods provide the file-like output behaviour.
5559 def write(self, text):
5560 """
5561 Create the output window if needed and write the string to it.
5562 If not called in the context of the gui thread then uses
5563 CallAfter to do the work there.
5564 """
5565 if self.frame is None:
5566 if not wx.Thread_IsMain():
5567 wx.CallAfter(self.CreateOutputWindow, text)
5568 else:
5569 self.CreateOutputWindow(text)
5570 else:
5571 if not wx.Thread_IsMain():
5572 wx.CallAfter(self.text.AppendText, text)
5573 else:
5574 self.text.AppendText(text)
5575
5576
5577 def close(self):
5578 if self.frame is not None:
5579 wx.CallAfter(self.frame.Close)
5580
5581
bb4524c4
RD
5582 def flush(self):
5583 pass
5584
5585
d55e5bfc
RD
5586
5587#----------------------------------------------------------------------
5588
5589_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5590
5591class App(wx.PyApp):
5592 """
d6c14a4c
RD
5593 The ``wx.App`` class represents the application and is used to:
5594
5595 * bootstrap the wxPython system and initialize the underlying
5596 gui toolkit
5597 * set and get application-wide properties
5598 * implement the windowing system main message or event loop,
5599 and to dispatch events to window instances
5600 * etc.
5601
5602 Every application must have a ``wx.App`` instance, and all
5603 creation of UI objects should be delayed until after the
5604 ``wx.App`` object has been created in order to ensure that the gui
5605 platform and wxWidgets have been fully initialized.
5606
5607 Normally you would derive from this class and implement an
5608 ``OnInit`` method that creates a frame and then calls
5609 ``self.SetTopWindow(frame)``.
5610
5611 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 5612 directly.
d55e5bfc 5613 """
d6c14a4c 5614
d55e5bfc
RD
5615 outputWindowClass = PyOnDemandOutputWindow
5616
d6c14a4c
RD
5617 def __init__(self, redirect=_defRedirect, filename=None,
5618 useBestVisual=False, clearSigInt=True):
5619 """
5620 Construct a ``wx.App`` object.
5621
5622 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5623 redirected? Defaults to True on Windows and Mac, False
5624 otherwise. If `filename` is None then output will be
5625 redirected to a window that pops up as needed. (You can
5626 control what kind of window is created for the output by
5627 resetting the class variable ``outputWindowClass`` to a
5628 class of your choosing.)
5629
5630 :param filename: The name of a file to redirect output to, if
5631 redirect is True.
5632
5633 :param useBestVisual: Should the app try to use the best
5634 available visual provided by the system (only relevant on
5635 systems that have more than one visual.) This parameter
5636 must be used instead of calling `SetUseBestVisual` later
5637 on because it must be set before the underlying GUI
5638 toolkit is initialized.
5639
5640 :param clearSigInt: Should SIGINT be cleared? This allows the
5641 app to terminate upon a Ctrl-C in the console like other
5642 GUI apps will.
5643
5644 :note: You should override OnInit to do applicaition
5645 initialization to ensure that the system, toolkit and
5646 wxWidgets are fully initialized.
5647 """
d55e5bfc
RD
5648 wx.PyApp.__init__(self)
5649
5650 if wx.Platform == "__WXMAC__":
5651 try:
5652 import MacOS
5653 if not MacOS.WMAvailable():
5654 print """\
5655This program needs access to the screen. Please run with 'pythonw',
5656not 'python', and only when you are logged in on the main display of
5657your Mac."""
5658 _sys.exit(1)
0346c964
RD
5659 except SystemExit:
5660 raise
d55e5bfc
RD
5661 except:
5662 pass
5663
5664 # This has to be done before OnInit
5665 self.SetUseBestVisual(useBestVisual)
5666
5667 # Set the default handler for SIGINT. This fixes a problem
5668 # where if Ctrl-C is pressed in the console that started this
5669 # app then it will not appear to do anything, (not even send
5670 # KeyboardInterrupt???) but will later segfault on exit. By
5671 # setting the default handler then the app will exit, as
5672 # expected (depending on platform.)
d6c14a4c
RD
5673 if clearSigInt:
5674 try:
5675 import signal
5676 signal.signal(signal.SIGINT, signal.SIG_DFL)
5677 except:
5678 pass
d55e5bfc
RD
5679
5680 # Save and redirect the stdio to a window?
5681 self.stdioWin = None
5682 self.saveStdio = (_sys.stdout, _sys.stderr)
5683 if redirect:
5684 self.RedirectStdio(filename)
5685
8fb0e70a
RD
5686 # Use Python's install prefix as the default
5687 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
5688
d55e5bfc
RD
5689 # This finishes the initialization of wxWindows and then calls
5690 # the OnInit that should be present in the derived class
5691 self._BootstrapApp()
5692
5693
5694 def __del__(self):
5695 try:
5696 self.RestoreStdio() # Just in case the MainLoop was overridden
5697 except:
5698 pass
5699
5700
5701 def SetTopWindow(self, frame):
5702 """Set the \"main\" top level window"""
5703 if self.stdioWin:
5704 self.stdioWin.SetParent(frame)
5705 wx.PyApp.SetTopWindow(self, frame)
5706
5707
5708 def MainLoop(self):
5709 """Execute the main GUI event loop"""
5710 wx.PyApp.MainLoop(self)
5711 self.RestoreStdio()
5712
5713
5714 def RedirectStdio(self, filename=None):
5715 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
5716 if filename:
5717 _sys.stdout = _sys.stderr = open(filename, 'a')
5718 else:
5719 self.stdioWin = self.outputWindowClass()
5720 _sys.stdout = _sys.stderr = self.stdioWin
5721
5722
5723 def RestoreStdio(self):
5724 _sys.stdout, _sys.stderr = self.saveStdio
5725
5726
412d302d
RD
5727 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
5728 """
5729 Set the title, position and/or size of the output window if
f5b96ee1
RD
5730 the stdio has been redirected. This should be called before
5731 any output would cause the output window to be created.
412d302d
RD
5732 """
5733 if self.stdioWin:
5734 if title is not None:
5735 self.stdioWin.title = title
5736 if pos is not None:
5737 self.stdioWin.pos = pos
5738 if size is not None:
5739 self.stdioWin.size = size
5740
5741
5742
d55e5bfc 5743
d6c14a4c 5744# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
5745App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5746App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5747App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5748App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5749App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5750App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5751App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5752App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5753App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5754App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5755App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
5756
5757#----------------------------------------------------------------------------
5758
5759class PySimpleApp(wx.App):
5760 """
5761 A simple application class. You can just create one of these and
5762 then then make your top level windows later, and not have to worry
d6c14a4c 5763 about OnInit. For example::
d55e5bfc 5764
d6c14a4c
RD
5765 app = wx.PySimpleApp()
5766 frame = wx.Frame(None, title='Hello World')
5767 frame.Show()
5768 app.MainLoop()
5769
5770 :see: `wx.App`
5771 """
5772
5773 def __init__(self, redirect=False, filename=None,
5774 useBestVisual=False, clearSigInt=True):
5775 """
5776 :see: `wx.App.__init__`
5777 """
5778 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
5779
5780 def OnInit(self):
d55e5bfc
RD
5781 return True
5782
5783
d6c14a4c 5784
d55e5bfc
RD
5785# Is anybody using this one?
5786class PyWidgetTester(wx.App):
5787 def __init__(self, size = (250, 100)):
5788 self.size = size
5789 wx.App.__init__(self, 0)
5790
5791 def OnInit(self):
5792 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
5793 self.SetTopWindow(self.frame)
5794 return True
5795
d6c14a4c
RD
5796 def SetWidget(self, widgetClass, *args, **kwargs):
5797 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
5798 self.frame.Show(True)
5799
5800#----------------------------------------------------------------------------
5801# DO NOT hold any other references to this object. This is how we
d6c14a4c 5802# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 5803# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 5804# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
5805
5806class __wxPyCleanup:
5807 def __init__(self):
5808 self.cleanup = _core_.App_CleanUp
5809 def __del__(self):
5810 self.cleanup()
5811
5812_sys.__wxPythonCleanup = __wxPyCleanup()
5813
5814## # another possible solution, but it gets called too early...
d6c14a4c
RD
5815## import atexit
5816## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
5817
5818
5819#----------------------------------------------------------------------------
5820
5821#---------------------------------------------------------------------------
5822
5b5c9bc7
RD
5823class EventLoop(object):
5824 """Proxy of C++ EventLoop class"""
b411df4a
RD
5825 def __repr__(self):
5826 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5827 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
5828 """__init__(self) -> EventLoop"""
5829 newobj = _core_.new_EventLoop(*args, **kwargs)
b411df4a
RD
5830 self.this = newobj.this
5831 self.thisown = 1
5832 del newobj.thisown
5b5c9bc7 5833 def __del__(self, destroy=_core_.delete_EventLoop):
b411df4a
RD
5834 """__del__(self)"""
5835 try:
5836 if self.thisown: destroy(self)
5837 except: pass
5838
5839 def Run(*args, **kwargs):
5840 """Run(self) -> int"""
5b5c9bc7 5841 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
5842
5843 def Exit(*args, **kwargs):
5844 """Exit(self, int rc=0)"""
5b5c9bc7 5845 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
5846
5847 def Pending(*args, **kwargs):
5848 """Pending(self) -> bool"""
5b5c9bc7 5849 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
5850
5851 def Dispatch(*args, **kwargs):
5852 """Dispatch(self) -> bool"""
5b5c9bc7 5853 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
5854
5855 def IsRunning(*args, **kwargs):
5856 """IsRunning(self) -> bool"""
5b5c9bc7 5857 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
5858
5859 def GetActive(*args, **kwargs):
5b5c9bc7
RD
5860 """GetActive() -> EventLoop"""
5861 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
5862
5863 GetActive = staticmethod(GetActive)
5864 def SetActive(*args, **kwargs):
5b5c9bc7
RD
5865 """SetActive(EventLoop loop)"""
5866 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
5867
5868 SetActive = staticmethod(SetActive)
5869
5b5c9bc7 5870class EventLoopPtr(EventLoop):
b411df4a
RD
5871 def __init__(self, this):
5872 self.this = this
5873 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5874 self.__class__ = EventLoop
5875_core_.EventLoop_swigregister(EventLoopPtr)
b411df4a 5876
5b5c9bc7
RD
5877def EventLoop_GetActive(*args, **kwargs):
5878 """EventLoop_GetActive() -> EventLoop"""
5879 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a 5880
5b5c9bc7
RD
5881def EventLoop_SetActive(*args, **kwargs):
5882 """EventLoop_SetActive(EventLoop loop)"""
5883 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
5884
5885#---------------------------------------------------------------------------
5886
5b5c9bc7 5887class AcceleratorEntry(object):
d6c14a4c
RD
5888 """
5889 A class used to define items in an `wx.AcceleratorTable`. wxPython
5890 programs can choose to use wx.AcceleratorEntry objects, but using a
5891 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 5892 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
5893
5894 :see: `wx.AcceleratorTable`
5895 """
d55e5bfc
RD
5896 def __repr__(self):
5897 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5898 def __init__(self, *args, **kwargs):
d6c14a4c 5899 """
5b5c9bc7 5900 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
5901
5902 Construct a wx.AcceleratorEntry.
d6c14a4c 5903 """
5b5c9bc7 5904 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
d55e5bfc
RD
5905 self.this = newobj.this
5906 self.thisown = 1
5907 del newobj.thisown
5b5c9bc7 5908 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
d55e5bfc
RD
5909 """__del__(self)"""
5910 try:
5911 if self.thisown: destroy(self)
5912 except: pass
5913
5914 def Set(*args, **kwargs):
d6c14a4c
RD
5915 """
5916 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 5917
d6c14a4c
RD
5918 (Re)set the attributes of a wx.AcceleratorEntry.
5919 :see `__init__`
5920 """
5b5c9bc7 5921 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
5922
5923 def GetFlags(*args, **kwargs):
d6c14a4c
RD
5924 """
5925 GetFlags(self) -> int
5926
5927 Get the AcceleratorEntry's flags.
5928 """
5b5c9bc7 5929 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
5930
5931 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
5932 """
5933 GetKeyCode(self) -> int
5934
5935 Get the AcceleratorEntry's keycode.
5936 """
5b5c9bc7 5937 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
5938
5939 def GetCommand(*args, **kwargs):
d6c14a4c
RD
5940 """
5941 GetCommand(self) -> int
5942
5943 Get the AcceleratorEntry's command ID.
5944 """
5b5c9bc7 5945 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc
RD
5946
5947
5b5c9bc7 5948class AcceleratorEntryPtr(AcceleratorEntry):
d55e5bfc
RD
5949 def __init__(self, this):
5950 self.this = this
5951 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5952 self.__class__ = AcceleratorEntry
5953_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
d55e5bfc 5954
5b5c9bc7 5955class AcceleratorTable(Object):
d6c14a4c
RD
5956 """
5957 An accelerator table allows the application to specify a table of
5958 keyboard shortcuts for menus or other commands. On Windows, menu or
5959 button commands are supported; on GTK, only menu commands are
5960 supported.
d6c14a4c 5961 """
d55e5bfc
RD
5962 def __repr__(self):
5963 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5964 def __init__(self, *args, **kwargs):
5965 """
5966 __init__(entries) -> AcceleratorTable
5967
d6c14a4c
RD
5968 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5969 items or or of 3-tuples (flags, keyCode, cmdID)
5970
5971 :see: `wx.AcceleratorEntry`
d55e5bfc 5972 """
5b5c9bc7 5973 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
d55e5bfc
RD
5974 self.this = newobj.this
5975 self.thisown = 1
5976 del newobj.thisown
5b5c9bc7 5977 def __del__(self, destroy=_core_.delete_AcceleratorTable):
d55e5bfc
RD
5978 """__del__(self)"""
5979 try:
5980 if self.thisown: destroy(self)
5981 except: pass
5982
5983 def Ok(*args, **kwargs):
5984 """Ok(self) -> bool"""
5b5c9bc7 5985 return _core_.AcceleratorTable_Ok(*args, **kwargs)
d55e5bfc
RD
5986
5987
5b5c9bc7 5988class AcceleratorTablePtr(AcceleratorTable):
d55e5bfc
RD
5989 def __init__(self, this):
5990 self.this = this
5991 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5992 self.__class__ = AcceleratorTable
5993_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
d55e5bfc
RD
5994
5995
5b5c9bc7
RD
5996def GetAccelFromString(*args, **kwargs):
5997 """GetAccelFromString(String label) -> AcceleratorEntry"""
5998 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
5999#---------------------------------------------------------------------------
6000
5b5c9bc7 6001class VisualAttributes(object):
d55e5bfc
RD
6002 """struct containing all the visual attributes of a control"""
6003 def __repr__(self):
6004 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6005 def __init__(self, *args, **kwargs):
6006 """
5b5c9bc7 6007 __init__(self) -> VisualAttributes
d55e5bfc
RD
6008
6009 struct containing all the visual attributes of a control
6010 """
5b5c9bc7 6011 newobj = _core_.new_VisualAttributes(*args, **kwargs)
d55e5bfc
RD
6012 self.this = newobj.this
6013 self.thisown = 1
6014 del newobj.thisown
5b5c9bc7 6015 def __del__(self, destroy=_core_.delete_VisualAttributes):
d55e5bfc
RD
6016 """__del__(self)"""
6017 try:
6018 if self.thisown: destroy(self)
6019 except: pass
6020
5b5c9bc7
RD
6021 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
6022 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
6023 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
d55e5bfc 6024
5b5c9bc7 6025class VisualAttributesPtr(VisualAttributes):
d55e5bfc
RD
6026 def __init__(self, this):
6027 self.this = this
6028 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6029 self.__class__ = VisualAttributes
6030_core_.VisualAttributes_swigregister(VisualAttributesPtr)
6031NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
6032PanelNameStr = cvar.PanelNameStr
6033
5b5c9bc7
RD
6034WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
6035WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
6036WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
6037WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
6038WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
6039class Window(EvtHandler):
d55e5bfc
RD
6040 """
6041 wx.Window is the base class for all windows and represents any visible
6042 object on the screen. All controls, top level windows and so on are
6043 wx.Windows. Sizers and device contexts are not however, as they don't
6044 appear on screen themselves.
6045
6046 """
6047 def __repr__(self):
6048 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6049 def __init__(self, *args, **kwargs):
6050 """
5b5c9bc7
RD
6051 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
6052 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
6053
6054 Construct and show a generic Window.
6055 """
5b5c9bc7 6056 newobj = _core_.new_Window(*args, **kwargs)
d55e5bfc
RD
6057 self.this = newobj.this
6058 self.thisown = 1
6059 del newobj.thisown
6060 self._setOORInfo(self)
6061
6062 def Create(*args, **kwargs):
6063 """
5b5c9bc7
RD
6064 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
6065 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
6066
6067 Create the GUI part of the Window for 2-phase creation mode.
6068 """
5b5c9bc7 6069 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
6070
6071 def Close(*args, **kwargs):
6072 """
6073 Close(self, bool force=False) -> bool
6074
6075 This function simply generates a EVT_CLOSE event whose handler usually
6076 tries to close the window. It doesn't close the window itself,
6077 however. If force is False (the default) then the window's close
6078 handler will be allowed to veto the destruction of the window.
d55e5bfc 6079 """
5b5c9bc7 6080 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
6081
6082 def Destroy(*args, **kwargs):
6083 """
6084 Destroy(self) -> bool
6085
6086 Destroys the window safely. Frames and dialogs are not destroyed
6087 immediately when this function is called -- they are added to a list
6088 of windows to be deleted on idle time, when all the window's events
6089 have been processed. This prevents problems with events being sent to
6090 non-existent windows.
6091
6092 Returns True if the window has either been successfully deleted, or it
6093 has been added to the list of windows pending real deletion.
6094 """
5b5c9bc7 6095 return _core_.Window_Destroy(*args, **kwargs)
d55e5bfc
RD
6096
6097 def DestroyChildren(*args, **kwargs):
6098 """
6099 DestroyChildren(self) -> bool
6100
15817c7e
RD
6101 Destroys all children of a window. Called automatically by the
6102 destructor.
d55e5bfc 6103 """
5b5c9bc7 6104 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
6105
6106 def IsBeingDeleted(*args, **kwargs):
6107 """
6108 IsBeingDeleted(self) -> bool
6109
6110 Is the window in the process of being deleted?
6111 """
5b5c9bc7 6112 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc
RD
6113
6114 def SetTitle(*args, **kwargs):
6115 """
5b5c9bc7 6116 SetTitle(self, String title)
d55e5bfc
RD
6117
6118 Sets the window's title. Applicable only to frames and dialogs.
6119 """
5b5c9bc7 6120 return _core_.Window_SetTitle(*args, **kwargs)
d55e5bfc
RD
6121
6122 def GetTitle(*args, **kwargs):
6123 """
5b5c9bc7 6124 GetTitle(self) -> String
d55e5bfc
RD
6125
6126 Gets the window's title. Applicable only to frames and dialogs.
6127 """
5b5c9bc7 6128 return _core_.Window_GetTitle(*args, **kwargs)
d55e5bfc
RD
6129
6130 def SetLabel(*args, **kwargs):
6131 """
5b5c9bc7 6132 SetLabel(self, String label)
d55e5bfc
RD
6133
6134 Set the text which the window shows in its label if applicable.
6135 """
5b5c9bc7 6136 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
6137
6138 def GetLabel(*args, **kwargs):
6139 """
5b5c9bc7 6140 GetLabel(self) -> String
d55e5bfc 6141
15817c7e
RD
6142 Generic way of getting a label from any window, for identification
6143 purposes. The interpretation of this function differs from class to
6144 class. For frames and dialogs, the value returned is the title. For
6145 buttons or static text controls, it is the button text. This function
6146 can be useful for meta-programs such as testing tools or special-needs
6147 access programs)which need to identify windows by name.
d55e5bfc 6148 """
5b5c9bc7 6149 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
6150
6151 def SetName(*args, **kwargs):
6152 """
5b5c9bc7 6153 SetName(self, String name)
d55e5bfc 6154
15817c7e
RD
6155 Sets the window's name. The window name is used for ressource setting
6156 in X, it is not the same as the window title/label
d55e5bfc 6157 """
5b5c9bc7 6158 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
6159
6160 def GetName(*args, **kwargs):
6161 """
5b5c9bc7 6162 GetName(self) -> String
d55e5bfc 6163
15817c7e
RD
6164 Returns the windows name. This name is not guaranteed to be unique;
6165 it is up to the programmer to supply an appropriate name in the window
6166 constructor or via wx.Window.SetName.
d55e5bfc 6167 """
5b5c9bc7 6168 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
6169
6170 def SetWindowVariant(*args, **kwargs):
6171 """
6172 SetWindowVariant(self, int variant)
6173
15817c7e
RD
6174 Sets the variant of the window/font size to use for this window, if
6175 the platform supports variants, for example, wxMac.
d55e5bfc 6176 """
5b5c9bc7 6177 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
6178
6179 def GetWindowVariant(*args, **kwargs):
6180 """GetWindowVariant(self) -> int"""
5b5c9bc7 6181 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
6182
6183 def SetId(*args, **kwargs):
6184 """
6185 SetId(self, int winid)
6186
6187 Sets the identifier of the window. Each window has an integer
6188 identifier. If the application has not provided one, an identifier
6189 will be generated. Normally, the identifier should be provided on
6190 creation and should not be modified subsequently.
6191 """
5b5c9bc7 6192 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
6193
6194 def GetId(*args, **kwargs):
6195 """
6196 GetId(self) -> int
6197
6198 Returns the identifier of the window. Each window has an integer
6199 identifier. If the application has not provided one (or the default Id
6200 -1 is used) then an unique identifier with a negative value will be
6201 generated.
6202 """
5b5c9bc7 6203 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
6204
6205 def NewControlId(*args, **kwargs):
6206 """
d6c14a4c 6207 NewControlId() -> int
d55e5bfc
RD
6208
6209 Generate a control id for the controls which were not given one.
6210 """
5b5c9bc7 6211 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
6212
6213 NewControlId = staticmethod(NewControlId)
6214 def NextControlId(*args, **kwargs):
6215 """
d6c14a4c 6216 NextControlId(int winid) -> int
d55e5bfc
RD
6217
6218 Get the id of the control following the one with the given
15817c7e 6219 autogenerated) id
d55e5bfc 6220 """
5b5c9bc7 6221 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
6222
6223 NextControlId = staticmethod(NextControlId)
6224 def PrevControlId(*args, **kwargs):
6225 """
d6c14a4c 6226 PrevControlId(int winid) -> int
d55e5bfc
RD
6227
6228 Get the id of the control preceding the one with the given
15817c7e 6229 autogenerated) id
d55e5bfc 6230 """
5b5c9bc7 6231 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
6232
6233 PrevControlId = staticmethod(PrevControlId)
6234 def SetSize(*args, **kwargs):
6235 """
5b5c9bc7 6236 SetSize(self, Size size)
d55e5bfc
RD
6237
6238 Sets the size of the window in pixels.
6239 """
5b5c9bc7 6240 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
6241
6242 def SetDimensions(*args, **kwargs):
6243 """
5b5c9bc7 6244 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
6245
6246 Sets the position and size of the window in pixels. The sizeFlags
6247 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
6248 equal to -1.
6249
6250 ======================== ======================================
6251 wx.SIZE_AUTO A -1 indicates that a class-specific
6252 default should be used.
6253 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
6254 -1 values are supplied.
6255 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
6256 interpreted as real dimensions, not
6257 default values.
6258 ======================== ======================================
6259
d55e5bfc 6260 """
5b5c9bc7 6261 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
6262
6263 def SetRect(*args, **kwargs):
6264 """
5b5c9bc7 6265 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
6266
6267 Sets the position and size of the window in pixels using a wx.Rect.
6268 """
5b5c9bc7 6269 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
6270
6271 def SetSizeWH(*args, **kwargs):
6272 """
6273 SetSizeWH(self, int width, int height)
6274
6275 Sets the size of the window in pixels.
6276 """
5b5c9bc7 6277 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
6278
6279 def Move(*args, **kwargs):
6280 """
5b5c9bc7 6281 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
6282
6283 Moves the window to the given position.
6284 """
5b5c9bc7 6285 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
6286
6287 SetPosition = Move
6288 def MoveXY(*args, **kwargs):
6289 """
5b5c9bc7 6290 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
6291
6292 Moves the window to the given position.
6293 """
5b5c9bc7 6294 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 6295
f8167d6e
RD
6296 def SetBestFittingSize(*args, **kwargs):
6297 """
5b5c9bc7 6298 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
6299
6300 A 'Smart' SetSize that will fill in default size components with the
6301 window's *best size* values. Also set's the minsize for use with sizers.
6302 """
5b5c9bc7 6303 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 6304
d55e5bfc
RD
6305 def Raise(*args, **kwargs):
6306 """
6307 Raise(self)
6308
6309 Raises the window to the top of the window hierarchy if it is a
6310 managed window (dialog or frame).
6311 """
5b5c9bc7 6312 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
6313
6314 def Lower(*args, **kwargs):
6315 """
6316 Lower(self)
6317
6318 Lowers the window to the bottom of the window hierarchy if it is a
6319 managed window (dialog or frame).
6320 """
5b5c9bc7 6321 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
6322
6323 def SetClientSize(*args, **kwargs):
6324 """
5b5c9bc7 6325 SetClientSize(self, Size size)
d55e5bfc
RD
6326
6327 This sets the size of the window client area in pixels. Using this
6328 function to size a window tends to be more device-independent than
6329 wx.Window.SetSize, since the application need not worry about what
6330 dimensions the border or title bar have when trying to fit the window
6331 around panel items, for example.
6332 """
5b5c9bc7 6333 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
6334
6335 def SetClientSizeWH(*args, **kwargs):
6336 """
6337 SetClientSizeWH(self, int width, int height)
6338
6339 This sets the size of the window client area in pixels. Using this
6340 function to size a window tends to be more device-independent than
6341 wx.Window.SetSize, since the application need not worry about what
6342 dimensions the border or title bar have when trying to fit the window
6343 around panel items, for example.
6344 """
5b5c9bc7 6345 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
6346
6347 def SetClientRect(*args, **kwargs):
6348 """
5b5c9bc7 6349 SetClientRect(self, Rect rect)
d55e5bfc
RD
6350
6351 This sets the size of the window client area in pixels. Using this
6352 function to size a window tends to be more device-independent than
6353 wx.Window.SetSize, since the application need not worry about what
6354 dimensions the border or title bar have when trying to fit the window
6355 around panel items, for example.
6356 """
5b5c9bc7 6357 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
6358
6359 def GetPosition(*args, **kwargs):
6360 """
5b5c9bc7 6361 GetPosition(self) -> Point
d55e5bfc
RD
6362
6363 Get the window's position.
6364 """
5b5c9bc7 6365 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
6366
6367 def GetPositionTuple(*args, **kwargs):
6368 """
6369 GetPositionTuple() -> (x,y)
6370
6371 Get the window's position.
6372 """
5b5c9bc7 6373 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
6374
6375 def GetSize(*args, **kwargs):
6376 """
5b5c9bc7 6377 GetSize(self) -> Size
d55e5bfc
RD
6378
6379 Get the window size.
6380 """
5b5c9bc7 6381 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
6382
6383 def GetSizeTuple(*args, **kwargs):
6384 """
6385 GetSizeTuple() -> (width, height)
6386
6387 Get the window size.
6388 """
5b5c9bc7 6389 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
6390
6391 def GetRect(*args, **kwargs):
6392 """
5b5c9bc7 6393 GetRect(self) -> Rect
d55e5bfc
RD
6394
6395 Returns the size and position of the window as a wx.Rect object.
6396 """
5b5c9bc7 6397 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
6398
6399 def GetClientSize(*args, **kwargs):
6400 """
5b5c9bc7 6401 GetClientSize(self) -> Size
d55e5bfc
RD
6402
6403 This gets the size of the window's 'client area' in pixels. The client
6404 area is the area which may be drawn on by the programmer, excluding
6405 title bar, border, scrollbars, etc.
6406 """
5b5c9bc7 6407 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
6408
6409 def GetClientSizeTuple(*args, **kwargs):
6410 """
6411 GetClientSizeTuple() -> (width, height)
6412
6413 This gets the size of the window's 'client area' in pixels. The client
6414 area is the area which may be drawn on by the programmer, excluding
6415 title bar, border, scrollbars, etc.
6416 """
5b5c9bc7 6417 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
6418
6419 def GetClientAreaOrigin(*args, **kwargs):
6420 """
5b5c9bc7 6421 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
6422
6423 Get the origin of the client area of the window relative to the
6424 window's top left corner (the client area may be shifted because of
6425 the borders, scrollbars, other decorations...)
6426 """
5b5c9bc7 6427 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
6428
6429 def GetClientRect(*args, **kwargs):
6430 """
5b5c9bc7 6431 GetClientRect(self) -> Rect
d55e5bfc 6432
0439c23b 6433 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 6434 """
5b5c9bc7 6435 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
6436
6437 def GetBestSize(*args, **kwargs):
6438 """
5b5c9bc7 6439 GetBestSize(self) -> Size
d55e5bfc 6440
bfddbb17 6441 This function returns the best acceptable minimal size for the
15817c7e
RD
6442 window, if applicable. For example, for a static text control, it will
6443 be the minimal size such that the control label is not truncated. For
6444 windows containing subwindows (suzh aswx.Panel), the size returned by
6445 this function will be the same as the size the window would have had
6446 after calling Fit.
d55e5bfc 6447 """
5b5c9bc7 6448 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
6449
6450 def GetBestSizeTuple(*args, **kwargs):
6451 """
6452 GetBestSizeTuple() -> (width, height)
6453
bfddbb17 6454 This function returns the best acceptable minimal size for the
15817c7e
RD
6455 window, if applicable. For example, for a static text control, it will
6456 be the minimal size such that the control label is not truncated. For
6457 windows containing subwindows (suzh aswx.Panel), the size returned by
6458 this function will be the same as the size the window would have had
6459 after calling Fit.
d55e5bfc 6460 """
5b5c9bc7 6461 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 6462
a001823c
RD
6463 def InvalidateBestSize(*args, **kwargs):
6464 """
6465 InvalidateBestSize(self)
6466
6467 Reset the cached best size value so it will be recalculated the next
6468 time it is needed.
6469 """
5b5c9bc7 6470 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c
RD
6471
6472 def GetBestFittingSize(*args, **kwargs):
6473 """
5b5c9bc7 6474 GetBestFittingSize(self) -> Size
a001823c
RD
6475
6476 This function will merge the window's best size into the window's
6477 minimum size, giving priority to the min size components, and returns
6478 the results.
6479
6480 """
5b5c9bc7 6481 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 6482
d55e5bfc
RD
6483 def GetAdjustedBestSize(*args, **kwargs):
6484 """
5b5c9bc7 6485 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
6486
6487 This method is similar to GetBestSize, except in one
6488 thing. GetBestSize should return the minimum untruncated size of the
6489 window, while this method will return the largest of BestSize and any
6490 user specified minimum size. ie. it is the minimum size the window
6491 should currently be drawn at, not the minimal size it can possibly
6492 tolerate.
6493 """
5b5c9bc7 6494 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
6495
6496 def Center(*args, **kwargs):
6497 """
5b5c9bc7 6498 Center(self, int direction=BOTH)
d55e5bfc
RD
6499
6500 Centers the window. The parameter specifies the direction for
6501 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
6502 also include wx.CENTER_ON_SCREEN flag if you want to center the window
6503 on the entire screen and not on its parent window. If it is a
6504 top-level window and has no parent then it will always be centered
6505 relative to the screen.
6506 """
5b5c9bc7 6507 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
6508
6509 Centre = Center
6510 def CenterOnScreen(*args, **kwargs):
6511 """
5b5c9bc7 6512 CenterOnScreen(self, int dir=BOTH)
d55e5bfc
RD
6513
6514 Center on screen (only works for top level windows)
6515 """
5b5c9bc7 6516 return _core_.Window_CenterOnScreen(*args, **kwargs)
d55e5bfc
RD
6517
6518 CentreOnScreen = CenterOnScreen
6519 def CenterOnParent(*args, **kwargs):
6520 """
5b5c9bc7 6521 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
6522
6523 Center with respect to the the parent window
6524 """
5b5c9bc7 6525 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
6526
6527 CentreOnParent = CenterOnParent
6528 def Fit(*args, **kwargs):
6529 """
6530 Fit(self)
6531
6532 Sizes the window so that it fits around its subwindows. This function
6533 won't do anything if there are no subwindows and will only really work
6534 correctly if sizers are used for the subwindows layout. Also, if the
6535 window has exactly one subwindow it is better (faster and the result
6536 is more precise as Fit adds some margin to account for fuzziness of
6537 its calculations) to call window.SetClientSize(child.GetSize())
6538 instead of calling Fit.
6539 """
5b5c9bc7 6540 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
6541
6542 def FitInside(*args, **kwargs):
6543 """
6544 FitInside(self)
6545
6546 Similar to Fit, but sizes the interior (virtual) size of a
6547 window. Mainly useful with scrolled windows to reset scrollbars after
6548 sizing changes that do not trigger a size event, and/or scrolled
6549 windows without an interior sizer. This function similarly won't do
6550 anything if there are no subwindows.
6551 """
5b5c9bc7 6552 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 6553
03837c5c 6554 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
6555 """
6556 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
6557 int incH=-1)
d55e5bfc
RD
6558
6559 Allows specification of minimum and maximum window sizes, and window
6560 size increments. If a pair of values is not set (or set to -1), the
6561 default values will be used. If this function is called, the user
908b74cd
RD
6562 will not be able to size the window outside the given bounds (if it is
6563 a top-level window.) Sizers will also inspect the minimum window size
6564 and will use that value if set when calculating layout.
6565
6566 The resizing increments are only significant under Motif or Xt.
d55e5bfc 6567 """
5b5c9bc7 6568 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 6569
03837c5c
RD
6570 def SetSizeHintsSz(*args, **kwargs):
6571 """
5b5c9bc7 6572 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
6573
6574 Allows specification of minimum and maximum window sizes, and window
6575 size increments. If a pair of values is not set (or set to -1), the
6576 default values will be used. If this function is called, the user
6577 will not be able to size the window outside the given bounds (if it is
6578 a top-level window.) Sizers will also inspect the minimum window size
6579 and will use that value if set when calculating layout.
6580
6581 The resizing increments are only significant under Motif or Xt.
6582 """
5b5c9bc7 6583 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
6584
6585 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 6586 """
908b74cd 6587 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
6588
6589 Allows specification of minimum and maximum virtual window sizes. If a
6590 pair of values is not set (or set to -1), the default values will be
6591 used. If this function is called, the user will not be able to size
6592 the virtual area of the window outside the given bounds.
6593 """
5b5c9bc7 6594 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
6595
6596 def SetVirtualSizeHintsSz(*args, **kwargs):
6597 """
5b5c9bc7 6598 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
6599
6600 Allows specification of minimum and maximum virtual window sizes. If a
6601 pair of values is not set (or set to -1), the default values will be
6602 used. If this function is called, the user will not be able to size
6603 the virtual area of the window outside the given bounds.
6604 """
5b5c9bc7 6605 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 6606
908b74cd 6607 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
6608 """GetMaxSize(self) -> Size"""
6609 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
6610
6611 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
6612 """GetMinSize(self) -> Size"""
6613 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
6614
6615 def SetMinSize(*args, **kwargs):
6616 """
5b5c9bc7 6617 SetMinSize(self, Size minSize)
908b74cd
RD
6618
6619 A more convenient method than `SetSizeHints` for setting just the
6620 min size.
6621 """
5b5c9bc7 6622 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
6623
6624 def SetMaxSize(*args, **kwargs):
6625 """
5b5c9bc7 6626 SetMaxSize(self, Size maxSize)
908b74cd
RD
6627
6628 A more convenient method than `SetSizeHints` for setting just the
6629 max size.
6630 """
5b5c9bc7 6631 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 6632
d55e5bfc
RD
6633 def GetMinWidth(*args, **kwargs):
6634 """GetMinWidth(self) -> int"""
5b5c9bc7 6635 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
6636
6637 def GetMinHeight(*args, **kwargs):
6638 """GetMinHeight(self) -> int"""
5b5c9bc7 6639 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
6640
6641 def GetMaxWidth(*args, **kwargs):
6642 """GetMaxWidth(self) -> int"""
5b5c9bc7 6643 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
6644
6645 def GetMaxHeight(*args, **kwargs):
6646 """GetMaxHeight(self) -> int"""
5b5c9bc7 6647 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 6648
d55e5bfc
RD
6649 def SetVirtualSize(*args, **kwargs):
6650 """
5b5c9bc7 6651 SetVirtualSize(self, Size size)
d55e5bfc
RD
6652
6653 Set the the virtual size of a window in pixels. For most windows this
6654 is just the client area of the window, but for some like scrolled
6655 windows it is more or less independent of the screen window size.
6656 """
5b5c9bc7 6657 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
6658
6659 def SetVirtualSizeWH(*args, **kwargs):
6660 """
6661 SetVirtualSizeWH(self, int w, int h)
6662
6663 Set the the virtual size of a window in pixels. For most windows this
6664 is just the client area of the window, but for some like scrolled
6665 windows it is more or less independent of the screen window size.
6666 """
5b5c9bc7 6667 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
6668
6669 def GetVirtualSize(*args, **kwargs):
6670 """
5b5c9bc7 6671 GetVirtualSize(self) -> Size
d55e5bfc
RD
6672
6673 Get the the virtual size of the window in pixels. For most windows
6674 this is just the client area of the window, but for some like scrolled
6675 windows it is more or less independent of the screen window size.
6676 """
5b5c9bc7 6677 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
6678
6679 def GetVirtualSizeTuple(*args, **kwargs):
6680 """
6681 GetVirtualSizeTuple() -> (width, height)
6682
6683 Get the the virtual size of the window in pixels. For most windows
6684 this is just the client area of the window, but for some like scrolled
6685 windows it is more or less independent of the screen window size.
6686 """
5b5c9bc7 6687 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
6688
6689 def GetBestVirtualSize(*args, **kwargs):
6690 """
5b5c9bc7 6691 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
6692
6693 Return the largest of ClientSize and BestSize (as determined by a
6694 sizer, interior children, or other means)
6695 """
5b5c9bc7 6696 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
6697
6698 def Show(*args, **kwargs):
6699 """
6700 Show(self, bool show=True) -> bool
6701
6702 Shows or hides the window. You may need to call Raise for a top level
6703 window if you want to bring it to top, although this is not needed if
6704 Show is called immediately after the frame creation. Returns True if
6705 the window has been shown or hidden or False if nothing was done
6706 because it already was in the requested state.
6707 """
5b5c9bc7 6708 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
6709
6710 def Hide(*args, **kwargs):
6711 """
6712 Hide(self) -> bool
6713
6714 Equivalent to calling Show(False).
6715 """
5b5c9bc7 6716 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
6717
6718 def Enable(*args, **kwargs):
6719 """
6720 Enable(self, bool enable=True) -> bool
6721
6722 Enable or disable the window for user input. Note that when a parent
6723 window is disabled, all of its children are disabled as well and they
6724 are reenabled again when the parent is. Returns true if the window
6725 has been enabled or disabled, false if nothing was done, i.e. if the
6726 window had already been in the specified state.
6727 """
5b5c9bc7 6728 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
6729
6730 def Disable(*args, **kwargs):
6731 """
6732 Disable(self) -> bool
6733
6734 Disables the window, same as Enable(false).
6735 """
5b5c9bc7 6736 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
6737
6738 def IsShown(*args, **kwargs):
6739 """
6740 IsShown(self) -> bool
6741
6742 Returns true if the window is shown, false if it has been hidden.
6743 """
5b5c9bc7 6744 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
6745
6746 def IsEnabled(*args, **kwargs):
6747 """
6748 IsEnabled(self) -> bool
6749
6750 Returns true if the window is enabled for input, false otherwise.
6751 """
5b5c9bc7 6752 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc
RD
6753
6754 def SetWindowStyleFlag(*args, **kwargs):
6755 """
6756 SetWindowStyleFlag(self, long style)
6757
15817c7e
RD
6758 Sets the style of the window. Please note that some styles cannot be
6759 changed after the window creation and that Refresh() might need to be
6760 called after changing the others for the change to take place
6761 immediately.
d55e5bfc 6762 """
5b5c9bc7 6763 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
6764
6765 def GetWindowStyleFlag(*args, **kwargs):
6766 """
6767 GetWindowStyleFlag(self) -> long
6768
6769 Gets the window style that was passed to the constructor or Create
6770 method.
6771 """
5b5c9bc7 6772 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
6773
6774 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
6775 def HasFlag(*args, **kwargs):
6776 """
6777 HasFlag(self, int flag) -> bool
6778
6779 Test if the given style is set for this window.
6780 """
5b5c9bc7 6781 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
6782
6783 def IsRetained(*args, **kwargs):
6784 """
6785 IsRetained(self) -> bool
6786
6787 Returns true if the window is retained, false otherwise. Retained
6788 windows are only available on X platforms.
6789 """
5b5c9bc7 6790 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
6791
6792 def SetExtraStyle(*args, **kwargs):
6793 """
6794 SetExtraStyle(self, long exStyle)
6795
6796 Sets the extra style bits for the window. Extra styles are the less
6797 often used style bits which can't be set with the constructor or with
6798 SetWindowStyleFlag()
6799 """
5b5c9bc7 6800 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
6801
6802 def GetExtraStyle(*args, **kwargs):
6803 """
6804 GetExtraStyle(self) -> long
6805
6806 Returns the extra style bits for the window.
6807 """
5b5c9bc7 6808 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
6809
6810 def MakeModal(*args, **kwargs):
6811 """
6812 MakeModal(self, bool modal=True)
6813
6814 Disables all other windows in the application so that the user can
6815 only interact with this window. Passing False will reverse this
6816 effect.
6817 """
5b5c9bc7 6818 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
6819
6820 def SetThemeEnabled(*args, **kwargs):
6821 """
6822 SetThemeEnabled(self, bool enableTheme)
6823
6824 This function tells a window if it should use the system's "theme"
6825 code to draw the windows' background instead if its own background
6826 drawing code. This will only have an effect on platforms that support
6827 the notion of themes in user defined windows. One such platform is
6828 GTK+ where windows can have (very colourful) backgrounds defined by a
6829 user's selected theme.
6830
6831 Dialogs, notebook pages and the status bar have this flag set to true
6832 by default so that the default look and feel is simulated best.
6833 """
5b5c9bc7 6834 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
6835
6836 def GetThemeEnabled(*args, **kwargs):
6837 """
6838 GetThemeEnabled(self) -> bool
6839
6840 Return the themeEnabled flag.
6841 """
5b5c9bc7 6842 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
6843
6844 def SetFocus(*args, **kwargs):
6845 """
6846 SetFocus(self)
6847
6848 Set's the focus to this window, allowing it to receive keyboard input.
6849 """
5b5c9bc7 6850 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
6851
6852 def SetFocusFromKbd(*args, **kwargs):
6853 """
6854 SetFocusFromKbd(self)
6855
6856 Set focus to this window as the result of a keyboard action. Normally
6857 only called internally.
6858 """
5b5c9bc7 6859 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
6860
6861 def FindFocus(*args, **kwargs):
6862 """
5b5c9bc7 6863 FindFocus() -> Window
d55e5bfc
RD
6864
6865 Returns the window or control that currently has the keyboard focus,
6866 or None.
6867 """
5b5c9bc7 6868 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
6869
6870 FindFocus = staticmethod(FindFocus)
6871 def AcceptsFocus(*args, **kwargs):
6872 """
6873 AcceptsFocus(self) -> bool
6874
6875 Can this window have focus?
6876 """
5b5c9bc7 6877 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
6878
6879 def AcceptsFocusFromKeyboard(*args, **kwargs):
6880 """
6881 AcceptsFocusFromKeyboard(self) -> bool
6882
6883 Can this window be given focus by keyboard navigation? if not, the
6884 only way to give it focus (provided it accepts it at all) is to click
6885 it.
6886 """
5b5c9bc7 6887 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc
RD
6888
6889 def GetDefaultItem(*args, **kwargs):
6890 """
5b5c9bc7 6891 GetDefaultItem(self) -> Window
d55e5bfc
RD
6892
6893 Get the default child of this parent, i.e. the one which is activated
6894 by pressing <Enter> such as the OK button on a wx.Dialog.
6895 """
5b5c9bc7 6896 return _core_.Window_GetDefaultItem(*args, **kwargs)
d55e5bfc
RD
6897
6898 def SetDefaultItem(*args, **kwargs):
6899 """
5b5c9bc7 6900 SetDefaultItem(self, Window child) -> Window
d55e5bfc
RD
6901
6902 Set this child as default, return the old default.
6903 """
5b5c9bc7 6904 return _core_.Window_SetDefaultItem(*args, **kwargs)
d55e5bfc
RD
6905
6906 def SetTmpDefaultItem(*args, **kwargs):
6907 """
5b5c9bc7 6908 SetTmpDefaultItem(self, Window win)
d55e5bfc
RD
6909
6910 Set this child as temporary default
6911 """
5b5c9bc7 6912 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
d55e5bfc 6913
908b74cd
RD
6914 def Navigate(*args, **kwargs):
6915 """
6916 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6917
fd2dc343
RD
6918 Does keyboard navigation from this window to another, by sending a
6919 `wx.NavigationKeyEvent`.
908b74cd 6920 """
5b5c9bc7 6921 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 6922
bf26d883
RD
6923 def MoveAfterInTabOrder(*args, **kwargs):
6924 """
5b5c9bc7 6925 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
6926
6927 Moves this window in the tab navigation order after the specified
6928 sibling window. This means that when the user presses the TAB key on
6929 that other window, the focus switches to this window.
6930
6931 The default tab order is the same as creation order. This function
6932 and `MoveBeforeInTabOrder` allow to change it after creating all the
6933 windows.
6934
6935 """
5b5c9bc7 6936 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
6937
6938 def MoveBeforeInTabOrder(*args, **kwargs):
6939 """
5b5c9bc7 6940 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
6941
6942 Same as `MoveAfterInTabOrder` except that it inserts this window just
6943 before win instead of putting it right after it.
6944 """
5b5c9bc7 6945 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 6946
d55e5bfc
RD
6947 def GetChildren(*args, **kwargs):
6948 """
6949 GetChildren(self) -> PyObject
6950
6951 Returns a list of the window's children. NOTE: Currently this is a
6952 copy of the child window list maintained by the window, so the return
6953 value of this function is only valid as long as the window's children
6954 do not change.
6955 """
5b5c9bc7 6956 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
6957
6958 def GetParent(*args, **kwargs):
6959 """
5b5c9bc7 6960 GetParent(self) -> Window
d55e5bfc
RD
6961
6962 Returns the parent window of this window, or None if there isn't one.
6963 """
5b5c9bc7 6964 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
6965
6966 def GetGrandParent(*args, **kwargs):
6967 """
5b5c9bc7 6968 GetGrandParent(self) -> Window
d55e5bfc 6969
15817c7e
RD
6970 Returns the parent of the parent of this window, or None if there
6971 isn't one.
d55e5bfc 6972 """
5b5c9bc7 6973 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
6974
6975 def IsTopLevel(*args, **kwargs):
6976 """
6977 IsTopLevel(self) -> bool
6978
6979 Returns true if the given window is a top-level one. Currently all
6980 frames and dialogs are always considered to be top-level windows (even
6981 if they have a parent window).
6982 """
5b5c9bc7 6983 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
6984
6985 def Reparent(*args, **kwargs):
6986 """
5b5c9bc7 6987 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
6988
6989 Reparents the window, i.e the window will be removed from its current
6990 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6991 re-inserted into another. Available on Windows and GTK. Returns True
6992 if the parent was changed, False otherwise (error or newParent ==
6993 oldParent)
6994 """
5b5c9bc7 6995 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
6996
6997 def AddChild(*args, **kwargs):
6998 """
5b5c9bc7 6999 AddChild(self, Window child)
d55e5bfc
RD
7000
7001 Adds a child window. This is called automatically by window creation
7002 functions so should not be required by the application programmer.
7003 """
5b5c9bc7 7004 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
7005
7006 def RemoveChild(*args, **kwargs):
7007 """
5b5c9bc7 7008 RemoveChild(self, Window child)
d55e5bfc
RD
7009
7010 Removes a child window. This is called automatically by window
7011 deletion functions so should not be required by the application
7012 programmer.
7013 """
5b5c9bc7 7014 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc
RD
7015
7016 def FindWindowById(*args, **kwargs):
7017 """
5b5c9bc7 7018 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
7019
7020 Find a chld of this window by window ID
7021 """
5b5c9bc7 7022 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
7023
7024 def FindWindowByName(*args, **kwargs):
7025 """
5b5c9bc7 7026 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
7027
7028 Find a child of this window by name
7029 """
5b5c9bc7 7030 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
7031
7032 def GetEventHandler(*args, **kwargs):
7033 """
5b5c9bc7 7034 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
7035
7036 Returns the event handler for this window. By default, the window is
7037 its own event handler.
7038 """
5b5c9bc7 7039 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
7040
7041 def SetEventHandler(*args, **kwargs):
7042 """
5b5c9bc7 7043 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
7044
7045 Sets the event handler for this window. An event handler is an object
7046 that is capable of processing the events sent to a window. By default,
7047 the window is its own event handler, but an application may wish to
7048 substitute another, for example to allow central implementation of
7049 event-handling for a variety of different window classes.
7050
15817c7e 7051 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
7052 up a chain of event handlers, where an event not handled by one event
7053 handler is handed to the next one in the chain.
7054 """
5b5c9bc7 7055 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
7056
7057 def PushEventHandler(*args, **kwargs):
7058 """
5b5c9bc7 7059 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
7060
7061 Pushes this event handler onto the event handler stack for the window.
7062 An event handler is an object that is capable of processing the events
7063 sent to a window. By default, the window is its own event handler, but
7064 an application may wish to substitute another, for example to allow
7065 central implementation of event-handling for a variety of different
7066 window classes.
7067
7068 wx.Window.PushEventHandler allows an application to set up a chain of
7069 event handlers, where an event not handled by one event handler is
15817c7e 7070 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
7071 remove the event handler.
7072 """
5b5c9bc7 7073 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
7074
7075 def PopEventHandler(*args, **kwargs):
7076 """
5b5c9bc7 7077 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
7078
7079 Removes and returns the top-most event handler on the event handler
7080 stack. If deleteHandler is True then the wx.EvtHandler object will be
7081 destroyed after it is popped.
7082 """
5b5c9bc7 7083 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
7084
7085 def RemoveEventHandler(*args, **kwargs):
7086 """
5b5c9bc7 7087 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 7088
15817c7e
RD
7089 Find the given handler in the event handler chain and remove (but not
7090 delete) it from the event handler chain, return True if it was found
7091 and False otherwise (this also results in an assert failure so this
7092 function should only be called when the handler is supposed to be
7093 there.)
d55e5bfc 7094 """
5b5c9bc7 7095 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
7096
7097 def SetValidator(*args, **kwargs):
7098 """
5b5c9bc7 7099 SetValidator(self, Validator validator)
d55e5bfc
RD
7100
7101 Deletes the current validator (if any) and sets the window validator,
7102 having called wx.Validator.Clone to create a new validator of this
7103 type.
7104 """
5b5c9bc7 7105 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
7106
7107 def GetValidator(*args, **kwargs):
7108 """
5b5c9bc7 7109 GetValidator(self) -> Validator
d55e5bfc
RD
7110
7111 Returns a pointer to the current validator for the window, or None if
7112 there is none.
7113 """
5b5c9bc7 7114 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
7115
7116 def Validate(*args, **kwargs):
7117 """
7118 Validate(self) -> bool
7119
7120 Validates the current values of the child controls using their
15817c7e
RD
7121 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7122 style flag set, the method will also call Validate() of all child
7123 windows. Returns false if any of the validations failed.
d55e5bfc 7124 """
5b5c9bc7 7125 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
7126
7127 def TransferDataToWindow(*args, **kwargs):
7128 """
7129 TransferDataToWindow(self) -> bool
7130
15817c7e
RD
7131 Transfers values to child controls from data areas specified by their
7132 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7133 style flag set, the method will also call TransferDataToWindow() of
7134 all child windows.
d55e5bfc 7135 """
5b5c9bc7 7136 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
7137
7138 def TransferDataFromWindow(*args, **kwargs):
7139 """
7140 TransferDataFromWindow(self) -> bool
7141
15817c7e
RD
7142 Transfers values from child controls to data areas specified by their
7143 validators. Returns false if a transfer failed. If the window has
7144 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
7145 also call TransferDataFromWindow() of all child windows.
d55e5bfc 7146 """
5b5c9bc7 7147 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
7148
7149 def InitDialog(*args, **kwargs):
7150 """
7151 InitDialog(self)
7152
15817c7e
RD
7153 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
7154 to the dialog via validators.
d55e5bfc 7155 """
5b5c9bc7 7156 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
7157
7158 def SetAcceleratorTable(*args, **kwargs):
7159 """
5b5c9bc7 7160 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
7161
7162 Sets the accelerator table for this window.
7163 """
5b5c9bc7 7164 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
7165
7166 def GetAcceleratorTable(*args, **kwargs):
7167 """
5b5c9bc7 7168 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
7169
7170 Gets the accelerator table for this window.
7171 """
5b5c9bc7 7172 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
7173
7174 def RegisterHotKey(*args, **kwargs):
7175 """
7176 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
7177
7178 Registers a system wide hotkey. Every time the user presses the hotkey
7179 registered here, this window will receive a hotkey event. It will
7180 receive the event even if the application is in the background and
7181 does not have the input focus because the user is working with some
7182 other application. To bind an event handler function to this hotkey
7183 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
7184 hotkey was registered successfully.
7185 """
5b5c9bc7 7186 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
7187
7188 def UnregisterHotKey(*args, **kwargs):
7189 """
7190 UnregisterHotKey(self, int hotkeyId) -> bool
7191
7192 Unregisters a system wide hotkey.
7193 """
5b5c9bc7 7194 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
7195
7196 def ConvertDialogPointToPixels(*args, **kwargs):
7197 """
5b5c9bc7 7198 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
7199
7200 Converts a point or size from dialog units to pixels. Dialog units
7201 are used for maintaining a dialog's proportions even if the font
7202 changes. For the x dimension, the dialog units are multiplied by the
7203 average character width and then divided by 4. For the y dimension,
7204 the dialog units are multiplied by the average character height and
7205 then divided by 8.
7206 """
5b5c9bc7 7207 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
7208
7209 def ConvertDialogSizeToPixels(*args, **kwargs):
7210 """
5b5c9bc7 7211 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
7212
7213 Converts a point or size from dialog units to pixels. Dialog units
7214 are used for maintaining a dialog's proportions even if the font
7215 changes. For the x dimension, the dialog units are multiplied by the
7216 average character width and then divided by 4. For the y dimension,
7217 the dialog units are multiplied by the average character height and
7218 then divided by 8.
7219 """
5b5c9bc7 7220 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
7221
7222 def DLG_PNT(*args, **kwargs):
7223 """
5b5c9bc7 7224 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
7225
7226 Converts a point or size from dialog units to pixels. Dialog units
7227 are used for maintaining a dialog's proportions even if the font
7228 changes. For the x dimension, the dialog units are multiplied by the
7229 average character width and then divided by 4. For the y dimension,
7230 the dialog units are multiplied by the average character height and
7231 then divided by 8.
7232 """
5b5c9bc7 7233 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
7234
7235 def DLG_SZE(*args, **kwargs):
7236 """
5b5c9bc7 7237 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
7238
7239 Converts a point or size from dialog units to pixels. Dialog units
7240 are used for maintaining a dialog's proportions even if the font
7241 changes. For the x dimension, the dialog units are multiplied by the
7242 average character width and then divided by 4. For the y dimension,
7243 the dialog units are multiplied by the average character height and
7244 then divided by 8.
7245 """
5b5c9bc7 7246 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
7247
7248 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
7249 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
7250 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
7251
7252 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
7253 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
7254 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
7255
7256 def WarpPointer(*args, **kwargs):
7257 """
7258 WarpPointer(self, int x, int y)
7259
7260 Moves the pointer to the given position on the window.
7261
7262 NOTE: This function is not supported under Mac because Apple Human
7263 Interface Guidelines forbid moving the mouse cursor programmatically.
7264 """
5b5c9bc7 7265 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
7266
7267 def CaptureMouse(*args, **kwargs):
7268 """
7269 CaptureMouse(self)
7270
7271 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
7272 release the capture.
7273
7274 Note that wxWindows maintains the stack of windows having captured the
7275 mouse and when the mouse is released the capture returns to the window
7276 which had had captured it previously and it is only really released if
7277 there were no previous window. In particular, this means that you must
7278 release the mouse as many times as you capture it.
7279 """
5b5c9bc7 7280 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
7281
7282 def ReleaseMouse(*args, **kwargs):
7283 """
7284 ReleaseMouse(self)
7285
7286 Releases mouse input captured with wx.Window.CaptureMouse.
7287 """
5b5c9bc7 7288 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
7289
7290 def GetCapture(*args, **kwargs):
7291 """
5b5c9bc7 7292 GetCapture() -> Window
d55e5bfc
RD
7293
7294 Returns the window which currently captures the mouse or None
7295 """
5b5c9bc7 7296 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
7297
7298 GetCapture = staticmethod(GetCapture)
7299 def HasCapture(*args, **kwargs):
7300 """
7301 HasCapture(self) -> bool
7302
7303 Returns true if this window has the current mouse capture.
7304 """
5b5c9bc7 7305 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
7306
7307 def Refresh(*args, **kwargs):
7308 """
5b5c9bc7 7309 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
7310
7311 Mark the specified rectangle (or the whole window) as "dirty" so it
7312 will be repainted. Causes an EVT_PAINT event to be generated and sent
7313 to the window.
7314 """
5b5c9bc7 7315 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
7316
7317 def RefreshRect(*args, **kwargs):
7318 """
5b5c9bc7 7319 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
7320
7321 Redraws the contents of the given rectangle: the area inside it will
7322 be repainted. This is the same as Refresh but has a nicer syntax.
7323 """
5b5c9bc7 7324 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
7325
7326 def Update(*args, **kwargs):
7327 """
7328 Update(self)
7329
7330 Calling this method immediately repaints the invalidated area of the
7331 window instead of waiting for the EVT_PAINT event to happen, (normally
7332 this would usually only happen when the flow of control returns to the
7333 event loop.) Notice that this function doesn't refresh the window and
7334 does nothing if the window has been already repainted. Use Refresh
7335 first if you want to immediately redraw the window (or some portion of
7336 it) unconditionally.
7337 """
5b5c9bc7 7338 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
7339
7340 def ClearBackground(*args, **kwargs):
7341 """
7342 ClearBackground(self)
7343
7344 Clears the window by filling it with the current background
7345 colour. Does not cause an erase background event to be generated.
7346 """
5b5c9bc7 7347 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
7348
7349 def Freeze(*args, **kwargs):
7350 """
7351 Freeze(self)
7352
15817c7e
RD
7353 Freezes the window or, in other words, prevents any updates from
7354 taking place on screen, the window is not redrawn at all. Thaw must be
7355 called to reenable window redrawing. Calls to Freeze/Thaw may be
7356 nested, with the actual Thaw being delayed until all the nesting has
7357 been undone.
d55e5bfc
RD
7358
7359 This method is useful for visual appearance optimization (for example,
7360 it is a good idea to use it before inserting large amount of text into
7361 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
7362 for all controls so it is mostly just a hint to wxWindows and not a
7363 mandatory directive.
7364 """
5b5c9bc7 7365 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc
RD
7366
7367 def Thaw(*args, **kwargs):
7368 """
7369 Thaw(self)
7370
7371 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
7372 Freeze/Thaw may be nested, so Thaw must be called the same number of
7373 times that Freeze was before the window will be updated.
d55e5bfc 7374 """
5b5c9bc7 7375 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
7376
7377 def PrepareDC(*args, **kwargs):
7378 """
5b5c9bc7 7379 PrepareDC(self, DC dc)
d55e5bfc
RD
7380
7381 Call this function to prepare the device context for drawing a
7382 scrolled image. It sets the device origin according to the current
7383 scroll position.
7384 """
5b5c9bc7 7385 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc
RD
7386
7387 def GetUpdateRegion(*args, **kwargs):
7388 """
5b5c9bc7 7389 GetUpdateRegion(self) -> Region
d55e5bfc
RD
7390
7391 Returns the region specifying which parts of the window have been
7392 damaged. Should only be called within an EVT_PAINT handler.
7393 """
5b5c9bc7 7394 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
7395
7396 def GetUpdateClientRect(*args, **kwargs):
7397 """
5b5c9bc7 7398 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
7399
7400 Get the update rectangle region bounding box in client coords.
7401 """
5b5c9bc7 7402 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
7403
7404 def IsExposed(*args, **kwargs):
7405 """
7406 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
7407
7408 Returns true if the given point or rectangle area has been exposed
7409 since the last repaint. Call this in an paint event handler to
7410 optimize redrawing by only redrawing those areas, which have been
7411 exposed.
7412 """
5b5c9bc7 7413 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
7414
7415 def IsExposedPoint(*args, **kwargs):
7416 """
5b5c9bc7 7417 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
7418
7419 Returns true if the given point or rectangle area has been exposed
7420 since the last repaint. Call this in an paint event handler to
7421 optimize redrawing by only redrawing those areas, which have been
7422 exposed.
7423 """
5b5c9bc7 7424 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
7425
7426 def IsExposedRect(*args, **kwargs):
7427 """
5b5c9bc7 7428 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
7429
7430 Returns true if the given point or rectangle area has been exposed
7431 since the last repaint. Call this in an paint event handler to
7432 optimize redrawing by only redrawing those areas, which have been
7433 exposed.
7434 """
5b5c9bc7 7435 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
7436
7437 def GetDefaultAttributes(*args, **kwargs):
7438 """
5b5c9bc7 7439 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 7440
15817c7e
RD
7441 Get the default attributes for an instance of this class. This is
7442 useful if you want to use the same font or colour in your own control
7443 as in a standard control -- which is a much better idea than hard
7444 coding specific colours or fonts which might look completely out of
a5ee0656 7445 place on the user's system, especially if it uses themes.
d55e5bfc 7446 """
5b5c9bc7 7447 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
7448
7449 def GetClassDefaultAttributes(*args, **kwargs):
7450 """
5b5c9bc7 7451 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 7452
15817c7e
RD
7453 Get the default attributes for this class. This is useful if you want
7454 to use the same font or colour in your own control as in a standard
7455 control -- which is a much better idea than hard coding specific
a5ee0656
RD
7456 colours or fonts which might look completely out of place on the
7457 user's system, especially if it uses themes.
d55e5bfc
RD
7458
7459 The variant parameter is only relevant under Mac currently and is
15817c7e 7460 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
7461 the returned font. See `wx.Window.SetWindowVariant` for more about
7462 this.
d55e5bfc 7463 """
5b5c9bc7 7464 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
7465
7466 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
7467 def SetBackgroundColour(*args, **kwargs):
7468 """
5b5c9bc7 7469 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
7470
7471 Sets the background colour of the window. Returns True if the colour
7472 was changed. The background colour is usually painted by the default
7473 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
7474 automatically under GTK. Using `wx.NullColour` will reset the window
7475 to the default background colour.
d55e5bfc 7476
a5ee0656 7477 Note that setting the background colour may not cause an immediate
f8167d6e 7478 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
7479 calling this function.
7480
f8167d6e
RD
7481 Using this function will disable attempts to use themes for this
7482 window, if the system supports them. Use with care since usually the
7483 themes represent the appearance chosen by the user to be used for all
7484 applications on the system.
d55e5bfc 7485 """
5b5c9bc7 7486 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 7487
412d302d 7488 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
7489 """SetOwnBackgroundColour(self, Colour colour)"""
7490 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
7491
7492 def SetForegroundColour(*args, **kwargs):
7493 """
5b5c9bc7 7494 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
7495
7496 Sets the foreground colour of the window. Returns True is the colour
7497 was changed. The interpretation of foreground colour is dependent on
7498 the window class; it may be the text colour or other colour, or it may
7499 not be used at all.
7500 """
5b5c9bc7 7501 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 7502
fa47d7a7 7503 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
7504 """SetOwnForegroundColour(self, Colour colour)"""
7505 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
7506
7507 def GetBackgroundColour(*args, **kwargs):
7508 """
5b5c9bc7 7509 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
7510
7511 Returns the background colour of the window.
7512 """
5b5c9bc7 7513 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
7514
7515 def GetForegroundColour(*args, **kwargs):
7516 """
5b5c9bc7 7517 GetForegroundColour(self) -> Colour
d55e5bfc
RD
7518
7519 Returns the foreground colour of the window. The interpretation of
7520 foreground colour is dependent on the window class; it may be the text
7521 colour or other colour, or it may not be used at all.
7522 """
5b5c9bc7 7523 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 7524
dcb8fc74
RD
7525 def InheritsBackgroundColour(*args, **kwargs):
7526 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 7527 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
7528
7529 def UseBgCol(*args, **kwargs):
7530 """UseBgCol(self) -> bool"""
5b5c9bc7 7531 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 7532
0f63ec68
RD
7533 def SetBackgroundStyle(*args, **kwargs):
7534 """
7535 SetBackgroundStyle(self, int style) -> bool
7536
7537 Returns the background style of the window. The background style
7538 indicates how the background of the window is drawn.
7539
7540 ====================== ========================================
7541 wx.BG_STYLE_SYSTEM The background colour or pattern should
7542 be determined by the system
7543 wx.BG_STYLE_COLOUR The background should be a solid colour
7544 wx.BG_STYLE_CUSTOM The background will be implemented by the
7545 application.
7546 ====================== ========================================
7547
7548 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
7549 a custom background, such as a tiled bitmap. Currently the style has
7550 no effect on other platforms.
7551
7552 :see: `GetBackgroundStyle`, `SetBackgroundColour`
7553 """
5b5c9bc7 7554 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
7555
7556 def GetBackgroundStyle(*args, **kwargs):
7557 """
7558 GetBackgroundStyle(self) -> int
7559
7560 Returns the background style of the window.
7561
7562 :see: `SetBackgroundStyle`
7563 """
5b5c9bc7 7564 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 7565
51b83b37
RD
7566 def HasTransparentBackground(*args, **kwargs):
7567 """
7568 HasTransparentBackground(self) -> bool
7569
7570 Returns True if this window's background is transparent (as, for
7571 example, for `wx.StaticText`) and should show the parent window's
7572 background.
7573
7574 This method is mostly used internally by the library itself and you
7575 normally shouldn't have to call it. You may, however, have to override
7576 it in your custom control classes to ensure that background is painted
7577 correctly.
7578 """
5b5c9bc7 7579 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 7580
d55e5bfc
RD
7581 def SetCursor(*args, **kwargs):
7582 """
5b5c9bc7 7583 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
7584
7585 Sets the window's cursor. Notice that the window cursor also sets it
7586 for the children of the window implicitly.
7587
7588 The cursor may be wx.NullCursor in which case the window cursor will
7589 be reset back to default.
7590 """
5b5c9bc7 7591 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
7592
7593 def GetCursor(*args, **kwargs):
7594 """
5b5c9bc7 7595 GetCursor(self) -> Cursor
d55e5bfc
RD
7596
7597 Return the cursor associated with this window.
7598 """
5b5c9bc7 7599 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
7600
7601 def SetFont(*args, **kwargs):
7602 """
5b5c9bc7 7603 SetFont(self, Font font) -> bool
d55e5bfc
RD
7604
7605 Sets the font for this window.
7606 """
5b5c9bc7 7607 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 7608
fa47d7a7 7609 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
7610 """SetOwnFont(self, Font font)"""
7611 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
7612
7613 def GetFont(*args, **kwargs):
7614 """
5b5c9bc7 7615 GetFont(self) -> Font
d55e5bfc
RD
7616
7617 Returns the default font used for this window.
7618 """
5b5c9bc7 7619 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
7620
7621 def SetCaret(*args, **kwargs):
7622 """
5b5c9bc7 7623 SetCaret(self, Caret caret)
d55e5bfc
RD
7624
7625 Sets the caret associated with the window.
7626 """
5b5c9bc7 7627 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
7628
7629 def GetCaret(*args, **kwargs):
7630 """
5b5c9bc7 7631 GetCaret(self) -> Caret
d55e5bfc
RD
7632
7633 Returns the caret associated with the window.
7634 """
5b5c9bc7 7635 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
7636
7637 def GetCharHeight(*args, **kwargs):
7638 """
7639 GetCharHeight(self) -> int
7640
7641 Get the (average) character size for the current font.
7642 """
5b5c9bc7 7643 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
7644
7645 def GetCharWidth(*args, **kwargs):
7646 """
7647 GetCharWidth(self) -> int
7648
7649 Get the (average) character size for the current font.
7650 """
5b5c9bc7 7651 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
7652
7653 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
7654 """
7655 GetTextExtent(String string) -> (width, height)
7656
7657 Get the width and height of the text using the current font.
7658 """
5b5c9bc7 7659 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
7660
7661 def GetFullTextExtent(*args, **kwargs):
7662 """
7663 GetFullTextExtent(String string, Font font=None) ->
7664 (width, height, descent, externalLeading)
7665
7666 Get the width, height, decent and leading of the text using the
7667 current or specified font.
7668 """
5b5c9bc7 7669 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
7670
7671 def ClientToScreenXY(*args, **kwargs):
7672 """
7673 ClientToScreenXY(int x, int y) -> (x,y)
7674
7675 Converts to screen coordinates from coordinates relative to this window.
7676 """
5b5c9bc7 7677 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
7678
7679 def ScreenToClientXY(*args, **kwargs):
7680 """
7681 ScreenToClientXY(int x, int y) -> (x,y)
7682
7683 Converts from screen to client window coordinates.
7684 """
5b5c9bc7 7685 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
7686
7687 def ClientToScreen(*args, **kwargs):
7688 """
5b5c9bc7 7689 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
7690
7691 Converts to screen coordinates from coordinates relative to this window.
7692 """
5b5c9bc7 7693 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
7694
7695 def ScreenToClient(*args, **kwargs):
7696 """
5b5c9bc7 7697 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
7698
7699 Converts from screen to client window coordinates.
7700 """
5b5c9bc7 7701 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
7702
7703 def HitTestXY(*args, **kwargs):
7704 """
7705 HitTestXY(self, int x, int y) -> int
7706
7707 Test where the given (in client coords) point lies
7708 """
5b5c9bc7 7709 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
7710
7711 def HitTest(*args, **kwargs):
7712 """
5b5c9bc7 7713 HitTest(self, Point pt) -> int
d55e5bfc
RD
7714
7715 Test where the given (in client coords) point lies
7716 """
5b5c9bc7 7717 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
7718
7719 def GetBorder(*args):
7720 """
7721 GetBorder(self, long flags) -> int
7722 GetBorder(self) -> int
7723
7724 Get border for the flags of this window
7725 """
5b5c9bc7 7726 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
7727
7728 def UpdateWindowUI(*args, **kwargs):
7729 """
5b5c9bc7 7730 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
7731
7732 This function sends EVT_UPDATE_UI events to the window. The particular
7733 implementation depends on the window; for example a wx.ToolBar will
7734 send an update UI event for each toolbar button, and a wx.Frame will
7735 send an update UI event for each menubar menu item. You can call this
7736 function from your application to ensure that your UI is up-to-date at
7737 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7738 concerned). This may be necessary if you have called
7739 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7740 limit the overhead that wxWindows incurs by sending update UI events
7741 in idle time.
d55e5bfc 7742 """
5b5c9bc7 7743 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
7744
7745 def PopupMenuXY(*args, **kwargs):
7746 """
5b5c9bc7 7747 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 7748
b0503257
RD
7749 Pops up the given menu at the specified coordinates, relative to this window,
7750 and returns control when the user has dismissed the menu. If a menu item is
7751 selected, the corresponding menu event is generated and will be processed as
7752 usual. If the default position is given then the current position of the
7753 mouse cursor will be used.
d55e5bfc 7754 """
5b5c9bc7 7755 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
7756
7757 def PopupMenu(*args, **kwargs):
7758 """
5b5c9bc7 7759 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 7760
b0503257
RD
7761 Pops up the given menu at the specified coordinates, relative to this window,
7762 and returns control when the user has dismissed the menu. If a menu item is
7763 selected, the corresponding menu event is generated and will be processed as
7764 usual. If the default position is given then the current position of the
7765 mouse cursor will be used.
d55e5bfc 7766 """
5b5c9bc7 7767 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc
RD
7768
7769 def GetHandle(*args, **kwargs):
7770 """
7771 GetHandle(self) -> long
7772
7773 Returns the platform-specific handle (as a long integer) of the
7774 physical window. Currently on wxMac it returns the handle of the
7775 toplevel parent of the window.
7776 """
5b5c9bc7 7777 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 7778
629e65c2
RD
7779 def AssociateHandle(*args, **kwargs):
7780 """
7781 AssociateHandle(self, long handle)
7782
7783 Associate the window with a new native handle
7784 """
5b5c9bc7 7785 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
7786
7787 def DissociateHandle(*args, **kwargs):
7788 """
7789 DissociateHandle(self)
7790
7791 Dissociate the current native handle from the window
7792 """
5b5c9bc7 7793 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 7794
d55e5bfc
RD
7795 def HasScrollbar(*args, **kwargs):
7796 """
7797 HasScrollbar(self, int orient) -> bool
7798
7799 Does the window have the scrollbar for this orientation?
7800 """
5b5c9bc7 7801 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
7802
7803 def SetScrollbar(*args, **kwargs):
7804 """
15817c7e 7805 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
7806 bool refresh=True)
7807
7808 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 7809 """
5b5c9bc7 7810 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
7811
7812 def SetScrollPos(*args, **kwargs):
7813 """
7814 SetScrollPos(self, int orientation, int pos, bool refresh=True)
7815
7816 Sets the position of one of the built-in scrollbars.
7817 """
5b5c9bc7 7818 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
7819
7820 def GetScrollPos(*args, **kwargs):
7821 """
7822 GetScrollPos(self, int orientation) -> int
7823
7824 Returns the built-in scrollbar position.
7825 """
5b5c9bc7 7826 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
7827
7828 def GetScrollThumb(*args, **kwargs):
7829 """
7830 GetScrollThumb(self, int orientation) -> int
7831
7832 Returns the built-in scrollbar thumb size.
7833 """
5b5c9bc7 7834 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
7835
7836 def GetScrollRange(*args, **kwargs):
7837 """
7838 GetScrollRange(self, int orientation) -> int
7839
7840 Returns the built-in scrollbar range.
7841 """
5b5c9bc7 7842 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
7843
7844 def ScrollWindow(*args, **kwargs):
7845 """
5b5c9bc7 7846 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
7847
7848 Physically scrolls the pixels in the window and move child windows
7849 accordingly. Use this function to optimise your scrolling
7850 implementations, to minimise the area that must be redrawn. Note that
7851 it is rarely required to call this function from a user program.
d55e5bfc 7852 """
5b5c9bc7 7853 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
7854
7855 def ScrollLines(*args, **kwargs):
7856 """
7857 ScrollLines(self, int lines) -> bool
7858
7859 If the platform and window class supports it, scrolls the window by
7860 the given number of lines down, if lines is positive, or up if lines
7861 is negative. Returns True if the window was scrolled, False if it was
7862 already on top/bottom and nothing was done.
7863 """
5b5c9bc7 7864 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
7865
7866 def ScrollPages(*args, **kwargs):
7867 """
7868 ScrollPages(self, int pages) -> bool
7869
15817c7e 7870 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
7871 the given number of pages down, if pages is positive, or up if pages
7872 is negative. Returns True if the window was scrolled, False if it was
7873 already on top/bottom and nothing was done.
7874 """
5b5c9bc7 7875 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
7876
7877 def LineUp(*args, **kwargs):
7878 """
7879 LineUp(self) -> bool
7880
7881 This is just a wrapper for ScrollLines(-1).
7882 """
5b5c9bc7 7883 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
7884
7885 def LineDown(*args, **kwargs):
7886 """
7887 LineDown(self) -> bool
7888
7889 This is just a wrapper for ScrollLines(1).
7890 """
5b5c9bc7 7891 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
7892
7893 def PageUp(*args, **kwargs):
7894 """
7895 PageUp(self) -> bool
7896
7897 This is just a wrapper for ScrollPages(-1).
7898 """
5b5c9bc7 7899 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
7900
7901 def PageDown(*args, **kwargs):
7902 """
7903 PageDown(self) -> bool
7904
7905 This is just a wrapper for ScrollPages(1).
7906 """
5b5c9bc7 7907 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
7908
7909 def SetHelpText(*args, **kwargs):
7910 """
5b5c9bc7 7911 SetHelpText(self, String text)
d55e5bfc
RD
7912
7913 Sets the help text to be used as context-sensitive help for this
7914 window. Note that the text is actually stored by the current
7915 wxHelpProvider implementation, and not in the window object itself.
7916 """
5b5c9bc7 7917 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
7918
7919 def SetHelpTextForId(*args, **kwargs):
7920 """
5b5c9bc7 7921 SetHelpTextForId(self, String text)
d55e5bfc
RD
7922
7923 Associate this help text with all windows with the same id as this
7924 one.
7925 """
5b5c9bc7 7926 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc
RD
7927
7928 def GetHelpText(*args, **kwargs):
7929 """
5b5c9bc7 7930 GetHelpText(self) -> String
d55e5bfc
RD
7931
7932 Gets the help text to be used as context-sensitive help for this
7933 window. Note that the text is actually stored by the current
7934 wxHelpProvider implementation, and not in the window object itself.
7935 """
5b5c9bc7 7936 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
7937
7938 def SetToolTipString(*args, **kwargs):
7939 """
5b5c9bc7 7940 SetToolTipString(self, String tip)
d55e5bfc
RD
7941
7942 Attach a tooltip to the window.
7943 """
5b5c9bc7 7944 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
7945
7946 def SetToolTip(*args, **kwargs):
7947 """
5b5c9bc7 7948 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
7949
7950 Attach a tooltip to the window.
7951 """
5b5c9bc7 7952 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
7953
7954 def GetToolTip(*args, **kwargs):
7955 """
5b5c9bc7 7956 GetToolTip(self) -> ToolTip
d55e5bfc
RD
7957
7958 get the associated tooltip or None if none
7959 """
5b5c9bc7 7960 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
7961
7962 def SetDropTarget(*args, **kwargs):
7963 """
5b5c9bc7 7964 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
7965
7966 Associates a drop target with this window. If the window already has
7967 a drop target, it is deleted.
7968 """
5b5c9bc7 7969 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
7970
7971 def GetDropTarget(*args, **kwargs):
7972 """
5b5c9bc7 7973 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
7974
7975 Returns the associated drop target, which may be None.
7976 """
5b5c9bc7 7977 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc
RD
7978
7979 def SetConstraints(*args, **kwargs):
7980 """
5b5c9bc7 7981 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
7982
7983 Sets the window to have the given layout constraints. If an existing
7984 layout constraints object is already owned by the window, it will be
7985 deleted. Pass None to disassociate and delete the window's current
7986 constraints.
7987
7988 You must call SetAutoLayout to tell a window to use the constraints
7989 automatically in its default EVT_SIZE handler; otherwise, you must
7990 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7991 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7992 effect.
7993 """
5b5c9bc7 7994 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
7995
7996 def GetConstraints(*args, **kwargs):
7997 """
5b5c9bc7 7998 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
7999
8000 Returns a pointer to the window's layout constraints, or None if there
8001 are none.
8002 """
5b5c9bc7 8003 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
8004
8005 def SetAutoLayout(*args, **kwargs):
8006 """
8007 SetAutoLayout(self, bool autoLayout)
8008
8009 Determines whether the Layout function will be called automatically
8010 when the window is resized. It is called implicitly by SetSizer but
8011 if you use SetConstraints you should call it manually or otherwise the
8012 window layout won't be correctly updated when its size changes.
8013 """
5b5c9bc7 8014 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
8015
8016 def GetAutoLayout(*args, **kwargs):
8017 """
8018 GetAutoLayout(self) -> bool
8019
8020 Returns the current autoLayout setting
8021 """
5b5c9bc7 8022 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
8023
8024 def Layout(*args, **kwargs):
8025 """
8026 Layout(self) -> bool
8027
8028 Invokes the constraint-based layout algorithm or the sizer-based
8029 algorithm for this window. See SetAutoLayout: when auto layout is on,
8030 this function gets called automatically by the default EVT_SIZE
8031 handler when the window is resized.
8032 """
5b5c9bc7 8033 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
8034
8035 def SetSizer(*args, **kwargs):
8036 """
5b5c9bc7 8037 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
8038
8039 Sets the window to have the given layout sizer. The window will then
8040 own the object, and will take care of its deletion. If an existing
8041 layout sizer object is already owned by the window, it will be deleted
8042 if the deleteOld parameter is true. Note that this function will also
8043 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 8044 non-None, and False otherwise.
d55e5bfc 8045 """
5b5c9bc7 8046 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
8047
8048 def SetSizerAndFit(*args, **kwargs):
8049 """
5b5c9bc7 8050 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
8051
8052 The same as SetSizer, except it also sets the size hints for the
8053 window based on the sizer's minimum size.
8054 """
5b5c9bc7 8055 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
8056
8057 def GetSizer(*args, **kwargs):
8058 """
5b5c9bc7 8059 GetSizer(self) -> Sizer
d55e5bfc
RD
8060
8061 Return the sizer associated with the window by a previous call to
8062 SetSizer or None if there isn't one.
8063 """
5b5c9bc7 8064 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
8065
8066 def SetContainingSizer(*args, **kwargs):
8067 """
5b5c9bc7 8068 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
8069
8070 This normally does not need to be called by application code. It is
8071 called internally when a window is added to a sizer, and is used so
8072 the window can remove itself from the sizer when it is destroyed.
8073 """
5b5c9bc7 8074 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
8075
8076 def GetContainingSizer(*args, **kwargs):
8077 """
5b5c9bc7 8078 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
8079
8080 Return the sizer that this window is a member of, if any, otherwise None.
8081 """
5b5c9bc7 8082 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
8083
8084 def InheritAttributes(*args, **kwargs):
8085 """
8086 InheritAttributes(self)
8087
15817c7e
RD
8088 This function is (or should be, in case of custom controls) called
8089 during window creation to intelligently set up the window visual
8090 attributes, that is the font and the foreground and background
8091 colours.
8092
8093 By 'intelligently' the following is meant: by default, all windows use
8094 their own default attributes. However if some of the parent's
8095 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 8096 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
8097 explicitly set for this window itself, then this window takes the same
8098 value as used by the parent. In addition, if the window overrides
8099 ShouldInheritColours to return false, the colours will not be changed
8100 no matter what and only the font might.
8101
a7bb0a9d
RD
8102 This rather complicated logic is necessary in order to accommodate the
8103 different usage scenarios. The most common one is when all default
15817c7e
RD
8104 attributes are used and in this case, nothing should be inherited as
8105 in modern GUIs different controls use different fonts (and colours)
8106 than their siblings so they can't inherit the same value from the
8107 parent. However it was also deemed desirable to allow to simply change
8108 the attributes of all children at once by just changing the font or
8109 colour of their common parent, hence in this case we do inherit the
8110 parents attributes.
8111
d55e5bfc 8112 """
5b5c9bc7 8113 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
8114
8115 def ShouldInheritColours(*args, **kwargs):
8116 """
8117 ShouldInheritColours(self) -> bool
8118
8119 Return true from here to allow the colours of this window to be
15817c7e
RD
8120 changed by InheritAttributes, returning false forbids inheriting them
8121 from the parent window.
d55e5bfc 8122
15817c7e
RD
8123 The base class version returns false, but this method is overridden in
8124 wxControl where it returns true.
d55e5bfc 8125 """
5b5c9bc7 8126 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc
RD
8127
8128 def PostCreate(self, pre):
8129 """
8130 Phase 3 of the 2-phase create <wink!>
8131 Call this method after precreating the window with the 2-phase create method.
8132 """
8133 self.this = pre.this
8134 self.thisown = pre.thisown
8135 pre.thisown = 0
8136 if hasattr(self, '_setOORInfo'):
8137 self._setOORInfo(self)
8138 if hasattr(self, '_setCallbackInfo'):
8139 self._setCallbackInfo(self, self.__class__)
8140
8141
5b5c9bc7 8142class WindowPtr(Window):
d55e5bfc
RD
8143 def __init__(self, this):
8144 self.this = this
8145 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
8146 self.__class__ = Window
8147_core_.Window_swigregister(WindowPtr)
d55e5bfc
RD
8148
8149def PreWindow(*args, **kwargs):
8150 """
5b5c9bc7 8151 PreWindow() -> Window
d55e5bfc
RD
8152
8153 Precreate a Window for 2-phase creation.
8154 """
5b5c9bc7 8155 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
8156 val.thisown = 1
8157 return val
8158
5b5c9bc7 8159def Window_NewControlId(*args, **kwargs):
d55e5bfc 8160 """
5b5c9bc7 8161 Window_NewControlId() -> int
d55e5bfc
RD
8162
8163 Generate a control id for the controls which were not given one.
8164 """
5b5c9bc7 8165 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc 8166
5b5c9bc7 8167def Window_NextControlId(*args, **kwargs):
d55e5bfc 8168 """
5b5c9bc7 8169 Window_NextControlId(int winid) -> int
d55e5bfc
RD
8170
8171 Get the id of the control following the one with the given
15817c7e 8172 autogenerated) id
d55e5bfc 8173 """
5b5c9bc7 8174 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 8175
5b5c9bc7 8176def Window_PrevControlId(*args, **kwargs):
d55e5bfc 8177 """
5b5c9bc7 8178 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
8179
8180 Get the id of the control preceding the one with the given
15817c7e 8181 autogenerated) id
d55e5bfc 8182 """
5b5c9bc7 8183 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 8184
5b5c9bc7 8185def Window_FindFocus(*args, **kwargs):
d55e5bfc 8186 """
5b5c9bc7 8187 Window_FindFocus() -> Window
d55e5bfc
RD
8188
8189 Returns the window or control that currently has the keyboard focus,
8190 or None.
8191 """
5b5c9bc7 8192 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc 8193
5b5c9bc7 8194def Window_GetCapture(*args, **kwargs):
d55e5bfc 8195 """
5b5c9bc7 8196 Window_GetCapture() -> Window
d55e5bfc
RD
8197
8198 Returns the window which currently captures the mouse or None
8199 """
5b5c9bc7 8200 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc 8201
5b5c9bc7 8202def Window_GetClassDefaultAttributes(*args, **kwargs):
d55e5bfc 8203 """
5b5c9bc7 8204 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 8205
15817c7e
RD
8206 Get the default attributes for this class. This is useful if you want
8207 to use the same font or colour in your own control as in a standard
8208 control -- which is a much better idea than hard coding specific
a5ee0656
RD
8209 colours or fonts which might look completely out of place on the
8210 user's system, especially if it uses themes.
d55e5bfc
RD
8211
8212 The variant parameter is only relevant under Mac currently and is
15817c7e 8213 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
8214 the returned font. See `wx.Window.SetWindowVariant` for more about
8215 this.
d55e5bfc 8216 """
5b5c9bc7 8217 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8218
8219def DLG_PNT(win, point_or_x, y=None):
8220 """
8221 Convenience function for converting a Point or (x,y) in
8222 dialog units to pixel units.
8223 """
8224 if y is None:
8225 return win.ConvertDialogPointToPixels(point_or_x)
8226 else:
8227 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
8228
8229def DLG_SZE(win, size_width, height=None):
8230 """
8231 Convenience function for converting a Size or (w,h) in
8232 dialog units to pixel units.
8233 """
8234 if height is None:
8235 return win.ConvertDialogSizeToPixels(size_width)
8236 else:
8237 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
8238
8239
5b5c9bc7 8240def FindWindowById(*args, **kwargs):
d55e5bfc 8241 """
5b5c9bc7 8242 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
8243
8244 Find the first window in the application with the given id. If parent
8245 is None, the search will start from all top-level frames and dialog
8246 boxes; if non-None, the search will be limited to the given window
8247 hierarchy. The search is recursive in both cases.
8248 """
5b5c9bc7 8249 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 8250
5b5c9bc7 8251def FindWindowByName(*args, **kwargs):
d55e5bfc 8252 """
5b5c9bc7 8253 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
8254
8255 Find a window by its name (as given in a window constructor or Create
8256 function call). If parent is None, the search will start from all
8257 top-level frames and dialog boxes; if non-None, the search will be
8258 limited to the given window hierarchy. The search is recursive in both
8259 cases.
8260
8261 If no window with such name is found, wx.FindWindowByLabel is called.
8262 """
5b5c9bc7 8263 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 8264
5b5c9bc7 8265def FindWindowByLabel(*args, **kwargs):
d55e5bfc 8266 """
5b5c9bc7 8267 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
8268
8269 Find a window by its label. Depending on the type of window, the label
8270 may be a window title or panel item label. If parent is None, the
8271 search will start from all top-level frames and dialog boxes; if
8272 non-None, the search will be limited to the given window
8273 hierarchy. The search is recursive in both cases.
8274 """
5b5c9bc7 8275 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 8276
5b5c9bc7
RD
8277def Window_FromHWND(*args, **kwargs):
8278 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
8279 return _core_.Window_FromHWND(*args, **kwargs)
3215336e
RD
8280
8281def GetTopLevelWindows(*args, **kwargs):
8282 """
8283 GetTopLevelWindows() -> PyObject
8284
8285 Returns a list of the the application's top-level windows, (frames,
8286 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
8287 by wxWidgets, and so it is only valid as long as no top-level windows
8288 are closed or new top-level windows are created.
8289
8290 """
8291 return _core_.GetTopLevelWindows(*args, **kwargs)
d55e5bfc
RD
8292#---------------------------------------------------------------------------
8293
5b5c9bc7
RD
8294class Validator(EvtHandler):
8295 """Proxy of C++ Validator class"""
d55e5bfc
RD
8296 def __repr__(self):
8297 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8298 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
8299 """__init__(self) -> Validator"""
8300 newobj = _core_.new_Validator(*args, **kwargs)
d55e5bfc
RD
8301 self.this = newobj.this
8302 self.thisown = 1
8303 del newobj.thisown
8304 self._setOORInfo(self)
8305
8306 def Clone(*args, **kwargs):
5b5c9bc7
RD
8307 """Clone(self) -> Validator"""
8308 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
8309
8310 def Validate(*args, **kwargs):
5b5c9bc7
RD
8311 """Validate(self, Window parent) -> bool"""
8312 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
8313
8314 def TransferToWindow(*args, **kwargs):
8315 """TransferToWindow(self) -> bool"""
5b5c9bc7 8316 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
8317
8318 def TransferFromWindow(*args, **kwargs):
8319 """TransferFromWindow(self) -> bool"""
5b5c9bc7 8320 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
8321
8322 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
8323 """GetWindow(self) -> Window"""
8324 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
8325
8326 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
8327 """SetWindow(self, Window window)"""
8328 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
8329
8330 def IsSilent(*args, **kwargs):
d6c14a4c 8331 """IsSilent() -> bool"""
5b5c9bc7 8332 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
8333
8334 IsSilent = staticmethod(IsSilent)
8335 def SetBellOnError(*args, **kwargs):
d6c14a4c 8336 """SetBellOnError(int doIt=True)"""
5b5c9bc7 8337 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
8338
8339 SetBellOnError = staticmethod(SetBellOnError)
8340
5b5c9bc7 8341class ValidatorPtr(Validator):
d55e5bfc
RD
8342 def __init__(self, this):
8343 self.this = this
8344 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
8345 self.__class__ = Validator
8346_core_.Validator_swigregister(ValidatorPtr)
d55e5bfc 8347
5b5c9bc7
RD
8348def Validator_IsSilent(*args, **kwargs):
8349 """Validator_IsSilent() -> bool"""
8350 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc 8351
5b5c9bc7
RD
8352def Validator_SetBellOnError(*args, **kwargs):
8353 """Validator_SetBellOnError(int doIt=True)"""
8354 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 8355
5b5c9bc7
RD
8356class PyValidator(Validator):
8357 """Proxy of C++ PyValidator class"""
d55e5bfc
RD
8358 def __repr__(self):
8359 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8360 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
8361 """__init__(self) -> PyValidator"""
8362 newobj = _core_.new_PyValidator(*args, **kwargs)
d55e5bfc
RD
8363 self.this = newobj.this
8364 self.thisown = 1
8365 del newobj.thisown
8366
8367 self._setCallbackInfo(self, PyValidator, 1)
8368 self._setOORInfo(self)
8369
8370 def _setCallbackInfo(*args, **kwargs):
8371 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 8372 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
8373
8374
5b5c9bc7 8375class PyValidatorPtr(PyValidator):
d55e5bfc
RD
8376 def __init__(self, this):
8377 self.this = this
8378 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
8379 self.__class__ = PyValidator
8380_core_.PyValidator_swigregister(PyValidatorPtr)
d55e5bfc
RD
8381
8382#---------------------------------------------------------------------------
8383
5b5c9bc7
RD
8384class Menu(EvtHandler):
8385 """Proxy of C++ Menu class"""
d55e5bfc
RD
8386 def __repr__(self):
8387 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8388 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
8389 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
8390 newobj = _core_.new_Menu(*args, **kwargs)
d55e5bfc
RD
8391 self.this = newobj.this
8392 self.thisown = 1
8393 del newobj.thisown
8394 self._setOORInfo(self)
8395
8396 def Append(*args, **kwargs):
5b5c9bc7
RD
8397 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8398 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
8399
8400 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
8401 """AppendSeparator(self) -> MenuItem"""
8402 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
8403
8404 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
8405 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8406 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
8407
8408 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
8409 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8410 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
8411
8412 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
8413 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8414 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc
RD
8415
8416 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
8417 """AppendItem(self, MenuItem item) -> MenuItem"""
8418 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc
RD
8419
8420 def Break(*args, **kwargs):
8421 """Break(self)"""
5b5c9bc7 8422 return _core_.Menu_Break(*args, **kwargs)
d55e5bfc
RD
8423
8424 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
8425 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
8426 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc
RD
8427
8428 def Insert(*args, **kwargs):
8429 """
5b5c9bc7
RD
8430 Insert(self, size_t pos, int id, String text, String help=EmptyString,
8431 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 8432 """
5b5c9bc7 8433 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
8434
8435 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
8436 """InsertSeparator(self, size_t pos) -> MenuItem"""
8437 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
8438
8439 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
8440 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8441 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
8442
8443 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
8444 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8445 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
8446
8447 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
8448 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8449 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc
RD
8450
8451 def PrependItem(*args, **kwargs):
5b5c9bc7
RD
8452 """PrependItem(self, MenuItem item) -> MenuItem"""
8453 return _core_.Menu_PrependItem(*args, **kwargs)
d55e5bfc
RD
8454
8455 def Prepend(*args, **kwargs):
5b5c9bc7
RD
8456 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8457 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
8458
8459 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
8460 """PrependSeparator(self) -> MenuItem"""
8461 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
8462
8463 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
8464 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8465 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
8466
8467 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
8468 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8469 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
8470
8471 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
8472 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8473 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
8474
8475 def Remove(*args, **kwargs):
5b5c9bc7
RD
8476 """Remove(self, int id) -> MenuItem"""
8477 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
8478
8479 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
8480 """RemoveItem(self, MenuItem item) -> MenuItem"""
8481 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
8482
8483 def Delete(*args, **kwargs):
8484 """Delete(self, int id) -> bool"""
5b5c9bc7 8485 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
8486
8487 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
8488 """DeleteItem(self, MenuItem item) -> bool"""
8489 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
8490
8491 def Destroy(*args, **kwargs):
8492 """
8493 Destroy(self)
8494
8495 Deletes the C++ object this Python object is a proxy for.
8496 """
5b5c9bc7 8497 return _core_.Menu_Destroy(*args, **kwargs)
d55e5bfc
RD
8498
8499 def DestroyId(*args, **kwargs):
8500 """
8501 DestroyId(self, int id) -> bool
8502
8503 Deletes the C++ object this Python object is a proxy for.
8504 """
5b5c9bc7 8505 return _core_.Menu_DestroyId(*args, **kwargs)
d55e5bfc
RD
8506
8507 def DestroyItem(*args, **kwargs):
8508 """
5b5c9bc7 8509 DestroyItem(self, MenuItem item) -> bool
d55e5bfc
RD
8510
8511 Deletes the C++ object this Python object is a proxy for.
8512 """
5b5c9bc7 8513 return _core_.Menu_DestroyItem(*args, **kwargs)
d55e5bfc
RD
8514
8515 def GetMenuItemCount(*args, **kwargs):
8516 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 8517 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
8518
8519 def GetMenuItems(*args, **kwargs):
8520 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 8521 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
8522
8523 def FindItem(*args, **kwargs):
5b5c9bc7
RD
8524 """FindItem(self, String item) -> int"""
8525 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
8526
8527 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
8528 """FindItemById(self, int id) -> MenuItem"""
8529 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
8530
8531 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
8532 """FindItemByPosition(self, size_t position) -> MenuItem"""
8533 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
8534
8535 def Enable(*args, **kwargs):
8536 """Enable(self, int id, bool enable)"""
5b5c9bc7 8537 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
8538
8539 def IsEnabled(*args, **kwargs):
8540 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 8541 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8542
8543 def Check(*args, **kwargs):
8544 """Check(self, int id, bool check)"""
5b5c9bc7 8545 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
8546
8547 def IsChecked(*args, **kwargs):
8548 """IsChecked(self, int id) -> bool"""
5b5c9bc7 8549 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
8550
8551 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
8552 """SetLabel(self, int id, String label)"""
8553 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
8554
8555 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
8556 """GetLabel(self, int id) -> String"""
8557 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
8558
8559 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
8560 """SetHelpString(self, int id, String helpString)"""
8561 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
8562
8563 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
8564 """GetHelpString(self, int id) -> String"""
8565 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
8566
8567 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
8568 """SetTitle(self, String title)"""
8569 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
8570
8571 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
8572 """GetTitle(self) -> String"""
8573 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
8574
8575 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
8576 """SetEventHandler(self, EvtHandler handler)"""
8577 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
8578
8579 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
8580 """GetEventHandler(self) -> EvtHandler"""
8581 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
8582
8583 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
8584 """SetInvokingWindow(self, Window win)"""
8585 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
8586
8587 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
8588 """GetInvokingWindow(self) -> Window"""
8589 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
8590
8591 def GetStyle(*args, **kwargs):
8592 """GetStyle(self) -> long"""
5b5c9bc7 8593 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
8594
8595 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
8596 """UpdateUI(self, EvtHandler source=None)"""
8597 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
8598
8599 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
8600 """GetMenuBar(self) -> MenuBar"""
8601 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
8602
8603 def Attach(*args, **kwargs):
8604 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 8605 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
8606
8607 def Detach(*args, **kwargs):
8608 """Detach(self)"""
5b5c9bc7 8609 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
8610
8611 def IsAttached(*args, **kwargs):
8612 """IsAttached(self) -> bool"""
5b5c9bc7 8613 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
8614
8615 def SetParent(*args, **kwargs):
5b5c9bc7
RD
8616 """SetParent(self, Menu parent)"""
8617 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
8618
8619 def GetParent(*args, **kwargs):
5b5c9bc7
RD
8620 """GetParent(self) -> Menu"""
8621 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc
RD
8622
8623
5b5c9bc7 8624class MenuPtr(Menu):
d55e5bfc
RD
8625 def __init__(self, this):
8626 self.this = this
8627 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
8628 self.__class__ = Menu
8629_core_.Menu_swigregister(MenuPtr)
8630DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
8631
8632#---------------------------------------------------------------------------
8633
5b5c9bc7
RD
8634class MenuBar(Window):
8635 """Proxy of C++ MenuBar class"""
d55e5bfc
RD
8636 def __repr__(self):
8637 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8638 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
8639 """__init__(self, long style=0) -> MenuBar"""
8640 newobj = _core_.new_MenuBar(*args, **kwargs)
d55e5bfc
RD
8641 self.this = newobj.this
8642 self.thisown = 1
8643 del newobj.thisown
8644 self._setOORInfo(self)
8645
8646 def Append(*args, **kwargs):
5b5c9bc7
RD
8647 """Append(self, Menu menu, String title) -> bool"""
8648 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
8649
8650 def Insert(*args, **kwargs):
5b5c9bc7
RD
8651 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
8652 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
8653
8654 def GetMenuCount(*args, **kwargs):
8655 """GetMenuCount(self) -> size_t"""
5b5c9bc7 8656 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
8657
8658 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
8659 """GetMenu(self, size_t pos) -> Menu"""
8660 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
8661
8662 def Replace(*args, **kwargs):
5b5c9bc7
RD
8663 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
8664 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
8665
8666 def Remove(*args, **kwargs):
5b5c9bc7
RD
8667 """Remove(self, size_t pos) -> Menu"""
8668 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
8669
8670 def EnableTop(*args, **kwargs):
8671 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 8672 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
8673
8674 def IsEnabledTop(*args, **kwargs):
8675 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 8676 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
8677
8678 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
8679 """SetLabelTop(self, size_t pos, String label)"""
8680 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
8681
8682 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
8683 """GetLabelTop(self, size_t pos) -> String"""
8684 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
8685
8686 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
8687 """FindMenuItem(self, String menu, String item) -> int"""
8688 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
8689
8690 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
8691 """FindItemById(self, int id) -> MenuItem"""
8692 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
8693
8694 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
8695 """FindMenu(self, String title) -> int"""
8696 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
8697
8698 def Enable(*args, **kwargs):
8699 """Enable(self, int id, bool enable)"""
5b5c9bc7 8700 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
8701
8702 def Check(*args, **kwargs):
8703 """Check(self, int id, bool check)"""
5b5c9bc7 8704 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
8705
8706 def IsChecked(*args, **kwargs):
8707 """IsChecked(self, int id) -> bool"""
5b5c9bc7 8708 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
8709
8710 def IsEnabled(*args, **kwargs):
8711 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 8712 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8713
8714 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
8715 """SetLabel(self, int id, String label)"""
8716 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
8717
8718 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
8719 """GetLabel(self, int id) -> String"""
8720 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
8721
8722 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
8723 """SetHelpString(self, int id, String helpString)"""
8724 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
8725
8726 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
8727 """GetHelpString(self, int id) -> String"""
8728 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
8729
8730 def GetFrame(*args, **kwargs):
8731 """GetFrame(self) -> wxFrame"""
5b5c9bc7 8732 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
8733
8734 def IsAttached(*args, **kwargs):
8735 """IsAttached(self) -> bool"""
5b5c9bc7 8736 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
8737
8738 def Attach(*args, **kwargs):
8739 """Attach(self, wxFrame frame)"""
5b5c9bc7 8740 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
8741
8742 def Detach(*args, **kwargs):
8743 """Detach(self)"""
5b5c9bc7 8744 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc
RD
8745
8746
5b5c9bc7 8747class MenuBarPtr(MenuBar):
d55e5bfc
RD
8748 def __init__(self, this):
8749 self.this = this
8750 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
8751 self.__class__ = MenuBar
8752_core_.MenuBar_swigregister(MenuBarPtr)
d55e5bfc
RD
8753
8754#---------------------------------------------------------------------------
8755
5b5c9bc7
RD
8756class MenuItem(Object):
8757 """Proxy of C++ MenuItem class"""
d55e5bfc
RD
8758 def __repr__(self):
8759 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8760 def __init__(self, *args, **kwargs):
8761 """
5b5c9bc7
RD
8762 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
8763 String help=EmptyString, int kind=ITEM_NORMAL,
8764 Menu subMenu=None) -> MenuItem
d55e5bfc 8765 """
5b5c9bc7 8766 newobj = _core_.new_MenuItem(*args, **kwargs)
d55e5bfc
RD
8767 self.this = newobj.this
8768 self.thisown = 1
8769 del newobj.thisown
8770 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
8771 """GetMenu(self) -> Menu"""
8772 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
8773
8774 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
8775 """SetMenu(self, Menu menu)"""
8776 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
8777
8778 def SetId(*args, **kwargs):
8779 """SetId(self, int id)"""
5b5c9bc7 8780 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
8781
8782 def GetId(*args, **kwargs):
8783 """GetId(self) -> int"""
5b5c9bc7 8784 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
8785
8786 def IsSeparator(*args, **kwargs):
8787 """IsSeparator(self) -> bool"""
5b5c9bc7 8788 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
8789
8790 def SetText(*args, **kwargs):
5b5c9bc7
RD
8791 """SetText(self, String str)"""
8792 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
8793
8794 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
8795 """GetLabel(self) -> String"""
8796 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
8797
8798 def GetText(*args, **kwargs):
5b5c9bc7
RD
8799 """GetText(self) -> String"""
8800 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
8801
8802 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
8803 """GetLabelFromText(String text) -> String"""
8804 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
8805
8806 GetLabelFromText = staticmethod(GetLabelFromText)
8807 def GetKind(*args, **kwargs):
8808 """GetKind(self) -> int"""
5b5c9bc7 8809 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
8810
8811 def SetKind(*args, **kwargs):
8812 """SetKind(self, int kind)"""
5b5c9bc7 8813 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
8814
8815 def SetCheckable(*args, **kwargs):
8816 """SetCheckable(self, bool checkable)"""
5b5c9bc7 8817 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
8818
8819 def IsCheckable(*args, **kwargs):
8820 """IsCheckable(self) -> bool"""
5b5c9bc7 8821 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
8822
8823 def IsSubMenu(*args, **kwargs):
8824 """IsSubMenu(self) -> bool"""
5b5c9bc7 8825 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
8826
8827 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
8828 """SetSubMenu(self, Menu menu)"""
8829 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
8830
8831 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
8832 """GetSubMenu(self) -> Menu"""
8833 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
8834
8835 def Enable(*args, **kwargs):
8836 """Enable(self, bool enable=True)"""
5b5c9bc7 8837 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
8838
8839 def IsEnabled(*args, **kwargs):
8840 """IsEnabled(self) -> bool"""
5b5c9bc7 8841 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8842
8843 def Check(*args, **kwargs):
8844 """Check(self, bool check=True)"""
5b5c9bc7 8845 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
8846
8847 def IsChecked(*args, **kwargs):
8848 """IsChecked(self) -> bool"""
5b5c9bc7 8849 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
8850
8851 def Toggle(*args, **kwargs):
8852 """Toggle(self)"""
5b5c9bc7 8853 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
8854
8855 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
8856 """SetHelp(self, String str)"""
8857 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
8858
8859 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
8860 """GetHelp(self) -> String"""
8861 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
8862
8863 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
8864 """GetAccel(self) -> AcceleratorEntry"""
8865 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
8866
8867 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
8868 """SetAccel(self, AcceleratorEntry accel)"""
8869 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 8870
c1280d1e 8871 def SetFont(*args, **kwargs):
5b5c9bc7
RD
8872 """SetFont(self, Font font)"""
8873 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
8874
8875 def GetFont(*args, **kwargs):
5b5c9bc7
RD
8876 """GetFont(self) -> Font"""
8877 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
8878
8879 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
8880 """SetTextColour(self, Colour colText)"""
8881 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
8882
8883 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
8884 """GetTextColour(self) -> Colour"""
8885 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
8886
8887 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
8888 """SetBackgroundColour(self, Colour colBack)"""
8889 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
8890
8891 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
8892 """GetBackgroundColour(self) -> Colour"""
8893 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
8894
8895 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
8896 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
8897 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
8898
8899 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
8900 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
8901 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
8902
8903 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
8904 """GetDisabledBitmap(self) -> Bitmap"""
8905 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
8906
8907 def SetMarginWidth(*args, **kwargs):
8908 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 8909 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
8910
8911 def GetMarginWidth(*args, **kwargs):
8912 """GetMarginWidth(self) -> int"""
5b5c9bc7 8913 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 8914
d55e5bfc 8915 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 8916 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 8917 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
8918
8919 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
8920 def IsOwnerDrawn(*args, **kwargs):
8921 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 8922 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
8923
8924 def SetOwnerDrawn(*args, **kwargs):
8925 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 8926 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
8927
8928 def ResetOwnerDrawn(*args, **kwargs):
8929 """ResetOwnerDrawn(self)"""
5b5c9bc7 8930 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 8931
d55e5bfc 8932 def SetBitmap(*args, **kwargs):
5b5c9bc7
RD
8933 """SetBitmap(self, Bitmap bitmap)"""
8934 return _core_.MenuItem_SetBitmap(*args, **kwargs)
d55e5bfc
RD
8935
8936 def GetBitmap(*args, **kwargs):
5b5c9bc7
RD
8937 """GetBitmap(self) -> Bitmap"""
8938 return _core_.MenuItem_GetBitmap(*args, **kwargs)
d55e5bfc
RD
8939
8940
5b5c9bc7 8941class MenuItemPtr(MenuItem):
d55e5bfc
RD
8942 def __init__(self, this):
8943 self.this = this
8944 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
8945 self.__class__ = MenuItem
8946_core_.MenuItem_swigregister(MenuItemPtr)
d55e5bfc 8947
5b5c9bc7
RD
8948def MenuItem_GetLabelFromText(*args, **kwargs):
8949 """MenuItem_GetLabelFromText(String text) -> String"""
8950 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 8951
5b5c9bc7
RD
8952def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8953 """MenuItem_GetDefaultMarginWidth() -> int"""
8954 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
8955
8956#---------------------------------------------------------------------------
8957
5b5c9bc7 8958class Control(Window):
d55e5bfc
RD
8959 """
8960 This is the base class for a control or 'widget'.
8961
15817c7e
RD
8962 A control is generally a small window which processes user input
8963 and/or displays one or more item of data.
d55e5bfc
RD
8964 """
8965 def __repr__(self):
8966 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8967 def __init__(self, *args, **kwargs):
8968 """
5b5c9bc7
RD
8969 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8970 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
8971 String name=ControlNameStr) -> Control
d55e5bfc 8972
15817c7e
RD
8973 Create a Control. Normally you should only call this from a subclass'
8974 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 8975 """
5b5c9bc7 8976 newobj = _core_.new_Control(*args, **kwargs)
d55e5bfc
RD
8977 self.this = newobj.this
8978 self.thisown = 1
8979 del newobj.thisown
8980 self._setOORInfo(self)
8981
8982 def Create(*args, **kwargs):
8983 """
5b5c9bc7
RD
8984 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8985 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
8986 String name=ControlNameStr) -> bool
d55e5bfc
RD
8987
8988 Do the 2nd phase and create the GUI control.
8989 """
5b5c9bc7 8990 return _core_.Control_Create(*args, **kwargs)
d55e5bfc
RD
8991
8992 def Command(*args, **kwargs):
8993 """
5b5c9bc7 8994 Command(self, CommandEvent event)
d55e5bfc 8995
15817c7e
RD
8996 Simulates the effect of the user issuing a command to the item.
8997
8998 :see: `wx.CommandEvent`
8999
d55e5bfc 9000 """
5b5c9bc7 9001 return _core_.Control_Command(*args, **kwargs)
d55e5bfc
RD
9002
9003 def GetLabel(*args, **kwargs):
9004 """
5b5c9bc7 9005 GetLabel(self) -> String
d55e5bfc
RD
9006
9007 Return a control's text.
9008 """
5b5c9bc7 9009 return _core_.Control_GetLabel(*args, **kwargs)
d55e5bfc
RD
9010
9011 def SetLabel(*args, **kwargs):
9012 """
5b5c9bc7 9013 SetLabel(self, String label)
d55e5bfc
RD
9014
9015 Sets the item's text.
9016 """
5b5c9bc7 9017 return _core_.Control_SetLabel(*args, **kwargs)
d55e5bfc
RD
9018
9019 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 9020 """
5b5c9bc7 9021 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
9022
9023 Get the default attributes for this class. This is useful if you want
9024 to use the same font or colour in your own control as in a standard
9025 control -- which is a much better idea than hard coding specific
9026 colours or fonts which might look completely out of place on the
9027 user's system, especially if it uses themes.
9028
9029 The variant parameter is only relevant under Mac currently and is
9030 ignore under other platforms. Under Mac, it will change the size of
9031 the returned font. See `wx.Window.SetWindowVariant` for more about
9032 this.
9033 """
5b5c9bc7 9034 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9035
9036 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9037
5b5c9bc7 9038class ControlPtr(Control):
d55e5bfc
RD
9039 def __init__(self, this):
9040 self.this = this
9041 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
9042 self.__class__ = Control
9043_core_.Control_swigregister(ControlPtr)
d55e5bfc
RD
9044ControlNameStr = cvar.ControlNameStr
9045
9046def PreControl(*args, **kwargs):
9047 """
5b5c9bc7 9048 PreControl() -> Control
d55e5bfc
RD
9049
9050 Precreate a Control control for 2-phase creation
9051 """
5b5c9bc7 9052 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
9053 val.thisown = 1
9054 return val
9055
5b5c9bc7 9056def Control_GetClassDefaultAttributes(*args, **kwargs):
110da5b0 9057 """
5b5c9bc7 9058 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
9059
9060 Get the default attributes for this class. This is useful if you want
9061 to use the same font or colour in your own control as in a standard
9062 control -- which is a much better idea than hard coding specific
9063 colours or fonts which might look completely out of place on the
9064 user's system, especially if it uses themes.
9065
9066 The variant parameter is only relevant under Mac currently and is
9067 ignore under other platforms. Under Mac, it will change the size of
9068 the returned font. See `wx.Window.SetWindowVariant` for more about
9069 this.
9070 """
5b5c9bc7 9071 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9072
9073#---------------------------------------------------------------------------
9074
5b5c9bc7 9075class ItemContainer(object):
d55e5bfc 9076 """
53aa7709
RD
9077 The wx.ItemContainer class defines an interface which is implemented
9078 by all controls which have string subitems, each of which may be
9079 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
9080 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 9081 this one.
d55e5bfc 9082
15817c7e
RD
9083 It defines the methods for accessing the control's items and although
9084 each of the derived classes implements them differently, they still
9085 all conform to the same interface.
d55e5bfc 9086
15817c7e
RD
9087 The items in a wx.ItemContainer have (non empty) string labels and,
9088 optionally, client data associated with them.
d55e5bfc
RD
9089
9090 """
9091 def __init__(self): raise RuntimeError, "No constructor defined"
9092 def __repr__(self):
9093 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9094 def Append(*args, **kwargs):
9095 """
5b5c9bc7 9096 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 9097
15817c7e
RD
9098 Adds the item to the control, associating the given data with the item
9099 if not None. The return value is the index of the newly added item
9100 which may be different from the last one if the control is sorted (e.g.
9101 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 9102 """
5b5c9bc7 9103 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
9104
9105 def AppendItems(*args, **kwargs):
9106 """
f5b96ee1 9107 AppendItems(self, List strings)
d55e5bfc 9108
15817c7e
RD
9109 Apend several items at once to the control. Notice that calling this
9110 method may be much faster than appending the items one by one if you
9111 need to add a lot of items.
d55e5bfc 9112 """
5b5c9bc7 9113 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
9114
9115 def Insert(*args, **kwargs):
9116 """
5b5c9bc7 9117 Insert(self, String item, int pos, PyObject clientData=None) -> int
d55e5bfc 9118
15817c7e 9119 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
9120 optionally associating some data object with the item.
9121 """
5b5c9bc7 9122 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
9123
9124 def Clear(*args, **kwargs):
9125 """
9126 Clear(self)
9127
9128 Removes all items from the control.
9129 """
5b5c9bc7 9130 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
9131
9132 def Delete(*args, **kwargs):
9133 """
9134 Delete(self, int n)
9135
15817c7e
RD
9136 Deletes the item at the zero-based index 'n' from the control. Note
9137 that it is an error (signalled by a `wx.PyAssertionError` exception if
9138 enabled) to remove an item with the index negative or greater or equal
9139 than the number of items in the control.
d55e5bfc 9140 """
5b5c9bc7 9141 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 9142
53aa7709
RD
9143 def GetClientData(*args, **kwargs):
9144 """
9145 GetClientData(self, int n) -> PyObject
9146
9147 Returns the client data associated with the given item, (if any.)
9148 """
5b5c9bc7 9149 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
9150
9151 def SetClientData(*args, **kwargs):
9152 """
9153 SetClientData(self, int n, PyObject clientData)
9154
9155 Associate the given client data with the item at position n.
9156 """
5b5c9bc7 9157 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 9158
d55e5bfc
RD
9159 def GetCount(*args, **kwargs):
9160 """
9161 GetCount(self) -> int
9162
9163 Returns the number of items in the control.
9164 """
5b5c9bc7 9165 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
9166
9167 def IsEmpty(*args, **kwargs):
9168 """
9169 IsEmpty(self) -> bool
9170
9171 Returns True if the control is empty or False if it has some items.
9172 """
5b5c9bc7 9173 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
9174
9175 def GetString(*args, **kwargs):
9176 """
5b5c9bc7 9177 GetString(self, int n) -> String
d55e5bfc
RD
9178
9179 Returns the label of the item with the given index.
9180 """
5b5c9bc7 9181 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
9182
9183 def GetStrings(*args, **kwargs):
9184 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 9185 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
9186
9187 def SetString(*args, **kwargs):
9188 """
5b5c9bc7 9189 SetString(self, int n, String s)
d55e5bfc
RD
9190
9191 Sets the label for the given item.
9192 """
5b5c9bc7 9193 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
9194
9195 def FindString(*args, **kwargs):
9196 """
5b5c9bc7 9197 FindString(self, String s) -> int
d55e5bfc
RD
9198
9199 Finds an item whose label matches the given string. Returns the
15817c7e
RD
9200 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
9201 found.
d55e5bfc 9202 """
5b5c9bc7 9203 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 9204
53aa7709 9205 def SetSelection(*args, **kwargs):
d55e5bfc 9206 """
53aa7709 9207 SetSelection(self, int n)
d55e5bfc
RD
9208
9209 Sets the item at index 'n' to be the selected item.
9210 """
5b5c9bc7 9211 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 9212
d55e5bfc
RD
9213 def GetSelection(*args, **kwargs):
9214 """
9215 GetSelection(self) -> int
9216
15817c7e
RD
9217 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
9218 is selected.
d55e5bfc 9219 """
5b5c9bc7 9220 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 9221
53aa7709 9222 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
9223 """SetStringSelection(self, String s) -> bool"""
9224 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 9225
d55e5bfc
RD
9226 def GetStringSelection(*args, **kwargs):
9227 """
5b5c9bc7 9228 GetStringSelection(self) -> String
d55e5bfc 9229
15817c7e
RD
9230 Returns the label of the selected item or an empty string if no item
9231 is selected.
d55e5bfc 9232 """
5b5c9bc7 9233 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 9234
53aa7709 9235 def Select(*args, **kwargs):
d55e5bfc 9236 """
53aa7709 9237 Select(self, int n)
d55e5bfc 9238
53aa7709
RD
9239 This is the same as `SetSelection` and exists only because it is
9240 slightly more natural for controls which support multiple selection.
d55e5bfc 9241 """
5b5c9bc7 9242 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc
RD
9243
9244
5b5c9bc7 9245class ItemContainerPtr(ItemContainer):
d55e5bfc
RD
9246 def __init__(self, this):
9247 self.this = this
9248 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
9249 self.__class__ = ItemContainer
9250_core_.ItemContainer_swigregister(ItemContainerPtr)
d55e5bfc
RD
9251
9252#---------------------------------------------------------------------------
9253
5b5c9bc7 9254class ControlWithItems(Control,ItemContainer):
d55e5bfc 9255 """
15817c7e
RD
9256 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
9257 wx.Control class, and is used for the base class of various controls
9258 that have items.
d55e5bfc
RD
9259 """
9260 def __init__(self): raise RuntimeError, "No constructor defined"
9261 def __repr__(self):
9262 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9263
5b5c9bc7 9264class ControlWithItemsPtr(ControlWithItems):
d55e5bfc
RD
9265 def __init__(self, this):
9266 self.this = this
9267 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
9268 self.__class__ = ControlWithItems
9269_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
d55e5bfc
RD
9270
9271#---------------------------------------------------------------------------
9272
5b5c9bc7 9273class SizerItem(Object):
bfddbb17
RD
9274 """
9275 The wx.SizerItem class is used to track the position, size and other
9276 attributes of each item managed by a `wx.Sizer`. In normal usage user
9277 code should never need to deal directly with a wx.SizerItem, but
9278 custom classes derived from `wx.PySizer` will probably need to use the
9279 collection of wx.SizerItems held by wx.Sizer when calculating layout.
9280
9281 :see: `wx.Sizer`, `wx.GBSizerItem`
9282 """
d55e5bfc
RD
9283 def __repr__(self):
9284 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9285 def __init__(self, *args, **kwargs):
bfddbb17 9286 """
5b5c9bc7 9287 __init__(self) -> SizerItem
bfddbb17
RD
9288
9289 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
9290 size will need to be set before this item can be used in a Sizer.
9291
9292 You will probably never need to create a wx.SizerItem directly as they
9293 are created automatically when the sizer's Add, Insert or Prepend
9294 methods are called.
9295
9296 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
9297 """
5b5c9bc7 9298 newobj = _core_.new_SizerItem(*args, **kwargs)
d55e5bfc
RD
9299 self.this = newobj.this
9300 self.thisown = 1
9301 del newobj.thisown
9302 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
9303 """
9304 DeleteWindows(self)
9305
9306 Destroy the window or the windows in a subsizer, depending on the type
9307 of item.
9308 """
5b5c9bc7 9309 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
9310
9311 def DetachSizer(*args, **kwargs):
bfddbb17
RD
9312 """
9313 DetachSizer(self)
9314
9315 Enable deleting the SizerItem without destroying the contained sizer.
9316 """
5b5c9bc7 9317 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
9318
9319 def GetSize(*args, **kwargs):
bfddbb17 9320 """
5b5c9bc7 9321 GetSize(self) -> Size
bfddbb17
RD
9322
9323 Get the current size of the item, as set in the last Layout.
9324 """
5b5c9bc7 9325 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
9326
9327 def CalcMin(*args, **kwargs):
bfddbb17 9328 """
5b5c9bc7 9329 CalcMin(self) -> Size
bfddbb17
RD
9330
9331 Calculates the minimum desired size for the item, including any space
9332 needed by borders.
9333 """
5b5c9bc7 9334 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
9335
9336 def SetDimension(*args, **kwargs):
bfddbb17 9337 """
5b5c9bc7 9338 SetDimension(self, Point pos, Size size)
bfddbb17
RD
9339
9340 Set the position and size of the space allocated for this item by the
9341 sizer, and adjust the position and size of the item (window or
9342 subsizer) to be within that space taking alignment and borders into
9343 account.
9344 """
5b5c9bc7 9345 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
9346
9347 def GetMinSize(*args, **kwargs):
bfddbb17 9348 """
5b5c9bc7 9349 GetMinSize(self) -> Size
bfddbb17
RD
9350
9351 Get the minimum size needed for the item.
9352 """
5b5c9bc7 9353 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 9354
a001823c
RD
9355 def GetMinSizeWithBorder(*args, **kwargs):
9356 """
5b5c9bc7 9357 GetMinSizeWithBorder(self) -> Size
a001823c
RD
9358
9359 Get the minimum size needed for the item with space for the borders
9360 added, if needed.
9361 """
5b5c9bc7 9362 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 9363
d55e5bfc
RD
9364 def SetInitSize(*args, **kwargs):
9365 """SetInitSize(self, int x, int y)"""
5b5c9bc7 9366 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
9367
9368 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
9369 """
9370 SetRatioWH(self, int width, int height)
9371
9372 Set the ratio item attribute.
9373 """
5b5c9bc7 9374 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
9375
9376 def SetRatioSize(*args, **kwargs):
bfddbb17 9377 """
5b5c9bc7 9378 SetRatioSize(self, Size size)
bfddbb17
RD
9379
9380 Set the ratio item attribute.
9381 """
5b5c9bc7 9382 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
9383
9384 def SetRatio(*args, **kwargs):
bfddbb17
RD
9385 """
9386 SetRatio(self, float ratio)
9387
9388 Set the ratio item attribute.
9389 """
5b5c9bc7 9390 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
9391
9392 def GetRatio(*args, **kwargs):
bfddbb17
RD
9393 """
9394 GetRatio(self) -> float
9395
9396 Set the ratio item attribute.
9397 """
5b5c9bc7 9398 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 9399
070c48b4
RD
9400 def GetRect(*args, **kwargs):
9401 """
5b5c9bc7 9402 GetRect(self) -> Rect
070c48b4
RD
9403
9404 Returns the rectangle that the sizer item should occupy
9405 """
5b5c9bc7 9406 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 9407
d55e5bfc 9408 def IsWindow(*args, **kwargs):
bfddbb17
RD
9409 """
9410 IsWindow(self) -> bool
9411
9412 Is this sizer item a window?
9413 """
5b5c9bc7 9414 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
9415
9416 def IsSizer(*args, **kwargs):
bfddbb17
RD
9417 """
9418 IsSizer(self) -> bool
9419
9420 Is this sizer item a subsizer?
9421 """
5b5c9bc7 9422 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
9423
9424 def IsSpacer(*args, **kwargs):
bfddbb17
RD
9425 """
9426 IsSpacer(self) -> bool
9427
9428 Is this sizer item a spacer?
9429 """
5b5c9bc7 9430 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
9431
9432 def SetProportion(*args, **kwargs):
bfddbb17
RD
9433 """
9434 SetProportion(self, int proportion)
9435
9436 Set the proportion value for this item.
9437 """
5b5c9bc7 9438 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
9439
9440 def GetProportion(*args, **kwargs):
bfddbb17
RD
9441 """
9442 GetProportion(self) -> int
9443
9444 Get the proportion value for this item.
9445 """
5b5c9bc7 9446 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 9447
bfddbb17
RD
9448 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
9449 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 9450 def SetFlag(*args, **kwargs):
bfddbb17
RD
9451 """
9452 SetFlag(self, int flag)
9453
9454 Set the flag value for this item.
9455 """
5b5c9bc7 9456 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
9457
9458 def GetFlag(*args, **kwargs):
bfddbb17
RD
9459 """
9460 GetFlag(self) -> int
9461
9462 Get the flag value for this item.
9463 """
5b5c9bc7 9464 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
9465
9466 def SetBorder(*args, **kwargs):
bfddbb17
RD
9467 """
9468 SetBorder(self, int border)
9469
9470 Set the border value for this item.
9471 """
5b5c9bc7 9472 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
9473
9474 def GetBorder(*args, **kwargs):
bfddbb17
RD
9475 """
9476 GetBorder(self) -> int
9477
9478 Get the border value for this item.
9479 """
5b5c9bc7 9480 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
9481
9482 def GetWindow(*args, **kwargs):
bfddbb17 9483 """
5b5c9bc7 9484 GetWindow(self) -> Window
bfddbb17
RD
9485
9486 Get the window (if any) that is managed by this sizer item.
9487 """
5b5c9bc7 9488 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
9489
9490 def SetWindow(*args, **kwargs):
bfddbb17 9491 """
5b5c9bc7 9492 SetWindow(self, Window window)
bfddbb17
RD
9493
9494 Set the window to be managed by this sizer item.
9495 """
5b5c9bc7 9496 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
9497
9498 def GetSizer(*args, **kwargs):
bfddbb17 9499 """
5b5c9bc7 9500 GetSizer(self) -> Sizer
bfddbb17
RD
9501
9502 Get the subsizer (if any) that is managed by this sizer item.
9503 """
5b5c9bc7 9504 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
9505
9506 def SetSizer(*args, **kwargs):
bfddbb17 9507 """
5b5c9bc7 9508 SetSizer(self, Sizer sizer)
bfddbb17
RD
9509
9510 Set the subsizer to be managed by this sizer item.
9511 """
5b5c9bc7 9512 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
9513
9514 def GetSpacer(*args, **kwargs):
bfddbb17 9515 """
5b5c9bc7 9516 GetSpacer(self) -> Size
bfddbb17
RD
9517
9518 Get the size of the spacer managed by this sizer item.
9519 """
5b5c9bc7 9520 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
9521
9522 def SetSpacer(*args, **kwargs):
bfddbb17 9523 """
5b5c9bc7 9524 SetSpacer(self, Size size)
bfddbb17
RD
9525
9526 Set the size of the spacer to be managed by this sizer item.
9527 """
5b5c9bc7 9528 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
9529
9530 def Show(*args, **kwargs):
bfddbb17
RD
9531 """
9532 Show(self, bool show)
9533
9534 Set the show item attribute, which sizers use to determine if the item
9535 is to be made part of the layout or not. If the item is tracking a
9536 window then it is shown or hidden as needed.
9537 """
5b5c9bc7 9538 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
9539
9540 def IsShown(*args, **kwargs):
bfddbb17
RD
9541 """
9542 IsShown(self) -> bool
9543
9544 Is the item to be shown in the layout?
9545 """
5b5c9bc7 9546 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
9547
9548 def GetPosition(*args, **kwargs):
bfddbb17 9549 """
5b5c9bc7 9550 GetPosition(self) -> Point
bfddbb17
RD
9551
9552 Returns the current position of the item, as set in the last Layout.
9553 """
5b5c9bc7 9554 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
9555
9556 def GetUserData(*args, **kwargs):
bfddbb17
RD
9557 """
9558 GetUserData(self) -> PyObject
9559
9560 Returns the userData associated with this sizer item, or None if there
9561 isn't any.
9562 """
5b5c9bc7 9563 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc
RD
9564
9565
5b5c9bc7 9566class SizerItemPtr(SizerItem):
d55e5bfc
RD
9567 def __init__(self, this):
9568 self.this = this
9569 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
9570 self.__class__ = SizerItem
9571_core_.SizerItem_swigregister(SizerItemPtr)
d55e5bfc 9572
bfddbb17 9573def SizerItemWindow(*args, **kwargs):
d55e5bfc 9574 """
5b5c9bc7
RD
9575 SizerItemWindow(Window window, int proportion, int flag, int border,
9576 PyObject userData=None) -> SizerItem
bfddbb17
RD
9577
9578 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 9579 """
5b5c9bc7 9580 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
9581 val.thisown = 1
9582 return val
9583
bfddbb17 9584def SizerItemSpacer(*args, **kwargs):
d55e5bfc 9585 """
bfddbb17 9586 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 9587 PyObject userData=None) -> SizerItem
bfddbb17
RD
9588
9589 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 9590 """
5b5c9bc7 9591 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
9592 val.thisown = 1
9593 return val
9594
9595def SizerItemSizer(*args, **kwargs):
9596 """
5b5c9bc7
RD
9597 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
9598 PyObject userData=None) -> SizerItem
bfddbb17
RD
9599
9600 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 9601 """
5b5c9bc7 9602 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
9603 val.thisown = 1
9604 return val
9605
5b5c9bc7 9606class Sizer(Object):
bfddbb17
RD
9607 """
9608 wx.Sizer is the abstract base class used for laying out subwindows in
9609 a window. You cannot use wx.Sizer directly; instead, you will have to
9610 use one of the sizer classes derived from it such as `wx.BoxSizer`,
9611 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
9612 and `wx.GridBagSizer`.
9613
9614 The concept implemented by sizers in wxWidgets is closely related to
9615 layout tools in other GUI toolkits, such as Java's AWT, the GTK
9616 toolkit or the Qt toolkit. It is based upon the idea of the individual
9617 subwindows reporting their minimal required size and their ability to
9618 get stretched if the size of the parent window has changed. This will
9619 most often mean that the programmer does not set the original size of
9620 a dialog in the beginning, rather the dialog will assigned a sizer and
9621 this sizer will be queried about the recommended size. The sizer in
9622 turn will query its children, which can be normal windows or contorls,
9623 empty space or other sizers, so that a hierarchy of sizers can be
9624 constructed. Note that wxSizer does not derive from wxWindow and thus
9625 do not interfere with tab ordering and requires very little resources
9626 compared to a real window on screen.
9627
9628 What makes sizers so well fitted for use in wxWidgets is the fact that
9629 every control reports its own minimal size and the algorithm can
9630 handle differences in font sizes or different window (dialog item)
9631 sizes on different platforms without problems. If for example the
9632 standard font as well as the overall design of Mac widgets requires
9633 more space than on Windows, then the initial size of a dialog using a
9634 sizer will automatically be bigger on Mac than on Windows.
9635 """
d55e5bfc
RD
9636 def __init__(self): raise RuntimeError, "No constructor defined"
9637 def __repr__(self):
9638 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9639 def _setOORInfo(*args, **kwargs):
9640 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 9641 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
9642
9643 def Add(*args, **kwargs):
9644 """
bfddbb17 9645 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 9646 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
9647
9648 Appends a child item to the sizer.
d55e5bfc 9649 """
5b5c9bc7 9650 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
9651
9652 def Insert(*args, **kwargs):
9653 """
bfddbb17 9654 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 9655 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
9656
9657 Inserts a new item into the list of items managed by this sizer before
9658 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 9659 """
5b5c9bc7 9660 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
9661
9662 def Prepend(*args, **kwargs):
9663 """
bfddbb17 9664 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 9665 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
9666
9667 Adds a new item to the begining of the list of sizer items managed by
9668 this sizer. See `Add` for a description of the parameters.
d55e5bfc 9669 """
5b5c9bc7 9670 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
9671
9672 def Remove(*args, **kwargs):
bfddbb17
RD
9673 """
9674 Remove(self, item) -> bool
9675
9676 Removes an item from the sizer and destroys it. This method does not
9677 cause any layout or resizing to take place, call `Layout` to update
9678 the layout on screen after removing a child from the sizer. The
9679 *item* parameter can be either a window, a sizer, or the zero-based
9680 index of an item to remove. Returns True if the child item was found
9681 and removed.
9682 """
5b5c9bc7 9683 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 9684
1a6bba1e 9685 def Detach(*args, **kwargs):
bfddbb17
RD
9686 """
9687 Detach(self, item) -> bool
9688
9689 Detaches an item from the sizer without destroying it. This method
9690 does not cause any layout or resizing to take place, call `Layout` to
9691 do so. The *item* parameter can be either a window, a sizer, or the
9692 zero-based index of the item to be detached. Returns True if the child item
9693 was found and detached.
9694 """
5b5c9bc7 9695 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 9696
070c48b4
RD
9697 def GetItem(*args, **kwargs):
9698 """
9699 GetItem(self, item) -> wx.SizerItem
9700
9701 Returns the `wx.SizerItem` which holds the *item* given. The *item*
9702 parameter can be either a window, a sizer, or the zero-based index of
9703 the item to be detached.
9704 """
5b5c9bc7 9705 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 9706
d55e5bfc 9707 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
9708 """_SetItemMinSize(self, PyObject item, Size size)"""
9709 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 9710
bfddbb17
RD
9711 def SetItemMinSize(self, item, *args):
9712 """
9713 SetItemMinSize(self, item, Size size)
9714
9715 Sets the minimum size that will be allocated for an item in the sizer.
9716 The *item* parameter can be either a window, a sizer, or the
9717 zero-based index of the item. If a window or sizer is given then it
9718 will be searched for recursivly in subsizers if neccessary.
9719 """
9720 if len(args) == 2:
9721 # for backward compatibility accept separate width,height args too
9722 return self._SetItemMinSize(item, args)
9723 else:
9724 return self._SetItemMinSize(item, args[0])
9725
d55e5bfc 9726 def AddItem(*args, **kwargs):
bfddbb17
RD
9727 """
9728 AddItem(self, SizerItem item)
9729
9730 Adds a `wx.SizerItem` to the sizer.
9731 """
5b5c9bc7 9732 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
9733
9734 def InsertItem(*args, **kwargs):
bfddbb17
RD
9735 """
9736 InsertItem(self, int index, SizerItem item)
9737
9738 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
9739 """
5b5c9bc7 9740 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
9741
9742 def PrependItem(*args, **kwargs):
bfddbb17
RD
9743 """
9744 PrependItem(self, SizerItem item)
9745
9746 Prepends a `wx.SizerItem` to the sizer.
9747 """
5b5c9bc7 9748 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 9749
bfddbb17 9750 def AddMany(self, items):
d6c14a4c
RD
9751 """
9752 AddMany is a convenience method for adding several items
9753 to a sizer at one time. Simply pass it a list of tuples,
9754 where each tuple consists of the parameters that you
9755 would normally pass to the `Add` method.
9756 """
bfddbb17
RD
9757 for item in items:
9758 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
9759 item = (item, )
9760 self.Add(*item)
d55e5bfc
RD
9761
9762 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
9763 def AddWindow(self, *args, **kw):
9764 """Compatibility alias for `Add`."""
9765 return self.Add(*args, **kw)
9766 def AddSizer(self, *args, **kw):
9767 """Compatibility alias for `Add`."""
9768 return self.Add(*args, **kw)
9769 def AddSpacer(self, *args, **kw):
9770 """Compatibility alias for `Add`."""
9771 return self.Add(*args, **kw)
9772
9773 def PrependWindow(self, *args, **kw):
9774 """Compatibility alias for `Prepend`."""
9775 return self.Prepend(*args, **kw)
9776 def PrependSizer(self, *args, **kw):
9777 """Compatibility alias for `Prepend`."""
9778 return self.Prepend(*args, **kw)
9779 def PrependSpacer(self, *args, **kw):
9780 """Compatibility alias for `Prepend`."""
9781 return self.Prepend(*args, **kw)
9782
9783 def InsertWindow(self, *args, **kw):
9784 """Compatibility alias for `Insert`."""
9785 return self.Insert(*args, **kw)
9786 def InsertSizer(self, *args, **kw):
9787 """Compatibility alias for `Insert`."""
9788 return self.Insert(*args, **kw)
9789 def InsertSpacer(self, *args, **kw):
9790 """Compatibility alias for `Insert`."""
9791 return self.Insert(*args, **kw)
9792
9793 def RemoveWindow(self, *args, **kw):
9794 """Compatibility alias for `Remove`."""
9795 return self.Remove(*args, **kw)
9796 def RemoveSizer(self, *args, **kw):
9797 """Compatibility alias for `Remove`."""
9798 return self.Remove(*args, **kw)
9799 def RemovePos(self, *args, **kw):
9800 """Compatibility alias for `Remove`."""
9801 return self.Remove(*args, **kw)
d55e5bfc
RD
9802
9803
d55e5bfc 9804 def SetDimension(*args, **kwargs):
bfddbb17
RD
9805 """
9806 SetDimension(self, int x, int y, int width, int height)
9807
9808 Call this to force the sizer to take the given dimension and thus
9809 force the items owned by the sizer to resize themselves according to
9810 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
9811 methods.
9812 """
5b5c9bc7 9813 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
9814
9815 def SetMinSize(*args, **kwargs):
bfddbb17 9816 """
5b5c9bc7 9817 SetMinSize(self, Size size)
bfddbb17
RD
9818
9819 Call this to give the sizer a minimal size. Normally, the sizer will
9820 calculate its minimal size based purely on how much space its children
9821 need. After calling this method `GetMinSize` will return either the
9822 minimal size as requested by its children or the minimal size set
9823 here, depending on which is bigger.
9824 """
5b5c9bc7 9825 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
9826
9827 def GetSize(*args, **kwargs):
bfddbb17 9828 """
5b5c9bc7 9829 GetSize(self) -> Size
bfddbb17
RD
9830
9831 Returns the current size of the space managed by the sizer.
9832 """
5b5c9bc7 9833 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
9834
9835 def GetPosition(*args, **kwargs):
bfddbb17 9836 """
5b5c9bc7 9837 GetPosition(self) -> Point
bfddbb17
RD
9838
9839 Returns the current position of the sizer's managed space.
9840 """
5b5c9bc7 9841 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
9842
9843 def GetMinSize(*args, **kwargs):
bfddbb17 9844 """
5b5c9bc7 9845 GetMinSize(self) -> Size
bfddbb17
RD
9846
9847 Returns the minimal size of the sizer. This is either the combined
9848 minimal size of all the children and their borders or the minimal size
9849 set by SetMinSize, depending on which is bigger.
9850 """
5b5c9bc7 9851 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
9852
9853 def GetSizeTuple(self):
1a6bba1e 9854 return self.GetSize().Get()
d55e5bfc 9855 def GetPositionTuple(self):
1a6bba1e 9856 return self.GetPosition().Get()
d55e5bfc 9857 def GetMinSizeTuple(self):
1a6bba1e 9858 return self.GetMinSize().Get()
d55e5bfc
RD
9859
9860 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
9861 """
9862 RecalcSizes(self)
9863
9864 Using the sizes calculated by `CalcMin` reposition and resize all the
9865 items managed by this sizer. You should not need to call this directly as
9866 it is called by `Layout`.
9867 """
5b5c9bc7 9868 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
9869
9870 def CalcMin(*args, **kwargs):
bfddbb17 9871 """
5b5c9bc7 9872 CalcMin(self) -> Size
bfddbb17
RD
9873
9874 This method is where the sizer will do the actual calculation of its
9875 children's minimal sizes. You should not need to call this directly as
9876 it is called by `Layout`.
9877 """
5b5c9bc7 9878 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
9879
9880 def Layout(*args, **kwargs):
bfddbb17
RD
9881 """
9882 Layout(self)
9883
9884 This method will force the recalculation and layout of the items
9885 controlled by the sizer using the current space allocated to the
9886 sizer. Normally this is called automatically from the owning window's
9887 EVT_SIZE handler, but it is also useful to call it from user code when
9888 one of the items in a sizer change size, or items are added or
9889 removed.
9890 """
5b5c9bc7 9891 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
9892
9893 def Fit(*args, **kwargs):
bfddbb17 9894 """
5b5c9bc7 9895 Fit(self, Window window) -> Size
bfddbb17
RD
9896
9897 Tell the sizer to resize the *window* to match the sizer's minimal
9898 size. This is commonly done in the constructor of the window itself in
9899 order to set its initial size to match the needs of the children as
9900 determined by the sizer. Returns the new size.
9901
9902 For a top level window this is the total window size, not the client size.
9903 """
5b5c9bc7 9904 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
9905
9906 def FitInside(*args, **kwargs):
bfddbb17 9907 """
5b5c9bc7 9908 FitInside(self, Window window)
bfddbb17
RD
9909
9910 Tell the sizer to resize the *virtual size* of the *window* to match the
9911 sizer's minimal size. This will not alter the on screen size of the
9912 window, but may cause the addition/removal/alteration of scrollbars
9913 required to view the virtual area in windows which manage it.
9914
9915 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9916
9917 """
5b5c9bc7 9918 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
9919
9920 def SetSizeHints(*args, **kwargs):
bfddbb17 9921 """
5b5c9bc7 9922 SetSizeHints(self, Window window)
bfddbb17
RD
9923
9924 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9925 match the sizer's minimal size. This is commonly done in the
9926 constructor of the window itself if the window is resizable (as are
9927 many dialogs under Unix and frames on probably all platforms) in order
9928 to prevent the window from being sized smaller than the minimal size
9929 required by the sizer.
9930 """
5b5c9bc7 9931 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
9932
9933 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 9934 """
5b5c9bc7 9935 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
9936
9937 Tell the sizer to set the minimal size of the window virtual area to
9938 match the sizer's minimal size. For windows with managed scrollbars
9939 this will set them appropriately.
9940
9941 :see: `wx.ScrolledWindow.SetScrollbars`
9942
9943 """
5b5c9bc7 9944 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
9945
9946 def Clear(*args, **kwargs):
bfddbb17
RD
9947 """
9948 Clear(self, bool deleteWindows=False)
9949
9950 Clear all items from the sizer, optionally destroying the window items
9951 as well.
9952 """
5b5c9bc7 9953 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
9954
9955 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
9956 """
9957 DeleteWindows(self)
9958
9959 Destroy all windows managed by the sizer.
9960 """
5b5c9bc7 9961 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
9962
9963 def GetChildren(*args, **kwargs):
bfddbb17 9964 """
51b83b37 9965 GetChildren(self) -> list
bfddbb17
RD
9966
9967 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9968 """
5b5c9bc7 9969 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
9970
9971 def Show(*args, **kwargs):
bfddbb17 9972 """
b411df4a 9973 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 9974
bfddbb17
RD
9975 Shows or hides an item managed by the sizer. To make a sizer item
9976 disappear or reappear, use Show followed by `Layout`. The *item*
9977 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
9978 the item. Use the recursive parameter to show or hide an item in a
9979 subsizer. Returns True if the item was found.
bfddbb17 9980 """
5b5c9bc7 9981 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
9982
9983 def IsShown(*args, **kwargs):
bfddbb17
RD
9984 """
9985 IsShown(self, item)
9986
9987 Determines if the item is currently shown. sizer. To make a sizer
9988 item disappear or reappear, use Show followed by `Layout`. The *item*
9989 parameter can be either a window, a sizer, or the zero-based index of
9990 the item.
9991 """
5b5c9bc7 9992 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 9993
629e65c2 9994 def Hide(self, item, recursive=False):
bfddbb17 9995 """
88c6b281 9996 A convenience method for `Show`(item, False, recursive).
bfddbb17 9997 """
06759a38 9998 return self.Show(item, False, recursive)
bfddbb17 9999
d55e5bfc 10000 def ShowItems(*args, **kwargs):
bfddbb17
RD
10001 """
10002 ShowItems(self, bool show)
10003
84f85550 10004 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 10005 """
5b5c9bc7 10006 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc
RD
10007
10008
5b5c9bc7 10009class SizerPtr(Sizer):
d55e5bfc
RD
10010 def __init__(self, this):
10011 self.this = this
10012 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10013 self.__class__ = Sizer
10014_core_.Sizer_swigregister(SizerPtr)
d55e5bfc 10015
5b5c9bc7 10016class PySizer(Sizer):
bfddbb17
RD
10017 """
10018 wx.PySizer is a special version of `wx.Sizer` that has been
10019 instrumented to allow the C++ virtual methods to be overloaded in
10020 Python derived classes. You would derive from this class if you are
10021 wanting to implement a custom sizer in Python code. Simply implement
10022 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
10023 For example::
10024
10025 class MySizer(wx.PySizer):
10026 def __init__(self):
10027 wx.PySizer.__init__(self)
10028
10029 def CalcMin(self):
10030 for item in self.GetChildren():
10031 # calculate the total minimum width and height needed
10032 # by all items in the sizer according to this sizer's
10033 # layout algorithm.
10034 ...
10035 return wx.Size(width, height)
10036
10037 def RecalcSizes(self):
10038 # find the space allotted to this sizer
10039 pos = self.GetPosition()
10040 size = self.GetSize()
10041 for item in self.GetChildren():
10042 # Recalculate (if necessary) the position and size of
10043 # each item and then call item.SetDimension to do the
10044 # actual positioning and sizing of the items within the
10045 # space alloted to this sizer.
10046 ...
10047 item.SetDimension(itemPos, itemSize)
10048
10049
10050 When `Layout` is called it first calls `CalcMin` followed by
10051 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 10052 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
10053
10054 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
10055
10056
10057 """
d55e5bfc
RD
10058 def __repr__(self):
10059 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10060 def __init__(self, *args, **kwargs):
bfddbb17 10061 """
5b5c9bc7 10062 __init__(self) -> PySizer
bfddbb17
RD
10063
10064 Creates a wx.PySizer. Must be called from the __init__ in the derived
10065 class.
10066 """
5b5c9bc7 10067 newobj = _core_.new_PySizer(*args, **kwargs)
d55e5bfc
RD
10068 self.this = newobj.this
10069 self.thisown = 1
10070 del newobj.thisown
10071 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
10072
10073 def _setCallbackInfo(*args, **kwargs):
10074 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 10075 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
10076
10077
5b5c9bc7 10078class PySizerPtr(PySizer):
d55e5bfc
RD
10079 def __init__(self, this):
10080 self.this = this
10081 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10082 self.__class__ = PySizer
10083_core_.PySizer_swigregister(PySizerPtr)
d55e5bfc
RD
10084
10085#---------------------------------------------------------------------------
10086
5b5c9bc7 10087class BoxSizer(Sizer):
bfddbb17
RD
10088 """
10089 The basic idea behind a box sizer is that windows will most often be
10090 laid out in rather simple basic geometry, typically in a row or a
10091 column or nested hierarchies of either. A wx.BoxSizer will lay out
10092 its items in a simple row or column, depending on the orientation
10093 parameter passed to the constructor.
10094 """
d55e5bfc
RD
10095 def __repr__(self):
10096 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10097 def __init__(self, *args, **kwargs):
bfddbb17 10098 """
5b5c9bc7 10099 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
10100
10101 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
10102 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
10103 sizer.
10104 """
5b5c9bc7 10105 newobj = _core_.new_BoxSizer(*args, **kwargs)
d55e5bfc
RD
10106 self.this = newobj.this
10107 self.thisown = 1
10108 del newobj.thisown
10109 self._setOORInfo(self)
10110
10111 def GetOrientation(*args, **kwargs):
bfddbb17
RD
10112 """
10113 GetOrientation(self) -> int
10114
10115 Returns the current orientation of the sizer.
10116 """
5b5c9bc7 10117 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
10118
10119 def SetOrientation(*args, **kwargs):
bfddbb17
RD
10120 """
10121 SetOrientation(self, int orient)
d55e5bfc 10122
bfddbb17
RD
10123 Resets the orientation of the sizer.
10124 """
5b5c9bc7 10125 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc
RD
10126
10127
5b5c9bc7 10128class BoxSizerPtr(BoxSizer):
d55e5bfc
RD
10129 def __init__(self, this):
10130 self.this = this
10131 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10132 self.__class__ = BoxSizer
10133_core_.BoxSizer_swigregister(BoxSizerPtr)
d55e5bfc
RD
10134
10135#---------------------------------------------------------------------------
10136
5b5c9bc7 10137class StaticBoxSizer(BoxSizer):
bfddbb17
RD
10138 """
10139 wx.StaticBoxSizer derives from and functions identically to the
10140 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
10141 manages. Note that this static box must be created separately and
10142 passed to the sizer constructor.
10143 """
d55e5bfc
RD
10144 def __repr__(self):
10145 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10146 def __init__(self, *args, **kwargs):
bfddbb17 10147 """
5b5c9bc7 10148 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
10149
10150 Constructor. It takes an associated static box and the orientation
10151 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
10152 ``wx.HORIZONTAL``.
10153 """
5b5c9bc7 10154 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
d55e5bfc
RD
10155 self.this = newobj.this
10156 self.thisown = 1
10157 del newobj.thisown
10158 self._setOORInfo(self)
10159
10160 def GetStaticBox(*args, **kwargs):
bfddbb17 10161 """
5b5c9bc7 10162 GetStaticBox(self) -> StaticBox
d55e5bfc 10163
bfddbb17
RD
10164 Returns the static box associated with this sizer.
10165 """
5b5c9bc7 10166 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc
RD
10167
10168
5b5c9bc7 10169class StaticBoxSizerPtr(StaticBoxSizer):
d55e5bfc
RD
10170 def __init__(self, this):
10171 self.this = this
10172 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10173 self.__class__ = StaticBoxSizer
10174_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
d55e5bfc
RD
10175
10176#---------------------------------------------------------------------------
10177
5b5c9bc7 10178class GridSizer(Sizer):
bfddbb17
RD
10179 """
10180 A grid sizer is a sizer which lays out its children in a
10181 two-dimensional table with all cells having the same size. In other
10182 words, the width of each cell within the grid is the width of the
10183 widest item added to the sizer and the height of each grid cell is the
10184 height of the tallest item. An optional vertical and/or horizontal
10185 gap between items can also be specified (in pixels.)
10186
10187 Items are placed in the cells of the grid in the order they are added,
10188 in row-major order. In other words, the first row is filled first,
10189 then the second, and so on until all items have been added. (If
10190 neccessary, additional rows will be added as items are added.) If you
10191 need to have greater control over the cells that items are placed in
10192 then use the `wx.GridBagSizer`.
10193
10194 """
d55e5bfc
RD
10195 def __repr__(self):
10196 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10197 def __init__(self, *args, **kwargs):
bfddbb17 10198 """
5b5c9bc7 10199 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
10200
10201 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
10202 of columns and rows in the sizer - if either of the parameters is
10203 zero, it will be calculated to from the total number of children in
10204 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
10205 define extra space between all children.
10206 """
5b5c9bc7 10207 newobj = _core_.new_GridSizer(*args, **kwargs)
d55e5bfc
RD
10208 self.this = newobj.this
10209 self.thisown = 1
10210 del newobj.thisown
10211 self._setOORInfo(self)
10212
d55e5bfc 10213 def SetCols(*args, **kwargs):
bfddbb17
RD
10214 """
10215 SetCols(self, int cols)
10216
10217 Sets the number of columns in the sizer.
10218 """
5b5c9bc7 10219 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
10220
10221 def SetRows(*args, **kwargs):
bfddbb17
RD
10222 """
10223 SetRows(self, int rows)
10224
10225 Sets the number of rows in the sizer.
10226 """
5b5c9bc7 10227 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
10228
10229 def SetVGap(*args, **kwargs):
bfddbb17
RD
10230 """
10231 SetVGap(self, int gap)
10232
10233 Sets the vertical gap (in pixels) between the cells in the sizer.
10234 """
5b5c9bc7 10235 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
10236
10237 def SetHGap(*args, **kwargs):
bfddbb17
RD
10238 """
10239 SetHGap(self, int gap)
10240
10241 Sets the horizontal gap (in pixels) between cells in the sizer
10242 """
5b5c9bc7 10243 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
10244
10245 def GetCols(*args, **kwargs):
bfddbb17
RD
10246 """
10247 GetCols(self) -> int
10248
10249 Returns the number of columns in the sizer.
10250 """
5b5c9bc7 10251 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
10252
10253 def GetRows(*args, **kwargs):
bfddbb17
RD
10254 """
10255 GetRows(self) -> int
10256
10257 Returns the number of rows in the sizer.
10258 """
5b5c9bc7 10259 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
10260
10261 def GetVGap(*args, **kwargs):
bfddbb17
RD
10262 """
10263 GetVGap(self) -> int
10264
10265 Returns the vertical gap (in pixels) between the cells in the sizer.
10266 """
5b5c9bc7 10267 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
10268
10269 def GetHGap(*args, **kwargs):
bfddbb17
RD
10270 """
10271 GetHGap(self) -> int
10272
10273 Returns the horizontal gap (in pixels) between cells in the sizer.
10274 """
5b5c9bc7 10275 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc
RD
10276
10277
5b5c9bc7 10278class GridSizerPtr(GridSizer):
d55e5bfc
RD
10279 def __init__(self, this):
10280 self.this = this
10281 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10282 self.__class__ = GridSizer
10283_core_.GridSizer_swigregister(GridSizerPtr)
d55e5bfc
RD
10284
10285#---------------------------------------------------------------------------
10286
5b5c9bc7
RD
10287FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
10288FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
10289FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
10290class FlexGridSizer(GridSizer):
bfddbb17
RD
10291 """
10292 A flex grid sizer is a sizer which lays out its children in a
10293 two-dimensional table with all table cells in one row having the same
10294 height and all cells in one column having the same width, but all
10295 rows or all columns are not necessarily the same height or width as in
10296 the `wx.GridSizer`.
10297
10298 wx.FlexGridSizer can also size items equally in one direction but
10299 unequally ("flexibly") in the other. If the sizer is only flexible
10300 in one direction (this can be changed using `SetFlexibleDirection`), it
10301 needs to be decided how the sizer should grow in the other ("non
10302 flexible") direction in order to fill the available space. The
10303 `SetNonFlexibleGrowMode` method serves this purpose.
10304
10305
10306 """
d55e5bfc
RD
10307 def __repr__(self):
10308 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10309 def __init__(self, *args, **kwargs):
bfddbb17 10310 """
5b5c9bc7 10311 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
10312
10313 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
10314 number of columns and rows in the sizer - if either of the parameters
10315 is zero, it will be calculated to from the total number of children in
10316 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
10317 define extra space between all children.
10318 """
5b5c9bc7 10319 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
d55e5bfc
RD
10320 self.this = newobj.this
10321 self.thisown = 1
10322 del newobj.thisown
10323 self._setOORInfo(self)
10324
bfddbb17
RD
10325 def AddGrowableRow(*args, **kwargs):
10326 """
10327 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 10328
bfddbb17
RD
10329 Specifies that row *idx* (starting from zero) should be grown if there
10330 is extra space available to the sizer.
d55e5bfc 10331
bfddbb17
RD
10332 The *proportion* parameter has the same meaning as the stretch factor
10333 for the box sizers except that if all proportions are 0, then all
10334 columns are resized equally (instead of not being resized at all).
10335 """
5b5c9bc7 10336 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
10337
10338 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
10339 """
10340 RemoveGrowableRow(self, size_t idx)
10341
10342 Specifies that row *idx* is no longer growable.
10343 """
5b5c9bc7 10344 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
10345
10346 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
10347 """
10348 AddGrowableCol(self, size_t idx, int proportion=0)
10349
10350 Specifies that column *idx* (starting from zero) should be grown if
10351 there is extra space available to the sizer.
10352
10353 The *proportion* parameter has the same meaning as the stretch factor
10354 for the box sizers except that if all proportions are 0, then all
10355 columns are resized equally (instead of not being resized at all).
10356 """
5b5c9bc7 10357 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
10358
10359 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
10360 """
10361 RemoveGrowableCol(self, size_t idx)
10362
10363 Specifies that column *idx* is no longer growable.
10364 """
5b5c9bc7 10365 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
10366
10367 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
10368 """
10369 SetFlexibleDirection(self, int direction)
10370
10371 Specifies whether the sizer should flexibly resize its columns, rows,
10372 or both. Argument *direction* can be one of the following values. Any
10373 other value is ignored.
10374
10375 ============== =======================================
10376 wx.VERTICAL Rows are flexibly sized.
10377 wx.HORIZONTAL Columns are flexibly sized.
10378 wx.BOTH Both rows and columns are flexibly sized
10379 (this is the default value).
10380 ============== =======================================
10381
10382 Note that this method does not trigger relayout.
10383
10384 """
5b5c9bc7 10385 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
10386
10387 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
10388 """
10389 GetFlexibleDirection(self) -> int
10390
10391 Returns a value that specifies whether the sizer
10392 flexibly resizes its columns, rows, or both (default).
10393
10394 :see: `SetFlexibleDirection`
10395 """
5b5c9bc7 10396 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
10397
10398 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
10399 """
10400 SetNonFlexibleGrowMode(self, int mode)
10401
10402 Specifies how the sizer should grow in the non-flexible direction if
10403 there is one (so `SetFlexibleDirection` must have been called
10404 previously). Argument *mode* can be one of the following values:
10405
10406 ========================== =================================================
10407 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
10408 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
10409 `AddGrowableCol` and `AddGrowableRow`. In this
10410 case equal sizing applies to minimum sizes of
10411 columns or rows (this is the default value).
10412 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
10413 the non flexible direction, whether they are
10414 growable or not in the flexbile direction.
10415 ========================== =================================================
10416
10417 Note that this method does not trigger relayout.
10418
10419
10420 """
5b5c9bc7 10421 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
10422
10423 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
10424 """
10425 GetNonFlexibleGrowMode(self) -> int
10426
10427 Returns the value that specifies how the sizer grows in the
10428 non-flexible direction if there is one.
10429
10430 :see: `SetNonFlexibleGrowMode`
10431 """
5b5c9bc7 10432 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
10433
10434 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
10435 """
10436 GetRowHeights(self) -> list
10437
10438 Returns a list of integers representing the heights of each of the
10439 rows in the sizer.
10440 """
5b5c9bc7 10441 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
10442
10443 def GetColWidths(*args, **kwargs):
fd2dc343
RD
10444 """
10445 GetColWidths(self) -> list
10446
10447 Returns a list of integers representing the widths of each of the
10448 columns in the sizer.
10449 """
5b5c9bc7 10450 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc
RD
10451
10452
5b5c9bc7 10453class FlexGridSizerPtr(FlexGridSizer):
d55e5bfc
RD
10454 def __init__(self, this):
10455 self.this = this
10456 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10457 self.__class__ = FlexGridSizer
10458_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
d55e5bfc 10459
5b5c9bc7 10460class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
10461 """
10462 A special sizer that knows how to order and position standard buttons
10463 in order to conform to the current platform's standards. You simply
10464 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 10465 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
10466 will take care of the rest.
10467
10468 """
10469 def __repr__(self):
10470 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10471 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10472 """__init__(self) -> StdDialogButtonSizer"""
10473 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
62d32a5f
RD
10474 self.this = newobj.this
10475 self.thisown = 1
10476 del newobj.thisown
10477 def AddButton(*args, **kwargs):
10478 """
10479 AddButton(self, wxButton button)
10480
10481 Use this to add the buttons to this sizer. Do not use the `Add`
10482 method in the base class.
10483 """
5b5c9bc7 10484 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 10485
53aa7709 10486 def Realize(*args, **kwargs):
62d32a5f 10487 """
53aa7709 10488 Realize(self)
62d32a5f
RD
10489
10490 This funciton needs to be called after all the buttons have been added
10491 to the sizer. It will reorder them and position them in a platform
10492 specifc manner.
10493 """
5b5c9bc7 10494 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
10495
10496 def SetAffirmativeButton(*args, **kwargs):
10497 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 10498 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
10499
10500 def SetNegativeButton(*args, **kwargs):
10501 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 10502 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
10503
10504 def SetCancelButton(*args, **kwargs):
10505 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 10506 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
10507
10508 def GetAffirmativeButton(*args, **kwargs):
10509 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 10510 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
10511
10512 def GetApplyButton(*args, **kwargs):
10513 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 10514 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
10515
10516 def GetNegativeButton(*args, **kwargs):
10517 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 10518 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
10519
10520 def GetCancelButton(*args, **kwargs):
10521 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 10522 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
10523
10524 def GetHelpButton(*args, **kwargs):
10525 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 10526 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f
RD
10527
10528
5b5c9bc7 10529class StdDialogButtonSizerPtr(StdDialogButtonSizer):
62d32a5f
RD
10530 def __init__(self, this):
10531 self.this = this
10532 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10533 self.__class__ = StdDialogButtonSizer
10534_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
62d32a5f 10535
d55e5bfc
RD
10536#---------------------------------------------------------------------------
10537
5b5c9bc7 10538class GBPosition(object):
bfddbb17
RD
10539 """
10540 This class represents the position of an item in a virtual grid of
10541 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10542 typemaps that will automatically convert from a 2-element sequence of
10543 integers to a wx.GBPosition, so you can use the more pythonic
10544 representation of the position nearly transparently in Python code.
10545 """
d55e5bfc
RD
10546 def __repr__(self):
10547 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10548 def __init__(self, *args, **kwargs):
bfddbb17 10549 """
5b5c9bc7 10550 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
10551
10552 This class represents the position of an item in a virtual grid of
10553 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10554 typemaps that will automatically convert from a 2-element sequence of
10555 integers to a wx.GBPosition, so you can use the more pythonic
10556 representation of the position nearly transparently in Python code.
10557 """
5b5c9bc7 10558 newobj = _core_.new_GBPosition(*args, **kwargs)
d55e5bfc
RD
10559 self.this = newobj.this
10560 self.thisown = 1
10561 del newobj.thisown
10562 def GetRow(*args, **kwargs):
10563 """GetRow(self) -> int"""
5b5c9bc7 10564 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
10565
10566 def GetCol(*args, **kwargs):
10567 """GetCol(self) -> int"""
5b5c9bc7 10568 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
10569
10570 def SetRow(*args, **kwargs):
10571 """SetRow(self, int row)"""
5b5c9bc7 10572 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
10573
10574 def SetCol(*args, **kwargs):
10575 """SetCol(self, int col)"""
5b5c9bc7 10576 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
10577
10578 def __eq__(*args, **kwargs):
5b5c9bc7
RD
10579 """__eq__(self, GBPosition other) -> bool"""
10580 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
10581
10582 def __ne__(*args, **kwargs):
5b5c9bc7
RD
10583 """__ne__(self, GBPosition other) -> bool"""
10584 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
10585
10586 def Set(*args, **kwargs):
10587 """Set(self, int row=0, int col=0)"""
5b5c9bc7 10588 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
10589
10590 def Get(*args, **kwargs):
10591 """Get(self) -> PyObject"""
5b5c9bc7 10592 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 10593
15817c7e 10594 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
10595 def __str__(self): return str(self.Get())
10596 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
10597 def __len__(self): return len(self.Get())
10598 def __getitem__(self, index): return self.Get()[index]
10599 def __setitem__(self, index, val):
10600 if index == 0: self.SetRow(val)
10601 elif index == 1: self.SetCol(val)
10602 else: raise IndexError
10603 def __nonzero__(self): return self.Get() != (0,0)
10604 __safe_for_unpickling__ = True
10605 def __reduce__(self): return (wx.GBPosition, self.Get())
10606
10607 row = property(GetRow, SetRow)
10608 col = property(GetCol, SetCol)
10609
10610
5b5c9bc7 10611class GBPositionPtr(GBPosition):
d55e5bfc
RD
10612 def __init__(self, this):
10613 self.this = this
10614 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10615 self.__class__ = GBPosition
10616_core_.GBPosition_swigregister(GBPositionPtr)
d55e5bfc 10617
5b5c9bc7 10618class GBSpan(object):
bfddbb17
RD
10619 """
10620 This class is used to hold the row and column spanning attributes of
10621 items in a `wx.GridBagSizer`. wxPython has typemaps that will
10622 automatically convert from a 2-element sequence of integers to a
10623 wx.GBSpan, so you can use the more pythonic representation of the span
10624 nearly transparently in Python code.
10625
10626 """
d55e5bfc
RD
10627 def __repr__(self):
10628 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10629 def __init__(self, *args, **kwargs):
bfddbb17 10630 """
5b5c9bc7 10631 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
10632
10633 Construct a new wxGBSpan, optionally setting the rowspan and
10634 colspan. The default is (1,1). (Meaning that the item occupies one
10635 cell in each direction.
10636 """
5b5c9bc7 10637 newobj = _core_.new_GBSpan(*args, **kwargs)
d55e5bfc
RD
10638 self.this = newobj.this
10639 self.thisown = 1
10640 del newobj.thisown
10641 def GetRowspan(*args, **kwargs):
10642 """GetRowspan(self) -> int"""
5b5c9bc7 10643 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
10644
10645 def GetColspan(*args, **kwargs):
10646 """GetColspan(self) -> int"""
5b5c9bc7 10647 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
10648
10649 def SetRowspan(*args, **kwargs):
10650 """SetRowspan(self, int rowspan)"""
5b5c9bc7 10651 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
10652
10653 def SetColspan(*args, **kwargs):
10654 """SetColspan(self, int colspan)"""
5b5c9bc7 10655 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
10656
10657 def __eq__(*args, **kwargs):
5b5c9bc7
RD
10658 """__eq__(self, GBSpan other) -> bool"""
10659 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
10660
10661 def __ne__(*args, **kwargs):
5b5c9bc7
RD
10662 """__ne__(self, GBSpan other) -> bool"""
10663 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
10664
10665 def Set(*args, **kwargs):
10666 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 10667 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
10668
10669 def Get(*args, **kwargs):
10670 """Get(self) -> PyObject"""
5b5c9bc7 10671 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 10672
15817c7e 10673 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
10674 def __str__(self): return str(self.Get())
10675 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
10676 def __len__(self): return len(self.Get())
10677 def __getitem__(self, index): return self.Get()[index]
10678 def __setitem__(self, index, val):
10679 if index == 0: self.SetRowspan(val)
10680 elif index == 1: self.SetColspan(val)
10681 else: raise IndexError
10682 def __nonzero__(self): return self.Get() != (0,0)
10683 __safe_for_unpickling__ = True
10684 def __reduce__(self): return (wx.GBSpan, self.Get())
10685
10686 rowspan = property(GetRowspan, SetRowspan)
10687 colspan = property(GetColspan, SetColspan)
10688
10689
5b5c9bc7 10690class GBSpanPtr(GBSpan):
d55e5bfc
RD
10691 def __init__(self, this):
10692 self.this = this
10693 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10694 self.__class__ = GBSpan
10695_core_.GBSpan_swigregister(GBSpanPtr)
d55e5bfc 10696
5b5c9bc7 10697class GBSizerItem(SizerItem):
bfddbb17
RD
10698 """
10699 The wx.GBSizerItem class is used to track the additional data about
10700 items in a `wx.GridBagSizer` such as the item's position in the grid
10701 and how many rows or columns it spans.
10702
10703 """
d55e5bfc
RD
10704 def __repr__(self):
10705 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10706 def __init__(self, *args, **kwargs):
bfddbb17 10707 """
5b5c9bc7 10708 __init__(self) -> GBSizerItem
bfddbb17
RD
10709
10710 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
10711 size will need to be set, as well as a position and span before this
10712 item can be used in a Sizer.
10713
10714 You will probably never need to create a wx.GBSizerItem directly as they
10715 are created automatically when the sizer's Add method is called.
10716 """
5b5c9bc7 10717 newobj = _core_.new_GBSizerItem(*args, **kwargs)
d55e5bfc
RD
10718 self.this = newobj.this
10719 self.thisown = 1
10720 del newobj.thisown
10721 def GetPos(*args, **kwargs):
bfddbb17 10722 """
5b5c9bc7 10723 GetPos(self) -> GBPosition
bfddbb17
RD
10724
10725 Get the grid position of the item
10726 """
5b5c9bc7 10727 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
10728
10729 def GetPosTuple(self): return self.GetPos().Get()
10730 def GetSpan(*args, **kwargs):
bfddbb17 10731 """
5b5c9bc7 10732 GetSpan(self) -> GBSpan
bfddbb17
RD
10733
10734 Get the row and column spanning of the item
10735 """
5b5c9bc7 10736 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
10737
10738 def GetSpanTuple(self): return self.GetSpan().Get()
10739 def SetPos(*args, **kwargs):
bfddbb17 10740 """
5b5c9bc7 10741 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
10742
10743 If the item is already a member of a sizer then first ensure that
10744 there is no other item that would intersect with this one at the new
10745 position, then set the new position. Returns True if the change is
10746 successful and after the next Layout() the item will be moved.
10747 """
5b5c9bc7 10748 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
10749
10750 def SetSpan(*args, **kwargs):
bfddbb17 10751 """
5b5c9bc7 10752 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
10753
10754 If the item is already a member of a sizer then first ensure that
10755 there is no other item that would intersect with this one with its new
10756 spanning size, then set the new spanning. Returns True if the change
10757 is successful and after the next Layout() the item will be resized.
10758
10759 """
5b5c9bc7 10760 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 10761
bfddbb17 10762 def Intersects(*args, **kwargs):
d55e5bfc 10763 """
5b5c9bc7 10764 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
10765
10766 Returns True if this item and the other item instersect.
d55e5bfc 10767 """
5b5c9bc7 10768 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
10769
10770 def IntersectsPos(*args, **kwargs):
10771 """
5b5c9bc7 10772 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
10773
10774 Returns True if the given pos/span would intersect with this item.
10775 """
5b5c9bc7 10776 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
10777
10778 def GetEndPos(*args, **kwargs):
bfddbb17 10779 """
5b5c9bc7 10780 GetEndPos(self) -> GBPosition
bfddbb17
RD
10781
10782 Get the row and column of the endpoint of this item.
10783 """
5b5c9bc7 10784 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
10785
10786 def GetGBSizer(*args, **kwargs):
bfddbb17 10787 """
5b5c9bc7 10788 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
10789
10790 Get the sizer this item is a member of.
10791 """
5b5c9bc7 10792 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
10793
10794 def SetGBSizer(*args, **kwargs):
bfddbb17 10795 """
5b5c9bc7 10796 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
10797
10798 Set the sizer this item is a member of.
10799 """
5b5c9bc7 10800 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc
RD
10801
10802
5b5c9bc7 10803class GBSizerItemPtr(GBSizerItem):
d55e5bfc
RD
10804 def __init__(self, this):
10805 self.this = this
10806 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10807 self.__class__ = GBSizerItem
10808_core_.GBSizerItem_swigregister(GBSizerItemPtr)
10809DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
10810
10811def GBSizerItemWindow(*args, **kwargs):
10812 """
5b5c9bc7
RD
10813 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
10814 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
10815
10816 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 10817 """
5b5c9bc7 10818 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
10819 val.thisown = 1
10820 return val
10821
10822def GBSizerItemSizer(*args, **kwargs):
10823 """
5b5c9bc7
RD
10824 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
10825 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
10826
10827 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 10828 """
5b5c9bc7 10829 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
10830 val.thisown = 1
10831 return val
10832
10833def GBSizerItemSpacer(*args, **kwargs):
10834 """
5b5c9bc7
RD
10835 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
10836 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
10837
10838 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 10839 """
5b5c9bc7 10840 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
10841 val.thisown = 1
10842 return val
10843
5b5c9bc7 10844class GridBagSizer(FlexGridSizer):
bfddbb17
RD
10845 """
10846 A `wx.Sizer` that can lay out items in a virtual grid like a
10847 `wx.FlexGridSizer` but in this case explicit positioning of the items
10848 is allowed using `wx.GBPosition`, and items can optionally span more
10849 than one row and/or column using `wx.GBSpan`. The total size of the
10850 virtual grid is determined by the largest row and column that items are
10851 positioned at, adjusted for spanning.
10852
10853 """
d55e5bfc
RD
10854 def __repr__(self):
10855 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10856 def __init__(self, *args, **kwargs):
bfddbb17 10857 """
5b5c9bc7 10858 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
10859
10860 Constructor, with optional parameters to specify the gap between the
10861 rows and columns.
10862 """
5b5c9bc7 10863 newobj = _core_.new_GridBagSizer(*args, **kwargs)
d55e5bfc
RD
10864 self.this = newobj.this
10865 self.thisown = 1
10866 del newobj.thisown
03e46024
RD
10867 self._setOORInfo(self)
10868
d55e5bfc
RD
10869 def Add(*args, **kwargs):
10870 """
bfddbb17 10871 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 10872 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
10873
10874 Adds an item to the sizer at the grid cell *pos*, optionally spanning
10875 more than one row or column as specified with *span*. The remaining
10876 args behave similarly to `wx.Sizer.Add`.
10877
10878 Returns True if the item was successfully placed at the given cell
10879 position, False if something was already there.
10880
d55e5bfc 10881 """
5b5c9bc7 10882 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
10883
10884 def AddItem(*args, **kwargs):
bfddbb17 10885 """
070c48b4 10886 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
10887
10888 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
10889 the item was successfully placed at its given cell position, False if
10890 something was already there.
10891 """
5b5c9bc7 10892 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 10893
84f85550
RD
10894 def GetCellSize(*args, **kwargs):
10895 """
5b5c9bc7 10896 GetCellSize(self, int row, int col) -> Size
84f85550
RD
10897
10898 Get the size of the specified cell, including hgap and
10899 vgap. Only valid after a Layout.
10900 """
5b5c9bc7 10901 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 10902
d55e5bfc 10903 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 10904 """
5b5c9bc7 10905 GetEmptyCellSize(self) -> Size
bfddbb17
RD
10906
10907 Get the size used for cells in the grid with no item.
10908 """
5b5c9bc7 10909 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
10910
10911 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 10912 """
5b5c9bc7 10913 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
10914
10915 Set the size used for cells in the grid with no item.
10916 """
5b5c9bc7 10917 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
10918
10919 def GetItemPosition(*args):
10920 """
bfddbb17
RD
10921 GetItemPosition(self, item) -> GBPosition
10922
10923 Get the grid position of the specified *item* where *item* is either a
10924 window or subsizer that is a member of this sizer, or a zero-based
10925 index of an item.
d55e5bfc 10926 """
5b5c9bc7 10927 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
10928
10929 def SetItemPosition(*args):
10930 """
bfddbb17
RD
10931 SetItemPosition(self, item, GBPosition pos) -> bool
10932
10933 Set the grid position of the specified *item* where *item* is either a
10934 window or subsizer that is a member of this sizer, or a zero-based
10935 index of an item. Returns True on success. If the move is not
10936 allowed (because an item is already there) then False is returned.
10937
d55e5bfc 10938 """
5b5c9bc7 10939 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
10940
10941 def GetItemSpan(*args):
10942 """
bfddbb17
RD
10943 GetItemSpan(self, item) -> GBSpan
10944
10945 Get the row/col spanning of the specified *item* where *item* is
10946 either a window or subsizer that is a member of this sizer, or a
10947 zero-based index of an item.
d55e5bfc 10948 """
5b5c9bc7 10949 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
10950
10951 def SetItemSpan(*args):
10952 """
bfddbb17
RD
10953 SetItemSpan(self, item, GBSpan span) -> bool
10954
10955 Set the row/col spanning of the specified *item* where *item* is
10956 either a window or subsizer that is a member of this sizer, or a
10957 zero-based index of an item. Returns True on success. If the move is
10958 not allowed (because an item is already there) then False is returned.
d55e5bfc 10959 """
5b5c9bc7 10960 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
10961
10962 def FindItem(*args):
10963 """
bfddbb17
RD
10964 FindItem(self, item) -> GBSizerItem
10965
10966 Find the sizer item for the given window or subsizer, returns None if
10967 not found. (non-recursive)
d55e5bfc 10968 """
5b5c9bc7 10969 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
10970
10971 def FindItemAtPosition(*args, **kwargs):
bfddbb17 10972 """
5b5c9bc7 10973 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
10974
10975 Return the sizer item for the given grid cell, or None if there is no
10976 item at that position. (non-recursive)
10977 """
5b5c9bc7 10978 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
10979
10980 def FindItemAtPoint(*args, **kwargs):
bfddbb17 10981 """
5b5c9bc7 10982 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
10983
10984 Return the sizer item located at the point given in *pt*, or None if
10985 there is no item at that point. The (x,y) coordinates in pt correspond
10986 to the client coordinates of the window using the sizer for
10987 layout. (non-recursive)
10988 """
5b5c9bc7 10989 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 10990
bfddbb17
RD
10991 def CheckForIntersection(*args, **kwargs):
10992 """
5b5c9bc7 10993 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 10994
bfddbb17
RD
10995 Look at all items and see if any intersect (or would overlap) the
10996 given *item*. Returns True if so, False if there would be no overlap.
10997 If an *excludeItem* is given then it will not be checked for
10998 intersection, for example it may be the item we are checking the
10999 position of.
d55e5bfc 11000
bfddbb17 11001 """
5b5c9bc7 11002 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 11003
bfddbb17 11004 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 11005 """
5b5c9bc7 11006 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
11007
11008 Look at all items and see if any intersect (or would overlap) the
11009 given position and span. Returns True if so, False if there would be
11010 no overlap. If an *excludeItem* is given then it will not be checked
11011 for intersection, for example it may be the item we are checking the
11012 position of.
d55e5bfc 11013 """
5b5c9bc7 11014 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc
RD
11015
11016
5b5c9bc7 11017class GridBagSizerPtr(GridBagSizer):
d55e5bfc
RD
11018 def __init__(self, this):
11019 self.this = this
11020 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11021 self.__class__ = GridBagSizer
11022_core_.GridBagSizer_swigregister(GridBagSizerPtr)
d55e5bfc
RD
11023
11024#---------------------------------------------------------------------------
11025
5b5c9bc7
RD
11026Left = _core_.Left
11027Top = _core_.Top
11028Right = _core_.Right
11029Bottom = _core_.Bottom
11030Width = _core_.Width
11031Height = _core_.Height
11032Centre = _core_.Centre
11033Center = _core_.Center
11034CentreX = _core_.CentreX
11035CentreY = _core_.CentreY
11036Unconstrained = _core_.Unconstrained
11037AsIs = _core_.AsIs
11038PercentOf = _core_.PercentOf
11039Above = _core_.Above
11040Below = _core_.Below
11041LeftOf = _core_.LeftOf
11042RightOf = _core_.RightOf
11043SameAs = _core_.SameAs
11044Absolute = _core_.Absolute
11045class IndividualLayoutConstraint(Object):
d55e5bfc 11046 """
15817c7e
RD
11047 Objects of this class are stored in the `wx.LayoutConstraints` class as
11048 one of eight possible constraints that a window can be involved in.
11049 You will never need to create an instance of
11050 wx.IndividualLayoutConstraint, rather you should create a
11051 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 11052 that it contains.
d55e5bfc
RD
11053 """
11054 def __init__(self): raise RuntimeError, "No constructor defined"
11055 def __repr__(self):
11056 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11057 def Set(*args, **kwargs):
15817c7e 11058 """
5b5c9bc7 11059 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
11060
11061 Sets the properties of the constraint. Normally called by one of the
11062 convenience functions such as Above, RightOf, SameAs.
11063 """
5b5c9bc7 11064 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
11065
11066 def LeftOf(*args, **kwargs):
11067 """
5b5c9bc7 11068 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 11069
15817c7e
RD
11070 Constrains this edge to be to the left of the given window, with an
11071 optional margin. Implicitly, this is relative to the left edge of the
11072 other window.
d55e5bfc 11073 """
5b5c9bc7 11074 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
11075
11076 def RightOf(*args, **kwargs):
11077 """
5b5c9bc7 11078 RightOf(self, Window sibling, int marg=0)
d55e5bfc 11079
15817c7e
RD
11080 Constrains this edge to be to the right of the given window, with an
11081 optional margin. Implicitly, this is relative to the right edge of the
11082 other window.
d55e5bfc 11083 """
5b5c9bc7 11084 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
11085
11086 def Above(*args, **kwargs):
11087 """
5b5c9bc7 11088 Above(self, Window sibling, int marg=0)
d55e5bfc 11089
15817c7e
RD
11090 Constrains this edge to be above the given window, with an optional
11091 margin. Implicitly, this is relative to the top edge of the other
11092 window.
d55e5bfc 11093 """
5b5c9bc7 11094 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
11095
11096 def Below(*args, **kwargs):
11097 """
5b5c9bc7 11098 Below(self, Window sibling, int marg=0)
d55e5bfc 11099
15817c7e
RD
11100 Constrains this edge to be below the given window, with an optional
11101 margin. Implicitly, this is relative to the bottom edge of the other
11102 window.
d55e5bfc 11103 """
5b5c9bc7 11104 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
11105
11106 def SameAs(*args, **kwargs):
11107 """
5b5c9bc7 11108 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 11109
15817c7e
RD
11110 Constrains this edge or dimension to be to the same as the edge of the
11111 given window, with an optional margin.
d55e5bfc 11112 """
5b5c9bc7 11113 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
11114
11115 def PercentOf(*args, **kwargs):
11116 """
5b5c9bc7 11117 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 11118
15817c7e
RD
11119 Constrains this edge or dimension to be to a percentage of the given
11120 window, with an optional margin.
d55e5bfc 11121 """
5b5c9bc7 11122 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
11123
11124 def Absolute(*args, **kwargs):
11125 """
11126 Absolute(self, int val)
11127
15817c7e 11128 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 11129 """
5b5c9bc7 11130 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
11131
11132 def Unconstrained(*args, **kwargs):
11133 """
11134 Unconstrained(self)
11135
15817c7e
RD
11136 Sets this edge or dimension to be unconstrained, that is, dependent on
11137 other edges and dimensions from which this value can be deduced.
d55e5bfc 11138 """
5b5c9bc7 11139 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
11140
11141 def AsIs(*args, **kwargs):
11142 """
11143 AsIs(self)
11144
15817c7e
RD
11145 Sets this edge or constraint to be whatever the window's value is at
11146 the moment. If either of the width and height constraints are *as is*,
11147 the window will not be resized, but moved instead. This is important
11148 when considering panel items which are intended to have a default
11149 size, such as a button, which may take its size from the size of the
11150 button label.
d55e5bfc 11151 """
5b5c9bc7 11152 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
11153
11154 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
11155 """GetOtherWindow(self) -> Window"""
11156 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
11157
11158 def GetMyEdge(*args, **kwargs):
11159 """GetMyEdge(self) -> int"""
5b5c9bc7 11160 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
11161
11162 def SetEdge(*args, **kwargs):
11163 """SetEdge(self, int which)"""
5b5c9bc7 11164 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
11165
11166 def SetValue(*args, **kwargs):
11167 """SetValue(self, int v)"""
5b5c9bc7 11168 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
11169
11170 def GetMargin(*args, **kwargs):
11171 """GetMargin(self) -> int"""
5b5c9bc7 11172 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
11173
11174 def SetMargin(*args, **kwargs):
11175 """SetMargin(self, int m)"""
5b5c9bc7 11176 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
11177
11178 def GetValue(*args, **kwargs):
11179 """GetValue(self) -> int"""
5b5c9bc7 11180 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
11181
11182 def GetPercent(*args, **kwargs):
11183 """GetPercent(self) -> int"""
5b5c9bc7 11184 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
11185
11186 def GetOtherEdge(*args, **kwargs):
11187 """GetOtherEdge(self) -> int"""
5b5c9bc7 11188 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
11189
11190 def GetDone(*args, **kwargs):
11191 """GetDone(self) -> bool"""
5b5c9bc7 11192 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
11193
11194 def SetDone(*args, **kwargs):
11195 """SetDone(self, bool d)"""
5b5c9bc7 11196 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
11197
11198 def GetRelationship(*args, **kwargs):
11199 """GetRelationship(self) -> int"""
5b5c9bc7 11200 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
11201
11202 def SetRelationship(*args, **kwargs):
11203 """SetRelationship(self, int r)"""
5b5c9bc7 11204 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
11205
11206 def ResetIfWin(*args, **kwargs):
11207 """
5b5c9bc7 11208 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
11209
11210 Reset constraint if it mentions otherWin
11211 """
5b5c9bc7 11212 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
11213
11214 def SatisfyConstraint(*args, **kwargs):
11215 """
5b5c9bc7 11216 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
11217
11218 Try to satisfy constraint
11219 """
5b5c9bc7 11220 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
11221
11222 def GetEdge(*args, **kwargs):
11223 """
5b5c9bc7 11224 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
11225
11226 Get the value of this edge or dimension, or if this
11227 is not determinable, -1.
11228 """
5b5c9bc7 11229 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc
RD
11230
11231
5b5c9bc7 11232class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
d55e5bfc
RD
11233 def __init__(self, this):
11234 self.this = this
11235 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11236 self.__class__ = IndividualLayoutConstraint
11237_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
d55e5bfc 11238
5b5c9bc7 11239class LayoutConstraints(Object):
d55e5bfc 11240 """
15817c7e
RD
11241 **Note:** constraints are now deprecated and you should use sizers
11242 instead.
d55e5bfc 11243
15817c7e
RD
11244 Objects of this class can be associated with a window to define its
11245 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
11246
11247 The class consists of the following eight constraints of class
11248 wx.IndividualLayoutConstraint, some or all of which should be accessed
11249 directly to set the appropriate constraints.
11250
11251 * left: represents the left hand edge of the window
11252 * right: represents the right hand edge of the window
11253 * top: represents the top edge of the window
11254 * bottom: represents the bottom edge of the window
11255 * width: represents the width of the window
11256 * height: represents the height of the window
11257 * centreX: represents the horizontal centre point of the window
11258 * centreY: represents the vertical centre point of the window
11259
15817c7e
RD
11260 Most constraints are initially set to have the relationship
11261 wxUnconstrained, which means that their values should be calculated by
11262 looking at known constraints. The exceptions are width and height,
11263 which are set to wxAsIs to ensure that if the user does not specify a
11264 constraint, the existing width and height will be used, to be
11265 compatible with panel items which often have take a default size. If
11266 the constraint is ``wx.AsIs``, the dimension will not be changed.
11267
11268 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
11269
11270 """
11271 def __repr__(self):
11272 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
11273 left = property(_core_.LayoutConstraints_left_get)
11274 top = property(_core_.LayoutConstraints_top_get)
11275 right = property(_core_.LayoutConstraints_right_get)
11276 bottom = property(_core_.LayoutConstraints_bottom_get)
11277 width = property(_core_.LayoutConstraints_width_get)
11278 height = property(_core_.LayoutConstraints_height_get)
11279 centreX = property(_core_.LayoutConstraints_centreX_get)
11280 centreY = property(_core_.LayoutConstraints_centreY_get)
d55e5bfc 11281 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
11282 """__init__(self) -> LayoutConstraints"""
11283 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
d55e5bfc
RD
11284 self.this = newobj.this
11285 self.thisown = 1
11286 del newobj.thisown
11287 def SatisfyConstraints(*args, **kwargs):
11288 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 11289 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
11290
11291 def AreSatisfied(*args, **kwargs):
11292 """AreSatisfied(self) -> bool"""
5b5c9bc7 11293 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc
RD
11294
11295
5b5c9bc7 11296class LayoutConstraintsPtr(LayoutConstraints):
d55e5bfc
RD
11297 def __init__(self, this):
11298 self.this = this
11299 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11300 self.__class__ = LayoutConstraints
11301_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
d55e5bfc
RD
11302
11303#----------------------------------------------------------------------------
11304
11305# Use Python's bool constants if available, make some if not
11306try:
11307 True
11308except NameError:
11309 __builtins__.True = 1==1
11310 __builtins__.False = 1==0
11311 def bool(value): return not not value
11312 __builtins__.bool = bool
11313
11314
11315
11316# workarounds for bad wxRTTI names
11317__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
11318__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
11319__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
11320
11321
11322#----------------------------------------------------------------------------
11323# Load version numbers from __version__... Ensure that major and minor
0f63ec68 11324# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
11325
11326from __version__ import *
11327__version__ = VERSION_STRING
11328
0f63ec68
RD
11329assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
11330assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
11331if RELEASE_VERSION != _core_.RELEASE_VERSION:
11332 import warnings
0f63ec68 11333 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
11334
11335#----------------------------------------------------------------------------
11336
62d32a5f
RD
11337# Set the default string<-->unicode conversion encoding from the
11338# locale. This encoding is used when string or unicode objects need
11339# to be converted in order to pass them to wxWidgets. Please be aware
11340# that the default encoding within the same locale may be slightly
11341# different on different platforms. For example, please see
11342# http://www.alanwood.net/demos/charsetdiffs.html for differences
11343# between the common latin/roman encodings.
3837a853
RD
11344
11345default = _sys.getdefaultencoding()
11346if default == 'ascii':
11347 import locale
11348 import codecs
11349 try:
11350 default = locale.getdefaultlocale()[1]
11351 codecs.lookup(default)
11352 except (ValueError, LookupError):
11353 default = _sys.getdefaultencoding()
11354 del locale
11355 del codecs
5cbf236d
RD
11356if default:
11357 wx.SetDefaultPyEncoding(default)
11358del default
5cbf236d
RD
11359
11360#----------------------------------------------------------------------------
11361
d55e5bfc
RD
11362class PyDeadObjectError(AttributeError):
11363 pass
11364
11365class _wxPyDeadObject(object):
11366 """
11367 Instances of wx objects that are OOR capable will have their __class__
11368 changed to this class when the C++ object is deleted. This should help
11369 prevent crashes due to referencing a bogus C++ pointer.
11370 """
11371 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
11372 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
11373
11374 def __repr__(self):
11375 if not hasattr(self, "_name"):
11376 self._name = "[unknown]"
11377 return self.reprStr % self._name
11378
11379 def __getattr__(self, *args):
11380 if not hasattr(self, "_name"):
11381 self._name = "[unknown]"
11382 raise PyDeadObjectError(self.attrStr % self._name)
11383
11384 def __nonzero__(self):
11385 return 0
11386
11387
11388
11389class PyUnbornObjectError(AttributeError):
11390 pass
11391
11392class _wxPyUnbornObject(object):
11393 """
11394 Some stock objects are created when the wx._core module is
11395 imported, but their C++ instance is not created until the wx.App
11396 object is created and initialized. These object instances will
11397 temporarily have their __class__ changed to this class so an
11398 exception will be raised if they are used before the C++ instance
11399 is ready.
11400 """
11401
11402 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
11403 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
11404
11405 def __repr__(self):
11406 #if not hasattr(self, "_name"):
11407 # self._name = "[unknown]"
11408 return self.reprStr #% self._name
11409
11410 def __getattr__(self, *args):
11411 #if not hasattr(self, "_name"):
11412 # self._name = "[unknown]"
11413 raise PyUnbornObjectError(self.attrStr) # % self._name )
11414
11415 def __nonzero__(self):
11416 return 0
11417
11418
11419#----------------------------------------------------------------------------
d55e5bfc
RD
11420
11421def CallAfter(callable, *args, **kw):
11422 """
11423 Call the specified function after the current and pending event
11424 handlers have been completed. This is also good for making GUI
0439c23b
RD
11425 method calls from non-GUI threads. Any extra positional or
11426 keyword args are passed on to the callable when it is called.
11427
11428 :see: `wx.FutureCall`
d55e5bfc
RD
11429 """
11430 app = wx.GetApp()
a001823c 11431 assert app is not None, 'No wx.App created yet'
d55e5bfc 11432
891bb194
RD
11433 if not hasattr(app, "_CallAfterId"):
11434 app._CallAfterId = wx.NewEventType()
11435 app.Connect(-1, -1, app._CallAfterId,
11436 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 11437 evt = wx.PyEvent()
891bb194 11438 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
11439 evt.callable = callable
11440 evt.args = args
11441 evt.kw = kw
11442 wx.PostEvent(app, evt)
11443
d55e5bfc
RD
11444#----------------------------------------------------------------------------
11445
11446
11447class FutureCall:
11448 """
6e0de3df 11449 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
11450 object once after the given amount of milliseconds, passing any
11451 positional or keyword args. The return value of the callable is
0439c23b 11452 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
11453
11454 If you don't need to get the return value or restart the timer
11455 then there is no need to hold a reference to this object. It will
11456 hold a reference to itself while the timer is running (the timer
11457 has a reference to self.Notify) but the cycle will be broken when
11458 the timer completes, automatically cleaning up the wx.FutureCall
11459 object.
0439c23b
RD
11460
11461 :see: `wx.CallAfter`
d55e5bfc
RD
11462 """
11463 def __init__(self, millis, callable, *args, **kwargs):
11464 self.millis = millis
11465 self.callable = callable
11466 self.SetArgs(*args, **kwargs)
11467 self.runCount = 0
11468 self.running = False
11469 self.hasRun = False
11470 self.result = None
11471 self.timer = None
11472 self.Start()
11473
11474 def __del__(self):
11475 self.Stop()
11476
11477
11478 def Start(self, millis=None, *args, **kwargs):
11479 """
11480 (Re)start the timer
11481 """
11482 self.hasRun = False
11483 if millis is not None:
11484 self.millis = millis
11485 if args or kwargs:
11486 self.SetArgs(*args, **kwargs)
11487 self.Stop()
11488 self.timer = wx.PyTimer(self.Notify)
11489 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
11490 self.running = True
11491 Restart = Start
11492
11493
11494 def Stop(self):
11495 """
11496 Stop and destroy the timer.
11497 """
11498 if self.timer is not None:
11499 self.timer.Stop()
11500 self.timer = None
11501
11502
11503 def GetInterval(self):
11504 if self.timer is not None:
11505 return self.timer.GetInterval()
11506 else:
11507 return 0
11508
11509
11510 def IsRunning(self):
11511 return self.timer is not None and self.timer.IsRunning()
11512
11513
11514 def SetArgs(self, *args, **kwargs):
11515 """
11516 (Re)set the args passed to the callable object. This is
11517 useful in conjunction with Restart if you want to schedule a
11518 new call to the same callable object but with different
11519 parameters.
11520 """
11521 self.args = args
11522 self.kwargs = kwargs
11523
11524
11525 def HasRun(self):
11526 return self.hasRun
11527
11528 def GetResult(self):
11529 return self.result
11530
11531 def Notify(self):
11532 """
11533 The timer has expired so call the callable.
11534 """
11535 if self.callable and getattr(self.callable, 'im_self', True):
11536 self.runCount += 1
11537 self.running = False
11538 self.result = self.callable(*self.args, **self.kwargs)
11539 self.hasRun = True
11540 if not self.running:
11541 # if it wasn't restarted, then cleanup
11542 wx.CallAfter(self.Stop)
11543
11544
11545
11546#----------------------------------------------------------------------------
11547# Control which items in this module should be documented by epydoc.
11548# We allow only classes and functions, which will help reduce the size
11549# of the docs by filtering out the zillions of constants, EVT objects,
11550# and etc that don't make much sense by themselves, but are instead
11551# documented (or will be) as part of the classes/functions/methods
11552# where they should be used.
11553
d6c14a4c
RD
11554class __DocFilter:
11555 """
11556 A filter for epydoc that only allows non-Ptr classes and
11557 fucntions, in order to reduce the clutter in the API docs.
11558 """
11559 def __init__(self, globals):
11560 self._globals = globals
11561
11562 def __call__(self, name):
11563 import types
11564 obj = self._globals.get(name, None)
11565 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
11566 return False
11567 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
11568 return False
11569 return True
d55e5bfc
RD
11570
11571#----------------------------------------------------------------------------
11572#----------------------------------------------------------------------------
11573
11574# Import other modules in this package that should show up in the
11575# "core" wx namespace
11576from _gdi import *
11577from _windows import *
11578from _controls import *
11579from _misc import *
11580
11581
11582# Fixup the stock objects since they can't be used yet. (They will be
11583# restored in wx.PyApp.OnInit.)
11584_core_._wxPyFixStockObjects()
11585
11586#----------------------------------------------------------------------------
11587#----------------------------------------------------------------------------
11588
11589