]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
Documenting WX_MONOLITHIC build option.
[wxWidgets.git] / wxPython / src / mac / _core.py
CommitLineData
32fe5131 1# This file was created automatically by SWIG 1.3.27.
d55e5bfc
RD
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
943e8dfd 164SIZE_FORCE = _core_.SIZE_FORCE
5b5c9bc7
RD
165PORTRAIT = _core_.PORTRAIT
166LANDSCAPE = _core_.LANDSCAPE
167PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
168PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
169PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
170PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
171ID_ANY = _core_.ID_ANY
172ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 173ID_NONE = _core_.ID_NONE
5b5c9bc7
RD
174ID_LOWEST = _core_.ID_LOWEST
175ID_OPEN = _core_.ID_OPEN
176ID_CLOSE = _core_.ID_CLOSE
177ID_NEW = _core_.ID_NEW
178ID_SAVE = _core_.ID_SAVE
179ID_SAVEAS = _core_.ID_SAVEAS
180ID_REVERT = _core_.ID_REVERT
181ID_EXIT = _core_.ID_EXIT
182ID_UNDO = _core_.ID_UNDO
183ID_REDO = _core_.ID_REDO
184ID_HELP = _core_.ID_HELP
185ID_PRINT = _core_.ID_PRINT
186ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
187ID_PREVIEW = _core_.ID_PREVIEW
188ID_ABOUT = _core_.ID_ABOUT
189ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
190ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
191ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
192ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
193ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
194ID_PREFERENCES = _core_.ID_PREFERENCES
195ID_CUT = _core_.ID_CUT
196ID_COPY = _core_.ID_COPY
197ID_PASTE = _core_.ID_PASTE
198ID_CLEAR = _core_.ID_CLEAR
199ID_FIND = _core_.ID_FIND
200ID_DUPLICATE = _core_.ID_DUPLICATE
201ID_SELECTALL = _core_.ID_SELECTALL
202ID_DELETE = _core_.ID_DELETE
203ID_REPLACE = _core_.ID_REPLACE
204ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
205ID_PROPERTIES = _core_.ID_PROPERTIES
206ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
207ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
208ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
209ID_VIEW_LIST = _core_.ID_VIEW_LIST
210ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
211ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
212ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
213ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
214ID_FILE1 = _core_.ID_FILE1
215ID_FILE2 = _core_.ID_FILE2
216ID_FILE3 = _core_.ID_FILE3
217ID_FILE4 = _core_.ID_FILE4
218ID_FILE5 = _core_.ID_FILE5
219ID_FILE6 = _core_.ID_FILE6
220ID_FILE7 = _core_.ID_FILE7
221ID_FILE8 = _core_.ID_FILE8
222ID_FILE9 = _core_.ID_FILE9
223ID_OK = _core_.ID_OK
224ID_CANCEL = _core_.ID_CANCEL
225ID_APPLY = _core_.ID_APPLY
226ID_YES = _core_.ID_YES
227ID_NO = _core_.ID_NO
228ID_STATIC = _core_.ID_STATIC
229ID_FORWARD = _core_.ID_FORWARD
230ID_BACKWARD = _core_.ID_BACKWARD
231ID_DEFAULT = _core_.ID_DEFAULT
232ID_MORE = _core_.ID_MORE
233ID_SETUP = _core_.ID_SETUP
234ID_RESET = _core_.ID_RESET
235ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
236ID_YESTOALL = _core_.ID_YESTOALL
237ID_NOTOALL = _core_.ID_NOTOALL
238ID_ABORT = _core_.ID_ABORT
239ID_RETRY = _core_.ID_RETRY
240ID_IGNORE = _core_.ID_IGNORE
241ID_ADD = _core_.ID_ADD
242ID_REMOVE = _core_.ID_REMOVE
243ID_UP = _core_.ID_UP
244ID_DOWN = _core_.ID_DOWN
245ID_HOME = _core_.ID_HOME
246ID_REFRESH = _core_.ID_REFRESH
247ID_STOP = _core_.ID_STOP
248ID_INDEX = _core_.ID_INDEX
249ID_BOLD = _core_.ID_BOLD
250ID_ITALIC = _core_.ID_ITALIC
251ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
252ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
253ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
254ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
255ID_UNDERLINE = _core_.ID_UNDERLINE
256ID_INDENT = _core_.ID_INDENT
257ID_UNINDENT = _core_.ID_UNINDENT
258ID_ZOOM_100 = _core_.ID_ZOOM_100
259ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
260ID_ZOOM_IN = _core_.ID_ZOOM_IN
261ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
262ID_UNDELETE = _core_.ID_UNDELETE
263ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
264ID_HIGHEST = _core_.ID_HIGHEST
265OPEN = _core_.OPEN
266SAVE = _core_.SAVE
267HIDE_READONLY = _core_.HIDE_READONLY
268OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
269FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
270MULTIPLE = _core_.MULTIPLE
271CHANGE_DIR = _core_.CHANGE_DIR
272ACCEL_ALT = _core_.ACCEL_ALT
273ACCEL_CTRL = _core_.ACCEL_CTRL
274ACCEL_SHIFT = _core_.ACCEL_SHIFT
275ACCEL_NORMAL = _core_.ACCEL_NORMAL
276PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
277PD_APP_MODAL = _core_.PD_APP_MODAL
278PD_CAN_ABORT = _core_.PD_CAN_ABORT
279PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
280PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
281PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
282PD_SMOOTH = _core_.PD_SMOOTH
283PD_CAN_SKIP = _core_.PD_CAN_SKIP
284DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
285DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
286MENU_TEAROFF = _core_.MENU_TEAROFF
287MB_DOCKABLE = _core_.MB_DOCKABLE
288NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
289FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
290LI_HORIZONTAL = _core_.LI_HORIZONTAL
291LI_VERTICAL = _core_.LI_VERTICAL
292WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
293WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
294WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
295WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
296WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
297WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
298MM_TEXT = _core_.MM_TEXT
299MM_LOMETRIC = _core_.MM_LOMETRIC
300MM_HIMETRIC = _core_.MM_HIMETRIC
301MM_LOENGLISH = _core_.MM_LOENGLISH
302MM_HIENGLISH = _core_.MM_HIENGLISH
303MM_TWIPS = _core_.MM_TWIPS
304MM_ISOTROPIC = _core_.MM_ISOTROPIC
305MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
306MM_POINTS = _core_.MM_POINTS
307MM_METRIC = _core_.MM_METRIC
308CENTRE = _core_.CENTRE
309CENTER = _core_.CENTER
310HORIZONTAL = _core_.HORIZONTAL
311VERTICAL = _core_.VERTICAL
312BOTH = _core_.BOTH
313LEFT = _core_.LEFT
314RIGHT = _core_.RIGHT
315UP = _core_.UP
316DOWN = _core_.DOWN
317TOP = _core_.TOP
318BOTTOM = _core_.BOTTOM
319NORTH = _core_.NORTH
320SOUTH = _core_.SOUTH
321WEST = _core_.WEST
322EAST = _core_.EAST
323ALL = _core_.ALL
324ALIGN_NOT = _core_.ALIGN_NOT
325ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
326ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
327ALIGN_LEFT = _core_.ALIGN_LEFT
328ALIGN_TOP = _core_.ALIGN_TOP
329ALIGN_RIGHT = _core_.ALIGN_RIGHT
330ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
331ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
332ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
333ALIGN_CENTER = _core_.ALIGN_CENTER
334ALIGN_CENTRE = _core_.ALIGN_CENTRE
335ALIGN_MASK = _core_.ALIGN_MASK
336STRETCH_NOT = _core_.STRETCH_NOT
337SHRINK = _core_.SHRINK
338GROW = _core_.GROW
339EXPAND = _core_.EXPAND
340SHAPED = _core_.SHAPED
341FIXED_MINSIZE = _core_.FIXED_MINSIZE
342TILE = _core_.TILE
343ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
344BORDER_DEFAULT = _core_.BORDER_DEFAULT
345BORDER_NONE = _core_.BORDER_NONE
346BORDER_STATIC = _core_.BORDER_STATIC
347BORDER_SIMPLE = _core_.BORDER_SIMPLE
348BORDER_RAISED = _core_.BORDER_RAISED
349BORDER_SUNKEN = _core_.BORDER_SUNKEN
350BORDER_DOUBLE = _core_.BORDER_DOUBLE
351BORDER_MASK = _core_.BORDER_MASK
352BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
353BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
354BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
355DEFAULT = _core_.DEFAULT
356DECORATIVE = _core_.DECORATIVE
357ROMAN = _core_.ROMAN
358SCRIPT = _core_.SCRIPT
359SWISS = _core_.SWISS
360MODERN = _core_.MODERN
361TELETYPE = _core_.TELETYPE
362VARIABLE = _core_.VARIABLE
363FIXED = _core_.FIXED
364NORMAL = _core_.NORMAL
365LIGHT = _core_.LIGHT
366BOLD = _core_.BOLD
367ITALIC = _core_.ITALIC
368SLANT = _core_.SLANT
369SOLID = _core_.SOLID
370DOT = _core_.DOT
371LONG_DASH = _core_.LONG_DASH
372SHORT_DASH = _core_.SHORT_DASH
373DOT_DASH = _core_.DOT_DASH
374USER_DASH = _core_.USER_DASH
375TRANSPARENT = _core_.TRANSPARENT
376STIPPLE = _core_.STIPPLE
d04418a7
RD
377STIPPLE_MASK = _core_.STIPPLE_MASK
378STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
5b5c9bc7
RD
379BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
380CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
381FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
382CROSS_HATCH = _core_.CROSS_HATCH
383HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
384VERTICAL_HATCH = _core_.VERTICAL_HATCH
385JOIN_BEVEL = _core_.JOIN_BEVEL
386JOIN_MITER = _core_.JOIN_MITER
387JOIN_ROUND = _core_.JOIN_ROUND
388CAP_ROUND = _core_.CAP_ROUND
389CAP_PROJECTING = _core_.CAP_PROJECTING
390CAP_BUTT = _core_.CAP_BUTT
391CLEAR = _core_.CLEAR
392XOR = _core_.XOR
393INVERT = _core_.INVERT
394OR_REVERSE = _core_.OR_REVERSE
395AND_REVERSE = _core_.AND_REVERSE
396COPY = _core_.COPY
397AND = _core_.AND
398AND_INVERT = _core_.AND_INVERT
399NO_OP = _core_.NO_OP
400NOR = _core_.NOR
401EQUIV = _core_.EQUIV
402SRC_INVERT = _core_.SRC_INVERT
403OR_INVERT = _core_.OR_INVERT
404NAND = _core_.NAND
405OR = _core_.OR
406SET = _core_.SET
407WXK_BACK = _core_.WXK_BACK
408WXK_TAB = _core_.WXK_TAB
409WXK_RETURN = _core_.WXK_RETURN
410WXK_ESCAPE = _core_.WXK_ESCAPE
411WXK_SPACE = _core_.WXK_SPACE
412WXK_DELETE = _core_.WXK_DELETE
413WXK_START = _core_.WXK_START
414WXK_LBUTTON = _core_.WXK_LBUTTON
415WXK_RBUTTON = _core_.WXK_RBUTTON
416WXK_CANCEL = _core_.WXK_CANCEL
417WXK_MBUTTON = _core_.WXK_MBUTTON
418WXK_CLEAR = _core_.WXK_CLEAR
419WXK_SHIFT = _core_.WXK_SHIFT
420WXK_ALT = _core_.WXK_ALT
421WXK_CONTROL = _core_.WXK_CONTROL
422WXK_MENU = _core_.WXK_MENU
423WXK_PAUSE = _core_.WXK_PAUSE
424WXK_CAPITAL = _core_.WXK_CAPITAL
425WXK_PRIOR = _core_.WXK_PRIOR
426WXK_NEXT = _core_.WXK_NEXT
427WXK_END = _core_.WXK_END
428WXK_HOME = _core_.WXK_HOME
429WXK_LEFT = _core_.WXK_LEFT
430WXK_UP = _core_.WXK_UP
431WXK_RIGHT = _core_.WXK_RIGHT
432WXK_DOWN = _core_.WXK_DOWN
433WXK_SELECT = _core_.WXK_SELECT
434WXK_PRINT = _core_.WXK_PRINT
435WXK_EXECUTE = _core_.WXK_EXECUTE
436WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
437WXK_INSERT = _core_.WXK_INSERT
438WXK_HELP = _core_.WXK_HELP
439WXK_NUMPAD0 = _core_.WXK_NUMPAD0
440WXK_NUMPAD1 = _core_.WXK_NUMPAD1
441WXK_NUMPAD2 = _core_.WXK_NUMPAD2
442WXK_NUMPAD3 = _core_.WXK_NUMPAD3
443WXK_NUMPAD4 = _core_.WXK_NUMPAD4
444WXK_NUMPAD5 = _core_.WXK_NUMPAD5
445WXK_NUMPAD6 = _core_.WXK_NUMPAD6
446WXK_NUMPAD7 = _core_.WXK_NUMPAD7
447WXK_NUMPAD8 = _core_.WXK_NUMPAD8
448WXK_NUMPAD9 = _core_.WXK_NUMPAD9
449WXK_MULTIPLY = _core_.WXK_MULTIPLY
450WXK_ADD = _core_.WXK_ADD
451WXK_SEPARATOR = _core_.WXK_SEPARATOR
452WXK_SUBTRACT = _core_.WXK_SUBTRACT
453WXK_DECIMAL = _core_.WXK_DECIMAL
454WXK_DIVIDE = _core_.WXK_DIVIDE
455WXK_F1 = _core_.WXK_F1
456WXK_F2 = _core_.WXK_F2
457WXK_F3 = _core_.WXK_F3
458WXK_F4 = _core_.WXK_F4
459WXK_F5 = _core_.WXK_F5
460WXK_F6 = _core_.WXK_F6
461WXK_F7 = _core_.WXK_F7
462WXK_F8 = _core_.WXK_F8
463WXK_F9 = _core_.WXK_F9
464WXK_F10 = _core_.WXK_F10
465WXK_F11 = _core_.WXK_F11
466WXK_F12 = _core_.WXK_F12
467WXK_F13 = _core_.WXK_F13
468WXK_F14 = _core_.WXK_F14
469WXK_F15 = _core_.WXK_F15
470WXK_F16 = _core_.WXK_F16
471WXK_F17 = _core_.WXK_F17
472WXK_F18 = _core_.WXK_F18
473WXK_F19 = _core_.WXK_F19
474WXK_F20 = _core_.WXK_F20
475WXK_F21 = _core_.WXK_F21
476WXK_F22 = _core_.WXK_F22
477WXK_F23 = _core_.WXK_F23
478WXK_F24 = _core_.WXK_F24
479WXK_NUMLOCK = _core_.WXK_NUMLOCK
480WXK_SCROLL = _core_.WXK_SCROLL
481WXK_PAGEUP = _core_.WXK_PAGEUP
482WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
483WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
484WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
485WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
486WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
487WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
488WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
489WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
490WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
491WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
492WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
493WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
494WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
495WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
496WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
497WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
498WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
499WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
500WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
501WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
502WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
503WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
504WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
505WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
506WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
507WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
508WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
509WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
510WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
511WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
512WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
513WXK_COMMAND = _core_.WXK_COMMAND
514WXK_SPECIAL1 = _core_.WXK_SPECIAL1
515WXK_SPECIAL2 = _core_.WXK_SPECIAL2
516WXK_SPECIAL3 = _core_.WXK_SPECIAL3
517WXK_SPECIAL4 = _core_.WXK_SPECIAL4
518WXK_SPECIAL5 = _core_.WXK_SPECIAL5
519WXK_SPECIAL6 = _core_.WXK_SPECIAL6
520WXK_SPECIAL7 = _core_.WXK_SPECIAL7
521WXK_SPECIAL8 = _core_.WXK_SPECIAL8
522WXK_SPECIAL9 = _core_.WXK_SPECIAL9
523WXK_SPECIAL10 = _core_.WXK_SPECIAL10
524WXK_SPECIAL11 = _core_.WXK_SPECIAL11
525WXK_SPECIAL12 = _core_.WXK_SPECIAL12
526WXK_SPECIAL13 = _core_.WXK_SPECIAL13
527WXK_SPECIAL14 = _core_.WXK_SPECIAL14
528WXK_SPECIAL15 = _core_.WXK_SPECIAL15
529WXK_SPECIAL16 = _core_.WXK_SPECIAL16
530WXK_SPECIAL17 = _core_.WXK_SPECIAL17
531WXK_SPECIAL18 = _core_.WXK_SPECIAL18
532WXK_SPECIAL19 = _core_.WXK_SPECIAL19
533WXK_SPECIAL20 = _core_.WXK_SPECIAL20
534PAPER_NONE = _core_.PAPER_NONE
535PAPER_LETTER = _core_.PAPER_LETTER
536PAPER_LEGAL = _core_.PAPER_LEGAL
537PAPER_A4 = _core_.PAPER_A4
538PAPER_CSHEET = _core_.PAPER_CSHEET
539PAPER_DSHEET = _core_.PAPER_DSHEET
540PAPER_ESHEET = _core_.PAPER_ESHEET
541PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
542PAPER_TABLOID = _core_.PAPER_TABLOID
543PAPER_LEDGER = _core_.PAPER_LEDGER
544PAPER_STATEMENT = _core_.PAPER_STATEMENT
545PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
546PAPER_A3 = _core_.PAPER_A3
547PAPER_A4SMALL = _core_.PAPER_A4SMALL
548PAPER_A5 = _core_.PAPER_A5
549PAPER_B4 = _core_.PAPER_B4
550PAPER_B5 = _core_.PAPER_B5
551PAPER_FOLIO = _core_.PAPER_FOLIO
552PAPER_QUARTO = _core_.PAPER_QUARTO
553PAPER_10X14 = _core_.PAPER_10X14
554PAPER_11X17 = _core_.PAPER_11X17
555PAPER_NOTE = _core_.PAPER_NOTE
556PAPER_ENV_9 = _core_.PAPER_ENV_9
557PAPER_ENV_10 = _core_.PAPER_ENV_10
558PAPER_ENV_11 = _core_.PAPER_ENV_11
559PAPER_ENV_12 = _core_.PAPER_ENV_12
560PAPER_ENV_14 = _core_.PAPER_ENV_14
561PAPER_ENV_DL = _core_.PAPER_ENV_DL
562PAPER_ENV_C5 = _core_.PAPER_ENV_C5
563PAPER_ENV_C3 = _core_.PAPER_ENV_C3
564PAPER_ENV_C4 = _core_.PAPER_ENV_C4
565PAPER_ENV_C6 = _core_.PAPER_ENV_C6
566PAPER_ENV_C65 = _core_.PAPER_ENV_C65
567PAPER_ENV_B4 = _core_.PAPER_ENV_B4
568PAPER_ENV_B5 = _core_.PAPER_ENV_B5
569PAPER_ENV_B6 = _core_.PAPER_ENV_B6
570PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
571PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
572PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
573PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
574PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
575PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
576PAPER_ISO_B4 = _core_.PAPER_ISO_B4
577PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
578PAPER_9X11 = _core_.PAPER_9X11
579PAPER_10X11 = _core_.PAPER_10X11
580PAPER_15X11 = _core_.PAPER_15X11
581PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
582PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
583PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
584PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
585PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
586PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
587PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
588PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
589PAPER_A_PLUS = _core_.PAPER_A_PLUS
590PAPER_B_PLUS = _core_.PAPER_B_PLUS
591PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
592PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
593PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
594PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
595PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
596PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
597PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
598PAPER_A2 = _core_.PAPER_A2
599PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
600PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
601PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
602PAPER_A6 = _core_.PAPER_A6
603PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
604PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
605PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
606PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
607PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
608PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
609PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
610PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
611PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
612PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
613PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
614PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
615PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
616PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
617PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
618PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
619PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
620PAPER_B6_JIS = _core_.PAPER_B6_JIS
621PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
622PAPER_12X11 = _core_.PAPER_12X11
623PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
624PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
625PAPER_P16K = _core_.PAPER_P16K
626PAPER_P32K = _core_.PAPER_P32K
627PAPER_P32KBIG = _core_.PAPER_P32KBIG
628PAPER_PENV_1 = _core_.PAPER_PENV_1
629PAPER_PENV_2 = _core_.PAPER_PENV_2
630PAPER_PENV_3 = _core_.PAPER_PENV_3
631PAPER_PENV_4 = _core_.PAPER_PENV_4
632PAPER_PENV_5 = _core_.PAPER_PENV_5
633PAPER_PENV_6 = _core_.PAPER_PENV_6
634PAPER_PENV_7 = _core_.PAPER_PENV_7
635PAPER_PENV_8 = _core_.PAPER_PENV_8
636PAPER_PENV_9 = _core_.PAPER_PENV_9
637PAPER_PENV_10 = _core_.PAPER_PENV_10
638PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
639PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
640PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
641PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
642PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
643PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
644PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
645PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
646PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
647PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
648PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
649PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
650PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
5b5c9bc7
RD
651DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
652DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
653DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
654ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
655ITEM_NORMAL = _core_.ITEM_NORMAL
656ITEM_CHECK = _core_.ITEM_CHECK
657ITEM_RADIO = _core_.ITEM_RADIO
658ITEM_MAX = _core_.ITEM_MAX
659HT_NOWHERE = _core_.HT_NOWHERE
660HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
661HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
662HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
663HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
664HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
665HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
666HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
667HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
668HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
669HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
670HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
671HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
672HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
673HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
674HT_MAX = _core_.HT_MAX
675MOD_NONE = _core_.MOD_NONE
676MOD_ALT = _core_.MOD_ALT
677MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 678MOD_ALTGR = _core_.MOD_ALTGR
5b5c9bc7 679MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 680MOD_META = _core_.MOD_META
5b5c9bc7 681MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
682MOD_CMD = _core_.MOD_CMD
683MOD_ALL = _core_.MOD_ALL
5b5c9bc7
RD
684UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
685UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
686UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d55e5bfc
RD
687#---------------------------------------------------------------------------
688
5b5c9bc7 689class Object(object):
d55e5bfc
RD
690 """
691 The base class for most wx objects, although in wxPython not
692 much functionality is needed nor exposed.
693 """
694 def __init__(self): raise RuntimeError, "No constructor defined"
695 def __repr__(self):
696 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
697 def GetClassName(*args, **kwargs):
698 """
5b5c9bc7 699 GetClassName(self) -> String
d55e5bfc
RD
700
701 Returns the class name of the C++ class using wxRTTI.
702 """
5b5c9bc7 703 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
704
705 def Destroy(*args, **kwargs):
706 """
707 Destroy(self)
708
709 Deletes the C++ object this Python object is a proxy for.
710 """
7e08d4ef
RD
711 val = _core_.Object_Destroy(*args, **kwargs)
712 args[0].thisown = 0
713 return val
d55e5bfc
RD
714
715
5b5c9bc7 716class ObjectPtr(Object):
d55e5bfc
RD
717 def __init__(self, this):
718 self.this = this
719 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
720 self.__class__ = Object
721_core_.Object_swigregister(ObjectPtr)
722_wxPySetDictionary = _core_._wxPySetDictionary
d55e5bfc 723
5b5c9bc7 724_wxPyFixStockObjects = _core_._wxPyFixStockObjects
d55e5bfc 725
5b5c9bc7 726cvar = _core_.cvar
d55e5bfc
RD
727EmptyString = cvar.EmptyString
728
729#---------------------------------------------------------------------------
730
5b5c9bc7
RD
731BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
732BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
733BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
734BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
735BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
736BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
737BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
738BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
739BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
740BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
741BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
742BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
743BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
744BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
745BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
746BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
747BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
748BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
749BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
750BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
751CURSOR_NONE = _core_.CURSOR_NONE
752CURSOR_ARROW = _core_.CURSOR_ARROW
753CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
754CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
755CURSOR_CHAR = _core_.CURSOR_CHAR
756CURSOR_CROSS = _core_.CURSOR_CROSS
757CURSOR_HAND = _core_.CURSOR_HAND
758CURSOR_IBEAM = _core_.CURSOR_IBEAM
759CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
760CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
761CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
762CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
763CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
764CURSOR_PENCIL = _core_.CURSOR_PENCIL
765CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
766CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
767CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
768CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
769CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
770CURSOR_SIZENS = _core_.CURSOR_SIZENS
771CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
772CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
773CURSOR_SIZING = _core_.CURSOR_SIZING
774CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
775CURSOR_WAIT = _core_.CURSOR_WAIT
776CURSOR_WATCH = _core_.CURSOR_WATCH
777CURSOR_BLANK = _core_.CURSOR_BLANK
778CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
779CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
780CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
781CURSOR_MAX = _core_.CURSOR_MAX
d55e5bfc
RD
782#---------------------------------------------------------------------------
783
5b5c9bc7 784class Size(object):
d55e5bfc 785 """
15817c7e 786 wx.Size is a useful data structure used to represent the size of
36ed4f51
RD
787 something. It simply contians integer width and height
788 proprtites. In most places in wxPython where a wx.Size is
789 expected a (width, height) tuple can be used instead.
d55e5bfc
RD
790 """
791 def __repr__(self):
792 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
793 width = property(_core_.Size_width_get, _core_.Size_width_set)
794 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc
RD
795 x = width; y = height
796 def __init__(self, *args, **kwargs):
797 """
5b5c9bc7 798 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
799
800 Creates a size object.
801 """
5b5c9bc7 802 newobj = _core_.new_Size(*args, **kwargs)
d55e5bfc
RD
803 self.this = newobj.this
804 self.thisown = 1
805 del newobj.thisown
5b5c9bc7 806 def __del__(self, destroy=_core_.delete_Size):
d55e5bfc
RD
807 """__del__(self)"""
808 try:
809 if self.thisown: destroy(self)
810 except: pass
811
812 def __eq__(*args, **kwargs):
813 """
5b5c9bc7 814 __eq__(self, Size sz) -> bool
d55e5bfc
RD
815
816 Test for equality of wx.Size objects.
817 """
5b5c9bc7 818 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
819
820 def __ne__(*args, **kwargs):
821 """
5b5c9bc7 822 __ne__(self, Size sz) -> bool
d55e5bfc
RD
823
824 Test for inequality.
825 """
5b5c9bc7 826 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
827
828 def __add__(*args, **kwargs):
829 """
5b5c9bc7 830 __add__(self, Size sz) -> Size
d55e5bfc
RD
831
832 Add sz's proprties to this and return the result.
833 """
5b5c9bc7 834 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
835
836 def __sub__(*args, **kwargs):
837 """
5b5c9bc7 838 __sub__(self, Size sz) -> Size
d55e5bfc
RD
839
840 Subtract sz's properties from this and return the result.
841 """
5b5c9bc7 842 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
843
844 def IncTo(*args, **kwargs):
845 """
5b5c9bc7 846 IncTo(self, Size sz)
d55e5bfc
RD
847
848 Increments this object so that both of its dimensions are not less
849 than the corresponding dimensions of the size.
850 """
5b5c9bc7 851 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
852
853 def DecTo(*args, **kwargs):
854 """
5b5c9bc7 855 DecTo(self, Size sz)
d55e5bfc
RD
856
857 Decrements this object so that both of its dimensions are not greater
858 than the corresponding dimensions of the size.
859 """
5b5c9bc7 860 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc
RD
861
862 def Set(*args, **kwargs):
863 """
864 Set(self, int w, int h)
865
866 Set both width and height.
867 """
5b5c9bc7 868 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
869
870 def SetWidth(*args, **kwargs):
871 """SetWidth(self, int w)"""
5b5c9bc7 872 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
873
874 def SetHeight(*args, **kwargs):
875 """SetHeight(self, int h)"""
5b5c9bc7 876 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
877
878 def GetWidth(*args, **kwargs):
879 """GetWidth(self) -> int"""
5b5c9bc7 880 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
881
882 def GetHeight(*args, **kwargs):
883 """GetHeight(self) -> int"""
5b5c9bc7 884 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
885
886 def IsFullySpecified(*args, **kwargs):
887 """
888 IsFullySpecified(self) -> bool
889
890 Returns True if both components of the size are non-default values.
891 """
5b5c9bc7 892 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
893
894 def SetDefaults(*args, **kwargs):
895 """
5b5c9bc7 896 SetDefaults(self, Size size)
d55e5bfc 897
15817c7e
RD
898 Combine this size with the other one replacing the default components
899 of this object (i.e. equal to -1) with those of the other.
d55e5bfc 900 """
5b5c9bc7 901 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
902
903 def Get(*args, **kwargs):
904 """
905 Get() -> (width,height)
906
907 Returns the width and height properties as a tuple.
908 """
5b5c9bc7 909 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 910
15817c7e 911 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
912 def __str__(self): return str(self.Get())
913 def __repr__(self): return 'wx.Size'+str(self.Get())
914 def __len__(self): return len(self.Get())
915 def __getitem__(self, index): return self.Get()[index]
916 def __setitem__(self, index, val):
917 if index == 0: self.width = val
918 elif index == 1: self.height = val
919 else: raise IndexError
920 def __nonzero__(self): return self.Get() != (0,0)
921 __safe_for_unpickling__ = True
922 def __reduce__(self): return (wx.Size, self.Get())
923
924
5b5c9bc7 925class SizePtr(Size):
d55e5bfc
RD
926 def __init__(self, this):
927 self.this = this
928 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
929 self.__class__ = Size
930_core_.Size_swigregister(SizePtr)
d55e5bfc
RD
931
932#---------------------------------------------------------------------------
933
5b5c9bc7 934class RealPoint(object):
d55e5bfc 935 """
15817c7e
RD
936 A data structure for representing a point or position with floating
937 point x and y properties. In wxPython most places that expect a
938 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc
RD
939 """
940 def __repr__(self):
941 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
942 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
943 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
d55e5bfc
RD
944 def __init__(self, *args, **kwargs):
945 """
5b5c9bc7 946 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
947
948 Create a wx.RealPoint object
949 """
5b5c9bc7 950 newobj = _core_.new_RealPoint(*args, **kwargs)
d55e5bfc
RD
951 self.this = newobj.this
952 self.thisown = 1
953 del newobj.thisown
5b5c9bc7 954 def __del__(self, destroy=_core_.delete_RealPoint):
d55e5bfc
RD
955 """__del__(self)"""
956 try:
957 if self.thisown: destroy(self)
958 except: pass
959
960 def __eq__(*args, **kwargs):
961 """
5b5c9bc7 962 __eq__(self, RealPoint pt) -> bool
d55e5bfc
RD
963
964 Test for equality of wx.RealPoint objects.
965 """
5b5c9bc7 966 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
967
968 def __ne__(*args, **kwargs):
969 """
5b5c9bc7 970 __ne__(self, RealPoint pt) -> bool
d55e5bfc
RD
971
972 Test for inequality of wx.RealPoint objects.
973 """
5b5c9bc7 974 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
975
976 def __add__(*args, **kwargs):
977 """
5b5c9bc7 978 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
979
980 Add pt's proprties to this and return the result.
981 """
5b5c9bc7 982 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
983
984 def __sub__(*args, **kwargs):
985 """
5b5c9bc7 986 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
987
988 Subtract pt's proprties from this and return the result
989 """
5b5c9bc7 990 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
991
992 def Set(*args, **kwargs):
993 """
994 Set(self, double x, double y)
995
996 Set both the x and y properties
997 """
5b5c9bc7 998 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
999
1000 def Get(*args, **kwargs):
1001 """
1002 Get() -> (x,y)
1003
1004 Return the x and y properties as a tuple.
1005 """
5b5c9bc7 1006 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 1007
15817c7e 1008 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1009 def __str__(self): return str(self.Get())
1010 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1011 def __len__(self): return len(self.Get())
1012 def __getitem__(self, index): return self.Get()[index]
1013 def __setitem__(self, index, val):
1014 if index == 0: self.x = val
1015 elif index == 1: self.y = val
1016 else: raise IndexError
1017 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1018 __safe_for_unpickling__ = True
1019 def __reduce__(self): return (wx.RealPoint, self.Get())
1020
1021
5b5c9bc7 1022class RealPointPtr(RealPoint):
d55e5bfc
RD
1023 def __init__(self, this):
1024 self.this = this
1025 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1026 self.__class__ = RealPoint
1027_core_.RealPoint_swigregister(RealPointPtr)
d55e5bfc
RD
1028
1029#---------------------------------------------------------------------------
1030
5b5c9bc7 1031class Point(object):
d55e5bfc 1032 """
15817c7e
RD
1033 A data structure for representing a point or position with integer x
1034 and y properties. Most places in wxPython that expect a wx.Point can
1035 also accept a (x,y) tuple.
d55e5bfc
RD
1036 """
1037 def __repr__(self):
1038 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
1039 x = property(_core_.Point_x_get, _core_.Point_x_set)
1040 y = property(_core_.Point_y_get, _core_.Point_y_set)
d55e5bfc
RD
1041 def __init__(self, *args, **kwargs):
1042 """
5b5c9bc7 1043 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
1044
1045 Create a wx.Point object
1046 """
5b5c9bc7 1047 newobj = _core_.new_Point(*args, **kwargs)
d55e5bfc
RD
1048 self.this = newobj.this
1049 self.thisown = 1
1050 del newobj.thisown
5b5c9bc7 1051 def __del__(self, destroy=_core_.delete_Point):
d55e5bfc
RD
1052 """__del__(self)"""
1053 try:
1054 if self.thisown: destroy(self)
1055 except: pass
1056
1057 def __eq__(*args, **kwargs):
1058 """
5b5c9bc7 1059 __eq__(self, Point pt) -> bool
d55e5bfc
RD
1060
1061 Test for equality of wx.Point objects.
1062 """
5b5c9bc7 1063 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1064
1065 def __ne__(*args, **kwargs):
1066 """
5b5c9bc7 1067 __ne__(self, Point pt) -> bool
d55e5bfc
RD
1068
1069 Test for inequality of wx.Point objects.
1070 """
5b5c9bc7 1071 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1072
1073 def __add__(*args, **kwargs):
1074 """
5b5c9bc7 1075 __add__(self, Point pt) -> Point
d55e5bfc
RD
1076
1077 Add pt's proprties to this and return the result.
1078 """
5b5c9bc7 1079 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1080
1081 def __sub__(*args, **kwargs):
1082 """
5b5c9bc7 1083 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1084
1085 Subtract pt's proprties from this and return the result
1086 """
5b5c9bc7 1087 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1088
1089 def __iadd__(*args, **kwargs):
1090 """
5b5c9bc7 1091 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1092
1093 Add pt to this object.
1094 """
5b5c9bc7 1095 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1096
1097 def __isub__(*args, **kwargs):
1098 """
5b5c9bc7 1099 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1100
1101 Subtract pt from this object.
1102 """
5b5c9bc7 1103 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1104
1105 def Set(*args, **kwargs):
1106 """
1107 Set(self, long x, long y)
1108
1109 Set both the x and y properties
1110 """
5b5c9bc7 1111 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1112
1113 def Get(*args, **kwargs):
1114 """
1115 Get() -> (x,y)
1116
1117 Return the x and y properties as a tuple.
1118 """
5b5c9bc7 1119 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1120
15817c7e 1121 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1122 def __str__(self): return str(self.Get())
1123 def __repr__(self): return 'wx.Point'+str(self.Get())
1124 def __len__(self): return len(self.Get())
1125 def __getitem__(self, index): return self.Get()[index]
1126 def __setitem__(self, index, val):
1127 if index == 0: self.x = val
1128 elif index == 1: self.y = val
1129 else: raise IndexError
1130 def __nonzero__(self): return self.Get() != (0,0)
1131 __safe_for_unpickling__ = True
1132 def __reduce__(self): return (wx.Point, self.Get())
1133
1134
5b5c9bc7 1135class PointPtr(Point):
d55e5bfc
RD
1136 def __init__(self, this):
1137 self.this = this
1138 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1139 self.__class__ = Point
1140_core_.Point_swigregister(PointPtr)
d55e5bfc
RD
1141
1142#---------------------------------------------------------------------------
1143
5b5c9bc7 1144class Rect(object):
d55e5bfc 1145 """
15817c7e
RD
1146 A class for representing and manipulating rectangles. It has x, y,
1147 width and height properties. In wxPython most palces that expect a
1148 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc
RD
1149 """
1150 def __repr__(self):
1151 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1152 def __init__(self, *args, **kwargs):
1153 """
5b5c9bc7 1154 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1155
1156 Create a new Rect object.
1157 """
5b5c9bc7 1158 newobj = _core_.new_Rect(*args, **kwargs)
d55e5bfc
RD
1159 self.this = newobj.this
1160 self.thisown = 1
1161 del newobj.thisown
5b5c9bc7 1162 def __del__(self, destroy=_core_.delete_Rect):
d55e5bfc
RD
1163 """__del__(self)"""
1164 try:
1165 if self.thisown: destroy(self)
1166 except: pass
1167
1168 def GetX(*args, **kwargs):
1169 """GetX(self) -> int"""
5b5c9bc7 1170 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1171
1172 def SetX(*args, **kwargs):
1173 """SetX(self, int x)"""
5b5c9bc7 1174 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1175
1176 def GetY(*args, **kwargs):
1177 """GetY(self) -> int"""
5b5c9bc7 1178 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1179
1180 def SetY(*args, **kwargs):
1181 """SetY(self, int y)"""
5b5c9bc7 1182 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1183
1184 def GetWidth(*args, **kwargs):
1185 """GetWidth(self) -> int"""
5b5c9bc7 1186 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1187
1188 def SetWidth(*args, **kwargs):
1189 """SetWidth(self, int w)"""
5b5c9bc7 1190 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1191
1192 def GetHeight(*args, **kwargs):
1193 """GetHeight(self) -> int"""
5b5c9bc7 1194 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1195
1196 def SetHeight(*args, **kwargs):
1197 """SetHeight(self, int h)"""
5b5c9bc7 1198 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1199
1200 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1201 """GetPosition(self) -> Point"""
1202 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1203
1204 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1205 """SetPosition(self, Point p)"""
1206 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1207
1208 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1209 """GetSize(self) -> Size"""
1210 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1211
1212 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1213 """SetSize(self, Size s)"""
1214 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1215
aff4cc5c
RD
1216 def IsEmpty(*args, **kwargs):
1217 """IsEmpty(self) -> bool"""
5b5c9bc7 1218 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1219
d55e5bfc 1220 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1221 """GetTopLeft(self) -> Point"""
1222 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1223
1224 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1225 """SetTopLeft(self, Point p)"""
1226 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1227
1228 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1229 """GetBottomRight(self) -> Point"""
1230 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1231
1232 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1233 """SetBottomRight(self, Point p)"""
1234 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc
RD
1235
1236 def GetLeft(*args, **kwargs):
1237 """GetLeft(self) -> int"""
5b5c9bc7 1238 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1239
1240 def GetTop(*args, **kwargs):
1241 """GetTop(self) -> int"""
5b5c9bc7 1242 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1243
1244 def GetBottom(*args, **kwargs):
1245 """GetBottom(self) -> int"""
5b5c9bc7 1246 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1247
1248 def GetRight(*args, **kwargs):
1249 """GetRight(self) -> int"""
5b5c9bc7 1250 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1251
1252 def SetLeft(*args, **kwargs):
1253 """SetLeft(self, int left)"""
5b5c9bc7 1254 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1255
1256 def SetRight(*args, **kwargs):
1257 """SetRight(self, int right)"""
5b5c9bc7 1258 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1259
1260 def SetTop(*args, **kwargs):
1261 """SetTop(self, int top)"""
5b5c9bc7 1262 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1263
1264 def SetBottom(*args, **kwargs):
1265 """SetBottom(self, int bottom)"""
5b5c9bc7 1266 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
1267
1268 position = property(GetPosition, SetPosition)
1269 size = property(GetSize, SetSize)
1270 left = property(GetLeft, SetLeft)
1271 right = property(GetRight, SetRight)
1272 top = property(GetTop, SetTop)
1273 bottom = property(GetBottom, SetBottom)
1274
1275 def Inflate(*args, **kwargs):
1276 """
5b5c9bc7 1277 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1278
091fdbfa
RD
1279 Increases the size of the rectangle.
1280
1281 The left border is moved farther left and the right border is moved
1282 farther right by ``dx``. The upper border is moved farther up and the
1283 bottom border is moved farther down by ``dy``. (Note the the width and
1284 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1285 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1286 opposite happens: the rectangle size decreases in the respective
1287 direction.
1288
1289 The change is made to the rectangle inplace, if instead you need a
1290 copy that is inflated, preserving the original then make the copy
1291 first::
1292
1293 copy = wx.Rect(*original)
1294 copy.Inflate(10,15)
1295
1296
d55e5bfc 1297 """
5b5c9bc7 1298 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1299
1300 def Deflate(*args, **kwargs):
1301 """
5b5c9bc7 1302 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1303
091fdbfa
RD
1304 Decrease the rectangle size. This method is the opposite of `Inflate`
1305 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1306 `Inflate` for a full description.
d55e5bfc 1307 """
5b5c9bc7 1308 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1309
1310 def OffsetXY(*args, **kwargs):
1311 """
1312 OffsetXY(self, int dx, int dy)
1313
15817c7e
RD
1314 Moves the rectangle by the specified offset. If dx is positive, the
1315 rectangle is moved to the right, if dy is positive, it is moved to the
1316 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc 1317 """
5b5c9bc7 1318 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1319
1320 def Offset(*args, **kwargs):
1321 """
5b5c9bc7 1322 Offset(self, Point pt)
d55e5bfc
RD
1323
1324 Same as OffsetXY but uses dx,dy from Point
1325 """
5b5c9bc7 1326 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1327
1328 def Intersect(*args, **kwargs):
1329 """
5b5c9bc7 1330 Intersect(self, Rect rect) -> Rect
d55e5bfc 1331
5cbf236d 1332 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1333 """
5b5c9bc7 1334 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1335
5cbf236d
RD
1336 def Union(*args, **kwargs):
1337 """
5b5c9bc7 1338 Union(self, Rect rect) -> Rect
5cbf236d
RD
1339
1340 Returns the union of this rectangle and rect.
1341 """
5b5c9bc7 1342 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1343
d55e5bfc
RD
1344 def __add__(*args, **kwargs):
1345 """
5b5c9bc7 1346 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1347
1348 Add the properties of rect to this rectangle and return the result.
1349 """
5b5c9bc7 1350 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1351
1352 def __iadd__(*args, **kwargs):
1353 """
5b5c9bc7 1354 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1355
1356 Add the properties of rect to this rectangle, updating this rectangle.
1357 """
5b5c9bc7 1358 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1359
1360 def __eq__(*args, **kwargs):
1361 """
5b5c9bc7 1362 __eq__(self, Rect rect) -> bool
d55e5bfc
RD
1363
1364 Test for equality.
1365 """
5b5c9bc7 1366 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1367
1368 def __ne__(*args, **kwargs):
1369 """
5b5c9bc7 1370 __ne__(self, Rect rect) -> bool
d55e5bfc
RD
1371
1372 Test for inequality.
1373 """
5b5c9bc7 1374 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc
RD
1375
1376 def InsideXY(*args, **kwargs):
1377 """
1378 InsideXY(self, int x, int y) -> bool
1379
1380 Return True if the point is (not strcitly) inside the rect.
1381 """
5b5c9bc7 1382 return _core_.Rect_InsideXY(*args, **kwargs)
d55e5bfc
RD
1383
1384 def Inside(*args, **kwargs):
1385 """
5b5c9bc7 1386 Inside(self, Point pt) -> bool
d55e5bfc
RD
1387
1388 Return True if the point is (not strcitly) inside the rect.
1389 """
5b5c9bc7 1390 return _core_.Rect_Inside(*args, **kwargs)
d55e5bfc
RD
1391
1392 def Intersects(*args, **kwargs):
1393 """
5b5c9bc7 1394 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1395
1396 Returns True if the rectangles have a non empty intersection.
1397 """
5b5c9bc7 1398 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1399
5b5c9bc7
RD
1400 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1401 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1402 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1403 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
d55e5bfc
RD
1404 def Set(*args, **kwargs):
1405 """
1406 Set(self, int x=0, int y=0, int width=0, int height=0)
1407
1408 Set all rectangle properties.
1409 """
5b5c9bc7 1410 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1411
1412 def Get(*args, **kwargs):
1413 """
1414 Get() -> (x,y,width,height)
1415
1416 Return the rectangle properties as a tuple.
1417 """
5b5c9bc7 1418 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1419
15817c7e 1420 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1421 def __str__(self): return str(self.Get())
1422 def __repr__(self): return 'wx.Rect'+str(self.Get())
1423 def __len__(self): return len(self.Get())
1424 def __getitem__(self, index): return self.Get()[index]
1425 def __setitem__(self, index, val):
1426 if index == 0: self.x = val
1427 elif index == 1: self.y = val
1428 elif index == 2: self.width = val
1429 elif index == 3: self.height = val
1430 else: raise IndexError
1431 def __nonzero__(self): return self.Get() != (0,0,0,0)
1432 __safe_for_unpickling__ = True
1433 def __reduce__(self): return (wx.Rect, self.Get())
1434
1435
5b5c9bc7 1436class RectPtr(Rect):
d55e5bfc
RD
1437 def __init__(self, this):
1438 self.this = this
1439 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1440 self.__class__ = Rect
1441_core_.Rect_swigregister(RectPtr)
d55e5bfc
RD
1442
1443def RectPP(*args, **kwargs):
1444 """
5b5c9bc7 1445 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1446
1447 Create a new Rect object from Points representing two corners.
1448 """
5b5c9bc7 1449 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1450 val.thisown = 1
1451 return val
1452
1453def RectPS(*args, **kwargs):
1454 """
5b5c9bc7 1455 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1456
1457 Create a new Rect from a position and size.
1458 """
5b5c9bc7 1459 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1460 val.thisown = 1
1461 return val
1462
070c48b4
RD
1463def RectS(*args, **kwargs):
1464 """
5b5c9bc7 1465 RectS(Size size) -> Rect
070c48b4
RD
1466
1467 Create a new Rect from a size only.
1468 """
5b5c9bc7 1469 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1470 val.thisown = 1
1471 return val
1472
d55e5bfc 1473
5b5c9bc7 1474def IntersectRect(*args, **kwargs):
d55e5bfc
RD
1475 """
1476 IntersectRect(Rect r1, Rect r2) -> Rect
1477
1478 Calculate and return the intersection of r1 and r2.
1479 """
5b5c9bc7 1480 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1481#---------------------------------------------------------------------------
1482
5b5c9bc7 1483class Point2D(object):
15817c7e
RD
1484 """
1485 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1486 with floating point values.
1487 """
d55e5bfc
RD
1488 def __repr__(self):
1489 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1490 def __init__(self, *args, **kwargs):
1491 """
5b5c9bc7 1492 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1493
1494 Create a w.Point2D object.
1495 """
5b5c9bc7 1496 newobj = _core_.new_Point2D(*args, **kwargs)
d55e5bfc
RD
1497 self.this = newobj.this
1498 self.thisown = 1
1499 del newobj.thisown
1500 def GetFloor(*args, **kwargs):
fd2dc343
RD
1501 """
1502 GetFloor() -> (x,y)
1503
1504 Convert to integer
1505 """
5b5c9bc7 1506 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1507
1508 def GetRounded(*args, **kwargs):
fd2dc343
RD
1509 """
1510 GetRounded() -> (x,y)
1511
1512 Convert to integer
1513 """
5b5c9bc7 1514 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1515
1516 def GetVectorLength(*args, **kwargs):
1517 """GetVectorLength(self) -> double"""
5b5c9bc7 1518 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1519
1520 def GetVectorAngle(*args, **kwargs):
1521 """GetVectorAngle(self) -> double"""
5b5c9bc7 1522 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1523
1524 def SetVectorLength(*args, **kwargs):
1525 """SetVectorLength(self, double length)"""
5b5c9bc7 1526 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1527
1528 def SetVectorAngle(*args, **kwargs):
1529 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1530 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1531
1532 def SetPolarCoordinates(self, angle, length):
1533 self.SetVectorLength(length)
1534 self.SetVectorAngle(angle)
1535 def Normalize(self):
1536 self.SetVectorLength(1.0)
1537
1538 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1539 """GetDistance(self, Point2D pt) -> double"""
1540 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1541
1542 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1543 """GetDistanceSquare(self, Point2D pt) -> double"""
1544 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1545
1546 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1547 """GetDotProduct(self, Point2D vec) -> double"""
1548 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1549
1550 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1551 """GetCrossProduct(self, Point2D vec) -> double"""
1552 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1553
1554 def __neg__(*args, **kwargs):
1555 """
5b5c9bc7 1556 __neg__(self) -> Point2D
d55e5bfc
RD
1557
1558 the reflection of this point
1559 """
5b5c9bc7 1560 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1561
1562 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1563 """__iadd__(self, Point2D pt) -> Point2D"""
1564 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1565
1566 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1567 """__isub__(self, Point2D pt) -> Point2D"""
1568 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1569
1570 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1571 """__imul__(self, Point2D pt) -> Point2D"""
1572 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1573
1574 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1575 """__idiv__(self, Point2D pt) -> Point2D"""
1576 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1577
1578 def __eq__(*args, **kwargs):
1579 """
5b5c9bc7 1580 __eq__(self, Point2D pt) -> bool
d55e5bfc
RD
1581
1582 Test for equality
1583 """
5b5c9bc7 1584 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1585
1586 def __ne__(*args, **kwargs):
1587 """
5b5c9bc7 1588 __ne__(self, Point2D pt) -> bool
d55e5bfc
RD
1589
1590 Test for inequality
1591 """
5b5c9bc7 1592 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1593
5b5c9bc7
RD
1594 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1595 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1596 def Set(*args, **kwargs):
1597 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1598 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1599
1600 def Get(*args, **kwargs):
1601 """
1602 Get() -> (x,y)
1603
1604 Return x and y properties as a tuple.
1605 """
5b5c9bc7 1606 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1607
15817c7e 1608 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1609 def __str__(self): return str(self.Get())
1610 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1611 def __len__(self): return len(self.Get())
1612 def __getitem__(self, index): return self.Get()[index]
1613 def __setitem__(self, index, val):
1614 if index == 0: self.x = val
1615 elif index == 1: self.y = val
1616 else: raise IndexError
1617 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1618 __safe_for_unpickling__ = True
1619 def __reduce__(self): return (wx.Point2D, self.Get())
1620
1621
5b5c9bc7 1622class Point2DPtr(Point2D):
d55e5bfc
RD
1623 def __init__(self, this):
1624 self.this = this
1625 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1626 self.__class__ = Point2D
1627_core_.Point2D_swigregister(Point2DPtr)
d55e5bfc
RD
1628
1629def Point2DCopy(*args, **kwargs):
1630 """
5b5c9bc7 1631 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1632
1633 Create a w.Point2D object.
1634 """
5b5c9bc7 1635 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1636 val.thisown = 1
1637 return val
1638
1639def Point2DFromPoint(*args, **kwargs):
1640 """
5b5c9bc7 1641 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1642
1643 Create a w.Point2D object.
1644 """
5b5c9bc7 1645 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1646 val.thisown = 1
1647 return val
1648
1649#---------------------------------------------------------------------------
1650
5b5c9bc7
RD
1651FromStart = _core_.FromStart
1652FromCurrent = _core_.FromCurrent
1653FromEnd = _core_.FromEnd
d55e5bfc 1654class InputStream(object):
36ed4f51 1655 """Proxy of C++ InputStream class"""
d55e5bfc
RD
1656 def __repr__(self):
1657 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1658 def __init__(self, *args, **kwargs):
1659 """__init__(self, PyObject p) -> InputStream"""
5b5c9bc7 1660 newobj = _core_.new_InputStream(*args, **kwargs)
d55e5bfc
RD
1661 self.this = newobj.this
1662 self.thisown = 1
1663 del newobj.thisown
5b5c9bc7 1664 def __del__(self, destroy=_core_.delete_InputStream):
8fb0e70a
RD
1665 """__del__(self)"""
1666 try:
1667 if self.thisown: destroy(self)
1668 except: pass
1669
d55e5bfc
RD
1670 def close(*args, **kwargs):
1671 """close(self)"""
5b5c9bc7 1672 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1673
1674 def flush(*args, **kwargs):
1675 """flush(self)"""
5b5c9bc7 1676 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1677
1678 def eof(*args, **kwargs):
1679 """eof(self) -> bool"""
5b5c9bc7 1680 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1681
1682 def read(*args, **kwargs):
1683 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1684 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1685
1686 def readline(*args, **kwargs):
1687 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1688 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1689
1690 def readlines(*args, **kwargs):
1691 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1692 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1693
1694 def seek(*args, **kwargs):
1695 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1696 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1697
1698 def tell(*args, **kwargs):
1699 """tell(self) -> int"""
5b5c9bc7 1700 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1701
1702 def Peek(*args, **kwargs):
1703 """Peek(self) -> char"""
5b5c9bc7 1704 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1705
1706 def GetC(*args, **kwargs):
1707 """GetC(self) -> char"""
5b5c9bc7 1708 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1709
1710 def LastRead(*args, **kwargs):
1711 """LastRead(self) -> size_t"""
5b5c9bc7 1712 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1713
1714 def CanRead(*args, **kwargs):
1715 """CanRead(self) -> bool"""
5b5c9bc7 1716 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1717
1718 def Eof(*args, **kwargs):
1719 """Eof(self) -> bool"""
5b5c9bc7 1720 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1721
1722 def Ungetch(*args, **kwargs):
1723 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1724 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1725
1726 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1727 """SeekI(self, long pos, int mode=FromStart) -> long"""
1728 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1729
1730 def TellI(*args, **kwargs):
1731 """TellI(self) -> long"""
5b5c9bc7 1732 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc
RD
1733
1734
1735class InputStreamPtr(InputStream):
1736 def __init__(self, this):
1737 self.this = this
1738 if not hasattr(self,"thisown"): self.thisown = 0
1739 self.__class__ = InputStream
5b5c9bc7
RD
1740_core_.InputStream_swigregister(InputStreamPtr)
1741DefaultPosition = cvar.DefaultPosition
1742DefaultSize = cvar.DefaultSize
d55e5bfc 1743
5b5c9bc7
RD
1744class OutputStream(object):
1745 """Proxy of C++ OutputStream class"""
d55e5bfc
RD
1746 def __init__(self): raise RuntimeError, "No constructor defined"
1747 def __repr__(self):
1748 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1749 def write(*args, **kwargs):
1750 """write(self, PyObject obj)"""
5b5c9bc7 1751 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc
RD
1752
1753
5b5c9bc7 1754class OutputStreamPtr(OutputStream):
d55e5bfc
RD
1755 def __init__(self, this):
1756 self.this = this
1757 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1758 self.__class__ = OutputStream
1759_core_.OutputStream_swigregister(OutputStreamPtr)
d55e5bfc
RD
1760
1761#---------------------------------------------------------------------------
1762
5b5c9bc7
RD
1763class FSFile(Object):
1764 """Proxy of C++ FSFile class"""
d55e5bfc
RD
1765 def __repr__(self):
1766 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1767 def __init__(self, *args, **kwargs):
1768 """
5b5c9bc7
RD
1769 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1770 DateTime modif) -> FSFile
d55e5bfc 1771 """
5b5c9bc7 1772 newobj = _core_.new_FSFile(*args, **kwargs)
d55e5bfc
RD
1773 self.this = newobj.this
1774 self.thisown = 1
1775 del newobj.thisown
e2950dbb 1776 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1777
5b5c9bc7 1778 def __del__(self, destroy=_core_.delete_FSFile):
d55e5bfc
RD
1779 """__del__(self)"""
1780 try:
1781 if self.thisown: destroy(self)
1782 except: pass
1783
1784 def GetStream(*args, **kwargs):
5b5c9bc7
RD
1785 """GetStream(self) -> InputStream"""
1786 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc
RD
1787
1788 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1789 """GetMimeType(self) -> String"""
1790 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1791
1792 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
1793 """GetLocation(self) -> String"""
1794 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
1795
1796 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1797 """GetAnchor(self) -> String"""
1798 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1799
1800 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
1801 """GetModificationTime(self) -> DateTime"""
1802 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc
RD
1803
1804
5b5c9bc7 1805class FSFilePtr(FSFile):
d55e5bfc
RD
1806 def __init__(self, this):
1807 self.this = this
1808 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1809 self.__class__ = FSFile
1810_core_.FSFile_swigregister(FSFilePtr)
d55e5bfc
RD
1811
1812class CPPFileSystemHandler(object):
36ed4f51 1813 """Proxy of C++ CPPFileSystemHandler class"""
d55e5bfc
RD
1814 def __init__(self): raise RuntimeError, "No constructor defined"
1815 def __repr__(self):
1816 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1817
1818class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1819 def __init__(self, this):
1820 self.this = this
1821 if not hasattr(self,"thisown"): self.thisown = 0
1822 self.__class__ = CPPFileSystemHandler
5b5c9bc7 1823_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
d55e5bfc
RD
1824
1825class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1826 """Proxy of C++ FileSystemHandler class"""
d55e5bfc
RD
1827 def __repr__(self):
1828 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1829 def __init__(self, *args, **kwargs):
1830 """__init__(self) -> FileSystemHandler"""
5b5c9bc7 1831 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
d55e5bfc
RD
1832 self.this = newobj.this
1833 self.thisown = 1
1834 del newobj.thisown
1835 self._setCallbackInfo(self, FileSystemHandler)
1836
1837 def _setCallbackInfo(*args, **kwargs):
1838 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 1839 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
1840
1841 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1842 """CanOpen(self, String location) -> bool"""
1843 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1844
1845 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1846 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1847 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1848
1849 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1850 """FindFirst(self, String spec, int flags=0) -> String"""
1851 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1852
1853 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1854 """FindNext(self) -> String"""
1855 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1856
1857 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
1858 """GetProtocol(self, String location) -> String"""
1859 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
1860
1861 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
1862 """GetLeftLocation(self, String location) -> String"""
1863 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
1864
1865 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1866 """GetAnchor(self, String location) -> String"""
1867 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1868
1869 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
1870 """GetRightLocation(self, String location) -> String"""
1871 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
1872
1873 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
1874 """GetMimeTypeFromExt(self, String location) -> String"""
1875 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc
RD
1876
1877
1878class FileSystemHandlerPtr(FileSystemHandler):
1879 def __init__(self, this):
1880 self.this = this
1881 if not hasattr(self,"thisown"): self.thisown = 0
1882 self.__class__ = FileSystemHandler
5b5c9bc7 1883_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
d55e5bfc 1884
5b5c9bc7
RD
1885class FileSystem(Object):
1886 """Proxy of C++ FileSystem class"""
d55e5bfc
RD
1887 def __repr__(self):
1888 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1889 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1890 """__init__(self) -> FileSystem"""
1891 newobj = _core_.new_FileSystem(*args, **kwargs)
d55e5bfc
RD
1892 self.this = newobj.this
1893 self.thisown = 1
1894 del newobj.thisown
5b5c9bc7 1895 def __del__(self, destroy=_core_.delete_FileSystem):
d55e5bfc
RD
1896 """__del__(self)"""
1897 try:
1898 if self.thisown: destroy(self)
1899 except: pass
1900
1901 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
1902 """ChangePathTo(self, String location, bool is_dir=False)"""
1903 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
1904
1905 def GetPath(*args, **kwargs):
5b5c9bc7
RD
1906 """GetPath(self) -> String"""
1907 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
1908
1909 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1910 """OpenFile(self, String location) -> FSFile"""
1911 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
1912
1913 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1914 """FindFirst(self, String spec, int flags=0) -> String"""
1915 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
1916
1917 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1918 """FindNext(self) -> String"""
1919 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
1920
1921 def AddHandler(*args, **kwargs):
d6c14a4c 1922 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 1923 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
1924
1925 AddHandler = staticmethod(AddHandler)
1926 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1927 """CleanUpHandlers()"""
5b5c9bc7 1928 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
1929
1930 CleanUpHandlers = staticmethod(CleanUpHandlers)
1931 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
1932 """FileNameToURL(String filename) -> String"""
1933 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
1934
1935 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 1936 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
1937 """URLToFileName(String url) -> String"""
1938 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
1939
1940 URLToFileName = staticmethod(URLToFileName)
d55e5bfc 1941
5b5c9bc7 1942class FileSystemPtr(FileSystem):
d55e5bfc
RD
1943 def __init__(self, this):
1944 self.this = this
1945 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1946 self.__class__ = FileSystem
1947_core_.FileSystem_swigregister(FileSystemPtr)
d55e5bfc 1948
5b5c9bc7
RD
1949def FileSystem_AddHandler(*args, **kwargs):
1950 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1951 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1952
5b5c9bc7
RD
1953def FileSystem_CleanUpHandlers(*args, **kwargs):
1954 """FileSystem_CleanUpHandlers()"""
1955 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc 1956
5b5c9bc7
RD
1957def FileSystem_FileNameToURL(*args, **kwargs):
1958 """FileSystem_FileNameToURL(String filename) -> String"""
1959 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1960
5b5c9bc7
RD
1961def FileSystem_URLToFileName(*args, **kwargs):
1962 """FileSystem_URLToFileName(String url) -> String"""
1963 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1964
5b5c9bc7
RD
1965class InternetFSHandler(CPPFileSystemHandler):
1966 """Proxy of C++ InternetFSHandler class"""
d55e5bfc
RD
1967 def __repr__(self):
1968 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1969 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1970 """__init__(self) -> InternetFSHandler"""
1971 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
d55e5bfc
RD
1972 self.this = newobj.this
1973 self.thisown = 1
1974 del newobj.thisown
1975 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1976 """CanOpen(self, String location) -> bool"""
1977 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1978
1979 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1980 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1981 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1982
1983
5b5c9bc7 1984class InternetFSHandlerPtr(InternetFSHandler):
d55e5bfc
RD
1985 def __init__(self, this):
1986 self.this = this
1987 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1988 self.__class__ = InternetFSHandler
1989_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
d55e5bfc 1990
5b5c9bc7
RD
1991class ZipFSHandler(CPPFileSystemHandler):
1992 """Proxy of C++ ZipFSHandler class"""
d55e5bfc
RD
1993 def __repr__(self):
1994 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1995 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1996 """__init__(self) -> ZipFSHandler"""
1997 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
d55e5bfc
RD
1998 self.this = newobj.this
1999 self.thisown = 1
2000 del newobj.thisown
2001 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2002 """CanOpen(self, String location) -> bool"""
2003 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2004
2005 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2006 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2007 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2008
2009 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2010 """FindFirst(self, String spec, int flags=0) -> String"""
2011 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2012
2013 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2014 """FindNext(self) -> String"""
2015 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
2016
2017
5b5c9bc7 2018class ZipFSHandlerPtr(ZipFSHandler):
d55e5bfc
RD
2019 def __init__(self, this):
2020 self.this = this
2021 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2022 self.__class__ = ZipFSHandler
2023_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
d55e5bfc
RD
2024
2025
2026def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
5b5c9bc7
RD
2027 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2028 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
2029
2030def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
5b5c9bc7
RD
2031 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2032 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
2033
2034def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
5b5c9bc7
RD
2035 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2036 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
2037def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2038 """
2039 Add 'file' to the memory filesystem. The dataItem parameter can
2040 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2041 arbitrary data. If a bitmap or image is used then the imgType
2042 parameter should specify what kind of image file it should be
2043 written as, wx.BITMAP_TYPE_PNG, etc.
2044 """
2045 if isinstance(dataItem, wx.Image):
2046 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2047 elif isinstance(dataItem, wx.Bitmap):
2048 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2049 elif type(dataItem) == str:
2050 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2051 else:
2052 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc 2053
5b5c9bc7
RD
2054class MemoryFSHandler(CPPFileSystemHandler):
2055 """Proxy of C++ MemoryFSHandler class"""
d55e5bfc
RD
2056 def __repr__(self):
2057 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2058 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2059 """__init__(self) -> MemoryFSHandler"""
2060 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
d55e5bfc
RD
2061 self.this = newobj.this
2062 self.thisown = 1
2063 del newobj.thisown
2064 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
2065 """RemoveFile(String filename)"""
2066 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
2067
2068 RemoveFile = staticmethod(RemoveFile)
2069 AddFile = staticmethod(MemoryFSHandler_AddFile)
2070 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2071 """CanOpen(self, String location) -> bool"""
2072 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2073
2074 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2075 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2076 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2077
2078 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2079 """FindFirst(self, String spec, int flags=0) -> String"""
2080 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2081
2082 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2083 """FindNext(self) -> String"""
2084 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
2085
2086
5b5c9bc7 2087class MemoryFSHandlerPtr(MemoryFSHandler):
d55e5bfc
RD
2088 def __init__(self, this):
2089 self.this = this
2090 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2091 self.__class__ = MemoryFSHandler
2092_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
d55e5bfc 2093
5b5c9bc7
RD
2094def MemoryFSHandler_RemoveFile(*args, **kwargs):
2095 """MemoryFSHandler_RemoveFile(String filename)"""
2096 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 2097
5b5c9bc7
RD
2098IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2099IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2100IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
2101#---------------------------------------------------------------------------
2102
5b5c9bc7 2103class ImageHandler(Object):
27fb7603
RD
2104 """
2105 This is the base class for implementing image file loading/saving, and
2106 image creation from data. It is used within `wx.Image` and is not
2107 normally seen by the application.
2108 """
d55e5bfc
RD
2109 def __init__(self): raise RuntimeError, "No constructor defined"
2110 def __repr__(self):
2111 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2112 def GetName(*args, **kwargs):
5b5c9bc7
RD
2113 """GetName(self) -> String"""
2114 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
2115
2116 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
2117 """GetExtension(self) -> String"""
2118 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
2119
2120 def GetType(*args, **kwargs):
2121 """GetType(self) -> long"""
5b5c9bc7 2122 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
2123
2124 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
2125 """GetMimeType(self) -> String"""
2126 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
2127
2128 def CanRead(*args, **kwargs):
5b5c9bc7
RD
2129 """CanRead(self, String name) -> bool"""
2130 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc
RD
2131
2132 def SetName(*args, **kwargs):
5b5c9bc7
RD
2133 """SetName(self, String name)"""
2134 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
2135
2136 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2137 """SetExtension(self, String extension)"""
2138 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2139
2140 def SetType(*args, **kwargs):
2141 """SetType(self, long type)"""
5b5c9bc7 2142 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2143
2144 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2145 """SetMimeType(self, String mimetype)"""
2146 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc
RD
2147
2148
5b5c9bc7 2149class ImageHandlerPtr(ImageHandler):
d55e5bfc
RD
2150 def __init__(self, this):
2151 self.this = this
2152 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2153 self.__class__ = ImageHandler
2154_core_.ImageHandler_swigregister(ImageHandlerPtr)
d55e5bfc 2155
943e8dfd
RD
2156class PyImageHandler(ImageHandler):
2157 """
2158 This is the base class for implementing image file loading/saving, and
2159 image creation from data, all written in Python. To create a custom
2160 image handler derive a new class from wx.PyImageHandler and provide
2161 the following methods::
2162
2163 def DoCanRead(self, stream) --> bool
2164 '''Check if this handler can read the image on the stream'''
2165
2166 def LoadFile(self, image, stream, verbose, index) --> bool
2167 '''Load image data from the stream and load it into image.'''
2168
2169 def SaveFile(self, image, stream, verbose) --> bool
2170 '''Save the iamge data in image to the stream using
2171 this handler's image file format.'''
2172
2173 def GetImageCount(self, stream) --> int
2174 '''If this image format can hold more than one image,
2175 how many does the image on the stream have?'''
2176
2177 To activate your handler create an instance of it and pass it to
2178 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2179 `SetExtension` from your constructor.
2180
2181 """
2182 def __repr__(self):
2183 return "<%s.%s; proxy of C++ wxPyImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2184 def __init__(self, *args, **kwargs):
2185 """
2186 __init__(self) -> PyImageHandler
2187
2188 This is the base class for implementing image file loading/saving, and
2189 image creation from data, all written in Python. To create a custom
2190 image handler derive a new class from wx.PyImageHandler and provide
2191 the following methods::
2192
2193 def DoCanRead(self, stream) --> bool
2194 '''Check if this handler can read the image on the stream'''
2195
2196 def LoadFile(self, image, stream, verbose, index) --> bool
2197 '''Load image data from the stream and load it into image.'''
2198
2199 def SaveFile(self, image, stream, verbose) --> bool
2200 '''Save the iamge data in image to the stream using
2201 this handler's image file format.'''
2202
2203 def GetImageCount(self, stream) --> int
2204 '''If this image format can hold more than one image,
2205 how many does the image on the stream have?'''
2206
2207 To activate your handler create an instance of it and pass it to
2208 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2209 `SetExtension` from your constructor.
2210
2211 """
2212 newobj = _core_.new_PyImageHandler(*args, **kwargs)
2213 self.this = newobj.this
2214 self.thisown = 1
2215 del newobj.thisown
2216 self._SetSelf(self)
2217
2218 def _SetSelf(*args, **kwargs):
2219 """_SetSelf(self, PyObject self)"""
2220 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2221
2222
2223class PyImageHandlerPtr(PyImageHandler):
2224 def __init__(self, this):
2225 self.this = this
2226 if not hasattr(self,"thisown"): self.thisown = 0
2227 self.__class__ = PyImageHandler
2228_core_.PyImageHandler_swigregister(PyImageHandlerPtr)
2229
5b5c9bc7
RD
2230class ImageHistogram(object):
2231 """Proxy of C++ ImageHistogram class"""
d55e5bfc
RD
2232 def __repr__(self):
2233 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2234 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2235 """__init__(self) -> ImageHistogram"""
2236 newobj = _core_.new_ImageHistogram(*args, **kwargs)
d55e5bfc
RD
2237 self.this = newobj.this
2238 self.thisown = 1
2239 del newobj.thisown
2240 def MakeKey(*args, **kwargs):
2241 """
7a27cf7c 2242 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2243
2244 Get the key in the histogram for the given RGB values
2245 """
5b5c9bc7 2246 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2247
2248 MakeKey = staticmethod(MakeKey)
2249 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2250 """
2251 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2252
2253 Find first colour that is not used in the image and has higher RGB
2254 values than startR, startG, startB. Returns a tuple consisting of a
2255 success flag and rgb values.
2256 """
5b5c9bc7 2257 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2258
f1cbd8fa
RD
2259 def GetCount(*args, **kwargs):
2260 """
2261 GetCount(self, unsigned long key) -> unsigned long
2262
2263 Returns the pixel count for the given key. Use `MakeKey` to create a
2264 key value from a RGB tripple.
2265 """
5b5c9bc7 2266 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2267
2268 def GetCountRGB(*args, **kwargs):
2269 """
7a27cf7c 2270 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2271
2272 Returns the pixel count for the given RGB values.
2273 """
5b5c9bc7 2274 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2275
2276 def GetCountColour(*args, **kwargs):
2277 """
5b5c9bc7 2278 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2279
2280 Returns the pixel count for the given `wx.Colour` value.
2281 """
5b5c9bc7 2282 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2283
d55e5bfc 2284
5b5c9bc7 2285class ImageHistogramPtr(ImageHistogram):
d55e5bfc
RD
2286 def __init__(self, this):
2287 self.this = this
2288 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2289 self.__class__ = ImageHistogram
2290_core_.ImageHistogram_swigregister(ImageHistogramPtr)
d55e5bfc 2291
5b5c9bc7 2292def ImageHistogram_MakeKey(*args, **kwargs):
d55e5bfc 2293 """
7a27cf7c 2294 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2295
2296 Get the key in the histogram for the given RGB values
2297 """
5b5c9bc7 2298 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2299
943e8dfd
RD
2300class Image_RGBValue(object):
2301 """
2302 An object that contains values for red, green and blue which represent
2303 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2304 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2305 color space.
2306 """
2307 def __repr__(self):
2308 return "<%s.%s; proxy of C++ wxImage_RGBValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2309 def __init__(self, *args, **kwargs):
2310 """
2311 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2312
2313 Constructor.
2314 """
2315 newobj = _core_.new_Image_RGBValue(*args, **kwargs)
2316 self.this = newobj.this
2317 self.thisown = 1
2318 del newobj.thisown
2319 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2320 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2321 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2322
2323class Image_RGBValuePtr(Image_RGBValue):
2324 def __init__(self, this):
2325 self.this = this
2326 if not hasattr(self,"thisown"): self.thisown = 0
2327 self.__class__ = Image_RGBValue
2328_core_.Image_RGBValue_swigregister(Image_RGBValuePtr)
2329
2330class Image_HSVValue(object):
2331 """
2332 An object that contains values for hue, saturation and value which
2333 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2334 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2335 color space.
2336 """
2337 def __repr__(self):
2338 return "<%s.%s; proxy of C++ wxImage_HSVValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2339 def __init__(self, *args, **kwargs):
2340 """
2341 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2342
2343 Constructor.
2344 """
2345 newobj = _core_.new_Image_HSVValue(*args, **kwargs)
2346 self.this = newobj.this
2347 self.thisown = 1
2348 del newobj.thisown
2349 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2350 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2351 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2352
2353class Image_HSVValuePtr(Image_HSVValue):
2354 def __init__(self, this):
2355 self.this = this
2356 if not hasattr(self,"thisown"): self.thisown = 0
2357 self.__class__ = Image_HSVValue
2358_core_.Image_HSVValue_swigregister(Image_HSVValuePtr)
2359
5b5c9bc7 2360class Image(Object):
7a27cf7c
RD
2361 """
2362 A platform-independent image class. An image can be created from
2363 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2364 variety of formats. Functions are available to set and get image
2365 bits, so it can be used for basic image manipulation.
2366
2367 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2368 platform-specific `wx.Bitmap` object must be created from it using the
2369 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2370 device context, using `wx.DC.DrawBitmap`.
2371
2372 One colour value of the image may be used as a mask colour which will
2373 lead to the automatic creation of a `wx.Mask` object associated to the
2374 bitmap object.
2375
2376 wx.Image supports alpha channel data, that is in addition to a byte
2377 for the red, green and blue colour components for each pixel it also
2378 stores a byte representing the pixel opacity. An alpha value of 0
2379 corresponds to a transparent pixel (null opacity) while a value of 255
2380 means that the pixel is 100% opaque.
2381
2382 Unlike RGB data, not all images have an alpha channel and before using
2383 `GetAlpha` you should check if this image contains an alpha channel
2384 with `HasAlpha`. Note that currently only images loaded from PNG files
2385 with transparency information will have an alpha channel.
2386 """
d55e5bfc
RD
2387 def __repr__(self):
2388 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2389 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2390 """
2391 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2392
2393 Loads an image from a file.
2394 """
5b5c9bc7 2395 newobj = _core_.new_Image(*args, **kwargs)
d55e5bfc
RD
2396 self.this = newobj.this
2397 self.thisown = 1
2398 del newobj.thisown
5b5c9bc7 2399 def __del__(self, destroy=_core_.delete_Image):
d55e5bfc
RD
2400 """__del__(self)"""
2401 try:
2402 if self.thisown: destroy(self)
2403 except: pass
2404
2405 def Create(*args, **kwargs):
7a27cf7c
RD
2406 """
2407 Create(self, int width, int height, bool clear=True)
2408
2409 Creates a fresh image. If clear is ``True``, the new image will be
2410 initialized to black. Otherwise, the image data will be uninitialized.
2411 """
5b5c9bc7 2412 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2413
2414 def Destroy(*args, **kwargs):
2415 """
2416 Destroy(self)
2417
7a27cf7c 2418 Destroys the image data.
d55e5bfc 2419 """
7e08d4ef
RD
2420 val = _core_.Image_Destroy(*args, **kwargs)
2421 args[0].thisown = 0
2422 return val
d55e5bfc
RD
2423
2424 def Scale(*args, **kwargs):
7a27cf7c
RD
2425 """
2426 Scale(self, int width, int height) -> Image
2427
2428 Returns a scaled version of the image. This is also useful for scaling
2429 bitmaps in general as the only other way to scale bitmaps is to blit a
2430 `wx.MemoryDC` into another `wx.MemoryDC`.
2431 """
5b5c9bc7 2432 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc
RD
2433
2434 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2435 """
2436 ShrinkBy(self, int xFactor, int yFactor) -> Image
2437
2438 Return a version of the image scaled smaller by the given factors.
2439 """
5b5c9bc7 2440 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
2441
2442 def Rescale(*args, **kwargs):
7a27cf7c
RD
2443 """
2444 Rescale(self, int width, int height) -> Image
2445
2446 Changes the size of the image in-place by scaling it: after a call to
2447 this function, the image will have the given width and height.
2448
2449 Returns the (modified) image itself.
2450 """
5b5c9bc7 2451 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 2452
aff4cc5c 2453 def Resize(*args, **kwargs):
7a27cf7c
RD
2454 """
2455 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2456
2457 Changes the size of the image in-place without scaling it, by adding
2458 either a border with the given colour or cropping as necessary. The
2459 image is pasted into a new image with the given size and background
2460 colour at the position pos relative to the upper left of the new
2461 image. If red = green = blue = -1 then use either the current mask
2462 colour if set or find, use, and set a suitable mask colour for any
2463 newly exposed areas.
2464
2465 Returns the (modified) image itself.
2466 """
5b5c9bc7 2467 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 2468
d55e5bfc 2469 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2470 """
2471 SetRGB(self, int x, int y, byte r, byte g, byte b)
2472
2473 Sets the pixel at the given coordinate. This routine performs
2474 bounds-checks for the coordinate so it can be considered a safe way to
2475 manipulate the data, but in some cases this might be too slow so that
2476 the data will have to be set directly. In that case you will have to
2477 get access to the image data using the `GetData` method.
2478 """
5b5c9bc7 2479 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 2480
aff4cc5c 2481 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2482 """
2483 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2484
2485 Sets the colour of the pixels within the given rectangle. This routine
2486 performs bounds-checks for the rectangle so it can be considered a
2487 safe way to manipulate the data.
2488 """
5b5c9bc7 2489 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 2490
d55e5bfc 2491 def GetRed(*args, **kwargs):
7a27cf7c
RD
2492 """
2493 GetRed(self, int x, int y) -> byte
2494
2495 Returns the red intensity at the given coordinate.
2496 """
5b5c9bc7 2497 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
2498
2499 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2500 """
2501 GetGreen(self, int x, int y) -> byte
2502
2503 Returns the green intensity at the given coordinate.
2504 """
5b5c9bc7 2505 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
2506
2507 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2508 """
2509 GetBlue(self, int x, int y) -> byte
2510
2511 Returns the blue intensity at the given coordinate.
2512 """
5b5c9bc7 2513 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
2514
2515 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2516 """
2517 SetAlpha(self, int x, int y, byte alpha)
2518
2519 Sets the alpha value for the given pixel. This function should only be
2520 called if the image has alpha channel data, use `HasAlpha` to check
2521 for this.
2522 """
5b5c9bc7 2523 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
2524
2525 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2526 """
2527 GetAlpha(self, int x, int y) -> byte
2528
2529 Returns the alpha value for the given pixel. This function may only be
2530 called for the images with alpha channel, use `HasAlpha` to check for
2531 this.
2532
2533 The returned value is the *opacity* of the image, i.e. the value of 0
2534 corresponds to the fully transparent pixels while the value of 255 to
2535 the fully opaque pixels.
2536 """
5b5c9bc7 2537 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
2538
2539 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2540 """
2541 HasAlpha(self) -> bool
2542
2543 Returns true if this image has alpha channel, false otherwise.
2544 """
5b5c9bc7 2545 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 2546
68350608
RD
2547 def InitAlpha(*args, **kwargs):
2548 """
2549 InitAlpha(self)
2550
2551 Initializes the image alpha channel data. It is an error to call it if
2552 the image already has alpha data. If it doesn't, alpha data will be by
2553 default initialized to all pixels being fully opaque. But if the image
2554 has a a mask colour, all mask pixels will be completely transparent.
2555 """
5b5c9bc7
RD
2556 return _core_.Image_InitAlpha(*args, **kwargs)
2557
2558 def IsTransparent(*args, **kwargs):
2559 """
7a27cf7c 2560 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2561
7a27cf7c
RD
2562 Returns ``True`` if this pixel is masked or has an alpha value less
2563 than the spcified threshold.
5b5c9bc7
RD
2564 """
2565 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2566
d55e5bfc 2567 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2568 """
2569 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2570
2571 Find first colour that is not used in the image and has higher RGB
2572 values than startR, startG, startB. Returns a tuple consisting of a
2573 success flag and rgb values.
2574 """
5b5c9bc7 2575 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2576
4cf4100f
RD
2577 def ConvertAlphaToMask(*args, **kwargs):
2578 """
5b5c9bc7 2579 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2580
7a27cf7c
RD
2581 If the image has alpha channel, this method converts it to mask. All
2582 pixels with alpha value less than ``threshold`` are replaced with the
2583 mask colour and the alpha channel is removed. The mask colour is
2584 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2585
2586 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2587 nothing.
2588 """
5b5c9bc7 2589 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 2590
8fb0e70a
RD
2591 def ConvertColourToAlpha(*args, **kwargs):
2592 """
7a27cf7c 2593 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2594
2595 This method converts an image where the original alpha information is
2596 only available as a shades of a colour (actually shades of grey)
2597 typically when you draw anti-aliased text into a bitmap. The DC
2598 drawing routines draw grey values on the black background although
2599 they actually mean to draw white with differnt alpha values. This
2600 method reverses it, assuming a black (!) background and white text.
2601 The method will then fill up the whole image with the colour given.
2602 """
5b5c9bc7 2603 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 2604
d55e5bfc 2605 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2606 """
2607 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2608
2609 Sets the image's mask so that the pixels that have RGB value of
2610 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2611 by first finding an unused colour in the image, setting this colour as
2612 the mask colour and then using this colour to draw all pixels in the
2613 image who corresponding pixel in mask has given RGB value.
2614
2615 Returns ``False`` if ``mask`` does not have same dimensions as the
2616 image or if there is no unused colour left. Returns ``True`` if the
2617 mask was successfully applied.
2618
2619 Note that this method involves computing the histogram, which is
2620 computationally intensive operation.
2621 """
5b5c9bc7 2622 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
2623
2624 def CanRead(*args, **kwargs):
7a27cf7c
RD
2625 """
2626 CanRead(String filename) -> bool
2627
2628 Returns True if the image handlers can read this file.
2629 """
5b5c9bc7 2630 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2631
2632 CanRead = staticmethod(CanRead)
2633 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2634 """
2635 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2636
2637 If the image file contains more than one image and the image handler
2638 is capable of retrieving these individually, this function will return
2639 the number of available images.
2640 """
5b5c9bc7 2641 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2642
2643 GetImageCount = staticmethod(GetImageCount)
2644 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2645 """
2646 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2647
2648 Loads an image from a file. If no handler type is provided, the
2649 library will try to autodetect the format.
2650 """
5b5c9bc7 2651 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
2652
2653 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2654 """
2655 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2656
2657 Loads an image from a file, specifying the image type with a MIME type
2658 string.
2659 """
5b5c9bc7 2660 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
2661
2662 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2663 """
2664 SaveFile(self, String name, int type) -> bool
2665
2666 Saves an image in the named file.
2667 """
5b5c9bc7 2668 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
2669
2670 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2671 """
2672 SaveMimeFile(self, String name, String mimetype) -> bool
2673
2674 Saves an image in the named file.
2675 """
5b5c9bc7 2676 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
2677
2678 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2679 """
2680 CanReadStream(InputStream stream) -> bool
2681
2682 Returns True if the image handlers can read an image file from the
2683 data currently on the input stream, or a readable Python file-like
2684 object.
2685 """
5b5c9bc7 2686 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2687
2688 CanReadStream = staticmethod(CanReadStream)
2689 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2690 """
2691 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2692
2693 Loads an image from an input stream or a readable Python file-like
2694 object. If no handler type is provided, the library will try to
2695 autodetect the format.
2696 """
5b5c9bc7 2697 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
2698
2699 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2700 """
2701 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2702
2703 Loads an image from an input stream or a readable Python file-like
2704 object, using a MIME type string to specify the image file format.
2705 """
5b5c9bc7 2706 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc
RD
2707
2708 def Ok(*args, **kwargs):
7a27cf7c
RD
2709 """
2710 Ok(self) -> bool
2711
2712 Returns true if image data is present.
2713 """
5b5c9bc7 2714 return _core_.Image_Ok(*args, **kwargs)
d55e5bfc
RD
2715
2716 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2717 """
2718 GetWidth(self) -> int
2719
2720 Gets the width of the image in pixels.
2721 """
5b5c9bc7 2722 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2723
2724 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2725 """
2726 GetHeight(self) -> int
2727
2728 Gets the height of the image in pixels.
2729 """
5b5c9bc7 2730 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2731
2732 def GetSize(*args, **kwargs):
7a27cf7c
RD
2733 """
2734 GetSize(self) -> Size
2735
2736 Returns the size of the image in pixels.
2737 """
5b5c9bc7 2738 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2739
2740 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2741 """
2742 GetSubImage(self, Rect rect) -> Image
2743
2744 Returns a sub image of the current one as long as the rect belongs
2745 entirely to the image.
2746 """
5b5c9bc7 2747 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2748
aff4cc5c 2749 def Size(*args, **kwargs):
7a27cf7c
RD
2750 """
2751 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2752
2753 Returns a resized version of this image without scaling it by adding
2754 either a border with the given colour or cropping as necessary. The
2755 image is pasted into a new image with the given size and background
2756 colour at the position ``pos`` relative to the upper left of the new
2757 image. If red = green = blue = -1 then use either the current mask
2758 colour if set or find, use, and set a suitable mask colour for any
2759 newly exposed areas.
2760 """
5b5c9bc7 2761 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2762
d55e5bfc 2763 def Copy(*args, **kwargs):
7a27cf7c
RD
2764 """
2765 Copy(self) -> Image
2766
2767 Returns an identical copy of the image.
2768 """
5b5c9bc7 2769 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2770
2771 def Paste(*args, **kwargs):
7a27cf7c
RD
2772 """
2773 Paste(self, Image image, int x, int y)
2774
2775 Pastes ``image`` into this instance and takes care of the mask colour
2776 and any out of bounds problems.
2777 """
5b5c9bc7 2778 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2779
2780 def GetData(*args, **kwargs):
bb2ef2cc
RD
2781 """
2782 GetData(self) -> PyObject
2783
2784 Returns a string containing a copy of the RGB bytes of the image.
2785 """
5b5c9bc7 2786 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2787
2788 def SetData(*args, **kwargs):
bb2ef2cc
RD
2789 """
2790 SetData(self, buffer data)
2791
2792 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2793 either a string or a buffer object holding the data and the length of
2794 the data must be width*height*3.
2795 """
5b5c9bc7 2796 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2797
2798 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2799 """
2800 GetDataBuffer(self) -> PyObject
2801
2802 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2803 image data buffer inside the wx.Image. You need to ensure that you do
2804 not use this buffer object after the image has been destroyed.
bb2ef2cc 2805 """
5b5c9bc7 2806 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2807
2808 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2809 """
2810 SetDataBuffer(self, buffer data)
2811
2812 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2813 object. This can save making an extra copy of the data but you must
2814 ensure that the buffer object lives longer than the wx.Image does.
bb2ef2cc 2815 """
5b5c9bc7 2816 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2817
2818 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2819 """
2820 GetAlphaData(self) -> PyObject
2821
2822 Returns a string containing a copy of the alpha bytes of the image.
2823 """
5b5c9bc7 2824 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2825
2826 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2827 """
2828 SetAlphaData(self, buffer alpha)
2829
2830 Resets the Image's alpha data from a buffer of bytes. Accepts either
2831 a string or a buffer object holding the data and the length of the
2832 data must be width*height.
2833 """
5b5c9bc7 2834 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2835
2836 def GetAlphaBuffer(*args, **kwargs):
2837 """GetAlphaBuffer(self) -> PyObject"""
5b5c9bc7 2838 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2839
2840 def SetAlphaBuffer(*args, **kwargs):
bb2ef2cc 2841 """SetAlphaBuffer(self, buffer alpha)"""
5b5c9bc7 2842 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2843
2844 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2845 """
2846 SetMaskColour(self, byte r, byte g, byte b)
2847
2848 Sets the mask colour for this image (and tells the image to use the
2849 mask).
2850 """
5b5c9bc7 2851 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 2852
aff4cc5c
RD
2853 def GetOrFindMaskColour(*args, **kwargs):
2854 """
2855 GetOrFindMaskColour() -> (r,g,b)
2856
2857 Get the current mask colour or find a suitable colour.
2858 """
5b5c9bc7 2859 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2860
d55e5bfc 2861 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2862 """
2863 GetMaskRed(self) -> byte
2864
2865 Gets the red component of the mask colour.
2866 """
5b5c9bc7 2867 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
2868
2869 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2870 """
2871 GetMaskGreen(self) -> byte
2872
2873 Gets the green component of the mask colour.
2874 """
5b5c9bc7 2875 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
2876
2877 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2878 """
2879 GetMaskBlue(self) -> byte
2880
2881 Gets the blue component of the mask colour.
2882 """
5b5c9bc7 2883 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
2884
2885 def SetMask(*args, **kwargs):
7a27cf7c
RD
2886 """
2887 SetMask(self, bool mask=True)
2888
2889 Specifies whether there is a mask or not. The area of the mask is
2890 determined by the current mask colour.
2891 """
5b5c9bc7 2892 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
2893
2894 def HasMask(*args, **kwargs):
7a27cf7c
RD
2895 """
2896 HasMask(self) -> bool
2897
2898 Returns ``True`` if there is a mask active, ``False`` otherwise.
2899 """
5b5c9bc7 2900 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2901
2902 def Rotate(*args, **kwargs):
2903 """
5b5c9bc7
RD
2904 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2905 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2906
2907 Rotates the image about the given point, by ``angle`` radians. Passing
2908 ``True`` to ``interpolating`` results in better image quality, but is
2909 slower. If the image has a mask, then the mask colour is used for the
2910 uncovered pixels in the rotated image background. Otherwise, black
2911 will be used as the fill colour.
2912
2913 Returns the rotated image, leaving this image intact.
d55e5bfc 2914 """
5b5c9bc7 2915 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
2916
2917 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2918 """
2919 Rotate90(self, bool clockwise=True) -> Image
2920
2921 Returns a copy of the image rotated 90 degrees in the direction
2922 indicated by ``clockwise``.
2923 """
5b5c9bc7 2924 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
2925
2926 def Mirror(*args, **kwargs):
7a27cf7c
RD
2927 """
2928 Mirror(self, bool horizontally=True) -> Image
2929
2930 Returns a mirrored copy of the image. The parameter ``horizontally``
2931 indicates the orientation.
2932 """
5b5c9bc7 2933 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2934
2935 def Replace(*args, **kwargs):
2936 """
7a27cf7c
RD
2937 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2938
2939 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2940 ``(r2,g2,b2)``.
d55e5bfc 2941 """
5b5c9bc7 2942 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 2943
32fe5131
RD
2944 def ConvertToGreyscale(*args, **kwargs):
2945 """
2946 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2947
2948 Convert to greyscale image. Uses the luminance component (Y) of the
2949 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2950 defaults to ITU-T BT.601
2951 """
2952 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2953
d55e5bfc 2954 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2955 """
2956 ConvertToMono(self, byte r, byte g, byte b) -> Image
2957
2958 Returns monochromatic version of the image. The returned image has
2959 white colour where the original has ``(r,g,b)`` colour and black
2960 colour everywhere else.
2961 """
5b5c9bc7 2962 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2963
2964 def SetOption(*args, **kwargs):
7a27cf7c
RD
2965 """
2966 SetOption(self, String name, String value)
2967
2968 Sets an image handler defined option. For example, when saving as a
2969 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2970 number between 0 and 100 (0 is terrible, 100 is very good).
2971 """
5b5c9bc7 2972 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2973
2974 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2975 """
2976 SetOptionInt(self, String name, int value)
2977
2978 Sets an image option as an integer.
2979 """
5b5c9bc7 2980 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2981
2982 def GetOption(*args, **kwargs):
7a27cf7c
RD
2983 """
2984 GetOption(self, String name) -> String
2985
2986 Gets the value of an image handler option.
2987 """
5b5c9bc7 2988 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2989
2990 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2991 """
2992 GetOptionInt(self, String name) -> int
2993
2994 Gets the value of an image handler option as an integer. If the given
2995 option is not present, the function returns 0.
2996 """
5b5c9bc7 2997 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2998
2999 def HasOption(*args, **kwargs):
7a27cf7c
RD
3000 """
3001 HasOption(self, String name) -> bool
3002
3003 Returns true if the given option is present.
3004 """
5b5c9bc7 3005 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
3006
3007 def CountColours(*args, **kwargs):
3008 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 3009 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
3010
3011 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
3012 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3013 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
3014
3015 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
3016 """AddHandler(ImageHandler handler)"""
3017 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
3018
3019 AddHandler = staticmethod(AddHandler)
3020 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
3021 """InsertHandler(ImageHandler handler)"""
3022 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
3023
3024 InsertHandler = staticmethod(InsertHandler)
3025 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
3026 """RemoveHandler(String name) -> bool"""
3027 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
3028
3029 RemoveHandler = staticmethod(RemoveHandler)
3030 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3031 """
3032 GetImageExtWildcard() -> String
3033
3034 Iterates all registered wxImageHandler objects, and returns a string
3035 containing file extension masks suitable for passing to file open/save
3036 dialog boxes.
3037 """
5b5c9bc7 3038 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
3039
3040 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3041 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
3042 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3043 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
3044
3045 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3046 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 3047 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 3048
943e8dfd
RD
3049 def RotateHue(*args, **kwargs):
3050 """
3051 RotateHue(self, double angle)
3052
3053 Rotates the hue of each pixel of the image. Hue is a double in the
3054 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3055 """
3056 return _core_.Image_RotateHue(*args, **kwargs)
3057
3058 def RGBtoHSV(*args, **kwargs):
3059 """
3060 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3061
3062 Converts a color in RGB color space to HSV color space.
3063 """
3064 return _core_.Image_RGBtoHSV(*args, **kwargs)
3065
3066 RGBtoHSV = staticmethod(RGBtoHSV)
3067 def HSVtoRGB(*args, **kwargs):
3068 """
3069 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3070
3071 Converts a color in HSV color space to RGB color space.
3072 """
3073 return _core_.Image_HSVtoRGB(*args, **kwargs)
3074
3075 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc
RD
3076 def __nonzero__(self): return self.Ok()
3077
5b5c9bc7 3078class ImagePtr(Image):
d55e5bfc
RD
3079 def __init__(self, this):
3080 self.this = this
3081 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3082 self.__class__ = Image
3083_core_.Image_swigregister(ImagePtr)
d55e5bfc
RD
3084
3085def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3086 """
3087 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3088
3089 Loads an image from a file, using a MIME type string (such as
3090 'image/jpeg') to specify image type.
3091 """
5b5c9bc7 3092 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
3093 val.thisown = 1
3094 return val
3095
3096def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3097 """
3098 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3099
3100 Loads an image from an input stream, or any readable Python file-like
3101 object.
3102 """
5b5c9bc7 3103 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
3104 val.thisown = 1
3105 return val
3106
3107def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3108 """
3109 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3110
3111 Loads an image from an input stream, or any readable Python file-like
3112 object, specifying the image format with a MIME type string.
3113 """
5b5c9bc7 3114 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
3115 val.thisown = 1
3116 return val
3117
d6c14a4c 3118def EmptyImage(*args, **kwargs):
bb2ef2cc 3119 """
5b5c9bc7 3120 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
3121
3122 Construct an empty image of a given size, optionally setting all
3123 pixels to black.
3124 """
5b5c9bc7 3125 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
3126 val.thisown = 1
3127 return val
3128
3129def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 3130 """
5b5c9bc7 3131 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
3132
3133 Construct an Image from a `wx.Bitmap`.
3134 """
5b5c9bc7 3135 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
3136 val.thisown = 1
3137 return val
3138
3139def ImageFromData(*args, **kwargs):
bb2ef2cc 3140 """
5b5c9bc7 3141 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
3142
3143 Construct an Image from a buffer of RGB bytes. Accepts either a
3144 string or a buffer object holding the data and the length of the data
3145 must be width*height*3.
3146 """
5b5c9bc7 3147 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
3148 val.thisown = 1
3149 return val
3150
03e46024 3151def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 3152 """
5b5c9bc7 3153 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
3154
3155 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3156 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3157 length of the data must be width*height*3 bytes, and the length of the
3158 alpha data must be width*height bytes.
bb2ef2cc 3159 """
5b5c9bc7 3160 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
3161 val.thisown = 1
3162 return val
3163
5b5c9bc7 3164def Image_CanRead(*args, **kwargs):
7a27cf7c
RD
3165 """
3166 Image_CanRead(String filename) -> bool
3167
3168 Returns True if the image handlers can read this file.
3169 """
5b5c9bc7 3170 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 3171
5b5c9bc7 3172def Image_GetImageCount(*args, **kwargs):
7a27cf7c
RD
3173 """
3174 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3175
3176 If the image file contains more than one image and the image handler
3177 is capable of retrieving these individually, this function will return
3178 the number of available images.
3179 """
5b5c9bc7 3180 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 3181
5b5c9bc7 3182def Image_CanReadStream(*args, **kwargs):
7a27cf7c
RD
3183 """
3184 Image_CanReadStream(InputStream stream) -> bool
3185
3186 Returns True if the image handlers can read an image file from the
3187 data currently on the input stream, or a readable Python file-like
3188 object.
3189 """
5b5c9bc7 3190 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 3191
5b5c9bc7
RD
3192def Image_AddHandler(*args, **kwargs):
3193 """Image_AddHandler(ImageHandler handler)"""
3194 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 3195
5b5c9bc7
RD
3196def Image_InsertHandler(*args, **kwargs):
3197 """Image_InsertHandler(ImageHandler handler)"""
3198 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 3199
5b5c9bc7
RD
3200def Image_RemoveHandler(*args, **kwargs):
3201 """Image_RemoveHandler(String name) -> bool"""
3202 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3203
5b5c9bc7 3204def Image_GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3205 """
3206 Image_GetImageExtWildcard() -> String
3207
3208 Iterates all registered wxImageHandler objects, and returns a string
3209 containing file extension masks suitable for passing to file open/save
3210 dialog boxes.
3211 """
5b5c9bc7 3212 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc 3213
943e8dfd
RD
3214def Image_RGBtoHSV(*args, **kwargs):
3215 """
3216 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3217
3218 Converts a color in RGB color space to HSV color space.
3219 """
3220 return _core_.Image_RGBtoHSV(*args, **kwargs)
3221
3222def Image_HSVtoRGB(*args, **kwargs):
3223 """
3224 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3225
3226 Converts a color in HSV color space to RGB color space.
3227 """
3228 return _core_.Image_HSVtoRGB(*args, **kwargs)
3229
68e533f8
RD
3230def InitAllImageHandlers():
3231 """
3232 The former functionality of InitAllImageHanders is now done internal to
3233 the _core_ extension module and so this function has become a simple NOP.
3234 """
3235 pass
d55e5bfc 3236
5b5c9bc7
RD
3237IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3238IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3239PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3240PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3241PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3242BMP_24BPP = _core_.BMP_24BPP
3243BMP_8BPP = _core_.BMP_8BPP
3244BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3245BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3246BMP_8BPP_RED = _core_.BMP_8BPP_RED
3247BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3248BMP_4BPP = _core_.BMP_4BPP
3249BMP_1BPP = _core_.BMP_1BPP
3250BMP_1BPP_BW = _core_.BMP_1BPP_BW
3251class BMPHandler(ImageHandler):
27fb7603 3252 """A `wx.ImageHandler` for \*.bmp bitmap files."""
d55e5bfc
RD
3253 def __repr__(self):
3254 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3255 def __init__(self, *args, **kwargs):
27fb7603
RD
3256 """
3257 __init__(self) -> BMPHandler
3258
3259 A `wx.ImageHandler` for \*.bmp bitmap files.
3260 """
5b5c9bc7 3261 newobj = _core_.new_BMPHandler(*args, **kwargs)
d55e5bfc
RD
3262 self.this = newobj.this
3263 self.thisown = 1
3264 del newobj.thisown
3265
5b5c9bc7 3266class BMPHandlerPtr(BMPHandler):
d55e5bfc
RD
3267 def __init__(self, this):
3268 self.this = this
3269 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3270 self.__class__ = BMPHandler
3271_core_.BMPHandler_swigregister(BMPHandlerPtr)
3272NullImage = cvar.NullImage
68350608 3273IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3274IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3275IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3276IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3277IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3278IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3279IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3280IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3281IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3282IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3283IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3284IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3285IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3286IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3287IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3288
5b5c9bc7 3289class ICOHandler(BMPHandler):
27fb7603 3290 """A `wx.ImageHandler` for \*.ico icon files."""
d55e5bfc
RD
3291 def __repr__(self):
3292 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3293 def __init__(self, *args, **kwargs):
27fb7603
RD
3294 """
3295 __init__(self) -> ICOHandler
3296
3297 A `wx.ImageHandler` for \*.ico icon files.
3298 """
5b5c9bc7 3299 newobj = _core_.new_ICOHandler(*args, **kwargs)
d55e5bfc
RD
3300 self.this = newobj.this
3301 self.thisown = 1
3302 del newobj.thisown
3303
5b5c9bc7 3304class ICOHandlerPtr(ICOHandler):
d55e5bfc
RD
3305 def __init__(self, this):
3306 self.this = this
3307 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3308 self.__class__ = ICOHandler
3309_core_.ICOHandler_swigregister(ICOHandlerPtr)
d55e5bfc 3310
5b5c9bc7 3311class CURHandler(ICOHandler):
27fb7603 3312 """A `wx.ImageHandler` for \*.cur cursor files."""
d55e5bfc
RD
3313 def __repr__(self):
3314 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3315 def __init__(self, *args, **kwargs):
27fb7603
RD
3316 """
3317 __init__(self) -> CURHandler
3318
3319 A `wx.ImageHandler` for \*.cur cursor files.
3320 """
5b5c9bc7 3321 newobj = _core_.new_CURHandler(*args, **kwargs)
d55e5bfc
RD
3322 self.this = newobj.this
3323 self.thisown = 1
3324 del newobj.thisown
3325
5b5c9bc7 3326class CURHandlerPtr(CURHandler):
d55e5bfc
RD
3327 def __init__(self, this):
3328 self.this = this
3329 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3330 self.__class__ = CURHandler
3331_core_.CURHandler_swigregister(CURHandlerPtr)
d55e5bfc 3332
5b5c9bc7 3333class ANIHandler(CURHandler):
27fb7603 3334 """A `wx.ImageHandler` for \*.ani animated cursor files."""
d55e5bfc
RD
3335 def __repr__(self):
3336 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3337 def __init__(self, *args, **kwargs):
27fb7603
RD
3338 """
3339 __init__(self) -> ANIHandler
3340
3341 A `wx.ImageHandler` for \*.ani animated cursor files.
3342 """
5b5c9bc7 3343 newobj = _core_.new_ANIHandler(*args, **kwargs)
d55e5bfc
RD
3344 self.this = newobj.this
3345 self.thisown = 1
3346 del newobj.thisown
3347
5b5c9bc7 3348class ANIHandlerPtr(ANIHandler):
d55e5bfc
RD
3349 def __init__(self, this):
3350 self.this = this
3351 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3352 self.__class__ = ANIHandler
3353_core_.ANIHandler_swigregister(ANIHandlerPtr)
d55e5bfc 3354
5b5c9bc7 3355class PNGHandler(ImageHandler):
27fb7603 3356 """A `wx.ImageHandler` for PNG image files."""
d55e5bfc
RD
3357 def __repr__(self):
3358 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3359 def __init__(self, *args, **kwargs):
27fb7603
RD
3360 """
3361 __init__(self) -> PNGHandler
3362
3363 A `wx.ImageHandler` for PNG image files.
3364 """
5b5c9bc7 3365 newobj = _core_.new_PNGHandler(*args, **kwargs)
d55e5bfc
RD
3366 self.this = newobj.this
3367 self.thisown = 1
3368 del newobj.thisown
3369
5b5c9bc7 3370class PNGHandlerPtr(PNGHandler):
d55e5bfc
RD
3371 def __init__(self, this):
3372 self.this = this
3373 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3374 self.__class__ = PNGHandler
3375_core_.PNGHandler_swigregister(PNGHandlerPtr)
d55e5bfc 3376
5b5c9bc7 3377class GIFHandler(ImageHandler):
27fb7603 3378 """A `wx.ImageHandler` for GIF image files."""
d55e5bfc
RD
3379 def __repr__(self):
3380 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3381 def __init__(self, *args, **kwargs):
27fb7603
RD
3382 """
3383 __init__(self) -> GIFHandler
3384
3385 A `wx.ImageHandler` for GIF image files.
3386 """
5b5c9bc7 3387 newobj = _core_.new_GIFHandler(*args, **kwargs)
d55e5bfc
RD
3388 self.this = newobj.this
3389 self.thisown = 1
3390 del newobj.thisown
3391
5b5c9bc7 3392class GIFHandlerPtr(GIFHandler):
d55e5bfc
RD
3393 def __init__(self, this):
3394 self.this = this
3395 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3396 self.__class__ = GIFHandler
3397_core_.GIFHandler_swigregister(GIFHandlerPtr)
d55e5bfc 3398
5b5c9bc7 3399class PCXHandler(ImageHandler):
27fb7603 3400 """A `wx.ImageHandler` for PCX imager files."""
d55e5bfc
RD
3401 def __repr__(self):
3402 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3403 def __init__(self, *args, **kwargs):
27fb7603
RD
3404 """
3405 __init__(self) -> PCXHandler
3406
3407 A `wx.ImageHandler` for PCX imager files.
3408 """
5b5c9bc7 3409 newobj = _core_.new_PCXHandler(*args, **kwargs)
d55e5bfc
RD
3410 self.this = newobj.this
3411 self.thisown = 1
3412 del newobj.thisown
3413
5b5c9bc7 3414class PCXHandlerPtr(PCXHandler):
d55e5bfc
RD
3415 def __init__(self, this):
3416 self.this = this
3417 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3418 self.__class__ = PCXHandler
3419_core_.PCXHandler_swigregister(PCXHandlerPtr)
d55e5bfc 3420
5b5c9bc7 3421class JPEGHandler(ImageHandler):
27fb7603 3422 """A `wx.ImageHandler` for JPEG/JPG image files."""
d55e5bfc
RD
3423 def __repr__(self):
3424 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3425 def __init__(self, *args, **kwargs):
27fb7603
RD
3426 """
3427 __init__(self) -> JPEGHandler
3428
3429 A `wx.ImageHandler` for JPEG/JPG image files.
3430 """
5b5c9bc7 3431 newobj = _core_.new_JPEGHandler(*args, **kwargs)
d55e5bfc
RD
3432 self.this = newobj.this
3433 self.thisown = 1
3434 del newobj.thisown
3435
5b5c9bc7 3436class JPEGHandlerPtr(JPEGHandler):
d55e5bfc
RD
3437 def __init__(self, this):
3438 self.this = this
3439 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3440 self.__class__ = JPEGHandler
3441_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
d55e5bfc 3442
5b5c9bc7 3443class PNMHandler(ImageHandler):
27fb7603 3444 """A `wx.ImageHandler` for PNM image files."""
d55e5bfc
RD
3445 def __repr__(self):
3446 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3447 def __init__(self, *args, **kwargs):
27fb7603
RD
3448 """
3449 __init__(self) -> PNMHandler
3450
3451 A `wx.ImageHandler` for PNM image files.
3452 """
5b5c9bc7 3453 newobj = _core_.new_PNMHandler(*args, **kwargs)
d55e5bfc
RD
3454 self.this = newobj.this
3455 self.thisown = 1
3456 del newobj.thisown
3457
5b5c9bc7 3458class PNMHandlerPtr(PNMHandler):
d55e5bfc
RD
3459 def __init__(self, this):
3460 self.this = this
3461 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3462 self.__class__ = PNMHandler
3463_core_.PNMHandler_swigregister(PNMHandlerPtr)
d55e5bfc 3464
5b5c9bc7 3465class XPMHandler(ImageHandler):
27fb7603 3466 """A `wx.ImageHandler` for XPM image."""
d55e5bfc
RD
3467 def __repr__(self):
3468 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3469 def __init__(self, *args, **kwargs):
27fb7603
RD
3470 """
3471 __init__(self) -> XPMHandler
3472
3473 A `wx.ImageHandler` for XPM image.
3474 """
5b5c9bc7 3475 newobj = _core_.new_XPMHandler(*args, **kwargs)
d55e5bfc
RD
3476 self.this = newobj.this
3477 self.thisown = 1
3478 del newobj.thisown
3479
5b5c9bc7 3480class XPMHandlerPtr(XPMHandler):
d55e5bfc
RD
3481 def __init__(self, this):
3482 self.this = this
3483 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3484 self.__class__ = XPMHandler
3485_core_.XPMHandler_swigregister(XPMHandlerPtr)
d55e5bfc 3486
5b5c9bc7 3487class TIFFHandler(ImageHandler):
27fb7603 3488 """A `wx.ImageHandler` for TIFF image files."""
d55e5bfc
RD
3489 def __repr__(self):
3490 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3491 def __init__(self, *args, **kwargs):
27fb7603
RD
3492 """
3493 __init__(self) -> TIFFHandler
3494
3495 A `wx.ImageHandler` for TIFF image files.
3496 """
5b5c9bc7 3497 newobj = _core_.new_TIFFHandler(*args, **kwargs)
d55e5bfc
RD
3498 self.this = newobj.this
3499 self.thisown = 1
3500 del newobj.thisown
3501
5b5c9bc7 3502class TIFFHandlerPtr(TIFFHandler):
d55e5bfc
RD
3503 def __init__(self, this):
3504 self.this = this
3505 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3506 self.__class__ = TIFFHandler
3507_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
d55e5bfc 3508
5b5c9bc7
RD
3509QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3510QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3511class Quantize(object):
c0de73ae
RD
3512 """Performs quantization, or colour reduction, on a wxImage."""
3513 def __init__(self): raise RuntimeError, "No constructor defined"
3514 def __repr__(self):
3515 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3516 def Quantize(*args, **kwargs):
3517 """
5b5c9bc7 3518 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3519
3520 Reduce the colours in the source image and put the result into the
3521 destination image, setting the palette in the destination if
3522 needed. Both images may be the same, to overwrite the source image.
3523 """
5b5c9bc7 3524 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3525
3526 Quantize = staticmethod(Quantize)
3527
5b5c9bc7 3528class QuantizePtr(Quantize):
c0de73ae
RD
3529 def __init__(self, this):
3530 self.this = this
3531 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3532 self.__class__ = Quantize
3533_core_.Quantize_swigregister(QuantizePtr)
c0de73ae 3534
5b5c9bc7 3535def Quantize_Quantize(*args, **kwargs):
c0de73ae 3536 """
5b5c9bc7 3537 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3538
3539 Reduce the colours in the source image and put the result into the
3540 destination image, setting the palette in the destination if
3541 needed. Both images may be the same, to overwrite the source image.
3542 """
5b5c9bc7 3543 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3544
d55e5bfc
RD
3545#---------------------------------------------------------------------------
3546
5b5c9bc7
RD
3547class EvtHandler(Object):
3548 """Proxy of C++ EvtHandler class"""
d55e5bfc
RD
3549 def __repr__(self):
3550 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3551 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3552 """__init__(self) -> EvtHandler"""
3553 newobj = _core_.new_EvtHandler(*args, **kwargs)
d55e5bfc
RD
3554 self.this = newobj.this
3555 self.thisown = 1
3556 del newobj.thisown
3557 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3558 """GetNextHandler(self) -> EvtHandler"""
3559 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3560
3561 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3562 """GetPreviousHandler(self) -> EvtHandler"""
3563 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3564
3565 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3566 """SetNextHandler(self, EvtHandler handler)"""
3567 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3568
3569 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3570 """SetPreviousHandler(self, EvtHandler handler)"""
3571 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3572
3573 def GetEvtHandlerEnabled(*args, **kwargs):
3574 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3575 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3576
3577 def SetEvtHandlerEnabled(*args, **kwargs):
3578 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3579 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3580
3581 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3582 """ProcessEvent(self, Event event) -> bool"""
3583 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3584
3585 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3586 """AddPendingEvent(self, Event event)"""
3587 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3588
3589 def ProcessPendingEvents(*args, **kwargs):
3590 """ProcessPendingEvents(self)"""
5b5c9bc7 3591 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3592
3593 def Connect(*args, **kwargs):
3594 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3595 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3596
3597 def Disconnect(*args, **kwargs):
3598 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3599 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3600
3601 def _setOORInfo(*args, **kwargs):
36ed4f51 3602 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3603 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3604 args[0].thisown = 0
3605 return val
d55e5bfc
RD
3606
3607 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3608 """
3609 Bind an event to an event handler.
3610
a5ee0656
RD
3611 :param event: One of the EVT_* objects that specifies the
3612 type of event to bind,
d55e5bfc 3613
a5ee0656
RD
3614 :param handler: A callable object to be invoked when the
3615 event is delivered to self. Pass None to
3616 disconnect an event handler.
d55e5bfc 3617
a5ee0656
RD
3618 :param source: Sometimes the event originates from a
3619 different window than self, but you still
3620 want to catch it in self. (For example, a
3621 button event delivered to a frame.) By
3622 passing the source of the event, the event
3623 handling system is able to differentiate
3624 between the same event type from different
3625 controls.
d55e5bfc 3626
a5ee0656
RD
3627 :param id: Used to spcify the event source by ID instead
3628 of instance.
3629
3630 :param id2: Used when it is desirable to bind a handler
3631 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3632 """
3633 if source is not None:
3634 id = source.GetId()
3635 event.Bind(self, id, id2, handler)
3636
d6c14a4c
RD
3637 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3638 """
3639 Disconencts the event handler binding for event from self.
3640 Returns True if successful.
3641 """
3642 if source is not None:
3643 id = source.GetId()
3644 return event.Unbind(self, id, id2)
d55e5bfc
RD
3645
3646
5b5c9bc7 3647class EvtHandlerPtr(EvtHandler):
d55e5bfc
RD
3648 def __init__(self, this):
3649 self.this = this
3650 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3651 self.__class__ = EvtHandler
3652_core_.EvtHandler_swigregister(EvtHandlerPtr)
d55e5bfc
RD
3653
3654#---------------------------------------------------------------------------
3655
3656class PyEventBinder(object):
3657 """
3658 Instances of this class are used to bind specific events to event
3659 handlers.
3660 """
3661 def __init__(self, evtType, expectedIDs=0):
3662 if expectedIDs not in [0, 1, 2]:
3663 raise ValueError, "Invalid number of expectedIDs"
3664 self.expectedIDs = expectedIDs
3665
3666 if type(evtType) == list or type(evtType) == tuple:
3667 self.evtType = evtType
3668 else:
3669 self.evtType = [evtType]
3670
3671
3672 def Bind(self, target, id1, id2, function):
3673 """Bind this set of event types to target."""
3674 for et in self.evtType:
3675 target.Connect(id1, id2, et, function)
3676
d6c14a4c
RD
3677
3678 def Unbind(self, target, id1, id2):
3679 """Remove an event binding."""
3680 success = 0
3681 for et in self.evtType:
3682 success += target.Disconnect(id1, id2, et)
3683 return success != 0
3684
d55e5bfc
RD
3685
3686 def __call__(self, *args):
3687 """
3688 For backwards compatibility with the old EVT_* functions.
3689 Should be called with either (window, func), (window, ID,
3690 func) or (window, ID1, ID2, func) parameters depending on the
3691 type of the event.
3692 """
3693 assert len(args) == 2 + self.expectedIDs
3694 id1 = wx.ID_ANY
3695 id2 = wx.ID_ANY
3696 target = args[0]
3697 if self.expectedIDs == 0:
3698 func = args[1]
3699 elif self.expectedIDs == 1:
3700 id1 = args[1]
3701 func = args[2]
3702 elif self.expectedIDs == 2:
3703 id1 = args[1]
3704 id2 = args[2]
3705 func = args[3]
3706 else:
3707 raise ValueError, "Unexpected number of IDs"
3708
3709 self.Bind(target, id1, id2, func)
3710
3711
3712# These two are square pegs that don't fit the PyEventBinder hole...
3713def EVT_COMMAND(win, id, cmd, func):
3714 win.Connect(id, -1, cmd, func)
3715def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3716 win.Connect(id1, id2, cmd, func)
3717
3718
3719#---------------------------------------------------------------------------
3720
3721#---------------------------------------------------------------------------
3722
5b5c9bc7
RD
3723EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3724EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3725
3726def NewEventType(*args, **kwargs):
3727 """NewEventType() -> wxEventType"""
3728 return _core_.NewEventType(*args, **kwargs)
3729wxEVT_NULL = _core_.wxEVT_NULL
3730wxEVT_FIRST = _core_.wxEVT_FIRST
3731wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3732wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3733wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3734wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3735wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3736wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3737wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3738wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3739wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3740wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3741wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3742wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3743wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3744wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3745wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3746wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3747wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3748wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3749wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3750wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3751wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3752wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3753wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3754wxEVT_MOTION = _core_.wxEVT_MOTION
3755wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3756wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3757wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3758wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3759wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3760wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3761wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3762wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3763wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3764wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3765wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3766wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3767wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3768wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3769wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3770wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3771wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3772wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3773wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3774wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3775wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3776wxEVT_CHAR = _core_.wxEVT_CHAR
3777wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3778wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3779wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3780wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3781wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3782wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3783wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3784wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3785wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3786wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3787wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3788wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3789wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3790wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3791wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3792wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
RD
3793wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3794wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3795wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3796wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3797wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3798wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3799wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3800wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3801wxEVT_SIZE = _core_.wxEVT_SIZE
3802wxEVT_MOVE = _core_.wxEVT_MOVE
3803wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3804wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3805wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3806wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3807wxEVT_POWER = _core_.wxEVT_POWER
3808wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3809wxEVT_CREATE = _core_.wxEVT_CREATE
3810wxEVT_DESTROY = _core_.wxEVT_DESTROY
3811wxEVT_SHOW = _core_.wxEVT_SHOW
3812wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3813wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3814wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3815wxEVT_PAINT = _core_.wxEVT_PAINT
3816wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3817wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3818wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3819wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3820wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3821wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3822wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3823wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3824wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3825wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3826wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3827wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3828wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3829wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3830wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3831wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3832wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3833wxEVT_IDLE = _core_.wxEVT_IDLE
3834wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3835wxEVT_SIZING = _core_.wxEVT_SIZING
3836wxEVT_MOVING = _core_.wxEVT_MOVING
3837wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3838wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3839wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3840wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3841wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3842wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3843wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3844wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3845#
3846# Create some event binders
3847EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3848EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3849EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3850EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3851EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3852EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3853EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3854EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3855EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3856EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3857EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3858EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3859EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3860EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3861EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3862EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3863EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3864EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3865EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3866EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3867EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3868EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3869EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3870EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3871EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3872EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3873EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3874EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3875EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3876EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3877EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3878EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3879EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3880EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3881EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3882EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3883EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3884EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3885EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3886EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3887EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3888
3889EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3890EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3891EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3892EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3893EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3894EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3895EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3896EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3897EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3898EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3899EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3900EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3901EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3902
3903EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3904 wxEVT_LEFT_UP,
3905 wxEVT_MIDDLE_DOWN,
3906 wxEVT_MIDDLE_UP,
3907 wxEVT_RIGHT_DOWN,
3908 wxEVT_RIGHT_UP,
3909 wxEVT_MOTION,
3910 wxEVT_LEFT_DCLICK,
3911 wxEVT_MIDDLE_DCLICK,
3912 wxEVT_RIGHT_DCLICK,
3913 wxEVT_ENTER_WINDOW,
3914 wxEVT_LEAVE_WINDOW,
3915 wxEVT_MOUSEWHEEL
3916 ])
3917
3918
3919# Scrolling from wxWindow (sent to wxScrolledWindow)
3920EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3921 wxEVT_SCROLLWIN_BOTTOM,
3922 wxEVT_SCROLLWIN_LINEUP,
3923 wxEVT_SCROLLWIN_LINEDOWN,
3924 wxEVT_SCROLLWIN_PAGEUP,
3925 wxEVT_SCROLLWIN_PAGEDOWN,
3926 wxEVT_SCROLLWIN_THUMBTRACK,
3927 wxEVT_SCROLLWIN_THUMBRELEASE,
3928 ])
3929
3930EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3931EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3932EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3933EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3934EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3935EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3936EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3937EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3938
27fb7603 3939# Scrolling from wx.Slider and wx.ScrollBar
d55e5bfc
RD
3940EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3941 wxEVT_SCROLL_BOTTOM,
3942 wxEVT_SCROLL_LINEUP,
3943 wxEVT_SCROLL_LINEDOWN,
3944 wxEVT_SCROLL_PAGEUP,
3945 wxEVT_SCROLL_PAGEDOWN,
3946 wxEVT_SCROLL_THUMBTRACK,
3947 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3948 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3949 ])
3950
3951EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3952EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3953EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3954EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3955EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3956EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3957EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3958EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3959EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3960EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3961
27fb7603 3962# Scrolling from wx.Slider and wx.ScrollBar, with an id
d55e5bfc
RD
3963EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3964 wxEVT_SCROLL_BOTTOM,
3965 wxEVT_SCROLL_LINEUP,
3966 wxEVT_SCROLL_LINEDOWN,
3967 wxEVT_SCROLL_PAGEUP,
3968 wxEVT_SCROLL_PAGEDOWN,
3969 wxEVT_SCROLL_THUMBTRACK,
3970 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3971 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3972 ], 1)
3973
3974EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3975EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3976EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3977EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3978EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3979EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3980EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3981EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3982EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3983EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3984
3985EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3986EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3987EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3988EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3989EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3990EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3991EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3992EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3993EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3994EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3995
3996EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3997EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3998EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3999EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
4000EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
4001EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
4002EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
4003EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
4004EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
4005
4006
4007EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
4008EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
4009EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
4010EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
4011EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
4012EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
4013EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
4014
4015EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4016
4017EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4018EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4019
4020EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4021
4022
4023
4024#---------------------------------------------------------------------------
4025
5b5c9bc7 4026class Event(Object):
27fb7603
RD
4027 """
4028 An event is a structure holding information about an event passed to a
4029 callback or member function. wx.Event is an abstract base class for
4030 other event classes
4031 """
d55e5bfc
RD
4032 def __init__(self): raise RuntimeError, "No constructor defined"
4033 def __repr__(self):
4034 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7 4035 def __del__(self, destroy=_core_.delete_Event):
d55e5bfc
RD
4036 """__del__(self)"""
4037 try:
4038 if self.thisown: destroy(self)
4039 except: pass
4040
4041 def SetEventType(*args, **kwargs):
27fb7603
RD
4042 """
4043 SetEventType(self, wxEventType typ)
4044
4045 Sets the specific type of the event.
4046 """
5b5c9bc7 4047 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
4048
4049 def GetEventType(*args, **kwargs):
27fb7603
RD
4050 """
4051 GetEventType(self) -> wxEventType
4052
4053 Returns the identifier of the given event type, such as
4054 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4055 """
5b5c9bc7 4056 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
4057
4058 def GetEventObject(*args, **kwargs):
27fb7603
RD
4059 """
4060 GetEventObject(self) -> Object
4061
4062 Returns the object (usually a window) associated with the event, if
4063 any.
4064 """
5b5c9bc7 4065 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
4066
4067 def SetEventObject(*args, **kwargs):
27fb7603
RD
4068 """
4069 SetEventObject(self, Object obj)
4070
4071 Sets the originating object, or in other words, obj is normally the
4072 object that is sending the event.
4073 """
5b5c9bc7 4074 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
4075
4076 def GetTimestamp(*args, **kwargs):
4077 """GetTimestamp(self) -> long"""
5b5c9bc7 4078 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
4079
4080 def SetTimestamp(*args, **kwargs):
4081 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 4082 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
4083
4084 def GetId(*args, **kwargs):
27fb7603
RD
4085 """
4086 GetId(self) -> int
4087
4088 Returns the identifier associated with this event, such as a button
4089 command id.
4090 """
5b5c9bc7 4091 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
4092
4093 def SetId(*args, **kwargs):
27fb7603
RD
4094 """
4095 SetId(self, int Id)
4096
4097 Set's the ID for the event. This is usually the ID of the window that
4098 is sending the event, but it can also be a command id from a menu
4099 item, etc.
4100 """
5b5c9bc7 4101 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
4102
4103 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4104 """
4105 IsCommandEvent(self) -> bool
4106
4107 Returns true if the event is or is derived from `wx.CommandEvent` else
4108 it returns false. Note: Exists only for optimization purposes.
4109 """
5b5c9bc7 4110 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
4111
4112 def Skip(*args, **kwargs):
51b83b37
RD
4113 """
4114 Skip(self, bool skip=True)
4115
4116 Called by an event handler, it controls whether additional event
4117 handlers bound to this event will be called after the current event
4118 handler returns. Skip(false) (the default setting) will prevent
4119 additional event handlers from being called and control will be
4120 returned to the sender of the event immediately after the current
4121 handler has finished. Skip(True) will cause the event processing
4122 system to continue searching for a handler function for this event.
4123
4124 """
5b5c9bc7 4125 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
4126
4127 def GetSkipped(*args, **kwargs):
27fb7603
RD
4128 """
4129 GetSkipped(self) -> bool
4130
4131 Returns true if the event handler should be skipped, false otherwise.
4132 :see: `Skip`
4133 """
5b5c9bc7 4134 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
4135
4136 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4137 """
4138 ShouldPropagate(self) -> bool
4139
4140 Test if this event should be propagated to the parent window or not,
4141 i.e. if the propagation level is currently greater than 0.
4142 """
5b5c9bc7 4143 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
4144
4145 def StopPropagation(*args, **kwargs):
27fb7603
RD
4146 """
4147 StopPropagation(self) -> int
4148
4149 Stop the event from propagating to its parent window. Returns the old
4150 propagation level value which may be later passed to
4151 `ResumePropagation` to allow propagating the event again.
4152 """
5b5c9bc7 4153 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
4154
4155 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4156 """
4157 ResumePropagation(self, int propagationLevel)
4158
4159 Resume the event propagation by restoring the propagation level. (For
4160 example, you can use the value returned by an earlier call to
4161 `StopPropagation`.)
4162
4163 """
5b5c9bc7 4164 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
4165
4166 def Clone(*args, **kwargs):
5b5c9bc7
RD
4167 """Clone(self) -> Event"""
4168 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc
RD
4169
4170
5b5c9bc7 4171class EventPtr(Event):
d55e5bfc
RD
4172 def __init__(self, this):
4173 self.this = this
4174 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4175 self.__class__ = Event
4176_core_.Event_swigregister(EventPtr)
d55e5bfc
RD
4177
4178#---------------------------------------------------------------------------
4179
5b5c9bc7 4180class PropagationDisabler(object):
27fb7603
RD
4181 """
4182 Helper class to temporarily change an event not to propagate. Simply
4183 create an instance of this class and then whe it is destroyed the
4184 propogation of the event will be restored.
4185 """
d55e5bfc
RD
4186 def __repr__(self):
4187 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4188 def __init__(self, *args, **kwargs):
27fb7603
RD
4189 """
4190 __init__(self, Event event) -> PropagationDisabler
4191
4192 Helper class to temporarily change an event not to propagate. Simply
4193 create an instance of this class and then whe it is destroyed the
4194 propogation of the event will be restored.
4195 """
5b5c9bc7 4196 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
d55e5bfc
RD
4197 self.this = newobj.this
4198 self.thisown = 1
4199 del newobj.thisown
5b5c9bc7 4200 def __del__(self, destroy=_core_.delete_PropagationDisabler):
d55e5bfc
RD
4201 """__del__(self)"""
4202 try:
4203 if self.thisown: destroy(self)
4204 except: pass
4205
4206
5b5c9bc7 4207class PropagationDisablerPtr(PropagationDisabler):
d55e5bfc
RD
4208 def __init__(self, this):
4209 self.this = this
4210 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4211 self.__class__ = PropagationDisabler
4212_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
d55e5bfc 4213
5b5c9bc7 4214class PropagateOnce(object):
27fb7603
RD
4215 """
4216 A helper class that will temporarily lower propagation level of an
4217 event. Simply create an instance of this class and then whe it is
4218 destroyed the propogation of the event will be restored.
4219 """
d55e5bfc
RD
4220 def __repr__(self):
4221 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4222 def __init__(self, *args, **kwargs):
27fb7603
RD
4223 """
4224 __init__(self, Event event) -> PropagateOnce
4225
4226 A helper class that will temporarily lower propagation level of an
4227 event. Simply create an instance of this class and then whe it is
4228 destroyed the propogation of the event will be restored.
4229 """
5b5c9bc7 4230 newobj = _core_.new_PropagateOnce(*args, **kwargs)
d55e5bfc
RD
4231 self.this = newobj.this
4232 self.thisown = 1
4233 del newobj.thisown
5b5c9bc7 4234 def __del__(self, destroy=_core_.delete_PropagateOnce):
d55e5bfc
RD
4235 """__del__(self)"""
4236 try:
4237 if self.thisown: destroy(self)
4238 except: pass
4239
4240
5b5c9bc7 4241class PropagateOncePtr(PropagateOnce):
d55e5bfc
RD
4242 def __init__(self, this):
4243 self.this = this
4244 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4245 self.__class__ = PropagateOnce
4246_core_.PropagateOnce_swigregister(PropagateOncePtr)
d55e5bfc
RD
4247
4248#---------------------------------------------------------------------------
4249
5b5c9bc7 4250class CommandEvent(Event):
27fb7603
RD
4251 """
4252 This event class contains information about command events, which
4253 originate from a variety of simple controls, as well as menus and
4254 toolbars.
4255 """
d55e5bfc
RD
4256 def __repr__(self):
4257 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4258 def __init__(self, *args, **kwargs):
27fb7603
RD
4259 """
4260 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4261
4262 This event class contains information about command events, which
4263 originate from a variety of simple controls, as well as menus and
4264 toolbars.
4265 """
5b5c9bc7 4266 newobj = _core_.new_CommandEvent(*args, **kwargs)
d55e5bfc
RD
4267 self.this = newobj.this
4268 self.thisown = 1
4269 del newobj.thisown
4270 def GetSelection(*args, **kwargs):
27fb7603
RD
4271 """
4272 GetSelection(self) -> int
4273
4274 Returns item index for a listbox or choice selection event (not valid
4275 for a deselection).
4276 """
5b5c9bc7 4277 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
4278
4279 def SetString(*args, **kwargs):
5b5c9bc7
RD
4280 """SetString(self, String s)"""
4281 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
4282
4283 def GetString(*args, **kwargs):
27fb7603
RD
4284 """
4285 GetString(self) -> String
4286
4287 Returns item string for a listbox or choice selection event (not valid
4288 for a deselection).
4289 """
5b5c9bc7 4290 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
4291
4292 def IsChecked(*args, **kwargs):
27fb7603
RD
4293 """
4294 IsChecked(self) -> bool
4295
4296 This method can be used with checkbox and menu events: for the
4297 checkboxes, the method returns true for a selection event and false
4298 for a deselection one. For the menu events, this method indicates if
4299 the menu item just has become checked or unchecked (and thus only
4300 makes sense for checkable menu items).
4301 """
5b5c9bc7 4302 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
4303
4304 Checked = IsChecked
4305 def IsSelection(*args, **kwargs):
27fb7603
RD
4306 """
4307 IsSelection(self) -> bool
4308
4309 For a listbox or similar event, returns true if it is a selection,
4310 false if it is a deselection.
4311 """
5b5c9bc7 4312 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
4313
4314 def SetExtraLong(*args, **kwargs):
4315 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 4316 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
4317
4318 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4319 """
4320 GetExtraLong(self) -> long
4321
5ba5649b
RD
4322 Returns extra information dependant on the event objects type. If the
4323 event comes from a listbox selection, it is a boolean determining
4324 whether the event was a selection (true) or a deselection (false). A
4325 listbox deselection only occurs for multiple-selection boxes, and in
4326 this case the index and string values are indeterminate and the
4327 listbox must be examined by the application.
27fb7603 4328 """
5b5c9bc7 4329 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
4330
4331 def SetInt(*args, **kwargs):
4332 """SetInt(self, int i)"""
5b5c9bc7 4333 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
4334
4335 def GetInt(*args, **kwargs):
27fb7603
RD
4336 """
4337 GetInt(self) -> long
4338
5ba5649b
RD
4339 Returns the integer identifier corresponding to a listbox, choice or
4340 radiobox selection (only if the event was a selection, not a
4341 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4342 """
5b5c9bc7 4343 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc
RD
4344
4345 def Clone(*args, **kwargs):
5b5c9bc7
RD
4346 """Clone(self) -> Event"""
4347 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc
RD
4348
4349
5b5c9bc7 4350class CommandEventPtr(CommandEvent):
d55e5bfc
RD
4351 def __init__(self, this):
4352 self.this = this
4353 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4354 self.__class__ = CommandEvent
4355_core_.CommandEvent_swigregister(CommandEventPtr)
d55e5bfc
RD
4356
4357#---------------------------------------------------------------------------
4358
5b5c9bc7 4359class NotifyEvent(CommandEvent):
27fb7603
RD
4360 """
4361 An instance of this class (or one of its derived classes) is sent from
4362 a control when the control's state is being changed and the control
4363 allows that change to be prevented from happening. The event handler
4364 can call `Veto` or `Allow` to tell the control what to do.
4365 """
d55e5bfc
RD
4366 def __repr__(self):
4367 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4368 def __init__(self, *args, **kwargs):
27fb7603
RD
4369 """
4370 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4371
4372 An instance of this class (or one of its derived classes) is sent from
4373 a control when the control's state is being changed and the control
4374 allows that change to be prevented from happening. The event handler
4375 can call `Veto` or `Allow` to tell the control what to do.
4376 """
5b5c9bc7 4377 newobj = _core_.new_NotifyEvent(*args, **kwargs)
d55e5bfc
RD
4378 self.this = newobj.this
4379 self.thisown = 1
4380 del newobj.thisown
4381 def Veto(*args, **kwargs):
27fb7603
RD
4382 """
4383 Veto(self)
4384
4385 Prevents the change announced by this event from happening.
4386
4387 It is in general a good idea to notify the user about the reasons for
4388 vetoing the change because otherwise the applications behaviour (which
4389 just refuses to do what the user wants) might be quite surprising.
4390 """
5b5c9bc7 4391 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4392
4393 def Allow(*args, **kwargs):
27fb7603
RD
4394 """
4395 Allow(self)
4396
4397 This is the opposite of `Veto`: it explicitly allows the event to be
4398 processed. For most events it is not necessary to call this method as
4399 the events are allowed anyhow but some are forbidden by default (this
4400 will be mentioned in the corresponding event description).
4401 """
5b5c9bc7 4402 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4403
4404 def IsAllowed(*args, **kwargs):
27fb7603
RD
4405 """
4406 IsAllowed(self) -> bool
4407
4408 Returns true if the change is allowed (`Veto` hasn't been called) or
4409 false otherwise (if it was).
4410 """
5b5c9bc7 4411 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc
RD
4412
4413
5b5c9bc7 4414class NotifyEventPtr(NotifyEvent):
d55e5bfc
RD
4415 def __init__(self, this):
4416 self.this = this
4417 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4418 self.__class__ = NotifyEvent
4419_core_.NotifyEvent_swigregister(NotifyEventPtr)
d55e5bfc
RD
4420
4421#---------------------------------------------------------------------------
4422
5b5c9bc7 4423class ScrollEvent(CommandEvent):
27fb7603
RD
4424 """
4425 A scroll event holds information about events sent from stand-alone
4426 scrollbars and sliders. Note that scrolled windows do not send
4427 instnaces of this event class, but send the `wx.ScrollWinEvent`
4428 instead.
4429 """
d55e5bfc
RD
4430 def __repr__(self):
4431 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4432 def __init__(self, *args, **kwargs):
4433 """
4434 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4435 int orient=0) -> ScrollEvent
d55e5bfc 4436 """
5b5c9bc7 4437 newobj = _core_.new_ScrollEvent(*args, **kwargs)
d55e5bfc
RD
4438 self.this = newobj.this
4439 self.thisown = 1
4440 del newobj.thisown
4441 def GetOrientation(*args, **kwargs):
27fb7603
RD
4442 """
4443 GetOrientation(self) -> int
4444
4445 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4446 the scrollbar.
4447 """
5b5c9bc7 4448 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4449
4450 def GetPosition(*args, **kwargs):
27fb7603
RD
4451 """
4452 GetPosition(self) -> int
4453
4454 Returns the position of the scrollbar.
4455 """
5b5c9bc7 4456 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4457
4458 def SetOrientation(*args, **kwargs):
4459 """SetOrientation(self, int orient)"""
5b5c9bc7 4460 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4461
4462 def SetPosition(*args, **kwargs):
4463 """SetPosition(self, int pos)"""
5b5c9bc7 4464 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
4465
4466
5b5c9bc7 4467class ScrollEventPtr(ScrollEvent):
d55e5bfc
RD
4468 def __init__(self, this):
4469 self.this = this
4470 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4471 self.__class__ = ScrollEvent
4472_core_.ScrollEvent_swigregister(ScrollEventPtr)
d55e5bfc
RD
4473
4474#---------------------------------------------------------------------------
4475
5b5c9bc7 4476class ScrollWinEvent(Event):
27fb7603
RD
4477 """
4478 A wx.ScrollWinEvent holds information about scrolling and is sent from
4479 scrolling windows.
4480 """
d55e5bfc
RD
4481 def __repr__(self):
4482 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4483 def __init__(self, *args, **kwargs):
27fb7603
RD
4484 """
4485 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4486
4487 A wx.ScrollWinEvent holds information about scrolling and is sent from
4488 scrolling windows.
4489 """
5b5c9bc7 4490 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
d55e5bfc
RD
4491 self.this = newobj.this
4492 self.thisown = 1
4493 del newobj.thisown
4494 def GetOrientation(*args, **kwargs):
27fb7603
RD
4495 """
4496 GetOrientation(self) -> int
4497
4498 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4499 the scrollbar.
4500 """
5b5c9bc7 4501 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4502
4503 def GetPosition(*args, **kwargs):
27fb7603
RD
4504 """
4505 GetPosition(self) -> int
4506
4507 Returns the position of the scrollbar for the thumb track and release
4508 events. Note that this field can't be used for the other events, you
4509 need to query the window itself for the current position in that case.
4510 """
5b5c9bc7 4511 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4512
4513 def SetOrientation(*args, **kwargs):
4514 """SetOrientation(self, int orient)"""
5b5c9bc7 4515 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4516
4517 def SetPosition(*args, **kwargs):
4518 """SetPosition(self, int pos)"""
5b5c9bc7 4519 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
4520
4521
5b5c9bc7 4522class ScrollWinEventPtr(ScrollWinEvent):
d55e5bfc
RD
4523 def __init__(self, this):
4524 self.this = this
4525 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4526 self.__class__ = ScrollWinEvent
4527_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
d55e5bfc
RD
4528
4529#---------------------------------------------------------------------------
4530
5b5c9bc7
RD
4531MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4532MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4533MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4534MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4535MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4536class MouseEvent(Event):
27fb7603
RD
4537 """
4538 This event class contains information about the events generated by
4539 the mouse: they include mouse buttons press and release events and
4540 mouse move events.
4541
4542 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4543 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4544 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4545 a middle button so a portable application should avoid relying on the
4546 events from it.
4547
4548 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4549 the former returns true when the event corresponds to the left mouse
4550 button click while the latter returns true if the left mouse button is
4551 currently being pressed. For example, when the user is dragging the
4552 mouse you can use `LeftIsDown` to test whether the left mouse button
4553 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4554 `LeftIsDown` will also return true in wxWidgets whatever the
4555 underlying GUI behaviour is (which is platform-dependent). The same
4556 applies, of course, to other mouse buttons as well.
4557 """
d55e5bfc
RD
4558 def __repr__(self):
4559 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4560 def __init__(self, *args, **kwargs):
27fb7603
RD
4561 """
4562 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4563
4564 Constructs a wx.MouseEvent. Valid event types are:
4565
4566 * wxEVT_ENTER_WINDOW
4567 * wxEVT_LEAVE_WINDOW
4568 * wxEVT_LEFT_DOWN
4569 * wxEVT_LEFT_UP
4570 * wxEVT_LEFT_DCLICK
4571 * wxEVT_MIDDLE_DOWN
4572 * wxEVT_MIDDLE_UP
4573 * wxEVT_MIDDLE_DCLICK
4574 * wxEVT_RIGHT_DOWN
4575 * wxEVT_RIGHT_UP
4576 * wxEVT_RIGHT_DCLICK
4577 * wxEVT_MOTION
4578 * wxEVT_MOUSEWHEEL
4579 """
5b5c9bc7 4580 newobj = _core_.new_MouseEvent(*args, **kwargs)
d55e5bfc
RD
4581 self.this = newobj.this
4582 self.thisown = 1
4583 del newobj.thisown
4584 def IsButton(*args, **kwargs):
27fb7603
RD
4585 """
4586 IsButton(self) -> bool
4587
4588 Returns true if the event was a mouse button event (not necessarily a
4589 button down event - that may be tested using `ButtonDown`).
4590 """
5b5c9bc7 4591 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4592
4593 def ButtonDown(*args, **kwargs):
27fb7603
RD
4594 """
4595 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4596
5ba5649b
RD
4597 If the argument is omitted, this returns true if the event was any
4598 mouse button down event. Otherwise the argument specifies which
4599 button-down event shold be checked for (see `Button` for the possible
4600 values).
27fb7603 4601 """
5b5c9bc7 4602 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4603
4604 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4605 """
4606 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4607
4608 If the argument is omitted, this returns true if the event was any
4609 mouse double click event. Otherwise the argument specifies which
4610 double click event to check for (see `Button` for the possible
4611 values).
4612 """
5b5c9bc7 4613 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4614
4615 def ButtonUp(*args, **kwargs):
27fb7603
RD
4616 """
4617 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4618
4619 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4620 mouse button up event. Otherwise the argument specifies which button
4621 up event to check for (see `Button` for the possible values).
27fb7603 4622 """
5b5c9bc7 4623 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4624
4625 def Button(*args, **kwargs):
27fb7603
RD
4626 """
4627 Button(self, int button) -> bool
4628
4629 Returns true if the identified mouse button is changing state. Valid
4630 values of button are:
4631
4632 ==================== =====================================
4633 wx.MOUSE_BTN_LEFT check if left button was pressed
4634 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4635 wx.MOUSE_BTN_RIGHT check if right button was pressed
4636 wx.MOUSE_BTN_ANY check if any button was pressed
4637 ==================== =====================================
4638
4639 """
5b5c9bc7 4640 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4641
4642 def ButtonIsDown(*args, **kwargs):
4643 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4644 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4645
4646 def GetButton(*args, **kwargs):
27fb7603
RD
4647 """
4648 GetButton(self) -> int
4649
4650 Returns the mouse button which generated this event or
4651 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4652 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4653 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4654 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4655 right buttons respectively.
4656 """
5b5c9bc7 4657 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4658
4659 def ControlDown(*args, **kwargs):
27fb7603
RD
4660 """
4661 ControlDown(self) -> bool
4662
4663 Returns true if the control key was down at the time of the event.
4664 """
5b5c9bc7 4665 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4666
4667 def MetaDown(*args, **kwargs):
27fb7603
RD
4668 """
4669 MetaDown(self) -> bool
4670
4671 Returns true if the Meta key was down at the time of the event.
4672 """
5b5c9bc7 4673 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4674
4675 def AltDown(*args, **kwargs):
27fb7603
RD
4676 """
4677 AltDown(self) -> bool
4678
4679 Returns true if the Alt key was down at the time of the event.
4680 """
5b5c9bc7 4681 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4682
4683 def ShiftDown(*args, **kwargs):
27fb7603
RD
4684 """
4685 ShiftDown(self) -> bool
4686
4687 Returns true if the Shift key was down at the time of the event.
4688 """
5b5c9bc7 4689 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4690
412d302d
RD
4691 def CmdDown(*args, **kwargs):
4692 """
4693 CmdDown(self) -> bool
4694
4695 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4696 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4697 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4698 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4699 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4700 purpose. So for non-Mac platforms this is the same as `ControlDown`
4701 and Macs this is the same as `MetaDown`.
4702 """
5b5c9bc7 4703 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4704
d55e5bfc 4705 def LeftDown(*args, **kwargs):
27fb7603
RD
4706 """
4707 LeftDown(self) -> bool
4708
4709 Returns true if the left mouse button state changed to down.
4710 """
5b5c9bc7 4711 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4712
4713 def MiddleDown(*args, **kwargs):
27fb7603
RD
4714 """
4715 MiddleDown(self) -> bool
4716
4717 Returns true if the middle mouse button state changed to down.
4718 """
5b5c9bc7 4719 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4720
4721 def RightDown(*args, **kwargs):
27fb7603
RD
4722 """
4723 RightDown(self) -> bool
4724
4725 Returns true if the right mouse button state changed to down.
4726 """
5b5c9bc7 4727 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4728
4729 def LeftUp(*args, **kwargs):
27fb7603
RD
4730 """
4731 LeftUp(self) -> bool
4732
4733 Returns true if the left mouse button state changed to up.
4734 """
5b5c9bc7 4735 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4736
4737 def MiddleUp(*args, **kwargs):
27fb7603
RD
4738 """
4739 MiddleUp(self) -> bool
4740
4741 Returns true if the middle mouse button state changed to up.
4742 """
5b5c9bc7 4743 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4744
4745 def RightUp(*args, **kwargs):
27fb7603
RD
4746 """
4747 RightUp(self) -> bool
4748
4749 Returns true if the right mouse button state changed to up.
4750 """
5b5c9bc7 4751 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4752
4753 def LeftDClick(*args, **kwargs):
27fb7603
RD
4754 """
4755 LeftDClick(self) -> bool
4756
4757 Returns true if the event was a left button double click.
4758 """
5b5c9bc7 4759 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4760
4761 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4762 """
4763 MiddleDClick(self) -> bool
4764
4765 Returns true if the event was a middle button double click.
4766 """
5b5c9bc7 4767 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4768
4769 def RightDClick(*args, **kwargs):
27fb7603
RD
4770 """
4771 RightDClick(self) -> bool
4772
4773 Returns true if the event was a right button double click.
4774 """
5b5c9bc7 4775 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4776
4777 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4778 """
4779 LeftIsDown(self) -> bool
4780
4781 Returns true if the left mouse button is currently down, independent
4782 of the current event type.
4783
4784 Please notice that it is not the same as LeftDown which returns true
4785 if the left mouse button was just pressed. Rather, it describes the
4786 state of the mouse button before the event happened.
4787
4788 This event is usually used in the mouse event handlers which process
4789 "move mouse" messages to determine whether the user is (still)
4790 dragging the mouse.
4791 """
5b5c9bc7 4792 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4793
4794 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4795 """
4796 MiddleIsDown(self) -> bool
4797
4798 Returns true if the middle mouse button is currently down, independent
4799 of the current event type.
4800 """
5b5c9bc7 4801 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4802
4803 def RightIsDown(*args, **kwargs):
27fb7603
RD
4804 """
4805 RightIsDown(self) -> bool
4806
4807 Returns true if the right mouse button is currently down, independent
4808 of the current event type.
4809 """
5b5c9bc7 4810 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4811
4812 def Dragging(*args, **kwargs):
27fb7603
RD
4813 """
4814 Dragging(self) -> bool
4815
4816 Returns true if this was a dragging event (motion while a button is
4817 depressed).
4818 """
5b5c9bc7 4819 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4820
4821 def Moving(*args, **kwargs):
27fb7603
RD
4822 """
4823 Moving(self) -> bool
4824
4825 Returns true if this was a motion event and no mouse buttons were
4826 pressed. If any mouse button is held pressed, then this method returns
4827 false and Dragging returns true.
4828 """
5b5c9bc7 4829 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4830
4831 def Entering(*args, **kwargs):
27fb7603
RD
4832 """
4833 Entering(self) -> bool
4834
4835 Returns true if the mouse was entering the window.
4836 """
5b5c9bc7 4837 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4838
4839 def Leaving(*args, **kwargs):
27fb7603
RD
4840 """
4841 Leaving(self) -> bool
4842
4843 Returns true if the mouse was leaving the window.
4844 """
5b5c9bc7 4845 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4846
4847 def GetPosition(*args, **kwargs):
4848 """
5b5c9bc7 4849 GetPosition(self) -> Point
d55e5bfc 4850
27fb7603
RD
4851 Returns the pixel position of the mouse in window coordinates when the
4852 event happened.
d55e5bfc 4853 """
5b5c9bc7 4854 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4855
4856 def GetPositionTuple(*args, **kwargs):
4857 """
4858 GetPositionTuple() -> (x,y)
4859
27fb7603
RD
4860 Returns the pixel position of the mouse in window coordinates when the
4861 event happened.
d55e5bfc 4862 """
5b5c9bc7 4863 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4864
4865 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4866 """
4867 GetLogicalPosition(self, DC dc) -> Point
4868
4869 Returns the logical mouse position in pixels (i.e. translated
4870 according to the translation set for the DC, which usually indicates
4871 that the window has been scrolled).
4872 """
5b5c9bc7 4873 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
4874
4875 def GetX(*args, **kwargs):
27fb7603
RD
4876 """
4877 GetX(self) -> int
4878
4879 Returns X coordinate of the physical mouse event position.
4880 """
5b5c9bc7 4881 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4882
4883 def GetY(*args, **kwargs):
27fb7603
RD
4884 """
4885 GetY(self) -> int
4886
4887 Returns Y coordinate of the physical mouse event position.
4888 """
5b5c9bc7 4889 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4890
4891 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4892 """
4893 GetWheelRotation(self) -> int
4894
4895 Get wheel rotation, positive or negative indicates direction of
4896 rotation. Current devices all send an event when rotation is equal to
4897 +/-WheelDelta, but this allows for finer resolution devices to be
4898 created in the future. Because of this you shouldn't assume that one
4899 event is equal to 1 line or whatever, but you should be able to either
4900 do partial line scrolling or wait until +/-WheelDelta rotation values
4901 have been accumulated before scrolling.
4902 """
5b5c9bc7 4903 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
4904
4905 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4906 """
4907 GetWheelDelta(self) -> int
4908
4909 Get wheel delta, normally 120. This is the threshold for action to be
4910 taken, and one such action (for example, scrolling one increment)
4911 should occur for each delta.
4912 """
5b5c9bc7 4913 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
4914
4915 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4916 """
4917 GetLinesPerAction(self) -> int
4918
4919 Returns the configured number of lines (or whatever) to be scrolled
4920 per wheel action. Defaults to three.
4921 """
5b5c9bc7 4922 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
4923
4924 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4925 """
4926 IsPageScroll(self) -> bool
4927
4928 Returns true if the system has been setup to do page scrolling with
4929 the mouse wheel instead of line scrolling.
4930 """
5b5c9bc7
RD
4931 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4932
4933 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4934 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4935 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4936 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4937 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4938 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4939 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4940 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4941 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4942 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4943 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4944 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4945
4946class MouseEventPtr(MouseEvent):
d55e5bfc
RD
4947 def __init__(self, this):
4948 self.this = this
4949 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4950 self.__class__ = MouseEvent
4951_core_.MouseEvent_swigregister(MouseEventPtr)
d55e5bfc
RD
4952
4953#---------------------------------------------------------------------------
4954
5b5c9bc7 4955class SetCursorEvent(Event):
5ba5649b
RD
4956 """
4957 A SetCursorEvent is generated when the mouse cursor is about to be set
4958 as a result of mouse motion. This event gives the application the
4959 chance to perform specific mouse cursor processing based on the
4960 current position of the mouse within the window. Use the `SetCursor`
4961 method to specify the cursor you want to be displayed.
4962 """
d55e5bfc
RD
4963 def __repr__(self):
4964 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4965 def __init__(self, *args, **kwargs):
5ba5649b
RD
4966 """
4967 __init__(self, int x=0, int y=0) -> SetCursorEvent
4968
4969 Construct a new `wx.SetCursorEvent`.
4970 """
5b5c9bc7 4971 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
d55e5bfc
RD
4972 self.this = newobj.this
4973 self.thisown = 1
4974 del newobj.thisown
4975 def GetX(*args, **kwargs):
5ba5649b
RD
4976 """
4977 GetX(self) -> int
4978
4979 Returns the X coordinate of the mouse in client coordinates.
4980 """
5b5c9bc7 4981 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4982
4983 def GetY(*args, **kwargs):
5ba5649b
RD
4984 """
4985 GetY(self) -> int
4986
4987 Returns the Y coordinate of the mouse in client coordinates.
4988 """
5b5c9bc7 4989 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4990
4991 def SetCursor(*args, **kwargs):
5ba5649b
RD
4992 """
4993 SetCursor(self, Cursor cursor)
4994
4995 Sets the cursor associated with this event.
4996 """
5b5c9bc7 4997 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
4998
4999 def GetCursor(*args, **kwargs):
5ba5649b
RD
5000 """
5001 GetCursor(self) -> Cursor
5002
5003 Returns a reference to the cursor specified by this event.
5004 """
5b5c9bc7 5005 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
5006
5007 def HasCursor(*args, **kwargs):
5ba5649b
RD
5008 """
5009 HasCursor(self) -> bool
5010
5011 Returns true if the cursor specified by this event is a valid cursor.
5012 """
5b5c9bc7 5013 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc
RD
5014
5015
5b5c9bc7 5016class SetCursorEventPtr(SetCursorEvent):
d55e5bfc
RD
5017 def __init__(self, this):
5018 self.this = this
5019 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5020 self.__class__ = SetCursorEvent
5021_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
d55e5bfc
RD
5022
5023#---------------------------------------------------------------------------
5024
5b5c9bc7 5025class KeyEvent(Event):
5ba5649b
RD
5026 """
5027 This event class contains information about keypress and character
5028 events. These events are only sent to the widget that currently has
5029 the keyboard focus.
5030
5031 Notice that there are three different kinds of keyboard events in
5032 wxWidgets: key down and up events and char events. The difference
5033 between the first two is clear - the first corresponds to a key press
5034 and the second to a key release - otherwise they are identical. Just
5035 note that if the key is maintained in a pressed state you will
5036 typically get a lot of (automatically generated) down events but only
5037 one up so it is wrong to assume that there is one up event
5038 corresponding to each down one.
5039
5040 Both key events provide untranslated key codes while the char event
5041 carries the translated one. The untranslated code for alphanumeric
5042 keys is always an upper case value. For the other keys it is one of
5043 WXK_XXX values from the keycodes table. The translated key is, in
5044 general, the character the user expects to appear as the result of the
5045 key combination when typing the text into a text entry zone, for
5046 example.
5047
5048 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5049 and the standard US keyboard): when the 'A' key is pressed, the key
5050 down event key code is equal to ASCII A == 65. But the char event key
5051 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5052 'A' keys simultaneously , the key code in key down event will still be
5053 just 'A' while the char event key code parameter will now be 'A' as
5054 well.
5055
5056 Although in this simple case it is clear that the correct key code
5057 could be found in the key down event handler by checking the value
5058 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5059 as for non alphanumeric keys or non-US keyboard layouts the
5060 translation is keyboard-layout dependent and can only be done properly
5061 by the system itself.
5062
5063 Another kind of translation is done when the control key is pressed:
5064 for example, for CTRL-A key press the key down event still carries the
5065 same key code 'A' as usual but the char event will have key code of 1,
5066 the ASCII value of this key combination.
5067
5068 You may discover how the other keys on your system behave
5069 interactively by running the KeyEvents sample in the wxPython demo and
5070 pressing some keys while the blue box at the top has the keyboard
5071 focus.
5072
5073 **Note**: If a key down event is caught and the event handler does not
5074 call event.Skip() then the coresponding char event will not
5075 happen. This is by design and enables the programs that handle both
5076 types of events to be a bit simpler.
5077
5078 **Note for Windows programmers**: The key and char events in wxWidgets
5079 are similar to but slightly different from Windows WM_KEYDOWN and
5080 WM_CHAR events. In particular, Alt-x combination will generate a char
5081 event in wxWidgets (unless it is used as an accelerator).
5082
5083 **Tip**: be sure to call event.Skip() for events that you don't
5084 process in key event function, otherwise menu shortcuts may cease to
5085 work under Windows.
5086
5087 """
d55e5bfc
RD
5088 def __repr__(self):
5089 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5090 def __init__(self, *args, **kwargs):
5ba5649b
RD
5091 """
5092 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
5093
5094 Construct a new `wx.KeyEvent`. Valid event types are:
5095 *
5096 """
5b5c9bc7 5097 newobj = _core_.new_KeyEvent(*args, **kwargs)
d55e5bfc
RD
5098 self.this = newobj.this
5099 self.thisown = 1
5100 del newobj.thisown
5101 def ControlDown(*args, **kwargs):
5ba5649b
RD
5102 """
5103 ControlDown(self) -> bool
5104
5105 Returns ``True`` if the Control key was down at the time of the event.
5106 """
5b5c9bc7 5107 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
5108
5109 def MetaDown(*args, **kwargs):
5ba5649b
RD
5110 """
5111 MetaDown(self) -> bool
5112
5113 Returns ``True`` if the Meta key was down at the time of the event.
5114 """
5b5c9bc7 5115 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
5116
5117 def AltDown(*args, **kwargs):
5ba5649b
RD
5118 """
5119 AltDown(self) -> bool
5120
5121 Returns ``True`` if the Alt key was down at the time of the event.
5122 """
5b5c9bc7 5123 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
5124
5125 def ShiftDown(*args, **kwargs):
5ba5649b
RD
5126 """
5127 ShiftDown(self) -> bool
5128
5129 Returns ``True`` if the Shift key was down at the time of the event.
5130 """
5b5c9bc7 5131 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 5132
412d302d
RD
5133 def CmdDown(*args, **kwargs):
5134 """
5135 CmdDown(self) -> bool
5136
5137 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5138 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5139 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5140 because Cmd key is used for the same thing under Mac as Ctrl
5141 elsewhere. The Ctrl still exists, it's just not used for this
5142 purpose. So for non-Mac platforms this is the same as `ControlDown`
5143 and Macs this is the same as `MetaDown`.
5144 """
5b5c9bc7 5145 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 5146
d55e5bfc 5147 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5148 """
5149 HasModifiers(self) -> bool
5150
5151 Returns true if either CTRL or ALT keys was down at the time of the
5152 key event. Note that this function does not take into account neither
5153 SHIFT nor META key states (the reason for ignoring the latter is that
5154 it is common for NUMLOCK key to be configured as META under X but the
5155 key presses even while NUMLOCK is on should be still processed
5156 normally).
5157 """
5b5c9bc7 5158 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
5159
5160 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5161 """
5162 GetKeyCode(self) -> int
5163
5164 Returns the virtual key code. ASCII events return normal ASCII values,
5165 while non-ASCII events return values such as WXK_LEFT for the left
5166 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5167 codes.
5168
5169 Note that in Unicode build, the returned value is meaningful only if
5170 the user entered a character that can be represented in current
5171 locale's default charset. You can obtain the corresponding Unicode
5172 character using `GetUnicodeKey`.
5173 """
5b5c9bc7 5174 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
5175
5176 KeyCode = GetKeyCode
bb4524c4 5177 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5178 """
5179 GetUnicodeKey(self) -> int
5180
5181 Returns the Unicode character corresponding to this key event. This
5182 function is only meaningfule in a Unicode build of wxPython.
5183 """
5b5c9bc7 5184 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 5185
bb4524c4 5186 GetUniChar = GetUnicodeKey
d55e5bfc 5187 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5188 """
5189 GetRawKeyCode(self) -> unsigned int
5190
5191 Returns the raw key code for this event. This is a platform-dependent
5192 scan code which should only be used in advanced
5193 applications. Currently the raw key codes are not supported by all
5194 ports.
5195 """
5b5c9bc7 5196 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
5197
5198 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5199 """
5200 GetRawKeyFlags(self) -> unsigned int
5201
5202 Returns the low level key flags for this event. The flags are
5203 platform-dependent and should only be used in advanced applications.
5204 Currently the raw key flags are not supported by all ports.
5205 """
5b5c9bc7 5206 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
5207
5208 def GetPosition(*args, **kwargs):
5209 """
5b5c9bc7 5210 GetPosition(self) -> Point
d55e5bfc 5211
5ba5649b 5212 Find the position of the event, if applicable.
d55e5bfc 5213 """
5b5c9bc7 5214 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5215
5216 def GetPositionTuple(*args, **kwargs):
5217 """
5218 GetPositionTuple() -> (x,y)
5219
5ba5649b 5220 Find the position of the event, if applicable.
d55e5bfc 5221 """
5b5c9bc7 5222 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
5223
5224 def GetX(*args, **kwargs):
5ba5649b
RD
5225 """
5226 GetX(self) -> int
5227
5228 Returns the X position (in client coordinates) of the event, if
5229 applicable.
5230 """
5b5c9bc7 5231 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
5232
5233 def GetY(*args, **kwargs):
5ba5649b
RD
5234 """
5235 GetY(self) -> int
5236
5237 Returns the Y position (in client coordinates) of the event, if
5238 applicable.
5239 """
5b5c9bc7
RD
5240 return _core_.KeyEvent_GetY(*args, **kwargs)
5241
5242 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5243 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5244 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5245 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5246 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5247 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5248 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5249 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5250 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5251 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5252
5253class KeyEventPtr(KeyEvent):
d55e5bfc
RD
5254 def __init__(self, this):
5255 self.this = this
5256 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5257 self.__class__ = KeyEvent
5258_core_.KeyEvent_swigregister(KeyEventPtr)
d55e5bfc
RD
5259
5260#---------------------------------------------------------------------------
5261
5b5c9bc7 5262class SizeEvent(Event):
5ba5649b
RD
5263 """
5264 A size event holds information about size change events. The EVT_SIZE
5265 handler function will be called when the window it is bound to has
5266 been resized.
5267
5268 Note that the size passed is of the whole window: call
5269 `wx.Window.GetClientSize` for the area which may be used by the
5270 application.
5271
5272 When a window is resized, usually only a small part of the window is
5273 damaged and and that area is all that is in the update region for the
5274 next paint event. However, if your drawing depends on the size of the
5275 window, you may need to clear the DC explicitly and repaint the whole
5276 window. In which case, you may need to call `wx.Window.Refresh` to
5277 invalidate the entire window.
5278
5279 """
d55e5bfc
RD
5280 def __repr__(self):
5281 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5282 def __init__(self, *args, **kwargs):
5ba5649b
RD
5283 """
5284 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5285
5286 Construct a new ``wx.SizeEvent``.
5287 """
5b5c9bc7 5288 newobj = _core_.new_SizeEvent(*args, **kwargs)
d55e5bfc
RD
5289 self.this = newobj.this
5290 self.thisown = 1
5291 del newobj.thisown
5292 def GetSize(*args, **kwargs):
5ba5649b
RD
5293 """
5294 GetSize(self) -> Size
5295
5296 Returns the entire size of the window generating the size change
5297 event.
5298 """
5b5c9bc7 5299 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
5300
5301 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5302 """GetRect(self) -> Rect"""
5303 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5304
5305 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5306 """SetRect(self, Rect rect)"""
5307 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5308
5309 def SetSize(*args, **kwargs):
5b5c9bc7
RD
5310 """SetSize(self, Size size)"""
5311 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 5312
5b5c9bc7
RD
5313 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5314 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
d55e5bfc 5315
5b5c9bc7 5316class SizeEventPtr(SizeEvent):
d55e5bfc
RD
5317 def __init__(self, this):
5318 self.this = this
5319 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5320 self.__class__ = SizeEvent
5321_core_.SizeEvent_swigregister(SizeEventPtr)
d55e5bfc
RD
5322
5323#---------------------------------------------------------------------------
5324
5b5c9bc7 5325class MoveEvent(Event):
5ba5649b
RD
5326 """
5327 This event object is sent for EVT_MOVE event bindings when a window is
5328 moved to a new position.
5329 """
d55e5bfc
RD
5330 def __repr__(self):
5331 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5332 def __init__(self, *args, **kwargs):
5ba5649b
RD
5333 """
5334 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5335
5336 Constructor.
5337 """
5b5c9bc7 5338 newobj = _core_.new_MoveEvent(*args, **kwargs)
d55e5bfc
RD
5339 self.this = newobj.this
5340 self.thisown = 1
5341 del newobj.thisown
5342 def GetPosition(*args, **kwargs):
5ba5649b
RD
5343 """
5344 GetPosition(self) -> Point
5345
5346 Returns the position of the window generating the move change event.
5347 """
5b5c9bc7 5348 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5349
5350 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5351 """GetRect(self) -> Rect"""
5352 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5353
5354 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5355 """SetRect(self, Rect rect)"""
5356 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5357
5358 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
5359 """SetPosition(self, Point pos)"""
5360 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 5361
fef4c27a
RD
5362 m_pos = property(GetPosition, SetPosition)
5363 m_rect = property(GetRect, SetRect)
5364
d55e5bfc 5365
5b5c9bc7 5366class MoveEventPtr(MoveEvent):
d55e5bfc
RD
5367 def __init__(self, this):
5368 self.this = this
5369 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5370 self.__class__ = MoveEvent
5371_core_.MoveEvent_swigregister(MoveEventPtr)
d55e5bfc
RD
5372
5373#---------------------------------------------------------------------------
5374
5b5c9bc7 5375class PaintEvent(Event):
5ba5649b
RD
5376 """
5377 A paint event is sent when a window's contents needs to be repainted.
5378 Note that in an EVT_PAINT handler the application must *always* create
5379 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5380 Windows assumes that the window has not been painted yet and will send
5381 the event again, causing endless refreshes.
5382
5383 You can optimize painting by retrieving the rectangles that have been
5384 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5385 and only repainting these rectangles. The rectangles are in terms of
5386 the client area, and are unscrolled, so you will need to do some
5387 calculations using the current view position to obtain logical,
5388 scrolled units.
5389
5390 """
d55e5bfc
RD
5391 def __repr__(self):
5392 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5393 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
5394 """__init__(self, int Id=0) -> PaintEvent"""
5395 newobj = _core_.new_PaintEvent(*args, **kwargs)
d55e5bfc
RD
5396 self.this = newobj.this
5397 self.thisown = 1
5398 del newobj.thisown
5399
5b5c9bc7 5400class PaintEventPtr(PaintEvent):
d55e5bfc
RD
5401 def __init__(self, this):
5402 self.this = this
5403 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5404 self.__class__ = PaintEvent
5405_core_.PaintEvent_swigregister(PaintEventPtr)
d55e5bfc 5406
5b5c9bc7
RD
5407class NcPaintEvent(Event):
5408 """Proxy of C++ NcPaintEvent class"""
d55e5bfc
RD
5409 def __repr__(self):
5410 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5411 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
5412 """__init__(self, int winid=0) -> NcPaintEvent"""
5413 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
d55e5bfc
RD
5414 self.this = newobj.this
5415 self.thisown = 1
5416 del newobj.thisown
5417
5b5c9bc7 5418class NcPaintEventPtr(NcPaintEvent):
d55e5bfc
RD
5419 def __init__(self, this):
5420 self.this = this
5421 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5422 self.__class__ = NcPaintEvent
5423_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
d55e5bfc
RD
5424
5425#---------------------------------------------------------------------------
5426
5b5c9bc7 5427class EraseEvent(Event):
5ba5649b
RD
5428 """
5429 An erase event is sent whenever the background of a window needs to be
5430 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5431 binder. On some platforms, such as GTK+, this event is simulated
5432 (simply generated just before the paint event) and may cause flicker.
5433
5434 To paint a custom background use the `GetDC` method and use the returned
5435 device context if it is not ``None``, otherwise create a temporary
5436 `wx.ClientDC` and draw on that.
5437
5438 """
d55e5bfc
RD
5439 def __repr__(self):
5440 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5441 def __init__(self, *args, **kwargs):
5ba5649b
RD
5442 """
5443 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5444
5445 Constructor
5446 """
5b5c9bc7 5447 newobj = _core_.new_EraseEvent(*args, **kwargs)
d55e5bfc
RD
5448 self.this = newobj.this
5449 self.thisown = 1
5450 del newobj.thisown
5451 def GetDC(*args, **kwargs):
5ba5649b
RD
5452 """
5453 GetDC(self) -> DC
5454
5455 Returns the device context the event handler should draw upon. If
5456 ``None`` is returned then create a temporary `wx.ClientDC` and use
5457 that instead.
5458 """
5b5c9bc7 5459 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc
RD
5460
5461
5b5c9bc7 5462class EraseEventPtr(EraseEvent):
d55e5bfc
RD
5463 def __init__(self, this):
5464 self.this = this
5465 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5466 self.__class__ = EraseEvent
5467_core_.EraseEvent_swigregister(EraseEventPtr)
d55e5bfc
RD
5468
5469#---------------------------------------------------------------------------
5470
5b5c9bc7 5471class FocusEvent(Event):
5ba5649b
RD
5472 """
5473 A focus event is sent when a window's focus changes. The window losing
5474 focus receives an EVT_KILL_FOCUS event while the window gaining it
5475 gets an EVT_SET_FOCUS event.
5476
5477 Notice that the set focus event happens both when the user gives focus
5478 to the window (whether using the mouse or keyboard) and when it is
5479 done from the program itself using `wx.Window.SetFocus`.
5480
5481 """
d55e5bfc
RD
5482 def __repr__(self):
5483 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5484 def __init__(self, *args, **kwargs):
5ba5649b
RD
5485 """
5486 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5487
5488 Constructor
5489 """
5b5c9bc7 5490 newobj = _core_.new_FocusEvent(*args, **kwargs)
d55e5bfc
RD
5491 self.this = newobj.this
5492 self.thisown = 1
5493 del newobj.thisown
5494 def GetWindow(*args, **kwargs):
5ba5649b
RD
5495 """
5496 GetWindow(self) -> Window
5497
5498 Returns the other window associated with this event, that is the
5499 window which had the focus before for the EVT_SET_FOCUS event and the
5500 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5501
5502 Warning: the window returned may be None!
5503 """
5b5c9bc7 5504 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5505
5506 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5507 """SetWindow(self, Window win)"""
5508 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc
RD
5509
5510
5b5c9bc7 5511class FocusEventPtr(FocusEvent):
d55e5bfc
RD
5512 def __init__(self, this):
5513 self.this = this
5514 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5515 self.__class__ = FocusEvent
5516_core_.FocusEvent_swigregister(FocusEventPtr)
d55e5bfc
RD
5517
5518#---------------------------------------------------------------------------
5519
5b5c9bc7 5520class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5521 """
5522 wx.ChildFocusEvent notifies the parent that a child has received the
5523 focus. Unlike `wx.FocusEvent` it is propagated up the window
5524 heirarchy.
5525 """
d55e5bfc
RD
5526 def __repr__(self):
5527 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5528 def __init__(self, *args, **kwargs):
5ba5649b
RD
5529 """
5530 __init__(self, Window win=None) -> ChildFocusEvent
5531
5532 Constructor
5533 """
5b5c9bc7 5534 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
d55e5bfc
RD
5535 self.this = newobj.this
5536 self.thisown = 1
5537 del newobj.thisown
5538 def GetWindow(*args, **kwargs):
5ba5649b
RD
5539 """
5540 GetWindow(self) -> Window
5541
5542 The window which has just received the focus.
5543 """
5b5c9bc7 5544 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5545
5546
5b5c9bc7 5547class ChildFocusEventPtr(ChildFocusEvent):
d55e5bfc
RD
5548 def __init__(self, this):
5549 self.this = this
5550 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5551 self.__class__ = ChildFocusEvent
5552_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
d55e5bfc
RD
5553
5554#---------------------------------------------------------------------------
5555
5b5c9bc7 5556class ActivateEvent(Event):
5ba5649b
RD
5557 """
5558 An activate event is sent when a top-level window or the entire
5559 application is being activated or deactivated.
5560
5561 A top-level window (a dialog or frame) receives an activate event when
5562 is being activated or deactivated. This is indicated visually by the
5563 title bar changing colour, and a subwindow gaining the keyboard focus.
5564 An application is activated or deactivated when one of its frames
5565 becomes activated, or a frame becomes inactivate resulting in all
5566 application frames being inactive.
5567
5568 Please note that usually you should call event.Skip() in your handlers
5569 for these events so the default handlers will still be called, as not
5570 doing so can result in strange effects.
5571
5572 """
d55e5bfc
RD
5573 def __repr__(self):
5574 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5575 def __init__(self, *args, **kwargs):
5ba5649b
RD
5576 """
5577 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5578
5579 Constructor
5580 """
5b5c9bc7 5581 newobj = _core_.new_ActivateEvent(*args, **kwargs)
d55e5bfc
RD
5582 self.this = newobj.this
5583 self.thisown = 1
5584 del newobj.thisown
5585 def GetActive(*args, **kwargs):
5ba5649b
RD
5586 """
5587 GetActive(self) -> bool
5588
5589 Returns true if the application or window is being activated, false
5590 otherwise.
5591 """
5b5c9bc7 5592 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc
RD
5593
5594
5b5c9bc7 5595class ActivateEventPtr(ActivateEvent):
d55e5bfc
RD
5596 def __init__(self, this):
5597 self.this = this
5598 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5599 self.__class__ = ActivateEvent
5600_core_.ActivateEvent_swigregister(ActivateEventPtr)
d55e5bfc
RD
5601
5602#---------------------------------------------------------------------------
5603
5b5c9bc7 5604class InitDialogEvent(Event):
5ba5649b
RD
5605 """
5606 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5607 any window when `wx.Window.InitDialog` is called. Handlers for this
5608 event can transfer data to the window, or anything else that should be
5609 done before the user begins editing the form. The default handler
5610 calls `wx.Window.TransferDataToWindow`.
5611 """
d55e5bfc
RD
5612 def __repr__(self):
5613 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5614 def __init__(self, *args, **kwargs):
5ba5649b
RD
5615 """
5616 __init__(self, int Id=0) -> InitDialogEvent
5617
5618 Constructor
5619 """
5b5c9bc7 5620 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
d55e5bfc
RD
5621 self.this = newobj.this
5622 self.thisown = 1
5623 del newobj.thisown
5624
5b5c9bc7 5625class InitDialogEventPtr(InitDialogEvent):
d55e5bfc
RD
5626 def __init__(self, this):
5627 self.this = this
5628 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5629 self.__class__ = InitDialogEvent
5630_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
d55e5bfc
RD
5631
5632#---------------------------------------------------------------------------
5633
5b5c9bc7 5634class MenuEvent(Event):
5ba5649b
RD
5635 """
5636 This class is used for a variety of menu-related events. Note that
5637 these do not include menu command events, which are handled by sending
5638 `wx.CommandEvent` objects.
5639
5640 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5641 text in the first field of the status bar.
5642 """
d55e5bfc
RD
5643 def __repr__(self):
5644 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5645 def __init__(self, *args, **kwargs):
5ba5649b
RD
5646 """
5647 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5648
5649 Constructor
5650 """
5b5c9bc7 5651 newobj = _core_.new_MenuEvent(*args, **kwargs)
d55e5bfc
RD
5652 self.this = newobj.this
5653 self.thisown = 1
5654 del newobj.thisown
5655 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5656 """
5657 GetMenuId(self) -> int
5658
5659 Returns the menu identifier associated with the event. This method
5660 should be only used with the HIGHLIGHT events.
5661 """
5b5c9bc7 5662 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5663
5664 def IsPopup(*args, **kwargs):
5ba5649b
RD
5665 """
5666 IsPopup(self) -> bool
5667
5668 Returns ``True`` if the menu which is being opened or closed is a
5669 popup menu, ``False`` if it is a normal one. This method should only
5670 be used with the OPEN and CLOSE events.
5671 """
5b5c9bc7 5672 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5673
5674 def GetMenu(*args, **kwargs):
5ba5649b
RD
5675 """
5676 GetMenu(self) -> Menu
5677
5678 Returns the menu which is being opened or closed. This method should
5679 only be used with the OPEN and CLOSE events.
5680 """
5b5c9bc7 5681 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc
RD
5682
5683
5b5c9bc7 5684class MenuEventPtr(MenuEvent):
d55e5bfc
RD
5685 def __init__(self, this):
5686 self.this = this
5687 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5688 self.__class__ = MenuEvent
5689_core_.MenuEvent_swigregister(MenuEventPtr)
d55e5bfc
RD
5690
5691#---------------------------------------------------------------------------
5692
5b5c9bc7 5693class CloseEvent(Event):
5ba5649b
RD
5694 """
5695 This event class contains information about window and session close
5696 events.
5697
5698 The handler function for EVT_CLOSE is called when the user has tried
5699 to close a a frame or dialog box using the window manager controls or
5700 the system menu. It can also be invoked by the application itself
5701 programmatically, for example by calling the `wx.Window.Close`
5702 function.
5703
5704 You should check whether the application is forcing the deletion of
5705 the window using `CanVeto`. If it returns ``False``, you must destroy
5706 the window using `wx.Window.Destroy`. If the return value is ``True``,
5707 it is up to you whether you respond by destroying the window or not.
5708 For example you may wish to display a message dialog prompting to save
5709 files or to cancel the close.
5710
5711 If you don't destroy the window, you should call `Veto` to let the
5712 calling code know that you did not destroy the window. This allows the
5713 `wx.Window.Close` function to return ``True`` or ``False`` depending
5714 on whether the close instruction was honored or not.
5715 """
d55e5bfc
RD
5716 def __repr__(self):
5717 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5718 def __init__(self, *args, **kwargs):
5ba5649b
RD
5719 """
5720 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5721
5722 Constructor.
5723 """
5b5c9bc7 5724 newobj = _core_.new_CloseEvent(*args, **kwargs)
d55e5bfc
RD
5725 self.this = newobj.this
5726 self.thisown = 1
5727 del newobj.thisown
5728 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5729 """
5730 SetLoggingOff(self, bool logOff)
5731
5732 Sets the 'logging off' flag.
5733 """
5b5c9bc7 5734 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5735
5736 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5737 """
5738 GetLoggingOff(self) -> bool
5739
034e3677
RD
5740 Returns ``True`` if the user is logging off or ``False`` if the
5741 system is shutting down. This method can only be called for end
5742 session and query end session events, it doesn't make sense for close
5743 window event.
5ba5649b 5744 """
5b5c9bc7 5745 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5746
5747 def Veto(*args, **kwargs):
5ba5649b
RD
5748 """
5749 Veto(self, bool veto=True)
5750
5751 Call this from your event handler to veto a system shutdown or to
5752 signal to the calling application that a window close did not happen.
5753
5754 You can only veto a shutdown or close if `CanVeto` returns true.
5755 """
5b5c9bc7 5756 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5757
5ba5649b
RD
5758 def GetVeto(*args, **kwargs):
5759 """GetVeto(self) -> bool"""
5760 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5761
d55e5bfc 5762 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5763 """
5764 SetCanVeto(self, bool canVeto)
5765
5766 Sets the 'can veto' flag.
5767 """
5b5c9bc7 5768 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5769
5770 def CanVeto(*args, **kwargs):
5ba5649b
RD
5771 """
5772 CanVeto(self) -> bool
d55e5bfc 5773
5ba5649b
RD
5774 Returns true if you can veto a system shutdown or a window close
5775 event. Vetoing a window close event is not possible if the calling
5776 code wishes to force the application to exit, and so this function
5777 must be called to check this.
5778 """
5779 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc
RD
5780
5781
5b5c9bc7 5782class CloseEventPtr(CloseEvent):
d55e5bfc
RD
5783 def __init__(self, this):
5784 self.this = this
5785 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5786 self.__class__ = CloseEvent
5787_core_.CloseEvent_swigregister(CloseEventPtr)
d55e5bfc
RD
5788
5789#---------------------------------------------------------------------------
5790
5b5c9bc7 5791class ShowEvent(Event):
5ba5649b 5792 """An EVT_SHOW event is sent when a window is shown or hidden."""
d55e5bfc
RD
5793 def __repr__(self):
5794 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5795 def __init__(self, *args, **kwargs):
5ba5649b
RD
5796 """
5797 __init__(self, int winid=0, bool show=False) -> ShowEvent
5798
5799 An EVT_SHOW event is sent when a window is shown or hidden.
5800 """
5b5c9bc7 5801 newobj = _core_.new_ShowEvent(*args, **kwargs)
d55e5bfc
RD
5802 self.this = newobj.this
5803 self.thisown = 1
5804 del newobj.thisown
5805 def SetShow(*args, **kwargs):
5806 """SetShow(self, bool show)"""
5b5c9bc7 5807 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5808
5809 def GetShow(*args, **kwargs):
5810 """GetShow(self) -> bool"""
5b5c9bc7 5811 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc
RD
5812
5813
5b5c9bc7 5814class ShowEventPtr(ShowEvent):
d55e5bfc
RD
5815 def __init__(self, this):
5816 self.this = this
5817 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5818 self.__class__ = ShowEvent
5819_core_.ShowEvent_swigregister(ShowEventPtr)
d55e5bfc
RD
5820
5821#---------------------------------------------------------------------------
5822
5b5c9bc7 5823class IconizeEvent(Event):
5ba5649b
RD
5824 """
5825 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5826 restored.
5827 """
d55e5bfc
RD
5828 def __repr__(self):
5829 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5830 def __init__(self, *args, **kwargs):
5ba5649b
RD
5831 """
5832 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5833
5834 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5835 restored.
5836 """
5b5c9bc7 5837 newobj = _core_.new_IconizeEvent(*args, **kwargs)
d55e5bfc
RD
5838 self.this = newobj.this
5839 self.thisown = 1
5840 del newobj.thisown
5841 def Iconized(*args, **kwargs):
5ba5649b
RD
5842 """
5843 Iconized(self) -> bool
5844
5845 Returns ``True`` if the frame has been iconized, ``False`` if it has
5846 been restored.
5847 """
5b5c9bc7 5848 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc
RD
5849
5850
5b5c9bc7 5851class IconizeEventPtr(IconizeEvent):
d55e5bfc
RD
5852 def __init__(self, this):
5853 self.this = this
5854 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5855 self.__class__ = IconizeEvent
5856_core_.IconizeEvent_swigregister(IconizeEventPtr)
d55e5bfc
RD
5857
5858#---------------------------------------------------------------------------
5859
5b5c9bc7 5860class MaximizeEvent(Event):
5ba5649b 5861 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
d55e5bfc
RD
5862 def __repr__(self):
5863 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5864 def __init__(self, *args, **kwargs):
5ba5649b
RD
5865 """
5866 __init__(self, int id=0) -> MaximizeEvent
5867
5868 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5869 """
5b5c9bc7 5870 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
d55e5bfc
RD
5871 self.this = newobj.this
5872 self.thisown = 1
5873 del newobj.thisown
5874
5b5c9bc7 5875class MaximizeEventPtr(MaximizeEvent):
d55e5bfc
RD
5876 def __init__(self, this):
5877 self.this = this
5878 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5879 self.__class__ = MaximizeEvent
5880_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
d55e5bfc
RD
5881
5882#---------------------------------------------------------------------------
5883
5b5c9bc7 5884class DropFilesEvent(Event):
5ba5649b
RD
5885 """
5886 This class is used for drop files events, that is, when files have
5887 been dropped onto the window. This functionality is only available
5888 under Windows. The window must have previously been enabled for
5889 dropping by calling `wx.Window.DragAcceptFiles`.
5890
5891 Important note: this is a separate implementation to the more general
5892 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5893 implementation uses the older, Windows message-based approach of
5894 dropping files.
5895
5896 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5897 events.
5898
5899 """
d55e5bfc
RD
5900 def __init__(self): raise RuntimeError, "No constructor defined"
5901 def __repr__(self):
5902 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5903 def GetPosition(*args, **kwargs):
5ba5649b
RD
5904 """
5905 GetPosition(self) -> Point
5906
5907 Returns the position at which the files were dropped.
5908 """
5b5c9bc7 5909 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5910
5911 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5912 """
5913 GetNumberOfFiles(self) -> int
5914
5915 Returns the number of files dropped.
5916 """
5b5c9bc7 5917 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5918
5919 def GetFiles(*args, **kwargs):
5ba5649b
RD
5920 """
5921 GetFiles(self) -> PyObject
5922
5923 Returns a list of the filenames that were dropped.
5924 """
5b5c9bc7 5925 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc
RD
5926
5927
5b5c9bc7 5928class DropFilesEventPtr(DropFilesEvent):
d55e5bfc
RD
5929 def __init__(self, this):
5930 self.this = this
5931 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5932 self.__class__ = DropFilesEvent
5933_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
d55e5bfc
RD
5934
5935#---------------------------------------------------------------------------
5936
5b5c9bc7
RD
5937UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5938UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5939class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5940 """
5941 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5942 wxWidgets to give an application the chance to update various user
5943 interface elements.
5944
5945 Without update UI events, an application has to work hard to
5946 check/uncheck, enable/disable, and set the text for elements such as
5947 menu items and toolbar buttons. The code for doing this has to be
5948 mixed up with the code that is invoked when an action is invoked for a
5949 menu item or button.
5950
5951 With update UI events, you define an event handler to look at the
5952 state of the application and change UI elements accordingly. wxWidgets
5953 will call your handler functions in idle time, so you don't have to
5954 worry where to call this code. In addition to being a clearer and more
5955 declarative method, it also means you don't have to worry whether
5956 you're updating a toolbar or menubar identifier. The same handler can
5957 update a menu item and toolbar button, if the ID values are the same.
5958
5959 Instead of directly manipulating the menu or button, you call
5960 functions in the event object, such as `Check`. wxWidgets will
5961 determine whether such a call has been made, and which UI element to
5962 update.
5963
5964 These events will work for popup menus as well as menubars. Just
5965 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5966 any UI events for the window that owns the menu.
5967
5968 If you find that the overhead of UI update processing is affecting
5969 your application, you can do one or both of the following:
5970
5971 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5972 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5973 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5974 receive update events. No other windows will receive update
5975 events.
5976
5977 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5978 value to set the delay between updates. You may need to call
5979 `wx.Window.UpdateWindowUI` at critical points, for example when
5980 a dialog is about to be shown, in case the user sees a slight
5981 delay before windows are updated.
5982
5983 Note that although events are sent in idle time, defining a EVT_IDLE
5984 handler for a window does not affect this because the events are sent
5985 from an internal idle handler.
5986
5987 wxWidgets tries to optimize update events on some platforms. On
5988 Windows and GTK+, events for menubar items are only sent when the menu
5989 is about to be shown, and not in idle time.
5990
5991 """
d55e5bfc
RD
5992 def __repr__(self):
5993 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5994 def __init__(self, *args, **kwargs):
5ba5649b
RD
5995 """
5996 __init__(self, int commandId=0) -> UpdateUIEvent
5997
5998 Constructor
5999 """
5b5c9bc7 6000 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
d55e5bfc
RD
6001 self.this = newobj.this
6002 self.thisown = 1
6003 del newobj.thisown
6004 def GetChecked(*args, **kwargs):
5ba5649b
RD
6005 """
6006 GetChecked(self) -> bool
6007
6008 Returns ``True`` if the UI element should be checked.
6009 """
5b5c9bc7 6010 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
6011
6012 def GetEnabled(*args, **kwargs):
5ba5649b
RD
6013 """
6014 GetEnabled(self) -> bool
6015
6016 Returns ``True`` if the UI element should be enabled.
6017 """
5b5c9bc7 6018 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc
RD
6019
6020 def GetText(*args, **kwargs):
5ba5649b
RD
6021 """
6022 GetText(self) -> String
6023
6024 Returns the text that should be set for the UI element.
6025 """
5b5c9bc7 6026 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
6027
6028 def GetSetText(*args, **kwargs):
5ba5649b
RD
6029 """
6030 GetSetText(self) -> bool
6031
6032 Returns ``True`` if the application has called `SetText`. For
6033 wxWidgets internal use only.
6034 """
5b5c9bc7 6035 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
6036
6037 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
6038 """
6039 GetSetChecked(self) -> bool
6040
6041 Returns ``True`` if the application has called `Check`. For wxWidgets
6042 internal use only.
6043 """
5b5c9bc7 6044 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
6045
6046 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
6047 """
6048 GetSetEnabled(self) -> bool
6049
6050 Returns ``True`` if the application has called `Enable`. For wxWidgets
6051 internal use only.
6052 """
5b5c9bc7 6053 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc
RD
6054
6055 def Check(*args, **kwargs):
5ba5649b
RD
6056 """
6057 Check(self, bool check)
6058
6059 Check or uncheck the UI element.
6060 """
5b5c9bc7 6061 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
6062
6063 def Enable(*args, **kwargs):
5ba5649b
RD
6064 """
6065 Enable(self, bool enable)
6066
6067 Enable or disable the UI element.
6068 """
5b5c9bc7 6069 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc
RD
6070
6071 def SetText(*args, **kwargs):
5ba5649b
RD
6072 """
6073 SetText(self, String text)
6074
6075 Sets the text for this UI element.
6076 """
5b5c9bc7 6077 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
6078
6079 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6080 """
6081 SetUpdateInterval(long updateInterval)
6082
6083 Sets the interval between updates in milliseconds. Set to -1 to
6084 disable updates, or to 0 to update as frequently as possible. The
6085 default is 0.
6086
6087 Use this to reduce the overhead of UI update events if your
6088 application has a lot of windows. If you set the value to -1 or
6089 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6090 at appropriate points in your application, such as when a dialog is
6091 about to be shown.
6092 """
5b5c9bc7 6093 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
6094
6095 SetUpdateInterval = staticmethod(SetUpdateInterval)
6096 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6097 """
6098 GetUpdateInterval() -> long
6099
6100 Returns the current interval between updates in milliseconds. -1
6101 disables updates, 0 updates as frequently as possible.
6102 """
5b5c9bc7 6103 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
6104
6105 GetUpdateInterval = staticmethod(GetUpdateInterval)
6106 def CanUpdate(*args, **kwargs):
5ba5649b
RD
6107 """
6108 CanUpdate(Window win) -> bool
6109
6110 Returns ``True`` if it is appropriate to update (send UI update events
6111 to) this window.
6112
6113 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6114 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6115 events were last sent in idle time, and the update interval, to
6116 determine whether events should be sent to this window now. By default
6117 this will always return true because the update mode is initially
6118 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6119 events will be sent as often as possible. You can reduce the frequency
6120 that events are sent by changing the mode and/or setting an update
6121 interval.
6122
6123 """
5b5c9bc7 6124 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
6125
6126 CanUpdate = staticmethod(CanUpdate)
6127 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6128 """
6129 ResetUpdateTime()
6130
6131 Used internally to reset the last-updated time to the current time. It
6132 is assumed that update events are normally sent in idle time, so this
6133 is called at the end of idle processing.
6134 """
5b5c9bc7 6135 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
6136
6137 ResetUpdateTime = staticmethod(ResetUpdateTime)
6138 def SetMode(*args, **kwargs):
5ba5649b
RD
6139 """
6140 SetMode(int mode)
6141
6142 Specify how wxWidgets will send update events: to all windows, or only
6143 to those which specify that they will process the events.
6144
6145 The mode may be one of the following values:
6146
6147 ============================= ==========================================
6148 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6149 is the default setting.
6150 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6151 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6152 style set.
6153 ============================= ==========================================
6154
6155 """
5b5c9bc7 6156 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6157
6158 SetMode = staticmethod(SetMode)
6159 def GetMode(*args, **kwargs):
5ba5649b
RD
6160 """
6161 GetMode() -> int
6162
6163 Returns a value specifying how wxWidgets will send update events: to
6164 all windows, or only to those which specify that they will process the
6165 events.
6166 """
5b5c9bc7 6167 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6168
6169 GetMode = staticmethod(GetMode)
6170
5b5c9bc7 6171class UpdateUIEventPtr(UpdateUIEvent):
d55e5bfc
RD
6172 def __init__(self, this):
6173 self.this = this
6174 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6175 self.__class__ = UpdateUIEvent
6176_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
d55e5bfc 6177
5b5c9bc7 6178def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6179 """
6180 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6181
6182 Sets the interval between updates in milliseconds. Set to -1 to
6183 disable updates, or to 0 to update as frequently as possible. The
6184 default is 0.
6185
6186 Use this to reduce the overhead of UI update events if your
6187 application has a lot of windows. If you set the value to -1 or
6188 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6189 at appropriate points in your application, such as when a dialog is
6190 about to be shown.
6191 """
5b5c9bc7 6192 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 6193
5b5c9bc7 6194def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6195 """
6196 UpdateUIEvent_GetUpdateInterval() -> long
6197
6198 Returns the current interval between updates in milliseconds. -1
6199 disables updates, 0 updates as frequently as possible.
6200 """
5b5c9bc7 6201 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc 6202
5b5c9bc7 6203def UpdateUIEvent_CanUpdate(*args, **kwargs):
5ba5649b
RD
6204 """
6205 UpdateUIEvent_CanUpdate(Window win) -> bool
6206
6207 Returns ``True`` if it is appropriate to update (send UI update events
6208 to) this window.
6209
6210 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6211 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6212 events were last sent in idle time, and the update interval, to
6213 determine whether events should be sent to this window now. By default
6214 this will always return true because the update mode is initially
6215 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6216 events will be sent as often as possible. You can reduce the frequency
6217 that events are sent by changing the mode and/or setting an update
6218 interval.
6219
6220 """
5b5c9bc7 6221 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 6222
5b5c9bc7 6223def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6224 """
6225 UpdateUIEvent_ResetUpdateTime()
6226
6227 Used internally to reset the last-updated time to the current time. It
6228 is assumed that update events are normally sent in idle time, so this
6229 is called at the end of idle processing.
6230 """
5b5c9bc7 6231 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc 6232
5b5c9bc7 6233def UpdateUIEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6234 """
6235 UpdateUIEvent_SetMode(int mode)
6236
6237 Specify how wxWidgets will send update events: to all windows, or only
6238 to those which specify that they will process the events.
6239
6240 The mode may be one of the following values:
6241
6242 ============================= ==========================================
6243 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6244 is the default setting.
6245 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6246 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6247 style set.
6248 ============================= ==========================================
6249
6250 """
5b5c9bc7 6251 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 6252
5b5c9bc7 6253def UpdateUIEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6254 """
6255 UpdateUIEvent_GetMode() -> int
6256
6257 Returns a value specifying how wxWidgets will send update events: to
6258 all windows, or only to those which specify that they will process the
6259 events.
6260 """
5b5c9bc7 6261 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6262
6263#---------------------------------------------------------------------------
6264
5b5c9bc7 6265class SysColourChangedEvent(Event):
5ba5649b
RD
6266 """
6267 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6268 when the user changes the colour settings using the control
6269 panel. This is only applicable under Windows.
6270
6271 The default event handler for this event propagates the event to child
6272 windows, since Windows only sends the events to top-level windows. If
6273 intercepting this event for a top-level window, remember to call
6274 `Skip` so the the base class handler will still be executed, or to
6275 pass the event on to the window's children explicitly.
6276
6277 """
d55e5bfc
RD
6278 def __repr__(self):
6279 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6280 def __init__(self, *args, **kwargs):
5ba5649b
RD
6281 """
6282 __init__(self) -> SysColourChangedEvent
6283
6284 Constructor
6285 """
5b5c9bc7 6286 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
d55e5bfc
RD
6287 self.this = newobj.this
6288 self.thisown = 1
6289 del newobj.thisown
6290
5b5c9bc7 6291class SysColourChangedEventPtr(SysColourChangedEvent):
d55e5bfc
RD
6292 def __init__(self, this):
6293 self.this = this
6294 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6295 self.__class__ = SysColourChangedEvent
6296_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
d55e5bfc
RD
6297
6298#---------------------------------------------------------------------------
6299
5b5c9bc7 6300class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6301 """
6302 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6303 a window that loses its mouse capture. This is called even if
6304 `wx.Window.ReleaseMouse` was called by the application code. Handling
6305 this event allows an application to cater for unexpected capture
6306 releases which might otherwise confuse mouse handling code.
6307
6308 This event is implemented under Windows only.
6309 """
d55e5bfc
RD
6310 def __repr__(self):
6311 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6312 def __init__(self, *args, **kwargs):
5ba5649b
RD
6313 """
6314 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6315
6316 Constructor
6317 """
5b5c9bc7 6318 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
d55e5bfc
RD
6319 self.this = newobj.this
6320 self.thisown = 1
6321 del newobj.thisown
6322 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6323 """
6324 GetCapturedWindow(self) -> Window
6325
6326 Returns the window that gained the capture, or ``None`` if it was a
6327 non-wxWidgets window.
6328 """
5b5c9bc7 6329 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc
RD
6330
6331
5b5c9bc7 6332class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
d55e5bfc
RD
6333 def __init__(self, this):
6334 self.this = this
6335 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6336 self.__class__ = MouseCaptureChangedEvent
6337_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
d55e5bfc
RD
6338
6339#---------------------------------------------------------------------------
6340
5b5c9bc7 6341class DisplayChangedEvent(Event):
5ba5649b
RD
6342 """
6343 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6344 resolution has changed.
6345
6346 This event is implemented under Windows only.
6347 """
d55e5bfc
RD
6348 def __repr__(self):
6349 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6350 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
6351 """__init__(self) -> DisplayChangedEvent"""
6352 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
d55e5bfc
RD
6353 self.this = newobj.this
6354 self.thisown = 1
6355 del newobj.thisown
6356
5b5c9bc7 6357class DisplayChangedEventPtr(DisplayChangedEvent):
d55e5bfc
RD
6358 def __init__(self, this):
6359 self.this = this
6360 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6361 self.__class__ = DisplayChangedEvent
6362_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
d55e5bfc
RD
6363
6364#---------------------------------------------------------------------------
6365
5b5c9bc7 6366class PaletteChangedEvent(Event):
5ba5649b
RD
6367 """
6368 An EVT_PALETTE_CHANGED event is sent when the system palette has
6369 changed, thereby giving each window a chance to redo their own to
6370 match.
6371
6372 This event is implemented under Windows only.
6373 """
d55e5bfc
RD
6374 def __repr__(self):
6375 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6376 def __init__(self, *args, **kwargs):
5ba5649b
RD
6377 """
6378 __init__(self, int id=0) -> PaletteChangedEvent
6379
6380 An EVT_PALETTE_CHANGED event is sent when the system palette has
6381 changed, thereby giving each window a chance to redo their own to
6382 match.
6383
6384 This event is implemented under Windows only.
6385 """
5b5c9bc7 6386 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
d55e5bfc
RD
6387 self.this = newobj.this
6388 self.thisown = 1
6389 del newobj.thisown
6390 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6391 """SetChangedWindow(self, Window win)"""
6392 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
6393
6394 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6395 """GetChangedWindow(self) -> Window"""
6396 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc
RD
6397
6398
5b5c9bc7 6399class PaletteChangedEventPtr(PaletteChangedEvent):
d55e5bfc
RD
6400 def __init__(self, this):
6401 self.this = this
6402 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6403 self.__class__ = PaletteChangedEvent
6404_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
d55e5bfc
RD
6405
6406#---------------------------------------------------------------------------
6407
5b5c9bc7 6408class QueryNewPaletteEvent(Event):
5ba5649b
RD
6409 """
6410 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6411 focus and should re-do its palette.
6412
6413 This event is implemented under Windows only.
6414 """
d55e5bfc
RD
6415 def __repr__(self):
6416 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6417 def __init__(self, *args, **kwargs):
5ba5649b
RD
6418 """
6419 __init__(self, int winid=0) -> QueryNewPaletteEvent
6420
6421 Constructor.
6422 """
5b5c9bc7 6423 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
d55e5bfc
RD
6424 self.this = newobj.this
6425 self.thisown = 1
6426 del newobj.thisown
6427 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6428 """
6429 SetPaletteRealized(self, bool realized)
6430
6431 App should set this if it changes the palette.
6432 """
5b5c9bc7 6433 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
6434
6435 def GetPaletteRealized(*args, **kwargs):
6436 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 6437 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
6438
6439
5b5c9bc7 6440class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
d55e5bfc
RD
6441 def __init__(self, this):
6442 self.this = this
6443 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6444 self.__class__ = QueryNewPaletteEvent
6445_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
d55e5bfc
RD
6446
6447#---------------------------------------------------------------------------
6448
5b5c9bc7 6449class NavigationKeyEvent(Event):
5ba5649b
RD
6450 """
6451 EVT_NAVIGATION_KEY events are used to control moving the focus between
6452 widgets, otherwise known as tab-traversal. You woudl normally not
6453 catch navigation events in applications as there are already
6454 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6455 it useful to send navigation events in certain situations to change
6456 the focus in certain ways, although it's probably easier to just call
6457 `wx.Window.Navigate`.
6458 """
d55e5bfc
RD
6459 def __repr__(self):
6460 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6461 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
6462 """__init__(self) -> NavigationKeyEvent"""
6463 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
d55e5bfc
RD
6464 self.this = newobj.this
6465 self.thisown = 1
6466 del newobj.thisown
6467 def GetDirection(*args, **kwargs):
5ba5649b
RD
6468 """
6469 GetDirection(self) -> bool
6470
6471 Returns ``True`` if the direction is forward, ``False`` otherwise.
6472 """
5b5c9bc7 6473 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
6474
6475 def SetDirection(*args, **kwargs):
5ba5649b
RD
6476 """
6477 SetDirection(self, bool forward)
6478
6479 Specify the direction that the navigation should take. Usually the
6480 difference between using Tab and Shift-Tab.
6481 """
5b5c9bc7 6482 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
6483
6484 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6485 """
6486 IsWindowChange(self) -> bool
6487
6488 Returns ``True`` if window change is allowed.
6489 """
5b5c9bc7 6490 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
6491
6492 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6493 """
6494 SetWindowChange(self, bool ischange)
6495
6496 Specify if the navigation should be able to change parent windows.
6497 For example, changing notebook pages, etc. This is usually implemented
6498 by using Control-Tab.
6499 """
5b5c9bc7 6500 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 6501
68350608 6502 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6503 """
6504 IsFromTab(self) -> bool
6505
6506 Returns ``True`` if the navigation event is originated from the Tab
6507 key.
6508 """
5b5c9bc7 6509 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
6510
6511 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6512 """
6513 SetFromTab(self, bool bIs)
6514
6515 Set to true under MSW if the event was generated using the tab key.
6516 This is required for proper navogation over radio buttons.
6517 """
5b5c9bc7 6518 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 6519
908b74cd 6520 def SetFlags(*args, **kwargs):
5ba5649b
RD
6521 """
6522 SetFlags(self, long flags)
6523
6524 Set the navigation flags to a combination of the following:
6525
6526 * wx.NavigationKeyEvent.IsBackward
6527 * wx.NavigationKeyEvent.IsForward
6528 * wx.NavigationKeyEvent.WinChange
6529 * wx.NavigationKeyEvent.FromTab
6530
6531 """
5b5c9bc7 6532 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6533
d55e5bfc 6534 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6535 """
6536 GetCurrentFocus(self) -> Window
6537
6538 Returns the child window which currenty has the focus. May be
6539 ``None``.
6540 """
5b5c9bc7 6541 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6542
6543 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6544 """
6545 SetCurrentFocus(self, Window win)
6546
6547 Set the window that has the focus.
6548 """
5b5c9bc7 6549 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6550
5b5c9bc7
RD
6551 IsBackward = _core_.NavigationKeyEvent_IsBackward
6552 IsForward = _core_.NavigationKeyEvent_IsForward
6553 WinChange = _core_.NavigationKeyEvent_WinChange
6554 FromTab = _core_.NavigationKeyEvent_FromTab
d55e5bfc 6555
5b5c9bc7 6556class NavigationKeyEventPtr(NavigationKeyEvent):
d55e5bfc
RD
6557 def __init__(self, this):
6558 self.this = this
6559 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6560 self.__class__ = NavigationKeyEvent
6561_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
d55e5bfc
RD
6562
6563#---------------------------------------------------------------------------
6564
5b5c9bc7 6565class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6566 """
6567 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6568 underlying GUI object) exists.
6569 """
d55e5bfc
RD
6570 def __repr__(self):
6571 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6572 def __init__(self, *args, **kwargs):
5ba5649b
RD
6573 """
6574 __init__(self, Window win=None) -> WindowCreateEvent
6575
6576 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6577 underlying GUI object) exists.
6578 """
5b5c9bc7 6579 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
d55e5bfc
RD
6580 self.this = newobj.this
6581 self.thisown = 1
6582 del newobj.thisown
6583 def GetWindow(*args, **kwargs):
5ba5649b
RD
6584 """
6585 GetWindow(self) -> Window
6586
6587 Returns the window that this event refers to.
6588 """
5b5c9bc7 6589 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
6590
6591
5b5c9bc7 6592class WindowCreateEventPtr(WindowCreateEvent):
d55e5bfc
RD
6593 def __init__(self, this):
6594 self.this = this
6595 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6596 self.__class__ = WindowCreateEvent
6597_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
d55e5bfc 6598
5b5c9bc7 6599class WindowDestroyEvent(CommandEvent):
5ba5649b 6600 """
943e8dfd
RD
6601 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6602 when the GUI window is destroyed.
6603
6604 When a class derived from `wx.Window` is destroyed its destructor will
6605 have already run by the time this event is sent. Therefore this event
6606 will not usually be received at all by the window itself. Since it is
6607 received after the destructor has run, an object should not try to
6608 handle its own wx.WindowDestroyEvent, but it can be used to get
6609 notification of the destruction of another window.
5ba5649b 6610 """
d55e5bfc
RD
6611 def __repr__(self):
6612 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6613 def __init__(self, *args, **kwargs):
5ba5649b
RD
6614 """
6615 __init__(self, Window win=None) -> WindowDestroyEvent
6616
943e8dfd
RD
6617 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6618 when the GUI window is destroyed.
6619
6620 When a class derived from `wx.Window` is destroyed its destructor will
6621 have already run by the time this event is sent. Therefore this event
6622 will not usually be received at all by the window itself. Since it is
6623 received after the destructor has run, an object should not try to
6624 handle its own wx.WindowDestroyEvent, but it can be used to get
6625 notification of the destruction of another window.
5ba5649b 6626 """
5b5c9bc7 6627 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
d55e5bfc
RD
6628 self.this = newobj.this
6629 self.thisown = 1
6630 del newobj.thisown
6631 def GetWindow(*args, **kwargs):
5ba5649b
RD
6632 """
6633 GetWindow(self) -> Window
6634
6635 Returns the window that this event refers to.
6636 """
5b5c9bc7 6637 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
6638
6639
5b5c9bc7 6640class WindowDestroyEventPtr(WindowDestroyEvent):
d55e5bfc
RD
6641 def __init__(self, this):
6642 self.this = this
6643 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6644 self.__class__ = WindowDestroyEvent
6645_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
d55e5bfc
RD
6646
6647#---------------------------------------------------------------------------
6648
5b5c9bc7 6649class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6650 """
6651 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6652 give the application a chance to show a context (popup) menu.
6653 """
d55e5bfc
RD
6654 def __repr__(self):
6655 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6656 def __init__(self, *args, **kwargs):
5ba5649b
RD
6657 """
6658 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6659
6660 Constructor.
6661 """
5b5c9bc7 6662 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
d55e5bfc
RD
6663 self.this = newobj.this
6664 self.thisown = 1
6665 del newobj.thisown
6666 def GetPosition(*args, **kwargs):
5ba5649b
RD
6667 """
6668 GetPosition(self) -> Point
6669
6670 Returns the position (in screen coordinants) at which the menu should
6671 be shown.
6672 """
5b5c9bc7 6673 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6674
6675 def SetPosition(*args, **kwargs):
5ba5649b
RD
6676 """
6677 SetPosition(self, Point pos)
6678
6679 Sets the position at which the menu should be shown.
6680 """
5b5c9bc7 6681 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
6682
6683
5b5c9bc7 6684class ContextMenuEventPtr(ContextMenuEvent):
d55e5bfc
RD
6685 def __init__(self, this):
6686 self.this = this
6687 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6688 self.__class__ = ContextMenuEvent
6689_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
d55e5bfc
RD
6690
6691#---------------------------------------------------------------------------
6692
5b5c9bc7
RD
6693IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6694IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6695class IdleEvent(Event):
5ba5649b
RD
6696 """
6697 This class is used for EVT_IDLE events, which are generated and sent
6698 when the application *becomes* idle. In other words, the when the
6699 event queue becomes empty then idle events are sent to all windows (by
6700 default) and as long as none of them call `RequestMore` then there are
6701 no more idle events until after the system event queue has some normal
6702 events and then becomes empty again.
6703
6704 By default, idle events are sent to all windows. If this is causing a
6705 significant overhead in your application, you can call
6706 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6707 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6708 which should receive idle events. Then idle events will only be sent
6709 to those windows and not to any others.
6710 """
d55e5bfc
RD
6711 def __repr__(self):
6712 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6713 def __init__(self, *args, **kwargs):
5ba5649b
RD
6714 """
6715 __init__(self) -> IdleEvent
6716
6717 Constructor
6718 """
5b5c9bc7 6719 newobj = _core_.new_IdleEvent(*args, **kwargs)
d55e5bfc
RD
6720 self.this = newobj.this
6721 self.thisown = 1
6722 del newobj.thisown
6723 def RequestMore(*args, **kwargs):
5ba5649b
RD
6724 """
6725 RequestMore(self, bool needMore=True)
6726
6727 Tells wxWidgets that more processing is required. This function can be
6728 called by an EVT_IDLE handler for a window to indicate that the
6729 application should forward the EVT_IDLE event once more to the
6730 application windows. If no window calls this function during its
6731 EVT_IDLE handler, then the application will remain in a passive event
6732 loop until a new event is posted to the application by the windowing
6733 system.
6734 """
5b5c9bc7 6735 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6736
6737 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6738 """
6739 MoreRequested(self) -> bool
6740
6741 Returns ``True`` if the OnIdle function processing this event
6742 requested more processing time.
6743 """
5b5c9bc7 6744 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6745
6746 def SetMode(*args, **kwargs):
5ba5649b
RD
6747 """
6748 SetMode(int mode)
6749
6750 Static method for specifying how wxWidgets will send idle events: to
6751 all windows, or only to those which specify that they will process the
6752 events.
6753
6754 The mode can be one of the following values:
6755
6756 ========================= ========================================
6757 wx.IDLE_PROCESS_ALL Send idle events to all windows
6758 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6759 the wx.WS_EX_PROCESS_IDLE extra style
6760 flag set.
6761 ========================= ========================================
6762
6763 """
5b5c9bc7 6764 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6765
6766 SetMode = staticmethod(SetMode)
6767 def GetMode(*args, **kwargs):
5ba5649b
RD
6768 """
6769 GetMode() -> int
6770
6771 Static method returning a value specifying how wxWidgets will send
6772 idle events: to all windows, or only to those which specify that they
6773 will process the events.
6774 """
5b5c9bc7 6775 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6776
6777 GetMode = staticmethod(GetMode)
6778 def CanSend(*args, **kwargs):
5ba5649b
RD
6779 """
6780 CanSend(Window win) -> bool
6781
6782 Returns ``True`` if it is appropriate to send idle events to this
6783 window.
6784
6785 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6786 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6787 events should be sent to this window now. By default this will always
6788 return ``True`` because the update mode is initially
6789 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6790 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6791 """
5b5c9bc7 6792 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6793
6794 CanSend = staticmethod(CanSend)
6795
5b5c9bc7 6796class IdleEventPtr(IdleEvent):
d55e5bfc
RD
6797 def __init__(self, this):
6798 self.this = this
6799 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6800 self.__class__ = IdleEvent
6801_core_.IdleEvent_swigregister(IdleEventPtr)
d55e5bfc 6802
5b5c9bc7 6803def IdleEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6804 """
6805 IdleEvent_SetMode(int mode)
6806
6807 Static method for specifying how wxWidgets will send idle events: to
6808 all windows, or only to those which specify that they will process the
6809 events.
6810
6811 The mode can be one of the following values:
6812
6813 ========================= ========================================
6814 wx.IDLE_PROCESS_ALL Send idle events to all windows
6815 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6816 the wx.WS_EX_PROCESS_IDLE extra style
6817 flag set.
6818 ========================= ========================================
6819
6820 """
5b5c9bc7 6821 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6822
5b5c9bc7 6823def IdleEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6824 """
6825 IdleEvent_GetMode() -> int
6826
6827 Static method returning a value specifying how wxWidgets will send
6828 idle events: to all windows, or only to those which specify that they
6829 will process the events.
6830 """
5b5c9bc7 6831 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc 6832
5b5c9bc7 6833def IdleEvent_CanSend(*args, **kwargs):
5ba5649b
RD
6834 """
6835 IdleEvent_CanSend(Window win) -> bool
6836
6837 Returns ``True`` if it is appropriate to send idle events to this
6838 window.
6839
6840 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6841 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6842 events should be sent to this window now. By default this will always
6843 return ``True`` because the update mode is initially
6844 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6845 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6846 """
5b5c9bc7 6847 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6848
6849#---------------------------------------------------------------------------
6850
5b5c9bc7 6851class PyEvent(Event):
5ba5649b
RD
6852 """
6853 wx.PyEvent can be used as a base class for implementing custom event
6854 types in Python. You should derived from this class instead of
6855 `wx.Event` because this class is Python-aware and is able to transport
6856 its Python bits safely through the wxWidgets event system and have
6857 them still be there when the event handler is invoked.
6858
6859 :see: `wx.PyCommandEvent`
6860
6861 """
d55e5bfc
RD
6862 def __repr__(self):
6863 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6864 def __init__(self, *args, **kwargs):
5ba5649b 6865 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
5b5c9bc7 6866 newobj = _core_.new_PyEvent(*args, **kwargs)
d55e5bfc
RD
6867 self.this = newobj.this
6868 self.thisown = 1
6869 del newobj.thisown
5ba5649b 6870 self._SetSelf(self)
d55e5bfc 6871
5b5c9bc7 6872 def __del__(self, destroy=_core_.delete_PyEvent):
d55e5bfc
RD
6873 """__del__(self)"""
6874 try:
6875 if self.thisown: destroy(self)
6876 except: pass
6877
5ba5649b
RD
6878 def _SetSelf(*args, **kwargs):
6879 """_SetSelf(self, PyObject self)"""
6880 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6881
5ba5649b
RD
6882 def _GetSelf(*args, **kwargs):
6883 """_GetSelf(self) -> PyObject"""
6884 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc
RD
6885
6886
5b5c9bc7 6887class PyEventPtr(PyEvent):
d55e5bfc
RD
6888 def __init__(self, this):
6889 self.this = this
6890 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6891 self.__class__ = PyEvent
6892_core_.PyEvent_swigregister(PyEventPtr)
d55e5bfc 6893
5b5c9bc7 6894class PyCommandEvent(CommandEvent):
5ba5649b
RD
6895 """
6896 wx.PyCommandEvent can be used as a base class for implementing custom
6897 event types in Python, where the event shoudl travel up to parent
6898 windows looking for a handler. You should derived from this class
6899 instead of `wx.CommandEvent` because this class is Python-aware and is
6900 able to transport its Python bits safely through the wxWidgets event
6901 system and have them still be there when the event handler is invoked.
6902
6903 :see: `wx.PyEvent`
6904
6905 """
d55e5bfc
RD
6906 def __repr__(self):
6907 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6908 def __init__(self, *args, **kwargs):
5ba5649b 6909 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
5b5c9bc7 6910 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
d55e5bfc
RD
6911 self.this = newobj.this
6912 self.thisown = 1
6913 del newobj.thisown
5ba5649b 6914 self._SetSelf(self)
d55e5bfc 6915
5b5c9bc7 6916 def __del__(self, destroy=_core_.delete_PyCommandEvent):
d55e5bfc
RD
6917 """__del__(self)"""
6918 try:
6919 if self.thisown: destroy(self)
6920 except: pass
6921
5ba5649b
RD
6922 def _SetSelf(*args, **kwargs):
6923 """_SetSelf(self, PyObject self)"""
6924 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6925
5ba5649b
RD
6926 def _GetSelf(*args, **kwargs):
6927 """_GetSelf(self) -> PyObject"""
6928 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc
RD
6929
6930
5b5c9bc7 6931class PyCommandEventPtr(PyCommandEvent):
d55e5bfc
RD
6932 def __init__(self, this):
6933 self.this = this
6934 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6935 self.__class__ = PyCommandEvent
6936_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
d55e5bfc 6937
5b5c9bc7 6938class DateEvent(CommandEvent):
5ba5649b
RD
6939 """
6940 This event class holds information about a date change event and is
6941 used together with `wx.DatePickerCtrl`. It also serves as a base class
6942 for `wx.calendar.CalendarEvent`. Bind these event types with
6943 EVT_DATE_CHANGED.
6944 """
53aa7709
RD
6945 def __repr__(self):
6946 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6947 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
6948 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6949 newobj = _core_.new_DateEvent(*args, **kwargs)
53aa7709
RD
6950 self.this = newobj.this
6951 self.thisown = 1
6952 del newobj.thisown
6953 def GetDate(*args, **kwargs):
5ba5649b
RD
6954 """
6955 GetDate(self) -> DateTime
6956
6957 Returns the date.
6958 """
5b5c9bc7 6959 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6960
6961 def SetDate(*args, **kwargs):
5ba5649b
RD
6962 """
6963 SetDate(self, DateTime date)
6964
6965 Sets the date carried by the event, normally only used by the library
6966 internally.
6967 """
5b5c9bc7 6968 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709
RD
6969
6970
5b5c9bc7 6971class DateEventPtr(DateEvent):
53aa7709
RD
6972 def __init__(self, this):
6973 self.this = this
6974 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6975 self.__class__ = DateEvent
6976_core_.DateEvent_swigregister(DateEventPtr)
53aa7709 6977
5b5c9bc7 6978wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
6979EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6980
d55e5bfc
RD
6981#---------------------------------------------------------------------------
6982
5b5c9bc7
RD
6983PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6984PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6985PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6986PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6987PRINT_WINDOWS = _core_.PRINT_WINDOWS
6988PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6989class PyApp(EvtHandler):
d6c14a4c
RD
6990 """
6991 The ``wx.PyApp`` class is an *implementation detail*, please use the
6992 `wx.App` class (or some other derived class) instead.
6993 """
d55e5bfc
RD
6994 def __repr__(self):
6995 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6996 def __init__(self, *args, **kwargs):
6997 """
5b5c9bc7 6998 __init__(self) -> PyApp
d55e5bfc
RD
6999
7000 Create a new application object, starting the bootstrap process.
7001 """
5b5c9bc7 7002 newobj = _core_.new_PyApp(*args, **kwargs)
d55e5bfc
RD
7003 self.this = newobj.this
7004 self.thisown = 1
7005 del newobj.thisown
7993762b
RD
7006 self._setCallbackInfo(self, PyApp, False)
7007 self._setOORInfo(self, False)
d55e5bfc 7008
5b5c9bc7 7009 def __del__(self, destroy=_core_.delete_PyApp):
d55e5bfc
RD
7010 """__del__(self)"""
7011 try:
7012 if self.thisown: destroy(self)
7013 except: pass
7014
7015 def _setCallbackInfo(*args, **kwargs):
7993762b 7016 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5b5c9bc7 7017 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
7018
7019 def GetAppName(*args, **kwargs):
7020 """
5b5c9bc7 7021 GetAppName(self) -> String
d55e5bfc
RD
7022
7023 Get the application name.
7024 """
5b5c9bc7 7025 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
7026
7027 def SetAppName(*args, **kwargs):
7028 """
5b5c9bc7 7029 SetAppName(self, String name)
d55e5bfc 7030
d6c14a4c
RD
7031 Set the application name. This value may be used automatically by
7032 `wx.Config` and such.
d55e5bfc 7033 """
5b5c9bc7 7034 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
7035
7036 def GetClassName(*args, **kwargs):
7037 """
5b5c9bc7 7038 GetClassName(self) -> String
d55e5bfc
RD
7039
7040 Get the application's class name.
7041 """
5b5c9bc7 7042 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
7043
7044 def SetClassName(*args, **kwargs):
7045 """
5b5c9bc7 7046 SetClassName(self, String name)
d55e5bfc 7047
d6c14a4c
RD
7048 Set the application's class name. This value may be used for
7049 X-resources if applicable for the platform
d55e5bfc 7050 """
5b5c9bc7 7051 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
7052
7053 def GetVendorName(*args, **kwargs):
7054 """
5b5c9bc7 7055 GetVendorName(self) -> String
d55e5bfc
RD
7056
7057 Get the application's vendor name.
7058 """
5b5c9bc7 7059 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
7060
7061 def SetVendorName(*args, **kwargs):
7062 """
5b5c9bc7 7063 SetVendorName(self, String name)
d55e5bfc 7064
d6c14a4c
RD
7065 Set the application's vendor name. This value may be used
7066 automatically by `wx.Config` and such.
d55e5bfc 7067 """
5b5c9bc7 7068 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
7069
7070 def GetTraits(*args, **kwargs):
7071 """
7072 GetTraits(self) -> wxAppTraits
7073
d6c14a4c
RD
7074 Return (and create if necessary) the app traits object to which we
7075 delegate for everything which either should be configurable by the
7076 user (then he can change the default behaviour simply by overriding
7077 CreateTraits() and returning his own traits object) or which is
7078 GUI/console dependent as then wx.AppTraits allows us to abstract the
7079 differences behind the common facade.
7080
7081 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 7082 """
5b5c9bc7 7083 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
7084
7085 def ProcessPendingEvents(*args, **kwargs):
7086 """
7087 ProcessPendingEvents(self)
7088
d6c14a4c
RD
7089 Process all events in the Pending Events list -- it is necessary to
7090 call this function to process posted events. This normally happens
7091 during each event loop iteration.
d55e5bfc 7092 """
5b5c9bc7 7093 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
7094
7095 def Yield(*args, **kwargs):
7096 """
7097 Yield(self, bool onlyIfNeeded=False) -> bool
7098
d6c14a4c
RD
7099 Process all currently pending events right now, instead of waiting
7100 until return to the event loop. It is an error to call ``Yield``
7101 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 7102
d6c14a4c 7103 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
7104 reentrancies (i.e. when called from an event handler it may
7105 result in calling the same event handler again), use with
7106 extreme care or, better, don't use at all!
d55e5bfc 7107
d6c14a4c 7108 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 7109
d55e5bfc 7110 """
5b5c9bc7 7111 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
7112
7113 def WakeUpIdle(*args, **kwargs):
7114 """
7115 WakeUpIdle(self)
7116
d6c14a4c
RD
7117 Make sure that idle events are sent again.
7118 :see: `wx.WakeUpIdle`
d55e5bfc 7119 """
5b5c9bc7 7120 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 7121
84f85550
RD
7122 def IsMainLoopRunning(*args, **kwargs):
7123 """
7124 IsMainLoopRunning() -> bool
7125
7126 Returns True if we're running the main loop, i.e. if the events can
7127 currently be dispatched.
7128 """
5b5c9bc7 7129 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
7130
7131 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
7132 def MainLoop(*args, **kwargs):
7133 """
7134 MainLoop(self) -> int
7135
d6c14a4c
RD
7136 Execute the main GUI loop, the function doesn't normally return until
7137 all top level windows have been closed and destroyed.
d55e5bfc 7138 """
5b5c9bc7 7139 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
7140
7141 def Exit(*args, **kwargs):
7142 """
7143 Exit(self)
7144
7145 Exit the main loop thus terminating the application.
d6c14a4c 7146 :see: `wx.Exit`
d55e5bfc 7147 """
5b5c9bc7 7148 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc
RD
7149
7150 def ExitMainLoop(*args, **kwargs):
7151 """
7152 ExitMainLoop(self)
7153
d6c14a4c
RD
7154 Exit the main GUI loop during the next iteration of the main
7155 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 7156 """
5b5c9bc7 7157 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
7158
7159 def Pending(*args, **kwargs):
7160 """
7161 Pending(self) -> bool
7162
7163 Returns True if there are unprocessed events in the event queue.
7164 """
5b5c9bc7 7165 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
7166
7167 def Dispatch(*args, **kwargs):
7168 """
7169 Dispatch(self) -> bool
7170
7171 Process the first event in the event queue (blocks until an event
7172 appears if there are none currently)
7173 """
5b5c9bc7 7174 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
7175
7176 def ProcessIdle(*args, **kwargs):
7177 """
7178 ProcessIdle(self) -> bool
7179
d6c14a4c
RD
7180 Called from the MainLoop when the application becomes idle (there are
7181 no pending events) and sends a `wx.IdleEvent` to all interested
7182 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 7183 """
5b5c9bc7 7184 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
7185
7186 def SendIdleEvents(*args, **kwargs):
7187 """
5b5c9bc7 7188 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 7189
d6c14a4c
RD
7190 Send idle event to window and all subwindows. Returns True if more
7191 idle time is requested.
d55e5bfc 7192 """
5b5c9bc7 7193 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
7194
7195 def IsActive(*args, **kwargs):
7196 """
7197 IsActive(self) -> bool
7198
7199 Return True if our app has focus.
7200 """
5b5c9bc7 7201 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
7202
7203 def SetTopWindow(*args, **kwargs):
7204 """
5b5c9bc7 7205 SetTopWindow(self, Window win)
d55e5bfc 7206
d6c14a4c 7207 Set the *main* top level window
d55e5bfc 7208 """
5b5c9bc7 7209 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
7210
7211 def GetTopWindow(*args, **kwargs):
7212 """
5b5c9bc7 7213 GetTopWindow(self) -> Window
d55e5bfc 7214
d6c14a4c
RD
7215 Return the *main* top level window (if it hadn't been set previously
7216 with SetTopWindow(), will return just some top level window and, if
7217 there not any, will return None)
d55e5bfc 7218 """
5b5c9bc7 7219 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
7220
7221 def SetExitOnFrameDelete(*args, **kwargs):
7222 """
7223 SetExitOnFrameDelete(self, bool flag)
7224
d6c14a4c
RD
7225 Control the exit behaviour: by default, the program will exit the main
7226 loop (and so, usually, terminate) when the last top-level program
7227 window is deleted. Beware that if you disable this behaviour (with
7228 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7229 explicitly from somewhere.
d55e5bfc 7230 """
5b5c9bc7 7231 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
7232
7233 def GetExitOnFrameDelete(*args, **kwargs):
7234 """
7235 GetExitOnFrameDelete(self) -> bool
7236
7237 Get the current exit behaviour setting.
7238 """
5b5c9bc7 7239 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
7240
7241 def SetUseBestVisual(*args, **kwargs):
7242 """
7243 SetUseBestVisual(self, bool flag)
7244
d6c14a4c
RD
7245 Set whether the app should try to use the best available visual on
7246 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 7247 """
5b5c9bc7 7248 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
7249
7250 def GetUseBestVisual(*args, **kwargs):
7251 """
7252 GetUseBestVisual(self) -> bool
7253
7254 Get current UseBestVisual setting.
7255 """
5b5c9bc7 7256 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
7257
7258 def SetPrintMode(*args, **kwargs):
7259 """SetPrintMode(self, int mode)"""
5b5c9bc7 7260 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
7261
7262 def GetPrintMode(*args, **kwargs):
7263 """GetPrintMode(self) -> int"""
5b5c9bc7 7264 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
7265
7266 def SetAssertMode(*args, **kwargs):
7267 """
7268 SetAssertMode(self, int mode)
7269
15817c7e 7270 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 7271 """
5b5c9bc7 7272 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
7273
7274 def GetAssertMode(*args, **kwargs):
7275 """
7276 GetAssertMode(self) -> int
7277
7278 Get the current OnAssert behaviour setting.
7279 """
5b5c9bc7 7280 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
7281
7282 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7283 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 7284 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7285
7286 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7287 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7288 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 7289 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7290
7291 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7292 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7293 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 7294 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7295
7296 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7297 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7298 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 7299 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7300
7301 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7302 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7303 """GetMacHelpMenuTitleName() -> String"""
7304 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7305
7306 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7307 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7308 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 7309 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7310
7311 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7312 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7313 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 7314 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7315
7316 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7317 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7318 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 7319 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7320
7321 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7322 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7323 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 7324 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7325
7326 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7327 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7328 """SetMacHelpMenuTitleName(String val)"""
7329 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7330
7331 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7332 def _BootstrapApp(*args, **kwargs):
7333 """
7334 _BootstrapApp(self)
7335
7336 For internal use only
7337 """
5b5c9bc7 7338 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
7339
7340 def GetComCtl32Version(*args, **kwargs):
7341 """
d6c14a4c 7342 GetComCtl32Version() -> int
d55e5bfc 7343
d6c14a4c
RD
7344 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7345 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7346 """
5b5c9bc7 7347 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
7348
7349 GetComCtl32Version = staticmethod(GetComCtl32Version)
7350
5b5c9bc7 7351class PyAppPtr(PyApp):
d55e5bfc
RD
7352 def __init__(self, this):
7353 self.this = this
7354 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7355 self.__class__ = PyApp
7356_core_.PyApp_swigregister(PyAppPtr)
d55e5bfc 7357
5b5c9bc7 7358def PyApp_IsMainLoopRunning(*args, **kwargs):
84f85550 7359 """
5b5c9bc7 7360 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
7361
7362 Returns True if we're running the main loop, i.e. if the events can
7363 currently be dispatched.
7364 """
5b5c9bc7 7365 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550 7366
5b5c9bc7
RD
7367def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
7368 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7369 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 7370
5b5c9bc7
RD
7371def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
7372 """PyApp_GetMacAboutMenuItemId() -> long"""
7373 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 7374
5b5c9bc7
RD
7375def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
7376 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7377 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 7378
5b5c9bc7
RD
7379def PyApp_GetMacExitMenuItemId(*args, **kwargs):
7380 """PyApp_GetMacExitMenuItemId() -> long"""
7381 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 7382
5b5c9bc7
RD
7383def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
7384 """PyApp_GetMacHelpMenuTitleName() -> String"""
7385 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7386
5b5c9bc7
RD
7387def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7388 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7389 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 7390
5b5c9bc7
RD
7391def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7392 """PyApp_SetMacAboutMenuItemId(long val)"""
7393 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 7394
5b5c9bc7
RD
7395def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7396 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7397 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 7398
5b5c9bc7
RD
7399def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7400 """PyApp_SetMacExitMenuItemId(long val)"""
7401 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 7402
5b5c9bc7
RD
7403def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7404 """PyApp_SetMacHelpMenuTitleName(String val)"""
7405 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7406
5b5c9bc7 7407def PyApp_GetComCtl32Version(*args, **kwargs):
d55e5bfc 7408 """
5b5c9bc7 7409 PyApp_GetComCtl32Version() -> int
d55e5bfc 7410
d6c14a4c
RD
7411 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7412 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7413 """
5b5c9bc7 7414 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
7415
7416#---------------------------------------------------------------------------
7417
7418
5b5c9bc7 7419def Exit(*args, **kwargs):
d55e5bfc 7420 """
5b5c9bc7 7421 Exit()
d55e5bfc
RD
7422
7423 Force an exit of the application. Convenience for wx.GetApp().Exit()
7424 """
5b5c9bc7 7425 return _core_.Exit(*args, **kwargs)
d55e5bfc 7426
5b5c9bc7 7427def Yield(*args, **kwargs):
d55e5bfc 7428 """
5b5c9bc7 7429 Yield() -> bool
d55e5bfc
RD
7430
7431 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7432 """
5b5c9bc7 7433 return _core_.Yield(*args, **kwargs)
d55e5bfc 7434
5b5c9bc7 7435def YieldIfNeeded(*args, **kwargs):
d55e5bfc 7436 """
5b5c9bc7 7437 YieldIfNeeded() -> bool
d55e5bfc
RD
7438
7439 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7440 """
5b5c9bc7 7441 return _core_.YieldIfNeeded(*args, **kwargs)
d55e5bfc 7442
5b5c9bc7 7443def SafeYield(*args, **kwargs):
d55e5bfc 7444 """
5b5c9bc7 7445 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 7446
d6c14a4c
RD
7447 This function is similar to `wx.Yield`, except that it disables the
7448 user input to all program windows before calling `wx.Yield` and
7449 re-enables it again afterwards. If ``win`` is not None, this window
7450 will remain enabled, allowing the implementation of some limited user
7451 interaction.
d55e5bfc 7452
d6c14a4c 7453 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 7454 """
5b5c9bc7 7455 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 7456
5b5c9bc7 7457def WakeUpIdle(*args, **kwargs):
d55e5bfc 7458 """
5b5c9bc7 7459 WakeUpIdle()
d55e5bfc 7460
d6c14a4c
RD
7461 Cause the message queue to become empty again, so idle events will be
7462 sent.
d55e5bfc 7463 """
5b5c9bc7 7464 return _core_.WakeUpIdle(*args, **kwargs)
d55e5bfc 7465
5b5c9bc7 7466def PostEvent(*args, **kwargs):
d55e5bfc 7467 """
5b5c9bc7 7468 PostEvent(EvtHandler dest, Event event)
d55e5bfc 7469
d6c14a4c
RD
7470 Send an event to a window or other wx.EvtHandler to be processed
7471 later.
d55e5bfc 7472 """
5b5c9bc7 7473 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 7474
5b5c9bc7 7475def App_CleanUp(*args, **kwargs):
d55e5bfc 7476 """
5b5c9bc7 7477 App_CleanUp()
d55e5bfc 7478
15817c7e 7479 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 7480 Python shuts down.
d55e5bfc 7481 """
5b5c9bc7 7482 return _core_.App_CleanUp(*args, **kwargs)
d55e5bfc
RD
7483
7484def GetApp(*args, **kwargs):
7485 """
5b5c9bc7 7486 GetApp() -> PyApp
d55e5bfc
RD
7487
7488 Return a reference to the current wx.App object.
7489 """
5b5c9bc7 7490 return _core_.GetApp(*args, **kwargs)
5cbf236d 7491
5b5c9bc7 7492def SetDefaultPyEncoding(*args, **kwargs):
5cbf236d
RD
7493 """
7494 SetDefaultPyEncoding(string encoding)
7495
7496 Sets the encoding that wxPython will use when it needs to convert a
7497 Python string or unicode object to or from a wxString.
62d32a5f
RD
7498
7499 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7500 but please be aware that the default encoding within the same locale
7501 may be slightly different on different platforms. For example, please
7502 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7503 between the common latin/roman encodings.
5cbf236d 7504 """
5b5c9bc7 7505 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7506
5b5c9bc7 7507def GetDefaultPyEncoding(*args, **kwargs):
5cbf236d
RD
7508 """
7509 GetDefaultPyEncoding() -> string
7510
7511 Gets the current encoding that wxPython will use when it needs to
7512 convert a Python string or unicode object to or from a wxString.
7513 """
5b5c9bc7 7514 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d55e5bfc
RD
7515#----------------------------------------------------------------------
7516
7517class PyOnDemandOutputWindow:
7518 """
7519 A class that can be used for redirecting Python's stdout and
7520 stderr streams. It will do nothing until something is wrriten to
7521 the stream at which point it will create a Frame with a text area
7522 and write the text there.
7523 """
7524 def __init__(self, title = "wxPython: stdout/stderr"):
7525 self.frame = None
7526 self.title = title
412d302d
RD
7527 self.pos = wx.DefaultPosition
7528 self.size = (450, 300)
d55e5bfc
RD
7529 self.parent = None
7530
7531 def SetParent(self, parent):
7532 """Set the window to be used as the popup Frame's parent."""
7533 self.parent = parent
7534
7535
7536 def CreateOutputWindow(self, st):
412d302d
RD
7537 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7538 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7539 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7540 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7541 self.text.AppendText(st)
d55e5bfc
RD
7542 self.frame.Show(True)
7543 EVT_CLOSE(self.frame, self.OnCloseWindow)
7544
7545
7546 def OnCloseWindow(self, event):
7547 if self.frame is not None:
7548 self.frame.Destroy()
7549 self.frame = None
7550 self.text = None
7551
7552
7553 # These methods provide the file-like output behaviour.
7554 def write(self, text):
7555 """
7556 Create the output window if needed and write the string to it.
7557 If not called in the context of the gui thread then uses
7558 CallAfter to do the work there.
7559 """
7560 if self.frame is None:
7561 if not wx.Thread_IsMain():
7562 wx.CallAfter(self.CreateOutputWindow, text)
7563 else:
7564 self.CreateOutputWindow(text)
7565 else:
7566 if not wx.Thread_IsMain():
7567 wx.CallAfter(self.text.AppendText, text)
7568 else:
7569 self.text.AppendText(text)
7570
7571
7572 def close(self):
7573 if self.frame is not None:
7574 wx.CallAfter(self.frame.Close)
7575
7576
bb4524c4
RD
7577 def flush(self):
7578 pass
7579
7580
d55e5bfc
RD
7581
7582#----------------------------------------------------------------------
7583
7584_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7585
7586class App(wx.PyApp):
7587 """
d6c14a4c
RD
7588 The ``wx.App`` class represents the application and is used to:
7589
7590 * bootstrap the wxPython system and initialize the underlying
7591 gui toolkit
7592 * set and get application-wide properties
7593 * implement the windowing system main message or event loop,
7594 and to dispatch events to window instances
7595 * etc.
7596
7597 Every application must have a ``wx.App`` instance, and all
7598 creation of UI objects should be delayed until after the
7599 ``wx.App`` object has been created in order to ensure that the gui
7600 platform and wxWidgets have been fully initialized.
7601
7602 Normally you would derive from this class and implement an
7603 ``OnInit`` method that creates a frame and then calls
7604 ``self.SetTopWindow(frame)``.
7605
7606 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7607 directly.
d55e5bfc 7608 """
d6c14a4c 7609
d55e5bfc
RD
7610 outputWindowClass = PyOnDemandOutputWindow
7611
d6c14a4c
RD
7612 def __init__(self, redirect=_defRedirect, filename=None,
7613 useBestVisual=False, clearSigInt=True):
7614 """
7615 Construct a ``wx.App`` object.
7616
7617 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7618 redirected? Defaults to True on Windows and Mac, False
7619 otherwise. If `filename` is None then output will be
7620 redirected to a window that pops up as needed. (You can
7621 control what kind of window is created for the output by
7622 resetting the class variable ``outputWindowClass`` to a
7623 class of your choosing.)
7624
7625 :param filename: The name of a file to redirect output to, if
7626 redirect is True.
7627
7628 :param useBestVisual: Should the app try to use the best
7629 available visual provided by the system (only relevant on
7630 systems that have more than one visual.) This parameter
7631 must be used instead of calling `SetUseBestVisual` later
7632 on because it must be set before the underlying GUI
7633 toolkit is initialized.
7634
7635 :param clearSigInt: Should SIGINT be cleared? This allows the
7636 app to terminate upon a Ctrl-C in the console like other
7637 GUI apps will.
7638
7639 :note: You should override OnInit to do applicaition
7640 initialization to ensure that the system, toolkit and
7641 wxWidgets are fully initialized.
7642 """
d55e5bfc
RD
7643 wx.PyApp.__init__(self)
7644
7645 if wx.Platform == "__WXMAC__":
7646 try:
7647 import MacOS
7648 if not MacOS.WMAvailable():
7649 print """\
7650This program needs access to the screen. Please run with 'pythonw',
7651not 'python', and only when you are logged in on the main display of
7652your Mac."""
7653 _sys.exit(1)
0346c964
RD
7654 except SystemExit:
7655 raise
d55e5bfc
RD
7656 except:
7657 pass
7658
7659 # This has to be done before OnInit
7660 self.SetUseBestVisual(useBestVisual)
7661
7662 # Set the default handler for SIGINT. This fixes a problem
7663 # where if Ctrl-C is pressed in the console that started this
7664 # app then it will not appear to do anything, (not even send
7665 # KeyboardInterrupt???) but will later segfault on exit. By
7666 # setting the default handler then the app will exit, as
7667 # expected (depending on platform.)
d6c14a4c
RD
7668 if clearSigInt:
7669 try:
7670 import signal
7671 signal.signal(signal.SIGINT, signal.SIG_DFL)
7672 except:
7673 pass
d55e5bfc
RD
7674
7675 # Save and redirect the stdio to a window?
7676 self.stdioWin = None
7677 self.saveStdio = (_sys.stdout, _sys.stderr)
7678 if redirect:
7679 self.RedirectStdio(filename)
7680
8fb0e70a
RD
7681 # Use Python's install prefix as the default
7682 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7683
d55e5bfc
RD
7684 # This finishes the initialization of wxWindows and then calls
7685 # the OnInit that should be present in the derived class
7686 self._BootstrapApp()
7687
7688
66af7a75
RD
7689 def __del__(self, destroy=wx.PyApp.__del__):
7690 self.RestoreStdio() # Just in case the MainLoop was overridden
7691 destroy(self)
d55e5bfc 7692
7993762b
RD
7693 def Destroy(self):
7694 wx.PyApp.Destroy(self)
7695 self.thisown = 0
d55e5bfc
RD
7696
7697 def SetTopWindow(self, frame):
7698 """Set the \"main\" top level window"""
7699 if self.stdioWin:
7700 self.stdioWin.SetParent(frame)
7701 wx.PyApp.SetTopWindow(self, frame)
7702
7703
7704 def MainLoop(self):
7705 """Execute the main GUI event loop"""
7706 wx.PyApp.MainLoop(self)
7707 self.RestoreStdio()
7708
7709
7710 def RedirectStdio(self, filename=None):
7711 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7712 if filename:
7713 _sys.stdout = _sys.stderr = open(filename, 'a')
7714 else:
7715 self.stdioWin = self.outputWindowClass()
7716 _sys.stdout = _sys.stderr = self.stdioWin
7717
7718
7719 def RestoreStdio(self):
66af7a75
RD
7720 try:
7721 _sys.stdout, _sys.stderr = self.saveStdio
7722 except:
7723 pass
d55e5bfc
RD
7724
7725
412d302d
RD
7726 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7727 """
7728 Set the title, position and/or size of the output window if
f5b96ee1
RD
7729 the stdio has been redirected. This should be called before
7730 any output would cause the output window to be created.
412d302d
RD
7731 """
7732 if self.stdioWin:
7733 if title is not None:
7734 self.stdioWin.title = title
7735 if pos is not None:
7736 self.stdioWin.pos = pos
7737 if size is not None:
7738 self.stdioWin.size = size
7739
7740
7741
d55e5bfc 7742
d6c14a4c 7743# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7744App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7745App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7746App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7747App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7748App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7749App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7750App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7751App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7752App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7753App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7754App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7755
7756#----------------------------------------------------------------------------
7757
7758class PySimpleApp(wx.App):
7759 """
7760 A simple application class. You can just create one of these and
7761 then then make your top level windows later, and not have to worry
d6c14a4c 7762 about OnInit. For example::
d55e5bfc 7763
d6c14a4c
RD
7764 app = wx.PySimpleApp()
7765 frame = wx.Frame(None, title='Hello World')
7766 frame.Show()
7767 app.MainLoop()
7768
7769 :see: `wx.App`
7770 """
7771
7772 def __init__(self, redirect=False, filename=None,
7773 useBestVisual=False, clearSigInt=True):
7774 """
7775 :see: `wx.App.__init__`
7776 """
7777 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7778
7779 def OnInit(self):
d55e5bfc
RD
7780 return True
7781
7782
d6c14a4c 7783
d55e5bfc
RD
7784# Is anybody using this one?
7785class PyWidgetTester(wx.App):
7786 def __init__(self, size = (250, 100)):
7787 self.size = size
7788 wx.App.__init__(self, 0)
7789
7790 def OnInit(self):
7791 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7792 self.SetTopWindow(self.frame)
7793 return True
7794
d6c14a4c
RD
7795 def SetWidget(self, widgetClass, *args, **kwargs):
7796 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7797 self.frame.Show(True)
7798
7799#----------------------------------------------------------------------------
7800# DO NOT hold any other references to this object. This is how we
d6c14a4c 7801# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7802# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7803# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7804
7805class __wxPyCleanup:
7806 def __init__(self):
7807 self.cleanup = _core_.App_CleanUp
7808 def __del__(self):
7809 self.cleanup()
7810
7811_sys.__wxPythonCleanup = __wxPyCleanup()
7812
7813## # another possible solution, but it gets called too early...
d6c14a4c
RD
7814## import atexit
7815## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7816
7817
7818#----------------------------------------------------------------------------
7819
7820#---------------------------------------------------------------------------
7821
5b5c9bc7
RD
7822class EventLoop(object):
7823 """Proxy of C++ EventLoop class"""
b411df4a
RD
7824 def __repr__(self):
7825 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7826 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
7827 """__init__(self) -> EventLoop"""
7828 newobj = _core_.new_EventLoop(*args, **kwargs)
b411df4a
RD
7829 self.this = newobj.this
7830 self.thisown = 1
7831 del newobj.thisown
5b5c9bc7 7832 def __del__(self, destroy=_core_.delete_EventLoop):
b411df4a
RD
7833 """__del__(self)"""
7834 try:
7835 if self.thisown: destroy(self)
7836 except: pass
7837
7838 def Run(*args, **kwargs):
7839 """Run(self) -> int"""
5b5c9bc7 7840 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7841
7842 def Exit(*args, **kwargs):
7843 """Exit(self, int rc=0)"""
5b5c9bc7 7844 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7845
7846 def Pending(*args, **kwargs):
7847 """Pending(self) -> bool"""
5b5c9bc7 7848 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7849
7850 def Dispatch(*args, **kwargs):
7851 """Dispatch(self) -> bool"""
5b5c9bc7 7852 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7853
7854 def IsRunning(*args, **kwargs):
7855 """IsRunning(self) -> bool"""
5b5c9bc7 7856 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7857
7858 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7859 """GetActive() -> EventLoop"""
7860 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7861
7862 GetActive = staticmethod(GetActive)
7863 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7864 """SetActive(EventLoop loop)"""
7865 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7866
7867 SetActive = staticmethod(SetActive)
7868
5b5c9bc7 7869class EventLoopPtr(EventLoop):
b411df4a
RD
7870 def __init__(self, this):
7871 self.this = this
7872 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7873 self.__class__ = EventLoop
7874_core_.EventLoop_swigregister(EventLoopPtr)
b411df4a 7875
5b5c9bc7
RD
7876def EventLoop_GetActive(*args, **kwargs):
7877 """EventLoop_GetActive() -> EventLoop"""
7878 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a 7879
5b5c9bc7
RD
7880def EventLoop_SetActive(*args, **kwargs):
7881 """EventLoop_SetActive(EventLoop loop)"""
7882 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7883
32fe5131
RD
7884class EventLoopActivator(object):
7885 """Proxy of C++ EventLoopActivator class"""
7886 def __repr__(self):
7887 return "<%s.%s; proxy of C++ wxEventLoopActivator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7888 def __init__(self, *args, **kwargs):
7889 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7890 newobj = _core_.new_EventLoopActivator(*args, **kwargs)
7891 self.this = newobj.this
7892 self.thisown = 1
7893 del newobj.thisown
7894 def __del__(self, destroy=_core_.delete_EventLoopActivator):
7895 """__del__(self)"""
7896 try:
7897 if self.thisown: destroy(self)
7898 except: pass
7899
7900
7901class EventLoopActivatorPtr(EventLoopActivator):
7902 def __init__(self, this):
7903 self.this = this
7904 if not hasattr(self,"thisown"): self.thisown = 0
7905 self.__class__ = EventLoopActivator
7906_core_.EventLoopActivator_swigregister(EventLoopActivatorPtr)
7907
b411df4a
RD
7908#---------------------------------------------------------------------------
7909
5b5c9bc7 7910class AcceleratorEntry(object):
d6c14a4c
RD
7911 """
7912 A class used to define items in an `wx.AcceleratorTable`. wxPython
7913 programs can choose to use wx.AcceleratorEntry objects, but using a
7914 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 7915 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
7916
7917 :see: `wx.AcceleratorTable`
7918 """
d55e5bfc
RD
7919 def __repr__(self):
7920 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7921 def __init__(self, *args, **kwargs):
d6c14a4c 7922 """
5b5c9bc7 7923 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
7924
7925 Construct a wx.AcceleratorEntry.
d6c14a4c 7926 """
5b5c9bc7 7927 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
d55e5bfc
RD
7928 self.this = newobj.this
7929 self.thisown = 1
7930 del newobj.thisown
5b5c9bc7 7931 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
d55e5bfc
RD
7932 """__del__(self)"""
7933 try:
7934 if self.thisown: destroy(self)
7935 except: pass
7936
7937 def Set(*args, **kwargs):
d6c14a4c
RD
7938 """
7939 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7940
d6c14a4c
RD
7941 (Re)set the attributes of a wx.AcceleratorEntry.
7942 :see `__init__`
7943 """
5b5c9bc7 7944 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7945
7946 def GetFlags(*args, **kwargs):
d6c14a4c
RD
7947 """
7948 GetFlags(self) -> int
7949
7950 Get the AcceleratorEntry's flags.
7951 """
5b5c9bc7 7952 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
7953
7954 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
7955 """
7956 GetKeyCode(self) -> int
7957
7958 Get the AcceleratorEntry's keycode.
7959 """
5b5c9bc7 7960 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
7961
7962 def GetCommand(*args, **kwargs):
d6c14a4c
RD
7963 """
7964 GetCommand(self) -> int
7965
7966 Get the AcceleratorEntry's command ID.
7967 """
5b5c9bc7 7968 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc
RD
7969
7970
5b5c9bc7 7971class AcceleratorEntryPtr(AcceleratorEntry):
d55e5bfc
RD
7972 def __init__(self, this):
7973 self.this = this
7974 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7975 self.__class__ = AcceleratorEntry
7976_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
d55e5bfc 7977
5b5c9bc7 7978class AcceleratorTable(Object):
d6c14a4c
RD
7979 """
7980 An accelerator table allows the application to specify a table of
7981 keyboard shortcuts for menus or other commands. On Windows, menu or
7982 button commands are supported; on GTK, only menu commands are
7983 supported.
d6c14a4c 7984 """
d55e5bfc
RD
7985 def __repr__(self):
7986 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7987 def __init__(self, *args, **kwargs):
7988 """
7989 __init__(entries) -> AcceleratorTable
7990
d6c14a4c
RD
7991 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7992 items or or of 3-tuples (flags, keyCode, cmdID)
7993
7994 :see: `wx.AcceleratorEntry`
d55e5bfc 7995 """
5b5c9bc7 7996 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
d55e5bfc
RD
7997 self.this = newobj.this
7998 self.thisown = 1
7999 del newobj.thisown
5b5c9bc7 8000 def __del__(self, destroy=_core_.delete_AcceleratorTable):
d55e5bfc
RD
8001 """__del__(self)"""
8002 try:
8003 if self.thisown: destroy(self)
8004 except: pass
8005
8006 def Ok(*args, **kwargs):
8007 """Ok(self) -> bool"""
5b5c9bc7 8008 return _core_.AcceleratorTable_Ok(*args, **kwargs)
d55e5bfc
RD
8009
8010
5b5c9bc7 8011class AcceleratorTablePtr(AcceleratorTable):
d55e5bfc
RD
8012 def __init__(self, this):
8013 self.this = this
8014 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
8015 self.__class__ = AcceleratorTable
8016_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
d55e5bfc
RD
8017
8018
5b5c9bc7
RD
8019def GetAccelFromString(*args, **kwargs):
8020 """GetAccelFromString(String label) -> AcceleratorEntry"""
8021 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
8022#---------------------------------------------------------------------------
8023
5b5c9bc7 8024class VisualAttributes(object):
d55e5bfc
RD
8025 """struct containing all the visual attributes of a control"""
8026 def __repr__(self):
8027 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8028 def __init__(self, *args, **kwargs):
8029 """
5b5c9bc7 8030 __init__(self) -> VisualAttributes
d55e5bfc
RD
8031
8032 struct containing all the visual attributes of a control
8033 """
5b5c9bc7 8034 newobj = _core_.new_VisualAttributes(*args, **kwargs)
d55e5bfc
RD
8035 self.this = newobj.this
8036 self.thisown = 1
8037 del newobj.thisown
5b5c9bc7 8038 def __del__(self, destroy=_core_.delete_VisualAttributes):
d55e5bfc
RD
8039 """__del__(self)"""
8040 try:
8041 if self.thisown: destroy(self)
8042 except: pass
8043
5b5c9bc7
RD
8044 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
8045 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
8046 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
d55e5bfc 8047
5b5c9bc7 8048class VisualAttributesPtr(VisualAttributes):
d55e5bfc
RD
8049 def __init__(self, this):
8050 self.this = this
8051 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
8052 self.__class__ = VisualAttributes
8053_core_.VisualAttributes_swigregister(VisualAttributesPtr)
8054NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
8055PanelNameStr = cvar.PanelNameStr
8056
5b5c9bc7
RD
8057WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8058WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8059WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8060WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8061WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
8062class Window(EvtHandler):
d55e5bfc
RD
8063 """
8064 wx.Window is the base class for all windows and represents any visible
8065 object on the screen. All controls, top level windows and so on are
8066 wx.Windows. Sizers and device contexts are not however, as they don't
8067 appear on screen themselves.
8068
8069 """
8070 def __repr__(self):
8071 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8072 def __init__(self, *args, **kwargs):
8073 """
5b5c9bc7
RD
8074 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8075 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
8076
8077 Construct and show a generic Window.
8078 """
5b5c9bc7 8079 newobj = _core_.new_Window(*args, **kwargs)
d55e5bfc
RD
8080 self.this = newobj.this
8081 self.thisown = 1
8082 del newobj.thisown
8083 self._setOORInfo(self)
8084
8085 def Create(*args, **kwargs):
8086 """
5b5c9bc7
RD
8087 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8088 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
8089
8090 Create the GUI part of the Window for 2-phase creation mode.
8091 """
5b5c9bc7 8092 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
8093
8094 def Close(*args, **kwargs):
8095 """
8096 Close(self, bool force=False) -> bool
8097
8098 This function simply generates a EVT_CLOSE event whose handler usually
8099 tries to close the window. It doesn't close the window itself,
8100 however. If force is False (the default) then the window's close
8101 handler will be allowed to veto the destruction of the window.
d55e5bfc 8102 """
5b5c9bc7 8103 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
8104
8105 def Destroy(*args, **kwargs):
8106 """
8107 Destroy(self) -> bool
8108
8109 Destroys the window safely. Frames and dialogs are not destroyed
8110 immediately when this function is called -- they are added to a list
8111 of windows to be deleted on idle time, when all the window's events
8112 have been processed. This prevents problems with events being sent to
8113 non-existent windows.
8114
8115 Returns True if the window has either been successfully deleted, or it
8116 has been added to the list of windows pending real deletion.
8117 """
7e08d4ef
RD
8118 val = _core_.Window_Destroy(*args, **kwargs)
8119 args[0].thisown = 0
8120 return val
d55e5bfc
RD
8121
8122 def DestroyChildren(*args, **kwargs):
8123 """
8124 DestroyChildren(self) -> bool
8125
15817c7e
RD
8126 Destroys all children of a window. Called automatically by the
8127 destructor.
d55e5bfc 8128 """
5b5c9bc7 8129 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
8130
8131 def IsBeingDeleted(*args, **kwargs):
8132 """
8133 IsBeingDeleted(self) -> bool
8134
8135 Is the window in the process of being deleted?
8136 """
5b5c9bc7 8137 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 8138
d55e5bfc
RD
8139 def SetLabel(*args, **kwargs):
8140 """
5b5c9bc7 8141 SetLabel(self, String label)
d55e5bfc
RD
8142
8143 Set the text which the window shows in its label if applicable.
8144 """
5b5c9bc7 8145 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
8146
8147 def GetLabel(*args, **kwargs):
8148 """
5b5c9bc7 8149 GetLabel(self) -> String
d55e5bfc 8150
15817c7e
RD
8151 Generic way of getting a label from any window, for identification
8152 purposes. The interpretation of this function differs from class to
8153 class. For frames and dialogs, the value returned is the title. For
8154 buttons or static text controls, it is the button text. This function
8155 can be useful for meta-programs such as testing tools or special-needs
8156 access programs)which need to identify windows by name.
d55e5bfc 8157 """
5b5c9bc7 8158 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
8159
8160 def SetName(*args, **kwargs):
8161 """
5b5c9bc7 8162 SetName(self, String name)
d55e5bfc 8163
15817c7e
RD
8164 Sets the window's name. The window name is used for ressource setting
8165 in X, it is not the same as the window title/label
d55e5bfc 8166 """
5b5c9bc7 8167 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
8168
8169 def GetName(*args, **kwargs):
8170 """
5b5c9bc7 8171 GetName(self) -> String
d55e5bfc 8172
15817c7e
RD
8173 Returns the windows name. This name is not guaranteed to be unique;
8174 it is up to the programmer to supply an appropriate name in the window
8175 constructor or via wx.Window.SetName.
d55e5bfc 8176 """
5b5c9bc7 8177 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
8178
8179 def SetWindowVariant(*args, **kwargs):
8180 """
8181 SetWindowVariant(self, int variant)
8182
15817c7e
RD
8183 Sets the variant of the window/font size to use for this window, if
8184 the platform supports variants, for example, wxMac.
d55e5bfc 8185 """
5b5c9bc7 8186 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
8187
8188 def GetWindowVariant(*args, **kwargs):
8189 """GetWindowVariant(self) -> int"""
5b5c9bc7 8190 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
8191
8192 def SetId(*args, **kwargs):
8193 """
8194 SetId(self, int winid)
8195
8196 Sets the identifier of the window. Each window has an integer
8197 identifier. If the application has not provided one, an identifier
8198 will be generated. Normally, the identifier should be provided on
8199 creation and should not be modified subsequently.
8200 """
5b5c9bc7 8201 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
8202
8203 def GetId(*args, **kwargs):
8204 """
8205 GetId(self) -> int
8206
8207 Returns the identifier of the window. Each window has an integer
8208 identifier. If the application has not provided one (or the default Id
8209 -1 is used) then an unique identifier with a negative value will be
8210 generated.
8211 """
5b5c9bc7 8212 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
8213
8214 def NewControlId(*args, **kwargs):
8215 """
d6c14a4c 8216 NewControlId() -> int
d55e5bfc
RD
8217
8218 Generate a control id for the controls which were not given one.
8219 """
5b5c9bc7 8220 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
8221
8222 NewControlId = staticmethod(NewControlId)
8223 def NextControlId(*args, **kwargs):
8224 """
d6c14a4c 8225 NextControlId(int winid) -> int
d55e5bfc
RD
8226
8227 Get the id of the control following the one with the given
15817c7e 8228 autogenerated) id
d55e5bfc 8229 """
5b5c9bc7 8230 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
8231
8232 NextControlId = staticmethod(NextControlId)
8233 def PrevControlId(*args, **kwargs):
8234 """
d6c14a4c 8235 PrevControlId(int winid) -> int
d55e5bfc
RD
8236
8237 Get the id of the control preceding the one with the given
15817c7e 8238 autogenerated) id
d55e5bfc 8239 """
5b5c9bc7 8240 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
8241
8242 PrevControlId = staticmethod(PrevControlId)
8243 def SetSize(*args, **kwargs):
8244 """
5b5c9bc7 8245 SetSize(self, Size size)
d55e5bfc
RD
8246
8247 Sets the size of the window in pixels.
8248 """
5b5c9bc7 8249 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
8250
8251 def SetDimensions(*args, **kwargs):
8252 """
5b5c9bc7 8253 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8254
8255 Sets the position and size of the window in pixels. The sizeFlags
8256 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
8257 equal to -1.
8258
8259 ======================== ======================================
8260 wx.SIZE_AUTO A -1 indicates that a class-specific
8261 default should be used.
8262 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8263 -1 values are supplied.
8264 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8265 interpreted as real dimensions, not
8266 default values.
8267 ======================== ======================================
8268
d55e5bfc 8269 """
5b5c9bc7 8270 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
8271
8272 def SetRect(*args, **kwargs):
8273 """
5b5c9bc7 8274 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8275
8276 Sets the position and size of the window in pixels using a wx.Rect.
8277 """
5b5c9bc7 8278 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
8279
8280 def SetSizeWH(*args, **kwargs):
8281 """
8282 SetSizeWH(self, int width, int height)
8283
8284 Sets the size of the window in pixels.
8285 """
5b5c9bc7 8286 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
8287
8288 def Move(*args, **kwargs):
8289 """
5b5c9bc7 8290 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8291
8292 Moves the window to the given position.
8293 """
5b5c9bc7 8294 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
8295
8296 SetPosition = Move
8297 def MoveXY(*args, **kwargs):
8298 """
5b5c9bc7 8299 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8300
8301 Moves the window to the given position.
8302 """
5b5c9bc7 8303 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 8304
f8167d6e
RD
8305 def SetBestFittingSize(*args, **kwargs):
8306 """
5b5c9bc7 8307 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
8308
8309 A 'Smart' SetSize that will fill in default size components with the
8310 window's *best size* values. Also set's the minsize for use with sizers.
8311 """
5b5c9bc7 8312 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 8313
d55e5bfc
RD
8314 def Raise(*args, **kwargs):
8315 """
8316 Raise(self)
8317
943e8dfd
RD
8318 Raises the window to the top of the window hierarchy. In current
8319 version of wxWidgets this works both for manage and child windows.
d55e5bfc 8320 """
5b5c9bc7 8321 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
8322
8323 def Lower(*args, **kwargs):
8324 """
8325 Lower(self)
8326
943e8dfd
RD
8327 Lowers the window to the bottom of the window hierarchy. In current
8328 version of wxWidgets this works both for manage and child windows.
d55e5bfc 8329 """
5b5c9bc7 8330 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
8331
8332 def SetClientSize(*args, **kwargs):
8333 """
5b5c9bc7 8334 SetClientSize(self, Size size)
d55e5bfc
RD
8335
8336 This sets the size of the window client area in pixels. Using this
8337 function to size a window tends to be more device-independent than
8338 wx.Window.SetSize, since the application need not worry about what
8339 dimensions the border or title bar have when trying to fit the window
8340 around panel items, for example.
8341 """
5b5c9bc7 8342 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
8343
8344 def SetClientSizeWH(*args, **kwargs):
8345 """
8346 SetClientSizeWH(self, int width, int height)
8347
8348 This sets the size of the window client area in pixels. Using this
8349 function to size a window tends to be more device-independent than
8350 wx.Window.SetSize, since the application need not worry about what
8351 dimensions the border or title bar have when trying to fit the window
8352 around panel items, for example.
8353 """
5b5c9bc7 8354 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
8355
8356 def SetClientRect(*args, **kwargs):
8357 """
5b5c9bc7 8358 SetClientRect(self, Rect rect)
d55e5bfc
RD
8359
8360 This sets the size of the window client area in pixels. Using this
8361 function to size a window tends to be more device-independent than
8362 wx.Window.SetSize, since the application need not worry about what
8363 dimensions the border or title bar have when trying to fit the window
8364 around panel items, for example.
8365 """
5b5c9bc7 8366 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
8367
8368 def GetPosition(*args, **kwargs):
8369 """
5b5c9bc7 8370 GetPosition(self) -> Point
d55e5bfc
RD
8371
8372 Get the window's position.
8373 """
5b5c9bc7 8374 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
8375
8376 def GetPositionTuple(*args, **kwargs):
8377 """
8378 GetPositionTuple() -> (x,y)
8379
8380 Get the window's position.
8381 """
5b5c9bc7 8382 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
8383
8384 def GetSize(*args, **kwargs):
8385 """
5b5c9bc7 8386 GetSize(self) -> Size
d55e5bfc
RD
8387
8388 Get the window size.
8389 """
5b5c9bc7 8390 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
8391
8392 def GetSizeTuple(*args, **kwargs):
8393 """
8394 GetSizeTuple() -> (width, height)
8395
8396 Get the window size.
8397 """
5b5c9bc7 8398 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
8399
8400 def GetRect(*args, **kwargs):
8401 """
5b5c9bc7 8402 GetRect(self) -> Rect
d55e5bfc
RD
8403
8404 Returns the size and position of the window as a wx.Rect object.
8405 """
5b5c9bc7 8406 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
8407
8408 def GetClientSize(*args, **kwargs):
8409 """
5b5c9bc7 8410 GetClientSize(self) -> Size
d55e5bfc
RD
8411
8412 This gets the size of the window's 'client area' in pixels. The client
8413 area is the area which may be drawn on by the programmer, excluding
8414 title bar, border, scrollbars, etc.
8415 """
5b5c9bc7 8416 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
8417
8418 def GetClientSizeTuple(*args, **kwargs):
8419 """
8420 GetClientSizeTuple() -> (width, height)
8421
8422 This gets the size of the window's 'client area' in pixels. The client
8423 area is the area which may be drawn on by the programmer, excluding
8424 title bar, border, scrollbars, etc.
8425 """
5b5c9bc7 8426 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
8427
8428 def GetClientAreaOrigin(*args, **kwargs):
8429 """
5b5c9bc7 8430 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
8431
8432 Get the origin of the client area of the window relative to the
8433 window's top left corner (the client area may be shifted because of
8434 the borders, scrollbars, other decorations...)
8435 """
5b5c9bc7 8436 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
8437
8438 def GetClientRect(*args, **kwargs):
8439 """
5b5c9bc7 8440 GetClientRect(self) -> Rect
d55e5bfc 8441
0439c23b 8442 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 8443 """
5b5c9bc7 8444 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
8445
8446 def GetBestSize(*args, **kwargs):
8447 """
5b5c9bc7 8448 GetBestSize(self) -> Size
d55e5bfc 8449
bfddbb17 8450 This function returns the best acceptable minimal size for the
15817c7e
RD
8451 window, if applicable. For example, for a static text control, it will
8452 be the minimal size such that the control label is not truncated. For
8453 windows containing subwindows (suzh aswx.Panel), the size returned by
8454 this function will be the same as the size the window would have had
8455 after calling Fit.
d55e5bfc 8456 """
5b5c9bc7 8457 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
8458
8459 def GetBestSizeTuple(*args, **kwargs):
8460 """
8461 GetBestSizeTuple() -> (width, height)
8462
bfddbb17 8463 This function returns the best acceptable minimal size for the
15817c7e
RD
8464 window, if applicable. For example, for a static text control, it will
8465 be the minimal size such that the control label is not truncated. For
8466 windows containing subwindows (suzh aswx.Panel), the size returned by
8467 this function will be the same as the size the window would have had
8468 after calling Fit.
d55e5bfc 8469 """
5b5c9bc7 8470 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 8471
a001823c
RD
8472 def InvalidateBestSize(*args, **kwargs):
8473 """
8474 InvalidateBestSize(self)
8475
8476 Reset the cached best size value so it will be recalculated the next
8477 time it is needed.
8478 """
5b5c9bc7 8479 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 8480
e2813725
RD
8481 def CacheBestSize(*args, **kwargs):
8482 """
8483 CacheBestSize(self, Size size)
8484
8485 Cache the best size so it doesn't need to be calculated again, (at least until
8486 some properties of the window change.)
8487 """
8488 return _core_.Window_CacheBestSize(*args, **kwargs)
8489
a001823c
RD
8490 def GetBestFittingSize(*args, **kwargs):
8491 """
5b5c9bc7 8492 GetBestFittingSize(self) -> Size
a001823c
RD
8493
8494 This function will merge the window's best size into the window's
8495 minimum size, giving priority to the min size components, and returns
8496 the results.
8497
8498 """
5b5c9bc7 8499 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 8500
d55e5bfc
RD
8501 def GetAdjustedBestSize(*args, **kwargs):
8502 """
5b5c9bc7 8503 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
8504
8505 This method is similar to GetBestSize, except in one
8506 thing. GetBestSize should return the minimum untruncated size of the
8507 window, while this method will return the largest of BestSize and any
8508 user specified minimum size. ie. it is the minimum size the window
8509 should currently be drawn at, not the minimal size it can possibly
8510 tolerate.
8511 """
5b5c9bc7 8512 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
8513
8514 def Center(*args, **kwargs):
8515 """
5b5c9bc7 8516 Center(self, int direction=BOTH)
d55e5bfc
RD
8517
8518 Centers the window. The parameter specifies the direction for
8519 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8520 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8521 on the entire screen and not on its parent window. If it is a
8522 top-level window and has no parent then it will always be centered
8523 relative to the screen.
8524 """
5b5c9bc7 8525 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
8526
8527 Centre = Center
8528 def CenterOnScreen(*args, **kwargs):
8529 """
5b5c9bc7 8530 CenterOnScreen(self, int dir=BOTH)
d55e5bfc
RD
8531
8532 Center on screen (only works for top level windows)
8533 """
5b5c9bc7 8534 return _core_.Window_CenterOnScreen(*args, **kwargs)
d55e5bfc
RD
8535
8536 CentreOnScreen = CenterOnScreen
8537 def CenterOnParent(*args, **kwargs):
8538 """
5b5c9bc7 8539 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
8540
8541 Center with respect to the the parent window
8542 """
5b5c9bc7 8543 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
8544
8545 CentreOnParent = CenterOnParent
8546 def Fit(*args, **kwargs):
8547 """
8548 Fit(self)
8549
8550 Sizes the window so that it fits around its subwindows. This function
8551 won't do anything if there are no subwindows and will only really work
8552 correctly if sizers are used for the subwindows layout. Also, if the
8553 window has exactly one subwindow it is better (faster and the result
8554 is more precise as Fit adds some margin to account for fuzziness of
8555 its calculations) to call window.SetClientSize(child.GetSize())
8556 instead of calling Fit.
8557 """
5b5c9bc7 8558 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
8559
8560 def FitInside(*args, **kwargs):
8561 """
8562 FitInside(self)
8563
8564 Similar to Fit, but sizes the interior (virtual) size of a
8565 window. Mainly useful with scrolled windows to reset scrollbars after
8566 sizing changes that do not trigger a size event, and/or scrolled
8567 windows without an interior sizer. This function similarly won't do
8568 anything if there are no subwindows.
8569 """
5b5c9bc7 8570 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 8571
03837c5c 8572 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8573 """
8574 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8575 int incH=-1)
d55e5bfc
RD
8576
8577 Allows specification of minimum and maximum window sizes, and window
8578 size increments. If a pair of values is not set (or set to -1), the
8579 default values will be used. If this function is called, the user
908b74cd
RD
8580 will not be able to size the window outside the given bounds (if it is
8581 a top-level window.) Sizers will also inspect the minimum window size
8582 and will use that value if set when calculating layout.
8583
8584 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8585 """
5b5c9bc7 8586 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8587
03837c5c
RD
8588 def SetSizeHintsSz(*args, **kwargs):
8589 """
5b5c9bc7 8590 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
8591
8592 Allows specification of minimum and maximum window sizes, and window
8593 size increments. If a pair of values is not set (or set to -1), the
8594 default values will be used. If this function is called, the user
8595 will not be able to size the window outside the given bounds (if it is
8596 a top-level window.) Sizers will also inspect the minimum window size
8597 and will use that value if set when calculating layout.
8598
8599 The resizing increments are only significant under Motif or Xt.
8600 """
5b5c9bc7 8601 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
8602
8603 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8604 """
908b74cd 8605 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8606
8607 Allows specification of minimum and maximum virtual window sizes. If a
8608 pair of values is not set (or set to -1), the default values will be
8609 used. If this function is called, the user will not be able to size
8610 the virtual area of the window outside the given bounds.
8611 """
5b5c9bc7 8612 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
8613
8614 def SetVirtualSizeHintsSz(*args, **kwargs):
8615 """
5b5c9bc7 8616 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
8617
8618 Allows specification of minimum and maximum virtual window sizes. If a
8619 pair of values is not set (or set to -1), the default values will be
8620 used. If this function is called, the user will not be able to size
8621 the virtual area of the window outside the given bounds.
8622 """
5b5c9bc7 8623 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8624
908b74cd 8625 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
8626 """GetMaxSize(self) -> Size"""
8627 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8628
8629 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8630 """GetMinSize(self) -> Size"""
8631 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8632
8633 def SetMinSize(*args, **kwargs):
8634 """
5b5c9bc7 8635 SetMinSize(self, Size minSize)
908b74cd
RD
8636
8637 A more convenient method than `SetSizeHints` for setting just the
8638 min size.
8639 """
5b5c9bc7 8640 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8641
8642 def SetMaxSize(*args, **kwargs):
8643 """
5b5c9bc7 8644 SetMaxSize(self, Size maxSize)
908b74cd
RD
8645
8646 A more convenient method than `SetSizeHints` for setting just the
8647 max size.
8648 """
5b5c9bc7 8649 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8650
d55e5bfc
RD
8651 def GetMinWidth(*args, **kwargs):
8652 """GetMinWidth(self) -> int"""
5b5c9bc7 8653 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8654
8655 def GetMinHeight(*args, **kwargs):
8656 """GetMinHeight(self) -> int"""
5b5c9bc7 8657 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8658
8659 def GetMaxWidth(*args, **kwargs):
8660 """GetMaxWidth(self) -> int"""
5b5c9bc7 8661 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8662
8663 def GetMaxHeight(*args, **kwargs):
8664 """GetMaxHeight(self) -> int"""
5b5c9bc7 8665 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8666
d55e5bfc
RD
8667 def SetVirtualSize(*args, **kwargs):
8668 """
5b5c9bc7 8669 SetVirtualSize(self, Size size)
d55e5bfc
RD
8670
8671 Set the the virtual size of a window in pixels. For most windows this
8672 is just the client area of the window, but for some like scrolled
8673 windows it is more or less independent of the screen window size.
8674 """
5b5c9bc7 8675 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8676
8677 def SetVirtualSizeWH(*args, **kwargs):
8678 """
8679 SetVirtualSizeWH(self, int w, int h)
8680
8681 Set the the virtual size of a window in pixels. For most windows this
8682 is just the client area of the window, but for some like scrolled
8683 windows it is more or less independent of the screen window size.
8684 """
5b5c9bc7 8685 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8686
8687 def GetVirtualSize(*args, **kwargs):
8688 """
5b5c9bc7 8689 GetVirtualSize(self) -> Size
d55e5bfc
RD
8690
8691 Get the the virtual size of the window in pixels. For most windows
8692 this is just the client area of the window, but for some like scrolled
8693 windows it is more or less independent of the screen window size.
8694 """
5b5c9bc7 8695 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8696
8697 def GetVirtualSizeTuple(*args, **kwargs):
8698 """
8699 GetVirtualSizeTuple() -> (width, height)
8700
8701 Get the the virtual size of the window in pixels. For most windows
8702 this is just the client area of the window, but for some like scrolled
8703 windows it is more or less independent of the screen window size.
8704 """
5b5c9bc7 8705 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
8706
8707 def GetBestVirtualSize(*args, **kwargs):
8708 """
5b5c9bc7 8709 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8710
8711 Return the largest of ClientSize and BestSize (as determined by a
8712 sizer, interior children, or other means)
8713 """
5b5c9bc7 8714 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8715
8716 def Show(*args, **kwargs):
8717 """
8718 Show(self, bool show=True) -> bool
8719
8720 Shows or hides the window. You may need to call Raise for a top level
8721 window if you want to bring it to top, although this is not needed if
8722 Show is called immediately after the frame creation. Returns True if
8723 the window has been shown or hidden or False if nothing was done
8724 because it already was in the requested state.
8725 """
5b5c9bc7 8726 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8727
8728 def Hide(*args, **kwargs):
8729 """
8730 Hide(self) -> bool
8731
8732 Equivalent to calling Show(False).
8733 """
5b5c9bc7 8734 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8735
8736 def Enable(*args, **kwargs):
8737 """
8738 Enable(self, bool enable=True) -> bool
8739
8740 Enable or disable the window for user input. Note that when a parent
8741 window is disabled, all of its children are disabled as well and they
8742 are reenabled again when the parent is. Returns true if the window
8743 has been enabled or disabled, false if nothing was done, i.e. if the
8744 window had already been in the specified state.
8745 """
5b5c9bc7 8746 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8747
8748 def Disable(*args, **kwargs):
8749 """
8750 Disable(self) -> bool
8751
8752 Disables the window, same as Enable(false).
8753 """
5b5c9bc7 8754 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8755
8756 def IsShown(*args, **kwargs):
8757 """
8758 IsShown(self) -> bool
8759
8760 Returns true if the window is shown, false if it has been hidden.
8761 """
5b5c9bc7 8762 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8763
8764 def IsEnabled(*args, **kwargs):
8765 """
8766 IsEnabled(self) -> bool
8767
8768 Returns true if the window is enabled for input, false otherwise.
8769 """
5b5c9bc7 8770 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8771
8772 def SetWindowStyleFlag(*args, **kwargs):
8773 """
8774 SetWindowStyleFlag(self, long style)
8775
15817c7e
RD
8776 Sets the style of the window. Please note that some styles cannot be
8777 changed after the window creation and that Refresh() might need to be
8778 called after changing the others for the change to take place
8779 immediately.
d55e5bfc 8780 """
5b5c9bc7 8781 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8782
8783 def GetWindowStyleFlag(*args, **kwargs):
8784 """
8785 GetWindowStyleFlag(self) -> long
8786
8787 Gets the window style that was passed to the constructor or Create
8788 method.
8789 """
5b5c9bc7 8790 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8791
8792 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8793 def HasFlag(*args, **kwargs):
8794 """
8795 HasFlag(self, int flag) -> bool
8796
8797 Test if the given style is set for this window.
8798 """
5b5c9bc7 8799 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8800
8801 def IsRetained(*args, **kwargs):
8802 """
8803 IsRetained(self) -> bool
8804
8805 Returns true if the window is retained, false otherwise. Retained
8806 windows are only available on X platforms.
8807 """
5b5c9bc7 8808 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
8809
8810 def SetExtraStyle(*args, **kwargs):
8811 """
8812 SetExtraStyle(self, long exStyle)
8813
8814 Sets the extra style bits for the window. Extra styles are the less
8815 often used style bits which can't be set with the constructor or with
8816 SetWindowStyleFlag()
8817 """
5b5c9bc7 8818 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8819
8820 def GetExtraStyle(*args, **kwargs):
8821 """
8822 GetExtraStyle(self) -> long
8823
8824 Returns the extra style bits for the window.
8825 """
5b5c9bc7 8826 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8827
8828 def MakeModal(*args, **kwargs):
8829 """
8830 MakeModal(self, bool modal=True)
8831
8832 Disables all other windows in the application so that the user can
8833 only interact with this window. Passing False will reverse this
8834 effect.
8835 """
5b5c9bc7 8836 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
8837
8838 def SetThemeEnabled(*args, **kwargs):
8839 """
8840 SetThemeEnabled(self, bool enableTheme)
8841
8842 This function tells a window if it should use the system's "theme"
8843 code to draw the windows' background instead if its own background
8844 drawing code. This will only have an effect on platforms that support
8845 the notion of themes in user defined windows. One such platform is
8846 GTK+ where windows can have (very colourful) backgrounds defined by a
8847 user's selected theme.
8848
8849 Dialogs, notebook pages and the status bar have this flag set to true
8850 by default so that the default look and feel is simulated best.
8851 """
5b5c9bc7 8852 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8853
8854 def GetThemeEnabled(*args, **kwargs):
8855 """
8856 GetThemeEnabled(self) -> bool
8857
8858 Return the themeEnabled flag.
8859 """
5b5c9bc7 8860 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8861
8862 def SetFocus(*args, **kwargs):
8863 """
8864 SetFocus(self)
8865
8866 Set's the focus to this window, allowing it to receive keyboard input.
8867 """
5b5c9bc7 8868 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
8869
8870 def SetFocusFromKbd(*args, **kwargs):
8871 """
8872 SetFocusFromKbd(self)
8873
8874 Set focus to this window as the result of a keyboard action. Normally
8875 only called internally.
8876 """
5b5c9bc7 8877 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
8878
8879 def FindFocus(*args, **kwargs):
8880 """
5b5c9bc7 8881 FindFocus() -> Window
d55e5bfc
RD
8882
8883 Returns the window or control that currently has the keyboard focus,
8884 or None.
8885 """
5b5c9bc7 8886 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
8887
8888 FindFocus = staticmethod(FindFocus)
8889 def AcceptsFocus(*args, **kwargs):
8890 """
8891 AcceptsFocus(self) -> bool
8892
8893 Can this window have focus?
8894 """
5b5c9bc7 8895 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
8896
8897 def AcceptsFocusFromKeyboard(*args, **kwargs):
8898 """
8899 AcceptsFocusFromKeyboard(self) -> bool
8900
8901 Can this window be given focus by keyboard navigation? if not, the
8902 only way to give it focus (provided it accepts it at all) is to click
8903 it.
8904 """
5b5c9bc7 8905 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc
RD
8906
8907 def GetDefaultItem(*args, **kwargs):
8908 """
5b5c9bc7 8909 GetDefaultItem(self) -> Window
d55e5bfc
RD
8910
8911 Get the default child of this parent, i.e. the one which is activated
8912 by pressing <Enter> such as the OK button on a wx.Dialog.
8913 """
5b5c9bc7 8914 return _core_.Window_GetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8915
8916 def SetDefaultItem(*args, **kwargs):
8917 """
5b5c9bc7 8918 SetDefaultItem(self, Window child) -> Window
d55e5bfc
RD
8919
8920 Set this child as default, return the old default.
8921 """
5b5c9bc7 8922 return _core_.Window_SetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8923
8924 def SetTmpDefaultItem(*args, **kwargs):
8925 """
5b5c9bc7 8926 SetTmpDefaultItem(self, Window win)
d55e5bfc
RD
8927
8928 Set this child as temporary default
8929 """
5b5c9bc7 8930 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
d55e5bfc 8931
908b74cd
RD
8932 def Navigate(*args, **kwargs):
8933 """
8934 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8935
fd2dc343
RD
8936 Does keyboard navigation from this window to another, by sending a
8937 `wx.NavigationKeyEvent`.
908b74cd 8938 """
5b5c9bc7 8939 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 8940
bf26d883
RD
8941 def MoveAfterInTabOrder(*args, **kwargs):
8942 """
5b5c9bc7 8943 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
8944
8945 Moves this window in the tab navigation order after the specified
8946 sibling window. This means that when the user presses the TAB key on
8947 that other window, the focus switches to this window.
8948
8949 The default tab order is the same as creation order. This function
8950 and `MoveBeforeInTabOrder` allow to change it after creating all the
8951 windows.
8952
8953 """
5b5c9bc7 8954 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
8955
8956 def MoveBeforeInTabOrder(*args, **kwargs):
8957 """
5b5c9bc7 8958 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
8959
8960 Same as `MoveAfterInTabOrder` except that it inserts this window just
8961 before win instead of putting it right after it.
8962 """
5b5c9bc7 8963 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 8964
d55e5bfc
RD
8965 def GetChildren(*args, **kwargs):
8966 """
8967 GetChildren(self) -> PyObject
8968
8969 Returns a list of the window's children. NOTE: Currently this is a
8970 copy of the child window list maintained by the window, so the return
8971 value of this function is only valid as long as the window's children
8972 do not change.
8973 """
5b5c9bc7 8974 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
8975
8976 def GetParent(*args, **kwargs):
8977 """
5b5c9bc7 8978 GetParent(self) -> Window
d55e5bfc
RD
8979
8980 Returns the parent window of this window, or None if there isn't one.
8981 """
5b5c9bc7 8982 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
8983
8984 def GetGrandParent(*args, **kwargs):
8985 """
5b5c9bc7 8986 GetGrandParent(self) -> Window
d55e5bfc 8987
15817c7e
RD
8988 Returns the parent of the parent of this window, or None if there
8989 isn't one.
d55e5bfc 8990 """
5b5c9bc7 8991 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
8992
8993 def IsTopLevel(*args, **kwargs):
8994 """
8995 IsTopLevel(self) -> bool
8996
8997 Returns true if the given window is a top-level one. Currently all
8998 frames and dialogs are always considered to be top-level windows (even
8999 if they have a parent window).
9000 """
5b5c9bc7 9001 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
9002
9003 def Reparent(*args, **kwargs):
9004 """
5b5c9bc7 9005 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
9006
9007 Reparents the window, i.e the window will be removed from its current
9008 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9009 re-inserted into another. Available on Windows and GTK. Returns True
9010 if the parent was changed, False otherwise (error or newParent ==
9011 oldParent)
9012 """
5b5c9bc7 9013 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
9014
9015 def AddChild(*args, **kwargs):
9016 """
5b5c9bc7 9017 AddChild(self, Window child)
d55e5bfc
RD
9018
9019 Adds a child window. This is called automatically by window creation
9020 functions so should not be required by the application programmer.
9021 """
5b5c9bc7 9022 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
9023
9024 def RemoveChild(*args, **kwargs):
9025 """
5b5c9bc7 9026 RemoveChild(self, Window child)
d55e5bfc
RD
9027
9028 Removes a child window. This is called automatically by window
9029 deletion functions so should not be required by the application
9030 programmer.
9031 """
5b5c9bc7 9032 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc
RD
9033
9034 def FindWindowById(*args, **kwargs):
9035 """
5b5c9bc7 9036 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
9037
9038 Find a chld of this window by window ID
9039 """
5b5c9bc7 9040 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
9041
9042 def FindWindowByName(*args, **kwargs):
9043 """
5b5c9bc7 9044 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
9045
9046 Find a child of this window by name
9047 """
5b5c9bc7 9048 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
9049
9050 def GetEventHandler(*args, **kwargs):
9051 """
5b5c9bc7 9052 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
9053
9054 Returns the event handler for this window. By default, the window is
9055 its own event handler.
9056 """
5b5c9bc7 9057 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
9058
9059 def SetEventHandler(*args, **kwargs):
9060 """
5b5c9bc7 9061 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
9062
9063 Sets the event handler for this window. An event handler is an object
9064 that is capable of processing the events sent to a window. By default,
9065 the window is its own event handler, but an application may wish to
9066 substitute another, for example to allow central implementation of
9067 event-handling for a variety of different window classes.
9068
15817c7e 9069 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
9070 up a chain of event handlers, where an event not handled by one event
9071 handler is handed to the next one in the chain.
9072 """
5b5c9bc7 9073 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
9074
9075 def PushEventHandler(*args, **kwargs):
9076 """
5b5c9bc7 9077 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
9078
9079 Pushes this event handler onto the event handler stack for the window.
9080 An event handler is an object that is capable of processing the events
9081 sent to a window. By default, the window is its own event handler, but
9082 an application may wish to substitute another, for example to allow
9083 central implementation of event-handling for a variety of different
9084 window classes.
9085
9086 wx.Window.PushEventHandler allows an application to set up a chain of
9087 event handlers, where an event not handled by one event handler is
15817c7e 9088 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
9089 remove the event handler.
9090 """
5b5c9bc7 9091 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
9092
9093 def PopEventHandler(*args, **kwargs):
9094 """
5b5c9bc7 9095 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
9096
9097 Removes and returns the top-most event handler on the event handler
9098 stack. If deleteHandler is True then the wx.EvtHandler object will be
9099 destroyed after it is popped.
9100 """
5b5c9bc7 9101 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
9102
9103 def RemoveEventHandler(*args, **kwargs):
9104 """
5b5c9bc7 9105 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 9106
15817c7e
RD
9107 Find the given handler in the event handler chain and remove (but not
9108 delete) it from the event handler chain, return True if it was found
9109 and False otherwise (this also results in an assert failure so this
9110 function should only be called when the handler is supposed to be
9111 there.)
d55e5bfc 9112 """
5b5c9bc7 9113 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
9114
9115 def SetValidator(*args, **kwargs):
9116 """
5b5c9bc7 9117 SetValidator(self, Validator validator)
d55e5bfc
RD
9118
9119 Deletes the current validator (if any) and sets the window validator,
9120 having called wx.Validator.Clone to create a new validator of this
9121 type.
9122 """
5b5c9bc7 9123 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
9124
9125 def GetValidator(*args, **kwargs):
9126 """
5b5c9bc7 9127 GetValidator(self) -> Validator
d55e5bfc
RD
9128
9129 Returns a pointer to the current validator for the window, or None if
9130 there is none.
9131 """
5b5c9bc7 9132 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
9133
9134 def Validate(*args, **kwargs):
9135 """
9136 Validate(self) -> bool
9137
9138 Validates the current values of the child controls using their
15817c7e
RD
9139 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9140 style flag set, the method will also call Validate() of all child
9141 windows. Returns false if any of the validations failed.
d55e5bfc 9142 """
5b5c9bc7 9143 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
9144
9145 def TransferDataToWindow(*args, **kwargs):
9146 """
9147 TransferDataToWindow(self) -> bool
9148
15817c7e
RD
9149 Transfers values to child controls from data areas specified by their
9150 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9151 style flag set, the method will also call TransferDataToWindow() of
9152 all child windows.
d55e5bfc 9153 """
5b5c9bc7 9154 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
9155
9156 def TransferDataFromWindow(*args, **kwargs):
9157 """
9158 TransferDataFromWindow(self) -> bool
9159
15817c7e
RD
9160 Transfers values from child controls to data areas specified by their
9161 validators. Returns false if a transfer failed. If the window has
9162 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9163 also call TransferDataFromWindow() of all child windows.
d55e5bfc 9164 """
5b5c9bc7 9165 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
9166
9167 def InitDialog(*args, **kwargs):
9168 """
9169 InitDialog(self)
9170
15817c7e
RD
9171 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9172 to the dialog via validators.
d55e5bfc 9173 """
5b5c9bc7 9174 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
9175
9176 def SetAcceleratorTable(*args, **kwargs):
9177 """
5b5c9bc7 9178 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
9179
9180 Sets the accelerator table for this window.
9181 """
5b5c9bc7 9182 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9183
9184 def GetAcceleratorTable(*args, **kwargs):
9185 """
5b5c9bc7 9186 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
9187
9188 Gets the accelerator table for this window.
9189 """
5b5c9bc7 9190 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9191
9192 def RegisterHotKey(*args, **kwargs):
9193 """
9194 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9195
9196 Registers a system wide hotkey. Every time the user presses the hotkey
9197 registered here, this window will receive a hotkey event. It will
9198 receive the event even if the application is in the background and
9199 does not have the input focus because the user is working with some
9200 other application. To bind an event handler function to this hotkey
9201 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9202 hotkey was registered successfully.
9203 """
5b5c9bc7 9204 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
9205
9206 def UnregisterHotKey(*args, **kwargs):
9207 """
9208 UnregisterHotKey(self, int hotkeyId) -> bool
9209
9210 Unregisters a system wide hotkey.
9211 """
5b5c9bc7 9212 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
9213
9214 def ConvertDialogPointToPixels(*args, **kwargs):
9215 """
5b5c9bc7 9216 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
9217
9218 Converts a point or size from dialog units to pixels. Dialog units
9219 are used for maintaining a dialog's proportions even if the font
9220 changes. For the x dimension, the dialog units are multiplied by the
9221 average character width and then divided by 4. For the y dimension,
9222 the dialog units are multiplied by the average character height and
9223 then divided by 8.
9224 """
5b5c9bc7 9225 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
9226
9227 def ConvertDialogSizeToPixels(*args, **kwargs):
9228 """
5b5c9bc7 9229 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
9230
9231 Converts a point or size from dialog units to pixels. Dialog units
9232 are used for maintaining a dialog's proportions even if the font
9233 changes. For the x dimension, the dialog units are multiplied by the
9234 average character width and then divided by 4. For the y dimension,
9235 the dialog units are multiplied by the average character height and
9236 then divided by 8.
9237 """
5b5c9bc7 9238 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
9239
9240 def DLG_PNT(*args, **kwargs):
9241 """
5b5c9bc7 9242 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
9243
9244 Converts a point or size from dialog units to pixels. Dialog units
9245 are used for maintaining a dialog's proportions even if the font
9246 changes. For the x dimension, the dialog units are multiplied by the
9247 average character width and then divided by 4. For the y dimension,
9248 the dialog units are multiplied by the average character height and
9249 then divided by 8.
9250 """
5b5c9bc7 9251 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
9252
9253 def DLG_SZE(*args, **kwargs):
9254 """
5b5c9bc7 9255 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
9256
9257 Converts a point or size from dialog units to pixels. Dialog units
9258 are used for maintaining a dialog's proportions even if the font
9259 changes. For the x dimension, the dialog units are multiplied by the
9260 average character width and then divided by 4. For the y dimension,
9261 the dialog units are multiplied by the average character height and
9262 then divided by 8.
9263 """
5b5c9bc7 9264 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
9265
9266 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
9267 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9268 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
9269
9270 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
9271 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9272 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
9273
9274 def WarpPointer(*args, **kwargs):
9275 """
9276 WarpPointer(self, int x, int y)
9277
9278 Moves the pointer to the given position on the window.
9279
9280 NOTE: This function is not supported under Mac because Apple Human
9281 Interface Guidelines forbid moving the mouse cursor programmatically.
9282 """
5b5c9bc7 9283 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
9284
9285 def CaptureMouse(*args, **kwargs):
9286 """
9287 CaptureMouse(self)
9288
9289 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9290 release the capture.
9291
9292 Note that wxWindows maintains the stack of windows having captured the
9293 mouse and when the mouse is released the capture returns to the window
9294 which had had captured it previously and it is only really released if
9295 there were no previous window. In particular, this means that you must
9296 release the mouse as many times as you capture it.
9297 """
5b5c9bc7 9298 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
9299
9300 def ReleaseMouse(*args, **kwargs):
9301 """
9302 ReleaseMouse(self)
9303
9304 Releases mouse input captured with wx.Window.CaptureMouse.
9305 """
5b5c9bc7 9306 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
9307
9308 def GetCapture(*args, **kwargs):
9309 """
5b5c9bc7 9310 GetCapture() -> Window
d55e5bfc
RD
9311
9312 Returns the window which currently captures the mouse or None
9313 """
5b5c9bc7 9314 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
9315
9316 GetCapture = staticmethod(GetCapture)
9317 def HasCapture(*args, **kwargs):
9318 """
9319 HasCapture(self) -> bool
9320
9321 Returns true if this window has the current mouse capture.
9322 """
5b5c9bc7 9323 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
9324
9325 def Refresh(*args, **kwargs):
9326 """
5b5c9bc7 9327 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
9328
9329 Mark the specified rectangle (or the whole window) as "dirty" so it
9330 will be repainted. Causes an EVT_PAINT event to be generated and sent
9331 to the window.
9332 """
5b5c9bc7 9333 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
9334
9335 def RefreshRect(*args, **kwargs):
9336 """
5b5c9bc7 9337 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
9338
9339 Redraws the contents of the given rectangle: the area inside it will
9340 be repainted. This is the same as Refresh but has a nicer syntax.
9341 """
5b5c9bc7 9342 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
9343
9344 def Update(*args, **kwargs):
9345 """
9346 Update(self)
9347
9348 Calling this method immediately repaints the invalidated area of the
9349 window instead of waiting for the EVT_PAINT event to happen, (normally
9350 this would usually only happen when the flow of control returns to the
9351 event loop.) Notice that this function doesn't refresh the window and
9352 does nothing if the window has been already repainted. Use Refresh
9353 first if you want to immediately redraw the window (or some portion of
9354 it) unconditionally.
9355 """
5b5c9bc7 9356 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
9357
9358 def ClearBackground(*args, **kwargs):
9359 """
9360 ClearBackground(self)
9361
9362 Clears the window by filling it with the current background
9363 colour. Does not cause an erase background event to be generated.
9364 """
5b5c9bc7 9365 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
9366
9367 def Freeze(*args, **kwargs):
9368 """
9369 Freeze(self)
9370
15817c7e
RD
9371 Freezes the window or, in other words, prevents any updates from
9372 taking place on screen, the window is not redrawn at all. Thaw must be
9373 called to reenable window redrawing. Calls to Freeze/Thaw may be
9374 nested, with the actual Thaw being delayed until all the nesting has
9375 been undone.
d55e5bfc
RD
9376
9377 This method is useful for visual appearance optimization (for example,
9378 it is a good idea to use it before inserting large amount of text into
9379 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9380 for all controls so it is mostly just a hint to wxWindows and not a
9381 mandatory directive.
9382 """
5b5c9bc7 9383 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc
RD
9384
9385 def Thaw(*args, **kwargs):
9386 """
9387 Thaw(self)
9388
9389 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
9390 Freeze/Thaw may be nested, so Thaw must be called the same number of
9391 times that Freeze was before the window will be updated.
d55e5bfc 9392 """
5b5c9bc7 9393 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
9394
9395 def PrepareDC(*args, **kwargs):
9396 """
5b5c9bc7 9397 PrepareDC(self, DC dc)
d55e5bfc
RD
9398
9399 Call this function to prepare the device context for drawing a
9400 scrolled image. It sets the device origin according to the current
9401 scroll position.
9402 """
5b5c9bc7 9403 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc
RD
9404
9405 def GetUpdateRegion(*args, **kwargs):
9406 """
5b5c9bc7 9407 GetUpdateRegion(self) -> Region
d55e5bfc
RD
9408
9409 Returns the region specifying which parts of the window have been
9410 damaged. Should only be called within an EVT_PAINT handler.
9411 """
5b5c9bc7 9412 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
9413
9414 def GetUpdateClientRect(*args, **kwargs):
9415 """
5b5c9bc7 9416 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
9417
9418 Get the update rectangle region bounding box in client coords.
9419 """
5b5c9bc7 9420 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
9421
9422 def IsExposed(*args, **kwargs):
9423 """
9424 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9425
9426 Returns true if the given point or rectangle area has been exposed
9427 since the last repaint. Call this in an paint event handler to
9428 optimize redrawing by only redrawing those areas, which have been
9429 exposed.
9430 """
5b5c9bc7 9431 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
9432
9433 def IsExposedPoint(*args, **kwargs):
9434 """
5b5c9bc7 9435 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
9436
9437 Returns true if the given point or rectangle area has been exposed
9438 since the last repaint. Call this in an paint event handler to
9439 optimize redrawing by only redrawing those areas, which have been
9440 exposed.
9441 """
5b5c9bc7 9442 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
9443
9444 def IsExposedRect(*args, **kwargs):
9445 """
5b5c9bc7 9446 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
9447
9448 Returns true if the given point or rectangle area has been exposed
9449 since the last repaint. Call this in an paint event handler to
9450 optimize redrawing by only redrawing those areas, which have been
9451 exposed.
9452 """
5b5c9bc7 9453 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
9454
9455 def GetDefaultAttributes(*args, **kwargs):
9456 """
5b5c9bc7 9457 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 9458
15817c7e
RD
9459 Get the default attributes for an instance of this class. This is
9460 useful if you want to use the same font or colour in your own control
9461 as in a standard control -- which is a much better idea than hard
9462 coding specific colours or fonts which might look completely out of
a5ee0656 9463 place on the user's system, especially if it uses themes.
d55e5bfc 9464 """
5b5c9bc7 9465 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9466
9467 def GetClassDefaultAttributes(*args, **kwargs):
9468 """
5b5c9bc7 9469 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9470
15817c7e
RD
9471 Get the default attributes for this class. This is useful if you want
9472 to use the same font or colour in your own control as in a standard
9473 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9474 colours or fonts which might look completely out of place on the
9475 user's system, especially if it uses themes.
d55e5bfc
RD
9476
9477 The variant parameter is only relevant under Mac currently and is
15817c7e 9478 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9479 the returned font. See `wx.Window.SetWindowVariant` for more about
9480 this.
d55e5bfc 9481 """
5b5c9bc7 9482 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9483
9484 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9485 def SetBackgroundColour(*args, **kwargs):
9486 """
5b5c9bc7 9487 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9488
9489 Sets the background colour of the window. Returns True if the colour
9490 was changed. The background colour is usually painted by the default
9491 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9492 automatically under GTK. Using `wx.NullColour` will reset the window
9493 to the default background colour.
d55e5bfc 9494
a5ee0656 9495 Note that setting the background colour may not cause an immediate
f8167d6e 9496 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
9497 calling this function.
9498
f8167d6e
RD
9499 Using this function will disable attempts to use themes for this
9500 window, if the system supports them. Use with care since usually the
9501 themes represent the appearance chosen by the user to be used for all
9502 applications on the system.
d55e5bfc 9503 """
5b5c9bc7 9504 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 9505
412d302d 9506 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
9507 """SetOwnBackgroundColour(self, Colour colour)"""
9508 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9509
9510 def SetForegroundColour(*args, **kwargs):
9511 """
5b5c9bc7 9512 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9513
9514 Sets the foreground colour of the window. Returns True is the colour
9515 was changed. The interpretation of foreground colour is dependent on
9516 the window class; it may be the text colour or other colour, or it may
9517 not be used at all.
9518 """
5b5c9bc7 9519 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 9520
fa47d7a7 9521 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
9522 """SetOwnForegroundColour(self, Colour colour)"""
9523 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9524
9525 def GetBackgroundColour(*args, **kwargs):
9526 """
5b5c9bc7 9527 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
9528
9529 Returns the background colour of the window.
9530 """
5b5c9bc7 9531 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9532
9533 def GetForegroundColour(*args, **kwargs):
9534 """
5b5c9bc7 9535 GetForegroundColour(self) -> Colour
d55e5bfc
RD
9536
9537 Returns the foreground colour of the window. The interpretation of
9538 foreground colour is dependent on the window class; it may be the text
9539 colour or other colour, or it may not be used at all.
9540 """
5b5c9bc7 9541 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 9542
dcb8fc74
RD
9543 def InheritsBackgroundColour(*args, **kwargs):
9544 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 9545 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
9546
9547 def UseBgCol(*args, **kwargs):
9548 """UseBgCol(self) -> bool"""
5b5c9bc7 9549 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 9550
0f63ec68
RD
9551 def SetBackgroundStyle(*args, **kwargs):
9552 """
9553 SetBackgroundStyle(self, int style) -> bool
9554
9555 Returns the background style of the window. The background style
9556 indicates how the background of the window is drawn.
9557
9558 ====================== ========================================
9559 wx.BG_STYLE_SYSTEM The background colour or pattern should
9560 be determined by the system
9561 wx.BG_STYLE_COLOUR The background should be a solid colour
9562 wx.BG_STYLE_CUSTOM The background will be implemented by the
9563 application.
9564 ====================== ========================================
9565
9566 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9567 a custom background, such as a tiled bitmap. Currently the style has
9568 no effect on other platforms.
9569
9570 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9571 """
5b5c9bc7 9572 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
9573
9574 def GetBackgroundStyle(*args, **kwargs):
9575 """
9576 GetBackgroundStyle(self) -> int
9577
9578 Returns the background style of the window.
9579
9580 :see: `SetBackgroundStyle`
9581 """
5b5c9bc7 9582 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 9583
51b83b37
RD
9584 def HasTransparentBackground(*args, **kwargs):
9585 """
9586 HasTransparentBackground(self) -> bool
9587
9588 Returns True if this window's background is transparent (as, for
9589 example, for `wx.StaticText`) and should show the parent window's
9590 background.
9591
9592 This method is mostly used internally by the library itself and you
9593 normally shouldn't have to call it. You may, however, have to override
9594 it in your custom control classes to ensure that background is painted
9595 correctly.
9596 """
5b5c9bc7 9597 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 9598
d55e5bfc
RD
9599 def SetCursor(*args, **kwargs):
9600 """
5b5c9bc7 9601 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
9602
9603 Sets the window's cursor. Notice that the window cursor also sets it
9604 for the children of the window implicitly.
9605
9606 The cursor may be wx.NullCursor in which case the window cursor will
9607 be reset back to default.
9608 """
5b5c9bc7 9609 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
9610
9611 def GetCursor(*args, **kwargs):
9612 """
5b5c9bc7 9613 GetCursor(self) -> Cursor
d55e5bfc
RD
9614
9615 Return the cursor associated with this window.
9616 """
5b5c9bc7 9617 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
9618
9619 def SetFont(*args, **kwargs):
9620 """
5b5c9bc7 9621 SetFont(self, Font font) -> bool
d55e5bfc
RD
9622
9623 Sets the font for this window.
9624 """
5b5c9bc7 9625 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9626
fa47d7a7 9627 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9628 """SetOwnFont(self, Font font)"""
9629 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9630
9631 def GetFont(*args, **kwargs):
9632 """
5b5c9bc7 9633 GetFont(self) -> Font
d55e5bfc
RD
9634
9635 Returns the default font used for this window.
9636 """
5b5c9bc7 9637 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9638
9639 def SetCaret(*args, **kwargs):
9640 """
5b5c9bc7 9641 SetCaret(self, Caret caret)
d55e5bfc
RD
9642
9643 Sets the caret associated with the window.
9644 """
5b5c9bc7 9645 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9646
9647 def GetCaret(*args, **kwargs):
9648 """
5b5c9bc7 9649 GetCaret(self) -> Caret
d55e5bfc
RD
9650
9651 Returns the caret associated with the window.
9652 """
5b5c9bc7 9653 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9654
9655 def GetCharHeight(*args, **kwargs):
9656 """
9657 GetCharHeight(self) -> int
9658
9659 Get the (average) character size for the current font.
9660 """
5b5c9bc7 9661 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9662
9663 def GetCharWidth(*args, **kwargs):
9664 """
9665 GetCharWidth(self) -> int
9666
9667 Get the (average) character size for the current font.
9668 """
5b5c9bc7 9669 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9670
9671 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9672 """
9673 GetTextExtent(String string) -> (width, height)
9674
9675 Get the width and height of the text using the current font.
9676 """
5b5c9bc7 9677 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9678
9679 def GetFullTextExtent(*args, **kwargs):
9680 """
9681 GetFullTextExtent(String string, Font font=None) ->
9682 (width, height, descent, externalLeading)
9683
9684 Get the width, height, decent and leading of the text using the
9685 current or specified font.
9686 """
5b5c9bc7 9687 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9688
9689 def ClientToScreenXY(*args, **kwargs):
9690 """
9691 ClientToScreenXY(int x, int y) -> (x,y)
9692
9693 Converts to screen coordinates from coordinates relative to this window.
9694 """
5b5c9bc7 9695 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9696
9697 def ScreenToClientXY(*args, **kwargs):
9698 """
9699 ScreenToClientXY(int x, int y) -> (x,y)
9700
9701 Converts from screen to client window coordinates.
9702 """
5b5c9bc7 9703 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9704
9705 def ClientToScreen(*args, **kwargs):
9706 """
5b5c9bc7 9707 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9708
9709 Converts to screen coordinates from coordinates relative to this window.
9710 """
5b5c9bc7 9711 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9712
9713 def ScreenToClient(*args, **kwargs):
9714 """
5b5c9bc7 9715 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9716
9717 Converts from screen to client window coordinates.
9718 """
5b5c9bc7 9719 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9720
9721 def HitTestXY(*args, **kwargs):
9722 """
9723 HitTestXY(self, int x, int y) -> int
9724
9725 Test where the given (in client coords) point lies
9726 """
5b5c9bc7 9727 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9728
9729 def HitTest(*args, **kwargs):
9730 """
5b5c9bc7 9731 HitTest(self, Point pt) -> int
d55e5bfc
RD
9732
9733 Test where the given (in client coords) point lies
9734 """
5b5c9bc7 9735 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9736
9737 def GetBorder(*args):
9738 """
9739 GetBorder(self, long flags) -> int
9740 GetBorder(self) -> int
9741
9742 Get border for the flags of this window
9743 """
5b5c9bc7 9744 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9745
9746 def UpdateWindowUI(*args, **kwargs):
9747 """
5b5c9bc7 9748 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9749
9750 This function sends EVT_UPDATE_UI events to the window. The particular
9751 implementation depends on the window; for example a wx.ToolBar will
9752 send an update UI event for each toolbar button, and a wx.Frame will
9753 send an update UI event for each menubar menu item. You can call this
9754 function from your application to ensure that your UI is up-to-date at
9755 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9756 concerned). This may be necessary if you have called
5ba5649b 9757 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9758 limit the overhead that wxWindows incurs by sending update UI events
9759 in idle time.
d55e5bfc 9760 """
5b5c9bc7 9761 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9762
9763 def PopupMenuXY(*args, **kwargs):
9764 """
5b5c9bc7 9765 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9766
b0503257
RD
9767 Pops up the given menu at the specified coordinates, relative to this window,
9768 and returns control when the user has dismissed the menu. If a menu item is
9769 selected, the corresponding menu event is generated and will be processed as
9770 usual. If the default position is given then the current position of the
9771 mouse cursor will be used.
d55e5bfc 9772 """
5b5c9bc7 9773 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9774
9775 def PopupMenu(*args, **kwargs):
9776 """
5b5c9bc7 9777 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9778
b0503257
RD
9779 Pops up the given menu at the specified coordinates, relative to this window,
9780 and returns control when the user has dismissed the menu. If a menu item is
9781 selected, the corresponding menu event is generated and will be processed as
9782 usual. If the default position is given then the current position of the
9783 mouse cursor will be used.
d55e5bfc 9784 """
5b5c9bc7 9785 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc
RD
9786
9787 def GetHandle(*args, **kwargs):
9788 """
9789 GetHandle(self) -> long
9790
9791 Returns the platform-specific handle (as a long integer) of the
9792 physical window. Currently on wxMac it returns the handle of the
9793 toplevel parent of the window.
9794 """
5b5c9bc7 9795 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 9796
629e65c2
RD
9797 def AssociateHandle(*args, **kwargs):
9798 """
9799 AssociateHandle(self, long handle)
9800
9801 Associate the window with a new native handle
9802 """
5b5c9bc7 9803 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
9804
9805 def DissociateHandle(*args, **kwargs):
9806 """
9807 DissociateHandle(self)
9808
9809 Dissociate the current native handle from the window
9810 """
5b5c9bc7 9811 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 9812
d55e5bfc
RD
9813 def HasScrollbar(*args, **kwargs):
9814 """
9815 HasScrollbar(self, int orient) -> bool
9816
9817 Does the window have the scrollbar for this orientation?
9818 """
5b5c9bc7 9819 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
9820
9821 def SetScrollbar(*args, **kwargs):
9822 """
15817c7e 9823 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9824 bool refresh=True)
9825
9826 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 9827 """
5b5c9bc7 9828 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
9829
9830 def SetScrollPos(*args, **kwargs):
9831 """
9832 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9833
9834 Sets the position of one of the built-in scrollbars.
9835 """
5b5c9bc7 9836 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
9837
9838 def GetScrollPos(*args, **kwargs):
9839 """
9840 GetScrollPos(self, int orientation) -> int
9841
9842 Returns the built-in scrollbar position.
9843 """
5b5c9bc7 9844 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
9845
9846 def GetScrollThumb(*args, **kwargs):
9847 """
9848 GetScrollThumb(self, int orientation) -> int
9849
9850 Returns the built-in scrollbar thumb size.
9851 """
5b5c9bc7 9852 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
9853
9854 def GetScrollRange(*args, **kwargs):
9855 """
9856 GetScrollRange(self, int orientation) -> int
9857
9858 Returns the built-in scrollbar range.
9859 """
5b5c9bc7 9860 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
9861
9862 def ScrollWindow(*args, **kwargs):
9863 """
5b5c9bc7 9864 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
9865
9866 Physically scrolls the pixels in the window and move child windows
9867 accordingly. Use this function to optimise your scrolling
9868 implementations, to minimise the area that must be redrawn. Note that
9869 it is rarely required to call this function from a user program.
d55e5bfc 9870 """
5b5c9bc7 9871 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
9872
9873 def ScrollLines(*args, **kwargs):
9874 """
9875 ScrollLines(self, int lines) -> bool
9876
9877 If the platform and window class supports it, scrolls the window by
9878 the given number of lines down, if lines is positive, or up if lines
9879 is negative. Returns True if the window was scrolled, False if it was
9880 already on top/bottom and nothing was done.
9881 """
5b5c9bc7 9882 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
9883
9884 def ScrollPages(*args, **kwargs):
9885 """
9886 ScrollPages(self, int pages) -> bool
9887
15817c7e 9888 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9889 the given number of pages down, if pages is positive, or up if pages
9890 is negative. Returns True if the window was scrolled, False if it was
9891 already on top/bottom and nothing was done.
9892 """
5b5c9bc7 9893 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
9894
9895 def LineUp(*args, **kwargs):
9896 """
9897 LineUp(self) -> bool
9898
9899 This is just a wrapper for ScrollLines(-1).
9900 """
5b5c9bc7 9901 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
9902
9903 def LineDown(*args, **kwargs):
9904 """
9905 LineDown(self) -> bool
9906
9907 This is just a wrapper for ScrollLines(1).
9908 """
5b5c9bc7 9909 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
9910
9911 def PageUp(*args, **kwargs):
9912 """
9913 PageUp(self) -> bool
9914
9915 This is just a wrapper for ScrollPages(-1).
9916 """
5b5c9bc7 9917 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
9918
9919 def PageDown(*args, **kwargs):
9920 """
9921 PageDown(self) -> bool
9922
9923 This is just a wrapper for ScrollPages(1).
9924 """
5b5c9bc7 9925 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
9926
9927 def SetHelpText(*args, **kwargs):
9928 """
5b5c9bc7 9929 SetHelpText(self, String text)
d55e5bfc
RD
9930
9931 Sets the help text to be used as context-sensitive help for this
9932 window. Note that the text is actually stored by the current
9933 wxHelpProvider implementation, and not in the window object itself.
9934 """
5b5c9bc7 9935 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
9936
9937 def SetHelpTextForId(*args, **kwargs):
9938 """
5b5c9bc7 9939 SetHelpTextForId(self, String text)
d55e5bfc
RD
9940
9941 Associate this help text with all windows with the same id as this
9942 one.
9943 """
5b5c9bc7 9944 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc
RD
9945
9946 def GetHelpText(*args, **kwargs):
9947 """
5b5c9bc7 9948 GetHelpText(self) -> String
d55e5bfc
RD
9949
9950 Gets the help text to be used as context-sensitive help for this
9951 window. Note that the text is actually stored by the current
9952 wxHelpProvider implementation, and not in the window object itself.
9953 """
5b5c9bc7 9954 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
9955
9956 def SetToolTipString(*args, **kwargs):
9957 """
5b5c9bc7 9958 SetToolTipString(self, String tip)
d55e5bfc
RD
9959
9960 Attach a tooltip to the window.
9961 """
5b5c9bc7 9962 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
9963
9964 def SetToolTip(*args, **kwargs):
9965 """
5b5c9bc7 9966 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
9967
9968 Attach a tooltip to the window.
9969 """
5b5c9bc7 9970 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
9971
9972 def GetToolTip(*args, **kwargs):
9973 """
5b5c9bc7 9974 GetToolTip(self) -> ToolTip
d55e5bfc
RD
9975
9976 get the associated tooltip or None if none
9977 """
5b5c9bc7 9978 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
9979
9980 def SetDropTarget(*args, **kwargs):
9981 """
5b5c9bc7 9982 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
9983
9984 Associates a drop target with this window. If the window already has
9985 a drop target, it is deleted.
9986 """
5b5c9bc7 9987 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
9988
9989 def GetDropTarget(*args, **kwargs):
9990 """
5b5c9bc7 9991 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
9992
9993 Returns the associated drop target, which may be None.
9994 """
5b5c9bc7 9995 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 9996
5ba5649b
RD
9997 def DragAcceptFiles(*args, **kwargs):
9998 """
9999 DragAcceptFiles(self, bool accept)
10000
10001 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10002 Only functional on Windows.
10003 """
10004 return _core_.Window_DragAcceptFiles(*args, **kwargs)
10005
d55e5bfc
RD
10006 def SetConstraints(*args, **kwargs):
10007 """
5b5c9bc7 10008 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
10009
10010 Sets the window to have the given layout constraints. If an existing
10011 layout constraints object is already owned by the window, it will be
10012 deleted. Pass None to disassociate and delete the window's current
10013 constraints.
10014
10015 You must call SetAutoLayout to tell a window to use the constraints
10016 automatically in its default EVT_SIZE handler; otherwise, you must
10017 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10018 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10019 effect.
10020 """
5b5c9bc7 10021 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
10022
10023 def GetConstraints(*args, **kwargs):
10024 """
5b5c9bc7 10025 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
10026
10027 Returns a pointer to the window's layout constraints, or None if there
10028 are none.
10029 """
5b5c9bc7 10030 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
10031
10032 def SetAutoLayout(*args, **kwargs):
10033 """
10034 SetAutoLayout(self, bool autoLayout)
10035
10036 Determines whether the Layout function will be called automatically
10037 when the window is resized. It is called implicitly by SetSizer but
10038 if you use SetConstraints you should call it manually or otherwise the
10039 window layout won't be correctly updated when its size changes.
10040 """
5b5c9bc7 10041 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
10042
10043 def GetAutoLayout(*args, **kwargs):
10044 """
10045 GetAutoLayout(self) -> bool
10046
10047 Returns the current autoLayout setting
10048 """
5b5c9bc7 10049 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
10050
10051 def Layout(*args, **kwargs):
10052 """
10053 Layout(self) -> bool
10054
10055 Invokes the constraint-based layout algorithm or the sizer-based
10056 algorithm for this window. See SetAutoLayout: when auto layout is on,
10057 this function gets called automatically by the default EVT_SIZE
10058 handler when the window is resized.
10059 """
5b5c9bc7 10060 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
10061
10062 def SetSizer(*args, **kwargs):
10063 """
5b5c9bc7 10064 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
10065
10066 Sets the window to have the given layout sizer. The window will then
10067 own the object, and will take care of its deletion. If an existing
10068 layout sizer object is already owned by the window, it will be deleted
10069 if the deleteOld parameter is true. Note that this function will also
10070 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 10071 non-None, and False otherwise.
d55e5bfc 10072 """
5b5c9bc7 10073 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
10074
10075 def SetSizerAndFit(*args, **kwargs):
10076 """
5b5c9bc7 10077 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
10078
10079 The same as SetSizer, except it also sets the size hints for the
10080 window based on the sizer's minimum size.
10081 """
5b5c9bc7 10082 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
10083
10084 def GetSizer(*args, **kwargs):
10085 """
5b5c9bc7 10086 GetSizer(self) -> Sizer
d55e5bfc
RD
10087
10088 Return the sizer associated with the window by a previous call to
10089 SetSizer or None if there isn't one.
10090 """
5b5c9bc7 10091 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
10092
10093 def SetContainingSizer(*args, **kwargs):
10094 """
5b5c9bc7 10095 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
10096
10097 This normally does not need to be called by application code. It is
10098 called internally when a window is added to a sizer, and is used so
10099 the window can remove itself from the sizer when it is destroyed.
10100 """
5b5c9bc7 10101 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
10102
10103 def GetContainingSizer(*args, **kwargs):
10104 """
5b5c9bc7 10105 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
10106
10107 Return the sizer that this window is a member of, if any, otherwise None.
10108 """
5b5c9bc7 10109 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
10110
10111 def InheritAttributes(*args, **kwargs):
10112 """
10113 InheritAttributes(self)
10114
15817c7e
RD
10115 This function is (or should be, in case of custom controls) called
10116 during window creation to intelligently set up the window visual
10117 attributes, that is the font and the foreground and background
10118 colours.
10119
10120 By 'intelligently' the following is meant: by default, all windows use
10121 their own default attributes. However if some of the parent's
10122 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10123 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
10124 explicitly set for this window itself, then this window takes the same
10125 value as used by the parent. In addition, if the window overrides
10126 ShouldInheritColours to return false, the colours will not be changed
10127 no matter what and only the font might.
10128
a7bb0a9d
RD
10129 This rather complicated logic is necessary in order to accommodate the
10130 different usage scenarios. The most common one is when all default
15817c7e
RD
10131 attributes are used and in this case, nothing should be inherited as
10132 in modern GUIs different controls use different fonts (and colours)
10133 than their siblings so they can't inherit the same value from the
10134 parent. However it was also deemed desirable to allow to simply change
10135 the attributes of all children at once by just changing the font or
10136 colour of their common parent, hence in this case we do inherit the
10137 parents attributes.
10138
d55e5bfc 10139 """
5b5c9bc7 10140 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
10141
10142 def ShouldInheritColours(*args, **kwargs):
10143 """
10144 ShouldInheritColours(self) -> bool
10145
10146 Return true from here to allow the colours of this window to be
15817c7e
RD
10147 changed by InheritAttributes, returning false forbids inheriting them
10148 from the parent window.
d55e5bfc 10149
15817c7e
RD
10150 The base class version returns false, but this method is overridden in
10151 wxControl where it returns true.
d55e5bfc 10152 """
5b5c9bc7 10153 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc
RD
10154
10155 def PostCreate(self, pre):
10156 """
10157 Phase 3 of the 2-phase create <wink!>
10158 Call this method after precreating the window with the 2-phase create method.
10159 """
10160 self.this = pre.this
10161 self.thisown = pre.thisown
10162 pre.thisown = 0
10163 if hasattr(self, '_setOORInfo'):
10164 self._setOORInfo(self)
10165 if hasattr(self, '_setCallbackInfo'):
10166 self._setCallbackInfo(self, self.__class__)
10167
7e08d4ef
RD
10168 def SendSizeEvent(self):
10169 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
10170
d55e5bfc 10171
5b5c9bc7 10172class WindowPtr(Window):
d55e5bfc
RD
10173 def __init__(self, this):
10174 self.this = this
10175 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10176 self.__class__ = Window
10177_core_.Window_swigregister(WindowPtr)
d55e5bfc
RD
10178
10179def PreWindow(*args, **kwargs):
10180 """
5b5c9bc7 10181 PreWindow() -> Window
d55e5bfc
RD
10182
10183 Precreate a Window for 2-phase creation.
10184 """
5b5c9bc7 10185 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
10186 val.thisown = 1
10187 return val
10188
5b5c9bc7 10189def Window_NewControlId(*args, **kwargs):
d55e5bfc 10190 """
5b5c9bc7 10191 Window_NewControlId() -> int
d55e5bfc
RD
10192
10193 Generate a control id for the controls which were not given one.
10194 """
5b5c9bc7 10195 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc 10196
5b5c9bc7 10197def Window_NextControlId(*args, **kwargs):
d55e5bfc 10198 """
5b5c9bc7 10199 Window_NextControlId(int winid) -> int
d55e5bfc
RD
10200
10201 Get the id of the control following the one with the given
15817c7e 10202 autogenerated) id
d55e5bfc 10203 """
5b5c9bc7 10204 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 10205
5b5c9bc7 10206def Window_PrevControlId(*args, **kwargs):
d55e5bfc 10207 """
5b5c9bc7 10208 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
10209
10210 Get the id of the control preceding the one with the given
15817c7e 10211 autogenerated) id
d55e5bfc 10212 """
5b5c9bc7 10213 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 10214
5b5c9bc7 10215def Window_FindFocus(*args, **kwargs):
d55e5bfc 10216 """
5b5c9bc7 10217 Window_FindFocus() -> Window
d55e5bfc
RD
10218
10219 Returns the window or control that currently has the keyboard focus,
10220 or None.
10221 """
5b5c9bc7 10222 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc 10223
5b5c9bc7 10224def Window_GetCapture(*args, **kwargs):
d55e5bfc 10225 """
5b5c9bc7 10226 Window_GetCapture() -> Window
d55e5bfc
RD
10227
10228 Returns the window which currently captures the mouse or None
10229 """
5b5c9bc7 10230 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc 10231
5b5c9bc7 10232def Window_GetClassDefaultAttributes(*args, **kwargs):
d55e5bfc 10233 """
5b5c9bc7 10234 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 10235
15817c7e
RD
10236 Get the default attributes for this class. This is useful if you want
10237 to use the same font or colour in your own control as in a standard
10238 control -- which is a much better idea than hard coding specific
a5ee0656
RD
10239 colours or fonts which might look completely out of place on the
10240 user's system, especially if it uses themes.
d55e5bfc
RD
10241
10242 The variant parameter is only relevant under Mac currently and is
15817c7e 10243 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
10244 the returned font. See `wx.Window.SetWindowVariant` for more about
10245 this.
d55e5bfc 10246 """
5b5c9bc7 10247 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10248
10249def DLG_PNT(win, point_or_x, y=None):
10250 """
10251 Convenience function for converting a Point or (x,y) in
10252 dialog units to pixel units.
10253 """
10254 if y is None:
10255 return win.ConvertDialogPointToPixels(point_or_x)
10256 else:
10257 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10258
10259def DLG_SZE(win, size_width, height=None):
10260 """
10261 Convenience function for converting a Size or (w,h) in
10262 dialog units to pixel units.
10263 """
10264 if height is None:
10265 return win.ConvertDialogSizeToPixels(size_width)
10266 else:
10267 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10268
10269
5b5c9bc7 10270def FindWindowById(*args, **kwargs):
d55e5bfc 10271 """
5b5c9bc7 10272 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
10273
10274 Find the first window in the application with the given id. If parent
10275 is None, the search will start from all top-level frames and dialog
10276 boxes; if non-None, the search will be limited to the given window
10277 hierarchy. The search is recursive in both cases.
10278 """
5b5c9bc7 10279 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 10280
5b5c9bc7 10281def FindWindowByName(*args, **kwargs):
d55e5bfc 10282 """
5b5c9bc7 10283 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
10284
10285 Find a window by its name (as given in a window constructor or Create
10286 function call). If parent is None, the search will start from all
10287 top-level frames and dialog boxes; if non-None, the search will be
10288 limited to the given window hierarchy. The search is recursive in both
10289 cases.
10290
10291 If no window with such name is found, wx.FindWindowByLabel is called.
10292 """
5b5c9bc7 10293 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 10294
5b5c9bc7 10295def FindWindowByLabel(*args, **kwargs):
d55e5bfc 10296 """
5b5c9bc7 10297 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
10298
10299 Find a window by its label. Depending on the type of window, the label
10300 may be a window title or panel item label. If parent is None, the
10301 search will start from all top-level frames and dialog boxes; if
10302 non-None, the search will be limited to the given window
10303 hierarchy. The search is recursive in both cases.
10304 """
5b5c9bc7 10305 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 10306
5b5c9bc7
RD
10307def Window_FromHWND(*args, **kwargs):
10308 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10309 return _core_.Window_FromHWND(*args, **kwargs)
3215336e
RD
10310
10311def GetTopLevelWindows(*args, **kwargs):
10312 """
10313 GetTopLevelWindows() -> PyObject
10314
10315 Returns a list of the the application's top-level windows, (frames,
10316 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10317 by wxWidgets, and so it is only valid as long as no top-level windows
10318 are closed or new top-level windows are created.
10319
10320 """
10321 return _core_.GetTopLevelWindows(*args, **kwargs)
d55e5bfc
RD
10322#---------------------------------------------------------------------------
10323
5b5c9bc7
RD
10324class Validator(EvtHandler):
10325 """Proxy of C++ Validator class"""
d55e5bfc
RD
10326 def __repr__(self):
10327 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10328 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10329 """__init__(self) -> Validator"""
10330 newobj = _core_.new_Validator(*args, **kwargs)
d55e5bfc
RD
10331 self.this = newobj.this
10332 self.thisown = 1
10333 del newobj.thisown
10334 self._setOORInfo(self)
10335
10336 def Clone(*args, **kwargs):
5b5c9bc7
RD
10337 """Clone(self) -> Validator"""
10338 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
10339
10340 def Validate(*args, **kwargs):
5b5c9bc7
RD
10341 """Validate(self, Window parent) -> bool"""
10342 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
10343
10344 def TransferToWindow(*args, **kwargs):
10345 """TransferToWindow(self) -> bool"""
5b5c9bc7 10346 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
10347
10348 def TransferFromWindow(*args, **kwargs):
10349 """TransferFromWindow(self) -> bool"""
5b5c9bc7 10350 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
10351
10352 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
10353 """GetWindow(self) -> Window"""
10354 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
10355
10356 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
10357 """SetWindow(self, Window window)"""
10358 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
10359
10360 def IsSilent(*args, **kwargs):
d6c14a4c 10361 """IsSilent() -> bool"""
5b5c9bc7 10362 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
10363
10364 IsSilent = staticmethod(IsSilent)
10365 def SetBellOnError(*args, **kwargs):
d6c14a4c 10366 """SetBellOnError(int doIt=True)"""
5b5c9bc7 10367 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
10368
10369 SetBellOnError = staticmethod(SetBellOnError)
10370
5b5c9bc7 10371class ValidatorPtr(Validator):
d55e5bfc
RD
10372 def __init__(self, this):
10373 self.this = this
10374 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10375 self.__class__ = Validator
10376_core_.Validator_swigregister(ValidatorPtr)
d55e5bfc 10377
5b5c9bc7
RD
10378def Validator_IsSilent(*args, **kwargs):
10379 """Validator_IsSilent() -> bool"""
10380 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc 10381
5b5c9bc7
RD
10382def Validator_SetBellOnError(*args, **kwargs):
10383 """Validator_SetBellOnError(int doIt=True)"""
10384 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 10385
5b5c9bc7
RD
10386class PyValidator(Validator):
10387 """Proxy of C++ PyValidator class"""
d55e5bfc
RD
10388 def __repr__(self):
10389 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10390 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10391 """__init__(self) -> PyValidator"""
10392 newobj = _core_.new_PyValidator(*args, **kwargs)
d55e5bfc
RD
10393 self.this = newobj.this
10394 self.thisown = 1
10395 del newobj.thisown
10396
10397 self._setCallbackInfo(self, PyValidator, 1)
10398 self._setOORInfo(self)
10399
10400 def _setCallbackInfo(*args, **kwargs):
10401 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 10402 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
10403
10404
5b5c9bc7 10405class PyValidatorPtr(PyValidator):
d55e5bfc
RD
10406 def __init__(self, this):
10407 self.this = this
10408 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10409 self.__class__ = PyValidator
10410_core_.PyValidator_swigregister(PyValidatorPtr)
d55e5bfc
RD
10411
10412#---------------------------------------------------------------------------
10413
5b5c9bc7
RD
10414class Menu(EvtHandler):
10415 """Proxy of C++ Menu class"""
d55e5bfc
RD
10416 def __repr__(self):
10417 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10418 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10419 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10420 newobj = _core_.new_Menu(*args, **kwargs)
d55e5bfc
RD
10421 self.this = newobj.this
10422 self.thisown = 1
10423 del newobj.thisown
10424 self._setOORInfo(self)
10425
10426 def Append(*args, **kwargs):
5b5c9bc7
RD
10427 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10428 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
10429
10430 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
10431 """AppendSeparator(self) -> MenuItem"""
10432 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
10433
10434 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
10435 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10436 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
10437
10438 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
10439 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10440 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
10441
10442 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
10443 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10444 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc
RD
10445
10446 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
10447 """AppendItem(self, MenuItem item) -> MenuItem"""
10448 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc
RD
10449
10450 def Break(*args, **kwargs):
10451 """Break(self)"""
5b5c9bc7 10452 return _core_.Menu_Break(*args, **kwargs)
d55e5bfc
RD
10453
10454 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
10455 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10456 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc
RD
10457
10458 def Insert(*args, **kwargs):
10459 """
5b5c9bc7
RD
10460 Insert(self, size_t pos, int id, String text, String help=EmptyString,
10461 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 10462 """
5b5c9bc7 10463 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
10464
10465 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
10466 """InsertSeparator(self, size_t pos) -> MenuItem"""
10467 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
10468
10469 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
10470 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10471 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
10472
10473 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
10474 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10475 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
10476
10477 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
10478 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10479 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc
RD
10480
10481 def PrependItem(*args, **kwargs):
5b5c9bc7
RD
10482 """PrependItem(self, MenuItem item) -> MenuItem"""
10483 return _core_.Menu_PrependItem(*args, **kwargs)
d55e5bfc
RD
10484
10485 def Prepend(*args, **kwargs):
5b5c9bc7
RD
10486 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10487 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
10488
10489 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
10490 """PrependSeparator(self) -> MenuItem"""
10491 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
10492
10493 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
10494 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10495 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
10496
10497 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
10498 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10499 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
10500
10501 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
10502 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10503 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
10504
10505 def Remove(*args, **kwargs):
5b5c9bc7
RD
10506 """Remove(self, int id) -> MenuItem"""
10507 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
10508
10509 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
10510 """RemoveItem(self, MenuItem item) -> MenuItem"""
10511 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
10512
10513 def Delete(*args, **kwargs):
10514 """Delete(self, int id) -> bool"""
5b5c9bc7 10515 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
10516
10517 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
10518 """DeleteItem(self, MenuItem item) -> bool"""
10519 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
10520
10521 def Destroy(*args, **kwargs):
10522 """
10523 Destroy(self)
10524
10525 Deletes the C++ object this Python object is a proxy for.
10526 """
7e08d4ef
RD
10527 val = _core_.Menu_Destroy(*args, **kwargs)
10528 args[0].thisown = 0
10529 return val
d55e5bfc
RD
10530
10531 def DestroyId(*args, **kwargs):
10532 """
10533 DestroyId(self, int id) -> bool
10534
10535 Deletes the C++ object this Python object is a proxy for.
10536 """
7e08d4ef
RD
10537 val = _core_.Menu_DestroyId(*args, **kwargs)
10538 args[0].thisown = 0
10539 return val
d55e5bfc
RD
10540
10541 def DestroyItem(*args, **kwargs):
10542 """
5b5c9bc7 10543 DestroyItem(self, MenuItem item) -> bool
d55e5bfc
RD
10544
10545 Deletes the C++ object this Python object is a proxy for.
10546 """
7e08d4ef
RD
10547 val = _core_.Menu_DestroyItem(*args, **kwargs)
10548 args[0].thisown = 0
10549 return val
d55e5bfc
RD
10550
10551 def GetMenuItemCount(*args, **kwargs):
10552 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 10553 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
10554
10555 def GetMenuItems(*args, **kwargs):
10556 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 10557 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
10558
10559 def FindItem(*args, **kwargs):
5b5c9bc7
RD
10560 """FindItem(self, String item) -> int"""
10561 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
10562
10563 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10564 """FindItemById(self, int id) -> MenuItem"""
10565 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
10566
10567 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
10568 """FindItemByPosition(self, size_t position) -> MenuItem"""
10569 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
10570
10571 def Enable(*args, **kwargs):
10572 """Enable(self, int id, bool enable)"""
5b5c9bc7 10573 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
10574
10575 def IsEnabled(*args, **kwargs):
10576 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10577 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10578
10579 def Check(*args, **kwargs):
10580 """Check(self, int id, bool check)"""
5b5c9bc7 10581 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
10582
10583 def IsChecked(*args, **kwargs):
10584 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10585 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
10586
10587 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10588 """SetLabel(self, int id, String label)"""
10589 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
10590
10591 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10592 """GetLabel(self, int id) -> String"""
10593 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
10594
10595 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10596 """SetHelpString(self, int id, String helpString)"""
10597 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10598
10599 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10600 """GetHelpString(self, int id) -> String"""
10601 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10602
10603 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
10604 """SetTitle(self, String title)"""
10605 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
10606
10607 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
10608 """GetTitle(self) -> String"""
10609 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
10610
10611 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10612 """SetEventHandler(self, EvtHandler handler)"""
10613 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
10614
10615 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10616 """GetEventHandler(self) -> EvtHandler"""
10617 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
10618
10619 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10620 """SetInvokingWindow(self, Window win)"""
10621 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10622
10623 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10624 """GetInvokingWindow(self) -> Window"""
10625 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10626
10627 def GetStyle(*args, **kwargs):
10628 """GetStyle(self) -> long"""
5b5c9bc7 10629 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
10630
10631 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10632 """UpdateUI(self, EvtHandler source=None)"""
10633 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10634
10635 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10636 """GetMenuBar(self) -> MenuBar"""
10637 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10638
10639 def Attach(*args, **kwargs):
10640 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10641 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10642
10643 def Detach(*args, **kwargs):
10644 """Detach(self)"""
5b5c9bc7 10645 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10646
10647 def IsAttached(*args, **kwargs):
10648 """IsAttached(self) -> bool"""
5b5c9bc7 10649 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10650
10651 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10652 """SetParent(self, Menu parent)"""
10653 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10654
10655 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10656 """GetParent(self) -> Menu"""
10657 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc
RD
10658
10659
5b5c9bc7 10660class MenuPtr(Menu):
d55e5bfc
RD
10661 def __init__(self, this):
10662 self.this = this
10663 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10664 self.__class__ = Menu
10665_core_.Menu_swigregister(MenuPtr)
10666DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10667
10668#---------------------------------------------------------------------------
10669
5b5c9bc7
RD
10670class MenuBar(Window):
10671 """Proxy of C++ MenuBar class"""
d55e5bfc
RD
10672 def __repr__(self):
10673 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10674 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10675 """__init__(self, long style=0) -> MenuBar"""
10676 newobj = _core_.new_MenuBar(*args, **kwargs)
d55e5bfc
RD
10677 self.this = newobj.this
10678 self.thisown = 1
10679 del newobj.thisown
10680 self._setOORInfo(self)
10681
10682 def Append(*args, **kwargs):
5b5c9bc7
RD
10683 """Append(self, Menu menu, String title) -> bool"""
10684 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10685
10686 def Insert(*args, **kwargs):
5b5c9bc7
RD
10687 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10688 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10689
10690 def GetMenuCount(*args, **kwargs):
10691 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10692 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10693
10694 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10695 """GetMenu(self, size_t pos) -> Menu"""
10696 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10697
10698 def Replace(*args, **kwargs):
5b5c9bc7
RD
10699 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10700 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
10701
10702 def Remove(*args, **kwargs):
5b5c9bc7
RD
10703 """Remove(self, size_t pos) -> Menu"""
10704 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
10705
10706 def EnableTop(*args, **kwargs):
10707 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 10708 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
10709
10710 def IsEnabledTop(*args, **kwargs):
10711 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 10712 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
10713
10714 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10715 """SetLabelTop(self, size_t pos, String label)"""
10716 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
10717
10718 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10719 """GetLabelTop(self, size_t pos) -> String"""
10720 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
10721
10722 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
10723 """FindMenuItem(self, String menu, String item) -> int"""
10724 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
10725
10726 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10727 """FindItemById(self, int id) -> MenuItem"""
10728 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
10729
10730 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
10731 """FindMenu(self, String title) -> int"""
10732 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
10733
10734 def Enable(*args, **kwargs):
10735 """Enable(self, int id, bool enable)"""
5b5c9bc7 10736 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
10737
10738 def Check(*args, **kwargs):
10739 """Check(self, int id, bool check)"""
5b5c9bc7 10740 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
10741
10742 def IsChecked(*args, **kwargs):
10743 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10744 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
10745
10746 def IsEnabled(*args, **kwargs):
10747 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10748 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10749
10750 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10751 """SetLabel(self, int id, String label)"""
10752 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
10753
10754 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10755 """GetLabel(self, int id) -> String"""
10756 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
10757
10758 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10759 """SetHelpString(self, int id, String helpString)"""
10760 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10761
10762 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10763 """GetHelpString(self, int id) -> String"""
10764 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10765
10766 def GetFrame(*args, **kwargs):
10767 """GetFrame(self) -> wxFrame"""
5b5c9bc7 10768 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
10769
10770 def IsAttached(*args, **kwargs):
10771 """IsAttached(self) -> bool"""
5b5c9bc7 10772 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
10773
10774 def Attach(*args, **kwargs):
10775 """Attach(self, wxFrame frame)"""
5b5c9bc7 10776 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
10777
10778 def Detach(*args, **kwargs):
10779 """Detach(self)"""
5b5c9bc7 10780 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 10781
4f433fef
RD
10782 def SetAutoWindowMenu(*args, **kwargs):
10783 """SetAutoWindowMenu(bool enable)"""
10784 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10785
10786 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10787 def GetAutoWindowMenu(*args, **kwargs):
10788 """GetAutoWindowMenu() -> bool"""
10789 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10790
10791 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
d55e5bfc 10792
5b5c9bc7 10793class MenuBarPtr(MenuBar):
d55e5bfc
RD
10794 def __init__(self, this):
10795 self.this = this
10796 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10797 self.__class__ = MenuBar
10798_core_.MenuBar_swigregister(MenuBarPtr)
d55e5bfc 10799
4f433fef
RD
10800def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10801 """MenuBar_SetAutoWindowMenu(bool enable)"""
10802 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10803
10804def MenuBar_GetAutoWindowMenu(*args, **kwargs):
10805 """MenuBar_GetAutoWindowMenu() -> bool"""
10806 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10807
d55e5bfc
RD
10808#---------------------------------------------------------------------------
10809
5b5c9bc7
RD
10810class MenuItem(Object):
10811 """Proxy of C++ MenuItem class"""
d55e5bfc
RD
10812 def __repr__(self):
10813 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10814 def __init__(self, *args, **kwargs):
10815 """
5b5c9bc7
RD
10816 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10817 String help=EmptyString, int kind=ITEM_NORMAL,
10818 Menu subMenu=None) -> MenuItem
d55e5bfc 10819 """
5b5c9bc7 10820 newobj = _core_.new_MenuItem(*args, **kwargs)
d55e5bfc
RD
10821 self.this = newobj.this
10822 self.thisown = 1
10823 del newobj.thisown
10824 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10825 """GetMenu(self) -> Menu"""
10826 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
10827
10828 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
10829 """SetMenu(self, Menu menu)"""
10830 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
10831
10832 def SetId(*args, **kwargs):
10833 """SetId(self, int id)"""
5b5c9bc7 10834 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
10835
10836 def GetId(*args, **kwargs):
10837 """GetId(self) -> int"""
5b5c9bc7 10838 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
10839
10840 def IsSeparator(*args, **kwargs):
10841 """IsSeparator(self) -> bool"""
5b5c9bc7 10842 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
10843
10844 def SetText(*args, **kwargs):
5b5c9bc7
RD
10845 """SetText(self, String str)"""
10846 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
10847
10848 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10849 """GetLabel(self) -> String"""
10850 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
10851
10852 def GetText(*args, **kwargs):
5b5c9bc7
RD
10853 """GetText(self) -> String"""
10854 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
10855
10856 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
10857 """GetLabelFromText(String text) -> String"""
10858 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
10859
10860 GetLabelFromText = staticmethod(GetLabelFromText)
10861 def GetKind(*args, **kwargs):
10862 """GetKind(self) -> int"""
5b5c9bc7 10863 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
10864
10865 def SetKind(*args, **kwargs):
10866 """SetKind(self, int kind)"""
5b5c9bc7 10867 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
10868
10869 def SetCheckable(*args, **kwargs):
10870 """SetCheckable(self, bool checkable)"""
5b5c9bc7 10871 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
10872
10873 def IsCheckable(*args, **kwargs):
10874 """IsCheckable(self) -> bool"""
5b5c9bc7 10875 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
10876
10877 def IsSubMenu(*args, **kwargs):
10878 """IsSubMenu(self) -> bool"""
5b5c9bc7 10879 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
10880
10881 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10882 """SetSubMenu(self, Menu menu)"""
10883 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
10884
10885 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10886 """GetSubMenu(self) -> Menu"""
10887 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
10888
10889 def Enable(*args, **kwargs):
10890 """Enable(self, bool enable=True)"""
5b5c9bc7 10891 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
10892
10893 def IsEnabled(*args, **kwargs):
10894 """IsEnabled(self) -> bool"""
5b5c9bc7 10895 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10896
10897 def Check(*args, **kwargs):
10898 """Check(self, bool check=True)"""
5b5c9bc7 10899 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
10900
10901 def IsChecked(*args, **kwargs):
10902 """IsChecked(self) -> bool"""
5b5c9bc7 10903 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
10904
10905 def Toggle(*args, **kwargs):
10906 """Toggle(self)"""
5b5c9bc7 10907 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
10908
10909 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
10910 """SetHelp(self, String str)"""
10911 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
10912
10913 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
10914 """GetHelp(self) -> String"""
10915 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
10916
10917 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
10918 """GetAccel(self) -> AcceleratorEntry"""
10919 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
10920
10921 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
10922 """SetAccel(self, AcceleratorEntry accel)"""
10923 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 10924
32fe5131
RD
10925 def SetBitmap(*args, **kwargs):
10926 """SetBitmap(self, Bitmap bitmap)"""
10927 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10928
10929 def GetBitmap(*args, **kwargs):
10930 """GetBitmap(self) -> Bitmap"""
10931 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10932
c1280d1e 10933 def SetFont(*args, **kwargs):
5b5c9bc7
RD
10934 """SetFont(self, Font font)"""
10935 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
10936
10937 def GetFont(*args, **kwargs):
5b5c9bc7
RD
10938 """GetFont(self) -> Font"""
10939 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
10940
10941 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
10942 """SetTextColour(self, Colour colText)"""
10943 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
10944
10945 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
10946 """GetTextColour(self) -> Colour"""
10947 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
10948
10949 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10950 """SetBackgroundColour(self, Colour colBack)"""
10951 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10952
10953 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10954 """GetBackgroundColour(self) -> Colour"""
10955 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10956
10957 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
10958 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10959 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
10960
10961 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10962 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10963 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10964
10965 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10966 """GetDisabledBitmap(self) -> Bitmap"""
10967 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10968
10969 def SetMarginWidth(*args, **kwargs):
10970 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 10971 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
10972
10973 def GetMarginWidth(*args, **kwargs):
10974 """GetMarginWidth(self) -> int"""
5b5c9bc7 10975 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 10976
d55e5bfc 10977 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 10978 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 10979 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10980
10981 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10982 def IsOwnerDrawn(*args, **kwargs):
10983 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 10984 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10985
10986 def SetOwnerDrawn(*args, **kwargs):
10987 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 10988 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10989
10990 def ResetOwnerDrawn(*args, **kwargs):
10991 """ResetOwnerDrawn(self)"""
5b5c9bc7 10992 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 10993
d55e5bfc 10994
5b5c9bc7 10995class MenuItemPtr(MenuItem):
d55e5bfc
RD
10996 def __init__(self, this):
10997 self.this = this
10998 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10999 self.__class__ = MenuItem
11000_core_.MenuItem_swigregister(MenuItemPtr)
d55e5bfc 11001
5b5c9bc7
RD
11002def MenuItem_GetLabelFromText(*args, **kwargs):
11003 """MenuItem_GetLabelFromText(String text) -> String"""
11004 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 11005
5b5c9bc7
RD
11006def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
11007 """MenuItem_GetDefaultMarginWidth() -> int"""
11008 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
11009
11010#---------------------------------------------------------------------------
11011
5b5c9bc7 11012class Control(Window):
d55e5bfc
RD
11013 """
11014 This is the base class for a control or 'widget'.
11015
15817c7e
RD
11016 A control is generally a small window which processes user input
11017 and/or displays one or more item of data.
d55e5bfc
RD
11018 """
11019 def __repr__(self):
11020 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11021 def __init__(self, *args, **kwargs):
11022 """
5b5c9bc7
RD
11023 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11024 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11025 String name=ControlNameStr) -> Control
d55e5bfc 11026
15817c7e
RD
11027 Create a Control. Normally you should only call this from a subclass'
11028 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 11029 """
5b5c9bc7 11030 newobj = _core_.new_Control(*args, **kwargs)
d55e5bfc
RD
11031 self.this = newobj.this
11032 self.thisown = 1
11033 del newobj.thisown
11034 self._setOORInfo(self)
11035
11036 def Create(*args, **kwargs):
11037 """
5b5c9bc7
RD
11038 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11039 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11040 String name=ControlNameStr) -> bool
d55e5bfc
RD
11041
11042 Do the 2nd phase and create the GUI control.
11043 """
5b5c9bc7 11044 return _core_.Control_Create(*args, **kwargs)
d55e5bfc
RD
11045
11046 def Command(*args, **kwargs):
11047 """
5b5c9bc7 11048 Command(self, CommandEvent event)
d55e5bfc 11049
15817c7e
RD
11050 Simulates the effect of the user issuing a command to the item.
11051
11052 :see: `wx.CommandEvent`
11053
d55e5bfc 11054 """
5b5c9bc7 11055 return _core_.Control_Command(*args, **kwargs)
d55e5bfc
RD
11056
11057 def GetLabel(*args, **kwargs):
11058 """
5b5c9bc7 11059 GetLabel(self) -> String
d55e5bfc
RD
11060
11061 Return a control's text.
11062 """
5b5c9bc7 11063 return _core_.Control_GetLabel(*args, **kwargs)
d55e5bfc
RD
11064
11065 def SetLabel(*args, **kwargs):
11066 """
5b5c9bc7 11067 SetLabel(self, String label)
d55e5bfc
RD
11068
11069 Sets the item's text.
11070 """
5b5c9bc7 11071 return _core_.Control_SetLabel(*args, **kwargs)
d55e5bfc
RD
11072
11073 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 11074 """
5b5c9bc7 11075 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11076
11077 Get the default attributes for this class. This is useful if you want
11078 to use the same font or colour in your own control as in a standard
11079 control -- which is a much better idea than hard coding specific
11080 colours or fonts which might look completely out of place on the
11081 user's system, especially if it uses themes.
11082
11083 The variant parameter is only relevant under Mac currently and is
11084 ignore under other platforms. Under Mac, it will change the size of
11085 the returned font. See `wx.Window.SetWindowVariant` for more about
11086 this.
11087 """
5b5c9bc7 11088 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11089
11090 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
11091
5b5c9bc7 11092class ControlPtr(Control):
d55e5bfc
RD
11093 def __init__(self, this):
11094 self.this = this
11095 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11096 self.__class__ = Control
11097_core_.Control_swigregister(ControlPtr)
d55e5bfc
RD
11098ControlNameStr = cvar.ControlNameStr
11099
11100def PreControl(*args, **kwargs):
11101 """
5b5c9bc7 11102 PreControl() -> Control
d55e5bfc
RD
11103
11104 Precreate a Control control for 2-phase creation
11105 """
5b5c9bc7 11106 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
11107 val.thisown = 1
11108 return val
11109
5b5c9bc7 11110def Control_GetClassDefaultAttributes(*args, **kwargs):
110da5b0 11111 """
5b5c9bc7 11112 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11113
11114 Get the default attributes for this class. This is useful if you want
11115 to use the same font or colour in your own control as in a standard
11116 control -- which is a much better idea than hard coding specific
11117 colours or fonts which might look completely out of place on the
11118 user's system, especially if it uses themes.
11119
11120 The variant parameter is only relevant under Mac currently and is
11121 ignore under other platforms. Under Mac, it will change the size of
11122 the returned font. See `wx.Window.SetWindowVariant` for more about
11123 this.
11124 """
5b5c9bc7 11125 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11126
11127#---------------------------------------------------------------------------
11128
5b5c9bc7 11129class ItemContainer(object):
d55e5bfc 11130 """
53aa7709
RD
11131 The wx.ItemContainer class defines an interface which is implemented
11132 by all controls which have string subitems, each of which may be
11133 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11134 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 11135 this one.
d55e5bfc 11136
15817c7e
RD
11137 It defines the methods for accessing the control's items and although
11138 each of the derived classes implements them differently, they still
11139 all conform to the same interface.
d55e5bfc 11140
15817c7e
RD
11141 The items in a wx.ItemContainer have (non empty) string labels and,
11142 optionally, client data associated with them.
d55e5bfc
RD
11143
11144 """
11145 def __init__(self): raise RuntimeError, "No constructor defined"
11146 def __repr__(self):
11147 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11148 def Append(*args, **kwargs):
11149 """
5b5c9bc7 11150 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 11151
15817c7e
RD
11152 Adds the item to the control, associating the given data with the item
11153 if not None. The return value is the index of the newly added item
11154 which may be different from the last one if the control is sorted (e.g.
11155 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 11156 """
5b5c9bc7 11157 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
11158
11159 def AppendItems(*args, **kwargs):
11160 """
f5b96ee1 11161 AppendItems(self, List strings)
d55e5bfc 11162
15817c7e
RD
11163 Apend several items at once to the control. Notice that calling this
11164 method may be much faster than appending the items one by one if you
11165 need to add a lot of items.
d55e5bfc 11166 """
5b5c9bc7 11167 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
11168
11169 def Insert(*args, **kwargs):
11170 """
5b5c9bc7 11171 Insert(self, String item, int pos, PyObject clientData=None) -> int
d55e5bfc 11172
15817c7e 11173 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
11174 optionally associating some data object with the item.
11175 """
5b5c9bc7 11176 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
11177
11178 def Clear(*args, **kwargs):
11179 """
11180 Clear(self)
11181
11182 Removes all items from the control.
11183 """
5b5c9bc7 11184 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
11185
11186 def Delete(*args, **kwargs):
11187 """
11188 Delete(self, int n)
11189
15817c7e
RD
11190 Deletes the item at the zero-based index 'n' from the control. Note
11191 that it is an error (signalled by a `wx.PyAssertionError` exception if
11192 enabled) to remove an item with the index negative or greater or equal
11193 than the number of items in the control.
d55e5bfc 11194 """
5b5c9bc7 11195 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 11196
53aa7709
RD
11197 def GetClientData(*args, **kwargs):
11198 """
11199 GetClientData(self, int n) -> PyObject
11200
11201 Returns the client data associated with the given item, (if any.)
11202 """
5b5c9bc7 11203 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
11204
11205 def SetClientData(*args, **kwargs):
11206 """
11207 SetClientData(self, int n, PyObject clientData)
11208
11209 Associate the given client data with the item at position n.
11210 """
5b5c9bc7 11211 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 11212
d55e5bfc
RD
11213 def GetCount(*args, **kwargs):
11214 """
11215 GetCount(self) -> int
11216
11217 Returns the number of items in the control.
11218 """
5b5c9bc7 11219 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
11220
11221 def IsEmpty(*args, **kwargs):
11222 """
11223 IsEmpty(self) -> bool
11224
11225 Returns True if the control is empty or False if it has some items.
11226 """
5b5c9bc7 11227 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
11228
11229 def GetString(*args, **kwargs):
11230 """
5b5c9bc7 11231 GetString(self, int n) -> String
d55e5bfc
RD
11232
11233 Returns the label of the item with the given index.
11234 """
5b5c9bc7 11235 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
11236
11237 def GetStrings(*args, **kwargs):
11238 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 11239 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
11240
11241 def SetString(*args, **kwargs):
11242 """
5b5c9bc7 11243 SetString(self, int n, String s)
d55e5bfc
RD
11244
11245 Sets the label for the given item.
11246 """
5b5c9bc7 11247 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
11248
11249 def FindString(*args, **kwargs):
11250 """
5b5c9bc7 11251 FindString(self, String s) -> int
d55e5bfc
RD
11252
11253 Finds an item whose label matches the given string. Returns the
15817c7e
RD
11254 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11255 found.
d55e5bfc 11256 """
5b5c9bc7 11257 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 11258
53aa7709 11259 def SetSelection(*args, **kwargs):
d55e5bfc 11260 """
53aa7709 11261 SetSelection(self, int n)
d55e5bfc
RD
11262
11263 Sets the item at index 'n' to be the selected item.
11264 """
5b5c9bc7 11265 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 11266
d55e5bfc
RD
11267 def GetSelection(*args, **kwargs):
11268 """
11269 GetSelection(self) -> int
11270
15817c7e
RD
11271 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11272 is selected.
d55e5bfc 11273 """
5b5c9bc7 11274 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 11275
53aa7709 11276 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
11277 """SetStringSelection(self, String s) -> bool"""
11278 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 11279
d55e5bfc
RD
11280 def GetStringSelection(*args, **kwargs):
11281 """
5b5c9bc7 11282 GetStringSelection(self) -> String
d55e5bfc 11283
15817c7e
RD
11284 Returns the label of the selected item or an empty string if no item
11285 is selected.
d55e5bfc 11286 """
5b5c9bc7 11287 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 11288
53aa7709 11289 def Select(*args, **kwargs):
d55e5bfc 11290 """
53aa7709 11291 Select(self, int n)
d55e5bfc 11292
53aa7709
RD
11293 This is the same as `SetSelection` and exists only because it is
11294 slightly more natural for controls which support multiple selection.
d55e5bfc 11295 """
5b5c9bc7 11296 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc
RD
11297
11298
5b5c9bc7 11299class ItemContainerPtr(ItemContainer):
d55e5bfc
RD
11300 def __init__(self, this):
11301 self.this = this
11302 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11303 self.__class__ = ItemContainer
11304_core_.ItemContainer_swigregister(ItemContainerPtr)
d55e5bfc
RD
11305
11306#---------------------------------------------------------------------------
11307
5b5c9bc7 11308class ControlWithItems(Control,ItemContainer):
d55e5bfc 11309 """
15817c7e
RD
11310 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11311 wx.Control class, and is used for the base class of various controls
11312 that have items.
d55e5bfc
RD
11313 """
11314 def __init__(self): raise RuntimeError, "No constructor defined"
11315 def __repr__(self):
11316 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11317
5b5c9bc7 11318class ControlWithItemsPtr(ControlWithItems):
d55e5bfc
RD
11319 def __init__(self, this):
11320 self.this = this
11321 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11322 self.__class__ = ControlWithItems
11323_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
d55e5bfc
RD
11324
11325#---------------------------------------------------------------------------
11326
5b5c9bc7 11327class SizerItem(Object):
bfddbb17
RD
11328 """
11329 The wx.SizerItem class is used to track the position, size and other
11330 attributes of each item managed by a `wx.Sizer`. In normal usage user
11331 code should never need to deal directly with a wx.SizerItem, but
11332 custom classes derived from `wx.PySizer` will probably need to use the
11333 collection of wx.SizerItems held by wx.Sizer when calculating layout.
11334
11335 :see: `wx.Sizer`, `wx.GBSizerItem`
11336 """
d55e5bfc
RD
11337 def __repr__(self):
11338 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11339 def __init__(self, *args, **kwargs):
bfddbb17 11340 """
5b5c9bc7 11341 __init__(self) -> SizerItem
bfddbb17
RD
11342
11343 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11344 size will need to be set before this item can be used in a Sizer.
11345
11346 You will probably never need to create a wx.SizerItem directly as they
11347 are created automatically when the sizer's Add, Insert or Prepend
11348 methods are called.
11349
11350 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11351 """
5b5c9bc7 11352 newobj = _core_.new_SizerItem(*args, **kwargs)
d55e5bfc
RD
11353 self.this = newobj.this
11354 self.thisown = 1
11355 del newobj.thisown
7e08d4ef
RD
11356 def __del__(self, destroy=_core_.delete_SizerItem):
11357 """__del__(self)"""
11358 try:
11359 if self.thisown: destroy(self)
11360 except: pass
11361
d55e5bfc 11362 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11363 """
11364 DeleteWindows(self)
11365
11366 Destroy the window or the windows in a subsizer, depending on the type
11367 of item.
11368 """
5b5c9bc7 11369 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11370
11371 def DetachSizer(*args, **kwargs):
bfddbb17
RD
11372 """
11373 DetachSizer(self)
11374
11375 Enable deleting the SizerItem without destroying the contained sizer.
11376 """
5b5c9bc7 11377 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
11378
11379 def GetSize(*args, **kwargs):
bfddbb17 11380 """
5b5c9bc7 11381 GetSize(self) -> Size
bfddbb17
RD
11382
11383 Get the current size of the item, as set in the last Layout.
11384 """
5b5c9bc7 11385 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
11386
11387 def CalcMin(*args, **kwargs):
bfddbb17 11388 """
5b5c9bc7 11389 CalcMin(self) -> Size
bfddbb17
RD
11390
11391 Calculates the minimum desired size for the item, including any space
11392 needed by borders.
11393 """
5b5c9bc7 11394 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
11395
11396 def SetDimension(*args, **kwargs):
bfddbb17 11397 """
5b5c9bc7 11398 SetDimension(self, Point pos, Size size)
bfddbb17
RD
11399
11400 Set the position and size of the space allocated for this item by the
11401 sizer, and adjust the position and size of the item (window or
11402 subsizer) to be within that space taking alignment and borders into
11403 account.
11404 """
5b5c9bc7 11405 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
11406
11407 def GetMinSize(*args, **kwargs):
bfddbb17 11408 """
5b5c9bc7 11409 GetMinSize(self) -> Size
bfddbb17
RD
11410
11411 Get the minimum size needed for the item.
11412 """
5b5c9bc7 11413 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 11414
a001823c
RD
11415 def GetMinSizeWithBorder(*args, **kwargs):
11416 """
5b5c9bc7 11417 GetMinSizeWithBorder(self) -> Size
a001823c
RD
11418
11419 Get the minimum size needed for the item with space for the borders
11420 added, if needed.
11421 """
5b5c9bc7 11422 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 11423
d55e5bfc
RD
11424 def SetInitSize(*args, **kwargs):
11425 """SetInitSize(self, int x, int y)"""
5b5c9bc7 11426 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
11427
11428 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
11429 """
11430 SetRatioWH(self, int width, int height)
11431
11432 Set the ratio item attribute.
11433 """
5b5c9bc7 11434 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
11435
11436 def SetRatioSize(*args, **kwargs):
bfddbb17 11437 """
5b5c9bc7 11438 SetRatioSize(self, Size size)
bfddbb17
RD
11439
11440 Set the ratio item attribute.
11441 """
5b5c9bc7 11442 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
11443
11444 def SetRatio(*args, **kwargs):
bfddbb17
RD
11445 """
11446 SetRatio(self, float ratio)
11447
11448 Set the ratio item attribute.
11449 """
5b5c9bc7 11450 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
11451
11452 def GetRatio(*args, **kwargs):
bfddbb17
RD
11453 """
11454 GetRatio(self) -> float
11455
11456 Set the ratio item attribute.
11457 """
5b5c9bc7 11458 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 11459
070c48b4
RD
11460 def GetRect(*args, **kwargs):
11461 """
5b5c9bc7 11462 GetRect(self) -> Rect
070c48b4
RD
11463
11464 Returns the rectangle that the sizer item should occupy
11465 """
5b5c9bc7 11466 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 11467
d55e5bfc 11468 def IsWindow(*args, **kwargs):
bfddbb17
RD
11469 """
11470 IsWindow(self) -> bool
11471
11472 Is this sizer item a window?
11473 """
5b5c9bc7 11474 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
11475
11476 def IsSizer(*args, **kwargs):
bfddbb17
RD
11477 """
11478 IsSizer(self) -> bool
11479
11480 Is this sizer item a subsizer?
11481 """
5b5c9bc7 11482 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
11483
11484 def IsSpacer(*args, **kwargs):
bfddbb17
RD
11485 """
11486 IsSpacer(self) -> bool
11487
11488 Is this sizer item a spacer?
11489 """
5b5c9bc7 11490 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
11491
11492 def SetProportion(*args, **kwargs):
bfddbb17
RD
11493 """
11494 SetProportion(self, int proportion)
11495
11496 Set the proportion value for this item.
11497 """
5b5c9bc7 11498 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
11499
11500 def GetProportion(*args, **kwargs):
bfddbb17
RD
11501 """
11502 GetProportion(self) -> int
11503
11504 Get the proportion value for this item.
11505 """
5b5c9bc7 11506 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 11507
bfddbb17
RD
11508 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11509 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 11510 def SetFlag(*args, **kwargs):
bfddbb17
RD
11511 """
11512 SetFlag(self, int flag)
11513
11514 Set the flag value for this item.
11515 """
5b5c9bc7 11516 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
11517
11518 def GetFlag(*args, **kwargs):
bfddbb17
RD
11519 """
11520 GetFlag(self) -> int
11521
11522 Get the flag value for this item.
11523 """
5b5c9bc7 11524 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
11525
11526 def SetBorder(*args, **kwargs):
bfddbb17
RD
11527 """
11528 SetBorder(self, int border)
11529
11530 Set the border value for this item.
11531 """
5b5c9bc7 11532 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
11533
11534 def GetBorder(*args, **kwargs):
bfddbb17
RD
11535 """
11536 GetBorder(self) -> int
11537
11538 Get the border value for this item.
11539 """
5b5c9bc7 11540 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
11541
11542 def GetWindow(*args, **kwargs):
bfddbb17 11543 """
5b5c9bc7 11544 GetWindow(self) -> Window
bfddbb17
RD
11545
11546 Get the window (if any) that is managed by this sizer item.
11547 """
5b5c9bc7 11548 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
11549
11550 def SetWindow(*args, **kwargs):
bfddbb17 11551 """
5b5c9bc7 11552 SetWindow(self, Window window)
bfddbb17
RD
11553
11554 Set the window to be managed by this sizer item.
11555 """
5b5c9bc7 11556 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
11557
11558 def GetSizer(*args, **kwargs):
bfddbb17 11559 """
5b5c9bc7 11560 GetSizer(self) -> Sizer
bfddbb17
RD
11561
11562 Get the subsizer (if any) that is managed by this sizer item.
11563 """
5b5c9bc7 11564 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
11565
11566 def SetSizer(*args, **kwargs):
bfddbb17 11567 """
5b5c9bc7 11568 SetSizer(self, Sizer sizer)
bfddbb17
RD
11569
11570 Set the subsizer to be managed by this sizer item.
11571 """
5b5c9bc7 11572 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
11573
11574 def GetSpacer(*args, **kwargs):
bfddbb17 11575 """
5b5c9bc7 11576 GetSpacer(self) -> Size
bfddbb17
RD
11577
11578 Get the size of the spacer managed by this sizer item.
11579 """
5b5c9bc7 11580 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
11581
11582 def SetSpacer(*args, **kwargs):
bfddbb17 11583 """
5b5c9bc7 11584 SetSpacer(self, Size size)
bfddbb17
RD
11585
11586 Set the size of the spacer to be managed by this sizer item.
11587 """
5b5c9bc7 11588 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
11589
11590 def Show(*args, **kwargs):
bfddbb17
RD
11591 """
11592 Show(self, bool show)
11593
11594 Set the show item attribute, which sizers use to determine if the item
11595 is to be made part of the layout or not. If the item is tracking a
11596 window then it is shown or hidden as needed.
11597 """
5b5c9bc7 11598 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
11599
11600 def IsShown(*args, **kwargs):
bfddbb17
RD
11601 """
11602 IsShown(self) -> bool
11603
11604 Is the item to be shown in the layout?
11605 """
5b5c9bc7 11606 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
11607
11608 def GetPosition(*args, **kwargs):
bfddbb17 11609 """
5b5c9bc7 11610 GetPosition(self) -> Point
bfddbb17
RD
11611
11612 Returns the current position of the item, as set in the last Layout.
11613 """
5b5c9bc7 11614 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
11615
11616 def GetUserData(*args, **kwargs):
bfddbb17
RD
11617 """
11618 GetUserData(self) -> PyObject
11619
11620 Returns the userData associated with this sizer item, or None if there
11621 isn't any.
11622 """
5b5c9bc7 11623 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 11624
32fe5131
RD
11625 def SetUserData(*args, **kwargs):
11626 """
11627 SetUserData(self, PyObject userData)
11628
11629 Associate a Python object with this sizer item.
11630 """
11631 return _core_.SizerItem_SetUserData(*args, **kwargs)
11632
d55e5bfc 11633
5b5c9bc7 11634class SizerItemPtr(SizerItem):
d55e5bfc
RD
11635 def __init__(self, this):
11636 self.this = this
11637 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11638 self.__class__ = SizerItem
11639_core_.SizerItem_swigregister(SizerItemPtr)
d55e5bfc 11640
bfddbb17 11641def SizerItemWindow(*args, **kwargs):
d55e5bfc 11642 """
5b5c9bc7
RD
11643 SizerItemWindow(Window window, int proportion, int flag, int border,
11644 PyObject userData=None) -> SizerItem
bfddbb17
RD
11645
11646 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 11647 """
5b5c9bc7 11648 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
11649 val.thisown = 1
11650 return val
11651
bfddbb17 11652def SizerItemSpacer(*args, **kwargs):
d55e5bfc 11653 """
bfddbb17 11654 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 11655 PyObject userData=None) -> SizerItem
bfddbb17
RD
11656
11657 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 11658 """
5b5c9bc7 11659 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
11660 val.thisown = 1
11661 return val
11662
11663def SizerItemSizer(*args, **kwargs):
11664 """
5b5c9bc7
RD
11665 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11666 PyObject userData=None) -> SizerItem
bfddbb17
RD
11667
11668 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 11669 """
5b5c9bc7 11670 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
11671 val.thisown = 1
11672 return val
11673
5b5c9bc7 11674class Sizer(Object):
bfddbb17
RD
11675 """
11676 wx.Sizer is the abstract base class used for laying out subwindows in
11677 a window. You cannot use wx.Sizer directly; instead, you will have to
11678 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11679 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11680 and `wx.GridBagSizer`.
11681
11682 The concept implemented by sizers in wxWidgets is closely related to
11683 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11684 toolkit or the Qt toolkit. It is based upon the idea of the individual
11685 subwindows reporting their minimal required size and their ability to
11686 get stretched if the size of the parent window has changed. This will
11687 most often mean that the programmer does not set the original size of
11688 a dialog in the beginning, rather the dialog will assigned a sizer and
11689 this sizer will be queried about the recommended size. The sizer in
11690 turn will query its children, which can be normal windows or contorls,
11691 empty space or other sizers, so that a hierarchy of sizers can be
11692 constructed. Note that wxSizer does not derive from wxWindow and thus
11693 do not interfere with tab ordering and requires very little resources
11694 compared to a real window on screen.
11695
11696 What makes sizers so well fitted for use in wxWidgets is the fact that
11697 every control reports its own minimal size and the algorithm can
11698 handle differences in font sizes or different window (dialog item)
11699 sizes on different platforms without problems. If for example the
11700 standard font as well as the overall design of Mac widgets requires
11701 more space than on Windows, then the initial size of a dialog using a
11702 sizer will automatically be bigger on Mac than on Windows.
11703 """
d55e5bfc
RD
11704 def __init__(self): raise RuntimeError, "No constructor defined"
11705 def __repr__(self):
11706 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7e08d4ef
RD
11707 def __del__(self, destroy=_core_.delete_Sizer):
11708 """__del__(self)"""
11709 try:
11710 if self.thisown: destroy(self)
11711 except: pass
11712
d55e5bfc
RD
11713 def _setOORInfo(*args, **kwargs):
11714 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 11715 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
11716
11717 def Add(*args, **kwargs):
11718 """
bfddbb17 11719 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11720 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11721
11722 Appends a child item to the sizer.
d55e5bfc 11723 """
5b5c9bc7 11724 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
11725
11726 def Insert(*args, **kwargs):
11727 """
bfddbb17 11728 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 11729 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11730
11731 Inserts a new item into the list of items managed by this sizer before
11732 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 11733 """
5b5c9bc7 11734 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
11735
11736 def Prepend(*args, **kwargs):
11737 """
bfddbb17 11738 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11739 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11740
11741 Adds a new item to the begining of the list of sizer items managed by
11742 this sizer. See `Add` for a description of the parameters.
d55e5bfc 11743 """
5b5c9bc7 11744 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
11745
11746 def Remove(*args, **kwargs):
bfddbb17
RD
11747 """
11748 Remove(self, item) -> bool
11749
11750 Removes an item from the sizer and destroys it. This method does not
11751 cause any layout or resizing to take place, call `Layout` to update
11752 the layout on screen after removing a child from the sizer. The
11753 *item* parameter can be either a window, a sizer, or the zero-based
11754 index of an item to remove. Returns True if the child item was found
11755 and removed.
11756 """
5b5c9bc7 11757 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 11758
1a6bba1e 11759 def Detach(*args, **kwargs):
bfddbb17
RD
11760 """
11761 Detach(self, item) -> bool
11762
11763 Detaches an item from the sizer without destroying it. This method
11764 does not cause any layout or resizing to take place, call `Layout` to
11765 do so. The *item* parameter can be either a window, a sizer, or the
11766 zero-based index of the item to be detached. Returns True if the child item
11767 was found and detached.
11768 """
5b5c9bc7 11769 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 11770
070c48b4
RD
11771 def GetItem(*args, **kwargs):
11772 """
11773 GetItem(self, item) -> wx.SizerItem
11774
11775 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11776 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11777 the item to be found.
070c48b4 11778 """
5b5c9bc7 11779 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 11780
d55e5bfc 11781 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
11782 """_SetItemMinSize(self, PyObject item, Size size)"""
11783 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 11784
bfddbb17
RD
11785 def SetItemMinSize(self, item, *args):
11786 """
11787 SetItemMinSize(self, item, Size size)
11788
11789 Sets the minimum size that will be allocated for an item in the sizer.
11790 The *item* parameter can be either a window, a sizer, or the
11791 zero-based index of the item. If a window or sizer is given then it
11792 will be searched for recursivly in subsizers if neccessary.
11793 """
11794 if len(args) == 2:
11795 # for backward compatibility accept separate width,height args too
11796 return self._SetItemMinSize(item, args)
11797 else:
11798 return self._SetItemMinSize(item, args[0])
11799
d55e5bfc 11800 def AddItem(*args, **kwargs):
bfddbb17
RD
11801 """
11802 AddItem(self, SizerItem item)
11803
11804 Adds a `wx.SizerItem` to the sizer.
11805 """
5b5c9bc7 11806 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
11807
11808 def InsertItem(*args, **kwargs):
bfddbb17
RD
11809 """
11810 InsertItem(self, int index, SizerItem item)
11811
11812 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11813 """
5b5c9bc7 11814 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
11815
11816 def PrependItem(*args, **kwargs):
bfddbb17
RD
11817 """
11818 PrependItem(self, SizerItem item)
11819
11820 Prepends a `wx.SizerItem` to the sizer.
11821 """
5b5c9bc7 11822 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 11823
bfddbb17 11824 def AddMany(self, items):
d6c14a4c
RD
11825 """
11826 AddMany is a convenience method for adding several items
11827 to a sizer at one time. Simply pass it a list of tuples,
11828 where each tuple consists of the parameters that you
11829 would normally pass to the `Add` method.
11830 """
bfddbb17
RD
11831 for item in items:
11832 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11833 item = (item, )
11834 self.Add(*item)
d55e5bfc
RD
11835
11836 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
11837 def AddWindow(self, *args, **kw):
11838 """Compatibility alias for `Add`."""
11839 return self.Add(*args, **kw)
11840 def AddSizer(self, *args, **kw):
11841 """Compatibility alias for `Add`."""
11842 return self.Add(*args, **kw)
11843 def AddSpacer(self, *args, **kw):
11844 """Compatibility alias for `Add`."""
11845 return self.Add(*args, **kw)
11846
11847 def PrependWindow(self, *args, **kw):
11848 """Compatibility alias for `Prepend`."""
11849 return self.Prepend(*args, **kw)
11850 def PrependSizer(self, *args, **kw):
11851 """Compatibility alias for `Prepend`."""
11852 return self.Prepend(*args, **kw)
11853 def PrependSpacer(self, *args, **kw):
11854 """Compatibility alias for `Prepend`."""
11855 return self.Prepend(*args, **kw)
11856
11857 def InsertWindow(self, *args, **kw):
11858 """Compatibility alias for `Insert`."""
11859 return self.Insert(*args, **kw)
11860 def InsertSizer(self, *args, **kw):
11861 """Compatibility alias for `Insert`."""
11862 return self.Insert(*args, **kw)
11863 def InsertSpacer(self, *args, **kw):
11864 """Compatibility alias for `Insert`."""
11865 return self.Insert(*args, **kw)
11866
11867 def RemoveWindow(self, *args, **kw):
11868 """Compatibility alias for `Remove`."""
11869 return self.Remove(*args, **kw)
11870 def RemoveSizer(self, *args, **kw):
11871 """Compatibility alias for `Remove`."""
11872 return self.Remove(*args, **kw)
11873 def RemovePos(self, *args, **kw):
11874 """Compatibility alias for `Remove`."""
11875 return self.Remove(*args, **kw)
d55e5bfc
RD
11876
11877
d55e5bfc 11878 def SetDimension(*args, **kwargs):
bfddbb17
RD
11879 """
11880 SetDimension(self, int x, int y, int width, int height)
11881
11882 Call this to force the sizer to take the given dimension and thus
11883 force the items owned by the sizer to resize themselves according to
11884 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11885 methods.
11886 """
5b5c9bc7 11887 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
11888
11889 def SetMinSize(*args, **kwargs):
bfddbb17 11890 """
5b5c9bc7 11891 SetMinSize(self, Size size)
bfddbb17
RD
11892
11893 Call this to give the sizer a minimal size. Normally, the sizer will
11894 calculate its minimal size based purely on how much space its children
11895 need. After calling this method `GetMinSize` will return either the
11896 minimal size as requested by its children or the minimal size set
11897 here, depending on which is bigger.
11898 """
5b5c9bc7 11899 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
11900
11901 def GetSize(*args, **kwargs):
bfddbb17 11902 """
5b5c9bc7 11903 GetSize(self) -> Size
bfddbb17
RD
11904
11905 Returns the current size of the space managed by the sizer.
11906 """
5b5c9bc7 11907 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
11908
11909 def GetPosition(*args, **kwargs):
bfddbb17 11910 """
5b5c9bc7 11911 GetPosition(self) -> Point
bfddbb17
RD
11912
11913 Returns the current position of the sizer's managed space.
11914 """
5b5c9bc7 11915 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
11916
11917 def GetMinSize(*args, **kwargs):
bfddbb17 11918 """
5b5c9bc7 11919 GetMinSize(self) -> Size
bfddbb17
RD
11920
11921 Returns the minimal size of the sizer. This is either the combined
11922 minimal size of all the children and their borders or the minimal size
11923 set by SetMinSize, depending on which is bigger.
11924 """
5b5c9bc7 11925 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
11926
11927 def GetSizeTuple(self):
1a6bba1e 11928 return self.GetSize().Get()
d55e5bfc 11929 def GetPositionTuple(self):
1a6bba1e 11930 return self.GetPosition().Get()
d55e5bfc 11931 def GetMinSizeTuple(self):
1a6bba1e 11932 return self.GetMinSize().Get()
d55e5bfc
RD
11933
11934 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
11935 """
11936 RecalcSizes(self)
11937
11938 Using the sizes calculated by `CalcMin` reposition and resize all the
11939 items managed by this sizer. You should not need to call this directly as
11940 it is called by `Layout`.
11941 """
5b5c9bc7 11942 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
11943
11944 def CalcMin(*args, **kwargs):
bfddbb17 11945 """
5b5c9bc7 11946 CalcMin(self) -> Size
bfddbb17
RD
11947
11948 This method is where the sizer will do the actual calculation of its
11949 children's minimal sizes. You should not need to call this directly as
11950 it is called by `Layout`.
11951 """
5b5c9bc7 11952 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
11953
11954 def Layout(*args, **kwargs):
bfddbb17
RD
11955 """
11956 Layout(self)
11957
11958 This method will force the recalculation and layout of the items
11959 controlled by the sizer using the current space allocated to the
11960 sizer. Normally this is called automatically from the owning window's
11961 EVT_SIZE handler, but it is also useful to call it from user code when
11962 one of the items in a sizer change size, or items are added or
11963 removed.
11964 """
5b5c9bc7 11965 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
11966
11967 def Fit(*args, **kwargs):
bfddbb17 11968 """
5b5c9bc7 11969 Fit(self, Window window) -> Size
bfddbb17
RD
11970
11971 Tell the sizer to resize the *window* to match the sizer's minimal
11972 size. This is commonly done in the constructor of the window itself in
11973 order to set its initial size to match the needs of the children as
11974 determined by the sizer. Returns the new size.
11975
11976 For a top level window this is the total window size, not the client size.
11977 """
5b5c9bc7 11978 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
11979
11980 def FitInside(*args, **kwargs):
bfddbb17 11981 """
5b5c9bc7 11982 FitInside(self, Window window)
bfddbb17
RD
11983
11984 Tell the sizer to resize the *virtual size* of the *window* to match the
11985 sizer's minimal size. This will not alter the on screen size of the
11986 window, but may cause the addition/removal/alteration of scrollbars
11987 required to view the virtual area in windows which manage it.
11988
11989 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11990
11991 """
5b5c9bc7 11992 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
11993
11994 def SetSizeHints(*args, **kwargs):
bfddbb17 11995 """
5b5c9bc7 11996 SetSizeHints(self, Window window)
bfddbb17
RD
11997
11998 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11999 match the sizer's minimal size. This is commonly done in the
12000 constructor of the window itself if the window is resizable (as are
12001 many dialogs under Unix and frames on probably all platforms) in order
12002 to prevent the window from being sized smaller than the minimal size
12003 required by the sizer.
12004 """
5b5c9bc7 12005 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
12006
12007 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 12008 """
5b5c9bc7 12009 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
12010
12011 Tell the sizer to set the minimal size of the window virtual area to
12012 match the sizer's minimal size. For windows with managed scrollbars
12013 this will set them appropriately.
12014
12015 :see: `wx.ScrolledWindow.SetScrollbars`
12016
12017 """
5b5c9bc7 12018 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
12019
12020 def Clear(*args, **kwargs):
bfddbb17
RD
12021 """
12022 Clear(self, bool deleteWindows=False)
12023
12024 Clear all items from the sizer, optionally destroying the window items
12025 as well.
12026 """
5b5c9bc7 12027 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
12028
12029 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
12030 """
12031 DeleteWindows(self)
12032
12033 Destroy all windows managed by the sizer.
12034 """
5b5c9bc7 12035 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
12036
12037 def GetChildren(*args, **kwargs):
bfddbb17 12038 """
51b83b37 12039 GetChildren(self) -> list
bfddbb17
RD
12040
12041 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12042 """
5b5c9bc7 12043 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
12044
12045 def Show(*args, **kwargs):
bfddbb17 12046 """
b411df4a 12047 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 12048
bfddbb17
RD
12049 Shows or hides an item managed by the sizer. To make a sizer item
12050 disappear or reappear, use Show followed by `Layout`. The *item*
12051 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
12052 the item. Use the recursive parameter to show or hide an item in a
12053 subsizer. Returns True if the item was found.
bfddbb17 12054 """
5b5c9bc7 12055 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
12056
12057 def IsShown(*args, **kwargs):
bfddbb17
RD
12058 """
12059 IsShown(self, item)
12060
12061 Determines if the item is currently shown. sizer. To make a sizer
12062 item disappear or reappear, use Show followed by `Layout`. The *item*
12063 parameter can be either a window, a sizer, or the zero-based index of
12064 the item.
12065 """
5b5c9bc7 12066 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 12067
629e65c2 12068 def Hide(self, item, recursive=False):
bfddbb17 12069 """
27fb7603 12070 A convenience method for `Show` (item, False, recursive).
bfddbb17 12071 """
06759a38 12072 return self.Show(item, False, recursive)
bfddbb17 12073
d55e5bfc 12074 def ShowItems(*args, **kwargs):
bfddbb17
RD
12075 """
12076 ShowItems(self, bool show)
12077
84f85550 12078 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 12079 """
5b5c9bc7 12080 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc
RD
12081
12082
5b5c9bc7 12083class SizerPtr(Sizer):
d55e5bfc
RD
12084 def __init__(self, this):
12085 self.this = this
12086 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12087 self.__class__ = Sizer
12088_core_.Sizer_swigregister(SizerPtr)
d55e5bfc 12089
5b5c9bc7 12090class PySizer(Sizer):
bfddbb17
RD
12091 """
12092 wx.PySizer is a special version of `wx.Sizer` that has been
12093 instrumented to allow the C++ virtual methods to be overloaded in
12094 Python derived classes. You would derive from this class if you are
12095 wanting to implement a custom sizer in Python code. Simply implement
12096 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12097 For example::
12098
12099 class MySizer(wx.PySizer):
12100 def __init__(self):
12101 wx.PySizer.__init__(self)
12102
12103 def CalcMin(self):
12104 for item in self.GetChildren():
12105 # calculate the total minimum width and height needed
12106 # by all items in the sizer according to this sizer's
12107 # layout algorithm.
12108 ...
12109 return wx.Size(width, height)
12110
12111 def RecalcSizes(self):
12112 # find the space allotted to this sizer
12113 pos = self.GetPosition()
12114 size = self.GetSize()
12115 for item in self.GetChildren():
12116 # Recalculate (if necessary) the position and size of
12117 # each item and then call item.SetDimension to do the
12118 # actual positioning and sizing of the items within the
12119 # space alloted to this sizer.
12120 ...
12121 item.SetDimension(itemPos, itemSize)
12122
12123
12124 When `Layout` is called it first calls `CalcMin` followed by
12125 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 12126 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
12127
12128 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12129
12130
12131 """
d55e5bfc
RD
12132 def __repr__(self):
12133 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12134 def __init__(self, *args, **kwargs):
bfddbb17 12135 """
5b5c9bc7 12136 __init__(self) -> PySizer
bfddbb17
RD
12137
12138 Creates a wx.PySizer. Must be called from the __init__ in the derived
12139 class.
12140 """
5b5c9bc7 12141 newobj = _core_.new_PySizer(*args, **kwargs)
d55e5bfc
RD
12142 self.this = newobj.this
12143 self.thisown = 1
12144 del newobj.thisown
12145 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
12146
12147 def _setCallbackInfo(*args, **kwargs):
12148 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 12149 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
12150
12151
5b5c9bc7 12152class PySizerPtr(PySizer):
d55e5bfc
RD
12153 def __init__(self, this):
12154 self.this = this
12155 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12156 self.__class__ = PySizer
12157_core_.PySizer_swigregister(PySizerPtr)
d55e5bfc
RD
12158
12159#---------------------------------------------------------------------------
12160
5b5c9bc7 12161class BoxSizer(Sizer):
bfddbb17
RD
12162 """
12163 The basic idea behind a box sizer is that windows will most often be
12164 laid out in rather simple basic geometry, typically in a row or a
12165 column or nested hierarchies of either. A wx.BoxSizer will lay out
12166 its items in a simple row or column, depending on the orientation
12167 parameter passed to the constructor.
12168 """
d55e5bfc
RD
12169 def __repr__(self):
12170 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12171 def __init__(self, *args, **kwargs):
bfddbb17 12172 """
5b5c9bc7 12173 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
12174
12175 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12176 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12177 sizer.
12178 """
5b5c9bc7 12179 newobj = _core_.new_BoxSizer(*args, **kwargs)
d55e5bfc
RD
12180 self.this = newobj.this
12181 self.thisown = 1
12182 del newobj.thisown
12183 self._setOORInfo(self)
12184
12185 def GetOrientation(*args, **kwargs):
bfddbb17
RD
12186 """
12187 GetOrientation(self) -> int
12188
12189 Returns the current orientation of the sizer.
12190 """
5b5c9bc7 12191 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
12192
12193 def SetOrientation(*args, **kwargs):
bfddbb17
RD
12194 """
12195 SetOrientation(self, int orient)
d55e5bfc 12196
bfddbb17
RD
12197 Resets the orientation of the sizer.
12198 """
5b5c9bc7 12199 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc
RD
12200
12201
5b5c9bc7 12202class BoxSizerPtr(BoxSizer):
d55e5bfc
RD
12203 def __init__(self, this):
12204 self.this = this
12205 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12206 self.__class__ = BoxSizer
12207_core_.BoxSizer_swigregister(BoxSizerPtr)
d55e5bfc
RD
12208
12209#---------------------------------------------------------------------------
12210
5b5c9bc7 12211class StaticBoxSizer(BoxSizer):
bfddbb17
RD
12212 """
12213 wx.StaticBoxSizer derives from and functions identically to the
12214 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12215 manages. Note that this static box must be created separately and
12216 passed to the sizer constructor.
12217 """
d55e5bfc
RD
12218 def __repr__(self):
12219 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12220 def __init__(self, *args, **kwargs):
bfddbb17 12221 """
5b5c9bc7 12222 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
12223
12224 Constructor. It takes an associated static box and the orientation
12225 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12226 ``wx.HORIZONTAL``.
12227 """
5b5c9bc7 12228 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
d55e5bfc
RD
12229 self.this = newobj.this
12230 self.thisown = 1
12231 del newobj.thisown
12232 self._setOORInfo(self)
12233
12234 def GetStaticBox(*args, **kwargs):
bfddbb17 12235 """
5b5c9bc7 12236 GetStaticBox(self) -> StaticBox
d55e5bfc 12237
bfddbb17
RD
12238 Returns the static box associated with this sizer.
12239 """
5b5c9bc7 12240 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc
RD
12241
12242
5b5c9bc7 12243class StaticBoxSizerPtr(StaticBoxSizer):
d55e5bfc
RD
12244 def __init__(self, this):
12245 self.this = this
12246 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12247 self.__class__ = StaticBoxSizer
12248_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
d55e5bfc
RD
12249
12250#---------------------------------------------------------------------------
12251
5b5c9bc7 12252class GridSizer(Sizer):
bfddbb17
RD
12253 """
12254 A grid sizer is a sizer which lays out its children in a
12255 two-dimensional table with all cells having the same size. In other
12256 words, the width of each cell within the grid is the width of the
12257 widest item added to the sizer and the height of each grid cell is the
12258 height of the tallest item. An optional vertical and/or horizontal
12259 gap between items can also be specified (in pixels.)
12260
12261 Items are placed in the cells of the grid in the order they are added,
12262 in row-major order. In other words, the first row is filled first,
12263 then the second, and so on until all items have been added. (If
12264 neccessary, additional rows will be added as items are added.) If you
12265 need to have greater control over the cells that items are placed in
12266 then use the `wx.GridBagSizer`.
12267
12268 """
d55e5bfc
RD
12269 def __repr__(self):
12270 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12271 def __init__(self, *args, **kwargs):
bfddbb17 12272 """
5b5c9bc7 12273 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
12274
12275 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12276 of columns and rows in the sizer - if either of the parameters is
12277 zero, it will be calculated to from the total number of children in
12278 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12279 define extra space between all children.
12280 """
5b5c9bc7 12281 newobj = _core_.new_GridSizer(*args, **kwargs)
d55e5bfc
RD
12282 self.this = newobj.this
12283 self.thisown = 1
12284 del newobj.thisown
12285 self._setOORInfo(self)
12286
d55e5bfc 12287 def SetCols(*args, **kwargs):
bfddbb17
RD
12288 """
12289 SetCols(self, int cols)
12290
12291 Sets the number of columns in the sizer.
12292 """
5b5c9bc7 12293 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
12294
12295 def SetRows(*args, **kwargs):
bfddbb17
RD
12296 """
12297 SetRows(self, int rows)
12298
12299 Sets the number of rows in the sizer.
12300 """
5b5c9bc7 12301 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
12302
12303 def SetVGap(*args, **kwargs):
bfddbb17
RD
12304 """
12305 SetVGap(self, int gap)
12306
12307 Sets the vertical gap (in pixels) between the cells in the sizer.
12308 """
5b5c9bc7 12309 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
12310
12311 def SetHGap(*args, **kwargs):
bfddbb17
RD
12312 """
12313 SetHGap(self, int gap)
12314
12315 Sets the horizontal gap (in pixels) between cells in the sizer
12316 """
5b5c9bc7 12317 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
12318
12319 def GetCols(*args, **kwargs):
bfddbb17
RD
12320 """
12321 GetCols(self) -> int
12322
12323 Returns the number of columns in the sizer.
12324 """
5b5c9bc7 12325 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
12326
12327 def GetRows(*args, **kwargs):
bfddbb17
RD
12328 """
12329 GetRows(self) -> int
12330
12331 Returns the number of rows in the sizer.
12332 """
5b5c9bc7 12333 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
12334
12335 def GetVGap(*args, **kwargs):
bfddbb17
RD
12336 """
12337 GetVGap(self) -> int
12338
12339 Returns the vertical gap (in pixels) between the cells in the sizer.
12340 """
5b5c9bc7 12341 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
12342
12343 def GetHGap(*args, **kwargs):
bfddbb17
RD
12344 """
12345 GetHGap(self) -> int
12346
12347 Returns the horizontal gap (in pixels) between cells in the sizer.
12348 """
5b5c9bc7 12349 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc
RD
12350
12351
5b5c9bc7 12352class GridSizerPtr(GridSizer):
d55e5bfc
RD
12353 def __init__(self, this):
12354 self.this = this
12355 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12356 self.__class__ = GridSizer
12357_core_.GridSizer_swigregister(GridSizerPtr)
d55e5bfc
RD
12358
12359#---------------------------------------------------------------------------
12360
5b5c9bc7
RD
12361FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12362FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12363FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12364class FlexGridSizer(GridSizer):
bfddbb17
RD
12365 """
12366 A flex grid sizer is a sizer which lays out its children in a
12367 two-dimensional table with all table cells in one row having the same
12368 height and all cells in one column having the same width, but all
12369 rows or all columns are not necessarily the same height or width as in
12370 the `wx.GridSizer`.
12371
12372 wx.FlexGridSizer can also size items equally in one direction but
12373 unequally ("flexibly") in the other. If the sizer is only flexible
12374 in one direction (this can be changed using `SetFlexibleDirection`), it
12375 needs to be decided how the sizer should grow in the other ("non
12376 flexible") direction in order to fill the available space. The
12377 `SetNonFlexibleGrowMode` method serves this purpose.
12378
12379
12380 """
d55e5bfc
RD
12381 def __repr__(self):
12382 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12383 def __init__(self, *args, **kwargs):
bfddbb17 12384 """
5b5c9bc7 12385 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
12386
12387 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12388 number of columns and rows in the sizer - if either of the parameters
12389 is zero, it will be calculated to from the total number of children in
12390 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12391 define extra space between all children.
12392 """
5b5c9bc7 12393 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
d55e5bfc
RD
12394 self.this = newobj.this
12395 self.thisown = 1
12396 del newobj.thisown
12397 self._setOORInfo(self)
12398
bfddbb17
RD
12399 def AddGrowableRow(*args, **kwargs):
12400 """
12401 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 12402
bfddbb17
RD
12403 Specifies that row *idx* (starting from zero) should be grown if there
12404 is extra space available to the sizer.
d55e5bfc 12405
bfddbb17
RD
12406 The *proportion* parameter has the same meaning as the stretch factor
12407 for the box sizers except that if all proportions are 0, then all
12408 columns are resized equally (instead of not being resized at all).
12409 """
5b5c9bc7 12410 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
12411
12412 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
12413 """
12414 RemoveGrowableRow(self, size_t idx)
12415
12416 Specifies that row *idx* is no longer growable.
12417 """
5b5c9bc7 12418 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
12419
12420 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
12421 """
12422 AddGrowableCol(self, size_t idx, int proportion=0)
12423
12424 Specifies that column *idx* (starting from zero) should be grown if
12425 there is extra space available to the sizer.
12426
12427 The *proportion* parameter has the same meaning as the stretch factor
12428 for the box sizers except that if all proportions are 0, then all
12429 columns are resized equally (instead of not being resized at all).
12430 """
5b5c9bc7 12431 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
12432
12433 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
12434 """
12435 RemoveGrowableCol(self, size_t idx)
12436
12437 Specifies that column *idx* is no longer growable.
12438 """
5b5c9bc7 12439 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
12440
12441 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
12442 """
12443 SetFlexibleDirection(self, int direction)
12444
12445 Specifies whether the sizer should flexibly resize its columns, rows,
12446 or both. Argument *direction* can be one of the following values. Any
12447 other value is ignored.
12448
12449 ============== =======================================
12450 wx.VERTICAL Rows are flexibly sized.
12451 wx.HORIZONTAL Columns are flexibly sized.
12452 wx.BOTH Both rows and columns are flexibly sized
12453 (this is the default value).
12454 ============== =======================================
12455
12456 Note that this method does not trigger relayout.
12457
12458 """
5b5c9bc7 12459 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
12460
12461 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
12462 """
12463 GetFlexibleDirection(self) -> int
12464
12465 Returns a value that specifies whether the sizer
12466 flexibly resizes its columns, rows, or both (default).
12467
12468 :see: `SetFlexibleDirection`
12469 """
5b5c9bc7 12470 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
12471
12472 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
12473 """
12474 SetNonFlexibleGrowMode(self, int mode)
12475
12476 Specifies how the sizer should grow in the non-flexible direction if
12477 there is one (so `SetFlexibleDirection` must have been called
12478 previously). Argument *mode* can be one of the following values:
12479
12480 ========================== =================================================
12481 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12482 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12483 `AddGrowableCol` and `AddGrowableRow`. In this
12484 case equal sizing applies to minimum sizes of
12485 columns or rows (this is the default value).
12486 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12487 the non flexible direction, whether they are
12488 growable or not in the flexbile direction.
12489 ========================== =================================================
12490
12491 Note that this method does not trigger relayout.
12492
12493
12494 """
5b5c9bc7 12495 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
12496
12497 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
12498 """
12499 GetNonFlexibleGrowMode(self) -> int
12500
12501 Returns the value that specifies how the sizer grows in the
12502 non-flexible direction if there is one.
12503
12504 :see: `SetNonFlexibleGrowMode`
12505 """
5b5c9bc7 12506 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
12507
12508 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
12509 """
12510 GetRowHeights(self) -> list
12511
12512 Returns a list of integers representing the heights of each of the
12513 rows in the sizer.
12514 """
5b5c9bc7 12515 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
12516
12517 def GetColWidths(*args, **kwargs):
fd2dc343
RD
12518 """
12519 GetColWidths(self) -> list
12520
12521 Returns a list of integers representing the widths of each of the
12522 columns in the sizer.
12523 """
5b5c9bc7 12524 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc
RD
12525
12526
5b5c9bc7 12527class FlexGridSizerPtr(FlexGridSizer):
d55e5bfc
RD
12528 def __init__(self, this):
12529 self.this = this
12530 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12531 self.__class__ = FlexGridSizer
12532_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
d55e5bfc 12533
5b5c9bc7 12534class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
12535 """
12536 A special sizer that knows how to order and position standard buttons
12537 in order to conform to the current platform's standards. You simply
12538 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12539 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
12540 will take care of the rest.
12541
12542 """
12543 def __repr__(self):
12544 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12545 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
12546 """__init__(self) -> StdDialogButtonSizer"""
12547 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
62d32a5f
RD
12548 self.this = newobj.this
12549 self.thisown = 1
12550 del newobj.thisown
12551 def AddButton(*args, **kwargs):
12552 """
12553 AddButton(self, wxButton button)
12554
12555 Use this to add the buttons to this sizer. Do not use the `Add`
12556 method in the base class.
12557 """
5b5c9bc7 12558 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 12559
53aa7709 12560 def Realize(*args, **kwargs):
62d32a5f 12561 """
53aa7709 12562 Realize(self)
62d32a5f
RD
12563
12564 This funciton needs to be called after all the buttons have been added
12565 to the sizer. It will reorder them and position them in a platform
12566 specifc manner.
12567 """
5b5c9bc7 12568 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12569
12570 def SetAffirmativeButton(*args, **kwargs):
12571 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 12572 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
12573
12574 def SetNegativeButton(*args, **kwargs):
12575 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 12576 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
12577
12578 def SetCancelButton(*args, **kwargs):
12579 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 12580 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
12581
12582 def GetAffirmativeButton(*args, **kwargs):
12583 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 12584 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
12585
12586 def GetApplyButton(*args, **kwargs):
12587 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 12588 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
12589
12590 def GetNegativeButton(*args, **kwargs):
12591 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 12592 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
12593
12594 def GetCancelButton(*args, **kwargs):
12595 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 12596 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
12597
12598 def GetHelpButton(*args, **kwargs):
12599 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 12600 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f
RD
12601
12602
5b5c9bc7 12603class StdDialogButtonSizerPtr(StdDialogButtonSizer):
62d32a5f
RD
12604 def __init__(self, this):
12605 self.this = this
12606 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12607 self.__class__ = StdDialogButtonSizer
12608_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
62d32a5f 12609
d55e5bfc
RD
12610#---------------------------------------------------------------------------
12611
5b5c9bc7 12612class GBPosition(object):
bfddbb17
RD
12613 """
12614 This class represents the position of an item in a virtual grid of
12615 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12616 typemaps that will automatically convert from a 2-element sequence of
12617 integers to a wx.GBPosition, so you can use the more pythonic
12618 representation of the position nearly transparently in Python code.
12619 """
d55e5bfc
RD
12620 def __repr__(self):
12621 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12622 def __init__(self, *args, **kwargs):
bfddbb17 12623 """
5b5c9bc7 12624 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
12625
12626 This class represents the position of an item in a virtual grid of
12627 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12628 typemaps that will automatically convert from a 2-element sequence of
12629 integers to a wx.GBPosition, so you can use the more pythonic
12630 representation of the position nearly transparently in Python code.
12631 """
5b5c9bc7 12632 newobj = _core_.new_GBPosition(*args, **kwargs)
d55e5bfc
RD
12633 self.this = newobj.this
12634 self.thisown = 1
12635 del newobj.thisown
7e08d4ef
RD
12636 def __del__(self, destroy=_core_.delete_GBPosition):
12637 """__del__(self)"""
12638 try:
12639 if self.thisown: destroy(self)
12640 except: pass
12641
d55e5bfc
RD
12642 def GetRow(*args, **kwargs):
12643 """GetRow(self) -> int"""
5b5c9bc7 12644 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
12645
12646 def GetCol(*args, **kwargs):
12647 """GetCol(self) -> int"""
5b5c9bc7 12648 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
12649
12650 def SetRow(*args, **kwargs):
12651 """SetRow(self, int row)"""
5b5c9bc7 12652 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
12653
12654 def SetCol(*args, **kwargs):
12655 """SetCol(self, int col)"""
5b5c9bc7 12656 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
12657
12658 def __eq__(*args, **kwargs):
5b5c9bc7
RD
12659 """__eq__(self, GBPosition other) -> bool"""
12660 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
12661
12662 def __ne__(*args, **kwargs):
5b5c9bc7
RD
12663 """__ne__(self, GBPosition other) -> bool"""
12664 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
12665
12666 def Set(*args, **kwargs):
12667 """Set(self, int row=0, int col=0)"""
5b5c9bc7 12668 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
12669
12670 def Get(*args, **kwargs):
12671 """Get(self) -> PyObject"""
5b5c9bc7 12672 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 12673
15817c7e 12674 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12675 def __str__(self): return str(self.Get())
12676 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12677 def __len__(self): return len(self.Get())
12678 def __getitem__(self, index): return self.Get()[index]
12679 def __setitem__(self, index, val):
12680 if index == 0: self.SetRow(val)
12681 elif index == 1: self.SetCol(val)
12682 else: raise IndexError
12683 def __nonzero__(self): return self.Get() != (0,0)
12684 __safe_for_unpickling__ = True
12685 def __reduce__(self): return (wx.GBPosition, self.Get())
12686
12687 row = property(GetRow, SetRow)
12688 col = property(GetCol, SetCol)
12689
12690
5b5c9bc7 12691class GBPositionPtr(GBPosition):
d55e5bfc
RD
12692 def __init__(self, this):
12693 self.this = this
12694 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12695 self.__class__ = GBPosition
12696_core_.GBPosition_swigregister(GBPositionPtr)
d55e5bfc 12697
5b5c9bc7 12698class GBSpan(object):
bfddbb17
RD
12699 """
12700 This class is used to hold the row and column spanning attributes of
12701 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12702 automatically convert from a 2-element sequence of integers to a
12703 wx.GBSpan, so you can use the more pythonic representation of the span
12704 nearly transparently in Python code.
12705
12706 """
d55e5bfc
RD
12707 def __repr__(self):
12708 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12709 def __init__(self, *args, **kwargs):
bfddbb17 12710 """
5b5c9bc7 12711 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
12712
12713 Construct a new wxGBSpan, optionally setting the rowspan and
12714 colspan. The default is (1,1). (Meaning that the item occupies one
12715 cell in each direction.
12716 """
5b5c9bc7 12717 newobj = _core_.new_GBSpan(*args, **kwargs)
d55e5bfc
RD
12718 self.this = newobj.this
12719 self.thisown = 1
12720 del newobj.thisown
7e08d4ef
RD
12721 def __del__(self, destroy=_core_.delete_GBSpan):
12722 """__del__(self)"""
12723 try:
12724 if self.thisown: destroy(self)
12725 except: pass
12726
d55e5bfc
RD
12727 def GetRowspan(*args, **kwargs):
12728 """GetRowspan(self) -> int"""
5b5c9bc7 12729 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
12730
12731 def GetColspan(*args, **kwargs):
12732 """GetColspan(self) -> int"""
5b5c9bc7 12733 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
12734
12735 def SetRowspan(*args, **kwargs):
12736 """SetRowspan(self, int rowspan)"""
5b5c9bc7 12737 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
12738
12739 def SetColspan(*args, **kwargs):
12740 """SetColspan(self, int colspan)"""
5b5c9bc7 12741 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
12742
12743 def __eq__(*args, **kwargs):
5b5c9bc7
RD
12744 """__eq__(self, GBSpan other) -> bool"""
12745 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
12746
12747 def __ne__(*args, **kwargs):
5b5c9bc7
RD
12748 """__ne__(self, GBSpan other) -> bool"""
12749 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
12750
12751 def Set(*args, **kwargs):
12752 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 12753 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
12754
12755 def Get(*args, **kwargs):
12756 """Get(self) -> PyObject"""
5b5c9bc7 12757 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 12758
15817c7e 12759 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12760 def __str__(self): return str(self.Get())
12761 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12762 def __len__(self): return len(self.Get())
12763 def __getitem__(self, index): return self.Get()[index]
12764 def __setitem__(self, index, val):
12765 if index == 0: self.SetRowspan(val)
12766 elif index == 1: self.SetColspan(val)
12767 else: raise IndexError
12768 def __nonzero__(self): return self.Get() != (0,0)
12769 __safe_for_unpickling__ = True
12770 def __reduce__(self): return (wx.GBSpan, self.Get())
12771
12772 rowspan = property(GetRowspan, SetRowspan)
12773 colspan = property(GetColspan, SetColspan)
12774
12775
5b5c9bc7 12776class GBSpanPtr(GBSpan):
d55e5bfc
RD
12777 def __init__(self, this):
12778 self.this = this
12779 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12780 self.__class__ = GBSpan
12781_core_.GBSpan_swigregister(GBSpanPtr)
d55e5bfc 12782
5b5c9bc7 12783class GBSizerItem(SizerItem):
bfddbb17
RD
12784 """
12785 The wx.GBSizerItem class is used to track the additional data about
12786 items in a `wx.GridBagSizer` such as the item's position in the grid
12787 and how many rows or columns it spans.
12788
12789 """
d55e5bfc
RD
12790 def __repr__(self):
12791 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12792 def __init__(self, *args, **kwargs):
bfddbb17 12793 """
5b5c9bc7 12794 __init__(self) -> GBSizerItem
bfddbb17
RD
12795
12796 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12797 size will need to be set, as well as a position and span before this
12798 item can be used in a Sizer.
12799
12800 You will probably never need to create a wx.GBSizerItem directly as they
12801 are created automatically when the sizer's Add method is called.
12802 """
5b5c9bc7 12803 newobj = _core_.new_GBSizerItem(*args, **kwargs)
d55e5bfc
RD
12804 self.this = newobj.this
12805 self.thisown = 1
12806 del newobj.thisown
7e08d4ef
RD
12807 def __del__(self, destroy=_core_.delete_GBSizerItem):
12808 """__del__(self)"""
12809 try:
12810 if self.thisown: destroy(self)
12811 except: pass
12812
d55e5bfc 12813 def GetPos(*args, **kwargs):
bfddbb17 12814 """
5b5c9bc7 12815 GetPos(self) -> GBPosition
bfddbb17
RD
12816
12817 Get the grid position of the item
12818 """
5b5c9bc7 12819 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
12820
12821 def GetPosTuple(self): return self.GetPos().Get()
12822 def GetSpan(*args, **kwargs):
bfddbb17 12823 """
5b5c9bc7 12824 GetSpan(self) -> GBSpan
bfddbb17
RD
12825
12826 Get the row and column spanning of the item
12827 """
5b5c9bc7 12828 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
12829
12830 def GetSpanTuple(self): return self.GetSpan().Get()
12831 def SetPos(*args, **kwargs):
bfddbb17 12832 """
5b5c9bc7 12833 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
12834
12835 If the item is already a member of a sizer then first ensure that
12836 there is no other item that would intersect with this one at the new
12837 position, then set the new position. Returns True if the change is
12838 successful and after the next Layout() the item will be moved.
12839 """
5b5c9bc7 12840 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
12841
12842 def SetSpan(*args, **kwargs):
bfddbb17 12843 """
5b5c9bc7 12844 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
12845
12846 If the item is already a member of a sizer then first ensure that
12847 there is no other item that would intersect with this one with its new
12848 spanning size, then set the new spanning. Returns True if the change
12849 is successful and after the next Layout() the item will be resized.
12850
12851 """
5b5c9bc7 12852 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 12853
bfddbb17 12854 def Intersects(*args, **kwargs):
d55e5bfc 12855 """
5b5c9bc7 12856 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
12857
12858 Returns True if this item and the other item instersect.
d55e5bfc 12859 """
5b5c9bc7 12860 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
12861
12862 def IntersectsPos(*args, **kwargs):
12863 """
5b5c9bc7 12864 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
12865
12866 Returns True if the given pos/span would intersect with this item.
12867 """
5b5c9bc7 12868 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12869
12870 def GetEndPos(*args, **kwargs):
bfddbb17 12871 """
5b5c9bc7 12872 GetEndPos(self) -> GBPosition
bfddbb17
RD
12873
12874 Get the row and column of the endpoint of this item.
12875 """
5b5c9bc7 12876 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
12877
12878 def GetGBSizer(*args, **kwargs):
bfddbb17 12879 """
5b5c9bc7 12880 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
12881
12882 Get the sizer this item is a member of.
12883 """
5b5c9bc7 12884 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
12885
12886 def SetGBSizer(*args, **kwargs):
bfddbb17 12887 """
5b5c9bc7 12888 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
12889
12890 Set the sizer this item is a member of.
12891 """
5b5c9bc7 12892 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc
RD
12893
12894
5b5c9bc7 12895class GBSizerItemPtr(GBSizerItem):
d55e5bfc
RD
12896 def __init__(self, this):
12897 self.this = this
12898 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12899 self.__class__ = GBSizerItem
12900_core_.GBSizerItem_swigregister(GBSizerItemPtr)
12901DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
12902
12903def GBSizerItemWindow(*args, **kwargs):
12904 """
5b5c9bc7
RD
12905 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12906 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12907
12908 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 12909 """
5b5c9bc7 12910 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12911 val.thisown = 1
12912 return val
12913
12914def GBSizerItemSizer(*args, **kwargs):
12915 """
5b5c9bc7
RD
12916 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12917 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12918
12919 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 12920 """
5b5c9bc7 12921 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12922 val.thisown = 1
12923 return val
12924
12925def GBSizerItemSpacer(*args, **kwargs):
12926 """
5b5c9bc7
RD
12927 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12928 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12929
12930 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 12931 """
5b5c9bc7 12932 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12933 val.thisown = 1
12934 return val
12935
5b5c9bc7 12936class GridBagSizer(FlexGridSizer):
bfddbb17
RD
12937 """
12938 A `wx.Sizer` that can lay out items in a virtual grid like a
12939 `wx.FlexGridSizer` but in this case explicit positioning of the items
12940 is allowed using `wx.GBPosition`, and items can optionally span more
12941 than one row and/or column using `wx.GBSpan`. The total size of the
12942 virtual grid is determined by the largest row and column that items are
12943 positioned at, adjusted for spanning.
12944
12945 """
d55e5bfc
RD
12946 def __repr__(self):
12947 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12948 def __init__(self, *args, **kwargs):
bfddbb17 12949 """
5b5c9bc7 12950 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
12951
12952 Constructor, with optional parameters to specify the gap between the
12953 rows and columns.
12954 """
5b5c9bc7 12955 newobj = _core_.new_GridBagSizer(*args, **kwargs)
d55e5bfc
RD
12956 self.this = newobj.this
12957 self.thisown = 1
12958 del newobj.thisown
03e46024
RD
12959 self._setOORInfo(self)
12960
d55e5bfc
RD
12961 def Add(*args, **kwargs):
12962 """
bfddbb17 12963 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 12964 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
12965
12966 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12967 more than one row or column as specified with *span*. The remaining
12968 args behave similarly to `wx.Sizer.Add`.
12969
12970 Returns True if the item was successfully placed at the given cell
12971 position, False if something was already there.
12972
d55e5bfc 12973 """
5b5c9bc7 12974 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
12975
12976 def AddItem(*args, **kwargs):
bfddbb17 12977 """
070c48b4 12978 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
12979
12980 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12981 the item was successfully placed at its given cell position, False if
12982 something was already there.
12983 """
5b5c9bc7 12984 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 12985
84f85550
RD
12986 def GetCellSize(*args, **kwargs):
12987 """
5b5c9bc7 12988 GetCellSize(self, int row, int col) -> Size
84f85550
RD
12989
12990 Get the size of the specified cell, including hgap and
12991 vgap. Only valid after a Layout.
12992 """
5b5c9bc7 12993 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 12994
d55e5bfc 12995 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 12996 """
5b5c9bc7 12997 GetEmptyCellSize(self) -> Size
bfddbb17
RD
12998
12999 Get the size used for cells in the grid with no item.
13000 """
5b5c9bc7 13001 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
13002
13003 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 13004 """
5b5c9bc7 13005 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
13006
13007 Set the size used for cells in the grid with no item.
13008 """
5b5c9bc7 13009 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
13010
13011 def GetItemPosition(*args):
13012 """
bfddbb17
RD
13013 GetItemPosition(self, item) -> GBPosition
13014
13015 Get the grid position of the specified *item* where *item* is either a
13016 window or subsizer that is a member of this sizer, or a zero-based
13017 index of an item.
d55e5bfc 13018 """
5b5c9bc7 13019 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
13020
13021 def SetItemPosition(*args):
13022 """
bfddbb17
RD
13023 SetItemPosition(self, item, GBPosition pos) -> bool
13024
13025 Set the grid position of the specified *item* where *item* is either a
13026 window or subsizer that is a member of this sizer, or a zero-based
13027 index of an item. Returns True on success. If the move is not
13028 allowed (because an item is already there) then False is returned.
13029
d55e5bfc 13030 """
5b5c9bc7 13031 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
13032
13033 def GetItemSpan(*args):
13034 """
bfddbb17
RD
13035 GetItemSpan(self, item) -> GBSpan
13036
13037 Get the row/col spanning of the specified *item* where *item* is
13038 either a window or subsizer that is a member of this sizer, or a
13039 zero-based index of an item.
d55e5bfc 13040 """
5b5c9bc7 13041 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
13042
13043 def SetItemSpan(*args):
13044 """
bfddbb17
RD
13045 SetItemSpan(self, item, GBSpan span) -> bool
13046
13047 Set the row/col spanning of the specified *item* where *item* is
13048 either a window or subsizer that is a member of this sizer, or a
13049 zero-based index of an item. Returns True on success. If the move is
13050 not allowed (because an item is already there) then False is returned.
d55e5bfc 13051 """
5b5c9bc7 13052 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
13053
13054 def FindItem(*args):
13055 """
bfddbb17
RD
13056 FindItem(self, item) -> GBSizerItem
13057
13058 Find the sizer item for the given window or subsizer, returns None if
13059 not found. (non-recursive)
d55e5bfc 13060 """
5b5c9bc7 13061 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
13062
13063 def FindItemAtPosition(*args, **kwargs):
bfddbb17 13064 """
5b5c9bc7 13065 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
13066
13067 Return the sizer item for the given grid cell, or None if there is no
13068 item at that position. (non-recursive)
13069 """
5b5c9bc7 13070 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
13071
13072 def FindItemAtPoint(*args, **kwargs):
bfddbb17 13073 """
5b5c9bc7 13074 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
13075
13076 Return the sizer item located at the point given in *pt*, or None if
13077 there is no item at that point. The (x,y) coordinates in pt correspond
13078 to the client coordinates of the window using the sizer for
13079 layout. (non-recursive)
13080 """
5b5c9bc7 13081 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 13082
bfddbb17
RD
13083 def CheckForIntersection(*args, **kwargs):
13084 """
5b5c9bc7 13085 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 13086
bfddbb17
RD
13087 Look at all items and see if any intersect (or would overlap) the
13088 given *item*. Returns True if so, False if there would be no overlap.
13089 If an *excludeItem* is given then it will not be checked for
13090 intersection, for example it may be the item we are checking the
13091 position of.
d55e5bfc 13092
bfddbb17 13093 """
5b5c9bc7 13094 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 13095
bfddbb17 13096 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 13097 """
5b5c9bc7 13098 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
13099
13100 Look at all items and see if any intersect (or would overlap) the
13101 given position and span. Returns True if so, False if there would be
13102 no overlap. If an *excludeItem* is given then it will not be checked
13103 for intersection, for example it may be the item we are checking the
13104 position of.
d55e5bfc 13105 """
5b5c9bc7 13106 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc
RD
13107
13108
5b5c9bc7 13109class GridBagSizerPtr(GridBagSizer):
d55e5bfc
RD
13110 def __init__(self, this):
13111 self.this = this
13112 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
13113 self.__class__ = GridBagSizer
13114_core_.GridBagSizer_swigregister(GridBagSizerPtr)
d55e5bfc
RD
13115
13116#---------------------------------------------------------------------------
13117
5b5c9bc7
RD
13118Left = _core_.Left
13119Top = _core_.Top
13120Right = _core_.Right
13121Bottom = _core_.Bottom
13122Width = _core_.Width
13123Height = _core_.Height
13124Centre = _core_.Centre
13125Center = _core_.Center
13126CentreX = _core_.CentreX
13127CentreY = _core_.CentreY
13128Unconstrained = _core_.Unconstrained
13129AsIs = _core_.AsIs
13130PercentOf = _core_.PercentOf
13131Above = _core_.Above
13132Below = _core_.Below
13133LeftOf = _core_.LeftOf
13134RightOf = _core_.RightOf
13135SameAs = _core_.SameAs
13136Absolute = _core_.Absolute
13137class IndividualLayoutConstraint(Object):
d55e5bfc 13138 """
15817c7e
RD
13139 Objects of this class are stored in the `wx.LayoutConstraints` class as
13140 one of eight possible constraints that a window can be involved in.
13141 You will never need to create an instance of
13142 wx.IndividualLayoutConstraint, rather you should create a
13143 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 13144 that it contains.
d55e5bfc
RD
13145 """
13146 def __init__(self): raise RuntimeError, "No constructor defined"
13147 def __repr__(self):
13148 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
13149 def Set(*args, **kwargs):
15817c7e 13150 """
5b5c9bc7 13151 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
13152
13153 Sets the properties of the constraint. Normally called by one of the
13154 convenience functions such as Above, RightOf, SameAs.
13155 """
5b5c9bc7 13156 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
13157
13158 def LeftOf(*args, **kwargs):
13159 """
5b5c9bc7 13160 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 13161
15817c7e
RD
13162 Constrains this edge to be to the left of the given window, with an
13163 optional margin. Implicitly, this is relative to the left edge of the
13164 other window.
d55e5bfc 13165 """
5b5c9bc7 13166 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
13167
13168 def RightOf(*args, **kwargs):
13169 """
5b5c9bc7 13170 RightOf(self, Window sibling, int marg=0)
d55e5bfc 13171
15817c7e
RD
13172 Constrains this edge to be to the right of the given window, with an
13173 optional margin. Implicitly, this is relative to the right edge of the
13174 other window.
d55e5bfc 13175 """
5b5c9bc7 13176 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
13177
13178 def Above(*args, **kwargs):
13179 """
5b5c9bc7 13180 Above(self, Window sibling, int marg=0)
d55e5bfc 13181
15817c7e
RD
13182 Constrains this edge to be above the given window, with an optional
13183 margin. Implicitly, this is relative to the top edge of the other
13184 window.
d55e5bfc 13185 """
5b5c9bc7 13186 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
13187
13188 def Below(*args, **kwargs):
13189 """
5b5c9bc7 13190 Below(self, Window sibling, int marg=0)
d55e5bfc 13191
15817c7e
RD
13192 Constrains this edge to be below the given window, with an optional
13193 margin. Implicitly, this is relative to the bottom edge of the other
13194 window.
d55e5bfc 13195 """
5b5c9bc7 13196 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
13197
13198 def SameAs(*args, **kwargs):
13199 """
5b5c9bc7 13200 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 13201
15817c7e
RD
13202 Constrains this edge or dimension to be to the same as the edge of the
13203 given window, with an optional margin.
d55e5bfc 13204 """
5b5c9bc7 13205 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
13206
13207 def PercentOf(*args, **kwargs):
13208 """
5b5c9bc7 13209 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 13210
15817c7e
RD
13211 Constrains this edge or dimension to be to a percentage of the given
13212 window, with an optional margin.
d55e5bfc 13213 """
5b5c9bc7 13214 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
13215
13216 def Absolute(*args, **kwargs):
13217 """
13218 Absolute(self, int val)
13219
15817c7e 13220 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 13221 """
5b5c9bc7 13222 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
13223
13224 def Unconstrained(*args, **kwargs):
13225 """
13226 Unconstrained(self)
13227
15817c7e
RD
13228 Sets this edge or dimension to be unconstrained, that is, dependent on
13229 other edges and dimensions from which this value can be deduced.
d55e5bfc 13230 """
5b5c9bc7 13231 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
13232
13233 def AsIs(*args, **kwargs):
13234 """
13235 AsIs(self)
13236
15817c7e
RD
13237 Sets this edge or constraint to be whatever the window's value is at
13238 the moment. If either of the width and height constraints are *as is*,
13239 the window will not be resized, but moved instead. This is important
13240 when considering panel items which are intended to have a default
13241 size, such as a button, which may take its size from the size of the
13242 button label.
d55e5bfc 13243 """
5b5c9bc7 13244 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
13245
13246 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
13247 """GetOtherWindow(self) -> Window"""
13248 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
13249
13250 def GetMyEdge(*args, **kwargs):
13251 """GetMyEdge(self) -> int"""
5b5c9bc7 13252 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
13253
13254 def SetEdge(*args, **kwargs):
13255 """SetEdge(self, int which)"""
5b5c9bc7 13256 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
13257
13258 def SetValue(*args, **kwargs):
13259 """SetValue(self, int v)"""
5b5c9bc7 13260 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
13261
13262 def GetMargin(*args, **kwargs):
13263 """GetMargin(self) -> int"""
5b5c9bc7 13264 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
13265
13266 def SetMargin(*args, **kwargs):
13267 """SetMargin(self, int m)"""
5b5c9bc7 13268 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
13269
13270 def GetValue(*args, **kwargs):
13271 """GetValue(self) -> int"""
5b5c9bc7 13272 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
13273
13274 def GetPercent(*args, **kwargs):
13275 """GetPercent(self) -> int"""
5b5c9bc7 13276 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
13277
13278 def GetOtherEdge(*args, **kwargs):
13279 """GetOtherEdge(self) -> int"""
5b5c9bc7 13280 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
13281
13282 def GetDone(*args, **kwargs):
13283 """GetDone(self) -> bool"""
5b5c9bc7 13284 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
13285
13286 def SetDone(*args, **kwargs):
13287 """SetDone(self, bool d)"""
5b5c9bc7 13288 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
13289
13290 def GetRelationship(*args, **kwargs):
13291 """GetRelationship(self) -> int"""
5b5c9bc7 13292 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
13293
13294 def SetRelationship(*args, **kwargs):
13295 """SetRelationship(self, int r)"""
5b5c9bc7 13296 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
13297
13298 def ResetIfWin(*args, **kwargs):
13299 """
5b5c9bc7 13300 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
13301
13302 Reset constraint if it mentions otherWin
13303 """
5b5c9bc7 13304 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
13305
13306 def SatisfyConstraint(*args, **kwargs):
13307 """
5b5c9bc7 13308 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
13309
13310 Try to satisfy constraint
13311 """
5b5c9bc7 13312 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
13313
13314 def GetEdge(*args, **kwargs):
13315 """
5b5c9bc7 13316 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
13317
13318 Get the value of this edge or dimension, or if this
13319 is not determinable, -1.
13320 """
5b5c9bc7 13321 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc
RD
13322
13323
5b5c9bc7 13324class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
d55e5bfc
RD
13325 def __init__(self, this):
13326 self.this = this
13327 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
13328 self.__class__ = IndividualLayoutConstraint
13329_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
d55e5bfc 13330
5b5c9bc7 13331class LayoutConstraints(Object):
d55e5bfc 13332 """
15817c7e
RD
13333 **Note:** constraints are now deprecated and you should use sizers
13334 instead.
d55e5bfc 13335
15817c7e
RD
13336 Objects of this class can be associated with a window to define its
13337 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
13338
13339 The class consists of the following eight constraints of class
13340 wx.IndividualLayoutConstraint, some or all of which should be accessed
13341 directly to set the appropriate constraints.
13342
13343 * left: represents the left hand edge of the window
13344 * right: represents the right hand edge of the window
13345 * top: represents the top edge of the window
13346 * bottom: represents the bottom edge of the window
13347 * width: represents the width of the window
13348 * height: represents the height of the window
13349 * centreX: represents the horizontal centre point of the window
13350 * centreY: represents the vertical centre point of the window
13351
15817c7e
RD
13352 Most constraints are initially set to have the relationship
13353 wxUnconstrained, which means that their values should be calculated by
13354 looking at known constraints. The exceptions are width and height,
13355 which are set to wxAsIs to ensure that if the user does not specify a
13356 constraint, the existing width and height will be used, to be
13357 compatible with panel items which often have take a default size. If
13358 the constraint is ``wx.AsIs``, the dimension will not be changed.
13359
13360 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
13361
13362 """
13363 def __repr__(self):
13364 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
13365 left = property(_core_.LayoutConstraints_left_get)
13366 top = property(_core_.LayoutConstraints_top_get)
13367 right = property(_core_.LayoutConstraints_right_get)
13368 bottom = property(_core_.LayoutConstraints_bottom_get)
13369 width = property(_core_.LayoutConstraints_width_get)
13370 height = property(_core_.LayoutConstraints_height_get)
13371 centreX = property(_core_.LayoutConstraints_centreX_get)
13372 centreY = property(_core_.LayoutConstraints_centreY_get)
d55e5bfc 13373 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
13374 """__init__(self) -> LayoutConstraints"""
13375 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
d55e5bfc
RD
13376 self.this = newobj.this
13377 self.thisown = 1
13378 del newobj.thisown
13379 def SatisfyConstraints(*args, **kwargs):
13380 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 13381 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
13382
13383 def AreSatisfied(*args, **kwargs):
13384 """AreSatisfied(self) -> bool"""
5b5c9bc7 13385 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc
RD
13386
13387
5b5c9bc7 13388class LayoutConstraintsPtr(LayoutConstraints):
d55e5bfc
RD
13389 def __init__(self, this):
13390 self.this = this
13391 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
13392 self.__class__ = LayoutConstraints
13393_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
d55e5bfc
RD
13394
13395#----------------------------------------------------------------------------
13396
13397# Use Python's bool constants if available, make some if not
13398try:
13399 True
13400except NameError:
13401 __builtins__.True = 1==1
13402 __builtins__.False = 1==0
13403 def bool(value): return not not value
13404 __builtins__.bool = bool
13405
13406
13407
13408# workarounds for bad wxRTTI names
13409__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13410__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13411__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13412
13413
13414#----------------------------------------------------------------------------
13415# Load version numbers from __version__... Ensure that major and minor
0f63ec68 13416# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
13417
13418from __version__ import *
13419__version__ = VERSION_STRING
13420
0f63ec68
RD
13421assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13422assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
13423if RELEASE_VERSION != _core_.RELEASE_VERSION:
13424 import warnings
0f63ec68 13425 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
13426
13427#----------------------------------------------------------------------------
13428
7993762b
RD
13429# Set wxPython's default string<-->unicode conversion encoding from
13430# the locale, but only if Python's default hasn't been changed. (We
13431# assume that if the user has customized it already then that is the
13432# encoding we need to use as well.)
13433#
13434# The encoding selected here is used when string or unicode objects
13435# need to be converted in order to pass them to wxWidgets. Please be
13436# aware that the default encoding within the same locale may be
13437# slightly different on different platforms. For example, please see
62d32a5f
RD
13438# http://www.alanwood.net/demos/charsetdiffs.html for differences
13439# between the common latin/roman encodings.
3837a853
RD
13440
13441default = _sys.getdefaultencoding()
13442if default == 'ascii':
13443 import locale
13444 import codecs
13445 try:
13446 default = locale.getdefaultlocale()[1]
13447 codecs.lookup(default)
7993762b 13448 except (ValueError, LookupError, TypeError):
3837a853
RD
13449 default = _sys.getdefaultencoding()
13450 del locale
13451 del codecs
5cbf236d
RD
13452if default:
13453 wx.SetDefaultPyEncoding(default)
13454del default
5cbf236d
RD
13455
13456#----------------------------------------------------------------------------
13457
d55e5bfc
RD
13458class PyDeadObjectError(AttributeError):
13459 pass
13460
13461class _wxPyDeadObject(object):
13462 """
13463 Instances of wx objects that are OOR capable will have their __class__
13464 changed to this class when the C++ object is deleted. This should help
13465 prevent crashes due to referencing a bogus C++ pointer.
13466 """
13467 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13468 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13469
13470 def __repr__(self):
13471 if not hasattr(self, "_name"):
13472 self._name = "[unknown]"
13473 return self.reprStr % self._name
13474
13475 def __getattr__(self, *args):
13476 if not hasattr(self, "_name"):
13477 self._name = "[unknown]"
13478 raise PyDeadObjectError(self.attrStr % self._name)
13479
13480 def __nonzero__(self):
13481 return 0
13482
13483
13484
13485class PyUnbornObjectError(AttributeError):
13486 pass
13487
13488class _wxPyUnbornObject(object):
13489 """
13490 Some stock objects are created when the wx._core module is
13491 imported, but their C++ instance is not created until the wx.App
13492 object is created and initialized. These object instances will
13493 temporarily have their __class__ changed to this class so an
13494 exception will be raised if they are used before the C++ instance
13495 is ready.
13496 """
13497
13498 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13499 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13500
13501 def __repr__(self):
13502 #if not hasattr(self, "_name"):
13503 # self._name = "[unknown]"
13504 return self.reprStr #% self._name
13505
13506 def __getattr__(self, *args):
13507 #if not hasattr(self, "_name"):
13508 # self._name = "[unknown]"
13509 raise PyUnbornObjectError(self.attrStr) # % self._name )
13510
13511 def __nonzero__(self):
13512 return 0
13513
13514
13515#----------------------------------------------------------------------------
d55e5bfc
RD
13516
13517def CallAfter(callable, *args, **kw):
13518 """
13519 Call the specified function after the current and pending event
13520 handlers have been completed. This is also good for making GUI
0439c23b
RD
13521 method calls from non-GUI threads. Any extra positional or
13522 keyword args are passed on to the callable when it is called.
13523
13524 :see: `wx.FutureCall`
d55e5bfc
RD
13525 """
13526 app = wx.GetApp()
a001823c 13527 assert app is not None, 'No wx.App created yet'
d55e5bfc 13528
891bb194
RD
13529 if not hasattr(app, "_CallAfterId"):
13530 app._CallAfterId = wx.NewEventType()
13531 app.Connect(-1, -1, app._CallAfterId,
13532 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 13533 evt = wx.PyEvent()
891bb194 13534 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
13535 evt.callable = callable
13536 evt.args = args
13537 evt.kw = kw
13538 wx.PostEvent(app, evt)
13539
d55e5bfc
RD
13540#----------------------------------------------------------------------------
13541
13542
13543class FutureCall:
13544 """
6e0de3df 13545 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
13546 object once after the given amount of milliseconds, passing any
13547 positional or keyword args. The return value of the callable is
0439c23b 13548 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
13549
13550 If you don't need to get the return value or restart the timer
13551 then there is no need to hold a reference to this object. It will
13552 hold a reference to itself while the timer is running (the timer
13553 has a reference to self.Notify) but the cycle will be broken when
13554 the timer completes, automatically cleaning up the wx.FutureCall
13555 object.
0439c23b
RD
13556
13557 :see: `wx.CallAfter`
d55e5bfc
RD
13558 """
13559 def __init__(self, millis, callable, *args, **kwargs):
13560 self.millis = millis
13561 self.callable = callable
13562 self.SetArgs(*args, **kwargs)
13563 self.runCount = 0
13564 self.running = False
13565 self.hasRun = False
13566 self.result = None
13567 self.timer = None
13568 self.Start()
13569
13570 def __del__(self):
13571 self.Stop()
13572
13573
13574 def Start(self, millis=None, *args, **kwargs):
13575 """
13576 (Re)start the timer
13577 """
13578 self.hasRun = False
13579 if millis is not None:
13580 self.millis = millis
13581 if args or kwargs:
13582 self.SetArgs(*args, **kwargs)
13583 self.Stop()
13584 self.timer = wx.PyTimer(self.Notify)
13585 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13586 self.running = True
13587 Restart = Start
13588
13589
13590 def Stop(self):
13591 """
13592 Stop and destroy the timer.
13593 """
13594 if self.timer is not None:
13595 self.timer.Stop()
13596 self.timer = None
13597
13598
13599 def GetInterval(self):
13600 if self.timer is not None:
13601 return self.timer.GetInterval()
13602 else:
13603 return 0
13604
13605
13606 def IsRunning(self):
13607 return self.timer is not None and self.timer.IsRunning()
13608
13609
13610 def SetArgs(self, *args, **kwargs):
13611 """
13612 (Re)set the args passed to the callable object. This is
13613 useful in conjunction with Restart if you want to schedule a
13614 new call to the same callable object but with different
13615 parameters.
13616 """
13617 self.args = args
13618 self.kwargs = kwargs
13619
13620
13621 def HasRun(self):
13622 return self.hasRun
13623
13624 def GetResult(self):
13625 return self.result
13626
13627 def Notify(self):
13628 """
13629 The timer has expired so call the callable.
13630 """
13631 if self.callable and getattr(self.callable, 'im_self', True):
13632 self.runCount += 1
13633 self.running = False
13634 self.result = self.callable(*self.args, **self.kwargs)
13635 self.hasRun = True
13636 if not self.running:
13637 # if it wasn't restarted, then cleanup
13638 wx.CallAfter(self.Stop)
13639
13640
13641
13642#----------------------------------------------------------------------------
13643# Control which items in this module should be documented by epydoc.
13644# We allow only classes and functions, which will help reduce the size
13645# of the docs by filtering out the zillions of constants, EVT objects,
13646# and etc that don't make much sense by themselves, but are instead
13647# documented (or will be) as part of the classes/functions/methods
13648# where they should be used.
13649
d6c14a4c
RD
13650class __DocFilter:
13651 """
13652 A filter for epydoc that only allows non-Ptr classes and
13653 fucntions, in order to reduce the clutter in the API docs.
13654 """
13655 def __init__(self, globals):
13656 self._globals = globals
13657
13658 def __call__(self, name):
13659 import types
13660 obj = self._globals.get(name, None)
13661 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13662 return False
13663 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
13664 return False
13665 return True
d55e5bfc
RD
13666
13667#----------------------------------------------------------------------------
13668#----------------------------------------------------------------------------
13669
13670# Import other modules in this package that should show up in the
13671# "core" wx namespace
13672from _gdi import *
13673from _windows import *
13674from _controls import *
13675from _misc import *
13676
13677
13678# Fixup the stock objects since they can't be used yet. (They will be
13679# restored in wx.PyApp.OnInit.)
13680_core_._wxPyFixStockObjects()
13681
13682#----------------------------------------------------------------------------
13683#----------------------------------------------------------------------------
13684
13685
32fe5131 13686