]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
Applied patch [ 1378183 ] Mac: wxNotebook::HitTest off by one
[wxWidgets.git] / wxPython / src / gtk / _core.py
CommitLineData
d14a1e28
RD
1# This file was created automatically by SWIG.
2# Don't modify this file, modify the SWIG interface instead.
3
54f9ee45 4import _core_
d14a1e28 5
093d3ff1
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
d14a1e28
RD
47#// Give a reference to the dictionary of this module to the C++ extension
48#// code.
54f9ee45 49_core_._wxPySetDictionary(vars())
d14a1e28
RD
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
66c033b4
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
54f9ee45
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
bcd0d7b6 88DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 89DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
54f9ee45
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
54f9ee45
RD
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
fef4c27a 121RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
54f9ee45
RD
122RB_GROUP = _core_.RB_GROUP
123RB_SINGLE = _core_.RB_SINGLE
54f9ee45
RD
124SB_HORIZONTAL = _core_.SB_HORIZONTAL
125SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 126RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
54f9ee45
RD
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
54f9ee45
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
54f9ee45
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
7bc1e663
RD
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
54f9ee45
RD
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
e505d15e
RD
282PD_SMOOTH = _core_.PD_SMOOTH
283PD_CAN_SKIP = _core_.PD_CAN_SKIP
54f9ee45
RD
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
7bc1e663
RD
352BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
353BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
354BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
54f9ee45
RD
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
54f9ee45
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
88c6b281
RD
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
54f9ee45
RD
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
6c75a4cf
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
54f9ee45
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
54f9ee45 679MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 680MOD_META = _core_.MOD_META
54f9ee45 681MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
682MOD_CMD = _core_.MOD_CMD
683MOD_ALL = _core_.MOD_ALL
54f9ee45
RD
684UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
685UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
686UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d14a1e28
RD
687#---------------------------------------------------------------------------
688
689class Object(object):
0df68c9f
RD
690 """
691 The base class for most wx objects, although in wxPython not
692 much functionality is needed nor exposed.
693 """
d14a1e28
RD
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,)
e811c8ce 697 def GetClassName(*args, **kwargs):
0df68c9f 698 """
a95a7133 699 GetClassName(self) -> String
e811c8ce 700
a95a7133 701 Returns the class name of the C++ class using wxRTTI.
0df68c9f 702 """
54f9ee45 703 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
704
705 def Destroy(*args, **kwargs):
0df68c9f 706 """
a95a7133 707 Destroy(self)
e811c8ce 708
0df68c9f
RD
709 Deletes the C++ object this Python object is a proxy for.
710 """
54f9ee45 711 return _core_.Object_Destroy(*args, **kwargs)
e811c8ce 712
d14a1e28
RD
713
714class ObjectPtr(Object):
715 def __init__(self, this):
716 self.this = this
717 if not hasattr(self,"thisown"): self.thisown = 0
718 self.__class__ = Object
54f9ee45
RD
719_core_.Object_swigregister(ObjectPtr)
720_wxPySetDictionary = _core_._wxPySetDictionary
d14a1e28 721
54f9ee45 722_wxPyFixStockObjects = _core_._wxPyFixStockObjects
3a04f143 723
54f9ee45 724cvar = _core_.cvar
196addbf 725EmptyString = cvar.EmptyString
d14a1e28
RD
726
727#---------------------------------------------------------------------------
728
54f9ee45
RD
729BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
730BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
731BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
732BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
733BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
734BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
735BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
736BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
737BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
738BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
739BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
740BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
741BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
742BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
743BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
744BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
745BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
746BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
747BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
748BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
749CURSOR_NONE = _core_.CURSOR_NONE
750CURSOR_ARROW = _core_.CURSOR_ARROW
751CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
752CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
753CURSOR_CHAR = _core_.CURSOR_CHAR
754CURSOR_CROSS = _core_.CURSOR_CROSS
755CURSOR_HAND = _core_.CURSOR_HAND
756CURSOR_IBEAM = _core_.CURSOR_IBEAM
757CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
758CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
759CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
760CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
761CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
762CURSOR_PENCIL = _core_.CURSOR_PENCIL
763CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
764CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
765CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
766CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
767CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
768CURSOR_SIZENS = _core_.CURSOR_SIZENS
769CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
770CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
771CURSOR_SIZING = _core_.CURSOR_SIZING
772CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
773CURSOR_WAIT = _core_.CURSOR_WAIT
774CURSOR_WATCH = _core_.CURSOR_WATCH
775CURSOR_BLANK = _core_.CURSOR_BLANK
776CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
777CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
778CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
779CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
780#---------------------------------------------------------------------------
781
782class Size(object):
0df68c9f 783 """
41e2b43e 784 wx.Size is a useful data structure used to represent the size of
093d3ff1
RD
785 something. It simply contians integer width and height
786 proprtites. In most places in wxPython where a wx.Size is
787 expected a (width, height) tuple can be used instead.
0df68c9f 788 """
e811c8ce
RD
789 def __repr__(self):
790 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
791 width = property(_core_.Size_width_get, _core_.Size_width_set)
792 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 793 x = width; y = height
d14a1e28 794 def __init__(self, *args, **kwargs):
0df68c9f 795 """
a95a7133 796 __init__(self, int w=0, int h=0) -> Size
e811c8ce 797
0df68c9f
RD
798 Creates a size object.
799 """
54f9ee45 800 newobj = _core_.new_Size(*args, **kwargs)
d14a1e28
RD
801 self.this = newobj.this
802 self.thisown = 1
803 del newobj.thisown
54f9ee45 804 def __del__(self, destroy=_core_.delete_Size):
a95a7133 805 """__del__(self)"""
d14a1e28
RD
806 try:
807 if self.thisown: destroy(self)
808 except: pass
e811c8ce
RD
809
810 def __eq__(*args, **kwargs):
0df68c9f 811 """
a95a7133 812 __eq__(self, Size sz) -> bool
e811c8ce 813
0df68c9f
RD
814 Test for equality of wx.Size objects.
815 """
54f9ee45 816 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
817
818 def __ne__(*args, **kwargs):
0df68c9f 819 """
a95a7133 820 __ne__(self, Size sz) -> bool
e811c8ce 821
0df68c9f
RD
822 Test for inequality.
823 """
54f9ee45 824 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
825
826 def __add__(*args, **kwargs):
0df68c9f 827 """
a95a7133 828 __add__(self, Size sz) -> Size
e811c8ce 829
0df68c9f
RD
830 Add sz's proprties to this and return the result.
831 """
54f9ee45 832 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
833
834 def __sub__(*args, **kwargs):
0df68c9f 835 """
a95a7133 836 __sub__(self, Size sz) -> Size
e811c8ce 837
0df68c9f
RD
838 Subtract sz's properties from this and return the result.
839 """
54f9ee45 840 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
841
842 def IncTo(*args, **kwargs):
0df68c9f 843 """
a95a7133 844 IncTo(self, Size sz)
e811c8ce 845
0df68c9f
RD
846 Increments this object so that both of its dimensions are not less
847 than the corresponding dimensions of the size.
848 """
54f9ee45 849 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
850
851 def DecTo(*args, **kwargs):
0df68c9f 852 """
a95a7133 853 DecTo(self, Size sz)
e811c8ce 854
0df68c9f
RD
855 Decrements this object so that both of its dimensions are not greater
856 than the corresponding dimensions of the size.
857 """
54f9ee45 858 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce
RD
859
860 def Set(*args, **kwargs):
0df68c9f 861 """
a95a7133 862 Set(self, int w, int h)
e811c8ce 863
0df68c9f
RD
864 Set both width and height.
865 """
54f9ee45 866 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
867
868 def SetWidth(*args, **kwargs):
a95a7133 869 """SetWidth(self, int w)"""
54f9ee45 870 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
871
872 def SetHeight(*args, **kwargs):
a95a7133 873 """SetHeight(self, int h)"""
54f9ee45 874 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
875
876 def GetWidth(*args, **kwargs):
a95a7133 877 """GetWidth(self) -> int"""
54f9ee45 878 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
879
880 def GetHeight(*args, **kwargs):
a95a7133 881 """GetHeight(self) -> int"""
54f9ee45 882 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 883
74a57fcd
RD
884 def IsFullySpecified(*args, **kwargs):
885 """
a95a7133 886 IsFullySpecified(self) -> bool
74a57fcd
RD
887
888 Returns True if both components of the size are non-default values.
889 """
54f9ee45 890 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
891
892 def SetDefaults(*args, **kwargs):
893 """
a95a7133 894 SetDefaults(self, Size size)
74a57fcd 895
41e2b43e
RD
896 Combine this size with the other one replacing the default components
897 of this object (i.e. equal to -1) with those of the other.
74a57fcd 898 """
54f9ee45 899 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 900
e811c8ce 901 def Get(*args, **kwargs):
0df68c9f
RD
902 """
903 Get() -> (width,height)
e811c8ce 904
0df68c9f
RD
905 Returns the width and height properties as a tuple.
906 """
54f9ee45 907 return _core_.Size_Get(*args, **kwargs)
e811c8ce 908
41e2b43e 909 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
910 def __str__(self): return str(self.Get())
911 def __repr__(self): return 'wx.Size'+str(self.Get())
912 def __len__(self): return len(self.Get())
913 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
914 def __setitem__(self, index, val):
915 if index == 0: self.width = val
916 elif index == 1: self.height = val
917 else: raise IndexError
e811c8ce 918 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
919 __safe_for_unpickling__ = True
920 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28
RD
921
922
923class SizePtr(Size):
924 def __init__(self, this):
925 self.this = this
926 if not hasattr(self,"thisown"): self.thisown = 0
927 self.__class__ = Size
54f9ee45 928_core_.Size_swigregister(SizePtr)
d14a1e28
RD
929
930#---------------------------------------------------------------------------
931
932class RealPoint(object):
0df68c9f 933 """
41e2b43e
RD
934 A data structure for representing a point or position with floating
935 point x and y properties. In wxPython most places that expect a
936 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 937 """
e811c8ce
RD
938 def __repr__(self):
939 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
940 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
941 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
d14a1e28 942 def __init__(self, *args, **kwargs):
0df68c9f 943 """
a95a7133 944 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 945
0df68c9f
RD
946 Create a wx.RealPoint object
947 """
54f9ee45 948 newobj = _core_.new_RealPoint(*args, **kwargs)
d14a1e28
RD
949 self.this = newobj.this
950 self.thisown = 1
951 del newobj.thisown
54f9ee45 952 def __del__(self, destroy=_core_.delete_RealPoint):
a95a7133 953 """__del__(self)"""
d14a1e28
RD
954 try:
955 if self.thisown: destroy(self)
956 except: pass
e811c8ce
RD
957
958 def __eq__(*args, **kwargs):
0df68c9f 959 """
a95a7133 960 __eq__(self, RealPoint pt) -> bool
e811c8ce 961
0df68c9f
RD
962 Test for equality of wx.RealPoint objects.
963 """
54f9ee45 964 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
965
966 def __ne__(*args, **kwargs):
0df68c9f 967 """
a95a7133 968 __ne__(self, RealPoint pt) -> bool
e811c8ce 969
0df68c9f
RD
970 Test for inequality of wx.RealPoint objects.
971 """
54f9ee45 972 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
973
974 def __add__(*args, **kwargs):
0df68c9f 975 """
a95a7133 976 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 977
0df68c9f
RD
978 Add pt's proprties to this and return the result.
979 """
54f9ee45 980 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
981
982 def __sub__(*args, **kwargs):
0df68c9f 983 """
a95a7133 984 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 985
0df68c9f
RD
986 Subtract pt's proprties from this and return the result
987 """
54f9ee45 988 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
989
990 def Set(*args, **kwargs):
0df68c9f 991 """
a95a7133 992 Set(self, double x, double y)
e811c8ce 993
0df68c9f
RD
994 Set both the x and y properties
995 """
54f9ee45 996 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
997
998 def Get(*args, **kwargs):
0df68c9f
RD
999 """
1000 Get() -> (x,y)
e811c8ce 1001
0df68c9f
RD
1002 Return the x and y properties as a tuple.
1003 """
54f9ee45 1004 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 1005
41e2b43e 1006 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1007 def __str__(self): return str(self.Get())
1008 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1009 def __len__(self): return len(self.Get())
1010 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1011 def __setitem__(self, index, val):
e811c8ce
RD
1012 if index == 0: self.x = val
1013 elif index == 1: self.y = val
d14a1e28 1014 else: raise IndexError
e811c8ce 1015 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1016 __safe_for_unpickling__ = True
1017 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28
RD
1018
1019
1020class RealPointPtr(RealPoint):
1021 def __init__(self, this):
1022 self.this = this
1023 if not hasattr(self,"thisown"): self.thisown = 0
1024 self.__class__ = RealPoint
54f9ee45 1025_core_.RealPoint_swigregister(RealPointPtr)
d14a1e28
RD
1026
1027#---------------------------------------------------------------------------
1028
1029class Point(object):
0df68c9f 1030 """
41e2b43e
RD
1031 A data structure for representing a point or position with integer x
1032 and y properties. Most places in wxPython that expect a wx.Point can
1033 also accept a (x,y) tuple.
0df68c9f 1034 """
e811c8ce
RD
1035 def __repr__(self):
1036 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
1037 x = property(_core_.Point_x_get, _core_.Point_x_set)
1038 y = property(_core_.Point_y_get, _core_.Point_y_set)
d14a1e28 1039 def __init__(self, *args, **kwargs):
0df68c9f 1040 """
a95a7133 1041 __init__(self, int x=0, int y=0) -> Point
e811c8ce 1042
0df68c9f
RD
1043 Create a wx.Point object
1044 """
54f9ee45 1045 newobj = _core_.new_Point(*args, **kwargs)
d14a1e28
RD
1046 self.this = newobj.this
1047 self.thisown = 1
1048 del newobj.thisown
54f9ee45 1049 def __del__(self, destroy=_core_.delete_Point):
a95a7133 1050 """__del__(self)"""
d14a1e28
RD
1051 try:
1052 if self.thisown: destroy(self)
1053 except: pass
e811c8ce
RD
1054
1055 def __eq__(*args, **kwargs):
0df68c9f 1056 """
a95a7133 1057 __eq__(self, Point pt) -> bool
e811c8ce 1058
0df68c9f
RD
1059 Test for equality of wx.Point objects.
1060 """
54f9ee45 1061 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
1062
1063 def __ne__(*args, **kwargs):
0df68c9f 1064 """
a95a7133 1065 __ne__(self, Point pt) -> bool
e811c8ce 1066
0df68c9f
RD
1067 Test for inequality of wx.Point objects.
1068 """
54f9ee45 1069 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
1070
1071 def __add__(*args, **kwargs):
0df68c9f 1072 """
a95a7133 1073 __add__(self, Point pt) -> Point
e811c8ce 1074
0df68c9f
RD
1075 Add pt's proprties to this and return the result.
1076 """
54f9ee45 1077 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
1078
1079 def __sub__(*args, **kwargs):
0df68c9f 1080 """
a95a7133 1081 __sub__(self, Point pt) -> Point
e811c8ce 1082
0df68c9f
RD
1083 Subtract pt's proprties from this and return the result
1084 """
54f9ee45 1085 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
1086
1087 def __iadd__(*args, **kwargs):
0df68c9f 1088 """
a95a7133 1089 __iadd__(self, Point pt) -> Point
e811c8ce 1090
0df68c9f
RD
1091 Add pt to this object.
1092 """
54f9ee45 1093 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
1094
1095 def __isub__(*args, **kwargs):
0df68c9f 1096 """
a95a7133 1097 __isub__(self, Point pt) -> Point
e811c8ce 1098
0df68c9f
RD
1099 Subtract pt from this object.
1100 """
54f9ee45 1101 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
1102
1103 def Set(*args, **kwargs):
0df68c9f 1104 """
a95a7133 1105 Set(self, long x, long y)
e811c8ce 1106
0df68c9f
RD
1107 Set both the x and y properties
1108 """
54f9ee45 1109 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
1110
1111 def Get(*args, **kwargs):
0df68c9f
RD
1112 """
1113 Get() -> (x,y)
e811c8ce 1114
0df68c9f
RD
1115 Return the x and y properties as a tuple.
1116 """
54f9ee45 1117 return _core_.Point_Get(*args, **kwargs)
e811c8ce 1118
41e2b43e 1119 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1120 def __str__(self): return str(self.Get())
1121 def __repr__(self): return 'wx.Point'+str(self.Get())
1122 def __len__(self): return len(self.Get())
1123 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1124 def __setitem__(self, index, val):
1125 if index == 0: self.x = val
1126 elif index == 1: self.y = val
1127 else: raise IndexError
e811c8ce 1128 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
1129 __safe_for_unpickling__ = True
1130 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28
RD
1131
1132
1133class PointPtr(Point):
1134 def __init__(self, this):
1135 self.this = this
1136 if not hasattr(self,"thisown"): self.thisown = 0
1137 self.__class__ = Point
54f9ee45 1138_core_.Point_swigregister(PointPtr)
d14a1e28
RD
1139
1140#---------------------------------------------------------------------------
1141
1142class Rect(object):
0df68c9f 1143 """
41e2b43e
RD
1144 A class for representing and manipulating rectangles. It has x, y,
1145 width and height properties. In wxPython most palces that expect a
1146 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1147 """
e811c8ce
RD
1148 def __repr__(self):
1149 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1150 def __init__(self, *args, **kwargs):
0df68c9f 1151 """
a95a7133 1152 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1153
0df68c9f
RD
1154 Create a new Rect object.
1155 """
54f9ee45 1156 newobj = _core_.new_Rect(*args, **kwargs)
d14a1e28
RD
1157 self.this = newobj.this
1158 self.thisown = 1
1159 del newobj.thisown
54f9ee45 1160 def __del__(self, destroy=_core_.delete_Rect):
a95a7133 1161 """__del__(self)"""
d14a1e28
RD
1162 try:
1163 if self.thisown: destroy(self)
1164 except: pass
e811c8ce
RD
1165
1166 def GetX(*args, **kwargs):
a95a7133 1167 """GetX(self) -> int"""
54f9ee45 1168 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1169
1170 def SetX(*args, **kwargs):
a95a7133 1171 """SetX(self, int x)"""
54f9ee45 1172 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1173
1174 def GetY(*args, **kwargs):
a95a7133 1175 """GetY(self) -> int"""
54f9ee45 1176 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1177
1178 def SetY(*args, **kwargs):
a95a7133 1179 """SetY(self, int y)"""
54f9ee45 1180 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1181
1182 def GetWidth(*args, **kwargs):
a95a7133 1183 """GetWidth(self) -> int"""
54f9ee45 1184 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1185
1186 def SetWidth(*args, **kwargs):
a95a7133 1187 """SetWidth(self, int w)"""
54f9ee45 1188 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1189
1190 def GetHeight(*args, **kwargs):
a95a7133 1191 """GetHeight(self) -> int"""
54f9ee45 1192 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1193
1194 def SetHeight(*args, **kwargs):
a95a7133 1195 """SetHeight(self, int h)"""
54f9ee45 1196 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1197
1198 def GetPosition(*args, **kwargs):
a95a7133 1199 """GetPosition(self) -> Point"""
54f9ee45 1200 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1201
1202 def SetPosition(*args, **kwargs):
a95a7133 1203 """SetPosition(self, Point p)"""
54f9ee45 1204 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1205
1206 def GetSize(*args, **kwargs):
a95a7133 1207 """GetSize(self) -> Size"""
54f9ee45 1208 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1209
1210 def SetSize(*args, **kwargs):
a95a7133 1211 """SetSize(self, Size s)"""
54f9ee45 1212 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1213
aff4cc5c
RD
1214 def IsEmpty(*args, **kwargs):
1215 """IsEmpty(self) -> bool"""
1216 return _core_.Rect_IsEmpty(*args, **kwargs)
1217
c9c7117a 1218 def GetTopLeft(*args, **kwargs):
a95a7133 1219 """GetTopLeft(self) -> Point"""
54f9ee45 1220 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1221
1222 def SetTopLeft(*args, **kwargs):
a95a7133 1223 """SetTopLeft(self, Point p)"""
54f9ee45 1224 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1225
1226 def GetBottomRight(*args, **kwargs):
a95a7133 1227 """GetBottomRight(self) -> Point"""
54f9ee45 1228 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1229
1230 def SetBottomRight(*args, **kwargs):
a95a7133 1231 """SetBottomRight(self, Point p)"""
54f9ee45 1232 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1233
e811c8ce 1234 def GetLeft(*args, **kwargs):
a95a7133 1235 """GetLeft(self) -> int"""
54f9ee45 1236 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1237
1238 def GetTop(*args, **kwargs):
a95a7133 1239 """GetTop(self) -> int"""
54f9ee45 1240 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1241
1242 def GetBottom(*args, **kwargs):
a95a7133 1243 """GetBottom(self) -> int"""
54f9ee45 1244 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1245
1246 def GetRight(*args, **kwargs):
a95a7133 1247 """GetRight(self) -> int"""
54f9ee45 1248 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1249
1250 def SetLeft(*args, **kwargs):
a95a7133 1251 """SetLeft(self, int left)"""
54f9ee45 1252 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1253
1254 def SetRight(*args, **kwargs):
a95a7133 1255 """SetRight(self, int right)"""
54f9ee45 1256 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1257
1258 def SetTop(*args, **kwargs):
a95a7133 1259 """SetTop(self, int top)"""
54f9ee45 1260 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1261
1262 def SetBottom(*args, **kwargs):
a95a7133 1263 """SetBottom(self, int bottom)"""
54f9ee45 1264 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1265
1266 position = property(GetPosition, SetPosition)
1267 size = property(GetSize, SetSize)
1268 left = property(GetLeft, SetLeft)
1269 right = property(GetRight, SetRight)
1270 top = property(GetTop, SetTop)
1271 bottom = property(GetBottom, SetBottom)
1272
1273 def Inflate(*args, **kwargs):
0df68c9f 1274 """
a95a7133 1275 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1276
8e738329
RD
1277 Increases the size of the rectangle.
1278
1279 The left border is moved farther left and the right border is moved
1280 farther right by ``dx``. The upper border is moved farther up and the
1281 bottom border is moved farther down by ``dy``. (Note the the width and
1282 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1283 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1284 opposite happens: the rectangle size decreases in the respective
1285 direction.
1286
1287 The change is made to the rectangle inplace, if instead you need a
1288 copy that is inflated, preserving the original then make the copy
1289 first::
1290
1291 copy = wx.Rect(*original)
1292 copy.Inflate(10,15)
1293
1294
0df68c9f 1295 """
54f9ee45 1296 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1297
1298 def Deflate(*args, **kwargs):
0df68c9f 1299 """
a95a7133 1300 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1301
8e738329
RD
1302 Decrease the rectangle size. This method is the opposite of `Inflate`
1303 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1304 `Inflate` for a full description.
0df68c9f 1305 """
54f9ee45 1306 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1307
1308 def OffsetXY(*args, **kwargs):
0df68c9f 1309 """
a95a7133 1310 OffsetXY(self, int dx, int dy)
e811c8ce 1311
41e2b43e
RD
1312 Moves the rectangle by the specified offset. If dx is positive, the
1313 rectangle is moved to the right, if dy is positive, it is moved to the
1314 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1315 """
54f9ee45 1316 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1317
1318 def Offset(*args, **kwargs):
0df68c9f 1319 """
a95a7133 1320 Offset(self, Point pt)
e811c8ce 1321
0df68c9f
RD
1322 Same as OffsetXY but uses dx,dy from Point
1323 """
54f9ee45 1324 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1325
1326 def Intersect(*args, **kwargs):
0df68c9f 1327 """
a95a7133 1328 Intersect(self, Rect rect) -> Rect
e811c8ce 1329
5cbf236d 1330 Returns the intersectsion of this rectangle and rect.
0df68c9f 1331 """
54f9ee45 1332 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce 1333
5cbf236d
RD
1334 def Union(*args, **kwargs):
1335 """
1336 Union(self, Rect rect) -> Rect
1337
1338 Returns the union of this rectangle and rect.
1339 """
1340 return _core_.Rect_Union(*args, **kwargs)
1341
e811c8ce 1342 def __add__(*args, **kwargs):
0df68c9f 1343 """
a95a7133 1344 __add__(self, Rect rect) -> Rect
e811c8ce 1345
0df68c9f
RD
1346 Add the properties of rect to this rectangle and return the result.
1347 """
54f9ee45 1348 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1349
1350 def __iadd__(*args, **kwargs):
0df68c9f 1351 """
a95a7133 1352 __iadd__(self, Rect rect) -> Rect
e811c8ce 1353
0df68c9f
RD
1354 Add the properties of rect to this rectangle, updating this rectangle.
1355 """
54f9ee45 1356 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1357
1358 def __eq__(*args, **kwargs):
0df68c9f 1359 """
a95a7133 1360 __eq__(self, Rect rect) -> bool
e811c8ce 1361
0df68c9f
RD
1362 Test for equality.
1363 """
54f9ee45 1364 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1365
1366 def __ne__(*args, **kwargs):
0df68c9f 1367 """
a95a7133 1368 __ne__(self, Rect rect) -> bool
e811c8ce 1369
0df68c9f
RD
1370 Test for inequality.
1371 """
54f9ee45 1372 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce
RD
1373
1374 def InsideXY(*args, **kwargs):
0df68c9f 1375 """
a95a7133 1376 InsideXY(self, int x, int y) -> bool
e811c8ce 1377
0df68c9f
RD
1378 Return True if the point is (not strcitly) inside the rect.
1379 """
54f9ee45 1380 return _core_.Rect_InsideXY(*args, **kwargs)
e811c8ce
RD
1381
1382 def Inside(*args, **kwargs):
0df68c9f 1383 """
a95a7133 1384 Inside(self, Point pt) -> bool
e811c8ce 1385
0df68c9f
RD
1386 Return True if the point is (not strcitly) inside the rect.
1387 """
54f9ee45 1388 return _core_.Rect_Inside(*args, **kwargs)
e811c8ce
RD
1389
1390 def Intersects(*args, **kwargs):
0df68c9f 1391 """
a95a7133 1392 Intersects(self, Rect rect) -> bool
e811c8ce 1393
0df68c9f
RD
1394 Returns True if the rectangles have a non empty intersection.
1395 """
54f9ee45 1396 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1397
54f9ee45
RD
1398 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1399 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1400 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1401 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1402 def Set(*args, **kwargs):
0df68c9f 1403 """
a95a7133 1404 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1405
0df68c9f
RD
1406 Set all rectangle properties.
1407 """
54f9ee45 1408 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1409
1410 def Get(*args, **kwargs):
0df68c9f
RD
1411 """
1412 Get() -> (x,y,width,height)
e811c8ce 1413
0df68c9f
RD
1414 Return the rectangle properties as a tuple.
1415 """
54f9ee45 1416 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1417
41e2b43e 1418 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1419 def __str__(self): return str(self.Get())
1420 def __repr__(self): return 'wx.Rect'+str(self.Get())
1421 def __len__(self): return len(self.Get())
1422 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1423 def __setitem__(self, index, val):
1424 if index == 0: self.x = val
1425 elif index == 1: self.y = val
1426 elif index == 2: self.width = val
1427 elif index == 3: self.height = val
1428 else: raise IndexError
e811c8ce 1429 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1430 __safe_for_unpickling__ = True
1431 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28
RD
1432
1433
1434class RectPtr(Rect):
1435 def __init__(self, this):
1436 self.this = this
1437 if not hasattr(self,"thisown"): self.thisown = 0
1438 self.__class__ = Rect
54f9ee45 1439_core_.Rect_swigregister(RectPtr)
d14a1e28
RD
1440
1441def RectPP(*args, **kwargs):
0df68c9f
RD
1442 """
1443 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1444
0df68c9f
RD
1445 Create a new Rect object from Points representing two corners.
1446 """
54f9ee45 1447 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1448 val.thisown = 1
1449 return val
1450
1451def RectPS(*args, **kwargs):
0df68c9f
RD
1452 """
1453 RectPS(Point pos, Size size) -> Rect
e811c8ce 1454
0df68c9f
RD
1455 Create a new Rect from a position and size.
1456 """
54f9ee45 1457 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1458 val.thisown = 1
1459 return val
1460
d3b6e4ff
RD
1461def RectS(*args, **kwargs):
1462 """
1463 RectS(Size size) -> Rect
1464
1465 Create a new Rect from a size only.
1466 """
1467 val = _core_.new_RectS(*args, **kwargs)
1468 val.thisown = 1
1469 return val
1470
d14a1e28 1471
e811c8ce 1472def IntersectRect(*args, **kwargs):
0df68c9f
RD
1473 """
1474 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1475
0df68c9f
RD
1476 Calculate and return the intersection of r1 and r2.
1477 """
54f9ee45 1478 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1479#---------------------------------------------------------------------------
1480
1481class Point2D(object):
41e2b43e
RD
1482 """
1483 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1484 with floating point values.
1485 """
e811c8ce
RD
1486 def __repr__(self):
1487 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1488 def __init__(self, *args, **kwargs):
0df68c9f 1489 """
a95a7133 1490 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1491
0df68c9f
RD
1492 Create a w.Point2D object.
1493 """
54f9ee45 1494 newobj = _core_.new_Point2D(*args, **kwargs)
d14a1e28
RD
1495 self.this = newobj.this
1496 self.thisown = 1
1497 del newobj.thisown
e811c8ce 1498 def GetFloor(*args, **kwargs):
fd2dc343
RD
1499 """
1500 GetFloor() -> (x,y)
1501
1502 Convert to integer
1503 """
54f9ee45 1504 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1505
1506 def GetRounded(*args, **kwargs):
fd2dc343
RD
1507 """
1508 GetRounded() -> (x,y)
1509
1510 Convert to integer
1511 """
54f9ee45 1512 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1513
1514 def GetVectorLength(*args, **kwargs):
a95a7133 1515 """GetVectorLength(self) -> double"""
54f9ee45 1516 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1517
1518 def GetVectorAngle(*args, **kwargs):
a95a7133 1519 """GetVectorAngle(self) -> double"""
54f9ee45 1520 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1521
1522 def SetVectorLength(*args, **kwargs):
a95a7133 1523 """SetVectorLength(self, double length)"""
54f9ee45 1524 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1525
1526 def SetVectorAngle(*args, **kwargs):
a95a7133 1527 """SetVectorAngle(self, double degrees)"""
54f9ee45 1528 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1529
d14a1e28
RD
1530 def SetPolarCoordinates(self, angle, length):
1531 self.SetVectorLength(length)
1532 self.SetVectorAngle(angle)
1533 def Normalize(self):
1534 self.SetVectorLength(1.0)
1535
e811c8ce 1536 def GetDistance(*args, **kwargs):
a95a7133 1537 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1538 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1539
1540 def GetDistanceSquare(*args, **kwargs):
a95a7133 1541 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1542 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1543
1544 def GetDotProduct(*args, **kwargs):
a95a7133 1545 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1546 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1547
1548 def GetCrossProduct(*args, **kwargs):
a95a7133 1549 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1550 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1551
1552 def __neg__(*args, **kwargs):
0df68c9f 1553 """
a95a7133 1554 __neg__(self) -> Point2D
e811c8ce 1555
0df68c9f
RD
1556 the reflection of this point
1557 """
54f9ee45 1558 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1559
1560 def __iadd__(*args, **kwargs):
a95a7133 1561 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1562 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1563
1564 def __isub__(*args, **kwargs):
a95a7133 1565 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1566 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1567
1568 def __imul__(*args, **kwargs):
a95a7133 1569 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1570 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1571
1572 def __idiv__(*args, **kwargs):
a95a7133 1573 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1574 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1575
1576 def __eq__(*args, **kwargs):
0df68c9f 1577 """
a95a7133 1578 __eq__(self, Point2D pt) -> bool
e811c8ce 1579
0df68c9f
RD
1580 Test for equality
1581 """
54f9ee45 1582 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1583
1584 def __ne__(*args, **kwargs):
0df68c9f 1585 """
a95a7133 1586 __ne__(self, Point2D pt) -> bool
e811c8ce 1587
0df68c9f
RD
1588 Test for inequality
1589 """
54f9ee45 1590 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1591
54f9ee45
RD
1592 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1593 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1594 def Set(*args, **kwargs):
a95a7133 1595 """Set(self, double x=0, double y=0)"""
54f9ee45 1596 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1597
1598 def Get(*args, **kwargs):
0df68c9f
RD
1599 """
1600 Get() -> (x,y)
e811c8ce 1601
0df68c9f
RD
1602 Return x and y properties as a tuple.
1603 """
54f9ee45 1604 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1605
41e2b43e 1606 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1607 def __str__(self): return str(self.Get())
1608 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1609 def __len__(self): return len(self.Get())
1610 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1611 def __setitem__(self, index, val):
e811c8ce
RD
1612 if index == 0: self.x = val
1613 elif index == 1: self.y = val
d14a1e28 1614 else: raise IndexError
e811c8ce 1615 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1616 __safe_for_unpickling__ = True
1617 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28
RD
1618
1619
1620class Point2DPtr(Point2D):
1621 def __init__(self, this):
1622 self.this = this
1623 if not hasattr(self,"thisown"): self.thisown = 0
1624 self.__class__ = Point2D
54f9ee45 1625_core_.Point2D_swigregister(Point2DPtr)
d14a1e28
RD
1626
1627def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1628 """
1629 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1630
0df68c9f
RD
1631 Create a w.Point2D object.
1632 """
54f9ee45 1633 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1634 val.thisown = 1
1635 return val
1636
1637def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1638 """
1639 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1640
0df68c9f
RD
1641 Create a w.Point2D object.
1642 """
54f9ee45 1643 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1644 val.thisown = 1
1645 return val
1646
1647#---------------------------------------------------------------------------
1648
54f9ee45
RD
1649FromStart = _core_.FromStart
1650FromCurrent = _core_.FromCurrent
1651FromEnd = _core_.FromEnd
d14a1e28 1652class InputStream(object):
093d3ff1 1653 """Proxy of C++ InputStream class"""
e811c8ce
RD
1654 def __repr__(self):
1655 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1656 def __init__(self, *args, **kwargs):
a95a7133 1657 """__init__(self, PyObject p) -> InputStream"""
54f9ee45 1658 newobj = _core_.new_InputStream(*args, **kwargs)
d14a1e28
RD
1659 self.this = newobj.this
1660 self.thisown = 1
1661 del newobj.thisown
8fb0e70a
RD
1662 def __del__(self, destroy=_core_.delete_InputStream):
1663 """__del__(self)"""
1664 try:
1665 if self.thisown: destroy(self)
1666 except: pass
1667
e811c8ce 1668 def close(*args, **kwargs):
a95a7133 1669 """close(self)"""
54f9ee45 1670 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1671
1672 def flush(*args, **kwargs):
a95a7133 1673 """flush(self)"""
54f9ee45 1674 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1675
1676 def eof(*args, **kwargs):
a95a7133 1677 """eof(self) -> bool"""
54f9ee45 1678 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1679
1680 def read(*args, **kwargs):
a95a7133 1681 """read(self, int size=-1) -> PyObject"""
54f9ee45 1682 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1683
1684 def readline(*args, **kwargs):
a95a7133 1685 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1686 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1687
1688 def readlines(*args, **kwargs):
a95a7133 1689 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1690 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1691
1692 def seek(*args, **kwargs):
a95a7133 1693 """seek(self, int offset, int whence=0)"""
54f9ee45 1694 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1695
1696 def tell(*args, **kwargs):
a95a7133 1697 """tell(self) -> int"""
54f9ee45 1698 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1699
1700 def Peek(*args, **kwargs):
a95a7133 1701 """Peek(self) -> char"""
54f9ee45 1702 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1703
1704 def GetC(*args, **kwargs):
a95a7133 1705 """GetC(self) -> char"""
54f9ee45 1706 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1707
1708 def LastRead(*args, **kwargs):
a95a7133 1709 """LastRead(self) -> size_t"""
54f9ee45 1710 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1711
1712 def CanRead(*args, **kwargs):
a95a7133 1713 """CanRead(self) -> bool"""
54f9ee45 1714 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1715
1716 def Eof(*args, **kwargs):
a95a7133 1717 """Eof(self) -> bool"""
54f9ee45 1718 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1719
1720 def Ungetch(*args, **kwargs):
a95a7133 1721 """Ungetch(self, char c) -> bool"""
54f9ee45 1722 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1723
1724 def SeekI(*args, **kwargs):
a95a7133 1725 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1726 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1727
1728 def TellI(*args, **kwargs):
a95a7133 1729 """TellI(self) -> long"""
54f9ee45 1730 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1731
d14a1e28
RD
1732
1733class InputStreamPtr(InputStream):
1734 def __init__(self, this):
1735 self.this = this
1736 if not hasattr(self,"thisown"): self.thisown = 0
1737 self.__class__ = InputStream
54f9ee45 1738_core_.InputStream_swigregister(InputStreamPtr)
d14a1e28
RD
1739DefaultPosition = cvar.DefaultPosition
1740DefaultSize = cvar.DefaultSize
1741
1742class OutputStream(object):
093d3ff1 1743 """Proxy of C++ OutputStream class"""
d14a1e28
RD
1744 def __init__(self): raise RuntimeError, "No constructor defined"
1745 def __repr__(self):
1746 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 1747 def write(*args, **kwargs):
a95a7133 1748 """write(self, PyObject obj)"""
54f9ee45 1749 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 1750
d14a1e28
RD
1751
1752class OutputStreamPtr(OutputStream):
1753 def __init__(self, this):
1754 self.this = this
1755 if not hasattr(self,"thisown"): self.thisown = 0
1756 self.__class__ = OutputStream
54f9ee45 1757_core_.OutputStream_swigregister(OutputStreamPtr)
d14a1e28
RD
1758
1759#---------------------------------------------------------------------------
1760
1761class FSFile(Object):
093d3ff1 1762 """Proxy of C++ FSFile class"""
e811c8ce
RD
1763 def __repr__(self):
1764 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1765 def __init__(self, *args, **kwargs):
0df68c9f 1766 """
a95a7133 1767 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 1768 DateTime modif) -> FSFile
0df68c9f 1769 """
54f9ee45 1770 newobj = _core_.new_FSFile(*args, **kwargs)
d14a1e28
RD
1771 self.this = newobj.this
1772 self.thisown = 1
1773 del newobj.thisown
e2950dbb 1774 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1775
54f9ee45 1776 def __del__(self, destroy=_core_.delete_FSFile):
a95a7133 1777 """__del__(self)"""
d14a1e28
RD
1778 try:
1779 if self.thisown: destroy(self)
1780 except: pass
e811c8ce
RD
1781
1782 def GetStream(*args, **kwargs):
a95a7133 1783 """GetStream(self) -> InputStream"""
54f9ee45 1784 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce
RD
1785
1786 def GetMimeType(*args, **kwargs):
a95a7133 1787 """GetMimeType(self) -> String"""
54f9ee45 1788 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
1789
1790 def GetLocation(*args, **kwargs):
a95a7133 1791 """GetLocation(self) -> String"""
54f9ee45 1792 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
1793
1794 def GetAnchor(*args, **kwargs):
a95a7133 1795 """GetAnchor(self) -> String"""
54f9ee45 1796 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
1797
1798 def GetModificationTime(*args, **kwargs):
a95a7133 1799 """GetModificationTime(self) -> DateTime"""
54f9ee45 1800 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 1801
d14a1e28
RD
1802
1803class FSFilePtr(FSFile):
1804 def __init__(self, this):
1805 self.this = this
1806 if not hasattr(self,"thisown"): self.thisown = 0
1807 self.__class__ = FSFile
54f9ee45 1808_core_.FSFile_swigregister(FSFilePtr)
d14a1e28
RD
1809
1810class CPPFileSystemHandler(object):
093d3ff1 1811 """Proxy of C++ CPPFileSystemHandler class"""
d14a1e28
RD
1812 def __init__(self): raise RuntimeError, "No constructor defined"
1813 def __repr__(self):
1814 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1815
1816class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1817 def __init__(self, this):
1818 self.this = this
1819 if not hasattr(self,"thisown"): self.thisown = 0
1820 self.__class__ = CPPFileSystemHandler
54f9ee45 1821_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
d14a1e28
RD
1822
1823class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1824 """Proxy of C++ FileSystemHandler class"""
e811c8ce
RD
1825 def __repr__(self):
1826 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1827 def __init__(self, *args, **kwargs):
a95a7133 1828 """__init__(self) -> FileSystemHandler"""
54f9ee45 1829 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
d14a1e28
RD
1830 self.this = newobj.this
1831 self.thisown = 1
1832 del newobj.thisown
1833 self._setCallbackInfo(self, FileSystemHandler)
e811c8ce
RD
1834
1835 def _setCallbackInfo(*args, **kwargs):
a95a7133 1836 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 1837 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
1838
1839 def CanOpen(*args, **kwargs):
a95a7133 1840 """CanOpen(self, String location) -> bool"""
54f9ee45 1841 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1842
1843 def OpenFile(*args, **kwargs):
a95a7133 1844 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1845 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1846
1847 def FindFirst(*args, **kwargs):
a95a7133 1848 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1849 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1850
1851 def FindNext(*args, **kwargs):
a95a7133 1852 """FindNext(self) -> String"""
54f9ee45 1853 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
1854
1855 def GetProtocol(*args, **kwargs):
a95a7133 1856 """GetProtocol(self, String location) -> String"""
54f9ee45 1857 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
1858
1859 def GetLeftLocation(*args, **kwargs):
a95a7133 1860 """GetLeftLocation(self, String location) -> String"""
54f9ee45 1861 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
1862
1863 def GetAnchor(*args, **kwargs):
a95a7133 1864 """GetAnchor(self, String location) -> String"""
54f9ee45 1865 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
1866
1867 def GetRightLocation(*args, **kwargs):
a95a7133 1868 """GetRightLocation(self, String location) -> String"""
54f9ee45 1869 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
1870
1871 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 1872 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 1873 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 1874
d14a1e28
RD
1875
1876class FileSystemHandlerPtr(FileSystemHandler):
1877 def __init__(self, this):
1878 self.this = this
1879 if not hasattr(self,"thisown"): self.thisown = 0
1880 self.__class__ = FileSystemHandler
54f9ee45 1881_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
d14a1e28
RD
1882
1883class FileSystem(Object):
093d3ff1 1884 """Proxy of C++ FileSystem class"""
e811c8ce
RD
1885 def __repr__(self):
1886 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1887 def __init__(self, *args, **kwargs):
a95a7133 1888 """__init__(self) -> FileSystem"""
54f9ee45 1889 newobj = _core_.new_FileSystem(*args, **kwargs)
d14a1e28
RD
1890 self.this = newobj.this
1891 self.thisown = 1
1892 del newobj.thisown
54f9ee45 1893 def __del__(self, destroy=_core_.delete_FileSystem):
a95a7133 1894 """__del__(self)"""
d14a1e28
RD
1895 try:
1896 if self.thisown: destroy(self)
1897 except: pass
e811c8ce
RD
1898
1899 def ChangePathTo(*args, **kwargs):
a95a7133 1900 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 1901 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
1902
1903 def GetPath(*args, **kwargs):
a95a7133 1904 """GetPath(self) -> String"""
54f9ee45 1905 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
1906
1907 def OpenFile(*args, **kwargs):
a95a7133 1908 """OpenFile(self, String location) -> FSFile"""
54f9ee45 1909 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
1910
1911 def FindFirst(*args, **kwargs):
a95a7133 1912 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1913 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
1914
1915 def FindNext(*args, **kwargs):
a95a7133 1916 """FindNext(self) -> String"""
54f9ee45 1917 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
1918
1919 def AddHandler(*args, **kwargs):
66c033b4 1920 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1921 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
1922
1923 AddHandler = staticmethod(AddHandler)
1924 def CleanUpHandlers(*args, **kwargs):
66c033b4 1925 """CleanUpHandlers()"""
54f9ee45 1926 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
1927
1928 CleanUpHandlers = staticmethod(CleanUpHandlers)
1929 def FileNameToURL(*args, **kwargs):
66c033b4 1930 """FileNameToURL(String filename) -> String"""
54f9ee45 1931 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
1932
1933 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
1934 def URLToFileName(*args, **kwargs):
1935 """URLToFileName(String url) -> String"""
1936 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1937
1938 URLToFileName = staticmethod(URLToFileName)
d14a1e28
RD
1939
1940class FileSystemPtr(FileSystem):
1941 def __init__(self, this):
1942 self.this = this
1943 if not hasattr(self,"thisown"): self.thisown = 0
1944 self.__class__ = FileSystem
54f9ee45 1945_core_.FileSystem_swigregister(FileSystemPtr)
d14a1e28 1946
e811c8ce
RD
1947def FileSystem_AddHandler(*args, **kwargs):
1948 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1949 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 1950
e811c8ce
RD
1951def FileSystem_CleanUpHandlers(*args, **kwargs):
1952 """FileSystem_CleanUpHandlers()"""
54f9ee45 1953 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d14a1e28 1954
e811c8ce 1955def FileSystem_FileNameToURL(*args, **kwargs):
196addbf 1956 """FileSystem_FileNameToURL(String filename) -> String"""
54f9ee45 1957 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 1958
e811c8ce 1959def FileSystem_URLToFileName(*args, **kwargs):
196addbf 1960 """FileSystem_URLToFileName(String url) -> String"""
54f9ee45 1961 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 1962
d14a1e28 1963class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1964 """Proxy of C++ InternetFSHandler class"""
e811c8ce
RD
1965 def __repr__(self):
1966 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1967 def __init__(self, *args, **kwargs):
a95a7133 1968 """__init__(self) -> InternetFSHandler"""
54f9ee45 1969 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
d14a1e28
RD
1970 self.this = newobj.this
1971 self.thisown = 1
1972 del newobj.thisown
e811c8ce 1973 def CanOpen(*args, **kwargs):
a95a7133 1974 """CanOpen(self, String location) -> bool"""
54f9ee45 1975 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1976
1977 def OpenFile(*args, **kwargs):
a95a7133 1978 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1979 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 1980
d14a1e28
RD
1981
1982class InternetFSHandlerPtr(InternetFSHandler):
1983 def __init__(self, this):
1984 self.this = this
1985 if not hasattr(self,"thisown"): self.thisown = 0
1986 self.__class__ = InternetFSHandler
54f9ee45 1987_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
d14a1e28
RD
1988
1989class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1990 """Proxy of C++ ZipFSHandler class"""
e811c8ce
RD
1991 def __repr__(self):
1992 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1993 def __init__(self, *args, **kwargs):
a95a7133 1994 """__init__(self) -> ZipFSHandler"""
54f9ee45 1995 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
d14a1e28
RD
1996 self.this = newobj.this
1997 self.thisown = 1
1998 del newobj.thisown
e811c8ce 1999 def CanOpen(*args, **kwargs):
a95a7133 2000 """CanOpen(self, String location) -> bool"""
54f9ee45 2001 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2002
2003 def OpenFile(*args, **kwargs):
a95a7133 2004 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2005 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2006
2007 def FindFirst(*args, **kwargs):
a95a7133 2008 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2009 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2010
2011 def FindNext(*args, **kwargs):
a95a7133 2012 """FindNext(self) -> String"""
54f9ee45 2013 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 2014
d14a1e28
RD
2015
2016class ZipFSHandlerPtr(ZipFSHandler):
2017 def __init__(self, this):
2018 self.this = this
2019 if not hasattr(self,"thisown"): self.thisown = 0
2020 self.__class__ = ZipFSHandler
54f9ee45 2021_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
d14a1e28
RD
2022
2023
e811c8ce 2024def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
196addbf 2025 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
54f9ee45 2026 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 2027
e811c8ce 2028def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
196addbf 2029 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
54f9ee45 2030 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 2031
e811c8ce 2032def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
196addbf 2033 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
54f9ee45 2034 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
2035def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2036 """
2037 Add 'file' to the memory filesystem. The dataItem parameter can
2038 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2039 arbitrary data. If a bitmap or image is used then the imgType
2040 parameter should specify what kind of image file it should be
2041 written as, wx.BITMAP_TYPE_PNG, etc.
2042 """
2043 if isinstance(dataItem, wx.Image):
2044 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2045 elif isinstance(dataItem, wx.Bitmap):
2046 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2047 elif type(dataItem) == str:
2048 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2049 else:
2050 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
2051
2052class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 2053 """Proxy of C++ MemoryFSHandler class"""
e811c8ce
RD
2054 def __repr__(self):
2055 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2056 def __init__(self, *args, **kwargs):
a95a7133 2057 """__init__(self) -> MemoryFSHandler"""
54f9ee45 2058 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
d14a1e28
RD
2059 self.this = newobj.this
2060 self.thisown = 1
2061 del newobj.thisown
e811c8ce 2062 def RemoveFile(*args, **kwargs):
66c033b4 2063 """RemoveFile(String filename)"""
54f9ee45 2064 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
2065
2066 RemoveFile = staticmethod(RemoveFile)
d14a1e28 2067 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 2068 def CanOpen(*args, **kwargs):
a95a7133 2069 """CanOpen(self, String location) -> bool"""
54f9ee45 2070 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2071
2072 def OpenFile(*args, **kwargs):
a95a7133 2073 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2074 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2075
2076 def FindFirst(*args, **kwargs):
a95a7133 2077 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2078 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2079
2080 def FindNext(*args, **kwargs):
a95a7133 2081 """FindNext(self) -> String"""
54f9ee45 2082 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 2083
d14a1e28
RD
2084
2085class MemoryFSHandlerPtr(MemoryFSHandler):
2086 def __init__(self, this):
2087 self.this = this
2088 if not hasattr(self,"thisown"): self.thisown = 0
2089 self.__class__ = MemoryFSHandler
54f9ee45 2090_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
d14a1e28 2091
e811c8ce 2092def MemoryFSHandler_RemoveFile(*args, **kwargs):
196addbf 2093 """MemoryFSHandler_RemoveFile(String filename)"""
54f9ee45 2094 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28 2095
bcd0d7b6
RD
2096IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2097IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2098IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d14a1e28
RD
2099#---------------------------------------------------------------------------
2100
2101class ImageHandler(Object):
27fb7603
RD
2102 """
2103 This is the base class for implementing image file loading/saving, and
2104 image creation from data. It is used within `wx.Image` and is not
2105 normally seen by the application.
2106 """
d14a1e28
RD
2107 def __init__(self): raise RuntimeError, "No constructor defined"
2108 def __repr__(self):
2109 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 2110 def GetName(*args, **kwargs):
a95a7133 2111 """GetName(self) -> String"""
54f9ee45 2112 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
2113
2114 def GetExtension(*args, **kwargs):
a95a7133 2115 """GetExtension(self) -> String"""
54f9ee45 2116 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
2117
2118 def GetType(*args, **kwargs):
a95a7133 2119 """GetType(self) -> long"""
54f9ee45 2120 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
2121
2122 def GetMimeType(*args, **kwargs):
a95a7133 2123 """GetMimeType(self) -> String"""
54f9ee45 2124 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
2125
2126 def CanRead(*args, **kwargs):
a95a7133 2127 """CanRead(self, String name) -> bool"""
54f9ee45 2128 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce
RD
2129
2130 def SetName(*args, **kwargs):
a95a7133 2131 """SetName(self, String name)"""
54f9ee45 2132 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
2133
2134 def SetExtension(*args, **kwargs):
a95a7133 2135 """SetExtension(self, String extension)"""
54f9ee45 2136 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
2137
2138 def SetType(*args, **kwargs):
a95a7133 2139 """SetType(self, long type)"""
54f9ee45 2140 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
2141
2142 def SetMimeType(*args, **kwargs):
a95a7133 2143 """SetMimeType(self, String mimetype)"""
54f9ee45 2144 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 2145
d14a1e28
RD
2146
2147class ImageHandlerPtr(ImageHandler):
2148 def __init__(self, this):
2149 self.this = this
2150 if not hasattr(self,"thisown"): self.thisown = 0
2151 self.__class__ = ImageHandler
54f9ee45 2152_core_.ImageHandler_swigregister(ImageHandlerPtr)
d14a1e28 2153
943e8dfd
RD
2154class PyImageHandler(ImageHandler):
2155 """
2156 This is the base class for implementing image file loading/saving, and
2157 image creation from data, all written in Python. To create a custom
2158 image handler derive a new class from wx.PyImageHandler and provide
2159 the following methods::
2160
2161 def DoCanRead(self, stream) --> bool
2162 '''Check if this handler can read the image on the stream'''
2163
2164 def LoadFile(self, image, stream, verbose, index) --> bool
2165 '''Load image data from the stream and load it into image.'''
2166
2167 def SaveFile(self, image, stream, verbose) --> bool
2168 '''Save the iamge data in image to the stream using
2169 this handler's image file format.'''
2170
2171 def GetImageCount(self, stream) --> int
2172 '''If this image format can hold more than one image,
2173 how many does the image on the stream have?'''
2174
2175 To activate your handler create an instance of it and pass it to
2176 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2177 `SetExtension` from your constructor.
2178
2179 """
2180 def __repr__(self):
2181 return "<%s.%s; proxy of C++ wxPyImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2182 def __init__(self, *args, **kwargs):
2183 """
2184 __init__(self) -> PyImageHandler
2185
2186 This is the base class for implementing image file loading/saving, and
2187 image creation from data, all written in Python. To create a custom
2188 image handler derive a new class from wx.PyImageHandler and provide
2189 the following methods::
2190
2191 def DoCanRead(self, stream) --> bool
2192 '''Check if this handler can read the image on the stream'''
2193
2194 def LoadFile(self, image, stream, verbose, index) --> bool
2195 '''Load image data from the stream and load it into image.'''
2196
2197 def SaveFile(self, image, stream, verbose) --> bool
2198 '''Save the iamge data in image to the stream using
2199 this handler's image file format.'''
2200
2201 def GetImageCount(self, stream) --> int
2202 '''If this image format can hold more than one image,
2203 how many does the image on the stream have?'''
2204
2205 To activate your handler create an instance of it and pass it to
2206 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2207 `SetExtension` from your constructor.
2208
2209 """
2210 newobj = _core_.new_PyImageHandler(*args, **kwargs)
2211 self.this = newobj.this
2212 self.thisown = 1
2213 del newobj.thisown
2214 self._SetSelf(self)
2215
2216 def _SetSelf(*args, **kwargs):
2217 """_SetSelf(self, PyObject self)"""
2218 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2219
2220
2221class PyImageHandlerPtr(PyImageHandler):
2222 def __init__(self, this):
2223 self.this = this
2224 if not hasattr(self,"thisown"): self.thisown = 0
2225 self.__class__ = PyImageHandler
2226_core_.PyImageHandler_swigregister(PyImageHandlerPtr)
2227
d14a1e28 2228class ImageHistogram(object):
093d3ff1 2229 """Proxy of C++ ImageHistogram class"""
e811c8ce
RD
2230 def __repr__(self):
2231 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2232 def __init__(self, *args, **kwargs):
a95a7133 2233 """__init__(self) -> ImageHistogram"""
54f9ee45 2234 newobj = _core_.new_ImageHistogram(*args, **kwargs)
d14a1e28
RD
2235 self.this = newobj.this
2236 self.thisown = 1
2237 del newobj.thisown
e811c8ce 2238 def MakeKey(*args, **kwargs):
0df68c9f 2239 """
7a27cf7c 2240 MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2241
0df68c9f
RD
2242 Get the key in the histogram for the given RGB values
2243 """
54f9ee45 2244 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2245
2246 MakeKey = staticmethod(MakeKey)
2247 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2248 """
2249 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2250
2251 Find first colour that is not used in the image and has higher RGB
2252 values than startR, startG, startB. Returns a tuple consisting of a
2253 success flag and rgb values.
2254 """
54f9ee45 2255 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2256
f1cbd8fa
RD
2257 def GetCount(*args, **kwargs):
2258 """
2259 GetCount(self, unsigned long key) -> unsigned long
2260
2261 Returns the pixel count for the given key. Use `MakeKey` to create a
2262 key value from a RGB tripple.
2263 """
2264 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2265
2266 def GetCountRGB(*args, **kwargs):
2267 """
7a27cf7c 2268 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2269
2270 Returns the pixel count for the given RGB values.
2271 """
2272 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2273
2274 def GetCountColour(*args, **kwargs):
2275 """
2276 GetCountColour(self, Colour colour) -> unsigned long
2277
2278 Returns the pixel count for the given `wx.Colour` value.
2279 """
2280 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2281
d14a1e28
RD
2282
2283class ImageHistogramPtr(ImageHistogram):
2284 def __init__(self, this):
2285 self.this = this
2286 if not hasattr(self,"thisown"): self.thisown = 0
2287 self.__class__ = ImageHistogram
54f9ee45 2288_core_.ImageHistogram_swigregister(ImageHistogramPtr)
d14a1e28 2289
e811c8ce 2290def ImageHistogram_MakeKey(*args, **kwargs):
0df68c9f 2291 """
7a27cf7c 2292 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2293
0df68c9f
RD
2294 Get the key in the histogram for the given RGB values
2295 """
54f9ee45 2296 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28 2297
943e8dfd
RD
2298class Image_RGBValue(object):
2299 """
2300 An object that contains values for red, green and blue which represent
2301 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2302 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2303 color space.
2304 """
2305 def __repr__(self):
2306 return "<%s.%s; proxy of C++ wxImage_RGBValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2307 def __init__(self, *args, **kwargs):
2308 """
2309 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2310
2311 Constructor.
2312 """
2313 newobj = _core_.new_Image_RGBValue(*args, **kwargs)
2314 self.this = newobj.this
2315 self.thisown = 1
2316 del newobj.thisown
2317 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2318 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2319 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2320
2321class Image_RGBValuePtr(Image_RGBValue):
2322 def __init__(self, this):
2323 self.this = this
2324 if not hasattr(self,"thisown"): self.thisown = 0
2325 self.__class__ = Image_RGBValue
2326_core_.Image_RGBValue_swigregister(Image_RGBValuePtr)
2327
2328class Image_HSVValue(object):
2329 """
2330 An object that contains values for hue, saturation and value which
2331 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2332 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2333 color space.
2334 """
2335 def __repr__(self):
2336 return "<%s.%s; proxy of C++ wxImage_HSVValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2337 def __init__(self, *args, **kwargs):
2338 """
2339 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2340
2341 Constructor.
2342 """
2343 newobj = _core_.new_Image_HSVValue(*args, **kwargs)
2344 self.this = newobj.this
2345 self.thisown = 1
2346 del newobj.thisown
2347 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2348 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2349 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2350
2351class Image_HSVValuePtr(Image_HSVValue):
2352 def __init__(self, this):
2353 self.this = this
2354 if not hasattr(self,"thisown"): self.thisown = 0
2355 self.__class__ = Image_HSVValue
2356_core_.Image_HSVValue_swigregister(Image_HSVValuePtr)
2357
d14a1e28 2358class Image(Object):
7a27cf7c
RD
2359 """
2360 A platform-independent image class. An image can be created from
2361 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2362 variety of formats. Functions are available to set and get image
2363 bits, so it can be used for basic image manipulation.
2364
2365 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2366 platform-specific `wx.Bitmap` object must be created from it using the
2367 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2368 device context, using `wx.DC.DrawBitmap`.
2369
2370 One colour value of the image may be used as a mask colour which will
2371 lead to the automatic creation of a `wx.Mask` object associated to the
2372 bitmap object.
2373
2374 wx.Image supports alpha channel data, that is in addition to a byte
2375 for the red, green and blue colour components for each pixel it also
2376 stores a byte representing the pixel opacity. An alpha value of 0
2377 corresponds to a transparent pixel (null opacity) while a value of 255
2378 means that the pixel is 100% opaque.
2379
2380 Unlike RGB data, not all images have an alpha channel and before using
2381 `GetAlpha` you should check if this image contains an alpha channel
2382 with `HasAlpha`. Note that currently only images loaded from PNG files
2383 with transparency information will have an alpha channel.
2384 """
e811c8ce
RD
2385 def __repr__(self):
2386 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2387 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2388 """
2389 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2390
2391 Loads an image from a file.
2392 """
54f9ee45 2393 newobj = _core_.new_Image(*args, **kwargs)
d14a1e28
RD
2394 self.this = newobj.this
2395 self.thisown = 1
2396 del newobj.thisown
54f9ee45 2397 def __del__(self, destroy=_core_.delete_Image):
a95a7133 2398 """__del__(self)"""
d14a1e28
RD
2399 try:
2400 if self.thisown: destroy(self)
2401 except: pass
e811c8ce
RD
2402
2403 def Create(*args, **kwargs):
7a27cf7c
RD
2404 """
2405 Create(self, int width, int height, bool clear=True)
2406
2407 Creates a fresh image. If clear is ``True``, the new image will be
2408 initialized to black. Otherwise, the image data will be uninitialized.
2409 """
54f9ee45 2410 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2411
2412 def Destroy(*args, **kwargs):
0df68c9f 2413 """
a95a7133 2414 Destroy(self)
e811c8ce 2415
7a27cf7c 2416 Destroys the image data.
0df68c9f 2417 """
54f9ee45 2418 return _core_.Image_Destroy(*args, **kwargs)
e811c8ce
RD
2419
2420 def Scale(*args, **kwargs):
7a27cf7c
RD
2421 """
2422 Scale(self, int width, int height) -> Image
2423
2424 Returns a scaled version of the image. This is also useful for scaling
2425 bitmaps in general as the only other way to scale bitmaps is to blit a
2426 `wx.MemoryDC` into another `wx.MemoryDC`.
2427 """
54f9ee45 2428 return _core_.Image_Scale(*args, **kwargs)
e811c8ce
RD
2429
2430 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2431 """
2432 ShrinkBy(self, int xFactor, int yFactor) -> Image
2433
2434 Return a version of the image scaled smaller by the given factors.
2435 """
54f9ee45 2436 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2437
2438 def Rescale(*args, **kwargs):
7a27cf7c
RD
2439 """
2440 Rescale(self, int width, int height) -> Image
2441
2442 Changes the size of the image in-place by scaling it: after a call to
2443 this function, the image will have the given width and height.
2444
2445 Returns the (modified) image itself.
2446 """
54f9ee45 2447 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce 2448
aff4cc5c 2449 def Resize(*args, **kwargs):
7a27cf7c
RD
2450 """
2451 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2452
2453 Changes the size of the image in-place without scaling it, by adding
2454 either a border with the given colour or cropping as necessary. The
2455 image is pasted into a new image with the given size and background
2456 colour at the position pos relative to the upper left of the new
2457 image. If red = green = blue = -1 then use either the current mask
2458 colour if set or find, use, and set a suitable mask colour for any
2459 newly exposed areas.
2460
2461 Returns the (modified) image itself.
2462 """
aff4cc5c
RD
2463 return _core_.Image_Resize(*args, **kwargs)
2464
e811c8ce 2465 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2466 """
2467 SetRGB(self, int x, int y, byte r, byte g, byte b)
2468
2469 Sets the pixel at the given coordinate. This routine performs
2470 bounds-checks for the coordinate so it can be considered a safe way to
2471 manipulate the data, but in some cases this might be too slow so that
2472 the data will have to be set directly. In that case you will have to
2473 get access to the image data using the `GetData` method.
2474 """
54f9ee45 2475 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce 2476
aff4cc5c 2477 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2478 """
2479 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2480
2481 Sets the colour of the pixels within the given rectangle. This routine
2482 performs bounds-checks for the rectangle so it can be considered a
2483 safe way to manipulate the data.
2484 """
aff4cc5c
RD
2485 return _core_.Image_SetRGBRect(*args, **kwargs)
2486
e811c8ce 2487 def GetRed(*args, **kwargs):
7a27cf7c
RD
2488 """
2489 GetRed(self, int x, int y) -> byte
2490
2491 Returns the red intensity at the given coordinate.
2492 """
54f9ee45 2493 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2494
2495 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2496 """
2497 GetGreen(self, int x, int y) -> byte
2498
2499 Returns the green intensity at the given coordinate.
2500 """
54f9ee45 2501 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2502
2503 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2504 """
2505 GetBlue(self, int x, int y) -> byte
2506
2507 Returns the blue intensity at the given coordinate.
2508 """
54f9ee45 2509 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2510
2511 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2512 """
2513 SetAlpha(self, int x, int y, byte alpha)
2514
2515 Sets the alpha value for the given pixel. This function should only be
2516 called if the image has alpha channel data, use `HasAlpha` to check
2517 for this.
2518 """
54f9ee45 2519 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2520
2521 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2522 """
2523 GetAlpha(self, int x, int y) -> byte
2524
2525 Returns the alpha value for the given pixel. This function may only be
2526 called for the images with alpha channel, use `HasAlpha` to check for
2527 this.
2528
2529 The returned value is the *opacity* of the image, i.e. the value of 0
2530 corresponds to the fully transparent pixels while the value of 255 to
2531 the fully opaque pixels.
2532 """
54f9ee45 2533 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2534
2535 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2536 """
2537 HasAlpha(self) -> bool
2538
2539 Returns true if this image has alpha channel, false otherwise.
2540 """
54f9ee45 2541 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce 2542
68350608
RD
2543 def InitAlpha(*args, **kwargs):
2544 """
2545 InitAlpha(self)
2546
2547 Initializes the image alpha channel data. It is an error to call it if
2548 the image already has alpha data. If it doesn't, alpha data will be by
2549 default initialized to all pixels being fully opaque. But if the image
2550 has a a mask colour, all mask pixels will be completely transparent.
2551 """
2552 return _core_.Image_InitAlpha(*args, **kwargs)
2553
bcd0d7b6
RD
2554 def IsTransparent(*args, **kwargs):
2555 """
7a27cf7c 2556 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
bcd0d7b6 2557
7a27cf7c
RD
2558 Returns ``True`` if this pixel is masked or has an alpha value less
2559 than the spcified threshold.
bcd0d7b6
RD
2560 """
2561 return _core_.Image_IsTransparent(*args, **kwargs)
2562
e811c8ce 2563 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2564 """
2565 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2566
2567 Find first colour that is not used in the image and has higher RGB
2568 values than startR, startG, startB. Returns a tuple consisting of a
2569 success flag and rgb values.
2570 """
54f9ee45 2571 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2572
4cf4100f
RD
2573 def ConvertAlphaToMask(*args, **kwargs):
2574 """
bcd0d7b6 2575 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2576
7a27cf7c
RD
2577 If the image has alpha channel, this method converts it to mask. All
2578 pixels with alpha value less than ``threshold`` are replaced with the
2579 mask colour and the alpha channel is removed. The mask colour is
2580 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2581
2582 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2583 nothing.
2584 """
2585 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2586
8fb0e70a
RD
2587 def ConvertColourToAlpha(*args, **kwargs):
2588 """
7a27cf7c 2589 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2590
2591 This method converts an image where the original alpha information is
2592 only available as a shades of a colour (actually shades of grey)
2593 typically when you draw anti-aliased text into a bitmap. The DC
2594 drawing routines draw grey values on the black background although
2595 they actually mean to draw white with differnt alpha values. This
2596 method reverses it, assuming a black (!) background and white text.
2597 The method will then fill up the whole image with the colour given.
2598 """
2599 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2600
e811c8ce 2601 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2602 """
2603 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2604
2605 Sets the image's mask so that the pixels that have RGB value of
2606 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2607 by first finding an unused colour in the image, setting this colour as
2608 the mask colour and then using this colour to draw all pixels in the
2609 image who corresponding pixel in mask has given RGB value.
2610
2611 Returns ``False`` if ``mask`` does not have same dimensions as the
2612 image or if there is no unused colour left. Returns ``True`` if the
2613 mask was successfully applied.
2614
2615 Note that this method involves computing the histogram, which is
2616 computationally intensive operation.
2617 """
54f9ee45 2618 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2619
2620 def CanRead(*args, **kwargs):
7a27cf7c
RD
2621 """
2622 CanRead(String filename) -> bool
2623
2624 Returns True if the image handlers can read this file.
2625 """
54f9ee45 2626 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2627
2628 CanRead = staticmethod(CanRead)
2629 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2630 """
2631 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2632
2633 If the image file contains more than one image and the image handler
2634 is capable of retrieving these individually, this function will return
2635 the number of available images.
2636 """
54f9ee45 2637 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2638
2639 GetImageCount = staticmethod(GetImageCount)
2640 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2641 """
2642 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2643
2644 Loads an image from a file. If no handler type is provided, the
2645 library will try to autodetect the format.
2646 """
54f9ee45 2647 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2648
2649 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2650 """
2651 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2652
2653 Loads an image from a file, specifying the image type with a MIME type
2654 string.
2655 """
54f9ee45 2656 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2657
2658 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2659 """
2660 SaveFile(self, String name, int type) -> bool
2661
2662 Saves an image in the named file.
2663 """
54f9ee45 2664 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2665
2666 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2667 """
2668 SaveMimeFile(self, String name, String mimetype) -> bool
2669
2670 Saves an image in the named file.
2671 """
54f9ee45 2672 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2673
2674 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2675 """
2676 CanReadStream(InputStream stream) -> bool
2677
2678 Returns True if the image handlers can read an image file from the
2679 data currently on the input stream, or a readable Python file-like
2680 object.
2681 """
54f9ee45 2682 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2683
2684 CanReadStream = staticmethod(CanReadStream)
2685 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2686 """
2687 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2688
2689 Loads an image from an input stream or a readable Python file-like
2690 object. If no handler type is provided, the library will try to
2691 autodetect the format.
2692 """
54f9ee45 2693 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2694
2695 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2696 """
2697 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2698
2699 Loads an image from an input stream or a readable Python file-like
2700 object, using a MIME type string to specify the image file format.
2701 """
54f9ee45 2702 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce
RD
2703
2704 def Ok(*args, **kwargs):
7a27cf7c
RD
2705 """
2706 Ok(self) -> bool
2707
2708 Returns true if image data is present.
2709 """
54f9ee45 2710 return _core_.Image_Ok(*args, **kwargs)
e811c8ce
RD
2711
2712 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2713 """
2714 GetWidth(self) -> int
2715
2716 Gets the width of the image in pixels.
2717 """
54f9ee45 2718 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2719
2720 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2721 """
2722 GetHeight(self) -> int
2723
2724 Gets the height of the image in pixels.
2725 """
54f9ee45 2726 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2727
b2df227b 2728 def GetSize(*args, **kwargs):
7a27cf7c
RD
2729 """
2730 GetSize(self) -> Size
2731
2732 Returns the size of the image in pixels.
2733 """
54f9ee45 2734 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2735
e811c8ce 2736 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2737 """
2738 GetSubImage(self, Rect rect) -> Image
2739
2740 Returns a sub image of the current one as long as the rect belongs
2741 entirely to the image.
2742 """
54f9ee45 2743 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce 2744
aff4cc5c 2745 def Size(*args, **kwargs):
7a27cf7c
RD
2746 """
2747 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2748
2749 Returns a resized version of this image without scaling it by adding
2750 either a border with the given colour or cropping as necessary. The
2751 image is pasted into a new image with the given size and background
2752 colour at the position ``pos`` relative to the upper left of the new
2753 image. If red = green = blue = -1 then use either the current mask
2754 colour if set or find, use, and set a suitable mask colour for any
2755 newly exposed areas.
2756 """
aff4cc5c
RD
2757 return _core_.Image_Size(*args, **kwargs)
2758
e811c8ce 2759 def Copy(*args, **kwargs):
7a27cf7c
RD
2760 """
2761 Copy(self) -> Image
2762
2763 Returns an identical copy of the image.
2764 """
54f9ee45 2765 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2766
2767 def Paste(*args, **kwargs):
7a27cf7c
RD
2768 """
2769 Paste(self, Image image, int x, int y)
2770
2771 Pastes ``image`` into this instance and takes care of the mask colour
2772 and any out of bounds problems.
2773 """
54f9ee45 2774 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2775
2776 def GetData(*args, **kwargs):
61d07ac7
RD
2777 """
2778 GetData(self) -> PyObject
2779
2780 Returns a string containing a copy of the RGB bytes of the image.
2781 """
54f9ee45 2782 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2783
2784 def SetData(*args, **kwargs):
61d07ac7
RD
2785 """
2786 SetData(self, buffer data)
2787
2788 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2789 either a string or a buffer object holding the data and the length of
2790 the data must be width*height*3.
2791 """
54f9ee45 2792 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
2793
2794 def GetDataBuffer(*args, **kwargs):
61d07ac7
RD
2795 """
2796 GetDataBuffer(self) -> PyObject
2797
2798 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2799 image data buffer inside the wx.Image. You need to ensure that you do
2800 not use this buffer object after the image has been destroyed.
61d07ac7 2801 """
54f9ee45 2802 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
2803
2804 def SetDataBuffer(*args, **kwargs):
61d07ac7
RD
2805 """
2806 SetDataBuffer(self, buffer data)
2807
2808 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2809 object. This can save making an extra copy of the data but you must
2810 ensure that the buffer object lives longer than the wx.Image does.
61d07ac7 2811 """
54f9ee45 2812 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
2813
2814 def GetAlphaData(*args, **kwargs):
61d07ac7
RD
2815 """
2816 GetAlphaData(self) -> PyObject
2817
2818 Returns a string containing a copy of the alpha bytes of the image.
2819 """
54f9ee45 2820 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
2821
2822 def SetAlphaData(*args, **kwargs):
61d07ac7
RD
2823 """
2824 SetAlphaData(self, buffer alpha)
2825
2826 Resets the Image's alpha data from a buffer of bytes. Accepts either
2827 a string or a buffer object holding the data and the length of the
2828 data must be width*height.
2829 """
54f9ee45 2830 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
2831
2832 def GetAlphaBuffer(*args, **kwargs):
a95a7133 2833 """GetAlphaBuffer(self) -> PyObject"""
54f9ee45 2834 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2835
2836 def SetAlphaBuffer(*args, **kwargs):
61d07ac7 2837 """SetAlphaBuffer(self, buffer alpha)"""
54f9ee45 2838 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2839
2840 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2841 """
2842 SetMaskColour(self, byte r, byte g, byte b)
2843
2844 Sets the mask colour for this image (and tells the image to use the
2845 mask).
2846 """
54f9ee45 2847 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce 2848
aff4cc5c
RD
2849 def GetOrFindMaskColour(*args, **kwargs):
2850 """
2851 GetOrFindMaskColour() -> (r,g,b)
2852
2853 Get the current mask colour or find a suitable colour.
2854 """
2855 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2856
e811c8ce 2857 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2858 """
2859 GetMaskRed(self) -> byte
2860
2861 Gets the red component of the mask colour.
2862 """
54f9ee45 2863 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
2864
2865 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2866 """
2867 GetMaskGreen(self) -> byte
2868
2869 Gets the green component of the mask colour.
2870 """
54f9ee45 2871 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
2872
2873 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2874 """
2875 GetMaskBlue(self) -> byte
2876
2877 Gets the blue component of the mask colour.
2878 """
54f9ee45 2879 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
2880
2881 def SetMask(*args, **kwargs):
7a27cf7c
RD
2882 """
2883 SetMask(self, bool mask=True)
2884
2885 Specifies whether there is a mask or not. The area of the mask is
2886 determined by the current mask colour.
2887 """
54f9ee45 2888 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
2889
2890 def HasMask(*args, **kwargs):
7a27cf7c
RD
2891 """
2892 HasMask(self) -> bool
2893
2894 Returns ``True`` if there is a mask active, ``False`` otherwise.
2895 """
54f9ee45 2896 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
2897
2898 def Rotate(*args, **kwargs):
0df68c9f 2899 """
a95a7133 2900 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f 2901 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2902
2903 Rotates the image about the given point, by ``angle`` radians. Passing
2904 ``True`` to ``interpolating`` results in better image quality, but is
2905 slower. If the image has a mask, then the mask colour is used for the
2906 uncovered pixels in the rotated image background. Otherwise, black
2907 will be used as the fill colour.
2908
2909 Returns the rotated image, leaving this image intact.
0df68c9f 2910 """
54f9ee45 2911 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
2912
2913 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2914 """
2915 Rotate90(self, bool clockwise=True) -> Image
2916
2917 Returns a copy of the image rotated 90 degrees in the direction
2918 indicated by ``clockwise``.
2919 """
54f9ee45 2920 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
2921
2922 def Mirror(*args, **kwargs):
7a27cf7c
RD
2923 """
2924 Mirror(self, bool horizontally=True) -> Image
2925
2926 Returns a mirrored copy of the image. The parameter ``horizontally``
2927 indicates the orientation.
2928 """
54f9ee45 2929 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
2930
2931 def Replace(*args, **kwargs):
0df68c9f 2932 """
7a27cf7c
RD
2933 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2934
2935 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2936 ``(r2,g2,b2)``.
0df68c9f 2937 """
54f9ee45 2938 return _core_.Image_Replace(*args, **kwargs)
e811c8ce
RD
2939
2940 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2941 """
2942 ConvertToMono(self, byte r, byte g, byte b) -> Image
2943
2944 Returns monochromatic version of the image. The returned image has
2945 white colour where the original has ``(r,g,b)`` colour and black
2946 colour everywhere else.
2947 """
54f9ee45 2948 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
2949
2950 def SetOption(*args, **kwargs):
7a27cf7c
RD
2951 """
2952 SetOption(self, String name, String value)
2953
2954 Sets an image handler defined option. For example, when saving as a
2955 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2956 number between 0 and 100 (0 is terrible, 100 is very good).
2957 """
54f9ee45 2958 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
2959
2960 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2961 """
2962 SetOptionInt(self, String name, int value)
2963
2964 Sets an image option as an integer.
2965 """
54f9ee45 2966 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
2967
2968 def GetOption(*args, **kwargs):
7a27cf7c
RD
2969 """
2970 GetOption(self, String name) -> String
2971
2972 Gets the value of an image handler option.
2973 """
54f9ee45 2974 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
2975
2976 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2977 """
2978 GetOptionInt(self, String name) -> int
2979
2980 Gets the value of an image handler option as an integer. If the given
2981 option is not present, the function returns 0.
2982 """
54f9ee45 2983 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
2984
2985 def HasOption(*args, **kwargs):
7a27cf7c
RD
2986 """
2987 HasOption(self, String name) -> bool
2988
2989 Returns true if the given option is present.
2990 """
54f9ee45 2991 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
2992
2993 def CountColours(*args, **kwargs):
a95a7133 2994 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 2995 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
2996
2997 def ComputeHistogram(*args, **kwargs):
a95a7133 2998 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 2999 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
3000
3001 def AddHandler(*args, **kwargs):
66c033b4 3002 """AddHandler(ImageHandler handler)"""
54f9ee45 3003 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
3004
3005 AddHandler = staticmethod(AddHandler)
3006 def InsertHandler(*args, **kwargs):
66c033b4 3007 """InsertHandler(ImageHandler handler)"""
54f9ee45 3008 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
3009
3010 InsertHandler = staticmethod(InsertHandler)
3011 def RemoveHandler(*args, **kwargs):
66c033b4 3012 """RemoveHandler(String name) -> bool"""
54f9ee45 3013 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
3014
3015 RemoveHandler = staticmethod(RemoveHandler)
3016 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3017 """
3018 GetImageExtWildcard() -> String
3019
3020 Iterates all registered wxImageHandler objects, and returns a string
3021 containing file extension masks suitable for passing to file open/save
3022 dialog boxes.
3023 """
54f9ee45 3024 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
3025
3026 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3027 def ConvertToBitmap(*args, **kwargs):
1fbf26be 3028 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 3029 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
3030
3031 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3032 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
54f9ee45 3033 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce 3034
943e8dfd
RD
3035 def RotateHue(*args, **kwargs):
3036 """
3037 RotateHue(self, double angle)
3038
3039 Rotates the hue of each pixel of the image. Hue is a double in the
3040 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3041 """
3042 return _core_.Image_RotateHue(*args, **kwargs)
3043
3044 def RGBtoHSV(*args, **kwargs):
3045 """
3046 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3047
3048 Converts a color in RGB color space to HSV color space.
3049 """
3050 return _core_.Image_RGBtoHSV(*args, **kwargs)
3051
3052 RGBtoHSV = staticmethod(RGBtoHSV)
3053 def HSVtoRGB(*args, **kwargs):
3054 """
3055 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3056
3057 Converts a color in HSV color space to RGB color space.
3058 """
3059 return _core_.Image_HSVtoRGB(*args, **kwargs)
3060
3061 HSVtoRGB = staticmethod(HSVtoRGB)
e811c8ce 3062 def __nonzero__(self): return self.Ok()
d14a1e28
RD
3063
3064class ImagePtr(Image):
3065 def __init__(self, this):
3066 self.this = this
3067 if not hasattr(self,"thisown"): self.thisown = 0
3068 self.__class__ = Image
54f9ee45 3069_core_.Image_swigregister(ImagePtr)
d14a1e28
RD
3070
3071def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3072 """
3073 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3074
3075 Loads an image from a file, using a MIME type string (such as
3076 'image/jpeg') to specify image type.
3077 """
54f9ee45 3078 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
3079 val.thisown = 1
3080 return val
3081
3082def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3083 """
3084 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3085
3086 Loads an image from an input stream, or any readable Python file-like
3087 object.
3088 """
54f9ee45 3089 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
3090 val.thisown = 1
3091 return val
3092
3093def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3094 """
3095 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3096
3097 Loads an image from an input stream, or any readable Python file-like
3098 object, specifying the image format with a MIME type string.
3099 """
54f9ee45 3100 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
3101 val.thisown = 1
3102 return val
3103
66c033b4 3104def EmptyImage(*args, **kwargs):
61d07ac7
RD
3105 """
3106 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3107
3108 Construct an empty image of a given size, optionally setting all
3109 pixels to black.
3110 """
66c033b4 3111 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
3112 val.thisown = 1
3113 return val
3114
3115def ImageFromBitmap(*args, **kwargs):
61d07ac7
RD
3116 """
3117 ImageFromBitmap(Bitmap bitmap) -> Image
3118
3119 Construct an Image from a `wx.Bitmap`.
3120 """
54f9ee45 3121 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
3122 val.thisown = 1
3123 return val
3124
3125def ImageFromData(*args, **kwargs):
61d07ac7
RD
3126 """
3127 ImageFromData(int width, int height, buffer data) -> Image
3128
3129 Construct an Image from a buffer of RGB bytes. Accepts either a
3130 string or a buffer object holding the data and the length of the data
3131 must be width*height*3.
3132 """
54f9ee45 3133 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
3134 val.thisown = 1
3135 return val
3136
1823fbb4 3137def ImageFromDataWithAlpha(*args, **kwargs):
61d07ac7
RD
3138 """
3139 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3140
3141 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3142 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3143 length of the data must be width*height*3 bytes, and the length of the
3144 alpha data must be width*height bytes.
61d07ac7 3145 """
1823fbb4
RD
3146 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3147 val.thisown = 1
3148 return val
3149
e811c8ce 3150def Image_CanRead(*args, **kwargs):
7a27cf7c
RD
3151 """
3152 Image_CanRead(String filename) -> bool
3153
3154 Returns True if the image handlers can read this file.
3155 """
54f9ee45 3156 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 3157
e811c8ce 3158def Image_GetImageCount(*args, **kwargs):
7a27cf7c
RD
3159 """
3160 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3161
3162 If the image file contains more than one image and the image handler
3163 is capable of retrieving these individually, this function will return
3164 the number of available images.
3165 """
54f9ee45 3166 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 3167
e811c8ce 3168def Image_CanReadStream(*args, **kwargs):
7a27cf7c
RD
3169 """
3170 Image_CanReadStream(InputStream stream) -> bool
3171
3172 Returns True if the image handlers can read an image file from the
3173 data currently on the input stream, or a readable Python file-like
3174 object.
3175 """
54f9ee45 3176 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 3177
e811c8ce
RD
3178def Image_AddHandler(*args, **kwargs):
3179 """Image_AddHandler(ImageHandler handler)"""
54f9ee45 3180 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 3181
e811c8ce
RD
3182def Image_InsertHandler(*args, **kwargs):
3183 """Image_InsertHandler(ImageHandler handler)"""
54f9ee45 3184 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 3185
e811c8ce 3186def Image_RemoveHandler(*args, **kwargs):
196addbf 3187 """Image_RemoveHandler(String name) -> bool"""
54f9ee45 3188 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 3189
e811c8ce 3190def Image_GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3191 """
3192 Image_GetImageExtWildcard() -> String
3193
3194 Iterates all registered wxImageHandler objects, and returns a string
3195 containing file extension masks suitable for passing to file open/save
3196 dialog boxes.
3197 """
54f9ee45 3198 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d14a1e28 3199
943e8dfd
RD
3200def Image_RGBtoHSV(*args, **kwargs):
3201 """
3202 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3203
3204 Converts a color in RGB color space to HSV color space.
3205 """
3206 return _core_.Image_RGBtoHSV(*args, **kwargs)
3207
3208def Image_HSVtoRGB(*args, **kwargs):
3209 """
3210 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3211
3212 Converts a color in HSV color space to RGB color space.
3213 """
3214 return _core_.Image_HSVtoRGB(*args, **kwargs)
3215
5e4ca4a8
RD
3216def InitAllImageHandlers():
3217 """
3218 The former functionality of InitAllImageHanders is now done internal to
3219 the _core_ extension module and so this function has become a simple NOP.
3220 """
3221 pass
d14a1e28 3222
54f9ee45
RD
3223IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3224IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3225PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3226PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3227PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
54f9ee45
RD
3228BMP_24BPP = _core_.BMP_24BPP
3229BMP_8BPP = _core_.BMP_8BPP
3230BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3231BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3232BMP_8BPP_RED = _core_.BMP_8BPP_RED
3233BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3234BMP_4BPP = _core_.BMP_4BPP
3235BMP_1BPP = _core_.BMP_1BPP
3236BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 3237class BMPHandler(ImageHandler):
27fb7603 3238 """A `wx.ImageHandler` for \*.bmp bitmap files."""
e811c8ce
RD
3239 def __repr__(self):
3240 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3241 def __init__(self, *args, **kwargs):
27fb7603
RD
3242 """
3243 __init__(self) -> BMPHandler
3244
3245 A `wx.ImageHandler` for \*.bmp bitmap files.
3246 """
54f9ee45 3247 newobj = _core_.new_BMPHandler(*args, **kwargs)
d14a1e28
RD
3248 self.this = newobj.this
3249 self.thisown = 1
3250 del newobj.thisown
d14a1e28
RD
3251
3252class BMPHandlerPtr(BMPHandler):
3253 def __init__(self, this):
3254 self.this = this
3255 if not hasattr(self,"thisown"): self.thisown = 0
3256 self.__class__ = BMPHandler
54f9ee45 3257_core_.BMPHandler_swigregister(BMPHandlerPtr)
d14a1e28 3258NullImage = cvar.NullImage
0c243d93 3259IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d14a1e28
RD
3260IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3261IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3262IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3263IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
0c243d93
RD
3264IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3265IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d14a1e28 3266IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3267IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
0c243d93
RD
3268IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3269IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3270IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3271IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3272IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3273IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d14a1e28
RD
3274
3275class ICOHandler(BMPHandler):
27fb7603 3276 """A `wx.ImageHandler` for \*.ico icon files."""
e811c8ce
RD
3277 def __repr__(self):
3278 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3279 def __init__(self, *args, **kwargs):
27fb7603
RD
3280 """
3281 __init__(self) -> ICOHandler
3282
3283 A `wx.ImageHandler` for \*.ico icon files.
3284 """
54f9ee45 3285 newobj = _core_.new_ICOHandler(*args, **kwargs)
d14a1e28
RD
3286 self.this = newobj.this
3287 self.thisown = 1
3288 del newobj.thisown
d14a1e28
RD
3289
3290class ICOHandlerPtr(ICOHandler):
3291 def __init__(self, this):
3292 self.this = this
3293 if not hasattr(self,"thisown"): self.thisown = 0
3294 self.__class__ = ICOHandler
54f9ee45 3295_core_.ICOHandler_swigregister(ICOHandlerPtr)
d14a1e28
RD
3296
3297class CURHandler(ICOHandler):
27fb7603 3298 """A `wx.ImageHandler` for \*.cur cursor files."""
e811c8ce
RD
3299 def __repr__(self):
3300 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3301 def __init__(self, *args, **kwargs):
27fb7603
RD
3302 """
3303 __init__(self) -> CURHandler
3304
3305 A `wx.ImageHandler` for \*.cur cursor files.
3306 """
54f9ee45 3307 newobj = _core_.new_CURHandler(*args, **kwargs)
d14a1e28
RD
3308 self.this = newobj.this
3309 self.thisown = 1
3310 del newobj.thisown
d14a1e28
RD
3311
3312class CURHandlerPtr(CURHandler):
3313 def __init__(self, this):
3314 self.this = this
3315 if not hasattr(self,"thisown"): self.thisown = 0
3316 self.__class__ = CURHandler
54f9ee45 3317_core_.CURHandler_swigregister(CURHandlerPtr)
d14a1e28
RD
3318
3319class ANIHandler(CURHandler):
27fb7603 3320 """A `wx.ImageHandler` for \*.ani animated cursor files."""
e811c8ce
RD
3321 def __repr__(self):
3322 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3323 def __init__(self, *args, **kwargs):
27fb7603
RD
3324 """
3325 __init__(self) -> ANIHandler
3326
3327 A `wx.ImageHandler` for \*.ani animated cursor files.
3328 """
54f9ee45 3329 newobj = _core_.new_ANIHandler(*args, **kwargs)
d14a1e28
RD
3330 self.this = newobj.this
3331 self.thisown = 1
3332 del newobj.thisown
d14a1e28
RD
3333
3334class ANIHandlerPtr(ANIHandler):
3335 def __init__(self, this):
3336 self.this = this
3337 if not hasattr(self,"thisown"): self.thisown = 0
3338 self.__class__ = ANIHandler
54f9ee45 3339_core_.ANIHandler_swigregister(ANIHandlerPtr)
d14a1e28
RD
3340
3341class PNGHandler(ImageHandler):
27fb7603 3342 """A `wx.ImageHandler` for PNG image files."""
e811c8ce
RD
3343 def __repr__(self):
3344 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3345 def __init__(self, *args, **kwargs):
27fb7603
RD
3346 """
3347 __init__(self) -> PNGHandler
3348
3349 A `wx.ImageHandler` for PNG image files.
3350 """
54f9ee45 3351 newobj = _core_.new_PNGHandler(*args, **kwargs)
d14a1e28
RD
3352 self.this = newobj.this
3353 self.thisown = 1
3354 del newobj.thisown
d14a1e28
RD
3355
3356class PNGHandlerPtr(PNGHandler):
3357 def __init__(self, this):
3358 self.this = this
3359 if not hasattr(self,"thisown"): self.thisown = 0
3360 self.__class__ = PNGHandler
54f9ee45 3361_core_.PNGHandler_swigregister(PNGHandlerPtr)
d14a1e28
RD
3362
3363class GIFHandler(ImageHandler):
27fb7603 3364 """A `wx.ImageHandler` for GIF image files."""
e811c8ce
RD
3365 def __repr__(self):
3366 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3367 def __init__(self, *args, **kwargs):
27fb7603
RD
3368 """
3369 __init__(self) -> GIFHandler
3370
3371 A `wx.ImageHandler` for GIF image files.
3372 """
54f9ee45 3373 newobj = _core_.new_GIFHandler(*args, **kwargs)
d14a1e28
RD
3374 self.this = newobj.this
3375 self.thisown = 1
3376 del newobj.thisown
d14a1e28
RD
3377
3378class GIFHandlerPtr(GIFHandler):
3379 def __init__(self, this):
3380 self.this = this
3381 if not hasattr(self,"thisown"): self.thisown = 0
3382 self.__class__ = GIFHandler
54f9ee45 3383_core_.GIFHandler_swigregister(GIFHandlerPtr)
d14a1e28
RD
3384
3385class PCXHandler(ImageHandler):
27fb7603 3386 """A `wx.ImageHandler` for PCX imager files."""
e811c8ce
RD
3387 def __repr__(self):
3388 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3389 def __init__(self, *args, **kwargs):
27fb7603
RD
3390 """
3391 __init__(self) -> PCXHandler
3392
3393 A `wx.ImageHandler` for PCX imager files.
3394 """
54f9ee45 3395 newobj = _core_.new_PCXHandler(*args, **kwargs)
d14a1e28
RD
3396 self.this = newobj.this
3397 self.thisown = 1
3398 del newobj.thisown
d14a1e28
RD
3399
3400class PCXHandlerPtr(PCXHandler):
3401 def __init__(self, this):
3402 self.this = this
3403 if not hasattr(self,"thisown"): self.thisown = 0
3404 self.__class__ = PCXHandler
54f9ee45 3405_core_.PCXHandler_swigregister(PCXHandlerPtr)
d14a1e28
RD
3406
3407class JPEGHandler(ImageHandler):
27fb7603 3408 """A `wx.ImageHandler` for JPEG/JPG image files."""
e811c8ce
RD
3409 def __repr__(self):
3410 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3411 def __init__(self, *args, **kwargs):
27fb7603
RD
3412 """
3413 __init__(self) -> JPEGHandler
3414
3415 A `wx.ImageHandler` for JPEG/JPG image files.
3416 """
54f9ee45 3417 newobj = _core_.new_JPEGHandler(*args, **kwargs)
d14a1e28
RD
3418 self.this = newobj.this
3419 self.thisown = 1
3420 del newobj.thisown
d14a1e28
RD
3421
3422class JPEGHandlerPtr(JPEGHandler):
3423 def __init__(self, this):
3424 self.this = this
3425 if not hasattr(self,"thisown"): self.thisown = 0
3426 self.__class__ = JPEGHandler
54f9ee45 3427_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
d14a1e28
RD
3428
3429class PNMHandler(ImageHandler):
27fb7603 3430 """A `wx.ImageHandler` for PNM image files."""
e811c8ce
RD
3431 def __repr__(self):
3432 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3433 def __init__(self, *args, **kwargs):
27fb7603
RD
3434 """
3435 __init__(self) -> PNMHandler
3436
3437 A `wx.ImageHandler` for PNM image files.
3438 """
54f9ee45 3439 newobj = _core_.new_PNMHandler(*args, **kwargs)
d14a1e28
RD
3440 self.this = newobj.this
3441 self.thisown = 1
3442 del newobj.thisown
d14a1e28
RD
3443
3444class PNMHandlerPtr(PNMHandler):
3445 def __init__(self, this):
3446 self.this = this
3447 if not hasattr(self,"thisown"): self.thisown = 0
3448 self.__class__ = PNMHandler
54f9ee45 3449_core_.PNMHandler_swigregister(PNMHandlerPtr)
d14a1e28
RD
3450
3451class XPMHandler(ImageHandler):
27fb7603 3452 """A `wx.ImageHandler` for XPM image."""
e811c8ce
RD
3453 def __repr__(self):
3454 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3455 def __init__(self, *args, **kwargs):
27fb7603
RD
3456 """
3457 __init__(self) -> XPMHandler
3458
3459 A `wx.ImageHandler` for XPM image.
3460 """
54f9ee45 3461 newobj = _core_.new_XPMHandler(*args, **kwargs)
d14a1e28
RD
3462 self.this = newobj.this
3463 self.thisown = 1
3464 del newobj.thisown
d14a1e28
RD
3465
3466class XPMHandlerPtr(XPMHandler):
3467 def __init__(self, this):
3468 self.this = this
3469 if not hasattr(self,"thisown"): self.thisown = 0
3470 self.__class__ = XPMHandler
54f9ee45 3471_core_.XPMHandler_swigregister(XPMHandlerPtr)
d14a1e28
RD
3472
3473class TIFFHandler(ImageHandler):
27fb7603 3474 """A `wx.ImageHandler` for TIFF image files."""
e811c8ce
RD
3475 def __repr__(self):
3476 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3477 def __init__(self, *args, **kwargs):
27fb7603
RD
3478 """
3479 __init__(self) -> TIFFHandler
3480
3481 A `wx.ImageHandler` for TIFF image files.
3482 """
54f9ee45 3483 newobj = _core_.new_TIFFHandler(*args, **kwargs)
d14a1e28
RD
3484 self.this = newobj.this
3485 self.thisown = 1
3486 del newobj.thisown
d14a1e28
RD
3487
3488class TIFFHandlerPtr(TIFFHandler):
3489 def __init__(self, this):
3490 self.this = this
3491 if not hasattr(self,"thisown"): self.thisown = 0
3492 self.__class__ = TIFFHandler
54f9ee45 3493_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
d14a1e28 3494
c0de73ae
RD
3495QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3496QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3497class Quantize(object):
3498 """Performs quantization, or colour reduction, on a wxImage."""
3499 def __init__(self): raise RuntimeError, "No constructor defined"
3500 def __repr__(self):
3501 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3502 def Quantize(*args, **kwargs):
3503 """
3504 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3505
3506 Reduce the colours in the source image and put the result into the
3507 destination image, setting the palette in the destination if
3508 needed. Both images may be the same, to overwrite the source image.
3509 """
3510 return _core_.Quantize_Quantize(*args, **kwargs)
3511
3512 Quantize = staticmethod(Quantize)
3513
3514class QuantizePtr(Quantize):
3515 def __init__(self, this):
3516 self.this = this
3517 if not hasattr(self,"thisown"): self.thisown = 0
3518 self.__class__ = Quantize
3519_core_.Quantize_swigregister(QuantizePtr)
3520
3521def Quantize_Quantize(*args, **kwargs):
3522 """
3523 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3524
3525 Reduce the colours in the source image and put the result into the
3526 destination image, setting the palette in the destination if
3527 needed. Both images may be the same, to overwrite the source image.
3528 """
3529 return _core_.Quantize_Quantize(*args, **kwargs)
3530
d14a1e28
RD
3531#---------------------------------------------------------------------------
3532
3533class EvtHandler(Object):
093d3ff1 3534 """Proxy of C++ EvtHandler class"""
e811c8ce
RD
3535 def __repr__(self):
3536 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3537 def __init__(self, *args, **kwargs):
a95a7133 3538 """__init__(self) -> EvtHandler"""
54f9ee45 3539 newobj = _core_.new_EvtHandler(*args, **kwargs)
d14a1e28
RD
3540 self.this = newobj.this
3541 self.thisown = 1
3542 del newobj.thisown
e811c8ce 3543 def GetNextHandler(*args, **kwargs):
a95a7133 3544 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 3545 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
3546
3547 def GetPreviousHandler(*args, **kwargs):
a95a7133 3548 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 3549 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3550
3551 def SetNextHandler(*args, **kwargs):
a95a7133 3552 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 3553 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
3554
3555 def SetPreviousHandler(*args, **kwargs):
a95a7133 3556 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 3557 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3558
3559 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3560 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 3561 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3562
3563 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3564 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 3565 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3566
3567 def ProcessEvent(*args, **kwargs):
a95a7133 3568 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 3569 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
3570
3571 def AddPendingEvent(*args, **kwargs):
a95a7133 3572 """AddPendingEvent(self, Event event)"""
54f9ee45 3573 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
3574
3575 def ProcessPendingEvents(*args, **kwargs):
a95a7133 3576 """ProcessPendingEvents(self)"""
54f9ee45 3577 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
3578
3579 def Connect(*args, **kwargs):
a95a7133 3580 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 3581 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
3582
3583 def Disconnect(*args, **kwargs):
a95a7133 3584 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 3585 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
3586
3587 def _setOORInfo(*args, **kwargs):
689b42ee 3588 """_setOORInfo(self, PyObject _self, bool incref=True)"""
54f9ee45 3589 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
e811c8ce 3590
d14a1e28
RD
3591 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3592 """
3593 Bind an event to an event handler.
3594
db3e571a
RD
3595 :param event: One of the EVT_* objects that specifies the
3596 type of event to bind,
d14a1e28 3597
db3e571a
RD
3598 :param handler: A callable object to be invoked when the
3599 event is delivered to self. Pass None to
3600 disconnect an event handler.
d14a1e28 3601
db3e571a
RD
3602 :param source: Sometimes the event originates from a
3603 different window than self, but you still
3604 want to catch it in self. (For example, a
3605 button event delivered to a frame.) By
3606 passing the source of the event, the event
3607 handling system is able to differentiate
3608 between the same event type from different
3609 controls.
d14a1e28 3610
db3e571a
RD
3611 :param id: Used to spcify the event source by ID instead
3612 of instance.
3613
3614 :param id2: Used when it is desirable to bind a handler
3615 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
3616 """
3617 if source is not None:
3618 id = source.GetId()
3619 event.Bind(self, id, id2, handler)
3620
66c033b4
RD
3621 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3622 """
3623 Disconencts the event handler binding for event from self.
3624 Returns True if successful.
3625 """
3626 if source is not None:
3627 id = source.GetId()
3628 return event.Unbind(self, id, id2)
d14a1e28 3629
d14a1e28
RD
3630
3631class EvtHandlerPtr(EvtHandler):
3632 def __init__(self, this):
3633 self.this = this
3634 if not hasattr(self,"thisown"): self.thisown = 0
3635 self.__class__ = EvtHandler
54f9ee45 3636_core_.EvtHandler_swigregister(EvtHandlerPtr)
d14a1e28
RD
3637
3638#---------------------------------------------------------------------------
3639
3640class PyEventBinder(object):
3641 """
3642 Instances of this class are used to bind specific events to event
3643 handlers.
3644 """
3645 def __init__(self, evtType, expectedIDs=0):
3646 if expectedIDs not in [0, 1, 2]:
3647 raise ValueError, "Invalid number of expectedIDs"
3648 self.expectedIDs = expectedIDs
3649
3650 if type(evtType) == list or type(evtType) == tuple:
3651 self.evtType = evtType
3652 else:
3653 self.evtType = [evtType]
3654
3655
3656 def Bind(self, target, id1, id2, function):
3657 """Bind this set of event types to target."""
3658 for et in self.evtType:
3659 target.Connect(id1, id2, et, function)
3660
66c033b4
RD
3661
3662 def Unbind(self, target, id1, id2):
3663 """Remove an event binding."""
3664 success = 0
3665 for et in self.evtType:
3666 success += target.Disconnect(id1, id2, et)
3667 return success != 0
3668
d14a1e28
RD
3669
3670 def __call__(self, *args):
3671 """
3672 For backwards compatibility with the old EVT_* functions.
3673 Should be called with either (window, func), (window, ID,
3674 func) or (window, ID1, ID2, func) parameters depending on the
3675 type of the event.
3676 """
3677 assert len(args) == 2 + self.expectedIDs
3678 id1 = wx.ID_ANY
3679 id2 = wx.ID_ANY
3680 target = args[0]
3681 if self.expectedIDs == 0:
3682 func = args[1]
3683 elif self.expectedIDs == 1:
3684 id1 = args[1]
3685 func = args[2]
3686 elif self.expectedIDs == 2:
3687 id1 = args[1]
3688 id2 = args[2]
3689 func = args[3]
3690 else:
3691 raise ValueError, "Unexpected number of IDs"
3692
3693 self.Bind(target, id1, id2, func)
3694
3695
3696# These two are square pegs that don't fit the PyEventBinder hole...
3697def EVT_COMMAND(win, id, cmd, func):
3698 win.Connect(id, -1, cmd, func)
3699def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3700 win.Connect(id1, id2, cmd, func)
3701
3702
3703#---------------------------------------------------------------------------
3704
3705#---------------------------------------------------------------------------
3706
54f9ee45
RD
3707EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3708EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 3709
e811c8ce
RD
3710def NewEventType(*args, **kwargs):
3711 """NewEventType() -> wxEventType"""
54f9ee45
RD
3712 return _core_.NewEventType(*args, **kwargs)
3713wxEVT_NULL = _core_.wxEVT_NULL
3714wxEVT_FIRST = _core_.wxEVT_FIRST
3715wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3716wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3717wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3718wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3719wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3720wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3721wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3722wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3723wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3724wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3725wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3726wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3727wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3728wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3729wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3730wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3731wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3732wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3733wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3734wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3735wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3736wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3737wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3738wxEVT_MOTION = _core_.wxEVT_MOTION
3739wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3740wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3741wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3742wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3743wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3744wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3745wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3746wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3747wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3748wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3749wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3750wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3751wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3752wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3753wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3754wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3755wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3756wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3757wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3758wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3759wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3760wxEVT_CHAR = _core_.wxEVT_CHAR
3761wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3762wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3763wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3764wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3765wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3766wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3767wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3768wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3769wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3770wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3771wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3772wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3773wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3774wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3775wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3776wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
54f9ee45
RD
3777wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3778wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3779wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3780wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3781wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3782wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3783wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3784wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3785wxEVT_SIZE = _core_.wxEVT_SIZE
3786wxEVT_MOVE = _core_.wxEVT_MOVE
3787wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3788wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3789wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3790wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3791wxEVT_POWER = _core_.wxEVT_POWER
3792wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3793wxEVT_CREATE = _core_.wxEVT_CREATE
3794wxEVT_DESTROY = _core_.wxEVT_DESTROY
3795wxEVT_SHOW = _core_.wxEVT_SHOW
3796wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3797wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3798wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3799wxEVT_PAINT = _core_.wxEVT_PAINT
3800wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3801wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3802wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3803wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3804wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3805wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3806wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3807wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3808wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3809wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3810wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3811wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3812wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3813wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3814wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3815wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3816wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3817wxEVT_IDLE = _core_.wxEVT_IDLE
3818wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3819wxEVT_SIZING = _core_.wxEVT_SIZING
3820wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3821wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
54f9ee45
RD
3822wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3823wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3824wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3825wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3826wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3827wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3828wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
3829#
3830# Create some event binders
3831EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3832EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3833EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3834EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3835EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3836EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3837EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3838EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3839EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3840EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3841EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3842EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3843EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3844EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3845EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3846EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3847EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3848EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3849EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3850EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3851EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3852EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3853EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3854EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3855EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d14a1e28
RD
3856EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3857EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3858EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3859EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3860EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3861EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3862EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3863EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3864EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3865EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3866EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3867EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3868EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3869EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3870EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3871EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3872
3873EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3874EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3875EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3876EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3877EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3878EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3879EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3880EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3881EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3882EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3883EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3884EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3885EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3886
3887EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3888 wxEVT_LEFT_UP,
3889 wxEVT_MIDDLE_DOWN,
3890 wxEVT_MIDDLE_UP,
3891 wxEVT_RIGHT_DOWN,
3892 wxEVT_RIGHT_UP,
3893 wxEVT_MOTION,
3894 wxEVT_LEFT_DCLICK,
3895 wxEVT_MIDDLE_DCLICK,
3896 wxEVT_RIGHT_DCLICK,
3897 wxEVT_ENTER_WINDOW,
3898 wxEVT_LEAVE_WINDOW,
3899 wxEVT_MOUSEWHEEL
3900 ])
3901
3902
3903# Scrolling from wxWindow (sent to wxScrolledWindow)
3904EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3905 wxEVT_SCROLLWIN_BOTTOM,
3906 wxEVT_SCROLLWIN_LINEUP,
3907 wxEVT_SCROLLWIN_LINEDOWN,
3908 wxEVT_SCROLLWIN_PAGEUP,
3909 wxEVT_SCROLLWIN_PAGEDOWN,
3910 wxEVT_SCROLLWIN_THUMBTRACK,
3911 wxEVT_SCROLLWIN_THUMBRELEASE,
3912 ])
3913
3914EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3915EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3916EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3917EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3918EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3919EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3920EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3921EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3922
27fb7603 3923# Scrolling from wx.Slider and wx.ScrollBar
d14a1e28
RD
3924EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3925 wxEVT_SCROLL_BOTTOM,
3926 wxEVT_SCROLL_LINEUP,
3927 wxEVT_SCROLL_LINEDOWN,
3928 wxEVT_SCROLL_PAGEUP,
3929 wxEVT_SCROLL_PAGEDOWN,
3930 wxEVT_SCROLL_THUMBTRACK,
3931 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3932 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3933 ])
3934
3935EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3936EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3937EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3938EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3939EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3940EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3941EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3942EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3943EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3944EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3945
27fb7603 3946# Scrolling from wx.Slider and wx.ScrollBar, with an id
d14a1e28
RD
3947EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3948 wxEVT_SCROLL_BOTTOM,
3949 wxEVT_SCROLL_LINEUP,
3950 wxEVT_SCROLL_LINEDOWN,
3951 wxEVT_SCROLL_PAGEUP,
3952 wxEVT_SCROLL_PAGEDOWN,
3953 wxEVT_SCROLL_THUMBTRACK,
3954 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3955 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3956 ], 1)
3957
3958EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3959EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3960EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3961EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3962EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3963EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3964EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3965EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3966EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3967EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d14a1e28 3968
d14a1e28
RD
3969EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3970EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3971EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3972EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3973EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3974EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3975EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3976EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3977EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3978EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3979
3980EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3981EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3982EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3983EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3984EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3985EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3986EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3987EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3988EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3989
3990
3991EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3992EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3993EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3994EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3995EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3996EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3997EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3998
3999EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4000
4001EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4002EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4003
4004EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4005
4006
4007
4008#---------------------------------------------------------------------------
4009
4010class Event(Object):
27fb7603
RD
4011 """
4012 An event is a structure holding information about an event passed to a
4013 callback or member function. wx.Event is an abstract base class for
4014 other event classes
4015 """
e811c8ce
RD
4016 def __init__(self): raise RuntimeError, "No constructor defined"
4017 def __repr__(self):
4018 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45 4019 def __del__(self, destroy=_core_.delete_Event):
a95a7133 4020 """__del__(self)"""
d14a1e28
RD
4021 try:
4022 if self.thisown: destroy(self)
4023 except: pass
e811c8ce
RD
4024
4025 def SetEventType(*args, **kwargs):
27fb7603
RD
4026 """
4027 SetEventType(self, wxEventType typ)
4028
4029 Sets the specific type of the event.
4030 """
54f9ee45 4031 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
4032
4033 def GetEventType(*args, **kwargs):
27fb7603
RD
4034 """
4035 GetEventType(self) -> wxEventType
4036
4037 Returns the identifier of the given event type, such as
4038 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4039 """
54f9ee45 4040 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
4041
4042 def GetEventObject(*args, **kwargs):
27fb7603
RD
4043 """
4044 GetEventObject(self) -> Object
4045
4046 Returns the object (usually a window) associated with the event, if
4047 any.
4048 """
54f9ee45 4049 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
4050
4051 def SetEventObject(*args, **kwargs):
27fb7603
RD
4052 """
4053 SetEventObject(self, Object obj)
4054
4055 Sets the originating object, or in other words, obj is normally the
4056 object that is sending the event.
4057 """
54f9ee45 4058 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
4059
4060 def GetTimestamp(*args, **kwargs):
a95a7133 4061 """GetTimestamp(self) -> long"""
54f9ee45 4062 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
4063
4064 def SetTimestamp(*args, **kwargs):
a95a7133 4065 """SetTimestamp(self, long ts=0)"""
54f9ee45 4066 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
4067
4068 def GetId(*args, **kwargs):
27fb7603
RD
4069 """
4070 GetId(self) -> int
4071
4072 Returns the identifier associated with this event, such as a button
4073 command id.
4074 """
54f9ee45 4075 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
4076
4077 def SetId(*args, **kwargs):
27fb7603
RD
4078 """
4079 SetId(self, int Id)
4080
4081 Set's the ID for the event. This is usually the ID of the window that
4082 is sending the event, but it can also be a command id from a menu
4083 item, etc.
4084 """
54f9ee45 4085 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
4086
4087 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4088 """
4089 IsCommandEvent(self) -> bool
4090
4091 Returns true if the event is or is derived from `wx.CommandEvent` else
4092 it returns false. Note: Exists only for optimization purposes.
4093 """
54f9ee45 4094 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
4095
4096 def Skip(*args, **kwargs):
51b83b37
RD
4097 """
4098 Skip(self, bool skip=True)
4099
4100 Called by an event handler, it controls whether additional event
4101 handlers bound to this event will be called after the current event
4102 handler returns. Skip(false) (the default setting) will prevent
4103 additional event handlers from being called and control will be
4104 returned to the sender of the event immediately after the current
4105 handler has finished. Skip(True) will cause the event processing
4106 system to continue searching for a handler function for this event.
4107
4108 """
54f9ee45 4109 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
4110
4111 def GetSkipped(*args, **kwargs):
27fb7603
RD
4112 """
4113 GetSkipped(self) -> bool
4114
4115 Returns true if the event handler should be skipped, false otherwise.
4116 :see: `Skip`
4117 """
54f9ee45 4118 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
4119
4120 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4121 """
4122 ShouldPropagate(self) -> bool
4123
4124 Test if this event should be propagated to the parent window or not,
4125 i.e. if the propagation level is currently greater than 0.
4126 """
54f9ee45 4127 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
4128
4129 def StopPropagation(*args, **kwargs):
27fb7603
RD
4130 """
4131 StopPropagation(self) -> int
4132
4133 Stop the event from propagating to its parent window. Returns the old
4134 propagation level value which may be later passed to
4135 `ResumePropagation` to allow propagating the event again.
4136 """
54f9ee45 4137 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
4138
4139 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4140 """
4141 ResumePropagation(self, int propagationLevel)
4142
4143 Resume the event propagation by restoring the propagation level. (For
4144 example, you can use the value returned by an earlier call to
4145 `StopPropagation`.)
4146
4147 """
54f9ee45 4148 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
4149
4150 def Clone(*args, **kwargs):
a95a7133 4151 """Clone(self) -> Event"""
54f9ee45 4152 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 4153
d14a1e28
RD
4154
4155class EventPtr(Event):
4156 def __init__(self, this):
4157 self.this = this
4158 if not hasattr(self,"thisown"): self.thisown = 0
4159 self.__class__ = Event
54f9ee45 4160_core_.Event_swigregister(EventPtr)
d14a1e28
RD
4161
4162#---------------------------------------------------------------------------
4163
4164class PropagationDisabler(object):
27fb7603
RD
4165 """
4166 Helper class to temporarily change an event not to propagate. Simply
4167 create an instance of this class and then whe it is destroyed the
4168 propogation of the event will be restored.
4169 """
e811c8ce
RD
4170 def __repr__(self):
4171 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4172 def __init__(self, *args, **kwargs):
27fb7603
RD
4173 """
4174 __init__(self, Event event) -> PropagationDisabler
4175
4176 Helper class to temporarily change an event not to propagate. Simply
4177 create an instance of this class and then whe it is destroyed the
4178 propogation of the event will be restored.
4179 """
54f9ee45 4180 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
d14a1e28
RD
4181 self.this = newobj.this
4182 self.thisown = 1
4183 del newobj.thisown
54f9ee45 4184 def __del__(self, destroy=_core_.delete_PropagationDisabler):
a95a7133 4185 """__del__(self)"""
d14a1e28
RD
4186 try:
4187 if self.thisown: destroy(self)
4188 except: pass
e811c8ce 4189
d14a1e28
RD
4190
4191class PropagationDisablerPtr(PropagationDisabler):
4192 def __init__(self, this):
4193 self.this = this
4194 if not hasattr(self,"thisown"): self.thisown = 0
4195 self.__class__ = PropagationDisabler
54f9ee45 4196_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
d14a1e28
RD
4197
4198class PropagateOnce(object):
27fb7603
RD
4199 """
4200 A helper class that will temporarily lower propagation level of an
4201 event. Simply create an instance of this class and then whe it is
4202 destroyed the propogation of the event will be restored.
4203 """
e811c8ce
RD
4204 def __repr__(self):
4205 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4206 def __init__(self, *args, **kwargs):
27fb7603
RD
4207 """
4208 __init__(self, Event event) -> PropagateOnce
4209
4210 A helper class that will temporarily lower propagation level of an
4211 event. Simply create an instance of this class and then whe it is
4212 destroyed the propogation of the event will be restored.
4213 """
54f9ee45 4214 newobj = _core_.new_PropagateOnce(*args, **kwargs)
d14a1e28
RD
4215 self.this = newobj.this
4216 self.thisown = 1
4217 del newobj.thisown
54f9ee45 4218 def __del__(self, destroy=_core_.delete_PropagateOnce):
a95a7133 4219 """__del__(self)"""
d14a1e28
RD
4220 try:
4221 if self.thisown: destroy(self)
4222 except: pass
e811c8ce 4223
d14a1e28
RD
4224
4225class PropagateOncePtr(PropagateOnce):
4226 def __init__(self, this):
4227 self.this = this
4228 if not hasattr(self,"thisown"): self.thisown = 0
4229 self.__class__ = PropagateOnce
54f9ee45 4230_core_.PropagateOnce_swigregister(PropagateOncePtr)
d14a1e28
RD
4231
4232#---------------------------------------------------------------------------
4233
4234class CommandEvent(Event):
27fb7603
RD
4235 """
4236 This event class contains information about command events, which
4237 originate from a variety of simple controls, as well as menus and
4238 toolbars.
4239 """
e811c8ce
RD
4240 def __repr__(self):
4241 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4242 def __init__(self, *args, **kwargs):
27fb7603
RD
4243 """
4244 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4245
4246 This event class contains information about command events, which
4247 originate from a variety of simple controls, as well as menus and
4248 toolbars.
4249 """
54f9ee45 4250 newobj = _core_.new_CommandEvent(*args, **kwargs)
d14a1e28
RD
4251 self.this = newobj.this
4252 self.thisown = 1
4253 del newobj.thisown
e811c8ce 4254 def GetSelection(*args, **kwargs):
27fb7603
RD
4255 """
4256 GetSelection(self) -> int
4257
4258 Returns item index for a listbox or choice selection event (not valid
4259 for a deselection).
4260 """
54f9ee45 4261 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
4262
4263 def SetString(*args, **kwargs):
a95a7133 4264 """SetString(self, String s)"""
54f9ee45 4265 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
4266
4267 def GetString(*args, **kwargs):
27fb7603
RD
4268 """
4269 GetString(self) -> String
4270
4271 Returns item string for a listbox or choice selection event (not valid
4272 for a deselection).
4273 """
54f9ee45 4274 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
4275
4276 def IsChecked(*args, **kwargs):
27fb7603
RD
4277 """
4278 IsChecked(self) -> bool
4279
4280 This method can be used with checkbox and menu events: for the
4281 checkboxes, the method returns true for a selection event and false
4282 for a deselection one. For the menu events, this method indicates if
4283 the menu item just has become checked or unchecked (and thus only
4284 makes sense for checkable menu items).
4285 """
54f9ee45 4286 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 4287
242b7b46 4288 Checked = IsChecked
e811c8ce 4289 def IsSelection(*args, **kwargs):
27fb7603
RD
4290 """
4291 IsSelection(self) -> bool
4292
4293 For a listbox or similar event, returns true if it is a selection,
4294 false if it is a deselection.
4295 """
54f9ee45 4296 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
4297
4298 def SetExtraLong(*args, **kwargs):
a95a7133 4299 """SetExtraLong(self, long extraLong)"""
54f9ee45 4300 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
4301
4302 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4303 """
4304 GetExtraLong(self) -> long
4305
5ba5649b
RD
4306 Returns extra information dependant on the event objects type. If the
4307 event comes from a listbox selection, it is a boolean determining
4308 whether the event was a selection (true) or a deselection (false). A
4309 listbox deselection only occurs for multiple-selection boxes, and in
4310 this case the index and string values are indeterminate and the
4311 listbox must be examined by the application.
27fb7603 4312 """
54f9ee45 4313 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
4314
4315 def SetInt(*args, **kwargs):
a95a7133 4316 """SetInt(self, int i)"""
54f9ee45 4317 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
4318
4319 def GetInt(*args, **kwargs):
27fb7603
RD
4320 """
4321 GetInt(self) -> long
4322
5ba5649b
RD
4323 Returns the integer identifier corresponding to a listbox, choice or
4324 radiobox selection (only if the event was a selection, not a
4325 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4326 """
54f9ee45 4327 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce
RD
4328
4329 def Clone(*args, **kwargs):
a95a7133 4330 """Clone(self) -> Event"""
54f9ee45 4331 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 4332
d14a1e28
RD
4333
4334class CommandEventPtr(CommandEvent):
4335 def __init__(self, this):
4336 self.this = this
4337 if not hasattr(self,"thisown"): self.thisown = 0
4338 self.__class__ = CommandEvent
54f9ee45 4339_core_.CommandEvent_swigregister(CommandEventPtr)
d14a1e28
RD
4340
4341#---------------------------------------------------------------------------
4342
4343class NotifyEvent(CommandEvent):
27fb7603
RD
4344 """
4345 An instance of this class (or one of its derived classes) is sent from
4346 a control when the control's state is being changed and the control
4347 allows that change to be prevented from happening. The event handler
4348 can call `Veto` or `Allow` to tell the control what to do.
4349 """
e811c8ce
RD
4350 def __repr__(self):
4351 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4352 def __init__(self, *args, **kwargs):
27fb7603
RD
4353 """
4354 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4355
4356 An instance of this class (or one of its derived classes) is sent from
4357 a control when the control's state is being changed and the control
4358 allows that change to be prevented from happening. The event handler
4359 can call `Veto` or `Allow` to tell the control what to do.
4360 """
54f9ee45 4361 newobj = _core_.new_NotifyEvent(*args, **kwargs)
d14a1e28
RD
4362 self.this = newobj.this
4363 self.thisown = 1
4364 del newobj.thisown
e811c8ce 4365 def Veto(*args, **kwargs):
27fb7603
RD
4366 """
4367 Veto(self)
4368
4369 Prevents the change announced by this event from happening.
4370
4371 It is in general a good idea to notify the user about the reasons for
4372 vetoing the change because otherwise the applications behaviour (which
4373 just refuses to do what the user wants) might be quite surprising.
4374 """
54f9ee45 4375 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
4376
4377 def Allow(*args, **kwargs):
27fb7603
RD
4378 """
4379 Allow(self)
4380
4381 This is the opposite of `Veto`: it explicitly allows the event to be
4382 processed. For most events it is not necessary to call this method as
4383 the events are allowed anyhow but some are forbidden by default (this
4384 will be mentioned in the corresponding event description).
4385 """
54f9ee45 4386 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
4387
4388 def IsAllowed(*args, **kwargs):
27fb7603
RD
4389 """
4390 IsAllowed(self) -> bool
4391
4392 Returns true if the change is allowed (`Veto` hasn't been called) or
4393 false otherwise (if it was).
4394 """
54f9ee45 4395 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 4396
d14a1e28
RD
4397
4398class NotifyEventPtr(NotifyEvent):
4399 def __init__(self, this):
4400 self.this = this
4401 if not hasattr(self,"thisown"): self.thisown = 0
4402 self.__class__ = NotifyEvent
54f9ee45 4403_core_.NotifyEvent_swigregister(NotifyEventPtr)
d14a1e28
RD
4404
4405#---------------------------------------------------------------------------
4406
4407class ScrollEvent(CommandEvent):
27fb7603
RD
4408 """
4409 A scroll event holds information about events sent from stand-alone
4410 scrollbars and sliders. Note that scrolled windows do not send
4411 instnaces of this event class, but send the `wx.ScrollWinEvent`
4412 instead.
4413 """
e811c8ce
RD
4414 def __repr__(self):
4415 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4416 def __init__(self, *args, **kwargs):
0df68c9f 4417 """
a95a7133 4418 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
4419 int orient=0) -> ScrollEvent
4420 """
54f9ee45 4421 newobj = _core_.new_ScrollEvent(*args, **kwargs)
d14a1e28
RD
4422 self.this = newobj.this
4423 self.thisown = 1
4424 del newobj.thisown
e811c8ce 4425 def GetOrientation(*args, **kwargs):
27fb7603
RD
4426 """
4427 GetOrientation(self) -> int
4428
4429 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4430 the scrollbar.
4431 """
54f9ee45 4432 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4433
4434 def GetPosition(*args, **kwargs):
27fb7603
RD
4435 """
4436 GetPosition(self) -> int
4437
4438 Returns the position of the scrollbar.
4439 """
54f9ee45 4440 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4441
4442 def SetOrientation(*args, **kwargs):
a95a7133 4443 """SetOrientation(self, int orient)"""
54f9ee45 4444 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4445
4446 def SetPosition(*args, **kwargs):
a95a7133 4447 """SetPosition(self, int pos)"""
54f9ee45 4448 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 4449
d14a1e28
RD
4450
4451class ScrollEventPtr(ScrollEvent):
4452 def __init__(self, this):
4453 self.this = this
4454 if not hasattr(self,"thisown"): self.thisown = 0
4455 self.__class__ = ScrollEvent
54f9ee45 4456_core_.ScrollEvent_swigregister(ScrollEventPtr)
d14a1e28
RD
4457
4458#---------------------------------------------------------------------------
4459
4460class ScrollWinEvent(Event):
27fb7603
RD
4461 """
4462 A wx.ScrollWinEvent holds information about scrolling and is sent from
4463 scrolling windows.
4464 """
e811c8ce
RD
4465 def __repr__(self):
4466 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4467 def __init__(self, *args, **kwargs):
27fb7603
RD
4468 """
4469 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4470
4471 A wx.ScrollWinEvent holds information about scrolling and is sent from
4472 scrolling windows.
4473 """
54f9ee45 4474 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
d14a1e28
RD
4475 self.this = newobj.this
4476 self.thisown = 1
4477 del newobj.thisown
e811c8ce 4478 def GetOrientation(*args, **kwargs):
27fb7603
RD
4479 """
4480 GetOrientation(self) -> int
4481
4482 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4483 the scrollbar.
4484 """
54f9ee45 4485 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4486
4487 def GetPosition(*args, **kwargs):
27fb7603
RD
4488 """
4489 GetPosition(self) -> int
4490
4491 Returns the position of the scrollbar for the thumb track and release
4492 events. Note that this field can't be used for the other events, you
4493 need to query the window itself for the current position in that case.
4494 """
54f9ee45 4495 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4496
4497 def SetOrientation(*args, **kwargs):
a95a7133 4498 """SetOrientation(self, int orient)"""
54f9ee45 4499 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4500
4501 def SetPosition(*args, **kwargs):
a95a7133 4502 """SetPosition(self, int pos)"""
54f9ee45 4503 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 4504
d14a1e28
RD
4505
4506class ScrollWinEventPtr(ScrollWinEvent):
4507 def __init__(self, this):
4508 self.this = this
4509 if not hasattr(self,"thisown"): self.thisown = 0
4510 self.__class__ = ScrollWinEvent
54f9ee45 4511_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
d14a1e28
RD
4512
4513#---------------------------------------------------------------------------
4514
54f9ee45
RD
4515MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4516MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4517MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4518MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4519MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 4520class MouseEvent(Event):
27fb7603
RD
4521 """
4522 This event class contains information about the events generated by
4523 the mouse: they include mouse buttons press and release events and
4524 mouse move events.
4525
4526 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4527 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4528 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4529 a middle button so a portable application should avoid relying on the
4530 events from it.
4531
4532 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4533 the former returns true when the event corresponds to the left mouse
4534 button click while the latter returns true if the left mouse button is
4535 currently being pressed. For example, when the user is dragging the
4536 mouse you can use `LeftIsDown` to test whether the left mouse button
4537 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4538 `LeftIsDown` will also return true in wxWidgets whatever the
4539 underlying GUI behaviour is (which is platform-dependent). The same
4540 applies, of course, to other mouse buttons as well.
4541 """
e811c8ce
RD
4542 def __repr__(self):
4543 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4544 def __init__(self, *args, **kwargs):
27fb7603
RD
4545 """
4546 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4547
4548 Constructs a wx.MouseEvent. Valid event types are:
4549
4550 * wxEVT_ENTER_WINDOW
4551 * wxEVT_LEAVE_WINDOW
4552 * wxEVT_LEFT_DOWN
4553 * wxEVT_LEFT_UP
4554 * wxEVT_LEFT_DCLICK
4555 * wxEVT_MIDDLE_DOWN
4556 * wxEVT_MIDDLE_UP
4557 * wxEVT_MIDDLE_DCLICK
4558 * wxEVT_RIGHT_DOWN
4559 * wxEVT_RIGHT_UP
4560 * wxEVT_RIGHT_DCLICK
4561 * wxEVT_MOTION
4562 * wxEVT_MOUSEWHEEL
4563 """
54f9ee45 4564 newobj = _core_.new_MouseEvent(*args, **kwargs)
d14a1e28
RD
4565 self.this = newobj.this
4566 self.thisown = 1
4567 del newobj.thisown
e811c8ce 4568 def IsButton(*args, **kwargs):
27fb7603
RD
4569 """
4570 IsButton(self) -> bool
4571
4572 Returns true if the event was a mouse button event (not necessarily a
4573 button down event - that may be tested using `ButtonDown`).
4574 """
54f9ee45 4575 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
4576
4577 def ButtonDown(*args, **kwargs):
27fb7603
RD
4578 """
4579 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4580
5ba5649b
RD
4581 If the argument is omitted, this returns true if the event was any
4582 mouse button down event. Otherwise the argument specifies which
4583 button-down event shold be checked for (see `Button` for the possible
4584 values).
27fb7603 4585 """
54f9ee45 4586 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
4587
4588 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4589 """
4590 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4591
4592 If the argument is omitted, this returns true if the event was any
4593 mouse double click event. Otherwise the argument specifies which
4594 double click event to check for (see `Button` for the possible
4595 values).
4596 """
54f9ee45 4597 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
4598
4599 def ButtonUp(*args, **kwargs):
27fb7603
RD
4600 """
4601 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4602
4603 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4604 mouse button up event. Otherwise the argument specifies which button
4605 up event to check for (see `Button` for the possible values).
27fb7603 4606 """
54f9ee45 4607 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
4608
4609 def Button(*args, **kwargs):
27fb7603
RD
4610 """
4611 Button(self, int button) -> bool
4612
4613 Returns true if the identified mouse button is changing state. Valid
4614 values of button are:
4615
4616 ==================== =====================================
4617 wx.MOUSE_BTN_LEFT check if left button was pressed
4618 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4619 wx.MOUSE_BTN_RIGHT check if right button was pressed
4620 wx.MOUSE_BTN_ANY check if any button was pressed
4621 ==================== =====================================
4622
4623 """
54f9ee45 4624 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
4625
4626 def ButtonIsDown(*args, **kwargs):
a95a7133 4627 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 4628 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
4629
4630 def GetButton(*args, **kwargs):
27fb7603
RD
4631 """
4632 GetButton(self) -> int
4633
4634 Returns the mouse button which generated this event or
4635 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4636 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4637 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4638 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4639 right buttons respectively.
4640 """
54f9ee45 4641 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
4642
4643 def ControlDown(*args, **kwargs):
27fb7603
RD
4644 """
4645 ControlDown(self) -> bool
4646
4647 Returns true if the control key was down at the time of the event.
4648 """
54f9ee45 4649 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4650
4651 def MetaDown(*args, **kwargs):
27fb7603
RD
4652 """
4653 MetaDown(self) -> bool
4654
4655 Returns true if the Meta key was down at the time of the event.
4656 """
54f9ee45 4657 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4658
4659 def AltDown(*args, **kwargs):
27fb7603
RD
4660 """
4661 AltDown(self) -> bool
4662
4663 Returns true if the Alt key was down at the time of the event.
4664 """
54f9ee45 4665 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4666
4667 def ShiftDown(*args, **kwargs):
27fb7603
RD
4668 """
4669 ShiftDown(self) -> bool
4670
4671 Returns true if the Shift key was down at the time of the event.
4672 """
54f9ee45 4673 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 4674
412d302d
RD
4675 def CmdDown(*args, **kwargs):
4676 """
4677 CmdDown(self) -> bool
4678
4679 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4680 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4681 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4682 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4683 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4684 purpose. So for non-Mac platforms this is the same as `ControlDown`
4685 and Macs this is the same as `MetaDown`.
4686 """
4687 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4688
e811c8ce 4689 def LeftDown(*args, **kwargs):
27fb7603
RD
4690 """
4691 LeftDown(self) -> bool
4692
4693 Returns true if the left mouse button state changed to down.
4694 """
54f9ee45 4695 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
4696
4697 def MiddleDown(*args, **kwargs):
27fb7603
RD
4698 """
4699 MiddleDown(self) -> bool
4700
4701 Returns true if the middle mouse button state changed to down.
4702 """
54f9ee45 4703 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
4704
4705 def RightDown(*args, **kwargs):
27fb7603
RD
4706 """
4707 RightDown(self) -> bool
4708
4709 Returns true if the right mouse button state changed to down.
4710 """
54f9ee45 4711 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
4712
4713 def LeftUp(*args, **kwargs):
27fb7603
RD
4714 """
4715 LeftUp(self) -> bool
4716
4717 Returns true if the left mouse button state changed to up.
4718 """
54f9ee45 4719 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
4720
4721 def MiddleUp(*args, **kwargs):
27fb7603
RD
4722 """
4723 MiddleUp(self) -> bool
4724
4725 Returns true if the middle mouse button state changed to up.
4726 """
54f9ee45 4727 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
4728
4729 def RightUp(*args, **kwargs):
27fb7603
RD
4730 """
4731 RightUp(self) -> bool
4732
4733 Returns true if the right mouse button state changed to up.
4734 """
54f9ee45 4735 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
4736
4737 def LeftDClick(*args, **kwargs):
27fb7603
RD
4738 """
4739 LeftDClick(self) -> bool
4740
4741 Returns true if the event was a left button double click.
4742 """
54f9ee45 4743 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
4744
4745 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4746 """
4747 MiddleDClick(self) -> bool
4748
4749 Returns true if the event was a middle button double click.
4750 """
54f9ee45 4751 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
4752
4753 def RightDClick(*args, **kwargs):
27fb7603
RD
4754 """
4755 RightDClick(self) -> bool
4756
4757 Returns true if the event was a right button double click.
4758 """
54f9ee45 4759 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
4760
4761 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4762 """
4763 LeftIsDown(self) -> bool
4764
4765 Returns true if the left mouse button is currently down, independent
4766 of the current event type.
4767
4768 Please notice that it is not the same as LeftDown which returns true
4769 if the left mouse button was just pressed. Rather, it describes the
4770 state of the mouse button before the event happened.
4771
4772 This event is usually used in the mouse event handlers which process
4773 "move mouse" messages to determine whether the user is (still)
4774 dragging the mouse.
4775 """
54f9ee45 4776 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
4777
4778 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4779 """
4780 MiddleIsDown(self) -> bool
4781
4782 Returns true if the middle mouse button is currently down, independent
4783 of the current event type.
4784 """
54f9ee45 4785 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
4786
4787 def RightIsDown(*args, **kwargs):
27fb7603
RD
4788 """
4789 RightIsDown(self) -> bool
4790
4791 Returns true if the right mouse button is currently down, independent
4792 of the current event type.
4793 """
54f9ee45 4794 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
4795
4796 def Dragging(*args, **kwargs):
27fb7603
RD
4797 """
4798 Dragging(self) -> bool
4799
4800 Returns true if this was a dragging event (motion while a button is
4801 depressed).
4802 """
54f9ee45 4803 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
4804
4805 def Moving(*args, **kwargs):
27fb7603
RD
4806 """
4807 Moving(self) -> bool
4808
4809 Returns true if this was a motion event and no mouse buttons were
4810 pressed. If any mouse button is held pressed, then this method returns
4811 false and Dragging returns true.
4812 """
54f9ee45 4813 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
4814
4815 def Entering(*args, **kwargs):
27fb7603
RD
4816 """
4817 Entering(self) -> bool
4818
4819 Returns true if the mouse was entering the window.
4820 """
54f9ee45 4821 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
4822
4823 def Leaving(*args, **kwargs):
27fb7603
RD
4824 """
4825 Leaving(self) -> bool
4826
4827 Returns true if the mouse was leaving the window.
4828 """
54f9ee45 4829 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
4830
4831 def GetPosition(*args, **kwargs):
0df68c9f 4832 """
a95a7133 4833 GetPosition(self) -> Point
e811c8ce 4834
27fb7603
RD
4835 Returns the pixel position of the mouse in window coordinates when the
4836 event happened.
0df68c9f 4837 """
54f9ee45 4838 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4839
4840 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4841 """
4842 GetPositionTuple() -> (x,y)
e811c8ce 4843
27fb7603
RD
4844 Returns the pixel position of the mouse in window coordinates when the
4845 event happened.
0df68c9f 4846 """
54f9ee45 4847 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4848
4849 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4850 """
4851 GetLogicalPosition(self, DC dc) -> Point
4852
4853 Returns the logical mouse position in pixels (i.e. translated
4854 according to the translation set for the DC, which usually indicates
4855 that the window has been scrolled).
4856 """
54f9ee45 4857 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
4858
4859 def GetX(*args, **kwargs):
27fb7603
RD
4860 """
4861 GetX(self) -> int
4862
4863 Returns X coordinate of the physical mouse event position.
4864 """
54f9ee45 4865 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
4866
4867 def GetY(*args, **kwargs):
27fb7603
RD
4868 """
4869 GetY(self) -> int
4870
4871 Returns Y coordinate of the physical mouse event position.
4872 """
54f9ee45 4873 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
4874
4875 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4876 """
4877 GetWheelRotation(self) -> int
4878
4879 Get wheel rotation, positive or negative indicates direction of
4880 rotation. Current devices all send an event when rotation is equal to
4881 +/-WheelDelta, but this allows for finer resolution devices to be
4882 created in the future. Because of this you shouldn't assume that one
4883 event is equal to 1 line or whatever, but you should be able to either
4884 do partial line scrolling or wait until +/-WheelDelta rotation values
4885 have been accumulated before scrolling.
4886 """
54f9ee45 4887 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
4888
4889 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4890 """
4891 GetWheelDelta(self) -> int
4892
4893 Get wheel delta, normally 120. This is the threshold for action to be
4894 taken, and one such action (for example, scrolling one increment)
4895 should occur for each delta.
4896 """
54f9ee45 4897 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce
RD
4898
4899 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4900 """
4901 GetLinesPerAction(self) -> int
4902
4903 Returns the configured number of lines (or whatever) to be scrolled
4904 per wheel action. Defaults to three.
4905 """
54f9ee45 4906 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
4907
4908 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4909 """
4910 IsPageScroll(self) -> bool
4911
4912 Returns true if the system has been setup to do page scrolling with
4913 the mouse wheel instead of line scrolling.
4914 """
54f9ee45
RD
4915 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4916
4917 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4918 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4919 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4920 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4921 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4922 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4923 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4924 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4925 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4926 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4927 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4928 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
d14a1e28
RD
4929
4930class MouseEventPtr(MouseEvent):
4931 def __init__(self, this):
4932 self.this = this
4933 if not hasattr(self,"thisown"): self.thisown = 0
4934 self.__class__ = MouseEvent
54f9ee45 4935_core_.MouseEvent_swigregister(MouseEventPtr)
d14a1e28
RD
4936
4937#---------------------------------------------------------------------------
4938
4939class SetCursorEvent(Event):
5ba5649b
RD
4940 """
4941 A SetCursorEvent is generated when the mouse cursor is about to be set
4942 as a result of mouse motion. This event gives the application the
4943 chance to perform specific mouse cursor processing based on the
4944 current position of the mouse within the window. Use the `SetCursor`
4945 method to specify the cursor you want to be displayed.
4946 """
e811c8ce
RD
4947 def __repr__(self):
4948 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4949 def __init__(self, *args, **kwargs):
5ba5649b
RD
4950 """
4951 __init__(self, int x=0, int y=0) -> SetCursorEvent
4952
4953 Construct a new `wx.SetCursorEvent`.
4954 """
54f9ee45 4955 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
d14a1e28
RD
4956 self.this = newobj.this
4957 self.thisown = 1
4958 del newobj.thisown
e811c8ce 4959 def GetX(*args, **kwargs):
5ba5649b
RD
4960 """
4961 GetX(self) -> int
4962
4963 Returns the X coordinate of the mouse in client coordinates.
4964 """
54f9ee45 4965 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
4966
4967 def GetY(*args, **kwargs):
5ba5649b
RD
4968 """
4969 GetY(self) -> int
4970
4971 Returns the Y coordinate of the mouse in client coordinates.
4972 """
54f9ee45 4973 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
4974
4975 def SetCursor(*args, **kwargs):
5ba5649b
RD
4976 """
4977 SetCursor(self, Cursor cursor)
4978
4979 Sets the cursor associated with this event.
4980 """
54f9ee45 4981 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
4982
4983 def GetCursor(*args, **kwargs):
5ba5649b
RD
4984 """
4985 GetCursor(self) -> Cursor
4986
4987 Returns a reference to the cursor specified by this event.
4988 """
54f9ee45 4989 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
4990
4991 def HasCursor(*args, **kwargs):
5ba5649b
RD
4992 """
4993 HasCursor(self) -> bool
4994
4995 Returns true if the cursor specified by this event is a valid cursor.
4996 """
54f9ee45 4997 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 4998
d14a1e28
RD
4999
5000class SetCursorEventPtr(SetCursorEvent):
5001 def __init__(self, this):
5002 self.this = this
5003 if not hasattr(self,"thisown"): self.thisown = 0
5004 self.__class__ = SetCursorEvent
54f9ee45 5005_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
d14a1e28
RD
5006
5007#---------------------------------------------------------------------------
5008
5009class KeyEvent(Event):
5ba5649b
RD
5010 """
5011 This event class contains information about keypress and character
5012 events. These events are only sent to the widget that currently has
5013 the keyboard focus.
5014
5015 Notice that there are three different kinds of keyboard events in
5016 wxWidgets: key down and up events and char events. The difference
5017 between the first two is clear - the first corresponds to a key press
5018 and the second to a key release - otherwise they are identical. Just
5019 note that if the key is maintained in a pressed state you will
5020 typically get a lot of (automatically generated) down events but only
5021 one up so it is wrong to assume that there is one up event
5022 corresponding to each down one.
5023
5024 Both key events provide untranslated key codes while the char event
5025 carries the translated one. The untranslated code for alphanumeric
5026 keys is always an upper case value. For the other keys it is one of
5027 WXK_XXX values from the keycodes table. The translated key is, in
5028 general, the character the user expects to appear as the result of the
5029 key combination when typing the text into a text entry zone, for
5030 example.
5031
5032 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5033 and the standard US keyboard): when the 'A' key is pressed, the key
5034 down event key code is equal to ASCII A == 65. But the char event key
5035 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5036 'A' keys simultaneously , the key code in key down event will still be
5037 just 'A' while the char event key code parameter will now be 'A' as
5038 well.
5039
5040 Although in this simple case it is clear that the correct key code
5041 could be found in the key down event handler by checking the value
5042 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5043 as for non alphanumeric keys or non-US keyboard layouts the
5044 translation is keyboard-layout dependent and can only be done properly
5045 by the system itself.
5046
5047 Another kind of translation is done when the control key is pressed:
5048 for example, for CTRL-A key press the key down event still carries the
5049 same key code 'A' as usual but the char event will have key code of 1,
5050 the ASCII value of this key combination.
5051
5052 You may discover how the other keys on your system behave
5053 interactively by running the KeyEvents sample in the wxPython demo and
5054 pressing some keys while the blue box at the top has the keyboard
5055 focus.
5056
5057 **Note**: If a key down event is caught and the event handler does not
5058 call event.Skip() then the coresponding char event will not
5059 happen. This is by design and enables the programs that handle both
5060 types of events to be a bit simpler.
5061
5062 **Note for Windows programmers**: The key and char events in wxWidgets
5063 are similar to but slightly different from Windows WM_KEYDOWN and
5064 WM_CHAR events. In particular, Alt-x combination will generate a char
5065 event in wxWidgets (unless it is used as an accelerator).
5066
5067 **Tip**: be sure to call event.Skip() for events that you don't
5068 process in key event function, otherwise menu shortcuts may cease to
5069 work under Windows.
5070
5071 """
e811c8ce
RD
5072 def __repr__(self):
5073 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5074 def __init__(self, *args, **kwargs):
5ba5649b
RD
5075 """
5076 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
5077
5078 Construct a new `wx.KeyEvent`. Valid event types are:
5079 *
5080 """
54f9ee45 5081 newobj = _core_.new_KeyEvent(*args, **kwargs)
d14a1e28
RD
5082 self.this = newobj.this
5083 self.thisown = 1
5084 del newobj.thisown
e811c8ce 5085 def ControlDown(*args, **kwargs):
5ba5649b
RD
5086 """
5087 ControlDown(self) -> bool
5088
5089 Returns ``True`` if the Control key was down at the time of the event.
5090 """
54f9ee45 5091 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
5092
5093 def MetaDown(*args, **kwargs):
5ba5649b
RD
5094 """
5095 MetaDown(self) -> bool
5096
5097 Returns ``True`` if the Meta key was down at the time of the event.
5098 """
54f9ee45 5099 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
5100
5101 def AltDown(*args, **kwargs):
5ba5649b
RD
5102 """
5103 AltDown(self) -> bool
5104
5105 Returns ``True`` if the Alt key was down at the time of the event.
5106 """
54f9ee45 5107 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
5108
5109 def ShiftDown(*args, **kwargs):
5ba5649b
RD
5110 """
5111 ShiftDown(self) -> bool
5112
5113 Returns ``True`` if the Shift key was down at the time of the event.
5114 """
54f9ee45 5115 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 5116
412d302d
RD
5117 def CmdDown(*args, **kwargs):
5118 """
5119 CmdDown(self) -> bool
5120
5121 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5122 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5123 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5124 because Cmd key is used for the same thing under Mac as Ctrl
5125 elsewhere. The Ctrl still exists, it's just not used for this
5126 purpose. So for non-Mac platforms this is the same as `ControlDown`
5127 and Macs this is the same as `MetaDown`.
5128 """
5129 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5130
e811c8ce 5131 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5132 """
5133 HasModifiers(self) -> bool
5134
5135 Returns true if either CTRL or ALT keys was down at the time of the
5136 key event. Note that this function does not take into account neither
5137 SHIFT nor META key states (the reason for ignoring the latter is that
5138 it is common for NUMLOCK key to be configured as META under X but the
5139 key presses even while NUMLOCK is on should be still processed
5140 normally).
5141 """
54f9ee45 5142 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
5143
5144 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5145 """
5146 GetKeyCode(self) -> int
5147
5148 Returns the virtual key code. ASCII events return normal ASCII values,
5149 while non-ASCII events return values such as WXK_LEFT for the left
5150 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5151 codes.
5152
5153 Note that in Unicode build, the returned value is meaningful only if
5154 the user entered a character that can be represented in current
5155 locale's default charset. You can obtain the corresponding Unicode
5156 character using `GetUnicodeKey`.
5157 """
54f9ee45 5158 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 5159
d14a1e28 5160 KeyCode = GetKeyCode
19272049 5161 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5162 """
5163 GetUnicodeKey(self) -> int
5164
5165 Returns the Unicode character corresponding to this key event. This
5166 function is only meaningfule in a Unicode build of wxPython.
5167 """
19272049 5168 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 5169
19272049 5170 GetUniChar = GetUnicodeKey
e811c8ce 5171 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5172 """
5173 GetRawKeyCode(self) -> unsigned int
5174
5175 Returns the raw key code for this event. This is a platform-dependent
5176 scan code which should only be used in advanced
5177 applications. Currently the raw key codes are not supported by all
5178 ports.
5179 """
54f9ee45 5180 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
5181
5182 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5183 """
5184 GetRawKeyFlags(self) -> unsigned int
5185
5186 Returns the low level key flags for this event. The flags are
5187 platform-dependent and should only be used in advanced applications.
5188 Currently the raw key flags are not supported by all ports.
5189 """
54f9ee45 5190 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
5191
5192 def GetPosition(*args, **kwargs):
0df68c9f 5193 """
a95a7133 5194 GetPosition(self) -> Point
e811c8ce 5195
5ba5649b 5196 Find the position of the event, if applicable.
0df68c9f 5197 """
54f9ee45 5198 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5199
5200 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
5201 """
5202 GetPositionTuple() -> (x,y)
e811c8ce 5203
5ba5649b 5204 Find the position of the event, if applicable.
0df68c9f 5205 """
54f9ee45 5206 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
5207
5208 def GetX(*args, **kwargs):
5ba5649b
RD
5209 """
5210 GetX(self) -> int
5211
5212 Returns the X position (in client coordinates) of the event, if
5213 applicable.
5214 """
54f9ee45 5215 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
5216
5217 def GetY(*args, **kwargs):
5ba5649b
RD
5218 """
5219 GetY(self) -> int
5220
5221 Returns the Y position (in client coordinates) of the event, if
5222 applicable.
5223 """
54f9ee45
RD
5224 return _core_.KeyEvent_GetY(*args, **kwargs)
5225
5226 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5227 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5228 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5229 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5230 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5231 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5232 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5233 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5234 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5235 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
d14a1e28
RD
5236
5237class KeyEventPtr(KeyEvent):
5238 def __init__(self, this):
5239 self.this = this
5240 if not hasattr(self,"thisown"): self.thisown = 0
5241 self.__class__ = KeyEvent
54f9ee45 5242_core_.KeyEvent_swigregister(KeyEventPtr)
d14a1e28
RD
5243
5244#---------------------------------------------------------------------------
5245
5246class SizeEvent(Event):
5ba5649b
RD
5247 """
5248 A size event holds information about size change events. The EVT_SIZE
5249 handler function will be called when the window it is bound to has
5250 been resized.
5251
5252 Note that the size passed is of the whole window: call
5253 `wx.Window.GetClientSize` for the area which may be used by the
5254 application.
5255
5256 When a window is resized, usually only a small part of the window is
5257 damaged and and that area is all that is in the update region for the
5258 next paint event. However, if your drawing depends on the size of the
5259 window, you may need to clear the DC explicitly and repaint the whole
5260 window. In which case, you may need to call `wx.Window.Refresh` to
5261 invalidate the entire window.
5262
5263 """
e811c8ce
RD
5264 def __repr__(self):
5265 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5266 def __init__(self, *args, **kwargs):
5ba5649b
RD
5267 """
5268 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5269
5270 Construct a new ``wx.SizeEvent``.
5271 """
54f9ee45 5272 newobj = _core_.new_SizeEvent(*args, **kwargs)
d14a1e28
RD
5273 self.this = newobj.this
5274 self.thisown = 1
5275 del newobj.thisown
e811c8ce 5276 def GetSize(*args, **kwargs):
5ba5649b
RD
5277 """
5278 GetSize(self) -> Size
5279
5280 Returns the entire size of the window generating the size change
5281 event.
5282 """
54f9ee45 5283 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
5284
5285 def GetRect(*args, **kwargs):
a95a7133 5286 """GetRect(self) -> Rect"""
54f9ee45 5287 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5288
5289 def SetRect(*args, **kwargs):
a95a7133 5290 """SetRect(self, Rect rect)"""
54f9ee45 5291 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5292
5293 def SetSize(*args, **kwargs):
a95a7133 5294 """SetSize(self, Size size)"""
54f9ee45 5295 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 5296
54f9ee45
RD
5297 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5298 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
d14a1e28
RD
5299
5300class SizeEventPtr(SizeEvent):
5301 def __init__(self, this):
5302 self.this = this
5303 if not hasattr(self,"thisown"): self.thisown = 0
5304 self.__class__ = SizeEvent
54f9ee45 5305_core_.SizeEvent_swigregister(SizeEventPtr)
d14a1e28
RD
5306
5307#---------------------------------------------------------------------------
5308
5309class MoveEvent(Event):
5ba5649b
RD
5310 """
5311 This event object is sent for EVT_MOVE event bindings when a window is
5312 moved to a new position.
5313 """
e811c8ce
RD
5314 def __repr__(self):
5315 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5316 def __init__(self, *args, **kwargs):
5ba5649b
RD
5317 """
5318 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5319
5320 Constructor.
5321 """
54f9ee45 5322 newobj = _core_.new_MoveEvent(*args, **kwargs)
d14a1e28
RD
5323 self.this = newobj.this
5324 self.thisown = 1
5325 del newobj.thisown
e811c8ce 5326 def GetPosition(*args, **kwargs):
5ba5649b
RD
5327 """
5328 GetPosition(self) -> Point
5329
5330 Returns the position of the window generating the move change event.
5331 """
54f9ee45 5332 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5333
5334 def GetRect(*args, **kwargs):
a95a7133 5335 """GetRect(self) -> Rect"""
54f9ee45 5336 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5337
5338 def SetRect(*args, **kwargs):
a95a7133 5339 """SetRect(self, Rect rect)"""
54f9ee45 5340 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5341
5342 def SetPosition(*args, **kwargs):
a95a7133 5343 """SetPosition(self, Point pos)"""
54f9ee45 5344 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 5345
7557b9b5
RD
5346 m_pos = property(GetPosition, SetPosition)
5347 m_rect = property(GetRect, SetRect)
5348
d14a1e28
RD
5349
5350class MoveEventPtr(MoveEvent):
5351 def __init__(self, this):
5352 self.this = this
5353 if not hasattr(self,"thisown"): self.thisown = 0
5354 self.__class__ = MoveEvent
54f9ee45 5355_core_.MoveEvent_swigregister(MoveEventPtr)
d14a1e28
RD
5356
5357#---------------------------------------------------------------------------
5358
5359class PaintEvent(Event):
5ba5649b
RD
5360 """
5361 A paint event is sent when a window's contents needs to be repainted.
5362 Note that in an EVT_PAINT handler the application must *always* create
5363 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5364 Windows assumes that the window has not been painted yet and will send
5365 the event again, causing endless refreshes.
5366
5367 You can optimize painting by retrieving the rectangles that have been
5368 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5369 and only repainting these rectangles. The rectangles are in terms of
5370 the client area, and are unscrolled, so you will need to do some
5371 calculations using the current view position to obtain logical,
5372 scrolled units.
5373
5374 """
e811c8ce
RD
5375 def __repr__(self):
5376 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5377 def __init__(self, *args, **kwargs):
a95a7133 5378 """__init__(self, int Id=0) -> PaintEvent"""
54f9ee45 5379 newobj = _core_.new_PaintEvent(*args, **kwargs)
d14a1e28
RD
5380 self.this = newobj.this
5381 self.thisown = 1
5382 del newobj.thisown
d14a1e28
RD
5383
5384class PaintEventPtr(PaintEvent):
5385 def __init__(self, this):
5386 self.this = this
5387 if not hasattr(self,"thisown"): self.thisown = 0
5388 self.__class__ = PaintEvent
54f9ee45 5389_core_.PaintEvent_swigregister(PaintEventPtr)
d14a1e28
RD
5390
5391class NcPaintEvent(Event):
093d3ff1 5392 """Proxy of C++ NcPaintEvent class"""
e811c8ce
RD
5393 def __repr__(self):
5394 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5395 def __init__(self, *args, **kwargs):
a95a7133 5396 """__init__(self, int winid=0) -> NcPaintEvent"""
54f9ee45 5397 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
d14a1e28
RD
5398 self.this = newobj.this
5399 self.thisown = 1
5400 del newobj.thisown
d14a1e28
RD
5401
5402class NcPaintEventPtr(NcPaintEvent):
5403 def __init__(self, this):
5404 self.this = this
5405 if not hasattr(self,"thisown"): self.thisown = 0
5406 self.__class__ = NcPaintEvent
54f9ee45 5407_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
d14a1e28
RD
5408
5409#---------------------------------------------------------------------------
5410
5411class EraseEvent(Event):
5ba5649b
RD
5412 """
5413 An erase event is sent whenever the background of a window needs to be
5414 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5415 binder. On some platforms, such as GTK+, this event is simulated
5416 (simply generated just before the paint event) and may cause flicker.
5417
5418 To paint a custom background use the `GetDC` method and use the returned
5419 device context if it is not ``None``, otherwise create a temporary
5420 `wx.ClientDC` and draw on that.
5421
5422 """
e811c8ce
RD
5423 def __repr__(self):
5424 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5425 def __init__(self, *args, **kwargs):
5ba5649b
RD
5426 """
5427 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5428
5429 Constructor
5430 """
54f9ee45 5431 newobj = _core_.new_EraseEvent(*args, **kwargs)
d14a1e28
RD
5432 self.this = newobj.this
5433 self.thisown = 1
5434 del newobj.thisown
e811c8ce 5435 def GetDC(*args, **kwargs):
5ba5649b
RD
5436 """
5437 GetDC(self) -> DC
5438
5439 Returns the device context the event handler should draw upon. If
5440 ``None`` is returned then create a temporary `wx.ClientDC` and use
5441 that instead.
5442 """
54f9ee45 5443 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 5444
d14a1e28
RD
5445
5446class EraseEventPtr(EraseEvent):
5447 def __init__(self, this):
5448 self.this = this
5449 if not hasattr(self,"thisown"): self.thisown = 0
5450 self.__class__ = EraseEvent
54f9ee45 5451_core_.EraseEvent_swigregister(EraseEventPtr)
d14a1e28
RD
5452
5453#---------------------------------------------------------------------------
5454
5455class FocusEvent(Event):
5ba5649b
RD
5456 """
5457 A focus event is sent when a window's focus changes. The window losing
5458 focus receives an EVT_KILL_FOCUS event while the window gaining it
5459 gets an EVT_SET_FOCUS event.
5460
5461 Notice that the set focus event happens both when the user gives focus
5462 to the window (whether using the mouse or keyboard) and when it is
5463 done from the program itself using `wx.Window.SetFocus`.
5464
5465 """
e811c8ce
RD
5466 def __repr__(self):
5467 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5468 def __init__(self, *args, **kwargs):
5ba5649b
RD
5469 """
5470 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5471
5472 Constructor
5473 """
54f9ee45 5474 newobj = _core_.new_FocusEvent(*args, **kwargs)
d14a1e28
RD
5475 self.this = newobj.this
5476 self.thisown = 1
5477 del newobj.thisown
e811c8ce 5478 def GetWindow(*args, **kwargs):
5ba5649b
RD
5479 """
5480 GetWindow(self) -> Window
5481
5482 Returns the other window associated with this event, that is the
5483 window which had the focus before for the EVT_SET_FOCUS event and the
5484 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5485
5486 Warning: the window returned may be None!
5487 """
54f9ee45 5488 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
5489
5490 def SetWindow(*args, **kwargs):
a95a7133 5491 """SetWindow(self, Window win)"""
54f9ee45 5492 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 5493
d14a1e28
RD
5494
5495class FocusEventPtr(FocusEvent):
5496 def __init__(self, this):
5497 self.this = this
5498 if not hasattr(self,"thisown"): self.thisown = 0
5499 self.__class__ = FocusEvent
54f9ee45 5500_core_.FocusEvent_swigregister(FocusEventPtr)
d14a1e28
RD
5501
5502#---------------------------------------------------------------------------
5503
5504class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5505 """
5506 wx.ChildFocusEvent notifies the parent that a child has received the
5507 focus. Unlike `wx.FocusEvent` it is propagated up the window
5508 heirarchy.
5509 """
e811c8ce
RD
5510 def __repr__(self):
5511 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5512 def __init__(self, *args, **kwargs):
5ba5649b
RD
5513 """
5514 __init__(self, Window win=None) -> ChildFocusEvent
5515
5516 Constructor
5517 """
54f9ee45 5518 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
d14a1e28
RD
5519 self.this = newobj.this
5520 self.thisown = 1
5521 del newobj.thisown
e811c8ce 5522 def GetWindow(*args, **kwargs):
5ba5649b
RD
5523 """
5524 GetWindow(self) -> Window
5525
5526 The window which has just received the focus.
5527 """
54f9ee45 5528 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 5529
d14a1e28
RD
5530
5531class ChildFocusEventPtr(ChildFocusEvent):
5532 def __init__(self, this):
5533 self.this = this
5534 if not hasattr(self,"thisown"): self.thisown = 0
5535 self.__class__ = ChildFocusEvent
54f9ee45 5536_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
d14a1e28
RD
5537
5538#---------------------------------------------------------------------------
5539
5540class ActivateEvent(Event):
5ba5649b
RD
5541 """
5542 An activate event is sent when a top-level window or the entire
5543 application is being activated or deactivated.
5544
5545 A top-level window (a dialog or frame) receives an activate event when
5546 is being activated or deactivated. This is indicated visually by the
5547 title bar changing colour, and a subwindow gaining the keyboard focus.
5548 An application is activated or deactivated when one of its frames
5549 becomes activated, or a frame becomes inactivate resulting in all
5550 application frames being inactive.
5551
5552 Please note that usually you should call event.Skip() in your handlers
5553 for these events so the default handlers will still be called, as not
5554 doing so can result in strange effects.
5555
5556 """
e811c8ce
RD
5557 def __repr__(self):
5558 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5559 def __init__(self, *args, **kwargs):
5ba5649b
RD
5560 """
5561 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5562
5563 Constructor
5564 """
54f9ee45 5565 newobj = _core_.new_ActivateEvent(*args, **kwargs)
d14a1e28
RD
5566 self.this = newobj.this
5567 self.thisown = 1
5568 del newobj.thisown
e811c8ce 5569 def GetActive(*args, **kwargs):
5ba5649b
RD
5570 """
5571 GetActive(self) -> bool
5572
5573 Returns true if the application or window is being activated, false
5574 otherwise.
5575 """
54f9ee45 5576 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 5577
d14a1e28
RD
5578
5579class ActivateEventPtr(ActivateEvent):
5580 def __init__(self, this):
5581 self.this = this
5582 if not hasattr(self,"thisown"): self.thisown = 0
5583 self.__class__ = ActivateEvent
54f9ee45 5584_core_.ActivateEvent_swigregister(ActivateEventPtr)
d14a1e28
RD
5585
5586#---------------------------------------------------------------------------
5587
5588class InitDialogEvent(Event):
5ba5649b
RD
5589 """
5590 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5591 any window when `wx.Window.InitDialog` is called. Handlers for this
5592 event can transfer data to the window, or anything else that should be
5593 done before the user begins editing the form. The default handler
5594 calls `wx.Window.TransferDataToWindow`.
5595 """
e811c8ce
RD
5596 def __repr__(self):
5597 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5598 def __init__(self, *args, **kwargs):
5ba5649b
RD
5599 """
5600 __init__(self, int Id=0) -> InitDialogEvent
5601
5602 Constructor
5603 """
54f9ee45 5604 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
d14a1e28
RD
5605 self.this = newobj.this
5606 self.thisown = 1
5607 del newobj.thisown
d14a1e28
RD
5608
5609class InitDialogEventPtr(InitDialogEvent):
5610 def __init__(self, this):
5611 self.this = this
5612 if not hasattr(self,"thisown"): self.thisown = 0
5613 self.__class__ = InitDialogEvent
54f9ee45 5614_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
d14a1e28
RD
5615
5616#---------------------------------------------------------------------------
5617
5618class MenuEvent(Event):
5ba5649b
RD
5619 """
5620 This class is used for a variety of menu-related events. Note that
5621 these do not include menu command events, which are handled by sending
5622 `wx.CommandEvent` objects.
5623
5624 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5625 text in the first field of the status bar.
5626 """
e811c8ce
RD
5627 def __repr__(self):
5628 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5629 def __init__(self, *args, **kwargs):
5ba5649b
RD
5630 """
5631 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5632
5633 Constructor
5634 """
54f9ee45 5635 newobj = _core_.new_MenuEvent(*args, **kwargs)
d14a1e28
RD
5636 self.this = newobj.this
5637 self.thisown = 1
5638 del newobj.thisown
e811c8ce 5639 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5640 """
5641 GetMenuId(self) -> int
5642
5643 Returns the menu identifier associated with the event. This method
5644 should be only used with the HIGHLIGHT events.
5645 """
54f9ee45 5646 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
5647
5648 def IsPopup(*args, **kwargs):
5ba5649b
RD
5649 """
5650 IsPopup(self) -> bool
5651
5652 Returns ``True`` if the menu which is being opened or closed is a
5653 popup menu, ``False`` if it is a normal one. This method should only
5654 be used with the OPEN and CLOSE events.
5655 """
54f9ee45 5656 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
5657
5658 def GetMenu(*args, **kwargs):
5ba5649b
RD
5659 """
5660 GetMenu(self) -> Menu
5661
5662 Returns the menu which is being opened or closed. This method should
5663 only be used with the OPEN and CLOSE events.
5664 """
54f9ee45 5665 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 5666
d14a1e28
RD
5667
5668class MenuEventPtr(MenuEvent):
5669 def __init__(self, this):
5670 self.this = this
5671 if not hasattr(self,"thisown"): self.thisown = 0
5672 self.__class__ = MenuEvent
54f9ee45 5673_core_.MenuEvent_swigregister(MenuEventPtr)
d14a1e28
RD
5674
5675#---------------------------------------------------------------------------
5676
5677class CloseEvent(Event):
5ba5649b
RD
5678 """
5679 This event class contains information about window and session close
5680 events.
5681
5682 The handler function for EVT_CLOSE is called when the user has tried
5683 to close a a frame or dialog box using the window manager controls or
5684 the system menu. It can also be invoked by the application itself
5685 programmatically, for example by calling the `wx.Window.Close`
5686 function.
5687
5688 You should check whether the application is forcing the deletion of
5689 the window using `CanVeto`. If it returns ``False``, you must destroy
5690 the window using `wx.Window.Destroy`. If the return value is ``True``,
5691 it is up to you whether you respond by destroying the window or not.
5692 For example you may wish to display a message dialog prompting to save
5693 files or to cancel the close.
5694
5695 If you don't destroy the window, you should call `Veto` to let the
5696 calling code know that you did not destroy the window. This allows the
5697 `wx.Window.Close` function to return ``True`` or ``False`` depending
5698 on whether the close instruction was honored or not.
5699 """
e811c8ce
RD
5700 def __repr__(self):
5701 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5702 def __init__(self, *args, **kwargs):
5ba5649b
RD
5703 """
5704 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5705
5706 Constructor.
5707 """
54f9ee45 5708 newobj = _core_.new_CloseEvent(*args, **kwargs)
d14a1e28
RD
5709 self.this = newobj.this
5710 self.thisown = 1
5711 del newobj.thisown
e811c8ce 5712 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5713 """
5714 SetLoggingOff(self, bool logOff)
5715
5716 Sets the 'logging off' flag.
5717 """
54f9ee45 5718 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
5719
5720 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5721 """
5722 GetLoggingOff(self) -> bool
5723
6c75a4cf
RD
5724 Returns ``True`` if the user is logging off or ``False`` if the
5725 system is shutting down. This method can only be called for end
5726 session and query end session events, it doesn't make sense for close
5727 window event.
5ba5649b 5728 """
54f9ee45 5729 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
5730
5731 def Veto(*args, **kwargs):
5ba5649b
RD
5732 """
5733 Veto(self, bool veto=True)
5734
5735 Call this from your event handler to veto a system shutdown or to
5736 signal to the calling application that a window close did not happen.
5737
5738 You can only veto a shutdown or close if `CanVeto` returns true.
5739 """
54f9ee45 5740 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce 5741
5ba5649b
RD
5742 def GetVeto(*args, **kwargs):
5743 """GetVeto(self) -> bool"""
5744 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5745
e811c8ce 5746 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5747 """
5748 SetCanVeto(self, bool canVeto)
5749
5750 Sets the 'can veto' flag.
5751 """
54f9ee45 5752 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
5753
5754 def CanVeto(*args, **kwargs):
5ba5649b
RD
5755 """
5756 CanVeto(self) -> bool
e811c8ce 5757
5ba5649b
RD
5758 Returns true if you can veto a system shutdown or a window close
5759 event. Vetoing a window close event is not possible if the calling
5760 code wishes to force the application to exit, and so this function
5761 must be called to check this.
5762 """
5763 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce 5764
d14a1e28
RD
5765
5766class CloseEventPtr(CloseEvent):
5767 def __init__(self, this):
5768 self.this = this
5769 if not hasattr(self,"thisown"): self.thisown = 0
5770 self.__class__ = CloseEvent
54f9ee45 5771_core_.CloseEvent_swigregister(CloseEventPtr)
d14a1e28
RD
5772
5773#---------------------------------------------------------------------------
5774
5775class ShowEvent(Event):
5ba5649b 5776 """An EVT_SHOW event is sent when a window is shown or hidden."""
e811c8ce
RD
5777 def __repr__(self):
5778 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5779 def __init__(self, *args, **kwargs):
5ba5649b
RD
5780 """
5781 __init__(self, int winid=0, bool show=False) -> ShowEvent
5782
5783 An EVT_SHOW event is sent when a window is shown or hidden.
5784 """
54f9ee45 5785 newobj = _core_.new_ShowEvent(*args, **kwargs)
d14a1e28
RD
5786 self.this = newobj.this
5787 self.thisown = 1
5788 del newobj.thisown
e811c8ce 5789 def SetShow(*args, **kwargs):
a95a7133 5790 """SetShow(self, bool show)"""
54f9ee45 5791 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
5792
5793 def GetShow(*args, **kwargs):
a95a7133 5794 """GetShow(self) -> bool"""
54f9ee45 5795 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 5796
d14a1e28
RD
5797
5798class ShowEventPtr(ShowEvent):
5799 def __init__(self, this):
5800 self.this = this
5801 if not hasattr(self,"thisown"): self.thisown = 0
5802 self.__class__ = ShowEvent
54f9ee45 5803_core_.ShowEvent_swigregister(ShowEventPtr)
d14a1e28
RD
5804
5805#---------------------------------------------------------------------------
5806
5807class IconizeEvent(Event):
5ba5649b
RD
5808 """
5809 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5810 restored.
5811 """
e811c8ce
RD
5812 def __repr__(self):
5813 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5814 def __init__(self, *args, **kwargs):
5ba5649b
RD
5815 """
5816 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5817
5818 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5819 restored.
5820 """
54f9ee45 5821 newobj = _core_.new_IconizeEvent(*args, **kwargs)
d14a1e28
RD
5822 self.this = newobj.this
5823 self.thisown = 1
5824 del newobj.thisown
e811c8ce 5825 def Iconized(*args, **kwargs):
5ba5649b
RD
5826 """
5827 Iconized(self) -> bool
5828
5829 Returns ``True`` if the frame has been iconized, ``False`` if it has
5830 been restored.
5831 """
54f9ee45 5832 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 5833
d14a1e28
RD
5834
5835class IconizeEventPtr(IconizeEvent):
5836 def __init__(self, this):
5837 self.this = this
5838 if not hasattr(self,"thisown"): self.thisown = 0
5839 self.__class__ = IconizeEvent
54f9ee45 5840_core_.IconizeEvent_swigregister(IconizeEventPtr)
d14a1e28
RD
5841
5842#---------------------------------------------------------------------------
5843
5844class MaximizeEvent(Event):
5ba5649b 5845 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
e811c8ce
RD
5846 def __repr__(self):
5847 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5848 def __init__(self, *args, **kwargs):
5ba5649b
RD
5849 """
5850 __init__(self, int id=0) -> MaximizeEvent
5851
5852 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5853 """
54f9ee45 5854 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
d14a1e28
RD
5855 self.this = newobj.this
5856 self.thisown = 1
5857 del newobj.thisown
d14a1e28
RD
5858
5859class MaximizeEventPtr(MaximizeEvent):
5860 def __init__(self, this):
5861 self.this = this
5862 if not hasattr(self,"thisown"): self.thisown = 0
5863 self.__class__ = MaximizeEvent
54f9ee45 5864_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
d14a1e28
RD
5865
5866#---------------------------------------------------------------------------
5867
5868class DropFilesEvent(Event):
5ba5649b
RD
5869 """
5870 This class is used for drop files events, that is, when files have
5871 been dropped onto the window. This functionality is only available
5872 under Windows. The window must have previously been enabled for
5873 dropping by calling `wx.Window.DragAcceptFiles`.
5874
5875 Important note: this is a separate implementation to the more general
5876 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5877 implementation uses the older, Windows message-based approach of
5878 dropping files.
5879
5880 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5881 events.
5882
5883 """
d14a1e28
RD
5884 def __init__(self): raise RuntimeError, "No constructor defined"
5885 def __repr__(self):
5886 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 5887 def GetPosition(*args, **kwargs):
5ba5649b
RD
5888 """
5889 GetPosition(self) -> Point
5890
5891 Returns the position at which the files were dropped.
5892 """
54f9ee45 5893 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5894
5895 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5896 """
5897 GetNumberOfFiles(self) -> int
5898
5899 Returns the number of files dropped.
5900 """
54f9ee45 5901 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
5902
5903 def GetFiles(*args, **kwargs):
5ba5649b
RD
5904 """
5905 GetFiles(self) -> PyObject
5906
5907 Returns a list of the filenames that were dropped.
5908 """
54f9ee45 5909 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 5910
d14a1e28
RD
5911
5912class DropFilesEventPtr(DropFilesEvent):
5913 def __init__(self, this):
5914 self.this = this
5915 if not hasattr(self,"thisown"): self.thisown = 0
5916 self.__class__ = DropFilesEvent
54f9ee45 5917_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
d14a1e28
RD
5918
5919#---------------------------------------------------------------------------
5920
54f9ee45
RD
5921UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5922UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 5923class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5924 """
5925 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5926 wxWidgets to give an application the chance to update various user
5927 interface elements.
5928
5929 Without update UI events, an application has to work hard to
5930 check/uncheck, enable/disable, and set the text for elements such as
5931 menu items and toolbar buttons. The code for doing this has to be
5932 mixed up with the code that is invoked when an action is invoked for a
5933 menu item or button.
5934
5935 With update UI events, you define an event handler to look at the
5936 state of the application and change UI elements accordingly. wxWidgets
5937 will call your handler functions in idle time, so you don't have to
5938 worry where to call this code. In addition to being a clearer and more
5939 declarative method, it also means you don't have to worry whether
5940 you're updating a toolbar or menubar identifier. The same handler can
5941 update a menu item and toolbar button, if the ID values are the same.
5942
5943 Instead of directly manipulating the menu or button, you call
5944 functions in the event object, such as `Check`. wxWidgets will
5945 determine whether such a call has been made, and which UI element to
5946 update.
5947
5948 These events will work for popup menus as well as menubars. Just
5949 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5950 any UI events for the window that owns the menu.
5951
5952 If you find that the overhead of UI update processing is affecting
5953 your application, you can do one or both of the following:
5954
5955 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5956 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5957 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5958 receive update events. No other windows will receive update
5959 events.
5960
5961 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5962 value to set the delay between updates. You may need to call
5963 `wx.Window.UpdateWindowUI` at critical points, for example when
5964 a dialog is about to be shown, in case the user sees a slight
5965 delay before windows are updated.
5966
5967 Note that although events are sent in idle time, defining a EVT_IDLE
5968 handler for a window does not affect this because the events are sent
5969 from an internal idle handler.
5970
5971 wxWidgets tries to optimize update events on some platforms. On
5972 Windows and GTK+, events for menubar items are only sent when the menu
5973 is about to be shown, and not in idle time.
5974
5975 """
e811c8ce
RD
5976 def __repr__(self):
5977 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5978 def __init__(self, *args, **kwargs):
5ba5649b
RD
5979 """
5980 __init__(self, int commandId=0) -> UpdateUIEvent
5981
5982 Constructor
5983 """
54f9ee45 5984 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
d14a1e28
RD
5985 self.this = newobj.this
5986 self.thisown = 1
5987 del newobj.thisown
e811c8ce 5988 def GetChecked(*args, **kwargs):
5ba5649b
RD
5989 """
5990 GetChecked(self) -> bool
5991
5992 Returns ``True`` if the UI element should be checked.
5993 """
54f9ee45 5994 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
5995
5996 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5997 """
5998 GetEnabled(self) -> bool
5999
6000 Returns ``True`` if the UI element should be enabled.
6001 """
54f9ee45 6002 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce
RD
6003
6004 def GetText(*args, **kwargs):
5ba5649b
RD
6005 """
6006 GetText(self) -> String
6007
6008 Returns the text that should be set for the UI element.
6009 """
54f9ee45 6010 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
6011
6012 def GetSetText(*args, **kwargs):
5ba5649b
RD
6013 """
6014 GetSetText(self) -> bool
6015
6016 Returns ``True`` if the application has called `SetText`. For
6017 wxWidgets internal use only.
6018 """
54f9ee45 6019 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
6020
6021 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
6022 """
6023 GetSetChecked(self) -> bool
6024
6025 Returns ``True`` if the application has called `Check`. For wxWidgets
6026 internal use only.
6027 """
54f9ee45 6028 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
6029
6030 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
6031 """
6032 GetSetEnabled(self) -> bool
6033
6034 Returns ``True`` if the application has called `Enable`. For wxWidgets
6035 internal use only.
6036 """
54f9ee45 6037 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce
RD
6038
6039 def Check(*args, **kwargs):
5ba5649b
RD
6040 """
6041 Check(self, bool check)
6042
6043 Check or uncheck the UI element.
6044 """
54f9ee45 6045 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
6046
6047 def Enable(*args, **kwargs):
5ba5649b
RD
6048 """
6049 Enable(self, bool enable)
6050
6051 Enable or disable the UI element.
6052 """
54f9ee45 6053 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce
RD
6054
6055 def SetText(*args, **kwargs):
5ba5649b
RD
6056 """
6057 SetText(self, String text)
6058
6059 Sets the text for this UI element.
6060 """
54f9ee45 6061 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
6062
6063 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6064 """
6065 SetUpdateInterval(long updateInterval)
6066
6067 Sets the interval between updates in milliseconds. Set to -1 to
6068 disable updates, or to 0 to update as frequently as possible. The
6069 default is 0.
6070
6071 Use this to reduce the overhead of UI update events if your
6072 application has a lot of windows. If you set the value to -1 or
6073 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6074 at appropriate points in your application, such as when a dialog is
6075 about to be shown.
6076 """
54f9ee45 6077 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
6078
6079 SetUpdateInterval = staticmethod(SetUpdateInterval)
6080 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6081 """
6082 GetUpdateInterval() -> long
6083
6084 Returns the current interval between updates in milliseconds. -1
6085 disables updates, 0 updates as frequently as possible.
6086 """
54f9ee45 6087 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
6088
6089 GetUpdateInterval = staticmethod(GetUpdateInterval)
6090 def CanUpdate(*args, **kwargs):
5ba5649b
RD
6091 """
6092 CanUpdate(Window win) -> bool
6093
6094 Returns ``True`` if it is appropriate to update (send UI update events
6095 to) this window.
6096
6097 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6098 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6099 events were last sent in idle time, and the update interval, to
6100 determine whether events should be sent to this window now. By default
6101 this will always return true because the update mode is initially
6102 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6103 events will be sent as often as possible. You can reduce the frequency
6104 that events are sent by changing the mode and/or setting an update
6105 interval.
6106
6107 """
54f9ee45 6108 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
6109
6110 CanUpdate = staticmethod(CanUpdate)
6111 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6112 """
6113 ResetUpdateTime()
6114
6115 Used internally to reset the last-updated time to the current time. It
6116 is assumed that update events are normally sent in idle time, so this
6117 is called at the end of idle processing.
6118 """
54f9ee45 6119 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
6120
6121 ResetUpdateTime = staticmethod(ResetUpdateTime)
6122 def SetMode(*args, **kwargs):
5ba5649b
RD
6123 """
6124 SetMode(int mode)
6125
6126 Specify how wxWidgets will send update events: to all windows, or only
6127 to those which specify that they will process the events.
6128
6129 The mode may be one of the following values:
6130
6131 ============================= ==========================================
6132 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6133 is the default setting.
6134 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6135 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6136 style set.
6137 ============================= ==========================================
6138
6139 """
54f9ee45 6140 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6141
6142 SetMode = staticmethod(SetMode)
6143 def GetMode(*args, **kwargs):
5ba5649b
RD
6144 """
6145 GetMode() -> int
6146
6147 Returns a value specifying how wxWidgets will send update events: to
6148 all windows, or only to those which specify that they will process the
6149 events.
6150 """
54f9ee45 6151 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6152
6153 GetMode = staticmethod(GetMode)
d14a1e28
RD
6154
6155class UpdateUIEventPtr(UpdateUIEvent):
6156 def __init__(self, this):
6157 self.this = this
6158 if not hasattr(self,"thisown"): self.thisown = 0
6159 self.__class__ = UpdateUIEvent
54f9ee45 6160_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
d14a1e28 6161
e811c8ce 6162def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6163 """
6164 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6165
6166 Sets the interval between updates in milliseconds. Set to -1 to
6167 disable updates, or to 0 to update as frequently as possible. The
6168 default is 0.
6169
6170 Use this to reduce the overhead of UI update events if your
6171 application has a lot of windows. If you set the value to -1 or
6172 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6173 at appropriate points in your application, such as when a dialog is
6174 about to be shown.
6175 """
54f9ee45 6176 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 6177
e811c8ce 6178def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6179 """
6180 UpdateUIEvent_GetUpdateInterval() -> long
6181
6182 Returns the current interval between updates in milliseconds. -1
6183 disables updates, 0 updates as frequently as possible.
6184 """
54f9ee45 6185 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d14a1e28 6186
e811c8ce 6187def UpdateUIEvent_CanUpdate(*args, **kwargs):
5ba5649b
RD
6188 """
6189 UpdateUIEvent_CanUpdate(Window win) -> bool
6190
6191 Returns ``True`` if it is appropriate to update (send UI update events
6192 to) this window.
6193
6194 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6195 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6196 events were last sent in idle time, and the update interval, to
6197 determine whether events should be sent to this window now. By default
6198 this will always return true because the update mode is initially
6199 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6200 events will be sent as often as possible. You can reduce the frequency
6201 that events are sent by changing the mode and/or setting an update
6202 interval.
6203
6204 """
54f9ee45 6205 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 6206
e811c8ce 6207def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6208 """
6209 UpdateUIEvent_ResetUpdateTime()
6210
6211 Used internally to reset the last-updated time to the current time. It
6212 is assumed that update events are normally sent in idle time, so this
6213 is called at the end of idle processing.
6214 """
54f9ee45 6215 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d14a1e28 6216
e811c8ce 6217def UpdateUIEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6218 """
6219 UpdateUIEvent_SetMode(int mode)
6220
6221 Specify how wxWidgets will send update events: to all windows, or only
6222 to those which specify that they will process the events.
6223
6224 The mode may be one of the following values:
6225
6226 ============================= ==========================================
6227 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6228 is the default setting.
6229 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6230 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6231 style set.
6232 ============================= ==========================================
6233
6234 """
54f9ee45 6235 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 6236
e811c8ce 6237def UpdateUIEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6238 """
6239 UpdateUIEvent_GetMode() -> int
6240
6241 Returns a value specifying how wxWidgets will send update events: to
6242 all windows, or only to those which specify that they will process the
6243 events.
6244 """
54f9ee45 6245 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d14a1e28
RD
6246
6247#---------------------------------------------------------------------------
6248
6249class SysColourChangedEvent(Event):
5ba5649b
RD
6250 """
6251 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6252 when the user changes the colour settings using the control
6253 panel. This is only applicable under Windows.
6254
6255 The default event handler for this event propagates the event to child
6256 windows, since Windows only sends the events to top-level windows. If
6257 intercepting this event for a top-level window, remember to call
6258 `Skip` so the the base class handler will still be executed, or to
6259 pass the event on to the window's children explicitly.
6260
6261 """
e811c8ce
RD
6262 def __repr__(self):
6263 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6264 def __init__(self, *args, **kwargs):
5ba5649b
RD
6265 """
6266 __init__(self) -> SysColourChangedEvent
6267
6268 Constructor
6269 """
54f9ee45 6270 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
d14a1e28
RD
6271 self.this = newobj.this
6272 self.thisown = 1
6273 del newobj.thisown
d14a1e28
RD
6274
6275class SysColourChangedEventPtr(SysColourChangedEvent):
6276 def __init__(self, this):
6277 self.this = this
6278 if not hasattr(self,"thisown"): self.thisown = 0
6279 self.__class__ = SysColourChangedEvent
54f9ee45 6280_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
d14a1e28
RD
6281
6282#---------------------------------------------------------------------------
6283
6284class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6285 """
6286 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6287 a window that loses its mouse capture. This is called even if
6288 `wx.Window.ReleaseMouse` was called by the application code. Handling
6289 this event allows an application to cater for unexpected capture
6290 releases which might otherwise confuse mouse handling code.
6291
6292 This event is implemented under Windows only.
6293 """
e811c8ce
RD
6294 def __repr__(self):
6295 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6296 def __init__(self, *args, **kwargs):
5ba5649b
RD
6297 """
6298 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6299
6300 Constructor
6301 """
54f9ee45 6302 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
d14a1e28
RD
6303 self.this = newobj.this
6304 self.thisown = 1
6305 del newobj.thisown
e811c8ce 6306 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6307 """
6308 GetCapturedWindow(self) -> Window
6309
6310 Returns the window that gained the capture, or ``None`` if it was a
6311 non-wxWidgets window.
6312 """
54f9ee45 6313 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 6314
d14a1e28
RD
6315
6316class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
6317 def __init__(self, this):
6318 self.this = this
6319 if not hasattr(self,"thisown"): self.thisown = 0
6320 self.__class__ = MouseCaptureChangedEvent
54f9ee45 6321_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
d14a1e28
RD
6322
6323#---------------------------------------------------------------------------
6324
6325class DisplayChangedEvent(Event):
5ba5649b
RD
6326 """
6327 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6328 resolution has changed.
6329
6330 This event is implemented under Windows only.
6331 """
e811c8ce
RD
6332 def __repr__(self):
6333 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6334 def __init__(self, *args, **kwargs):
a95a7133 6335 """__init__(self) -> DisplayChangedEvent"""
54f9ee45 6336 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
d14a1e28
RD
6337 self.this = newobj.this
6338 self.thisown = 1
6339 del newobj.thisown
d14a1e28
RD
6340
6341class DisplayChangedEventPtr(DisplayChangedEvent):
6342 def __init__(self, this):
6343 self.this = this
6344 if not hasattr(self,"thisown"): self.thisown = 0
6345 self.__class__ = DisplayChangedEvent
54f9ee45 6346_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
d14a1e28
RD
6347
6348#---------------------------------------------------------------------------
6349
6350class PaletteChangedEvent(Event):
5ba5649b
RD
6351 """
6352 An EVT_PALETTE_CHANGED event is sent when the system palette has
6353 changed, thereby giving each window a chance to redo their own to
6354 match.
6355
6356 This event is implemented under Windows only.
6357 """
e811c8ce
RD
6358 def __repr__(self):
6359 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6360 def __init__(self, *args, **kwargs):
5ba5649b
RD
6361 """
6362 __init__(self, int id=0) -> PaletteChangedEvent
6363
6364 An EVT_PALETTE_CHANGED event is sent when the system palette has
6365 changed, thereby giving each window a chance to redo their own to
6366 match.
6367
6368 This event is implemented under Windows only.
6369 """
54f9ee45 6370 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
d14a1e28
RD
6371 self.this = newobj.this
6372 self.thisown = 1
6373 del newobj.thisown
e811c8ce 6374 def SetChangedWindow(*args, **kwargs):
a95a7133 6375 """SetChangedWindow(self, Window win)"""
54f9ee45 6376 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
6377
6378 def GetChangedWindow(*args, **kwargs):
a95a7133 6379 """GetChangedWindow(self) -> Window"""
54f9ee45 6380 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 6381
d14a1e28
RD
6382
6383class PaletteChangedEventPtr(PaletteChangedEvent):
6384 def __init__(self, this):
6385 self.this = this
6386 if not hasattr(self,"thisown"): self.thisown = 0
6387 self.__class__ = PaletteChangedEvent
54f9ee45 6388_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
d14a1e28
RD
6389
6390#---------------------------------------------------------------------------
6391
6392class QueryNewPaletteEvent(Event):
5ba5649b
RD
6393 """
6394 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6395 focus and should re-do its palette.
6396
6397 This event is implemented under Windows only.
6398 """
e811c8ce
RD
6399 def __repr__(self):
6400 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6401 def __init__(self, *args, **kwargs):
5ba5649b
RD
6402 """
6403 __init__(self, int winid=0) -> QueryNewPaletteEvent
6404
6405 Constructor.
6406 """
54f9ee45 6407 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
d14a1e28
RD
6408 self.this = newobj.this
6409 self.thisown = 1
6410 del newobj.thisown
e811c8ce 6411 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6412 """
6413 SetPaletteRealized(self, bool realized)
6414
6415 App should set this if it changes the palette.
6416 """
54f9ee45 6417 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
6418
6419 def GetPaletteRealized(*args, **kwargs):
a95a7133 6420 """GetPaletteRealized(self) -> bool"""
54f9ee45 6421 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 6422
d14a1e28
RD
6423
6424class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
6425 def __init__(self, this):
6426 self.this = this
6427 if not hasattr(self,"thisown"): self.thisown = 0
6428 self.__class__ = QueryNewPaletteEvent
54f9ee45 6429_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
d14a1e28
RD
6430
6431#---------------------------------------------------------------------------
6432
6433class NavigationKeyEvent(Event):
5ba5649b
RD
6434 """
6435 EVT_NAVIGATION_KEY events are used to control moving the focus between
6436 widgets, otherwise known as tab-traversal. You woudl normally not
6437 catch navigation events in applications as there are already
6438 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6439 it useful to send navigation events in certain situations to change
6440 the focus in certain ways, although it's probably easier to just call
6441 `wx.Window.Navigate`.
6442 """
e811c8ce
RD
6443 def __repr__(self):
6444 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6445 def __init__(self, *args, **kwargs):
a95a7133 6446 """__init__(self) -> NavigationKeyEvent"""
54f9ee45 6447 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
d14a1e28
RD
6448 self.this = newobj.this
6449 self.thisown = 1
6450 del newobj.thisown
e811c8ce 6451 def GetDirection(*args, **kwargs):
5ba5649b
RD
6452 """
6453 GetDirection(self) -> bool
6454
6455 Returns ``True`` if the direction is forward, ``False`` otherwise.
6456 """
54f9ee45 6457 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
6458
6459 def SetDirection(*args, **kwargs):
5ba5649b
RD
6460 """
6461 SetDirection(self, bool forward)
6462
6463 Specify the direction that the navigation should take. Usually the
6464 difference between using Tab and Shift-Tab.
6465 """
54f9ee45 6466 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
6467
6468 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6469 """
6470 IsWindowChange(self) -> bool
6471
6472 Returns ``True`` if window change is allowed.
6473 """
54f9ee45 6474 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
6475
6476 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6477 """
6478 SetWindowChange(self, bool ischange)
6479
6480 Specify if the navigation should be able to change parent windows.
6481 For example, changing notebook pages, etc. This is usually implemented
6482 by using Control-Tab.
6483 """
54f9ee45 6484 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 6485
68350608 6486 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6487 """
6488 IsFromTab(self) -> bool
6489
6490 Returns ``True`` if the navigation event is originated from the Tab
6491 key.
6492 """
68350608
RD
6493 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6494
6495 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6496 """
6497 SetFromTab(self, bool bIs)
6498
6499 Set to true under MSW if the event was generated using the tab key.
6500 This is required for proper navogation over radio buttons.
6501 """
68350608
RD
6502 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6503
908b74cd 6504 def SetFlags(*args, **kwargs):
5ba5649b
RD
6505 """
6506 SetFlags(self, long flags)
6507
6508 Set the navigation flags to a combination of the following:
6509
6510 * wx.NavigationKeyEvent.IsBackward
6511 * wx.NavigationKeyEvent.IsForward
6512 * wx.NavigationKeyEvent.WinChange
6513 * wx.NavigationKeyEvent.FromTab
6514
6515 """
908b74cd
RD
6516 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6517
e811c8ce 6518 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6519 """
6520 GetCurrentFocus(self) -> Window
6521
6522 Returns the child window which currenty has the focus. May be
6523 ``None``.
6524 """
54f9ee45 6525 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
6526
6527 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6528 """
6529 SetCurrentFocus(self, Window win)
6530
6531 Set the window that has the focus.
6532 """
54f9ee45 6533 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 6534
b0f7404b 6535 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6536 IsForward = _core_.NavigationKeyEvent_IsForward
6537 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6538 FromTab = _core_.NavigationKeyEvent_FromTab
d14a1e28
RD
6539
6540class NavigationKeyEventPtr(NavigationKeyEvent):
6541 def __init__(self, this):
6542 self.this = this
6543 if not hasattr(self,"thisown"): self.thisown = 0
6544 self.__class__ = NavigationKeyEvent
54f9ee45 6545_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
d14a1e28
RD
6546
6547#---------------------------------------------------------------------------
6548
6549class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6550 """
6551 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6552 underlying GUI object) exists.
6553 """
e811c8ce
RD
6554 def __repr__(self):
6555 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6556 def __init__(self, *args, **kwargs):
5ba5649b
RD
6557 """
6558 __init__(self, Window win=None) -> WindowCreateEvent
6559
6560 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6561 underlying GUI object) exists.
6562 """
54f9ee45 6563 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
d14a1e28
RD
6564 self.this = newobj.this
6565 self.thisown = 1
6566 del newobj.thisown
e811c8ce 6567 def GetWindow(*args, **kwargs):
5ba5649b
RD
6568 """
6569 GetWindow(self) -> Window
6570
6571 Returns the window that this event refers to.
6572 """
54f9ee45 6573 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 6574
d14a1e28
RD
6575
6576class WindowCreateEventPtr(WindowCreateEvent):
6577 def __init__(self, this):
6578 self.this = this
6579 if not hasattr(self,"thisown"): self.thisown = 0
6580 self.__class__ = WindowCreateEvent
54f9ee45 6581_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
d14a1e28
RD
6582
6583class WindowDestroyEvent(CommandEvent):
5ba5649b 6584 """
943e8dfd
RD
6585 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6586 when the GUI window is destroyed.
6587
6588 When a class derived from `wx.Window` is destroyed its destructor will
6589 have already run by the time this event is sent. Therefore this event
6590 will not usually be received at all by the window itself. Since it is
6591 received after the destructor has run, an object should not try to
6592 handle its own wx.WindowDestroyEvent, but it can be used to get
6593 notification of the destruction of another window.
5ba5649b 6594 """
e811c8ce
RD
6595 def __repr__(self):
6596 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6597 def __init__(self, *args, **kwargs):
5ba5649b
RD
6598 """
6599 __init__(self, Window win=None) -> WindowDestroyEvent
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 """
54f9ee45 6611 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
d14a1e28
RD
6612 self.this = newobj.this
6613 self.thisown = 1
6614 del newobj.thisown
e811c8ce 6615 def GetWindow(*args, **kwargs):
5ba5649b
RD
6616 """
6617 GetWindow(self) -> Window
6618
6619 Returns the window that this event refers to.
6620 """
54f9ee45 6621 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 6622
d14a1e28
RD
6623
6624class WindowDestroyEventPtr(WindowDestroyEvent):
6625 def __init__(self, this):
6626 self.this = this
6627 if not hasattr(self,"thisown"): self.thisown = 0
6628 self.__class__ = WindowDestroyEvent
54f9ee45 6629_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
d14a1e28
RD
6630
6631#---------------------------------------------------------------------------
6632
6633class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6634 """
6635 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6636 give the application a chance to show a context (popup) menu.
6637 """
e811c8ce
RD
6638 def __repr__(self):
6639 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6640 def __init__(self, *args, **kwargs):
5ba5649b
RD
6641 """
6642 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6643
6644 Constructor.
6645 """
54f9ee45 6646 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
d14a1e28
RD
6647 self.this = newobj.this
6648 self.thisown = 1
6649 del newobj.thisown
e811c8ce 6650 def GetPosition(*args, **kwargs):
5ba5649b
RD
6651 """
6652 GetPosition(self) -> Point
6653
6654 Returns the position (in screen coordinants) at which the menu should
6655 be shown.
6656 """
54f9ee45 6657 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
6658
6659 def SetPosition(*args, **kwargs):
5ba5649b
RD
6660 """
6661 SetPosition(self, Point pos)
6662
6663 Sets the position at which the menu should be shown.
6664 """
54f9ee45 6665 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 6666
d14a1e28
RD
6667
6668class ContextMenuEventPtr(ContextMenuEvent):
6669 def __init__(self, this):
6670 self.this = this
6671 if not hasattr(self,"thisown"): self.thisown = 0
6672 self.__class__ = ContextMenuEvent
54f9ee45 6673_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
d14a1e28
RD
6674
6675#---------------------------------------------------------------------------
6676
54f9ee45
RD
6677IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6678IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 6679class IdleEvent(Event):
5ba5649b
RD
6680 """
6681 This class is used for EVT_IDLE events, which are generated and sent
6682 when the application *becomes* idle. In other words, the when the
6683 event queue becomes empty then idle events are sent to all windows (by
6684 default) and as long as none of them call `RequestMore` then there are
6685 no more idle events until after the system event queue has some normal
6686 events and then becomes empty again.
6687
6688 By default, idle events are sent to all windows. If this is causing a
6689 significant overhead in your application, you can call
6690 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6691 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6692 which should receive idle events. Then idle events will only be sent
6693 to those windows and not to any others.
6694 """
e811c8ce
RD
6695 def __repr__(self):
6696 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6697 def __init__(self, *args, **kwargs):
5ba5649b
RD
6698 """
6699 __init__(self) -> IdleEvent
6700
6701 Constructor
6702 """
54f9ee45 6703 newobj = _core_.new_IdleEvent(*args, **kwargs)
d14a1e28
RD
6704 self.this = newobj.this
6705 self.thisown = 1
6706 del newobj.thisown
e811c8ce 6707 def RequestMore(*args, **kwargs):
5ba5649b
RD
6708 """
6709 RequestMore(self, bool needMore=True)
6710
6711 Tells wxWidgets that more processing is required. This function can be
6712 called by an EVT_IDLE handler for a window to indicate that the
6713 application should forward the EVT_IDLE event once more to the
6714 application windows. If no window calls this function during its
6715 EVT_IDLE handler, then the application will remain in a passive event
6716 loop until a new event is posted to the application by the windowing
6717 system.
6718 """
54f9ee45 6719 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
6720
6721 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6722 """
6723 MoreRequested(self) -> bool
6724
6725 Returns ``True`` if the OnIdle function processing this event
6726 requested more processing time.
6727 """
54f9ee45 6728 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
6729
6730 def SetMode(*args, **kwargs):
5ba5649b
RD
6731 """
6732 SetMode(int mode)
6733
6734 Static method for specifying how wxWidgets will send idle events: to
6735 all windows, or only to those which specify that they will process the
6736 events.
6737
6738 The mode can be one of the following values:
6739
6740 ========================= ========================================
6741 wx.IDLE_PROCESS_ALL Send idle events to all windows
6742 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6743 the wx.WS_EX_PROCESS_IDLE extra style
6744 flag set.
6745 ========================= ========================================
6746
6747 """
54f9ee45 6748 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6749
6750 SetMode = staticmethod(SetMode)
6751 def GetMode(*args, **kwargs):
5ba5649b
RD
6752 """
6753 GetMode() -> int
6754
6755 Static method returning a value specifying how wxWidgets will send
6756 idle events: to all windows, or only to those which specify that they
6757 will process the events.
6758 """
54f9ee45 6759 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6760
6761 GetMode = staticmethod(GetMode)
6762 def CanSend(*args, **kwargs):
5ba5649b
RD
6763 """
6764 CanSend(Window win) -> bool
6765
6766 Returns ``True`` if it is appropriate to send idle events to this
6767 window.
6768
6769 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6770 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6771 events should be sent to this window now. By default this will always
6772 return ``True`` because the update mode is initially
6773 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6774 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6775 """
54f9ee45 6776 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
6777
6778 CanSend = staticmethod(CanSend)
d14a1e28
RD
6779
6780class IdleEventPtr(IdleEvent):
6781 def __init__(self, this):
6782 self.this = this
6783 if not hasattr(self,"thisown"): self.thisown = 0
6784 self.__class__ = IdleEvent
54f9ee45 6785_core_.IdleEvent_swigregister(IdleEventPtr)
d14a1e28 6786
e811c8ce 6787def IdleEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6788 """
6789 IdleEvent_SetMode(int mode)
6790
6791 Static method for specifying how wxWidgets will send idle events: to
6792 all windows, or only to those which specify that they will process the
6793 events.
6794
6795 The mode can be one of the following values:
6796
6797 ========================= ========================================
6798 wx.IDLE_PROCESS_ALL Send idle events to all windows
6799 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6800 the wx.WS_EX_PROCESS_IDLE extra style
6801 flag set.
6802 ========================= ========================================
6803
6804 """
54f9ee45 6805 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 6806
e811c8ce 6807def IdleEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6808 """
6809 IdleEvent_GetMode() -> int
6810
6811 Static method returning a value specifying how wxWidgets will send
6812 idle events: to all windows, or only to those which specify that they
6813 will process the events.
6814 """
54f9ee45 6815 return _core_.IdleEvent_GetMode(*args, **kwargs)
d14a1e28 6816
e811c8ce 6817def IdleEvent_CanSend(*args, **kwargs):
5ba5649b
RD
6818 """
6819 IdleEvent_CanSend(Window win) -> bool
6820
6821 Returns ``True`` if it is appropriate to send idle events to this
6822 window.
6823
6824 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6825 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6826 events should be sent to this window now. By default this will always
6827 return ``True`` because the update mode is initially
6828 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6829 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6830 """
54f9ee45 6831 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
6832
6833#---------------------------------------------------------------------------
6834
6835class PyEvent(Event):
5ba5649b
RD
6836 """
6837 wx.PyEvent can be used as a base class for implementing custom event
6838 types in Python. You should derived from this class instead of
6839 `wx.Event` because this class is Python-aware and is able to transport
6840 its Python bits safely through the wxWidgets event system and have
6841 them still be there when the event handler is invoked.
6842
6843 :see: `wx.PyCommandEvent`
6844
6845 """
e811c8ce
RD
6846 def __repr__(self):
6847 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6848 def __init__(self, *args, **kwargs):
5ba5649b 6849 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
54f9ee45 6850 newobj = _core_.new_PyEvent(*args, **kwargs)
d14a1e28
RD
6851 self.this = newobj.this
6852 self.thisown = 1
6853 del newobj.thisown
5ba5649b 6854 self._SetSelf(self)
e811c8ce 6855
54f9ee45 6856 def __del__(self, destroy=_core_.delete_PyEvent):
a95a7133 6857 """__del__(self)"""
d14a1e28
RD
6858 try:
6859 if self.thisown: destroy(self)
6860 except: pass
e811c8ce 6861
5ba5649b
RD
6862 def _SetSelf(*args, **kwargs):
6863 """_SetSelf(self, PyObject self)"""
6864 return _core_.PyEvent__SetSelf(*args, **kwargs)
e811c8ce 6865
5ba5649b
RD
6866 def _GetSelf(*args, **kwargs):
6867 """_GetSelf(self) -> PyObject"""
6868 return _core_.PyEvent__GetSelf(*args, **kwargs)
e811c8ce 6869
d14a1e28
RD
6870
6871class PyEventPtr(PyEvent):
6872 def __init__(self, this):
6873 self.this = this
6874 if not hasattr(self,"thisown"): self.thisown = 0
6875 self.__class__ = PyEvent
54f9ee45 6876_core_.PyEvent_swigregister(PyEventPtr)
d14a1e28
RD
6877
6878class PyCommandEvent(CommandEvent):
5ba5649b
RD
6879 """
6880 wx.PyCommandEvent can be used as a base class for implementing custom
6881 event types in Python, where the event shoudl travel up to parent
6882 windows looking for a handler. You should derived from this class
6883 instead of `wx.CommandEvent` because this class is Python-aware and is
6884 able to transport its Python bits safely through the wxWidgets event
6885 system and have them still be there when the event handler is invoked.
6886
6887 :see: `wx.PyEvent`
6888
6889 """
e811c8ce
RD
6890 def __repr__(self):
6891 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6892 def __init__(self, *args, **kwargs):
5ba5649b 6893 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
54f9ee45 6894 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
d14a1e28
RD
6895 self.this = newobj.this
6896 self.thisown = 1
6897 del newobj.thisown
5ba5649b 6898 self._SetSelf(self)
e811c8ce 6899
54f9ee45 6900 def __del__(self, destroy=_core_.delete_PyCommandEvent):
a95a7133 6901 """__del__(self)"""
d14a1e28
RD
6902 try:
6903 if self.thisown: destroy(self)
6904 except: pass
e811c8ce 6905
5ba5649b
RD
6906 def _SetSelf(*args, **kwargs):
6907 """_SetSelf(self, PyObject self)"""
6908 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
e811c8ce 6909
5ba5649b
RD
6910 def _GetSelf(*args, **kwargs):
6911 """_GetSelf(self) -> PyObject"""
6912 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
e811c8ce 6913
d14a1e28
RD
6914
6915class PyCommandEventPtr(PyCommandEvent):
6916 def __init__(self, this):
6917 self.this = this
6918 if not hasattr(self,"thisown"): self.thisown = 0
6919 self.__class__ = PyCommandEvent
54f9ee45 6920_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
d14a1e28 6921
53aa7709 6922class DateEvent(CommandEvent):
5ba5649b
RD
6923 """
6924 This event class holds information about a date change event and is
6925 used together with `wx.DatePickerCtrl`. It also serves as a base class
6926 for `wx.calendar.CalendarEvent`. Bind these event types with
6927 EVT_DATE_CHANGED.
6928 """
53aa7709
RD
6929 def __repr__(self):
6930 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6931 def __init__(self, *args, **kwargs):
6932 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6933 newobj = _core_.new_DateEvent(*args, **kwargs)
6934 self.this = newobj.this
6935 self.thisown = 1
6936 del newobj.thisown
6937 def GetDate(*args, **kwargs):
5ba5649b
RD
6938 """
6939 GetDate(self) -> DateTime
6940
6941 Returns the date.
6942 """
53aa7709
RD
6943 return _core_.DateEvent_GetDate(*args, **kwargs)
6944
6945 def SetDate(*args, **kwargs):
5ba5649b
RD
6946 """
6947 SetDate(self, DateTime date)
6948
6949 Sets the date carried by the event, normally only used by the library
6950 internally.
6951 """
53aa7709
RD
6952 return _core_.DateEvent_SetDate(*args, **kwargs)
6953
6954
6955class DateEventPtr(DateEvent):
6956 def __init__(self, this):
6957 self.this = this
6958 if not hasattr(self,"thisown"): self.thisown = 0
6959 self.__class__ = DateEvent
6960_core_.DateEvent_swigregister(DateEventPtr)
6961
6962wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6963EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6964
d14a1e28
RD
6965#---------------------------------------------------------------------------
6966
54f9ee45
RD
6967PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6968PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6969PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6970PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6971PRINT_WINDOWS = _core_.PRINT_WINDOWS
6972PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 6973class PyApp(EvtHandler):
66c033b4
RD
6974 """
6975 The ``wx.PyApp`` class is an *implementation detail*, please use the
6976 `wx.App` class (or some other derived class) instead.
6977 """
e811c8ce
RD
6978 def __repr__(self):
6979 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6980 def __init__(self, *args, **kwargs):
98e665d3 6981 """
a95a7133 6982 __init__(self) -> PyApp
98e665d3
RD
6983
6984 Create a new application object, starting the bootstrap process.
6985 """
54f9ee45 6986 newobj = _core_.new_PyApp(*args, **kwargs)
d14a1e28
RD
6987 self.this = newobj.this
6988 self.thisown = 1
6989 del newobj.thisown
70b7a5fe
RD
6990 self._setCallbackInfo(self, PyApp, False)
6991 self._setOORInfo(self, False)
e811c8ce 6992
54f9ee45 6993 def __del__(self, destroy=_core_.delete_PyApp):
a95a7133 6994 """__del__(self)"""
d14a1e28
RD
6995 try:
6996 if self.thisown: destroy(self)
6997 except: pass
e811c8ce
RD
6998
6999 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 7000 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
54f9ee45 7001 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
7002
7003 def GetAppName(*args, **kwargs):
0df68c9f 7004 """
a95a7133 7005 GetAppName(self) -> String
6c3b4aae 7006
0df68c9f
RD
7007 Get the application name.
7008 """
54f9ee45 7009 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
7010
7011 def SetAppName(*args, **kwargs):
0df68c9f 7012 """
a95a7133 7013 SetAppName(self, String name)
6c3b4aae 7014
66c033b4
RD
7015 Set the application name. This value may be used automatically by
7016 `wx.Config` and such.
0df68c9f 7017 """
54f9ee45 7018 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
7019
7020 def GetClassName(*args, **kwargs):
0df68c9f 7021 """
a95a7133 7022 GetClassName(self) -> String
e811c8ce 7023
0df68c9f
RD
7024 Get the application's class name.
7025 """
54f9ee45 7026 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
7027
7028 def SetClassName(*args, **kwargs):
0df68c9f 7029 """
a95a7133 7030 SetClassName(self, String name)
6c3b4aae 7031
66c033b4
RD
7032 Set the application's class name. This value may be used for
7033 X-resources if applicable for the platform
0df68c9f 7034 """
54f9ee45 7035 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
7036
7037 def GetVendorName(*args, **kwargs):
0df68c9f 7038 """
a95a7133 7039 GetVendorName(self) -> String
6c3b4aae 7040
0df68c9f
RD
7041 Get the application's vendor name.
7042 """
54f9ee45 7043 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
7044
7045 def SetVendorName(*args, **kwargs):
0df68c9f 7046 """
a95a7133 7047 SetVendorName(self, String name)
6c3b4aae 7048
66c033b4
RD
7049 Set the application's vendor name. This value may be used
7050 automatically by `wx.Config` and such.
0df68c9f 7051 """
54f9ee45 7052 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
7053
7054 def GetTraits(*args, **kwargs):
0df68c9f 7055 """
a95a7133 7056 GetTraits(self) -> wxAppTraits
6c3b4aae 7057
66c033b4
RD
7058 Return (and create if necessary) the app traits object to which we
7059 delegate for everything which either should be configurable by the
7060 user (then he can change the default behaviour simply by overriding
7061 CreateTraits() and returning his own traits object) or which is
7062 GUI/console dependent as then wx.AppTraits allows us to abstract the
7063 differences behind the common facade.
7064
7065 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 7066 """
54f9ee45 7067 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
7068
7069 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 7070 """
a95a7133 7071 ProcessPendingEvents(self)
6c3b4aae 7072
66c033b4
RD
7073 Process all events in the Pending Events list -- it is necessary to
7074 call this function to process posted events. This normally happens
7075 during each event loop iteration.
0df68c9f 7076 """
54f9ee45 7077 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
7078
7079 def Yield(*args, **kwargs):
0df68c9f 7080 """
a95a7133 7081 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 7082
66c033b4
RD
7083 Process all currently pending events right now, instead of waiting
7084 until return to the event loop. It is an error to call ``Yield``
7085 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 7086
66c033b4 7087 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
7088 reentrancies (i.e. when called from an event handler it may
7089 result in calling the same event handler again), use with
7090 extreme care or, better, don't use at all!
0df68c9f 7091
66c033b4 7092 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 7093
0df68c9f 7094 """
54f9ee45 7095 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
7096
7097 def WakeUpIdle(*args, **kwargs):
0df68c9f 7098 """
a95a7133 7099 WakeUpIdle(self)
6c3b4aae 7100
66c033b4
RD
7101 Make sure that idle events are sent again.
7102 :see: `wx.WakeUpIdle`
0df68c9f 7103 """
54f9ee45 7104 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 7105
1fc3b23a
RD
7106 def IsMainLoopRunning(*args, **kwargs):
7107 """
7108 IsMainLoopRunning() -> bool
7109
7110 Returns True if we're running the main loop, i.e. if the events can
7111 currently be dispatched.
7112 """
7113 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7114
7115 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 7116 def MainLoop(*args, **kwargs):
0df68c9f 7117 """
a95a7133 7118 MainLoop(self) -> int
6c3b4aae 7119
66c033b4
RD
7120 Execute the main GUI loop, the function doesn't normally return until
7121 all top level windows have been closed and destroyed.
0df68c9f 7122 """
54f9ee45 7123 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
7124
7125 def Exit(*args, **kwargs):
0df68c9f 7126 """
a95a7133 7127 Exit(self)
6c3b4aae 7128
0df68c9f 7129 Exit the main loop thus terminating the application.
66c033b4 7130 :see: `wx.Exit`
0df68c9f 7131 """
54f9ee45 7132 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce
RD
7133
7134 def ExitMainLoop(*args, **kwargs):
0df68c9f 7135 """
a95a7133 7136 ExitMainLoop(self)
6c3b4aae 7137
66c033b4
RD
7138 Exit the main GUI loop during the next iteration of the main
7139 loop, (i.e. it does not stop the program immediately!)
0df68c9f 7140 """
54f9ee45 7141 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
7142
7143 def Pending(*args, **kwargs):
0df68c9f 7144 """
a95a7133 7145 Pending(self) -> bool
6c3b4aae 7146
0df68c9f
RD
7147 Returns True if there are unprocessed events in the event queue.
7148 """
54f9ee45 7149 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
7150
7151 def Dispatch(*args, **kwargs):
0df68c9f 7152 """
a95a7133 7153 Dispatch(self) -> bool
6c3b4aae 7154
0df68c9f
RD
7155 Process the first event in the event queue (blocks until an event
7156 appears if there are none currently)
7157 """
54f9ee45 7158 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
7159
7160 def ProcessIdle(*args, **kwargs):
0df68c9f 7161 """
a95a7133 7162 ProcessIdle(self) -> bool
6c3b4aae 7163
66c033b4
RD
7164 Called from the MainLoop when the application becomes idle (there are
7165 no pending events) and sends a `wx.IdleEvent` to all interested
7166 parties. Returns True if more idle events are needed, False if not.
0df68c9f 7167 """
54f9ee45 7168 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
7169
7170 def SendIdleEvents(*args, **kwargs):
0df68c9f 7171 """
a95a7133 7172 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 7173
66c033b4
RD
7174 Send idle event to window and all subwindows. Returns True if more
7175 idle time is requested.
0df68c9f 7176 """
54f9ee45 7177 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
7178
7179 def IsActive(*args, **kwargs):
0df68c9f 7180 """
a95a7133 7181 IsActive(self) -> bool
6c3b4aae 7182
0df68c9f
RD
7183 Return True if our app has focus.
7184 """
54f9ee45 7185 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
7186
7187 def SetTopWindow(*args, **kwargs):
0df68c9f 7188 """
a95a7133 7189 SetTopWindow(self, Window win)
6c3b4aae 7190
66c033b4 7191 Set the *main* top level window
0df68c9f 7192 """
54f9ee45 7193 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
7194
7195 def GetTopWindow(*args, **kwargs):
0df68c9f 7196 """
a95a7133 7197 GetTopWindow(self) -> Window
6c3b4aae 7198
66c033b4
RD
7199 Return the *main* top level window (if it hadn't been set previously
7200 with SetTopWindow(), will return just some top level window and, if
7201 there not any, will return None)
0df68c9f 7202 """
54f9ee45 7203 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
7204
7205 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 7206 """
a95a7133 7207 SetExitOnFrameDelete(self, bool flag)
0df68c9f 7208
66c033b4
RD
7209 Control the exit behaviour: by default, the program will exit the main
7210 loop (and so, usually, terminate) when the last top-level program
7211 window is deleted. Beware that if you disable this behaviour (with
7212 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7213 explicitly from somewhere.
0df68c9f 7214 """
54f9ee45 7215 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
7216
7217 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 7218 """
a95a7133 7219 GetExitOnFrameDelete(self) -> bool
6c3b4aae 7220
0df68c9f
RD
7221 Get the current exit behaviour setting.
7222 """
54f9ee45 7223 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
7224
7225 def SetUseBestVisual(*args, **kwargs):
0df68c9f 7226 """
a95a7133 7227 SetUseBestVisual(self, bool flag)
6c3b4aae 7228
66c033b4
RD
7229 Set whether the app should try to use the best available visual on
7230 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 7231 """
54f9ee45 7232 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
7233
7234 def GetUseBestVisual(*args, **kwargs):
0df68c9f 7235 """
a95a7133 7236 GetUseBestVisual(self) -> bool
6c3b4aae 7237
0df68c9f
RD
7238 Get current UseBestVisual setting.
7239 """
54f9ee45 7240 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
7241
7242 def SetPrintMode(*args, **kwargs):
a95a7133 7243 """SetPrintMode(self, int mode)"""
54f9ee45 7244 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
7245
7246 def GetPrintMode(*args, **kwargs):
a95a7133 7247 """GetPrintMode(self) -> int"""
54f9ee45 7248 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 7249
e811c8ce 7250 def SetAssertMode(*args, **kwargs):
0df68c9f 7251 """
a95a7133 7252 SetAssertMode(self, int mode)
6c3b4aae 7253
41e2b43e 7254 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 7255 """
54f9ee45 7256 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 7257
6c3b4aae 7258 def GetAssertMode(*args, **kwargs):
0df68c9f 7259 """
a95a7133 7260 GetAssertMode(self) -> int
6c3b4aae 7261
0df68c9f
RD
7262 Get the current OnAssert behaviour setting.
7263 """
54f9ee45 7264 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 7265
e811c8ce 7266 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 7267 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 7268 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
7269
7270 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7271 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 7272 """GetMacAboutMenuItemId() -> long"""
54f9ee45 7273 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
7274
7275 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7276 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 7277 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 7278 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
7279
7280 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7281 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 7282 """GetMacExitMenuItemId() -> long"""
54f9ee45 7283 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
7284
7285 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7286 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 7287 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 7288 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
7289
7290 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7291 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 7292 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 7293 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
7294
7295 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7296 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 7297 """SetMacAboutMenuItemId(long val)"""
54f9ee45 7298 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
7299
7300 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7301 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 7302 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 7303 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
7304
7305 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7306 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 7307 """SetMacExitMenuItemId(long val)"""
54f9ee45 7308 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
7309
7310 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7311 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 7312 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 7313 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
7314
7315 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7316 def _BootstrapApp(*args, **kwargs):
0df68c9f 7317 """
a95a7133 7318 _BootstrapApp(self)
6c3b4aae 7319
0df68c9f
RD
7320 For internal use only
7321 """
54f9ee45 7322 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
7323
7324 def GetComCtl32Version(*args, **kwargs):
0df68c9f 7325 """
66c033b4 7326 GetComCtl32Version() -> int
6c3b4aae 7327
66c033b4
RD
7328 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7329 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7330 """
54f9ee45 7331 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
7332
7333 GetComCtl32Version = staticmethod(GetComCtl32Version)
d14a1e28
RD
7334
7335class PyAppPtr(PyApp):
7336 def __init__(self, this):
7337 self.this = this
7338 if not hasattr(self,"thisown"): self.thisown = 0
7339 self.__class__ = PyApp
54f9ee45 7340_core_.PyApp_swigregister(PyAppPtr)
d14a1e28 7341
1fc3b23a
RD
7342def PyApp_IsMainLoopRunning(*args, **kwargs):
7343 """
7344 PyApp_IsMainLoopRunning() -> bool
7345
7346 Returns True if we're running the main loop, i.e. if the events can
7347 currently be dispatched.
7348 """
7349 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7350
e811c8ce
RD
7351def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
7352 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 7353 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 7354
e811c8ce
RD
7355def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
7356 """PyApp_GetMacAboutMenuItemId() -> long"""
54f9ee45 7357 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 7358
e811c8ce
RD
7359def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
7360 """PyApp_GetMacPreferencesMenuItemId() -> long"""
54f9ee45 7361 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 7362
e811c8ce
RD
7363def PyApp_GetMacExitMenuItemId(*args, **kwargs):
7364 """PyApp_GetMacExitMenuItemId() -> long"""
54f9ee45 7365 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d14a1e28 7366
e811c8ce 7367def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
196addbf 7368 """PyApp_GetMacHelpMenuTitleName() -> String"""
54f9ee45 7369 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 7370
e811c8ce
RD
7371def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7372 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 7373 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 7374
e811c8ce
RD
7375def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7376 """PyApp_SetMacAboutMenuItemId(long val)"""
54f9ee45 7377 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 7378
e811c8ce
RD
7379def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7380 """PyApp_SetMacPreferencesMenuItemId(long val)"""
54f9ee45 7381 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 7382
e811c8ce
RD
7383def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7384 """PyApp_SetMacExitMenuItemId(long val)"""
54f9ee45 7385 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 7386
e811c8ce 7387def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
196addbf 7388 """PyApp_SetMacHelpMenuTitleName(String val)"""
54f9ee45 7389 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 7390
e811c8ce 7391def PyApp_GetComCtl32Version(*args, **kwargs):
0df68c9f
RD
7392 """
7393 PyApp_GetComCtl32Version() -> int
6c3b4aae 7394
66c033b4
RD
7395 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7396 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7397 """
54f9ee45 7398 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d14a1e28
RD
7399
7400#---------------------------------------------------------------------------
7401
7402
e811c8ce 7403def Exit(*args, **kwargs):
0df68c9f
RD
7404 """
7405 Exit()
6c3b4aae 7406
0df68c9f
RD
7407 Force an exit of the application. Convenience for wx.GetApp().Exit()
7408 """
54f9ee45 7409 return _core_.Exit(*args, **kwargs)
d14a1e28 7410
e811c8ce 7411def Yield(*args, **kwargs):
0df68c9f
RD
7412 """
7413 Yield() -> bool
6c3b4aae 7414
0df68c9f
RD
7415 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7416 """
54f9ee45 7417 return _core_.Yield(*args, **kwargs)
d14a1e28 7418
e811c8ce 7419def YieldIfNeeded(*args, **kwargs):
0df68c9f
RD
7420 """
7421 YieldIfNeeded() -> bool
6c3b4aae 7422
0df68c9f
RD
7423 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7424 """
54f9ee45 7425 return _core_.YieldIfNeeded(*args, **kwargs)
d14a1e28 7426
e811c8ce 7427def SafeYield(*args, **kwargs):
0df68c9f
RD
7428 """
7429 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 7430
66c033b4
RD
7431 This function is similar to `wx.Yield`, except that it disables the
7432 user input to all program windows before calling `wx.Yield` and
7433 re-enables it again afterwards. If ``win`` is not None, this window
7434 will remain enabled, allowing the implementation of some limited user
7435 interaction.
6c3b4aae 7436
66c033b4 7437 :Returns: the result of the call to `wx.Yield`.
0df68c9f 7438 """
54f9ee45 7439 return _core_.SafeYield(*args, **kwargs)
d14a1e28 7440
e811c8ce 7441def WakeUpIdle(*args, **kwargs):
0df68c9f
RD
7442 """
7443 WakeUpIdle()
6c3b4aae 7444
66c033b4
RD
7445 Cause the message queue to become empty again, so idle events will be
7446 sent.
0df68c9f 7447 """
54f9ee45 7448 return _core_.WakeUpIdle(*args, **kwargs)
d14a1e28 7449
e811c8ce 7450def PostEvent(*args, **kwargs):
0df68c9f
RD
7451 """
7452 PostEvent(EvtHandler dest, Event event)
6c3b4aae 7453
66c033b4
RD
7454 Send an event to a window or other wx.EvtHandler to be processed
7455 later.
0df68c9f 7456 """
54f9ee45 7457 return _core_.PostEvent(*args, **kwargs)
d14a1e28 7458
e811c8ce 7459def App_CleanUp(*args, **kwargs):
0df68c9f
RD
7460 """
7461 App_CleanUp()
6c3b4aae 7462
41e2b43e 7463 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 7464 Python shuts down.
0df68c9f 7465 """
54f9ee45 7466 return _core_.App_CleanUp(*args, **kwargs)
d14a1e28 7467
e811c8ce 7468def GetApp(*args, **kwargs):
0df68c9f
RD
7469 """
7470 GetApp() -> PyApp
6c3b4aae 7471
196addbf 7472 Return a reference to the current wx.App object.
0df68c9f 7473 """
54f9ee45 7474 return _core_.GetApp(*args, **kwargs)
5cbf236d
RD
7475
7476def SetDefaultPyEncoding(*args, **kwargs):
7477 """
7478 SetDefaultPyEncoding(string encoding)
7479
7480 Sets the encoding that wxPython will use when it needs to convert a
7481 Python string or unicode object to or from a wxString.
e505d15e
RD
7482
7483 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7484 but please be aware that the default encoding within the same locale
7485 may be slightly different on different platforms. For example, please
7486 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7487 between the common latin/roman encodings.
5cbf236d
RD
7488 """
7489 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7490
7491def GetDefaultPyEncoding(*args, **kwargs):
7492 """
7493 GetDefaultPyEncoding() -> string
7494
7495 Gets the current encoding that wxPython will use when it needs to
7496 convert a Python string or unicode object to or from a wxString.
7497 """
7498 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d14a1e28
RD
7499#----------------------------------------------------------------------
7500
7501class PyOnDemandOutputWindow:
6c3b4aae
RD
7502 """
7503 A class that can be used for redirecting Python's stdout and
7504 stderr streams. It will do nothing until something is wrriten to
7505 the stream at which point it will create a Frame with a text area
7506 and write the text there.
7507 """
d14a1e28
RD
7508 def __init__(self, title = "wxPython: stdout/stderr"):
7509 self.frame = None
7510 self.title = title
412d302d
RD
7511 self.pos = wx.DefaultPosition
7512 self.size = (450, 300)
d14a1e28
RD
7513 self.parent = None
7514
7515 def SetParent(self, parent):
6c3b4aae 7516 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
7517 self.parent = parent
7518
6c3b4aae
RD
7519
7520 def CreateOutputWindow(self, st):
412d302d
RD
7521 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7522 style=wx.DEFAULT_FRAME_STYLE)
196addbf 7523 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7524 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 7525 self.text.AppendText(st)
6c3b4aae
RD
7526 self.frame.Show(True)
7527 EVT_CLOSE(self.frame, self.OnCloseWindow)
7528
d14a1e28 7529
7409c0c6
RD
7530 def OnCloseWindow(self, event):
7531 if self.frame is not None:
7532 self.frame.Destroy()
7533 self.frame = None
7534 self.text = None
7535
7536
d14a1e28 7537 # These methods provide the file-like output behaviour.
6c3b4aae
RD
7538 def write(self, text):
7539 """
7540 Create the output window if needed and write the string to it.
7541 If not called in the context of the gui thread then uses
7542 CallAfter to do the work there.
7543 """
7544 if self.frame is None:
7545 if not wx.Thread_IsMain():
7546 wx.CallAfter(self.CreateOutputWindow, text)
7547 else:
7548 self.CreateOutputWindow(text)
7549 else:
7550 if not wx.Thread_IsMain():
7551 wx.CallAfter(self.text.AppendText, text)
7552 else:
7553 self.text.AppendText(text)
7554
d14a1e28
RD
7555
7556 def close(self):
6c3b4aae
RD
7557 if self.frame is not None:
7558 wx.CallAfter(self.frame.Close)
7559
d14a1e28 7560
19272049
RD
7561 def flush(self):
7562 pass
7563
7564
d14a1e28
RD
7565
7566#----------------------------------------------------------------------
d14a1e28
RD
7567
7568_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7569
7570class App(wx.PyApp):
6c3b4aae 7571 """
66c033b4
RD
7572 The ``wx.App`` class represents the application and is used to:
7573
7574 * bootstrap the wxPython system and initialize the underlying
7575 gui toolkit
7576 * set and get application-wide properties
7577 * implement the windowing system main message or event loop,
7578 and to dispatch events to window instances
7579 * etc.
7580
7581 Every application must have a ``wx.App`` instance, and all
7582 creation of UI objects should be delayed until after the
03e37cd5
RD
7583 ``wx.App`` object has been created in order to ensure that the gui
7584 platform and wxWidgets have been fully initialized.
66c033b4
RD
7585
7586 Normally you would derive from this class and implement an
7587 ``OnInit`` method that creates a frame and then calls
7588 ``self.SetTopWindow(frame)``.
7589
03e37cd5 7590 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 7591 directly.
6c3b4aae 7592 """
66c033b4 7593
d14a1e28
RD
7594 outputWindowClass = PyOnDemandOutputWindow
7595
03e37cd5
RD
7596 def __init__(self, redirect=_defRedirect, filename=None,
7597 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7598 """
7599 Construct a ``wx.App`` object.
7600
03e37cd5
RD
7601 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7602 redirected? Defaults to True on Windows and Mac, False
7603 otherwise. If `filename` is None then output will be
7604 redirected to a window that pops up as needed. (You can
7605 control what kind of window is created for the output by
7606 resetting the class variable ``outputWindowClass`` to a
7607 class of your choosing.)
66c033b4 7608
03e37cd5
RD
7609 :param filename: The name of a file to redirect output to, if
7610 redirect is True.
66c033b4
RD
7611
7612 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
7613 available visual provided by the system (only relevant on
7614 systems that have more than one visual.) This parameter
7615 must be used instead of calling `SetUseBestVisual` later
7616 on because it must be set before the underlying GUI
7617 toolkit is initialized.
7618
7619 :param clearSigInt: Should SIGINT be cleared? This allows the
7620 app to terminate upon a Ctrl-C in the console like other
7621 GUI apps will.
66c033b4
RD
7622
7623 :note: You should override OnInit to do applicaition
7624 initialization to ensure that the system, toolkit and
7625 wxWidgets are fully initialized.
7626 """
d14a1e28
RD
7627 wx.PyApp.__init__(self)
7628
7629 if wx.Platform == "__WXMAC__":
7630 try:
7631 import MacOS
7632 if not MacOS.WMAvailable():
7633 print """\
7634This program needs access to the screen. Please run with 'pythonw',
7635not 'python', and only when you are logged in on the main display of
7636your Mac."""
7637 _sys.exit(1)
36cadbf7
RD
7638 except SystemExit:
7639 raise
d14a1e28
RD
7640 except:
7641 pass
7642
7643 # This has to be done before OnInit
7644 self.SetUseBestVisual(useBestVisual)
7645
7646 # Set the default handler for SIGINT. This fixes a problem
7647 # where if Ctrl-C is pressed in the console that started this
7648 # app then it will not appear to do anything, (not even send
7649 # KeyboardInterrupt???) but will later segfault on exit. By
7650 # setting the default handler then the app will exit, as
7651 # expected (depending on platform.)
03e37cd5
RD
7652 if clearSigInt:
7653 try:
7654 import signal
7655 signal.signal(signal.SIGINT, signal.SIG_DFL)
7656 except:
7657 pass
d14a1e28
RD
7658
7659 # Save and redirect the stdio to a window?
7660 self.stdioWin = None
7661 self.saveStdio = (_sys.stdout, _sys.stderr)
7662 if redirect:
7663 self.RedirectStdio(filename)
7664
8fb0e70a
RD
7665 # Use Python's install prefix as the default
7666 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7667
d14a1e28
RD
7668 # This finishes the initialization of wxWindows and then calls
7669 # the OnInit that should be present in the derived class
7670 self._BootstrapApp()
7671
7672
02b455f2
RD
7673 def __del__(self, destroy=wx.PyApp.__del__):
7674 self.RestoreStdio() # Just in case the MainLoop was overridden
7675 destroy(self)
d14a1e28 7676
70b7a5fe
RD
7677 def Destroy(self):
7678 wx.PyApp.Destroy(self)
7679 self.thisown = 0
d14a1e28
RD
7680
7681 def SetTopWindow(self, frame):
1e0c8722 7682 """Set the \"main\" top level window"""
d14a1e28
RD
7683 if self.stdioWin:
7684 self.stdioWin.SetParent(frame)
7685 wx.PyApp.SetTopWindow(self, frame)
7686
7687
7688 def MainLoop(self):
1e0c8722 7689 """Execute the main GUI event loop"""
d14a1e28
RD
7690 wx.PyApp.MainLoop(self)
7691 self.RestoreStdio()
7692
7693
7409c0c6 7694 def RedirectStdio(self, filename=None):
1e0c8722 7695 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
7696 if filename:
7697 _sys.stdout = _sys.stderr = open(filename, 'a')
7698 else:
7699 self.stdioWin = self.outputWindowClass()
7700 _sys.stdout = _sys.stderr = self.stdioWin
7701
7702
7703 def RestoreStdio(self):
02b455f2
RD
7704 try:
7705 _sys.stdout, _sys.stderr = self.saveStdio
7706 except:
7707 pass
d14a1e28
RD
7708
7709
412d302d
RD
7710 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7711 """
7712 Set the title, position and/or size of the output window if
f5b96ee1
RD
7713 the stdio has been redirected. This should be called before
7714 any output would cause the output window to be created.
412d302d
RD
7715 """
7716 if self.stdioWin:
7717 if title is not None:
7718 self.stdioWin.title = title
7719 if pos is not None:
7720 self.stdioWin.pos = pos
7721 if size is not None:
7722 self.stdioWin.size = size
7723
7724
7725
d14a1e28 7726
66c033b4 7727# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
7728App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7729App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7730App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7731App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7732App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7733App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7734App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7735App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7736App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7737App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7738App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
7739
7740#----------------------------------------------------------------------------
7741
7742class PySimpleApp(wx.App):
6c3b4aae
RD
7743 """
7744 A simple application class. You can just create one of these and
7745 then then make your top level windows later, and not have to worry
66c033b4
RD
7746 about OnInit. For example::
7747
7748 app = wx.PySimpleApp()
7749 frame = wx.Frame(None, title='Hello World')
7750 frame.Show()
7751 app.MainLoop()
7752
7753 :see: `wx.App`
7754 """
6c3b4aae 7755
03e37cd5
RD
7756 def __init__(self, redirect=False, filename=None,
7757 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7758 """
7759 :see: `wx.App.__init__`
7760 """
03e37cd5 7761 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 7762
d14a1e28 7763 def OnInit(self):
d14a1e28
RD
7764 return True
7765
7766
66c033b4 7767
6c3b4aae 7768# Is anybody using this one?
d14a1e28
RD
7769class PyWidgetTester(wx.App):
7770 def __init__(self, size = (250, 100)):
7771 self.size = size
7772 wx.App.__init__(self, 0)
7773
7774 def OnInit(self):
196addbf 7775 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
7776 self.SetTopWindow(self.frame)
7777 return True
7778
66c033b4
RD
7779 def SetWidget(self, widgetClass, *args, **kwargs):
7780 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
7781 self.frame.Show(True)
7782
7783#----------------------------------------------------------------------------
7784# DO NOT hold any other references to this object. This is how we
66c033b4 7785# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 7786# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 7787# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
7788
7789class __wxPyCleanup:
7790 def __init__(self):
54f9ee45 7791 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
7792 def __del__(self):
7793 self.cleanup()
7794
7795_sys.__wxPythonCleanup = __wxPyCleanup()
7796
7797## # another possible solution, but it gets called too early...
66c033b4
RD
7798## import atexit
7799## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
7800
7801
7802#----------------------------------------------------------------------------
7803
7804#---------------------------------------------------------------------------
2ef75293
RD
7805
7806class EventLoop(object):
093d3ff1 7807 """Proxy of C++ EventLoop class"""
2ef75293
RD
7808 def __repr__(self):
7809 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7810 def __init__(self, *args, **kwargs):
7811 """__init__(self) -> EventLoop"""
7812 newobj = _core_.new_EventLoop(*args, **kwargs)
7813 self.this = newobj.this
7814 self.thisown = 1
7815 del newobj.thisown
7816 def __del__(self, destroy=_core_.delete_EventLoop):
7817 """__del__(self)"""
7818 try:
7819 if self.thisown: destroy(self)
7820 except: pass
7821
7822 def Run(*args, **kwargs):
7823 """Run(self) -> int"""
7824 return _core_.EventLoop_Run(*args, **kwargs)
7825
7826 def Exit(*args, **kwargs):
7827 """Exit(self, int rc=0)"""
7828 return _core_.EventLoop_Exit(*args, **kwargs)
7829
7830 def Pending(*args, **kwargs):
7831 """Pending(self) -> bool"""
7832 return _core_.EventLoop_Pending(*args, **kwargs)
7833
7834 def Dispatch(*args, **kwargs):
7835 """Dispatch(self) -> bool"""
7836 return _core_.EventLoop_Dispatch(*args, **kwargs)
7837
7838 def IsRunning(*args, **kwargs):
7839 """IsRunning(self) -> bool"""
7840 return _core_.EventLoop_IsRunning(*args, **kwargs)
7841
7842 def GetActive(*args, **kwargs):
7843 """GetActive() -> EventLoop"""
7844 return _core_.EventLoop_GetActive(*args, **kwargs)
7845
7846 GetActive = staticmethod(GetActive)
7847 def SetActive(*args, **kwargs):
7848 """SetActive(EventLoop loop)"""
7849 return _core_.EventLoop_SetActive(*args, **kwargs)
7850
7851 SetActive = staticmethod(SetActive)
7852
7853class EventLoopPtr(EventLoop):
7854 def __init__(self, this):
7855 self.this = this
7856 if not hasattr(self,"thisown"): self.thisown = 0
7857 self.__class__ = EventLoop
7858_core_.EventLoop_swigregister(EventLoopPtr)
7859
7860def EventLoop_GetActive(*args, **kwargs):
7861 """EventLoop_GetActive() -> EventLoop"""
7862 return _core_.EventLoop_GetActive(*args, **kwargs)
7863
7864def EventLoop_SetActive(*args, **kwargs):
7865 """EventLoop_SetActive(EventLoop loop)"""
7866 return _core_.EventLoop_SetActive(*args, **kwargs)
7867
091f5bed
RD
7868class EventLoopActivator(object):
7869 """Proxy of C++ EventLoopActivator class"""
7870 def __repr__(self):
7871 return "<%s.%s; proxy of C++ wxEventLoopActivator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7872 def __init__(self, *args, **kwargs):
7873 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7874 newobj = _core_.new_EventLoopActivator(*args, **kwargs)
7875 self.this = newobj.this
7876 self.thisown = 1
7877 del newobj.thisown
7878 def __del__(self, destroy=_core_.delete_EventLoopActivator):
7879 """__del__(self)"""
7880 try:
7881 if self.thisown: destroy(self)
7882 except: pass
7883
7884
7885class EventLoopActivatorPtr(EventLoopActivator):
7886 def __init__(self, this):
7887 self.this = this
7888 if not hasattr(self,"thisown"): self.thisown = 0
7889 self.__class__ = EventLoopActivator
7890_core_.EventLoopActivator_swigregister(EventLoopActivatorPtr)
7891
2ef75293 7892#---------------------------------------------------------------------------
d14a1e28 7893
1e0c8722 7894class AcceleratorEntry(object):
66c033b4
RD
7895 """
7896 A class used to define items in an `wx.AcceleratorTable`. wxPython
7897 programs can choose to use wx.AcceleratorEntry objects, but using a
7898 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 7899 as well. See `__init__` for of the tuple values.
66c033b4
RD
7900
7901 :see: `wx.AcceleratorTable`
7902 """
1e0c8722
RD
7903 def __repr__(self):
7904 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7905 def __init__(self, *args, **kwargs):
66c033b4
RD
7906 """
7907 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7908
7909 Construct a wx.AcceleratorEntry.
66c033b4 7910 """
54f9ee45 7911 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
1e0c8722
RD
7912 self.this = newobj.this
7913 self.thisown = 1
7914 del newobj.thisown
54f9ee45 7915 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
a95a7133 7916 """__del__(self)"""
1e0c8722
RD
7917 try:
7918 if self.thisown: destroy(self)
7919 except: pass
7920
7921 def Set(*args, **kwargs):
66c033b4
RD
7922 """
7923 Set(self, int flags, int keyCode, int cmd)
1e0c8722 7924
66c033b4
RD
7925 (Re)set the attributes of a wx.AcceleratorEntry.
7926 :see `__init__`
7927 """
7928 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722
RD
7929
7930 def GetFlags(*args, **kwargs):
66c033b4
RD
7931 """
7932 GetFlags(self) -> int
7933
7934 Get the AcceleratorEntry's flags.
7935 """
54f9ee45 7936 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
7937
7938 def GetKeyCode(*args, **kwargs):
66c033b4
RD
7939 """
7940 GetKeyCode(self) -> int
7941
7942 Get the AcceleratorEntry's keycode.
7943 """
54f9ee45 7944 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
7945
7946 def GetCommand(*args, **kwargs):
66c033b4
RD
7947 """
7948 GetCommand(self) -> int
7949
7950 Get the AcceleratorEntry's command ID.
7951 """
54f9ee45 7952 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722
RD
7953
7954
7955class AcceleratorEntryPtr(AcceleratorEntry):
7956 def __init__(self, this):
7957 self.this = this
7958 if not hasattr(self,"thisown"): self.thisown = 0
7959 self.__class__ = AcceleratorEntry
54f9ee45 7960_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
1e0c8722
RD
7961
7962class AcceleratorTable(Object):
66c033b4
RD
7963 """
7964 An accelerator table allows the application to specify a table of
7965 keyboard shortcuts for menus or other commands. On Windows, menu or
7966 button commands are supported; on GTK, only menu commands are
7967 supported.
66c033b4 7968 """
1e0c8722
RD
7969 def __repr__(self):
7970 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7971 def __init__(self, *args, **kwargs):
0df68c9f
RD
7972 """
7973 __init__(entries) -> AcceleratorTable
1e0c8722 7974
66c033b4
RD
7975 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7976 items or or of 3-tuples (flags, keyCode, cmdID)
7977
7978 :see: `wx.AcceleratorEntry`
0df68c9f 7979 """
54f9ee45 7980 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
1e0c8722
RD
7981 self.this = newobj.this
7982 self.thisown = 1
7983 del newobj.thisown
54f9ee45 7984 def __del__(self, destroy=_core_.delete_AcceleratorTable):
a95a7133 7985 """__del__(self)"""
1e0c8722
RD
7986 try:
7987 if self.thisown: destroy(self)
7988 except: pass
7989
7990 def Ok(*args, **kwargs):
a95a7133 7991 """Ok(self) -> bool"""
54f9ee45 7992 return _core_.AcceleratorTable_Ok(*args, **kwargs)
1e0c8722
RD
7993
7994
7995class AcceleratorTablePtr(AcceleratorTable):
7996 def __init__(self, this):
7997 self.this = this
7998 if not hasattr(self,"thisown"): self.thisown = 0
7999 self.__class__ = AcceleratorTable
54f9ee45 8000_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
1e0c8722
RD
8001
8002
8003def GetAccelFromString(*args, **kwargs):
196addbf 8004 """GetAccelFromString(String label) -> AcceleratorEntry"""
54f9ee45 8005 return _core_.GetAccelFromString(*args, **kwargs)
1e0c8722
RD
8006#---------------------------------------------------------------------------
8007
74a57fcd
RD
8008class VisualAttributes(object):
8009 """struct containing all the visual attributes of a control"""
8010 def __repr__(self):
8011 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8012 def __init__(self, *args, **kwargs):
8013 """
a95a7133 8014 __init__(self) -> VisualAttributes
74a57fcd
RD
8015
8016 struct containing all the visual attributes of a control
8017 """
54f9ee45 8018 newobj = _core_.new_VisualAttributes(*args, **kwargs)
74a57fcd
RD
8019 self.this = newobj.this
8020 self.thisown = 1
8021 del newobj.thisown
54f9ee45 8022 def __del__(self, destroy=_core_.delete_VisualAttributes):
a95a7133 8023 """__del__(self)"""
74a57fcd
RD
8024 try:
8025 if self.thisown: destroy(self)
8026 except: pass
8027
54f9ee45
RD
8028 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
8029 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
8030 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
74a57fcd
RD
8031
8032class VisualAttributesPtr(VisualAttributes):
8033 def __init__(self, this):
8034 self.this = this
8035 if not hasattr(self,"thisown"): self.thisown = 0
8036 self.__class__ = VisualAttributes
54f9ee45 8037_core_.VisualAttributes_swigregister(VisualAttributesPtr)
74a57fcd
RD
8038NullAcceleratorTable = cvar.NullAcceleratorTable
8039PanelNameStr = cvar.PanelNameStr
8040
54f9ee45
RD
8041WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8042WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8043WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8044WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8045WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 8046class Window(EvtHandler):
15afbcd0
RD
8047 """
8048 wx.Window is the base class for all windows and represents any visible
8049 object on the screen. All controls, top level windows and so on are
8050 wx.Windows. Sizers and device contexts are not however, as they don't
8051 appear on screen themselves.
8052
8053 """
e811c8ce
RD
8054 def __repr__(self):
8055 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8056 def __init__(self, *args, **kwargs):
0df68c9f 8057 """
a95a7133 8058 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 8059 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
8060
8061 Construct and show a generic Window.
0df68c9f 8062 """
54f9ee45 8063 newobj = _core_.new_Window(*args, **kwargs)
d14a1e28
RD
8064 self.this = newobj.this
8065 self.thisown = 1
8066 del newobj.thisown
8067 self._setOORInfo(self)
d14a1e28 8068
e811c8ce 8069 def Create(*args, **kwargs):
0df68c9f 8070 """
a95a7133 8071 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 8072 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
8073
8074 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 8075 """
54f9ee45 8076 return _core_.Window_Create(*args, **kwargs)
d14a1e28 8077
e811c8ce 8078 def Close(*args, **kwargs):
15afbcd0 8079 """
a95a7133 8080 Close(self, bool force=False) -> bool
15afbcd0
RD
8081
8082 This function simply generates a EVT_CLOSE event whose handler usually
8083 tries to close the window. It doesn't close the window itself,
8084 however. If force is False (the default) then the window's close
8085 handler will be allowed to veto the destruction of the window.
15afbcd0 8086 """
54f9ee45 8087 return _core_.Window_Close(*args, **kwargs)
d14a1e28 8088
e811c8ce 8089 def Destroy(*args, **kwargs):
0df68c9f 8090 """
a95a7133 8091 Destroy(self) -> bool
d14a1e28 8092
15afbcd0
RD
8093 Destroys the window safely. Frames and dialogs are not destroyed
8094 immediately when this function is called -- they are added to a list
8095 of windows to be deleted on idle time, when all the window's events
8096 have been processed. This prevents problems with events being sent to
8097 non-existent windows.
8098
8099 Returns True if the window has either been successfully deleted, or it
8100 has been added to the list of windows pending real deletion.
0df68c9f 8101 """
54f9ee45 8102 return _core_.Window_Destroy(*args, **kwargs)
d14a1e28 8103
e811c8ce 8104 def DestroyChildren(*args, **kwargs):
15afbcd0 8105 """
a95a7133 8106 DestroyChildren(self) -> bool
15afbcd0 8107
41e2b43e
RD
8108 Destroys all children of a window. Called automatically by the
8109 destructor.
15afbcd0 8110 """
54f9ee45 8111 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 8112
e811c8ce 8113 def IsBeingDeleted(*args, **kwargs):
15afbcd0 8114 """
a95a7133 8115 IsBeingDeleted(self) -> bool
15afbcd0
RD
8116
8117 Is the window in the process of being deleted?
8118 """
54f9ee45 8119 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 8120
e811c8ce 8121 def SetLabel(*args, **kwargs):
15afbcd0 8122 """
a95a7133 8123 SetLabel(self, String label)
15afbcd0
RD
8124
8125 Set the text which the window shows in its label if applicable.
8126 """
54f9ee45 8127 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 8128
e811c8ce 8129 def GetLabel(*args, **kwargs):
15afbcd0 8130 """
a95a7133 8131 GetLabel(self) -> String
15afbcd0 8132
41e2b43e
RD
8133 Generic way of getting a label from any window, for identification
8134 purposes. The interpretation of this function differs from class to
8135 class. For frames and dialogs, the value returned is the title. For
8136 buttons or static text controls, it is the button text. This function
8137 can be useful for meta-programs such as testing tools or special-needs
8138 access programs)which need to identify windows by name.
15afbcd0 8139 """
54f9ee45 8140 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 8141
e811c8ce 8142 def SetName(*args, **kwargs):
15afbcd0 8143 """
a95a7133 8144 SetName(self, String name)
15afbcd0 8145
41e2b43e
RD
8146 Sets the window's name. The window name is used for ressource setting
8147 in X, it is not the same as the window title/label
15afbcd0 8148 """
54f9ee45 8149 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 8150
e811c8ce 8151 def GetName(*args, **kwargs):
15afbcd0 8152 """
a95a7133 8153 GetName(self) -> String
15afbcd0 8154
41e2b43e
RD
8155 Returns the windows name. This name is not guaranteed to be unique;
8156 it is up to the programmer to supply an appropriate name in the window
8157 constructor or via wx.Window.SetName.
15afbcd0 8158 """
54f9ee45 8159 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 8160
4276dc52
RD
8161 def SetWindowVariant(*args, **kwargs):
8162 """
a95a7133 8163 SetWindowVariant(self, int variant)
4276dc52 8164
41e2b43e
RD
8165 Sets the variant of the window/font size to use for this window, if
8166 the platform supports variants, for example, wxMac.
4276dc52 8167 """
54f9ee45 8168 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
8169
8170 def GetWindowVariant(*args, **kwargs):
a95a7133 8171 """GetWindowVariant(self) -> int"""
54f9ee45 8172 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 8173
e811c8ce 8174 def SetId(*args, **kwargs):
15afbcd0 8175 """
a95a7133 8176 SetId(self, int winid)
15afbcd0
RD
8177
8178 Sets the identifier of the window. Each window has an integer
8179 identifier. If the application has not provided one, an identifier
8180 will be generated. Normally, the identifier should be provided on
8181 creation and should not be modified subsequently.
8182 """
54f9ee45 8183 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 8184
e811c8ce 8185 def GetId(*args, **kwargs):
15afbcd0 8186 """
a95a7133 8187 GetId(self) -> int
15afbcd0
RD
8188
8189 Returns the identifier of the window. Each window has an integer
8190 identifier. If the application has not provided one (or the default Id
8191 -1 is used) then an unique identifier with a negative value will be
8192 generated.
8193 """
54f9ee45 8194 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 8195
e811c8ce 8196 def NewControlId(*args, **kwargs):
15afbcd0 8197 """
66c033b4 8198 NewControlId() -> int
15afbcd0
RD
8199
8200 Generate a control id for the controls which were not given one.
8201 """
54f9ee45 8202 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 8203
e811c8ce
RD
8204 NewControlId = staticmethod(NewControlId)
8205 def NextControlId(*args, **kwargs):
15afbcd0 8206 """
66c033b4 8207 NextControlId(int winid) -> int
15afbcd0
RD
8208
8209 Get the id of the control following the one with the given
41e2b43e 8210 autogenerated) id
15afbcd0 8211 """
54f9ee45 8212 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 8213
e811c8ce
RD
8214 NextControlId = staticmethod(NextControlId)
8215 def PrevControlId(*args, **kwargs):
15afbcd0 8216 """
66c033b4 8217 PrevControlId(int winid) -> int
15afbcd0
RD
8218
8219 Get the id of the control preceding the one with the given
41e2b43e 8220 autogenerated) id
15afbcd0 8221 """
54f9ee45 8222 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 8223
e811c8ce
RD
8224 PrevControlId = staticmethod(PrevControlId)
8225 def SetSize(*args, **kwargs):
15afbcd0 8226 """
a95a7133 8227 SetSize(self, Size size)
15afbcd0
RD
8228
8229 Sets the size of the window in pixels.
8230 """
54f9ee45 8231 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 8232
e811c8ce 8233 def SetDimensions(*args, **kwargs):
15afbcd0 8234 """
a95a7133 8235 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
8236
8237 Sets the position and size of the window in pixels. The sizeFlags
8238 parameter indicates the interpretation of the other params if they are
e505d15e
RD
8239 equal to -1.
8240
8241 ======================== ======================================
8242 wx.SIZE_AUTO A -1 indicates that a class-specific
8243 default should be used.
8244 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8245 -1 values are supplied.
8246 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8247 interpreted as real dimensions, not
8248 default values.
8249 ======================== ======================================
8250
15afbcd0 8251 """
54f9ee45 8252 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 8253
e811c8ce 8254 def SetRect(*args, **kwargs):
15afbcd0 8255 """
a95a7133 8256 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
8257
8258 Sets the position and size of the window in pixels using a wx.Rect.
8259 """
54f9ee45 8260 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 8261
e811c8ce 8262 def SetSizeWH(*args, **kwargs):
15afbcd0 8263 """
a95a7133 8264 SetSizeWH(self, int width, int height)
15afbcd0
RD
8265
8266 Sets the size of the window in pixels.
8267 """
54f9ee45 8268 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 8269
e811c8ce 8270 def Move(*args, **kwargs):
15afbcd0 8271 """
a95a7133 8272 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
8273
8274 Moves the window to the given position.
8275 """
54f9ee45 8276 return _core_.Window_Move(*args, **kwargs)
d14a1e28 8277
e811c8ce
RD
8278 SetPosition = Move
8279 def MoveXY(*args, **kwargs):
15afbcd0 8280 """
a95a7133 8281 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
8282
8283 Moves the window to the given position.
8284 """
54f9ee45 8285 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 8286
f8167d6e
RD
8287 def SetBestFittingSize(*args, **kwargs):
8288 """
8289 SetBestFittingSize(self, Size size=DefaultSize)
8290
8291 A 'Smart' SetSize that will fill in default size components with the
8292 window's *best size* values. Also set's the minsize for use with sizers.
8293 """
8294 return _core_.Window_SetBestFittingSize(*args, **kwargs)
8295
e811c8ce 8296 def Raise(*args, **kwargs):
15afbcd0 8297 """
a95a7133 8298 Raise(self)
15afbcd0 8299
943e8dfd
RD
8300 Raises the window to the top of the window hierarchy. In current
8301 version of wxWidgets this works both for manage and child windows.
15afbcd0 8302 """
54f9ee45 8303 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
8304
8305 def Lower(*args, **kwargs):
15afbcd0 8306 """
a95a7133 8307 Lower(self)
15afbcd0 8308
943e8dfd
RD
8309 Lowers the window to the bottom of the window hierarchy. In current
8310 version of wxWidgets this works both for manage and child windows.
15afbcd0 8311 """
54f9ee45 8312 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
8313
8314 def SetClientSize(*args, **kwargs):
15afbcd0 8315 """
a95a7133 8316 SetClientSize(self, Size size)
15afbcd0
RD
8317
8318 This sets the size of the window client area in pixels. Using this
8319 function to size a window tends to be more device-independent than
8320 wx.Window.SetSize, since the application need not worry about what
8321 dimensions the border or title bar have when trying to fit the window
8322 around panel items, for example.
8323 """
54f9ee45 8324 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
8325
8326 def SetClientSizeWH(*args, **kwargs):
15afbcd0 8327 """
a95a7133 8328 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
8329
8330 This sets the size of the window client area in pixels. Using this
8331 function to size a window tends to be more device-independent than
8332 wx.Window.SetSize, since the application need not worry about what
8333 dimensions the border or title bar have when trying to fit the window
8334 around panel items, for example.
8335 """
54f9ee45 8336 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
8337
8338 def SetClientRect(*args, **kwargs):
15afbcd0 8339 """
a95a7133 8340 SetClientRect(self, Rect rect)
15afbcd0
RD
8341
8342 This sets the size of the window client area in pixels. Using this
8343 function to size a window tends to be more device-independent than
8344 wx.Window.SetSize, since the application need not worry about what
8345 dimensions the border or title bar have when trying to fit the window
8346 around panel items, for example.
8347 """
54f9ee45 8348 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
8349
8350 def GetPosition(*args, **kwargs):
0df68c9f 8351 """
a95a7133 8352 GetPosition(self) -> Point
e811c8ce 8353
0df68c9f
RD
8354 Get the window's position.
8355 """
54f9ee45 8356 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
8357
8358 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
8359 """
8360 GetPositionTuple() -> (x,y)
e811c8ce 8361
0df68c9f
RD
8362 Get the window's position.
8363 """
54f9ee45 8364 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
8365
8366 def GetSize(*args, **kwargs):
0df68c9f 8367 """
a95a7133 8368 GetSize(self) -> Size
e811c8ce 8369
0df68c9f
RD
8370 Get the window size.
8371 """
54f9ee45 8372 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
8373
8374 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
8375 """
8376 GetSizeTuple() -> (width, height)
e811c8ce 8377
0df68c9f
RD
8378 Get the window size.
8379 """
54f9ee45 8380 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
8381
8382 def GetRect(*args, **kwargs):
15afbcd0 8383 """
a95a7133 8384 GetRect(self) -> Rect
15afbcd0
RD
8385
8386 Returns the size and position of the window as a wx.Rect object.
8387 """
54f9ee45 8388 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
8389
8390 def GetClientSize(*args, **kwargs):
0df68c9f 8391 """
a95a7133 8392 GetClientSize(self) -> Size
e811c8ce 8393
15afbcd0
RD
8394 This gets the size of the window's 'client area' in pixels. The client
8395 area is the area which may be drawn on by the programmer, excluding
8396 title bar, border, scrollbars, etc.
0df68c9f 8397 """
54f9ee45 8398 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
8399
8400 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
8401 """
8402 GetClientSizeTuple() -> (width, height)
e811c8ce 8403
15afbcd0
RD
8404 This gets the size of the window's 'client area' in pixels. The client
8405 area is the area which may be drawn on by the programmer, excluding
8406 title bar, border, scrollbars, etc.
0df68c9f 8407 """
54f9ee45 8408 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
8409
8410 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 8411 """
a95a7133 8412 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
8413
8414 Get the origin of the client area of the window relative to the
8415 window's top left corner (the client area may be shifted because of
8416 the borders, scrollbars, other decorations...)
8417 """
54f9ee45 8418 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
8419
8420 def GetClientRect(*args, **kwargs):
15afbcd0 8421 """
a95a7133 8422 GetClientRect(self) -> Rect
15afbcd0 8423
61863841 8424 Get the client area position and size as a `wx.Rect` object.
15afbcd0 8425 """
54f9ee45 8426 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
8427
8428 def GetBestSize(*args, **kwargs):
0df68c9f 8429 """
a95a7133 8430 GetBestSize(self) -> Size
e811c8ce 8431
248ed943 8432 This function returns the best acceptable minimal size for the
41e2b43e
RD
8433 window, if applicable. For example, for a static text control, it will
8434 be the minimal size such that the control label is not truncated. For
8435 windows containing subwindows (suzh aswx.Panel), the size returned by
8436 this function will be the same as the size the window would have had
8437 after calling Fit.
0df68c9f 8438 """
54f9ee45 8439 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
8440
8441 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
8442 """
8443 GetBestSizeTuple() -> (width, height)
e811c8ce 8444
248ed943 8445 This function returns the best acceptable minimal size for the
41e2b43e
RD
8446 window, if applicable. For example, for a static text control, it will
8447 be the minimal size such that the control label is not truncated. For
8448 windows containing subwindows (suzh aswx.Panel), the size returned by
8449 this function will be the same as the size the window would have had
8450 after calling Fit.
0df68c9f 8451 """
54f9ee45 8452 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 8453
dfbb5885
RD
8454 def InvalidateBestSize(*args, **kwargs):
8455 """
8456 InvalidateBestSize(self)
8457
8458 Reset the cached best size value so it will be recalculated the next
8459 time it is needed.
8460 """
8461 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8462
e2813725
RD
8463 def CacheBestSize(*args, **kwargs):
8464 """
8465 CacheBestSize(self, Size size)
8466
8467 Cache the best size so it doesn't need to be calculated again, (at least until
8468 some properties of the window change.)
8469 """
8470 return _core_.Window_CacheBestSize(*args, **kwargs)
8471
dfbb5885
RD
8472 def GetBestFittingSize(*args, **kwargs):
8473 """
8474 GetBestFittingSize(self) -> Size
8475
8476 This function will merge the window's best size into the window's
8477 minimum size, giving priority to the min size components, and returns
8478 the results.
8479
8480 """
8481 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8482
e811c8ce 8483 def GetAdjustedBestSize(*args, **kwargs):
15afbcd0 8484 """
a95a7133 8485 GetAdjustedBestSize(self) -> Size
15afbcd0
RD
8486
8487 This method is similar to GetBestSize, except in one
8488 thing. GetBestSize should return the minimum untruncated size of the
8489 window, while this method will return the largest of BestSize and any
8490 user specified minimum size. ie. it is the minimum size the window
8491 should currently be drawn at, not the minimal size it can possibly
8492 tolerate.
8493 """
54f9ee45 8494 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
e811c8ce
RD
8495
8496 def Center(*args, **kwargs):
15afbcd0 8497 """
a95a7133 8498 Center(self, int direction=BOTH)
15afbcd0
RD
8499
8500 Centers the window. The parameter specifies the direction for
8501 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8502 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8503 on the entire screen and not on its parent window. If it is a
8504 top-level window and has no parent then it will always be centered
8505 relative to the screen.
8506 """
54f9ee45 8507 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
8508
8509 Centre = Center
8510 def CenterOnScreen(*args, **kwargs):
15afbcd0 8511 """
a95a7133 8512 CenterOnScreen(self, int dir=BOTH)
15afbcd0
RD
8513
8514 Center on screen (only works for top level windows)
8515 """
54f9ee45 8516 return _core_.Window_CenterOnScreen(*args, **kwargs)
e811c8ce
RD
8517
8518 CentreOnScreen = CenterOnScreen
8519 def CenterOnParent(*args, **kwargs):
15afbcd0 8520 """
a95a7133 8521 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
8522
8523 Center with respect to the the parent window
8524 """
54f9ee45 8525 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
8526
8527 CentreOnParent = CenterOnParent
8528 def Fit(*args, **kwargs):
15afbcd0 8529 """
a95a7133 8530 Fit(self)
15afbcd0
RD
8531
8532 Sizes the window so that it fits around its subwindows. This function
8533 won't do anything if there are no subwindows and will only really work
8534 correctly if sizers are used for the subwindows layout. Also, if the
8535 window has exactly one subwindow it is better (faster and the result
8536 is more precise as Fit adds some margin to account for fuzziness of
8537 its calculations) to call window.SetClientSize(child.GetSize())
8538 instead of calling Fit.
8539 """
54f9ee45 8540 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
8541
8542 def FitInside(*args, **kwargs):
15afbcd0 8543 """
a95a7133 8544 FitInside(self)
15afbcd0
RD
8545
8546 Similar to Fit, but sizes the interior (virtual) size of a
8547 window. Mainly useful with scrolled windows to reset scrollbars after
8548 sizing changes that do not trigger a size event, and/or scrolled
8549 windows without an interior sizer. This function similarly won't do
8550 anything if there are no subwindows.
8551 """
54f9ee45 8552 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 8553
f16ab95d 8554 def SetSizeHints(*args, **kwargs):
0df68c9f 8555 """
a95a7133 8556 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 8557 int incH=-1)
15afbcd0
RD
8558
8559 Allows specification of minimum and maximum window sizes, and window
8560 size increments. If a pair of values is not set (or set to -1), the
8561 default values will be used. If this function is called, the user
908b74cd
RD
8562 will not be able to size the window outside the given bounds (if it is
8563 a top-level window.) Sizers will also inspect the minimum window size
8564 and will use that value if set when calculating layout.
8565
8566 The resizing increments are only significant under Motif or Xt.
0df68c9f 8567 """
f16ab95d 8568 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 8569
f16ab95d
RD
8570 def SetSizeHintsSz(*args, **kwargs):
8571 """
8572 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8573
8574 Allows specification of minimum and maximum window sizes, and window
8575 size increments. If a pair of values is not set (or set to -1), the
8576 default values will be used. If this function is called, the user
8577 will not be able to size the window outside the given bounds (if it is
8578 a top-level window.) Sizers will also inspect the minimum window size
8579 and will use that value if set when calculating layout.
8580
8581 The resizing increments are only significant under Motif or Xt.
8582 """
8583 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8584
8585 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 8586 """
908b74cd 8587 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
8588
8589 Allows specification of minimum and maximum virtual window sizes. If a
8590 pair of values is not set (or set to -1), the default values will be
8591 used. If this function is called, the user will not be able to size
8592 the virtual area of the window outside the given bounds.
8593 """
f16ab95d
RD
8594 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8595
8596 def SetVirtualSizeHintsSz(*args, **kwargs):
8597 """
8598 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8599
8600 Allows specification of minimum and maximum virtual window sizes. If a
8601 pair of values is not set (or set to -1), the default values will be
8602 used. If this function is called, the user will not be able to size
8603 the virtual area of the window outside the given bounds.
8604 """
8605 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 8606
908b74cd
RD
8607 def GetMaxSize(*args, **kwargs):
8608 """GetMaxSize(self) -> Size"""
8609 return _core_.Window_GetMaxSize(*args, **kwargs)
8610
8611 def GetMinSize(*args, **kwargs):
8612 """GetMinSize(self) -> Size"""
8613 return _core_.Window_GetMinSize(*args, **kwargs)
8614
8615 def SetMinSize(*args, **kwargs):
8616 """
8617 SetMinSize(self, Size minSize)
8618
8619 A more convenient method than `SetSizeHints` for setting just the
8620 min size.
8621 """
8622 return _core_.Window_SetMinSize(*args, **kwargs)
8623
8624 def SetMaxSize(*args, **kwargs):
8625 """
8626 SetMaxSize(self, Size maxSize)
8627
8628 A more convenient method than `SetSizeHints` for setting just the
8629 max size.
8630 """
8631 return _core_.Window_SetMaxSize(*args, **kwargs)
8632
e811c8ce 8633 def GetMinWidth(*args, **kwargs):
a95a7133 8634 """GetMinWidth(self) -> int"""
54f9ee45 8635 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
8636
8637 def GetMinHeight(*args, **kwargs):
a95a7133 8638 """GetMinHeight(self) -> int"""
54f9ee45 8639 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
8640
8641 def GetMaxWidth(*args, **kwargs):
a95a7133 8642 """GetMaxWidth(self) -> int"""
54f9ee45 8643 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
8644
8645 def GetMaxHeight(*args, **kwargs):
a95a7133 8646 """GetMaxHeight(self) -> int"""
54f9ee45 8647 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 8648
e811c8ce 8649 def SetVirtualSize(*args, **kwargs):
0df68c9f 8650 """
a95a7133 8651 SetVirtualSize(self, Size size)
e811c8ce 8652
15afbcd0
RD
8653 Set the the virtual size of a window in pixels. For most windows this
8654 is just the client area of the window, but for some like scrolled
8655 windows it is more or less independent of the screen window size.
0df68c9f 8656 """
54f9ee45 8657 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
8658
8659 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 8660 """
a95a7133 8661 SetVirtualSizeWH(self, int w, int h)
e811c8ce 8662
15afbcd0
RD
8663 Set the the virtual size of a window in pixels. For most windows this
8664 is just the client area of the window, but for some like scrolled
8665 windows it is more or less independent of the screen window size.
0df68c9f 8666 """
54f9ee45 8667 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
8668
8669 def GetVirtualSize(*args, **kwargs):
0df68c9f 8670 """
a95a7133 8671 GetVirtualSize(self) -> Size
e811c8ce 8672
15afbcd0
RD
8673 Get the the virtual size of the window in pixels. For most windows
8674 this is just the client area of the window, but for some like scrolled
8675 windows it is more or less independent of the screen window size.
0df68c9f 8676 """
54f9ee45 8677 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
8678
8679 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
8680 """
8681 GetVirtualSizeTuple() -> (width, height)
e811c8ce 8682
15afbcd0
RD
8683 Get the the virtual size of the window in pixels. For most windows
8684 this is just the client area of the window, but for some like scrolled
8685 windows it is more or less independent of the screen window size.
0df68c9f 8686 """
54f9ee45 8687 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce
RD
8688
8689 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 8690 """
a95a7133 8691 GetBestVirtualSize(self) -> Size
15afbcd0
RD
8692
8693 Return the largest of ClientSize and BestSize (as determined by a
8694 sizer, interior children, or other means)
8695 """
54f9ee45 8696 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
8697
8698 def Show(*args, **kwargs):
15afbcd0 8699 """
a95a7133 8700 Show(self, bool show=True) -> bool
15afbcd0
RD
8701
8702 Shows or hides the window. You may need to call Raise for a top level
8703 window if you want to bring it to top, although this is not needed if
8704 Show is called immediately after the frame creation. Returns True if
8705 the window has been shown or hidden or False if nothing was done
8706 because it already was in the requested state.
8707 """
54f9ee45 8708 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
8709
8710 def Hide(*args, **kwargs):
15afbcd0 8711 """
a95a7133 8712 Hide(self) -> bool
15afbcd0
RD
8713
8714 Equivalent to calling Show(False).
8715 """
54f9ee45 8716 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
8717
8718 def Enable(*args, **kwargs):
15afbcd0 8719 """
a95a7133 8720 Enable(self, bool enable=True) -> bool
15afbcd0
RD
8721
8722 Enable or disable the window for user input. Note that when a parent
8723 window is disabled, all of its children are disabled as well and they
8724 are reenabled again when the parent is. Returns true if the window
8725 has been enabled or disabled, false if nothing was done, i.e. if the
8726 window had already been in the specified state.
8727 """
54f9ee45 8728 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
8729
8730 def Disable(*args, **kwargs):
15afbcd0 8731 """
a95a7133 8732 Disable(self) -> bool
15afbcd0
RD
8733
8734 Disables the window, same as Enable(false).
8735 """
54f9ee45 8736 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
8737
8738 def IsShown(*args, **kwargs):
15afbcd0 8739 """
a95a7133 8740 IsShown(self) -> bool
15afbcd0
RD
8741
8742 Returns true if the window is shown, false if it has been hidden.
8743 """
54f9ee45 8744 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
8745
8746 def IsEnabled(*args, **kwargs):
15afbcd0 8747 """
a95a7133 8748 IsEnabled(self) -> bool
15afbcd0
RD
8749
8750 Returns true if the window is enabled for input, false otherwise.
8751 """
54f9ee45 8752 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce
RD
8753
8754 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 8755 """
a95a7133 8756 SetWindowStyleFlag(self, long style)
15afbcd0 8757
41e2b43e
RD
8758 Sets the style of the window. Please note that some styles cannot be
8759 changed after the window creation and that Refresh() might need to be
8760 called after changing the others for the change to take place
8761 immediately.
15afbcd0 8762 """
54f9ee45 8763 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
8764
8765 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 8766 """
a95a7133 8767 GetWindowStyleFlag(self) -> long
e811c8ce 8768
15afbcd0
RD
8769 Gets the window style that was passed to the constructor or Create
8770 method.
8771 """
54f9ee45 8772 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 8773
15afbcd0 8774 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 8775 def HasFlag(*args, **kwargs):
15afbcd0 8776 """
a95a7133 8777 HasFlag(self, int flag) -> bool
15afbcd0
RD
8778
8779 Test if the given style is set for this window.
8780 """
54f9ee45 8781 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
8782
8783 def IsRetained(*args, **kwargs):
15afbcd0 8784 """
a95a7133 8785 IsRetained(self) -> bool
15afbcd0
RD
8786
8787 Returns true if the window is retained, false otherwise. Retained
8788 windows are only available on X platforms.
8789 """
54f9ee45 8790 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce
RD
8791
8792 def SetExtraStyle(*args, **kwargs):
15afbcd0 8793 """
a95a7133 8794 SetExtraStyle(self, long exStyle)
15afbcd0
RD
8795
8796 Sets the extra style bits for the window. Extra styles are the less
8797 often used style bits which can't be set with the constructor or with
8798 SetWindowStyleFlag()
8799 """
54f9ee45 8800 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
8801
8802 def GetExtraStyle(*args, **kwargs):
15afbcd0 8803 """
a95a7133 8804 GetExtraStyle(self) -> long
15afbcd0
RD
8805
8806 Returns the extra style bits for the window.
8807 """
54f9ee45 8808 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
8809
8810 def MakeModal(*args, **kwargs):
15afbcd0 8811 """
a95a7133 8812 MakeModal(self, bool modal=True)
15afbcd0
RD
8813
8814 Disables all other windows in the application so that the user can
8815 only interact with this window. Passing False will reverse this
8816 effect.
8817 """
54f9ee45 8818 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
8819
8820 def SetThemeEnabled(*args, **kwargs):
15afbcd0 8821 """
a95a7133 8822 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
8823
8824 This function tells a window if it should use the system's "theme"
8825 code to draw the windows' background instead if its own background
8826 drawing code. This will only have an effect on platforms that support
8827 the notion of themes in user defined windows. One such platform is
8828 GTK+ where windows can have (very colourful) backgrounds defined by a
8829 user's selected theme.
8830
8831 Dialogs, notebook pages and the status bar have this flag set to true
8832 by default so that the default look and feel is simulated best.
8833 """
54f9ee45 8834 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8835
8836 def GetThemeEnabled(*args, **kwargs):
15afbcd0 8837 """
a95a7133 8838 GetThemeEnabled(self) -> bool
e811c8ce 8839
15afbcd0
RD
8840 Return the themeEnabled flag.
8841 """
54f9ee45 8842 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8843
8844 def SetFocus(*args, **kwargs):
15afbcd0 8845 """
a95a7133 8846 SetFocus(self)
15afbcd0
RD
8847
8848 Set's the focus to this window, allowing it to receive keyboard input.
8849 """
54f9ee45 8850 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
8851
8852 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 8853 """
a95a7133 8854 SetFocusFromKbd(self)
15afbcd0
RD
8855
8856 Set focus to this window as the result of a keyboard action. Normally
8857 only called internally.
8858 """
54f9ee45 8859 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
8860
8861 def FindFocus(*args, **kwargs):
15afbcd0 8862 """
66c033b4 8863 FindFocus() -> Window
15afbcd0
RD
8864
8865 Returns the window or control that currently has the keyboard focus,
8866 or None.
8867 """
54f9ee45 8868 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
8869
8870 FindFocus = staticmethod(FindFocus)
8871 def AcceptsFocus(*args, **kwargs):
15afbcd0 8872 """
a95a7133 8873 AcceptsFocus(self) -> bool
15afbcd0
RD
8874
8875 Can this window have focus?
8876 """
54f9ee45 8877 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce
RD
8878
8879 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 8880 """
a95a7133 8881 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
8882
8883 Can this window be given focus by keyboard navigation? if not, the
8884 only way to give it focus (provided it accepts it at all) is to click
8885 it.
8886 """
54f9ee45 8887 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce
RD
8888
8889 def GetDefaultItem(*args, **kwargs):
15afbcd0 8890 """
a95a7133 8891 GetDefaultItem(self) -> Window
15afbcd0
RD
8892
8893 Get the default child of this parent, i.e. the one which is activated
8894 by pressing <Enter> such as the OK button on a wx.Dialog.
8895 """
54f9ee45 8896 return _core_.Window_GetDefaultItem(*args, **kwargs)
e811c8ce
RD
8897
8898 def SetDefaultItem(*args, **kwargs):
15afbcd0 8899 """
a95a7133 8900 SetDefaultItem(self, Window child) -> Window
15afbcd0
RD
8901
8902 Set this child as default, return the old default.
8903 """
54f9ee45 8904 return _core_.Window_SetDefaultItem(*args, **kwargs)
e811c8ce
RD
8905
8906 def SetTmpDefaultItem(*args, **kwargs):
15afbcd0 8907 """
a95a7133 8908 SetTmpDefaultItem(self, Window win)
15afbcd0
RD
8909
8910 Set this child as temporary default
8911 """
54f9ee45 8912 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
e811c8ce 8913
908b74cd
RD
8914 def Navigate(*args, **kwargs):
8915 """
8916 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8917
fd2dc343
RD
8918 Does keyboard navigation from this window to another, by sending a
8919 `wx.NavigationKeyEvent`.
908b74cd
RD
8920 """
8921 return _core_.Window_Navigate(*args, **kwargs)
8922
7f98d120
RD
8923 def MoveAfterInTabOrder(*args, **kwargs):
8924 """
8925 MoveAfterInTabOrder(self, Window win)
8926
8927 Moves this window in the tab navigation order after the specified
8928 sibling window. This means that when the user presses the TAB key on
8929 that other window, the focus switches to this window.
8930
8931 The default tab order is the same as creation order. This function
8932 and `MoveBeforeInTabOrder` allow to change it after creating all the
8933 windows.
8934
8935 """
8936 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8937
8938 def MoveBeforeInTabOrder(*args, **kwargs):
8939 """
8940 MoveBeforeInTabOrder(self, Window win)
8941
8942 Same as `MoveAfterInTabOrder` except that it inserts this window just
8943 before win instead of putting it right after it.
8944 """
8945 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8946
e811c8ce 8947 def GetChildren(*args, **kwargs):
15afbcd0 8948 """
a95a7133 8949 GetChildren(self) -> PyObject
15afbcd0
RD
8950
8951 Returns a list of the window's children. NOTE: Currently this is a
8952 copy of the child window list maintained by the window, so the return
8953 value of this function is only valid as long as the window's children
8954 do not change.
8955 """
54f9ee45 8956 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
8957
8958 def GetParent(*args, **kwargs):
15afbcd0 8959 """
a95a7133 8960 GetParent(self) -> Window
15afbcd0
RD
8961
8962 Returns the parent window of this window, or None if there isn't one.
8963 """
54f9ee45 8964 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
8965
8966 def GetGrandParent(*args, **kwargs):
15afbcd0 8967 """
a95a7133 8968 GetGrandParent(self) -> Window
15afbcd0 8969
41e2b43e
RD
8970 Returns the parent of the parent of this window, or None if there
8971 isn't one.
15afbcd0 8972 """
54f9ee45 8973 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce
RD
8974
8975 def IsTopLevel(*args, **kwargs):
15afbcd0 8976 """
a95a7133 8977 IsTopLevel(self) -> bool
15afbcd0
RD
8978
8979 Returns true if the given window is a top-level one. Currently all
8980 frames and dialogs are always considered to be top-level windows (even
8981 if they have a parent window).
8982 """
54f9ee45 8983 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
8984
8985 def Reparent(*args, **kwargs):
15afbcd0 8986 """
a95a7133 8987 Reparent(self, Window newParent) -> bool
15afbcd0
RD
8988
8989 Reparents the window, i.e the window will be removed from its current
8990 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8991 re-inserted into another. Available on Windows and GTK. Returns True
8992 if the parent was changed, False otherwise (error or newParent ==
8993 oldParent)
8994 """
54f9ee45 8995 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
8996
8997 def AddChild(*args, **kwargs):
15afbcd0 8998 """
a95a7133 8999 AddChild(self, Window child)
15afbcd0
RD
9000
9001 Adds a child window. This is called automatically by window creation
9002 functions so should not be required by the application programmer.
9003 """
54f9ee45 9004 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
9005
9006 def RemoveChild(*args, **kwargs):
15afbcd0 9007 """
a95a7133 9008 RemoveChild(self, Window child)
15afbcd0
RD
9009
9010 Removes a child window. This is called automatically by window
9011 deletion functions so should not be required by the application
9012 programmer.
9013 """
54f9ee45 9014 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce
RD
9015
9016 def FindWindowById(*args, **kwargs):
15afbcd0 9017 """
a95a7133 9018 FindWindowById(self, long winid) -> Window
15afbcd0
RD
9019
9020 Find a chld of this window by window ID
9021 """
54f9ee45 9022 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
9023
9024 def FindWindowByName(*args, **kwargs):
15afbcd0 9025 """
a95a7133 9026 FindWindowByName(self, String name) -> Window
15afbcd0
RD
9027
9028 Find a child of this window by name
9029 """
54f9ee45 9030 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
9031
9032 def GetEventHandler(*args, **kwargs):
15afbcd0 9033 """
a95a7133 9034 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
9035
9036 Returns the event handler for this window. By default, the window is
9037 its own event handler.
9038 """
54f9ee45 9039 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
9040
9041 def SetEventHandler(*args, **kwargs):
15afbcd0 9042 """
a95a7133 9043 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
9044
9045 Sets the event handler for this window. An event handler is an object
9046 that is capable of processing the events sent to a window. By default,
9047 the window is its own event handler, but an application may wish to
9048 substitute another, for example to allow central implementation of
9049 event-handling for a variety of different window classes.
9050
41e2b43e 9051 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0
RD
9052 up a chain of event handlers, where an event not handled by one event
9053 handler is handed to the next one in the chain.
9054 """
54f9ee45 9055 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
9056
9057 def PushEventHandler(*args, **kwargs):
15afbcd0 9058 """
a95a7133 9059 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
9060
9061 Pushes this event handler onto the event handler stack for the window.
9062 An event handler is an object that is capable of processing the events
9063 sent to a window. By default, the window is its own event handler, but
9064 an application may wish to substitute another, for example to allow
9065 central implementation of event-handling for a variety of different
9066 window classes.
9067
9068 wx.Window.PushEventHandler allows an application to set up a chain of
9069 event handlers, where an event not handled by one event handler is
41e2b43e 9070 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
15afbcd0
RD
9071 remove the event handler.
9072 """
54f9ee45 9073 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
9074
9075 def PopEventHandler(*args, **kwargs):
15afbcd0 9076 """
a95a7133 9077 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
9078
9079 Removes and returns the top-most event handler on the event handler
9080 stack. If deleteHandler is True then the wx.EvtHandler object will be
9081 destroyed after it is popped.
9082 """
54f9ee45 9083 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
9084
9085 def RemoveEventHandler(*args, **kwargs):
15afbcd0 9086 """
a95a7133 9087 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 9088
41e2b43e
RD
9089 Find the given handler in the event handler chain and remove (but not
9090 delete) it from the event handler chain, return True if it was found
9091 and False otherwise (this also results in an assert failure so this
9092 function should only be called when the handler is supposed to be
9093 there.)
15afbcd0 9094 """
54f9ee45 9095 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
9096
9097 def SetValidator(*args, **kwargs):
15afbcd0 9098 """
a95a7133 9099 SetValidator(self, Validator validator)
15afbcd0
RD
9100
9101 Deletes the current validator (if any) and sets the window validator,
9102 having called wx.Validator.Clone to create a new validator of this
9103 type.
9104 """
54f9ee45 9105 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
9106
9107 def GetValidator(*args, **kwargs):
15afbcd0 9108 """
a95a7133 9109 GetValidator(self) -> Validator
15afbcd0
RD
9110
9111 Returns a pointer to the current validator for the window, or None if
9112 there is none.
9113 """
54f9ee45 9114 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 9115
74a57fcd
RD
9116 def Validate(*args, **kwargs):
9117 """
a95a7133 9118 Validate(self) -> bool
74a57fcd
RD
9119
9120 Validates the current values of the child controls using their
41e2b43e
RD
9121 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9122 style flag set, the method will also call Validate() of all child
9123 windows. Returns false if any of the validations failed.
74a57fcd 9124 """
54f9ee45 9125 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
9126
9127 def TransferDataToWindow(*args, **kwargs):
9128 """
a95a7133 9129 TransferDataToWindow(self) -> bool
74a57fcd 9130
41e2b43e
RD
9131 Transfers values to child controls from data areas specified by their
9132 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9133 style flag set, the method will also call TransferDataToWindow() of
9134 all child windows.
74a57fcd 9135 """
54f9ee45 9136 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
9137
9138 def TransferDataFromWindow(*args, **kwargs):
9139 """
a95a7133 9140 TransferDataFromWindow(self) -> bool
74a57fcd 9141
41e2b43e
RD
9142 Transfers values from child controls to data areas specified by their
9143 validators. Returns false if a transfer failed. If the window has
9144 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9145 also call TransferDataFromWindow() of all child windows.
74a57fcd 9146 """
54f9ee45 9147 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
9148
9149 def InitDialog(*args, **kwargs):
9150 """
a95a7133 9151 InitDialog(self)
74a57fcd 9152
41e2b43e
RD
9153 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9154 to the dialog via validators.
74a57fcd 9155 """
54f9ee45 9156 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 9157
e811c8ce 9158 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 9159 """
a95a7133 9160 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
9161
9162 Sets the accelerator table for this window.
9163 """
54f9ee45 9164 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
9165
9166 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 9167 """
a95a7133 9168 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
9169
9170 Gets the accelerator table for this window.
9171 """
54f9ee45 9172 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
9173
9174 def RegisterHotKey(*args, **kwargs):
15afbcd0 9175 """
a95a7133 9176 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
9177
9178 Registers a system wide hotkey. Every time the user presses the hotkey
9179 registered here, this window will receive a hotkey event. It will
9180 receive the event even if the application is in the background and
9181 does not have the input focus because the user is working with some
9182 other application. To bind an event handler function to this hotkey
9183 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9184 hotkey was registered successfully.
9185 """
54f9ee45 9186 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
9187
9188 def UnregisterHotKey(*args, **kwargs):
15afbcd0 9189 """
a95a7133 9190 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
9191
9192 Unregisters a system wide hotkey.
9193 """
54f9ee45 9194 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
9195
9196 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 9197 """
a95a7133 9198 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
9199
9200 Converts a point or size from dialog units to pixels. Dialog units
9201 are used for maintaining a dialog's proportions even if the font
9202 changes. For the x dimension, the dialog units are multiplied by the
9203 average character width and then divided by 4. For the y dimension,
9204 the dialog units are multiplied by the average character height and
9205 then divided by 8.
9206 """
54f9ee45 9207 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
9208
9209 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 9210 """
a95a7133 9211 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
9212
9213 Converts a point or size from dialog units to pixels. Dialog units
9214 are used for maintaining a dialog's proportions even if the font
9215 changes. For the x dimension, the dialog units are multiplied by the
9216 average character width and then divided by 4. For the y dimension,
9217 the dialog units are multiplied by the average character height and
9218 then divided by 8.
9219 """
54f9ee45 9220 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
9221
9222 def DLG_PNT(*args, **kwargs):
15afbcd0 9223 """
a95a7133 9224 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
9225
9226 Converts a point or size from dialog units to pixels. Dialog units
9227 are used for maintaining a dialog's proportions even if the font
9228 changes. For the x dimension, the dialog units are multiplied by the
9229 average character width and then divided by 4. For the y dimension,
9230 the dialog units are multiplied by the average character height and
9231 then divided by 8.
9232 """
54f9ee45 9233 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
9234
9235 def DLG_SZE(*args, **kwargs):
15afbcd0 9236 """
a95a7133 9237 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
9238
9239 Converts a point or size from dialog units to pixels. Dialog units
9240 are used for maintaining a dialog's proportions even if the font
9241 changes. For the x dimension, the dialog units are multiplied by the
9242 average character width and then divided by 4. For the y dimension,
9243 the dialog units are multiplied by the average character height and
9244 then divided by 8.
9245 """
54f9ee45 9246 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
9247
9248 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 9249 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 9250 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
9251
9252 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 9253 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 9254 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
9255
9256 def WarpPointer(*args, **kwargs):
15afbcd0 9257 """
a95a7133 9258 WarpPointer(self, int x, int y)
15afbcd0
RD
9259
9260 Moves the pointer to the given position on the window.
9261
9262 NOTE: This function is not supported under Mac because Apple Human
9263 Interface Guidelines forbid moving the mouse cursor programmatically.
9264 """
54f9ee45 9265 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
9266
9267 def CaptureMouse(*args, **kwargs):
15afbcd0 9268 """
a95a7133 9269 CaptureMouse(self)
15afbcd0
RD
9270
9271 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9272 release the capture.
9273
9274 Note that wxWindows maintains the stack of windows having captured the
9275 mouse and when the mouse is released the capture returns to the window
9276 which had had captured it previously and it is only really released if
9277 there were no previous window. In particular, this means that you must
9278 release the mouse as many times as you capture it.
9279 """
54f9ee45 9280 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
9281
9282 def ReleaseMouse(*args, **kwargs):
15afbcd0 9283 """
a95a7133 9284 ReleaseMouse(self)
15afbcd0
RD
9285
9286 Releases mouse input captured with wx.Window.CaptureMouse.
9287 """
54f9ee45 9288 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
9289
9290 def GetCapture(*args, **kwargs):
15afbcd0 9291 """
66c033b4 9292 GetCapture() -> Window
15afbcd0
RD
9293
9294 Returns the window which currently captures the mouse or None
9295 """
54f9ee45 9296 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
9297
9298 GetCapture = staticmethod(GetCapture)
9299 def HasCapture(*args, **kwargs):
15afbcd0 9300 """
a95a7133 9301 HasCapture(self) -> bool
15afbcd0
RD
9302
9303 Returns true if this window has the current mouse capture.
9304 """
54f9ee45 9305 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
9306
9307 def Refresh(*args, **kwargs):
15afbcd0 9308 """
a95a7133 9309 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
9310
9311 Mark the specified rectangle (or the whole window) as "dirty" so it
9312 will be repainted. Causes an EVT_PAINT event to be generated and sent
9313 to the window.
9314 """
54f9ee45 9315 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
9316
9317 def RefreshRect(*args, **kwargs):
15afbcd0 9318 """
fef4c27a 9319 RefreshRect(self, Rect rect, bool eraseBackground=True)
15afbcd0
RD
9320
9321 Redraws the contents of the given rectangle: the area inside it will
9322 be repainted. This is the same as Refresh but has a nicer syntax.
9323 """
54f9ee45 9324 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
9325
9326 def Update(*args, **kwargs):
15afbcd0 9327 """
a95a7133 9328 Update(self)
15afbcd0
RD
9329
9330 Calling this method immediately repaints the invalidated area of the
9331 window instead of waiting for the EVT_PAINT event to happen, (normally
9332 this would usually only happen when the flow of control returns to the
9333 event loop.) Notice that this function doesn't refresh the window and
9334 does nothing if the window has been already repainted. Use Refresh
9335 first if you want to immediately redraw the window (or some portion of
9336 it) unconditionally.
9337 """
54f9ee45 9338 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
9339
9340 def ClearBackground(*args, **kwargs):
15afbcd0 9341 """
a95a7133 9342 ClearBackground(self)
15afbcd0
RD
9343
9344 Clears the window by filling it with the current background
9345 colour. Does not cause an erase background event to be generated.
9346 """
54f9ee45 9347 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
9348
9349 def Freeze(*args, **kwargs):
15afbcd0 9350 """
a95a7133 9351 Freeze(self)
15afbcd0 9352
41e2b43e
RD
9353 Freezes the window or, in other words, prevents any updates from
9354 taking place on screen, the window is not redrawn at all. Thaw must be
9355 called to reenable window redrawing. Calls to Freeze/Thaw may be
9356 nested, with the actual Thaw being delayed until all the nesting has
9357 been undone.
15afbcd0
RD
9358
9359 This method is useful for visual appearance optimization (for example,
9360 it is a good idea to use it before inserting large amount of text into
9361 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9362 for all controls so it is mostly just a hint to wxWindows and not a
9363 mandatory directive.
9364 """
54f9ee45 9365 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce
RD
9366
9367 def Thaw(*args, **kwargs):
15afbcd0 9368 """
a95a7133 9369 Thaw(self)
15afbcd0 9370
4276dc52 9371 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
9372 Freeze/Thaw may be nested, so Thaw must be called the same number of
9373 times that Freeze was before the window will be updated.
15afbcd0 9374 """
54f9ee45 9375 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
9376
9377 def PrepareDC(*args, **kwargs):
15afbcd0 9378 """
a95a7133 9379 PrepareDC(self, DC dc)
15afbcd0
RD
9380
9381 Call this function to prepare the device context for drawing a
9382 scrolled image. It sets the device origin according to the current
9383 scroll position.
9384 """
54f9ee45 9385 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce
RD
9386
9387 def GetUpdateRegion(*args, **kwargs):
15afbcd0 9388 """
a95a7133 9389 GetUpdateRegion(self) -> Region
15afbcd0
RD
9390
9391 Returns the region specifying which parts of the window have been
9392 damaged. Should only be called within an EVT_PAINT handler.
9393 """
54f9ee45 9394 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
9395
9396 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 9397 """
a95a7133 9398 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
9399
9400 Get the update rectangle region bounding box in client coords.
9401 """
54f9ee45 9402 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
9403
9404 def IsExposed(*args, **kwargs):
15afbcd0 9405 """
a95a7133 9406 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
9407
9408 Returns true if the given point or rectangle area has been exposed
9409 since the last repaint. Call this in an paint event handler to
9410 optimize redrawing by only redrawing those areas, which have been
9411 exposed.
9412 """
54f9ee45 9413 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
9414
9415 def IsExposedPoint(*args, **kwargs):
15afbcd0 9416 """
a95a7133 9417 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
9418
9419 Returns true if the given point or rectangle area has been exposed
9420 since the last repaint. Call this in an paint event handler to
9421 optimize redrawing by only redrawing those areas, which have been
9422 exposed.
9423 """
54f9ee45 9424 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 9425
4276dc52 9426 def IsExposedRect(*args, **kwargs):
15afbcd0 9427 """
a95a7133 9428 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
9429
9430 Returns true if the given point or rectangle area has been exposed
9431 since the last repaint. Call this in an paint event handler to
9432 optimize redrawing by only redrawing those areas, which have been
9433 exposed.
9434 """
54f9ee45 9435 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 9436
74a57fcd
RD
9437 def GetDefaultAttributes(*args, **kwargs):
9438 """
a95a7133 9439 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 9440
41e2b43e
RD
9441 Get the default attributes for an instance of this class. This is
9442 useful if you want to use the same font or colour in your own control
9443 as in a standard control -- which is a much better idea than hard
9444 coding specific colours or fonts which might look completely out of
db3e571a 9445 place on the user's system, especially if it uses themes.
74a57fcd 9446 """
54f9ee45 9447 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9448
9449 def GetClassDefaultAttributes(*args, **kwargs):
9450 """
66c033b4 9451 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 9452
41e2b43e
RD
9453 Get the default attributes for this class. This is useful if you want
9454 to use the same font or colour in your own control as in a standard
9455 control -- which is a much better idea than hard coding specific
db3e571a
RD
9456 colours or fonts which might look completely out of place on the
9457 user's system, especially if it uses themes.
74a57fcd
RD
9458
9459 The variant parameter is only relevant under Mac currently and is
41e2b43e 9460 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
9461 the returned font. See `wx.Window.SetWindowVariant` for more about
9462 this.
74a57fcd 9463 """
54f9ee45 9464 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9465
9466 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 9467 def SetBackgroundColour(*args, **kwargs):
15afbcd0 9468 """
a95a7133 9469 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
9470
9471 Sets the background colour of the window. Returns True if the colour
9472 was changed. The background colour is usually painted by the default
9473 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9474 automatically under GTK. Using `wx.NullColour` will reset the window
9475 to the default background colour.
15afbcd0 9476
db3e571a 9477 Note that setting the background colour may not cause an immediate
f8167d6e 9478 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
9479 calling this function.
9480
f8167d6e
RD
9481 Using this function will disable attempts to use themes for this
9482 window, if the system supports them. Use with care since usually the
9483 themes represent the appearance chosen by the user to be used for all
9484 applications on the system.
15afbcd0 9485 """
54f9ee45 9486 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 9487
412d302d
RD
9488 def SetOwnBackgroundColour(*args, **kwargs):
9489 """SetOwnBackgroundColour(self, Colour colour)"""
9490 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 9491
e811c8ce 9492 def SetForegroundColour(*args, **kwargs):
15afbcd0 9493 """
a95a7133 9494 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
9495
9496 Sets the foreground colour of the window. Returns True is the colour
9497 was changed. The interpretation of foreground colour is dependent on
9498 the window class; it may be the text colour or other colour, or it may
9499 not be used at all.
9500 """
54f9ee45 9501 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 9502
fa47d7a7
VS
9503 def SetOwnForegroundColour(*args, **kwargs):
9504 """SetOwnForegroundColour(self, Colour colour)"""
9505 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 9506
e811c8ce 9507 def GetBackgroundColour(*args, **kwargs):
15afbcd0 9508 """
a95a7133 9509 GetBackgroundColour(self) -> Colour
15afbcd0
RD
9510
9511 Returns the background colour of the window.
9512 """
54f9ee45 9513 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
9514
9515 def GetForegroundColour(*args, **kwargs):
15afbcd0 9516 """
a95a7133 9517 GetForegroundColour(self) -> Colour
15afbcd0
RD
9518
9519 Returns the foreground colour of the window. The interpretation of
9520 foreground colour is dependent on the window class; it may be the text
9521 colour or other colour, or it may not be used at all.
9522 """
54f9ee45 9523 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 9524
562ecc31
RD
9525 def InheritsBackgroundColour(*args, **kwargs):
9526 """InheritsBackgroundColour(self) -> bool"""
9527 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9528
9529 def UseBgCol(*args, **kwargs):
9530 """UseBgCol(self) -> bool"""
9531 return _core_.Window_UseBgCol(*args, **kwargs)
9532
7bc1e663
RD
9533 def SetBackgroundStyle(*args, **kwargs):
9534 """
9535 SetBackgroundStyle(self, int style) -> bool
9536
9537 Returns the background style of the window. The background style
9538 indicates how the background of the window is drawn.
9539
9540 ====================== ========================================
9541 wx.BG_STYLE_SYSTEM The background colour or pattern should
9542 be determined by the system
9543 wx.BG_STYLE_COLOUR The background should be a solid colour
9544 wx.BG_STYLE_CUSTOM The background will be implemented by the
9545 application.
9546 ====================== ========================================
9547
9548 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9549 a custom background, such as a tiled bitmap. Currently the style has
9550 no effect on other platforms.
9551
9552 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9553 """
9554 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9555
9556 def GetBackgroundStyle(*args, **kwargs):
9557 """
9558 GetBackgroundStyle(self) -> int
9559
9560 Returns the background style of the window.
9561
9562 :see: `SetBackgroundStyle`
9563 """
9564 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9565
51b83b37
RD
9566 def HasTransparentBackground(*args, **kwargs):
9567 """
9568 HasTransparentBackground(self) -> bool
9569
9570 Returns True if this window's background is transparent (as, for
9571 example, for `wx.StaticText`) and should show the parent window's
9572 background.
9573
9574 This method is mostly used internally by the library itself and you
9575 normally shouldn't have to call it. You may, however, have to override
9576 it in your custom control classes to ensure that background is painted
9577 correctly.
9578 """
9579 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9580
e811c8ce 9581 def SetCursor(*args, **kwargs):
15afbcd0 9582 """
a95a7133 9583 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
9584
9585 Sets the window's cursor. Notice that the window cursor also sets it
9586 for the children of the window implicitly.
9587
9588 The cursor may be wx.NullCursor in which case the window cursor will
9589 be reset back to default.
9590 """
54f9ee45 9591 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
9592
9593 def GetCursor(*args, **kwargs):
15afbcd0 9594 """
a95a7133 9595 GetCursor(self) -> Cursor
15afbcd0
RD
9596
9597 Return the cursor associated with this window.
9598 """
54f9ee45 9599 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
9600
9601 def SetFont(*args, **kwargs):
15afbcd0 9602 """
a95a7133 9603 SetFont(self, Font font) -> bool
15afbcd0
RD
9604
9605 Sets the font for this window.
9606 """
54f9ee45 9607 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 9608
fa47d7a7
VS
9609 def SetOwnFont(*args, **kwargs):
9610 """SetOwnFont(self, Font font)"""
9611 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 9612
e811c8ce 9613 def GetFont(*args, **kwargs):
15afbcd0 9614 """
a95a7133 9615 GetFont(self) -> Font
15afbcd0 9616
4276dc52 9617 Returns the default font used for this window.
15afbcd0 9618 """
54f9ee45 9619 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
9620
9621 def SetCaret(*args, **kwargs):
15afbcd0 9622 """
a95a7133 9623 SetCaret(self, Caret caret)
15afbcd0
RD
9624
9625 Sets the caret associated with the window.
9626 """
54f9ee45 9627 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
9628
9629 def GetCaret(*args, **kwargs):
15afbcd0 9630 """
a95a7133 9631 GetCaret(self) -> Caret
15afbcd0
RD
9632
9633 Returns the caret associated with the window.
9634 """
54f9ee45 9635 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
9636
9637 def GetCharHeight(*args, **kwargs):
15afbcd0 9638 """
a95a7133 9639 GetCharHeight(self) -> int
15afbcd0
RD
9640
9641 Get the (average) character size for the current font.
9642 """
54f9ee45 9643 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
9644
9645 def GetCharWidth(*args, **kwargs):
15afbcd0 9646 """
a95a7133 9647 GetCharWidth(self) -> int
15afbcd0
RD
9648
9649 Get the (average) character size for the current font.
9650 """
54f9ee45 9651 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
9652
9653 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9654 """
9655 GetTextExtent(String string) -> (width, height)
9656
9657 Get the width and height of the text using the current font.
9658 """
54f9ee45 9659 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
9660
9661 def GetFullTextExtent(*args, **kwargs):
0df68c9f 9662 """
196addbf 9663 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 9664 (width, height, descent, externalLeading)
e811c8ce 9665
15afbcd0
RD
9666 Get the width, height, decent and leading of the text using the
9667 current or specified font.
0df68c9f 9668 """
54f9ee45 9669 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
9670
9671 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
9672 """
9673 ClientToScreenXY(int x, int y) -> (x,y)
9674
9675 Converts to screen coordinates from coordinates relative to this window.
9676 """
54f9ee45 9677 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
9678
9679 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
9680 """
9681 ScreenToClientXY(int x, int y) -> (x,y)
9682
9683 Converts from screen to client window coordinates.
9684 """
54f9ee45 9685 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
9686
9687 def ClientToScreen(*args, **kwargs):
15afbcd0 9688 """
a95a7133 9689 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
9690
9691 Converts to screen coordinates from coordinates relative to this window.
9692 """
54f9ee45 9693 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
9694
9695 def ScreenToClient(*args, **kwargs):
15afbcd0 9696 """
a95a7133 9697 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
9698
9699 Converts from screen to client window coordinates.
9700 """
54f9ee45 9701 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
9702
9703 def HitTestXY(*args, **kwargs):
15afbcd0 9704 """
a95a7133 9705 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
9706
9707 Test where the given (in client coords) point lies
9708 """
54f9ee45 9709 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
9710
9711 def HitTest(*args, **kwargs):
15afbcd0 9712 """
a95a7133 9713 HitTest(self, Point pt) -> int
15afbcd0
RD
9714
9715 Test where the given (in client coords) point lies
9716 """
54f9ee45 9717 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 9718
15afbcd0
RD
9719 def GetBorder(*args):
9720 """
a95a7133
RD
9721 GetBorder(self, long flags) -> int
9722 GetBorder(self) -> int
e811c8ce 9723
15afbcd0
RD
9724 Get border for the flags of this window
9725 """
54f9ee45 9726 return _core_.Window_GetBorder(*args)
e811c8ce
RD
9727
9728 def UpdateWindowUI(*args, **kwargs):
15afbcd0 9729 """
a95a7133 9730 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
9731
9732 This function sends EVT_UPDATE_UI events to the window. The particular
9733 implementation depends on the window; for example a wx.ToolBar will
9734 send an update UI event for each toolbar button, and a wx.Frame will
9735 send an update UI event for each menubar menu item. You can call this
9736 function from your application to ensure that your UI is up-to-date at
9737 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9738 concerned). This may be necessary if you have called
5ba5649b 9739 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
15afbcd0
RD
9740 limit the overhead that wxWindows incurs by sending update UI events
9741 in idle time.
15afbcd0 9742 """
54f9ee45 9743 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
9744
9745 def PopupMenuXY(*args, **kwargs):
15afbcd0 9746 """
b0503257 9747 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 9748
b0503257
RD
9749 Pops up the given menu at the specified coordinates, relative to this window,
9750 and returns control when the user has dismissed the menu. If a menu item is
9751 selected, the corresponding menu event is generated and will be processed as
9752 usual. If the default position is given then the current position of the
9753 mouse cursor will be used.
15afbcd0 9754 """
54f9ee45 9755 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 9756
15afbcd0
RD
9757 def PopupMenu(*args, **kwargs):
9758 """
b0503257 9759 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 9760
b0503257
RD
9761 Pops up the given menu at the specified coordinates, relative to this window,
9762 and returns control when the user has dismissed the menu. If a menu item is
9763 selected, the corresponding menu event is generated and will be processed as
9764 usual. If the default position is given then the current position of the
9765 mouse cursor will be used.
15afbcd0 9766 """
54f9ee45 9767 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0
RD
9768
9769 def GetHandle(*args, **kwargs):
9770 """
a95a7133 9771 GetHandle(self) -> long
15afbcd0
RD
9772
9773 Returns the platform-specific handle (as a long integer) of the
9774 physical window. Currently on wxMac it returns the handle of the
9775 toplevel parent of the window.
9776 """
54f9ee45 9777 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 9778
7e63a440
RD
9779 def AssociateHandle(*args, **kwargs):
9780 """
9781 AssociateHandle(self, long handle)
9782
9783 Associate the window with a new native handle
9784 """
9785 return _core_.Window_AssociateHandle(*args, **kwargs)
9786
9787 def DissociateHandle(*args, **kwargs):
9788 """
9789 DissociateHandle(self)
9790
9791 Dissociate the current native handle from the window
9792 """
9793 return _core_.Window_DissociateHandle(*args, **kwargs)
9794
15afbcd0
RD
9795 def HasScrollbar(*args, **kwargs):
9796 """
a95a7133 9797 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
9798
9799 Does the window have the scrollbar for this orientation?
9800 """
54f9ee45 9801 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
9802
9803 def SetScrollbar(*args, **kwargs):
9804 """
41e2b43e 9805 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
9806 bool refresh=True)
9807
9808 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 9809 """
54f9ee45 9810 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
9811
9812 def SetScrollPos(*args, **kwargs):
15afbcd0 9813 """
a95a7133 9814 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
9815
9816 Sets the position of one of the built-in scrollbars.
9817 """
54f9ee45 9818 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
9819
9820 def GetScrollPos(*args, **kwargs):
15afbcd0 9821 """
a95a7133 9822 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
9823
9824 Returns the built-in scrollbar position.
9825 """
54f9ee45 9826 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
9827
9828 def GetScrollThumb(*args, **kwargs):
15afbcd0 9829 """
a95a7133 9830 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
9831
9832 Returns the built-in scrollbar thumb size.
9833 """
54f9ee45 9834 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
9835
9836 def GetScrollRange(*args, **kwargs):
15afbcd0 9837 """
a95a7133 9838 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
9839
9840 Returns the built-in scrollbar range.
9841 """
54f9ee45 9842 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
9843
9844 def ScrollWindow(*args, **kwargs):
15afbcd0 9845 """
a95a7133 9846 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
9847
9848 Physically scrolls the pixels in the window and move child windows
9849 accordingly. Use this function to optimise your scrolling
9850 implementations, to minimise the area that must be redrawn. Note that
9851 it is rarely required to call this function from a user program.
15afbcd0 9852 """
54f9ee45 9853 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
9854
9855 def ScrollLines(*args, **kwargs):
15afbcd0 9856 """
a95a7133 9857 ScrollLines(self, int lines) -> bool
15afbcd0
RD
9858
9859 If the platform and window class supports it, scrolls the window by
9860 the given number of lines down, if lines is positive, or up if lines
9861 is negative. Returns True if the window was scrolled, False if it was
9862 already on top/bottom and nothing was done.
9863 """
54f9ee45 9864 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
9865
9866 def ScrollPages(*args, **kwargs):
15afbcd0 9867 """
a95a7133 9868 ScrollPages(self, int pages) -> bool
15afbcd0 9869
41e2b43e 9870 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
9871 the given number of pages down, if pages is positive, or up if pages
9872 is negative. Returns True if the window was scrolled, False if it was
9873 already on top/bottom and nothing was done.
9874 """
54f9ee45 9875 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
9876
9877 def LineUp(*args, **kwargs):
15afbcd0 9878 """
a95a7133 9879 LineUp(self) -> bool
15afbcd0
RD
9880
9881 This is just a wrapper for ScrollLines(-1).
9882 """
54f9ee45 9883 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
9884
9885 def LineDown(*args, **kwargs):
15afbcd0 9886 """
a95a7133 9887 LineDown(self) -> bool
15afbcd0
RD
9888
9889 This is just a wrapper for ScrollLines(1).
9890 """
54f9ee45 9891 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
9892
9893 def PageUp(*args, **kwargs):
15afbcd0 9894 """
a95a7133 9895 PageUp(self) -> bool
15afbcd0
RD
9896
9897 This is just a wrapper for ScrollPages(-1).
9898 """
54f9ee45 9899 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
9900
9901 def PageDown(*args, **kwargs):
15afbcd0 9902 """
a95a7133 9903 PageDown(self) -> bool
15afbcd0
RD
9904
9905 This is just a wrapper for ScrollPages(1).
9906 """
54f9ee45 9907 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
9908
9909 def SetHelpText(*args, **kwargs):
15afbcd0 9910 """
a95a7133 9911 SetHelpText(self, String text)
15afbcd0
RD
9912
9913 Sets the help text to be used as context-sensitive help for this
9914 window. Note that the text is actually stored by the current
9915 wxHelpProvider implementation, and not in the window object itself.
9916 """
54f9ee45 9917 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
9918
9919 def SetHelpTextForId(*args, **kwargs):
15afbcd0 9920 """
a95a7133 9921 SetHelpTextForId(self, String text)
15afbcd0
RD
9922
9923 Associate this help text with all windows with the same id as this
9924 one.
9925 """
54f9ee45 9926 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce
RD
9927
9928 def GetHelpText(*args, **kwargs):
15afbcd0 9929 """
a95a7133 9930 GetHelpText(self) -> String
15afbcd0
RD
9931
9932 Gets the help text to be used as context-sensitive help for this
9933 window. Note that the text is actually stored by the current
9934 wxHelpProvider implementation, and not in the window object itself.
9935 """
54f9ee45 9936 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
9937
9938 def SetToolTipString(*args, **kwargs):
15afbcd0 9939 """
a95a7133 9940 SetToolTipString(self, String tip)
15afbcd0
RD
9941
9942 Attach a tooltip to the window.
9943 """
54f9ee45 9944 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
9945
9946 def SetToolTip(*args, **kwargs):
15afbcd0 9947 """
a95a7133 9948 SetToolTip(self, ToolTip tip)
15afbcd0
RD
9949
9950 Attach a tooltip to the window.
9951 """
54f9ee45 9952 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
9953
9954 def GetToolTip(*args, **kwargs):
15afbcd0 9955 """
a95a7133 9956 GetToolTip(self) -> ToolTip
15afbcd0
RD
9957
9958 get the associated tooltip or None if none
9959 """
54f9ee45 9960 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
9961
9962 def SetDropTarget(*args, **kwargs):
15afbcd0 9963 """
a95a7133 9964 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
9965
9966 Associates a drop target with this window. If the window already has
9967 a drop target, it is deleted.
9968 """
54f9ee45 9969 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
9970
9971 def GetDropTarget(*args, **kwargs):
15afbcd0 9972 """
a95a7133 9973 GetDropTarget(self) -> DropTarget
15afbcd0
RD
9974
9975 Returns the associated drop target, which may be None.
9976 """
54f9ee45 9977 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce 9978
5ba5649b
RD
9979 def DragAcceptFiles(*args, **kwargs):
9980 """
9981 DragAcceptFiles(self, bool accept)
9982
9983 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9984 Only functional on Windows.
9985 """
9986 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9987
e811c8ce 9988 def SetConstraints(*args, **kwargs):
15afbcd0 9989 """
a95a7133 9990 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
9991
9992 Sets the window to have the given layout constraints. If an existing
9993 layout constraints object is already owned by the window, it will be
9994 deleted. Pass None to disassociate and delete the window's current
9995 constraints.
9996
9997 You must call SetAutoLayout to tell a window to use the constraints
9998 automatically in its default EVT_SIZE handler; otherwise, you must
9999 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10000 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10001 effect.
10002 """
54f9ee45 10003 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
10004
10005 def GetConstraints(*args, **kwargs):
15afbcd0 10006 """
a95a7133 10007 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
10008
10009 Returns a pointer to the window's layout constraints, or None if there
10010 are none.
10011 """
54f9ee45 10012 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
10013
10014 def SetAutoLayout(*args, **kwargs):
15afbcd0 10015 """
a95a7133 10016 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
10017
10018 Determines whether the Layout function will be called automatically
10019 when the window is resized. It is called implicitly by SetSizer but
10020 if you use SetConstraints you should call it manually or otherwise the
10021 window layout won't be correctly updated when its size changes.
10022 """
54f9ee45 10023 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
10024
10025 def GetAutoLayout(*args, **kwargs):
15afbcd0 10026 """
a95a7133 10027 GetAutoLayout(self) -> bool
15afbcd0
RD
10028
10029 Returns the current autoLayout setting
10030 """
54f9ee45 10031 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
10032
10033 def Layout(*args, **kwargs):
15afbcd0 10034 """
a95a7133 10035 Layout(self) -> bool
15afbcd0
RD
10036
10037 Invokes the constraint-based layout algorithm or the sizer-based
10038 algorithm for this window. See SetAutoLayout: when auto layout is on,
10039 this function gets called automatically by the default EVT_SIZE
10040 handler when the window is resized.
10041 """
54f9ee45 10042 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
10043
10044 def SetSizer(*args, **kwargs):
15afbcd0 10045 """
a95a7133 10046 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
10047
10048 Sets the window to have the given layout sizer. The window will then
10049 own the object, and will take care of its deletion. If an existing
10050 layout sizer object is already owned by the window, it will be deleted
10051 if the deleteOld parameter is true. Note that this function will also
10052 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 10053 non-None, and False otherwise.
15afbcd0 10054 """
54f9ee45 10055 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
10056
10057 def SetSizerAndFit(*args, **kwargs):
15afbcd0 10058 """
a95a7133 10059 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
10060
10061 The same as SetSizer, except it also sets the size hints for the
10062 window based on the sizer's minimum size.
10063 """
54f9ee45 10064 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
10065
10066 def GetSizer(*args, **kwargs):
15afbcd0 10067 """
a95a7133 10068 GetSizer(self) -> Sizer
15afbcd0
RD
10069
10070 Return the sizer associated with the window by a previous call to
10071 SetSizer or None if there isn't one.
10072 """
54f9ee45 10073 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
10074
10075 def SetContainingSizer(*args, **kwargs):
15afbcd0 10076 """
a95a7133 10077 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
10078
10079 This normally does not need to be called by application code. It is
10080 called internally when a window is added to a sizer, and is used so
10081 the window can remove itself from the sizer when it is destroyed.
10082 """
54f9ee45 10083 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
10084
10085 def GetContainingSizer(*args, **kwargs):
15afbcd0 10086 """
a95a7133 10087 GetContainingSizer(self) -> Sizer
15afbcd0
RD
10088
10089 Return the sizer that this window is a member of, if any, otherwise None.
10090 """
54f9ee45 10091 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 10092
a95a7133
RD
10093 def InheritAttributes(*args, **kwargs):
10094 """
10095 InheritAttributes(self)
10096
41e2b43e
RD
10097 This function is (or should be, in case of custom controls) called
10098 during window creation to intelligently set up the window visual
10099 attributes, that is the font and the foreground and background
10100 colours.
10101
10102 By 'intelligently' the following is meant: by default, all windows use
10103 their own default attributes. However if some of the parent's
10104 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10105 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
10106 explicitly set for this window itself, then this window takes the same
10107 value as used by the parent. In addition, if the window overrides
10108 ShouldInheritColours to return false, the colours will not be changed
10109 no matter what and only the font might.
10110
34621cc5 10111 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 10112 different usage scenarios. The most common one is when all default
41e2b43e
RD
10113 attributes are used and in this case, nothing should be inherited as
10114 in modern GUIs different controls use different fonts (and colours)
10115 than their siblings so they can't inherit the same value from the
10116 parent. However it was also deemed desirable to allow to simply change
10117 the attributes of all children at once by just changing the font or
10118 colour of their common parent, hence in this case we do inherit the
10119 parents attributes.
10120
a95a7133 10121 """
54f9ee45 10122 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
10123
10124 def ShouldInheritColours(*args, **kwargs):
10125 """
10126 ShouldInheritColours(self) -> bool
10127
10128 Return true from here to allow the colours of this window to be
41e2b43e
RD
10129 changed by InheritAttributes, returning false forbids inheriting them
10130 from the parent window.
a95a7133 10131
41e2b43e
RD
10132 The base class version returns false, but this method is overridden in
10133 wxControl where it returns true.
a95a7133 10134 """
54f9ee45 10135 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 10136
e811c8ce 10137 def PostCreate(self, pre):
15afbcd0
RD
10138 """
10139 Phase 3 of the 2-phase create <wink!>
10140 Call this method after precreating the window with the 2-phase create method.
10141 """
e811c8ce
RD
10142 self.this = pre.this
10143 self.thisown = pre.thisown
10144 pre.thisown = 0
10145 if hasattr(self, '_setOORInfo'):
10146 self._setOORInfo(self)
10147 if hasattr(self, '_setCallbackInfo'):
10148 self._setCallbackInfo(self, self.__class__)
10149
10150
10151class WindowPtr(Window):
10152 def __init__(self, this):
10153 self.this = this
10154 if not hasattr(self,"thisown"): self.thisown = 0
10155 self.__class__ = Window
54f9ee45 10156_core_.Window_swigregister(WindowPtr)
e811c8ce
RD
10157
10158def PreWindow(*args, **kwargs):
15afbcd0
RD
10159 """
10160 PreWindow() -> Window
10161
10162 Precreate a Window for 2-phase creation.
10163 """
54f9ee45 10164 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
10165 val.thisown = 1
10166 return val
10167
10168def Window_NewControlId(*args, **kwargs):
15afbcd0
RD
10169 """
10170 Window_NewControlId() -> int
10171
10172 Generate a control id for the controls which were not given one.
10173 """
54f9ee45 10174 return _core_.Window_NewControlId(*args, **kwargs)
e811c8ce
RD
10175
10176def Window_NextControlId(*args, **kwargs):
15afbcd0
RD
10177 """
10178 Window_NextControlId(int winid) -> int
10179
10180 Get the id of the control following the one with the given
41e2b43e 10181 autogenerated) id
15afbcd0 10182 """
54f9ee45 10183 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
10184
10185def Window_PrevControlId(*args, **kwargs):
15afbcd0
RD
10186 """
10187 Window_PrevControlId(int winid) -> int
10188
10189 Get the id of the control preceding the one with the given
41e2b43e 10190 autogenerated) id
15afbcd0 10191 """
54f9ee45 10192 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce
RD
10193
10194def Window_FindFocus(*args, **kwargs):
15afbcd0
RD
10195 """
10196 Window_FindFocus() -> Window
10197
10198 Returns the window or control that currently has the keyboard focus,
10199 or None.
10200 """
54f9ee45 10201 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
10202
10203def Window_GetCapture(*args, **kwargs):
15afbcd0
RD
10204 """
10205 Window_GetCapture() -> Window
10206
10207 Returns the window which currently captures the mouse or None
10208 """
54f9ee45 10209 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce 10210
74a57fcd
RD
10211def Window_GetClassDefaultAttributes(*args, **kwargs):
10212 """
10213 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10214
41e2b43e
RD
10215 Get the default attributes for this class. This is useful if you want
10216 to use the same font or colour in your own control as in a standard
10217 control -- which is a much better idea than hard coding specific
db3e571a
RD
10218 colours or fonts which might look completely out of place on the
10219 user's system, especially if it uses themes.
74a57fcd
RD
10220
10221 The variant parameter is only relevant under Mac currently and is
41e2b43e 10222 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
10223 the returned font. See `wx.Window.SetWindowVariant` for more about
10224 this.
74a57fcd 10225 """
54f9ee45 10226 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 10227
e811c8ce 10228def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
10229 """
10230 Convenience function for converting a Point or (x,y) in
10231 dialog units to pixel units.
10232 """
e811c8ce
RD
10233 if y is None:
10234 return win.ConvertDialogPointToPixels(point_or_x)
10235 else:
fd3f2efe 10236 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
10237
10238def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
10239 """
10240 Convenience function for converting a Size or (w,h) in
10241 dialog units to pixel units.
10242 """
e811c8ce
RD
10243 if height is None:
10244 return win.ConvertDialogSizeToPixels(size_width)
10245 else:
fd3f2efe 10246 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
10247
10248
10249def FindWindowById(*args, **kwargs):
15afbcd0
RD
10250 """
10251 FindWindowById(long id, Window parent=None) -> Window
10252
10253 Find the first window in the application with the given id. If parent
10254 is None, the search will start from all top-level frames and dialog
10255 boxes; if non-None, the search will be limited to the given window
10256 hierarchy. The search is recursive in both cases.
10257 """
54f9ee45 10258 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
10259
10260def FindWindowByName(*args, **kwargs):
15afbcd0
RD
10261 """
10262 FindWindowByName(String name, Window parent=None) -> Window
10263
10264 Find a window by its name (as given in a window constructor or Create
10265 function call). If parent is None, the search will start from all
10266 top-level frames and dialog boxes; if non-None, the search will be
10267 limited to the given window hierarchy. The search is recursive in both
10268 cases.
10269
10270 If no window with such name is found, wx.FindWindowByLabel is called.
10271 """
54f9ee45 10272 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
10273
10274def FindWindowByLabel(*args, **kwargs):
15afbcd0
RD
10275 """
10276 FindWindowByLabel(String label, Window parent=None) -> Window
10277
10278 Find a window by its label. Depending on the type of window, the label
10279 may be a window title or panel item label. If parent is None, the
10280 search will start from all top-level frames and dialog boxes; if
10281 non-None, the search will be limited to the given window
10282 hierarchy. The search is recursive in both cases.
10283 """
54f9ee45 10284 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
10285
10286def Window_FromHWND(*args, **kwargs):
4276dc52 10287 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
54f9ee45 10288 return _core_.Window_FromHWND(*args, **kwargs)
b6b0383e
RD
10289
10290def GetTopLevelWindows(*args, **kwargs):
10291 """
10292 GetTopLevelWindows() -> PyObject
10293
10294 Returns a list of the the application's top-level windows, (frames,
10295 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10296 by wxWidgets, and so it is only valid as long as no top-level windows
10297 are closed or new top-level windows are created.
10298
10299 """
10300 return _core_.GetTopLevelWindows(*args, **kwargs)
e811c8ce
RD
10301#---------------------------------------------------------------------------
10302
10303class Validator(EvtHandler):
093d3ff1 10304 """Proxy of C++ Validator class"""
e811c8ce
RD
10305 def __repr__(self):
10306 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10307 def __init__(self, *args, **kwargs):
a95a7133 10308 """__init__(self) -> Validator"""
54f9ee45 10309 newobj = _core_.new_Validator(*args, **kwargs)
d14a1e28
RD
10310 self.this = newobj.this
10311 self.thisown = 1
10312 del newobj.thisown
10313 self._setOORInfo(self)
e811c8ce
RD
10314
10315 def Clone(*args, **kwargs):
a95a7133 10316 """Clone(self) -> Validator"""
54f9ee45 10317 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
10318
10319 def Validate(*args, **kwargs):
a95a7133 10320 """Validate(self, Window parent) -> bool"""
54f9ee45 10321 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
10322
10323 def TransferToWindow(*args, **kwargs):
a95a7133 10324 """TransferToWindow(self) -> bool"""
54f9ee45 10325 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
10326
10327 def TransferFromWindow(*args, **kwargs):
a95a7133 10328 """TransferFromWindow(self) -> bool"""
54f9ee45 10329 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
10330
10331 def GetWindow(*args, **kwargs):
a95a7133 10332 """GetWindow(self) -> Window"""
54f9ee45 10333 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
10334
10335 def SetWindow(*args, **kwargs):
a95a7133 10336 """SetWindow(self, Window window)"""
54f9ee45 10337 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
10338
10339 def IsSilent(*args, **kwargs):
66c033b4 10340 """IsSilent() -> bool"""
54f9ee45 10341 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
10342
10343 IsSilent = staticmethod(IsSilent)
10344 def SetBellOnError(*args, **kwargs):
66c033b4 10345 """SetBellOnError(int doIt=True)"""
54f9ee45 10346 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10347
10348 SetBellOnError = staticmethod(SetBellOnError)
10349
10350class ValidatorPtr(Validator):
10351 def __init__(self, this):
10352 self.this = this
10353 if not hasattr(self,"thisown"): self.thisown = 0
10354 self.__class__ = Validator
54f9ee45 10355_core_.Validator_swigregister(ValidatorPtr)
e811c8ce
RD
10356
10357def Validator_IsSilent(*args, **kwargs):
10358 """Validator_IsSilent() -> bool"""
54f9ee45 10359 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
10360
10361def Validator_SetBellOnError(*args, **kwargs):
10362 """Validator_SetBellOnError(int doIt=True)"""
54f9ee45 10363 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10364
10365class PyValidator(Validator):
093d3ff1 10366 """Proxy of C++ PyValidator class"""
e811c8ce
RD
10367 def __repr__(self):
10368 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10369 def __init__(self, *args, **kwargs):
a95a7133 10370 """__init__(self) -> PyValidator"""
54f9ee45 10371 newobj = _core_.new_PyValidator(*args, **kwargs)
e811c8ce
RD
10372 self.this = newobj.this
10373 self.thisown = 1
10374 del newobj.thisown
10375
10376 self._setCallbackInfo(self, PyValidator, 1)
10377 self._setOORInfo(self)
10378
10379 def _setCallbackInfo(*args, **kwargs):
a95a7133 10380 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
54f9ee45 10381 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
10382
10383
10384class PyValidatorPtr(PyValidator):
10385 def __init__(self, this):
10386 self.this = this
10387 if not hasattr(self,"thisown"): self.thisown = 0
10388 self.__class__ = PyValidator
54f9ee45 10389_core_.PyValidator_swigregister(PyValidatorPtr)
e811c8ce
RD
10390
10391#---------------------------------------------------------------------------
10392
10393class Menu(EvtHandler):
093d3ff1 10394 """Proxy of C++ Menu class"""
d14a1e28
RD
10395 def __repr__(self):
10396 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 10397 def __init__(self, *args, **kwargs):
a95a7133 10398 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
54f9ee45 10399 newobj = _core_.new_Menu(*args, **kwargs)
e811c8ce
RD
10400 self.this = newobj.this
10401 self.thisown = 1
10402 del newobj.thisown
10403 self._setOORInfo(self)
10404
10405 def Append(*args, **kwargs):
a95a7133 10406 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 10407 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
10408
10409 def AppendSeparator(*args, **kwargs):
a95a7133 10410 """AppendSeparator(self) -> MenuItem"""
54f9ee45 10411 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
10412
10413 def AppendCheckItem(*args, **kwargs):
a95a7133 10414 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10415 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
10416
10417 def AppendRadioItem(*args, **kwargs):
a95a7133 10418 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10419 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
10420
10421 def AppendMenu(*args, **kwargs):
a95a7133 10422 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10423 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce
RD
10424
10425 def AppendItem(*args, **kwargs):
a95a7133 10426 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10427 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce
RD
10428
10429 def Break(*args, **kwargs):
a95a7133 10430 """Break(self)"""
54f9ee45 10431 return _core_.Menu_Break(*args, **kwargs)
e811c8ce
RD
10432
10433 def InsertItem(*args, **kwargs):
a95a7133 10434 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 10435 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce
RD
10436
10437 def Insert(*args, **kwargs):
0df68c9f 10438 """
a95a7133 10439 Insert(self, size_t pos, int id, String text, String help=EmptyString,
a41e16b6 10440 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 10441 """
54f9ee45 10442 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
10443
10444 def InsertSeparator(*args, **kwargs):
a95a7133 10445 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 10446 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
10447
10448 def InsertCheckItem(*args, **kwargs):
a95a7133 10449 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10450 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
10451
10452 def InsertRadioItem(*args, **kwargs):
a95a7133 10453 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10454 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
10455
10456 def InsertMenu(*args, **kwargs):
a95a7133 10457 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10458 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce
RD
10459
10460 def PrependItem(*args, **kwargs):
a95a7133 10461 """PrependItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10462 return _core_.Menu_PrependItem(*args, **kwargs)
e811c8ce
RD
10463
10464 def Prepend(*args, **kwargs):
a95a7133 10465 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 10466 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
10467
10468 def PrependSeparator(*args, **kwargs):
a95a7133 10469 """PrependSeparator(self) -> MenuItem"""
54f9ee45 10470 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
10471
10472 def PrependCheckItem(*args, **kwargs):
a95a7133 10473 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10474 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
10475
10476 def PrependRadioItem(*args, **kwargs):
a95a7133 10477 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10478 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
10479
10480 def PrependMenu(*args, **kwargs):
a95a7133 10481 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10482 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
10483
10484 def Remove(*args, **kwargs):
a95a7133 10485 """Remove(self, int id) -> MenuItem"""
54f9ee45 10486 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce
RD
10487
10488 def RemoveItem(*args, **kwargs):
a95a7133 10489 """RemoveItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10490 return _core_.Menu_RemoveItem(*args, **kwargs)
e811c8ce
RD
10491
10492 def Delete(*args, **kwargs):
a95a7133 10493 """Delete(self, int id) -> bool"""
54f9ee45 10494 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
10495
10496 def DeleteItem(*args, **kwargs):
a95a7133 10497 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 10498 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
10499
10500 def Destroy(*args, **kwargs):
0df68c9f 10501 """
a95a7133 10502 Destroy(self)
e811c8ce 10503
0df68c9f
RD
10504 Deletes the C++ object this Python object is a proxy for.
10505 """
54f9ee45 10506 return _core_.Menu_Destroy(*args, **kwargs)
e811c8ce
RD
10507
10508 def DestroyId(*args, **kwargs):
0df68c9f 10509 """
a95a7133 10510 DestroyId(self, int id) -> bool
e811c8ce 10511
0df68c9f
RD
10512 Deletes the C++ object this Python object is a proxy for.
10513 """
54f9ee45 10514 return _core_.Menu_DestroyId(*args, **kwargs)
e811c8ce
RD
10515
10516 def DestroyItem(*args, **kwargs):
0df68c9f 10517 """
a95a7133 10518 DestroyItem(self, MenuItem item) -> bool
e811c8ce 10519
0df68c9f
RD
10520 Deletes the C++ object this Python object is a proxy for.
10521 """
54f9ee45 10522 return _core_.Menu_DestroyItem(*args, **kwargs)
e811c8ce
RD
10523
10524 def GetMenuItemCount(*args, **kwargs):
a95a7133 10525 """GetMenuItemCount(self) -> size_t"""
54f9ee45 10526 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
10527
10528 def GetMenuItems(*args, **kwargs):
a95a7133 10529 """GetMenuItems(self) -> PyObject"""
54f9ee45 10530 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
10531
10532 def FindItem(*args, **kwargs):
a95a7133 10533 """FindItem(self, String item) -> int"""
54f9ee45 10534 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
10535
10536 def FindItemById(*args, **kwargs):
a95a7133 10537 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10538 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
10539
10540 def FindItemByPosition(*args, **kwargs):
a95a7133 10541 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 10542 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
10543
10544 def Enable(*args, **kwargs):
a95a7133 10545 """Enable(self, int id, bool enable)"""
54f9ee45 10546 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
10547
10548 def IsEnabled(*args, **kwargs):
a95a7133 10549 """IsEnabled(self, int id) -> bool"""
54f9ee45 10550 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
10551
10552 def Check(*args, **kwargs):
a95a7133 10553 """Check(self, int id, bool check)"""
54f9ee45 10554 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
10555
10556 def IsChecked(*args, **kwargs):
a95a7133 10557 """IsChecked(self, int id) -> bool"""
54f9ee45 10558 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
10559
10560 def SetLabel(*args, **kwargs):
a95a7133 10561 """SetLabel(self, int id, String label)"""
54f9ee45 10562 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
10563
10564 def GetLabel(*args, **kwargs):
a95a7133 10565 """GetLabel(self, int id) -> String"""
54f9ee45 10566 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
10567
10568 def SetHelpString(*args, **kwargs):
a95a7133 10569 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10570 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
10571
10572 def GetHelpString(*args, **kwargs):
a95a7133 10573 """GetHelpString(self, int id) -> String"""
54f9ee45 10574 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
10575
10576 def SetTitle(*args, **kwargs):
a95a7133 10577 """SetTitle(self, String title)"""
54f9ee45 10578 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
10579
10580 def GetTitle(*args, **kwargs):
a95a7133 10581 """GetTitle(self) -> String"""
54f9ee45 10582 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
10583
10584 def SetEventHandler(*args, **kwargs):
a95a7133 10585 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 10586 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
10587
10588 def GetEventHandler(*args, **kwargs):
a95a7133 10589 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 10590 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
10591
10592 def SetInvokingWindow(*args, **kwargs):
a95a7133 10593 """SetInvokingWindow(self, Window win)"""
54f9ee45 10594 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10595
10596 def GetInvokingWindow(*args, **kwargs):
a95a7133 10597 """GetInvokingWindow(self) -> Window"""
54f9ee45 10598 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10599
10600 def GetStyle(*args, **kwargs):
a95a7133 10601 """GetStyle(self) -> long"""
54f9ee45 10602 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
10603
10604 def UpdateUI(*args, **kwargs):
a95a7133 10605 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 10606 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
10607
10608 def GetMenuBar(*args, **kwargs):
a95a7133 10609 """GetMenuBar(self) -> MenuBar"""
54f9ee45 10610 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
10611
10612 def Attach(*args, **kwargs):
a95a7133 10613 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 10614 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
10615
10616 def Detach(*args, **kwargs):
a95a7133 10617 """Detach(self)"""
54f9ee45 10618 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
10619
10620 def IsAttached(*args, **kwargs):
a95a7133 10621 """IsAttached(self) -> bool"""
54f9ee45 10622 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
10623
10624 def SetParent(*args, **kwargs):
a95a7133 10625 """SetParent(self, Menu parent)"""
54f9ee45 10626 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
10627
10628 def GetParent(*args, **kwargs):
a95a7133 10629 """GetParent(self) -> Menu"""
54f9ee45 10630 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 10631
d14a1e28
RD
10632
10633class MenuPtr(Menu):
10634 def __init__(self, this):
10635 self.this = this
10636 if not hasattr(self,"thisown"): self.thisown = 0
10637 self.__class__ = Menu
54f9ee45 10638_core_.Menu_swigregister(MenuPtr)
d14a1e28
RD
10639DefaultValidator = cvar.DefaultValidator
10640
10641#---------------------------------------------------------------------------
10642
10643class MenuBar(Window):
093d3ff1 10644 """Proxy of C++ MenuBar class"""
e811c8ce
RD
10645 def __repr__(self):
10646 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10647 def __init__(self, *args, **kwargs):
a95a7133 10648 """__init__(self, long style=0) -> MenuBar"""
54f9ee45 10649 newobj = _core_.new_MenuBar(*args, **kwargs)
d14a1e28
RD
10650 self.this = newobj.this
10651 self.thisown = 1
10652 del newobj.thisown
10653 self._setOORInfo(self)
e811c8ce
RD
10654
10655 def Append(*args, **kwargs):
a95a7133 10656 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 10657 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
10658
10659 def Insert(*args, **kwargs):
a95a7133 10660 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 10661 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
10662
10663 def GetMenuCount(*args, **kwargs):
a95a7133 10664 """GetMenuCount(self) -> size_t"""
54f9ee45 10665 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
10666
10667 def GetMenu(*args, **kwargs):
a95a7133 10668 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 10669 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
10670
10671 def Replace(*args, **kwargs):
a95a7133 10672 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 10673 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
10674
10675 def Remove(*args, **kwargs):
a95a7133 10676 """Remove(self, size_t pos) -> Menu"""
54f9ee45 10677 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
10678
10679 def EnableTop(*args, **kwargs):
a95a7133 10680 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 10681 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
10682
10683 def IsEnabledTop(*args, **kwargs):
a95a7133 10684 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 10685 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
10686
10687 def SetLabelTop(*args, **kwargs):
a95a7133 10688 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 10689 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
10690
10691 def GetLabelTop(*args, **kwargs):
a95a7133 10692 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 10693 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
10694
10695 def FindMenuItem(*args, **kwargs):
a95a7133 10696 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 10697 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
10698
10699 def FindItemById(*args, **kwargs):
a95a7133 10700 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10701 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
10702
10703 def FindMenu(*args, **kwargs):
a95a7133 10704 """FindMenu(self, String title) -> int"""
54f9ee45 10705 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
10706
10707 def Enable(*args, **kwargs):
a95a7133 10708 """Enable(self, int id, bool enable)"""
54f9ee45 10709 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
10710
10711 def Check(*args, **kwargs):
a95a7133 10712 """Check(self, int id, bool check)"""
54f9ee45 10713 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
10714
10715 def IsChecked(*args, **kwargs):
a95a7133 10716 """IsChecked(self, int id) -> bool"""
54f9ee45 10717 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
10718
10719 def IsEnabled(*args, **kwargs):
a95a7133 10720 """IsEnabled(self, int id) -> bool"""
54f9ee45 10721 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
10722
10723 def SetLabel(*args, **kwargs):
a95a7133 10724 """SetLabel(self, int id, String label)"""
54f9ee45 10725 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
10726
10727 def GetLabel(*args, **kwargs):
a95a7133 10728 """GetLabel(self, int id) -> String"""
54f9ee45 10729 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
10730
10731 def SetHelpString(*args, **kwargs):
a95a7133 10732 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10733 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
10734
10735 def GetHelpString(*args, **kwargs):
a95a7133 10736 """GetHelpString(self, int id) -> String"""
54f9ee45 10737 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
10738
10739 def GetFrame(*args, **kwargs):
a95a7133 10740 """GetFrame(self) -> wxFrame"""
54f9ee45 10741 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
10742
10743 def IsAttached(*args, **kwargs):
a95a7133 10744 """IsAttached(self) -> bool"""
54f9ee45 10745 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
10746
10747 def Attach(*args, **kwargs):
a95a7133 10748 """Attach(self, wxFrame frame)"""
54f9ee45 10749 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
10750
10751 def Detach(*args, **kwargs):
a95a7133 10752 """Detach(self)"""
54f9ee45 10753 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 10754
4f433fef
RD
10755 def SetAutoWindowMenu(*args, **kwargs):
10756 """SetAutoWindowMenu(bool enable)"""
10757 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10758
10759 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10760 def GetAutoWindowMenu(*args, **kwargs):
10761 """GetAutoWindowMenu() -> bool"""
10762 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10763
10764 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
d14a1e28
RD
10765
10766class MenuBarPtr(MenuBar):
10767 def __init__(self, this):
10768 self.this = this
10769 if not hasattr(self,"thisown"): self.thisown = 0
10770 self.__class__ = MenuBar
54f9ee45 10771_core_.MenuBar_swigregister(MenuBarPtr)
d14a1e28 10772
4f433fef
RD
10773def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10774 """MenuBar_SetAutoWindowMenu(bool enable)"""
10775 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10776
10777def MenuBar_GetAutoWindowMenu(*args, **kwargs):
10778 """MenuBar_GetAutoWindowMenu() -> bool"""
10779 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10780
d14a1e28
RD
10781#---------------------------------------------------------------------------
10782
10783class MenuItem(Object):
093d3ff1 10784 """Proxy of C++ MenuItem class"""
e811c8ce
RD
10785 def __repr__(self):
10786 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10787 def __init__(self, *args, **kwargs):
0df68c9f 10788 """
a95a7133 10789 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
196addbf
RD
10790 String help=EmptyString, int kind=ITEM_NORMAL,
10791 Menu subMenu=None) -> MenuItem
0df68c9f 10792 """
54f9ee45 10793 newobj = _core_.new_MenuItem(*args, **kwargs)
d14a1e28
RD
10794 self.this = newobj.this
10795 self.thisown = 1
10796 del newobj.thisown
e811c8ce 10797 def GetMenu(*args, **kwargs):
a95a7133 10798 """GetMenu(self) -> Menu"""
54f9ee45 10799 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
10800
10801 def SetMenu(*args, **kwargs):
a95a7133 10802 """SetMenu(self, Menu menu)"""
54f9ee45 10803 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
10804
10805 def SetId(*args, **kwargs):
a95a7133 10806 """SetId(self, int id)"""
54f9ee45 10807 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
10808
10809 def GetId(*args, **kwargs):
a95a7133 10810 """GetId(self) -> int"""
54f9ee45 10811 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
10812
10813 def IsSeparator(*args, **kwargs):
a95a7133 10814 """IsSeparator(self) -> bool"""
54f9ee45 10815 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
10816
10817 def SetText(*args, **kwargs):
a95a7133 10818 """SetText(self, String str)"""
54f9ee45 10819 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
10820
10821 def GetLabel(*args, **kwargs):
a95a7133 10822 """GetLabel(self) -> String"""
54f9ee45 10823 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
10824
10825 def GetText(*args, **kwargs):
a95a7133 10826 """GetText(self) -> String"""
54f9ee45 10827 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
10828
10829 def GetLabelFromText(*args, **kwargs):
66c033b4 10830 """GetLabelFromText(String text) -> String"""
54f9ee45 10831 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
10832
10833 GetLabelFromText = staticmethod(GetLabelFromText)
10834 def GetKind(*args, **kwargs):
a95a7133 10835 """GetKind(self) -> int"""
54f9ee45 10836 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 10837
a95a7133
RD
10838 def SetKind(*args, **kwargs):
10839 """SetKind(self, int kind)"""
54f9ee45 10840 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 10841
e811c8ce 10842 def SetCheckable(*args, **kwargs):
a95a7133 10843 """SetCheckable(self, bool checkable)"""
54f9ee45 10844 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
10845
10846 def IsCheckable(*args, **kwargs):
a95a7133 10847 """IsCheckable(self) -> bool"""
54f9ee45 10848 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
10849
10850 def IsSubMenu(*args, **kwargs):
a95a7133 10851 """IsSubMenu(self) -> bool"""
54f9ee45 10852 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
10853
10854 def SetSubMenu(*args, **kwargs):
a95a7133 10855 """SetSubMenu(self, Menu menu)"""
54f9ee45 10856 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
10857
10858 def GetSubMenu(*args, **kwargs):
a95a7133 10859 """GetSubMenu(self) -> Menu"""
54f9ee45 10860 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
10861
10862 def Enable(*args, **kwargs):
a95a7133 10863 """Enable(self, bool enable=True)"""
54f9ee45 10864 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
10865
10866 def IsEnabled(*args, **kwargs):
a95a7133 10867 """IsEnabled(self) -> bool"""
54f9ee45 10868 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
10869
10870 def Check(*args, **kwargs):
a95a7133 10871 """Check(self, bool check=True)"""
54f9ee45 10872 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
10873
10874 def IsChecked(*args, **kwargs):
a95a7133 10875 """IsChecked(self) -> bool"""
54f9ee45 10876 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
10877
10878 def Toggle(*args, **kwargs):
a95a7133 10879 """Toggle(self)"""
54f9ee45 10880 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
10881
10882 def SetHelp(*args, **kwargs):
a95a7133 10883 """SetHelp(self, String str)"""
54f9ee45 10884 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
10885
10886 def GetHelp(*args, **kwargs):
a95a7133 10887 """GetHelp(self) -> String"""
54f9ee45 10888 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
10889
10890 def GetAccel(*args, **kwargs):
a95a7133 10891 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 10892 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
10893
10894 def SetAccel(*args, **kwargs):
a95a7133 10895 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 10896 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce 10897
091f5bed
RD
10898 def SetBitmap(*args, **kwargs):
10899 """SetBitmap(self, Bitmap bitmap)"""
10900 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10901
10902 def GetBitmap(*args, **kwargs):
10903 """GetBitmap(self) -> Bitmap"""
10904 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10905
c1280d1e
RD
10906 def SetFont(*args, **kwargs):
10907 """SetFont(self, Font font)"""
10908 return _core_.MenuItem_SetFont(*args, **kwargs)
10909
10910 def GetFont(*args, **kwargs):
10911 """GetFont(self) -> Font"""
10912 return _core_.MenuItem_GetFont(*args, **kwargs)
10913
10914 def SetTextColour(*args, **kwargs):
10915 """SetTextColour(self, Colour colText)"""
10916 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10917
10918 def GetTextColour(*args, **kwargs):
10919 """GetTextColour(self) -> Colour"""
10920 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10921
10922 def SetBackgroundColour(*args, **kwargs):
10923 """SetBackgroundColour(self, Colour colBack)"""
10924 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10925
10926 def GetBackgroundColour(*args, **kwargs):
10927 """GetBackgroundColour(self) -> Colour"""
10928 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10929
10930 def SetBitmaps(*args, **kwargs):
10931 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10932 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10933
10934 def SetDisabledBitmap(*args, **kwargs):
10935 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10936 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10937
10938 def GetDisabledBitmap(*args, **kwargs):
10939 """GetDisabledBitmap(self) -> Bitmap"""
10940 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10941
10942 def SetMarginWidth(*args, **kwargs):
10943 """SetMarginWidth(self, int nWidth)"""
10944 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10945
10946 def GetMarginWidth(*args, **kwargs):
10947 """GetMarginWidth(self) -> int"""
10948 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10949
e811c8ce 10950 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 10951 """GetDefaultMarginWidth() -> int"""
54f9ee45 10952 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
10953
10954 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10955 def IsOwnerDrawn(*args, **kwargs):
10956 """IsOwnerDrawn(self) -> bool"""
10957 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10958
10959 def SetOwnerDrawn(*args, **kwargs):
10960 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10961 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10962
10963 def ResetOwnerDrawn(*args, **kwargs):
10964 """ResetOwnerDrawn(self)"""
10965 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10966
d14a1e28
RD
10967
10968class MenuItemPtr(MenuItem):
10969 def __init__(self, this):
10970 self.this = this
10971 if not hasattr(self,"thisown"): self.thisown = 0
10972 self.__class__ = MenuItem
54f9ee45 10973_core_.MenuItem_swigregister(MenuItemPtr)
d14a1e28 10974
e811c8ce 10975def MenuItem_GetLabelFromText(*args, **kwargs):
196addbf 10976 """MenuItem_GetLabelFromText(String text) -> String"""
54f9ee45 10977 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 10978
e811c8ce
RD
10979def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
10980 """MenuItem_GetDefaultMarginWidth() -> int"""
54f9ee45 10981 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d14a1e28
RD
10982
10983#---------------------------------------------------------------------------
10984
10985class Control(Window):
15afbcd0
RD
10986 """
10987 This is the base class for a control or 'widget'.
10988
41e2b43e
RD
10989 A control is generally a small window which processes user input
10990 and/or displays one or more item of data.
15afbcd0 10991 """
e811c8ce
RD
10992 def __repr__(self):
10993 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10994 def __init__(self, *args, **kwargs):
0df68c9f 10995 """
248ed943
RD
10996 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10997 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10998 String name=ControlNameStr) -> Control
15afbcd0 10999
41e2b43e
RD
11000 Create a Control. Normally you should only call this from a subclass'
11001 __init__ as a plain old wx.Control is not very useful.
0df68c9f 11002 """
54f9ee45 11003 newobj = _core_.new_Control(*args, **kwargs)
d14a1e28
RD
11004 self.this = newobj.this
11005 self.thisown = 1
11006 del newobj.thisown
11007 self._setOORInfo(self)
e811c8ce
RD
11008
11009 def Create(*args, **kwargs):
0df68c9f 11010 """
248ed943
RD
11011 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11012 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 11013 String name=ControlNameStr) -> bool
15afbcd0
RD
11014
11015 Do the 2nd phase and create the GUI control.
0df68c9f 11016 """
54f9ee45 11017 return _core_.Control_Create(*args, **kwargs)
e811c8ce
RD
11018
11019 def Command(*args, **kwargs):
15afbcd0 11020 """
a95a7133 11021 Command(self, CommandEvent event)
15afbcd0 11022
41e2b43e
RD
11023 Simulates the effect of the user issuing a command to the item.
11024
11025 :see: `wx.CommandEvent`
11026
15afbcd0 11027 """
54f9ee45 11028 return _core_.Control_Command(*args, **kwargs)
e811c8ce
RD
11029
11030 def GetLabel(*args, **kwargs):
15afbcd0 11031 """
a95a7133 11032 GetLabel(self) -> String
15afbcd0
RD
11033
11034 Return a control's text.
11035 """
54f9ee45 11036 return _core_.Control_GetLabel(*args, **kwargs)
e811c8ce
RD
11037
11038 def SetLabel(*args, **kwargs):
15afbcd0 11039 """
a95a7133 11040 SetLabel(self, String label)
15afbcd0
RD
11041
11042 Sets the item's text.
11043 """
54f9ee45 11044 return _core_.Control_SetLabel(*args, **kwargs)
e811c8ce 11045
74a57fcd 11046 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
11047 """
11048 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11049
11050 Get the default attributes for this class. This is useful if you want
11051 to use the same font or colour in your own control as in a standard
11052 control -- which is a much better idea than hard coding specific
11053 colours or fonts which might look completely out of place on the
11054 user's system, especially if it uses themes.
11055
11056 The variant parameter is only relevant under Mac currently and is
11057 ignore under other platforms. Under Mac, it will change the size of
11058 the returned font. See `wx.Window.SetWindowVariant` for more about
11059 this.
11060 """
54f9ee45 11061 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
11062
11063 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
d14a1e28
RD
11064
11065class ControlPtr(Control):
11066 def __init__(self, this):
11067 self.this = this
11068 if not hasattr(self,"thisown"): self.thisown = 0
11069 self.__class__ = Control
54f9ee45 11070_core_.Control_swigregister(ControlPtr)
b2dc1044 11071ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
11072
11073def PreControl(*args, **kwargs):
15afbcd0
RD
11074 """
11075 PreControl() -> Control
11076
11077 Precreate a Control control for 2-phase creation
11078 """
54f9ee45 11079 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
11080 val.thisown = 1
11081 return val
11082
74a57fcd 11083def Control_GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
11084 """
11085 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11086
11087 Get the default attributes for this class. This is useful if you want
11088 to use the same font or colour in your own control as in a standard
11089 control -- which is a much better idea than hard coding specific
11090 colours or fonts which might look completely out of place on the
11091 user's system, especially if it uses themes.
11092
11093 The variant parameter is only relevant under Mac currently and is
11094 ignore under other platforms. Under Mac, it will change the size of
11095 the returned font. See `wx.Window.SetWindowVariant` for more about
11096 this.
11097 """
54f9ee45 11098 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 11099
d14a1e28
RD
11100#---------------------------------------------------------------------------
11101
11102class ItemContainer(object):
15afbcd0 11103 """
53aa7709
RD
11104 The wx.ItemContainer class defines an interface which is implemented
11105 by all controls which have string subitems, each of which may be
11106 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11107 as `wx.ComboBox` which implements an extended interface deriving from
41e2b43e 11108 this one.
15afbcd0 11109
41e2b43e
RD
11110 It defines the methods for accessing the control's items and although
11111 each of the derived classes implements them differently, they still
11112 all conform to the same interface.
15afbcd0 11113
41e2b43e
RD
11114 The items in a wx.ItemContainer have (non empty) string labels and,
11115 optionally, client data associated with them.
15afbcd0
RD
11116
11117 """
d14a1e28
RD
11118 def __init__(self): raise RuntimeError, "No constructor defined"
11119 def __repr__(self):
11120 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 11121 def Append(*args, **kwargs):
15afbcd0 11122 """
a95a7133 11123 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 11124
41e2b43e
RD
11125 Adds the item to the control, associating the given data with the item
11126 if not None. The return value is the index of the newly added item
11127 which may be different from the last one if the control is sorted (e.g.
11128 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 11129 """
54f9ee45 11130 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
11131
11132 def AppendItems(*args, **kwargs):
15afbcd0 11133 """
f5b96ee1 11134 AppendItems(self, List strings)
15afbcd0 11135
41e2b43e
RD
11136 Apend several items at once to the control. Notice that calling this
11137 method may be much faster than appending the items one by one if you
11138 need to add a lot of items.
15afbcd0 11139 """
54f9ee45 11140 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
11141
11142 def Insert(*args, **kwargs):
15afbcd0 11143 """
a95a7133 11144 Insert(self, String item, int pos, PyObject clientData=None) -> int
15afbcd0 11145
41e2b43e 11146 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
11147 optionally associating some data object with the item.
11148 """
54f9ee45 11149 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
11150
11151 def Clear(*args, **kwargs):
15afbcd0 11152 """
a95a7133 11153 Clear(self)
15afbcd0
RD
11154
11155 Removes all items from the control.
11156 """
54f9ee45 11157 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
11158
11159 def Delete(*args, **kwargs):
15afbcd0 11160 """
a95a7133 11161 Delete(self, int n)
15afbcd0 11162
41e2b43e
RD
11163 Deletes the item at the zero-based index 'n' from the control. Note
11164 that it is an error (signalled by a `wx.PyAssertionError` exception if
11165 enabled) to remove an item with the index negative or greater or equal
11166 than the number of items in the control.
15afbcd0 11167 """
54f9ee45 11168 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce 11169
53aa7709
RD
11170 def GetClientData(*args, **kwargs):
11171 """
11172 GetClientData(self, int n) -> PyObject
11173
11174 Returns the client data associated with the given item, (if any.)
11175 """
11176 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11177
11178 def SetClientData(*args, **kwargs):
11179 """
11180 SetClientData(self, int n, PyObject clientData)
11181
11182 Associate the given client data with the item at position n.
11183 """
11184 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11185
e811c8ce 11186 def GetCount(*args, **kwargs):
15afbcd0 11187 """
a95a7133 11188 GetCount(self) -> int
15afbcd0
RD
11189
11190 Returns the number of items in the control.
11191 """
54f9ee45 11192 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
11193
11194 def IsEmpty(*args, **kwargs):
15afbcd0 11195 """
a95a7133 11196 IsEmpty(self) -> bool
15afbcd0
RD
11197
11198 Returns True if the control is empty or False if it has some items.
11199 """
54f9ee45 11200 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
11201
11202 def GetString(*args, **kwargs):
15afbcd0 11203 """
a95a7133 11204 GetString(self, int n) -> String
15afbcd0
RD
11205
11206 Returns the label of the item with the given index.
11207 """
54f9ee45 11208 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
11209
11210 def GetStrings(*args, **kwargs):
a95a7133 11211 """GetStrings(self) -> wxArrayString"""
54f9ee45 11212 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
11213
11214 def SetString(*args, **kwargs):
15afbcd0 11215 """
a95a7133 11216 SetString(self, int n, String s)
15afbcd0
RD
11217
11218 Sets the label for the given item.
11219 """
54f9ee45 11220 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
11221
11222 def FindString(*args, **kwargs):
15afbcd0 11223 """
a95a7133 11224 FindString(self, String s) -> int
15afbcd0
RD
11225
11226 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
11227 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11228 found.
15afbcd0 11229 """
54f9ee45 11230 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce 11231
53aa7709 11232 def SetSelection(*args, **kwargs):
15afbcd0 11233 """
53aa7709 11234 SetSelection(self, int n)
15afbcd0
RD
11235
11236 Sets the item at index 'n' to be the selected item.
11237 """
53aa7709 11238 return _core_.ItemContainer_SetSelection(*args, **kwargs)
e811c8ce
RD
11239
11240 def GetSelection(*args, **kwargs):
15afbcd0 11241 """
a95a7133 11242 GetSelection(self) -> int
15afbcd0 11243
41e2b43e
RD
11244 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11245 is selected.
15afbcd0 11246 """
54f9ee45 11247 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce 11248
53aa7709
RD
11249 def SetStringSelection(*args, **kwargs):
11250 """SetStringSelection(self, String s) -> bool"""
11251 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11252
e811c8ce 11253 def GetStringSelection(*args, **kwargs):
15afbcd0 11254 """
a95a7133 11255 GetStringSelection(self) -> String
15afbcd0 11256
41e2b43e
RD
11257 Returns the label of the selected item or an empty string if no item
11258 is selected.
15afbcd0 11259 """
54f9ee45 11260 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce 11261
53aa7709 11262 def Select(*args, **kwargs):
15afbcd0 11263 """
53aa7709 11264 Select(self, int n)
15afbcd0 11265
53aa7709
RD
11266 This is the same as `SetSelection` and exists only because it is
11267 slightly more natural for controls which support multiple selection.
15afbcd0 11268 """
53aa7709 11269 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 11270
d14a1e28
RD
11271
11272class ItemContainerPtr(ItemContainer):
11273 def __init__(self, this):
11274 self.this = this
11275 if not hasattr(self,"thisown"): self.thisown = 0
11276 self.__class__ = ItemContainer
54f9ee45 11277_core_.ItemContainer_swigregister(ItemContainerPtr)
d14a1e28
RD
11278
11279#---------------------------------------------------------------------------
11280
11281class ControlWithItems(Control,ItemContainer):
15afbcd0 11282 """
41e2b43e
RD
11283 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11284 wx.Control class, and is used for the base class of various controls
11285 that have items.
15afbcd0 11286 """
d14a1e28
RD
11287 def __init__(self): raise RuntimeError, "No constructor defined"
11288 def __repr__(self):
11289 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11290
11291class ControlWithItemsPtr(ControlWithItems):
11292 def __init__(self, this):
11293 self.this = this
11294 if not hasattr(self,"thisown"): self.thisown = 0
11295 self.__class__ = ControlWithItems
54f9ee45 11296_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
d14a1e28
RD
11297
11298#---------------------------------------------------------------------------
11299
11300class SizerItem(Object):
248ed943
RD
11301 """
11302 The wx.SizerItem class is used to track the position, size and other
11303 attributes of each item managed by a `wx.Sizer`. In normal usage user
11304 code should never need to deal directly with a wx.SizerItem, but
11305 custom classes derived from `wx.PySizer` will probably need to use the
11306 collection of wx.SizerItems held by wx.Sizer when calculating layout.
11307
11308 :see: `wx.Sizer`, `wx.GBSizerItem`
11309 """
e811c8ce
RD
11310 def __repr__(self):
11311 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 11312 def __init__(self, *args, **kwargs):
248ed943
RD
11313 """
11314 __init__(self) -> SizerItem
11315
11316 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11317 size will need to be set before this item can be used in a Sizer.
11318
11319 You will probably never need to create a wx.SizerItem directly as they
11320 are created automatically when the sizer's Add, Insert or Prepend
11321 methods are called.
11322
11323 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11324 """
54f9ee45 11325 newobj = _core_.new_SizerItem(*args, **kwargs)
d14a1e28
RD
11326 self.this = newobj.this
11327 self.thisown = 1
11328 del newobj.thisown
e811c8ce 11329 def DeleteWindows(*args, **kwargs):
248ed943
RD
11330 """
11331 DeleteWindows(self)
11332
11333 Destroy the window or the windows in a subsizer, depending on the type
11334 of item.
11335 """
54f9ee45 11336 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
11337
11338 def DetachSizer(*args, **kwargs):
248ed943
RD
11339 """
11340 DetachSizer(self)
11341
11342 Enable deleting the SizerItem without destroying the contained sizer.
11343 """
54f9ee45 11344 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
11345
11346 def GetSize(*args, **kwargs):
248ed943
RD
11347 """
11348 GetSize(self) -> Size
11349
11350 Get the current size of the item, as set in the last Layout.
11351 """
54f9ee45 11352 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
11353
11354 def CalcMin(*args, **kwargs):
248ed943
RD
11355 """
11356 CalcMin(self) -> Size
11357
11358 Calculates the minimum desired size for the item, including any space
11359 needed by borders.
11360 """
54f9ee45 11361 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
11362
11363 def SetDimension(*args, **kwargs):
248ed943
RD
11364 """
11365 SetDimension(self, Point pos, Size size)
11366
11367 Set the position and size of the space allocated for this item by the
11368 sizer, and adjust the position and size of the item (window or
11369 subsizer) to be within that space taking alignment and borders into
11370 account.
11371 """
54f9ee45 11372 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
11373
11374 def GetMinSize(*args, **kwargs):
248ed943
RD
11375 """
11376 GetMinSize(self) -> Size
11377
11378 Get the minimum size needed for the item.
11379 """
54f9ee45 11380 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 11381
dfbb5885
RD
11382 def GetMinSizeWithBorder(*args, **kwargs):
11383 """
11384 GetMinSizeWithBorder(self) -> Size
11385
11386 Get the minimum size needed for the item with space for the borders
11387 added, if needed.
11388 """
11389 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11390
e811c8ce 11391 def SetInitSize(*args, **kwargs):
a95a7133 11392 """SetInitSize(self, int x, int y)"""
54f9ee45 11393 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
11394
11395 def SetRatioWH(*args, **kwargs):
248ed943
RD
11396 """
11397 SetRatioWH(self, int width, int height)
11398
11399 Set the ratio item attribute.
11400 """
54f9ee45 11401 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
11402
11403 def SetRatioSize(*args, **kwargs):
248ed943
RD
11404 """
11405 SetRatioSize(self, Size size)
11406
11407 Set the ratio item attribute.
11408 """
54f9ee45 11409 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
11410
11411 def SetRatio(*args, **kwargs):
248ed943
RD
11412 """
11413 SetRatio(self, float ratio)
11414
11415 Set the ratio item attribute.
11416 """
54f9ee45 11417 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
11418
11419 def GetRatio(*args, **kwargs):
248ed943
RD
11420 """
11421 GetRatio(self) -> float
11422
11423 Set the ratio item attribute.
11424 """
54f9ee45 11425 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 11426
d3b6e4ff
RD
11427 def GetRect(*args, **kwargs):
11428 """
11429 GetRect(self) -> Rect
11430
11431 Returns the rectangle that the sizer item should occupy
11432 """
11433 return _core_.SizerItem_GetRect(*args, **kwargs)
11434
e811c8ce 11435 def IsWindow(*args, **kwargs):
248ed943
RD
11436 """
11437 IsWindow(self) -> bool
11438
11439 Is this sizer item a window?
11440 """
54f9ee45 11441 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
11442
11443 def IsSizer(*args, **kwargs):
248ed943
RD
11444 """
11445 IsSizer(self) -> bool
11446
11447 Is this sizer item a subsizer?
11448 """
54f9ee45 11449 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
11450
11451 def IsSpacer(*args, **kwargs):
248ed943
RD
11452 """
11453 IsSpacer(self) -> bool
11454
11455 Is this sizer item a spacer?
11456 """
54f9ee45 11457 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
11458
11459 def SetProportion(*args, **kwargs):
248ed943
RD
11460 """
11461 SetProportion(self, int proportion)
11462
11463 Set the proportion value for this item.
11464 """
54f9ee45 11465 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
11466
11467 def GetProportion(*args, **kwargs):
248ed943
RD
11468 """
11469 GetProportion(self) -> int
11470
11471 Get the proportion value for this item.
11472 """
54f9ee45 11473 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 11474
248ed943
RD
11475 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11476 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 11477 def SetFlag(*args, **kwargs):
248ed943
RD
11478 """
11479 SetFlag(self, int flag)
11480
11481 Set the flag value for this item.
11482 """
54f9ee45 11483 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
11484
11485 def GetFlag(*args, **kwargs):
248ed943
RD
11486 """
11487 GetFlag(self) -> int
11488
11489 Get the flag value for this item.
11490 """
54f9ee45 11491 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
11492
11493 def SetBorder(*args, **kwargs):
248ed943
RD
11494 """
11495 SetBorder(self, int border)
11496
11497 Set the border value for this item.
11498 """
54f9ee45 11499 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
11500
11501 def GetBorder(*args, **kwargs):
248ed943
RD
11502 """
11503 GetBorder(self) -> int
11504
11505 Get the border value for this item.
11506 """
54f9ee45 11507 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
11508
11509 def GetWindow(*args, **kwargs):
248ed943
RD
11510 """
11511 GetWindow(self) -> Window
11512
11513 Get the window (if any) that is managed by this sizer item.
11514 """
54f9ee45 11515 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce
RD
11516
11517 def SetWindow(*args, **kwargs):
248ed943
RD
11518 """
11519 SetWindow(self, Window window)
11520
11521 Set the window to be managed by this sizer item.
11522 """
54f9ee45 11523 return _core_.SizerItem_SetWindow(*args, **kwargs)
e811c8ce
RD
11524
11525 def GetSizer(*args, **kwargs):
248ed943
RD
11526 """
11527 GetSizer(self) -> Sizer
11528
11529 Get the subsizer (if any) that is managed by this sizer item.
11530 """
54f9ee45 11531 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce
RD
11532
11533 def SetSizer(*args, **kwargs):
248ed943
RD
11534 """
11535 SetSizer(self, Sizer sizer)
11536
11537 Set the subsizer to be managed by this sizer item.
11538 """
54f9ee45 11539 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce
RD
11540
11541 def GetSpacer(*args, **kwargs):
248ed943
RD
11542 """
11543 GetSpacer(self) -> Size
11544
11545 Get the size of the spacer managed by this sizer item.
11546 """
54f9ee45 11547 return _core_.SizerItem_GetSpacer(*args, **kwargs)
e811c8ce
RD
11548
11549 def SetSpacer(*args, **kwargs):
248ed943
RD
11550 """
11551 SetSpacer(self, Size size)
11552
11553 Set the size of the spacer to be managed by this sizer item.
11554 """
54f9ee45 11555 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce
RD
11556
11557 def Show(*args, **kwargs):
248ed943
RD
11558 """
11559 Show(self, bool show)
11560
11561 Set the show item attribute, which sizers use to determine if the item
11562 is to be made part of the layout or not. If the item is tracking a
11563 window then it is shown or hidden as needed.
11564 """
54f9ee45 11565 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
11566
11567 def IsShown(*args, **kwargs):
248ed943
RD
11568 """
11569 IsShown(self) -> bool
11570
11571 Is the item to be shown in the layout?
11572 """
54f9ee45 11573 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
11574
11575 def GetPosition(*args, **kwargs):
248ed943
RD
11576 """
11577 GetPosition(self) -> Point
11578
11579 Returns the current position of the item, as set in the last Layout.
11580 """
54f9ee45 11581 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
11582
11583 def GetUserData(*args, **kwargs):
248ed943
RD
11584 """
11585 GetUserData(self) -> PyObject
11586
11587 Returns the userData associated with this sizer item, or None if there
11588 isn't any.
11589 """
54f9ee45 11590 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 11591
091f5bed
RD
11592 def SetUserData(*args, **kwargs):
11593 """
11594 SetUserData(self, PyObject userData)
11595
11596 Associate a Python object with this sizer item.
11597 """
11598 return _core_.SizerItem_SetUserData(*args, **kwargs)
11599
d14a1e28
RD
11600
11601class SizerItemPtr(SizerItem):
11602 def __init__(self, this):
11603 self.this = this
11604 if not hasattr(self,"thisown"): self.thisown = 0
11605 self.__class__ = SizerItem
54f9ee45 11606_core_.SizerItem_swigregister(SizerItemPtr)
d14a1e28 11607
248ed943 11608def SizerItemWindow(*args, **kwargs):
0df68c9f 11609 """
248ed943
RD
11610 SizerItemWindow(Window window, int proportion, int flag, int border,
11611 PyObject userData=None) -> SizerItem
11612
11613 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 11614 """
248ed943 11615 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
11616 val.thisown = 1
11617 return val
11618
248ed943 11619def SizerItemSpacer(*args, **kwargs):
0df68c9f 11620 """
248ed943
RD
11621 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11622 PyObject userData=None) -> SizerItem
11623
11624 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 11625 """
248ed943 11626 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
11627 val.thisown = 1
11628 return val
11629
11630def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
11631 """
11632 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
11633 PyObject userData=None) -> SizerItem
11634
11635 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 11636 """
54f9ee45 11637 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
11638 val.thisown = 1
11639 return val
11640
11641class Sizer(Object):
248ed943
RD
11642 """
11643 wx.Sizer is the abstract base class used for laying out subwindows in
11644 a window. You cannot use wx.Sizer directly; instead, you will have to
11645 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11646 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11647 and `wx.GridBagSizer`.
11648
11649 The concept implemented by sizers in wxWidgets is closely related to
11650 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11651 toolkit or the Qt toolkit. It is based upon the idea of the individual
11652 subwindows reporting their minimal required size and their ability to
11653 get stretched if the size of the parent window has changed. This will
11654 most often mean that the programmer does not set the original size of
11655 a dialog in the beginning, rather the dialog will assigned a sizer and
11656 this sizer will be queried about the recommended size. The sizer in
11657 turn will query its children, which can be normal windows or contorls,
11658 empty space or other sizers, so that a hierarchy of sizers can be
11659 constructed. Note that wxSizer does not derive from wxWindow and thus
11660 do not interfere with tab ordering and requires very little resources
11661 compared to a real window on screen.
11662
11663 What makes sizers so well fitted for use in wxWidgets is the fact that
11664 every control reports its own minimal size and the algorithm can
11665 handle differences in font sizes or different window (dialog item)
11666 sizes on different platforms without problems. If for example the
11667 standard font as well as the overall design of Mac widgets requires
11668 more space than on Windows, then the initial size of a dialog using a
11669 sizer will automatically be bigger on Mac than on Windows.
11670 """
e811c8ce
RD
11671 def __init__(self): raise RuntimeError, "No constructor defined"
11672 def __repr__(self):
11673 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11674 def _setOORInfo(*args, **kwargs):
a95a7133 11675 """_setOORInfo(self, PyObject _self)"""
54f9ee45 11676 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
11677
11678 def Add(*args, **kwargs):
0df68c9f 11679 """
248ed943 11680 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11681 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11682
11683 Appends a child item to the sizer.
0df68c9f 11684 """
54f9ee45 11685 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce
RD
11686
11687 def Insert(*args, **kwargs):
0df68c9f 11688 """
248ed943 11689 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11690 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11691
11692 Inserts a new item into the list of items managed by this sizer before
11693 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 11694 """
54f9ee45 11695 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce
RD
11696
11697 def Prepend(*args, **kwargs):
0df68c9f 11698 """
248ed943 11699 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11700 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11701
11702 Adds a new item to the begining of the list of sizer items managed by
11703 this sizer. See `Add` for a description of the parameters.
0df68c9f 11704 """
54f9ee45 11705 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce
RD
11706
11707 def Remove(*args, **kwargs):
248ed943
RD
11708 """
11709 Remove(self, item) -> bool
11710
11711 Removes an item from the sizer and destroys it. This method does not
11712 cause any layout or resizing to take place, call `Layout` to update
11713 the layout on screen after removing a child from the sizer. The
11714 *item* parameter can be either a window, a sizer, or the zero-based
11715 index of an item to remove. Returns True if the child item was found
11716 and removed.
11717 """
54f9ee45 11718 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 11719
1c0f361b 11720 def Detach(*args, **kwargs):
248ed943
RD
11721 """
11722 Detach(self, item) -> bool
11723
11724 Detaches an item from the sizer without destroying it. This method
11725 does not cause any layout or resizing to take place, call `Layout` to
11726 do so. The *item* parameter can be either a window, a sizer, or the
11727 zero-based index of the item to be detached. Returns True if the child item
11728 was found and detached.
11729 """
1c0f361b
RD
11730 return _core_.Sizer_Detach(*args, **kwargs)
11731
d3b6e4ff
RD
11732 def GetItem(*args, **kwargs):
11733 """
11734 GetItem(self, item) -> wx.SizerItem
11735
11736 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11737 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11738 the item to be found.
d3b6e4ff
RD
11739 """
11740 return _core_.Sizer_GetItem(*args, **kwargs)
11741
e811c8ce 11742 def _SetItemMinSize(*args, **kwargs):
a95a7133 11743 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 11744 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 11745
248ed943
RD
11746 def SetItemMinSize(self, item, *args):
11747 """
11748 SetItemMinSize(self, item, Size size)
11749
11750 Sets the minimum size that will be allocated for an item in the sizer.
11751 The *item* parameter can be either a window, a sizer, or the
11752 zero-based index of the item. If a window or sizer is given then it
11753 will be searched for recursivly in subsizers if neccessary.
11754 """
11755 if len(args) == 2:
11756 # for backward compatibility accept separate width,height args too
11757 return self._SetItemMinSize(item, args)
11758 else:
11759 return self._SetItemMinSize(item, args[0])
11760
e811c8ce 11761 def AddItem(*args, **kwargs):
248ed943
RD
11762 """
11763 AddItem(self, SizerItem item)
11764
11765 Adds a `wx.SizerItem` to the sizer.
11766 """
54f9ee45 11767 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
11768
11769 def InsertItem(*args, **kwargs):
248ed943
RD
11770 """
11771 InsertItem(self, int index, SizerItem item)
11772
11773 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11774 """
54f9ee45 11775 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
11776
11777 def PrependItem(*args, **kwargs):
248ed943
RD
11778 """
11779 PrependItem(self, SizerItem item)
11780
11781 Prepends a `wx.SizerItem` to the sizer.
11782 """
54f9ee45 11783 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 11784
248ed943 11785 def AddMany(self, items):
66c033b4
RD
11786 """
11787 AddMany is a convenience method for adding several items
11788 to a sizer at one time. Simply pass it a list of tuples,
11789 where each tuple consists of the parameters that you
11790 would normally pass to the `Add` method.
11791 """
248ed943
RD
11792 for item in items:
11793 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11794 item = (item, )
11795 self.Add(*item)
d14a1e28 11796
74e96f3d 11797 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11798 def AddWindow(self, *args, **kw):
11799 """Compatibility alias for `Add`."""
11800 return self.Add(*args, **kw)
11801 def AddSizer(self, *args, **kw):
11802 """Compatibility alias for `Add`."""
11803 return self.Add(*args, **kw)
11804 def AddSpacer(self, *args, **kw):
11805 """Compatibility alias for `Add`."""
11806 return self.Add(*args, **kw)
11807
11808 def PrependWindow(self, *args, **kw):
11809 """Compatibility alias for `Prepend`."""
11810 return self.Prepend(*args, **kw)
11811 def PrependSizer(self, *args, **kw):
11812 """Compatibility alias for `Prepend`."""
11813 return self.Prepend(*args, **kw)
11814 def PrependSpacer(self, *args, **kw):
11815 """Compatibility alias for `Prepend`."""
11816 return self.Prepend(*args, **kw)
11817
11818 def InsertWindow(self, *args, **kw):
11819 """Compatibility alias for `Insert`."""
11820 return self.Insert(*args, **kw)
11821 def InsertSizer(self, *args, **kw):
11822 """Compatibility alias for `Insert`."""
11823 return self.Insert(*args, **kw)
11824 def InsertSpacer(self, *args, **kw):
11825 """Compatibility alias for `Insert`."""
11826 return self.Insert(*args, **kw)
11827
11828 def RemoveWindow(self, *args, **kw):
11829 """Compatibility alias for `Remove`."""
11830 return self.Remove(*args, **kw)
11831 def RemoveSizer(self, *args, **kw):
11832 """Compatibility alias for `Remove`."""
11833 return self.Remove(*args, **kw)
11834 def RemovePos(self, *args, **kw):
11835 """Compatibility alias for `Remove`."""
11836 return self.Remove(*args, **kw)
d14a1e28
RD
11837
11838
e811c8ce 11839 def SetDimension(*args, **kwargs):
248ed943
RD
11840 """
11841 SetDimension(self, int x, int y, int width, int height)
11842
11843 Call this to force the sizer to take the given dimension and thus
11844 force the items owned by the sizer to resize themselves according to
11845 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11846 methods.
11847 """
54f9ee45 11848 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
11849
11850 def SetMinSize(*args, **kwargs):
248ed943
RD
11851 """
11852 SetMinSize(self, Size size)
11853
11854 Call this to give the sizer a minimal size. Normally, the sizer will
11855 calculate its minimal size based purely on how much space its children
11856 need. After calling this method `GetMinSize` will return either the
11857 minimal size as requested by its children or the minimal size set
11858 here, depending on which is bigger.
11859 """
54f9ee45 11860 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
11861
11862 def GetSize(*args, **kwargs):
248ed943
RD
11863 """
11864 GetSize(self) -> Size
11865
11866 Returns the current size of the space managed by the sizer.
11867 """
54f9ee45 11868 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
11869
11870 def GetPosition(*args, **kwargs):
248ed943
RD
11871 """
11872 GetPosition(self) -> Point
11873
11874 Returns the current position of the sizer's managed space.
11875 """
54f9ee45 11876 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
11877
11878 def GetMinSize(*args, **kwargs):
248ed943
RD
11879 """
11880 GetMinSize(self) -> Size
11881
11882 Returns the minimal size of the sizer. This is either the combined
11883 minimal size of all the children and their borders or the minimal size
11884 set by SetMinSize, depending on which is bigger.
11885 """
54f9ee45 11886 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 11887
d14a1e28 11888 def GetSizeTuple(self):
1c0f361b 11889 return self.GetSize().Get()
d14a1e28 11890 def GetPositionTuple(self):
1c0f361b 11891 return self.GetPosition().Get()
d14a1e28 11892 def GetMinSizeTuple(self):
1c0f361b 11893 return self.GetMinSize().Get()
d14a1e28 11894
e811c8ce 11895 def RecalcSizes(*args, **kwargs):
248ed943
RD
11896 """
11897 RecalcSizes(self)
11898
11899 Using the sizes calculated by `CalcMin` reposition and resize all the
11900 items managed by this sizer. You should not need to call this directly as
11901 it is called by `Layout`.
11902 """
54f9ee45 11903 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
11904
11905 def CalcMin(*args, **kwargs):
248ed943
RD
11906 """
11907 CalcMin(self) -> Size
11908
11909 This method is where the sizer will do the actual calculation of its
11910 children's minimal sizes. You should not need to call this directly as
11911 it is called by `Layout`.
11912 """
54f9ee45 11913 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
11914
11915 def Layout(*args, **kwargs):
248ed943
RD
11916 """
11917 Layout(self)
11918
11919 This method will force the recalculation and layout of the items
11920 controlled by the sizer using the current space allocated to the
11921 sizer. Normally this is called automatically from the owning window's
11922 EVT_SIZE handler, but it is also useful to call it from user code when
11923 one of the items in a sizer change size, or items are added or
11924 removed.
11925 """
54f9ee45 11926 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
11927
11928 def Fit(*args, **kwargs):
248ed943
RD
11929 """
11930 Fit(self, Window window) -> Size
11931
11932 Tell the sizer to resize the *window* to match the sizer's minimal
11933 size. This is commonly done in the constructor of the window itself in
11934 order to set its initial size to match the needs of the children as
11935 determined by the sizer. Returns the new size.
11936
11937 For a top level window this is the total window size, not the client size.
11938 """
54f9ee45 11939 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
11940
11941 def FitInside(*args, **kwargs):
248ed943
RD
11942 """
11943 FitInside(self, Window window)
11944
11945 Tell the sizer to resize the *virtual size* of the *window* to match the
11946 sizer's minimal size. This will not alter the on screen size of the
11947 window, but may cause the addition/removal/alteration of scrollbars
11948 required to view the virtual area in windows which manage it.
11949
11950 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11951
11952 """
54f9ee45 11953 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
11954
11955 def SetSizeHints(*args, **kwargs):
248ed943
RD
11956 """
11957 SetSizeHints(self, Window window)
11958
11959 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11960 match the sizer's minimal size. This is commonly done in the
11961 constructor of the window itself if the window is resizable (as are
11962 many dialogs under Unix and frames on probably all platforms) in order
11963 to prevent the window from being sized smaller than the minimal size
11964 required by the sizer.
11965 """
54f9ee45 11966 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
11967
11968 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
11969 """
11970 SetVirtualSizeHints(self, Window window)
11971
11972 Tell the sizer to set the minimal size of the window virtual area to
11973 match the sizer's minimal size. For windows with managed scrollbars
11974 this will set them appropriately.
11975
11976 :see: `wx.ScrolledWindow.SetScrollbars`
11977
11978 """
54f9ee45 11979 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
11980
11981 def Clear(*args, **kwargs):
248ed943
RD
11982 """
11983 Clear(self, bool deleteWindows=False)
11984
11985 Clear all items from the sizer, optionally destroying the window items
11986 as well.
11987 """
54f9ee45 11988 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
11989
11990 def DeleteWindows(*args, **kwargs):
248ed943
RD
11991 """
11992 DeleteWindows(self)
11993
11994 Destroy all windows managed by the sizer.
11995 """
54f9ee45 11996 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
11997
11998 def GetChildren(*args, **kwargs):
248ed943 11999 """
51b83b37 12000 GetChildren(self) -> list
248ed943
RD
12001
12002 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12003 """
54f9ee45 12004 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
12005
12006 def Show(*args, **kwargs):
248ed943 12007 """
ae8162c8 12008 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 12009
248ed943
RD
12010 Shows or hides an item managed by the sizer. To make a sizer item
12011 disappear or reappear, use Show followed by `Layout`. The *item*
12012 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
12013 the item. Use the recursive parameter to show or hide an item in a
12014 subsizer. Returns True if the item was found.
248ed943
RD
12015 """
12016 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
12017
12018 def IsShown(*args, **kwargs):
248ed943
RD
12019 """
12020 IsShown(self, item)
12021
12022 Determines if the item is currently shown. sizer. To make a sizer
12023 item disappear or reappear, use Show followed by `Layout`. The *item*
12024 parameter can be either a window, a sizer, or the zero-based index of
12025 the item.
12026 """
54f9ee45 12027 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 12028
7e63a440 12029 def Hide(self, item, recursive=False):
248ed943 12030 """
27fb7603 12031 A convenience method for `Show` (item, False, recursive).
248ed943 12032 """
06759a38 12033 return self.Show(item, False, recursive)
248ed943 12034
e811c8ce 12035 def ShowItems(*args, **kwargs):
248ed943
RD
12036 """
12037 ShowItems(self, bool show)
12038
84f85550 12039 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 12040 """
54f9ee45 12041 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 12042
d14a1e28
RD
12043
12044class SizerPtr(Sizer):
12045 def __init__(self, this):
12046 self.this = this
12047 if not hasattr(self,"thisown"): self.thisown = 0
12048 self.__class__ = Sizer
54f9ee45 12049_core_.Sizer_swigregister(SizerPtr)
d14a1e28
RD
12050
12051class PySizer(Sizer):
248ed943
RD
12052 """
12053 wx.PySizer is a special version of `wx.Sizer` that has been
12054 instrumented to allow the C++ virtual methods to be overloaded in
12055 Python derived classes. You would derive from this class if you are
12056 wanting to implement a custom sizer in Python code. Simply implement
12057 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12058 For example::
12059
12060 class MySizer(wx.PySizer):
12061 def __init__(self):
12062 wx.PySizer.__init__(self)
12063
12064 def CalcMin(self):
12065 for item in self.GetChildren():
12066 # calculate the total minimum width and height needed
12067 # by all items in the sizer according to this sizer's
12068 # layout algorithm.
12069 ...
12070 return wx.Size(width, height)
12071
12072 def RecalcSizes(self):
12073 # find the space allotted to this sizer
12074 pos = self.GetPosition()
12075 size = self.GetSize()
12076 for item in self.GetChildren():
12077 # Recalculate (if necessary) the position and size of
12078 # each item and then call item.SetDimension to do the
12079 # actual positioning and sizing of the items within the
12080 # space alloted to this sizer.
12081 ...
12082 item.SetDimension(itemPos, itemSize)
12083
12084
12085 When `Layout` is called it first calls `CalcMin` followed by
12086 `RecalcSizes` so you can optimize a bit by saving the results of
e505d15e 12087 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
12088
12089 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12090
12091
12092 """
e811c8ce
RD
12093 def __repr__(self):
12094 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12095 def __init__(self, *args, **kwargs):
248ed943
RD
12096 """
12097 __init__(self) -> PySizer
12098
12099 Creates a wx.PySizer. Must be called from the __init__ in the derived
12100 class.
12101 """
54f9ee45 12102 newobj = _core_.new_PySizer(*args, **kwargs)
d14a1e28
RD
12103 self.this = newobj.this
12104 self.thisown = 1
12105 del newobj.thisown
12106 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
e811c8ce
RD
12107
12108 def _setCallbackInfo(*args, **kwargs):
a95a7133 12109 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 12110 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 12111
d14a1e28
RD
12112
12113class PySizerPtr(PySizer):
12114 def __init__(self, this):
12115 self.this = this
12116 if not hasattr(self,"thisown"): self.thisown = 0
12117 self.__class__ = PySizer
54f9ee45 12118_core_.PySizer_swigregister(PySizerPtr)
d14a1e28
RD
12119
12120#---------------------------------------------------------------------------
12121
12122class BoxSizer(Sizer):
248ed943
RD
12123 """
12124 The basic idea behind a box sizer is that windows will most often be
12125 laid out in rather simple basic geometry, typically in a row or a
12126 column or nested hierarchies of either. A wx.BoxSizer will lay out
12127 its items in a simple row or column, depending on the orientation
12128 parameter passed to the constructor.
12129 """
e811c8ce
RD
12130 def __repr__(self):
12131 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12132 def __init__(self, *args, **kwargs):
248ed943
RD
12133 """
12134 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12135
12136 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12137 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12138 sizer.
12139 """
54f9ee45 12140 newobj = _core_.new_BoxSizer(*args, **kwargs)
d14a1e28
RD
12141 self.this = newobj.this
12142 self.thisown = 1
12143 del newobj.thisown
12144 self._setOORInfo(self)
e811c8ce
RD
12145
12146 def GetOrientation(*args, **kwargs):
248ed943
RD
12147 """
12148 GetOrientation(self) -> int
12149
12150 Returns the current orientation of the sizer.
12151 """
54f9ee45 12152 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
12153
12154 def SetOrientation(*args, **kwargs):
248ed943
RD
12155 """
12156 SetOrientation(self, int orient)
e811c8ce 12157
248ed943
RD
12158 Resets the orientation of the sizer.
12159 """
12160 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 12161
d14a1e28
RD
12162
12163class BoxSizerPtr(BoxSizer):
12164 def __init__(self, this):
12165 self.this = this
12166 if not hasattr(self,"thisown"): self.thisown = 0
12167 self.__class__ = BoxSizer
54f9ee45 12168_core_.BoxSizer_swigregister(BoxSizerPtr)
d14a1e28
RD
12169
12170#---------------------------------------------------------------------------
12171
12172class StaticBoxSizer(BoxSizer):
248ed943
RD
12173 """
12174 wx.StaticBoxSizer derives from and functions identically to the
12175 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12176 manages. Note that this static box must be created separately and
12177 passed to the sizer constructor.
12178 """
e811c8ce
RD
12179 def __repr__(self):
12180 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12181 def __init__(self, *args, **kwargs):
248ed943
RD
12182 """
12183 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12184
12185 Constructor. It takes an associated static box and the orientation
12186 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12187 ``wx.HORIZONTAL``.
12188 """
54f9ee45 12189 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
d14a1e28
RD
12190 self.this = newobj.this
12191 self.thisown = 1
12192 del newobj.thisown
12193 self._setOORInfo(self)
e811c8ce
RD
12194
12195 def GetStaticBox(*args, **kwargs):
248ed943
RD
12196 """
12197 GetStaticBox(self) -> StaticBox
e811c8ce 12198
248ed943
RD
12199 Returns the static box associated with this sizer.
12200 """
12201 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 12202
d14a1e28
RD
12203
12204class StaticBoxSizerPtr(StaticBoxSizer):
12205 def __init__(self, this):
12206 self.this = this
12207 if not hasattr(self,"thisown"): self.thisown = 0
12208 self.__class__ = StaticBoxSizer
54f9ee45 12209_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
d14a1e28
RD
12210
12211#---------------------------------------------------------------------------
12212
12213class GridSizer(Sizer):
248ed943
RD
12214 """
12215 A grid sizer is a sizer which lays out its children in a
12216 two-dimensional table with all cells having the same size. In other
12217 words, the width of each cell within the grid is the width of the
12218 widest item added to the sizer and the height of each grid cell is the
12219 height of the tallest item. An optional vertical and/or horizontal
12220 gap between items can also be specified (in pixels.)
12221
12222 Items are placed in the cells of the grid in the order they are added,
12223 in row-major order. In other words, the first row is filled first,
12224 then the second, and so on until all items have been added. (If
12225 neccessary, additional rows will be added as items are added.) If you
12226 need to have greater control over the cells that items are placed in
12227 then use the `wx.GridBagSizer`.
12228
12229 """
e811c8ce
RD
12230 def __repr__(self):
12231 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12232 def __init__(self, *args, **kwargs):
248ed943
RD
12233 """
12234 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12235
12236 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12237 of columns and rows in the sizer - if either of the parameters is
12238 zero, it will be calculated to from the total number of children in
12239 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12240 define extra space between all children.
12241 """
54f9ee45 12242 newobj = _core_.new_GridSizer(*args, **kwargs)
d14a1e28
RD
12243 self.this = newobj.this
12244 self.thisown = 1
12245 del newobj.thisown
12246 self._setOORInfo(self)
e811c8ce 12247
e811c8ce 12248 def SetCols(*args, **kwargs):
248ed943
RD
12249 """
12250 SetCols(self, int cols)
12251
12252 Sets the number of columns in the sizer.
12253 """
54f9ee45 12254 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
12255
12256 def SetRows(*args, **kwargs):
248ed943
RD
12257 """
12258 SetRows(self, int rows)
12259
12260 Sets the number of rows in the sizer.
12261 """
54f9ee45 12262 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
12263
12264 def SetVGap(*args, **kwargs):
248ed943
RD
12265 """
12266 SetVGap(self, int gap)
12267
12268 Sets the vertical gap (in pixels) between the cells in the sizer.
12269 """
54f9ee45 12270 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
12271
12272 def SetHGap(*args, **kwargs):
248ed943
RD
12273 """
12274 SetHGap(self, int gap)
12275
12276 Sets the horizontal gap (in pixels) between cells in the sizer
12277 """
54f9ee45 12278 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
12279
12280 def GetCols(*args, **kwargs):
248ed943
RD
12281 """
12282 GetCols(self) -> int
12283
12284 Returns the number of columns in the sizer.
12285 """
54f9ee45 12286 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
12287
12288 def GetRows(*args, **kwargs):
248ed943
RD
12289 """
12290 GetRows(self) -> int
12291
12292 Returns the number of rows in the sizer.
12293 """
54f9ee45 12294 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
12295
12296 def GetVGap(*args, **kwargs):
248ed943
RD
12297 """
12298 GetVGap(self) -> int
12299
12300 Returns the vertical gap (in pixels) between the cells in the sizer.
12301 """
54f9ee45 12302 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
12303
12304 def GetHGap(*args, **kwargs):
248ed943
RD
12305 """
12306 GetHGap(self) -> int
12307
12308 Returns the horizontal gap (in pixels) between cells in the sizer.
12309 """
54f9ee45 12310 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 12311
d14a1e28
RD
12312
12313class GridSizerPtr(GridSizer):
12314 def __init__(self, this):
12315 self.this = this
12316 if not hasattr(self,"thisown"): self.thisown = 0
12317 self.__class__ = GridSizer
54f9ee45 12318_core_.GridSizer_swigregister(GridSizerPtr)
d14a1e28
RD
12319
12320#---------------------------------------------------------------------------
12321
54f9ee45
RD
12322FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12323FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12324FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 12325class FlexGridSizer(GridSizer):
248ed943
RD
12326 """
12327 A flex grid sizer is a sizer which lays out its children in a
12328 two-dimensional table with all table cells in one row having the same
12329 height and all cells in one column having the same width, but all
12330 rows or all columns are not necessarily the same height or width as in
12331 the `wx.GridSizer`.
12332
12333 wx.FlexGridSizer can also size items equally in one direction but
12334 unequally ("flexibly") in the other. If the sizer is only flexible
12335 in one direction (this can be changed using `SetFlexibleDirection`), it
12336 needs to be decided how the sizer should grow in the other ("non
12337 flexible") direction in order to fill the available space. The
12338 `SetNonFlexibleGrowMode` method serves this purpose.
12339
12340
12341 """
e811c8ce
RD
12342 def __repr__(self):
12343 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12344 def __init__(self, *args, **kwargs):
248ed943
RD
12345 """
12346 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12347
12348 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12349 number of columns and rows in the sizer - if either of the parameters
12350 is zero, it will be calculated to from the total number of children in
12351 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12352 define extra space between all children.
12353 """
54f9ee45 12354 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
d14a1e28
RD
12355 self.this = newobj.this
12356 self.thisown = 1
12357 del newobj.thisown
12358 self._setOORInfo(self)
e811c8ce 12359
248ed943
RD
12360 def AddGrowableRow(*args, **kwargs):
12361 """
12362 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 12363
248ed943
RD
12364 Specifies that row *idx* (starting from zero) should be grown if there
12365 is extra space available to the sizer.
e811c8ce 12366
248ed943
RD
12367 The *proportion* parameter has the same meaning as the stretch factor
12368 for the box sizers except that if all proportions are 0, then all
12369 columns are resized equally (instead of not being resized at all).
12370 """
54f9ee45 12371 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
12372
12373 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
12374 """
12375 RemoveGrowableRow(self, size_t idx)
12376
12377 Specifies that row *idx* is no longer growable.
12378 """
54f9ee45 12379 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
12380
12381 def AddGrowableCol(*args, **kwargs):
248ed943
RD
12382 """
12383 AddGrowableCol(self, size_t idx, int proportion=0)
12384
12385 Specifies that column *idx* (starting from zero) should be grown if
12386 there is extra space available to the sizer.
12387
12388 The *proportion* parameter has the same meaning as the stretch factor
12389 for the box sizers except that if all proportions are 0, then all
12390 columns are resized equally (instead of not being resized at all).
12391 """
54f9ee45 12392 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
12393
12394 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
12395 """
12396 RemoveGrowableCol(self, size_t idx)
12397
12398 Specifies that column *idx* is no longer growable.
12399 """
54f9ee45 12400 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
12401
12402 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
12403 """
12404 SetFlexibleDirection(self, int direction)
12405
12406 Specifies whether the sizer should flexibly resize its columns, rows,
12407 or both. Argument *direction* can be one of the following values. Any
12408 other value is ignored.
12409
12410 ============== =======================================
12411 wx.VERTICAL Rows are flexibly sized.
12412 wx.HORIZONTAL Columns are flexibly sized.
12413 wx.BOTH Both rows and columns are flexibly sized
12414 (this is the default value).
12415 ============== =======================================
12416
12417 Note that this method does not trigger relayout.
12418
12419 """
54f9ee45 12420 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
12421
12422 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
12423 """
12424 GetFlexibleDirection(self) -> int
12425
12426 Returns a value that specifies whether the sizer
12427 flexibly resizes its columns, rows, or both (default).
12428
12429 :see: `SetFlexibleDirection`
12430 """
54f9ee45 12431 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
12432
12433 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12434 """
12435 SetNonFlexibleGrowMode(self, int mode)
12436
12437 Specifies how the sizer should grow in the non-flexible direction if
12438 there is one (so `SetFlexibleDirection` must have been called
12439 previously). Argument *mode* can be one of the following values:
12440
12441 ========================== =================================================
12442 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12443 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12444 `AddGrowableCol` and `AddGrowableRow`. In this
12445 case equal sizing applies to minimum sizes of
12446 columns or rows (this is the default value).
12447 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12448 the non flexible direction, whether they are
12449 growable or not in the flexbile direction.
12450 ========================== =================================================
12451
12452 Note that this method does not trigger relayout.
12453
12454
12455 """
54f9ee45 12456 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
12457
12458 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12459 """
12460 GetNonFlexibleGrowMode(self) -> int
12461
12462 Returns the value that specifies how the sizer grows in the
12463 non-flexible direction if there is one.
12464
12465 :see: `SetNonFlexibleGrowMode`
12466 """
54f9ee45 12467 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
12468
12469 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
12470 """
12471 GetRowHeights(self) -> list
12472
12473 Returns a list of integers representing the heights of each of the
12474 rows in the sizer.
12475 """
54f9ee45 12476 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
12477
12478 def GetColWidths(*args, **kwargs):
fd2dc343
RD
12479 """
12480 GetColWidths(self) -> list
12481
12482 Returns a list of integers representing the widths of each of the
12483 columns in the sizer.
12484 """
54f9ee45 12485 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 12486
d14a1e28
RD
12487
12488class FlexGridSizerPtr(FlexGridSizer):
12489 def __init__(self, this):
12490 self.this = this
12491 if not hasattr(self,"thisown"): self.thisown = 0
12492 self.__class__ = FlexGridSizer
54f9ee45 12493_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
d14a1e28 12494
e505d15e
RD
12495class StdDialogButtonSizer(BoxSizer):
12496 """
12497 A special sizer that knows how to order and position standard buttons
12498 in order to conform to the current platform's standards. You simply
12499 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12500 buttons using the standard ID's. Then call `Realize` and the sizer
e505d15e
RD
12501 will take care of the rest.
12502
12503 """
12504 def __repr__(self):
12505 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12506 def __init__(self, *args, **kwargs):
12507 """__init__(self) -> StdDialogButtonSizer"""
12508 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
12509 self.this = newobj.this
12510 self.thisown = 1
12511 del newobj.thisown
12512 def AddButton(*args, **kwargs):
12513 """
12514 AddButton(self, wxButton button)
12515
12516 Use this to add the buttons to this sizer. Do not use the `Add`
12517 method in the base class.
12518 """
12519 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12520
53aa7709 12521 def Realize(*args, **kwargs):
e505d15e 12522 """
53aa7709 12523 Realize(self)
e505d15e
RD
12524
12525 This funciton needs to be called after all the buttons have been added
12526 to the sizer. It will reorder them and position them in a platform
12527 specifc manner.
12528 """
53aa7709 12529 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12530
12531 def SetAffirmativeButton(*args, **kwargs):
12532 """SetAffirmativeButton(self, wxButton button)"""
12533 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12534
12535 def SetNegativeButton(*args, **kwargs):
12536 """SetNegativeButton(self, wxButton button)"""
12537 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12538
12539 def SetCancelButton(*args, **kwargs):
12540 """SetCancelButton(self, wxButton button)"""
12541 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
e505d15e
RD
12542
12543 def GetAffirmativeButton(*args, **kwargs):
12544 """GetAffirmativeButton(self) -> wxButton"""
12545 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12546
12547 def GetApplyButton(*args, **kwargs):
12548 """GetApplyButton(self) -> wxButton"""
12549 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12550
12551 def GetNegativeButton(*args, **kwargs):
12552 """GetNegativeButton(self) -> wxButton"""
12553 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12554
12555 def GetCancelButton(*args, **kwargs):
12556 """GetCancelButton(self) -> wxButton"""
12557 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12558
12559 def GetHelpButton(*args, **kwargs):
12560 """GetHelpButton(self) -> wxButton"""
12561 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12562
12563
12564class StdDialogButtonSizerPtr(StdDialogButtonSizer):
12565 def __init__(self, this):
12566 self.this = this
12567 if not hasattr(self,"thisown"): self.thisown = 0
12568 self.__class__ = StdDialogButtonSizer
12569_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
12570
d14a1e28
RD
12571#---------------------------------------------------------------------------
12572
12573class GBPosition(object):
248ed943
RD
12574 """
12575 This class represents the position of an item in a virtual grid of
12576 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12577 typemaps that will automatically convert from a 2-element sequence of
12578 integers to a wx.GBPosition, so you can use the more pythonic
12579 representation of the position nearly transparently in Python code.
12580 """
e811c8ce
RD
12581 def __repr__(self):
12582 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12583 def __init__(self, *args, **kwargs):
248ed943
RD
12584 """
12585 __init__(self, int row=0, int col=0) -> GBPosition
12586
12587 This class represents the position of an item in a virtual grid of
12588 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12589 typemaps that will automatically convert from a 2-element sequence of
12590 integers to a wx.GBPosition, so you can use the more pythonic
12591 representation of the position nearly transparently in Python code.
12592 """
54f9ee45 12593 newobj = _core_.new_GBPosition(*args, **kwargs)
d14a1e28
RD
12594 self.this = newobj.this
12595 self.thisown = 1
12596 del newobj.thisown
e811c8ce 12597 def GetRow(*args, **kwargs):
a95a7133 12598 """GetRow(self) -> int"""
54f9ee45 12599 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
12600
12601 def GetCol(*args, **kwargs):
a95a7133 12602 """GetCol(self) -> int"""
54f9ee45 12603 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
12604
12605 def SetRow(*args, **kwargs):
a95a7133 12606 """SetRow(self, int row)"""
54f9ee45 12607 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
12608
12609 def SetCol(*args, **kwargs):
a95a7133 12610 """SetCol(self, int col)"""
54f9ee45 12611 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
12612
12613 def __eq__(*args, **kwargs):
a95a7133 12614 """__eq__(self, GBPosition other) -> bool"""
54f9ee45 12615 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
12616
12617 def __ne__(*args, **kwargs):
a95a7133 12618 """__ne__(self, GBPosition other) -> bool"""
54f9ee45 12619 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
12620
12621 def Set(*args, **kwargs):
a95a7133 12622 """Set(self, int row=0, int col=0)"""
54f9ee45 12623 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
12624
12625 def Get(*args, **kwargs):
a95a7133 12626 """Get(self) -> PyObject"""
54f9ee45 12627 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 12628
41e2b43e 12629 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
12630 def __str__(self): return str(self.Get())
12631 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12632 def __len__(self): return len(self.Get())
12633 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
12634 def __setitem__(self, index, val):
12635 if index == 0: self.SetRow(val)
12636 elif index == 1: self.SetCol(val)
12637 else: raise IndexError
e811c8ce 12638 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12639 __safe_for_unpickling__ = True
12640 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
12641
12642 row = property(GetRow, SetRow)
12643 col = property(GetCol, SetCol)
12644
12645
12646class GBPositionPtr(GBPosition):
12647 def __init__(self, this):
12648 self.this = this
12649 if not hasattr(self,"thisown"): self.thisown = 0
12650 self.__class__ = GBPosition
54f9ee45 12651_core_.GBPosition_swigregister(GBPositionPtr)
d14a1e28
RD
12652
12653class GBSpan(object):
248ed943
RD
12654 """
12655 This class is used to hold the row and column spanning attributes of
12656 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12657 automatically convert from a 2-element sequence of integers to a
12658 wx.GBSpan, so you can use the more pythonic representation of the span
12659 nearly transparently in Python code.
12660
12661 """
e811c8ce
RD
12662 def __repr__(self):
12663 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12664 def __init__(self, *args, **kwargs):
248ed943
RD
12665 """
12666 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12667
12668 Construct a new wxGBSpan, optionally setting the rowspan and
12669 colspan. The default is (1,1). (Meaning that the item occupies one
12670 cell in each direction.
12671 """
54f9ee45 12672 newobj = _core_.new_GBSpan(*args, **kwargs)
d14a1e28
RD
12673 self.this = newobj.this
12674 self.thisown = 1
12675 del newobj.thisown
e811c8ce 12676 def GetRowspan(*args, **kwargs):
a95a7133 12677 """GetRowspan(self) -> int"""
54f9ee45 12678 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
12679
12680 def GetColspan(*args, **kwargs):
a95a7133 12681 """GetColspan(self) -> int"""
54f9ee45 12682 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
12683
12684 def SetRowspan(*args, **kwargs):
a95a7133 12685 """SetRowspan(self, int rowspan)"""
54f9ee45 12686 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
12687
12688 def SetColspan(*args, **kwargs):
a95a7133 12689 """SetColspan(self, int colspan)"""
54f9ee45 12690 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
12691
12692 def __eq__(*args, **kwargs):
a95a7133 12693 """__eq__(self, GBSpan other) -> bool"""
54f9ee45 12694 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
12695
12696 def __ne__(*args, **kwargs):
a95a7133 12697 """__ne__(self, GBSpan other) -> bool"""
54f9ee45 12698 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
12699
12700 def Set(*args, **kwargs):
a95a7133 12701 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 12702 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
12703
12704 def Get(*args, **kwargs):
a95a7133 12705 """Get(self) -> PyObject"""
54f9ee45 12706 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 12707
41e2b43e 12708 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
12709 def __str__(self): return str(self.Get())
12710 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12711 def __len__(self): return len(self.Get())
12712 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
12713 def __setitem__(self, index, val):
12714 if index == 0: self.SetRowspan(val)
12715 elif index == 1: self.SetColspan(val)
12716 else: raise IndexError
e811c8ce 12717 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12718 __safe_for_unpickling__ = True
12719 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
12720
12721 rowspan = property(GetRowspan, SetRowspan)
12722 colspan = property(GetColspan, SetColspan)
12723
12724
12725class GBSpanPtr(GBSpan):
12726 def __init__(self, this):
12727 self.this = this
12728 if not hasattr(self,"thisown"): self.thisown = 0
12729 self.__class__ = GBSpan
54f9ee45 12730_core_.GBSpan_swigregister(GBSpanPtr)
d14a1e28
RD
12731
12732class GBSizerItem(SizerItem):
248ed943
RD
12733 """
12734 The wx.GBSizerItem class is used to track the additional data about
12735 items in a `wx.GridBagSizer` such as the item's position in the grid
12736 and how many rows or columns it spans.
12737
12738 """
e811c8ce
RD
12739 def __repr__(self):
12740 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12741 def __init__(self, *args, **kwargs):
248ed943
RD
12742 """
12743 __init__(self) -> GBSizerItem
12744
12745 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12746 size will need to be set, as well as a position and span before this
12747 item can be used in a Sizer.
12748
12749 You will probably never need to create a wx.GBSizerItem directly as they
12750 are created automatically when the sizer's Add method is called.
12751 """
54f9ee45 12752 newobj = _core_.new_GBSizerItem(*args, **kwargs)
d14a1e28
RD
12753 self.this = newobj.this
12754 self.thisown = 1
12755 del newobj.thisown
e811c8ce 12756 def GetPos(*args, **kwargs):
248ed943
RD
12757 """
12758 GetPos(self) -> GBPosition
12759
12760 Get the grid position of the item
12761 """
54f9ee45 12762 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
12763
12764 def GetPosTuple(self): return self.GetPos().Get()
12765 def GetSpan(*args, **kwargs):
248ed943
RD
12766 """
12767 GetSpan(self) -> GBSpan
12768
12769 Get the row and column spanning of the item
12770 """
54f9ee45 12771 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
12772
12773 def GetSpanTuple(self): return self.GetSpan().Get()
12774 def SetPos(*args, **kwargs):
248ed943
RD
12775 """
12776 SetPos(self, GBPosition pos) -> bool
12777
12778 If the item is already a member of a sizer then first ensure that
12779 there is no other item that would intersect with this one at the new
12780 position, then set the new position. Returns True if the change is
12781 successful and after the next Layout() the item will be moved.
12782 """
54f9ee45 12783 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
12784
12785 def SetSpan(*args, **kwargs):
248ed943
RD
12786 """
12787 SetSpan(self, GBSpan span) -> bool
12788
12789 If the item is already a member of a sizer then first ensure that
12790 there is no other item that would intersect with this one with its new
12791 spanning size, then set the new spanning. Returns True if the change
12792 is successful and after the next Layout() the item will be resized.
12793
12794 """
54f9ee45 12795 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 12796
248ed943 12797 def Intersects(*args, **kwargs):
0df68c9f 12798 """
a95a7133 12799 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12800
12801 Returns True if this item and the other item instersect.
0df68c9f 12802 """
248ed943
RD
12803 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12804
12805 def IntersectsPos(*args, **kwargs):
12806 """
12807 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12808
12809 Returns True if the given pos/span would intersect with this item.
12810 """
12811 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
12812
12813 def GetEndPos(*args, **kwargs):
248ed943
RD
12814 """
12815 GetEndPos(self) -> GBPosition
12816
12817 Get the row and column of the endpoint of this item.
12818 """
54f9ee45 12819 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
12820
12821 def GetGBSizer(*args, **kwargs):
248ed943
RD
12822 """
12823 GetGBSizer(self) -> GridBagSizer
12824
12825 Get the sizer this item is a member of.
12826 """
54f9ee45 12827 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
12828
12829 def SetGBSizer(*args, **kwargs):
248ed943
RD
12830 """
12831 SetGBSizer(self, GridBagSizer sizer)
12832
12833 Set the sizer this item is a member of.
12834 """
54f9ee45 12835 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 12836
d14a1e28
RD
12837
12838class GBSizerItemPtr(GBSizerItem):
12839 def __init__(self, this):
12840 self.this = this
12841 if not hasattr(self,"thisown"): self.thisown = 0
12842 self.__class__ = GBSizerItem
54f9ee45 12843_core_.GBSizerItem_swigregister(GBSizerItemPtr)
d14a1e28
RD
12844DefaultSpan = cvar.DefaultSpan
12845
12846def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
12847 """
12848 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12849 int border, PyObject userData=None) -> GBSizerItem
12850
12851 Construct a `wx.GBSizerItem` for a window.
0df68c9f 12852 """
54f9ee45 12853 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
12854 val.thisown = 1
12855 return val
12856
12857def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
12858 """
12859 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12860 int border, PyObject userData=None) -> GBSizerItem
12861
12862 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 12863 """
54f9ee45 12864 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
12865 val.thisown = 1
12866 return val
12867
12868def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
12869 """
12870 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12871 int flag, int border, PyObject userData=None) -> GBSizerItem
12872
12873 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 12874 """
54f9ee45 12875 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
12876 val.thisown = 1
12877 return val
12878
12879class GridBagSizer(FlexGridSizer):
248ed943
RD
12880 """
12881 A `wx.Sizer` that can lay out items in a virtual grid like a
12882 `wx.FlexGridSizer` but in this case explicit positioning of the items
12883 is allowed using `wx.GBPosition`, and items can optionally span more
12884 than one row and/or column using `wx.GBSpan`. The total size of the
12885 virtual grid is determined by the largest row and column that items are
12886 positioned at, adjusted for spanning.
12887
12888 """
e811c8ce
RD
12889 def __repr__(self):
12890 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12891 def __init__(self, *args, **kwargs):
248ed943
RD
12892 """
12893 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12894
12895 Constructor, with optional parameters to specify the gap between the
12896 rows and columns.
12897 """
54f9ee45 12898 newobj = _core_.new_GridBagSizer(*args, **kwargs)
d14a1e28
RD
12899 self.this = newobj.this
12900 self.thisown = 1
12901 del newobj.thisown
1823fbb4
RD
12902 self._setOORInfo(self)
12903
e811c8ce 12904 def Add(*args, **kwargs):
0df68c9f 12905 """
248ed943 12906 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 12907 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12908
12909 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12910 more than one row or column as specified with *span*. The remaining
12911 args behave similarly to `wx.Sizer.Add`.
12912
12913 Returns True if the item was successfully placed at the given cell
12914 position, False if something was already there.
12915
0df68c9f 12916 """
54f9ee45 12917 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
12918
12919 def AddItem(*args, **kwargs):
248ed943 12920 """
d3b6e4ff 12921 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
12922
12923 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12924 the item was successfully placed at its given cell position, False if
12925 something was already there.
12926 """
54f9ee45 12927 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 12928
84f85550
RD
12929 def GetCellSize(*args, **kwargs):
12930 """
12931 GetCellSize(self, int row, int col) -> Size
12932
12933 Get the size of the specified cell, including hgap and
12934 vgap. Only valid after a Layout.
12935 """
12936 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12937
e811c8ce 12938 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
12939 """
12940 GetEmptyCellSize(self) -> Size
12941
12942 Get the size used for cells in the grid with no item.
12943 """
54f9ee45 12944 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12945
12946 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
12947 """
12948 SetEmptyCellSize(self, Size sz)
12949
12950 Set the size used for cells in the grid with no item.
12951 """
54f9ee45 12952 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12953
12954 def GetItemPosition(*args):
0df68c9f 12955 """
248ed943
RD
12956 GetItemPosition(self, item) -> GBPosition
12957
12958 Get the grid position of the specified *item* where *item* is either a
12959 window or subsizer that is a member of this sizer, or a zero-based
12960 index of an item.
0df68c9f 12961 """
54f9ee45 12962 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
12963
12964 def SetItemPosition(*args):
0df68c9f 12965 """
248ed943
RD
12966 SetItemPosition(self, item, GBPosition pos) -> bool
12967
12968 Set the grid position of the specified *item* where *item* is either a
12969 window or subsizer that is a member of this sizer, or a zero-based
12970 index of an item. Returns True on success. If the move is not
12971 allowed (because an item is already there) then False is returned.
12972
0df68c9f 12973 """
54f9ee45 12974 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
12975
12976 def GetItemSpan(*args):
0df68c9f 12977 """
248ed943
RD
12978 GetItemSpan(self, item) -> GBSpan
12979
12980 Get the row/col spanning of the specified *item* where *item* is
12981 either a window or subsizer that is a member of this sizer, or a
12982 zero-based index of an item.
0df68c9f 12983 """
54f9ee45 12984 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
12985
12986 def SetItemSpan(*args):
0df68c9f 12987 """
248ed943
RD
12988 SetItemSpan(self, item, GBSpan span) -> bool
12989
12990 Set the row/col spanning of the specified *item* where *item* is
12991 either a window or subsizer that is a member of this sizer, or a
12992 zero-based index of an item. Returns True on success. If the move is
12993 not allowed (because an item is already there) then False is returned.
0df68c9f 12994 """
54f9ee45 12995 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
12996
12997 def FindItem(*args):
0df68c9f 12998 """
248ed943
RD
12999 FindItem(self, item) -> GBSizerItem
13000
13001 Find the sizer item for the given window or subsizer, returns None if
13002 not found. (non-recursive)
0df68c9f 13003 """
54f9ee45 13004 return _core_.GridBagSizer_FindItem(*args)
e811c8ce
RD
13005
13006 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
13007 """
13008 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13009
13010 Return the sizer item for the given grid cell, or None if there is no
13011 item at that position. (non-recursive)
13012 """
54f9ee45 13013 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
13014
13015 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
13016 """
13017 FindItemAtPoint(self, Point pt) -> GBSizerItem
13018
13019 Return the sizer item located at the point given in *pt*, or None if
13020 there is no item at that point. The (x,y) coordinates in pt correspond
13021 to the client coordinates of the window using the sizer for
13022 layout. (non-recursive)
13023 """
54f9ee45 13024 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 13025
248ed943
RD
13026 def CheckForIntersection(*args, **kwargs):
13027 """
13028 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 13029
248ed943
RD
13030 Look at all items and see if any intersect (or would overlap) the
13031 given *item*. Returns True if so, False if there would be no overlap.
13032 If an *excludeItem* is given then it will not be checked for
13033 intersection, for example it may be the item we are checking the
13034 position of.
e811c8ce 13035
248ed943
RD
13036 """
13037 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 13038
248ed943 13039 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 13040 """
248ed943
RD
13041 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13042
13043 Look at all items and see if any intersect (or would overlap) the
13044 given position and span. Returns True if so, False if there would be
13045 no overlap. If an *excludeItem* is given then it will not be checked
13046 for intersection, for example it may be the item we are checking the
13047 position of.
0df68c9f 13048 """
248ed943 13049 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 13050
d14a1e28
RD
13051
13052class GridBagSizerPtr(GridBagSizer):
13053 def __init__(self, this):
13054 self.this = this
13055 if not hasattr(self,"thisown"): self.thisown = 0
13056 self.__class__ = GridBagSizer
54f9ee45 13057_core_.GridBagSizer_swigregister(GridBagSizerPtr)
d14a1e28
RD
13058
13059#---------------------------------------------------------------------------
13060
54f9ee45
RD
13061Left = _core_.Left
13062Top = _core_.Top
13063Right = _core_.Right
13064Bottom = _core_.Bottom
13065Width = _core_.Width
13066Height = _core_.Height
13067Centre = _core_.Centre
13068Center = _core_.Center
13069CentreX = _core_.CentreX
13070CentreY = _core_.CentreY
13071Unconstrained = _core_.Unconstrained
13072AsIs = _core_.AsIs
13073PercentOf = _core_.PercentOf
13074Above = _core_.Above
13075Below = _core_.Below
13076LeftOf = _core_.LeftOf
13077RightOf = _core_.RightOf
13078SameAs = _core_.SameAs
13079Absolute = _core_.Absolute
d14a1e28 13080class IndividualLayoutConstraint(Object):
15afbcd0 13081 """
41e2b43e
RD
13082 Objects of this class are stored in the `wx.LayoutConstraints` class as
13083 one of eight possible constraints that a window can be involved in.
13084 You will never need to create an instance of
13085 wx.IndividualLayoutConstraint, rather you should create a
13086 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 13087 that it contains.
15afbcd0 13088 """
d14a1e28
RD
13089 def __init__(self): raise RuntimeError, "No constructor defined"
13090 def __repr__(self):
13091 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 13092 def Set(*args, **kwargs):
41e2b43e
RD
13093 """
13094 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13095
13096 Sets the properties of the constraint. Normally called by one of the
13097 convenience functions such as Above, RightOf, SameAs.
13098 """
54f9ee45 13099 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
13100
13101 def LeftOf(*args, **kwargs):
15afbcd0 13102 """
a95a7133 13103 LeftOf(self, Window sibling, int marg=0)
15afbcd0 13104
41e2b43e
RD
13105 Constrains this edge to be to the left of the given window, with an
13106 optional margin. Implicitly, this is relative to the left edge of the
13107 other window.
15afbcd0 13108 """
54f9ee45 13109 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
13110
13111 def RightOf(*args, **kwargs):
15afbcd0 13112 """
a95a7133 13113 RightOf(self, Window sibling, int marg=0)
15afbcd0 13114
41e2b43e
RD
13115 Constrains this edge to be to the right of the given window, with an
13116 optional margin. Implicitly, this is relative to the right edge of the
13117 other window.
15afbcd0 13118 """
54f9ee45 13119 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
13120
13121 def Above(*args, **kwargs):
15afbcd0 13122 """
a95a7133 13123 Above(self, Window sibling, int marg=0)
15afbcd0 13124
41e2b43e
RD
13125 Constrains this edge to be above the given window, with an optional
13126 margin. Implicitly, this is relative to the top edge of the other
13127 window.
15afbcd0 13128 """
54f9ee45 13129 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
13130
13131 def Below(*args, **kwargs):
15afbcd0 13132 """
a95a7133 13133 Below(self, Window sibling, int marg=0)
15afbcd0 13134
41e2b43e
RD
13135 Constrains this edge to be below the given window, with an optional
13136 margin. Implicitly, this is relative to the bottom edge of the other
13137 window.
15afbcd0 13138 """
54f9ee45 13139 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
13140
13141 def SameAs(*args, **kwargs):
15afbcd0 13142 """
a95a7133 13143 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 13144
41e2b43e
RD
13145 Constrains this edge or dimension to be to the same as the edge of the
13146 given window, with an optional margin.
15afbcd0 13147 """
54f9ee45 13148 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
13149
13150 def PercentOf(*args, **kwargs):
15afbcd0 13151 """
a95a7133 13152 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 13153
41e2b43e
RD
13154 Constrains this edge or dimension to be to a percentage of the given
13155 window, with an optional margin.
15afbcd0 13156 """
54f9ee45 13157 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
13158
13159 def Absolute(*args, **kwargs):
15afbcd0 13160 """
a95a7133 13161 Absolute(self, int val)
15afbcd0 13162
41e2b43e 13163 Constrains this edge or dimension to be the given absolute value.
15afbcd0 13164 """
54f9ee45 13165 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
13166
13167 def Unconstrained(*args, **kwargs):
15afbcd0 13168 """
a95a7133 13169 Unconstrained(self)
15afbcd0 13170
41e2b43e
RD
13171 Sets this edge or dimension to be unconstrained, that is, dependent on
13172 other edges and dimensions from which this value can be deduced.
15afbcd0 13173 """
54f9ee45 13174 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
13175
13176 def AsIs(*args, **kwargs):
15afbcd0 13177 """
a95a7133 13178 AsIs(self)
15afbcd0 13179
41e2b43e
RD
13180 Sets this edge or constraint to be whatever the window's value is at
13181 the moment. If either of the width and height constraints are *as is*,
13182 the window will not be resized, but moved instead. This is important
13183 when considering panel items which are intended to have a default
13184 size, such as a button, which may take its size from the size of the
13185 button label.
15afbcd0 13186 """
54f9ee45 13187 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
13188
13189 def GetOtherWindow(*args, **kwargs):
a95a7133 13190 """GetOtherWindow(self) -> Window"""
54f9ee45 13191 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
13192
13193 def GetMyEdge(*args, **kwargs):
a95a7133 13194 """GetMyEdge(self) -> int"""
54f9ee45 13195 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
13196
13197 def SetEdge(*args, **kwargs):
a95a7133 13198 """SetEdge(self, int which)"""
54f9ee45 13199 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
13200
13201 def SetValue(*args, **kwargs):
a95a7133 13202 """SetValue(self, int v)"""
54f9ee45 13203 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
13204
13205 def GetMargin(*args, **kwargs):
a95a7133 13206 """GetMargin(self) -> int"""
54f9ee45 13207 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
13208
13209 def SetMargin(*args, **kwargs):
a95a7133 13210 """SetMargin(self, int m)"""
54f9ee45 13211 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
13212
13213 def GetValue(*args, **kwargs):
a95a7133 13214 """GetValue(self) -> int"""
54f9ee45 13215 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
13216
13217 def GetPercent(*args, **kwargs):
a95a7133 13218 """GetPercent(self) -> int"""
54f9ee45 13219 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
13220
13221 def GetOtherEdge(*args, **kwargs):
a95a7133 13222 """GetOtherEdge(self) -> int"""
54f9ee45 13223 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
13224
13225 def GetDone(*args, **kwargs):
a95a7133 13226 """GetDone(self) -> bool"""
54f9ee45 13227 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
13228
13229 def SetDone(*args, **kwargs):
a95a7133 13230 """SetDone(self, bool d)"""
54f9ee45 13231 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
13232
13233 def GetRelationship(*args, **kwargs):
a95a7133 13234 """GetRelationship(self) -> int"""
54f9ee45 13235 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
13236
13237 def SetRelationship(*args, **kwargs):
a95a7133 13238 """SetRelationship(self, int r)"""
54f9ee45 13239 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
13240
13241 def ResetIfWin(*args, **kwargs):
15afbcd0 13242 """
a95a7133 13243 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
13244
13245 Reset constraint if it mentions otherWin
13246 """
54f9ee45 13247 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
13248
13249 def SatisfyConstraint(*args, **kwargs):
15afbcd0 13250 """
a95a7133 13251 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
13252
13253 Try to satisfy constraint
13254 """
54f9ee45 13255 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
13256
13257 def GetEdge(*args, **kwargs):
15afbcd0 13258 """
a95a7133 13259 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
13260
13261 Get the value of this edge or dimension, or if this
13262 is not determinable, -1.
13263 """
54f9ee45 13264 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 13265
d14a1e28
RD
13266
13267class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
13268 def __init__(self, this):
13269 self.this = this
13270 if not hasattr(self,"thisown"): self.thisown = 0
13271 self.__class__ = IndividualLayoutConstraint
54f9ee45 13272_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
d14a1e28
RD
13273
13274class LayoutConstraints(Object):
15afbcd0 13275 """
41e2b43e
RD
13276 **Note:** constraints are now deprecated and you should use sizers
13277 instead.
15afbcd0 13278
41e2b43e
RD
13279 Objects of this class can be associated with a window to define its
13280 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
13281
13282 The class consists of the following eight constraints of class
13283 wx.IndividualLayoutConstraint, some or all of which should be accessed
13284 directly to set the appropriate constraints.
13285
13286 * left: represents the left hand edge of the window
13287 * right: represents the right hand edge of the window
13288 * top: represents the top edge of the window
13289 * bottom: represents the bottom edge of the window
13290 * width: represents the width of the window
13291 * height: represents the height of the window
13292 * centreX: represents the horizontal centre point of the window
13293 * centreY: represents the vertical centre point of the window
13294
41e2b43e
RD
13295 Most constraints are initially set to have the relationship
13296 wxUnconstrained, which means that their values should be calculated by
13297 looking at known constraints. The exceptions are width and height,
13298 which are set to wxAsIs to ensure that if the user does not specify a
13299 constraint, the existing width and height will be used, to be
13300 compatible with panel items which often have take a default size. If
13301 the constraint is ``wx.AsIs``, the dimension will not be changed.
13302
13303 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
13304
13305 """
e811c8ce
RD
13306 def __repr__(self):
13307 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
13308 left = property(_core_.LayoutConstraints_left_get)
13309 top = property(_core_.LayoutConstraints_top_get)
13310 right = property(_core_.LayoutConstraints_right_get)
13311 bottom = property(_core_.LayoutConstraints_bottom_get)
13312 width = property(_core_.LayoutConstraints_width_get)
13313 height = property(_core_.LayoutConstraints_height_get)
13314 centreX = property(_core_.LayoutConstraints_centreX_get)
13315 centreY = property(_core_.LayoutConstraints_centreY_get)
d14a1e28 13316 def __init__(self, *args, **kwargs):
a95a7133 13317 """__init__(self) -> LayoutConstraints"""
54f9ee45 13318 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
d14a1e28
RD
13319 self.this = newobj.this
13320 self.thisown = 1
13321 del newobj.thisown
e811c8ce 13322 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 13323 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 13324 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
13325
13326 def AreSatisfied(*args, **kwargs):
a95a7133 13327 """AreSatisfied(self) -> bool"""
54f9ee45 13328 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 13329
d14a1e28
RD
13330
13331class LayoutConstraintsPtr(LayoutConstraints):
13332 def __init__(self, this):
13333 self.this = this
13334 if not hasattr(self,"thisown"): self.thisown = 0
13335 self.__class__ = LayoutConstraints
54f9ee45 13336_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
d14a1e28
RD
13337
13338#----------------------------------------------------------------------------
13339
322913ce 13340# Use Python's bool constants if available, make some if not
d14a1e28
RD
13341try:
13342 True
13343except NameError:
322913ce
RD
13344 __builtins__.True = 1==1
13345 __builtins__.False = 1==0
4f89f6a3
RD
13346 def bool(value): return not not value
13347 __builtins__.bool = bool
d14a1e28 13348
d14a1e28
RD
13349
13350
13351# workarounds for bad wxRTTI names
13352__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13353__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13354__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13355
13356
13357#----------------------------------------------------------------------------
13358# Load version numbers from __version__... Ensure that major and minor
7bc1e663 13359# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
13360
13361from __version__ import *
13362__version__ = VERSION_STRING
13363
7bc1e663
RD
13364assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13365assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 13366if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 13367 import warnings
7bc1e663 13368 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28
RD
13369
13370#----------------------------------------------------------------------------
13371
70b7a5fe
RD
13372# Set wxPython's default string<-->unicode conversion encoding from
13373# the locale, but only if Python's default hasn't been changed. (We
13374# assume that if the user has customized it already then that is the
13375# encoding we need to use as well.)
13376#
13377# The encoding selected here is used when string or unicode objects
13378# need to be converted in order to pass them to wxWidgets. Please be
13379# aware that the default encoding within the same locale may be
13380# slightly different on different platforms. For example, please see
e505d15e
RD
13381# http://www.alanwood.net/demos/charsetdiffs.html for differences
13382# between the common latin/roman encodings.
396fb509
RD
13383
13384default = _sys.getdefaultencoding()
13385if default == 'ascii':
13386 import locale
13387 import codecs
13388 try:
13389 default = locale.getdefaultlocale()[1]
13390 codecs.lookup(default)
70b7a5fe 13391 except (ValueError, LookupError, TypeError):
396fb509
RD
13392 default = _sys.getdefaultencoding()
13393 del locale
13394 del codecs
5cbf236d
RD
13395if default:
13396 wx.SetDefaultPyEncoding(default)
13397del default
5cbf236d
RD
13398
13399#----------------------------------------------------------------------------
13400
d14a1e28
RD
13401class PyDeadObjectError(AttributeError):
13402 pass
13403
d14a1e28
RD
13404class _wxPyDeadObject(object):
13405 """
13406 Instances of wx objects that are OOR capable will have their __class__
13407 changed to this class when the C++ object is deleted. This should help
13408 prevent crashes due to referencing a bogus C++ pointer.
13409 """
13410 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13411 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13412
3a04f143 13413 def __repr__(self):
d14a1e28
RD
13414 if not hasattr(self, "_name"):
13415 self._name = "[unknown]"
13416 return self.reprStr % self._name
13417
3a04f143 13418 def __getattr__(self, *args):
d14a1e28
RD
13419 if not hasattr(self, "_name"):
13420 self._name = "[unknown]"
3a04f143
RD
13421 raise PyDeadObjectError(self.attrStr % self._name)
13422
13423 def __nonzero__(self):
13424 return 0
13425
13426
13427
13428class PyUnbornObjectError(AttributeError):
13429 pass
13430
13431class _wxPyUnbornObject(object):
13432 """
54f9ee45 13433 Some stock objects are created when the wx._core module is
3a04f143
RD
13434 imported, but their C++ instance is not created until the wx.App
13435 object is created and initialized. These object instances will
13436 temporarily have their __class__ changed to this class so an
13437 exception will be raised if they are used before the C++ instance
13438 is ready.
13439 """
13440
13441 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13442 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13443
13444 def __repr__(self):
13445 #if not hasattr(self, "_name"):
13446 # self._name = "[unknown]"
13447 return self.reprStr #% self._name
13448
13449 def __getattr__(self, *args):
13450 #if not hasattr(self, "_name"):
13451 # self._name = "[unknown]"
13452 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
13453
13454 def __nonzero__(self):
13455 return 0
13456
13457
13458#----------------------------------------------------------------------------
d14a1e28
RD
13459
13460def CallAfter(callable, *args, **kw):
13461 """
13462 Call the specified function after the current and pending event
13463 handlers have been completed. This is also good for making GUI
61863841
RD
13464 method calls from non-GUI threads. Any extra positional or
13465 keyword args are passed on to the callable when it is called.
13466
13467 :see: `wx.FutureCall`
d14a1e28
RD
13468 """
13469 app = wx.GetApp()
dfbb5885 13470 assert app is not None, 'No wx.App created yet'
d14a1e28 13471
148275d3
RD
13472 if not hasattr(app, "_CallAfterId"):
13473 app._CallAfterId = wx.NewEventType()
13474 app.Connect(-1, -1, app._CallAfterId,
13475 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 13476 evt = wx.PyEvent()
148275d3 13477 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
13478 evt.callable = callable
13479 evt.args = args
13480 evt.kw = kw
13481 wx.PostEvent(app, evt)
13482
d14a1e28
RD
13483#----------------------------------------------------------------------------
13484
13485
13486class FutureCall:
13487 """
8ac8dba0 13488 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
13489 object once after the given amount of milliseconds, passing any
13490 positional or keyword args. The return value of the callable is
61863841 13491 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
13492
13493 If you don't need to get the return value or restart the timer
13494 then there is no need to hold a reference to this object. It will
13495 hold a reference to itself while the timer is running (the timer
13496 has a reference to self.Notify) but the cycle will be broken when
13497 the timer completes, automatically cleaning up the wx.FutureCall
13498 object.
61863841
RD
13499
13500 :see: `wx.CallAfter`
d14a1e28
RD
13501 """
13502 def __init__(self, millis, callable, *args, **kwargs):
13503 self.millis = millis
13504 self.callable = callable
13505 self.SetArgs(*args, **kwargs)
13506 self.runCount = 0
4276dc52 13507 self.running = False
d14a1e28
RD
13508 self.hasRun = False
13509 self.result = None
13510 self.timer = None
13511 self.Start()
13512
13513 def __del__(self):
13514 self.Stop()
13515
13516
13517 def Start(self, millis=None, *args, **kwargs):
13518 """
13519 (Re)start the timer
13520 """
13521 self.hasRun = False
13522 if millis is not None:
13523 self.millis = millis
13524 if args or kwargs:
13525 self.SetArgs(*args, **kwargs)
13526 self.Stop()
13527 self.timer = wx.PyTimer(self.Notify)
13528 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 13529 self.running = True
d14a1e28
RD
13530 Restart = Start
13531
13532
13533 def Stop(self):
13534 """
13535 Stop and destroy the timer.
13536 """
13537 if self.timer is not None:
13538 self.timer.Stop()
13539 self.timer = None
13540
13541
13542 def GetInterval(self):
13543 if self.timer is not None:
13544 return self.timer.GetInterval()
13545 else:
13546 return 0
13547
13548
13549 def IsRunning(self):
13550 return self.timer is not None and self.timer.IsRunning()
13551
13552
13553 def SetArgs(self, *args, **kwargs):
13554 """
13555 (Re)set the args passed to the callable object. This is
13556 useful in conjunction with Restart if you want to schedule a
13557 new call to the same callable object but with different
13558 parameters.
13559 """
13560 self.args = args
13561 self.kwargs = kwargs
13562
13563
13564 def HasRun(self):
13565 return self.hasRun
13566
13567 def GetResult(self):
13568 return self.result
13569
13570 def Notify(self):
13571 """
13572 The timer has expired so call the callable.
13573 """
13574 if self.callable and getattr(self.callable, 'im_self', True):
13575 self.runCount += 1
4276dc52 13576 self.running = False
d14a1e28
RD
13577 self.result = self.callable(*self.args, **self.kwargs)
13578 self.hasRun = True
4276dc52
RD
13579 if not self.running:
13580 # if it wasn't restarted, then cleanup
13581 wx.CallAfter(self.Stop)
d14a1e28
RD
13582
13583
a95a7133
RD
13584
13585#----------------------------------------------------------------------------
13586# Control which items in this module should be documented by epydoc.
13587# We allow only classes and functions, which will help reduce the size
13588# of the docs by filtering out the zillions of constants, EVT objects,
13589# and etc that don't make much sense by themselves, but are instead
13590# documented (or will be) as part of the classes/functions/methods
13591# where they should be used.
13592
66c033b4
RD
13593class __DocFilter:
13594 """
13595 A filter for epydoc that only allows non-Ptr classes and
13596 fucntions, in order to reduce the clutter in the API docs.
13597 """
13598 def __init__(self, globals):
13599 self._globals = globals
13600
13601 def __call__(self, name):
13602 import types
13603 obj = self._globals.get(name, None)
13604 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13605 return False
13606 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
13607 return False
13608 return True
a95a7133 13609
d14a1e28
RD
13610#----------------------------------------------------------------------------
13611#----------------------------------------------------------------------------
13612
13613# Import other modules in this package that should show up in the
13614# "core" wx namespace
54f9ee45
RD
13615from _gdi import *
13616from _windows import *
13617from _controls import *
13618from _misc import *
d14a1e28 13619
3a04f143
RD
13620
13621# Fixup the stock objects since they can't be used yet. (They will be
13622# restored in wx.PyApp.OnInit.)
54f9ee45 13623_core_._wxPyFixStockObjects()
3a04f143 13624
d14a1e28
RD
13625#----------------------------------------------------------------------------
13626#----------------------------------------------------------------------------
13627
13628