]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
Mention the SWIG_VERSION change
[wxWidgets.git] / wxPython / src / mac / _core.py
CommitLineData
32fe5131 1# This file was created automatically by SWIG 1.3.27.
d55e5bfc
RD
2# Don't modify this file, modify the SWIG interface instead.
3
5b5c9bc7 4import _core_
d55e5bfc 5
36ed4f51
RD
6def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name) or (name == "thisown"):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
24 method = class_type.__swig_getmethods__.get(name,None)
25 if method: return method(self)
26 raise AttributeError,name
27
28import types
29try:
30 _object = types.ObjectType
31 _newclass = 1
32except AttributeError:
33 class _object : pass
34 _newclass = 0
35del types
36
37
38def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
d55e5bfc
RD
47#// Give a reference to the dictionary of this module to the C++ extension
48#// code.
49_core_._wxPySetDictionary(vars())
50
51#// A little trick to make 'wx' be a reference to this module so wx.Names can
52#// be used here.
53import sys as _sys
54wx = _sys.modules[__name__]
55
d6c14a4c
RD
56
57#----------------------------------------------------------------------------
58
59def _deprecated(callable, msg=None):
60 """
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
63 """
64 if msg is None:
65 msg = "%s is deprecated" % callable
66 def deprecatedWrapper(*args, **kwargs):
67 import warnings
68 warnings.warn(msg, DeprecationWarning, stacklevel=2)
69 return callable(*args, **kwargs)
70 deprecatedWrapper.__doc__ = msg
71 return deprecatedWrapper
72
73
74#----------------------------------------------------------------------------
75
5b5c9bc7
RD
76NOT_FOUND = _core_.NOT_FOUND
77VSCROLL = _core_.VSCROLL
78HSCROLL = _core_.HSCROLL
79CAPTION = _core_.CAPTION
80DOUBLE_BORDER = _core_.DOUBLE_BORDER
81SUNKEN_BORDER = _core_.SUNKEN_BORDER
82RAISED_BORDER = _core_.RAISED_BORDER
83BORDER = _core_.BORDER
84SIMPLE_BORDER = _core_.SIMPLE_BORDER
85STATIC_BORDER = _core_.STATIC_BORDER
86TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
87NO_BORDER = _core_.NO_BORDER
88DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 89DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
5b5c9bc7
RD
90TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
91WANTS_CHARS = _core_.WANTS_CHARS
92POPUP_WINDOW = _core_.POPUP_WINDOW
93CENTER_FRAME = _core_.CENTER_FRAME
94CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
95CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
96CLIP_CHILDREN = _core_.CLIP_CHILDREN
97CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
98ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
99RETAINED = _core_.RETAINED
100BACKINGSTORE = _core_.BACKINGSTORE
101COLOURED = _core_.COLOURED
102FIXED_LENGTH = _core_.FIXED_LENGTH
103LB_NEEDED_SB = _core_.LB_NEEDED_SB
104LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
105LB_SORT = _core_.LB_SORT
106LB_SINGLE = _core_.LB_SINGLE
107LB_MULTIPLE = _core_.LB_MULTIPLE
108LB_EXTENDED = _core_.LB_EXTENDED
109LB_OWNERDRAW = _core_.LB_OWNERDRAW
110LB_HSCROLL = _core_.LB_HSCROLL
111PROCESS_ENTER = _core_.PROCESS_ENTER
112PASSWORD = _core_.PASSWORD
113CB_SIMPLE = _core_.CB_SIMPLE
114CB_DROPDOWN = _core_.CB_DROPDOWN
115CB_SORT = _core_.CB_SORT
116CB_READONLY = _core_.CB_READONLY
117RA_HORIZONTAL = _core_.RA_HORIZONTAL
118RA_VERTICAL = _core_.RA_VERTICAL
119RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
120RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
121RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
122RB_GROUP = _core_.RB_GROUP
123RB_SINGLE = _core_.RB_SINGLE
124SB_HORIZONTAL = _core_.SB_HORIZONTAL
125SB_VERTICAL = _core_.SB_VERTICAL
126RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
127ST_SIZEGRIP = _core_.ST_SIZEGRIP
128ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
129FLOOD_SURFACE = _core_.FLOOD_SURFACE
130FLOOD_BORDER = _core_.FLOOD_BORDER
131ODDEVEN_RULE = _core_.ODDEVEN_RULE
132WINDING_RULE = _core_.WINDING_RULE
133TOOL_TOP = _core_.TOOL_TOP
134TOOL_BOTTOM = _core_.TOOL_BOTTOM
135TOOL_LEFT = _core_.TOOL_LEFT
136TOOL_RIGHT = _core_.TOOL_RIGHT
137OK = _core_.OK
138YES_NO = _core_.YES_NO
139CANCEL = _core_.CANCEL
140YES = _core_.YES
141NO = _core_.NO
142NO_DEFAULT = _core_.NO_DEFAULT
143YES_DEFAULT = _core_.YES_DEFAULT
144ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
145ICON_HAND = _core_.ICON_HAND
146ICON_QUESTION = _core_.ICON_QUESTION
147ICON_INFORMATION = _core_.ICON_INFORMATION
148ICON_STOP = _core_.ICON_STOP
149ICON_ASTERISK = _core_.ICON_ASTERISK
150ICON_MASK = _core_.ICON_MASK
151ICON_WARNING = _core_.ICON_WARNING
152ICON_ERROR = _core_.ICON_ERROR
153FORWARD = _core_.FORWARD
154BACKWARD = _core_.BACKWARD
155RESET = _core_.RESET
156HELP = _core_.HELP
157MORE = _core_.MORE
158SETUP = _core_.SETUP
159SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
160SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
161SIZE_AUTO = _core_.SIZE_AUTO
162SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
163SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 164SIZE_FORCE = _core_.SIZE_FORCE
5b5c9bc7
RD
165PORTRAIT = _core_.PORTRAIT
166LANDSCAPE = _core_.LANDSCAPE
167PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
168PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
169PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
170PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
171ID_ANY = _core_.ID_ANY
172ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 173ID_NONE = _core_.ID_NONE
5b5c9bc7
RD
174ID_LOWEST = _core_.ID_LOWEST
175ID_OPEN = _core_.ID_OPEN
176ID_CLOSE = _core_.ID_CLOSE
177ID_NEW = _core_.ID_NEW
178ID_SAVE = _core_.ID_SAVE
179ID_SAVEAS = _core_.ID_SAVEAS
180ID_REVERT = _core_.ID_REVERT
181ID_EXIT = _core_.ID_EXIT
182ID_UNDO = _core_.ID_UNDO
183ID_REDO = _core_.ID_REDO
184ID_HELP = _core_.ID_HELP
185ID_PRINT = _core_.ID_PRINT
186ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
187ID_PREVIEW = _core_.ID_PREVIEW
188ID_ABOUT = _core_.ID_ABOUT
189ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
190ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
191ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
192ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
193ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
194ID_PREFERENCES = _core_.ID_PREFERENCES
195ID_CUT = _core_.ID_CUT
196ID_COPY = _core_.ID_COPY
197ID_PASTE = _core_.ID_PASTE
198ID_CLEAR = _core_.ID_CLEAR
199ID_FIND = _core_.ID_FIND
200ID_DUPLICATE = _core_.ID_DUPLICATE
201ID_SELECTALL = _core_.ID_SELECTALL
202ID_DELETE = _core_.ID_DELETE
203ID_REPLACE = _core_.ID_REPLACE
204ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
205ID_PROPERTIES = _core_.ID_PROPERTIES
206ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
207ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
208ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
209ID_VIEW_LIST = _core_.ID_VIEW_LIST
210ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
211ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
212ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
213ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
214ID_FILE1 = _core_.ID_FILE1
215ID_FILE2 = _core_.ID_FILE2
216ID_FILE3 = _core_.ID_FILE3
217ID_FILE4 = _core_.ID_FILE4
218ID_FILE5 = _core_.ID_FILE5
219ID_FILE6 = _core_.ID_FILE6
220ID_FILE7 = _core_.ID_FILE7
221ID_FILE8 = _core_.ID_FILE8
222ID_FILE9 = _core_.ID_FILE9
223ID_OK = _core_.ID_OK
224ID_CANCEL = _core_.ID_CANCEL
225ID_APPLY = _core_.ID_APPLY
226ID_YES = _core_.ID_YES
227ID_NO = _core_.ID_NO
228ID_STATIC = _core_.ID_STATIC
229ID_FORWARD = _core_.ID_FORWARD
230ID_BACKWARD = _core_.ID_BACKWARD
231ID_DEFAULT = _core_.ID_DEFAULT
232ID_MORE = _core_.ID_MORE
233ID_SETUP = _core_.ID_SETUP
234ID_RESET = _core_.ID_RESET
235ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
236ID_YESTOALL = _core_.ID_YESTOALL
237ID_NOTOALL = _core_.ID_NOTOALL
238ID_ABORT = _core_.ID_ABORT
239ID_RETRY = _core_.ID_RETRY
240ID_IGNORE = _core_.ID_IGNORE
241ID_ADD = _core_.ID_ADD
242ID_REMOVE = _core_.ID_REMOVE
243ID_UP = _core_.ID_UP
244ID_DOWN = _core_.ID_DOWN
245ID_HOME = _core_.ID_HOME
246ID_REFRESH = _core_.ID_REFRESH
247ID_STOP = _core_.ID_STOP
248ID_INDEX = _core_.ID_INDEX
249ID_BOLD = _core_.ID_BOLD
250ID_ITALIC = _core_.ID_ITALIC
251ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
252ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
253ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
254ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
255ID_UNDERLINE = _core_.ID_UNDERLINE
256ID_INDENT = _core_.ID_INDENT
257ID_UNINDENT = _core_.ID_UNINDENT
258ID_ZOOM_100 = _core_.ID_ZOOM_100
259ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
260ID_ZOOM_IN = _core_.ID_ZOOM_IN
261ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
262ID_UNDELETE = _core_.ID_UNDELETE
263ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
264ID_HIGHEST = _core_.ID_HIGHEST
265OPEN = _core_.OPEN
266SAVE = _core_.SAVE
267HIDE_READONLY = _core_.HIDE_READONLY
268OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
269FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
270MULTIPLE = _core_.MULTIPLE
271CHANGE_DIR = _core_.CHANGE_DIR
272ACCEL_ALT = _core_.ACCEL_ALT
273ACCEL_CTRL = _core_.ACCEL_CTRL
274ACCEL_SHIFT = _core_.ACCEL_SHIFT
275ACCEL_NORMAL = _core_.ACCEL_NORMAL
276PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
277PD_APP_MODAL = _core_.PD_APP_MODAL
278PD_CAN_ABORT = _core_.PD_CAN_ABORT
279PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
280PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
281PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
282PD_SMOOTH = _core_.PD_SMOOTH
283PD_CAN_SKIP = _core_.PD_CAN_SKIP
284DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
285DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
286MENU_TEAROFF = _core_.MENU_TEAROFF
287MB_DOCKABLE = _core_.MB_DOCKABLE
288NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
289FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
290LI_HORIZONTAL = _core_.LI_HORIZONTAL
291LI_VERTICAL = _core_.LI_VERTICAL
292WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
293WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
294WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
295WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
296WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
297WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
298MM_TEXT = _core_.MM_TEXT
299MM_LOMETRIC = _core_.MM_LOMETRIC
300MM_HIMETRIC = _core_.MM_HIMETRIC
301MM_LOENGLISH = _core_.MM_LOENGLISH
302MM_HIENGLISH = _core_.MM_HIENGLISH
303MM_TWIPS = _core_.MM_TWIPS
304MM_ISOTROPIC = _core_.MM_ISOTROPIC
305MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
306MM_POINTS = _core_.MM_POINTS
307MM_METRIC = _core_.MM_METRIC
308CENTRE = _core_.CENTRE
309CENTER = _core_.CENTER
310HORIZONTAL = _core_.HORIZONTAL
311VERTICAL = _core_.VERTICAL
312BOTH = _core_.BOTH
313LEFT = _core_.LEFT
314RIGHT = _core_.RIGHT
315UP = _core_.UP
316DOWN = _core_.DOWN
317TOP = _core_.TOP
318BOTTOM = _core_.BOTTOM
319NORTH = _core_.NORTH
320SOUTH = _core_.SOUTH
321WEST = _core_.WEST
322EAST = _core_.EAST
323ALL = _core_.ALL
324ALIGN_NOT = _core_.ALIGN_NOT
325ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
326ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
327ALIGN_LEFT = _core_.ALIGN_LEFT
328ALIGN_TOP = _core_.ALIGN_TOP
329ALIGN_RIGHT = _core_.ALIGN_RIGHT
330ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
331ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
332ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
333ALIGN_CENTER = _core_.ALIGN_CENTER
334ALIGN_CENTRE = _core_.ALIGN_CENTRE
335ALIGN_MASK = _core_.ALIGN_MASK
336STRETCH_NOT = _core_.STRETCH_NOT
337SHRINK = _core_.SHRINK
338GROW = _core_.GROW
339EXPAND = _core_.EXPAND
340SHAPED = _core_.SHAPED
341FIXED_MINSIZE = _core_.FIXED_MINSIZE
342TILE = _core_.TILE
343ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
344BORDER_DEFAULT = _core_.BORDER_DEFAULT
345BORDER_NONE = _core_.BORDER_NONE
346BORDER_STATIC = _core_.BORDER_STATIC
347BORDER_SIMPLE = _core_.BORDER_SIMPLE
348BORDER_RAISED = _core_.BORDER_RAISED
349BORDER_SUNKEN = _core_.BORDER_SUNKEN
350BORDER_DOUBLE = _core_.BORDER_DOUBLE
351BORDER_MASK = _core_.BORDER_MASK
352BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
353BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
354BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
355DEFAULT = _core_.DEFAULT
356DECORATIVE = _core_.DECORATIVE
357ROMAN = _core_.ROMAN
358SCRIPT = _core_.SCRIPT
359SWISS = _core_.SWISS
360MODERN = _core_.MODERN
361TELETYPE = _core_.TELETYPE
362VARIABLE = _core_.VARIABLE
363FIXED = _core_.FIXED
364NORMAL = _core_.NORMAL
365LIGHT = _core_.LIGHT
366BOLD = _core_.BOLD
367ITALIC = _core_.ITALIC
368SLANT = _core_.SLANT
369SOLID = _core_.SOLID
370DOT = _core_.DOT
371LONG_DASH = _core_.LONG_DASH
372SHORT_DASH = _core_.SHORT_DASH
373DOT_DASH = _core_.DOT_DASH
374USER_DASH = _core_.USER_DASH
375TRANSPARENT = _core_.TRANSPARENT
376STIPPLE = _core_.STIPPLE
d04418a7
RD
377STIPPLE_MASK = _core_.STIPPLE_MASK
378STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
5b5c9bc7
RD
379BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
380CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
381FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
382CROSS_HATCH = _core_.CROSS_HATCH
383HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
384VERTICAL_HATCH = _core_.VERTICAL_HATCH
385JOIN_BEVEL = _core_.JOIN_BEVEL
386JOIN_MITER = _core_.JOIN_MITER
387JOIN_ROUND = _core_.JOIN_ROUND
388CAP_ROUND = _core_.CAP_ROUND
389CAP_PROJECTING = _core_.CAP_PROJECTING
390CAP_BUTT = _core_.CAP_BUTT
391CLEAR = _core_.CLEAR
392XOR = _core_.XOR
393INVERT = _core_.INVERT
394OR_REVERSE = _core_.OR_REVERSE
395AND_REVERSE = _core_.AND_REVERSE
396COPY = _core_.COPY
397AND = _core_.AND
398AND_INVERT = _core_.AND_INVERT
399NO_OP = _core_.NO_OP
400NOR = _core_.NOR
401EQUIV = _core_.EQUIV
402SRC_INVERT = _core_.SRC_INVERT
403OR_INVERT = _core_.OR_INVERT
404NAND = _core_.NAND
405OR = _core_.OR
406SET = _core_.SET
407WXK_BACK = _core_.WXK_BACK
408WXK_TAB = _core_.WXK_TAB
409WXK_RETURN = _core_.WXK_RETURN
410WXK_ESCAPE = _core_.WXK_ESCAPE
411WXK_SPACE = _core_.WXK_SPACE
412WXK_DELETE = _core_.WXK_DELETE
413WXK_START = _core_.WXK_START
414WXK_LBUTTON = _core_.WXK_LBUTTON
415WXK_RBUTTON = _core_.WXK_RBUTTON
416WXK_CANCEL = _core_.WXK_CANCEL
417WXK_MBUTTON = _core_.WXK_MBUTTON
418WXK_CLEAR = _core_.WXK_CLEAR
419WXK_SHIFT = _core_.WXK_SHIFT
420WXK_ALT = _core_.WXK_ALT
421WXK_CONTROL = _core_.WXK_CONTROL
422WXK_MENU = _core_.WXK_MENU
423WXK_PAUSE = _core_.WXK_PAUSE
424WXK_CAPITAL = _core_.WXK_CAPITAL
425WXK_PRIOR = _core_.WXK_PRIOR
426WXK_NEXT = _core_.WXK_NEXT
427WXK_END = _core_.WXK_END
428WXK_HOME = _core_.WXK_HOME
429WXK_LEFT = _core_.WXK_LEFT
430WXK_UP = _core_.WXK_UP
431WXK_RIGHT = _core_.WXK_RIGHT
432WXK_DOWN = _core_.WXK_DOWN
433WXK_SELECT = _core_.WXK_SELECT
434WXK_PRINT = _core_.WXK_PRINT
435WXK_EXECUTE = _core_.WXK_EXECUTE
436WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
437WXK_INSERT = _core_.WXK_INSERT
438WXK_HELP = _core_.WXK_HELP
439WXK_NUMPAD0 = _core_.WXK_NUMPAD0
440WXK_NUMPAD1 = _core_.WXK_NUMPAD1
441WXK_NUMPAD2 = _core_.WXK_NUMPAD2
442WXK_NUMPAD3 = _core_.WXK_NUMPAD3
443WXK_NUMPAD4 = _core_.WXK_NUMPAD4
444WXK_NUMPAD5 = _core_.WXK_NUMPAD5
445WXK_NUMPAD6 = _core_.WXK_NUMPAD6
446WXK_NUMPAD7 = _core_.WXK_NUMPAD7
447WXK_NUMPAD8 = _core_.WXK_NUMPAD8
448WXK_NUMPAD9 = _core_.WXK_NUMPAD9
449WXK_MULTIPLY = _core_.WXK_MULTIPLY
450WXK_ADD = _core_.WXK_ADD
451WXK_SEPARATOR = _core_.WXK_SEPARATOR
452WXK_SUBTRACT = _core_.WXK_SUBTRACT
453WXK_DECIMAL = _core_.WXK_DECIMAL
454WXK_DIVIDE = _core_.WXK_DIVIDE
455WXK_F1 = _core_.WXK_F1
456WXK_F2 = _core_.WXK_F2
457WXK_F3 = _core_.WXK_F3
458WXK_F4 = _core_.WXK_F4
459WXK_F5 = _core_.WXK_F5
460WXK_F6 = _core_.WXK_F6
461WXK_F7 = _core_.WXK_F7
462WXK_F8 = _core_.WXK_F8
463WXK_F9 = _core_.WXK_F9
464WXK_F10 = _core_.WXK_F10
465WXK_F11 = _core_.WXK_F11
466WXK_F12 = _core_.WXK_F12
467WXK_F13 = _core_.WXK_F13
468WXK_F14 = _core_.WXK_F14
469WXK_F15 = _core_.WXK_F15
470WXK_F16 = _core_.WXK_F16
471WXK_F17 = _core_.WXK_F17
472WXK_F18 = _core_.WXK_F18
473WXK_F19 = _core_.WXK_F19
474WXK_F20 = _core_.WXK_F20
475WXK_F21 = _core_.WXK_F21
476WXK_F22 = _core_.WXK_F22
477WXK_F23 = _core_.WXK_F23
478WXK_F24 = _core_.WXK_F24
479WXK_NUMLOCK = _core_.WXK_NUMLOCK
480WXK_SCROLL = _core_.WXK_SCROLL
481WXK_PAGEUP = _core_.WXK_PAGEUP
482WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
483WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
484WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
485WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
486WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
487WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
488WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
489WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
490WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
491WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
492WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
493WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
494WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
495WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
496WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
497WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
498WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
499WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
500WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
501WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
502WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
503WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
504WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
505WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
506WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
507WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
508WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
509WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
510WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
511WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
512WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
513WXK_COMMAND = _core_.WXK_COMMAND
514WXK_SPECIAL1 = _core_.WXK_SPECIAL1
515WXK_SPECIAL2 = _core_.WXK_SPECIAL2
516WXK_SPECIAL3 = _core_.WXK_SPECIAL3
517WXK_SPECIAL4 = _core_.WXK_SPECIAL4
518WXK_SPECIAL5 = _core_.WXK_SPECIAL5
519WXK_SPECIAL6 = _core_.WXK_SPECIAL6
520WXK_SPECIAL7 = _core_.WXK_SPECIAL7
521WXK_SPECIAL8 = _core_.WXK_SPECIAL8
522WXK_SPECIAL9 = _core_.WXK_SPECIAL9
523WXK_SPECIAL10 = _core_.WXK_SPECIAL10
524WXK_SPECIAL11 = _core_.WXK_SPECIAL11
525WXK_SPECIAL12 = _core_.WXK_SPECIAL12
526WXK_SPECIAL13 = _core_.WXK_SPECIAL13
527WXK_SPECIAL14 = _core_.WXK_SPECIAL14
528WXK_SPECIAL15 = _core_.WXK_SPECIAL15
529WXK_SPECIAL16 = _core_.WXK_SPECIAL16
530WXK_SPECIAL17 = _core_.WXK_SPECIAL17
531WXK_SPECIAL18 = _core_.WXK_SPECIAL18
532WXK_SPECIAL19 = _core_.WXK_SPECIAL19
533WXK_SPECIAL20 = _core_.WXK_SPECIAL20
534PAPER_NONE = _core_.PAPER_NONE
535PAPER_LETTER = _core_.PAPER_LETTER
536PAPER_LEGAL = _core_.PAPER_LEGAL
537PAPER_A4 = _core_.PAPER_A4
538PAPER_CSHEET = _core_.PAPER_CSHEET
539PAPER_DSHEET = _core_.PAPER_DSHEET
540PAPER_ESHEET = _core_.PAPER_ESHEET
541PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
542PAPER_TABLOID = _core_.PAPER_TABLOID
543PAPER_LEDGER = _core_.PAPER_LEDGER
544PAPER_STATEMENT = _core_.PAPER_STATEMENT
545PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
546PAPER_A3 = _core_.PAPER_A3
547PAPER_A4SMALL = _core_.PAPER_A4SMALL
548PAPER_A5 = _core_.PAPER_A5
549PAPER_B4 = _core_.PAPER_B4
550PAPER_B5 = _core_.PAPER_B5
551PAPER_FOLIO = _core_.PAPER_FOLIO
552PAPER_QUARTO = _core_.PAPER_QUARTO
553PAPER_10X14 = _core_.PAPER_10X14
554PAPER_11X17 = _core_.PAPER_11X17
555PAPER_NOTE = _core_.PAPER_NOTE
556PAPER_ENV_9 = _core_.PAPER_ENV_9
557PAPER_ENV_10 = _core_.PAPER_ENV_10
558PAPER_ENV_11 = _core_.PAPER_ENV_11
559PAPER_ENV_12 = _core_.PAPER_ENV_12
560PAPER_ENV_14 = _core_.PAPER_ENV_14
561PAPER_ENV_DL = _core_.PAPER_ENV_DL
562PAPER_ENV_C5 = _core_.PAPER_ENV_C5
563PAPER_ENV_C3 = _core_.PAPER_ENV_C3
564PAPER_ENV_C4 = _core_.PAPER_ENV_C4
565PAPER_ENV_C6 = _core_.PAPER_ENV_C6
566PAPER_ENV_C65 = _core_.PAPER_ENV_C65
567PAPER_ENV_B4 = _core_.PAPER_ENV_B4
568PAPER_ENV_B5 = _core_.PAPER_ENV_B5
569PAPER_ENV_B6 = _core_.PAPER_ENV_B6
570PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
571PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
572PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
573PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
574PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
575PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
576PAPER_ISO_B4 = _core_.PAPER_ISO_B4
577PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
578PAPER_9X11 = _core_.PAPER_9X11
579PAPER_10X11 = _core_.PAPER_10X11
580PAPER_15X11 = _core_.PAPER_15X11
581PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
582PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
583PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
584PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
585PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
586PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
587PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
588PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
589PAPER_A_PLUS = _core_.PAPER_A_PLUS
590PAPER_B_PLUS = _core_.PAPER_B_PLUS
591PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
592PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
593PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
594PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
595PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
596PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
597PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
598PAPER_A2 = _core_.PAPER_A2
599PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
600PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
601PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
602PAPER_A6 = _core_.PAPER_A6
603PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
604PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
605PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
606PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
607PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
608PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
609PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
610PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
611PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
612PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
613PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
614PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
615PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
616PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
617PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
618PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
619PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
620PAPER_B6_JIS = _core_.PAPER_B6_JIS
621PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
622PAPER_12X11 = _core_.PAPER_12X11
623PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
624PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
625PAPER_P16K = _core_.PAPER_P16K
626PAPER_P32K = _core_.PAPER_P32K
627PAPER_P32KBIG = _core_.PAPER_P32KBIG
628PAPER_PENV_1 = _core_.PAPER_PENV_1
629PAPER_PENV_2 = _core_.PAPER_PENV_2
630PAPER_PENV_3 = _core_.PAPER_PENV_3
631PAPER_PENV_4 = _core_.PAPER_PENV_4
632PAPER_PENV_5 = _core_.PAPER_PENV_5
633PAPER_PENV_6 = _core_.PAPER_PENV_6
634PAPER_PENV_7 = _core_.PAPER_PENV_7
635PAPER_PENV_8 = _core_.PAPER_PENV_8
636PAPER_PENV_9 = _core_.PAPER_PENV_9
637PAPER_PENV_10 = _core_.PAPER_PENV_10
638PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
639PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
640PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
641PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
642PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
643PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
644PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
645PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
646PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
647PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
648PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
649PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
650PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
5b5c9bc7
RD
651DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
652DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
653DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
654ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
655ITEM_NORMAL = _core_.ITEM_NORMAL
656ITEM_CHECK = _core_.ITEM_CHECK
657ITEM_RADIO = _core_.ITEM_RADIO
658ITEM_MAX = _core_.ITEM_MAX
659HT_NOWHERE = _core_.HT_NOWHERE
660HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
661HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
662HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
663HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
664HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
665HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
666HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
667HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
668HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
669HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
670HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
671HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
672HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
673HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
674HT_MAX = _core_.HT_MAX
675MOD_NONE = _core_.MOD_NONE
676MOD_ALT = _core_.MOD_ALT
677MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 678MOD_ALTGR = _core_.MOD_ALTGR
5b5c9bc7 679MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 680MOD_META = _core_.MOD_META
5b5c9bc7 681MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
682MOD_CMD = _core_.MOD_CMD
683MOD_ALL = _core_.MOD_ALL
5b5c9bc7
RD
684UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
685UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
686UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d55e5bfc
RD
687#---------------------------------------------------------------------------
688
5b5c9bc7 689class Object(object):
d55e5bfc
RD
690 """
691 The base class for most wx objects, although in wxPython not
692 much functionality is needed nor exposed.
693 """
694 def __init__(self): raise RuntimeError, "No constructor defined"
695 def __repr__(self):
696 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
697 def GetClassName(*args, **kwargs):
698 """
5b5c9bc7 699 GetClassName(self) -> String
d55e5bfc
RD
700
701 Returns the class name of the C++ class using wxRTTI.
702 """
5b5c9bc7 703 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
704
705 def Destroy(*args, **kwargs):
706 """
707 Destroy(self)
708
709 Deletes the C++ object this Python object is a proxy for.
710 """
5b5c9bc7 711 return _core_.Object_Destroy(*args, **kwargs)
d55e5bfc
RD
712
713
5b5c9bc7 714class ObjectPtr(Object):
d55e5bfc
RD
715 def __init__(self, this):
716 self.this = this
717 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
718 self.__class__ = Object
719_core_.Object_swigregister(ObjectPtr)
720_wxPySetDictionary = _core_._wxPySetDictionary
d55e5bfc 721
5b5c9bc7 722_wxPyFixStockObjects = _core_._wxPyFixStockObjects
d55e5bfc 723
5b5c9bc7 724cvar = _core_.cvar
d55e5bfc
RD
725EmptyString = cvar.EmptyString
726
727#---------------------------------------------------------------------------
728
5b5c9bc7
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
d55e5bfc
RD
780#---------------------------------------------------------------------------
781
5b5c9bc7 782class Size(object):
d55e5bfc 783 """
15817c7e 784 wx.Size is a useful data structure used to represent the size of
36ed4f51
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.
d55e5bfc
RD
788 """
789 def __repr__(self):
790 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
791 width = property(_core_.Size_width_get, _core_.Size_width_set)
792 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc
RD
793 x = width; y = height
794 def __init__(self, *args, **kwargs):
795 """
5b5c9bc7 796 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
797
798 Creates a size object.
799 """
5b5c9bc7 800 newobj = _core_.new_Size(*args, **kwargs)
d55e5bfc
RD
801 self.this = newobj.this
802 self.thisown = 1
803 del newobj.thisown
5b5c9bc7 804 def __del__(self, destroy=_core_.delete_Size):
d55e5bfc
RD
805 """__del__(self)"""
806 try:
807 if self.thisown: destroy(self)
808 except: pass
809
810 def __eq__(*args, **kwargs):
811 """
5b5c9bc7 812 __eq__(self, Size sz) -> bool
d55e5bfc
RD
813
814 Test for equality of wx.Size objects.
815 """
5b5c9bc7 816 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
817
818 def __ne__(*args, **kwargs):
819 """
5b5c9bc7 820 __ne__(self, Size sz) -> bool
d55e5bfc
RD
821
822 Test for inequality.
823 """
5b5c9bc7 824 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
825
826 def __add__(*args, **kwargs):
827 """
5b5c9bc7 828 __add__(self, Size sz) -> Size
d55e5bfc
RD
829
830 Add sz's proprties to this and return the result.
831 """
5b5c9bc7 832 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
833
834 def __sub__(*args, **kwargs):
835 """
5b5c9bc7 836 __sub__(self, Size sz) -> Size
d55e5bfc
RD
837
838 Subtract sz's properties from this and return the result.
839 """
5b5c9bc7 840 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
841
842 def IncTo(*args, **kwargs):
843 """
5b5c9bc7 844 IncTo(self, Size sz)
d55e5bfc
RD
845
846 Increments this object so that both of its dimensions are not less
847 than the corresponding dimensions of the size.
848 """
5b5c9bc7 849 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
850
851 def DecTo(*args, **kwargs):
852 """
5b5c9bc7 853 DecTo(self, Size sz)
d55e5bfc
RD
854
855 Decrements this object so that both of its dimensions are not greater
856 than the corresponding dimensions of the size.
857 """
5b5c9bc7 858 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc
RD
859
860 def Set(*args, **kwargs):
861 """
862 Set(self, int w, int h)
863
864 Set both width and height.
865 """
5b5c9bc7 866 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
867
868 def SetWidth(*args, **kwargs):
869 """SetWidth(self, int w)"""
5b5c9bc7 870 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
871
872 def SetHeight(*args, **kwargs):
873 """SetHeight(self, int h)"""
5b5c9bc7 874 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
875
876 def GetWidth(*args, **kwargs):
877 """GetWidth(self) -> int"""
5b5c9bc7 878 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
879
880 def GetHeight(*args, **kwargs):
881 """GetHeight(self) -> int"""
5b5c9bc7 882 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
883
884 def IsFullySpecified(*args, **kwargs):
885 """
886 IsFullySpecified(self) -> bool
887
888 Returns True if both components of the size are non-default values.
889 """
5b5c9bc7 890 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
891
892 def SetDefaults(*args, **kwargs):
893 """
5b5c9bc7 894 SetDefaults(self, Size size)
d55e5bfc 895
15817c7e
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.
d55e5bfc 898 """
5b5c9bc7 899 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
900
901 def Get(*args, **kwargs):
902 """
903 Get() -> (width,height)
904
905 Returns the width and height properties as a tuple.
906 """
5b5c9bc7 907 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 908
15817c7e 909 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
914 def __setitem__(self, index, val):
915 if index == 0: self.width = val
916 elif index == 1: self.height = val
917 else: raise IndexError
918 def __nonzero__(self): return self.Get() != (0,0)
919 __safe_for_unpickling__ = True
920 def __reduce__(self): return (wx.Size, self.Get())
921
922
5b5c9bc7 923class SizePtr(Size):
d55e5bfc
RD
924 def __init__(self, this):
925 self.this = this
926 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
927 self.__class__ = Size
928_core_.Size_swigregister(SizePtr)
d55e5bfc
RD
929
930#---------------------------------------------------------------------------
931
5b5c9bc7 932class RealPoint(object):
d55e5bfc 933 """
15817c7e
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.
d55e5bfc
RD
937 """
938 def __repr__(self):
939 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
940 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
941 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
d55e5bfc
RD
942 def __init__(self, *args, **kwargs):
943 """
5b5c9bc7 944 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
945
946 Create a wx.RealPoint object
947 """
5b5c9bc7 948 newobj = _core_.new_RealPoint(*args, **kwargs)
d55e5bfc
RD
949 self.this = newobj.this
950 self.thisown = 1
951 del newobj.thisown
5b5c9bc7 952 def __del__(self, destroy=_core_.delete_RealPoint):
d55e5bfc
RD
953 """__del__(self)"""
954 try:
955 if self.thisown: destroy(self)
956 except: pass
957
958 def __eq__(*args, **kwargs):
959 """
5b5c9bc7 960 __eq__(self, RealPoint pt) -> bool
d55e5bfc
RD
961
962 Test for equality of wx.RealPoint objects.
963 """
5b5c9bc7 964 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
965
966 def __ne__(*args, **kwargs):
967 """
5b5c9bc7 968 __ne__(self, RealPoint pt) -> bool
d55e5bfc
RD
969
970 Test for inequality of wx.RealPoint objects.
971 """
5b5c9bc7 972 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
973
974 def __add__(*args, **kwargs):
975 """
5b5c9bc7 976 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
977
978 Add pt's proprties to this and return the result.
979 """
5b5c9bc7 980 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
981
982 def __sub__(*args, **kwargs):
983 """
5b5c9bc7 984 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
985
986 Subtract pt's proprties from this and return the result
987 """
5b5c9bc7 988 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
989
990 def Set(*args, **kwargs):
991 """
992 Set(self, double x, double y)
993
994 Set both the x and y properties
995 """
5b5c9bc7 996 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
997
998 def Get(*args, **kwargs):
999 """
1000 Get() -> (x,y)
1001
1002 Return the x and y properties as a tuple.
1003 """
5b5c9bc7 1004 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 1005
15817c7e 1006 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
1011 def __setitem__(self, index, val):
1012 if index == 0: self.x = val
1013 elif index == 1: self.y = val
1014 else: raise IndexError
1015 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1016 __safe_for_unpickling__ = True
1017 def __reduce__(self): return (wx.RealPoint, self.Get())
1018
1019
5b5c9bc7 1020class RealPointPtr(RealPoint):
d55e5bfc
RD
1021 def __init__(self, this):
1022 self.this = this
1023 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1024 self.__class__ = RealPoint
1025_core_.RealPoint_swigregister(RealPointPtr)
d55e5bfc
RD
1026
1027#---------------------------------------------------------------------------
1028
5b5c9bc7 1029class Point(object):
d55e5bfc 1030 """
15817c7e
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.
d55e5bfc
RD
1034 """
1035 def __repr__(self):
1036 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
1037 x = property(_core_.Point_x_get, _core_.Point_x_set)
1038 y = property(_core_.Point_y_get, _core_.Point_y_set)
d55e5bfc
RD
1039 def __init__(self, *args, **kwargs):
1040 """
5b5c9bc7 1041 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
1042
1043 Create a wx.Point object
1044 """
5b5c9bc7 1045 newobj = _core_.new_Point(*args, **kwargs)
d55e5bfc
RD
1046 self.this = newobj.this
1047 self.thisown = 1
1048 del newobj.thisown
5b5c9bc7 1049 def __del__(self, destroy=_core_.delete_Point):
d55e5bfc
RD
1050 """__del__(self)"""
1051 try:
1052 if self.thisown: destroy(self)
1053 except: pass
1054
1055 def __eq__(*args, **kwargs):
1056 """
5b5c9bc7 1057 __eq__(self, Point pt) -> bool
d55e5bfc
RD
1058
1059 Test for equality of wx.Point objects.
1060 """
5b5c9bc7 1061 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1062
1063 def __ne__(*args, **kwargs):
1064 """
5b5c9bc7 1065 __ne__(self, Point pt) -> bool
d55e5bfc
RD
1066
1067 Test for inequality of wx.Point objects.
1068 """
5b5c9bc7 1069 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1070
1071 def __add__(*args, **kwargs):
1072 """
5b5c9bc7 1073 __add__(self, Point pt) -> Point
d55e5bfc
RD
1074
1075 Add pt's proprties to this and return the result.
1076 """
5b5c9bc7 1077 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1078
1079 def __sub__(*args, **kwargs):
1080 """
5b5c9bc7 1081 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1082
1083 Subtract pt's proprties from this and return the result
1084 """
5b5c9bc7 1085 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1086
1087 def __iadd__(*args, **kwargs):
1088 """
5b5c9bc7 1089 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1090
1091 Add pt to this object.
1092 """
5b5c9bc7 1093 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1094
1095 def __isub__(*args, **kwargs):
1096 """
5b5c9bc7 1097 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1098
1099 Subtract pt from this object.
1100 """
5b5c9bc7 1101 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1102
1103 def Set(*args, **kwargs):
1104 """
1105 Set(self, long x, long y)
1106
1107 Set both the x and y properties
1108 """
5b5c9bc7 1109 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1110
1111 def Get(*args, **kwargs):
1112 """
1113 Get() -> (x,y)
1114
1115 Return the x and y properties as a tuple.
1116 """
5b5c9bc7 1117 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1118
15817c7e 1119 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
1124 def __setitem__(self, index, val):
1125 if index == 0: self.x = val
1126 elif index == 1: self.y = val
1127 else: raise IndexError
1128 def __nonzero__(self): return self.Get() != (0,0)
1129 __safe_for_unpickling__ = True
1130 def __reduce__(self): return (wx.Point, self.Get())
1131
1132
5b5c9bc7 1133class PointPtr(Point):
d55e5bfc
RD
1134 def __init__(self, this):
1135 self.this = this
1136 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1137 self.__class__ = Point
1138_core_.Point_swigregister(PointPtr)
d55e5bfc
RD
1139
1140#---------------------------------------------------------------------------
1141
5b5c9bc7 1142class Rect(object):
d55e5bfc 1143 """
15817c7e
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.
d55e5bfc
RD
1147 """
1148 def __repr__(self):
1149 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1150 def __init__(self, *args, **kwargs):
1151 """
5b5c9bc7 1152 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1153
1154 Create a new Rect object.
1155 """
5b5c9bc7 1156 newobj = _core_.new_Rect(*args, **kwargs)
d55e5bfc
RD
1157 self.this = newobj.this
1158 self.thisown = 1
1159 del newobj.thisown
5b5c9bc7 1160 def __del__(self, destroy=_core_.delete_Rect):
d55e5bfc
RD
1161 """__del__(self)"""
1162 try:
1163 if self.thisown: destroy(self)
1164 except: pass
1165
1166 def GetX(*args, **kwargs):
1167 """GetX(self) -> int"""
5b5c9bc7 1168 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1169
1170 def SetX(*args, **kwargs):
1171 """SetX(self, int x)"""
5b5c9bc7 1172 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1173
1174 def GetY(*args, **kwargs):
1175 """GetY(self) -> int"""
5b5c9bc7 1176 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1177
1178 def SetY(*args, **kwargs):
1179 """SetY(self, int y)"""
5b5c9bc7 1180 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1181
1182 def GetWidth(*args, **kwargs):
1183 """GetWidth(self) -> int"""
5b5c9bc7 1184 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1185
1186 def SetWidth(*args, **kwargs):
1187 """SetWidth(self, int w)"""
5b5c9bc7 1188 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1189
1190 def GetHeight(*args, **kwargs):
1191 """GetHeight(self) -> int"""
5b5c9bc7 1192 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1193
1194 def SetHeight(*args, **kwargs):
1195 """SetHeight(self, int h)"""
5b5c9bc7 1196 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1197
1198 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1199 """GetPosition(self) -> Point"""
1200 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1201
1202 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1203 """SetPosition(self, Point p)"""
1204 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1205
1206 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1207 """GetSize(self) -> Size"""
1208 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1209
1210 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1211 """SetSize(self, Size s)"""
1212 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1213
aff4cc5c
RD
1214 def IsEmpty(*args, **kwargs):
1215 """IsEmpty(self) -> bool"""
5b5c9bc7 1216 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1217
d55e5bfc 1218 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1219 """GetTopLeft(self) -> Point"""
1220 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1221
1222 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1223 """SetTopLeft(self, Point p)"""
1224 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1225
1226 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1227 """GetBottomRight(self) -> Point"""
1228 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1229
1230 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1231 """SetBottomRight(self, Point p)"""
1232 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc
RD
1233
1234 def GetLeft(*args, **kwargs):
1235 """GetLeft(self) -> int"""
5b5c9bc7 1236 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1237
1238 def GetTop(*args, **kwargs):
1239 """GetTop(self) -> int"""
5b5c9bc7 1240 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1241
1242 def GetBottom(*args, **kwargs):
1243 """GetBottom(self) -> int"""
5b5c9bc7 1244 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1245
1246 def GetRight(*args, **kwargs):
1247 """GetRight(self) -> int"""
5b5c9bc7 1248 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1249
1250 def SetLeft(*args, **kwargs):
1251 """SetLeft(self, int left)"""
5b5c9bc7 1252 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1253
1254 def SetRight(*args, **kwargs):
1255 """SetRight(self, int right)"""
5b5c9bc7 1256 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1257
1258 def SetTop(*args, **kwargs):
1259 """SetTop(self, int top)"""
5b5c9bc7 1260 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1261
1262 def SetBottom(*args, **kwargs):
1263 """SetBottom(self, int bottom)"""
5b5c9bc7 1264 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
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):
1274 """
5b5c9bc7 1275 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1276
091fdbfa
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
d55e5bfc 1295 """
5b5c9bc7 1296 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1297
1298 def Deflate(*args, **kwargs):
1299 """
5b5c9bc7 1300 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1301
091fdbfa
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.
d55e5bfc 1305 """
5b5c9bc7 1306 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1307
1308 def OffsetXY(*args, **kwargs):
1309 """
1310 OffsetXY(self, int dx, int dy)
1311
15817c7e
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.
d55e5bfc 1315 """
5b5c9bc7 1316 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1317
1318 def Offset(*args, **kwargs):
1319 """
5b5c9bc7 1320 Offset(self, Point pt)
d55e5bfc
RD
1321
1322 Same as OffsetXY but uses dx,dy from Point
1323 """
5b5c9bc7 1324 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1325
1326 def Intersect(*args, **kwargs):
1327 """
5b5c9bc7 1328 Intersect(self, Rect rect) -> Rect
d55e5bfc 1329
5cbf236d 1330 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1331 """
5b5c9bc7 1332 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1333
5cbf236d
RD
1334 def Union(*args, **kwargs):
1335 """
5b5c9bc7 1336 Union(self, Rect rect) -> Rect
5cbf236d
RD
1337
1338 Returns the union of this rectangle and rect.
1339 """
5b5c9bc7 1340 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1341
d55e5bfc
RD
1342 def __add__(*args, **kwargs):
1343 """
5b5c9bc7 1344 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1345
1346 Add the properties of rect to this rectangle and return the result.
1347 """
5b5c9bc7 1348 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1349
1350 def __iadd__(*args, **kwargs):
1351 """
5b5c9bc7 1352 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1353
1354 Add the properties of rect to this rectangle, updating this rectangle.
1355 """
5b5c9bc7 1356 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1357
1358 def __eq__(*args, **kwargs):
1359 """
5b5c9bc7 1360 __eq__(self, Rect rect) -> bool
d55e5bfc
RD
1361
1362 Test for equality.
1363 """
5b5c9bc7 1364 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1365
1366 def __ne__(*args, **kwargs):
1367 """
5b5c9bc7 1368 __ne__(self, Rect rect) -> bool
d55e5bfc
RD
1369
1370 Test for inequality.
1371 """
5b5c9bc7 1372 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc
RD
1373
1374 def InsideXY(*args, **kwargs):
1375 """
1376 InsideXY(self, int x, int y) -> bool
1377
1378 Return True if the point is (not strcitly) inside the rect.
1379 """
5b5c9bc7 1380 return _core_.Rect_InsideXY(*args, **kwargs)
d55e5bfc
RD
1381
1382 def Inside(*args, **kwargs):
1383 """
5b5c9bc7 1384 Inside(self, Point pt) -> bool
d55e5bfc
RD
1385
1386 Return True if the point is (not strcitly) inside the rect.
1387 """
5b5c9bc7 1388 return _core_.Rect_Inside(*args, **kwargs)
d55e5bfc
RD
1389
1390 def Intersects(*args, **kwargs):
1391 """
5b5c9bc7 1392 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1393
1394 Returns True if the rectangles have a non empty intersection.
1395 """
5b5c9bc7 1396 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1397
5b5c9bc7
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)
d55e5bfc
RD
1402 def Set(*args, **kwargs):
1403 """
1404 Set(self, int x=0, int y=0, int width=0, int height=0)
1405
1406 Set all rectangle properties.
1407 """
5b5c9bc7 1408 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1409
1410 def Get(*args, **kwargs):
1411 """
1412 Get() -> (x,y,width,height)
1413
1414 Return the rectangle properties as a tuple.
1415 """
5b5c9bc7 1416 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1417
15817c7e 1418 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
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
1429 def __nonzero__(self): return self.Get() != (0,0,0,0)
1430 __safe_for_unpickling__ = True
1431 def __reduce__(self): return (wx.Rect, self.Get())
1432
1433
5b5c9bc7 1434class RectPtr(Rect):
d55e5bfc
RD
1435 def __init__(self, this):
1436 self.this = this
1437 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1438 self.__class__ = Rect
1439_core_.Rect_swigregister(RectPtr)
d55e5bfc
RD
1440
1441def RectPP(*args, **kwargs):
1442 """
5b5c9bc7 1443 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1444
1445 Create a new Rect object from Points representing two corners.
1446 """
5b5c9bc7 1447 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1448 val.thisown = 1
1449 return val
1450
1451def RectPS(*args, **kwargs):
1452 """
5b5c9bc7 1453 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1454
1455 Create a new Rect from a position and size.
1456 """
5b5c9bc7 1457 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1458 val.thisown = 1
1459 return val
1460
070c48b4
RD
1461def RectS(*args, **kwargs):
1462 """
5b5c9bc7 1463 RectS(Size size) -> Rect
070c48b4
RD
1464
1465 Create a new Rect from a size only.
1466 """
5b5c9bc7 1467 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1468 val.thisown = 1
1469 return val
1470
d55e5bfc 1471
5b5c9bc7 1472def IntersectRect(*args, **kwargs):
d55e5bfc
RD
1473 """
1474 IntersectRect(Rect r1, Rect r2) -> Rect
1475
1476 Calculate and return the intersection of r1 and r2.
1477 """
5b5c9bc7 1478 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1479#---------------------------------------------------------------------------
1480
5b5c9bc7 1481class Point2D(object):
15817c7e
RD
1482 """
1483 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1484 with floating point values.
1485 """
d55e5bfc
RD
1486 def __repr__(self):
1487 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1488 def __init__(self, *args, **kwargs):
1489 """
5b5c9bc7 1490 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1491
1492 Create a w.Point2D object.
1493 """
5b5c9bc7 1494 newobj = _core_.new_Point2D(*args, **kwargs)
d55e5bfc
RD
1495 self.this = newobj.this
1496 self.thisown = 1
1497 del newobj.thisown
1498 def GetFloor(*args, **kwargs):
fd2dc343
RD
1499 """
1500 GetFloor() -> (x,y)
1501
1502 Convert to integer
1503 """
5b5c9bc7 1504 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1505
1506 def GetRounded(*args, **kwargs):
fd2dc343
RD
1507 """
1508 GetRounded() -> (x,y)
1509
1510 Convert to integer
1511 """
5b5c9bc7 1512 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1513
1514 def GetVectorLength(*args, **kwargs):
1515 """GetVectorLength(self) -> double"""
5b5c9bc7 1516 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1517
1518 def GetVectorAngle(*args, **kwargs):
1519 """GetVectorAngle(self) -> double"""
5b5c9bc7 1520 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1521
1522 def SetVectorLength(*args, **kwargs):
1523 """SetVectorLength(self, double length)"""
5b5c9bc7 1524 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1525
1526 def SetVectorAngle(*args, **kwargs):
1527 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1528 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1529
1530 def SetPolarCoordinates(self, angle, length):
1531 self.SetVectorLength(length)
1532 self.SetVectorAngle(angle)
1533 def Normalize(self):
1534 self.SetVectorLength(1.0)
1535
1536 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1537 """GetDistance(self, Point2D pt) -> double"""
1538 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1539
1540 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1541 """GetDistanceSquare(self, Point2D pt) -> double"""
1542 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1543
1544 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1545 """GetDotProduct(self, Point2D vec) -> double"""
1546 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1547
1548 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1549 """GetCrossProduct(self, Point2D vec) -> double"""
1550 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1551
1552 def __neg__(*args, **kwargs):
1553 """
5b5c9bc7 1554 __neg__(self) -> Point2D
d55e5bfc
RD
1555
1556 the reflection of this point
1557 """
5b5c9bc7 1558 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1559
1560 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1561 """__iadd__(self, Point2D pt) -> Point2D"""
1562 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1563
1564 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1565 """__isub__(self, Point2D pt) -> Point2D"""
1566 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1567
1568 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1569 """__imul__(self, Point2D pt) -> Point2D"""
1570 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1571
1572 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1573 """__idiv__(self, Point2D pt) -> Point2D"""
1574 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1575
1576 def __eq__(*args, **kwargs):
1577 """
5b5c9bc7 1578 __eq__(self, Point2D pt) -> bool
d55e5bfc
RD
1579
1580 Test for equality
1581 """
5b5c9bc7 1582 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1583
1584 def __ne__(*args, **kwargs):
1585 """
5b5c9bc7 1586 __ne__(self, Point2D pt) -> bool
d55e5bfc
RD
1587
1588 Test for inequality
1589 """
5b5c9bc7 1590 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1591
5b5c9bc7
RD
1592 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1593 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1594 def Set(*args, **kwargs):
1595 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1596 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1597
1598 def Get(*args, **kwargs):
1599 """
1600 Get() -> (x,y)
1601
1602 Return x and y properties as a tuple.
1603 """
5b5c9bc7 1604 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1605
15817c7e 1606 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
1611 def __setitem__(self, index, val):
1612 if index == 0: self.x = val
1613 elif index == 1: self.y = val
1614 else: raise IndexError
1615 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1616 __safe_for_unpickling__ = True
1617 def __reduce__(self): return (wx.Point2D, self.Get())
1618
1619
5b5c9bc7 1620class Point2DPtr(Point2D):
d55e5bfc
RD
1621 def __init__(self, this):
1622 self.this = this
1623 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1624 self.__class__ = Point2D
1625_core_.Point2D_swigregister(Point2DPtr)
d55e5bfc
RD
1626
1627def Point2DCopy(*args, **kwargs):
1628 """
5b5c9bc7 1629 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1630
1631 Create a w.Point2D object.
1632 """
5b5c9bc7 1633 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1634 val.thisown = 1
1635 return val
1636
1637def Point2DFromPoint(*args, **kwargs):
1638 """
5b5c9bc7 1639 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1640
1641 Create a w.Point2D object.
1642 """
5b5c9bc7 1643 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1644 val.thisown = 1
1645 return val
1646
1647#---------------------------------------------------------------------------
1648
5b5c9bc7
RD
1649FromStart = _core_.FromStart
1650FromCurrent = _core_.FromCurrent
1651FromEnd = _core_.FromEnd
d55e5bfc 1652class InputStream(object):
36ed4f51 1653 """Proxy of C++ InputStream class"""
d55e5bfc
RD
1654 def __repr__(self):
1655 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1656 def __init__(self, *args, **kwargs):
1657 """__init__(self, PyObject p) -> InputStream"""
5b5c9bc7 1658 newobj = _core_.new_InputStream(*args, **kwargs)
d55e5bfc
RD
1659 self.this = newobj.this
1660 self.thisown = 1
1661 del newobj.thisown
5b5c9bc7 1662 def __del__(self, destroy=_core_.delete_InputStream):
8fb0e70a
RD
1663 """__del__(self)"""
1664 try:
1665 if self.thisown: destroy(self)
1666 except: pass
1667
d55e5bfc
RD
1668 def close(*args, **kwargs):
1669 """close(self)"""
5b5c9bc7 1670 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1671
1672 def flush(*args, **kwargs):
1673 """flush(self)"""
5b5c9bc7 1674 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1675
1676 def eof(*args, **kwargs):
1677 """eof(self) -> bool"""
5b5c9bc7 1678 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1679
1680 def read(*args, **kwargs):
1681 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1682 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1683
1684 def readline(*args, **kwargs):
1685 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1686 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1687
1688 def readlines(*args, **kwargs):
1689 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1690 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1691
1692 def seek(*args, **kwargs):
1693 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1694 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1695
1696 def tell(*args, **kwargs):
1697 """tell(self) -> int"""
5b5c9bc7 1698 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1699
1700 def Peek(*args, **kwargs):
1701 """Peek(self) -> char"""
5b5c9bc7 1702 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1703
1704 def GetC(*args, **kwargs):
1705 """GetC(self) -> char"""
5b5c9bc7 1706 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1707
1708 def LastRead(*args, **kwargs):
1709 """LastRead(self) -> size_t"""
5b5c9bc7 1710 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1711
1712 def CanRead(*args, **kwargs):
1713 """CanRead(self) -> bool"""
5b5c9bc7 1714 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1715
1716 def Eof(*args, **kwargs):
1717 """Eof(self) -> bool"""
5b5c9bc7 1718 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1719
1720 def Ungetch(*args, **kwargs):
1721 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1722 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1723
1724 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1725 """SeekI(self, long pos, int mode=FromStart) -> long"""
1726 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1727
1728 def TellI(*args, **kwargs):
1729 """TellI(self) -> long"""
5b5c9bc7 1730 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc
RD
1731
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
5b5c9bc7
RD
1738_core_.InputStream_swigregister(InputStreamPtr)
1739DefaultPosition = cvar.DefaultPosition
1740DefaultSize = cvar.DefaultSize
d55e5bfc 1741
5b5c9bc7
RD
1742class OutputStream(object):
1743 """Proxy of C++ OutputStream class"""
d55e5bfc
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,)
1747 def write(*args, **kwargs):
1748 """write(self, PyObject obj)"""
5b5c9bc7 1749 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc
RD
1750
1751
5b5c9bc7 1752class OutputStreamPtr(OutputStream):
d55e5bfc
RD
1753 def __init__(self, this):
1754 self.this = this
1755 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1756 self.__class__ = OutputStream
1757_core_.OutputStream_swigregister(OutputStreamPtr)
d55e5bfc
RD
1758
1759#---------------------------------------------------------------------------
1760
5b5c9bc7
RD
1761class FSFile(Object):
1762 """Proxy of C++ FSFile class"""
d55e5bfc
RD
1763 def __repr__(self):
1764 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1765 def __init__(self, *args, **kwargs):
1766 """
5b5c9bc7
RD
1767 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1768 DateTime modif) -> FSFile
d55e5bfc 1769 """
5b5c9bc7 1770 newobj = _core_.new_FSFile(*args, **kwargs)
d55e5bfc
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
5b5c9bc7 1776 def __del__(self, destroy=_core_.delete_FSFile):
d55e5bfc
RD
1777 """__del__(self)"""
1778 try:
1779 if self.thisown: destroy(self)
1780 except: pass
1781
1782 def GetStream(*args, **kwargs):
5b5c9bc7
RD
1783 """GetStream(self) -> InputStream"""
1784 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc
RD
1785
1786 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1787 """GetMimeType(self) -> String"""
1788 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1789
1790 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
1791 """GetLocation(self) -> String"""
1792 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
1793
1794 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1795 """GetAnchor(self) -> String"""
1796 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1797
1798 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
1799 """GetModificationTime(self) -> DateTime"""
1800 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc
RD
1801
1802
5b5c9bc7 1803class FSFilePtr(FSFile):
d55e5bfc
RD
1804 def __init__(self, this):
1805 self.this = this
1806 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1807 self.__class__ = FSFile
1808_core_.FSFile_swigregister(FSFilePtr)
d55e5bfc
RD
1809
1810class CPPFileSystemHandler(object):
36ed4f51 1811 """Proxy of C++ CPPFileSystemHandler class"""
d55e5bfc
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
5b5c9bc7 1821_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
d55e5bfc
RD
1822
1823class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1824 """Proxy of C++ FileSystemHandler class"""
d55e5bfc
RD
1825 def __repr__(self):
1826 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1827 def __init__(self, *args, **kwargs):
1828 """__init__(self) -> FileSystemHandler"""
5b5c9bc7 1829 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
d55e5bfc
RD
1830 self.this = newobj.this
1831 self.thisown = 1
1832 del newobj.thisown
1833 self._setCallbackInfo(self, FileSystemHandler)
1834
1835 def _setCallbackInfo(*args, **kwargs):
1836 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 1837 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
1838
1839 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1840 """CanOpen(self, String location) -> bool"""
1841 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1842
1843 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1844 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1845 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1846
1847 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1848 """FindFirst(self, String spec, int flags=0) -> String"""
1849 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1850
1851 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1852 """FindNext(self) -> String"""
1853 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1854
1855 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
1856 """GetProtocol(self, String location) -> String"""
1857 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
1858
1859 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
1860 """GetLeftLocation(self, String location) -> String"""
1861 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
1862
1863 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1864 """GetAnchor(self, String location) -> String"""
1865 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1866
1867 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
1868 """GetRightLocation(self, String location) -> String"""
1869 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
1870
1871 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
1872 """GetMimeTypeFromExt(self, String location) -> String"""
1873 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc
RD
1874
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
5b5c9bc7 1881_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
d55e5bfc 1882
5b5c9bc7
RD
1883class FileSystem(Object):
1884 """Proxy of C++ FileSystem class"""
d55e5bfc
RD
1885 def __repr__(self):
1886 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1887 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1888 """__init__(self) -> FileSystem"""
1889 newobj = _core_.new_FileSystem(*args, **kwargs)
d55e5bfc
RD
1890 self.this = newobj.this
1891 self.thisown = 1
1892 del newobj.thisown
5b5c9bc7 1893 def __del__(self, destroy=_core_.delete_FileSystem):
d55e5bfc
RD
1894 """__del__(self)"""
1895 try:
1896 if self.thisown: destroy(self)
1897 except: pass
1898
1899 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
1900 """ChangePathTo(self, String location, bool is_dir=False)"""
1901 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
1902
1903 def GetPath(*args, **kwargs):
5b5c9bc7
RD
1904 """GetPath(self) -> String"""
1905 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
1906
1907 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1908 """OpenFile(self, String location) -> FSFile"""
1909 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
1910
1911 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1912 """FindFirst(self, String spec, int flags=0) -> String"""
1913 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
1914
1915 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1916 """FindNext(self) -> String"""
1917 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
1918
1919 def AddHandler(*args, **kwargs):
d6c14a4c 1920 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 1921 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
1922
1923 AddHandler = staticmethod(AddHandler)
1924 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1925 """CleanUpHandlers()"""
5b5c9bc7 1926 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
1927
1928 CleanUpHandlers = staticmethod(CleanUpHandlers)
1929 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
1930 """FileNameToURL(String filename) -> String"""
1931 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
1932
1933 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 1934 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
1935 """URLToFileName(String url) -> String"""
1936 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
1937
1938 URLToFileName = staticmethod(URLToFileName)
d55e5bfc 1939
5b5c9bc7 1940class FileSystemPtr(FileSystem):
d55e5bfc
RD
1941 def __init__(self, this):
1942 self.this = this
1943 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1944 self.__class__ = FileSystem
1945_core_.FileSystem_swigregister(FileSystemPtr)
d55e5bfc 1946
5b5c9bc7
RD
1947def FileSystem_AddHandler(*args, **kwargs):
1948 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1949 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1950
5b5c9bc7
RD
1951def FileSystem_CleanUpHandlers(*args, **kwargs):
1952 """FileSystem_CleanUpHandlers()"""
1953 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc 1954
5b5c9bc7
RD
1955def FileSystem_FileNameToURL(*args, **kwargs):
1956 """FileSystem_FileNameToURL(String filename) -> String"""
1957 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1958
5b5c9bc7
RD
1959def FileSystem_URLToFileName(*args, **kwargs):
1960 """FileSystem_URLToFileName(String url) -> String"""
1961 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1962
5b5c9bc7
RD
1963class InternetFSHandler(CPPFileSystemHandler):
1964 """Proxy of C++ InternetFSHandler class"""
d55e5bfc
RD
1965 def __repr__(self):
1966 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1967 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1968 """__init__(self) -> InternetFSHandler"""
1969 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
d55e5bfc
RD
1970 self.this = newobj.this
1971 self.thisown = 1
1972 del newobj.thisown
1973 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1974 """CanOpen(self, String location) -> bool"""
1975 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1976
1977 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1978 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1979 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1980
1981
5b5c9bc7 1982class InternetFSHandlerPtr(InternetFSHandler):
d55e5bfc
RD
1983 def __init__(self, this):
1984 self.this = this
1985 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1986 self.__class__ = InternetFSHandler
1987_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
d55e5bfc 1988
5b5c9bc7
RD
1989class ZipFSHandler(CPPFileSystemHandler):
1990 """Proxy of C++ ZipFSHandler class"""
d55e5bfc
RD
1991 def __repr__(self):
1992 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1993 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1994 """__init__(self) -> ZipFSHandler"""
1995 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
d55e5bfc
RD
1996 self.this = newobj.this
1997 self.thisown = 1
1998 del newobj.thisown
1999 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2000 """CanOpen(self, String location) -> bool"""
2001 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2002
2003 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2004 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2005 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2006
2007 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2008 """FindFirst(self, String spec, int flags=0) -> String"""
2009 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2010
2011 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2012 """FindNext(self) -> String"""
2013 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
2014
2015
5b5c9bc7 2016class ZipFSHandlerPtr(ZipFSHandler):
d55e5bfc
RD
2017 def __init__(self, this):
2018 self.this = this
2019 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2020 self.__class__ = ZipFSHandler
2021_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
d55e5bfc
RD
2022
2023
2024def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
5b5c9bc7
RD
2025 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2026 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
2027
2028def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
5b5c9bc7
RD
2029 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2030 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
2031
2032def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
5b5c9bc7
RD
2033 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2034 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
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'
d55e5bfc 2051
5b5c9bc7
RD
2052class MemoryFSHandler(CPPFileSystemHandler):
2053 """Proxy of C++ MemoryFSHandler class"""
d55e5bfc
RD
2054 def __repr__(self):
2055 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2056 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2057 """__init__(self) -> MemoryFSHandler"""
2058 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
d55e5bfc
RD
2059 self.this = newobj.this
2060 self.thisown = 1
2061 del newobj.thisown
2062 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
2063 """RemoveFile(String filename)"""
2064 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
2065
2066 RemoveFile = staticmethod(RemoveFile)
2067 AddFile = staticmethod(MemoryFSHandler_AddFile)
2068 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2069 """CanOpen(self, String location) -> bool"""
2070 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2071
2072 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2073 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2074 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2075
2076 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2077 """FindFirst(self, String spec, int flags=0) -> String"""
2078 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2079
2080 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2081 """FindNext(self) -> String"""
2082 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
2083
2084
5b5c9bc7 2085class MemoryFSHandlerPtr(MemoryFSHandler):
d55e5bfc
RD
2086 def __init__(self, this):
2087 self.this = this
2088 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2089 self.__class__ = MemoryFSHandler
2090_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
d55e5bfc 2091
5b5c9bc7
RD
2092def MemoryFSHandler_RemoveFile(*args, **kwargs):
2093 """MemoryFSHandler_RemoveFile(String filename)"""
2094 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 2095
5b5c9bc7
RD
2096IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2097IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2098IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
2099#---------------------------------------------------------------------------
2100
5b5c9bc7 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 """
d55e5bfc
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,)
2110 def GetName(*args, **kwargs):
5b5c9bc7
RD
2111 """GetName(self) -> String"""
2112 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
2113
2114 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
2115 """GetExtension(self) -> String"""
2116 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
2117
2118 def GetType(*args, **kwargs):
2119 """GetType(self) -> long"""
5b5c9bc7 2120 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
2121
2122 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
2123 """GetMimeType(self) -> String"""
2124 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
2125
2126 def CanRead(*args, **kwargs):
5b5c9bc7
RD
2127 """CanRead(self, String name) -> bool"""
2128 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc
RD
2129
2130 def SetName(*args, **kwargs):
5b5c9bc7
RD
2131 """SetName(self, String name)"""
2132 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
2133
2134 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2135 """SetExtension(self, String extension)"""
2136 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2137
2138 def SetType(*args, **kwargs):
2139 """SetType(self, long type)"""
5b5c9bc7 2140 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2141
2142 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2143 """SetMimeType(self, String mimetype)"""
2144 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc
RD
2145
2146
5b5c9bc7 2147class ImageHandlerPtr(ImageHandler):
d55e5bfc
RD
2148 def __init__(self, this):
2149 self.this = this
2150 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2151 self.__class__ = ImageHandler
2152_core_.ImageHandler_swigregister(ImageHandlerPtr)
d55e5bfc 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
5b5c9bc7
RD
2228class ImageHistogram(object):
2229 """Proxy of C++ ImageHistogram class"""
d55e5bfc
RD
2230 def __repr__(self):
2231 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2232 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2233 """__init__(self) -> ImageHistogram"""
2234 newobj = _core_.new_ImageHistogram(*args, **kwargs)
d55e5bfc
RD
2235 self.this = newobj.this
2236 self.thisown = 1
2237 del newobj.thisown
2238 def MakeKey(*args, **kwargs):
2239 """
7a27cf7c 2240 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2241
2242 Get the key in the histogram for the given RGB values
2243 """
5b5c9bc7 2244 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2255 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2264 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
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 """
5b5c9bc7 2272 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2273
2274 def GetCountColour(*args, **kwargs):
2275 """
5b5c9bc7 2276 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2277
2278 Returns the pixel count for the given `wx.Colour` value.
2279 """
5b5c9bc7 2280 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2281
d55e5bfc 2282
5b5c9bc7 2283class ImageHistogramPtr(ImageHistogram):
d55e5bfc
RD
2284 def __init__(self, this):
2285 self.this = this
2286 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2287 self.__class__ = ImageHistogram
2288_core_.ImageHistogram_swigregister(ImageHistogramPtr)
d55e5bfc 2289
5b5c9bc7 2290def ImageHistogram_MakeKey(*args, **kwargs):
d55e5bfc 2291 """
7a27cf7c 2292 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2293
2294 Get the key in the histogram for the given RGB values
2295 """
5b5c9bc7 2296 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 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
5b5c9bc7 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 """
d55e5bfc
RD
2385 def __repr__(self):
2386 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
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 """
5b5c9bc7 2393 newobj = _core_.new_Image(*args, **kwargs)
d55e5bfc
RD
2394 self.this = newobj.this
2395 self.thisown = 1
2396 del newobj.thisown
5b5c9bc7 2397 def __del__(self, destroy=_core_.delete_Image):
d55e5bfc
RD
2398 """__del__(self)"""
2399 try:
2400 if self.thisown: destroy(self)
2401 except: pass
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 """
5b5c9bc7 2410 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2411
2412 def Destroy(*args, **kwargs):
2413 """
2414 Destroy(self)
2415
7a27cf7c 2416 Destroys the image data.
d55e5bfc 2417 """
5b5c9bc7 2418 return _core_.Image_Destroy(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2428 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2436 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2447 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2463 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 2464
d55e5bfc 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 """
5b5c9bc7 2475 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2485 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 2486
d55e5bfc 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 """
5b5c9bc7 2493 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2501 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2509 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2519 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2533 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2541 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7
RD
2552 return _core_.Image_InitAlpha(*args, **kwargs)
2553
2554 def IsTransparent(*args, **kwargs):
2555 """
7a27cf7c 2556 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2557
7a27cf7c
RD
2558 Returns ``True`` if this pixel is masked or has an alpha value less
2559 than the spcified threshold.
5b5c9bc7
RD
2560 """
2561 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2562
d55e5bfc 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 """
5b5c9bc7 2571 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2572
4cf4100f
RD
2573 def ConvertAlphaToMask(*args, **kwargs):
2574 """
5b5c9bc7 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 """
5b5c9bc7 2585 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 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 """
5b5c9bc7 2599 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 2600
d55e5bfc 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 """
5b5c9bc7 2618 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2626 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2637 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2647 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2656 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2664 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2672 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2682 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2693 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2702 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc
RD
2703
2704 def Ok(*args, **kwargs):
7a27cf7c
RD
2705 """
2706 Ok(self) -> bool
2707
2708 Returns true if image data is present.
2709 """
5b5c9bc7 2710 return _core_.Image_Ok(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2718 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2726 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2727
2728 def GetSize(*args, **kwargs):
7a27cf7c
RD
2729 """
2730 GetSize(self) -> Size
2731
2732 Returns the size of the image in pixels.
2733 """
5b5c9bc7 2734 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2735
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 """
5b5c9bc7 2743 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2757 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2758
d55e5bfc 2759 def Copy(*args, **kwargs):
7a27cf7c
RD
2760 """
2761 Copy(self) -> Image
2762
2763 Returns an identical copy of the image.
2764 """
5b5c9bc7 2765 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2774 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2775
2776 def GetData(*args, **kwargs):
bb2ef2cc
RD
2777 """
2778 GetData(self) -> PyObject
2779
2780 Returns a string containing a copy of the RGB bytes of the image.
2781 """
5b5c9bc7 2782 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2783
2784 def SetData(*args, **kwargs):
bb2ef2cc
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 """
5b5c9bc7 2792 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2793
2794 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
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.
bb2ef2cc 2801 """
5b5c9bc7 2802 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2803
2804 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
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.
bb2ef2cc 2811 """
5b5c9bc7 2812 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2813
2814 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2815 """
2816 GetAlphaData(self) -> PyObject
2817
2818 Returns a string containing a copy of the alpha bytes of the image.
2819 """
5b5c9bc7 2820 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2821
2822 def SetAlphaData(*args, **kwargs):
bb2ef2cc
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 """
5b5c9bc7 2830 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2831
2832 def GetAlphaBuffer(*args, **kwargs):
2833 """GetAlphaBuffer(self) -> PyObject"""
5b5c9bc7 2834 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2835
2836 def SetAlphaBuffer(*args, **kwargs):
bb2ef2cc 2837 """SetAlphaBuffer(self, buffer alpha)"""
5b5c9bc7 2838 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2847 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2855 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2856
d55e5bfc 2857 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2858 """
2859 GetMaskRed(self) -> byte
2860
2861 Gets the red component of the mask colour.
2862 """
5b5c9bc7 2863 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2871 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2879 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2888 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2896 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2897
2898 def Rotate(*args, **kwargs):
2899 """
5b5c9bc7
RD
2900 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
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.
d55e5bfc 2910 """
5b5c9bc7 2911 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2920 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
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 """
5b5c9bc7 2929 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2930
2931 def Replace(*args, **kwargs):
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)``.
d55e5bfc 2937 """
5b5c9bc7 2938 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 2939
32fe5131
RD
2940 def ConvertToGreyscale(*args, **kwargs):
2941 """
2942 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2943
2944 Convert to greyscale image. Uses the luminance component (Y) of the
2945 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2946 defaults to ITU-T BT.601
2947 """
2948 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2949
d55e5bfc 2950 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2951 """
2952 ConvertToMono(self, byte r, byte g, byte b) -> Image
2953
2954 Returns monochromatic version of the image. The returned image has
2955 white colour where the original has ``(r,g,b)`` colour and black
2956 colour everywhere else.
2957 """
5b5c9bc7 2958 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2959
2960 def SetOption(*args, **kwargs):
7a27cf7c
RD
2961 """
2962 SetOption(self, String name, String value)
2963
2964 Sets an image handler defined option. For example, when saving as a
2965 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2966 number between 0 and 100 (0 is terrible, 100 is very good).
2967 """
5b5c9bc7 2968 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2969
2970 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2971 """
2972 SetOptionInt(self, String name, int value)
2973
2974 Sets an image option as an integer.
2975 """
5b5c9bc7 2976 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2977
2978 def GetOption(*args, **kwargs):
7a27cf7c
RD
2979 """
2980 GetOption(self, String name) -> String
2981
2982 Gets the value of an image handler option.
2983 """
5b5c9bc7 2984 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2985
2986 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2987 """
2988 GetOptionInt(self, String name) -> int
2989
2990 Gets the value of an image handler option as an integer. If the given
2991 option is not present, the function returns 0.
2992 """
5b5c9bc7 2993 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2994
2995 def HasOption(*args, **kwargs):
7a27cf7c
RD
2996 """
2997 HasOption(self, String name) -> bool
2998
2999 Returns true if the given option is present.
3000 """
5b5c9bc7 3001 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
3002
3003 def CountColours(*args, **kwargs):
3004 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 3005 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
3006
3007 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
3008 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3009 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
3010
3011 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
3012 """AddHandler(ImageHandler handler)"""
3013 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
3014
3015 AddHandler = staticmethod(AddHandler)
3016 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
3017 """InsertHandler(ImageHandler handler)"""
3018 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
3019
3020 InsertHandler = staticmethod(InsertHandler)
3021 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
3022 """RemoveHandler(String name) -> bool"""
3023 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
3024
3025 RemoveHandler = staticmethod(RemoveHandler)
3026 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3027 """
3028 GetImageExtWildcard() -> String
3029
3030 Iterates all registered wxImageHandler objects, and returns a string
3031 containing file extension masks suitable for passing to file open/save
3032 dialog boxes.
3033 """
5b5c9bc7 3034 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
3035
3036 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3037 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
3038 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3039 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
3040
3041 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3042 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 3043 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 3044
943e8dfd
RD
3045 def RotateHue(*args, **kwargs):
3046 """
3047 RotateHue(self, double angle)
3048
3049 Rotates the hue of each pixel of the image. Hue is a double in the
3050 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3051 """
3052 return _core_.Image_RotateHue(*args, **kwargs)
3053
3054 def RGBtoHSV(*args, **kwargs):
3055 """
3056 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3057
3058 Converts a color in RGB color space to HSV color space.
3059 """
3060 return _core_.Image_RGBtoHSV(*args, **kwargs)
3061
3062 RGBtoHSV = staticmethod(RGBtoHSV)
3063 def HSVtoRGB(*args, **kwargs):
3064 """
3065 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3066
3067 Converts a color in HSV color space to RGB color space.
3068 """
3069 return _core_.Image_HSVtoRGB(*args, **kwargs)
3070
3071 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc
RD
3072 def __nonzero__(self): return self.Ok()
3073
5b5c9bc7 3074class ImagePtr(Image):
d55e5bfc
RD
3075 def __init__(self, this):
3076 self.this = this
3077 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3078 self.__class__ = Image
3079_core_.Image_swigregister(ImagePtr)
d55e5bfc
RD
3080
3081def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3082 """
3083 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3084
3085 Loads an image from a file, using a MIME type string (such as
3086 'image/jpeg') to specify image type.
3087 """
5b5c9bc7 3088 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
3089 val.thisown = 1
3090 return val
3091
3092def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3093 """
3094 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3095
3096 Loads an image from an input stream, or any readable Python file-like
3097 object.
3098 """
5b5c9bc7 3099 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
3100 val.thisown = 1
3101 return val
3102
3103def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3104 """
3105 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3106
3107 Loads an image from an input stream, or any readable Python file-like
3108 object, specifying the image format with a MIME type string.
3109 """
5b5c9bc7 3110 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
3111 val.thisown = 1
3112 return val
3113
d6c14a4c 3114def EmptyImage(*args, **kwargs):
bb2ef2cc 3115 """
5b5c9bc7 3116 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
3117
3118 Construct an empty image of a given size, optionally setting all
3119 pixels to black.
3120 """
5b5c9bc7 3121 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
3122 val.thisown = 1
3123 return val
3124
3125def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 3126 """
5b5c9bc7 3127 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
3128
3129 Construct an Image from a `wx.Bitmap`.
3130 """
5b5c9bc7 3131 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
3132 val.thisown = 1
3133 return val
3134
3135def ImageFromData(*args, **kwargs):
bb2ef2cc 3136 """
5b5c9bc7 3137 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
3138
3139 Construct an Image from a buffer of RGB bytes. Accepts either a
3140 string or a buffer object holding the data and the length of the data
3141 must be width*height*3.
3142 """
5b5c9bc7 3143 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
3144 val.thisown = 1
3145 return val
3146
03e46024 3147def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 3148 """
5b5c9bc7 3149 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
3150
3151 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3152 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3153 length of the data must be width*height*3 bytes, and the length of the
3154 alpha data must be width*height bytes.
bb2ef2cc 3155 """
5b5c9bc7 3156 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
3157 val.thisown = 1
3158 return val
3159
5b5c9bc7 3160def Image_CanRead(*args, **kwargs):
7a27cf7c
RD
3161 """
3162 Image_CanRead(String filename) -> bool
3163
3164 Returns True if the image handlers can read this file.
3165 """
5b5c9bc7 3166 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 3167
5b5c9bc7 3168def Image_GetImageCount(*args, **kwargs):
7a27cf7c
RD
3169 """
3170 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3171
3172 If the image file contains more than one image and the image handler
3173 is capable of retrieving these individually, this function will return
3174 the number of available images.
3175 """
5b5c9bc7 3176 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 3177
5b5c9bc7 3178def Image_CanReadStream(*args, **kwargs):
7a27cf7c
RD
3179 """
3180 Image_CanReadStream(InputStream stream) -> bool
3181
3182 Returns True if the image handlers can read an image file from the
3183 data currently on the input stream, or a readable Python file-like
3184 object.
3185 """
5b5c9bc7 3186 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 3187
5b5c9bc7
RD
3188def Image_AddHandler(*args, **kwargs):
3189 """Image_AddHandler(ImageHandler handler)"""
3190 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 3191
5b5c9bc7
RD
3192def Image_InsertHandler(*args, **kwargs):
3193 """Image_InsertHandler(ImageHandler handler)"""
3194 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 3195
5b5c9bc7
RD
3196def Image_RemoveHandler(*args, **kwargs):
3197 """Image_RemoveHandler(String name) -> bool"""
3198 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3199
5b5c9bc7 3200def Image_GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3201 """
3202 Image_GetImageExtWildcard() -> String
3203
3204 Iterates all registered wxImageHandler objects, and returns a string
3205 containing file extension masks suitable for passing to file open/save
3206 dialog boxes.
3207 """
5b5c9bc7 3208 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc 3209
943e8dfd
RD
3210def Image_RGBtoHSV(*args, **kwargs):
3211 """
3212 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3213
3214 Converts a color in RGB color space to HSV color space.
3215 """
3216 return _core_.Image_RGBtoHSV(*args, **kwargs)
3217
3218def Image_HSVtoRGB(*args, **kwargs):
3219 """
3220 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3221
3222 Converts a color in HSV color space to RGB color space.
3223 """
3224 return _core_.Image_HSVtoRGB(*args, **kwargs)
3225
68e533f8
RD
3226def InitAllImageHandlers():
3227 """
3228 The former functionality of InitAllImageHanders is now done internal to
3229 the _core_ extension module and so this function has become a simple NOP.
3230 """
3231 pass
d55e5bfc 3232
5b5c9bc7
RD
3233IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3234IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3235PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3236PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3237PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3238BMP_24BPP = _core_.BMP_24BPP
3239BMP_8BPP = _core_.BMP_8BPP
3240BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3241BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3242BMP_8BPP_RED = _core_.BMP_8BPP_RED
3243BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3244BMP_4BPP = _core_.BMP_4BPP
3245BMP_1BPP = _core_.BMP_1BPP
3246BMP_1BPP_BW = _core_.BMP_1BPP_BW
3247class BMPHandler(ImageHandler):
27fb7603 3248 """A `wx.ImageHandler` for \*.bmp bitmap files."""
d55e5bfc
RD
3249 def __repr__(self):
3250 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3251 def __init__(self, *args, **kwargs):
27fb7603
RD
3252 """
3253 __init__(self) -> BMPHandler
3254
3255 A `wx.ImageHandler` for \*.bmp bitmap files.
3256 """
5b5c9bc7 3257 newobj = _core_.new_BMPHandler(*args, **kwargs)
d55e5bfc
RD
3258 self.this = newobj.this
3259 self.thisown = 1
3260 del newobj.thisown
3261
5b5c9bc7 3262class BMPHandlerPtr(BMPHandler):
d55e5bfc
RD
3263 def __init__(self, this):
3264 self.this = this
3265 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3266 self.__class__ = BMPHandler
3267_core_.BMPHandler_swigregister(BMPHandlerPtr)
3268NullImage = cvar.NullImage
68350608 3269IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3270IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3271IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3272IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3273IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3274IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3275IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3276IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3277IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3278IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3279IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3280IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3281IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3282IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3283IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3284
5b5c9bc7 3285class ICOHandler(BMPHandler):
27fb7603 3286 """A `wx.ImageHandler` for \*.ico icon files."""
d55e5bfc
RD
3287 def __repr__(self):
3288 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3289 def __init__(self, *args, **kwargs):
27fb7603
RD
3290 """
3291 __init__(self) -> ICOHandler
3292
3293 A `wx.ImageHandler` for \*.ico icon files.
3294 """
5b5c9bc7 3295 newobj = _core_.new_ICOHandler(*args, **kwargs)
d55e5bfc
RD
3296 self.this = newobj.this
3297 self.thisown = 1
3298 del newobj.thisown
3299
5b5c9bc7 3300class ICOHandlerPtr(ICOHandler):
d55e5bfc
RD
3301 def __init__(self, this):
3302 self.this = this
3303 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3304 self.__class__ = ICOHandler
3305_core_.ICOHandler_swigregister(ICOHandlerPtr)
d55e5bfc 3306
5b5c9bc7 3307class CURHandler(ICOHandler):
27fb7603 3308 """A `wx.ImageHandler` for \*.cur cursor files."""
d55e5bfc
RD
3309 def __repr__(self):
3310 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3311 def __init__(self, *args, **kwargs):
27fb7603
RD
3312 """
3313 __init__(self) -> CURHandler
3314
3315 A `wx.ImageHandler` for \*.cur cursor files.
3316 """
5b5c9bc7 3317 newobj = _core_.new_CURHandler(*args, **kwargs)
d55e5bfc
RD
3318 self.this = newobj.this
3319 self.thisown = 1
3320 del newobj.thisown
3321
5b5c9bc7 3322class CURHandlerPtr(CURHandler):
d55e5bfc
RD
3323 def __init__(self, this):
3324 self.this = this
3325 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3326 self.__class__ = CURHandler
3327_core_.CURHandler_swigregister(CURHandlerPtr)
d55e5bfc 3328
5b5c9bc7 3329class ANIHandler(CURHandler):
27fb7603 3330 """A `wx.ImageHandler` for \*.ani animated cursor files."""
d55e5bfc
RD
3331 def __repr__(self):
3332 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3333 def __init__(self, *args, **kwargs):
27fb7603
RD
3334 """
3335 __init__(self) -> ANIHandler
3336
3337 A `wx.ImageHandler` for \*.ani animated cursor files.
3338 """
5b5c9bc7 3339 newobj = _core_.new_ANIHandler(*args, **kwargs)
d55e5bfc
RD
3340 self.this = newobj.this
3341 self.thisown = 1
3342 del newobj.thisown
3343
5b5c9bc7 3344class ANIHandlerPtr(ANIHandler):
d55e5bfc
RD
3345 def __init__(self, this):
3346 self.this = this
3347 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3348 self.__class__ = ANIHandler
3349_core_.ANIHandler_swigregister(ANIHandlerPtr)
d55e5bfc 3350
5b5c9bc7 3351class PNGHandler(ImageHandler):
27fb7603 3352 """A `wx.ImageHandler` for PNG image files."""
d55e5bfc
RD
3353 def __repr__(self):
3354 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3355 def __init__(self, *args, **kwargs):
27fb7603
RD
3356 """
3357 __init__(self) -> PNGHandler
3358
3359 A `wx.ImageHandler` for PNG image files.
3360 """
5b5c9bc7 3361 newobj = _core_.new_PNGHandler(*args, **kwargs)
d55e5bfc
RD
3362 self.this = newobj.this
3363 self.thisown = 1
3364 del newobj.thisown
3365
5b5c9bc7 3366class PNGHandlerPtr(PNGHandler):
d55e5bfc
RD
3367 def __init__(self, this):
3368 self.this = this
3369 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3370 self.__class__ = PNGHandler
3371_core_.PNGHandler_swigregister(PNGHandlerPtr)
d55e5bfc 3372
5b5c9bc7 3373class GIFHandler(ImageHandler):
27fb7603 3374 """A `wx.ImageHandler` for GIF image files."""
d55e5bfc
RD
3375 def __repr__(self):
3376 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3377 def __init__(self, *args, **kwargs):
27fb7603
RD
3378 """
3379 __init__(self) -> GIFHandler
3380
3381 A `wx.ImageHandler` for GIF image files.
3382 """
5b5c9bc7 3383 newobj = _core_.new_GIFHandler(*args, **kwargs)
d55e5bfc
RD
3384 self.this = newobj.this
3385 self.thisown = 1
3386 del newobj.thisown
3387
5b5c9bc7 3388class GIFHandlerPtr(GIFHandler):
d55e5bfc
RD
3389 def __init__(self, this):
3390 self.this = this
3391 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3392 self.__class__ = GIFHandler
3393_core_.GIFHandler_swigregister(GIFHandlerPtr)
d55e5bfc 3394
5b5c9bc7 3395class PCXHandler(ImageHandler):
27fb7603 3396 """A `wx.ImageHandler` for PCX imager files."""
d55e5bfc
RD
3397 def __repr__(self):
3398 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3399 def __init__(self, *args, **kwargs):
27fb7603
RD
3400 """
3401 __init__(self) -> PCXHandler
3402
3403 A `wx.ImageHandler` for PCX imager files.
3404 """
5b5c9bc7 3405 newobj = _core_.new_PCXHandler(*args, **kwargs)
d55e5bfc
RD
3406 self.this = newobj.this
3407 self.thisown = 1
3408 del newobj.thisown
3409
5b5c9bc7 3410class PCXHandlerPtr(PCXHandler):
d55e5bfc
RD
3411 def __init__(self, this):
3412 self.this = this
3413 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3414 self.__class__ = PCXHandler
3415_core_.PCXHandler_swigregister(PCXHandlerPtr)
d55e5bfc 3416
5b5c9bc7 3417class JPEGHandler(ImageHandler):
27fb7603 3418 """A `wx.ImageHandler` for JPEG/JPG image files."""
d55e5bfc
RD
3419 def __repr__(self):
3420 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3421 def __init__(self, *args, **kwargs):
27fb7603
RD
3422 """
3423 __init__(self) -> JPEGHandler
3424
3425 A `wx.ImageHandler` for JPEG/JPG image files.
3426 """
5b5c9bc7 3427 newobj = _core_.new_JPEGHandler(*args, **kwargs)
d55e5bfc
RD
3428 self.this = newobj.this
3429 self.thisown = 1
3430 del newobj.thisown
3431
5b5c9bc7 3432class JPEGHandlerPtr(JPEGHandler):
d55e5bfc
RD
3433 def __init__(self, this):
3434 self.this = this
3435 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3436 self.__class__ = JPEGHandler
3437_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
d55e5bfc 3438
5b5c9bc7 3439class PNMHandler(ImageHandler):
27fb7603 3440 """A `wx.ImageHandler` for PNM image files."""
d55e5bfc
RD
3441 def __repr__(self):
3442 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3443 def __init__(self, *args, **kwargs):
27fb7603
RD
3444 """
3445 __init__(self) -> PNMHandler
3446
3447 A `wx.ImageHandler` for PNM image files.
3448 """
5b5c9bc7 3449 newobj = _core_.new_PNMHandler(*args, **kwargs)
d55e5bfc
RD
3450 self.this = newobj.this
3451 self.thisown = 1
3452 del newobj.thisown
3453
5b5c9bc7 3454class PNMHandlerPtr(PNMHandler):
d55e5bfc
RD
3455 def __init__(self, this):
3456 self.this = this
3457 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3458 self.__class__ = PNMHandler
3459_core_.PNMHandler_swigregister(PNMHandlerPtr)
d55e5bfc 3460
5b5c9bc7 3461class XPMHandler(ImageHandler):
27fb7603 3462 """A `wx.ImageHandler` for XPM image."""
d55e5bfc
RD
3463 def __repr__(self):
3464 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3465 def __init__(self, *args, **kwargs):
27fb7603
RD
3466 """
3467 __init__(self) -> XPMHandler
3468
3469 A `wx.ImageHandler` for XPM image.
3470 """
5b5c9bc7 3471 newobj = _core_.new_XPMHandler(*args, **kwargs)
d55e5bfc
RD
3472 self.this = newobj.this
3473 self.thisown = 1
3474 del newobj.thisown
3475
5b5c9bc7 3476class XPMHandlerPtr(XPMHandler):
d55e5bfc
RD
3477 def __init__(self, this):
3478 self.this = this
3479 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3480 self.__class__ = XPMHandler
3481_core_.XPMHandler_swigregister(XPMHandlerPtr)
d55e5bfc 3482
5b5c9bc7 3483class TIFFHandler(ImageHandler):
27fb7603 3484 """A `wx.ImageHandler` for TIFF image files."""
d55e5bfc
RD
3485 def __repr__(self):
3486 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3487 def __init__(self, *args, **kwargs):
27fb7603
RD
3488 """
3489 __init__(self) -> TIFFHandler
3490
3491 A `wx.ImageHandler` for TIFF image files.
3492 """
5b5c9bc7 3493 newobj = _core_.new_TIFFHandler(*args, **kwargs)
d55e5bfc
RD
3494 self.this = newobj.this
3495 self.thisown = 1
3496 del newobj.thisown
3497
5b5c9bc7 3498class TIFFHandlerPtr(TIFFHandler):
d55e5bfc
RD
3499 def __init__(self, this):
3500 self.this = this
3501 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3502 self.__class__ = TIFFHandler
3503_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
d55e5bfc 3504
5b5c9bc7
RD
3505QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3506QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3507class Quantize(object):
c0de73ae
RD
3508 """Performs quantization, or colour reduction, on a wxImage."""
3509 def __init__(self): raise RuntimeError, "No constructor defined"
3510 def __repr__(self):
3511 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3512 def Quantize(*args, **kwargs):
3513 """
5b5c9bc7 3514 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3515
3516 Reduce the colours in the source image and put the result into the
3517 destination image, setting the palette in the destination if
3518 needed. Both images may be the same, to overwrite the source image.
3519 """
5b5c9bc7 3520 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3521
3522 Quantize = staticmethod(Quantize)
3523
5b5c9bc7 3524class QuantizePtr(Quantize):
c0de73ae
RD
3525 def __init__(self, this):
3526 self.this = this
3527 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3528 self.__class__ = Quantize
3529_core_.Quantize_swigregister(QuantizePtr)
c0de73ae 3530
5b5c9bc7 3531def Quantize_Quantize(*args, **kwargs):
c0de73ae 3532 """
5b5c9bc7 3533 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3534
3535 Reduce the colours in the source image and put the result into the
3536 destination image, setting the palette in the destination if
3537 needed. Both images may be the same, to overwrite the source image.
3538 """
5b5c9bc7 3539 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3540
d55e5bfc
RD
3541#---------------------------------------------------------------------------
3542
5b5c9bc7
RD
3543class EvtHandler(Object):
3544 """Proxy of C++ EvtHandler class"""
d55e5bfc
RD
3545 def __repr__(self):
3546 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3547 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3548 """__init__(self) -> EvtHandler"""
3549 newobj = _core_.new_EvtHandler(*args, **kwargs)
d55e5bfc
RD
3550 self.this = newobj.this
3551 self.thisown = 1
3552 del newobj.thisown
3553 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3554 """GetNextHandler(self) -> EvtHandler"""
3555 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3556
3557 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3558 """GetPreviousHandler(self) -> EvtHandler"""
3559 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3560
3561 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3562 """SetNextHandler(self, EvtHandler handler)"""
3563 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3564
3565 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3566 """SetPreviousHandler(self, EvtHandler handler)"""
3567 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3568
3569 def GetEvtHandlerEnabled(*args, **kwargs):
3570 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3571 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3572
3573 def SetEvtHandlerEnabled(*args, **kwargs):
3574 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3575 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3576
3577 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3578 """ProcessEvent(self, Event event) -> bool"""
3579 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3580
3581 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3582 """AddPendingEvent(self, Event event)"""
3583 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3584
3585 def ProcessPendingEvents(*args, **kwargs):
3586 """ProcessPendingEvents(self)"""
5b5c9bc7 3587 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3588
3589 def Connect(*args, **kwargs):
3590 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3591 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3592
3593 def Disconnect(*args, **kwargs):
3594 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3595 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3596
3597 def _setOORInfo(*args, **kwargs):
36ed4f51 3598 """_setOORInfo(self, PyObject _self, bool incref=True)"""
5b5c9bc7 3599 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
d55e5bfc
RD
3600
3601 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3602 """
3603 Bind an event to an event handler.
3604
a5ee0656
RD
3605 :param event: One of the EVT_* objects that specifies the
3606 type of event to bind,
d55e5bfc 3607
a5ee0656
RD
3608 :param handler: A callable object to be invoked when the
3609 event is delivered to self. Pass None to
3610 disconnect an event handler.
d55e5bfc 3611
a5ee0656
RD
3612 :param source: Sometimes the event originates from a
3613 different window than self, but you still
3614 want to catch it in self. (For example, a
3615 button event delivered to a frame.) By
3616 passing the source of the event, the event
3617 handling system is able to differentiate
3618 between the same event type from different
3619 controls.
d55e5bfc 3620
a5ee0656
RD
3621 :param id: Used to spcify the event source by ID instead
3622 of instance.
3623
3624 :param id2: Used when it is desirable to bind a handler
3625 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3626 """
3627 if source is not None:
3628 id = source.GetId()
3629 event.Bind(self, id, id2, handler)
3630
d6c14a4c
RD
3631 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3632 """
3633 Disconencts the event handler binding for event from self.
3634 Returns True if successful.
3635 """
3636 if source is not None:
3637 id = source.GetId()
3638 return event.Unbind(self, id, id2)
d55e5bfc
RD
3639
3640
5b5c9bc7 3641class EvtHandlerPtr(EvtHandler):
d55e5bfc
RD
3642 def __init__(self, this):
3643 self.this = this
3644 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3645 self.__class__ = EvtHandler
3646_core_.EvtHandler_swigregister(EvtHandlerPtr)
d55e5bfc
RD
3647
3648#---------------------------------------------------------------------------
3649
3650class PyEventBinder(object):
3651 """
3652 Instances of this class are used to bind specific events to event
3653 handlers.
3654 """
3655 def __init__(self, evtType, expectedIDs=0):
3656 if expectedIDs not in [0, 1, 2]:
3657 raise ValueError, "Invalid number of expectedIDs"
3658 self.expectedIDs = expectedIDs
3659
3660 if type(evtType) == list or type(evtType) == tuple:
3661 self.evtType = evtType
3662 else:
3663 self.evtType = [evtType]
3664
3665
3666 def Bind(self, target, id1, id2, function):
3667 """Bind this set of event types to target."""
3668 for et in self.evtType:
3669 target.Connect(id1, id2, et, function)
3670
d6c14a4c
RD
3671
3672 def Unbind(self, target, id1, id2):
3673 """Remove an event binding."""
3674 success = 0
3675 for et in self.evtType:
3676 success += target.Disconnect(id1, id2, et)
3677 return success != 0
3678
d55e5bfc
RD
3679
3680 def __call__(self, *args):
3681 """
3682 For backwards compatibility with the old EVT_* functions.
3683 Should be called with either (window, func), (window, ID,
3684 func) or (window, ID1, ID2, func) parameters depending on the
3685 type of the event.
3686 """
3687 assert len(args) == 2 + self.expectedIDs
3688 id1 = wx.ID_ANY
3689 id2 = wx.ID_ANY
3690 target = args[0]
3691 if self.expectedIDs == 0:
3692 func = args[1]
3693 elif self.expectedIDs == 1:
3694 id1 = args[1]
3695 func = args[2]
3696 elif self.expectedIDs == 2:
3697 id1 = args[1]
3698 id2 = args[2]
3699 func = args[3]
3700 else:
3701 raise ValueError, "Unexpected number of IDs"
3702
3703 self.Bind(target, id1, id2, func)
3704
3705
3706# These two are square pegs that don't fit the PyEventBinder hole...
3707def EVT_COMMAND(win, id, cmd, func):
3708 win.Connect(id, -1, cmd, func)
3709def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3710 win.Connect(id1, id2, cmd, func)
3711
3712
3713#---------------------------------------------------------------------------
3714
3715#---------------------------------------------------------------------------
3716
5b5c9bc7
RD
3717EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3718EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3719
3720def NewEventType(*args, **kwargs):
3721 """NewEventType() -> wxEventType"""
3722 return _core_.NewEventType(*args, **kwargs)
3723wxEVT_NULL = _core_.wxEVT_NULL
3724wxEVT_FIRST = _core_.wxEVT_FIRST
3725wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3726wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3727wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3728wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3729wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3730wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3731wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3732wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3733wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3734wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3735wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3736wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3737wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3738wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3739wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3740wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3741wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3742wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3743wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3744wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3745wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3746wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3747wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3748wxEVT_MOTION = _core_.wxEVT_MOTION
3749wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3750wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3751wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3752wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3753wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3754wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3755wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3756wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3757wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3758wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3759wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3760wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3761wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3762wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3763wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3764wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3765wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3766wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3767wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3768wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3769wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3770wxEVT_CHAR = _core_.wxEVT_CHAR
3771wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3772wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3773wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3774wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3775wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3776wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3777wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3778wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3779wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3780wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3781wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3782wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3783wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3784wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3785wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3786wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
RD
3787wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3788wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3789wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3790wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3791wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3792wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3793wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3794wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3795wxEVT_SIZE = _core_.wxEVT_SIZE
3796wxEVT_MOVE = _core_.wxEVT_MOVE
3797wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3798wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3799wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3800wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3801wxEVT_POWER = _core_.wxEVT_POWER
3802wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3803wxEVT_CREATE = _core_.wxEVT_CREATE
3804wxEVT_DESTROY = _core_.wxEVT_DESTROY
3805wxEVT_SHOW = _core_.wxEVT_SHOW
3806wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3807wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3808wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3809wxEVT_PAINT = _core_.wxEVT_PAINT
3810wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3811wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3812wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3813wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3814wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3815wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3816wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3817wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3818wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3819wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3820wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3821wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3822wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3823wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3824wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3825wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3826wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3827wxEVT_IDLE = _core_.wxEVT_IDLE
3828wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3829wxEVT_SIZING = _core_.wxEVT_SIZING
3830wxEVT_MOVING = _core_.wxEVT_MOVING
3831wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3832wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3833wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3834wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3835wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3836wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3837wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3838wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3839#
3840# Create some event binders
3841EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3842EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3843EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3844EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3845EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3846EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3847EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3848EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3849EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3850EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3851EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3852EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3853EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3854EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3855EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3856EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3857EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3858EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3859EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3860EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3861EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3862EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3863EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3864EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3865EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3866EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3867EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3868EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3869EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3870EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3871EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3872EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3873EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3874EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3875EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3876EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3877EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3878EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3879EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3880EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3881EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3882
3883EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3884EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3885EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3886EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3887EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3888EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3889EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3890EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3891EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3892EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3893EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3894EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3895EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3896
3897EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3898 wxEVT_LEFT_UP,
3899 wxEVT_MIDDLE_DOWN,
3900 wxEVT_MIDDLE_UP,
3901 wxEVT_RIGHT_DOWN,
3902 wxEVT_RIGHT_UP,
3903 wxEVT_MOTION,
3904 wxEVT_LEFT_DCLICK,
3905 wxEVT_MIDDLE_DCLICK,
3906 wxEVT_RIGHT_DCLICK,
3907 wxEVT_ENTER_WINDOW,
3908 wxEVT_LEAVE_WINDOW,
3909 wxEVT_MOUSEWHEEL
3910 ])
3911
3912
3913# Scrolling from wxWindow (sent to wxScrolledWindow)
3914EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3915 wxEVT_SCROLLWIN_BOTTOM,
3916 wxEVT_SCROLLWIN_LINEUP,
3917 wxEVT_SCROLLWIN_LINEDOWN,
3918 wxEVT_SCROLLWIN_PAGEUP,
3919 wxEVT_SCROLLWIN_PAGEDOWN,
3920 wxEVT_SCROLLWIN_THUMBTRACK,
3921 wxEVT_SCROLLWIN_THUMBRELEASE,
3922 ])
3923
3924EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3925EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3926EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3927EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3928EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3929EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3930EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3931EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3932
27fb7603 3933# Scrolling from wx.Slider and wx.ScrollBar
d55e5bfc
RD
3934EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3935 wxEVT_SCROLL_BOTTOM,
3936 wxEVT_SCROLL_LINEUP,
3937 wxEVT_SCROLL_LINEDOWN,
3938 wxEVT_SCROLL_PAGEUP,
3939 wxEVT_SCROLL_PAGEDOWN,
3940 wxEVT_SCROLL_THUMBTRACK,
3941 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3942 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3943 ])
3944
3945EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3946EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3947EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3948EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3949EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3950EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3951EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3952EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3953EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3954EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3955
27fb7603 3956# Scrolling from wx.Slider and wx.ScrollBar, with an id
d55e5bfc
RD
3957EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3958 wxEVT_SCROLL_BOTTOM,
3959 wxEVT_SCROLL_LINEUP,
3960 wxEVT_SCROLL_LINEDOWN,
3961 wxEVT_SCROLL_PAGEUP,
3962 wxEVT_SCROLL_PAGEDOWN,
3963 wxEVT_SCROLL_THUMBTRACK,
3964 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3965 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3966 ], 1)
3967
3968EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3969EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3970EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3971EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3972EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3973EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3974EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3975EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3976EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3977EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3978
3979EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3980EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3981EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3982EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3983EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3984EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3985EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3986EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3987EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3988EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3989
3990EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3991EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3992EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3993EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3994EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3995EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3996EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3997EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3998EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3999
4000
4001EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
4002EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
4003EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
4004EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
4005EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
4006EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
4007EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
4008
4009EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4010
4011EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4012EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4013
4014EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4015
4016
4017
4018#---------------------------------------------------------------------------
4019
5b5c9bc7 4020class Event(Object):
27fb7603
RD
4021 """
4022 An event is a structure holding information about an event passed to a
4023 callback or member function. wx.Event is an abstract base class for
4024 other event classes
4025 """
d55e5bfc
RD
4026 def __init__(self): raise RuntimeError, "No constructor defined"
4027 def __repr__(self):
4028 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7 4029 def __del__(self, destroy=_core_.delete_Event):
d55e5bfc
RD
4030 """__del__(self)"""
4031 try:
4032 if self.thisown: destroy(self)
4033 except: pass
4034
4035 def SetEventType(*args, **kwargs):
27fb7603
RD
4036 """
4037 SetEventType(self, wxEventType typ)
4038
4039 Sets the specific type of the event.
4040 """
5b5c9bc7 4041 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
4042
4043 def GetEventType(*args, **kwargs):
27fb7603
RD
4044 """
4045 GetEventType(self) -> wxEventType
4046
4047 Returns the identifier of the given event type, such as
4048 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4049 """
5b5c9bc7 4050 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
4051
4052 def GetEventObject(*args, **kwargs):
27fb7603
RD
4053 """
4054 GetEventObject(self) -> Object
4055
4056 Returns the object (usually a window) associated with the event, if
4057 any.
4058 """
5b5c9bc7 4059 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
4060
4061 def SetEventObject(*args, **kwargs):
27fb7603
RD
4062 """
4063 SetEventObject(self, Object obj)
4064
4065 Sets the originating object, or in other words, obj is normally the
4066 object that is sending the event.
4067 """
5b5c9bc7 4068 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
4069
4070 def GetTimestamp(*args, **kwargs):
4071 """GetTimestamp(self) -> long"""
5b5c9bc7 4072 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
4073
4074 def SetTimestamp(*args, **kwargs):
4075 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 4076 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
4077
4078 def GetId(*args, **kwargs):
27fb7603
RD
4079 """
4080 GetId(self) -> int
4081
4082 Returns the identifier associated with this event, such as a button
4083 command id.
4084 """
5b5c9bc7 4085 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
4086
4087 def SetId(*args, **kwargs):
27fb7603
RD
4088 """
4089 SetId(self, int Id)
4090
4091 Set's the ID for the event. This is usually the ID of the window that
4092 is sending the event, but it can also be a command id from a menu
4093 item, etc.
4094 """
5b5c9bc7 4095 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
4096
4097 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4098 """
4099 IsCommandEvent(self) -> bool
4100
4101 Returns true if the event is or is derived from `wx.CommandEvent` else
4102 it returns false. Note: Exists only for optimization purposes.
4103 """
5b5c9bc7 4104 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
4105
4106 def Skip(*args, **kwargs):
51b83b37
RD
4107 """
4108 Skip(self, bool skip=True)
4109
4110 Called by an event handler, it controls whether additional event
4111 handlers bound to this event will be called after the current event
4112 handler returns. Skip(false) (the default setting) will prevent
4113 additional event handlers from being called and control will be
4114 returned to the sender of the event immediately after the current
4115 handler has finished. Skip(True) will cause the event processing
4116 system to continue searching for a handler function for this event.
4117
4118 """
5b5c9bc7 4119 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
4120
4121 def GetSkipped(*args, **kwargs):
27fb7603
RD
4122 """
4123 GetSkipped(self) -> bool
4124
4125 Returns true if the event handler should be skipped, false otherwise.
4126 :see: `Skip`
4127 """
5b5c9bc7 4128 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
4129
4130 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4131 """
4132 ShouldPropagate(self) -> bool
4133
4134 Test if this event should be propagated to the parent window or not,
4135 i.e. if the propagation level is currently greater than 0.
4136 """
5b5c9bc7 4137 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
4138
4139 def StopPropagation(*args, **kwargs):
27fb7603
RD
4140 """
4141 StopPropagation(self) -> int
4142
4143 Stop the event from propagating to its parent window. Returns the old
4144 propagation level value which may be later passed to
4145 `ResumePropagation` to allow propagating the event again.
4146 """
5b5c9bc7 4147 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
4148
4149 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4150 """
4151 ResumePropagation(self, int propagationLevel)
4152
4153 Resume the event propagation by restoring the propagation level. (For
4154 example, you can use the value returned by an earlier call to
4155 `StopPropagation`.)
4156
4157 """
5b5c9bc7 4158 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
4159
4160 def Clone(*args, **kwargs):
5b5c9bc7
RD
4161 """Clone(self) -> Event"""
4162 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc
RD
4163
4164
5b5c9bc7 4165class EventPtr(Event):
d55e5bfc
RD
4166 def __init__(self, this):
4167 self.this = this
4168 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4169 self.__class__ = Event
4170_core_.Event_swigregister(EventPtr)
d55e5bfc
RD
4171
4172#---------------------------------------------------------------------------
4173
5b5c9bc7 4174class PropagationDisabler(object):
27fb7603
RD
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 """
d55e5bfc
RD
4180 def __repr__(self):
4181 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4182 def __init__(self, *args, **kwargs):
27fb7603
RD
4183 """
4184 __init__(self, Event event) -> PropagationDisabler
4185
4186 Helper class to temporarily change an event not to propagate. Simply
4187 create an instance of this class and then whe it is destroyed the
4188 propogation of the event will be restored.
4189 """
5b5c9bc7 4190 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
d55e5bfc
RD
4191 self.this = newobj.this
4192 self.thisown = 1
4193 del newobj.thisown
5b5c9bc7 4194 def __del__(self, destroy=_core_.delete_PropagationDisabler):
d55e5bfc
RD
4195 """__del__(self)"""
4196 try:
4197 if self.thisown: destroy(self)
4198 except: pass
4199
4200
5b5c9bc7 4201class PropagationDisablerPtr(PropagationDisabler):
d55e5bfc
RD
4202 def __init__(self, this):
4203 self.this = this
4204 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4205 self.__class__ = PropagationDisabler
4206_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
d55e5bfc 4207
5b5c9bc7 4208class PropagateOnce(object):
27fb7603
RD
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 """
d55e5bfc
RD
4214 def __repr__(self):
4215 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4216 def __init__(self, *args, **kwargs):
27fb7603
RD
4217 """
4218 __init__(self, Event event) -> PropagateOnce
4219
4220 A helper class that will temporarily lower propagation level of an
4221 event. Simply create an instance of this class and then whe it is
4222 destroyed the propogation of the event will be restored.
4223 """
5b5c9bc7 4224 newobj = _core_.new_PropagateOnce(*args, **kwargs)
d55e5bfc
RD
4225 self.this = newobj.this
4226 self.thisown = 1
4227 del newobj.thisown
5b5c9bc7 4228 def __del__(self, destroy=_core_.delete_PropagateOnce):
d55e5bfc
RD
4229 """__del__(self)"""
4230 try:
4231 if self.thisown: destroy(self)
4232 except: pass
4233
4234
5b5c9bc7 4235class PropagateOncePtr(PropagateOnce):
d55e5bfc
RD
4236 def __init__(self, this):
4237 self.this = this
4238 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4239 self.__class__ = PropagateOnce
4240_core_.PropagateOnce_swigregister(PropagateOncePtr)
d55e5bfc
RD
4241
4242#---------------------------------------------------------------------------
4243
5b5c9bc7 4244class CommandEvent(Event):
27fb7603
RD
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 """
d55e5bfc
RD
4250 def __repr__(self):
4251 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4252 def __init__(self, *args, **kwargs):
27fb7603
RD
4253 """
4254 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4255
4256 This event class contains information about command events, which
4257 originate from a variety of simple controls, as well as menus and
4258 toolbars.
4259 """
5b5c9bc7 4260 newobj = _core_.new_CommandEvent(*args, **kwargs)
d55e5bfc
RD
4261 self.this = newobj.this
4262 self.thisown = 1
4263 del newobj.thisown
4264 def GetSelection(*args, **kwargs):
27fb7603
RD
4265 """
4266 GetSelection(self) -> int
4267
4268 Returns item index for a listbox or choice selection event (not valid
4269 for a deselection).
4270 """
5b5c9bc7 4271 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
4272
4273 def SetString(*args, **kwargs):
5b5c9bc7
RD
4274 """SetString(self, String s)"""
4275 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
4276
4277 def GetString(*args, **kwargs):
27fb7603
RD
4278 """
4279 GetString(self) -> String
4280
4281 Returns item string for a listbox or choice selection event (not valid
4282 for a deselection).
4283 """
5b5c9bc7 4284 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
4285
4286 def IsChecked(*args, **kwargs):
27fb7603
RD
4287 """
4288 IsChecked(self) -> bool
4289
4290 This method can be used with checkbox and menu events: for the
4291 checkboxes, the method returns true for a selection event and false
4292 for a deselection one. For the menu events, this method indicates if
4293 the menu item just has become checked or unchecked (and thus only
4294 makes sense for checkable menu items).
4295 """
5b5c9bc7 4296 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
4297
4298 Checked = IsChecked
4299 def IsSelection(*args, **kwargs):
27fb7603
RD
4300 """
4301 IsSelection(self) -> bool
4302
4303 For a listbox or similar event, returns true if it is a selection,
4304 false if it is a deselection.
4305 """
5b5c9bc7 4306 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
4307
4308 def SetExtraLong(*args, **kwargs):
4309 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 4310 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
4311
4312 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4313 """
4314 GetExtraLong(self) -> long
4315
5ba5649b
RD
4316 Returns extra information dependant on the event objects type. If the
4317 event comes from a listbox selection, it is a boolean determining
4318 whether the event was a selection (true) or a deselection (false). A
4319 listbox deselection only occurs for multiple-selection boxes, and in
4320 this case the index and string values are indeterminate and the
4321 listbox must be examined by the application.
27fb7603 4322 """
5b5c9bc7 4323 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
4324
4325 def SetInt(*args, **kwargs):
4326 """SetInt(self, int i)"""
5b5c9bc7 4327 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
4328
4329 def GetInt(*args, **kwargs):
27fb7603
RD
4330 """
4331 GetInt(self) -> long
4332
5ba5649b
RD
4333 Returns the integer identifier corresponding to a listbox, choice or
4334 radiobox selection (only if the event was a selection, not a
4335 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4336 """
5b5c9bc7 4337 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc
RD
4338
4339 def Clone(*args, **kwargs):
5b5c9bc7
RD
4340 """Clone(self) -> Event"""
4341 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc
RD
4342
4343
5b5c9bc7 4344class CommandEventPtr(CommandEvent):
d55e5bfc
RD
4345 def __init__(self, this):
4346 self.this = this
4347 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4348 self.__class__ = CommandEvent
4349_core_.CommandEvent_swigregister(CommandEventPtr)
d55e5bfc
RD
4350
4351#---------------------------------------------------------------------------
4352
5b5c9bc7 4353class NotifyEvent(CommandEvent):
27fb7603
RD
4354 """
4355 An instance of this class (or one of its derived classes) is sent from
4356 a control when the control's state is being changed and the control
4357 allows that change to be prevented from happening. The event handler
4358 can call `Veto` or `Allow` to tell the control what to do.
4359 """
d55e5bfc
RD
4360 def __repr__(self):
4361 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4362 def __init__(self, *args, **kwargs):
27fb7603
RD
4363 """
4364 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4365
4366 An instance of this class (or one of its derived classes) is sent from
4367 a control when the control's state is being changed and the control
4368 allows that change to be prevented from happening. The event handler
4369 can call `Veto` or `Allow` to tell the control what to do.
4370 """
5b5c9bc7 4371 newobj = _core_.new_NotifyEvent(*args, **kwargs)
d55e5bfc
RD
4372 self.this = newobj.this
4373 self.thisown = 1
4374 del newobj.thisown
4375 def Veto(*args, **kwargs):
27fb7603
RD
4376 """
4377 Veto(self)
4378
4379 Prevents the change announced by this event from happening.
4380
4381 It is in general a good idea to notify the user about the reasons for
4382 vetoing the change because otherwise the applications behaviour (which
4383 just refuses to do what the user wants) might be quite surprising.
4384 """
5b5c9bc7 4385 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4386
4387 def Allow(*args, **kwargs):
27fb7603
RD
4388 """
4389 Allow(self)
4390
4391 This is the opposite of `Veto`: it explicitly allows the event to be
4392 processed. For most events it is not necessary to call this method as
4393 the events are allowed anyhow but some are forbidden by default (this
4394 will be mentioned in the corresponding event description).
4395 """
5b5c9bc7 4396 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4397
4398 def IsAllowed(*args, **kwargs):
27fb7603
RD
4399 """
4400 IsAllowed(self) -> bool
4401
4402 Returns true if the change is allowed (`Veto` hasn't been called) or
4403 false otherwise (if it was).
4404 """
5b5c9bc7 4405 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc
RD
4406
4407
5b5c9bc7 4408class NotifyEventPtr(NotifyEvent):
d55e5bfc
RD
4409 def __init__(self, this):
4410 self.this = this
4411 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4412 self.__class__ = NotifyEvent
4413_core_.NotifyEvent_swigregister(NotifyEventPtr)
d55e5bfc
RD
4414
4415#---------------------------------------------------------------------------
4416
5b5c9bc7 4417class ScrollEvent(CommandEvent):
27fb7603
RD
4418 """
4419 A scroll event holds information about events sent from stand-alone
4420 scrollbars and sliders. Note that scrolled windows do not send
4421 instnaces of this event class, but send the `wx.ScrollWinEvent`
4422 instead.
4423 """
d55e5bfc
RD
4424 def __repr__(self):
4425 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4426 def __init__(self, *args, **kwargs):
4427 """
4428 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4429 int orient=0) -> ScrollEvent
d55e5bfc 4430 """
5b5c9bc7 4431 newobj = _core_.new_ScrollEvent(*args, **kwargs)
d55e5bfc
RD
4432 self.this = newobj.this
4433 self.thisown = 1
4434 del newobj.thisown
4435 def GetOrientation(*args, **kwargs):
27fb7603
RD
4436 """
4437 GetOrientation(self) -> int
4438
4439 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4440 the scrollbar.
4441 """
5b5c9bc7 4442 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4443
4444 def GetPosition(*args, **kwargs):
27fb7603
RD
4445 """
4446 GetPosition(self) -> int
4447
4448 Returns the position of the scrollbar.
4449 """
5b5c9bc7 4450 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4451
4452 def SetOrientation(*args, **kwargs):
4453 """SetOrientation(self, int orient)"""
5b5c9bc7 4454 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4455
4456 def SetPosition(*args, **kwargs):
4457 """SetPosition(self, int pos)"""
5b5c9bc7 4458 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
4459
4460
5b5c9bc7 4461class ScrollEventPtr(ScrollEvent):
d55e5bfc
RD
4462 def __init__(self, this):
4463 self.this = this
4464 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4465 self.__class__ = ScrollEvent
4466_core_.ScrollEvent_swigregister(ScrollEventPtr)
d55e5bfc
RD
4467
4468#---------------------------------------------------------------------------
4469
5b5c9bc7 4470class ScrollWinEvent(Event):
27fb7603
RD
4471 """
4472 A wx.ScrollWinEvent holds information about scrolling and is sent from
4473 scrolling windows.
4474 """
d55e5bfc
RD
4475 def __repr__(self):
4476 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4477 def __init__(self, *args, **kwargs):
27fb7603
RD
4478 """
4479 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4480
4481 A wx.ScrollWinEvent holds information about scrolling and is sent from
4482 scrolling windows.
4483 """
5b5c9bc7 4484 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
d55e5bfc
RD
4485 self.this = newobj.this
4486 self.thisown = 1
4487 del newobj.thisown
4488 def GetOrientation(*args, **kwargs):
27fb7603
RD
4489 """
4490 GetOrientation(self) -> int
4491
4492 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4493 the scrollbar.
4494 """
5b5c9bc7 4495 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4496
4497 def GetPosition(*args, **kwargs):
27fb7603
RD
4498 """
4499 GetPosition(self) -> int
4500
4501 Returns the position of the scrollbar for the thumb track and release
4502 events. Note that this field can't be used for the other events, you
4503 need to query the window itself for the current position in that case.
4504 """
5b5c9bc7 4505 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4506
4507 def SetOrientation(*args, **kwargs):
4508 """SetOrientation(self, int orient)"""
5b5c9bc7 4509 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4510
4511 def SetPosition(*args, **kwargs):
4512 """SetPosition(self, int pos)"""
5b5c9bc7 4513 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
4514
4515
5b5c9bc7 4516class ScrollWinEventPtr(ScrollWinEvent):
d55e5bfc
RD
4517 def __init__(self, this):
4518 self.this = this
4519 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4520 self.__class__ = ScrollWinEvent
4521_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
d55e5bfc
RD
4522
4523#---------------------------------------------------------------------------
4524
5b5c9bc7
RD
4525MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4526MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4527MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4528MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4529MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4530class MouseEvent(Event):
27fb7603
RD
4531 """
4532 This event class contains information about the events generated by
4533 the mouse: they include mouse buttons press and release events and
4534 mouse move events.
4535
4536 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4537 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4538 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4539 a middle button so a portable application should avoid relying on the
4540 events from it.
4541
4542 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4543 the former returns true when the event corresponds to the left mouse
4544 button click while the latter returns true if the left mouse button is
4545 currently being pressed. For example, when the user is dragging the
4546 mouse you can use `LeftIsDown` to test whether the left mouse button
4547 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4548 `LeftIsDown` will also return true in wxWidgets whatever the
4549 underlying GUI behaviour is (which is platform-dependent). The same
4550 applies, of course, to other mouse buttons as well.
4551 """
d55e5bfc
RD
4552 def __repr__(self):
4553 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4554 def __init__(self, *args, **kwargs):
27fb7603
RD
4555 """
4556 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4557
4558 Constructs a wx.MouseEvent. Valid event types are:
4559
4560 * wxEVT_ENTER_WINDOW
4561 * wxEVT_LEAVE_WINDOW
4562 * wxEVT_LEFT_DOWN
4563 * wxEVT_LEFT_UP
4564 * wxEVT_LEFT_DCLICK
4565 * wxEVT_MIDDLE_DOWN
4566 * wxEVT_MIDDLE_UP
4567 * wxEVT_MIDDLE_DCLICK
4568 * wxEVT_RIGHT_DOWN
4569 * wxEVT_RIGHT_UP
4570 * wxEVT_RIGHT_DCLICK
4571 * wxEVT_MOTION
4572 * wxEVT_MOUSEWHEEL
4573 """
5b5c9bc7 4574 newobj = _core_.new_MouseEvent(*args, **kwargs)
d55e5bfc
RD
4575 self.this = newobj.this
4576 self.thisown = 1
4577 del newobj.thisown
4578 def IsButton(*args, **kwargs):
27fb7603
RD
4579 """
4580 IsButton(self) -> bool
4581
4582 Returns true if the event was a mouse button event (not necessarily a
4583 button down event - that may be tested using `ButtonDown`).
4584 """
5b5c9bc7 4585 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4586
4587 def ButtonDown(*args, **kwargs):
27fb7603
RD
4588 """
4589 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4590
5ba5649b
RD
4591 If the argument is omitted, this returns true if the event was any
4592 mouse button down event. Otherwise the argument specifies which
4593 button-down event shold be checked for (see `Button` for the possible
4594 values).
27fb7603 4595 """
5b5c9bc7 4596 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4597
4598 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4599 """
4600 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4601
4602 If the argument is omitted, this returns true if the event was any
4603 mouse double click event. Otherwise the argument specifies which
4604 double click event to check for (see `Button` for the possible
4605 values).
4606 """
5b5c9bc7 4607 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4608
4609 def ButtonUp(*args, **kwargs):
27fb7603
RD
4610 """
4611 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4612
4613 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4614 mouse button up event. Otherwise the argument specifies which button
4615 up event to check for (see `Button` for the possible values).
27fb7603 4616 """
5b5c9bc7 4617 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4618
4619 def Button(*args, **kwargs):
27fb7603
RD
4620 """
4621 Button(self, int button) -> bool
4622
4623 Returns true if the identified mouse button is changing state. Valid
4624 values of button are:
4625
4626 ==================== =====================================
4627 wx.MOUSE_BTN_LEFT check if left button was pressed
4628 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4629 wx.MOUSE_BTN_RIGHT check if right button was pressed
4630 wx.MOUSE_BTN_ANY check if any button was pressed
4631 ==================== =====================================
4632
4633 """
5b5c9bc7 4634 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4635
4636 def ButtonIsDown(*args, **kwargs):
4637 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4638 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4639
4640 def GetButton(*args, **kwargs):
27fb7603
RD
4641 """
4642 GetButton(self) -> int
4643
4644 Returns the mouse button which generated this event or
4645 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4646 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4647 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4648 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4649 right buttons respectively.
4650 """
5b5c9bc7 4651 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4652
4653 def ControlDown(*args, **kwargs):
27fb7603
RD
4654 """
4655 ControlDown(self) -> bool
4656
4657 Returns true if the control key was down at the time of the event.
4658 """
5b5c9bc7 4659 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4660
4661 def MetaDown(*args, **kwargs):
27fb7603
RD
4662 """
4663 MetaDown(self) -> bool
4664
4665 Returns true if the Meta key was down at the time of the event.
4666 """
5b5c9bc7 4667 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4668
4669 def AltDown(*args, **kwargs):
27fb7603
RD
4670 """
4671 AltDown(self) -> bool
4672
4673 Returns true if the Alt key was down at the time of the event.
4674 """
5b5c9bc7 4675 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4676
4677 def ShiftDown(*args, **kwargs):
27fb7603
RD
4678 """
4679 ShiftDown(self) -> bool
4680
4681 Returns true if the Shift key was down at the time of the event.
4682 """
5b5c9bc7 4683 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4684
412d302d
RD
4685 def CmdDown(*args, **kwargs):
4686 """
4687 CmdDown(self) -> bool
4688
4689 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4690 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4691 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4692 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4693 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4694 purpose. So for non-Mac platforms this is the same as `ControlDown`
4695 and Macs this is the same as `MetaDown`.
4696 """
5b5c9bc7 4697 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4698
d55e5bfc 4699 def LeftDown(*args, **kwargs):
27fb7603
RD
4700 """
4701 LeftDown(self) -> bool
4702
4703 Returns true if the left mouse button state changed to down.
4704 """
5b5c9bc7 4705 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4706
4707 def MiddleDown(*args, **kwargs):
27fb7603
RD
4708 """
4709 MiddleDown(self) -> bool
4710
4711 Returns true if the middle mouse button state changed to down.
4712 """
5b5c9bc7 4713 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4714
4715 def RightDown(*args, **kwargs):
27fb7603
RD
4716 """
4717 RightDown(self) -> bool
4718
4719 Returns true if the right mouse button state changed to down.
4720 """
5b5c9bc7 4721 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4722
4723 def LeftUp(*args, **kwargs):
27fb7603
RD
4724 """
4725 LeftUp(self) -> bool
4726
4727 Returns true if the left mouse button state changed to up.
4728 """
5b5c9bc7 4729 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4730
4731 def MiddleUp(*args, **kwargs):
27fb7603
RD
4732 """
4733 MiddleUp(self) -> bool
4734
4735 Returns true if the middle mouse button state changed to up.
4736 """
5b5c9bc7 4737 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4738
4739 def RightUp(*args, **kwargs):
27fb7603
RD
4740 """
4741 RightUp(self) -> bool
4742
4743 Returns true if the right mouse button state changed to up.
4744 """
5b5c9bc7 4745 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4746
4747 def LeftDClick(*args, **kwargs):
27fb7603
RD
4748 """
4749 LeftDClick(self) -> bool
4750
4751 Returns true if the event was a left button double click.
4752 """
5b5c9bc7 4753 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4754
4755 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4756 """
4757 MiddleDClick(self) -> bool
4758
4759 Returns true if the event was a middle button double click.
4760 """
5b5c9bc7 4761 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4762
4763 def RightDClick(*args, **kwargs):
27fb7603
RD
4764 """
4765 RightDClick(self) -> bool
4766
4767 Returns true if the event was a right button double click.
4768 """
5b5c9bc7 4769 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4770
4771 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4772 """
4773 LeftIsDown(self) -> bool
4774
4775 Returns true if the left mouse button is currently down, independent
4776 of the current event type.
4777
4778 Please notice that it is not the same as LeftDown which returns true
4779 if the left mouse button was just pressed. Rather, it describes the
4780 state of the mouse button before the event happened.
4781
4782 This event is usually used in the mouse event handlers which process
4783 "move mouse" messages to determine whether the user is (still)
4784 dragging the mouse.
4785 """
5b5c9bc7 4786 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4787
4788 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4789 """
4790 MiddleIsDown(self) -> bool
4791
4792 Returns true if the middle mouse button is currently down, independent
4793 of the current event type.
4794 """
5b5c9bc7 4795 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4796
4797 def RightIsDown(*args, **kwargs):
27fb7603
RD
4798 """
4799 RightIsDown(self) -> bool
4800
4801 Returns true if the right mouse button is currently down, independent
4802 of the current event type.
4803 """
5b5c9bc7 4804 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4805
4806 def Dragging(*args, **kwargs):
27fb7603
RD
4807 """
4808 Dragging(self) -> bool
4809
4810 Returns true if this was a dragging event (motion while a button is
4811 depressed).
4812 """
5b5c9bc7 4813 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4814
4815 def Moving(*args, **kwargs):
27fb7603
RD
4816 """
4817 Moving(self) -> bool
4818
4819 Returns true if this was a motion event and no mouse buttons were
4820 pressed. If any mouse button is held pressed, then this method returns
4821 false and Dragging returns true.
4822 """
5b5c9bc7 4823 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4824
4825 def Entering(*args, **kwargs):
27fb7603
RD
4826 """
4827 Entering(self) -> bool
4828
4829 Returns true if the mouse was entering the window.
4830 """
5b5c9bc7 4831 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4832
4833 def Leaving(*args, **kwargs):
27fb7603
RD
4834 """
4835 Leaving(self) -> bool
4836
4837 Returns true if the mouse was leaving the window.
4838 """
5b5c9bc7 4839 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4840
4841 def GetPosition(*args, **kwargs):
4842 """
5b5c9bc7 4843 GetPosition(self) -> Point
d55e5bfc 4844
27fb7603
RD
4845 Returns the pixel position of the mouse in window coordinates when the
4846 event happened.
d55e5bfc 4847 """
5b5c9bc7 4848 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4849
4850 def GetPositionTuple(*args, **kwargs):
4851 """
4852 GetPositionTuple() -> (x,y)
4853
27fb7603
RD
4854 Returns the pixel position of the mouse in window coordinates when the
4855 event happened.
d55e5bfc 4856 """
5b5c9bc7 4857 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4858
4859 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4860 """
4861 GetLogicalPosition(self, DC dc) -> Point
4862
4863 Returns the logical mouse position in pixels (i.e. translated
4864 according to the translation set for the DC, which usually indicates
4865 that the window has been scrolled).
4866 """
5b5c9bc7 4867 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
4868
4869 def GetX(*args, **kwargs):
27fb7603
RD
4870 """
4871 GetX(self) -> int
4872
4873 Returns X coordinate of the physical mouse event position.
4874 """
5b5c9bc7 4875 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4876
4877 def GetY(*args, **kwargs):
27fb7603
RD
4878 """
4879 GetY(self) -> int
4880
4881 Returns Y coordinate of the physical mouse event position.
4882 """
5b5c9bc7 4883 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4884
4885 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4886 """
4887 GetWheelRotation(self) -> int
4888
4889 Get wheel rotation, positive or negative indicates direction of
4890 rotation. Current devices all send an event when rotation is equal to
4891 +/-WheelDelta, but this allows for finer resolution devices to be
4892 created in the future. Because of this you shouldn't assume that one
4893 event is equal to 1 line or whatever, but you should be able to either
4894 do partial line scrolling or wait until +/-WheelDelta rotation values
4895 have been accumulated before scrolling.
4896 """
5b5c9bc7 4897 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
4898
4899 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4900 """
4901 GetWheelDelta(self) -> int
4902
4903 Get wheel delta, normally 120. This is the threshold for action to be
4904 taken, and one such action (for example, scrolling one increment)
4905 should occur for each delta.
4906 """
5b5c9bc7 4907 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
4908
4909 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4910 """
4911 GetLinesPerAction(self) -> int
4912
4913 Returns the configured number of lines (or whatever) to be scrolled
4914 per wheel action. Defaults to three.
4915 """
5b5c9bc7 4916 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
4917
4918 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4919 """
4920 IsPageScroll(self) -> bool
4921
4922 Returns true if the system has been setup to do page scrolling with
4923 the mouse wheel instead of line scrolling.
4924 """
5b5c9bc7
RD
4925 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4926
4927 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4928 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4929 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4930 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4931 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4932 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4933 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4934 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4935 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4936 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4937 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4938 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4939
4940class MouseEventPtr(MouseEvent):
d55e5bfc
RD
4941 def __init__(self, this):
4942 self.this = this
4943 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4944 self.__class__ = MouseEvent
4945_core_.MouseEvent_swigregister(MouseEventPtr)
d55e5bfc
RD
4946
4947#---------------------------------------------------------------------------
4948
5b5c9bc7 4949class SetCursorEvent(Event):
5ba5649b
RD
4950 """
4951 A SetCursorEvent is generated when the mouse cursor is about to be set
4952 as a result of mouse motion. This event gives the application the
4953 chance to perform specific mouse cursor processing based on the
4954 current position of the mouse within the window. Use the `SetCursor`
4955 method to specify the cursor you want to be displayed.
4956 """
d55e5bfc
RD
4957 def __repr__(self):
4958 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4959 def __init__(self, *args, **kwargs):
5ba5649b
RD
4960 """
4961 __init__(self, int x=0, int y=0) -> SetCursorEvent
4962
4963 Construct a new `wx.SetCursorEvent`.
4964 """
5b5c9bc7 4965 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
d55e5bfc
RD
4966 self.this = newobj.this
4967 self.thisown = 1
4968 del newobj.thisown
4969 def GetX(*args, **kwargs):
5ba5649b
RD
4970 """
4971 GetX(self) -> int
4972
4973 Returns the X coordinate of the mouse in client coordinates.
4974 """
5b5c9bc7 4975 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4976
4977 def GetY(*args, **kwargs):
5ba5649b
RD
4978 """
4979 GetY(self) -> int
4980
4981 Returns the Y coordinate of the mouse in client coordinates.
4982 """
5b5c9bc7 4983 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4984
4985 def SetCursor(*args, **kwargs):
5ba5649b
RD
4986 """
4987 SetCursor(self, Cursor cursor)
4988
4989 Sets the cursor associated with this event.
4990 """
5b5c9bc7 4991 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
4992
4993 def GetCursor(*args, **kwargs):
5ba5649b
RD
4994 """
4995 GetCursor(self) -> Cursor
4996
4997 Returns a reference to the cursor specified by this event.
4998 """
5b5c9bc7 4999 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
5000
5001 def HasCursor(*args, **kwargs):
5ba5649b
RD
5002 """
5003 HasCursor(self) -> bool
5004
5005 Returns true if the cursor specified by this event is a valid cursor.
5006 """
5b5c9bc7 5007 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc
RD
5008
5009
5b5c9bc7 5010class SetCursorEventPtr(SetCursorEvent):
d55e5bfc
RD
5011 def __init__(self, this):
5012 self.this = this
5013 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5014 self.__class__ = SetCursorEvent
5015_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
d55e5bfc
RD
5016
5017#---------------------------------------------------------------------------
5018
5b5c9bc7 5019class KeyEvent(Event):
5ba5649b
RD
5020 """
5021 This event class contains information about keypress and character
5022 events. These events are only sent to the widget that currently has
5023 the keyboard focus.
5024
5025 Notice that there are three different kinds of keyboard events in
5026 wxWidgets: key down and up events and char events. The difference
5027 between the first two is clear - the first corresponds to a key press
5028 and the second to a key release - otherwise they are identical. Just
5029 note that if the key is maintained in a pressed state you will
5030 typically get a lot of (automatically generated) down events but only
5031 one up so it is wrong to assume that there is one up event
5032 corresponding to each down one.
5033
5034 Both key events provide untranslated key codes while the char event
5035 carries the translated one. The untranslated code for alphanumeric
5036 keys is always an upper case value. For the other keys it is one of
5037 WXK_XXX values from the keycodes table. The translated key is, in
5038 general, the character the user expects to appear as the result of the
5039 key combination when typing the text into a text entry zone, for
5040 example.
5041
5042 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5043 and the standard US keyboard): when the 'A' key is pressed, the key
5044 down event key code is equal to ASCII A == 65. But the char event key
5045 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5046 'A' keys simultaneously , the key code in key down event will still be
5047 just 'A' while the char event key code parameter will now be 'A' as
5048 well.
5049
5050 Although in this simple case it is clear that the correct key code
5051 could be found in the key down event handler by checking the value
5052 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5053 as for non alphanumeric keys or non-US keyboard layouts the
5054 translation is keyboard-layout dependent and can only be done properly
5055 by the system itself.
5056
5057 Another kind of translation is done when the control key is pressed:
5058 for example, for CTRL-A key press the key down event still carries the
5059 same key code 'A' as usual but the char event will have key code of 1,
5060 the ASCII value of this key combination.
5061
5062 You may discover how the other keys on your system behave
5063 interactively by running the KeyEvents sample in the wxPython demo and
5064 pressing some keys while the blue box at the top has the keyboard
5065 focus.
5066
5067 **Note**: If a key down event is caught and the event handler does not
5068 call event.Skip() then the coresponding char event will not
5069 happen. This is by design and enables the programs that handle both
5070 types of events to be a bit simpler.
5071
5072 **Note for Windows programmers**: The key and char events in wxWidgets
5073 are similar to but slightly different from Windows WM_KEYDOWN and
5074 WM_CHAR events. In particular, Alt-x combination will generate a char
5075 event in wxWidgets (unless it is used as an accelerator).
5076
5077 **Tip**: be sure to call event.Skip() for events that you don't
5078 process in key event function, otherwise menu shortcuts may cease to
5079 work under Windows.
5080
5081 """
d55e5bfc
RD
5082 def __repr__(self):
5083 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5084 def __init__(self, *args, **kwargs):
5ba5649b
RD
5085 """
5086 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
5087
5088 Construct a new `wx.KeyEvent`. Valid event types are:
5089 *
5090 """
5b5c9bc7 5091 newobj = _core_.new_KeyEvent(*args, **kwargs)
d55e5bfc
RD
5092 self.this = newobj.this
5093 self.thisown = 1
5094 del newobj.thisown
5095 def ControlDown(*args, **kwargs):
5ba5649b
RD
5096 """
5097 ControlDown(self) -> bool
5098
5099 Returns ``True`` if the Control key was down at the time of the event.
5100 """
5b5c9bc7 5101 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
5102
5103 def MetaDown(*args, **kwargs):
5ba5649b
RD
5104 """
5105 MetaDown(self) -> bool
5106
5107 Returns ``True`` if the Meta key was down at the time of the event.
5108 """
5b5c9bc7 5109 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
5110
5111 def AltDown(*args, **kwargs):
5ba5649b
RD
5112 """
5113 AltDown(self) -> bool
5114
5115 Returns ``True`` if the Alt key was down at the time of the event.
5116 """
5b5c9bc7 5117 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
5118
5119 def ShiftDown(*args, **kwargs):
5ba5649b
RD
5120 """
5121 ShiftDown(self) -> bool
5122
5123 Returns ``True`` if the Shift key was down at the time of the event.
5124 """
5b5c9bc7 5125 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 5126
412d302d
RD
5127 def CmdDown(*args, **kwargs):
5128 """
5129 CmdDown(self) -> bool
5130
5131 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5132 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5133 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5134 because Cmd key is used for the same thing under Mac as Ctrl
5135 elsewhere. The Ctrl still exists, it's just not used for this
5136 purpose. So for non-Mac platforms this is the same as `ControlDown`
5137 and Macs this is the same as `MetaDown`.
5138 """
5b5c9bc7 5139 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 5140
d55e5bfc 5141 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5142 """
5143 HasModifiers(self) -> bool
5144
5145 Returns true if either CTRL or ALT keys was down at the time of the
5146 key event. Note that this function does not take into account neither
5147 SHIFT nor META key states (the reason for ignoring the latter is that
5148 it is common for NUMLOCK key to be configured as META under X but the
5149 key presses even while NUMLOCK is on should be still processed
5150 normally).
5151 """
5b5c9bc7 5152 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
5153
5154 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5155 """
5156 GetKeyCode(self) -> int
5157
5158 Returns the virtual key code. ASCII events return normal ASCII values,
5159 while non-ASCII events return values such as WXK_LEFT for the left
5160 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5161 codes.
5162
5163 Note that in Unicode build, the returned value is meaningful only if
5164 the user entered a character that can be represented in current
5165 locale's default charset. You can obtain the corresponding Unicode
5166 character using `GetUnicodeKey`.
5167 """
5b5c9bc7 5168 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
5169
5170 KeyCode = GetKeyCode
bb4524c4 5171 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5172 """
5173 GetUnicodeKey(self) -> int
5174
5175 Returns the Unicode character corresponding to this key event. This
5176 function is only meaningfule in a Unicode build of wxPython.
5177 """
5b5c9bc7 5178 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 5179
bb4524c4 5180 GetUniChar = GetUnicodeKey
d55e5bfc 5181 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5182 """
5183 GetRawKeyCode(self) -> unsigned int
5184
5185 Returns the raw key code for this event. This is a platform-dependent
5186 scan code which should only be used in advanced
5187 applications. Currently the raw key codes are not supported by all
5188 ports.
5189 """
5b5c9bc7 5190 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
5191
5192 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5193 """
5194 GetRawKeyFlags(self) -> unsigned int
5195
5196 Returns the low level key flags for this event. The flags are
5197 platform-dependent and should only be used in advanced applications.
5198 Currently the raw key flags are not supported by all ports.
5199 """
5b5c9bc7 5200 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
5201
5202 def GetPosition(*args, **kwargs):
5203 """
5b5c9bc7 5204 GetPosition(self) -> Point
d55e5bfc 5205
5ba5649b 5206 Find the position of the event, if applicable.
d55e5bfc 5207 """
5b5c9bc7 5208 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5209
5210 def GetPositionTuple(*args, **kwargs):
5211 """
5212 GetPositionTuple() -> (x,y)
5213
5ba5649b 5214 Find the position of the event, if applicable.
d55e5bfc 5215 """
5b5c9bc7 5216 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
5217
5218 def GetX(*args, **kwargs):
5ba5649b
RD
5219 """
5220 GetX(self) -> int
5221
5222 Returns the X position (in client coordinates) of the event, if
5223 applicable.
5224 """
5b5c9bc7 5225 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
5226
5227 def GetY(*args, **kwargs):
5ba5649b
RD
5228 """
5229 GetY(self) -> int
5230
5231 Returns the Y position (in client coordinates) of the event, if
5232 applicable.
5233 """
5b5c9bc7
RD
5234 return _core_.KeyEvent_GetY(*args, **kwargs)
5235
5236 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5237 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5238 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5239 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5240 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5241 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5242 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5243 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5244 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5245 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5246
5247class KeyEventPtr(KeyEvent):
d55e5bfc
RD
5248 def __init__(self, this):
5249 self.this = this
5250 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5251 self.__class__ = KeyEvent
5252_core_.KeyEvent_swigregister(KeyEventPtr)
d55e5bfc
RD
5253
5254#---------------------------------------------------------------------------
5255
5b5c9bc7 5256class SizeEvent(Event):
5ba5649b
RD
5257 """
5258 A size event holds information about size change events. The EVT_SIZE
5259 handler function will be called when the window it is bound to has
5260 been resized.
5261
5262 Note that the size passed is of the whole window: call
5263 `wx.Window.GetClientSize` for the area which may be used by the
5264 application.
5265
5266 When a window is resized, usually only a small part of the window is
5267 damaged and and that area is all that is in the update region for the
5268 next paint event. However, if your drawing depends on the size of the
5269 window, you may need to clear the DC explicitly and repaint the whole
5270 window. In which case, you may need to call `wx.Window.Refresh` to
5271 invalidate the entire window.
5272
5273 """
d55e5bfc
RD
5274 def __repr__(self):
5275 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5276 def __init__(self, *args, **kwargs):
5ba5649b
RD
5277 """
5278 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5279
5280 Construct a new ``wx.SizeEvent``.
5281 """
5b5c9bc7 5282 newobj = _core_.new_SizeEvent(*args, **kwargs)
d55e5bfc
RD
5283 self.this = newobj.this
5284 self.thisown = 1
5285 del newobj.thisown
5286 def GetSize(*args, **kwargs):
5ba5649b
RD
5287 """
5288 GetSize(self) -> Size
5289
5290 Returns the entire size of the window generating the size change
5291 event.
5292 """
5b5c9bc7 5293 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
5294
5295 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5296 """GetRect(self) -> Rect"""
5297 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5298
5299 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5300 """SetRect(self, Rect rect)"""
5301 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5302
5303 def SetSize(*args, **kwargs):
5b5c9bc7
RD
5304 """SetSize(self, Size size)"""
5305 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 5306
5b5c9bc7
RD
5307 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5308 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
d55e5bfc 5309
5b5c9bc7 5310class SizeEventPtr(SizeEvent):
d55e5bfc
RD
5311 def __init__(self, this):
5312 self.this = this
5313 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5314 self.__class__ = SizeEvent
5315_core_.SizeEvent_swigregister(SizeEventPtr)
d55e5bfc
RD
5316
5317#---------------------------------------------------------------------------
5318
5b5c9bc7 5319class MoveEvent(Event):
5ba5649b
RD
5320 """
5321 This event object is sent for EVT_MOVE event bindings when a window is
5322 moved to a new position.
5323 """
d55e5bfc
RD
5324 def __repr__(self):
5325 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5326 def __init__(self, *args, **kwargs):
5ba5649b
RD
5327 """
5328 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5329
5330 Constructor.
5331 """
5b5c9bc7 5332 newobj = _core_.new_MoveEvent(*args, **kwargs)
d55e5bfc
RD
5333 self.this = newobj.this
5334 self.thisown = 1
5335 del newobj.thisown
5336 def GetPosition(*args, **kwargs):
5ba5649b
RD
5337 """
5338 GetPosition(self) -> Point
5339
5340 Returns the position of the window generating the move change event.
5341 """
5b5c9bc7 5342 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5343
5344 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5345 """GetRect(self) -> Rect"""
5346 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5347
5348 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5349 """SetRect(self, Rect rect)"""
5350 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5351
5352 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
5353 """SetPosition(self, Point pos)"""
5354 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 5355
fef4c27a
RD
5356 m_pos = property(GetPosition, SetPosition)
5357 m_rect = property(GetRect, SetRect)
5358
d55e5bfc 5359
5b5c9bc7 5360class MoveEventPtr(MoveEvent):
d55e5bfc
RD
5361 def __init__(self, this):
5362 self.this = this
5363 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5364 self.__class__ = MoveEvent
5365_core_.MoveEvent_swigregister(MoveEventPtr)
d55e5bfc
RD
5366
5367#---------------------------------------------------------------------------
5368
5b5c9bc7 5369class PaintEvent(Event):
5ba5649b
RD
5370 """
5371 A paint event is sent when a window's contents needs to be repainted.
5372 Note that in an EVT_PAINT handler the application must *always* create
5373 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5374 Windows assumes that the window has not been painted yet and will send
5375 the event again, causing endless refreshes.
5376
5377 You can optimize painting by retrieving the rectangles that have been
5378 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5379 and only repainting these rectangles. The rectangles are in terms of
5380 the client area, and are unscrolled, so you will need to do some
5381 calculations using the current view position to obtain logical,
5382 scrolled units.
5383
5384 """
d55e5bfc
RD
5385 def __repr__(self):
5386 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5387 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
5388 """__init__(self, int Id=0) -> PaintEvent"""
5389 newobj = _core_.new_PaintEvent(*args, **kwargs)
d55e5bfc
RD
5390 self.this = newobj.this
5391 self.thisown = 1
5392 del newobj.thisown
5393
5b5c9bc7 5394class PaintEventPtr(PaintEvent):
d55e5bfc
RD
5395 def __init__(self, this):
5396 self.this = this
5397 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5398 self.__class__ = PaintEvent
5399_core_.PaintEvent_swigregister(PaintEventPtr)
d55e5bfc 5400
5b5c9bc7
RD
5401class NcPaintEvent(Event):
5402 """Proxy of C++ NcPaintEvent class"""
d55e5bfc
RD
5403 def __repr__(self):
5404 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5405 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
5406 """__init__(self, int winid=0) -> NcPaintEvent"""
5407 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
d55e5bfc
RD
5408 self.this = newobj.this
5409 self.thisown = 1
5410 del newobj.thisown
5411
5b5c9bc7 5412class NcPaintEventPtr(NcPaintEvent):
d55e5bfc
RD
5413 def __init__(self, this):
5414 self.this = this
5415 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5416 self.__class__ = NcPaintEvent
5417_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
d55e5bfc
RD
5418
5419#---------------------------------------------------------------------------
5420
5b5c9bc7 5421class EraseEvent(Event):
5ba5649b
RD
5422 """
5423 An erase event is sent whenever the background of a window needs to be
5424 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5425 binder. On some platforms, such as GTK+, this event is simulated
5426 (simply generated just before the paint event) and may cause flicker.
5427
5428 To paint a custom background use the `GetDC` method and use the returned
5429 device context if it is not ``None``, otherwise create a temporary
5430 `wx.ClientDC` and draw on that.
5431
5432 """
d55e5bfc
RD
5433 def __repr__(self):
5434 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5435 def __init__(self, *args, **kwargs):
5ba5649b
RD
5436 """
5437 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5438
5439 Constructor
5440 """
5b5c9bc7 5441 newobj = _core_.new_EraseEvent(*args, **kwargs)
d55e5bfc
RD
5442 self.this = newobj.this
5443 self.thisown = 1
5444 del newobj.thisown
5445 def GetDC(*args, **kwargs):
5ba5649b
RD
5446 """
5447 GetDC(self) -> DC
5448
5449 Returns the device context the event handler should draw upon. If
5450 ``None`` is returned then create a temporary `wx.ClientDC` and use
5451 that instead.
5452 """
5b5c9bc7 5453 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc
RD
5454
5455
5b5c9bc7 5456class EraseEventPtr(EraseEvent):
d55e5bfc
RD
5457 def __init__(self, this):
5458 self.this = this
5459 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5460 self.__class__ = EraseEvent
5461_core_.EraseEvent_swigregister(EraseEventPtr)
d55e5bfc
RD
5462
5463#---------------------------------------------------------------------------
5464
5b5c9bc7 5465class FocusEvent(Event):
5ba5649b
RD
5466 """
5467 A focus event is sent when a window's focus changes. The window losing
5468 focus receives an EVT_KILL_FOCUS event while the window gaining it
5469 gets an EVT_SET_FOCUS event.
5470
5471 Notice that the set focus event happens both when the user gives focus
5472 to the window (whether using the mouse or keyboard) and when it is
5473 done from the program itself using `wx.Window.SetFocus`.
5474
5475 """
d55e5bfc
RD
5476 def __repr__(self):
5477 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5478 def __init__(self, *args, **kwargs):
5ba5649b
RD
5479 """
5480 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5481
5482 Constructor
5483 """
5b5c9bc7 5484 newobj = _core_.new_FocusEvent(*args, **kwargs)
d55e5bfc
RD
5485 self.this = newobj.this
5486 self.thisown = 1
5487 del newobj.thisown
5488 def GetWindow(*args, **kwargs):
5ba5649b
RD
5489 """
5490 GetWindow(self) -> Window
5491
5492 Returns the other window associated with this event, that is the
5493 window which had the focus before for the EVT_SET_FOCUS event and the
5494 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5495
5496 Warning: the window returned may be None!
5497 """
5b5c9bc7 5498 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5499
5500 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5501 """SetWindow(self, Window win)"""
5502 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc
RD
5503
5504
5b5c9bc7 5505class FocusEventPtr(FocusEvent):
d55e5bfc
RD
5506 def __init__(self, this):
5507 self.this = this
5508 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5509 self.__class__ = FocusEvent
5510_core_.FocusEvent_swigregister(FocusEventPtr)
d55e5bfc
RD
5511
5512#---------------------------------------------------------------------------
5513
5b5c9bc7 5514class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5515 """
5516 wx.ChildFocusEvent notifies the parent that a child has received the
5517 focus. Unlike `wx.FocusEvent` it is propagated up the window
5518 heirarchy.
5519 """
d55e5bfc
RD
5520 def __repr__(self):
5521 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5522 def __init__(self, *args, **kwargs):
5ba5649b
RD
5523 """
5524 __init__(self, Window win=None) -> ChildFocusEvent
5525
5526 Constructor
5527 """
5b5c9bc7 5528 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
d55e5bfc
RD
5529 self.this = newobj.this
5530 self.thisown = 1
5531 del newobj.thisown
5532 def GetWindow(*args, **kwargs):
5ba5649b
RD
5533 """
5534 GetWindow(self) -> Window
5535
5536 The window which has just received the focus.
5537 """
5b5c9bc7 5538 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5539
5540
5b5c9bc7 5541class ChildFocusEventPtr(ChildFocusEvent):
d55e5bfc
RD
5542 def __init__(self, this):
5543 self.this = this
5544 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5545 self.__class__ = ChildFocusEvent
5546_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
d55e5bfc
RD
5547
5548#---------------------------------------------------------------------------
5549
5b5c9bc7 5550class ActivateEvent(Event):
5ba5649b
RD
5551 """
5552 An activate event is sent when a top-level window or the entire
5553 application is being activated or deactivated.
5554
5555 A top-level window (a dialog or frame) receives an activate event when
5556 is being activated or deactivated. This is indicated visually by the
5557 title bar changing colour, and a subwindow gaining the keyboard focus.
5558 An application is activated or deactivated when one of its frames
5559 becomes activated, or a frame becomes inactivate resulting in all
5560 application frames being inactive.
5561
5562 Please note that usually you should call event.Skip() in your handlers
5563 for these events so the default handlers will still be called, as not
5564 doing so can result in strange effects.
5565
5566 """
d55e5bfc
RD
5567 def __repr__(self):
5568 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5569 def __init__(self, *args, **kwargs):
5ba5649b
RD
5570 """
5571 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5572
5573 Constructor
5574 """
5b5c9bc7 5575 newobj = _core_.new_ActivateEvent(*args, **kwargs)
d55e5bfc
RD
5576 self.this = newobj.this
5577 self.thisown = 1
5578 del newobj.thisown
5579 def GetActive(*args, **kwargs):
5ba5649b
RD
5580 """
5581 GetActive(self) -> bool
5582
5583 Returns true if the application or window is being activated, false
5584 otherwise.
5585 """
5b5c9bc7 5586 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc
RD
5587
5588
5b5c9bc7 5589class ActivateEventPtr(ActivateEvent):
d55e5bfc
RD
5590 def __init__(self, this):
5591 self.this = this
5592 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5593 self.__class__ = ActivateEvent
5594_core_.ActivateEvent_swigregister(ActivateEventPtr)
d55e5bfc
RD
5595
5596#---------------------------------------------------------------------------
5597
5b5c9bc7 5598class InitDialogEvent(Event):
5ba5649b
RD
5599 """
5600 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5601 any window when `wx.Window.InitDialog` is called. Handlers for this
5602 event can transfer data to the window, or anything else that should be
5603 done before the user begins editing the form. The default handler
5604 calls `wx.Window.TransferDataToWindow`.
5605 """
d55e5bfc
RD
5606 def __repr__(self):
5607 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5608 def __init__(self, *args, **kwargs):
5ba5649b
RD
5609 """
5610 __init__(self, int Id=0) -> InitDialogEvent
5611
5612 Constructor
5613 """
5b5c9bc7 5614 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
d55e5bfc
RD
5615 self.this = newobj.this
5616 self.thisown = 1
5617 del newobj.thisown
5618
5b5c9bc7 5619class InitDialogEventPtr(InitDialogEvent):
d55e5bfc
RD
5620 def __init__(self, this):
5621 self.this = this
5622 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5623 self.__class__ = InitDialogEvent
5624_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
d55e5bfc
RD
5625
5626#---------------------------------------------------------------------------
5627
5b5c9bc7 5628class MenuEvent(Event):
5ba5649b
RD
5629 """
5630 This class is used for a variety of menu-related events. Note that
5631 these do not include menu command events, which are handled by sending
5632 `wx.CommandEvent` objects.
5633
5634 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5635 text in the first field of the status bar.
5636 """
d55e5bfc
RD
5637 def __repr__(self):
5638 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5639 def __init__(self, *args, **kwargs):
5ba5649b
RD
5640 """
5641 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5642
5643 Constructor
5644 """
5b5c9bc7 5645 newobj = _core_.new_MenuEvent(*args, **kwargs)
d55e5bfc
RD
5646 self.this = newobj.this
5647 self.thisown = 1
5648 del newobj.thisown
5649 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5650 """
5651 GetMenuId(self) -> int
5652
5653 Returns the menu identifier associated with the event. This method
5654 should be only used with the HIGHLIGHT events.
5655 """
5b5c9bc7 5656 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5657
5658 def IsPopup(*args, **kwargs):
5ba5649b
RD
5659 """
5660 IsPopup(self) -> bool
5661
5662 Returns ``True`` if the menu which is being opened or closed is a
5663 popup menu, ``False`` if it is a normal one. This method should only
5664 be used with the OPEN and CLOSE events.
5665 """
5b5c9bc7 5666 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5667
5668 def GetMenu(*args, **kwargs):
5ba5649b
RD
5669 """
5670 GetMenu(self) -> Menu
5671
5672 Returns the menu which is being opened or closed. This method should
5673 only be used with the OPEN and CLOSE events.
5674 """
5b5c9bc7 5675 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc
RD
5676
5677
5b5c9bc7 5678class MenuEventPtr(MenuEvent):
d55e5bfc
RD
5679 def __init__(self, this):
5680 self.this = this
5681 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5682 self.__class__ = MenuEvent
5683_core_.MenuEvent_swigregister(MenuEventPtr)
d55e5bfc
RD
5684
5685#---------------------------------------------------------------------------
5686
5b5c9bc7 5687class CloseEvent(Event):
5ba5649b
RD
5688 """
5689 This event class contains information about window and session close
5690 events.
5691
5692 The handler function for EVT_CLOSE is called when the user has tried
5693 to close a a frame or dialog box using the window manager controls or
5694 the system menu. It can also be invoked by the application itself
5695 programmatically, for example by calling the `wx.Window.Close`
5696 function.
5697
5698 You should check whether the application is forcing the deletion of
5699 the window using `CanVeto`. If it returns ``False``, you must destroy
5700 the window using `wx.Window.Destroy`. If the return value is ``True``,
5701 it is up to you whether you respond by destroying the window or not.
5702 For example you may wish to display a message dialog prompting to save
5703 files or to cancel the close.
5704
5705 If you don't destroy the window, you should call `Veto` to let the
5706 calling code know that you did not destroy the window. This allows the
5707 `wx.Window.Close` function to return ``True`` or ``False`` depending
5708 on whether the close instruction was honored or not.
5709 """
d55e5bfc
RD
5710 def __repr__(self):
5711 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5712 def __init__(self, *args, **kwargs):
5ba5649b
RD
5713 """
5714 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5715
5716 Constructor.
5717 """
5b5c9bc7 5718 newobj = _core_.new_CloseEvent(*args, **kwargs)
d55e5bfc
RD
5719 self.this = newobj.this
5720 self.thisown = 1
5721 del newobj.thisown
5722 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5723 """
5724 SetLoggingOff(self, bool logOff)
5725
5726 Sets the 'logging off' flag.
5727 """
5b5c9bc7 5728 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5729
5730 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5731 """
5732 GetLoggingOff(self) -> bool
5733
034e3677
RD
5734 Returns ``True`` if the user is logging off or ``False`` if the
5735 system is shutting down. This method can only be called for end
5736 session and query end session events, it doesn't make sense for close
5737 window event.
5ba5649b 5738 """
5b5c9bc7 5739 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5740
5741 def Veto(*args, **kwargs):
5ba5649b
RD
5742 """
5743 Veto(self, bool veto=True)
5744
5745 Call this from your event handler to veto a system shutdown or to
5746 signal to the calling application that a window close did not happen.
5747
5748 You can only veto a shutdown or close if `CanVeto` returns true.
5749 """
5b5c9bc7 5750 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5751
5ba5649b
RD
5752 def GetVeto(*args, **kwargs):
5753 """GetVeto(self) -> bool"""
5754 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5755
d55e5bfc 5756 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5757 """
5758 SetCanVeto(self, bool canVeto)
5759
5760 Sets the 'can veto' flag.
5761 """
5b5c9bc7 5762 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5763
5764 def CanVeto(*args, **kwargs):
5ba5649b
RD
5765 """
5766 CanVeto(self) -> bool
d55e5bfc 5767
5ba5649b
RD
5768 Returns true if you can veto a system shutdown or a window close
5769 event. Vetoing a window close event is not possible if the calling
5770 code wishes to force the application to exit, and so this function
5771 must be called to check this.
5772 """
5773 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc
RD
5774
5775
5b5c9bc7 5776class CloseEventPtr(CloseEvent):
d55e5bfc
RD
5777 def __init__(self, this):
5778 self.this = this
5779 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5780 self.__class__ = CloseEvent
5781_core_.CloseEvent_swigregister(CloseEventPtr)
d55e5bfc
RD
5782
5783#---------------------------------------------------------------------------
5784
5b5c9bc7 5785class ShowEvent(Event):
5ba5649b 5786 """An EVT_SHOW event is sent when a window is shown or hidden."""
d55e5bfc
RD
5787 def __repr__(self):
5788 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5789 def __init__(self, *args, **kwargs):
5ba5649b
RD
5790 """
5791 __init__(self, int winid=0, bool show=False) -> ShowEvent
5792
5793 An EVT_SHOW event is sent when a window is shown or hidden.
5794 """
5b5c9bc7 5795 newobj = _core_.new_ShowEvent(*args, **kwargs)
d55e5bfc
RD
5796 self.this = newobj.this
5797 self.thisown = 1
5798 del newobj.thisown
5799 def SetShow(*args, **kwargs):
5800 """SetShow(self, bool show)"""
5b5c9bc7 5801 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5802
5803 def GetShow(*args, **kwargs):
5804 """GetShow(self) -> bool"""
5b5c9bc7 5805 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc
RD
5806
5807
5b5c9bc7 5808class ShowEventPtr(ShowEvent):
d55e5bfc
RD
5809 def __init__(self, this):
5810 self.this = this
5811 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5812 self.__class__ = ShowEvent
5813_core_.ShowEvent_swigregister(ShowEventPtr)
d55e5bfc
RD
5814
5815#---------------------------------------------------------------------------
5816
5b5c9bc7 5817class IconizeEvent(Event):
5ba5649b
RD
5818 """
5819 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5820 restored.
5821 """
d55e5bfc
RD
5822 def __repr__(self):
5823 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5824 def __init__(self, *args, **kwargs):
5ba5649b
RD
5825 """
5826 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5827
5828 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5829 restored.
5830 """
5b5c9bc7 5831 newobj = _core_.new_IconizeEvent(*args, **kwargs)
d55e5bfc
RD
5832 self.this = newobj.this
5833 self.thisown = 1
5834 del newobj.thisown
5835 def Iconized(*args, **kwargs):
5ba5649b
RD
5836 """
5837 Iconized(self) -> bool
5838
5839 Returns ``True`` if the frame has been iconized, ``False`` if it has
5840 been restored.
5841 """
5b5c9bc7 5842 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc
RD
5843
5844
5b5c9bc7 5845class IconizeEventPtr(IconizeEvent):
d55e5bfc
RD
5846 def __init__(self, this):
5847 self.this = this
5848 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5849 self.__class__ = IconizeEvent
5850_core_.IconizeEvent_swigregister(IconizeEventPtr)
d55e5bfc
RD
5851
5852#---------------------------------------------------------------------------
5853
5b5c9bc7 5854class MaximizeEvent(Event):
5ba5649b 5855 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
d55e5bfc
RD
5856 def __repr__(self):
5857 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5858 def __init__(self, *args, **kwargs):
5ba5649b
RD
5859 """
5860 __init__(self, int id=0) -> MaximizeEvent
5861
5862 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5863 """
5b5c9bc7 5864 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
d55e5bfc
RD
5865 self.this = newobj.this
5866 self.thisown = 1
5867 del newobj.thisown
5868
5b5c9bc7 5869class MaximizeEventPtr(MaximizeEvent):
d55e5bfc
RD
5870 def __init__(self, this):
5871 self.this = this
5872 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5873 self.__class__ = MaximizeEvent
5874_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
d55e5bfc
RD
5875
5876#---------------------------------------------------------------------------
5877
5b5c9bc7 5878class DropFilesEvent(Event):
5ba5649b
RD
5879 """
5880 This class is used for drop files events, that is, when files have
5881 been dropped onto the window. This functionality is only available
5882 under Windows. The window must have previously been enabled for
5883 dropping by calling `wx.Window.DragAcceptFiles`.
5884
5885 Important note: this is a separate implementation to the more general
5886 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5887 implementation uses the older, Windows message-based approach of
5888 dropping files.
5889
5890 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5891 events.
5892
5893 """
d55e5bfc
RD
5894 def __init__(self): raise RuntimeError, "No constructor defined"
5895 def __repr__(self):
5896 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5897 def GetPosition(*args, **kwargs):
5ba5649b
RD
5898 """
5899 GetPosition(self) -> Point
5900
5901 Returns the position at which the files were dropped.
5902 """
5b5c9bc7 5903 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5904
5905 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5906 """
5907 GetNumberOfFiles(self) -> int
5908
5909 Returns the number of files dropped.
5910 """
5b5c9bc7 5911 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5912
5913 def GetFiles(*args, **kwargs):
5ba5649b
RD
5914 """
5915 GetFiles(self) -> PyObject
5916
5917 Returns a list of the filenames that were dropped.
5918 """
5b5c9bc7 5919 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc
RD
5920
5921
5b5c9bc7 5922class DropFilesEventPtr(DropFilesEvent):
d55e5bfc
RD
5923 def __init__(self, this):
5924 self.this = this
5925 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5926 self.__class__ = DropFilesEvent
5927_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
d55e5bfc
RD
5928
5929#---------------------------------------------------------------------------
5930
5b5c9bc7
RD
5931UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5932UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5933class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5934 """
5935 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5936 wxWidgets to give an application the chance to update various user
5937 interface elements.
5938
5939 Without update UI events, an application has to work hard to
5940 check/uncheck, enable/disable, and set the text for elements such as
5941 menu items and toolbar buttons. The code for doing this has to be
5942 mixed up with the code that is invoked when an action is invoked for a
5943 menu item or button.
5944
5945 With update UI events, you define an event handler to look at the
5946 state of the application and change UI elements accordingly. wxWidgets
5947 will call your handler functions in idle time, so you don't have to
5948 worry where to call this code. In addition to being a clearer and more
5949 declarative method, it also means you don't have to worry whether
5950 you're updating a toolbar or menubar identifier. The same handler can
5951 update a menu item and toolbar button, if the ID values are the same.
5952
5953 Instead of directly manipulating the menu or button, you call
5954 functions in the event object, such as `Check`. wxWidgets will
5955 determine whether such a call has been made, and which UI element to
5956 update.
5957
5958 These events will work for popup menus as well as menubars. Just
5959 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5960 any UI events for the window that owns the menu.
5961
5962 If you find that the overhead of UI update processing is affecting
5963 your application, you can do one or both of the following:
5964
5965 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5966 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5967 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5968 receive update events. No other windows will receive update
5969 events.
5970
5971 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5972 value to set the delay between updates. You may need to call
5973 `wx.Window.UpdateWindowUI` at critical points, for example when
5974 a dialog is about to be shown, in case the user sees a slight
5975 delay before windows are updated.
5976
5977 Note that although events are sent in idle time, defining a EVT_IDLE
5978 handler for a window does not affect this because the events are sent
5979 from an internal idle handler.
5980
5981 wxWidgets tries to optimize update events on some platforms. On
5982 Windows and GTK+, events for menubar items are only sent when the menu
5983 is about to be shown, and not in idle time.
5984
5985 """
d55e5bfc
RD
5986 def __repr__(self):
5987 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5988 def __init__(self, *args, **kwargs):
5ba5649b
RD
5989 """
5990 __init__(self, int commandId=0) -> UpdateUIEvent
5991
5992 Constructor
5993 """
5b5c9bc7 5994 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
d55e5bfc
RD
5995 self.this = newobj.this
5996 self.thisown = 1
5997 del newobj.thisown
5998 def GetChecked(*args, **kwargs):
5ba5649b
RD
5999 """
6000 GetChecked(self) -> bool
6001
6002 Returns ``True`` if the UI element should be checked.
6003 """
5b5c9bc7 6004 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
6005
6006 def GetEnabled(*args, **kwargs):
5ba5649b
RD
6007 """
6008 GetEnabled(self) -> bool
6009
6010 Returns ``True`` if the UI element should be enabled.
6011 """
5b5c9bc7 6012 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc
RD
6013
6014 def GetText(*args, **kwargs):
5ba5649b
RD
6015 """
6016 GetText(self) -> String
6017
6018 Returns the text that should be set for the UI element.
6019 """
5b5c9bc7 6020 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
6021
6022 def GetSetText(*args, **kwargs):
5ba5649b
RD
6023 """
6024 GetSetText(self) -> bool
6025
6026 Returns ``True`` if the application has called `SetText`. For
6027 wxWidgets internal use only.
6028 """
5b5c9bc7 6029 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
6030
6031 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
6032 """
6033 GetSetChecked(self) -> bool
6034
6035 Returns ``True`` if the application has called `Check`. For wxWidgets
6036 internal use only.
6037 """
5b5c9bc7 6038 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
6039
6040 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
6041 """
6042 GetSetEnabled(self) -> bool
6043
6044 Returns ``True`` if the application has called `Enable`. For wxWidgets
6045 internal use only.
6046 """
5b5c9bc7 6047 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc
RD
6048
6049 def Check(*args, **kwargs):
5ba5649b
RD
6050 """
6051 Check(self, bool check)
6052
6053 Check or uncheck the UI element.
6054 """
5b5c9bc7 6055 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
6056
6057 def Enable(*args, **kwargs):
5ba5649b
RD
6058 """
6059 Enable(self, bool enable)
6060
6061 Enable or disable the UI element.
6062 """
5b5c9bc7 6063 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc
RD
6064
6065 def SetText(*args, **kwargs):
5ba5649b
RD
6066 """
6067 SetText(self, String text)
6068
6069 Sets the text for this UI element.
6070 """
5b5c9bc7 6071 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
6072
6073 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6074 """
6075 SetUpdateInterval(long updateInterval)
6076
6077 Sets the interval between updates in milliseconds. Set to -1 to
6078 disable updates, or to 0 to update as frequently as possible. The
6079 default is 0.
6080
6081 Use this to reduce the overhead of UI update events if your
6082 application has a lot of windows. If you set the value to -1 or
6083 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6084 at appropriate points in your application, such as when a dialog is
6085 about to be shown.
6086 """
5b5c9bc7 6087 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
6088
6089 SetUpdateInterval = staticmethod(SetUpdateInterval)
6090 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6091 """
6092 GetUpdateInterval() -> long
6093
6094 Returns the current interval between updates in milliseconds. -1
6095 disables updates, 0 updates as frequently as possible.
6096 """
5b5c9bc7 6097 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
6098
6099 GetUpdateInterval = staticmethod(GetUpdateInterval)
6100 def CanUpdate(*args, **kwargs):
5ba5649b
RD
6101 """
6102 CanUpdate(Window win) -> bool
6103
6104 Returns ``True`` if it is appropriate to update (send UI update events
6105 to) this window.
6106
6107 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6108 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6109 events were last sent in idle time, and the update interval, to
6110 determine whether events should be sent to this window now. By default
6111 this will always return true because the update mode is initially
6112 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6113 events will be sent as often as possible. You can reduce the frequency
6114 that events are sent by changing the mode and/or setting an update
6115 interval.
6116
6117 """
5b5c9bc7 6118 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
6119
6120 CanUpdate = staticmethod(CanUpdate)
6121 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6122 """
6123 ResetUpdateTime()
6124
6125 Used internally to reset the last-updated time to the current time. It
6126 is assumed that update events are normally sent in idle time, so this
6127 is called at the end of idle processing.
6128 """
5b5c9bc7 6129 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
6130
6131 ResetUpdateTime = staticmethod(ResetUpdateTime)
6132 def SetMode(*args, **kwargs):
5ba5649b
RD
6133 """
6134 SetMode(int mode)
6135
6136 Specify how wxWidgets will send update events: to all windows, or only
6137 to those which specify that they will process the events.
6138
6139 The mode may be one of the following values:
6140
6141 ============================= ==========================================
6142 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6143 is the default setting.
6144 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6145 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6146 style set.
6147 ============================= ==========================================
6148
6149 """
5b5c9bc7 6150 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6151
6152 SetMode = staticmethod(SetMode)
6153 def GetMode(*args, **kwargs):
5ba5649b
RD
6154 """
6155 GetMode() -> int
6156
6157 Returns a value specifying how wxWidgets will send update events: to
6158 all windows, or only to those which specify that they will process the
6159 events.
6160 """
5b5c9bc7 6161 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6162
6163 GetMode = staticmethod(GetMode)
6164
5b5c9bc7 6165class UpdateUIEventPtr(UpdateUIEvent):
d55e5bfc
RD
6166 def __init__(self, this):
6167 self.this = this
6168 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6169 self.__class__ = UpdateUIEvent
6170_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
d55e5bfc 6171
5b5c9bc7 6172def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6173 """
6174 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6175
6176 Sets the interval between updates in milliseconds. Set to -1 to
6177 disable updates, or to 0 to update as frequently as possible. The
6178 default is 0.
6179
6180 Use this to reduce the overhead of UI update events if your
6181 application has a lot of windows. If you set the value to -1 or
6182 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6183 at appropriate points in your application, such as when a dialog is
6184 about to be shown.
6185 """
5b5c9bc7 6186 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 6187
5b5c9bc7 6188def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6189 """
6190 UpdateUIEvent_GetUpdateInterval() -> long
6191
6192 Returns the current interval between updates in milliseconds. -1
6193 disables updates, 0 updates as frequently as possible.
6194 """
5b5c9bc7 6195 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc 6196
5b5c9bc7 6197def UpdateUIEvent_CanUpdate(*args, **kwargs):
5ba5649b
RD
6198 """
6199 UpdateUIEvent_CanUpdate(Window win) -> bool
6200
6201 Returns ``True`` if it is appropriate to update (send UI update events
6202 to) this window.
6203
6204 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6205 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6206 events were last sent in idle time, and the update interval, to
6207 determine whether events should be sent to this window now. By default
6208 this will always return true because the update mode is initially
6209 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6210 events will be sent as often as possible. You can reduce the frequency
6211 that events are sent by changing the mode and/or setting an update
6212 interval.
6213
6214 """
5b5c9bc7 6215 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 6216
5b5c9bc7 6217def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6218 """
6219 UpdateUIEvent_ResetUpdateTime()
6220
6221 Used internally to reset the last-updated time to the current time. It
6222 is assumed that update events are normally sent in idle time, so this
6223 is called at the end of idle processing.
6224 """
5b5c9bc7 6225 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc 6226
5b5c9bc7 6227def UpdateUIEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6228 """
6229 UpdateUIEvent_SetMode(int mode)
6230
6231 Specify how wxWidgets will send update events: to all windows, or only
6232 to those which specify that they will process the events.
6233
6234 The mode may be one of the following values:
6235
6236 ============================= ==========================================
6237 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6238 is the default setting.
6239 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6240 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6241 style set.
6242 ============================= ==========================================
6243
6244 """
5b5c9bc7 6245 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 6246
5b5c9bc7 6247def UpdateUIEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6248 """
6249 UpdateUIEvent_GetMode() -> int
6250
6251 Returns a value specifying how wxWidgets will send update events: to
6252 all windows, or only to those which specify that they will process the
6253 events.
6254 """
5b5c9bc7 6255 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6256
6257#---------------------------------------------------------------------------
6258
5b5c9bc7 6259class SysColourChangedEvent(Event):
5ba5649b
RD
6260 """
6261 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6262 when the user changes the colour settings using the control
6263 panel. This is only applicable under Windows.
6264
6265 The default event handler for this event propagates the event to child
6266 windows, since Windows only sends the events to top-level windows. If
6267 intercepting this event for a top-level window, remember to call
6268 `Skip` so the the base class handler will still be executed, or to
6269 pass the event on to the window's children explicitly.
6270
6271 """
d55e5bfc
RD
6272 def __repr__(self):
6273 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6274 def __init__(self, *args, **kwargs):
5ba5649b
RD
6275 """
6276 __init__(self) -> SysColourChangedEvent
6277
6278 Constructor
6279 """
5b5c9bc7 6280 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
d55e5bfc
RD
6281 self.this = newobj.this
6282 self.thisown = 1
6283 del newobj.thisown
6284
5b5c9bc7 6285class SysColourChangedEventPtr(SysColourChangedEvent):
d55e5bfc
RD
6286 def __init__(self, this):
6287 self.this = this
6288 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6289 self.__class__ = SysColourChangedEvent
6290_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
d55e5bfc
RD
6291
6292#---------------------------------------------------------------------------
6293
5b5c9bc7 6294class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6295 """
6296 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6297 a window that loses its mouse capture. This is called even if
6298 `wx.Window.ReleaseMouse` was called by the application code. Handling
6299 this event allows an application to cater for unexpected capture
6300 releases which might otherwise confuse mouse handling code.
6301
6302 This event is implemented under Windows only.
6303 """
d55e5bfc
RD
6304 def __repr__(self):
6305 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6306 def __init__(self, *args, **kwargs):
5ba5649b
RD
6307 """
6308 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6309
6310 Constructor
6311 """
5b5c9bc7 6312 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
d55e5bfc
RD
6313 self.this = newobj.this
6314 self.thisown = 1
6315 del newobj.thisown
6316 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6317 """
6318 GetCapturedWindow(self) -> Window
6319
6320 Returns the window that gained the capture, or ``None`` if it was a
6321 non-wxWidgets window.
6322 """
5b5c9bc7 6323 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc
RD
6324
6325
5b5c9bc7 6326class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
d55e5bfc
RD
6327 def __init__(self, this):
6328 self.this = this
6329 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6330 self.__class__ = MouseCaptureChangedEvent
6331_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
d55e5bfc
RD
6332
6333#---------------------------------------------------------------------------
6334
5b5c9bc7 6335class DisplayChangedEvent(Event):
5ba5649b
RD
6336 """
6337 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6338 resolution has changed.
6339
6340 This event is implemented under Windows only.
6341 """
d55e5bfc
RD
6342 def __repr__(self):
6343 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6344 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
6345 """__init__(self) -> DisplayChangedEvent"""
6346 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
d55e5bfc
RD
6347 self.this = newobj.this
6348 self.thisown = 1
6349 del newobj.thisown
6350
5b5c9bc7 6351class DisplayChangedEventPtr(DisplayChangedEvent):
d55e5bfc
RD
6352 def __init__(self, this):
6353 self.this = this
6354 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6355 self.__class__ = DisplayChangedEvent
6356_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
d55e5bfc
RD
6357
6358#---------------------------------------------------------------------------
6359
5b5c9bc7 6360class PaletteChangedEvent(Event):
5ba5649b
RD
6361 """
6362 An EVT_PALETTE_CHANGED event is sent when the system palette has
6363 changed, thereby giving each window a chance to redo their own to
6364 match.
6365
6366 This event is implemented under Windows only.
6367 """
d55e5bfc
RD
6368 def __repr__(self):
6369 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6370 def __init__(self, *args, **kwargs):
5ba5649b
RD
6371 """
6372 __init__(self, int id=0) -> PaletteChangedEvent
6373
6374 An EVT_PALETTE_CHANGED event is sent when the system palette has
6375 changed, thereby giving each window a chance to redo their own to
6376 match.
6377
6378 This event is implemented under Windows only.
6379 """
5b5c9bc7 6380 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
d55e5bfc
RD
6381 self.this = newobj.this
6382 self.thisown = 1
6383 del newobj.thisown
6384 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6385 """SetChangedWindow(self, Window win)"""
6386 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
6387
6388 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6389 """GetChangedWindow(self) -> Window"""
6390 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc
RD
6391
6392
5b5c9bc7 6393class PaletteChangedEventPtr(PaletteChangedEvent):
d55e5bfc
RD
6394 def __init__(self, this):
6395 self.this = this
6396 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6397 self.__class__ = PaletteChangedEvent
6398_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
d55e5bfc
RD
6399
6400#---------------------------------------------------------------------------
6401
5b5c9bc7 6402class QueryNewPaletteEvent(Event):
5ba5649b
RD
6403 """
6404 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6405 focus and should re-do its palette.
6406
6407 This event is implemented under Windows only.
6408 """
d55e5bfc
RD
6409 def __repr__(self):
6410 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6411 def __init__(self, *args, **kwargs):
5ba5649b
RD
6412 """
6413 __init__(self, int winid=0) -> QueryNewPaletteEvent
6414
6415 Constructor.
6416 """
5b5c9bc7 6417 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
d55e5bfc
RD
6418 self.this = newobj.this
6419 self.thisown = 1
6420 del newobj.thisown
6421 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6422 """
6423 SetPaletteRealized(self, bool realized)
6424
6425 App should set this if it changes the palette.
6426 """
5b5c9bc7 6427 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
6428
6429 def GetPaletteRealized(*args, **kwargs):
6430 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 6431 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
6432
6433
5b5c9bc7 6434class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
d55e5bfc
RD
6435 def __init__(self, this):
6436 self.this = this
6437 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6438 self.__class__ = QueryNewPaletteEvent
6439_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
d55e5bfc
RD
6440
6441#---------------------------------------------------------------------------
6442
5b5c9bc7 6443class NavigationKeyEvent(Event):
5ba5649b
RD
6444 """
6445 EVT_NAVIGATION_KEY events are used to control moving the focus between
6446 widgets, otherwise known as tab-traversal. You woudl normally not
6447 catch navigation events in applications as there are already
6448 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6449 it useful to send navigation events in certain situations to change
6450 the focus in certain ways, although it's probably easier to just call
6451 `wx.Window.Navigate`.
6452 """
d55e5bfc
RD
6453 def __repr__(self):
6454 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6455 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
6456 """__init__(self) -> NavigationKeyEvent"""
6457 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
d55e5bfc
RD
6458 self.this = newobj.this
6459 self.thisown = 1
6460 del newobj.thisown
6461 def GetDirection(*args, **kwargs):
5ba5649b
RD
6462 """
6463 GetDirection(self) -> bool
6464
6465 Returns ``True`` if the direction is forward, ``False`` otherwise.
6466 """
5b5c9bc7 6467 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
6468
6469 def SetDirection(*args, **kwargs):
5ba5649b
RD
6470 """
6471 SetDirection(self, bool forward)
6472
6473 Specify the direction that the navigation should take. Usually the
6474 difference between using Tab and Shift-Tab.
6475 """
5b5c9bc7 6476 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
6477
6478 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6479 """
6480 IsWindowChange(self) -> bool
6481
6482 Returns ``True`` if window change is allowed.
6483 """
5b5c9bc7 6484 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
6485
6486 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6487 """
6488 SetWindowChange(self, bool ischange)
6489
6490 Specify if the navigation should be able to change parent windows.
6491 For example, changing notebook pages, etc. This is usually implemented
6492 by using Control-Tab.
6493 """
5b5c9bc7 6494 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 6495
68350608 6496 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6497 """
6498 IsFromTab(self) -> bool
6499
6500 Returns ``True`` if the navigation event is originated from the Tab
6501 key.
6502 """
5b5c9bc7 6503 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
6504
6505 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6506 """
6507 SetFromTab(self, bool bIs)
6508
6509 Set to true under MSW if the event was generated using the tab key.
6510 This is required for proper navogation over radio buttons.
6511 """
5b5c9bc7 6512 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 6513
908b74cd 6514 def SetFlags(*args, **kwargs):
5ba5649b
RD
6515 """
6516 SetFlags(self, long flags)
6517
6518 Set the navigation flags to a combination of the following:
6519
6520 * wx.NavigationKeyEvent.IsBackward
6521 * wx.NavigationKeyEvent.IsForward
6522 * wx.NavigationKeyEvent.WinChange
6523 * wx.NavigationKeyEvent.FromTab
6524
6525 """
5b5c9bc7 6526 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6527
d55e5bfc 6528 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6529 """
6530 GetCurrentFocus(self) -> Window
6531
6532 Returns the child window which currenty has the focus. May be
6533 ``None``.
6534 """
5b5c9bc7 6535 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6536
6537 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6538 """
6539 SetCurrentFocus(self, Window win)
6540
6541 Set the window that has the focus.
6542 """
5b5c9bc7 6543 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6544
5b5c9bc7
RD
6545 IsBackward = _core_.NavigationKeyEvent_IsBackward
6546 IsForward = _core_.NavigationKeyEvent_IsForward
6547 WinChange = _core_.NavigationKeyEvent_WinChange
6548 FromTab = _core_.NavigationKeyEvent_FromTab
d55e5bfc 6549
5b5c9bc7 6550class NavigationKeyEventPtr(NavigationKeyEvent):
d55e5bfc
RD
6551 def __init__(self, this):
6552 self.this = this
6553 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6554 self.__class__ = NavigationKeyEvent
6555_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
d55e5bfc
RD
6556
6557#---------------------------------------------------------------------------
6558
5b5c9bc7 6559class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6560 """
6561 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6562 underlying GUI object) exists.
6563 """
d55e5bfc
RD
6564 def __repr__(self):
6565 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6566 def __init__(self, *args, **kwargs):
5ba5649b
RD
6567 """
6568 __init__(self, Window win=None) -> WindowCreateEvent
6569
6570 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6571 underlying GUI object) exists.
6572 """
5b5c9bc7 6573 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
d55e5bfc
RD
6574 self.this = newobj.this
6575 self.thisown = 1
6576 del newobj.thisown
6577 def GetWindow(*args, **kwargs):
5ba5649b
RD
6578 """
6579 GetWindow(self) -> Window
6580
6581 Returns the window that this event refers to.
6582 """
5b5c9bc7 6583 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
6584
6585
5b5c9bc7 6586class WindowCreateEventPtr(WindowCreateEvent):
d55e5bfc
RD
6587 def __init__(self, this):
6588 self.this = this
6589 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6590 self.__class__ = WindowCreateEvent
6591_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
d55e5bfc 6592
5b5c9bc7 6593class WindowDestroyEvent(CommandEvent):
5ba5649b 6594 """
943e8dfd
RD
6595 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6596 when the GUI window is destroyed.
6597
6598 When a class derived from `wx.Window` is destroyed its destructor will
6599 have already run by the time this event is sent. Therefore this event
6600 will not usually be received at all by the window itself. Since it is
6601 received after the destructor has run, an object should not try to
6602 handle its own wx.WindowDestroyEvent, but it can be used to get
6603 notification of the destruction of another window.
5ba5649b 6604 """
d55e5bfc
RD
6605 def __repr__(self):
6606 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6607 def __init__(self, *args, **kwargs):
5ba5649b
RD
6608 """
6609 __init__(self, Window win=None) -> WindowDestroyEvent
6610
943e8dfd
RD
6611 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6612 when the GUI window is destroyed.
6613
6614 When a class derived from `wx.Window` is destroyed its destructor will
6615 have already run by the time this event is sent. Therefore this event
6616 will not usually be received at all by the window itself. Since it is
6617 received after the destructor has run, an object should not try to
6618 handle its own wx.WindowDestroyEvent, but it can be used to get
6619 notification of the destruction of another window.
5ba5649b 6620 """
5b5c9bc7 6621 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
d55e5bfc
RD
6622 self.this = newobj.this
6623 self.thisown = 1
6624 del newobj.thisown
6625 def GetWindow(*args, **kwargs):
5ba5649b
RD
6626 """
6627 GetWindow(self) -> Window
6628
6629 Returns the window that this event refers to.
6630 """
5b5c9bc7 6631 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
6632
6633
5b5c9bc7 6634class WindowDestroyEventPtr(WindowDestroyEvent):
d55e5bfc
RD
6635 def __init__(self, this):
6636 self.this = this
6637 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6638 self.__class__ = WindowDestroyEvent
6639_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
d55e5bfc
RD
6640
6641#---------------------------------------------------------------------------
6642
5b5c9bc7 6643class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6644 """
6645 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6646 give the application a chance to show a context (popup) menu.
6647 """
d55e5bfc
RD
6648 def __repr__(self):
6649 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6650 def __init__(self, *args, **kwargs):
5ba5649b
RD
6651 """
6652 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6653
6654 Constructor.
6655 """
5b5c9bc7 6656 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
d55e5bfc
RD
6657 self.this = newobj.this
6658 self.thisown = 1
6659 del newobj.thisown
6660 def GetPosition(*args, **kwargs):
5ba5649b
RD
6661 """
6662 GetPosition(self) -> Point
6663
6664 Returns the position (in screen coordinants) at which the menu should
6665 be shown.
6666 """
5b5c9bc7 6667 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6668
6669 def SetPosition(*args, **kwargs):
5ba5649b
RD
6670 """
6671 SetPosition(self, Point pos)
6672
6673 Sets the position at which the menu should be shown.
6674 """
5b5c9bc7 6675 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
6676
6677
5b5c9bc7 6678class ContextMenuEventPtr(ContextMenuEvent):
d55e5bfc
RD
6679 def __init__(self, this):
6680 self.this = this
6681 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6682 self.__class__ = ContextMenuEvent
6683_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
d55e5bfc
RD
6684
6685#---------------------------------------------------------------------------
6686
5b5c9bc7
RD
6687IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6688IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6689class IdleEvent(Event):
5ba5649b
RD
6690 """
6691 This class is used for EVT_IDLE events, which are generated and sent
6692 when the application *becomes* idle. In other words, the when the
6693 event queue becomes empty then idle events are sent to all windows (by
6694 default) and as long as none of them call `RequestMore` then there are
6695 no more idle events until after the system event queue has some normal
6696 events and then becomes empty again.
6697
6698 By default, idle events are sent to all windows. If this is causing a
6699 significant overhead in your application, you can call
6700 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6701 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6702 which should receive idle events. Then idle events will only be sent
6703 to those windows and not to any others.
6704 """
d55e5bfc
RD
6705 def __repr__(self):
6706 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6707 def __init__(self, *args, **kwargs):
5ba5649b
RD
6708 """
6709 __init__(self) -> IdleEvent
6710
6711 Constructor
6712 """
5b5c9bc7 6713 newobj = _core_.new_IdleEvent(*args, **kwargs)
d55e5bfc
RD
6714 self.this = newobj.this
6715 self.thisown = 1
6716 del newobj.thisown
6717 def RequestMore(*args, **kwargs):
5ba5649b
RD
6718 """
6719 RequestMore(self, bool needMore=True)
6720
6721 Tells wxWidgets that more processing is required. This function can be
6722 called by an EVT_IDLE handler for a window to indicate that the
6723 application should forward the EVT_IDLE event once more to the
6724 application windows. If no window calls this function during its
6725 EVT_IDLE handler, then the application will remain in a passive event
6726 loop until a new event is posted to the application by the windowing
6727 system.
6728 """
5b5c9bc7 6729 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6730
6731 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6732 """
6733 MoreRequested(self) -> bool
6734
6735 Returns ``True`` if the OnIdle function processing this event
6736 requested more processing time.
6737 """
5b5c9bc7 6738 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6739
6740 def SetMode(*args, **kwargs):
5ba5649b
RD
6741 """
6742 SetMode(int mode)
6743
6744 Static method for specifying how wxWidgets will send idle events: to
6745 all windows, or only to those which specify that they will process the
6746 events.
6747
6748 The mode can be one of the following values:
6749
6750 ========================= ========================================
6751 wx.IDLE_PROCESS_ALL Send idle events to all windows
6752 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6753 the wx.WS_EX_PROCESS_IDLE extra style
6754 flag set.
6755 ========================= ========================================
6756
6757 """
5b5c9bc7 6758 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6759
6760 SetMode = staticmethod(SetMode)
6761 def GetMode(*args, **kwargs):
5ba5649b
RD
6762 """
6763 GetMode() -> int
6764
6765 Static method returning a value specifying how wxWidgets will send
6766 idle events: to all windows, or only to those which specify that they
6767 will process the events.
6768 """
5b5c9bc7 6769 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6770
6771 GetMode = staticmethod(GetMode)
6772 def CanSend(*args, **kwargs):
5ba5649b
RD
6773 """
6774 CanSend(Window win) -> bool
6775
6776 Returns ``True`` if it is appropriate to send idle events to this
6777 window.
6778
6779 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6780 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6781 events should be sent to this window now. By default this will always
6782 return ``True`` because the update mode is initially
6783 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6784 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6785 """
5b5c9bc7 6786 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6787
6788 CanSend = staticmethod(CanSend)
6789
5b5c9bc7 6790class IdleEventPtr(IdleEvent):
d55e5bfc
RD
6791 def __init__(self, this):
6792 self.this = this
6793 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6794 self.__class__ = IdleEvent
6795_core_.IdleEvent_swigregister(IdleEventPtr)
d55e5bfc 6796
5b5c9bc7 6797def IdleEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6798 """
6799 IdleEvent_SetMode(int mode)
6800
6801 Static method for specifying how wxWidgets will send idle events: to
6802 all windows, or only to those which specify that they will process the
6803 events.
6804
6805 The mode can be one of the following values:
6806
6807 ========================= ========================================
6808 wx.IDLE_PROCESS_ALL Send idle events to all windows
6809 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6810 the wx.WS_EX_PROCESS_IDLE extra style
6811 flag set.
6812 ========================= ========================================
6813
6814 """
5b5c9bc7 6815 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6816
5b5c9bc7 6817def IdleEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6818 """
6819 IdleEvent_GetMode() -> int
6820
6821 Static method returning a value specifying how wxWidgets will send
6822 idle events: to all windows, or only to those which specify that they
6823 will process the events.
6824 """
5b5c9bc7 6825 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc 6826
5b5c9bc7 6827def IdleEvent_CanSend(*args, **kwargs):
5ba5649b
RD
6828 """
6829 IdleEvent_CanSend(Window win) -> bool
6830
6831 Returns ``True`` if it is appropriate to send idle events to this
6832 window.
6833
6834 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6835 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6836 events should be sent to this window now. By default this will always
6837 return ``True`` because the update mode is initially
6838 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6839 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6840 """
5b5c9bc7 6841 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6842
6843#---------------------------------------------------------------------------
6844
5b5c9bc7 6845class PyEvent(Event):
5ba5649b
RD
6846 """
6847 wx.PyEvent can be used as a base class for implementing custom event
6848 types in Python. You should derived from this class instead of
6849 `wx.Event` because this class is Python-aware and is able to transport
6850 its Python bits safely through the wxWidgets event system and have
6851 them still be there when the event handler is invoked.
6852
6853 :see: `wx.PyCommandEvent`
6854
6855 """
d55e5bfc
RD
6856 def __repr__(self):
6857 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6858 def __init__(self, *args, **kwargs):
5ba5649b 6859 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
5b5c9bc7 6860 newobj = _core_.new_PyEvent(*args, **kwargs)
d55e5bfc
RD
6861 self.this = newobj.this
6862 self.thisown = 1
6863 del newobj.thisown
5ba5649b 6864 self._SetSelf(self)
d55e5bfc 6865
5b5c9bc7 6866 def __del__(self, destroy=_core_.delete_PyEvent):
d55e5bfc
RD
6867 """__del__(self)"""
6868 try:
6869 if self.thisown: destroy(self)
6870 except: pass
6871
5ba5649b
RD
6872 def _SetSelf(*args, **kwargs):
6873 """_SetSelf(self, PyObject self)"""
6874 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6875
5ba5649b
RD
6876 def _GetSelf(*args, **kwargs):
6877 """_GetSelf(self) -> PyObject"""
6878 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc
RD
6879
6880
5b5c9bc7 6881class PyEventPtr(PyEvent):
d55e5bfc
RD
6882 def __init__(self, this):
6883 self.this = this
6884 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6885 self.__class__ = PyEvent
6886_core_.PyEvent_swigregister(PyEventPtr)
d55e5bfc 6887
5b5c9bc7 6888class PyCommandEvent(CommandEvent):
5ba5649b
RD
6889 """
6890 wx.PyCommandEvent can be used as a base class for implementing custom
6891 event types in Python, where the event shoudl travel up to parent
6892 windows looking for a handler. You should derived from this class
6893 instead of `wx.CommandEvent` because this class is Python-aware and is
6894 able to transport its Python bits safely through the wxWidgets event
6895 system and have them still be there when the event handler is invoked.
6896
6897 :see: `wx.PyEvent`
6898
6899 """
d55e5bfc
RD
6900 def __repr__(self):
6901 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6902 def __init__(self, *args, **kwargs):
5ba5649b 6903 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
5b5c9bc7 6904 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
d55e5bfc
RD
6905 self.this = newobj.this
6906 self.thisown = 1
6907 del newobj.thisown
5ba5649b 6908 self._SetSelf(self)
d55e5bfc 6909
5b5c9bc7 6910 def __del__(self, destroy=_core_.delete_PyCommandEvent):
d55e5bfc
RD
6911 """__del__(self)"""
6912 try:
6913 if self.thisown: destroy(self)
6914 except: pass
6915
5ba5649b
RD
6916 def _SetSelf(*args, **kwargs):
6917 """_SetSelf(self, PyObject self)"""
6918 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6919
5ba5649b
RD
6920 def _GetSelf(*args, **kwargs):
6921 """_GetSelf(self) -> PyObject"""
6922 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc
RD
6923
6924
5b5c9bc7 6925class PyCommandEventPtr(PyCommandEvent):
d55e5bfc
RD
6926 def __init__(self, this):
6927 self.this = this
6928 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6929 self.__class__ = PyCommandEvent
6930_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
d55e5bfc 6931
5b5c9bc7 6932class DateEvent(CommandEvent):
5ba5649b
RD
6933 """
6934 This event class holds information about a date change event and is
6935 used together with `wx.DatePickerCtrl`. It also serves as a base class
6936 for `wx.calendar.CalendarEvent`. Bind these event types with
6937 EVT_DATE_CHANGED.
6938 """
53aa7709
RD
6939 def __repr__(self):
6940 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6941 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
6942 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6943 newobj = _core_.new_DateEvent(*args, **kwargs)
53aa7709
RD
6944 self.this = newobj.this
6945 self.thisown = 1
6946 del newobj.thisown
6947 def GetDate(*args, **kwargs):
5ba5649b
RD
6948 """
6949 GetDate(self) -> DateTime
6950
6951 Returns the date.
6952 """
5b5c9bc7 6953 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6954
6955 def SetDate(*args, **kwargs):
5ba5649b
RD
6956 """
6957 SetDate(self, DateTime date)
6958
6959 Sets the date carried by the event, normally only used by the library
6960 internally.
6961 """
5b5c9bc7 6962 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709
RD
6963
6964
5b5c9bc7 6965class DateEventPtr(DateEvent):
53aa7709
RD
6966 def __init__(self, this):
6967 self.this = this
6968 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6969 self.__class__ = DateEvent
6970_core_.DateEvent_swigregister(DateEventPtr)
53aa7709 6971
5b5c9bc7 6972wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
6973EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6974
d55e5bfc
RD
6975#---------------------------------------------------------------------------
6976
5b5c9bc7
RD
6977PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6978PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6979PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6980PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6981PRINT_WINDOWS = _core_.PRINT_WINDOWS
6982PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6983class PyApp(EvtHandler):
d6c14a4c
RD
6984 """
6985 The ``wx.PyApp`` class is an *implementation detail*, please use the
6986 `wx.App` class (or some other derived class) instead.
6987 """
d55e5bfc
RD
6988 def __repr__(self):
6989 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6990 def __init__(self, *args, **kwargs):
6991 """
5b5c9bc7 6992 __init__(self) -> PyApp
d55e5bfc
RD
6993
6994 Create a new application object, starting the bootstrap process.
6995 """
5b5c9bc7 6996 newobj = _core_.new_PyApp(*args, **kwargs)
d55e5bfc
RD
6997 self.this = newobj.this
6998 self.thisown = 1
6999 del newobj.thisown
7993762b
RD
7000 self._setCallbackInfo(self, PyApp, False)
7001 self._setOORInfo(self, False)
d55e5bfc 7002
5b5c9bc7 7003 def __del__(self, destroy=_core_.delete_PyApp):
d55e5bfc
RD
7004 """__del__(self)"""
7005 try:
7006 if self.thisown: destroy(self)
7007 except: pass
7008
7009 def _setCallbackInfo(*args, **kwargs):
7993762b 7010 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5b5c9bc7 7011 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
7012
7013 def GetAppName(*args, **kwargs):
7014 """
5b5c9bc7 7015 GetAppName(self) -> String
d55e5bfc
RD
7016
7017 Get the application name.
7018 """
5b5c9bc7 7019 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
7020
7021 def SetAppName(*args, **kwargs):
7022 """
5b5c9bc7 7023 SetAppName(self, String name)
d55e5bfc 7024
d6c14a4c
RD
7025 Set the application name. This value may be used automatically by
7026 `wx.Config` and such.
d55e5bfc 7027 """
5b5c9bc7 7028 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
7029
7030 def GetClassName(*args, **kwargs):
7031 """
5b5c9bc7 7032 GetClassName(self) -> String
d55e5bfc
RD
7033
7034 Get the application's class name.
7035 """
5b5c9bc7 7036 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
7037
7038 def SetClassName(*args, **kwargs):
7039 """
5b5c9bc7 7040 SetClassName(self, String name)
d55e5bfc 7041
d6c14a4c
RD
7042 Set the application's class name. This value may be used for
7043 X-resources if applicable for the platform
d55e5bfc 7044 """
5b5c9bc7 7045 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
7046
7047 def GetVendorName(*args, **kwargs):
7048 """
5b5c9bc7 7049 GetVendorName(self) -> String
d55e5bfc
RD
7050
7051 Get the application's vendor name.
7052 """
5b5c9bc7 7053 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
7054
7055 def SetVendorName(*args, **kwargs):
7056 """
5b5c9bc7 7057 SetVendorName(self, String name)
d55e5bfc 7058
d6c14a4c
RD
7059 Set the application's vendor name. This value may be used
7060 automatically by `wx.Config` and such.
d55e5bfc 7061 """
5b5c9bc7 7062 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
7063
7064 def GetTraits(*args, **kwargs):
7065 """
7066 GetTraits(self) -> wxAppTraits
7067
d6c14a4c
RD
7068 Return (and create if necessary) the app traits object to which we
7069 delegate for everything which either should be configurable by the
7070 user (then he can change the default behaviour simply by overriding
7071 CreateTraits() and returning his own traits object) or which is
7072 GUI/console dependent as then wx.AppTraits allows us to abstract the
7073 differences behind the common facade.
7074
7075 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 7076 """
5b5c9bc7 7077 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
7078
7079 def ProcessPendingEvents(*args, **kwargs):
7080 """
7081 ProcessPendingEvents(self)
7082
d6c14a4c
RD
7083 Process all events in the Pending Events list -- it is necessary to
7084 call this function to process posted events. This normally happens
7085 during each event loop iteration.
d55e5bfc 7086 """
5b5c9bc7 7087 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
7088
7089 def Yield(*args, **kwargs):
7090 """
7091 Yield(self, bool onlyIfNeeded=False) -> bool
7092
d6c14a4c
RD
7093 Process all currently pending events right now, instead of waiting
7094 until return to the event loop. It is an error to call ``Yield``
7095 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 7096
d6c14a4c 7097 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
7098 reentrancies (i.e. when called from an event handler it may
7099 result in calling the same event handler again), use with
7100 extreme care or, better, don't use at all!
d55e5bfc 7101
d6c14a4c 7102 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 7103
d55e5bfc 7104 """
5b5c9bc7 7105 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
7106
7107 def WakeUpIdle(*args, **kwargs):
7108 """
7109 WakeUpIdle(self)
7110
d6c14a4c
RD
7111 Make sure that idle events are sent again.
7112 :see: `wx.WakeUpIdle`
d55e5bfc 7113 """
5b5c9bc7 7114 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 7115
84f85550
RD
7116 def IsMainLoopRunning(*args, **kwargs):
7117 """
7118 IsMainLoopRunning() -> bool
7119
7120 Returns True if we're running the main loop, i.e. if the events can
7121 currently be dispatched.
7122 """
5b5c9bc7 7123 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
7124
7125 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
7126 def MainLoop(*args, **kwargs):
7127 """
7128 MainLoop(self) -> int
7129
d6c14a4c
RD
7130 Execute the main GUI loop, the function doesn't normally return until
7131 all top level windows have been closed and destroyed.
d55e5bfc 7132 """
5b5c9bc7 7133 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
7134
7135 def Exit(*args, **kwargs):
7136 """
7137 Exit(self)
7138
7139 Exit the main loop thus terminating the application.
d6c14a4c 7140 :see: `wx.Exit`
d55e5bfc 7141 """
5b5c9bc7 7142 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc
RD
7143
7144 def ExitMainLoop(*args, **kwargs):
7145 """
7146 ExitMainLoop(self)
7147
d6c14a4c
RD
7148 Exit the main GUI loop during the next iteration of the main
7149 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 7150 """
5b5c9bc7 7151 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
7152
7153 def Pending(*args, **kwargs):
7154 """
7155 Pending(self) -> bool
7156
7157 Returns True if there are unprocessed events in the event queue.
7158 """
5b5c9bc7 7159 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
7160
7161 def Dispatch(*args, **kwargs):
7162 """
7163 Dispatch(self) -> bool
7164
7165 Process the first event in the event queue (blocks until an event
7166 appears if there are none currently)
7167 """
5b5c9bc7 7168 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
7169
7170 def ProcessIdle(*args, **kwargs):
7171 """
7172 ProcessIdle(self) -> bool
7173
d6c14a4c
RD
7174 Called from the MainLoop when the application becomes idle (there are
7175 no pending events) and sends a `wx.IdleEvent` to all interested
7176 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 7177 """
5b5c9bc7 7178 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
7179
7180 def SendIdleEvents(*args, **kwargs):
7181 """
5b5c9bc7 7182 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 7183
d6c14a4c
RD
7184 Send idle event to window and all subwindows. Returns True if more
7185 idle time is requested.
d55e5bfc 7186 """
5b5c9bc7 7187 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
7188
7189 def IsActive(*args, **kwargs):
7190 """
7191 IsActive(self) -> bool
7192
7193 Return True if our app has focus.
7194 """
5b5c9bc7 7195 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
7196
7197 def SetTopWindow(*args, **kwargs):
7198 """
5b5c9bc7 7199 SetTopWindow(self, Window win)
d55e5bfc 7200
d6c14a4c 7201 Set the *main* top level window
d55e5bfc 7202 """
5b5c9bc7 7203 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
7204
7205 def GetTopWindow(*args, **kwargs):
7206 """
5b5c9bc7 7207 GetTopWindow(self) -> Window
d55e5bfc 7208
d6c14a4c
RD
7209 Return the *main* top level window (if it hadn't been set previously
7210 with SetTopWindow(), will return just some top level window and, if
7211 there not any, will return None)
d55e5bfc 7212 """
5b5c9bc7 7213 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
7214
7215 def SetExitOnFrameDelete(*args, **kwargs):
7216 """
7217 SetExitOnFrameDelete(self, bool flag)
7218
d6c14a4c
RD
7219 Control the exit behaviour: by default, the program will exit the main
7220 loop (and so, usually, terminate) when the last top-level program
7221 window is deleted. Beware that if you disable this behaviour (with
7222 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7223 explicitly from somewhere.
d55e5bfc 7224 """
5b5c9bc7 7225 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
7226
7227 def GetExitOnFrameDelete(*args, **kwargs):
7228 """
7229 GetExitOnFrameDelete(self) -> bool
7230
7231 Get the current exit behaviour setting.
7232 """
5b5c9bc7 7233 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
7234
7235 def SetUseBestVisual(*args, **kwargs):
7236 """
7237 SetUseBestVisual(self, bool flag)
7238
d6c14a4c
RD
7239 Set whether the app should try to use the best available visual on
7240 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 7241 """
5b5c9bc7 7242 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
7243
7244 def GetUseBestVisual(*args, **kwargs):
7245 """
7246 GetUseBestVisual(self) -> bool
7247
7248 Get current UseBestVisual setting.
7249 """
5b5c9bc7 7250 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
7251
7252 def SetPrintMode(*args, **kwargs):
7253 """SetPrintMode(self, int mode)"""
5b5c9bc7 7254 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
7255
7256 def GetPrintMode(*args, **kwargs):
7257 """GetPrintMode(self) -> int"""
5b5c9bc7 7258 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
7259
7260 def SetAssertMode(*args, **kwargs):
7261 """
7262 SetAssertMode(self, int mode)
7263
15817c7e 7264 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 7265 """
5b5c9bc7 7266 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
7267
7268 def GetAssertMode(*args, **kwargs):
7269 """
7270 GetAssertMode(self) -> int
7271
7272 Get the current OnAssert behaviour setting.
7273 """
5b5c9bc7 7274 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
7275
7276 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7277 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 7278 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7279
7280 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7281 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7282 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 7283 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7284
7285 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7286 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7287 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 7288 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7289
7290 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7291 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7292 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 7293 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7294
7295 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7296 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7297 """GetMacHelpMenuTitleName() -> String"""
7298 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7299
7300 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7301 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7302 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 7303 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7304
7305 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7306 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7307 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 7308 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7309
7310 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7311 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7312 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 7313 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7314
7315 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7316 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7317 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 7318 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7319
7320 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7321 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7322 """SetMacHelpMenuTitleName(String val)"""
7323 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7324
7325 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7326 def _BootstrapApp(*args, **kwargs):
7327 """
7328 _BootstrapApp(self)
7329
7330 For internal use only
7331 """
5b5c9bc7 7332 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
7333
7334 def GetComCtl32Version(*args, **kwargs):
7335 """
d6c14a4c 7336 GetComCtl32Version() -> int
d55e5bfc 7337
d6c14a4c
RD
7338 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7339 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7340 """
5b5c9bc7 7341 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
7342
7343 GetComCtl32Version = staticmethod(GetComCtl32Version)
7344
5b5c9bc7 7345class PyAppPtr(PyApp):
d55e5bfc
RD
7346 def __init__(self, this):
7347 self.this = this
7348 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7349 self.__class__ = PyApp
7350_core_.PyApp_swigregister(PyAppPtr)
d55e5bfc 7351
5b5c9bc7 7352def PyApp_IsMainLoopRunning(*args, **kwargs):
84f85550 7353 """
5b5c9bc7 7354 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
7355
7356 Returns True if we're running the main loop, i.e. if the events can
7357 currently be dispatched.
7358 """
5b5c9bc7 7359 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550 7360
5b5c9bc7
RD
7361def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
7362 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7363 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 7364
5b5c9bc7
RD
7365def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
7366 """PyApp_GetMacAboutMenuItemId() -> long"""
7367 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 7368
5b5c9bc7
RD
7369def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
7370 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7371 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 7372
5b5c9bc7
RD
7373def PyApp_GetMacExitMenuItemId(*args, **kwargs):
7374 """PyApp_GetMacExitMenuItemId() -> long"""
7375 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 7376
5b5c9bc7
RD
7377def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
7378 """PyApp_GetMacHelpMenuTitleName() -> String"""
7379 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7380
5b5c9bc7
RD
7381def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7382 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7383 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 7384
5b5c9bc7
RD
7385def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7386 """PyApp_SetMacAboutMenuItemId(long val)"""
7387 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 7388
5b5c9bc7
RD
7389def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7390 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7391 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 7392
5b5c9bc7
RD
7393def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7394 """PyApp_SetMacExitMenuItemId(long val)"""
7395 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 7396
5b5c9bc7
RD
7397def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7398 """PyApp_SetMacHelpMenuTitleName(String val)"""
7399 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7400
5b5c9bc7 7401def PyApp_GetComCtl32Version(*args, **kwargs):
d55e5bfc 7402 """
5b5c9bc7 7403 PyApp_GetComCtl32Version() -> int
d55e5bfc 7404
d6c14a4c
RD
7405 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7406 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7407 """
5b5c9bc7 7408 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
7409
7410#---------------------------------------------------------------------------
7411
7412
5b5c9bc7 7413def Exit(*args, **kwargs):
d55e5bfc 7414 """
5b5c9bc7 7415 Exit()
d55e5bfc
RD
7416
7417 Force an exit of the application. Convenience for wx.GetApp().Exit()
7418 """
5b5c9bc7 7419 return _core_.Exit(*args, **kwargs)
d55e5bfc 7420
5b5c9bc7 7421def Yield(*args, **kwargs):
d55e5bfc 7422 """
5b5c9bc7 7423 Yield() -> bool
d55e5bfc
RD
7424
7425 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7426 """
5b5c9bc7 7427 return _core_.Yield(*args, **kwargs)
d55e5bfc 7428
5b5c9bc7 7429def YieldIfNeeded(*args, **kwargs):
d55e5bfc 7430 """
5b5c9bc7 7431 YieldIfNeeded() -> bool
d55e5bfc
RD
7432
7433 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7434 """
5b5c9bc7 7435 return _core_.YieldIfNeeded(*args, **kwargs)
d55e5bfc 7436
5b5c9bc7 7437def SafeYield(*args, **kwargs):
d55e5bfc 7438 """
5b5c9bc7 7439 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 7440
d6c14a4c
RD
7441 This function is similar to `wx.Yield`, except that it disables the
7442 user input to all program windows before calling `wx.Yield` and
7443 re-enables it again afterwards. If ``win`` is not None, this window
7444 will remain enabled, allowing the implementation of some limited user
7445 interaction.
d55e5bfc 7446
d6c14a4c 7447 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 7448 """
5b5c9bc7 7449 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 7450
5b5c9bc7 7451def WakeUpIdle(*args, **kwargs):
d55e5bfc 7452 """
5b5c9bc7 7453 WakeUpIdle()
d55e5bfc 7454
d6c14a4c
RD
7455 Cause the message queue to become empty again, so idle events will be
7456 sent.
d55e5bfc 7457 """
5b5c9bc7 7458 return _core_.WakeUpIdle(*args, **kwargs)
d55e5bfc 7459
5b5c9bc7 7460def PostEvent(*args, **kwargs):
d55e5bfc 7461 """
5b5c9bc7 7462 PostEvent(EvtHandler dest, Event event)
d55e5bfc 7463
d6c14a4c
RD
7464 Send an event to a window or other wx.EvtHandler to be processed
7465 later.
d55e5bfc 7466 """
5b5c9bc7 7467 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 7468
5b5c9bc7 7469def App_CleanUp(*args, **kwargs):
d55e5bfc 7470 """
5b5c9bc7 7471 App_CleanUp()
d55e5bfc 7472
15817c7e 7473 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 7474 Python shuts down.
d55e5bfc 7475 """
5b5c9bc7 7476 return _core_.App_CleanUp(*args, **kwargs)
d55e5bfc
RD
7477
7478def GetApp(*args, **kwargs):
7479 """
5b5c9bc7 7480 GetApp() -> PyApp
d55e5bfc
RD
7481
7482 Return a reference to the current wx.App object.
7483 """
5b5c9bc7 7484 return _core_.GetApp(*args, **kwargs)
5cbf236d 7485
5b5c9bc7 7486def SetDefaultPyEncoding(*args, **kwargs):
5cbf236d
RD
7487 """
7488 SetDefaultPyEncoding(string encoding)
7489
7490 Sets the encoding that wxPython will use when it needs to convert a
7491 Python string or unicode object to or from a wxString.
62d32a5f
RD
7492
7493 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7494 but please be aware that the default encoding within the same locale
7495 may be slightly different on different platforms. For example, please
7496 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7497 between the common latin/roman encodings.
5cbf236d 7498 """
5b5c9bc7 7499 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7500
5b5c9bc7 7501def GetDefaultPyEncoding(*args, **kwargs):
5cbf236d
RD
7502 """
7503 GetDefaultPyEncoding() -> string
7504
7505 Gets the current encoding that wxPython will use when it needs to
7506 convert a Python string or unicode object to or from a wxString.
7507 """
5b5c9bc7 7508 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d55e5bfc
RD
7509#----------------------------------------------------------------------
7510
7511class PyOnDemandOutputWindow:
7512 """
7513 A class that can be used for redirecting Python's stdout and
7514 stderr streams. It will do nothing until something is wrriten to
7515 the stream at which point it will create a Frame with a text area
7516 and write the text there.
7517 """
7518 def __init__(self, title = "wxPython: stdout/stderr"):
7519 self.frame = None
7520 self.title = title
412d302d
RD
7521 self.pos = wx.DefaultPosition
7522 self.size = (450, 300)
d55e5bfc
RD
7523 self.parent = None
7524
7525 def SetParent(self, parent):
7526 """Set the window to be used as the popup Frame's parent."""
7527 self.parent = parent
7528
7529
7530 def CreateOutputWindow(self, st):
412d302d
RD
7531 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7532 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7533 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7534 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7535 self.text.AppendText(st)
d55e5bfc
RD
7536 self.frame.Show(True)
7537 EVT_CLOSE(self.frame, self.OnCloseWindow)
7538
7539
7540 def OnCloseWindow(self, event):
7541 if self.frame is not None:
7542 self.frame.Destroy()
7543 self.frame = None
7544 self.text = None
7545
7546
7547 # These methods provide the file-like output behaviour.
7548 def write(self, text):
7549 """
7550 Create the output window if needed and write the string to it.
7551 If not called in the context of the gui thread then uses
7552 CallAfter to do the work there.
7553 """
7554 if self.frame is None:
7555 if not wx.Thread_IsMain():
7556 wx.CallAfter(self.CreateOutputWindow, text)
7557 else:
7558 self.CreateOutputWindow(text)
7559 else:
7560 if not wx.Thread_IsMain():
7561 wx.CallAfter(self.text.AppendText, text)
7562 else:
7563 self.text.AppendText(text)
7564
7565
7566 def close(self):
7567 if self.frame is not None:
7568 wx.CallAfter(self.frame.Close)
7569
7570
bb4524c4
RD
7571 def flush(self):
7572 pass
7573
7574
d55e5bfc
RD
7575
7576#----------------------------------------------------------------------
7577
7578_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7579
7580class App(wx.PyApp):
7581 """
d6c14a4c
RD
7582 The ``wx.App`` class represents the application and is used to:
7583
7584 * bootstrap the wxPython system and initialize the underlying
7585 gui toolkit
7586 * set and get application-wide properties
7587 * implement the windowing system main message or event loop,
7588 and to dispatch events to window instances
7589 * etc.
7590
7591 Every application must have a ``wx.App`` instance, and all
7592 creation of UI objects should be delayed until after the
7593 ``wx.App`` object has been created in order to ensure that the gui
7594 platform and wxWidgets have been fully initialized.
7595
7596 Normally you would derive from this class and implement an
7597 ``OnInit`` method that creates a frame and then calls
7598 ``self.SetTopWindow(frame)``.
7599
7600 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7601 directly.
d55e5bfc 7602 """
d6c14a4c 7603
d55e5bfc
RD
7604 outputWindowClass = PyOnDemandOutputWindow
7605
d6c14a4c
RD
7606 def __init__(self, redirect=_defRedirect, filename=None,
7607 useBestVisual=False, clearSigInt=True):
7608 """
7609 Construct a ``wx.App`` object.
7610
7611 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7612 redirected? Defaults to True on Windows and Mac, False
7613 otherwise. If `filename` is None then output will be
7614 redirected to a window that pops up as needed. (You can
7615 control what kind of window is created for the output by
7616 resetting the class variable ``outputWindowClass`` to a
7617 class of your choosing.)
7618
7619 :param filename: The name of a file to redirect output to, if
7620 redirect is True.
7621
7622 :param useBestVisual: Should the app try to use the best
7623 available visual provided by the system (only relevant on
7624 systems that have more than one visual.) This parameter
7625 must be used instead of calling `SetUseBestVisual` later
7626 on because it must be set before the underlying GUI
7627 toolkit is initialized.
7628
7629 :param clearSigInt: Should SIGINT be cleared? This allows the
7630 app to terminate upon a Ctrl-C in the console like other
7631 GUI apps will.
7632
7633 :note: You should override OnInit to do applicaition
7634 initialization to ensure that the system, toolkit and
7635 wxWidgets are fully initialized.
7636 """
d55e5bfc
RD
7637 wx.PyApp.__init__(self)
7638
7639 if wx.Platform == "__WXMAC__":
7640 try:
7641 import MacOS
7642 if not MacOS.WMAvailable():
7643 print """\
7644This program needs access to the screen. Please run with 'pythonw',
7645not 'python', and only when you are logged in on the main display of
7646your Mac."""
7647 _sys.exit(1)
0346c964
RD
7648 except SystemExit:
7649 raise
d55e5bfc
RD
7650 except:
7651 pass
7652
7653 # This has to be done before OnInit
7654 self.SetUseBestVisual(useBestVisual)
7655
7656 # Set the default handler for SIGINT. This fixes a problem
7657 # where if Ctrl-C is pressed in the console that started this
7658 # app then it will not appear to do anything, (not even send
7659 # KeyboardInterrupt???) but will later segfault on exit. By
7660 # setting the default handler then the app will exit, as
7661 # expected (depending on platform.)
d6c14a4c
RD
7662 if clearSigInt:
7663 try:
7664 import signal
7665 signal.signal(signal.SIGINT, signal.SIG_DFL)
7666 except:
7667 pass
d55e5bfc
RD
7668
7669 # Save and redirect the stdio to a window?
7670 self.stdioWin = None
7671 self.saveStdio = (_sys.stdout, _sys.stderr)
7672 if redirect:
7673 self.RedirectStdio(filename)
7674
8fb0e70a
RD
7675 # Use Python's install prefix as the default
7676 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7677
d55e5bfc
RD
7678 # This finishes the initialization of wxWindows and then calls
7679 # the OnInit that should be present in the derived class
7680 self._BootstrapApp()
7681
7682
66af7a75
RD
7683 def __del__(self, destroy=wx.PyApp.__del__):
7684 self.RestoreStdio() # Just in case the MainLoop was overridden
7685 destroy(self)
d55e5bfc 7686
7993762b
RD
7687 def Destroy(self):
7688 wx.PyApp.Destroy(self)
7689 self.thisown = 0
d55e5bfc
RD
7690
7691 def SetTopWindow(self, frame):
7692 """Set the \"main\" top level window"""
7693 if self.stdioWin:
7694 self.stdioWin.SetParent(frame)
7695 wx.PyApp.SetTopWindow(self, frame)
7696
7697
7698 def MainLoop(self):
7699 """Execute the main GUI event loop"""
7700 wx.PyApp.MainLoop(self)
7701 self.RestoreStdio()
7702
7703
7704 def RedirectStdio(self, filename=None):
7705 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7706 if filename:
7707 _sys.stdout = _sys.stderr = open(filename, 'a')
7708 else:
7709 self.stdioWin = self.outputWindowClass()
7710 _sys.stdout = _sys.stderr = self.stdioWin
7711
7712
7713 def RestoreStdio(self):
66af7a75
RD
7714 try:
7715 _sys.stdout, _sys.stderr = self.saveStdio
7716 except:
7717 pass
d55e5bfc
RD
7718
7719
412d302d
RD
7720 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7721 """
7722 Set the title, position and/or size of the output window if
f5b96ee1
RD
7723 the stdio has been redirected. This should be called before
7724 any output would cause the output window to be created.
412d302d
RD
7725 """
7726 if self.stdioWin:
7727 if title is not None:
7728 self.stdioWin.title = title
7729 if pos is not None:
7730 self.stdioWin.pos = pos
7731 if size is not None:
7732 self.stdioWin.size = size
7733
7734
7735
d55e5bfc 7736
d6c14a4c 7737# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7738App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7739App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7740App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7741App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7742App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7743App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7744App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7745App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7746App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7747App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7748App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7749
7750#----------------------------------------------------------------------------
7751
7752class PySimpleApp(wx.App):
7753 """
7754 A simple application class. You can just create one of these and
7755 then then make your top level windows later, and not have to worry
d6c14a4c 7756 about OnInit. For example::
d55e5bfc 7757
d6c14a4c
RD
7758 app = wx.PySimpleApp()
7759 frame = wx.Frame(None, title='Hello World')
7760 frame.Show()
7761 app.MainLoop()
7762
7763 :see: `wx.App`
7764 """
7765
7766 def __init__(self, redirect=False, filename=None,
7767 useBestVisual=False, clearSigInt=True):
7768 """
7769 :see: `wx.App.__init__`
7770 """
7771 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7772
7773 def OnInit(self):
d55e5bfc
RD
7774 return True
7775
7776
d6c14a4c 7777
d55e5bfc
RD
7778# Is anybody using this one?
7779class PyWidgetTester(wx.App):
7780 def __init__(self, size = (250, 100)):
7781 self.size = size
7782 wx.App.__init__(self, 0)
7783
7784 def OnInit(self):
7785 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7786 self.SetTopWindow(self.frame)
7787 return True
7788
d6c14a4c
RD
7789 def SetWidget(self, widgetClass, *args, **kwargs):
7790 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7791 self.frame.Show(True)
7792
7793#----------------------------------------------------------------------------
7794# DO NOT hold any other references to this object. This is how we
d6c14a4c 7795# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7796# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7797# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7798
7799class __wxPyCleanup:
7800 def __init__(self):
7801 self.cleanup = _core_.App_CleanUp
7802 def __del__(self):
7803 self.cleanup()
7804
7805_sys.__wxPythonCleanup = __wxPyCleanup()
7806
7807## # another possible solution, but it gets called too early...
d6c14a4c
RD
7808## import atexit
7809## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7810
7811
7812#----------------------------------------------------------------------------
7813
7814#---------------------------------------------------------------------------
7815
5b5c9bc7
RD
7816class EventLoop(object):
7817 """Proxy of C++ EventLoop class"""
b411df4a
RD
7818 def __repr__(self):
7819 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7820 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
7821 """__init__(self) -> EventLoop"""
7822 newobj = _core_.new_EventLoop(*args, **kwargs)
b411df4a
RD
7823 self.this = newobj.this
7824 self.thisown = 1
7825 del newobj.thisown
5b5c9bc7 7826 def __del__(self, destroy=_core_.delete_EventLoop):
b411df4a
RD
7827 """__del__(self)"""
7828 try:
7829 if self.thisown: destroy(self)
7830 except: pass
7831
7832 def Run(*args, **kwargs):
7833 """Run(self) -> int"""
5b5c9bc7 7834 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7835
7836 def Exit(*args, **kwargs):
7837 """Exit(self, int rc=0)"""
5b5c9bc7 7838 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7839
7840 def Pending(*args, **kwargs):
7841 """Pending(self) -> bool"""
5b5c9bc7 7842 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7843
7844 def Dispatch(*args, **kwargs):
7845 """Dispatch(self) -> bool"""
5b5c9bc7 7846 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7847
7848 def IsRunning(*args, **kwargs):
7849 """IsRunning(self) -> bool"""
5b5c9bc7 7850 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7851
7852 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7853 """GetActive() -> EventLoop"""
7854 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7855
7856 GetActive = staticmethod(GetActive)
7857 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7858 """SetActive(EventLoop loop)"""
7859 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7860
7861 SetActive = staticmethod(SetActive)
7862
5b5c9bc7 7863class EventLoopPtr(EventLoop):
b411df4a
RD
7864 def __init__(self, this):
7865 self.this = this
7866 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7867 self.__class__ = EventLoop
7868_core_.EventLoop_swigregister(EventLoopPtr)
b411df4a 7869
5b5c9bc7
RD
7870def EventLoop_GetActive(*args, **kwargs):
7871 """EventLoop_GetActive() -> EventLoop"""
7872 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a 7873
5b5c9bc7
RD
7874def EventLoop_SetActive(*args, **kwargs):
7875 """EventLoop_SetActive(EventLoop loop)"""
7876 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7877
32fe5131
RD
7878class EventLoopActivator(object):
7879 """Proxy of C++ EventLoopActivator class"""
7880 def __repr__(self):
7881 return "<%s.%s; proxy of C++ wxEventLoopActivator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7882 def __init__(self, *args, **kwargs):
7883 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7884 newobj = _core_.new_EventLoopActivator(*args, **kwargs)
7885 self.this = newobj.this
7886 self.thisown = 1
7887 del newobj.thisown
7888 def __del__(self, destroy=_core_.delete_EventLoopActivator):
7889 """__del__(self)"""
7890 try:
7891 if self.thisown: destroy(self)
7892 except: pass
7893
7894
7895class EventLoopActivatorPtr(EventLoopActivator):
7896 def __init__(self, this):
7897 self.this = this
7898 if not hasattr(self,"thisown"): self.thisown = 0
7899 self.__class__ = EventLoopActivator
7900_core_.EventLoopActivator_swigregister(EventLoopActivatorPtr)
7901
b411df4a
RD
7902#---------------------------------------------------------------------------
7903
5b5c9bc7 7904class AcceleratorEntry(object):
d6c14a4c
RD
7905 """
7906 A class used to define items in an `wx.AcceleratorTable`. wxPython
7907 programs can choose to use wx.AcceleratorEntry objects, but using a
7908 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 7909 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
7910
7911 :see: `wx.AcceleratorTable`
7912 """
d55e5bfc
RD
7913 def __repr__(self):
7914 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7915 def __init__(self, *args, **kwargs):
d6c14a4c 7916 """
5b5c9bc7 7917 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
7918
7919 Construct a wx.AcceleratorEntry.
d6c14a4c 7920 """
5b5c9bc7 7921 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
d55e5bfc
RD
7922 self.this = newobj.this
7923 self.thisown = 1
7924 del newobj.thisown
5b5c9bc7 7925 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
d55e5bfc
RD
7926 """__del__(self)"""
7927 try:
7928 if self.thisown: destroy(self)
7929 except: pass
7930
7931 def Set(*args, **kwargs):
d6c14a4c
RD
7932 """
7933 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7934
d6c14a4c
RD
7935 (Re)set the attributes of a wx.AcceleratorEntry.
7936 :see `__init__`
7937 """
5b5c9bc7 7938 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7939
7940 def GetFlags(*args, **kwargs):
d6c14a4c
RD
7941 """
7942 GetFlags(self) -> int
7943
7944 Get the AcceleratorEntry's flags.
7945 """
5b5c9bc7 7946 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
7947
7948 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
7949 """
7950 GetKeyCode(self) -> int
7951
7952 Get the AcceleratorEntry's keycode.
7953 """
5b5c9bc7 7954 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
7955
7956 def GetCommand(*args, **kwargs):
d6c14a4c
RD
7957 """
7958 GetCommand(self) -> int
7959
7960 Get the AcceleratorEntry's command ID.
7961 """
5b5c9bc7 7962 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc
RD
7963
7964
5b5c9bc7 7965class AcceleratorEntryPtr(AcceleratorEntry):
d55e5bfc
RD
7966 def __init__(self, this):
7967 self.this = this
7968 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7969 self.__class__ = AcceleratorEntry
7970_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
d55e5bfc 7971
5b5c9bc7 7972class AcceleratorTable(Object):
d6c14a4c
RD
7973 """
7974 An accelerator table allows the application to specify a table of
7975 keyboard shortcuts for menus or other commands. On Windows, menu or
7976 button commands are supported; on GTK, only menu commands are
7977 supported.
d6c14a4c 7978 """
d55e5bfc
RD
7979 def __repr__(self):
7980 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7981 def __init__(self, *args, **kwargs):
7982 """
7983 __init__(entries) -> AcceleratorTable
7984
d6c14a4c
RD
7985 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7986 items or or of 3-tuples (flags, keyCode, cmdID)
7987
7988 :see: `wx.AcceleratorEntry`
d55e5bfc 7989 """
5b5c9bc7 7990 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
d55e5bfc
RD
7991 self.this = newobj.this
7992 self.thisown = 1
7993 del newobj.thisown
5b5c9bc7 7994 def __del__(self, destroy=_core_.delete_AcceleratorTable):
d55e5bfc
RD
7995 """__del__(self)"""
7996 try:
7997 if self.thisown: destroy(self)
7998 except: pass
7999
8000 def Ok(*args, **kwargs):
8001 """Ok(self) -> bool"""
5b5c9bc7 8002 return _core_.AcceleratorTable_Ok(*args, **kwargs)
d55e5bfc
RD
8003
8004
5b5c9bc7 8005class AcceleratorTablePtr(AcceleratorTable):
d55e5bfc
RD
8006 def __init__(self, this):
8007 self.this = this
8008 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
8009 self.__class__ = AcceleratorTable
8010_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
d55e5bfc
RD
8011
8012
5b5c9bc7
RD
8013def GetAccelFromString(*args, **kwargs):
8014 """GetAccelFromString(String label) -> AcceleratorEntry"""
8015 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
8016#---------------------------------------------------------------------------
8017
5b5c9bc7 8018class VisualAttributes(object):
d55e5bfc
RD
8019 """struct containing all the visual attributes of a control"""
8020 def __repr__(self):
8021 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8022 def __init__(self, *args, **kwargs):
8023 """
5b5c9bc7 8024 __init__(self) -> VisualAttributes
d55e5bfc
RD
8025
8026 struct containing all the visual attributes of a control
8027 """
5b5c9bc7 8028 newobj = _core_.new_VisualAttributes(*args, **kwargs)
d55e5bfc
RD
8029 self.this = newobj.this
8030 self.thisown = 1
8031 del newobj.thisown
5b5c9bc7 8032 def __del__(self, destroy=_core_.delete_VisualAttributes):
d55e5bfc
RD
8033 """__del__(self)"""
8034 try:
8035 if self.thisown: destroy(self)
8036 except: pass
8037
5b5c9bc7
RD
8038 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
8039 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
8040 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
d55e5bfc 8041
5b5c9bc7 8042class VisualAttributesPtr(VisualAttributes):
d55e5bfc
RD
8043 def __init__(self, this):
8044 self.this = this
8045 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
8046 self.__class__ = VisualAttributes
8047_core_.VisualAttributes_swigregister(VisualAttributesPtr)
8048NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
8049PanelNameStr = cvar.PanelNameStr
8050
5b5c9bc7
RD
8051WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8052WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8053WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8054WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8055WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
8056class Window(EvtHandler):
d55e5bfc
RD
8057 """
8058 wx.Window is the base class for all windows and represents any visible
8059 object on the screen. All controls, top level windows and so on are
8060 wx.Windows. Sizers and device contexts are not however, as they don't
8061 appear on screen themselves.
8062
8063 """
8064 def __repr__(self):
8065 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8066 def __init__(self, *args, **kwargs):
8067 """
5b5c9bc7
RD
8068 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8069 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
8070
8071 Construct and show a generic Window.
8072 """
5b5c9bc7 8073 newobj = _core_.new_Window(*args, **kwargs)
d55e5bfc
RD
8074 self.this = newobj.this
8075 self.thisown = 1
8076 del newobj.thisown
8077 self._setOORInfo(self)
8078
8079 def Create(*args, **kwargs):
8080 """
5b5c9bc7
RD
8081 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8082 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
8083
8084 Create the GUI part of the Window for 2-phase creation mode.
8085 """
5b5c9bc7 8086 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
8087
8088 def Close(*args, **kwargs):
8089 """
8090 Close(self, bool force=False) -> bool
8091
8092 This function simply generates a EVT_CLOSE event whose handler usually
8093 tries to close the window. It doesn't close the window itself,
8094 however. If force is False (the default) then the window's close
8095 handler will be allowed to veto the destruction of the window.
d55e5bfc 8096 """
5b5c9bc7 8097 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
8098
8099 def Destroy(*args, **kwargs):
8100 """
8101 Destroy(self) -> bool
8102
8103 Destroys the window safely. Frames and dialogs are not destroyed
8104 immediately when this function is called -- they are added to a list
8105 of windows to be deleted on idle time, when all the window's events
8106 have been processed. This prevents problems with events being sent to
8107 non-existent windows.
8108
8109 Returns True if the window has either been successfully deleted, or it
8110 has been added to the list of windows pending real deletion.
8111 """
5b5c9bc7 8112 return _core_.Window_Destroy(*args, **kwargs)
d55e5bfc
RD
8113
8114 def DestroyChildren(*args, **kwargs):
8115 """
8116 DestroyChildren(self) -> bool
8117
15817c7e
RD
8118 Destroys all children of a window. Called automatically by the
8119 destructor.
d55e5bfc 8120 """
5b5c9bc7 8121 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
8122
8123 def IsBeingDeleted(*args, **kwargs):
8124 """
8125 IsBeingDeleted(self) -> bool
8126
8127 Is the window in the process of being deleted?
8128 """
5b5c9bc7 8129 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 8130
d55e5bfc
RD
8131 def SetLabel(*args, **kwargs):
8132 """
5b5c9bc7 8133 SetLabel(self, String label)
d55e5bfc
RD
8134
8135 Set the text which the window shows in its label if applicable.
8136 """
5b5c9bc7 8137 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
8138
8139 def GetLabel(*args, **kwargs):
8140 """
5b5c9bc7 8141 GetLabel(self) -> String
d55e5bfc 8142
15817c7e
RD
8143 Generic way of getting a label from any window, for identification
8144 purposes. The interpretation of this function differs from class to
8145 class. For frames and dialogs, the value returned is the title. For
8146 buttons or static text controls, it is the button text. This function
8147 can be useful for meta-programs such as testing tools or special-needs
8148 access programs)which need to identify windows by name.
d55e5bfc 8149 """
5b5c9bc7 8150 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
8151
8152 def SetName(*args, **kwargs):
8153 """
5b5c9bc7 8154 SetName(self, String name)
d55e5bfc 8155
15817c7e
RD
8156 Sets the window's name. The window name is used for ressource setting
8157 in X, it is not the same as the window title/label
d55e5bfc 8158 """
5b5c9bc7 8159 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
8160
8161 def GetName(*args, **kwargs):
8162 """
5b5c9bc7 8163 GetName(self) -> String
d55e5bfc 8164
15817c7e
RD
8165 Returns the windows name. This name is not guaranteed to be unique;
8166 it is up to the programmer to supply an appropriate name in the window
8167 constructor or via wx.Window.SetName.
d55e5bfc 8168 """
5b5c9bc7 8169 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
8170
8171 def SetWindowVariant(*args, **kwargs):
8172 """
8173 SetWindowVariant(self, int variant)
8174
15817c7e
RD
8175 Sets the variant of the window/font size to use for this window, if
8176 the platform supports variants, for example, wxMac.
d55e5bfc 8177 """
5b5c9bc7 8178 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
8179
8180 def GetWindowVariant(*args, **kwargs):
8181 """GetWindowVariant(self) -> int"""
5b5c9bc7 8182 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
8183
8184 def SetId(*args, **kwargs):
8185 """
8186 SetId(self, int winid)
8187
8188 Sets the identifier of the window. Each window has an integer
8189 identifier. If the application has not provided one, an identifier
8190 will be generated. Normally, the identifier should be provided on
8191 creation and should not be modified subsequently.
8192 """
5b5c9bc7 8193 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
8194
8195 def GetId(*args, **kwargs):
8196 """
8197 GetId(self) -> int
8198
8199 Returns the identifier of the window. Each window has an integer
8200 identifier. If the application has not provided one (or the default Id
8201 -1 is used) then an unique identifier with a negative value will be
8202 generated.
8203 """
5b5c9bc7 8204 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
8205
8206 def NewControlId(*args, **kwargs):
8207 """
d6c14a4c 8208 NewControlId() -> int
d55e5bfc
RD
8209
8210 Generate a control id for the controls which were not given one.
8211 """
5b5c9bc7 8212 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
8213
8214 NewControlId = staticmethod(NewControlId)
8215 def NextControlId(*args, **kwargs):
8216 """
d6c14a4c 8217 NextControlId(int winid) -> int
d55e5bfc
RD
8218
8219 Get the id of the control following the one with the given
15817c7e 8220 autogenerated) id
d55e5bfc 8221 """
5b5c9bc7 8222 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
8223
8224 NextControlId = staticmethod(NextControlId)
8225 def PrevControlId(*args, **kwargs):
8226 """
d6c14a4c 8227 PrevControlId(int winid) -> int
d55e5bfc
RD
8228
8229 Get the id of the control preceding the one with the given
15817c7e 8230 autogenerated) id
d55e5bfc 8231 """
5b5c9bc7 8232 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
8233
8234 PrevControlId = staticmethod(PrevControlId)
8235 def SetSize(*args, **kwargs):
8236 """
5b5c9bc7 8237 SetSize(self, Size size)
d55e5bfc
RD
8238
8239 Sets the size of the window in pixels.
8240 """
5b5c9bc7 8241 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
8242
8243 def SetDimensions(*args, **kwargs):
8244 """
5b5c9bc7 8245 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8246
8247 Sets the position and size of the window in pixels. The sizeFlags
8248 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
8249 equal to -1.
8250
8251 ======================== ======================================
8252 wx.SIZE_AUTO A -1 indicates that a class-specific
8253 default should be used.
8254 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8255 -1 values are supplied.
8256 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8257 interpreted as real dimensions, not
8258 default values.
8259 ======================== ======================================
8260
d55e5bfc 8261 """
5b5c9bc7 8262 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
8263
8264 def SetRect(*args, **kwargs):
8265 """
5b5c9bc7 8266 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8267
8268 Sets the position and size of the window in pixels using a wx.Rect.
8269 """
5b5c9bc7 8270 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
8271
8272 def SetSizeWH(*args, **kwargs):
8273 """
8274 SetSizeWH(self, int width, int height)
8275
8276 Sets the size of the window in pixels.
8277 """
5b5c9bc7 8278 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
8279
8280 def Move(*args, **kwargs):
8281 """
5b5c9bc7 8282 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8283
8284 Moves the window to the given position.
8285 """
5b5c9bc7 8286 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
8287
8288 SetPosition = Move
8289 def MoveXY(*args, **kwargs):
8290 """
5b5c9bc7 8291 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8292
8293 Moves the window to the given position.
8294 """
5b5c9bc7 8295 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 8296
f8167d6e
RD
8297 def SetBestFittingSize(*args, **kwargs):
8298 """
5b5c9bc7 8299 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
8300
8301 A 'Smart' SetSize that will fill in default size components with the
8302 window's *best size* values. Also set's the minsize for use with sizers.
8303 """
5b5c9bc7 8304 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 8305
d55e5bfc
RD
8306 def Raise(*args, **kwargs):
8307 """
8308 Raise(self)
8309
943e8dfd
RD
8310 Raises the window to the top of the window hierarchy. In current
8311 version of wxWidgets this works both for manage and child windows.
d55e5bfc 8312 """
5b5c9bc7 8313 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
8314
8315 def Lower(*args, **kwargs):
8316 """
8317 Lower(self)
8318
943e8dfd
RD
8319 Lowers the window to the bottom of the window hierarchy. In current
8320 version of wxWidgets this works both for manage and child windows.
d55e5bfc 8321 """
5b5c9bc7 8322 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
8323
8324 def SetClientSize(*args, **kwargs):
8325 """
5b5c9bc7 8326 SetClientSize(self, Size size)
d55e5bfc
RD
8327
8328 This sets the size of the window client area in pixels. Using this
8329 function to size a window tends to be more device-independent than
8330 wx.Window.SetSize, since the application need not worry about what
8331 dimensions the border or title bar have when trying to fit the window
8332 around panel items, for example.
8333 """
5b5c9bc7 8334 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
8335
8336 def SetClientSizeWH(*args, **kwargs):
8337 """
8338 SetClientSizeWH(self, int width, int height)
8339
8340 This sets the size of the window client area in pixels. Using this
8341 function to size a window tends to be more device-independent than
8342 wx.Window.SetSize, since the application need not worry about what
8343 dimensions the border or title bar have when trying to fit the window
8344 around panel items, for example.
8345 """
5b5c9bc7 8346 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
8347
8348 def SetClientRect(*args, **kwargs):
8349 """
5b5c9bc7 8350 SetClientRect(self, Rect rect)
d55e5bfc
RD
8351
8352 This sets the size of the window client area in pixels. Using this
8353 function to size a window tends to be more device-independent than
8354 wx.Window.SetSize, since the application need not worry about what
8355 dimensions the border or title bar have when trying to fit the window
8356 around panel items, for example.
8357 """
5b5c9bc7 8358 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
8359
8360 def GetPosition(*args, **kwargs):
8361 """
5b5c9bc7 8362 GetPosition(self) -> Point
d55e5bfc
RD
8363
8364 Get the window's position.
8365 """
5b5c9bc7 8366 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
8367
8368 def GetPositionTuple(*args, **kwargs):
8369 """
8370 GetPositionTuple() -> (x,y)
8371
8372 Get the window's position.
8373 """
5b5c9bc7 8374 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
8375
8376 def GetSize(*args, **kwargs):
8377 """
5b5c9bc7 8378 GetSize(self) -> Size
d55e5bfc
RD
8379
8380 Get the window size.
8381 """
5b5c9bc7 8382 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
8383
8384 def GetSizeTuple(*args, **kwargs):
8385 """
8386 GetSizeTuple() -> (width, height)
8387
8388 Get the window size.
8389 """
5b5c9bc7 8390 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
8391
8392 def GetRect(*args, **kwargs):
8393 """
5b5c9bc7 8394 GetRect(self) -> Rect
d55e5bfc
RD
8395
8396 Returns the size and position of the window as a wx.Rect object.
8397 """
5b5c9bc7 8398 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
8399
8400 def GetClientSize(*args, **kwargs):
8401 """
5b5c9bc7 8402 GetClientSize(self) -> Size
d55e5bfc
RD
8403
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.
8407 """
5b5c9bc7 8408 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
8409
8410 def GetClientSizeTuple(*args, **kwargs):
8411 """
8412 GetClientSizeTuple() -> (width, height)
8413
8414 This gets the size of the window's 'client area' in pixels. The client
8415 area is the area which may be drawn on by the programmer, excluding
8416 title bar, border, scrollbars, etc.
8417 """
5b5c9bc7 8418 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
8419
8420 def GetClientAreaOrigin(*args, **kwargs):
8421 """
5b5c9bc7 8422 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
8423
8424 Get the origin of the client area of the window relative to the
8425 window's top left corner (the client area may be shifted because of
8426 the borders, scrollbars, other decorations...)
8427 """
5b5c9bc7 8428 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
8429
8430 def GetClientRect(*args, **kwargs):
8431 """
5b5c9bc7 8432 GetClientRect(self) -> Rect
d55e5bfc 8433
0439c23b 8434 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 8435 """
5b5c9bc7 8436 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
8437
8438 def GetBestSize(*args, **kwargs):
8439 """
5b5c9bc7 8440 GetBestSize(self) -> Size
d55e5bfc 8441
bfddbb17 8442 This function returns the best acceptable minimal size for the
15817c7e
RD
8443 window, if applicable. For example, for a static text control, it will
8444 be the minimal size such that the control label is not truncated. For
8445 windows containing subwindows (suzh aswx.Panel), the size returned by
8446 this function will be the same as the size the window would have had
8447 after calling Fit.
d55e5bfc 8448 """
5b5c9bc7 8449 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
8450
8451 def GetBestSizeTuple(*args, **kwargs):
8452 """
8453 GetBestSizeTuple() -> (width, height)
8454
bfddbb17 8455 This function returns the best acceptable minimal size for the
15817c7e
RD
8456 window, if applicable. For example, for a static text control, it will
8457 be the minimal size such that the control label is not truncated. For
8458 windows containing subwindows (suzh aswx.Panel), the size returned by
8459 this function will be the same as the size the window would have had
8460 after calling Fit.
d55e5bfc 8461 """
5b5c9bc7 8462 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 8463
a001823c
RD
8464 def InvalidateBestSize(*args, **kwargs):
8465 """
8466 InvalidateBestSize(self)
8467
8468 Reset the cached best size value so it will be recalculated the next
8469 time it is needed.
8470 """
5b5c9bc7 8471 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 8472
e2813725
RD
8473 def CacheBestSize(*args, **kwargs):
8474 """
8475 CacheBestSize(self, Size size)
8476
8477 Cache the best size so it doesn't need to be calculated again, (at least until
8478 some properties of the window change.)
8479 """
8480 return _core_.Window_CacheBestSize(*args, **kwargs)
8481
a001823c
RD
8482 def GetBestFittingSize(*args, **kwargs):
8483 """
5b5c9bc7 8484 GetBestFittingSize(self) -> Size
a001823c
RD
8485
8486 This function will merge the window's best size into the window's
8487 minimum size, giving priority to the min size components, and returns
8488 the results.
8489
8490 """
5b5c9bc7 8491 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 8492
d55e5bfc
RD
8493 def GetAdjustedBestSize(*args, **kwargs):
8494 """
5b5c9bc7 8495 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
8496
8497 This method is similar to GetBestSize, except in one
8498 thing. GetBestSize should return the minimum untruncated size of the
8499 window, while this method will return the largest of BestSize and any
8500 user specified minimum size. ie. it is the minimum size the window
8501 should currently be drawn at, not the minimal size it can possibly
8502 tolerate.
8503 """
5b5c9bc7 8504 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
8505
8506 def Center(*args, **kwargs):
8507 """
5b5c9bc7 8508 Center(self, int direction=BOTH)
d55e5bfc
RD
8509
8510 Centers the window. The parameter specifies the direction for
8511 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8512 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8513 on the entire screen and not on its parent window. If it is a
8514 top-level window and has no parent then it will always be centered
8515 relative to the screen.
8516 """
5b5c9bc7 8517 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
8518
8519 Centre = Center
8520 def CenterOnScreen(*args, **kwargs):
8521 """
5b5c9bc7 8522 CenterOnScreen(self, int dir=BOTH)
d55e5bfc
RD
8523
8524 Center on screen (only works for top level windows)
8525 """
5b5c9bc7 8526 return _core_.Window_CenterOnScreen(*args, **kwargs)
d55e5bfc
RD
8527
8528 CentreOnScreen = CenterOnScreen
8529 def CenterOnParent(*args, **kwargs):
8530 """
5b5c9bc7 8531 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
8532
8533 Center with respect to the the parent window
8534 """
5b5c9bc7 8535 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
8536
8537 CentreOnParent = CenterOnParent
8538 def Fit(*args, **kwargs):
8539 """
8540 Fit(self)
8541
8542 Sizes the window so that it fits around its subwindows. This function
8543 won't do anything if there are no subwindows and will only really work
8544 correctly if sizers are used for the subwindows layout. Also, if the
8545 window has exactly one subwindow it is better (faster and the result
8546 is more precise as Fit adds some margin to account for fuzziness of
8547 its calculations) to call window.SetClientSize(child.GetSize())
8548 instead of calling Fit.
8549 """
5b5c9bc7 8550 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
8551
8552 def FitInside(*args, **kwargs):
8553 """
8554 FitInside(self)
8555
8556 Similar to Fit, but sizes the interior (virtual) size of a
8557 window. Mainly useful with scrolled windows to reset scrollbars after
8558 sizing changes that do not trigger a size event, and/or scrolled
8559 windows without an interior sizer. This function similarly won't do
8560 anything if there are no subwindows.
8561 """
5b5c9bc7 8562 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 8563
03837c5c 8564 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8565 """
8566 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8567 int incH=-1)
d55e5bfc
RD
8568
8569 Allows specification of minimum and maximum window sizes, and window
8570 size increments. If a pair of values is not set (or set to -1), the
8571 default values will be used. If this function is called, the user
908b74cd
RD
8572 will not be able to size the window outside the given bounds (if it is
8573 a top-level window.) Sizers will also inspect the minimum window size
8574 and will use that value if set when calculating layout.
8575
8576 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8577 """
5b5c9bc7 8578 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8579
03837c5c
RD
8580 def SetSizeHintsSz(*args, **kwargs):
8581 """
5b5c9bc7 8582 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
8583
8584 Allows specification of minimum and maximum window sizes, and window
8585 size increments. If a pair of values is not set (or set to -1), the
8586 default values will be used. If this function is called, the user
8587 will not be able to size the window outside the given bounds (if it is
8588 a top-level window.) Sizers will also inspect the minimum window size
8589 and will use that value if set when calculating layout.
8590
8591 The resizing increments are only significant under Motif or Xt.
8592 """
5b5c9bc7 8593 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
8594
8595 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8596 """
908b74cd 8597 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8598
8599 Allows specification of minimum and maximum virtual window sizes. If a
8600 pair of values is not set (or set to -1), the default values will be
8601 used. If this function is called, the user will not be able to size
8602 the virtual area of the window outside the given bounds.
8603 """
5b5c9bc7 8604 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
8605
8606 def SetVirtualSizeHintsSz(*args, **kwargs):
8607 """
5b5c9bc7 8608 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
8609
8610 Allows specification of minimum and maximum virtual window sizes. If a
8611 pair of values is not set (or set to -1), the default values will be
8612 used. If this function is called, the user will not be able to size
8613 the virtual area of the window outside the given bounds.
8614 """
5b5c9bc7 8615 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8616
908b74cd 8617 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
8618 """GetMaxSize(self) -> Size"""
8619 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8620
8621 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8622 """GetMinSize(self) -> Size"""
8623 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8624
8625 def SetMinSize(*args, **kwargs):
8626 """
5b5c9bc7 8627 SetMinSize(self, Size minSize)
908b74cd
RD
8628
8629 A more convenient method than `SetSizeHints` for setting just the
8630 min size.
8631 """
5b5c9bc7 8632 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8633
8634 def SetMaxSize(*args, **kwargs):
8635 """
5b5c9bc7 8636 SetMaxSize(self, Size maxSize)
908b74cd
RD
8637
8638 A more convenient method than `SetSizeHints` for setting just the
8639 max size.
8640 """
5b5c9bc7 8641 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8642
d55e5bfc
RD
8643 def GetMinWidth(*args, **kwargs):
8644 """GetMinWidth(self) -> int"""
5b5c9bc7 8645 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8646
8647 def GetMinHeight(*args, **kwargs):
8648 """GetMinHeight(self) -> int"""
5b5c9bc7 8649 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8650
8651 def GetMaxWidth(*args, **kwargs):
8652 """GetMaxWidth(self) -> int"""
5b5c9bc7 8653 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8654
8655 def GetMaxHeight(*args, **kwargs):
8656 """GetMaxHeight(self) -> int"""
5b5c9bc7 8657 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8658
d55e5bfc
RD
8659 def SetVirtualSize(*args, **kwargs):
8660 """
5b5c9bc7 8661 SetVirtualSize(self, Size size)
d55e5bfc
RD
8662
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.
8666 """
5b5c9bc7 8667 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8668
8669 def SetVirtualSizeWH(*args, **kwargs):
8670 """
8671 SetVirtualSizeWH(self, int w, int h)
8672
8673 Set the the virtual size of a window in pixels. For most windows this
8674 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.
8676 """
5b5c9bc7 8677 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8678
8679 def GetVirtualSize(*args, **kwargs):
8680 """
5b5c9bc7 8681 GetVirtualSize(self) -> Size
d55e5bfc
RD
8682
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.
8686 """
5b5c9bc7 8687 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8688
8689 def GetVirtualSizeTuple(*args, **kwargs):
8690 """
8691 GetVirtualSizeTuple() -> (width, height)
8692
8693 Get the the virtual size of the window in pixels. For most windows
8694 this is just the client area of the window, but for some like scrolled
8695 windows it is more or less independent of the screen window size.
8696 """
5b5c9bc7 8697 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
8698
8699 def GetBestVirtualSize(*args, **kwargs):
8700 """
5b5c9bc7 8701 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8702
8703 Return the largest of ClientSize and BestSize (as determined by a
8704 sizer, interior children, or other means)
8705 """
5b5c9bc7 8706 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8707
8708 def Show(*args, **kwargs):
8709 """
8710 Show(self, bool show=True) -> bool
8711
8712 Shows or hides the window. You may need to call Raise for a top level
8713 window if you want to bring it to top, although this is not needed if
8714 Show is called immediately after the frame creation. Returns True if
8715 the window has been shown or hidden or False if nothing was done
8716 because it already was in the requested state.
8717 """
5b5c9bc7 8718 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8719
8720 def Hide(*args, **kwargs):
8721 """
8722 Hide(self) -> bool
8723
8724 Equivalent to calling Show(False).
8725 """
5b5c9bc7 8726 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8727
8728 def Enable(*args, **kwargs):
8729 """
8730 Enable(self, bool enable=True) -> bool
8731
8732 Enable or disable the window for user input. Note that when a parent
8733 window is disabled, all of its children are disabled as well and they
8734 are reenabled again when the parent is. Returns true if the window
8735 has been enabled or disabled, false if nothing was done, i.e. if the
8736 window had already been in the specified state.
8737 """
5b5c9bc7 8738 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8739
8740 def Disable(*args, **kwargs):
8741 """
8742 Disable(self) -> bool
8743
8744 Disables the window, same as Enable(false).
8745 """
5b5c9bc7 8746 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8747
8748 def IsShown(*args, **kwargs):
8749 """
8750 IsShown(self) -> bool
8751
8752 Returns true if the window is shown, false if it has been hidden.
8753 """
5b5c9bc7 8754 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8755
8756 def IsEnabled(*args, **kwargs):
8757 """
8758 IsEnabled(self) -> bool
8759
8760 Returns true if the window is enabled for input, false otherwise.
8761 """
5b5c9bc7 8762 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8763
8764 def SetWindowStyleFlag(*args, **kwargs):
8765 """
8766 SetWindowStyleFlag(self, long style)
8767
15817c7e
RD
8768 Sets the style of the window. Please note that some styles cannot be
8769 changed after the window creation and that Refresh() might need to be
8770 called after changing the others for the change to take place
8771 immediately.
d55e5bfc 8772 """
5b5c9bc7 8773 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8774
8775 def GetWindowStyleFlag(*args, **kwargs):
8776 """
8777 GetWindowStyleFlag(self) -> long
8778
8779 Gets the window style that was passed to the constructor or Create
8780 method.
8781 """
5b5c9bc7 8782 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8783
8784 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8785 def HasFlag(*args, **kwargs):
8786 """
8787 HasFlag(self, int flag) -> bool
8788
8789 Test if the given style is set for this window.
8790 """
5b5c9bc7 8791 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8792
8793 def IsRetained(*args, **kwargs):
8794 """
8795 IsRetained(self) -> bool
8796
8797 Returns true if the window is retained, false otherwise. Retained
8798 windows are only available on X platforms.
8799 """
5b5c9bc7 8800 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
8801
8802 def SetExtraStyle(*args, **kwargs):
8803 """
8804 SetExtraStyle(self, long exStyle)
8805
8806 Sets the extra style bits for the window. Extra styles are the less
8807 often used style bits which can't be set with the constructor or with
8808 SetWindowStyleFlag()
8809 """
5b5c9bc7 8810 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8811
8812 def GetExtraStyle(*args, **kwargs):
8813 """
8814 GetExtraStyle(self) -> long
8815
8816 Returns the extra style bits for the window.
8817 """
5b5c9bc7 8818 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8819
8820 def MakeModal(*args, **kwargs):
8821 """
8822 MakeModal(self, bool modal=True)
8823
8824 Disables all other windows in the application so that the user can
8825 only interact with this window. Passing False will reverse this
8826 effect.
8827 """
5b5c9bc7 8828 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
8829
8830 def SetThemeEnabled(*args, **kwargs):
8831 """
8832 SetThemeEnabled(self, bool enableTheme)
8833
8834 This function tells a window if it should use the system's "theme"
8835 code to draw the windows' background instead if its own background
8836 drawing code. This will only have an effect on platforms that support
8837 the notion of themes in user defined windows. One such platform is
8838 GTK+ where windows can have (very colourful) backgrounds defined by a
8839 user's selected theme.
8840
8841 Dialogs, notebook pages and the status bar have this flag set to true
8842 by default so that the default look and feel is simulated best.
8843 """
5b5c9bc7 8844 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8845
8846 def GetThemeEnabled(*args, **kwargs):
8847 """
8848 GetThemeEnabled(self) -> bool
8849
8850 Return the themeEnabled flag.
8851 """
5b5c9bc7 8852 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8853
8854 def SetFocus(*args, **kwargs):
8855 """
8856 SetFocus(self)
8857
8858 Set's the focus to this window, allowing it to receive keyboard input.
8859 """
5b5c9bc7 8860 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
8861
8862 def SetFocusFromKbd(*args, **kwargs):
8863 """
8864 SetFocusFromKbd(self)
8865
8866 Set focus to this window as the result of a keyboard action. Normally
8867 only called internally.
8868 """
5b5c9bc7 8869 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
8870
8871 def FindFocus(*args, **kwargs):
8872 """
5b5c9bc7 8873 FindFocus() -> Window
d55e5bfc
RD
8874
8875 Returns the window or control that currently has the keyboard focus,
8876 or None.
8877 """
5b5c9bc7 8878 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
8879
8880 FindFocus = staticmethod(FindFocus)
8881 def AcceptsFocus(*args, **kwargs):
8882 """
8883 AcceptsFocus(self) -> bool
8884
8885 Can this window have focus?
8886 """
5b5c9bc7 8887 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
8888
8889 def AcceptsFocusFromKeyboard(*args, **kwargs):
8890 """
8891 AcceptsFocusFromKeyboard(self) -> bool
8892
8893 Can this window be given focus by keyboard navigation? if not, the
8894 only way to give it focus (provided it accepts it at all) is to click
8895 it.
8896 """
5b5c9bc7 8897 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc
RD
8898
8899 def GetDefaultItem(*args, **kwargs):
8900 """
5b5c9bc7 8901 GetDefaultItem(self) -> Window
d55e5bfc
RD
8902
8903 Get the default child of this parent, i.e. the one which is activated
8904 by pressing <Enter> such as the OK button on a wx.Dialog.
8905 """
5b5c9bc7 8906 return _core_.Window_GetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8907
8908 def SetDefaultItem(*args, **kwargs):
8909 """
5b5c9bc7 8910 SetDefaultItem(self, Window child) -> Window
d55e5bfc
RD
8911
8912 Set this child as default, return the old default.
8913 """
5b5c9bc7 8914 return _core_.Window_SetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8915
8916 def SetTmpDefaultItem(*args, **kwargs):
8917 """
5b5c9bc7 8918 SetTmpDefaultItem(self, Window win)
d55e5bfc
RD
8919
8920 Set this child as temporary default
8921 """
5b5c9bc7 8922 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
d55e5bfc 8923
908b74cd
RD
8924 def Navigate(*args, **kwargs):
8925 """
8926 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8927
fd2dc343
RD
8928 Does keyboard navigation from this window to another, by sending a
8929 `wx.NavigationKeyEvent`.
908b74cd 8930 """
5b5c9bc7 8931 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 8932
bf26d883
RD
8933 def MoveAfterInTabOrder(*args, **kwargs):
8934 """
5b5c9bc7 8935 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
8936
8937 Moves this window in the tab navigation order after the specified
8938 sibling window. This means that when the user presses the TAB key on
8939 that other window, the focus switches to this window.
8940
8941 The default tab order is the same as creation order. This function
8942 and `MoveBeforeInTabOrder` allow to change it after creating all the
8943 windows.
8944
8945 """
5b5c9bc7 8946 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
8947
8948 def MoveBeforeInTabOrder(*args, **kwargs):
8949 """
5b5c9bc7 8950 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
8951
8952 Same as `MoveAfterInTabOrder` except that it inserts this window just
8953 before win instead of putting it right after it.
8954 """
5b5c9bc7 8955 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 8956
d55e5bfc
RD
8957 def GetChildren(*args, **kwargs):
8958 """
8959 GetChildren(self) -> PyObject
8960
8961 Returns a list of the window's children. NOTE: Currently this is a
8962 copy of the child window list maintained by the window, so the return
8963 value of this function is only valid as long as the window's children
8964 do not change.
8965 """
5b5c9bc7 8966 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
8967
8968 def GetParent(*args, **kwargs):
8969 """
5b5c9bc7 8970 GetParent(self) -> Window
d55e5bfc
RD
8971
8972 Returns the parent window of this window, or None if there isn't one.
8973 """
5b5c9bc7 8974 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
8975
8976 def GetGrandParent(*args, **kwargs):
8977 """
5b5c9bc7 8978 GetGrandParent(self) -> Window
d55e5bfc 8979
15817c7e
RD
8980 Returns the parent of the parent of this window, or None if there
8981 isn't one.
d55e5bfc 8982 """
5b5c9bc7 8983 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
8984
8985 def IsTopLevel(*args, **kwargs):
8986 """
8987 IsTopLevel(self) -> bool
8988
8989 Returns true if the given window is a top-level one. Currently all
8990 frames and dialogs are always considered to be top-level windows (even
8991 if they have a parent window).
8992 """
5b5c9bc7 8993 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
8994
8995 def Reparent(*args, **kwargs):
8996 """
5b5c9bc7 8997 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
8998
8999 Reparents the window, i.e the window will be removed from its current
9000 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9001 re-inserted into another. Available on Windows and GTK. Returns True
9002 if the parent was changed, False otherwise (error or newParent ==
9003 oldParent)
9004 """
5b5c9bc7 9005 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
9006
9007 def AddChild(*args, **kwargs):
9008 """
5b5c9bc7 9009 AddChild(self, Window child)
d55e5bfc
RD
9010
9011 Adds a child window. This is called automatically by window creation
9012 functions so should not be required by the application programmer.
9013 """
5b5c9bc7 9014 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
9015
9016 def RemoveChild(*args, **kwargs):
9017 """
5b5c9bc7 9018 RemoveChild(self, Window child)
d55e5bfc
RD
9019
9020 Removes a child window. This is called automatically by window
9021 deletion functions so should not be required by the application
9022 programmer.
9023 """
5b5c9bc7 9024 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc
RD
9025
9026 def FindWindowById(*args, **kwargs):
9027 """
5b5c9bc7 9028 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
9029
9030 Find a chld of this window by window ID
9031 """
5b5c9bc7 9032 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
9033
9034 def FindWindowByName(*args, **kwargs):
9035 """
5b5c9bc7 9036 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
9037
9038 Find a child of this window by name
9039 """
5b5c9bc7 9040 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
9041
9042 def GetEventHandler(*args, **kwargs):
9043 """
5b5c9bc7 9044 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
9045
9046 Returns the event handler for this window. By default, the window is
9047 its own event handler.
9048 """
5b5c9bc7 9049 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
9050
9051 def SetEventHandler(*args, **kwargs):
9052 """
5b5c9bc7 9053 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
9054
9055 Sets the event handler for this window. An event handler is an object
9056 that is capable of processing the events sent to a window. By default,
9057 the window is its own event handler, but an application may wish to
9058 substitute another, for example to allow central implementation of
9059 event-handling for a variety of different window classes.
9060
15817c7e 9061 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
9062 up a chain of event handlers, where an event not handled by one event
9063 handler is handed to the next one in the chain.
9064 """
5b5c9bc7 9065 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
9066
9067 def PushEventHandler(*args, **kwargs):
9068 """
5b5c9bc7 9069 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
9070
9071 Pushes this event handler onto the event handler stack for the window.
9072 An event handler is an object that is capable of processing the events
9073 sent to a window. By default, the window is its own event handler, but
9074 an application may wish to substitute another, for example to allow
9075 central implementation of event-handling for a variety of different
9076 window classes.
9077
9078 wx.Window.PushEventHandler allows an application to set up a chain of
9079 event handlers, where an event not handled by one event handler is
15817c7e 9080 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
9081 remove the event handler.
9082 """
5b5c9bc7 9083 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
9084
9085 def PopEventHandler(*args, **kwargs):
9086 """
5b5c9bc7 9087 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
9088
9089 Removes and returns the top-most event handler on the event handler
9090 stack. If deleteHandler is True then the wx.EvtHandler object will be
9091 destroyed after it is popped.
9092 """
5b5c9bc7 9093 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
9094
9095 def RemoveEventHandler(*args, **kwargs):
9096 """
5b5c9bc7 9097 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 9098
15817c7e
RD
9099 Find the given handler in the event handler chain and remove (but not
9100 delete) it from the event handler chain, return True if it was found
9101 and False otherwise (this also results in an assert failure so this
9102 function should only be called when the handler is supposed to be
9103 there.)
d55e5bfc 9104 """
5b5c9bc7 9105 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
9106
9107 def SetValidator(*args, **kwargs):
9108 """
5b5c9bc7 9109 SetValidator(self, Validator validator)
d55e5bfc
RD
9110
9111 Deletes the current validator (if any) and sets the window validator,
9112 having called wx.Validator.Clone to create a new validator of this
9113 type.
9114 """
5b5c9bc7 9115 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
9116
9117 def GetValidator(*args, **kwargs):
9118 """
5b5c9bc7 9119 GetValidator(self) -> Validator
d55e5bfc
RD
9120
9121 Returns a pointer to the current validator for the window, or None if
9122 there is none.
9123 """
5b5c9bc7 9124 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
9125
9126 def Validate(*args, **kwargs):
9127 """
9128 Validate(self) -> bool
9129
9130 Validates the current values of the child controls using their
15817c7e
RD
9131 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9132 style flag set, the method will also call Validate() of all child
9133 windows. Returns false if any of the validations failed.
d55e5bfc 9134 """
5b5c9bc7 9135 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
9136
9137 def TransferDataToWindow(*args, **kwargs):
9138 """
9139 TransferDataToWindow(self) -> bool
9140
15817c7e
RD
9141 Transfers values to child controls from data areas specified by their
9142 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9143 style flag set, the method will also call TransferDataToWindow() of
9144 all child windows.
d55e5bfc 9145 """
5b5c9bc7 9146 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
9147
9148 def TransferDataFromWindow(*args, **kwargs):
9149 """
9150 TransferDataFromWindow(self) -> bool
9151
15817c7e
RD
9152 Transfers values from child controls to data areas specified by their
9153 validators. Returns false if a transfer failed. If the window has
9154 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9155 also call TransferDataFromWindow() of all child windows.
d55e5bfc 9156 """
5b5c9bc7 9157 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
9158
9159 def InitDialog(*args, **kwargs):
9160 """
9161 InitDialog(self)
9162
15817c7e
RD
9163 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9164 to the dialog via validators.
d55e5bfc 9165 """
5b5c9bc7 9166 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
9167
9168 def SetAcceleratorTable(*args, **kwargs):
9169 """
5b5c9bc7 9170 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
9171
9172 Sets the accelerator table for this window.
9173 """
5b5c9bc7 9174 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9175
9176 def GetAcceleratorTable(*args, **kwargs):
9177 """
5b5c9bc7 9178 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
9179
9180 Gets the accelerator table for this window.
9181 """
5b5c9bc7 9182 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9183
9184 def RegisterHotKey(*args, **kwargs):
9185 """
9186 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9187
9188 Registers a system wide hotkey. Every time the user presses the hotkey
9189 registered here, this window will receive a hotkey event. It will
9190 receive the event even if the application is in the background and
9191 does not have the input focus because the user is working with some
9192 other application. To bind an event handler function to this hotkey
9193 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9194 hotkey was registered successfully.
9195 """
5b5c9bc7 9196 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
9197
9198 def UnregisterHotKey(*args, **kwargs):
9199 """
9200 UnregisterHotKey(self, int hotkeyId) -> bool
9201
9202 Unregisters a system wide hotkey.
9203 """
5b5c9bc7 9204 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
9205
9206 def ConvertDialogPointToPixels(*args, **kwargs):
9207 """
5b5c9bc7 9208 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
9209
9210 Converts a point or size from dialog units to pixels. Dialog units
9211 are used for maintaining a dialog's proportions even if the font
9212 changes. For the x dimension, the dialog units are multiplied by the
9213 average character width and then divided by 4. For the y dimension,
9214 the dialog units are multiplied by the average character height and
9215 then divided by 8.
9216 """
5b5c9bc7 9217 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
9218
9219 def ConvertDialogSizeToPixels(*args, **kwargs):
9220 """
5b5c9bc7 9221 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
9222
9223 Converts a point or size from dialog units to pixels. Dialog units
9224 are used for maintaining a dialog's proportions even if the font
9225 changes. For the x dimension, the dialog units are multiplied by the
9226 average character width and then divided by 4. For the y dimension,
9227 the dialog units are multiplied by the average character height and
9228 then divided by 8.
9229 """
5b5c9bc7 9230 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
9231
9232 def DLG_PNT(*args, **kwargs):
9233 """
5b5c9bc7 9234 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
9235
9236 Converts a point or size from dialog units to pixels. Dialog units
9237 are used for maintaining a dialog's proportions even if the font
9238 changes. For the x dimension, the dialog units are multiplied by the
9239 average character width and then divided by 4. For the y dimension,
9240 the dialog units are multiplied by the average character height and
9241 then divided by 8.
9242 """
5b5c9bc7 9243 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
9244
9245 def DLG_SZE(*args, **kwargs):
9246 """
5b5c9bc7 9247 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
9248
9249 Converts a point or size from dialog units to pixels. Dialog units
9250 are used for maintaining a dialog's proportions even if the font
9251 changes. For the x dimension, the dialog units are multiplied by the
9252 average character width and then divided by 4. For the y dimension,
9253 the dialog units are multiplied by the average character height and
9254 then divided by 8.
9255 """
5b5c9bc7 9256 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
9257
9258 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
9259 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9260 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
9261
9262 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
9263 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9264 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
9265
9266 def WarpPointer(*args, **kwargs):
9267 """
9268 WarpPointer(self, int x, int y)
9269
9270 Moves the pointer to the given position on the window.
9271
9272 NOTE: This function is not supported under Mac because Apple Human
9273 Interface Guidelines forbid moving the mouse cursor programmatically.
9274 """
5b5c9bc7 9275 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
9276
9277 def CaptureMouse(*args, **kwargs):
9278 """
9279 CaptureMouse(self)
9280
9281 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9282 release the capture.
9283
9284 Note that wxWindows maintains the stack of windows having captured the
9285 mouse and when the mouse is released the capture returns to the window
9286 which had had captured it previously and it is only really released if
9287 there were no previous window. In particular, this means that you must
9288 release the mouse as many times as you capture it.
9289 """
5b5c9bc7 9290 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
9291
9292 def ReleaseMouse(*args, **kwargs):
9293 """
9294 ReleaseMouse(self)
9295
9296 Releases mouse input captured with wx.Window.CaptureMouse.
9297 """
5b5c9bc7 9298 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
9299
9300 def GetCapture(*args, **kwargs):
9301 """
5b5c9bc7 9302 GetCapture() -> Window
d55e5bfc
RD
9303
9304 Returns the window which currently captures the mouse or None
9305 """
5b5c9bc7 9306 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
9307
9308 GetCapture = staticmethod(GetCapture)
9309 def HasCapture(*args, **kwargs):
9310 """
9311 HasCapture(self) -> bool
9312
9313 Returns true if this window has the current mouse capture.
9314 """
5b5c9bc7 9315 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
9316
9317 def Refresh(*args, **kwargs):
9318 """
5b5c9bc7 9319 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
9320
9321 Mark the specified rectangle (or the whole window) as "dirty" so it
9322 will be repainted. Causes an EVT_PAINT event to be generated and sent
9323 to the window.
9324 """
5b5c9bc7 9325 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
9326
9327 def RefreshRect(*args, **kwargs):
9328 """
5b5c9bc7 9329 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
9330
9331 Redraws the contents of the given rectangle: the area inside it will
9332 be repainted. This is the same as Refresh but has a nicer syntax.
9333 """
5b5c9bc7 9334 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
9335
9336 def Update(*args, **kwargs):
9337 """
9338 Update(self)
9339
9340 Calling this method immediately repaints the invalidated area of the
9341 window instead of waiting for the EVT_PAINT event to happen, (normally
9342 this would usually only happen when the flow of control returns to the
9343 event loop.) Notice that this function doesn't refresh the window and
9344 does nothing if the window has been already repainted. Use Refresh
9345 first if you want to immediately redraw the window (or some portion of
9346 it) unconditionally.
9347 """
5b5c9bc7 9348 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
9349
9350 def ClearBackground(*args, **kwargs):
9351 """
9352 ClearBackground(self)
9353
9354 Clears the window by filling it with the current background
9355 colour. Does not cause an erase background event to be generated.
9356 """
5b5c9bc7 9357 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
9358
9359 def Freeze(*args, **kwargs):
9360 """
9361 Freeze(self)
9362
15817c7e
RD
9363 Freezes the window or, in other words, prevents any updates from
9364 taking place on screen, the window is not redrawn at all. Thaw must be
9365 called to reenable window redrawing. Calls to Freeze/Thaw may be
9366 nested, with the actual Thaw being delayed until all the nesting has
9367 been undone.
d55e5bfc
RD
9368
9369 This method is useful for visual appearance optimization (for example,
9370 it is a good idea to use it before inserting large amount of text into
9371 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9372 for all controls so it is mostly just a hint to wxWindows and not a
9373 mandatory directive.
9374 """
5b5c9bc7 9375 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc
RD
9376
9377 def Thaw(*args, **kwargs):
9378 """
9379 Thaw(self)
9380
9381 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
9382 Freeze/Thaw may be nested, so Thaw must be called the same number of
9383 times that Freeze was before the window will be updated.
d55e5bfc 9384 """
5b5c9bc7 9385 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
9386
9387 def PrepareDC(*args, **kwargs):
9388 """
5b5c9bc7 9389 PrepareDC(self, DC dc)
d55e5bfc
RD
9390
9391 Call this function to prepare the device context for drawing a
9392 scrolled image. It sets the device origin according to the current
9393 scroll position.
9394 """
5b5c9bc7 9395 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc
RD
9396
9397 def GetUpdateRegion(*args, **kwargs):
9398 """
5b5c9bc7 9399 GetUpdateRegion(self) -> Region
d55e5bfc
RD
9400
9401 Returns the region specifying which parts of the window have been
9402 damaged. Should only be called within an EVT_PAINT handler.
9403 """
5b5c9bc7 9404 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
9405
9406 def GetUpdateClientRect(*args, **kwargs):
9407 """
5b5c9bc7 9408 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
9409
9410 Get the update rectangle region bounding box in client coords.
9411 """
5b5c9bc7 9412 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
9413
9414 def IsExposed(*args, **kwargs):
9415 """
9416 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9417
9418 Returns true if the given point or rectangle area has been exposed
9419 since the last repaint. Call this in an paint event handler to
9420 optimize redrawing by only redrawing those areas, which have been
9421 exposed.
9422 """
5b5c9bc7 9423 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
9424
9425 def IsExposedPoint(*args, **kwargs):
9426 """
5b5c9bc7 9427 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
9428
9429 Returns true if the given point or rectangle area has been exposed
9430 since the last repaint. Call this in an paint event handler to
9431 optimize redrawing by only redrawing those areas, which have been
9432 exposed.
9433 """
5b5c9bc7 9434 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
9435
9436 def IsExposedRect(*args, **kwargs):
9437 """
5b5c9bc7 9438 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
9439
9440 Returns true if the given point or rectangle area has been exposed
9441 since the last repaint. Call this in an paint event handler to
9442 optimize redrawing by only redrawing those areas, which have been
9443 exposed.
9444 """
5b5c9bc7 9445 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
9446
9447 def GetDefaultAttributes(*args, **kwargs):
9448 """
5b5c9bc7 9449 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 9450
15817c7e
RD
9451 Get the default attributes for an instance of this class. This is
9452 useful if you want to use the same font or colour in your own control
9453 as in a standard control -- which is a much better idea than hard
9454 coding specific colours or fonts which might look completely out of
a5ee0656 9455 place on the user's system, especially if it uses themes.
d55e5bfc 9456 """
5b5c9bc7 9457 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9458
9459 def GetClassDefaultAttributes(*args, **kwargs):
9460 """
5b5c9bc7 9461 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9462
15817c7e
RD
9463 Get the default attributes for this class. This is useful if you want
9464 to use the same font or colour in your own control as in a standard
9465 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9466 colours or fonts which might look completely out of place on the
9467 user's system, especially if it uses themes.
d55e5bfc
RD
9468
9469 The variant parameter is only relevant under Mac currently and is
15817c7e 9470 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9471 the returned font. See `wx.Window.SetWindowVariant` for more about
9472 this.
d55e5bfc 9473 """
5b5c9bc7 9474 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9475
9476 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9477 def SetBackgroundColour(*args, **kwargs):
9478 """
5b5c9bc7 9479 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9480
9481 Sets the background colour of the window. Returns True if the colour
9482 was changed. The background colour is usually painted by the default
9483 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9484 automatically under GTK. Using `wx.NullColour` will reset the window
9485 to the default background colour.
d55e5bfc 9486
a5ee0656 9487 Note that setting the background colour may not cause an immediate
f8167d6e 9488 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
9489 calling this function.
9490
f8167d6e
RD
9491 Using this function will disable attempts to use themes for this
9492 window, if the system supports them. Use with care since usually the
9493 themes represent the appearance chosen by the user to be used for all
9494 applications on the system.
d55e5bfc 9495 """
5b5c9bc7 9496 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 9497
412d302d 9498 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
9499 """SetOwnBackgroundColour(self, Colour colour)"""
9500 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9501
9502 def SetForegroundColour(*args, **kwargs):
9503 """
5b5c9bc7 9504 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9505
9506 Sets the foreground colour of the window. Returns True is the colour
9507 was changed. The interpretation of foreground colour is dependent on
9508 the window class; it may be the text colour or other colour, or it may
9509 not be used at all.
9510 """
5b5c9bc7 9511 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 9512
fa47d7a7 9513 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
9514 """SetOwnForegroundColour(self, Colour colour)"""
9515 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9516
9517 def GetBackgroundColour(*args, **kwargs):
9518 """
5b5c9bc7 9519 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
9520
9521 Returns the background colour of the window.
9522 """
5b5c9bc7 9523 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9524
9525 def GetForegroundColour(*args, **kwargs):
9526 """
5b5c9bc7 9527 GetForegroundColour(self) -> Colour
d55e5bfc
RD
9528
9529 Returns the foreground colour of the window. The interpretation of
9530 foreground colour is dependent on the window class; it may be the text
9531 colour or other colour, or it may not be used at all.
9532 """
5b5c9bc7 9533 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 9534
dcb8fc74
RD
9535 def InheritsBackgroundColour(*args, **kwargs):
9536 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 9537 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
9538
9539 def UseBgCol(*args, **kwargs):
9540 """UseBgCol(self) -> bool"""
5b5c9bc7 9541 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 9542
0f63ec68
RD
9543 def SetBackgroundStyle(*args, **kwargs):
9544 """
9545 SetBackgroundStyle(self, int style) -> bool
9546
9547 Returns the background style of the window. The background style
9548 indicates how the background of the window is drawn.
9549
9550 ====================== ========================================
9551 wx.BG_STYLE_SYSTEM The background colour or pattern should
9552 be determined by the system
9553 wx.BG_STYLE_COLOUR The background should be a solid colour
9554 wx.BG_STYLE_CUSTOM The background will be implemented by the
9555 application.
9556 ====================== ========================================
9557
9558 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9559 a custom background, such as a tiled bitmap. Currently the style has
9560 no effect on other platforms.
9561
9562 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9563 """
5b5c9bc7 9564 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
9565
9566 def GetBackgroundStyle(*args, **kwargs):
9567 """
9568 GetBackgroundStyle(self) -> int
9569
9570 Returns the background style of the window.
9571
9572 :see: `SetBackgroundStyle`
9573 """
5b5c9bc7 9574 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 9575
51b83b37
RD
9576 def HasTransparentBackground(*args, **kwargs):
9577 """
9578 HasTransparentBackground(self) -> bool
9579
9580 Returns True if this window's background is transparent (as, for
9581 example, for `wx.StaticText`) and should show the parent window's
9582 background.
9583
9584 This method is mostly used internally by the library itself and you
9585 normally shouldn't have to call it. You may, however, have to override
9586 it in your custom control classes to ensure that background is painted
9587 correctly.
9588 """
5b5c9bc7 9589 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 9590
d55e5bfc
RD
9591 def SetCursor(*args, **kwargs):
9592 """
5b5c9bc7 9593 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
9594
9595 Sets the window's cursor. Notice that the window cursor also sets it
9596 for the children of the window implicitly.
9597
9598 The cursor may be wx.NullCursor in which case the window cursor will
9599 be reset back to default.
9600 """
5b5c9bc7 9601 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
9602
9603 def GetCursor(*args, **kwargs):
9604 """
5b5c9bc7 9605 GetCursor(self) -> Cursor
d55e5bfc
RD
9606
9607 Return the cursor associated with this window.
9608 """
5b5c9bc7 9609 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
9610
9611 def SetFont(*args, **kwargs):
9612 """
5b5c9bc7 9613 SetFont(self, Font font) -> bool
d55e5bfc
RD
9614
9615 Sets the font for this window.
9616 """
5b5c9bc7 9617 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9618
fa47d7a7 9619 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9620 """SetOwnFont(self, Font font)"""
9621 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9622
9623 def GetFont(*args, **kwargs):
9624 """
5b5c9bc7 9625 GetFont(self) -> Font
d55e5bfc
RD
9626
9627 Returns the default font used for this window.
9628 """
5b5c9bc7 9629 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9630
9631 def SetCaret(*args, **kwargs):
9632 """
5b5c9bc7 9633 SetCaret(self, Caret caret)
d55e5bfc
RD
9634
9635 Sets the caret associated with the window.
9636 """
5b5c9bc7 9637 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9638
9639 def GetCaret(*args, **kwargs):
9640 """
5b5c9bc7 9641 GetCaret(self) -> Caret
d55e5bfc
RD
9642
9643 Returns the caret associated with the window.
9644 """
5b5c9bc7 9645 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9646
9647 def GetCharHeight(*args, **kwargs):
9648 """
9649 GetCharHeight(self) -> int
9650
9651 Get the (average) character size for the current font.
9652 """
5b5c9bc7 9653 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9654
9655 def GetCharWidth(*args, **kwargs):
9656 """
9657 GetCharWidth(self) -> int
9658
9659 Get the (average) character size for the current font.
9660 """
5b5c9bc7 9661 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9662
9663 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9664 """
9665 GetTextExtent(String string) -> (width, height)
9666
9667 Get the width and height of the text using the current font.
9668 """
5b5c9bc7 9669 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9670
9671 def GetFullTextExtent(*args, **kwargs):
9672 """
9673 GetFullTextExtent(String string, Font font=None) ->
9674 (width, height, descent, externalLeading)
9675
9676 Get the width, height, decent and leading of the text using the
9677 current or specified font.
9678 """
5b5c9bc7 9679 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9680
9681 def ClientToScreenXY(*args, **kwargs):
9682 """
9683 ClientToScreenXY(int x, int y) -> (x,y)
9684
9685 Converts to screen coordinates from coordinates relative to this window.
9686 """
5b5c9bc7 9687 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9688
9689 def ScreenToClientXY(*args, **kwargs):
9690 """
9691 ScreenToClientXY(int x, int y) -> (x,y)
9692
9693 Converts from screen to client window coordinates.
9694 """
5b5c9bc7 9695 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9696
9697 def ClientToScreen(*args, **kwargs):
9698 """
5b5c9bc7 9699 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9700
9701 Converts to screen coordinates from coordinates relative to this window.
9702 """
5b5c9bc7 9703 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9704
9705 def ScreenToClient(*args, **kwargs):
9706 """
5b5c9bc7 9707 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9708
9709 Converts from screen to client window coordinates.
9710 """
5b5c9bc7 9711 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9712
9713 def HitTestXY(*args, **kwargs):
9714 """
9715 HitTestXY(self, int x, int y) -> int
9716
9717 Test where the given (in client coords) point lies
9718 """
5b5c9bc7 9719 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9720
9721 def HitTest(*args, **kwargs):
9722 """
5b5c9bc7 9723 HitTest(self, Point pt) -> int
d55e5bfc
RD
9724
9725 Test where the given (in client coords) point lies
9726 """
5b5c9bc7 9727 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9728
9729 def GetBorder(*args):
9730 """
9731 GetBorder(self, long flags) -> int
9732 GetBorder(self) -> int
9733
9734 Get border for the flags of this window
9735 """
5b5c9bc7 9736 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9737
9738 def UpdateWindowUI(*args, **kwargs):
9739 """
5b5c9bc7 9740 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9741
9742 This function sends EVT_UPDATE_UI events to the window. The particular
9743 implementation depends on the window; for example a wx.ToolBar will
9744 send an update UI event for each toolbar button, and a wx.Frame will
9745 send an update UI event for each menubar menu item. You can call this
9746 function from your application to ensure that your UI is up-to-date at
9747 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9748 concerned). This may be necessary if you have called
5ba5649b 9749 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9750 limit the overhead that wxWindows incurs by sending update UI events
9751 in idle time.
d55e5bfc 9752 """
5b5c9bc7 9753 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9754
9755 def PopupMenuXY(*args, **kwargs):
9756 """
5b5c9bc7 9757 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9758
b0503257
RD
9759 Pops up the given menu at the specified coordinates, relative to this window,
9760 and returns control when the user has dismissed the menu. If a menu item is
9761 selected, the corresponding menu event is generated and will be processed as
9762 usual. If the default position is given then the current position of the
9763 mouse cursor will be used.
d55e5bfc 9764 """
5b5c9bc7 9765 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9766
9767 def PopupMenu(*args, **kwargs):
9768 """
5b5c9bc7 9769 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9770
b0503257
RD
9771 Pops up the given menu at the specified coordinates, relative to this window,
9772 and returns control when the user has dismissed the menu. If a menu item is
9773 selected, the corresponding menu event is generated and will be processed as
9774 usual. If the default position is given then the current position of the
9775 mouse cursor will be used.
d55e5bfc 9776 """
5b5c9bc7 9777 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc
RD
9778
9779 def GetHandle(*args, **kwargs):
9780 """
9781 GetHandle(self) -> long
9782
9783 Returns the platform-specific handle (as a long integer) of the
9784 physical window. Currently on wxMac it returns the handle of the
9785 toplevel parent of the window.
9786 """
5b5c9bc7 9787 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 9788
629e65c2
RD
9789 def AssociateHandle(*args, **kwargs):
9790 """
9791 AssociateHandle(self, long handle)
9792
9793 Associate the window with a new native handle
9794 """
5b5c9bc7 9795 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
9796
9797 def DissociateHandle(*args, **kwargs):
9798 """
9799 DissociateHandle(self)
9800
9801 Dissociate the current native handle from the window
9802 """
5b5c9bc7 9803 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 9804
d55e5bfc
RD
9805 def HasScrollbar(*args, **kwargs):
9806 """
9807 HasScrollbar(self, int orient) -> bool
9808
9809 Does the window have the scrollbar for this orientation?
9810 """
5b5c9bc7 9811 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
9812
9813 def SetScrollbar(*args, **kwargs):
9814 """
15817c7e 9815 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9816 bool refresh=True)
9817
9818 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 9819 """
5b5c9bc7 9820 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
9821
9822 def SetScrollPos(*args, **kwargs):
9823 """
9824 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9825
9826 Sets the position of one of the built-in scrollbars.
9827 """
5b5c9bc7 9828 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
9829
9830 def GetScrollPos(*args, **kwargs):
9831 """
9832 GetScrollPos(self, int orientation) -> int
9833
9834 Returns the built-in scrollbar position.
9835 """
5b5c9bc7 9836 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
9837
9838 def GetScrollThumb(*args, **kwargs):
9839 """
9840 GetScrollThumb(self, int orientation) -> int
9841
9842 Returns the built-in scrollbar thumb size.
9843 """
5b5c9bc7 9844 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
9845
9846 def GetScrollRange(*args, **kwargs):
9847 """
9848 GetScrollRange(self, int orientation) -> int
9849
9850 Returns the built-in scrollbar range.
9851 """
5b5c9bc7 9852 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
9853
9854 def ScrollWindow(*args, **kwargs):
9855 """
5b5c9bc7 9856 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
9857
9858 Physically scrolls the pixels in the window and move child windows
9859 accordingly. Use this function to optimise your scrolling
9860 implementations, to minimise the area that must be redrawn. Note that
9861 it is rarely required to call this function from a user program.
d55e5bfc 9862 """
5b5c9bc7 9863 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
9864
9865 def ScrollLines(*args, **kwargs):
9866 """
9867 ScrollLines(self, int lines) -> bool
9868
9869 If the platform and window class supports it, scrolls the window by
9870 the given number of lines down, if lines is positive, or up if lines
9871 is negative. Returns True if the window was scrolled, False if it was
9872 already on top/bottom and nothing was done.
9873 """
5b5c9bc7 9874 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
9875
9876 def ScrollPages(*args, **kwargs):
9877 """
9878 ScrollPages(self, int pages) -> bool
9879
15817c7e 9880 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9881 the given number of pages down, if pages is positive, or up if pages
9882 is negative. Returns True if the window was scrolled, False if it was
9883 already on top/bottom and nothing was done.
9884 """
5b5c9bc7 9885 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
9886
9887 def LineUp(*args, **kwargs):
9888 """
9889 LineUp(self) -> bool
9890
9891 This is just a wrapper for ScrollLines(-1).
9892 """
5b5c9bc7 9893 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
9894
9895 def LineDown(*args, **kwargs):
9896 """
9897 LineDown(self) -> bool
9898
9899 This is just a wrapper for ScrollLines(1).
9900 """
5b5c9bc7 9901 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
9902
9903 def PageUp(*args, **kwargs):
9904 """
9905 PageUp(self) -> bool
9906
9907 This is just a wrapper for ScrollPages(-1).
9908 """
5b5c9bc7 9909 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
9910
9911 def PageDown(*args, **kwargs):
9912 """
9913 PageDown(self) -> bool
9914
9915 This is just a wrapper for ScrollPages(1).
9916 """
5b5c9bc7 9917 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
9918
9919 def SetHelpText(*args, **kwargs):
9920 """
5b5c9bc7 9921 SetHelpText(self, String text)
d55e5bfc
RD
9922
9923 Sets the help text to be used as context-sensitive help for this
9924 window. Note that the text is actually stored by the current
9925 wxHelpProvider implementation, and not in the window object itself.
9926 """
5b5c9bc7 9927 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
9928
9929 def SetHelpTextForId(*args, **kwargs):
9930 """
5b5c9bc7 9931 SetHelpTextForId(self, String text)
d55e5bfc
RD
9932
9933 Associate this help text with all windows with the same id as this
9934 one.
9935 """
5b5c9bc7 9936 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc
RD
9937
9938 def GetHelpText(*args, **kwargs):
9939 """
5b5c9bc7 9940 GetHelpText(self) -> String
d55e5bfc
RD
9941
9942 Gets the help text to be used as context-sensitive help for this
9943 window. Note that the text is actually stored by the current
9944 wxHelpProvider implementation, and not in the window object itself.
9945 """
5b5c9bc7 9946 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
9947
9948 def SetToolTipString(*args, **kwargs):
9949 """
5b5c9bc7 9950 SetToolTipString(self, String tip)
d55e5bfc
RD
9951
9952 Attach a tooltip to the window.
9953 """
5b5c9bc7 9954 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
9955
9956 def SetToolTip(*args, **kwargs):
9957 """
5b5c9bc7 9958 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
9959
9960 Attach a tooltip to the window.
9961 """
5b5c9bc7 9962 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
9963
9964 def GetToolTip(*args, **kwargs):
9965 """
5b5c9bc7 9966 GetToolTip(self) -> ToolTip
d55e5bfc
RD
9967
9968 get the associated tooltip or None if none
9969 """
5b5c9bc7 9970 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
9971
9972 def SetDropTarget(*args, **kwargs):
9973 """
5b5c9bc7 9974 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
9975
9976 Associates a drop target with this window. If the window already has
9977 a drop target, it is deleted.
9978 """
5b5c9bc7 9979 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
9980
9981 def GetDropTarget(*args, **kwargs):
9982 """
5b5c9bc7 9983 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
9984
9985 Returns the associated drop target, which may be None.
9986 """
5b5c9bc7 9987 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 9988
5ba5649b
RD
9989 def DragAcceptFiles(*args, **kwargs):
9990 """
9991 DragAcceptFiles(self, bool accept)
9992
9993 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9994 Only functional on Windows.
9995 """
9996 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9997
d55e5bfc
RD
9998 def SetConstraints(*args, **kwargs):
9999 """
5b5c9bc7 10000 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
10001
10002 Sets the window to have the given layout constraints. If an existing
10003 layout constraints object is already owned by the window, it will be
10004 deleted. Pass None to disassociate and delete the window's current
10005 constraints.
10006
10007 You must call SetAutoLayout to tell a window to use the constraints
10008 automatically in its default EVT_SIZE handler; otherwise, you must
10009 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10010 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10011 effect.
10012 """
5b5c9bc7 10013 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
10014
10015 def GetConstraints(*args, **kwargs):
10016 """
5b5c9bc7 10017 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
10018
10019 Returns a pointer to the window's layout constraints, or None if there
10020 are none.
10021 """
5b5c9bc7 10022 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
10023
10024 def SetAutoLayout(*args, **kwargs):
10025 """
10026 SetAutoLayout(self, bool autoLayout)
10027
10028 Determines whether the Layout function will be called automatically
10029 when the window is resized. It is called implicitly by SetSizer but
10030 if you use SetConstraints you should call it manually or otherwise the
10031 window layout won't be correctly updated when its size changes.
10032 """
5b5c9bc7 10033 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
10034
10035 def GetAutoLayout(*args, **kwargs):
10036 """
10037 GetAutoLayout(self) -> bool
10038
10039 Returns the current autoLayout setting
10040 """
5b5c9bc7 10041 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
10042
10043 def Layout(*args, **kwargs):
10044 """
10045 Layout(self) -> bool
10046
10047 Invokes the constraint-based layout algorithm or the sizer-based
10048 algorithm for this window. See SetAutoLayout: when auto layout is on,
10049 this function gets called automatically by the default EVT_SIZE
10050 handler when the window is resized.
10051 """
5b5c9bc7 10052 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
10053
10054 def SetSizer(*args, **kwargs):
10055 """
5b5c9bc7 10056 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
10057
10058 Sets the window to have the given layout sizer. The window will then
10059 own the object, and will take care of its deletion. If an existing
10060 layout sizer object is already owned by the window, it will be deleted
10061 if the deleteOld parameter is true. Note that this function will also
10062 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 10063 non-None, and False otherwise.
d55e5bfc 10064 """
5b5c9bc7 10065 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
10066
10067 def SetSizerAndFit(*args, **kwargs):
10068 """
5b5c9bc7 10069 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
10070
10071 The same as SetSizer, except it also sets the size hints for the
10072 window based on the sizer's minimum size.
10073 """
5b5c9bc7 10074 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
10075
10076 def GetSizer(*args, **kwargs):
10077 """
5b5c9bc7 10078 GetSizer(self) -> Sizer
d55e5bfc
RD
10079
10080 Return the sizer associated with the window by a previous call to
10081 SetSizer or None if there isn't one.
10082 """
5b5c9bc7 10083 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
10084
10085 def SetContainingSizer(*args, **kwargs):
10086 """
5b5c9bc7 10087 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
10088
10089 This normally does not need to be called by application code. It is
10090 called internally when a window is added to a sizer, and is used so
10091 the window can remove itself from the sizer when it is destroyed.
10092 """
5b5c9bc7 10093 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
10094
10095 def GetContainingSizer(*args, **kwargs):
10096 """
5b5c9bc7 10097 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
10098
10099 Return the sizer that this window is a member of, if any, otherwise None.
10100 """
5b5c9bc7 10101 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
10102
10103 def InheritAttributes(*args, **kwargs):
10104 """
10105 InheritAttributes(self)
10106
15817c7e
RD
10107 This function is (or should be, in case of custom controls) called
10108 during window creation to intelligently set up the window visual
10109 attributes, that is the font and the foreground and background
10110 colours.
10111
10112 By 'intelligently' the following is meant: by default, all windows use
10113 their own default attributes. However if some of the parent's
10114 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10115 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
10116 explicitly set for this window itself, then this window takes the same
10117 value as used by the parent. In addition, if the window overrides
10118 ShouldInheritColours to return false, the colours will not be changed
10119 no matter what and only the font might.
10120
a7bb0a9d
RD
10121 This rather complicated logic is necessary in order to accommodate the
10122 different usage scenarios. The most common one is when all default
15817c7e
RD
10123 attributes are used and in this case, nothing should be inherited as
10124 in modern GUIs different controls use different fonts (and colours)
10125 than their siblings so they can't inherit the same value from the
10126 parent. However it was also deemed desirable to allow to simply change
10127 the attributes of all children at once by just changing the font or
10128 colour of their common parent, hence in this case we do inherit the
10129 parents attributes.
10130
d55e5bfc 10131 """
5b5c9bc7 10132 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
10133
10134 def ShouldInheritColours(*args, **kwargs):
10135 """
10136 ShouldInheritColours(self) -> bool
10137
10138 Return true from here to allow the colours of this window to be
15817c7e
RD
10139 changed by InheritAttributes, returning false forbids inheriting them
10140 from the parent window.
d55e5bfc 10141
15817c7e
RD
10142 The base class version returns false, but this method is overridden in
10143 wxControl where it returns true.
d55e5bfc 10144 """
5b5c9bc7 10145 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc
RD
10146
10147 def PostCreate(self, pre):
10148 """
10149 Phase 3 of the 2-phase create <wink!>
10150 Call this method after precreating the window with the 2-phase create method.
10151 """
10152 self.this = pre.this
10153 self.thisown = pre.thisown
10154 pre.thisown = 0
10155 if hasattr(self, '_setOORInfo'):
10156 self._setOORInfo(self)
10157 if hasattr(self, '_setCallbackInfo'):
10158 self._setCallbackInfo(self, self.__class__)
10159
10160
5b5c9bc7 10161class WindowPtr(Window):
d55e5bfc
RD
10162 def __init__(self, this):
10163 self.this = this
10164 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10165 self.__class__ = Window
10166_core_.Window_swigregister(WindowPtr)
d55e5bfc
RD
10167
10168def PreWindow(*args, **kwargs):
10169 """
5b5c9bc7 10170 PreWindow() -> Window
d55e5bfc
RD
10171
10172 Precreate a Window for 2-phase creation.
10173 """
5b5c9bc7 10174 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
10175 val.thisown = 1
10176 return val
10177
5b5c9bc7 10178def Window_NewControlId(*args, **kwargs):
d55e5bfc 10179 """
5b5c9bc7 10180 Window_NewControlId() -> int
d55e5bfc
RD
10181
10182 Generate a control id for the controls which were not given one.
10183 """
5b5c9bc7 10184 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc 10185
5b5c9bc7 10186def Window_NextControlId(*args, **kwargs):
d55e5bfc 10187 """
5b5c9bc7 10188 Window_NextControlId(int winid) -> int
d55e5bfc
RD
10189
10190 Get the id of the control following the one with the given
15817c7e 10191 autogenerated) id
d55e5bfc 10192 """
5b5c9bc7 10193 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 10194
5b5c9bc7 10195def Window_PrevControlId(*args, **kwargs):
d55e5bfc 10196 """
5b5c9bc7 10197 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
10198
10199 Get the id of the control preceding the one with the given
15817c7e 10200 autogenerated) id
d55e5bfc 10201 """
5b5c9bc7 10202 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 10203
5b5c9bc7 10204def Window_FindFocus(*args, **kwargs):
d55e5bfc 10205 """
5b5c9bc7 10206 Window_FindFocus() -> Window
d55e5bfc
RD
10207
10208 Returns the window or control that currently has the keyboard focus,
10209 or None.
10210 """
5b5c9bc7 10211 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc 10212
5b5c9bc7 10213def Window_GetCapture(*args, **kwargs):
d55e5bfc 10214 """
5b5c9bc7 10215 Window_GetCapture() -> Window
d55e5bfc
RD
10216
10217 Returns the window which currently captures the mouse or None
10218 """
5b5c9bc7 10219 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc 10220
5b5c9bc7 10221def Window_GetClassDefaultAttributes(*args, **kwargs):
d55e5bfc 10222 """
5b5c9bc7 10223 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 10224
15817c7e
RD
10225 Get the default attributes for this class. This is useful if you want
10226 to use the same font or colour in your own control as in a standard
10227 control -- which is a much better idea than hard coding specific
a5ee0656
RD
10228 colours or fonts which might look completely out of place on the
10229 user's system, especially if it uses themes.
d55e5bfc
RD
10230
10231 The variant parameter is only relevant under Mac currently and is
15817c7e 10232 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
10233 the returned font. See `wx.Window.SetWindowVariant` for more about
10234 this.
d55e5bfc 10235 """
5b5c9bc7 10236 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10237
10238def DLG_PNT(win, point_or_x, y=None):
10239 """
10240 Convenience function for converting a Point or (x,y) in
10241 dialog units to pixel units.
10242 """
10243 if y is None:
10244 return win.ConvertDialogPointToPixels(point_or_x)
10245 else:
10246 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10247
10248def DLG_SZE(win, size_width, height=None):
10249 """
10250 Convenience function for converting a Size or (w,h) in
10251 dialog units to pixel units.
10252 """
10253 if height is None:
10254 return win.ConvertDialogSizeToPixels(size_width)
10255 else:
10256 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10257
10258
5b5c9bc7 10259def FindWindowById(*args, **kwargs):
d55e5bfc 10260 """
5b5c9bc7 10261 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
10262
10263 Find the first window in the application with the given id. If parent
10264 is None, the search will start from all top-level frames and dialog
10265 boxes; if non-None, the search will be limited to the given window
10266 hierarchy. The search is recursive in both cases.
10267 """
5b5c9bc7 10268 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 10269
5b5c9bc7 10270def FindWindowByName(*args, **kwargs):
d55e5bfc 10271 """
5b5c9bc7 10272 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
10273
10274 Find a window by its name (as given in a window constructor or Create
10275 function call). If parent is None, the search will start from all
10276 top-level frames and dialog boxes; if non-None, the search will be
10277 limited to the given window hierarchy. The search is recursive in both
10278 cases.
10279
10280 If no window with such name is found, wx.FindWindowByLabel is called.
10281 """
5b5c9bc7 10282 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 10283
5b5c9bc7 10284def FindWindowByLabel(*args, **kwargs):
d55e5bfc 10285 """
5b5c9bc7 10286 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
10287
10288 Find a window by its label. Depending on the type of window, the label
10289 may be a window title or panel item label. If parent is None, the
10290 search will start from all top-level frames and dialog boxes; if
10291 non-None, the search will be limited to the given window
10292 hierarchy. The search is recursive in both cases.
10293 """
5b5c9bc7 10294 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 10295
5b5c9bc7
RD
10296def Window_FromHWND(*args, **kwargs):
10297 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10298 return _core_.Window_FromHWND(*args, **kwargs)
3215336e
RD
10299
10300def GetTopLevelWindows(*args, **kwargs):
10301 """
10302 GetTopLevelWindows() -> PyObject
10303
10304 Returns a list of the the application's top-level windows, (frames,
10305 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10306 by wxWidgets, and so it is only valid as long as no top-level windows
10307 are closed or new top-level windows are created.
10308
10309 """
10310 return _core_.GetTopLevelWindows(*args, **kwargs)
d55e5bfc
RD
10311#---------------------------------------------------------------------------
10312
5b5c9bc7
RD
10313class Validator(EvtHandler):
10314 """Proxy of C++ Validator class"""
d55e5bfc
RD
10315 def __repr__(self):
10316 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10317 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10318 """__init__(self) -> Validator"""
10319 newobj = _core_.new_Validator(*args, **kwargs)
d55e5bfc
RD
10320 self.this = newobj.this
10321 self.thisown = 1
10322 del newobj.thisown
10323 self._setOORInfo(self)
10324
10325 def Clone(*args, **kwargs):
5b5c9bc7
RD
10326 """Clone(self) -> Validator"""
10327 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
10328
10329 def Validate(*args, **kwargs):
5b5c9bc7
RD
10330 """Validate(self, Window parent) -> bool"""
10331 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
10332
10333 def TransferToWindow(*args, **kwargs):
10334 """TransferToWindow(self) -> bool"""
5b5c9bc7 10335 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
10336
10337 def TransferFromWindow(*args, **kwargs):
10338 """TransferFromWindow(self) -> bool"""
5b5c9bc7 10339 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
10340
10341 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
10342 """GetWindow(self) -> Window"""
10343 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
10344
10345 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
10346 """SetWindow(self, Window window)"""
10347 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
10348
10349 def IsSilent(*args, **kwargs):
d6c14a4c 10350 """IsSilent() -> bool"""
5b5c9bc7 10351 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
10352
10353 IsSilent = staticmethod(IsSilent)
10354 def SetBellOnError(*args, **kwargs):
d6c14a4c 10355 """SetBellOnError(int doIt=True)"""
5b5c9bc7 10356 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
10357
10358 SetBellOnError = staticmethod(SetBellOnError)
10359
5b5c9bc7 10360class ValidatorPtr(Validator):
d55e5bfc
RD
10361 def __init__(self, this):
10362 self.this = this
10363 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10364 self.__class__ = Validator
10365_core_.Validator_swigregister(ValidatorPtr)
d55e5bfc 10366
5b5c9bc7
RD
10367def Validator_IsSilent(*args, **kwargs):
10368 """Validator_IsSilent() -> bool"""
10369 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc 10370
5b5c9bc7
RD
10371def Validator_SetBellOnError(*args, **kwargs):
10372 """Validator_SetBellOnError(int doIt=True)"""
10373 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 10374
5b5c9bc7
RD
10375class PyValidator(Validator):
10376 """Proxy of C++ PyValidator class"""
d55e5bfc
RD
10377 def __repr__(self):
10378 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10379 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10380 """__init__(self) -> PyValidator"""
10381 newobj = _core_.new_PyValidator(*args, **kwargs)
d55e5bfc
RD
10382 self.this = newobj.this
10383 self.thisown = 1
10384 del newobj.thisown
10385
10386 self._setCallbackInfo(self, PyValidator, 1)
10387 self._setOORInfo(self)
10388
10389 def _setCallbackInfo(*args, **kwargs):
10390 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 10391 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
10392
10393
5b5c9bc7 10394class PyValidatorPtr(PyValidator):
d55e5bfc
RD
10395 def __init__(self, this):
10396 self.this = this
10397 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10398 self.__class__ = PyValidator
10399_core_.PyValidator_swigregister(PyValidatorPtr)
d55e5bfc
RD
10400
10401#---------------------------------------------------------------------------
10402
5b5c9bc7
RD
10403class Menu(EvtHandler):
10404 """Proxy of C++ Menu class"""
d55e5bfc
RD
10405 def __repr__(self):
10406 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10407 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10408 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10409 newobj = _core_.new_Menu(*args, **kwargs)
d55e5bfc
RD
10410 self.this = newobj.this
10411 self.thisown = 1
10412 del newobj.thisown
10413 self._setOORInfo(self)
10414
10415 def Append(*args, **kwargs):
5b5c9bc7
RD
10416 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10417 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
10418
10419 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
10420 """AppendSeparator(self) -> MenuItem"""
10421 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
10422
10423 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
10424 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10425 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
10426
10427 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
10428 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10429 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
10430
10431 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
10432 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10433 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc
RD
10434
10435 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
10436 """AppendItem(self, MenuItem item) -> MenuItem"""
10437 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc
RD
10438
10439 def Break(*args, **kwargs):
10440 """Break(self)"""
5b5c9bc7 10441 return _core_.Menu_Break(*args, **kwargs)
d55e5bfc
RD
10442
10443 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
10444 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10445 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc
RD
10446
10447 def Insert(*args, **kwargs):
10448 """
5b5c9bc7
RD
10449 Insert(self, size_t pos, int id, String text, String help=EmptyString,
10450 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 10451 """
5b5c9bc7 10452 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
10453
10454 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
10455 """InsertSeparator(self, size_t pos) -> MenuItem"""
10456 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
10457
10458 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
10459 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10460 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
10461
10462 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
10463 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10464 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
10465
10466 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
10467 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10468 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc
RD
10469
10470 def PrependItem(*args, **kwargs):
5b5c9bc7
RD
10471 """PrependItem(self, MenuItem item) -> MenuItem"""
10472 return _core_.Menu_PrependItem(*args, **kwargs)
d55e5bfc
RD
10473
10474 def Prepend(*args, **kwargs):
5b5c9bc7
RD
10475 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10476 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
10477
10478 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
10479 """PrependSeparator(self) -> MenuItem"""
10480 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
10481
10482 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
10483 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10484 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
10485
10486 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
10487 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10488 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
10489
10490 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
10491 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10492 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
10493
10494 def Remove(*args, **kwargs):
5b5c9bc7
RD
10495 """Remove(self, int id) -> MenuItem"""
10496 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
10497
10498 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
10499 """RemoveItem(self, MenuItem item) -> MenuItem"""
10500 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
10501
10502 def Delete(*args, **kwargs):
10503 """Delete(self, int id) -> bool"""
5b5c9bc7 10504 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
10505
10506 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
10507 """DeleteItem(self, MenuItem item) -> bool"""
10508 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
10509
10510 def Destroy(*args, **kwargs):
10511 """
10512 Destroy(self)
10513
10514 Deletes the C++ object this Python object is a proxy for.
10515 """
5b5c9bc7 10516 return _core_.Menu_Destroy(*args, **kwargs)
d55e5bfc
RD
10517
10518 def DestroyId(*args, **kwargs):
10519 """
10520 DestroyId(self, int id) -> bool
10521
10522 Deletes the C++ object this Python object is a proxy for.
10523 """
5b5c9bc7 10524 return _core_.Menu_DestroyId(*args, **kwargs)
d55e5bfc
RD
10525
10526 def DestroyItem(*args, **kwargs):
10527 """
5b5c9bc7 10528 DestroyItem(self, MenuItem item) -> bool
d55e5bfc
RD
10529
10530 Deletes the C++ object this Python object is a proxy for.
10531 """
5b5c9bc7 10532 return _core_.Menu_DestroyItem(*args, **kwargs)
d55e5bfc
RD
10533
10534 def GetMenuItemCount(*args, **kwargs):
10535 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 10536 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
10537
10538 def GetMenuItems(*args, **kwargs):
10539 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 10540 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
10541
10542 def FindItem(*args, **kwargs):
5b5c9bc7
RD
10543 """FindItem(self, String item) -> int"""
10544 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
10545
10546 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10547 """FindItemById(self, int id) -> MenuItem"""
10548 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
10549
10550 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
10551 """FindItemByPosition(self, size_t position) -> MenuItem"""
10552 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
10553
10554 def Enable(*args, **kwargs):
10555 """Enable(self, int id, bool enable)"""
5b5c9bc7 10556 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
10557
10558 def IsEnabled(*args, **kwargs):
10559 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10560 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10561
10562 def Check(*args, **kwargs):
10563 """Check(self, int id, bool check)"""
5b5c9bc7 10564 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
10565
10566 def IsChecked(*args, **kwargs):
10567 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10568 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
10569
10570 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10571 """SetLabel(self, int id, String label)"""
10572 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
10573
10574 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10575 """GetLabel(self, int id) -> String"""
10576 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
10577
10578 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10579 """SetHelpString(self, int id, String helpString)"""
10580 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10581
10582 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10583 """GetHelpString(self, int id) -> String"""
10584 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10585
10586 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
10587 """SetTitle(self, String title)"""
10588 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
10589
10590 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
10591 """GetTitle(self) -> String"""
10592 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
10593
10594 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10595 """SetEventHandler(self, EvtHandler handler)"""
10596 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
10597
10598 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10599 """GetEventHandler(self) -> EvtHandler"""
10600 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
10601
10602 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10603 """SetInvokingWindow(self, Window win)"""
10604 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10605
10606 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10607 """GetInvokingWindow(self) -> Window"""
10608 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10609
10610 def GetStyle(*args, **kwargs):
10611 """GetStyle(self) -> long"""
5b5c9bc7 10612 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
10613
10614 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10615 """UpdateUI(self, EvtHandler source=None)"""
10616 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10617
10618 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10619 """GetMenuBar(self) -> MenuBar"""
10620 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10621
10622 def Attach(*args, **kwargs):
10623 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10624 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10625
10626 def Detach(*args, **kwargs):
10627 """Detach(self)"""
5b5c9bc7 10628 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10629
10630 def IsAttached(*args, **kwargs):
10631 """IsAttached(self) -> bool"""
5b5c9bc7 10632 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10633
10634 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10635 """SetParent(self, Menu parent)"""
10636 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10637
10638 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10639 """GetParent(self) -> Menu"""
10640 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc
RD
10641
10642
5b5c9bc7 10643class MenuPtr(Menu):
d55e5bfc
RD
10644 def __init__(self, this):
10645 self.this = this
10646 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10647 self.__class__ = Menu
10648_core_.Menu_swigregister(MenuPtr)
10649DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10650
10651#---------------------------------------------------------------------------
10652
5b5c9bc7
RD
10653class MenuBar(Window):
10654 """Proxy of C++ MenuBar class"""
d55e5bfc
RD
10655 def __repr__(self):
10656 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10657 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10658 """__init__(self, long style=0) -> MenuBar"""
10659 newobj = _core_.new_MenuBar(*args, **kwargs)
d55e5bfc
RD
10660 self.this = newobj.this
10661 self.thisown = 1
10662 del newobj.thisown
10663 self._setOORInfo(self)
10664
10665 def Append(*args, **kwargs):
5b5c9bc7
RD
10666 """Append(self, Menu menu, String title) -> bool"""
10667 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10668
10669 def Insert(*args, **kwargs):
5b5c9bc7
RD
10670 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10671 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10672
10673 def GetMenuCount(*args, **kwargs):
10674 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10675 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10676
10677 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10678 """GetMenu(self, size_t pos) -> Menu"""
10679 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10680
10681 def Replace(*args, **kwargs):
5b5c9bc7
RD
10682 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10683 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
10684
10685 def Remove(*args, **kwargs):
5b5c9bc7
RD
10686 """Remove(self, size_t pos) -> Menu"""
10687 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
10688
10689 def EnableTop(*args, **kwargs):
10690 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 10691 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
10692
10693 def IsEnabledTop(*args, **kwargs):
10694 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 10695 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
10696
10697 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10698 """SetLabelTop(self, size_t pos, String label)"""
10699 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
10700
10701 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10702 """GetLabelTop(self, size_t pos) -> String"""
10703 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
10704
10705 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
10706 """FindMenuItem(self, String menu, String item) -> int"""
10707 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
10708
10709 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10710 """FindItemById(self, int id) -> MenuItem"""
10711 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
10712
10713 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
10714 """FindMenu(self, String title) -> int"""
10715 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
10716
10717 def Enable(*args, **kwargs):
10718 """Enable(self, int id, bool enable)"""
5b5c9bc7 10719 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
10720
10721 def Check(*args, **kwargs):
10722 """Check(self, int id, bool check)"""
5b5c9bc7 10723 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
10724
10725 def IsChecked(*args, **kwargs):
10726 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10727 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
10728
10729 def IsEnabled(*args, **kwargs):
10730 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10731 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10732
10733 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10734 """SetLabel(self, int id, String label)"""
10735 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
10736
10737 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10738 """GetLabel(self, int id) -> String"""
10739 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
10740
10741 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10742 """SetHelpString(self, int id, String helpString)"""
10743 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10744
10745 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10746 """GetHelpString(self, int id) -> String"""
10747 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10748
10749 def GetFrame(*args, **kwargs):
10750 """GetFrame(self) -> wxFrame"""
5b5c9bc7 10751 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
10752
10753 def IsAttached(*args, **kwargs):
10754 """IsAttached(self) -> bool"""
5b5c9bc7 10755 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
10756
10757 def Attach(*args, **kwargs):
10758 """Attach(self, wxFrame frame)"""
5b5c9bc7 10759 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
10760
10761 def Detach(*args, **kwargs):
10762 """Detach(self)"""
5b5c9bc7 10763 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 10764
4f433fef
RD
10765 def SetAutoWindowMenu(*args, **kwargs):
10766 """SetAutoWindowMenu(bool enable)"""
10767 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10768
10769 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10770 def GetAutoWindowMenu(*args, **kwargs):
10771 """GetAutoWindowMenu() -> bool"""
10772 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10773
10774 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
d55e5bfc 10775
5b5c9bc7 10776class MenuBarPtr(MenuBar):
d55e5bfc
RD
10777 def __init__(self, this):
10778 self.this = this
10779 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10780 self.__class__ = MenuBar
10781_core_.MenuBar_swigregister(MenuBarPtr)
d55e5bfc 10782
4f433fef
RD
10783def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10784 """MenuBar_SetAutoWindowMenu(bool enable)"""
10785 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10786
10787def MenuBar_GetAutoWindowMenu(*args, **kwargs):
10788 """MenuBar_GetAutoWindowMenu() -> bool"""
10789 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10790
d55e5bfc
RD
10791#---------------------------------------------------------------------------
10792
5b5c9bc7
RD
10793class MenuItem(Object):
10794 """Proxy of C++ MenuItem class"""
d55e5bfc
RD
10795 def __repr__(self):
10796 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10797 def __init__(self, *args, **kwargs):
10798 """
5b5c9bc7
RD
10799 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10800 String help=EmptyString, int kind=ITEM_NORMAL,
10801 Menu subMenu=None) -> MenuItem
d55e5bfc 10802 """
5b5c9bc7 10803 newobj = _core_.new_MenuItem(*args, **kwargs)
d55e5bfc
RD
10804 self.this = newobj.this
10805 self.thisown = 1
10806 del newobj.thisown
10807 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10808 """GetMenu(self) -> Menu"""
10809 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
10810
10811 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
10812 """SetMenu(self, Menu menu)"""
10813 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
10814
10815 def SetId(*args, **kwargs):
10816 """SetId(self, int id)"""
5b5c9bc7 10817 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
10818
10819 def GetId(*args, **kwargs):
10820 """GetId(self) -> int"""
5b5c9bc7 10821 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
10822
10823 def IsSeparator(*args, **kwargs):
10824 """IsSeparator(self) -> bool"""
5b5c9bc7 10825 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
10826
10827 def SetText(*args, **kwargs):
5b5c9bc7
RD
10828 """SetText(self, String str)"""
10829 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
10830
10831 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10832 """GetLabel(self) -> String"""
10833 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
10834
10835 def GetText(*args, **kwargs):
5b5c9bc7
RD
10836 """GetText(self) -> String"""
10837 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
10838
10839 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
10840 """GetLabelFromText(String text) -> String"""
10841 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
10842
10843 GetLabelFromText = staticmethod(GetLabelFromText)
10844 def GetKind(*args, **kwargs):
10845 """GetKind(self) -> int"""
5b5c9bc7 10846 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
10847
10848 def SetKind(*args, **kwargs):
10849 """SetKind(self, int kind)"""
5b5c9bc7 10850 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
10851
10852 def SetCheckable(*args, **kwargs):
10853 """SetCheckable(self, bool checkable)"""
5b5c9bc7 10854 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
10855
10856 def IsCheckable(*args, **kwargs):
10857 """IsCheckable(self) -> bool"""
5b5c9bc7 10858 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
10859
10860 def IsSubMenu(*args, **kwargs):
10861 """IsSubMenu(self) -> bool"""
5b5c9bc7 10862 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
10863
10864 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10865 """SetSubMenu(self, Menu menu)"""
10866 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
10867
10868 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10869 """GetSubMenu(self) -> Menu"""
10870 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
10871
10872 def Enable(*args, **kwargs):
10873 """Enable(self, bool enable=True)"""
5b5c9bc7 10874 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
10875
10876 def IsEnabled(*args, **kwargs):
10877 """IsEnabled(self) -> bool"""
5b5c9bc7 10878 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10879
10880 def Check(*args, **kwargs):
10881 """Check(self, bool check=True)"""
5b5c9bc7 10882 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
10883
10884 def IsChecked(*args, **kwargs):
10885 """IsChecked(self) -> bool"""
5b5c9bc7 10886 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
10887
10888 def Toggle(*args, **kwargs):
10889 """Toggle(self)"""
5b5c9bc7 10890 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
10891
10892 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
10893 """SetHelp(self, String str)"""
10894 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
10895
10896 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
10897 """GetHelp(self) -> String"""
10898 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
10899
10900 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
10901 """GetAccel(self) -> AcceleratorEntry"""
10902 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
10903
10904 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
10905 """SetAccel(self, AcceleratorEntry accel)"""
10906 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 10907
32fe5131
RD
10908 def SetBitmap(*args, **kwargs):
10909 """SetBitmap(self, Bitmap bitmap)"""
10910 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10911
10912 def GetBitmap(*args, **kwargs):
10913 """GetBitmap(self) -> Bitmap"""
10914 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10915
c1280d1e 10916 def SetFont(*args, **kwargs):
5b5c9bc7
RD
10917 """SetFont(self, Font font)"""
10918 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
10919
10920 def GetFont(*args, **kwargs):
5b5c9bc7
RD
10921 """GetFont(self) -> Font"""
10922 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
10923
10924 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
10925 """SetTextColour(self, Colour colText)"""
10926 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
10927
10928 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
10929 """GetTextColour(self) -> Colour"""
10930 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
10931
10932 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10933 """SetBackgroundColour(self, Colour colBack)"""
10934 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10935
10936 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10937 """GetBackgroundColour(self) -> Colour"""
10938 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10939
10940 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
10941 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10942 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
10943
10944 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10945 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10946 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10947
10948 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10949 """GetDisabledBitmap(self) -> Bitmap"""
10950 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10951
10952 def SetMarginWidth(*args, **kwargs):
10953 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 10954 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
10955
10956 def GetMarginWidth(*args, **kwargs):
10957 """GetMarginWidth(self) -> int"""
5b5c9bc7 10958 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 10959
d55e5bfc 10960 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 10961 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 10962 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10963
10964 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10965 def IsOwnerDrawn(*args, **kwargs):
10966 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 10967 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10968
10969 def SetOwnerDrawn(*args, **kwargs):
10970 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 10971 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10972
10973 def ResetOwnerDrawn(*args, **kwargs):
10974 """ResetOwnerDrawn(self)"""
5b5c9bc7 10975 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 10976
d55e5bfc 10977
5b5c9bc7 10978class MenuItemPtr(MenuItem):
d55e5bfc
RD
10979 def __init__(self, this):
10980 self.this = this
10981 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10982 self.__class__ = MenuItem
10983_core_.MenuItem_swigregister(MenuItemPtr)
d55e5bfc 10984
5b5c9bc7
RD
10985def MenuItem_GetLabelFromText(*args, **kwargs):
10986 """MenuItem_GetLabelFromText(String text) -> String"""
10987 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10988
5b5c9bc7
RD
10989def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
10990 """MenuItem_GetDefaultMarginWidth() -> int"""
10991 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10992
10993#---------------------------------------------------------------------------
10994
5b5c9bc7 10995class Control(Window):
d55e5bfc
RD
10996 """
10997 This is the base class for a control or 'widget'.
10998
15817c7e
RD
10999 A control is generally a small window which processes user input
11000 and/or displays one or more item of data.
d55e5bfc
RD
11001 """
11002 def __repr__(self):
11003 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11004 def __init__(self, *args, **kwargs):
11005 """
5b5c9bc7
RD
11006 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11007 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11008 String name=ControlNameStr) -> Control
d55e5bfc 11009
15817c7e
RD
11010 Create a Control. Normally you should only call this from a subclass'
11011 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 11012 """
5b5c9bc7 11013 newobj = _core_.new_Control(*args, **kwargs)
d55e5bfc
RD
11014 self.this = newobj.this
11015 self.thisown = 1
11016 del newobj.thisown
11017 self._setOORInfo(self)
11018
11019 def Create(*args, **kwargs):
11020 """
5b5c9bc7
RD
11021 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11022 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11023 String name=ControlNameStr) -> bool
d55e5bfc
RD
11024
11025 Do the 2nd phase and create the GUI control.
11026 """
5b5c9bc7 11027 return _core_.Control_Create(*args, **kwargs)
d55e5bfc
RD
11028
11029 def Command(*args, **kwargs):
11030 """
5b5c9bc7 11031 Command(self, CommandEvent event)
d55e5bfc 11032
15817c7e
RD
11033 Simulates the effect of the user issuing a command to the item.
11034
11035 :see: `wx.CommandEvent`
11036
d55e5bfc 11037 """
5b5c9bc7 11038 return _core_.Control_Command(*args, **kwargs)
d55e5bfc
RD
11039
11040 def GetLabel(*args, **kwargs):
11041 """
5b5c9bc7 11042 GetLabel(self) -> String
d55e5bfc
RD
11043
11044 Return a control's text.
11045 """
5b5c9bc7 11046 return _core_.Control_GetLabel(*args, **kwargs)
d55e5bfc
RD
11047
11048 def SetLabel(*args, **kwargs):
11049 """
5b5c9bc7 11050 SetLabel(self, String label)
d55e5bfc
RD
11051
11052 Sets the item's text.
11053 """
5b5c9bc7 11054 return _core_.Control_SetLabel(*args, **kwargs)
d55e5bfc
RD
11055
11056 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 11057 """
5b5c9bc7 11058 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11059
11060 Get the default attributes for this class. This is useful if you want
11061 to use the same font or colour in your own control as in a standard
11062 control -- which is a much better idea than hard coding specific
11063 colours or fonts which might look completely out of place on the
11064 user's system, especially if it uses themes.
11065
11066 The variant parameter is only relevant under Mac currently and is
11067 ignore under other platforms. Under Mac, it will change the size of
11068 the returned font. See `wx.Window.SetWindowVariant` for more about
11069 this.
11070 """
5b5c9bc7 11071 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11072
11073 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
11074
5b5c9bc7 11075class ControlPtr(Control):
d55e5bfc
RD
11076 def __init__(self, this):
11077 self.this = this
11078 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11079 self.__class__ = Control
11080_core_.Control_swigregister(ControlPtr)
d55e5bfc
RD
11081ControlNameStr = cvar.ControlNameStr
11082
11083def PreControl(*args, **kwargs):
11084 """
5b5c9bc7 11085 PreControl() -> Control
d55e5bfc
RD
11086
11087 Precreate a Control control for 2-phase creation
11088 """
5b5c9bc7 11089 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
11090 val.thisown = 1
11091 return val
11092
5b5c9bc7 11093def Control_GetClassDefaultAttributes(*args, **kwargs):
110da5b0 11094 """
5b5c9bc7 11095 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11096
11097 Get the default attributes for this class. This is useful if you want
11098 to use the same font or colour in your own control as in a standard
11099 control -- which is a much better idea than hard coding specific
11100 colours or fonts which might look completely out of place on the
11101 user's system, especially if it uses themes.
11102
11103 The variant parameter is only relevant under Mac currently and is
11104 ignore under other platforms. Under Mac, it will change the size of
11105 the returned font. See `wx.Window.SetWindowVariant` for more about
11106 this.
11107 """
5b5c9bc7 11108 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11109
11110#---------------------------------------------------------------------------
11111
5b5c9bc7 11112class ItemContainer(object):
d55e5bfc 11113 """
53aa7709
RD
11114 The wx.ItemContainer class defines an interface which is implemented
11115 by all controls which have string subitems, each of which may be
11116 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11117 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 11118 this one.
d55e5bfc 11119
15817c7e
RD
11120 It defines the methods for accessing the control's items and although
11121 each of the derived classes implements them differently, they still
11122 all conform to the same interface.
d55e5bfc 11123
15817c7e
RD
11124 The items in a wx.ItemContainer have (non empty) string labels and,
11125 optionally, client data associated with them.
d55e5bfc
RD
11126
11127 """
11128 def __init__(self): raise RuntimeError, "No constructor defined"
11129 def __repr__(self):
11130 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11131 def Append(*args, **kwargs):
11132 """
5b5c9bc7 11133 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 11134
15817c7e
RD
11135 Adds the item to the control, associating the given data with the item
11136 if not None. The return value is the index of the newly added item
11137 which may be different from the last one if the control is sorted (e.g.
11138 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 11139 """
5b5c9bc7 11140 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
11141
11142 def AppendItems(*args, **kwargs):
11143 """
f5b96ee1 11144 AppendItems(self, List strings)
d55e5bfc 11145
15817c7e
RD
11146 Apend several items at once to the control. Notice that calling this
11147 method may be much faster than appending the items one by one if you
11148 need to add a lot of items.
d55e5bfc 11149 """
5b5c9bc7 11150 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
11151
11152 def Insert(*args, **kwargs):
11153 """
5b5c9bc7 11154 Insert(self, String item, int pos, PyObject clientData=None) -> int
d55e5bfc 11155
15817c7e 11156 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
11157 optionally associating some data object with the item.
11158 """
5b5c9bc7 11159 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
11160
11161 def Clear(*args, **kwargs):
11162 """
11163 Clear(self)
11164
11165 Removes all items from the control.
11166 """
5b5c9bc7 11167 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
11168
11169 def Delete(*args, **kwargs):
11170 """
11171 Delete(self, int n)
11172
15817c7e
RD
11173 Deletes the item at the zero-based index 'n' from the control. Note
11174 that it is an error (signalled by a `wx.PyAssertionError` exception if
11175 enabled) to remove an item with the index negative or greater or equal
11176 than the number of items in the control.
d55e5bfc 11177 """
5b5c9bc7 11178 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 11179
53aa7709
RD
11180 def GetClientData(*args, **kwargs):
11181 """
11182 GetClientData(self, int n) -> PyObject
11183
11184 Returns the client data associated with the given item, (if any.)
11185 """
5b5c9bc7 11186 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
11187
11188 def SetClientData(*args, **kwargs):
11189 """
11190 SetClientData(self, int n, PyObject clientData)
11191
11192 Associate the given client data with the item at position n.
11193 """
5b5c9bc7 11194 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 11195
d55e5bfc
RD
11196 def GetCount(*args, **kwargs):
11197 """
11198 GetCount(self) -> int
11199
11200 Returns the number of items in the control.
11201 """
5b5c9bc7 11202 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
11203
11204 def IsEmpty(*args, **kwargs):
11205 """
11206 IsEmpty(self) -> bool
11207
11208 Returns True if the control is empty or False if it has some items.
11209 """
5b5c9bc7 11210 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
11211
11212 def GetString(*args, **kwargs):
11213 """
5b5c9bc7 11214 GetString(self, int n) -> String
d55e5bfc
RD
11215
11216 Returns the label of the item with the given index.
11217 """
5b5c9bc7 11218 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
11219
11220 def GetStrings(*args, **kwargs):
11221 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 11222 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
11223
11224 def SetString(*args, **kwargs):
11225 """
5b5c9bc7 11226 SetString(self, int n, String s)
d55e5bfc
RD
11227
11228 Sets the label for the given item.
11229 """
5b5c9bc7 11230 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
11231
11232 def FindString(*args, **kwargs):
11233 """
5b5c9bc7 11234 FindString(self, String s) -> int
d55e5bfc
RD
11235
11236 Finds an item whose label matches the given string. Returns the
15817c7e
RD
11237 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11238 found.
d55e5bfc 11239 """
5b5c9bc7 11240 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 11241
53aa7709 11242 def SetSelection(*args, **kwargs):
d55e5bfc 11243 """
53aa7709 11244 SetSelection(self, int n)
d55e5bfc
RD
11245
11246 Sets the item at index 'n' to be the selected item.
11247 """
5b5c9bc7 11248 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 11249
d55e5bfc
RD
11250 def GetSelection(*args, **kwargs):
11251 """
11252 GetSelection(self) -> int
11253
15817c7e
RD
11254 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11255 is selected.
d55e5bfc 11256 """
5b5c9bc7 11257 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 11258
53aa7709 11259 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
11260 """SetStringSelection(self, String s) -> bool"""
11261 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 11262
d55e5bfc
RD
11263 def GetStringSelection(*args, **kwargs):
11264 """
5b5c9bc7 11265 GetStringSelection(self) -> String
d55e5bfc 11266
15817c7e
RD
11267 Returns the label of the selected item or an empty string if no item
11268 is selected.
d55e5bfc 11269 """
5b5c9bc7 11270 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 11271
53aa7709 11272 def Select(*args, **kwargs):
d55e5bfc 11273 """
53aa7709 11274 Select(self, int n)
d55e5bfc 11275
53aa7709
RD
11276 This is the same as `SetSelection` and exists only because it is
11277 slightly more natural for controls which support multiple selection.
d55e5bfc 11278 """
5b5c9bc7 11279 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc
RD
11280
11281
5b5c9bc7 11282class ItemContainerPtr(ItemContainer):
d55e5bfc
RD
11283 def __init__(self, this):
11284 self.this = this
11285 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11286 self.__class__ = ItemContainer
11287_core_.ItemContainer_swigregister(ItemContainerPtr)
d55e5bfc
RD
11288
11289#---------------------------------------------------------------------------
11290
5b5c9bc7 11291class ControlWithItems(Control,ItemContainer):
d55e5bfc 11292 """
15817c7e
RD
11293 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11294 wx.Control class, and is used for the base class of various controls
11295 that have items.
d55e5bfc
RD
11296 """
11297 def __init__(self): raise RuntimeError, "No constructor defined"
11298 def __repr__(self):
11299 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11300
5b5c9bc7 11301class ControlWithItemsPtr(ControlWithItems):
d55e5bfc
RD
11302 def __init__(self, this):
11303 self.this = this
11304 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11305 self.__class__ = ControlWithItems
11306_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
d55e5bfc
RD
11307
11308#---------------------------------------------------------------------------
11309
5b5c9bc7 11310class SizerItem(Object):
bfddbb17
RD
11311 """
11312 The wx.SizerItem class is used to track the position, size and other
11313 attributes of each item managed by a `wx.Sizer`. In normal usage user
11314 code should never need to deal directly with a wx.SizerItem, but
11315 custom classes derived from `wx.PySizer` will probably need to use the
11316 collection of wx.SizerItems held by wx.Sizer when calculating layout.
11317
11318 :see: `wx.Sizer`, `wx.GBSizerItem`
11319 """
d55e5bfc
RD
11320 def __repr__(self):
11321 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11322 def __init__(self, *args, **kwargs):
bfddbb17 11323 """
5b5c9bc7 11324 __init__(self) -> SizerItem
bfddbb17
RD
11325
11326 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11327 size will need to be set before this item can be used in a Sizer.
11328
11329 You will probably never need to create a wx.SizerItem directly as they
11330 are created automatically when the sizer's Add, Insert or Prepend
11331 methods are called.
11332
11333 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11334 """
5b5c9bc7 11335 newobj = _core_.new_SizerItem(*args, **kwargs)
d55e5bfc
RD
11336 self.this = newobj.this
11337 self.thisown = 1
11338 del newobj.thisown
11339 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11340 """
11341 DeleteWindows(self)
11342
11343 Destroy the window or the windows in a subsizer, depending on the type
11344 of item.
11345 """
5b5c9bc7 11346 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11347
11348 def DetachSizer(*args, **kwargs):
bfddbb17
RD
11349 """
11350 DetachSizer(self)
11351
11352 Enable deleting the SizerItem without destroying the contained sizer.
11353 """
5b5c9bc7 11354 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
11355
11356 def GetSize(*args, **kwargs):
bfddbb17 11357 """
5b5c9bc7 11358 GetSize(self) -> Size
bfddbb17
RD
11359
11360 Get the current size of the item, as set in the last Layout.
11361 """
5b5c9bc7 11362 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
11363
11364 def CalcMin(*args, **kwargs):
bfddbb17 11365 """
5b5c9bc7 11366 CalcMin(self) -> Size
bfddbb17
RD
11367
11368 Calculates the minimum desired size for the item, including any space
11369 needed by borders.
11370 """
5b5c9bc7 11371 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
11372
11373 def SetDimension(*args, **kwargs):
bfddbb17 11374 """
5b5c9bc7 11375 SetDimension(self, Point pos, Size size)
bfddbb17
RD
11376
11377 Set the position and size of the space allocated for this item by the
11378 sizer, and adjust the position and size of the item (window or
11379 subsizer) to be within that space taking alignment and borders into
11380 account.
11381 """
5b5c9bc7 11382 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
11383
11384 def GetMinSize(*args, **kwargs):
bfddbb17 11385 """
5b5c9bc7 11386 GetMinSize(self) -> Size
bfddbb17
RD
11387
11388 Get the minimum size needed for the item.
11389 """
5b5c9bc7 11390 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 11391
a001823c
RD
11392 def GetMinSizeWithBorder(*args, **kwargs):
11393 """
5b5c9bc7 11394 GetMinSizeWithBorder(self) -> Size
a001823c
RD
11395
11396 Get the minimum size needed for the item with space for the borders
11397 added, if needed.
11398 """
5b5c9bc7 11399 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 11400
d55e5bfc
RD
11401 def SetInitSize(*args, **kwargs):
11402 """SetInitSize(self, int x, int y)"""
5b5c9bc7 11403 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
11404
11405 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
11406 """
11407 SetRatioWH(self, int width, int height)
11408
11409 Set the ratio item attribute.
11410 """
5b5c9bc7 11411 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
11412
11413 def SetRatioSize(*args, **kwargs):
bfddbb17 11414 """
5b5c9bc7 11415 SetRatioSize(self, Size size)
bfddbb17
RD
11416
11417 Set the ratio item attribute.
11418 """
5b5c9bc7 11419 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
11420
11421 def SetRatio(*args, **kwargs):
bfddbb17
RD
11422 """
11423 SetRatio(self, float ratio)
11424
11425 Set the ratio item attribute.
11426 """
5b5c9bc7 11427 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
11428
11429 def GetRatio(*args, **kwargs):
bfddbb17
RD
11430 """
11431 GetRatio(self) -> float
11432
11433 Set the ratio item attribute.
11434 """
5b5c9bc7 11435 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 11436
070c48b4
RD
11437 def GetRect(*args, **kwargs):
11438 """
5b5c9bc7 11439 GetRect(self) -> Rect
070c48b4
RD
11440
11441 Returns the rectangle that the sizer item should occupy
11442 """
5b5c9bc7 11443 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 11444
d55e5bfc 11445 def IsWindow(*args, **kwargs):
bfddbb17
RD
11446 """
11447 IsWindow(self) -> bool
11448
11449 Is this sizer item a window?
11450 """
5b5c9bc7 11451 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
11452
11453 def IsSizer(*args, **kwargs):
bfddbb17
RD
11454 """
11455 IsSizer(self) -> bool
11456
11457 Is this sizer item a subsizer?
11458 """
5b5c9bc7 11459 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
11460
11461 def IsSpacer(*args, **kwargs):
bfddbb17
RD
11462 """
11463 IsSpacer(self) -> bool
11464
11465 Is this sizer item a spacer?
11466 """
5b5c9bc7 11467 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
11468
11469 def SetProportion(*args, **kwargs):
bfddbb17
RD
11470 """
11471 SetProportion(self, int proportion)
11472
11473 Set the proportion value for this item.
11474 """
5b5c9bc7 11475 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
11476
11477 def GetProportion(*args, **kwargs):
bfddbb17
RD
11478 """
11479 GetProportion(self) -> int
11480
11481 Get the proportion value for this item.
11482 """
5b5c9bc7 11483 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 11484
bfddbb17
RD
11485 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11486 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 11487 def SetFlag(*args, **kwargs):
bfddbb17
RD
11488 """
11489 SetFlag(self, int flag)
11490
11491 Set the flag value for this item.
11492 """
5b5c9bc7 11493 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
11494
11495 def GetFlag(*args, **kwargs):
bfddbb17
RD
11496 """
11497 GetFlag(self) -> int
11498
11499 Get the flag value for this item.
11500 """
5b5c9bc7 11501 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
11502
11503 def SetBorder(*args, **kwargs):
bfddbb17
RD
11504 """
11505 SetBorder(self, int border)
11506
11507 Set the border value for this item.
11508 """
5b5c9bc7 11509 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
11510
11511 def GetBorder(*args, **kwargs):
bfddbb17
RD
11512 """
11513 GetBorder(self) -> int
11514
11515 Get the border value for this item.
11516 """
5b5c9bc7 11517 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
11518
11519 def GetWindow(*args, **kwargs):
bfddbb17 11520 """
5b5c9bc7 11521 GetWindow(self) -> Window
bfddbb17
RD
11522
11523 Get the window (if any) that is managed by this sizer item.
11524 """
5b5c9bc7 11525 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
11526
11527 def SetWindow(*args, **kwargs):
bfddbb17 11528 """
5b5c9bc7 11529 SetWindow(self, Window window)
bfddbb17
RD
11530
11531 Set the window to be managed by this sizer item.
11532 """
5b5c9bc7 11533 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
11534
11535 def GetSizer(*args, **kwargs):
bfddbb17 11536 """
5b5c9bc7 11537 GetSizer(self) -> Sizer
bfddbb17
RD
11538
11539 Get the subsizer (if any) that is managed by this sizer item.
11540 """
5b5c9bc7 11541 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
11542
11543 def SetSizer(*args, **kwargs):
bfddbb17 11544 """
5b5c9bc7 11545 SetSizer(self, Sizer sizer)
bfddbb17
RD
11546
11547 Set the subsizer to be managed by this sizer item.
11548 """
5b5c9bc7 11549 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
11550
11551 def GetSpacer(*args, **kwargs):
bfddbb17 11552 """
5b5c9bc7 11553 GetSpacer(self) -> Size
bfddbb17
RD
11554
11555 Get the size of the spacer managed by this sizer item.
11556 """
5b5c9bc7 11557 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
11558
11559 def SetSpacer(*args, **kwargs):
bfddbb17 11560 """
5b5c9bc7 11561 SetSpacer(self, Size size)
bfddbb17
RD
11562
11563 Set the size of the spacer to be managed by this sizer item.
11564 """
5b5c9bc7 11565 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
11566
11567 def Show(*args, **kwargs):
bfddbb17
RD
11568 """
11569 Show(self, bool show)
11570
11571 Set the show item attribute, which sizers use to determine if the item
11572 is to be made part of the layout or not. If the item is tracking a
11573 window then it is shown or hidden as needed.
11574 """
5b5c9bc7 11575 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
11576
11577 def IsShown(*args, **kwargs):
bfddbb17
RD
11578 """
11579 IsShown(self) -> bool
11580
11581 Is the item to be shown in the layout?
11582 """
5b5c9bc7 11583 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
11584
11585 def GetPosition(*args, **kwargs):
bfddbb17 11586 """
5b5c9bc7 11587 GetPosition(self) -> Point
bfddbb17
RD
11588
11589 Returns the current position of the item, as set in the last Layout.
11590 """
5b5c9bc7 11591 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
11592
11593 def GetUserData(*args, **kwargs):
bfddbb17
RD
11594 """
11595 GetUserData(self) -> PyObject
11596
11597 Returns the userData associated with this sizer item, or None if there
11598 isn't any.
11599 """
5b5c9bc7 11600 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 11601
32fe5131
RD
11602 def SetUserData(*args, **kwargs):
11603 """
11604 SetUserData(self, PyObject userData)
11605
11606 Associate a Python object with this sizer item.
11607 """
11608 return _core_.SizerItem_SetUserData(*args, **kwargs)
11609
d55e5bfc 11610
5b5c9bc7 11611class SizerItemPtr(SizerItem):
d55e5bfc
RD
11612 def __init__(self, this):
11613 self.this = this
11614 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11615 self.__class__ = SizerItem
11616_core_.SizerItem_swigregister(SizerItemPtr)
d55e5bfc 11617
bfddbb17 11618def SizerItemWindow(*args, **kwargs):
d55e5bfc 11619 """
5b5c9bc7
RD
11620 SizerItemWindow(Window window, int proportion, int flag, int border,
11621 PyObject userData=None) -> SizerItem
bfddbb17
RD
11622
11623 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 11624 """
5b5c9bc7 11625 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
11626 val.thisown = 1
11627 return val
11628
bfddbb17 11629def SizerItemSpacer(*args, **kwargs):
d55e5bfc 11630 """
bfddbb17 11631 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 11632 PyObject userData=None) -> SizerItem
bfddbb17
RD
11633
11634 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 11635 """
5b5c9bc7 11636 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
11637 val.thisown = 1
11638 return val
11639
11640def SizerItemSizer(*args, **kwargs):
11641 """
5b5c9bc7
RD
11642 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11643 PyObject userData=None) -> SizerItem
bfddbb17
RD
11644
11645 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 11646 """
5b5c9bc7 11647 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
11648 val.thisown = 1
11649 return val
11650
5b5c9bc7 11651class Sizer(Object):
bfddbb17
RD
11652 """
11653 wx.Sizer is the abstract base class used for laying out subwindows in
11654 a window. You cannot use wx.Sizer directly; instead, you will have to
11655 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11656 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11657 and `wx.GridBagSizer`.
11658
11659 The concept implemented by sizers in wxWidgets is closely related to
11660 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11661 toolkit or the Qt toolkit. It is based upon the idea of the individual
11662 subwindows reporting their minimal required size and their ability to
11663 get stretched if the size of the parent window has changed. This will
11664 most often mean that the programmer does not set the original size of
11665 a dialog in the beginning, rather the dialog will assigned a sizer and
11666 this sizer will be queried about the recommended size. The sizer in
11667 turn will query its children, which can be normal windows or contorls,
11668 empty space or other sizers, so that a hierarchy of sizers can be
11669 constructed. Note that wxSizer does not derive from wxWindow and thus
11670 do not interfere with tab ordering and requires very little resources
11671 compared to a real window on screen.
11672
11673 What makes sizers so well fitted for use in wxWidgets is the fact that
11674 every control reports its own minimal size and the algorithm can
11675 handle differences in font sizes or different window (dialog item)
11676 sizes on different platforms without problems. If for example the
11677 standard font as well as the overall design of Mac widgets requires
11678 more space than on Windows, then the initial size of a dialog using a
11679 sizer will automatically be bigger on Mac than on Windows.
11680 """
d55e5bfc
RD
11681 def __init__(self): raise RuntimeError, "No constructor defined"
11682 def __repr__(self):
11683 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11684 def _setOORInfo(*args, **kwargs):
11685 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 11686 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
11687
11688 def Add(*args, **kwargs):
11689 """
bfddbb17 11690 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11691 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11692
11693 Appends a child item to the sizer.
d55e5bfc 11694 """
5b5c9bc7 11695 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
11696
11697 def Insert(*args, **kwargs):
11698 """
bfddbb17 11699 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 11700 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11701
11702 Inserts a new item into the list of items managed by this sizer before
11703 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 11704 """
5b5c9bc7 11705 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
11706
11707 def Prepend(*args, **kwargs):
11708 """
bfddbb17 11709 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11710 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11711
11712 Adds a new item to the begining of the list of sizer items managed by
11713 this sizer. See `Add` for a description of the parameters.
d55e5bfc 11714 """
5b5c9bc7 11715 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
11716
11717 def Remove(*args, **kwargs):
bfddbb17
RD
11718 """
11719 Remove(self, item) -> bool
11720
11721 Removes an item from the sizer and destroys it. This method does not
11722 cause any layout or resizing to take place, call `Layout` to update
11723 the layout on screen after removing a child from the sizer. The
11724 *item* parameter can be either a window, a sizer, or the zero-based
11725 index of an item to remove. Returns True if the child item was found
11726 and removed.
11727 """
5b5c9bc7 11728 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 11729
1a6bba1e 11730 def Detach(*args, **kwargs):
bfddbb17
RD
11731 """
11732 Detach(self, item) -> bool
11733
11734 Detaches an item from the sizer without destroying it. This method
11735 does not cause any layout or resizing to take place, call `Layout` to
11736 do so. The *item* parameter can be either a window, a sizer, or the
11737 zero-based index of the item to be detached. Returns True if the child item
11738 was found and detached.
11739 """
5b5c9bc7 11740 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 11741
070c48b4
RD
11742 def GetItem(*args, **kwargs):
11743 """
11744 GetItem(self, item) -> wx.SizerItem
11745
11746 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11747 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11748 the item to be found.
070c48b4 11749 """
5b5c9bc7 11750 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 11751
d55e5bfc 11752 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
11753 """_SetItemMinSize(self, PyObject item, Size size)"""
11754 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 11755
bfddbb17
RD
11756 def SetItemMinSize(self, item, *args):
11757 """
11758 SetItemMinSize(self, item, Size size)
11759
11760 Sets the minimum size that will be allocated for an item in the sizer.
11761 The *item* parameter can be either a window, a sizer, or the
11762 zero-based index of the item. If a window or sizer is given then it
11763 will be searched for recursivly in subsizers if neccessary.
11764 """
11765 if len(args) == 2:
11766 # for backward compatibility accept separate width,height args too
11767 return self._SetItemMinSize(item, args)
11768 else:
11769 return self._SetItemMinSize(item, args[0])
11770
d55e5bfc 11771 def AddItem(*args, **kwargs):
bfddbb17
RD
11772 """
11773 AddItem(self, SizerItem item)
11774
11775 Adds a `wx.SizerItem` to the sizer.
11776 """
5b5c9bc7 11777 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
11778
11779 def InsertItem(*args, **kwargs):
bfddbb17
RD
11780 """
11781 InsertItem(self, int index, SizerItem item)
11782
11783 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11784 """
5b5c9bc7 11785 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
11786
11787 def PrependItem(*args, **kwargs):
bfddbb17
RD
11788 """
11789 PrependItem(self, SizerItem item)
11790
11791 Prepends a `wx.SizerItem` to the sizer.
11792 """
5b5c9bc7 11793 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 11794
bfddbb17 11795 def AddMany(self, items):
d6c14a4c
RD
11796 """
11797 AddMany is a convenience method for adding several items
11798 to a sizer at one time. Simply pass it a list of tuples,
11799 where each tuple consists of the parameters that you
11800 would normally pass to the `Add` method.
11801 """
bfddbb17
RD
11802 for item in items:
11803 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11804 item = (item, )
11805 self.Add(*item)
d55e5bfc
RD
11806
11807 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
11808 def AddWindow(self, *args, **kw):
11809 """Compatibility alias for `Add`."""
11810 return self.Add(*args, **kw)
11811 def AddSizer(self, *args, **kw):
11812 """Compatibility alias for `Add`."""
11813 return self.Add(*args, **kw)
11814 def AddSpacer(self, *args, **kw):
11815 """Compatibility alias for `Add`."""
11816 return self.Add(*args, **kw)
11817
11818 def PrependWindow(self, *args, **kw):
11819 """Compatibility alias for `Prepend`."""
11820 return self.Prepend(*args, **kw)
11821 def PrependSizer(self, *args, **kw):
11822 """Compatibility alias for `Prepend`."""
11823 return self.Prepend(*args, **kw)
11824 def PrependSpacer(self, *args, **kw):
11825 """Compatibility alias for `Prepend`."""
11826 return self.Prepend(*args, **kw)
11827
11828 def InsertWindow(self, *args, **kw):
11829 """Compatibility alias for `Insert`."""
11830 return self.Insert(*args, **kw)
11831 def InsertSizer(self, *args, **kw):
11832 """Compatibility alias for `Insert`."""
11833 return self.Insert(*args, **kw)
11834 def InsertSpacer(self, *args, **kw):
11835 """Compatibility alias for `Insert`."""
11836 return self.Insert(*args, **kw)
11837
11838 def RemoveWindow(self, *args, **kw):
11839 """Compatibility alias for `Remove`."""
11840 return self.Remove(*args, **kw)
11841 def RemoveSizer(self, *args, **kw):
11842 """Compatibility alias for `Remove`."""
11843 return self.Remove(*args, **kw)
11844 def RemovePos(self, *args, **kw):
11845 """Compatibility alias for `Remove`."""
11846 return self.Remove(*args, **kw)
d55e5bfc
RD
11847
11848
d55e5bfc 11849 def SetDimension(*args, **kwargs):
bfddbb17
RD
11850 """
11851 SetDimension(self, int x, int y, int width, int height)
11852
11853 Call this to force the sizer to take the given dimension and thus
11854 force the items owned by the sizer to resize themselves according to
11855 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11856 methods.
11857 """
5b5c9bc7 11858 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
11859
11860 def SetMinSize(*args, **kwargs):
bfddbb17 11861 """
5b5c9bc7 11862 SetMinSize(self, Size size)
bfddbb17
RD
11863
11864 Call this to give the sizer a minimal size. Normally, the sizer will
11865 calculate its minimal size based purely on how much space its children
11866 need. After calling this method `GetMinSize` will return either the
11867 minimal size as requested by its children or the minimal size set
11868 here, depending on which is bigger.
11869 """
5b5c9bc7 11870 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
11871
11872 def GetSize(*args, **kwargs):
bfddbb17 11873 """
5b5c9bc7 11874 GetSize(self) -> Size
bfddbb17
RD
11875
11876 Returns the current size of the space managed by the sizer.
11877 """
5b5c9bc7 11878 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
11879
11880 def GetPosition(*args, **kwargs):
bfddbb17 11881 """
5b5c9bc7 11882 GetPosition(self) -> Point
bfddbb17
RD
11883
11884 Returns the current position of the sizer's managed space.
11885 """
5b5c9bc7 11886 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
11887
11888 def GetMinSize(*args, **kwargs):
bfddbb17 11889 """
5b5c9bc7 11890 GetMinSize(self) -> Size
bfddbb17
RD
11891
11892 Returns the minimal size of the sizer. This is either the combined
11893 minimal size of all the children and their borders or the minimal size
11894 set by SetMinSize, depending on which is bigger.
11895 """
5b5c9bc7 11896 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
11897
11898 def GetSizeTuple(self):
1a6bba1e 11899 return self.GetSize().Get()
d55e5bfc 11900 def GetPositionTuple(self):
1a6bba1e 11901 return self.GetPosition().Get()
d55e5bfc 11902 def GetMinSizeTuple(self):
1a6bba1e 11903 return self.GetMinSize().Get()
d55e5bfc
RD
11904
11905 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
11906 """
11907 RecalcSizes(self)
11908
11909 Using the sizes calculated by `CalcMin` reposition and resize all the
11910 items managed by this sizer. You should not need to call this directly as
11911 it is called by `Layout`.
11912 """
5b5c9bc7 11913 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
11914
11915 def CalcMin(*args, **kwargs):
bfddbb17 11916 """
5b5c9bc7 11917 CalcMin(self) -> Size
bfddbb17
RD
11918
11919 This method is where the sizer will do the actual calculation of its
11920 children's minimal sizes. You should not need to call this directly as
11921 it is called by `Layout`.
11922 """
5b5c9bc7 11923 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
11924
11925 def Layout(*args, **kwargs):
bfddbb17
RD
11926 """
11927 Layout(self)
11928
11929 This method will force the recalculation and layout of the items
11930 controlled by the sizer using the current space allocated to the
11931 sizer. Normally this is called automatically from the owning window's
11932 EVT_SIZE handler, but it is also useful to call it from user code when
11933 one of the items in a sizer change size, or items are added or
11934 removed.
11935 """
5b5c9bc7 11936 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
11937
11938 def Fit(*args, **kwargs):
bfddbb17 11939 """
5b5c9bc7 11940 Fit(self, Window window) -> Size
bfddbb17
RD
11941
11942 Tell the sizer to resize the *window* to match the sizer's minimal
11943 size. This is commonly done in the constructor of the window itself in
11944 order to set its initial size to match the needs of the children as
11945 determined by the sizer. Returns the new size.
11946
11947 For a top level window this is the total window size, not the client size.
11948 """
5b5c9bc7 11949 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
11950
11951 def FitInside(*args, **kwargs):
bfddbb17 11952 """
5b5c9bc7 11953 FitInside(self, Window window)
bfddbb17
RD
11954
11955 Tell the sizer to resize the *virtual size* of the *window* to match the
11956 sizer's minimal size. This will not alter the on screen size of the
11957 window, but may cause the addition/removal/alteration of scrollbars
11958 required to view the virtual area in windows which manage it.
11959
11960 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11961
11962 """
5b5c9bc7 11963 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
11964
11965 def SetSizeHints(*args, **kwargs):
bfddbb17 11966 """
5b5c9bc7 11967 SetSizeHints(self, Window window)
bfddbb17
RD
11968
11969 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11970 match the sizer's minimal size. This is commonly done in the
11971 constructor of the window itself if the window is resizable (as are
11972 many dialogs under Unix and frames on probably all platforms) in order
11973 to prevent the window from being sized smaller than the minimal size
11974 required by the sizer.
11975 """
5b5c9bc7 11976 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
11977
11978 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 11979 """
5b5c9bc7 11980 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
11981
11982 Tell the sizer to set the minimal size of the window virtual area to
11983 match the sizer's minimal size. For windows with managed scrollbars
11984 this will set them appropriately.
11985
11986 :see: `wx.ScrolledWindow.SetScrollbars`
11987
11988 """
5b5c9bc7 11989 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
11990
11991 def Clear(*args, **kwargs):
bfddbb17
RD
11992 """
11993 Clear(self, bool deleteWindows=False)
11994
11995 Clear all items from the sizer, optionally destroying the window items
11996 as well.
11997 """
5b5c9bc7 11998 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
11999
12000 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
12001 """
12002 DeleteWindows(self)
12003
12004 Destroy all windows managed by the sizer.
12005 """
5b5c9bc7 12006 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
12007
12008 def GetChildren(*args, **kwargs):
bfddbb17 12009 """
51b83b37 12010 GetChildren(self) -> list
bfddbb17
RD
12011
12012 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12013 """
5b5c9bc7 12014 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
12015
12016 def Show(*args, **kwargs):
bfddbb17 12017 """
b411df4a 12018 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 12019
bfddbb17
RD
12020 Shows or hides an item managed by the sizer. To make a sizer item
12021 disappear or reappear, use Show followed by `Layout`. The *item*
12022 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
12023 the item. Use the recursive parameter to show or hide an item in a
12024 subsizer. Returns True if the item was found.
bfddbb17 12025 """
5b5c9bc7 12026 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
12027
12028 def IsShown(*args, **kwargs):
bfddbb17
RD
12029 """
12030 IsShown(self, item)
12031
12032 Determines if the item is currently shown. sizer. To make a sizer
12033 item disappear or reappear, use Show followed by `Layout`. The *item*
12034 parameter can be either a window, a sizer, or the zero-based index of
12035 the item.
12036 """
5b5c9bc7 12037 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 12038
629e65c2 12039 def Hide(self, item, recursive=False):
bfddbb17 12040 """
27fb7603 12041 A convenience method for `Show` (item, False, recursive).
bfddbb17 12042 """
06759a38 12043 return self.Show(item, False, recursive)
bfddbb17 12044
d55e5bfc 12045 def ShowItems(*args, **kwargs):
bfddbb17
RD
12046 """
12047 ShowItems(self, bool show)
12048
84f85550 12049 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 12050 """
5b5c9bc7 12051 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc
RD
12052
12053
5b5c9bc7 12054class SizerPtr(Sizer):
d55e5bfc
RD
12055 def __init__(self, this):
12056 self.this = this
12057 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12058 self.__class__ = Sizer
12059_core_.Sizer_swigregister(SizerPtr)
d55e5bfc 12060
5b5c9bc7 12061class PySizer(Sizer):
bfddbb17
RD
12062 """
12063 wx.PySizer is a special version of `wx.Sizer` that has been
12064 instrumented to allow the C++ virtual methods to be overloaded in
12065 Python derived classes. You would derive from this class if you are
12066 wanting to implement a custom sizer in Python code. Simply implement
12067 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12068 For example::
12069
12070 class MySizer(wx.PySizer):
12071 def __init__(self):
12072 wx.PySizer.__init__(self)
12073
12074 def CalcMin(self):
12075 for item in self.GetChildren():
12076 # calculate the total minimum width and height needed
12077 # by all items in the sizer according to this sizer's
12078 # layout algorithm.
12079 ...
12080 return wx.Size(width, height)
12081
12082 def RecalcSizes(self):
12083 # find the space allotted to this sizer
12084 pos = self.GetPosition()
12085 size = self.GetSize()
12086 for item in self.GetChildren():
12087 # Recalculate (if necessary) the position and size of
12088 # each item and then call item.SetDimension to do the
12089 # actual positioning and sizing of the items within the
12090 # space alloted to this sizer.
12091 ...
12092 item.SetDimension(itemPos, itemSize)
12093
12094
12095 When `Layout` is called it first calls `CalcMin` followed by
12096 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 12097 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
12098
12099 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12100
12101
12102 """
d55e5bfc
RD
12103 def __repr__(self):
12104 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12105 def __init__(self, *args, **kwargs):
bfddbb17 12106 """
5b5c9bc7 12107 __init__(self) -> PySizer
bfddbb17
RD
12108
12109 Creates a wx.PySizer. Must be called from the __init__ in the derived
12110 class.
12111 """
5b5c9bc7 12112 newobj = _core_.new_PySizer(*args, **kwargs)
d55e5bfc
RD
12113 self.this = newobj.this
12114 self.thisown = 1
12115 del newobj.thisown
12116 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
12117
12118 def _setCallbackInfo(*args, **kwargs):
12119 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 12120 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
12121
12122
5b5c9bc7 12123class PySizerPtr(PySizer):
d55e5bfc
RD
12124 def __init__(self, this):
12125 self.this = this
12126 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12127 self.__class__ = PySizer
12128_core_.PySizer_swigregister(PySizerPtr)
d55e5bfc
RD
12129
12130#---------------------------------------------------------------------------
12131
5b5c9bc7 12132class BoxSizer(Sizer):
bfddbb17
RD
12133 """
12134 The basic idea behind a box sizer is that windows will most often be
12135 laid out in rather simple basic geometry, typically in a row or a
12136 column or nested hierarchies of either. A wx.BoxSizer will lay out
12137 its items in a simple row or column, depending on the orientation
12138 parameter passed to the constructor.
12139 """
d55e5bfc
RD
12140 def __repr__(self):
12141 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12142 def __init__(self, *args, **kwargs):
bfddbb17 12143 """
5b5c9bc7 12144 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
12145
12146 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12147 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12148 sizer.
12149 """
5b5c9bc7 12150 newobj = _core_.new_BoxSizer(*args, **kwargs)
d55e5bfc
RD
12151 self.this = newobj.this
12152 self.thisown = 1
12153 del newobj.thisown
12154 self._setOORInfo(self)
12155
12156 def GetOrientation(*args, **kwargs):
bfddbb17
RD
12157 """
12158 GetOrientation(self) -> int
12159
12160 Returns the current orientation of the sizer.
12161 """
5b5c9bc7 12162 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
12163
12164 def SetOrientation(*args, **kwargs):
bfddbb17
RD
12165 """
12166 SetOrientation(self, int orient)
d55e5bfc 12167
bfddbb17
RD
12168 Resets the orientation of the sizer.
12169 """
5b5c9bc7 12170 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc
RD
12171
12172
5b5c9bc7 12173class BoxSizerPtr(BoxSizer):
d55e5bfc
RD
12174 def __init__(self, this):
12175 self.this = this
12176 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12177 self.__class__ = BoxSizer
12178_core_.BoxSizer_swigregister(BoxSizerPtr)
d55e5bfc
RD
12179
12180#---------------------------------------------------------------------------
12181
5b5c9bc7 12182class StaticBoxSizer(BoxSizer):
bfddbb17
RD
12183 """
12184 wx.StaticBoxSizer derives from and functions identically to the
12185 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12186 manages. Note that this static box must be created separately and
12187 passed to the sizer constructor.
12188 """
d55e5bfc
RD
12189 def __repr__(self):
12190 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12191 def __init__(self, *args, **kwargs):
bfddbb17 12192 """
5b5c9bc7 12193 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
12194
12195 Constructor. It takes an associated static box and the orientation
12196 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12197 ``wx.HORIZONTAL``.
12198 """
5b5c9bc7 12199 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
d55e5bfc
RD
12200 self.this = newobj.this
12201 self.thisown = 1
12202 del newobj.thisown
12203 self._setOORInfo(self)
12204
12205 def GetStaticBox(*args, **kwargs):
bfddbb17 12206 """
5b5c9bc7 12207 GetStaticBox(self) -> StaticBox
d55e5bfc 12208
bfddbb17
RD
12209 Returns the static box associated with this sizer.
12210 """
5b5c9bc7 12211 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc
RD
12212
12213
5b5c9bc7 12214class StaticBoxSizerPtr(StaticBoxSizer):
d55e5bfc
RD
12215 def __init__(self, this):
12216 self.this = this
12217 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12218 self.__class__ = StaticBoxSizer
12219_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
d55e5bfc
RD
12220
12221#---------------------------------------------------------------------------
12222
5b5c9bc7 12223class GridSizer(Sizer):
bfddbb17
RD
12224 """
12225 A grid sizer is a sizer which lays out its children in a
12226 two-dimensional table with all cells having the same size. In other
12227 words, the width of each cell within the grid is the width of the
12228 widest item added to the sizer and the height of each grid cell is the
12229 height of the tallest item. An optional vertical and/or horizontal
12230 gap between items can also be specified (in pixels.)
12231
12232 Items are placed in the cells of the grid in the order they are added,
12233 in row-major order. In other words, the first row is filled first,
12234 then the second, and so on until all items have been added. (If
12235 neccessary, additional rows will be added as items are added.) If you
12236 need to have greater control over the cells that items are placed in
12237 then use the `wx.GridBagSizer`.
12238
12239 """
d55e5bfc
RD
12240 def __repr__(self):
12241 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12242 def __init__(self, *args, **kwargs):
bfddbb17 12243 """
5b5c9bc7 12244 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
12245
12246 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12247 of columns and rows in the sizer - if either of the parameters is
12248 zero, it will be calculated to from the total number of children in
12249 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12250 define extra space between all children.
12251 """
5b5c9bc7 12252 newobj = _core_.new_GridSizer(*args, **kwargs)
d55e5bfc
RD
12253 self.this = newobj.this
12254 self.thisown = 1
12255 del newobj.thisown
12256 self._setOORInfo(self)
12257
d55e5bfc 12258 def SetCols(*args, **kwargs):
bfddbb17
RD
12259 """
12260 SetCols(self, int cols)
12261
12262 Sets the number of columns in the sizer.
12263 """
5b5c9bc7 12264 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
12265
12266 def SetRows(*args, **kwargs):
bfddbb17
RD
12267 """
12268 SetRows(self, int rows)
12269
12270 Sets the number of rows in the sizer.
12271 """
5b5c9bc7 12272 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
12273
12274 def SetVGap(*args, **kwargs):
bfddbb17
RD
12275 """
12276 SetVGap(self, int gap)
12277
12278 Sets the vertical gap (in pixels) between the cells in the sizer.
12279 """
5b5c9bc7 12280 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
12281
12282 def SetHGap(*args, **kwargs):
bfddbb17
RD
12283 """
12284 SetHGap(self, int gap)
12285
12286 Sets the horizontal gap (in pixels) between cells in the sizer
12287 """
5b5c9bc7 12288 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
12289
12290 def GetCols(*args, **kwargs):
bfddbb17
RD
12291 """
12292 GetCols(self) -> int
12293
12294 Returns the number of columns in the sizer.
12295 """
5b5c9bc7 12296 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
12297
12298 def GetRows(*args, **kwargs):
bfddbb17
RD
12299 """
12300 GetRows(self) -> int
12301
12302 Returns the number of rows in the sizer.
12303 """
5b5c9bc7 12304 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
12305
12306 def GetVGap(*args, **kwargs):
bfddbb17
RD
12307 """
12308 GetVGap(self) -> int
12309
12310 Returns the vertical gap (in pixels) between the cells in the sizer.
12311 """
5b5c9bc7 12312 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
12313
12314 def GetHGap(*args, **kwargs):
bfddbb17
RD
12315 """
12316 GetHGap(self) -> int
12317
12318 Returns the horizontal gap (in pixels) between cells in the sizer.
12319 """
5b5c9bc7 12320 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc
RD
12321
12322
5b5c9bc7 12323class GridSizerPtr(GridSizer):
d55e5bfc
RD
12324 def __init__(self, this):
12325 self.this = this
12326 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12327 self.__class__ = GridSizer
12328_core_.GridSizer_swigregister(GridSizerPtr)
d55e5bfc
RD
12329
12330#---------------------------------------------------------------------------
12331
5b5c9bc7
RD
12332FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12333FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12334FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12335class FlexGridSizer(GridSizer):
bfddbb17
RD
12336 """
12337 A flex grid sizer is a sizer which lays out its children in a
12338 two-dimensional table with all table cells in one row having the same
12339 height and all cells in one column having the same width, but all
12340 rows or all columns are not necessarily the same height or width as in
12341 the `wx.GridSizer`.
12342
12343 wx.FlexGridSizer can also size items equally in one direction but
12344 unequally ("flexibly") in the other. If the sizer is only flexible
12345 in one direction (this can be changed using `SetFlexibleDirection`), it
12346 needs to be decided how the sizer should grow in the other ("non
12347 flexible") direction in order to fill the available space. The
12348 `SetNonFlexibleGrowMode` method serves this purpose.
12349
12350
12351 """
d55e5bfc
RD
12352 def __repr__(self):
12353 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12354 def __init__(self, *args, **kwargs):
bfddbb17 12355 """
5b5c9bc7 12356 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
12357
12358 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12359 number of columns and rows in the sizer - if either of the parameters
12360 is zero, it will be calculated to from the total number of children in
12361 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12362 define extra space between all children.
12363 """
5b5c9bc7 12364 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
d55e5bfc
RD
12365 self.this = newobj.this
12366 self.thisown = 1
12367 del newobj.thisown
12368 self._setOORInfo(self)
12369
bfddbb17
RD
12370 def AddGrowableRow(*args, **kwargs):
12371 """
12372 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 12373
bfddbb17
RD
12374 Specifies that row *idx* (starting from zero) should be grown if there
12375 is extra space available to the sizer.
d55e5bfc 12376
bfddbb17
RD
12377 The *proportion* parameter has the same meaning as the stretch factor
12378 for the box sizers except that if all proportions are 0, then all
12379 columns are resized equally (instead of not being resized at all).
12380 """
5b5c9bc7 12381 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
12382
12383 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
12384 """
12385 RemoveGrowableRow(self, size_t idx)
12386
12387 Specifies that row *idx* is no longer growable.
12388 """
5b5c9bc7 12389 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
12390
12391 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
12392 """
12393 AddGrowableCol(self, size_t idx, int proportion=0)
12394
12395 Specifies that column *idx* (starting from zero) should be grown if
12396 there is extra space available to the sizer.
12397
12398 The *proportion* parameter has the same meaning as the stretch factor
12399 for the box sizers except that if all proportions are 0, then all
12400 columns are resized equally (instead of not being resized at all).
12401 """
5b5c9bc7 12402 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
12403
12404 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
12405 """
12406 RemoveGrowableCol(self, size_t idx)
12407
12408 Specifies that column *idx* is no longer growable.
12409 """
5b5c9bc7 12410 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
12411
12412 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
12413 """
12414 SetFlexibleDirection(self, int direction)
12415
12416 Specifies whether the sizer should flexibly resize its columns, rows,
12417 or both. Argument *direction* can be one of the following values. Any
12418 other value is ignored.
12419
12420 ============== =======================================
12421 wx.VERTICAL Rows are flexibly sized.
12422 wx.HORIZONTAL Columns are flexibly sized.
12423 wx.BOTH Both rows and columns are flexibly sized
12424 (this is the default value).
12425 ============== =======================================
12426
12427 Note that this method does not trigger relayout.
12428
12429 """
5b5c9bc7 12430 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
12431
12432 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
12433 """
12434 GetFlexibleDirection(self) -> int
12435
12436 Returns a value that specifies whether the sizer
12437 flexibly resizes its columns, rows, or both (default).
12438
12439 :see: `SetFlexibleDirection`
12440 """
5b5c9bc7 12441 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
12442
12443 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
12444 """
12445 SetNonFlexibleGrowMode(self, int mode)
12446
12447 Specifies how the sizer should grow in the non-flexible direction if
12448 there is one (so `SetFlexibleDirection` must have been called
12449 previously). Argument *mode* can be one of the following values:
12450
12451 ========================== =================================================
12452 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12453 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12454 `AddGrowableCol` and `AddGrowableRow`. In this
12455 case equal sizing applies to minimum sizes of
12456 columns or rows (this is the default value).
12457 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12458 the non flexible direction, whether they are
12459 growable or not in the flexbile direction.
12460 ========================== =================================================
12461
12462 Note that this method does not trigger relayout.
12463
12464
12465 """
5b5c9bc7 12466 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
12467
12468 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
12469 """
12470 GetNonFlexibleGrowMode(self) -> int
12471
12472 Returns the value that specifies how the sizer grows in the
12473 non-flexible direction if there is one.
12474
12475 :see: `SetNonFlexibleGrowMode`
12476 """
5b5c9bc7 12477 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
12478
12479 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
12480 """
12481 GetRowHeights(self) -> list
12482
12483 Returns a list of integers representing the heights of each of the
12484 rows in the sizer.
12485 """
5b5c9bc7 12486 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
12487
12488 def GetColWidths(*args, **kwargs):
fd2dc343
RD
12489 """
12490 GetColWidths(self) -> list
12491
12492 Returns a list of integers representing the widths of each of the
12493 columns in the sizer.
12494 """
5b5c9bc7 12495 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc
RD
12496
12497
5b5c9bc7 12498class FlexGridSizerPtr(FlexGridSizer):
d55e5bfc
RD
12499 def __init__(self, this):
12500 self.this = this
12501 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12502 self.__class__ = FlexGridSizer
12503_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
d55e5bfc 12504
5b5c9bc7 12505class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
12506 """
12507 A special sizer that knows how to order and position standard buttons
12508 in order to conform to the current platform's standards. You simply
12509 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12510 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
12511 will take care of the rest.
12512
12513 """
12514 def __repr__(self):
12515 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12516 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
12517 """__init__(self) -> StdDialogButtonSizer"""
12518 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
62d32a5f
RD
12519 self.this = newobj.this
12520 self.thisown = 1
12521 del newobj.thisown
12522 def AddButton(*args, **kwargs):
12523 """
12524 AddButton(self, wxButton button)
12525
12526 Use this to add the buttons to this sizer. Do not use the `Add`
12527 method in the base class.
12528 """
5b5c9bc7 12529 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 12530
53aa7709 12531 def Realize(*args, **kwargs):
62d32a5f 12532 """
53aa7709 12533 Realize(self)
62d32a5f
RD
12534
12535 This funciton needs to be called after all the buttons have been added
12536 to the sizer. It will reorder them and position them in a platform
12537 specifc manner.
12538 """
5b5c9bc7 12539 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12540
12541 def SetAffirmativeButton(*args, **kwargs):
12542 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 12543 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
12544
12545 def SetNegativeButton(*args, **kwargs):
12546 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 12547 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
12548
12549 def SetCancelButton(*args, **kwargs):
12550 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 12551 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
12552
12553 def GetAffirmativeButton(*args, **kwargs):
12554 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 12555 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
12556
12557 def GetApplyButton(*args, **kwargs):
12558 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 12559 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
12560
12561 def GetNegativeButton(*args, **kwargs):
12562 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 12563 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
12564
12565 def GetCancelButton(*args, **kwargs):
12566 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 12567 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
12568
12569 def GetHelpButton(*args, **kwargs):
12570 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 12571 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f
RD
12572
12573
5b5c9bc7 12574class StdDialogButtonSizerPtr(StdDialogButtonSizer):
62d32a5f
RD
12575 def __init__(self, this):
12576 self.this = this
12577 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12578 self.__class__ = StdDialogButtonSizer
12579_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
62d32a5f 12580
d55e5bfc
RD
12581#---------------------------------------------------------------------------
12582
5b5c9bc7 12583class GBPosition(object):
bfddbb17
RD
12584 """
12585 This class represents the position of an item in a virtual grid of
12586 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12587 typemaps that will automatically convert from a 2-element sequence of
12588 integers to a wx.GBPosition, so you can use the more pythonic
12589 representation of the position nearly transparently in Python code.
12590 """
d55e5bfc
RD
12591 def __repr__(self):
12592 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12593 def __init__(self, *args, **kwargs):
bfddbb17 12594 """
5b5c9bc7 12595 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
12596
12597 This class represents the position of an item in a virtual grid of
12598 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12599 typemaps that will automatically convert from a 2-element sequence of
12600 integers to a wx.GBPosition, so you can use the more pythonic
12601 representation of the position nearly transparently in Python code.
12602 """
5b5c9bc7 12603 newobj = _core_.new_GBPosition(*args, **kwargs)
d55e5bfc
RD
12604 self.this = newobj.this
12605 self.thisown = 1
12606 del newobj.thisown
12607 def GetRow(*args, **kwargs):
12608 """GetRow(self) -> int"""
5b5c9bc7 12609 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
12610
12611 def GetCol(*args, **kwargs):
12612 """GetCol(self) -> int"""
5b5c9bc7 12613 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
12614
12615 def SetRow(*args, **kwargs):
12616 """SetRow(self, int row)"""
5b5c9bc7 12617 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
12618
12619 def SetCol(*args, **kwargs):
12620 """SetCol(self, int col)"""
5b5c9bc7 12621 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
12622
12623 def __eq__(*args, **kwargs):
5b5c9bc7
RD
12624 """__eq__(self, GBPosition other) -> bool"""
12625 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
12626
12627 def __ne__(*args, **kwargs):
5b5c9bc7
RD
12628 """__ne__(self, GBPosition other) -> bool"""
12629 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
12630
12631 def Set(*args, **kwargs):
12632 """Set(self, int row=0, int col=0)"""
5b5c9bc7 12633 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
12634
12635 def Get(*args, **kwargs):
12636 """Get(self) -> PyObject"""
5b5c9bc7 12637 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 12638
15817c7e 12639 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12640 def __str__(self): return str(self.Get())
12641 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12642 def __len__(self): return len(self.Get())
12643 def __getitem__(self, index): return self.Get()[index]
12644 def __setitem__(self, index, val):
12645 if index == 0: self.SetRow(val)
12646 elif index == 1: self.SetCol(val)
12647 else: raise IndexError
12648 def __nonzero__(self): return self.Get() != (0,0)
12649 __safe_for_unpickling__ = True
12650 def __reduce__(self): return (wx.GBPosition, self.Get())
12651
12652 row = property(GetRow, SetRow)
12653 col = property(GetCol, SetCol)
12654
12655
5b5c9bc7 12656class GBPositionPtr(GBPosition):
d55e5bfc
RD
12657 def __init__(self, this):
12658 self.this = this
12659 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12660 self.__class__ = GBPosition
12661_core_.GBPosition_swigregister(GBPositionPtr)
d55e5bfc 12662
5b5c9bc7 12663class GBSpan(object):
bfddbb17
RD
12664 """
12665 This class is used to hold the row and column spanning attributes of
12666 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12667 automatically convert from a 2-element sequence of integers to a
12668 wx.GBSpan, so you can use the more pythonic representation of the span
12669 nearly transparently in Python code.
12670
12671 """
d55e5bfc
RD
12672 def __repr__(self):
12673 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12674 def __init__(self, *args, **kwargs):
bfddbb17 12675 """
5b5c9bc7 12676 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
12677
12678 Construct a new wxGBSpan, optionally setting the rowspan and
12679 colspan. The default is (1,1). (Meaning that the item occupies one
12680 cell in each direction.
12681 """
5b5c9bc7 12682 newobj = _core_.new_GBSpan(*args, **kwargs)
d55e5bfc
RD
12683 self.this = newobj.this
12684 self.thisown = 1
12685 del newobj.thisown
12686 def GetRowspan(*args, **kwargs):
12687 """GetRowspan(self) -> int"""
5b5c9bc7 12688 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
12689
12690 def GetColspan(*args, **kwargs):
12691 """GetColspan(self) -> int"""
5b5c9bc7 12692 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
12693
12694 def SetRowspan(*args, **kwargs):
12695 """SetRowspan(self, int rowspan)"""
5b5c9bc7 12696 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
12697
12698 def SetColspan(*args, **kwargs):
12699 """SetColspan(self, int colspan)"""
5b5c9bc7 12700 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
12701
12702 def __eq__(*args, **kwargs):
5b5c9bc7
RD
12703 """__eq__(self, GBSpan other) -> bool"""
12704 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
12705
12706 def __ne__(*args, **kwargs):
5b5c9bc7
RD
12707 """__ne__(self, GBSpan other) -> bool"""
12708 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
12709
12710 def Set(*args, **kwargs):
12711 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 12712 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
12713
12714 def Get(*args, **kwargs):
12715 """Get(self) -> PyObject"""
5b5c9bc7 12716 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 12717
15817c7e 12718 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12719 def __str__(self): return str(self.Get())
12720 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12721 def __len__(self): return len(self.Get())
12722 def __getitem__(self, index): return self.Get()[index]
12723 def __setitem__(self, index, val):
12724 if index == 0: self.SetRowspan(val)
12725 elif index == 1: self.SetColspan(val)
12726 else: raise IndexError
12727 def __nonzero__(self): return self.Get() != (0,0)
12728 __safe_for_unpickling__ = True
12729 def __reduce__(self): return (wx.GBSpan, self.Get())
12730
12731 rowspan = property(GetRowspan, SetRowspan)
12732 colspan = property(GetColspan, SetColspan)
12733
12734
5b5c9bc7 12735class GBSpanPtr(GBSpan):
d55e5bfc
RD
12736 def __init__(self, this):
12737 self.this = this
12738 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12739 self.__class__ = GBSpan
12740_core_.GBSpan_swigregister(GBSpanPtr)
d55e5bfc 12741
5b5c9bc7 12742class GBSizerItem(SizerItem):
bfddbb17
RD
12743 """
12744 The wx.GBSizerItem class is used to track the additional data about
12745 items in a `wx.GridBagSizer` such as the item's position in the grid
12746 and how many rows or columns it spans.
12747
12748 """
d55e5bfc
RD
12749 def __repr__(self):
12750 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12751 def __init__(self, *args, **kwargs):
bfddbb17 12752 """
5b5c9bc7 12753 __init__(self) -> GBSizerItem
bfddbb17
RD
12754
12755 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12756 size will need to be set, as well as a position and span before this
12757 item can be used in a Sizer.
12758
12759 You will probably never need to create a wx.GBSizerItem directly as they
12760 are created automatically when the sizer's Add method is called.
12761 """
5b5c9bc7 12762 newobj = _core_.new_GBSizerItem(*args, **kwargs)
d55e5bfc
RD
12763 self.this = newobj.this
12764 self.thisown = 1
12765 del newobj.thisown
12766 def GetPos(*args, **kwargs):
bfddbb17 12767 """
5b5c9bc7 12768 GetPos(self) -> GBPosition
bfddbb17
RD
12769
12770 Get the grid position of the item
12771 """
5b5c9bc7 12772 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
12773
12774 def GetPosTuple(self): return self.GetPos().Get()
12775 def GetSpan(*args, **kwargs):
bfddbb17 12776 """
5b5c9bc7 12777 GetSpan(self) -> GBSpan
bfddbb17
RD
12778
12779 Get the row and column spanning of the item
12780 """
5b5c9bc7 12781 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
12782
12783 def GetSpanTuple(self): return self.GetSpan().Get()
12784 def SetPos(*args, **kwargs):
bfddbb17 12785 """
5b5c9bc7 12786 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
12787
12788 If the item is already a member of a sizer then first ensure that
12789 there is no other item that would intersect with this one at the new
12790 position, then set the new position. Returns True if the change is
12791 successful and after the next Layout() the item will be moved.
12792 """
5b5c9bc7 12793 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
12794
12795 def SetSpan(*args, **kwargs):
bfddbb17 12796 """
5b5c9bc7 12797 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
12798
12799 If the item is already a member of a sizer then first ensure that
12800 there is no other item that would intersect with this one with its new
12801 spanning size, then set the new spanning. Returns True if the change
12802 is successful and after the next Layout() the item will be resized.
12803
12804 """
5b5c9bc7 12805 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 12806
bfddbb17 12807 def Intersects(*args, **kwargs):
d55e5bfc 12808 """
5b5c9bc7 12809 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
12810
12811 Returns True if this item and the other item instersect.
d55e5bfc 12812 """
5b5c9bc7 12813 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
12814
12815 def IntersectsPos(*args, **kwargs):
12816 """
5b5c9bc7 12817 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
12818
12819 Returns True if the given pos/span would intersect with this item.
12820 """
5b5c9bc7 12821 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12822
12823 def GetEndPos(*args, **kwargs):
bfddbb17 12824 """
5b5c9bc7 12825 GetEndPos(self) -> GBPosition
bfddbb17
RD
12826
12827 Get the row and column of the endpoint of this item.
12828 """
5b5c9bc7 12829 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
12830
12831 def GetGBSizer(*args, **kwargs):
bfddbb17 12832 """
5b5c9bc7 12833 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
12834
12835 Get the sizer this item is a member of.
12836 """
5b5c9bc7 12837 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
12838
12839 def SetGBSizer(*args, **kwargs):
bfddbb17 12840 """
5b5c9bc7 12841 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
12842
12843 Set the sizer this item is a member of.
12844 """
5b5c9bc7 12845 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc
RD
12846
12847
5b5c9bc7 12848class GBSizerItemPtr(GBSizerItem):
d55e5bfc
RD
12849 def __init__(self, this):
12850 self.this = this
12851 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12852 self.__class__ = GBSizerItem
12853_core_.GBSizerItem_swigregister(GBSizerItemPtr)
12854DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
12855
12856def GBSizerItemWindow(*args, **kwargs):
12857 """
5b5c9bc7
RD
12858 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12859 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12860
12861 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 12862 """
5b5c9bc7 12863 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12864 val.thisown = 1
12865 return val
12866
12867def GBSizerItemSizer(*args, **kwargs):
12868 """
5b5c9bc7
RD
12869 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12870 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12871
12872 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 12873 """
5b5c9bc7 12874 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12875 val.thisown = 1
12876 return val
12877
12878def GBSizerItemSpacer(*args, **kwargs):
12879 """
5b5c9bc7
RD
12880 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12881 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12882
12883 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 12884 """
5b5c9bc7 12885 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12886 val.thisown = 1
12887 return val
12888
5b5c9bc7 12889class GridBagSizer(FlexGridSizer):
bfddbb17
RD
12890 """
12891 A `wx.Sizer` that can lay out items in a virtual grid like a
12892 `wx.FlexGridSizer` but in this case explicit positioning of the items
12893 is allowed using `wx.GBPosition`, and items can optionally span more
12894 than one row and/or column using `wx.GBSpan`. The total size of the
12895 virtual grid is determined by the largest row and column that items are
12896 positioned at, adjusted for spanning.
12897
12898 """
d55e5bfc
RD
12899 def __repr__(self):
12900 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12901 def __init__(self, *args, **kwargs):
bfddbb17 12902 """
5b5c9bc7 12903 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
12904
12905 Constructor, with optional parameters to specify the gap between the
12906 rows and columns.
12907 """
5b5c9bc7 12908 newobj = _core_.new_GridBagSizer(*args, **kwargs)
d55e5bfc
RD
12909 self.this = newobj.this
12910 self.thisown = 1
12911 del newobj.thisown
03e46024
RD
12912 self._setOORInfo(self)
12913
d55e5bfc
RD
12914 def Add(*args, **kwargs):
12915 """
bfddbb17 12916 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 12917 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
12918
12919 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12920 more than one row or column as specified with *span*. The remaining
12921 args behave similarly to `wx.Sizer.Add`.
12922
12923 Returns True if the item was successfully placed at the given cell
12924 position, False if something was already there.
12925
d55e5bfc 12926 """
5b5c9bc7 12927 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
12928
12929 def AddItem(*args, **kwargs):
bfddbb17 12930 """
070c48b4 12931 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
12932
12933 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12934 the item was successfully placed at its given cell position, False if
12935 something was already there.
12936 """
5b5c9bc7 12937 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 12938
84f85550
RD
12939 def GetCellSize(*args, **kwargs):
12940 """
5b5c9bc7 12941 GetCellSize(self, int row, int col) -> Size
84f85550
RD
12942
12943 Get the size of the specified cell, including hgap and
12944 vgap. Only valid after a Layout.
12945 """
5b5c9bc7 12946 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 12947
d55e5bfc 12948 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 12949 """
5b5c9bc7 12950 GetEmptyCellSize(self) -> Size
bfddbb17
RD
12951
12952 Get the size used for cells in the grid with no item.
12953 """
5b5c9bc7 12954 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12955
12956 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 12957 """
5b5c9bc7 12958 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
12959
12960 Set the size used for cells in the grid with no item.
12961 """
5b5c9bc7 12962 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12963
12964 def GetItemPosition(*args):
12965 """
bfddbb17
RD
12966 GetItemPosition(self, item) -> GBPosition
12967
12968 Get 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.
d55e5bfc 12971 """
5b5c9bc7 12972 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
12973
12974 def SetItemPosition(*args):
12975 """
bfddbb17
RD
12976 SetItemPosition(self, item, GBPosition pos) -> bool
12977
12978 Set the grid position of the specified *item* where *item* is either a
12979 window or subsizer that is a member of this sizer, or a zero-based
12980 index of an item. Returns True on success. If the move is not
12981 allowed (because an item is already there) then False is returned.
12982
d55e5bfc 12983 """
5b5c9bc7 12984 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
12985
12986 def GetItemSpan(*args):
12987 """
bfddbb17
RD
12988 GetItemSpan(self, item) -> GBSpan
12989
12990 Get 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.
d55e5bfc 12993 """
5b5c9bc7 12994 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
12995
12996 def SetItemSpan(*args):
12997 """
bfddbb17
RD
12998 SetItemSpan(self, item, GBSpan span) -> bool
12999
13000 Set the row/col spanning of the specified *item* where *item* is
13001 either a window or subsizer that is a member of this sizer, or a
13002 zero-based index of an item. Returns True on success. If the move is
13003 not allowed (because an item is already there) then False is returned.
d55e5bfc 13004 """
5b5c9bc7 13005 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
13006
13007 def FindItem(*args):
13008 """
bfddbb17
RD
13009 FindItem(self, item) -> GBSizerItem
13010
13011 Find the sizer item for the given window or subsizer, returns None if
13012 not found. (non-recursive)
d55e5bfc 13013 """
5b5c9bc7 13014 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
13015
13016 def FindItemAtPosition(*args, **kwargs):
bfddbb17 13017 """
5b5c9bc7 13018 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
13019
13020 Return the sizer item for the given grid cell, or None if there is no
13021 item at that position. (non-recursive)
13022 """
5b5c9bc7 13023 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
13024
13025 def FindItemAtPoint(*args, **kwargs):
bfddbb17 13026 """
5b5c9bc7 13027 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
13028
13029 Return the sizer item located at the point given in *pt*, or None if
13030 there is no item at that point. The (x,y) coordinates in pt correspond
13031 to the client coordinates of the window using the sizer for
13032 layout. (non-recursive)
13033 """
5b5c9bc7 13034 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 13035
bfddbb17
RD
13036 def CheckForIntersection(*args, **kwargs):
13037 """
5b5c9bc7 13038 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 13039
bfddbb17
RD
13040 Look at all items and see if any intersect (or would overlap) the
13041 given *item*. Returns True if so, False if there would be no overlap.
13042 If an *excludeItem* is given then it will not be checked for
13043 intersection, for example it may be the item we are checking the
13044 position of.
d55e5bfc 13045
bfddbb17 13046 """
5b5c9bc7 13047 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 13048
bfddbb17 13049 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 13050 """
5b5c9bc7 13051 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
13052
13053 Look at all items and see if any intersect (or would overlap) the
13054 given position and span. Returns True if so, False if there would be
13055 no overlap. If an *excludeItem* is given then it will not be checked
13056 for intersection, for example it may be the item we are checking the
13057 position of.
d55e5bfc 13058 """
5b5c9bc7 13059 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc
RD
13060
13061
5b5c9bc7 13062class GridBagSizerPtr(GridBagSizer):
d55e5bfc
RD
13063 def __init__(self, this):
13064 self.this = this
13065 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
13066 self.__class__ = GridBagSizer
13067_core_.GridBagSizer_swigregister(GridBagSizerPtr)
d55e5bfc
RD
13068
13069#---------------------------------------------------------------------------
13070
5b5c9bc7
RD
13071Left = _core_.Left
13072Top = _core_.Top
13073Right = _core_.Right
13074Bottom = _core_.Bottom
13075Width = _core_.Width
13076Height = _core_.Height
13077Centre = _core_.Centre
13078Center = _core_.Center
13079CentreX = _core_.CentreX
13080CentreY = _core_.CentreY
13081Unconstrained = _core_.Unconstrained
13082AsIs = _core_.AsIs
13083PercentOf = _core_.PercentOf
13084Above = _core_.Above
13085Below = _core_.Below
13086LeftOf = _core_.LeftOf
13087RightOf = _core_.RightOf
13088SameAs = _core_.SameAs
13089Absolute = _core_.Absolute
13090class IndividualLayoutConstraint(Object):
d55e5bfc 13091 """
15817c7e
RD
13092 Objects of this class are stored in the `wx.LayoutConstraints` class as
13093 one of eight possible constraints that a window can be involved in.
13094 You will never need to create an instance of
13095 wx.IndividualLayoutConstraint, rather you should create a
13096 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 13097 that it contains.
d55e5bfc
RD
13098 """
13099 def __init__(self): raise RuntimeError, "No constructor defined"
13100 def __repr__(self):
13101 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
13102 def Set(*args, **kwargs):
15817c7e 13103 """
5b5c9bc7 13104 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
13105
13106 Sets the properties of the constraint. Normally called by one of the
13107 convenience functions such as Above, RightOf, SameAs.
13108 """
5b5c9bc7 13109 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
13110
13111 def LeftOf(*args, **kwargs):
13112 """
5b5c9bc7 13113 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 13114
15817c7e
RD
13115 Constrains this edge to be to the left of the given window, with an
13116 optional margin. Implicitly, this is relative to the left edge of the
13117 other window.
d55e5bfc 13118 """
5b5c9bc7 13119 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
13120
13121 def RightOf(*args, **kwargs):
13122 """
5b5c9bc7 13123 RightOf(self, Window sibling, int marg=0)
d55e5bfc 13124
15817c7e
RD
13125 Constrains this edge to be to the right of the given window, with an
13126 optional margin. Implicitly, this is relative to the right edge of the
13127 other window.
d55e5bfc 13128 """
5b5c9bc7 13129 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
13130
13131 def Above(*args, **kwargs):
13132 """
5b5c9bc7 13133 Above(self, Window sibling, int marg=0)
d55e5bfc 13134
15817c7e
RD
13135 Constrains this edge to be above the given window, with an optional
13136 margin. Implicitly, this is relative to the top edge of the other
13137 window.
d55e5bfc 13138 """
5b5c9bc7 13139 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
13140
13141 def Below(*args, **kwargs):
13142 """
5b5c9bc7 13143 Below(self, Window sibling, int marg=0)
d55e5bfc 13144
15817c7e
RD
13145 Constrains this edge to be below the given window, with an optional
13146 margin. Implicitly, this is relative to the bottom edge of the other
13147 window.
d55e5bfc 13148 """
5b5c9bc7 13149 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
13150
13151 def SameAs(*args, **kwargs):
13152 """
5b5c9bc7 13153 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 13154
15817c7e
RD
13155 Constrains this edge or dimension to be to the same as the edge of the
13156 given window, with an optional margin.
d55e5bfc 13157 """
5b5c9bc7 13158 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
13159
13160 def PercentOf(*args, **kwargs):
13161 """
5b5c9bc7 13162 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 13163
15817c7e
RD
13164 Constrains this edge or dimension to be to a percentage of the given
13165 window, with an optional margin.
d55e5bfc 13166 """
5b5c9bc7 13167 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
13168
13169 def Absolute(*args, **kwargs):
13170 """
13171 Absolute(self, int val)
13172
15817c7e 13173 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 13174 """
5b5c9bc7 13175 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
13176
13177 def Unconstrained(*args, **kwargs):
13178 """
13179 Unconstrained(self)
13180
15817c7e
RD
13181 Sets this edge or dimension to be unconstrained, that is, dependent on
13182 other edges and dimensions from which this value can be deduced.
d55e5bfc 13183 """
5b5c9bc7 13184 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
13185
13186 def AsIs(*args, **kwargs):
13187 """
13188 AsIs(self)
13189
15817c7e
RD
13190 Sets this edge or constraint to be whatever the window's value is at
13191 the moment. If either of the width and height constraints are *as is*,
13192 the window will not be resized, but moved instead. This is important
13193 when considering panel items which are intended to have a default
13194 size, such as a button, which may take its size from the size of the
13195 button label.
d55e5bfc 13196 """
5b5c9bc7 13197 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
13198
13199 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
13200 """GetOtherWindow(self) -> Window"""
13201 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
13202
13203 def GetMyEdge(*args, **kwargs):
13204 """GetMyEdge(self) -> int"""
5b5c9bc7 13205 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
13206
13207 def SetEdge(*args, **kwargs):
13208 """SetEdge(self, int which)"""
5b5c9bc7 13209 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
13210
13211 def SetValue(*args, **kwargs):
13212 """SetValue(self, int v)"""
5b5c9bc7 13213 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
13214
13215 def GetMargin(*args, **kwargs):
13216 """GetMargin(self) -> int"""
5b5c9bc7 13217 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
13218
13219 def SetMargin(*args, **kwargs):
13220 """SetMargin(self, int m)"""
5b5c9bc7 13221 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
13222
13223 def GetValue(*args, **kwargs):
13224 """GetValue(self) -> int"""
5b5c9bc7 13225 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
13226
13227 def GetPercent(*args, **kwargs):
13228 """GetPercent(self) -> int"""
5b5c9bc7 13229 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
13230
13231 def GetOtherEdge(*args, **kwargs):
13232 """GetOtherEdge(self) -> int"""
5b5c9bc7 13233 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
13234
13235 def GetDone(*args, **kwargs):
13236 """GetDone(self) -> bool"""
5b5c9bc7 13237 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
13238
13239 def SetDone(*args, **kwargs):
13240 """SetDone(self, bool d)"""
5b5c9bc7 13241 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
13242
13243 def GetRelationship(*args, **kwargs):
13244 """GetRelationship(self) -> int"""
5b5c9bc7 13245 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
13246
13247 def SetRelationship(*args, **kwargs):
13248 """SetRelationship(self, int r)"""
5b5c9bc7 13249 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
13250
13251 def ResetIfWin(*args, **kwargs):
13252 """
5b5c9bc7 13253 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
13254
13255 Reset constraint if it mentions otherWin
13256 """
5b5c9bc7 13257 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
13258
13259 def SatisfyConstraint(*args, **kwargs):
13260 """
5b5c9bc7 13261 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
13262
13263 Try to satisfy constraint
13264 """
5b5c9bc7 13265 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
13266
13267 def GetEdge(*args, **kwargs):
13268 """
5b5c9bc7 13269 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
13270
13271 Get the value of this edge or dimension, or if this
13272 is not determinable, -1.
13273 """
5b5c9bc7 13274 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc
RD
13275
13276
5b5c9bc7 13277class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
d55e5bfc
RD
13278 def __init__(self, this):
13279 self.this = this
13280 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
13281 self.__class__ = IndividualLayoutConstraint
13282_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
d55e5bfc 13283
5b5c9bc7 13284class LayoutConstraints(Object):
d55e5bfc 13285 """
15817c7e
RD
13286 **Note:** constraints are now deprecated and you should use sizers
13287 instead.
d55e5bfc 13288
15817c7e
RD
13289 Objects of this class can be associated with a window to define its
13290 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
13291
13292 The class consists of the following eight constraints of class
13293 wx.IndividualLayoutConstraint, some or all of which should be accessed
13294 directly to set the appropriate constraints.
13295
13296 * left: represents the left hand edge of the window
13297 * right: represents the right hand edge of the window
13298 * top: represents the top edge of the window
13299 * bottom: represents the bottom edge of the window
13300 * width: represents the width of the window
13301 * height: represents the height of the window
13302 * centreX: represents the horizontal centre point of the window
13303 * centreY: represents the vertical centre point of the window
13304
15817c7e
RD
13305 Most constraints are initially set to have the relationship
13306 wxUnconstrained, which means that their values should be calculated by
13307 looking at known constraints. The exceptions are width and height,
13308 which are set to wxAsIs to ensure that if the user does not specify a
13309 constraint, the existing width and height will be used, to be
13310 compatible with panel items which often have take a default size. If
13311 the constraint is ``wx.AsIs``, the dimension will not be changed.
13312
13313 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
13314
13315 """
13316 def __repr__(self):
13317 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
13318 left = property(_core_.LayoutConstraints_left_get)
13319 top = property(_core_.LayoutConstraints_top_get)
13320 right = property(_core_.LayoutConstraints_right_get)
13321 bottom = property(_core_.LayoutConstraints_bottom_get)
13322 width = property(_core_.LayoutConstraints_width_get)
13323 height = property(_core_.LayoutConstraints_height_get)
13324 centreX = property(_core_.LayoutConstraints_centreX_get)
13325 centreY = property(_core_.LayoutConstraints_centreY_get)
d55e5bfc 13326 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
13327 """__init__(self) -> LayoutConstraints"""
13328 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
d55e5bfc
RD
13329 self.this = newobj.this
13330 self.thisown = 1
13331 del newobj.thisown
13332 def SatisfyConstraints(*args, **kwargs):
13333 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 13334 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
13335
13336 def AreSatisfied(*args, **kwargs):
13337 """AreSatisfied(self) -> bool"""
5b5c9bc7 13338 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc
RD
13339
13340
5b5c9bc7 13341class LayoutConstraintsPtr(LayoutConstraints):
d55e5bfc
RD
13342 def __init__(self, this):
13343 self.this = this
13344 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
13345 self.__class__ = LayoutConstraints
13346_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
d55e5bfc
RD
13347
13348#----------------------------------------------------------------------------
13349
13350# Use Python's bool constants if available, make some if not
13351try:
13352 True
13353except NameError:
13354 __builtins__.True = 1==1
13355 __builtins__.False = 1==0
13356 def bool(value): return not not value
13357 __builtins__.bool = bool
13358
13359
13360
13361# workarounds for bad wxRTTI names
13362__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13363__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13364__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13365
13366
13367#----------------------------------------------------------------------------
13368# Load version numbers from __version__... Ensure that major and minor
0f63ec68 13369# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
13370
13371from __version__ import *
13372__version__ = VERSION_STRING
13373
0f63ec68
RD
13374assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13375assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
13376if RELEASE_VERSION != _core_.RELEASE_VERSION:
13377 import warnings
0f63ec68 13378 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
13379
13380#----------------------------------------------------------------------------
13381
7993762b
RD
13382# Set wxPython's default string<-->unicode conversion encoding from
13383# the locale, but only if Python's default hasn't been changed. (We
13384# assume that if the user has customized it already then that is the
13385# encoding we need to use as well.)
13386#
13387# The encoding selected here is used when string or unicode objects
13388# need to be converted in order to pass them to wxWidgets. Please be
13389# aware that the default encoding within the same locale may be
13390# slightly different on different platforms. For example, please see
62d32a5f
RD
13391# http://www.alanwood.net/demos/charsetdiffs.html for differences
13392# between the common latin/roman encodings.
3837a853
RD
13393
13394default = _sys.getdefaultencoding()
13395if default == 'ascii':
13396 import locale
13397 import codecs
13398 try:
13399 default = locale.getdefaultlocale()[1]
13400 codecs.lookup(default)
7993762b 13401 except (ValueError, LookupError, TypeError):
3837a853
RD
13402 default = _sys.getdefaultencoding()
13403 del locale
13404 del codecs
5cbf236d
RD
13405if default:
13406 wx.SetDefaultPyEncoding(default)
13407del default
5cbf236d
RD
13408
13409#----------------------------------------------------------------------------
13410
d55e5bfc
RD
13411class PyDeadObjectError(AttributeError):
13412 pass
13413
13414class _wxPyDeadObject(object):
13415 """
13416 Instances of wx objects that are OOR capable will have their __class__
13417 changed to this class when the C++ object is deleted. This should help
13418 prevent crashes due to referencing a bogus C++ pointer.
13419 """
13420 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13421 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13422
13423 def __repr__(self):
13424 if not hasattr(self, "_name"):
13425 self._name = "[unknown]"
13426 return self.reprStr % self._name
13427
13428 def __getattr__(self, *args):
13429 if not hasattr(self, "_name"):
13430 self._name = "[unknown]"
13431 raise PyDeadObjectError(self.attrStr % self._name)
13432
13433 def __nonzero__(self):
13434 return 0
13435
13436
13437
13438class PyUnbornObjectError(AttributeError):
13439 pass
13440
13441class _wxPyUnbornObject(object):
13442 """
13443 Some stock objects are created when the wx._core module is
13444 imported, but their C++ instance is not created until the wx.App
13445 object is created and initialized. These object instances will
13446 temporarily have their __class__ changed to this class so an
13447 exception will be raised if they are used before the C++ instance
13448 is ready.
13449 """
13450
13451 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13452 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13453
13454 def __repr__(self):
13455 #if not hasattr(self, "_name"):
13456 # self._name = "[unknown]"
13457 return self.reprStr #% self._name
13458
13459 def __getattr__(self, *args):
13460 #if not hasattr(self, "_name"):
13461 # self._name = "[unknown]"
13462 raise PyUnbornObjectError(self.attrStr) # % self._name )
13463
13464 def __nonzero__(self):
13465 return 0
13466
13467
13468#----------------------------------------------------------------------------
d55e5bfc
RD
13469
13470def CallAfter(callable, *args, **kw):
13471 """
13472 Call the specified function after the current and pending event
13473 handlers have been completed. This is also good for making GUI
0439c23b
RD
13474 method calls from non-GUI threads. Any extra positional or
13475 keyword args are passed on to the callable when it is called.
13476
13477 :see: `wx.FutureCall`
d55e5bfc
RD
13478 """
13479 app = wx.GetApp()
a001823c 13480 assert app is not None, 'No wx.App created yet'
d55e5bfc 13481
891bb194
RD
13482 if not hasattr(app, "_CallAfterId"):
13483 app._CallAfterId = wx.NewEventType()
13484 app.Connect(-1, -1, app._CallAfterId,
13485 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 13486 evt = wx.PyEvent()
891bb194 13487 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
13488 evt.callable = callable
13489 evt.args = args
13490 evt.kw = kw
13491 wx.PostEvent(app, evt)
13492
d55e5bfc
RD
13493#----------------------------------------------------------------------------
13494
13495
13496class FutureCall:
13497 """
6e0de3df 13498 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
13499 object once after the given amount of milliseconds, passing any
13500 positional or keyword args. The return value of the callable is
0439c23b 13501 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
13502
13503 If you don't need to get the return value or restart the timer
13504 then there is no need to hold a reference to this object. It will
13505 hold a reference to itself while the timer is running (the timer
13506 has a reference to self.Notify) but the cycle will be broken when
13507 the timer completes, automatically cleaning up the wx.FutureCall
13508 object.
0439c23b
RD
13509
13510 :see: `wx.CallAfter`
d55e5bfc
RD
13511 """
13512 def __init__(self, millis, callable, *args, **kwargs):
13513 self.millis = millis
13514 self.callable = callable
13515 self.SetArgs(*args, **kwargs)
13516 self.runCount = 0
13517 self.running = False
13518 self.hasRun = False
13519 self.result = None
13520 self.timer = None
13521 self.Start()
13522
13523 def __del__(self):
13524 self.Stop()
13525
13526
13527 def Start(self, millis=None, *args, **kwargs):
13528 """
13529 (Re)start the timer
13530 """
13531 self.hasRun = False
13532 if millis is not None:
13533 self.millis = millis
13534 if args or kwargs:
13535 self.SetArgs(*args, **kwargs)
13536 self.Stop()
13537 self.timer = wx.PyTimer(self.Notify)
13538 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13539 self.running = True
13540 Restart = Start
13541
13542
13543 def Stop(self):
13544 """
13545 Stop and destroy the timer.
13546 """
13547 if self.timer is not None:
13548 self.timer.Stop()
13549 self.timer = None
13550
13551
13552 def GetInterval(self):
13553 if self.timer is not None:
13554 return self.timer.GetInterval()
13555 else:
13556 return 0
13557
13558
13559 def IsRunning(self):
13560 return self.timer is not None and self.timer.IsRunning()
13561
13562
13563 def SetArgs(self, *args, **kwargs):
13564 """
13565 (Re)set the args passed to the callable object. This is
13566 useful in conjunction with Restart if you want to schedule a
13567 new call to the same callable object but with different
13568 parameters.
13569 """
13570 self.args = args
13571 self.kwargs = kwargs
13572
13573
13574 def HasRun(self):
13575 return self.hasRun
13576
13577 def GetResult(self):
13578 return self.result
13579
13580 def Notify(self):
13581 """
13582 The timer has expired so call the callable.
13583 """
13584 if self.callable and getattr(self.callable, 'im_self', True):
13585 self.runCount += 1
13586 self.running = False
13587 self.result = self.callable(*self.args, **self.kwargs)
13588 self.hasRun = True
13589 if not self.running:
13590 # if it wasn't restarted, then cleanup
13591 wx.CallAfter(self.Stop)
13592
13593
13594
13595#----------------------------------------------------------------------------
13596# Control which items in this module should be documented by epydoc.
13597# We allow only classes and functions, which will help reduce the size
13598# of the docs by filtering out the zillions of constants, EVT objects,
13599# and etc that don't make much sense by themselves, but are instead
13600# documented (or will be) as part of the classes/functions/methods
13601# where they should be used.
13602
d6c14a4c
RD
13603class __DocFilter:
13604 """
13605 A filter for epydoc that only allows non-Ptr classes and
13606 fucntions, in order to reduce the clutter in the API docs.
13607 """
13608 def __init__(self, globals):
13609 self._globals = globals
13610
13611 def __call__(self, name):
13612 import types
13613 obj = self._globals.get(name, None)
13614 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13615 return False
13616 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
13617 return False
13618 return True
d55e5bfc
RD
13619
13620#----------------------------------------------------------------------------
13621#----------------------------------------------------------------------------
13622
13623# Import other modules in this package that should show up in the
13624# "core" wx namespace
13625from _gdi import *
13626from _windows import *
13627from _controls import *
13628from _misc import *
13629
13630
13631# Fixup the stock objects since they can't be used yet. (They will be
13632# restored in wx.PyApp.OnInit.)
13633_core_._wxPyFixStockObjects()
13634
13635#----------------------------------------------------------------------------
13636#----------------------------------------------------------------------------
13637
13638
32fe5131 13639