]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/msw/_core.py
Fixes so that wxPython builds on 2.7. Mostly removing references to all functions...
[wxWidgets.git] / wxPython / src / msw / _core.py
CommitLineData
d55e5bfc
RD
1# This file was created automatically by SWIG.
2# Don't modify this file, modify the SWIG interface instead.
3
4import _core_
5
093d3ff1
RD
6def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name) or (name == "thisown"):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
24 method = class_type.__swig_getmethods__.get(name,None)
25 if method: return method(self)
26 raise AttributeError,name
27
28import types
29try:
30 _object = types.ObjectType
31 _newclass = 1
32except AttributeError:
33 class _object : pass
34 _newclass = 0
35del types
36
37
38def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
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
c24da6d6
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
d55e5bfc
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
57133d5c 88DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 89DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
d55e5bfc
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
d55e5bfc
RD
96CLIP_CHILDREN = _core_.CLIP_CHILDREN
97CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
98ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
99RETAINED = _core_.RETAINED
100BACKINGSTORE = _core_.BACKINGSTORE
101COLOURED = _core_.COLOURED
102FIXED_LENGTH = _core_.FIXED_LENGTH
103LB_NEEDED_SB = _core_.LB_NEEDED_SB
104LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
105LB_SORT = _core_.LB_SORT
106LB_SINGLE = _core_.LB_SINGLE
107LB_MULTIPLE = _core_.LB_MULTIPLE
108LB_EXTENDED = _core_.LB_EXTENDED
109LB_OWNERDRAW = _core_.LB_OWNERDRAW
110LB_HSCROLL = _core_.LB_HSCROLL
111PROCESS_ENTER = _core_.PROCESS_ENTER
112PASSWORD = _core_.PASSWORD
113CB_SIMPLE = _core_.CB_SIMPLE
114CB_DROPDOWN = _core_.CB_DROPDOWN
115CB_SORT = _core_.CB_SORT
116CB_READONLY = _core_.CB_READONLY
117RA_HORIZONTAL = _core_.RA_HORIZONTAL
118RA_VERTICAL = _core_.RA_VERTICAL
119RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
120RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 121RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
d55e5bfc
RD
122RB_GROUP = _core_.RB_GROUP
123RB_SINGLE = _core_.RB_SINGLE
d55e5bfc
RD
124SB_HORIZONTAL = _core_.SB_HORIZONTAL
125SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 126RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
d55e5bfc
RD
127ST_SIZEGRIP = _core_.ST_SIZEGRIP
128ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
129FLOOD_SURFACE = _core_.FLOOD_SURFACE
130FLOOD_BORDER = _core_.FLOOD_BORDER
131ODDEVEN_RULE = _core_.ODDEVEN_RULE
132WINDING_RULE = _core_.WINDING_RULE
133TOOL_TOP = _core_.TOOL_TOP
134TOOL_BOTTOM = _core_.TOOL_BOTTOM
135TOOL_LEFT = _core_.TOOL_LEFT
136TOOL_RIGHT = _core_.TOOL_RIGHT
137OK = _core_.OK
138YES_NO = _core_.YES_NO
139CANCEL = _core_.CANCEL
140YES = _core_.YES
141NO = _core_.NO
142NO_DEFAULT = _core_.NO_DEFAULT
143YES_DEFAULT = _core_.YES_DEFAULT
144ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
145ICON_HAND = _core_.ICON_HAND
146ICON_QUESTION = _core_.ICON_QUESTION
147ICON_INFORMATION = _core_.ICON_INFORMATION
148ICON_STOP = _core_.ICON_STOP
149ICON_ASTERISK = _core_.ICON_ASTERISK
150ICON_MASK = _core_.ICON_MASK
151ICON_WARNING = _core_.ICON_WARNING
152ICON_ERROR = _core_.ICON_ERROR
153FORWARD = _core_.FORWARD
154BACKWARD = _core_.BACKWARD
155RESET = _core_.RESET
156HELP = _core_.HELP
157MORE = _core_.MORE
158SETUP = _core_.SETUP
159SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
160SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
161SIZE_AUTO = _core_.SIZE_AUTO
162SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
163SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
164PORTRAIT = _core_.PORTRAIT
165LANDSCAPE = _core_.LANDSCAPE
166PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
167PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
168PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
169PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
170ID_ANY = _core_.ID_ANY
171ID_SEPARATOR = _core_.ID_SEPARATOR
172ID_LOWEST = _core_.ID_LOWEST
173ID_OPEN = _core_.ID_OPEN
174ID_CLOSE = _core_.ID_CLOSE
175ID_NEW = _core_.ID_NEW
176ID_SAVE = _core_.ID_SAVE
177ID_SAVEAS = _core_.ID_SAVEAS
178ID_REVERT = _core_.ID_REVERT
179ID_EXIT = _core_.ID_EXIT
180ID_UNDO = _core_.ID_UNDO
181ID_REDO = _core_.ID_REDO
182ID_HELP = _core_.ID_HELP
183ID_PRINT = _core_.ID_PRINT
184ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
185ID_PREVIEW = _core_.ID_PREVIEW
186ID_ABOUT = _core_.ID_ABOUT
187ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
188ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
189ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
190ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
191ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
192ID_PREFERENCES = _core_.ID_PREFERENCES
193ID_CUT = _core_.ID_CUT
194ID_COPY = _core_.ID_COPY
195ID_PASTE = _core_.ID_PASTE
196ID_CLEAR = _core_.ID_CLEAR
197ID_FIND = _core_.ID_FIND
198ID_DUPLICATE = _core_.ID_DUPLICATE
199ID_SELECTALL = _core_.ID_SELECTALL
200ID_DELETE = _core_.ID_DELETE
201ID_REPLACE = _core_.ID_REPLACE
202ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
203ID_PROPERTIES = _core_.ID_PROPERTIES
204ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
205ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
206ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
207ID_VIEW_LIST = _core_.ID_VIEW_LIST
208ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
209ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
210ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
211ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
212ID_FILE1 = _core_.ID_FILE1
213ID_FILE2 = _core_.ID_FILE2
214ID_FILE3 = _core_.ID_FILE3
215ID_FILE4 = _core_.ID_FILE4
216ID_FILE5 = _core_.ID_FILE5
217ID_FILE6 = _core_.ID_FILE6
218ID_FILE7 = _core_.ID_FILE7
219ID_FILE8 = _core_.ID_FILE8
220ID_FILE9 = _core_.ID_FILE9
221ID_OK = _core_.ID_OK
222ID_CANCEL = _core_.ID_CANCEL
223ID_APPLY = _core_.ID_APPLY
224ID_YES = _core_.ID_YES
225ID_NO = _core_.ID_NO
226ID_STATIC = _core_.ID_STATIC
227ID_FORWARD = _core_.ID_FORWARD
228ID_BACKWARD = _core_.ID_BACKWARD
229ID_DEFAULT = _core_.ID_DEFAULT
230ID_MORE = _core_.ID_MORE
231ID_SETUP = _core_.ID_SETUP
232ID_RESET = _core_.ID_RESET
233ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
234ID_YESTOALL = _core_.ID_YESTOALL
235ID_NOTOALL = _core_.ID_NOTOALL
236ID_ABORT = _core_.ID_ABORT
237ID_RETRY = _core_.ID_RETRY
238ID_IGNORE = _core_.ID_IGNORE
0f63ec68
RD
239ID_ADD = _core_.ID_ADD
240ID_REMOVE = _core_.ID_REMOVE
241ID_UP = _core_.ID_UP
242ID_DOWN = _core_.ID_DOWN
243ID_HOME = _core_.ID_HOME
244ID_REFRESH = _core_.ID_REFRESH
245ID_STOP = _core_.ID_STOP
246ID_INDEX = _core_.ID_INDEX
247ID_BOLD = _core_.ID_BOLD
248ID_ITALIC = _core_.ID_ITALIC
249ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
250ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
251ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
252ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
253ID_UNDERLINE = _core_.ID_UNDERLINE
254ID_INDENT = _core_.ID_INDENT
255ID_UNINDENT = _core_.ID_UNINDENT
256ID_ZOOM_100 = _core_.ID_ZOOM_100
257ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
258ID_ZOOM_IN = _core_.ID_ZOOM_IN
259ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
260ID_UNDELETE = _core_.ID_UNDELETE
261ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
d55e5bfc
RD
262ID_HIGHEST = _core_.ID_HIGHEST
263OPEN = _core_.OPEN
264SAVE = _core_.SAVE
265HIDE_READONLY = _core_.HIDE_READONLY
266OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
267FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
268MULTIPLE = _core_.MULTIPLE
269CHANGE_DIR = _core_.CHANGE_DIR
270ACCEL_ALT = _core_.ACCEL_ALT
271ACCEL_CTRL = _core_.ACCEL_CTRL
272ACCEL_SHIFT = _core_.ACCEL_SHIFT
273ACCEL_NORMAL = _core_.ACCEL_NORMAL
274PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
275PD_APP_MODAL = _core_.PD_APP_MODAL
276PD_CAN_ABORT = _core_.PD_CAN_ABORT
277PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
278PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
279PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
62d32a5f
RD
280PD_SMOOTH = _core_.PD_SMOOTH
281PD_CAN_SKIP = _core_.PD_CAN_SKIP
d55e5bfc
RD
282DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
283DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
284MENU_TEAROFF = _core_.MENU_TEAROFF
285MB_DOCKABLE = _core_.MB_DOCKABLE
286NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
287FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
288LI_HORIZONTAL = _core_.LI_HORIZONTAL
289LI_VERTICAL = _core_.LI_VERTICAL
290WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
291WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
292WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
293WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
294WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
295WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
296MM_TEXT = _core_.MM_TEXT
297MM_LOMETRIC = _core_.MM_LOMETRIC
298MM_HIMETRIC = _core_.MM_HIMETRIC
299MM_LOENGLISH = _core_.MM_LOENGLISH
300MM_HIENGLISH = _core_.MM_HIENGLISH
301MM_TWIPS = _core_.MM_TWIPS
302MM_ISOTROPIC = _core_.MM_ISOTROPIC
303MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
304MM_POINTS = _core_.MM_POINTS
305MM_METRIC = _core_.MM_METRIC
306CENTRE = _core_.CENTRE
307CENTER = _core_.CENTER
308HORIZONTAL = _core_.HORIZONTAL
309VERTICAL = _core_.VERTICAL
310BOTH = _core_.BOTH
311LEFT = _core_.LEFT
312RIGHT = _core_.RIGHT
313UP = _core_.UP
314DOWN = _core_.DOWN
315TOP = _core_.TOP
316BOTTOM = _core_.BOTTOM
317NORTH = _core_.NORTH
318SOUTH = _core_.SOUTH
319WEST = _core_.WEST
320EAST = _core_.EAST
321ALL = _core_.ALL
322ALIGN_NOT = _core_.ALIGN_NOT
323ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
324ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
325ALIGN_LEFT = _core_.ALIGN_LEFT
326ALIGN_TOP = _core_.ALIGN_TOP
327ALIGN_RIGHT = _core_.ALIGN_RIGHT
328ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
329ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
330ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
331ALIGN_CENTER = _core_.ALIGN_CENTER
332ALIGN_CENTRE = _core_.ALIGN_CENTRE
333ALIGN_MASK = _core_.ALIGN_MASK
334STRETCH_NOT = _core_.STRETCH_NOT
335SHRINK = _core_.SHRINK
336GROW = _core_.GROW
337EXPAND = _core_.EXPAND
338SHAPED = _core_.SHAPED
339FIXED_MINSIZE = _core_.FIXED_MINSIZE
340TILE = _core_.TILE
341ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
342BORDER_DEFAULT = _core_.BORDER_DEFAULT
343BORDER_NONE = _core_.BORDER_NONE
344BORDER_STATIC = _core_.BORDER_STATIC
345BORDER_SIMPLE = _core_.BORDER_SIMPLE
346BORDER_RAISED = _core_.BORDER_RAISED
347BORDER_SUNKEN = _core_.BORDER_SUNKEN
348BORDER_DOUBLE = _core_.BORDER_DOUBLE
349BORDER_MASK = _core_.BORDER_MASK
0f63ec68
RD
350BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
351BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
352BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
d55e5bfc
RD
353DEFAULT = _core_.DEFAULT
354DECORATIVE = _core_.DECORATIVE
355ROMAN = _core_.ROMAN
356SCRIPT = _core_.SCRIPT
357SWISS = _core_.SWISS
358MODERN = _core_.MODERN
359TELETYPE = _core_.TELETYPE
360VARIABLE = _core_.VARIABLE
361FIXED = _core_.FIXED
362NORMAL = _core_.NORMAL
363LIGHT = _core_.LIGHT
364BOLD = _core_.BOLD
365ITALIC = _core_.ITALIC
366SLANT = _core_.SLANT
367SOLID = _core_.SOLID
368DOT = _core_.DOT
369LONG_DASH = _core_.LONG_DASH
370SHORT_DASH = _core_.SHORT_DASH
371DOT_DASH = _core_.DOT_DASH
372USER_DASH = _core_.USER_DASH
373TRANSPARENT = _core_.TRANSPARENT
374STIPPLE = _core_.STIPPLE
d04418a7
RD
375STIPPLE_MASK = _core_.STIPPLE_MASK
376STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
d55e5bfc
RD
377BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
378CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
379FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
380CROSS_HATCH = _core_.CROSS_HATCH
381HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
382VERTICAL_HATCH = _core_.VERTICAL_HATCH
383JOIN_BEVEL = _core_.JOIN_BEVEL
384JOIN_MITER = _core_.JOIN_MITER
385JOIN_ROUND = _core_.JOIN_ROUND
386CAP_ROUND = _core_.CAP_ROUND
387CAP_PROJECTING = _core_.CAP_PROJECTING
388CAP_BUTT = _core_.CAP_BUTT
389CLEAR = _core_.CLEAR
390XOR = _core_.XOR
391INVERT = _core_.INVERT
392OR_REVERSE = _core_.OR_REVERSE
393AND_REVERSE = _core_.AND_REVERSE
394COPY = _core_.COPY
395AND = _core_.AND
396AND_INVERT = _core_.AND_INVERT
397NO_OP = _core_.NO_OP
398NOR = _core_.NOR
399EQUIV = _core_.EQUIV
400SRC_INVERT = _core_.SRC_INVERT
401OR_INVERT = _core_.OR_INVERT
402NAND = _core_.NAND
403OR = _core_.OR
404SET = _core_.SET
405WXK_BACK = _core_.WXK_BACK
406WXK_TAB = _core_.WXK_TAB
407WXK_RETURN = _core_.WXK_RETURN
408WXK_ESCAPE = _core_.WXK_ESCAPE
409WXK_SPACE = _core_.WXK_SPACE
410WXK_DELETE = _core_.WXK_DELETE
411WXK_START = _core_.WXK_START
412WXK_LBUTTON = _core_.WXK_LBUTTON
413WXK_RBUTTON = _core_.WXK_RBUTTON
414WXK_CANCEL = _core_.WXK_CANCEL
415WXK_MBUTTON = _core_.WXK_MBUTTON
416WXK_CLEAR = _core_.WXK_CLEAR
417WXK_SHIFT = _core_.WXK_SHIFT
418WXK_ALT = _core_.WXK_ALT
419WXK_CONTROL = _core_.WXK_CONTROL
420WXK_MENU = _core_.WXK_MENU
421WXK_PAUSE = _core_.WXK_PAUSE
422WXK_CAPITAL = _core_.WXK_CAPITAL
423WXK_PRIOR = _core_.WXK_PRIOR
424WXK_NEXT = _core_.WXK_NEXT
425WXK_END = _core_.WXK_END
426WXK_HOME = _core_.WXK_HOME
427WXK_LEFT = _core_.WXK_LEFT
428WXK_UP = _core_.WXK_UP
429WXK_RIGHT = _core_.WXK_RIGHT
430WXK_DOWN = _core_.WXK_DOWN
431WXK_SELECT = _core_.WXK_SELECT
432WXK_PRINT = _core_.WXK_PRINT
433WXK_EXECUTE = _core_.WXK_EXECUTE
434WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
435WXK_INSERT = _core_.WXK_INSERT
436WXK_HELP = _core_.WXK_HELP
437WXK_NUMPAD0 = _core_.WXK_NUMPAD0
438WXK_NUMPAD1 = _core_.WXK_NUMPAD1
439WXK_NUMPAD2 = _core_.WXK_NUMPAD2
440WXK_NUMPAD3 = _core_.WXK_NUMPAD3
441WXK_NUMPAD4 = _core_.WXK_NUMPAD4
442WXK_NUMPAD5 = _core_.WXK_NUMPAD5
443WXK_NUMPAD6 = _core_.WXK_NUMPAD6
444WXK_NUMPAD7 = _core_.WXK_NUMPAD7
445WXK_NUMPAD8 = _core_.WXK_NUMPAD8
446WXK_NUMPAD9 = _core_.WXK_NUMPAD9
447WXK_MULTIPLY = _core_.WXK_MULTIPLY
448WXK_ADD = _core_.WXK_ADD
449WXK_SEPARATOR = _core_.WXK_SEPARATOR
450WXK_SUBTRACT = _core_.WXK_SUBTRACT
451WXK_DECIMAL = _core_.WXK_DECIMAL
452WXK_DIVIDE = _core_.WXK_DIVIDE
453WXK_F1 = _core_.WXK_F1
454WXK_F2 = _core_.WXK_F2
455WXK_F3 = _core_.WXK_F3
456WXK_F4 = _core_.WXK_F4
457WXK_F5 = _core_.WXK_F5
458WXK_F6 = _core_.WXK_F6
459WXK_F7 = _core_.WXK_F7
460WXK_F8 = _core_.WXK_F8
461WXK_F9 = _core_.WXK_F9
462WXK_F10 = _core_.WXK_F10
463WXK_F11 = _core_.WXK_F11
464WXK_F12 = _core_.WXK_F12
465WXK_F13 = _core_.WXK_F13
466WXK_F14 = _core_.WXK_F14
467WXK_F15 = _core_.WXK_F15
468WXK_F16 = _core_.WXK_F16
469WXK_F17 = _core_.WXK_F17
470WXK_F18 = _core_.WXK_F18
471WXK_F19 = _core_.WXK_F19
472WXK_F20 = _core_.WXK_F20
473WXK_F21 = _core_.WXK_F21
474WXK_F22 = _core_.WXK_F22
475WXK_F23 = _core_.WXK_F23
476WXK_F24 = _core_.WXK_F24
477WXK_NUMLOCK = _core_.WXK_NUMLOCK
478WXK_SCROLL = _core_.WXK_SCROLL
479WXK_PAGEUP = _core_.WXK_PAGEUP
480WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
481WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
482WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
483WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
484WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
485WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
486WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
487WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
488WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
489WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
490WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
491WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
492WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
493WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
494WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
495WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
496WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
497WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
498WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
499WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
500WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
501WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
502WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
503WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
504WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
505WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
506WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
507WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
508WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
509WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
510WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
511WXK_COMMAND = _core_.WXK_COMMAND
512WXK_SPECIAL1 = _core_.WXK_SPECIAL1
513WXK_SPECIAL2 = _core_.WXK_SPECIAL2
514WXK_SPECIAL3 = _core_.WXK_SPECIAL3
515WXK_SPECIAL4 = _core_.WXK_SPECIAL4
516WXK_SPECIAL5 = _core_.WXK_SPECIAL5
517WXK_SPECIAL6 = _core_.WXK_SPECIAL6
518WXK_SPECIAL7 = _core_.WXK_SPECIAL7
519WXK_SPECIAL8 = _core_.WXK_SPECIAL8
520WXK_SPECIAL9 = _core_.WXK_SPECIAL9
521WXK_SPECIAL10 = _core_.WXK_SPECIAL10
522WXK_SPECIAL11 = _core_.WXK_SPECIAL11
523WXK_SPECIAL12 = _core_.WXK_SPECIAL12
524WXK_SPECIAL13 = _core_.WXK_SPECIAL13
525WXK_SPECIAL14 = _core_.WXK_SPECIAL14
526WXK_SPECIAL15 = _core_.WXK_SPECIAL15
527WXK_SPECIAL16 = _core_.WXK_SPECIAL16
528WXK_SPECIAL17 = _core_.WXK_SPECIAL17
529WXK_SPECIAL18 = _core_.WXK_SPECIAL18
530WXK_SPECIAL19 = _core_.WXK_SPECIAL19
531WXK_SPECIAL20 = _core_.WXK_SPECIAL20
d55e5bfc
RD
532PAPER_NONE = _core_.PAPER_NONE
533PAPER_LETTER = _core_.PAPER_LETTER
534PAPER_LEGAL = _core_.PAPER_LEGAL
535PAPER_A4 = _core_.PAPER_A4
536PAPER_CSHEET = _core_.PAPER_CSHEET
537PAPER_DSHEET = _core_.PAPER_DSHEET
538PAPER_ESHEET = _core_.PAPER_ESHEET
539PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
540PAPER_TABLOID = _core_.PAPER_TABLOID
541PAPER_LEDGER = _core_.PAPER_LEDGER
542PAPER_STATEMENT = _core_.PAPER_STATEMENT
543PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
544PAPER_A3 = _core_.PAPER_A3
545PAPER_A4SMALL = _core_.PAPER_A4SMALL
546PAPER_A5 = _core_.PAPER_A5
547PAPER_B4 = _core_.PAPER_B4
548PAPER_B5 = _core_.PAPER_B5
549PAPER_FOLIO = _core_.PAPER_FOLIO
550PAPER_QUARTO = _core_.PAPER_QUARTO
551PAPER_10X14 = _core_.PAPER_10X14
552PAPER_11X17 = _core_.PAPER_11X17
553PAPER_NOTE = _core_.PAPER_NOTE
554PAPER_ENV_9 = _core_.PAPER_ENV_9
555PAPER_ENV_10 = _core_.PAPER_ENV_10
556PAPER_ENV_11 = _core_.PAPER_ENV_11
557PAPER_ENV_12 = _core_.PAPER_ENV_12
558PAPER_ENV_14 = _core_.PAPER_ENV_14
559PAPER_ENV_DL = _core_.PAPER_ENV_DL
560PAPER_ENV_C5 = _core_.PAPER_ENV_C5
561PAPER_ENV_C3 = _core_.PAPER_ENV_C3
562PAPER_ENV_C4 = _core_.PAPER_ENV_C4
563PAPER_ENV_C6 = _core_.PAPER_ENV_C6
564PAPER_ENV_C65 = _core_.PAPER_ENV_C65
565PAPER_ENV_B4 = _core_.PAPER_ENV_B4
566PAPER_ENV_B5 = _core_.PAPER_ENV_B5
567PAPER_ENV_B6 = _core_.PAPER_ENV_B6
568PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
569PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
570PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
571PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
572PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
573PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
574PAPER_ISO_B4 = _core_.PAPER_ISO_B4
575PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
576PAPER_9X11 = _core_.PAPER_9X11
577PAPER_10X11 = _core_.PAPER_10X11
578PAPER_15X11 = _core_.PAPER_15X11
579PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
580PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
581PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
582PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
583PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
584PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
585PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
586PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
587PAPER_A_PLUS = _core_.PAPER_A_PLUS
588PAPER_B_PLUS = _core_.PAPER_B_PLUS
589PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
590PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
591PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
592PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
593PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
594PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
595PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
596PAPER_A2 = _core_.PAPER_A2
597PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
598PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
599PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
600PAPER_A6 = _core_.PAPER_A6
601PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
602PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
603PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
604PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
605PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
606PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
607PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
608PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
609PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
610PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
611PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
612PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
613PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
614PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
615PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
616PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
617PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
618PAPER_B6_JIS = _core_.PAPER_B6_JIS
619PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
620PAPER_12X11 = _core_.PAPER_12X11
621PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
622PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
623PAPER_P16K = _core_.PAPER_P16K
624PAPER_P32K = _core_.PAPER_P32K
625PAPER_P32KBIG = _core_.PAPER_P32KBIG
626PAPER_PENV_1 = _core_.PAPER_PENV_1
627PAPER_PENV_2 = _core_.PAPER_PENV_2
628PAPER_PENV_3 = _core_.PAPER_PENV_3
629PAPER_PENV_4 = _core_.PAPER_PENV_4
630PAPER_PENV_5 = _core_.PAPER_PENV_5
631PAPER_PENV_6 = _core_.PAPER_PENV_6
632PAPER_PENV_7 = _core_.PAPER_PENV_7
633PAPER_PENV_8 = _core_.PAPER_PENV_8
634PAPER_PENV_9 = _core_.PAPER_PENV_9
635PAPER_PENV_10 = _core_.PAPER_PENV_10
636PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
637PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
638PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
639PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
640PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
641PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
642PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
643PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
644PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
645PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
646PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
647PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
648PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
d55e5bfc
RD
649DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
650DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
651DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
652ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
653ITEM_NORMAL = _core_.ITEM_NORMAL
654ITEM_CHECK = _core_.ITEM_CHECK
655ITEM_RADIO = _core_.ITEM_RADIO
656ITEM_MAX = _core_.ITEM_MAX
657HT_NOWHERE = _core_.HT_NOWHERE
658HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
659HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
660HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
661HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
662HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
663HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
664HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
665HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
666HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
667HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
668HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
669HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
670HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
671HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
672HT_MAX = _core_.HT_MAX
673MOD_NONE = _core_.MOD_NONE
674MOD_ALT = _core_.MOD_ALT
675MOD_CONTROL = _core_.MOD_CONTROL
676MOD_SHIFT = _core_.MOD_SHIFT
677MOD_WIN = _core_.MOD_WIN
678UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
679UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
680UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
681#---------------------------------------------------------------------------
682
683class Object(object):
684 """
685 The base class for most wx objects, although in wxPython not
686 much functionality is needed nor exposed.
687 """
688 def __init__(self): raise RuntimeError, "No constructor defined"
689 def __repr__(self):
690 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
691 def GetClassName(*args, **kwargs):
692 """
693 GetClassName(self) -> String
694
695 Returns the class name of the C++ class using wxRTTI.
696 """
697 return _core_.Object_GetClassName(*args, **kwargs)
698
699 def Destroy(*args, **kwargs):
700 """
701 Destroy(self)
702
703 Deletes the C++ object this Python object is a proxy for.
704 """
705 return _core_.Object_Destroy(*args, **kwargs)
706
707
708class ObjectPtr(Object):
709 def __init__(self, this):
710 self.this = this
711 if not hasattr(self,"thisown"): self.thisown = 0
712 self.__class__ = Object
713_core_.Object_swigregister(ObjectPtr)
714_wxPySetDictionary = _core_._wxPySetDictionary
715
716_wxPyFixStockObjects = _core_._wxPyFixStockObjects
717
718cvar = _core_.cvar
719EmptyString = cvar.EmptyString
720
721#---------------------------------------------------------------------------
722
723BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
724BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
725BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
726BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
727BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
728BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
729BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
730BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
731BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
732BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
733BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
734BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
735BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
736BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
737BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
738BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
739BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
740BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
741BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
742BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
743CURSOR_NONE = _core_.CURSOR_NONE
744CURSOR_ARROW = _core_.CURSOR_ARROW
745CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
746CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
747CURSOR_CHAR = _core_.CURSOR_CHAR
748CURSOR_CROSS = _core_.CURSOR_CROSS
749CURSOR_HAND = _core_.CURSOR_HAND
750CURSOR_IBEAM = _core_.CURSOR_IBEAM
751CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
752CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
753CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
754CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
755CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
756CURSOR_PENCIL = _core_.CURSOR_PENCIL
757CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
758CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
759CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
760CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
761CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
762CURSOR_SIZENS = _core_.CURSOR_SIZENS
763CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
764CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
765CURSOR_SIZING = _core_.CURSOR_SIZING
766CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
767CURSOR_WAIT = _core_.CURSOR_WAIT
768CURSOR_WATCH = _core_.CURSOR_WATCH
769CURSOR_BLANK = _core_.CURSOR_BLANK
770CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
771CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
772CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
773CURSOR_MAX = _core_.CURSOR_MAX
774#---------------------------------------------------------------------------
775
776class Size(object):
777 """
79fccf9d 778 wx.Size is a useful data structure used to represent the size of
093d3ff1
RD
779 something. It simply contians integer width and height
780 proprtites. In most places in wxPython where a wx.Size is
781 expected a (width, height) tuple can be used instead.
d55e5bfc
RD
782 """
783 def __repr__(self):
784 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
785 width = property(_core_.Size_width_get, _core_.Size_width_set)
786 height = property(_core_.Size_height_get, _core_.Size_height_set)
787 x = width; y = height
788 def __init__(self, *args, **kwargs):
789 """
790 __init__(self, int w=0, int h=0) -> Size
791
792 Creates a size object.
793 """
794 newobj = _core_.new_Size(*args, **kwargs)
795 self.this = newobj.this
796 self.thisown = 1
797 del newobj.thisown
798 def __del__(self, destroy=_core_.delete_Size):
799 """__del__(self)"""
800 try:
801 if self.thisown: destroy(self)
802 except: pass
803
804 def __eq__(*args, **kwargs):
805 """
806 __eq__(self, Size sz) -> bool
807
808 Test for equality of wx.Size objects.
809 """
810 return _core_.Size___eq__(*args, **kwargs)
811
812 def __ne__(*args, **kwargs):
813 """
814 __ne__(self, Size sz) -> bool
815
816 Test for inequality.
817 """
818 return _core_.Size___ne__(*args, **kwargs)
819
820 def __add__(*args, **kwargs):
821 """
822 __add__(self, Size sz) -> Size
823
824 Add sz's proprties to this and return the result.
825 """
826 return _core_.Size___add__(*args, **kwargs)
827
828 def __sub__(*args, **kwargs):
829 """
830 __sub__(self, Size sz) -> Size
831
832 Subtract sz's properties from this and return the result.
833 """
834 return _core_.Size___sub__(*args, **kwargs)
835
836 def IncTo(*args, **kwargs):
837 """
838 IncTo(self, Size sz)
839
840 Increments this object so that both of its dimensions are not less
841 than the corresponding dimensions of the size.
842 """
843 return _core_.Size_IncTo(*args, **kwargs)
844
845 def DecTo(*args, **kwargs):
846 """
847 DecTo(self, Size sz)
848
849 Decrements this object so that both of its dimensions are not greater
850 than the corresponding dimensions of the size.
851 """
852 return _core_.Size_DecTo(*args, **kwargs)
853
854 def Set(*args, **kwargs):
855 """
856 Set(self, int w, int h)
857
858 Set both width and height.
859 """
860 return _core_.Size_Set(*args, **kwargs)
861
862 def SetWidth(*args, **kwargs):
863 """SetWidth(self, int w)"""
864 return _core_.Size_SetWidth(*args, **kwargs)
865
866 def SetHeight(*args, **kwargs):
867 """SetHeight(self, int h)"""
868 return _core_.Size_SetHeight(*args, **kwargs)
869
870 def GetWidth(*args, **kwargs):
871 """GetWidth(self) -> int"""
872 return _core_.Size_GetWidth(*args, **kwargs)
873
874 def GetHeight(*args, **kwargs):
875 """GetHeight(self) -> int"""
876 return _core_.Size_GetHeight(*args, **kwargs)
877
878 def IsFullySpecified(*args, **kwargs):
879 """
880 IsFullySpecified(self) -> bool
881
882 Returns True if both components of the size are non-default values.
883 """
884 return _core_.Size_IsFullySpecified(*args, **kwargs)
885
886 def SetDefaults(*args, **kwargs):
887 """
888 SetDefaults(self, Size size)
889
79fccf9d
RD
890 Combine this size with the other one replacing the default components
891 of this object (i.e. equal to -1) with those of the other.
d55e5bfc
RD
892 """
893 return _core_.Size_SetDefaults(*args, **kwargs)
894
895 def Get(*args, **kwargs):
896 """
897 Get() -> (width,height)
898
899 Returns the width and height properties as a tuple.
900 """
901 return _core_.Size_Get(*args, **kwargs)
902
79fccf9d 903 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
904 def __str__(self): return str(self.Get())
905 def __repr__(self): return 'wx.Size'+str(self.Get())
906 def __len__(self): return len(self.Get())
907 def __getitem__(self, index): return self.Get()[index]
908 def __setitem__(self, index, val):
909 if index == 0: self.width = val
910 elif index == 1: self.height = val
911 else: raise IndexError
912 def __nonzero__(self): return self.Get() != (0,0)
913 __safe_for_unpickling__ = True
914 def __reduce__(self): return (wx.Size, self.Get())
915
916
917class SizePtr(Size):
918 def __init__(self, this):
919 self.this = this
920 if not hasattr(self,"thisown"): self.thisown = 0
921 self.__class__ = Size
922_core_.Size_swigregister(SizePtr)
923
924#---------------------------------------------------------------------------
925
926class RealPoint(object):
927 """
79fccf9d
RD
928 A data structure for representing a point or position with floating
929 point x and y properties. In wxPython most places that expect a
930 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc
RD
931 """
932 def __repr__(self):
933 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
934 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
935 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
936 def __init__(self, *args, **kwargs):
937 """
938 __init__(self, double x=0.0, double y=0.0) -> RealPoint
939
940 Create a wx.RealPoint object
941 """
942 newobj = _core_.new_RealPoint(*args, **kwargs)
943 self.this = newobj.this
944 self.thisown = 1
945 del newobj.thisown
946 def __del__(self, destroy=_core_.delete_RealPoint):
947 """__del__(self)"""
948 try:
949 if self.thisown: destroy(self)
950 except: pass
951
952 def __eq__(*args, **kwargs):
953 """
954 __eq__(self, RealPoint pt) -> bool
955
956 Test for equality of wx.RealPoint objects.
957 """
958 return _core_.RealPoint___eq__(*args, **kwargs)
959
960 def __ne__(*args, **kwargs):
961 """
962 __ne__(self, RealPoint pt) -> bool
963
964 Test for inequality of wx.RealPoint objects.
965 """
966 return _core_.RealPoint___ne__(*args, **kwargs)
967
968 def __add__(*args, **kwargs):
969 """
970 __add__(self, RealPoint pt) -> RealPoint
971
972 Add pt's proprties to this and return the result.
973 """
974 return _core_.RealPoint___add__(*args, **kwargs)
975
976 def __sub__(*args, **kwargs):
977 """
978 __sub__(self, RealPoint pt) -> RealPoint
979
980 Subtract pt's proprties from this and return the result
981 """
982 return _core_.RealPoint___sub__(*args, **kwargs)
983
984 def Set(*args, **kwargs):
985 """
986 Set(self, double x, double y)
987
988 Set both the x and y properties
989 """
990 return _core_.RealPoint_Set(*args, **kwargs)
991
992 def Get(*args, **kwargs):
993 """
994 Get() -> (x,y)
995
996 Return the x and y properties as a tuple.
997 """
998 return _core_.RealPoint_Get(*args, **kwargs)
999
79fccf9d 1000 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1001 def __str__(self): return str(self.Get())
1002 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1003 def __len__(self): return len(self.Get())
1004 def __getitem__(self, index): return self.Get()[index]
1005 def __setitem__(self, index, val):
1006 if index == 0: self.x = val
1007 elif index == 1: self.y = val
1008 else: raise IndexError
1009 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1010 __safe_for_unpickling__ = True
1011 def __reduce__(self): return (wx.RealPoint, self.Get())
1012
1013
1014class RealPointPtr(RealPoint):
1015 def __init__(self, this):
1016 self.this = this
1017 if not hasattr(self,"thisown"): self.thisown = 0
1018 self.__class__ = RealPoint
1019_core_.RealPoint_swigregister(RealPointPtr)
1020
1021#---------------------------------------------------------------------------
1022
1023class Point(object):
1024 """
79fccf9d
RD
1025 A data structure for representing a point or position with integer x
1026 and y properties. Most places in wxPython that expect a wx.Point can
1027 also accept a (x,y) tuple.
d55e5bfc
RD
1028 """
1029 def __repr__(self):
1030 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1031 x = property(_core_.Point_x_get, _core_.Point_x_set)
1032 y = property(_core_.Point_y_get, _core_.Point_y_set)
1033 def __init__(self, *args, **kwargs):
1034 """
1035 __init__(self, int x=0, int y=0) -> Point
1036
1037 Create a wx.Point object
1038 """
1039 newobj = _core_.new_Point(*args, **kwargs)
1040 self.this = newobj.this
1041 self.thisown = 1
1042 del newobj.thisown
1043 def __del__(self, destroy=_core_.delete_Point):
1044 """__del__(self)"""
1045 try:
1046 if self.thisown: destroy(self)
1047 except: pass
1048
1049 def __eq__(*args, **kwargs):
1050 """
1051 __eq__(self, Point pt) -> bool
1052
1053 Test for equality of wx.Point objects.
1054 """
1055 return _core_.Point___eq__(*args, **kwargs)
1056
1057 def __ne__(*args, **kwargs):
1058 """
1059 __ne__(self, Point pt) -> bool
1060
1061 Test for inequality of wx.Point objects.
1062 """
1063 return _core_.Point___ne__(*args, **kwargs)
1064
1065 def __add__(*args, **kwargs):
1066 """
1067 __add__(self, Point pt) -> Point
1068
1069 Add pt's proprties to this and return the result.
1070 """
1071 return _core_.Point___add__(*args, **kwargs)
1072
1073 def __sub__(*args, **kwargs):
1074 """
1075 __sub__(self, Point pt) -> Point
1076
1077 Subtract pt's proprties from this and return the result
1078 """
1079 return _core_.Point___sub__(*args, **kwargs)
1080
1081 def __iadd__(*args, **kwargs):
1082 """
1083 __iadd__(self, Point pt) -> Point
1084
1085 Add pt to this object.
1086 """
1087 return _core_.Point___iadd__(*args, **kwargs)
1088
1089 def __isub__(*args, **kwargs):
1090 """
1091 __isub__(self, Point pt) -> Point
1092
1093 Subtract pt from this object.
1094 """
1095 return _core_.Point___isub__(*args, **kwargs)
1096
1097 def Set(*args, **kwargs):
1098 """
1099 Set(self, long x, long y)
1100
1101 Set both the x and y properties
1102 """
1103 return _core_.Point_Set(*args, **kwargs)
1104
1105 def Get(*args, **kwargs):
1106 """
1107 Get() -> (x,y)
1108
1109 Return the x and y properties as a tuple.
1110 """
1111 return _core_.Point_Get(*args, **kwargs)
1112
79fccf9d 1113 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1114 def __str__(self): return str(self.Get())
1115 def __repr__(self): return 'wx.Point'+str(self.Get())
1116 def __len__(self): return len(self.Get())
1117 def __getitem__(self, index): return self.Get()[index]
1118 def __setitem__(self, index, val):
1119 if index == 0: self.x = val
1120 elif index == 1: self.y = val
1121 else: raise IndexError
1122 def __nonzero__(self): return self.Get() != (0,0)
1123 __safe_for_unpickling__ = True
1124 def __reduce__(self): return (wx.Point, self.Get())
1125
1126
1127class PointPtr(Point):
1128 def __init__(self, this):
1129 self.this = this
1130 if not hasattr(self,"thisown"): self.thisown = 0
1131 self.__class__ = Point
1132_core_.Point_swigregister(PointPtr)
1133
1134#---------------------------------------------------------------------------
1135
1136class Rect(object):
1137 """
79fccf9d
RD
1138 A class for representing and manipulating rectangles. It has x, y,
1139 width and height properties. In wxPython most palces that expect a
1140 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc
RD
1141 """
1142 def __repr__(self):
1143 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1144 def __init__(self, *args, **kwargs):
1145 """
1146 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1147
1148 Create a new Rect object.
1149 """
1150 newobj = _core_.new_Rect(*args, **kwargs)
1151 self.this = newobj.this
1152 self.thisown = 1
1153 del newobj.thisown
1154 def __del__(self, destroy=_core_.delete_Rect):
1155 """__del__(self)"""
1156 try:
1157 if self.thisown: destroy(self)
1158 except: pass
1159
1160 def GetX(*args, **kwargs):
1161 """GetX(self) -> int"""
1162 return _core_.Rect_GetX(*args, **kwargs)
1163
1164 def SetX(*args, **kwargs):
1165 """SetX(self, int x)"""
1166 return _core_.Rect_SetX(*args, **kwargs)
1167
1168 def GetY(*args, **kwargs):
1169 """GetY(self) -> int"""
1170 return _core_.Rect_GetY(*args, **kwargs)
1171
1172 def SetY(*args, **kwargs):
1173 """SetY(self, int y)"""
1174 return _core_.Rect_SetY(*args, **kwargs)
1175
1176 def GetWidth(*args, **kwargs):
1177 """GetWidth(self) -> int"""
1178 return _core_.Rect_GetWidth(*args, **kwargs)
1179
1180 def SetWidth(*args, **kwargs):
1181 """SetWidth(self, int w)"""
1182 return _core_.Rect_SetWidth(*args, **kwargs)
1183
1184 def GetHeight(*args, **kwargs):
1185 """GetHeight(self) -> int"""
1186 return _core_.Rect_GetHeight(*args, **kwargs)
1187
1188 def SetHeight(*args, **kwargs):
1189 """SetHeight(self, int h)"""
1190 return _core_.Rect_SetHeight(*args, **kwargs)
1191
1192 def GetPosition(*args, **kwargs):
1193 """GetPosition(self) -> Point"""
1194 return _core_.Rect_GetPosition(*args, **kwargs)
1195
1196 def SetPosition(*args, **kwargs):
1197 """SetPosition(self, Point p)"""
1198 return _core_.Rect_SetPosition(*args, **kwargs)
1199
1200 def GetSize(*args, **kwargs):
1201 """GetSize(self) -> Size"""
1202 return _core_.Rect_GetSize(*args, **kwargs)
1203
1204 def SetSize(*args, **kwargs):
1205 """SetSize(self, Size s)"""
1206 return _core_.Rect_SetSize(*args, **kwargs)
1207
aff4cc5c
RD
1208 def IsEmpty(*args, **kwargs):
1209 """IsEmpty(self) -> bool"""
1210 return _core_.Rect_IsEmpty(*args, **kwargs)
1211
d55e5bfc
RD
1212 def GetTopLeft(*args, **kwargs):
1213 """GetTopLeft(self) -> Point"""
1214 return _core_.Rect_GetTopLeft(*args, **kwargs)
1215
1216 def SetTopLeft(*args, **kwargs):
1217 """SetTopLeft(self, Point p)"""
1218 return _core_.Rect_SetTopLeft(*args, **kwargs)
1219
1220 def GetBottomRight(*args, **kwargs):
1221 """GetBottomRight(self) -> Point"""
1222 return _core_.Rect_GetBottomRight(*args, **kwargs)
1223
1224 def SetBottomRight(*args, **kwargs):
1225 """SetBottomRight(self, Point p)"""
1226 return _core_.Rect_SetBottomRight(*args, **kwargs)
1227
1228 def GetLeft(*args, **kwargs):
1229 """GetLeft(self) -> int"""
1230 return _core_.Rect_GetLeft(*args, **kwargs)
1231
1232 def GetTop(*args, **kwargs):
1233 """GetTop(self) -> int"""
1234 return _core_.Rect_GetTop(*args, **kwargs)
1235
1236 def GetBottom(*args, **kwargs):
1237 """GetBottom(self) -> int"""
1238 return _core_.Rect_GetBottom(*args, **kwargs)
1239
1240 def GetRight(*args, **kwargs):
1241 """GetRight(self) -> int"""
1242 return _core_.Rect_GetRight(*args, **kwargs)
1243
1244 def SetLeft(*args, **kwargs):
1245 """SetLeft(self, int left)"""
1246 return _core_.Rect_SetLeft(*args, **kwargs)
1247
1248 def SetRight(*args, **kwargs):
1249 """SetRight(self, int right)"""
1250 return _core_.Rect_SetRight(*args, **kwargs)
1251
1252 def SetTop(*args, **kwargs):
1253 """SetTop(self, int top)"""
1254 return _core_.Rect_SetTop(*args, **kwargs)
1255
1256 def SetBottom(*args, **kwargs):
1257 """SetBottom(self, int bottom)"""
1258 return _core_.Rect_SetBottom(*args, **kwargs)
1259
1260 position = property(GetPosition, SetPosition)
1261 size = property(GetSize, SetSize)
1262 left = property(GetLeft, SetLeft)
1263 right = property(GetRight, SetRight)
1264 top = property(GetTop, SetTop)
1265 bottom = property(GetBottom, SetBottom)
1266
1267 def Inflate(*args, **kwargs):
1268 """
1269 Inflate(self, int dx, int dy) -> Rect
1270
091fdbfa
RD
1271 Increases the size of the rectangle.
1272
1273 The left border is moved farther left and the right border is moved
1274 farther right by ``dx``. The upper border is moved farther up and the
1275 bottom border is moved farther down by ``dy``. (Note the the width and
1276 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1277 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1278 opposite happens: the rectangle size decreases in the respective
1279 direction.
1280
1281 The change is made to the rectangle inplace, if instead you need a
1282 copy that is inflated, preserving the original then make the copy
1283 first::
1284
1285 copy = wx.Rect(*original)
1286 copy.Inflate(10,15)
1287
1288
d55e5bfc
RD
1289 """
1290 return _core_.Rect_Inflate(*args, **kwargs)
1291
1292 def Deflate(*args, **kwargs):
1293 """
1294 Deflate(self, int dx, int dy) -> Rect
1295
091fdbfa
RD
1296 Decrease the rectangle size. This method is the opposite of `Inflate`
1297 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1298 `Inflate` for a full description.
d55e5bfc
RD
1299 """
1300 return _core_.Rect_Deflate(*args, **kwargs)
1301
1302 def OffsetXY(*args, **kwargs):
1303 """
1304 OffsetXY(self, int dx, int dy)
1305
79fccf9d
RD
1306 Moves the rectangle by the specified offset. If dx is positive, the
1307 rectangle is moved to the right, if dy is positive, it is moved to the
1308 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc
RD
1309 """
1310 return _core_.Rect_OffsetXY(*args, **kwargs)
1311
1312 def Offset(*args, **kwargs):
1313 """
1314 Offset(self, Point pt)
1315
1316 Same as OffsetXY but uses dx,dy from Point
1317 """
1318 return _core_.Rect_Offset(*args, **kwargs)
1319
1320 def Intersect(*args, **kwargs):
1321 """
1322 Intersect(self, Rect rect) -> Rect
1323
b519803b 1324 Returns the intersectsion of this rectangle and rect.
d55e5bfc
RD
1325 """
1326 return _core_.Rect_Intersect(*args, **kwargs)
1327
b519803b
RD
1328 def Union(*args, **kwargs):
1329 """
1330 Union(self, Rect rect) -> Rect
1331
1332 Returns the union of this rectangle and rect.
1333 """
1334 return _core_.Rect_Union(*args, **kwargs)
1335
d55e5bfc
RD
1336 def __add__(*args, **kwargs):
1337 """
1338 __add__(self, Rect rect) -> Rect
1339
1340 Add the properties of rect to this rectangle and return the result.
1341 """
1342 return _core_.Rect___add__(*args, **kwargs)
1343
1344 def __iadd__(*args, **kwargs):
1345 """
1346 __iadd__(self, Rect rect) -> Rect
1347
1348 Add the properties of rect to this rectangle, updating this rectangle.
1349 """
1350 return _core_.Rect___iadd__(*args, **kwargs)
1351
1352 def __eq__(*args, **kwargs):
1353 """
1354 __eq__(self, Rect rect) -> bool
1355
1356 Test for equality.
1357 """
1358 return _core_.Rect___eq__(*args, **kwargs)
1359
1360 def __ne__(*args, **kwargs):
1361 """
1362 __ne__(self, Rect rect) -> bool
1363
1364 Test for inequality.
1365 """
1366 return _core_.Rect___ne__(*args, **kwargs)
1367
1368 def InsideXY(*args, **kwargs):
1369 """
1370 InsideXY(self, int x, int y) -> bool
1371
1372 Return True if the point is (not strcitly) inside the rect.
1373 """
1374 return _core_.Rect_InsideXY(*args, **kwargs)
1375
1376 def Inside(*args, **kwargs):
1377 """
1378 Inside(self, Point pt) -> bool
1379
1380 Return True if the point is (not strcitly) inside the rect.
1381 """
1382 return _core_.Rect_Inside(*args, **kwargs)
1383
1384 def Intersects(*args, **kwargs):
1385 """
1386 Intersects(self, Rect rect) -> bool
1387
1388 Returns True if the rectangles have a non empty intersection.
1389 """
1390 return _core_.Rect_Intersects(*args, **kwargs)
1391
1392 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1393 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1394 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1395 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1396 def Set(*args, **kwargs):
1397 """
1398 Set(self, int x=0, int y=0, int width=0, int height=0)
1399
1400 Set all rectangle properties.
1401 """
1402 return _core_.Rect_Set(*args, **kwargs)
1403
1404 def Get(*args, **kwargs):
1405 """
1406 Get() -> (x,y,width,height)
1407
1408 Return the rectangle properties as a tuple.
1409 """
1410 return _core_.Rect_Get(*args, **kwargs)
1411
79fccf9d 1412 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1413 def __str__(self): return str(self.Get())
1414 def __repr__(self): return 'wx.Rect'+str(self.Get())
1415 def __len__(self): return len(self.Get())
1416 def __getitem__(self, index): return self.Get()[index]
1417 def __setitem__(self, index, val):
1418 if index == 0: self.x = val
1419 elif index == 1: self.y = val
1420 elif index == 2: self.width = val
1421 elif index == 3: self.height = val
1422 else: raise IndexError
1423 def __nonzero__(self): return self.Get() != (0,0,0,0)
1424 __safe_for_unpickling__ = True
1425 def __reduce__(self): return (wx.Rect, self.Get())
1426
1427
1428class RectPtr(Rect):
1429 def __init__(self, this):
1430 self.this = this
1431 if not hasattr(self,"thisown"): self.thisown = 0
1432 self.__class__ = Rect
1433_core_.Rect_swigregister(RectPtr)
1434
1435def RectPP(*args, **kwargs):
1436 """
1437 RectPP(Point topLeft, Point bottomRight) -> Rect
1438
1439 Create a new Rect object from Points representing two corners.
1440 """
1441 val = _core_.new_RectPP(*args, **kwargs)
1442 val.thisown = 1
1443 return val
1444
1445def RectPS(*args, **kwargs):
1446 """
1447 RectPS(Point pos, Size size) -> Rect
1448
1449 Create a new Rect from a position and size.
1450 """
1451 val = _core_.new_RectPS(*args, **kwargs)
1452 val.thisown = 1
1453 return val
1454
c1cb24a4
RD
1455def RectS(*args, **kwargs):
1456 """
1457 RectS(Size size) -> Rect
1458
1459 Create a new Rect from a size only.
1460 """
1461 val = _core_.new_RectS(*args, **kwargs)
1462 val.thisown = 1
1463 return val
1464
d55e5bfc
RD
1465
1466def IntersectRect(*args, **kwargs):
1467 """
1468 IntersectRect(Rect r1, Rect r2) -> Rect
1469
1470 Calculate and return the intersection of r1 and r2.
1471 """
1472 return _core_.IntersectRect(*args, **kwargs)
1473#---------------------------------------------------------------------------
1474
1475class Point2D(object):
79fccf9d
RD
1476 """
1477 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1478 with floating point values.
1479 """
d55e5bfc
RD
1480 def __repr__(self):
1481 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1482 def __init__(self, *args, **kwargs):
1483 """
1484 __init__(self, double x=0.0, double y=0.0) -> Point2D
1485
1486 Create a w.Point2D object.
1487 """
1488 newobj = _core_.new_Point2D(*args, **kwargs)
1489 self.this = newobj.this
1490 self.thisown = 1
1491 del newobj.thisown
1492 def GetFloor(*args, **kwargs):
a8eff060
RD
1493 """
1494 GetFloor() -> (x,y)
1495
1496 Convert to integer
1497 """
d55e5bfc
RD
1498 return _core_.Point2D_GetFloor(*args, **kwargs)
1499
1500 def GetRounded(*args, **kwargs):
a8eff060
RD
1501 """
1502 GetRounded() -> (x,y)
1503
1504 Convert to integer
1505 """
d55e5bfc
RD
1506 return _core_.Point2D_GetRounded(*args, **kwargs)
1507
1508 def GetVectorLength(*args, **kwargs):
1509 """GetVectorLength(self) -> double"""
1510 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1511
1512 def GetVectorAngle(*args, **kwargs):
1513 """GetVectorAngle(self) -> double"""
1514 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1515
1516 def SetVectorLength(*args, **kwargs):
1517 """SetVectorLength(self, double length)"""
1518 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1519
1520 def SetVectorAngle(*args, **kwargs):
1521 """SetVectorAngle(self, double degrees)"""
1522 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1523
1524 def SetPolarCoordinates(self, angle, length):
1525 self.SetVectorLength(length)
1526 self.SetVectorAngle(angle)
1527 def Normalize(self):
1528 self.SetVectorLength(1.0)
1529
1530 def GetDistance(*args, **kwargs):
1531 """GetDistance(self, Point2D pt) -> double"""
1532 return _core_.Point2D_GetDistance(*args, **kwargs)
1533
1534 def GetDistanceSquare(*args, **kwargs):
1535 """GetDistanceSquare(self, Point2D pt) -> double"""
1536 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1537
1538 def GetDotProduct(*args, **kwargs):
1539 """GetDotProduct(self, Point2D vec) -> double"""
1540 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1541
1542 def GetCrossProduct(*args, **kwargs):
1543 """GetCrossProduct(self, Point2D vec) -> double"""
1544 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1545
1546 def __neg__(*args, **kwargs):
1547 """
1548 __neg__(self) -> Point2D
1549
1550 the reflection of this point
1551 """
1552 return _core_.Point2D___neg__(*args, **kwargs)
1553
1554 def __iadd__(*args, **kwargs):
1555 """__iadd__(self, Point2D pt) -> Point2D"""
1556 return _core_.Point2D___iadd__(*args, **kwargs)
1557
1558 def __isub__(*args, **kwargs):
1559 """__isub__(self, Point2D pt) -> Point2D"""
1560 return _core_.Point2D___isub__(*args, **kwargs)
1561
1562 def __imul__(*args, **kwargs):
1563 """__imul__(self, Point2D pt) -> Point2D"""
1564 return _core_.Point2D___imul__(*args, **kwargs)
1565
1566 def __idiv__(*args, **kwargs):
1567 """__idiv__(self, Point2D pt) -> Point2D"""
1568 return _core_.Point2D___idiv__(*args, **kwargs)
1569
1570 def __eq__(*args, **kwargs):
1571 """
1572 __eq__(self, Point2D pt) -> bool
1573
1574 Test for equality
1575 """
1576 return _core_.Point2D___eq__(*args, **kwargs)
1577
1578 def __ne__(*args, **kwargs):
1579 """
1580 __ne__(self, Point2D pt) -> bool
1581
1582 Test for inequality
1583 """
1584 return _core_.Point2D___ne__(*args, **kwargs)
1585
1586 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1587 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1588 def Set(*args, **kwargs):
1589 """Set(self, double x=0, double y=0)"""
1590 return _core_.Point2D_Set(*args, **kwargs)
1591
1592 def Get(*args, **kwargs):
1593 """
1594 Get() -> (x,y)
1595
1596 Return x and y properties as a tuple.
1597 """
1598 return _core_.Point2D_Get(*args, **kwargs)
1599
79fccf9d 1600 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1601 def __str__(self): return str(self.Get())
1602 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1603 def __len__(self): return len(self.Get())
1604 def __getitem__(self, index): return self.Get()[index]
1605 def __setitem__(self, index, val):
1606 if index == 0: self.x = val
1607 elif index == 1: self.y = val
1608 else: raise IndexError
1609 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1610 __safe_for_unpickling__ = True
1611 def __reduce__(self): return (wx.Point2D, self.Get())
1612
1613
1614class Point2DPtr(Point2D):
1615 def __init__(self, this):
1616 self.this = this
1617 if not hasattr(self,"thisown"): self.thisown = 0
1618 self.__class__ = Point2D
1619_core_.Point2D_swigregister(Point2DPtr)
1620
1621def Point2DCopy(*args, **kwargs):
1622 """
1623 Point2DCopy(Point2D pt) -> Point2D
1624
1625 Create a w.Point2D object.
1626 """
1627 val = _core_.new_Point2DCopy(*args, **kwargs)
1628 val.thisown = 1
1629 return val
1630
1631def Point2DFromPoint(*args, **kwargs):
1632 """
1633 Point2DFromPoint(Point pt) -> Point2D
1634
1635 Create a w.Point2D object.
1636 """
1637 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1638 val.thisown = 1
1639 return val
1640
1641#---------------------------------------------------------------------------
1642
1643FromStart = _core_.FromStart
1644FromCurrent = _core_.FromCurrent
1645FromEnd = _core_.FromEnd
1646class InputStream(object):
093d3ff1 1647 """Proxy of C++ InputStream class"""
d55e5bfc
RD
1648 def __repr__(self):
1649 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1650 def __init__(self, *args, **kwargs):
1651 """__init__(self, PyObject p) -> InputStream"""
1652 newobj = _core_.new_InputStream(*args, **kwargs)
1653 self.this = newobj.this
1654 self.thisown = 1
1655 del newobj.thisown
8fb0e70a
RD
1656 def __del__(self, destroy=_core_.delete_InputStream):
1657 """__del__(self)"""
1658 try:
1659 if self.thisown: destroy(self)
1660 except: pass
1661
d55e5bfc
RD
1662 def close(*args, **kwargs):
1663 """close(self)"""
1664 return _core_.InputStream_close(*args, **kwargs)
1665
1666 def flush(*args, **kwargs):
1667 """flush(self)"""
1668 return _core_.InputStream_flush(*args, **kwargs)
1669
1670 def eof(*args, **kwargs):
1671 """eof(self) -> bool"""
1672 return _core_.InputStream_eof(*args, **kwargs)
1673
1674 def read(*args, **kwargs):
1675 """read(self, int size=-1) -> PyObject"""
1676 return _core_.InputStream_read(*args, **kwargs)
1677
1678 def readline(*args, **kwargs):
1679 """readline(self, int size=-1) -> PyObject"""
1680 return _core_.InputStream_readline(*args, **kwargs)
1681
1682 def readlines(*args, **kwargs):
1683 """readlines(self, int sizehint=-1) -> PyObject"""
1684 return _core_.InputStream_readlines(*args, **kwargs)
1685
1686 def seek(*args, **kwargs):
1687 """seek(self, int offset, int whence=0)"""
1688 return _core_.InputStream_seek(*args, **kwargs)
1689
1690 def tell(*args, **kwargs):
1691 """tell(self) -> int"""
1692 return _core_.InputStream_tell(*args, **kwargs)
1693
1694 def Peek(*args, **kwargs):
1695 """Peek(self) -> char"""
1696 return _core_.InputStream_Peek(*args, **kwargs)
1697
1698 def GetC(*args, **kwargs):
1699 """GetC(self) -> char"""
1700 return _core_.InputStream_GetC(*args, **kwargs)
1701
1702 def LastRead(*args, **kwargs):
1703 """LastRead(self) -> size_t"""
1704 return _core_.InputStream_LastRead(*args, **kwargs)
1705
1706 def CanRead(*args, **kwargs):
1707 """CanRead(self) -> bool"""
1708 return _core_.InputStream_CanRead(*args, **kwargs)
1709
1710 def Eof(*args, **kwargs):
1711 """Eof(self) -> bool"""
1712 return _core_.InputStream_Eof(*args, **kwargs)
1713
1714 def Ungetch(*args, **kwargs):
1715 """Ungetch(self, char c) -> bool"""
1716 return _core_.InputStream_Ungetch(*args, **kwargs)
1717
1718 def SeekI(*args, **kwargs):
1719 """SeekI(self, long pos, int mode=FromStart) -> long"""
1720 return _core_.InputStream_SeekI(*args, **kwargs)
1721
1722 def TellI(*args, **kwargs):
1723 """TellI(self) -> long"""
1724 return _core_.InputStream_TellI(*args, **kwargs)
1725
1726
1727class InputStreamPtr(InputStream):
1728 def __init__(self, this):
1729 self.this = this
1730 if not hasattr(self,"thisown"): self.thisown = 0
1731 self.__class__ = InputStream
1732_core_.InputStream_swigregister(InputStreamPtr)
1733DefaultPosition = cvar.DefaultPosition
1734DefaultSize = cvar.DefaultSize
1735
1736class OutputStream(object):
093d3ff1 1737 """Proxy of C++ OutputStream class"""
d55e5bfc
RD
1738 def __init__(self): raise RuntimeError, "No constructor defined"
1739 def __repr__(self):
1740 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1741 def write(*args, **kwargs):
1742 """write(self, PyObject obj)"""
1743 return _core_.OutputStream_write(*args, **kwargs)
1744
1745
1746class OutputStreamPtr(OutputStream):
1747 def __init__(self, this):
1748 self.this = this
1749 if not hasattr(self,"thisown"): self.thisown = 0
1750 self.__class__ = OutputStream
1751_core_.OutputStream_swigregister(OutputStreamPtr)
1752
1753#---------------------------------------------------------------------------
1754
1755class FSFile(Object):
093d3ff1 1756 """Proxy of C++ FSFile class"""
d55e5bfc
RD
1757 def __repr__(self):
1758 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1759 def __init__(self, *args, **kwargs):
1760 """
1761 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1762 DateTime modif) -> FSFile
1763 """
1764 newobj = _core_.new_FSFile(*args, **kwargs)
1765 self.this = newobj.this
1766 self.thisown = 1
1767 del newobj.thisown
e2950dbb 1768 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1769
d55e5bfc
RD
1770 def __del__(self, destroy=_core_.delete_FSFile):
1771 """__del__(self)"""
1772 try:
1773 if self.thisown: destroy(self)
1774 except: pass
1775
1776 def GetStream(*args, **kwargs):
1777 """GetStream(self) -> InputStream"""
1778 return _core_.FSFile_GetStream(*args, **kwargs)
1779
1780 def GetMimeType(*args, **kwargs):
1781 """GetMimeType(self) -> String"""
1782 return _core_.FSFile_GetMimeType(*args, **kwargs)
1783
1784 def GetLocation(*args, **kwargs):
1785 """GetLocation(self) -> String"""
1786 return _core_.FSFile_GetLocation(*args, **kwargs)
1787
1788 def GetAnchor(*args, **kwargs):
1789 """GetAnchor(self) -> String"""
1790 return _core_.FSFile_GetAnchor(*args, **kwargs)
1791
1792 def GetModificationTime(*args, **kwargs):
1793 """GetModificationTime(self) -> DateTime"""
1794 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1795
1796
1797class FSFilePtr(FSFile):
1798 def __init__(self, this):
1799 self.this = this
1800 if not hasattr(self,"thisown"): self.thisown = 0
1801 self.__class__ = FSFile
1802_core_.FSFile_swigregister(FSFilePtr)
1803
1804class CPPFileSystemHandler(object):
093d3ff1 1805 """Proxy of C++ CPPFileSystemHandler class"""
d55e5bfc
RD
1806 def __init__(self): raise RuntimeError, "No constructor defined"
1807 def __repr__(self):
1808 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1809
1810class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1811 def __init__(self, this):
1812 self.this = this
1813 if not hasattr(self,"thisown"): self.thisown = 0
1814 self.__class__ = CPPFileSystemHandler
1815_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
1816
1817class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1818 """Proxy of C++ FileSystemHandler class"""
d55e5bfc
RD
1819 def __repr__(self):
1820 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1821 def __init__(self, *args, **kwargs):
1822 """__init__(self) -> FileSystemHandler"""
1823 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
1824 self.this = newobj.this
1825 self.thisown = 1
1826 del newobj.thisown
1827 self._setCallbackInfo(self, FileSystemHandler)
1828
1829 def _setCallbackInfo(*args, **kwargs):
1830 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1831 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1832
1833 def CanOpen(*args, **kwargs):
1834 """CanOpen(self, String location) -> bool"""
1835 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1836
1837 def OpenFile(*args, **kwargs):
1838 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1839 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1840
1841 def FindFirst(*args, **kwargs):
1842 """FindFirst(self, String spec, int flags=0) -> String"""
1843 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1844
1845 def FindNext(*args, **kwargs):
1846 """FindNext(self) -> String"""
1847 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1848
1849 def GetProtocol(*args, **kwargs):
1850 """GetProtocol(self, String location) -> String"""
1851 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1852
1853 def GetLeftLocation(*args, **kwargs):
1854 """GetLeftLocation(self, String location) -> String"""
1855 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1856
1857 def GetAnchor(*args, **kwargs):
1858 """GetAnchor(self, String location) -> String"""
1859 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1860
1861 def GetRightLocation(*args, **kwargs):
1862 """GetRightLocation(self, String location) -> String"""
1863 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1864
1865 def GetMimeTypeFromExt(*args, **kwargs):
1866 """GetMimeTypeFromExt(self, String location) -> String"""
1867 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1868
1869
1870class FileSystemHandlerPtr(FileSystemHandler):
1871 def __init__(self, this):
1872 self.this = this
1873 if not hasattr(self,"thisown"): self.thisown = 0
1874 self.__class__ = FileSystemHandler
1875_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
1876
1877class FileSystem(Object):
093d3ff1 1878 """Proxy of C++ FileSystem class"""
d55e5bfc
RD
1879 def __repr__(self):
1880 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1881 def __init__(self, *args, **kwargs):
1882 """__init__(self) -> FileSystem"""
1883 newobj = _core_.new_FileSystem(*args, **kwargs)
1884 self.this = newobj.this
1885 self.thisown = 1
1886 del newobj.thisown
1887 def __del__(self, destroy=_core_.delete_FileSystem):
1888 """__del__(self)"""
1889 try:
1890 if self.thisown: destroy(self)
1891 except: pass
1892
1893 def ChangePathTo(*args, **kwargs):
1894 """ChangePathTo(self, String location, bool is_dir=False)"""
1895 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1896
1897 def GetPath(*args, **kwargs):
1898 """GetPath(self) -> String"""
1899 return _core_.FileSystem_GetPath(*args, **kwargs)
1900
1901 def OpenFile(*args, **kwargs):
1902 """OpenFile(self, String location) -> FSFile"""
1903 return _core_.FileSystem_OpenFile(*args, **kwargs)
1904
1905 def FindFirst(*args, **kwargs):
1906 """FindFirst(self, String spec, int flags=0) -> String"""
1907 return _core_.FileSystem_FindFirst(*args, **kwargs)
1908
1909 def FindNext(*args, **kwargs):
1910 """FindNext(self) -> String"""
1911 return _core_.FileSystem_FindNext(*args, **kwargs)
1912
1913 def AddHandler(*args, **kwargs):
c24da6d6 1914 """AddHandler(CPPFileSystemHandler handler)"""
d55e5bfc
RD
1915 return _core_.FileSystem_AddHandler(*args, **kwargs)
1916
1917 AddHandler = staticmethod(AddHandler)
1918 def CleanUpHandlers(*args, **kwargs):
c24da6d6 1919 """CleanUpHandlers()"""
d55e5bfc
RD
1920 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1921
1922 CleanUpHandlers = staticmethod(CleanUpHandlers)
1923 def FileNameToURL(*args, **kwargs):
c24da6d6 1924 """FileNameToURL(String filename) -> String"""
d55e5bfc
RD
1925 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1926
1927 FileNameToURL = staticmethod(FileNameToURL)
ae8162c8
RD
1928 def URLToFileName(*args, **kwargs):
1929 """URLToFileName(String url) -> String"""
1930 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1931
1932 URLToFileName = staticmethod(URLToFileName)
d55e5bfc
RD
1933
1934class FileSystemPtr(FileSystem):
1935 def __init__(self, this):
1936 self.this = this
1937 if not hasattr(self,"thisown"): self.thisown = 0
1938 self.__class__ = FileSystem
1939_core_.FileSystem_swigregister(FileSystemPtr)
1940
1941def FileSystem_AddHandler(*args, **kwargs):
1942 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1943 return _core_.FileSystem_AddHandler(*args, **kwargs)
1944
1945def FileSystem_CleanUpHandlers(*args, **kwargs):
1946 """FileSystem_CleanUpHandlers()"""
1947 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1948
1949def FileSystem_FileNameToURL(*args, **kwargs):
1950 """FileSystem_FileNameToURL(String filename) -> String"""
1951 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1952
d55e5bfc
RD
1953def FileSystem_URLToFileName(*args, **kwargs):
1954 """FileSystem_URLToFileName(String url) -> String"""
1955 return _core_.FileSystem_URLToFileName(*args, **kwargs)
ae8162c8 1956
d55e5bfc 1957class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1958 """Proxy of C++ InternetFSHandler class"""
d55e5bfc
RD
1959 def __repr__(self):
1960 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1961 def __init__(self, *args, **kwargs):
1962 """__init__(self) -> InternetFSHandler"""
1963 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
1964 self.this = newobj.this
1965 self.thisown = 1
1966 del newobj.thisown
1967 def CanOpen(*args, **kwargs):
1968 """CanOpen(self, String location) -> bool"""
1969 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1970
1971 def OpenFile(*args, **kwargs):
1972 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1973 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1974
1975
1976class InternetFSHandlerPtr(InternetFSHandler):
1977 def __init__(self, this):
1978 self.this = this
1979 if not hasattr(self,"thisown"): self.thisown = 0
1980 self.__class__ = InternetFSHandler
1981_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
1982
1983class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1984 """Proxy of C++ ZipFSHandler class"""
d55e5bfc
RD
1985 def __repr__(self):
1986 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1987 def __init__(self, *args, **kwargs):
1988 """__init__(self) -> ZipFSHandler"""
1989 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
1990 self.this = newobj.this
1991 self.thisown = 1
1992 del newobj.thisown
1993 def CanOpen(*args, **kwargs):
1994 """CanOpen(self, String location) -> bool"""
1995 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1996
1997 def OpenFile(*args, **kwargs):
1998 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1999 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
2000
2001 def FindFirst(*args, **kwargs):
2002 """FindFirst(self, String spec, int flags=0) -> String"""
2003 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
2004
2005 def FindNext(*args, **kwargs):
2006 """FindNext(self) -> String"""
2007 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
2008
2009
2010class ZipFSHandlerPtr(ZipFSHandler):
2011 def __init__(self, this):
2012 self.this = this
2013 if not hasattr(self,"thisown"): self.thisown = 0
2014 self.__class__ = ZipFSHandler
2015_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
2016
2017
2018def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
2019 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2020 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
2021
2022def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
2023 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2024 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
2025
2026def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
2027 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2028 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
ae8162c8
RD
2029def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2030 """
2031 Add 'file' to the memory filesystem. The dataItem parameter can
2032 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2033 arbitrary data. If a bitmap or image is used then the imgType
2034 parameter should specify what kind of image file it should be
2035 written as, wx.BITMAP_TYPE_PNG, etc.
2036 """
2037 if isinstance(dataItem, wx.Image):
2038 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2039 elif isinstance(dataItem, wx.Bitmap):
2040 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2041 elif type(dataItem) == str:
2042 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2043 else:
2044 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc
RD
2045
2046class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 2047 """Proxy of C++ MemoryFSHandler class"""
d55e5bfc
RD
2048 def __repr__(self):
2049 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2050 def __init__(self, *args, **kwargs):
2051 """__init__(self) -> MemoryFSHandler"""
2052 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
2053 self.this = newobj.this
2054 self.thisown = 1
2055 del newobj.thisown
2056 def RemoveFile(*args, **kwargs):
c24da6d6 2057 """RemoveFile(String filename)"""
d55e5bfc
RD
2058 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2059
2060 RemoveFile = staticmethod(RemoveFile)
2061 AddFile = staticmethod(MemoryFSHandler_AddFile)
2062 def CanOpen(*args, **kwargs):
2063 """CanOpen(self, String location) -> bool"""
2064 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2065
2066 def OpenFile(*args, **kwargs):
2067 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2068 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2069
2070 def FindFirst(*args, **kwargs):
2071 """FindFirst(self, String spec, int flags=0) -> String"""
2072 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2073
2074 def FindNext(*args, **kwargs):
2075 """FindNext(self) -> String"""
2076 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2077
2078
2079class MemoryFSHandlerPtr(MemoryFSHandler):
2080 def __init__(self, this):
2081 self.this = this
2082 if not hasattr(self,"thisown"): self.thisown = 0
2083 self.__class__ = MemoryFSHandler
2084_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
2085
2086def MemoryFSHandler_RemoveFile(*args, **kwargs):
2087 """MemoryFSHandler_RemoveFile(String filename)"""
2088 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2089
57133d5c
RD
2090IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2091IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2092IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
2093#---------------------------------------------------------------------------
2094
2095class ImageHandler(Object):
27fb7603
RD
2096 """
2097 This is the base class for implementing image file loading/saving, and
2098 image creation from data. It is used within `wx.Image` and is not
2099 normally seen by the application.
2100 """
d55e5bfc
RD
2101 def __init__(self): raise RuntimeError, "No constructor defined"
2102 def __repr__(self):
2103 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2104 def GetName(*args, **kwargs):
2105 """GetName(self) -> String"""
2106 return _core_.ImageHandler_GetName(*args, **kwargs)
2107
2108 def GetExtension(*args, **kwargs):
2109 """GetExtension(self) -> String"""
2110 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2111
2112 def GetType(*args, **kwargs):
2113 """GetType(self) -> long"""
2114 return _core_.ImageHandler_GetType(*args, **kwargs)
2115
2116 def GetMimeType(*args, **kwargs):
2117 """GetMimeType(self) -> String"""
2118 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2119
2120 def CanRead(*args, **kwargs):
2121 """CanRead(self, String name) -> bool"""
2122 return _core_.ImageHandler_CanRead(*args, **kwargs)
2123
2124 def SetName(*args, **kwargs):
2125 """SetName(self, String name)"""
2126 return _core_.ImageHandler_SetName(*args, **kwargs)
2127
2128 def SetExtension(*args, **kwargs):
2129 """SetExtension(self, String extension)"""
2130 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2131
2132 def SetType(*args, **kwargs):
2133 """SetType(self, long type)"""
2134 return _core_.ImageHandler_SetType(*args, **kwargs)
2135
2136 def SetMimeType(*args, **kwargs):
2137 """SetMimeType(self, String mimetype)"""
2138 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2139
2140
2141class ImageHandlerPtr(ImageHandler):
2142 def __init__(self, this):
2143 self.this = this
2144 if not hasattr(self,"thisown"): self.thisown = 0
2145 self.__class__ = ImageHandler
2146_core_.ImageHandler_swigregister(ImageHandlerPtr)
2147
2148class ImageHistogram(object):
093d3ff1 2149 """Proxy of C++ ImageHistogram class"""
d55e5bfc
RD
2150 def __repr__(self):
2151 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2152 def __init__(self, *args, **kwargs):
2153 """__init__(self) -> ImageHistogram"""
2154 newobj = _core_.new_ImageHistogram(*args, **kwargs)
2155 self.this = newobj.this
2156 self.thisown = 1
2157 del newobj.thisown
2158 def MakeKey(*args, **kwargs):
2159 """
7a27cf7c 2160 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2161
2162 Get the key in the histogram for the given RGB values
2163 """
2164 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2165
2166 MakeKey = staticmethod(MakeKey)
2167 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2168 """
2169 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2170
2171 Find first colour that is not used in the image and has higher RGB
2172 values than startR, startG, startB. Returns a tuple consisting of a
2173 success flag and rgb values.
2174 """
d55e5bfc
RD
2175 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2176
f1cbd8fa
RD
2177 def GetCount(*args, **kwargs):
2178 """
2179 GetCount(self, unsigned long key) -> unsigned long
2180
2181 Returns the pixel count for the given key. Use `MakeKey` to create a
2182 key value from a RGB tripple.
2183 """
2184 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2185
2186 def GetCountRGB(*args, **kwargs):
2187 """
7a27cf7c 2188 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2189
2190 Returns the pixel count for the given RGB values.
2191 """
2192 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2193
2194 def GetCountColour(*args, **kwargs):
2195 """
2196 GetCountColour(self, Colour colour) -> unsigned long
2197
2198 Returns the pixel count for the given `wx.Colour` value.
2199 """
2200 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2201
d55e5bfc
RD
2202
2203class ImageHistogramPtr(ImageHistogram):
2204 def __init__(self, this):
2205 self.this = this
2206 if not hasattr(self,"thisown"): self.thisown = 0
2207 self.__class__ = ImageHistogram
2208_core_.ImageHistogram_swigregister(ImageHistogramPtr)
2209
2210def ImageHistogram_MakeKey(*args, **kwargs):
2211 """
7a27cf7c 2212 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2213
2214 Get the key in the histogram for the given RGB values
2215 """
2216 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2217
2f91e3df
KO
2218class Image_RGBValue(object):
2219 """Proxy of C++ Image_RGBValue class"""
2220 def __repr__(self):
2221 return "<%s.%s; proxy of C++ wxImage_RGBValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2222 def __init__(self, *args, **kwargs):
2223 """__init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue"""
2224 newobj = _core_.new_Image_RGBValue(*args, **kwargs)
2225 self.this = newobj.this
2226 self.thisown = 1
2227 del newobj.thisown
2228 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2229 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2230 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2231
2232class Image_RGBValuePtr(Image_RGBValue):
2233 def __init__(self, this):
2234 self.this = this
2235 if not hasattr(self,"thisown"): self.thisown = 0
2236 self.__class__ = Image_RGBValue
2237_core_.Image_RGBValue_swigregister(Image_RGBValuePtr)
2238
2239class Image_HSVValue(object):
2240 """Proxy of C++ Image_HSVValue class"""
2241 def __repr__(self):
2242 return "<%s.%s; proxy of C++ wxImage_HSVValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2243 def __init__(self, *args, **kwargs):
2244 """__init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue"""
2245 newobj = _core_.new_Image_HSVValue(*args, **kwargs)
2246 self.this = newobj.this
2247 self.thisown = 1
2248 del newobj.thisown
2249 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2250 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2251 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2252
2253class Image_HSVValuePtr(Image_HSVValue):
2254 def __init__(self, this):
2255 self.this = this
2256 if not hasattr(self,"thisown"): self.thisown = 0
2257 self.__class__ = Image_HSVValue
2258_core_.Image_HSVValue_swigregister(Image_HSVValuePtr)
2259
d55e5bfc 2260class Image(Object):
7a27cf7c
RD
2261 """
2262 A platform-independent image class. An image can be created from
2263 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2264 variety of formats. Functions are available to set and get image
2265 bits, so it can be used for basic image manipulation.
2266
2267 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2268 platform-specific `wx.Bitmap` object must be created from it using the
2269 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2270 device context, using `wx.DC.DrawBitmap`.
2271
2272 One colour value of the image may be used as a mask colour which will
2273 lead to the automatic creation of a `wx.Mask` object associated to the
2274 bitmap object.
2275
2276 wx.Image supports alpha channel data, that is in addition to a byte
2277 for the red, green and blue colour components for each pixel it also
2278 stores a byte representing the pixel opacity. An alpha value of 0
2279 corresponds to a transparent pixel (null opacity) while a value of 255
2280 means that the pixel is 100% opaque.
2281
2282 Unlike RGB data, not all images have an alpha channel and before using
2283 `GetAlpha` you should check if this image contains an alpha channel
2284 with `HasAlpha`. Note that currently only images loaded from PNG files
2285 with transparency information will have an alpha channel.
2286 """
d55e5bfc
RD
2287 def __repr__(self):
2288 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2289 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2290 """
2291 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2292
2293 Loads an image from a file.
2294 """
d55e5bfc
RD
2295 newobj = _core_.new_Image(*args, **kwargs)
2296 self.this = newobj.this
2297 self.thisown = 1
2298 del newobj.thisown
2299 def __del__(self, destroy=_core_.delete_Image):
2300 """__del__(self)"""
2301 try:
2302 if self.thisown: destroy(self)
2303 except: pass
2304
2305 def Create(*args, **kwargs):
7a27cf7c
RD
2306 """
2307 Create(self, int width, int height, bool clear=True)
2308
2309 Creates a fresh image. If clear is ``True``, the new image will be
2310 initialized to black. Otherwise, the image data will be uninitialized.
2311 """
d55e5bfc
RD
2312 return _core_.Image_Create(*args, **kwargs)
2313
2314 def Destroy(*args, **kwargs):
2315 """
2316 Destroy(self)
2317
7a27cf7c 2318 Destroys the image data.
d55e5bfc
RD
2319 """
2320 return _core_.Image_Destroy(*args, **kwargs)
2321
2322 def Scale(*args, **kwargs):
7a27cf7c
RD
2323 """
2324 Scale(self, int width, int height) -> Image
2325
2326 Returns a scaled version of the image. This is also useful for scaling
2327 bitmaps in general as the only other way to scale bitmaps is to blit a
2328 `wx.MemoryDC` into another `wx.MemoryDC`.
2329 """
d55e5bfc
RD
2330 return _core_.Image_Scale(*args, **kwargs)
2331
2332 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2333 """
2334 ShrinkBy(self, int xFactor, int yFactor) -> Image
2335
2336 Return a version of the image scaled smaller by the given factors.
2337 """
d55e5bfc
RD
2338 return _core_.Image_ShrinkBy(*args, **kwargs)
2339
2340 def Rescale(*args, **kwargs):
7a27cf7c
RD
2341 """
2342 Rescale(self, int width, int height) -> Image
2343
2344 Changes the size of the image in-place by scaling it: after a call to
2345 this function, the image will have the given width and height.
2346
2347 Returns the (modified) image itself.
2348 """
d55e5bfc
RD
2349 return _core_.Image_Rescale(*args, **kwargs)
2350
aff4cc5c 2351 def Resize(*args, **kwargs):
7a27cf7c
RD
2352 """
2353 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2354
2355 Changes the size of the image in-place without scaling it, by adding
2356 either a border with the given colour or cropping as necessary. The
2357 image is pasted into a new image with the given size and background
2358 colour at the position pos relative to the upper left of the new
2359 image. If red = green = blue = -1 then use either the current mask
2360 colour if set or find, use, and set a suitable mask colour for any
2361 newly exposed areas.
2362
2363 Returns the (modified) image itself.
2364 """
aff4cc5c
RD
2365 return _core_.Image_Resize(*args, **kwargs)
2366
d55e5bfc 2367 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2368 """
2369 SetRGB(self, int x, int y, byte r, byte g, byte b)
2370
2371 Sets the pixel at the given coordinate. This routine performs
2372 bounds-checks for the coordinate so it can be considered a safe way to
2373 manipulate the data, but in some cases this might be too slow so that
2374 the data will have to be set directly. In that case you will have to
2375 get access to the image data using the `GetData` method.
2376 """
d55e5bfc
RD
2377 return _core_.Image_SetRGB(*args, **kwargs)
2378
aff4cc5c 2379 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2380 """
2381 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2382
2383 Sets the colour of the pixels within the given rectangle. This routine
2384 performs bounds-checks for the rectangle so it can be considered a
2385 safe way to manipulate the data.
2386 """
aff4cc5c
RD
2387 return _core_.Image_SetRGBRect(*args, **kwargs)
2388
d55e5bfc 2389 def GetRed(*args, **kwargs):
7a27cf7c
RD
2390 """
2391 GetRed(self, int x, int y) -> byte
2392
2393 Returns the red intensity at the given coordinate.
2394 """
d55e5bfc
RD
2395 return _core_.Image_GetRed(*args, **kwargs)
2396
2397 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2398 """
2399 GetGreen(self, int x, int y) -> byte
2400
2401 Returns the green intensity at the given coordinate.
2402 """
d55e5bfc
RD
2403 return _core_.Image_GetGreen(*args, **kwargs)
2404
2405 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2406 """
2407 GetBlue(self, int x, int y) -> byte
2408
2409 Returns the blue intensity at the given coordinate.
2410 """
d55e5bfc
RD
2411 return _core_.Image_GetBlue(*args, **kwargs)
2412
2413 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2414 """
2415 SetAlpha(self, int x, int y, byte alpha)
2416
2417 Sets the alpha value for the given pixel. This function should only be
2418 called if the image has alpha channel data, use `HasAlpha` to check
2419 for this.
2420 """
d55e5bfc
RD
2421 return _core_.Image_SetAlpha(*args, **kwargs)
2422
2423 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2424 """
2425 GetAlpha(self, int x, int y) -> byte
2426
2427 Returns the alpha value for the given pixel. This function may only be
2428 called for the images with alpha channel, use `HasAlpha` to check for
2429 this.
2430
2431 The returned value is the *opacity* of the image, i.e. the value of 0
2432 corresponds to the fully transparent pixels while the value of 255 to
2433 the fully opaque pixels.
2434 """
d55e5bfc
RD
2435 return _core_.Image_GetAlpha(*args, **kwargs)
2436
2437 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2438 """
2439 HasAlpha(self) -> bool
2440
2441 Returns true if this image has alpha channel, false otherwise.
2442 """
d55e5bfc
RD
2443 return _core_.Image_HasAlpha(*args, **kwargs)
2444
68350608
RD
2445 def InitAlpha(*args, **kwargs):
2446 """
2447 InitAlpha(self)
2448
2449 Initializes the image alpha channel data. It is an error to call it if
2450 the image already has alpha data. If it doesn't, alpha data will be by
2451 default initialized to all pixels being fully opaque. But if the image
2452 has a a mask colour, all mask pixels will be completely transparent.
2453 """
2454 return _core_.Image_InitAlpha(*args, **kwargs)
2455
57133d5c
RD
2456 def IsTransparent(*args, **kwargs):
2457 """
7a27cf7c 2458 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
57133d5c 2459
7a27cf7c
RD
2460 Returns ``True`` if this pixel is masked or has an alpha value less
2461 than the spcified threshold.
57133d5c
RD
2462 """
2463 return _core_.Image_IsTransparent(*args, **kwargs)
2464
d55e5bfc 2465 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2466 """
2467 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2468
2469 Find first colour that is not used in the image and has higher RGB
2470 values than startR, startG, startB. Returns a tuple consisting of a
2471 success flag and rgb values.
2472 """
d55e5bfc
RD
2473 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2474
4cf4100f
RD
2475 def ConvertAlphaToMask(*args, **kwargs):
2476 """
57133d5c 2477 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2478
7a27cf7c
RD
2479 If the image has alpha channel, this method converts it to mask. All
2480 pixels with alpha value less than ``threshold`` are replaced with the
2481 mask colour and the alpha channel is removed. The mask colour is
2482 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2483
2484 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2485 nothing.
2486 """
2487 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2488
8fb0e70a
RD
2489 def ConvertColourToAlpha(*args, **kwargs):
2490 """
7a27cf7c 2491 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2492
2493 This method converts an image where the original alpha information is
2494 only available as a shades of a colour (actually shades of grey)
2495 typically when you draw anti-aliased text into a bitmap. The DC
2496 drawing routines draw grey values on the black background although
2497 they actually mean to draw white with differnt alpha values. This
2498 method reverses it, assuming a black (!) background and white text.
2499 The method will then fill up the whole image with the colour given.
2500 """
2501 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2502
d55e5bfc 2503 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2504 """
2505 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2506
2507 Sets the image's mask so that the pixels that have RGB value of
2508 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2509 by first finding an unused colour in the image, setting this colour as
2510 the mask colour and then using this colour to draw all pixels in the
2511 image who corresponding pixel in mask has given RGB value.
2512
2513 Returns ``False`` if ``mask`` does not have same dimensions as the
2514 image or if there is no unused colour left. Returns ``True`` if the
2515 mask was successfully applied.
2516
2517 Note that this method involves computing the histogram, which is
2518 computationally intensive operation.
2519 """
d55e5bfc
RD
2520 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2521
2522 def CanRead(*args, **kwargs):
7a27cf7c
RD
2523 """
2524 CanRead(String filename) -> bool
2525
2526 Returns True if the image handlers can read this file.
2527 """
d55e5bfc
RD
2528 return _core_.Image_CanRead(*args, **kwargs)
2529
2530 CanRead = staticmethod(CanRead)
2531 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2532 """
2533 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2534
2535 If the image file contains more than one image and the image handler
2536 is capable of retrieving these individually, this function will return
2537 the number of available images.
2538 """
d55e5bfc
RD
2539 return _core_.Image_GetImageCount(*args, **kwargs)
2540
2541 GetImageCount = staticmethod(GetImageCount)
2542 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2543 """
2544 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2545
2546 Loads an image from a file. If no handler type is provided, the
2547 library will try to autodetect the format.
2548 """
d55e5bfc
RD
2549 return _core_.Image_LoadFile(*args, **kwargs)
2550
2551 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2552 """
2553 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2554
2555 Loads an image from a file, specifying the image type with a MIME type
2556 string.
2557 """
d55e5bfc
RD
2558 return _core_.Image_LoadMimeFile(*args, **kwargs)
2559
2560 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2561 """
2562 SaveFile(self, String name, int type) -> bool
2563
2564 Saves an image in the named file.
2565 """
d55e5bfc
RD
2566 return _core_.Image_SaveFile(*args, **kwargs)
2567
2568 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2569 """
2570 SaveMimeFile(self, String name, String mimetype) -> bool
2571
2572 Saves an image in the named file.
2573 """
d55e5bfc
RD
2574 return _core_.Image_SaveMimeFile(*args, **kwargs)
2575
2576 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2577 """
2578 CanReadStream(InputStream stream) -> bool
2579
2580 Returns True if the image handlers can read an image file from the
2581 data currently on the input stream, or a readable Python file-like
2582 object.
2583 """
d55e5bfc
RD
2584 return _core_.Image_CanReadStream(*args, **kwargs)
2585
2586 CanReadStream = staticmethod(CanReadStream)
2587 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2588 """
2589 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2590
2591 Loads an image from an input stream or a readable Python file-like
2592 object. If no handler type is provided, the library will try to
2593 autodetect the format.
2594 """
d55e5bfc
RD
2595 return _core_.Image_LoadStream(*args, **kwargs)
2596
2597 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2598 """
2599 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2600
2601 Loads an image from an input stream or a readable Python file-like
2602 object, using a MIME type string to specify the image file format.
2603 """
d55e5bfc
RD
2604 return _core_.Image_LoadMimeStream(*args, **kwargs)
2605
2606 def Ok(*args, **kwargs):
7a27cf7c
RD
2607 """
2608 Ok(self) -> bool
2609
2610 Returns true if image data is present.
2611 """
d55e5bfc
RD
2612 return _core_.Image_Ok(*args, **kwargs)
2613
2614 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2615 """
2616 GetWidth(self) -> int
2617
2618 Gets the width of the image in pixels.
2619 """
d55e5bfc
RD
2620 return _core_.Image_GetWidth(*args, **kwargs)
2621
2622 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2623 """
2624 GetHeight(self) -> int
2625
2626 Gets the height of the image in pixels.
2627 """
d55e5bfc
RD
2628 return _core_.Image_GetHeight(*args, **kwargs)
2629
2630 def GetSize(*args, **kwargs):
7a27cf7c
RD
2631 """
2632 GetSize(self) -> Size
2633
2634 Returns the size of the image in pixels.
2635 """
d55e5bfc
RD
2636 return _core_.Image_GetSize(*args, **kwargs)
2637
2638 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2639 """
2640 GetSubImage(self, Rect rect) -> Image
2641
2642 Returns a sub image of the current one as long as the rect belongs
2643 entirely to the image.
2644 """
d55e5bfc
RD
2645 return _core_.Image_GetSubImage(*args, **kwargs)
2646
aff4cc5c 2647 def Size(*args, **kwargs):
7a27cf7c
RD
2648 """
2649 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2650
2651 Returns a resized version of this image without scaling it by adding
2652 either a border with the given colour or cropping as necessary. The
2653 image is pasted into a new image with the given size and background
2654 colour at the position ``pos`` relative to the upper left of the new
2655 image. If red = green = blue = -1 then use either the current mask
2656 colour if set or find, use, and set a suitable mask colour for any
2657 newly exposed areas.
2658 """
aff4cc5c
RD
2659 return _core_.Image_Size(*args, **kwargs)
2660
d55e5bfc 2661 def Copy(*args, **kwargs):
7a27cf7c
RD
2662 """
2663 Copy(self) -> Image
2664
2665 Returns an identical copy of the image.
2666 """
d55e5bfc
RD
2667 return _core_.Image_Copy(*args, **kwargs)
2668
2669 def Paste(*args, **kwargs):
7a27cf7c
RD
2670 """
2671 Paste(self, Image image, int x, int y)
2672
2673 Pastes ``image`` into this instance and takes care of the mask colour
2674 and any out of bounds problems.
2675 """
d55e5bfc
RD
2676 return _core_.Image_Paste(*args, **kwargs)
2677
2678 def GetData(*args, **kwargs):
ea939623
RD
2679 """
2680 GetData(self) -> PyObject
2681
2682 Returns a string containing a copy of the RGB bytes of the image.
2683 """
d55e5bfc
RD
2684 return _core_.Image_GetData(*args, **kwargs)
2685
2686 def SetData(*args, **kwargs):
ea939623
RD
2687 """
2688 SetData(self, buffer data)
2689
2690 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2691 either a string or a buffer object holding the data and the length of
2692 the data must be width*height*3.
2693 """
d55e5bfc
RD
2694 return _core_.Image_SetData(*args, **kwargs)
2695
2696 def GetDataBuffer(*args, **kwargs):
ea939623
RD
2697 """
2698 GetDataBuffer(self) -> PyObject
2699
2700 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2701 image data buffer inside the wx.Image. You need to ensure that you do
2702 not use this buffer object after the image has been destroyed.
ea939623 2703 """
d55e5bfc
RD
2704 return _core_.Image_GetDataBuffer(*args, **kwargs)
2705
2706 def SetDataBuffer(*args, **kwargs):
ea939623
RD
2707 """
2708 SetDataBuffer(self, buffer data)
2709
2710 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2711 object. This can save making an extra copy of the data but you must
2712 ensure that the buffer object lives longer than the wx.Image does.
ea939623 2713 """
d55e5bfc
RD
2714 return _core_.Image_SetDataBuffer(*args, **kwargs)
2715
2716 def GetAlphaData(*args, **kwargs):
ea939623
RD
2717 """
2718 GetAlphaData(self) -> PyObject
2719
2720 Returns a string containing a copy of the alpha bytes of the image.
2721 """
d55e5bfc
RD
2722 return _core_.Image_GetAlphaData(*args, **kwargs)
2723
2724 def SetAlphaData(*args, **kwargs):
ea939623
RD
2725 """
2726 SetAlphaData(self, buffer alpha)
2727
2728 Resets the Image's alpha data from a buffer of bytes. Accepts either
2729 a string or a buffer object holding the data and the length of the
2730 data must be width*height.
2731 """
d55e5bfc
RD
2732 return _core_.Image_SetAlphaData(*args, **kwargs)
2733
2734 def GetAlphaBuffer(*args, **kwargs):
2735 """GetAlphaBuffer(self) -> PyObject"""
2736 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2737
2738 def SetAlphaBuffer(*args, **kwargs):
ea939623 2739 """SetAlphaBuffer(self, buffer alpha)"""
d55e5bfc
RD
2740 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2741
2742 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2743 """
2744 SetMaskColour(self, byte r, byte g, byte b)
2745
2746 Sets the mask colour for this image (and tells the image to use the
2747 mask).
2748 """
d55e5bfc
RD
2749 return _core_.Image_SetMaskColour(*args, **kwargs)
2750
aff4cc5c
RD
2751 def GetOrFindMaskColour(*args, **kwargs):
2752 """
2753 GetOrFindMaskColour() -> (r,g,b)
2754
2755 Get the current mask colour or find a suitable colour.
2756 """
2757 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2758
d55e5bfc 2759 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2760 """
2761 GetMaskRed(self) -> byte
2762
2763 Gets the red component of the mask colour.
2764 """
d55e5bfc
RD
2765 return _core_.Image_GetMaskRed(*args, **kwargs)
2766
2767 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2768 """
2769 GetMaskGreen(self) -> byte
2770
2771 Gets the green component of the mask colour.
2772 """
d55e5bfc
RD
2773 return _core_.Image_GetMaskGreen(*args, **kwargs)
2774
2775 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2776 """
2777 GetMaskBlue(self) -> byte
2778
2779 Gets the blue component of the mask colour.
2780 """
d55e5bfc
RD
2781 return _core_.Image_GetMaskBlue(*args, **kwargs)
2782
2783 def SetMask(*args, **kwargs):
7a27cf7c
RD
2784 """
2785 SetMask(self, bool mask=True)
2786
2787 Specifies whether there is a mask or not. The area of the mask is
2788 determined by the current mask colour.
2789 """
d55e5bfc
RD
2790 return _core_.Image_SetMask(*args, **kwargs)
2791
2792 def HasMask(*args, **kwargs):
7a27cf7c
RD
2793 """
2794 HasMask(self) -> bool
2795
2796 Returns ``True`` if there is a mask active, ``False`` otherwise.
2797 """
d55e5bfc
RD
2798 return _core_.Image_HasMask(*args, **kwargs)
2799
2800 def Rotate(*args, **kwargs):
2801 """
2802 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2803 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2804
2805 Rotates the image about the given point, by ``angle`` radians. Passing
2806 ``True`` to ``interpolating`` results in better image quality, but is
2807 slower. If the image has a mask, then the mask colour is used for the
2808 uncovered pixels in the rotated image background. Otherwise, black
2809 will be used as the fill colour.
2810
2811 Returns the rotated image, leaving this image intact.
d55e5bfc
RD
2812 """
2813 return _core_.Image_Rotate(*args, **kwargs)
2814
2815 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2816 """
2817 Rotate90(self, bool clockwise=True) -> Image
2818
2819 Returns a copy of the image rotated 90 degrees in the direction
2820 indicated by ``clockwise``.
2821 """
d55e5bfc
RD
2822 return _core_.Image_Rotate90(*args, **kwargs)
2823
2824 def Mirror(*args, **kwargs):
7a27cf7c
RD
2825 """
2826 Mirror(self, bool horizontally=True) -> Image
2827
2828 Returns a mirrored copy of the image. The parameter ``horizontally``
2829 indicates the orientation.
2830 """
d55e5bfc
RD
2831 return _core_.Image_Mirror(*args, **kwargs)
2832
2833 def Replace(*args, **kwargs):
2834 """
7a27cf7c
RD
2835 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2836
2837 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2838 ``(r2,g2,b2)``.
d55e5bfc
RD
2839 """
2840 return _core_.Image_Replace(*args, **kwargs)
2841
2842 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2843 """
2844 ConvertToMono(self, byte r, byte g, byte b) -> Image
2845
2846 Returns monochromatic version of the image. The returned image has
2847 white colour where the original has ``(r,g,b)`` colour and black
2848 colour everywhere else.
2849 """
d55e5bfc
RD
2850 return _core_.Image_ConvertToMono(*args, **kwargs)
2851
2852 def SetOption(*args, **kwargs):
7a27cf7c
RD
2853 """
2854 SetOption(self, String name, String value)
2855
2856 Sets an image handler defined option. For example, when saving as a
2857 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2858 number between 0 and 100 (0 is terrible, 100 is very good).
2859 """
d55e5bfc
RD
2860 return _core_.Image_SetOption(*args, **kwargs)
2861
2862 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2863 """
2864 SetOptionInt(self, String name, int value)
2865
2866 Sets an image option as an integer.
2867 """
d55e5bfc
RD
2868 return _core_.Image_SetOptionInt(*args, **kwargs)
2869
2870 def GetOption(*args, **kwargs):
7a27cf7c
RD
2871 """
2872 GetOption(self, String name) -> String
2873
2874 Gets the value of an image handler option.
2875 """
d55e5bfc
RD
2876 return _core_.Image_GetOption(*args, **kwargs)
2877
2878 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2879 """
2880 GetOptionInt(self, String name) -> int
2881
2882 Gets the value of an image handler option as an integer. If the given
2883 option is not present, the function returns 0.
2884 """
d55e5bfc
RD
2885 return _core_.Image_GetOptionInt(*args, **kwargs)
2886
2887 def HasOption(*args, **kwargs):
7a27cf7c
RD
2888 """
2889 HasOption(self, String name) -> bool
2890
2891 Returns true if the given option is present.
2892 """
d55e5bfc
RD
2893 return _core_.Image_HasOption(*args, **kwargs)
2894
2895 def CountColours(*args, **kwargs):
2896 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2897 return _core_.Image_CountColours(*args, **kwargs)
2898
2899 def ComputeHistogram(*args, **kwargs):
2900 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2901 return _core_.Image_ComputeHistogram(*args, **kwargs)
2902
2903 def AddHandler(*args, **kwargs):
c24da6d6 2904 """AddHandler(ImageHandler handler)"""
d55e5bfc
RD
2905 return _core_.Image_AddHandler(*args, **kwargs)
2906
2907 AddHandler = staticmethod(AddHandler)
2908 def InsertHandler(*args, **kwargs):
c24da6d6 2909 """InsertHandler(ImageHandler handler)"""
d55e5bfc
RD
2910 return _core_.Image_InsertHandler(*args, **kwargs)
2911
2912 InsertHandler = staticmethod(InsertHandler)
2913 def RemoveHandler(*args, **kwargs):
c24da6d6 2914 """RemoveHandler(String name) -> bool"""
d55e5bfc
RD
2915 return _core_.Image_RemoveHandler(*args, **kwargs)
2916
2917 RemoveHandler = staticmethod(RemoveHandler)
2918 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2919 """
2920 GetImageExtWildcard() -> String
2921
2922 Iterates all registered wxImageHandler objects, and returns a string
2923 containing file extension masks suitable for passing to file open/save
2924 dialog boxes.
2925 """
d55e5bfc
RD
2926 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2927
2928 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2929 def ConvertToBitmap(*args, **kwargs):
1fbf26be 2930 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
d55e5bfc
RD
2931 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2932
2933 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2934 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
d55e5bfc
RD
2935 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2936
2f91e3df
KO
2937 def RotateHue(*args, **kwargs):
2938 """
2939 RotateHue(self, double angle)
2940
2941 Rotates the hue of each pixel of the image. Hue is a double in the
2942 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2943 """
2944 return _core_.Image_RotateHue(*args, **kwargs)
2945
2946 def RGBtoHSV(*args, **kwargs):
2947 """RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue"""
2948 return _core_.Image_RGBtoHSV(*args, **kwargs)
2949
2950 RGBtoHSV = staticmethod(RGBtoHSV)
2951 def HSVtoRGB(*args, **kwargs):
2952 """HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue"""
2953 return _core_.Image_HSVtoRGB(*args, **kwargs)
2954
2955 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc
RD
2956 def __nonzero__(self): return self.Ok()
2957
2958class ImagePtr(Image):
2959 def __init__(self, this):
2960 self.this = this
2961 if not hasattr(self,"thisown"): self.thisown = 0
2962 self.__class__ = Image
2963_core_.Image_swigregister(ImagePtr)
2964
2965def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2966 """
2967 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2968
2969 Loads an image from a file, using a MIME type string (such as
2970 'image/jpeg') to specify image type.
2971 """
d55e5bfc
RD
2972 val = _core_.new_ImageFromMime(*args, **kwargs)
2973 val.thisown = 1
2974 return val
2975
2976def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2977 """
2978 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2979
2980 Loads an image from an input stream, or any readable Python file-like
2981 object.
2982 """
d55e5bfc
RD
2983 val = _core_.new_ImageFromStream(*args, **kwargs)
2984 val.thisown = 1
2985 return val
2986
2987def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2988 """
2989 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2990
2991 Loads an image from an input stream, or any readable Python file-like
2992 object, specifying the image format with a MIME type string.
2993 """
d55e5bfc
RD
2994 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2995 val.thisown = 1
2996 return val
2997
c24da6d6 2998def EmptyImage(*args, **kwargs):
ea939623
RD
2999 """
3000 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3001
3002 Construct an empty image of a given size, optionally setting all
3003 pixels to black.
3004 """
c24da6d6 3005 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
3006 val.thisown = 1
3007 return val
3008
3009def ImageFromBitmap(*args, **kwargs):
ea939623
RD
3010 """
3011 ImageFromBitmap(Bitmap bitmap) -> Image
3012
3013 Construct an Image from a `wx.Bitmap`.
3014 """
d55e5bfc
RD
3015 val = _core_.new_ImageFromBitmap(*args, **kwargs)
3016 val.thisown = 1
3017 return val
3018
3019def ImageFromData(*args, **kwargs):
ea939623
RD
3020 """
3021 ImageFromData(int width, int height, buffer data) -> Image
3022
3023 Construct an Image from a buffer of RGB bytes. Accepts either a
3024 string or a buffer object holding the data and the length of the data
3025 must be width*height*3.
3026 """
d55e5bfc
RD
3027 val = _core_.new_ImageFromData(*args, **kwargs)
3028 val.thisown = 1
3029 return val
3030
c9c2cf70 3031def ImageFromDataWithAlpha(*args, **kwargs):
ea939623
RD
3032 """
3033 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3034
3035 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3036 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3037 length of the data must be width*height*3 bytes, and the length of the
3038 alpha data must be width*height bytes.
ea939623 3039 """
c9c2cf70
RD
3040 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3041 val.thisown = 1
3042 return val
3043
d55e5bfc 3044def Image_CanRead(*args, **kwargs):
7a27cf7c
RD
3045 """
3046 Image_CanRead(String filename) -> bool
3047
3048 Returns True if the image handlers can read this file.
3049 """
d55e5bfc
RD
3050 return _core_.Image_CanRead(*args, **kwargs)
3051
3052def Image_GetImageCount(*args, **kwargs):
7a27cf7c
RD
3053 """
3054 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3055
3056 If the image file contains more than one image and the image handler
3057 is capable of retrieving these individually, this function will return
3058 the number of available images.
3059 """
d55e5bfc
RD
3060 return _core_.Image_GetImageCount(*args, **kwargs)
3061
3062def Image_CanReadStream(*args, **kwargs):
7a27cf7c
RD
3063 """
3064 Image_CanReadStream(InputStream stream) -> bool
3065
3066 Returns True if the image handlers can read an image file from the
3067 data currently on the input stream, or a readable Python file-like
3068 object.
3069 """
d55e5bfc
RD
3070 return _core_.Image_CanReadStream(*args, **kwargs)
3071
3072def Image_AddHandler(*args, **kwargs):
3073 """Image_AddHandler(ImageHandler handler)"""
3074 return _core_.Image_AddHandler(*args, **kwargs)
3075
3076def Image_InsertHandler(*args, **kwargs):
3077 """Image_InsertHandler(ImageHandler handler)"""
3078 return _core_.Image_InsertHandler(*args, **kwargs)
3079
3080def Image_RemoveHandler(*args, **kwargs):
3081 """Image_RemoveHandler(String name) -> bool"""
3082 return _core_.Image_RemoveHandler(*args, **kwargs)
3083
3084def Image_GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3085 """
3086 Image_GetImageExtWildcard() -> String
3087
3088 Iterates all registered wxImageHandler objects, and returns a string
3089 containing file extension masks suitable for passing to file open/save
3090 dialog boxes.
3091 """
d55e5bfc
RD
3092 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
3093
2f91e3df
KO
3094def Image_RGBtoHSV(*args, **kwargs):
3095 """Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue"""
3096 return _core_.Image_RGBtoHSV(*args, **kwargs)
3097
3098def Image_HSVtoRGB(*args, **kwargs):
3099 """Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue"""
3100 return _core_.Image_HSVtoRGB(*args, **kwargs)
3101
a07a67e6
RD
3102def InitAllImageHandlers():
3103 """
3104 The former functionality of InitAllImageHanders is now done internal to
3105 the _core_ extension module and so this function has become a simple NOP.
3106 """
3107 pass
d55e5bfc 3108
d55e5bfc
RD
3109IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3110IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3111PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3112PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3113PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
d55e5bfc
RD
3114BMP_24BPP = _core_.BMP_24BPP
3115BMP_8BPP = _core_.BMP_8BPP
3116BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3117BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3118BMP_8BPP_RED = _core_.BMP_8BPP_RED
3119BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3120BMP_4BPP = _core_.BMP_4BPP
3121BMP_1BPP = _core_.BMP_1BPP
3122BMP_1BPP_BW = _core_.BMP_1BPP_BW
3123class BMPHandler(ImageHandler):
27fb7603 3124 """A `wx.ImageHandler` for \*.bmp bitmap files."""
d55e5bfc
RD
3125 def __repr__(self):
3126 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3127 def __init__(self, *args, **kwargs):
27fb7603
RD
3128 """
3129 __init__(self) -> BMPHandler
3130
3131 A `wx.ImageHandler` for \*.bmp bitmap files.
3132 """
d55e5bfc
RD
3133 newobj = _core_.new_BMPHandler(*args, **kwargs)
3134 self.this = newobj.this
3135 self.thisown = 1
3136 del newobj.thisown
3137
3138class BMPHandlerPtr(BMPHandler):
3139 def __init__(self, this):
3140 self.this = this
3141 if not hasattr(self,"thisown"): self.thisown = 0
3142 self.__class__ = BMPHandler
3143_core_.BMPHandler_swigregister(BMPHandlerPtr)
3144NullImage = cvar.NullImage
68350608 3145IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3146IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3147IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3148IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3149IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3150IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3151IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3152IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3153IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3154IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3155IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3156IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3157IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3158IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3159IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc
RD
3160
3161class ICOHandler(BMPHandler):
27fb7603 3162 """A `wx.ImageHandler` for \*.ico icon files."""
d55e5bfc
RD
3163 def __repr__(self):
3164 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3165 def __init__(self, *args, **kwargs):
27fb7603
RD
3166 """
3167 __init__(self) -> ICOHandler
3168
3169 A `wx.ImageHandler` for \*.ico icon files.
3170 """
d55e5bfc
RD
3171 newobj = _core_.new_ICOHandler(*args, **kwargs)
3172 self.this = newobj.this
3173 self.thisown = 1
3174 del newobj.thisown
3175
3176class ICOHandlerPtr(ICOHandler):
3177 def __init__(self, this):
3178 self.this = this
3179 if not hasattr(self,"thisown"): self.thisown = 0
3180 self.__class__ = ICOHandler
3181_core_.ICOHandler_swigregister(ICOHandlerPtr)
3182
3183class CURHandler(ICOHandler):
27fb7603 3184 """A `wx.ImageHandler` for \*.cur cursor files."""
d55e5bfc
RD
3185 def __repr__(self):
3186 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3187 def __init__(self, *args, **kwargs):
27fb7603
RD
3188 """
3189 __init__(self) -> CURHandler
3190
3191 A `wx.ImageHandler` for \*.cur cursor files.
3192 """
d55e5bfc
RD
3193 newobj = _core_.new_CURHandler(*args, **kwargs)
3194 self.this = newobj.this
3195 self.thisown = 1
3196 del newobj.thisown
3197
3198class CURHandlerPtr(CURHandler):
3199 def __init__(self, this):
3200 self.this = this
3201 if not hasattr(self,"thisown"): self.thisown = 0
3202 self.__class__ = CURHandler
3203_core_.CURHandler_swigregister(CURHandlerPtr)
3204
3205class ANIHandler(CURHandler):
27fb7603 3206 """A `wx.ImageHandler` for \*.ani animated cursor files."""
d55e5bfc
RD
3207 def __repr__(self):
3208 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3209 def __init__(self, *args, **kwargs):
27fb7603
RD
3210 """
3211 __init__(self) -> ANIHandler
3212
3213 A `wx.ImageHandler` for \*.ani animated cursor files.
3214 """
d55e5bfc
RD
3215 newobj = _core_.new_ANIHandler(*args, **kwargs)
3216 self.this = newobj.this
3217 self.thisown = 1
3218 del newobj.thisown
3219
3220class ANIHandlerPtr(ANIHandler):
3221 def __init__(self, this):
3222 self.this = this
3223 if not hasattr(self,"thisown"): self.thisown = 0
3224 self.__class__ = ANIHandler
3225_core_.ANIHandler_swigregister(ANIHandlerPtr)
3226
3227class PNGHandler(ImageHandler):
27fb7603 3228 """A `wx.ImageHandler` for PNG image files."""
d55e5bfc
RD
3229 def __repr__(self):
3230 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3231 def __init__(self, *args, **kwargs):
27fb7603
RD
3232 """
3233 __init__(self) -> PNGHandler
3234
3235 A `wx.ImageHandler` for PNG image files.
3236 """
d55e5bfc
RD
3237 newobj = _core_.new_PNGHandler(*args, **kwargs)
3238 self.this = newobj.this
3239 self.thisown = 1
3240 del newobj.thisown
3241
3242class PNGHandlerPtr(PNGHandler):
3243 def __init__(self, this):
3244 self.this = this
3245 if not hasattr(self,"thisown"): self.thisown = 0
3246 self.__class__ = PNGHandler
3247_core_.PNGHandler_swigregister(PNGHandlerPtr)
3248
3249class GIFHandler(ImageHandler):
27fb7603 3250 """A `wx.ImageHandler` for GIF image files."""
d55e5bfc
RD
3251 def __repr__(self):
3252 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3253 def __init__(self, *args, **kwargs):
27fb7603
RD
3254 """
3255 __init__(self) -> GIFHandler
3256
3257 A `wx.ImageHandler` for GIF image files.
3258 """
d55e5bfc
RD
3259 newobj = _core_.new_GIFHandler(*args, **kwargs)
3260 self.this = newobj.this
3261 self.thisown = 1
3262 del newobj.thisown
3263
3264class GIFHandlerPtr(GIFHandler):
3265 def __init__(self, this):
3266 self.this = this
3267 if not hasattr(self,"thisown"): self.thisown = 0
3268 self.__class__ = GIFHandler
3269_core_.GIFHandler_swigregister(GIFHandlerPtr)
3270
3271class PCXHandler(ImageHandler):
27fb7603 3272 """A `wx.ImageHandler` for PCX imager files."""
d55e5bfc
RD
3273 def __repr__(self):
3274 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3275 def __init__(self, *args, **kwargs):
27fb7603
RD
3276 """
3277 __init__(self) -> PCXHandler
3278
3279 A `wx.ImageHandler` for PCX imager files.
3280 """
d55e5bfc
RD
3281 newobj = _core_.new_PCXHandler(*args, **kwargs)
3282 self.this = newobj.this
3283 self.thisown = 1
3284 del newobj.thisown
3285
3286class PCXHandlerPtr(PCXHandler):
3287 def __init__(self, this):
3288 self.this = this
3289 if not hasattr(self,"thisown"): self.thisown = 0
3290 self.__class__ = PCXHandler
3291_core_.PCXHandler_swigregister(PCXHandlerPtr)
3292
3293class JPEGHandler(ImageHandler):
27fb7603 3294 """A `wx.ImageHandler` for JPEG/JPG image files."""
d55e5bfc
RD
3295 def __repr__(self):
3296 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3297 def __init__(self, *args, **kwargs):
27fb7603
RD
3298 """
3299 __init__(self) -> JPEGHandler
3300
3301 A `wx.ImageHandler` for JPEG/JPG image files.
3302 """
d55e5bfc
RD
3303 newobj = _core_.new_JPEGHandler(*args, **kwargs)
3304 self.this = newobj.this
3305 self.thisown = 1
3306 del newobj.thisown
3307
3308class JPEGHandlerPtr(JPEGHandler):
3309 def __init__(self, this):
3310 self.this = this
3311 if not hasattr(self,"thisown"): self.thisown = 0
3312 self.__class__ = JPEGHandler
3313_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
3314
3315class PNMHandler(ImageHandler):
27fb7603 3316 """A `wx.ImageHandler` for PNM image files."""
d55e5bfc
RD
3317 def __repr__(self):
3318 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3319 def __init__(self, *args, **kwargs):
27fb7603
RD
3320 """
3321 __init__(self) -> PNMHandler
3322
3323 A `wx.ImageHandler` for PNM image files.
3324 """
d55e5bfc
RD
3325 newobj = _core_.new_PNMHandler(*args, **kwargs)
3326 self.this = newobj.this
3327 self.thisown = 1
3328 del newobj.thisown
3329
3330class PNMHandlerPtr(PNMHandler):
3331 def __init__(self, this):
3332 self.this = this
3333 if not hasattr(self,"thisown"): self.thisown = 0
3334 self.__class__ = PNMHandler
3335_core_.PNMHandler_swigregister(PNMHandlerPtr)
3336
3337class XPMHandler(ImageHandler):
27fb7603 3338 """A `wx.ImageHandler` for XPM image."""
d55e5bfc
RD
3339 def __repr__(self):
3340 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3341 def __init__(self, *args, **kwargs):
27fb7603
RD
3342 """
3343 __init__(self) -> XPMHandler
3344
3345 A `wx.ImageHandler` for XPM image.
3346 """
d55e5bfc
RD
3347 newobj = _core_.new_XPMHandler(*args, **kwargs)
3348 self.this = newobj.this
3349 self.thisown = 1
3350 del newobj.thisown
3351
3352class XPMHandlerPtr(XPMHandler):
3353 def __init__(self, this):
3354 self.this = this
3355 if not hasattr(self,"thisown"): self.thisown = 0
3356 self.__class__ = XPMHandler
3357_core_.XPMHandler_swigregister(XPMHandlerPtr)
3358
3359class TIFFHandler(ImageHandler):
27fb7603 3360 """A `wx.ImageHandler` for TIFF image files."""
d55e5bfc
RD
3361 def __repr__(self):
3362 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3363 def __init__(self, *args, **kwargs):
27fb7603
RD
3364 """
3365 __init__(self) -> TIFFHandler
3366
3367 A `wx.ImageHandler` for TIFF image files.
3368 """
d55e5bfc
RD
3369 newobj = _core_.new_TIFFHandler(*args, **kwargs)
3370 self.this = newobj.this
3371 self.thisown = 1
3372 del newobj.thisown
3373
3374class TIFFHandlerPtr(TIFFHandler):
3375 def __init__(self, this):
3376 self.this = this
3377 if not hasattr(self,"thisown"): self.thisown = 0
3378 self.__class__ = TIFFHandler
3379_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
3380
c0de73ae
RD
3381QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3382QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3383class Quantize(object):
3384 """Performs quantization, or colour reduction, on a wxImage."""
3385 def __init__(self): raise RuntimeError, "No constructor defined"
3386 def __repr__(self):
3387 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3388 def Quantize(*args, **kwargs):
3389 """
3390 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3391
3392 Reduce the colours in the source image and put the result into the
3393 destination image, setting the palette in the destination if
3394 needed. Both images may be the same, to overwrite the source image.
3395 """
3396 return _core_.Quantize_Quantize(*args, **kwargs)
3397
3398 Quantize = staticmethod(Quantize)
3399
3400class QuantizePtr(Quantize):
3401 def __init__(self, this):
3402 self.this = this
3403 if not hasattr(self,"thisown"): self.thisown = 0
3404 self.__class__ = Quantize
3405_core_.Quantize_swigregister(QuantizePtr)
3406
3407def Quantize_Quantize(*args, **kwargs):
3408 """
3409 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3410
3411 Reduce the colours in the source image and put the result into the
3412 destination image, setting the palette in the destination if
3413 needed. Both images may be the same, to overwrite the source image.
3414 """
3415 return _core_.Quantize_Quantize(*args, **kwargs)
3416
d55e5bfc
RD
3417#---------------------------------------------------------------------------
3418
3419class EvtHandler(Object):
093d3ff1 3420 """Proxy of C++ EvtHandler class"""
d55e5bfc
RD
3421 def __repr__(self):
3422 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3423 def __init__(self, *args, **kwargs):
3424 """__init__(self) -> EvtHandler"""
3425 newobj = _core_.new_EvtHandler(*args, **kwargs)
3426 self.this = newobj.this
3427 self.thisown = 1
3428 del newobj.thisown
3429 def GetNextHandler(*args, **kwargs):
3430 """GetNextHandler(self) -> EvtHandler"""
3431 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3432
3433 def GetPreviousHandler(*args, **kwargs):
3434 """GetPreviousHandler(self) -> EvtHandler"""
3435 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3436
3437 def SetNextHandler(*args, **kwargs):
3438 """SetNextHandler(self, EvtHandler handler)"""
3439 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3440
3441 def SetPreviousHandler(*args, **kwargs):
3442 """SetPreviousHandler(self, EvtHandler handler)"""
3443 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3444
3445 def GetEvtHandlerEnabled(*args, **kwargs):
3446 """GetEvtHandlerEnabled(self) -> bool"""
3447 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3448
3449 def SetEvtHandlerEnabled(*args, **kwargs):
3450 """SetEvtHandlerEnabled(self, bool enabled)"""
3451 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3452
3453 def ProcessEvent(*args, **kwargs):
3454 """ProcessEvent(self, Event event) -> bool"""
3455 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3456
3457 def AddPendingEvent(*args, **kwargs):
3458 """AddPendingEvent(self, Event event)"""
3459 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3460
3461 def ProcessPendingEvents(*args, **kwargs):
3462 """ProcessPendingEvents(self)"""
3463 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3464
3465 def Connect(*args, **kwargs):
3466 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3467 return _core_.EvtHandler_Connect(*args, **kwargs)
3468
3469 def Disconnect(*args, **kwargs):
3470 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
3471 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3472
3473 def _setOORInfo(*args, **kwargs):
093d3ff1 3474 """_setOORInfo(self, PyObject _self, bool incref=True)"""
d55e5bfc
RD
3475 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
3476
3477 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3478 """
3479 Bind an event to an event handler.
3480
caef1a4d
RD
3481 :param event: One of the EVT_* objects that specifies the
3482 type of event to bind,
d55e5bfc 3483
caef1a4d
RD
3484 :param handler: A callable object to be invoked when the
3485 event is delivered to self. Pass None to
3486 disconnect an event handler.
d55e5bfc 3487
caef1a4d
RD
3488 :param source: Sometimes the event originates from a
3489 different window than self, but you still
3490 want to catch it in self. (For example, a
3491 button event delivered to a frame.) By
3492 passing the source of the event, the event
3493 handling system is able to differentiate
3494 between the same event type from different
3495 controls.
d55e5bfc 3496
caef1a4d
RD
3497 :param id: Used to spcify the event source by ID instead
3498 of instance.
3499
3500 :param id2: Used when it is desirable to bind a handler
3501 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3502 """
3503 if source is not None:
3504 id = source.GetId()
3505 event.Bind(self, id, id2, handler)
3506
c24da6d6
RD
3507 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3508 """
3509 Disconencts the event handler binding for event from self.
3510 Returns True if successful.
3511 """
3512 if source is not None:
3513 id = source.GetId()
3514 return event.Unbind(self, id, id2)
d55e5bfc
RD
3515
3516
3517class EvtHandlerPtr(EvtHandler):
3518 def __init__(self, this):
3519 self.this = this
3520 if not hasattr(self,"thisown"): self.thisown = 0
3521 self.__class__ = EvtHandler
3522_core_.EvtHandler_swigregister(EvtHandlerPtr)
3523
3524#---------------------------------------------------------------------------
3525
3526class PyEventBinder(object):
3527 """
3528 Instances of this class are used to bind specific events to event
3529 handlers.
3530 """
3531 def __init__(self, evtType, expectedIDs=0):
3532 if expectedIDs not in [0, 1, 2]:
3533 raise ValueError, "Invalid number of expectedIDs"
3534 self.expectedIDs = expectedIDs
3535
3536 if type(evtType) == list or type(evtType) == tuple:
3537 self.evtType = evtType
3538 else:
3539 self.evtType = [evtType]
3540
3541
3542 def Bind(self, target, id1, id2, function):
3543 """Bind this set of event types to target."""
3544 for et in self.evtType:
3545 target.Connect(id1, id2, et, function)
3546
c24da6d6
RD
3547
3548 def Unbind(self, target, id1, id2):
3549 """Remove an event binding."""
3550 success = 0
3551 for et in self.evtType:
3552 success += target.Disconnect(id1, id2, et)
3553 return success != 0
3554
d55e5bfc
RD
3555
3556 def __call__(self, *args):
3557 """
3558 For backwards compatibility with the old EVT_* functions.
3559 Should be called with either (window, func), (window, ID,
3560 func) or (window, ID1, ID2, func) parameters depending on the
3561 type of the event.
3562 """
3563 assert len(args) == 2 + self.expectedIDs
3564 id1 = wx.ID_ANY
3565 id2 = wx.ID_ANY
3566 target = args[0]
3567 if self.expectedIDs == 0:
3568 func = args[1]
3569 elif self.expectedIDs == 1:
3570 id1 = args[1]
3571 func = args[2]
3572 elif self.expectedIDs == 2:
3573 id1 = args[1]
3574 id2 = args[2]
3575 func = args[3]
3576 else:
3577 raise ValueError, "Unexpected number of IDs"
3578
3579 self.Bind(target, id1, id2, func)
3580
3581
3582# These two are square pegs that don't fit the PyEventBinder hole...
3583def EVT_COMMAND(win, id, cmd, func):
3584 win.Connect(id, -1, cmd, func)
3585def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3586 win.Connect(id1, id2, cmd, func)
3587
3588
3589#---------------------------------------------------------------------------
3590
3591#---------------------------------------------------------------------------
3592
3593EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3594EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3595
3596def NewEventType(*args, **kwargs):
3597 """NewEventType() -> wxEventType"""
3598 return _core_.NewEventType(*args, **kwargs)
3599wxEVT_NULL = _core_.wxEVT_NULL
3600wxEVT_FIRST = _core_.wxEVT_FIRST
3601wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3602wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3603wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3604wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3605wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3606wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3607wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3608wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3609wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3610wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3611wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3612wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3613wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3614wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3615wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3616wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3617wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3618wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3619wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3620wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3621wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3622wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3623wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3624wxEVT_MOTION = _core_.wxEVT_MOTION
3625wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3626wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3627wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3628wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3629wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3630wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3631wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3632wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3633wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3634wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3635wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3636wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3637wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3638wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3639wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3640wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3641wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3642wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3643wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3644wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3645wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3646wxEVT_CHAR = _core_.wxEVT_CHAR
3647wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3648wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3649wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3650wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3651wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3652wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3653wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3654wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3655wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3656wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3657wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3658wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3659wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3660wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
db67f999
RD
3661wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3662wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
d55e5bfc
RD
3663wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3664wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3665wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3666wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3667wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3668wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3669wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3670wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3671wxEVT_SIZE = _core_.wxEVT_SIZE
3672wxEVT_MOVE = _core_.wxEVT_MOVE
3673wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3674wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3675wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3676wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3677wxEVT_POWER = _core_.wxEVT_POWER
3678wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3679wxEVT_CREATE = _core_.wxEVT_CREATE
3680wxEVT_DESTROY = _core_.wxEVT_DESTROY
3681wxEVT_SHOW = _core_.wxEVT_SHOW
3682wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3683wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3684wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3685wxEVT_PAINT = _core_.wxEVT_PAINT
3686wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3687wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3688wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3689wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3690wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3691wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3692wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3693wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3694wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3695wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3696wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3697wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3698wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3699wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3700wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3701wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3702wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3703wxEVT_IDLE = _core_.wxEVT_IDLE
3704wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3705wxEVT_SIZING = _core_.wxEVT_SIZING
3706wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3707wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
d55e5bfc
RD
3708wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3709wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3710wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3711wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3712wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3713wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3714wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3715#
3716# Create some event binders
3717EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3718EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3719EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3720EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3721EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3722EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3723EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3724EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3725EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3726EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3727EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3728EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3729EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3730EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3731EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3732EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3733EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3734EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3735EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3736EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3737EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3738EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3739EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3740EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3741EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3742EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3743EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3744EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3745EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3746EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3747EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3748EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3749EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3750EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3751EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3752EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3753EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3754EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3755EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3756EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3757EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3758
3759EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3760EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3761EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3762EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3763EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3764EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3765EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3766EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3767EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3768EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3769EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3770EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3771EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3772
3773EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3774 wxEVT_LEFT_UP,
3775 wxEVT_MIDDLE_DOWN,
3776 wxEVT_MIDDLE_UP,
3777 wxEVT_RIGHT_DOWN,
3778 wxEVT_RIGHT_UP,
3779 wxEVT_MOTION,
3780 wxEVT_LEFT_DCLICK,
3781 wxEVT_MIDDLE_DCLICK,
3782 wxEVT_RIGHT_DCLICK,
3783 wxEVT_ENTER_WINDOW,
3784 wxEVT_LEAVE_WINDOW,
3785 wxEVT_MOUSEWHEEL
3786 ])
3787
3788
3789# Scrolling from wxWindow (sent to wxScrolledWindow)
3790EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3791 wxEVT_SCROLLWIN_BOTTOM,
3792 wxEVT_SCROLLWIN_LINEUP,
3793 wxEVT_SCROLLWIN_LINEDOWN,
3794 wxEVT_SCROLLWIN_PAGEUP,
3795 wxEVT_SCROLLWIN_PAGEDOWN,
3796 wxEVT_SCROLLWIN_THUMBTRACK,
3797 wxEVT_SCROLLWIN_THUMBRELEASE,
3798 ])
3799
3800EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3801EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3802EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3803EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3804EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3805EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3806EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3807EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3808
27fb7603 3809# Scrolling from wx.Slider and wx.ScrollBar
d55e5bfc
RD
3810EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3811 wxEVT_SCROLL_BOTTOM,
3812 wxEVT_SCROLL_LINEUP,
3813 wxEVT_SCROLL_LINEDOWN,
3814 wxEVT_SCROLL_PAGEUP,
3815 wxEVT_SCROLL_PAGEDOWN,
3816 wxEVT_SCROLL_THUMBTRACK,
3817 wxEVT_SCROLL_THUMBRELEASE,
db67f999 3818 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3819 ])
3820
3821EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3822EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3823EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3824EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3825EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3826EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3827EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3828EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
db67f999
RD
3829EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3830EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3831
27fb7603 3832# Scrolling from wx.Slider and wx.ScrollBar, with an id
d55e5bfc
RD
3833EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3834 wxEVT_SCROLL_BOTTOM,
3835 wxEVT_SCROLL_LINEUP,
3836 wxEVT_SCROLL_LINEDOWN,
3837 wxEVT_SCROLL_PAGEUP,
3838 wxEVT_SCROLL_PAGEDOWN,
3839 wxEVT_SCROLL_THUMBTRACK,
3840 wxEVT_SCROLL_THUMBRELEASE,
db67f999 3841 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3842 ], 1)
3843
3844EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3845EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3846EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3847EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3848EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3849EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3850EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3851EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
db67f999
RD
3852EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3853EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3854
3855EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3856EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3857EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3858EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3859EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3860EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3861EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3862EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3863EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3864EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3865
3866EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3867EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3868EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3869EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3870EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3871EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3872EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3873EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3874EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3875
3876
3877EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3878EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3879EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3880EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3881EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3882EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3883EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3884
3885EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3886
3887EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3888EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3889
3890EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3891
3892
3893
3894#---------------------------------------------------------------------------
3895
3896class Event(Object):
27fb7603
RD
3897 """
3898 An event is a structure holding information about an event passed to a
3899 callback or member function. wx.Event is an abstract base class for
3900 other event classes
3901 """
d55e5bfc
RD
3902 def __init__(self): raise RuntimeError, "No constructor defined"
3903 def __repr__(self):
3904 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3905 def __del__(self, destroy=_core_.delete_Event):
3906 """__del__(self)"""
3907 try:
3908 if self.thisown: destroy(self)
3909 except: pass
3910
3911 def SetEventType(*args, **kwargs):
27fb7603
RD
3912 """
3913 SetEventType(self, wxEventType typ)
3914
3915 Sets the specific type of the event.
3916 """
d55e5bfc
RD
3917 return _core_.Event_SetEventType(*args, **kwargs)
3918
3919 def GetEventType(*args, **kwargs):
27fb7603
RD
3920 """
3921 GetEventType(self) -> wxEventType
3922
3923 Returns the identifier of the given event type, such as
3924 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3925 """
d55e5bfc
RD
3926 return _core_.Event_GetEventType(*args, **kwargs)
3927
3928 def GetEventObject(*args, **kwargs):
27fb7603
RD
3929 """
3930 GetEventObject(self) -> Object
3931
3932 Returns the object (usually a window) associated with the event, if
3933 any.
3934 """
d55e5bfc
RD
3935 return _core_.Event_GetEventObject(*args, **kwargs)
3936
3937 def SetEventObject(*args, **kwargs):
27fb7603
RD
3938 """
3939 SetEventObject(self, Object obj)
3940
3941 Sets the originating object, or in other words, obj is normally the
3942 object that is sending the event.
3943 """
d55e5bfc
RD
3944 return _core_.Event_SetEventObject(*args, **kwargs)
3945
3946 def GetTimestamp(*args, **kwargs):
3947 """GetTimestamp(self) -> long"""
3948 return _core_.Event_GetTimestamp(*args, **kwargs)
3949
3950 def SetTimestamp(*args, **kwargs):
3951 """SetTimestamp(self, long ts=0)"""
3952 return _core_.Event_SetTimestamp(*args, **kwargs)
3953
3954 def GetId(*args, **kwargs):
27fb7603
RD
3955 """
3956 GetId(self) -> int
3957
3958 Returns the identifier associated with this event, such as a button
3959 command id.
3960 """
d55e5bfc
RD
3961 return _core_.Event_GetId(*args, **kwargs)
3962
3963 def SetId(*args, **kwargs):
27fb7603
RD
3964 """
3965 SetId(self, int Id)
3966
3967 Set's the ID for the event. This is usually the ID of the window that
3968 is sending the event, but it can also be a command id from a menu
3969 item, etc.
3970 """
d55e5bfc
RD
3971 return _core_.Event_SetId(*args, **kwargs)
3972
3973 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3974 """
3975 IsCommandEvent(self) -> bool
3976
3977 Returns true if the event is or is derived from `wx.CommandEvent` else
3978 it returns false. Note: Exists only for optimization purposes.
3979 """
d55e5bfc
RD
3980 return _core_.Event_IsCommandEvent(*args, **kwargs)
3981
3982 def Skip(*args, **kwargs):
51b83b37
RD
3983 """
3984 Skip(self, bool skip=True)
3985
3986 Called by an event handler, it controls whether additional event
3987 handlers bound to this event will be called after the current event
3988 handler returns. Skip(false) (the default setting) will prevent
3989 additional event handlers from being called and control will be
3990 returned to the sender of the event immediately after the current
3991 handler has finished. Skip(True) will cause the event processing
3992 system to continue searching for a handler function for this event.
3993
3994 """
d55e5bfc
RD
3995 return _core_.Event_Skip(*args, **kwargs)
3996
3997 def GetSkipped(*args, **kwargs):
27fb7603
RD
3998 """
3999 GetSkipped(self) -> bool
4000
4001 Returns true if the event handler should be skipped, false otherwise.
4002 :see: `Skip`
4003 """
d55e5bfc
RD
4004 return _core_.Event_GetSkipped(*args, **kwargs)
4005
4006 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4007 """
4008 ShouldPropagate(self) -> bool
4009
4010 Test if this event should be propagated to the parent window or not,
4011 i.e. if the propagation level is currently greater than 0.
4012 """
d55e5bfc
RD
4013 return _core_.Event_ShouldPropagate(*args, **kwargs)
4014
4015 def StopPropagation(*args, **kwargs):
27fb7603
RD
4016 """
4017 StopPropagation(self) -> int
4018
4019 Stop the event from propagating to its parent window. Returns the old
4020 propagation level value which may be later passed to
4021 `ResumePropagation` to allow propagating the event again.
4022 """
d55e5bfc
RD
4023 return _core_.Event_StopPropagation(*args, **kwargs)
4024
4025 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4026 """
4027 ResumePropagation(self, int propagationLevel)
4028
4029 Resume the event propagation by restoring the propagation level. (For
4030 example, you can use the value returned by an earlier call to
4031 `StopPropagation`.)
4032
4033 """
d55e5bfc
RD
4034 return _core_.Event_ResumePropagation(*args, **kwargs)
4035
4036 def Clone(*args, **kwargs):
4037 """Clone(self) -> Event"""
4038 return _core_.Event_Clone(*args, **kwargs)
4039
4040
4041class EventPtr(Event):
4042 def __init__(self, this):
4043 self.this = this
4044 if not hasattr(self,"thisown"): self.thisown = 0
4045 self.__class__ = Event
4046_core_.Event_swigregister(EventPtr)
4047
4048#---------------------------------------------------------------------------
4049
4050class PropagationDisabler(object):
27fb7603
RD
4051 """
4052 Helper class to temporarily change an event not to propagate. Simply
4053 create an instance of this class and then whe it is destroyed the
4054 propogation of the event will be restored.
4055 """
d55e5bfc
RD
4056 def __repr__(self):
4057 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4058 def __init__(self, *args, **kwargs):
27fb7603
RD
4059 """
4060 __init__(self, Event event) -> PropagationDisabler
4061
4062 Helper class to temporarily change an event not to propagate. Simply
4063 create an instance of this class and then whe it is destroyed the
4064 propogation of the event will be restored.
4065 """
d55e5bfc
RD
4066 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
4067 self.this = newobj.this
4068 self.thisown = 1
4069 del newobj.thisown
4070 def __del__(self, destroy=_core_.delete_PropagationDisabler):
4071 """__del__(self)"""
4072 try:
4073 if self.thisown: destroy(self)
4074 except: pass
4075
4076
4077class PropagationDisablerPtr(PropagationDisabler):
4078 def __init__(self, this):
4079 self.this = this
4080 if not hasattr(self,"thisown"): self.thisown = 0
4081 self.__class__ = PropagationDisabler
4082_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
4083
4084class PropagateOnce(object):
27fb7603
RD
4085 """
4086 A helper class that will temporarily lower propagation level of an
4087 event. Simply create an instance of this class and then whe it is
4088 destroyed the propogation of the event will be restored.
4089 """
d55e5bfc
RD
4090 def __repr__(self):
4091 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4092 def __init__(self, *args, **kwargs):
27fb7603
RD
4093 """
4094 __init__(self, Event event) -> PropagateOnce
4095
4096 A helper class that will temporarily lower propagation level of an
4097 event. Simply create an instance of this class and then whe it is
4098 destroyed the propogation of the event will be restored.
4099 """
d55e5bfc
RD
4100 newobj = _core_.new_PropagateOnce(*args, **kwargs)
4101 self.this = newobj.this
4102 self.thisown = 1
4103 del newobj.thisown
4104 def __del__(self, destroy=_core_.delete_PropagateOnce):
4105 """__del__(self)"""
4106 try:
4107 if self.thisown: destroy(self)
4108 except: pass
4109
4110
4111class PropagateOncePtr(PropagateOnce):
4112 def __init__(self, this):
4113 self.this = this
4114 if not hasattr(self,"thisown"): self.thisown = 0
4115 self.__class__ = PropagateOnce
4116_core_.PropagateOnce_swigregister(PropagateOncePtr)
4117
4118#---------------------------------------------------------------------------
4119
4120class CommandEvent(Event):
27fb7603
RD
4121 """
4122 This event class contains information about command events, which
4123 originate from a variety of simple controls, as well as menus and
4124 toolbars.
4125 """
d55e5bfc
RD
4126 def __repr__(self):
4127 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4128 def __init__(self, *args, **kwargs):
27fb7603
RD
4129 """
4130 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4131
4132 This event class contains information about command events, which
4133 originate from a variety of simple controls, as well as menus and
4134 toolbars.
4135 """
d55e5bfc
RD
4136 newobj = _core_.new_CommandEvent(*args, **kwargs)
4137 self.this = newobj.this
4138 self.thisown = 1
4139 del newobj.thisown
4140 def GetSelection(*args, **kwargs):
27fb7603
RD
4141 """
4142 GetSelection(self) -> int
4143
4144 Returns item index for a listbox or choice selection event (not valid
4145 for a deselection).
4146 """
d55e5bfc
RD
4147 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4148
4149 def SetString(*args, **kwargs):
4150 """SetString(self, String s)"""
4151 return _core_.CommandEvent_SetString(*args, **kwargs)
4152
4153 def GetString(*args, **kwargs):
27fb7603
RD
4154 """
4155 GetString(self) -> String
4156
4157 Returns item string for a listbox or choice selection event (not valid
4158 for a deselection).
4159 """
d55e5bfc
RD
4160 return _core_.CommandEvent_GetString(*args, **kwargs)
4161
4162 def IsChecked(*args, **kwargs):
27fb7603
RD
4163 """
4164 IsChecked(self) -> bool
4165
4166 This method can be used with checkbox and menu events: for the
4167 checkboxes, the method returns true for a selection event and false
4168 for a deselection one. For the menu events, this method indicates if
4169 the menu item just has become checked or unchecked (and thus only
4170 makes sense for checkable menu items).
4171 """
d55e5bfc
RD
4172 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4173
4174 Checked = IsChecked
4175 def IsSelection(*args, **kwargs):
27fb7603
RD
4176 """
4177 IsSelection(self) -> bool
4178
4179 For a listbox or similar event, returns true if it is a selection,
4180 false if it is a deselection.
4181 """
d55e5bfc
RD
4182 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4183
4184 def SetExtraLong(*args, **kwargs):
4185 """SetExtraLong(self, long extraLong)"""
4186 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4187
4188 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4189 """
4190 GetExtraLong(self) -> long
4191
5ba5649b
RD
4192 Returns extra information dependant on the event objects type. If the
4193 event comes from a listbox selection, it is a boolean determining
4194 whether the event was a selection (true) or a deselection (false). A
4195 listbox deselection only occurs for multiple-selection boxes, and in
4196 this case the index and string values are indeterminate and the
4197 listbox must be examined by the application.
27fb7603 4198 """
d55e5bfc
RD
4199 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4200
4201 def SetInt(*args, **kwargs):
4202 """SetInt(self, int i)"""
4203 return _core_.CommandEvent_SetInt(*args, **kwargs)
4204
4205 def GetInt(*args, **kwargs):
27fb7603
RD
4206 """
4207 GetInt(self) -> long
4208
5ba5649b
RD
4209 Returns the integer identifier corresponding to a listbox, choice or
4210 radiobox selection (only if the event was a selection, not a
4211 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4212 """
d55e5bfc
RD
4213 return _core_.CommandEvent_GetInt(*args, **kwargs)
4214
4215 def Clone(*args, **kwargs):
4216 """Clone(self) -> Event"""
4217 return _core_.CommandEvent_Clone(*args, **kwargs)
4218
4219
4220class CommandEventPtr(CommandEvent):
4221 def __init__(self, this):
4222 self.this = this
4223 if not hasattr(self,"thisown"): self.thisown = 0
4224 self.__class__ = CommandEvent
4225_core_.CommandEvent_swigregister(CommandEventPtr)
4226
4227#---------------------------------------------------------------------------
4228
4229class NotifyEvent(CommandEvent):
27fb7603
RD
4230 """
4231 An instance of this class (or one of its derived classes) is sent from
4232 a control when the control's state is being changed and the control
4233 allows that change to be prevented from happening. The event handler
4234 can call `Veto` or `Allow` to tell the control what to do.
4235 """
d55e5bfc
RD
4236 def __repr__(self):
4237 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4238 def __init__(self, *args, **kwargs):
27fb7603
RD
4239 """
4240 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4241
4242 An instance of this class (or one of its derived classes) is sent from
4243 a control when the control's state is being changed and the control
4244 allows that change to be prevented from happening. The event handler
4245 can call `Veto` or `Allow` to tell the control what to do.
4246 """
d55e5bfc
RD
4247 newobj = _core_.new_NotifyEvent(*args, **kwargs)
4248 self.this = newobj.this
4249 self.thisown = 1
4250 del newobj.thisown
4251 def Veto(*args, **kwargs):
27fb7603
RD
4252 """
4253 Veto(self)
4254
4255 Prevents the change announced by this event from happening.
4256
4257 It is in general a good idea to notify the user about the reasons for
4258 vetoing the change because otherwise the applications behaviour (which
4259 just refuses to do what the user wants) might be quite surprising.
4260 """
d55e5bfc
RD
4261 return _core_.NotifyEvent_Veto(*args, **kwargs)
4262
4263 def Allow(*args, **kwargs):
27fb7603
RD
4264 """
4265 Allow(self)
4266
4267 This is the opposite of `Veto`: it explicitly allows the event to be
4268 processed. For most events it is not necessary to call this method as
4269 the events are allowed anyhow but some are forbidden by default (this
4270 will be mentioned in the corresponding event description).
4271 """
d55e5bfc
RD
4272 return _core_.NotifyEvent_Allow(*args, **kwargs)
4273
4274 def IsAllowed(*args, **kwargs):
27fb7603
RD
4275 """
4276 IsAllowed(self) -> bool
4277
4278 Returns true if the change is allowed (`Veto` hasn't been called) or
4279 false otherwise (if it was).
4280 """
d55e5bfc
RD
4281 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4282
4283
4284class NotifyEventPtr(NotifyEvent):
4285 def __init__(self, this):
4286 self.this = this
4287 if not hasattr(self,"thisown"): self.thisown = 0
4288 self.__class__ = NotifyEvent
4289_core_.NotifyEvent_swigregister(NotifyEventPtr)
4290
4291#---------------------------------------------------------------------------
4292
4293class ScrollEvent(CommandEvent):
27fb7603
RD
4294 """
4295 A scroll event holds information about events sent from stand-alone
4296 scrollbars and sliders. Note that scrolled windows do not send
4297 instnaces of this event class, but send the `wx.ScrollWinEvent`
4298 instead.
4299 """
d55e5bfc
RD
4300 def __repr__(self):
4301 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4302 def __init__(self, *args, **kwargs):
4303 """
4304 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
4305 int orient=0) -> ScrollEvent
4306 """
4307 newobj = _core_.new_ScrollEvent(*args, **kwargs)
4308 self.this = newobj.this
4309 self.thisown = 1
4310 del newobj.thisown
4311 def GetOrientation(*args, **kwargs):
27fb7603
RD
4312 """
4313 GetOrientation(self) -> int
4314
4315 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4316 the scrollbar.
4317 """
d55e5bfc
RD
4318 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4319
4320 def GetPosition(*args, **kwargs):
27fb7603
RD
4321 """
4322 GetPosition(self) -> int
4323
4324 Returns the position of the scrollbar.
4325 """
d55e5bfc
RD
4326 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4327
4328 def SetOrientation(*args, **kwargs):
4329 """SetOrientation(self, int orient)"""
4330 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4331
4332 def SetPosition(*args, **kwargs):
4333 """SetPosition(self, int pos)"""
4334 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4335
4336
4337class ScrollEventPtr(ScrollEvent):
4338 def __init__(self, this):
4339 self.this = this
4340 if not hasattr(self,"thisown"): self.thisown = 0
4341 self.__class__ = ScrollEvent
4342_core_.ScrollEvent_swigregister(ScrollEventPtr)
4343
4344#---------------------------------------------------------------------------
4345
4346class ScrollWinEvent(Event):
27fb7603
RD
4347 """
4348 A wx.ScrollWinEvent holds information about scrolling and is sent from
4349 scrolling windows.
4350 """
d55e5bfc
RD
4351 def __repr__(self):
4352 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4353 def __init__(self, *args, **kwargs):
27fb7603
RD
4354 """
4355 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4356
4357 A wx.ScrollWinEvent holds information about scrolling and is sent from
4358 scrolling windows.
4359 """
d55e5bfc
RD
4360 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
4361 self.this = newobj.this
4362 self.thisown = 1
4363 del newobj.thisown
4364 def GetOrientation(*args, **kwargs):
27fb7603
RD
4365 """
4366 GetOrientation(self) -> int
4367
4368 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4369 the scrollbar.
4370 """
d55e5bfc
RD
4371 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4372
4373 def GetPosition(*args, **kwargs):
27fb7603
RD
4374 """
4375 GetPosition(self) -> int
4376
4377 Returns the position of the scrollbar for the thumb track and release
4378 events. Note that this field can't be used for the other events, you
4379 need to query the window itself for the current position in that case.
4380 """
d55e5bfc
RD
4381 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4382
4383 def SetOrientation(*args, **kwargs):
4384 """SetOrientation(self, int orient)"""
4385 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4386
4387 def SetPosition(*args, **kwargs):
4388 """SetPosition(self, int pos)"""
4389 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4390
4391
4392class ScrollWinEventPtr(ScrollWinEvent):
4393 def __init__(self, this):
4394 self.this = this
4395 if not hasattr(self,"thisown"): self.thisown = 0
4396 self.__class__ = ScrollWinEvent
4397_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
4398
4399#---------------------------------------------------------------------------
4400
4401MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4402MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4403MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4404MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4405MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4406class MouseEvent(Event):
27fb7603
RD
4407 """
4408 This event class contains information about the events generated by
4409 the mouse: they include mouse buttons press and release events and
4410 mouse move events.
4411
4412 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4413 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4414 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4415 a middle button so a portable application should avoid relying on the
4416 events from it.
4417
4418 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4419 the former returns true when the event corresponds to the left mouse
4420 button click while the latter returns true if the left mouse button is
4421 currently being pressed. For example, when the user is dragging the
4422 mouse you can use `LeftIsDown` to test whether the left mouse button
4423 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4424 `LeftIsDown` will also return true in wxWidgets whatever the
4425 underlying GUI behaviour is (which is platform-dependent). The same
4426 applies, of course, to other mouse buttons as well.
4427 """
d55e5bfc
RD
4428 def __repr__(self):
4429 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4430 def __init__(self, *args, **kwargs):
27fb7603
RD
4431 """
4432 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4433
4434 Constructs a wx.MouseEvent. Valid event types are:
4435
4436 * wxEVT_ENTER_WINDOW
4437 * wxEVT_LEAVE_WINDOW
4438 * wxEVT_LEFT_DOWN
4439 * wxEVT_LEFT_UP
4440 * wxEVT_LEFT_DCLICK
4441 * wxEVT_MIDDLE_DOWN
4442 * wxEVT_MIDDLE_UP
4443 * wxEVT_MIDDLE_DCLICK
4444 * wxEVT_RIGHT_DOWN
4445 * wxEVT_RIGHT_UP
4446 * wxEVT_RIGHT_DCLICK
4447 * wxEVT_MOTION
4448 * wxEVT_MOUSEWHEEL
4449 """
d55e5bfc
RD
4450 newobj = _core_.new_MouseEvent(*args, **kwargs)
4451 self.this = newobj.this
4452 self.thisown = 1
4453 del newobj.thisown
4454 def IsButton(*args, **kwargs):
27fb7603
RD
4455 """
4456 IsButton(self) -> bool
4457
4458 Returns true if the event was a mouse button event (not necessarily a
4459 button down event - that may be tested using `ButtonDown`).
4460 """
d55e5bfc
RD
4461 return _core_.MouseEvent_IsButton(*args, **kwargs)
4462
4463 def ButtonDown(*args, **kwargs):
27fb7603
RD
4464 """
4465 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4466
5ba5649b
RD
4467 If the argument is omitted, this returns true if the event was any
4468 mouse button down event. Otherwise the argument specifies which
4469 button-down event shold be checked for (see `Button` for the possible
4470 values).
27fb7603 4471 """
d55e5bfc
RD
4472 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4473
4474 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4475 """
4476 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4477
4478 If the argument is omitted, this returns true if the event was any
4479 mouse double click event. Otherwise the argument specifies which
4480 double click event to check for (see `Button` for the possible
4481 values).
4482 """
d55e5bfc
RD
4483 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4484
4485 def ButtonUp(*args, **kwargs):
27fb7603
RD
4486 """
4487 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4488
4489 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4490 mouse button up event. Otherwise the argument specifies which button
4491 up event to check for (see `Button` for the possible values).
27fb7603 4492 """
d55e5bfc
RD
4493 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4494
4495 def Button(*args, **kwargs):
27fb7603
RD
4496 """
4497 Button(self, int button) -> bool
4498
4499 Returns true if the identified mouse button is changing state. Valid
4500 values of button are:
4501
4502 ==================== =====================================
4503 wx.MOUSE_BTN_LEFT check if left button was pressed
4504 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4505 wx.MOUSE_BTN_RIGHT check if right button was pressed
4506 wx.MOUSE_BTN_ANY check if any button was pressed
4507 ==================== =====================================
4508
4509 """
d55e5bfc
RD
4510 return _core_.MouseEvent_Button(*args, **kwargs)
4511
4512 def ButtonIsDown(*args, **kwargs):
4513 """ButtonIsDown(self, int but) -> bool"""
4514 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4515
4516 def GetButton(*args, **kwargs):
27fb7603
RD
4517 """
4518 GetButton(self) -> int
4519
4520 Returns the mouse button which generated this event or
4521 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4522 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4523 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4524 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4525 right buttons respectively.
4526 """
d55e5bfc
RD
4527 return _core_.MouseEvent_GetButton(*args, **kwargs)
4528
4529 def ControlDown(*args, **kwargs):
27fb7603
RD
4530 """
4531 ControlDown(self) -> bool
4532
4533 Returns true if the control key was down at the time of the event.
4534 """
d55e5bfc
RD
4535 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4536
4537 def MetaDown(*args, **kwargs):
27fb7603
RD
4538 """
4539 MetaDown(self) -> bool
4540
4541 Returns true if the Meta key was down at the time of the event.
4542 """
d55e5bfc
RD
4543 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4544
4545 def AltDown(*args, **kwargs):
27fb7603
RD
4546 """
4547 AltDown(self) -> bool
4548
4549 Returns true if the Alt key was down at the time of the event.
4550 """
d55e5bfc
RD
4551 return _core_.MouseEvent_AltDown(*args, **kwargs)
4552
4553 def ShiftDown(*args, **kwargs):
27fb7603
RD
4554 """
4555 ShiftDown(self) -> bool
4556
4557 Returns true if the Shift key was down at the time of the event.
4558 """
d55e5bfc
RD
4559 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4560
412d302d
RD
4561 def CmdDown(*args, **kwargs):
4562 """
4563 CmdDown(self) -> bool
4564
4565 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4566 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4567 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4568 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4569 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4570 purpose. So for non-Mac platforms this is the same as `ControlDown`
4571 and Macs this is the same as `MetaDown`.
4572 """
4573 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4574
d55e5bfc 4575 def LeftDown(*args, **kwargs):
27fb7603
RD
4576 """
4577 LeftDown(self) -> bool
4578
4579 Returns true if the left mouse button state changed to down.
4580 """
d55e5bfc
RD
4581 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4582
4583 def MiddleDown(*args, **kwargs):
27fb7603
RD
4584 """
4585 MiddleDown(self) -> bool
4586
4587 Returns true if the middle mouse button state changed to down.
4588 """
d55e5bfc
RD
4589 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4590
4591 def RightDown(*args, **kwargs):
27fb7603
RD
4592 """
4593 RightDown(self) -> bool
4594
4595 Returns true if the right mouse button state changed to down.
4596 """
d55e5bfc
RD
4597 return _core_.MouseEvent_RightDown(*args, **kwargs)
4598
4599 def LeftUp(*args, **kwargs):
27fb7603
RD
4600 """
4601 LeftUp(self) -> bool
4602
4603 Returns true if the left mouse button state changed to up.
4604 """
d55e5bfc
RD
4605 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4606
4607 def MiddleUp(*args, **kwargs):
27fb7603
RD
4608 """
4609 MiddleUp(self) -> bool
4610
4611 Returns true if the middle mouse button state changed to up.
4612 """
d55e5bfc
RD
4613 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4614
4615 def RightUp(*args, **kwargs):
27fb7603
RD
4616 """
4617 RightUp(self) -> bool
4618
4619 Returns true if the right mouse button state changed to up.
4620 """
d55e5bfc
RD
4621 return _core_.MouseEvent_RightUp(*args, **kwargs)
4622
4623 def LeftDClick(*args, **kwargs):
27fb7603
RD
4624 """
4625 LeftDClick(self) -> bool
4626
4627 Returns true if the event was a left button double click.
4628 """
d55e5bfc
RD
4629 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4630
4631 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4632 """
4633 MiddleDClick(self) -> bool
4634
4635 Returns true if the event was a middle button double click.
4636 """
d55e5bfc
RD
4637 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4638
4639 def RightDClick(*args, **kwargs):
27fb7603
RD
4640 """
4641 RightDClick(self) -> bool
4642
4643 Returns true if the event was a right button double click.
4644 """
d55e5bfc
RD
4645 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4646
4647 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4648 """
4649 LeftIsDown(self) -> bool
4650
4651 Returns true if the left mouse button is currently down, independent
4652 of the current event type.
4653
4654 Please notice that it is not the same as LeftDown which returns true
4655 if the left mouse button was just pressed. Rather, it describes the
4656 state of the mouse button before the event happened.
4657
4658 This event is usually used in the mouse event handlers which process
4659 "move mouse" messages to determine whether the user is (still)
4660 dragging the mouse.
4661 """
d55e5bfc
RD
4662 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4663
4664 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4665 """
4666 MiddleIsDown(self) -> bool
4667
4668 Returns true if the middle mouse button is currently down, independent
4669 of the current event type.
4670 """
d55e5bfc
RD
4671 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4672
4673 def RightIsDown(*args, **kwargs):
27fb7603
RD
4674 """
4675 RightIsDown(self) -> bool
4676
4677 Returns true if the right mouse button is currently down, independent
4678 of the current event type.
4679 """
d55e5bfc
RD
4680 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4681
4682 def Dragging(*args, **kwargs):
27fb7603
RD
4683 """
4684 Dragging(self) -> bool
4685
4686 Returns true if this was a dragging event (motion while a button is
4687 depressed).
4688 """
d55e5bfc
RD
4689 return _core_.MouseEvent_Dragging(*args, **kwargs)
4690
4691 def Moving(*args, **kwargs):
27fb7603
RD
4692 """
4693 Moving(self) -> bool
4694
4695 Returns true if this was a motion event and no mouse buttons were
4696 pressed. If any mouse button is held pressed, then this method returns
4697 false and Dragging returns true.
4698 """
d55e5bfc
RD
4699 return _core_.MouseEvent_Moving(*args, **kwargs)
4700
4701 def Entering(*args, **kwargs):
27fb7603
RD
4702 """
4703 Entering(self) -> bool
4704
4705 Returns true if the mouse was entering the window.
4706 """
d55e5bfc
RD
4707 return _core_.MouseEvent_Entering(*args, **kwargs)
4708
4709 def Leaving(*args, **kwargs):
27fb7603
RD
4710 """
4711 Leaving(self) -> bool
4712
4713 Returns true if the mouse was leaving the window.
4714 """
d55e5bfc
RD
4715 return _core_.MouseEvent_Leaving(*args, **kwargs)
4716
4717 def GetPosition(*args, **kwargs):
4718 """
4719 GetPosition(self) -> Point
4720
27fb7603
RD
4721 Returns the pixel position of the mouse in window coordinates when the
4722 event happened.
d55e5bfc
RD
4723 """
4724 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4725
4726 def GetPositionTuple(*args, **kwargs):
4727 """
4728 GetPositionTuple() -> (x,y)
4729
27fb7603
RD
4730 Returns the pixel position of the mouse in window coordinates when the
4731 event happened.
d55e5bfc
RD
4732 """
4733 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4734
4735 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4736 """
4737 GetLogicalPosition(self, DC dc) -> Point
4738
4739 Returns the logical mouse position in pixels (i.e. translated
4740 according to the translation set for the DC, which usually indicates
4741 that the window has been scrolled).
4742 """
d55e5bfc
RD
4743 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4744
4745 def GetX(*args, **kwargs):
27fb7603
RD
4746 """
4747 GetX(self) -> int
4748
4749 Returns X coordinate of the physical mouse event position.
4750 """
d55e5bfc
RD
4751 return _core_.MouseEvent_GetX(*args, **kwargs)
4752
4753 def GetY(*args, **kwargs):
27fb7603
RD
4754 """
4755 GetY(self) -> int
4756
4757 Returns Y coordinate of the physical mouse event position.
4758 """
d55e5bfc
RD
4759 return _core_.MouseEvent_GetY(*args, **kwargs)
4760
4761 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4762 """
4763 GetWheelRotation(self) -> int
4764
4765 Get wheel rotation, positive or negative indicates direction of
4766 rotation. Current devices all send an event when rotation is equal to
4767 +/-WheelDelta, but this allows for finer resolution devices to be
4768 created in the future. Because of this you shouldn't assume that one
4769 event is equal to 1 line or whatever, but you should be able to either
4770 do partial line scrolling or wait until +/-WheelDelta rotation values
4771 have been accumulated before scrolling.
4772 """
d55e5bfc
RD
4773 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4774
4775 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4776 """
4777 GetWheelDelta(self) -> int
4778
4779 Get wheel delta, normally 120. This is the threshold for action to be
4780 taken, and one such action (for example, scrolling one increment)
4781 should occur for each delta.
4782 """
d55e5bfc
RD
4783 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4784
4785 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4786 """
4787 GetLinesPerAction(self) -> int
4788
4789 Returns the configured number of lines (or whatever) to be scrolled
4790 per wheel action. Defaults to three.
4791 """
d55e5bfc
RD
4792 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4793
4794 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4795 """
4796 IsPageScroll(self) -> bool
4797
4798 Returns true if the system has been setup to do page scrolling with
4799 the mouse wheel instead of line scrolling.
4800 """
d55e5bfc
RD
4801 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4802
4803 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4804 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4805 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4806 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4807 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4808 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4809 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4810 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4811 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4812 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4813 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4814 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4815
4816class MouseEventPtr(MouseEvent):
4817 def __init__(self, this):
4818 self.this = this
4819 if not hasattr(self,"thisown"): self.thisown = 0
4820 self.__class__ = MouseEvent
4821_core_.MouseEvent_swigregister(MouseEventPtr)
4822
4823#---------------------------------------------------------------------------
4824
4825class SetCursorEvent(Event):
5ba5649b
RD
4826 """
4827 A SetCursorEvent is generated when the mouse cursor is about to be set
4828 as a result of mouse motion. This event gives the application the
4829 chance to perform specific mouse cursor processing based on the
4830 current position of the mouse within the window. Use the `SetCursor`
4831 method to specify the cursor you want to be displayed.
4832 """
d55e5bfc
RD
4833 def __repr__(self):
4834 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4835 def __init__(self, *args, **kwargs):
5ba5649b
RD
4836 """
4837 __init__(self, int x=0, int y=0) -> SetCursorEvent
4838
4839 Construct a new `wx.SetCursorEvent`.
4840 """
d55e5bfc
RD
4841 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
4842 self.this = newobj.this
4843 self.thisown = 1
4844 del newobj.thisown
4845 def GetX(*args, **kwargs):
5ba5649b
RD
4846 """
4847 GetX(self) -> int
4848
4849 Returns the X coordinate of the mouse in client coordinates.
4850 """
d55e5bfc
RD
4851 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4852
4853 def GetY(*args, **kwargs):
5ba5649b
RD
4854 """
4855 GetY(self) -> int
4856
4857 Returns the Y coordinate of the mouse in client coordinates.
4858 """
d55e5bfc
RD
4859 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4860
4861 def SetCursor(*args, **kwargs):
5ba5649b
RD
4862 """
4863 SetCursor(self, Cursor cursor)
4864
4865 Sets the cursor associated with this event.
4866 """
d55e5bfc
RD
4867 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4868
4869 def GetCursor(*args, **kwargs):
5ba5649b
RD
4870 """
4871 GetCursor(self) -> Cursor
4872
4873 Returns a reference to the cursor specified by this event.
4874 """
d55e5bfc
RD
4875 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4876
4877 def HasCursor(*args, **kwargs):
5ba5649b
RD
4878 """
4879 HasCursor(self) -> bool
4880
4881 Returns true if the cursor specified by this event is a valid cursor.
4882 """
d55e5bfc
RD
4883 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4884
4885
4886class SetCursorEventPtr(SetCursorEvent):
4887 def __init__(self, this):
4888 self.this = this
4889 if not hasattr(self,"thisown"): self.thisown = 0
4890 self.__class__ = SetCursorEvent
4891_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
4892
4893#---------------------------------------------------------------------------
4894
4895class KeyEvent(Event):
5ba5649b
RD
4896 """
4897 This event class contains information about keypress and character
4898 events. These events are only sent to the widget that currently has
4899 the keyboard focus.
4900
4901 Notice that there are three different kinds of keyboard events in
4902 wxWidgets: key down and up events and char events. The difference
4903 between the first two is clear - the first corresponds to a key press
4904 and the second to a key release - otherwise they are identical. Just
4905 note that if the key is maintained in a pressed state you will
4906 typically get a lot of (automatically generated) down events but only
4907 one up so it is wrong to assume that there is one up event
4908 corresponding to each down one.
4909
4910 Both key events provide untranslated key codes while the char event
4911 carries the translated one. The untranslated code for alphanumeric
4912 keys is always an upper case value. For the other keys it is one of
4913 WXK_XXX values from the keycodes table. The translated key is, in
4914 general, the character the user expects to appear as the result of the
4915 key combination when typing the text into a text entry zone, for
4916 example.
4917
4918 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4919 and the standard US keyboard): when the 'A' key is pressed, the key
4920 down event key code is equal to ASCII A == 65. But the char event key
4921 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4922 'A' keys simultaneously , the key code in key down event will still be
4923 just 'A' while the char event key code parameter will now be 'A' as
4924 well.
4925
4926 Although in this simple case it is clear that the correct key code
4927 could be found in the key down event handler by checking the value
4928 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4929 as for non alphanumeric keys or non-US keyboard layouts the
4930 translation is keyboard-layout dependent and can only be done properly
4931 by the system itself.
4932
4933 Another kind of translation is done when the control key is pressed:
4934 for example, for CTRL-A key press the key down event still carries the
4935 same key code 'A' as usual but the char event will have key code of 1,
4936 the ASCII value of this key combination.
4937
4938 You may discover how the other keys on your system behave
4939 interactively by running the KeyEvents sample in the wxPython demo and
4940 pressing some keys while the blue box at the top has the keyboard
4941 focus.
4942
4943 **Note**: If a key down event is caught and the event handler does not
4944 call event.Skip() then the coresponding char event will not
4945 happen. This is by design and enables the programs that handle both
4946 types of events to be a bit simpler.
4947
4948 **Note for Windows programmers**: The key and char events in wxWidgets
4949 are similar to but slightly different from Windows WM_KEYDOWN and
4950 WM_CHAR events. In particular, Alt-x combination will generate a char
4951 event in wxWidgets (unless it is used as an accelerator).
4952
4953 **Tip**: be sure to call event.Skip() for events that you don't
4954 process in key event function, otherwise menu shortcuts may cease to
4955 work under Windows.
4956
4957 """
d55e5bfc
RD
4958 def __repr__(self):
4959 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4960 def __init__(self, *args, **kwargs):
5ba5649b
RD
4961 """
4962 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
4963
4964 Construct a new `wx.KeyEvent`. Valid event types are:
4965 *
4966 """
d55e5bfc
RD
4967 newobj = _core_.new_KeyEvent(*args, **kwargs)
4968 self.this = newobj.this
4969 self.thisown = 1
4970 del newobj.thisown
4971 def ControlDown(*args, **kwargs):
5ba5649b
RD
4972 """
4973 ControlDown(self) -> bool
4974
4975 Returns ``True`` if the Control key was down at the time of the event.
4976 """
d55e5bfc
RD
4977 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4978
4979 def MetaDown(*args, **kwargs):
5ba5649b
RD
4980 """
4981 MetaDown(self) -> bool
4982
4983 Returns ``True`` if the Meta key was down at the time of the event.
4984 """
d55e5bfc
RD
4985 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4986
4987 def AltDown(*args, **kwargs):
5ba5649b
RD
4988 """
4989 AltDown(self) -> bool
4990
4991 Returns ``True`` if the Alt key was down at the time of the event.
4992 """
d55e5bfc
RD
4993 return _core_.KeyEvent_AltDown(*args, **kwargs)
4994
4995 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4996 """
4997 ShiftDown(self) -> bool
4998
4999 Returns ``True`` if the Shift key was down at the time of the event.
5000 """
d55e5bfc
RD
5001 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
5002
412d302d
RD
5003 def CmdDown(*args, **kwargs):
5004 """
5005 CmdDown(self) -> bool
5006
5007 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5008 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5009 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5010 because Cmd key is used for the same thing under Mac as Ctrl
5011 elsewhere. The Ctrl still exists, it's just not used for this
5012 purpose. So for non-Mac platforms this is the same as `ControlDown`
5013 and Macs this is the same as `MetaDown`.
5014 """
5015 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5016
d55e5bfc 5017 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5018 """
5019 HasModifiers(self) -> bool
5020
5021 Returns true if either CTRL or ALT keys was down at the time of the
5022 key event. Note that this function does not take into account neither
5023 SHIFT nor META key states (the reason for ignoring the latter is that
5024 it is common for NUMLOCK key to be configured as META under X but the
5025 key presses even while NUMLOCK is on should be still processed
5026 normally).
5027 """
d55e5bfc
RD
5028 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
5029
5030 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5031 """
5032 GetKeyCode(self) -> int
5033
5034 Returns the virtual key code. ASCII events return normal ASCII values,
5035 while non-ASCII events return values such as WXK_LEFT for the left
5036 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5037 codes.
5038
5039 Note that in Unicode build, the returned value is meaningful only if
5040 the user entered a character that can be represented in current
5041 locale's default charset. You can obtain the corresponding Unicode
5042 character using `GetUnicodeKey`.
5043 """
d55e5bfc
RD
5044 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
5045
5046 KeyCode = GetKeyCode
19272049 5047 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5048 """
5049 GetUnicodeKey(self) -> int
5050
5051 Returns the Unicode character corresponding to this key event. This
5052 function is only meaningfule in a Unicode build of wxPython.
5053 """
19272049 5054 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 5055
19272049 5056 GetUniChar = GetUnicodeKey
d55e5bfc 5057 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5058 """
5059 GetRawKeyCode(self) -> unsigned int
5060
5061 Returns the raw key code for this event. This is a platform-dependent
5062 scan code which should only be used in advanced
5063 applications. Currently the raw key codes are not supported by all
5064 ports.
5065 """
d55e5bfc
RD
5066 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
5067
5068 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5069 """
5070 GetRawKeyFlags(self) -> unsigned int
5071
5072 Returns the low level key flags for this event. The flags are
5073 platform-dependent and should only be used in advanced applications.
5074 Currently the raw key flags are not supported by all ports.
5075 """
d55e5bfc
RD
5076 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
5077
5078 def GetPosition(*args, **kwargs):
5079 """
5080 GetPosition(self) -> Point
5081
5ba5649b 5082 Find the position of the event, if applicable.
d55e5bfc
RD
5083 """
5084 return _core_.KeyEvent_GetPosition(*args, **kwargs)
5085
5086 def GetPositionTuple(*args, **kwargs):
5087 """
5088 GetPositionTuple() -> (x,y)
5089
5ba5649b 5090 Find the position of the event, if applicable.
d55e5bfc
RD
5091 """
5092 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
5093
5094 def GetX(*args, **kwargs):
5ba5649b
RD
5095 """
5096 GetX(self) -> int
5097
5098 Returns the X position (in client coordinates) of the event, if
5099 applicable.
5100 """
d55e5bfc
RD
5101 return _core_.KeyEvent_GetX(*args, **kwargs)
5102
5103 def GetY(*args, **kwargs):
5ba5649b
RD
5104 """
5105 GetY(self) -> int
5106
5107 Returns the Y position (in client coordinates) of the event, if
5108 applicable.
5109 """
d55e5bfc
RD
5110 return _core_.KeyEvent_GetY(*args, **kwargs)
5111
5112 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5113 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5114 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5115 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5116 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5117 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5118 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5119 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5120 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5121 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5122
5123class KeyEventPtr(KeyEvent):
5124 def __init__(self, this):
5125 self.this = this
5126 if not hasattr(self,"thisown"): self.thisown = 0
5127 self.__class__ = KeyEvent
5128_core_.KeyEvent_swigregister(KeyEventPtr)
5129
5130#---------------------------------------------------------------------------
5131
5132class SizeEvent(Event):
5ba5649b
RD
5133 """
5134 A size event holds information about size change events. The EVT_SIZE
5135 handler function will be called when the window it is bound to has
5136 been resized.
5137
5138 Note that the size passed is of the whole window: call
5139 `wx.Window.GetClientSize` for the area which may be used by the
5140 application.
5141
5142 When a window is resized, usually only a small part of the window is
5143 damaged and and that area is all that is in the update region for the
5144 next paint event. However, if your drawing depends on the size of the
5145 window, you may need to clear the DC explicitly and repaint the whole
5146 window. In which case, you may need to call `wx.Window.Refresh` to
5147 invalidate the entire window.
5148
5149 """
d55e5bfc
RD
5150 def __repr__(self):
5151 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5152 def __init__(self, *args, **kwargs):
5ba5649b
RD
5153 """
5154 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5155
5156 Construct a new ``wx.SizeEvent``.
5157 """
d55e5bfc
RD
5158 newobj = _core_.new_SizeEvent(*args, **kwargs)
5159 self.this = newobj.this
5160 self.thisown = 1
5161 del newobj.thisown
5162 def GetSize(*args, **kwargs):
5ba5649b
RD
5163 """
5164 GetSize(self) -> Size
5165
5166 Returns the entire size of the window generating the size change
5167 event.
5168 """
d55e5bfc
RD
5169 return _core_.SizeEvent_GetSize(*args, **kwargs)
5170
5171 def GetRect(*args, **kwargs):
5172 """GetRect(self) -> Rect"""
5173 return _core_.SizeEvent_GetRect(*args, **kwargs)
5174
5175 def SetRect(*args, **kwargs):
5176 """SetRect(self, Rect rect)"""
5177 return _core_.SizeEvent_SetRect(*args, **kwargs)
5178
5179 def SetSize(*args, **kwargs):
5180 """SetSize(self, Size size)"""
5181 return _core_.SizeEvent_SetSize(*args, **kwargs)
5182
5183 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5184 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
5185
5186class SizeEventPtr(SizeEvent):
5187 def __init__(self, this):
5188 self.this = this
5189 if not hasattr(self,"thisown"): self.thisown = 0
5190 self.__class__ = SizeEvent
5191_core_.SizeEvent_swigregister(SizeEventPtr)
5192
5193#---------------------------------------------------------------------------
5194
5195class MoveEvent(Event):
5ba5649b
RD
5196 """
5197 This event object is sent for EVT_MOVE event bindings when a window is
5198 moved to a new position.
5199 """
d55e5bfc
RD
5200 def __repr__(self):
5201 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5202 def __init__(self, *args, **kwargs):
5ba5649b
RD
5203 """
5204 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5205
5206 Constructor.
5207 """
d55e5bfc
RD
5208 newobj = _core_.new_MoveEvent(*args, **kwargs)
5209 self.this = newobj.this
5210 self.thisown = 1
5211 del newobj.thisown
5212 def GetPosition(*args, **kwargs):
5ba5649b
RD
5213 """
5214 GetPosition(self) -> Point
5215
5216 Returns the position of the window generating the move change event.
5217 """
d55e5bfc
RD
5218 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5219
5220 def GetRect(*args, **kwargs):
5221 """GetRect(self) -> Rect"""
5222 return _core_.MoveEvent_GetRect(*args, **kwargs)
5223
5224 def SetRect(*args, **kwargs):
5225 """SetRect(self, Rect rect)"""
5226 return _core_.MoveEvent_SetRect(*args, **kwargs)
5227
5228 def SetPosition(*args, **kwargs):
5229 """SetPosition(self, Point pos)"""
5230 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5231
fef4c27a
RD
5232 m_pos = property(GetPosition, SetPosition)
5233 m_rect = property(GetRect, SetRect)
5234
d55e5bfc
RD
5235
5236class MoveEventPtr(MoveEvent):
5237 def __init__(self, this):
5238 self.this = this
5239 if not hasattr(self,"thisown"): self.thisown = 0
5240 self.__class__ = MoveEvent
5241_core_.MoveEvent_swigregister(MoveEventPtr)
5242
5243#---------------------------------------------------------------------------
5244
5245class PaintEvent(Event):
5ba5649b
RD
5246 """
5247 A paint event is sent when a window's contents needs to be repainted.
5248 Note that in an EVT_PAINT handler the application must *always* create
5249 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5250 Windows assumes that the window has not been painted yet and will send
5251 the event again, causing endless refreshes.
5252
5253 You can optimize painting by retrieving the rectangles that have been
5254 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5255 and only repainting these rectangles. The rectangles are in terms of
5256 the client area, and are unscrolled, so you will need to do some
5257 calculations using the current view position to obtain logical,
5258 scrolled units.
5259
5260 """
d55e5bfc
RD
5261 def __repr__(self):
5262 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5263 def __init__(self, *args, **kwargs):
5264 """__init__(self, int Id=0) -> PaintEvent"""
5265 newobj = _core_.new_PaintEvent(*args, **kwargs)
5266 self.this = newobj.this
5267 self.thisown = 1
5268 del newobj.thisown
5269
5270class PaintEventPtr(PaintEvent):
5271 def __init__(self, this):
5272 self.this = this
5273 if not hasattr(self,"thisown"): self.thisown = 0
5274 self.__class__ = PaintEvent
5275_core_.PaintEvent_swigregister(PaintEventPtr)
5276
5277class NcPaintEvent(Event):
093d3ff1 5278 """Proxy of C++ NcPaintEvent class"""
d55e5bfc
RD
5279 def __repr__(self):
5280 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5281 def __init__(self, *args, **kwargs):
5282 """__init__(self, int winid=0) -> NcPaintEvent"""
5283 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
5284 self.this = newobj.this
5285 self.thisown = 1
5286 del newobj.thisown
5287
5288class NcPaintEventPtr(NcPaintEvent):
5289 def __init__(self, this):
5290 self.this = this
5291 if not hasattr(self,"thisown"): self.thisown = 0
5292 self.__class__ = NcPaintEvent
5293_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
5294
5295#---------------------------------------------------------------------------
5296
5297class EraseEvent(Event):
5ba5649b
RD
5298 """
5299 An erase event is sent whenever the background of a window needs to be
5300 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5301 binder. On some platforms, such as GTK+, this event is simulated
5302 (simply generated just before the paint event) and may cause flicker.
5303
5304 To paint a custom background use the `GetDC` method and use the returned
5305 device context if it is not ``None``, otherwise create a temporary
5306 `wx.ClientDC` and draw on that.
5307
5308 """
d55e5bfc
RD
5309 def __repr__(self):
5310 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5311 def __init__(self, *args, **kwargs):
5ba5649b
RD
5312 """
5313 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5314
5315 Constructor
5316 """
d55e5bfc
RD
5317 newobj = _core_.new_EraseEvent(*args, **kwargs)
5318 self.this = newobj.this
5319 self.thisown = 1
5320 del newobj.thisown
5321 def GetDC(*args, **kwargs):
5ba5649b
RD
5322 """
5323 GetDC(self) -> DC
5324
5325 Returns the device context the event handler should draw upon. If
5326 ``None`` is returned then create a temporary `wx.ClientDC` and use
5327 that instead.
5328 """
d55e5bfc
RD
5329 return _core_.EraseEvent_GetDC(*args, **kwargs)
5330
5331
5332class EraseEventPtr(EraseEvent):
5333 def __init__(self, this):
5334 self.this = this
5335 if not hasattr(self,"thisown"): self.thisown = 0
5336 self.__class__ = EraseEvent
5337_core_.EraseEvent_swigregister(EraseEventPtr)
5338
5339#---------------------------------------------------------------------------
5340
5341class FocusEvent(Event):
5ba5649b
RD
5342 """
5343 A focus event is sent when a window's focus changes. The window losing
5344 focus receives an EVT_KILL_FOCUS event while the window gaining it
5345 gets an EVT_SET_FOCUS event.
5346
5347 Notice that the set focus event happens both when the user gives focus
5348 to the window (whether using the mouse or keyboard) and when it is
5349 done from the program itself using `wx.Window.SetFocus`.
5350
5351 """
d55e5bfc
RD
5352 def __repr__(self):
5353 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5354 def __init__(self, *args, **kwargs):
5ba5649b
RD
5355 """
5356 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5357
5358 Constructor
5359 """
d55e5bfc
RD
5360 newobj = _core_.new_FocusEvent(*args, **kwargs)
5361 self.this = newobj.this
5362 self.thisown = 1
5363 del newobj.thisown
5364 def GetWindow(*args, **kwargs):
5ba5649b
RD
5365 """
5366 GetWindow(self) -> Window
5367
5368 Returns the other window associated with this event, that is the
5369 window which had the focus before for the EVT_SET_FOCUS event and the
5370 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5371
5372 Warning: the window returned may be None!
5373 """
d55e5bfc
RD
5374 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5375
5376 def SetWindow(*args, **kwargs):
5377 """SetWindow(self, Window win)"""
5378 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5379
5380
5381class FocusEventPtr(FocusEvent):
5382 def __init__(self, this):
5383 self.this = this
5384 if not hasattr(self,"thisown"): self.thisown = 0
5385 self.__class__ = FocusEvent
5386_core_.FocusEvent_swigregister(FocusEventPtr)
5387
5388#---------------------------------------------------------------------------
5389
5390class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5391 """
5392 wx.ChildFocusEvent notifies the parent that a child has received the
5393 focus. Unlike `wx.FocusEvent` it is propagated up the window
5394 heirarchy.
5395 """
d55e5bfc
RD
5396 def __repr__(self):
5397 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5398 def __init__(self, *args, **kwargs):
5ba5649b
RD
5399 """
5400 __init__(self, Window win=None) -> ChildFocusEvent
5401
5402 Constructor
5403 """
d55e5bfc
RD
5404 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
5405 self.this = newobj.this
5406 self.thisown = 1
5407 del newobj.thisown
5408 def GetWindow(*args, **kwargs):
5ba5649b
RD
5409 """
5410 GetWindow(self) -> Window
5411
5412 The window which has just received the focus.
5413 """
d55e5bfc
RD
5414 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5415
5416
5417class ChildFocusEventPtr(ChildFocusEvent):
5418 def __init__(self, this):
5419 self.this = this
5420 if not hasattr(self,"thisown"): self.thisown = 0
5421 self.__class__ = ChildFocusEvent
5422_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
5423
5424#---------------------------------------------------------------------------
5425
5426class ActivateEvent(Event):
5ba5649b
RD
5427 """
5428 An activate event is sent when a top-level window or the entire
5429 application is being activated or deactivated.
5430
5431 A top-level window (a dialog or frame) receives an activate event when
5432 is being activated or deactivated. This is indicated visually by the
5433 title bar changing colour, and a subwindow gaining the keyboard focus.
5434 An application is activated or deactivated when one of its frames
5435 becomes activated, or a frame becomes inactivate resulting in all
5436 application frames being inactive.
5437
5438 Please note that usually you should call event.Skip() in your handlers
5439 for these events so the default handlers will still be called, as not
5440 doing so can result in strange effects.
5441
5442 """
d55e5bfc
RD
5443 def __repr__(self):
5444 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5445 def __init__(self, *args, **kwargs):
5ba5649b
RD
5446 """
5447 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5448
5449 Constructor
5450 """
d55e5bfc
RD
5451 newobj = _core_.new_ActivateEvent(*args, **kwargs)
5452 self.this = newobj.this
5453 self.thisown = 1
5454 del newobj.thisown
5455 def GetActive(*args, **kwargs):
5ba5649b
RD
5456 """
5457 GetActive(self) -> bool
5458
5459 Returns true if the application or window is being activated, false
5460 otherwise.
5461 """
d55e5bfc
RD
5462 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5463
5464
5465class ActivateEventPtr(ActivateEvent):
5466 def __init__(self, this):
5467 self.this = this
5468 if not hasattr(self,"thisown"): self.thisown = 0
5469 self.__class__ = ActivateEvent
5470_core_.ActivateEvent_swigregister(ActivateEventPtr)
5471
5472#---------------------------------------------------------------------------
5473
5474class InitDialogEvent(Event):
5ba5649b
RD
5475 """
5476 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5477 any window when `wx.Window.InitDialog` is called. Handlers for this
5478 event can transfer data to the window, or anything else that should be
5479 done before the user begins editing the form. The default handler
5480 calls `wx.Window.TransferDataToWindow`.
5481 """
d55e5bfc
RD
5482 def __repr__(self):
5483 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5484 def __init__(self, *args, **kwargs):
5ba5649b
RD
5485 """
5486 __init__(self, int Id=0) -> InitDialogEvent
5487
5488 Constructor
5489 """
d55e5bfc
RD
5490 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
5491 self.this = newobj.this
5492 self.thisown = 1
5493 del newobj.thisown
5494
5495class InitDialogEventPtr(InitDialogEvent):
5496 def __init__(self, this):
5497 self.this = this
5498 if not hasattr(self,"thisown"): self.thisown = 0
5499 self.__class__ = InitDialogEvent
5500_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
5501
5502#---------------------------------------------------------------------------
5503
5504class MenuEvent(Event):
5ba5649b
RD
5505 """
5506 This class is used for a variety of menu-related events. Note that
5507 these do not include menu command events, which are handled by sending
5508 `wx.CommandEvent` objects.
5509
5510 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5511 text in the first field of the status bar.
5512 """
d55e5bfc
RD
5513 def __repr__(self):
5514 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5515 def __init__(self, *args, **kwargs):
5ba5649b
RD
5516 """
5517 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5518
5519 Constructor
5520 """
d55e5bfc
RD
5521 newobj = _core_.new_MenuEvent(*args, **kwargs)
5522 self.this = newobj.this
5523 self.thisown = 1
5524 del newobj.thisown
5525 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5526 """
5527 GetMenuId(self) -> int
5528
5529 Returns the menu identifier associated with the event. This method
5530 should be only used with the HIGHLIGHT events.
5531 """
d55e5bfc
RD
5532 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5533
5534 def IsPopup(*args, **kwargs):
5ba5649b
RD
5535 """
5536 IsPopup(self) -> bool
5537
5538 Returns ``True`` if the menu which is being opened or closed is a
5539 popup menu, ``False`` if it is a normal one. This method should only
5540 be used with the OPEN and CLOSE events.
5541 """
d55e5bfc
RD
5542 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5543
5544 def GetMenu(*args, **kwargs):
5ba5649b
RD
5545 """
5546 GetMenu(self) -> Menu
5547
5548 Returns the menu which is being opened or closed. This method should
5549 only be used with the OPEN and CLOSE events.
5550 """
d55e5bfc
RD
5551 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5552
5553
5554class MenuEventPtr(MenuEvent):
5555 def __init__(self, this):
5556 self.this = this
5557 if not hasattr(self,"thisown"): self.thisown = 0
5558 self.__class__ = MenuEvent
5559_core_.MenuEvent_swigregister(MenuEventPtr)
5560
5561#---------------------------------------------------------------------------
5562
5563class CloseEvent(Event):
5ba5649b
RD
5564 """
5565 This event class contains information about window and session close
5566 events.
5567
5568 The handler function for EVT_CLOSE is called when the user has tried
5569 to close a a frame or dialog box using the window manager controls or
5570 the system menu. It can also be invoked by the application itself
5571 programmatically, for example by calling the `wx.Window.Close`
5572 function.
5573
5574 You should check whether the application is forcing the deletion of
5575 the window using `CanVeto`. If it returns ``False``, you must destroy
5576 the window using `wx.Window.Destroy`. If the return value is ``True``,
5577 it is up to you whether you respond by destroying the window or not.
5578 For example you may wish to display a message dialog prompting to save
5579 files or to cancel the close.
5580
5581 If you don't destroy the window, you should call `Veto` to let the
5582 calling code know that you did not destroy the window. This allows the
5583 `wx.Window.Close` function to return ``True`` or ``False`` depending
5584 on whether the close instruction was honored or not.
5585 """
d55e5bfc
RD
5586 def __repr__(self):
5587 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5588 def __init__(self, *args, **kwargs):
5ba5649b
RD
5589 """
5590 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5591
5592 Constructor.
5593 """
d55e5bfc
RD
5594 newobj = _core_.new_CloseEvent(*args, **kwargs)
5595 self.this = newobj.this
5596 self.thisown = 1
5597 del newobj.thisown
5598 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5599 """
5600 SetLoggingOff(self, bool logOff)
5601
5602 Sets the 'logging off' flag.
5603 """
d55e5bfc
RD
5604 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5605
5606 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5607 """
5608 GetLoggingOff(self) -> bool
5609
034e3677
RD
5610 Returns ``True`` if the user is logging off or ``False`` if the
5611 system is shutting down. This method can only be called for end
5612 session and query end session events, it doesn't make sense for close
5613 window event.
5ba5649b 5614 """
d55e5bfc
RD
5615 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5616
5617 def Veto(*args, **kwargs):
5ba5649b
RD
5618 """
5619 Veto(self, bool veto=True)
5620
5621 Call this from your event handler to veto a system shutdown or to
5622 signal to the calling application that a window close did not happen.
5623
5624 You can only veto a shutdown or close if `CanVeto` returns true.
5625 """
d55e5bfc
RD
5626 return _core_.CloseEvent_Veto(*args, **kwargs)
5627
5ba5649b
RD
5628 def GetVeto(*args, **kwargs):
5629 """GetVeto(self) -> bool"""
5630 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5631
d55e5bfc 5632 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5633 """
5634 SetCanVeto(self, bool canVeto)
5635
5636 Sets the 'can veto' flag.
5637 """
d55e5bfc
RD
5638 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5639
5640 def CanVeto(*args, **kwargs):
5ba5649b
RD
5641 """
5642 CanVeto(self) -> bool
d55e5bfc 5643
5ba5649b
RD
5644 Returns true if you can veto a system shutdown or a window close
5645 event. Vetoing a window close event is not possible if the calling
5646 code wishes to force the application to exit, and so this function
5647 must be called to check this.
5648 """
5649 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc
RD
5650
5651
5652class CloseEventPtr(CloseEvent):
5653 def __init__(self, this):
5654 self.this = this
5655 if not hasattr(self,"thisown"): self.thisown = 0
5656 self.__class__ = CloseEvent
5657_core_.CloseEvent_swigregister(CloseEventPtr)
5658
5659#---------------------------------------------------------------------------
5660
5661class ShowEvent(Event):
5ba5649b 5662 """An EVT_SHOW event is sent when a window is shown or hidden."""
d55e5bfc
RD
5663 def __repr__(self):
5664 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5665 def __init__(self, *args, **kwargs):
5ba5649b
RD
5666 """
5667 __init__(self, int winid=0, bool show=False) -> ShowEvent
5668
5669 An EVT_SHOW event is sent when a window is shown or hidden.
5670 """
d55e5bfc
RD
5671 newobj = _core_.new_ShowEvent(*args, **kwargs)
5672 self.this = newobj.this
5673 self.thisown = 1
5674 del newobj.thisown
5675 def SetShow(*args, **kwargs):
5676 """SetShow(self, bool show)"""
5677 return _core_.ShowEvent_SetShow(*args, **kwargs)
5678
5679 def GetShow(*args, **kwargs):
5680 """GetShow(self) -> bool"""
5681 return _core_.ShowEvent_GetShow(*args, **kwargs)
5682
5683
5684class ShowEventPtr(ShowEvent):
5685 def __init__(self, this):
5686 self.this = this
5687 if not hasattr(self,"thisown"): self.thisown = 0
5688 self.__class__ = ShowEvent
5689_core_.ShowEvent_swigregister(ShowEventPtr)
5690
5691#---------------------------------------------------------------------------
5692
5693class IconizeEvent(Event):
5ba5649b
RD
5694 """
5695 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5696 restored.
5697 """
d55e5bfc
RD
5698 def __repr__(self):
5699 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5700 def __init__(self, *args, **kwargs):
5ba5649b
RD
5701 """
5702 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5703
5704 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5705 restored.
5706 """
d55e5bfc
RD
5707 newobj = _core_.new_IconizeEvent(*args, **kwargs)
5708 self.this = newobj.this
5709 self.thisown = 1
5710 del newobj.thisown
5711 def Iconized(*args, **kwargs):
5ba5649b
RD
5712 """
5713 Iconized(self) -> bool
5714
5715 Returns ``True`` if the frame has been iconized, ``False`` if it has
5716 been restored.
5717 """
d55e5bfc
RD
5718 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5719
5720
5721class IconizeEventPtr(IconizeEvent):
5722 def __init__(self, this):
5723 self.this = this
5724 if not hasattr(self,"thisown"): self.thisown = 0
5725 self.__class__ = IconizeEvent
5726_core_.IconizeEvent_swigregister(IconizeEventPtr)
5727
5728#---------------------------------------------------------------------------
5729
5730class MaximizeEvent(Event):
5ba5649b 5731 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
d55e5bfc
RD
5732 def __repr__(self):
5733 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5734 def __init__(self, *args, **kwargs):
5ba5649b
RD
5735 """
5736 __init__(self, int id=0) -> MaximizeEvent
5737
5738 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5739 """
d55e5bfc
RD
5740 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
5741 self.this = newobj.this
5742 self.thisown = 1
5743 del newobj.thisown
5744
5745class MaximizeEventPtr(MaximizeEvent):
5746 def __init__(self, this):
5747 self.this = this
5748 if not hasattr(self,"thisown"): self.thisown = 0
5749 self.__class__ = MaximizeEvent
5750_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
5751
5752#---------------------------------------------------------------------------
5753
5754class DropFilesEvent(Event):
5ba5649b
RD
5755 """
5756 This class is used for drop files events, that is, when files have
5757 been dropped onto the window. This functionality is only available
5758 under Windows. The window must have previously been enabled for
5759 dropping by calling `wx.Window.DragAcceptFiles`.
5760
5761 Important note: this is a separate implementation to the more general
5762 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5763 implementation uses the older, Windows message-based approach of
5764 dropping files.
5765
5766 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5767 events.
5768
5769 """
d55e5bfc
RD
5770 def __init__(self): raise RuntimeError, "No constructor defined"
5771 def __repr__(self):
5772 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5773 def GetPosition(*args, **kwargs):
5ba5649b
RD
5774 """
5775 GetPosition(self) -> Point
5776
5777 Returns the position at which the files were dropped.
5778 """
d55e5bfc
RD
5779 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5780
5781 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5782 """
5783 GetNumberOfFiles(self) -> int
5784
5785 Returns the number of files dropped.
5786 """
d55e5bfc
RD
5787 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5788
5789 def GetFiles(*args, **kwargs):
5ba5649b
RD
5790 """
5791 GetFiles(self) -> PyObject
5792
5793 Returns a list of the filenames that were dropped.
5794 """
d55e5bfc
RD
5795 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5796
5797
5798class DropFilesEventPtr(DropFilesEvent):
5799 def __init__(self, this):
5800 self.this = this
5801 if not hasattr(self,"thisown"): self.thisown = 0
5802 self.__class__ = DropFilesEvent
5803_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
5804
5805#---------------------------------------------------------------------------
5806
5807UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5808UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5809class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5810 """
5811 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5812 wxWidgets to give an application the chance to update various user
5813 interface elements.
5814
5815 Without update UI events, an application has to work hard to
5816 check/uncheck, enable/disable, and set the text for elements such as
5817 menu items and toolbar buttons. The code for doing this has to be
5818 mixed up with the code that is invoked when an action is invoked for a
5819 menu item or button.
5820
5821 With update UI events, you define an event handler to look at the
5822 state of the application and change UI elements accordingly. wxWidgets
5823 will call your handler functions in idle time, so you don't have to
5824 worry where to call this code. In addition to being a clearer and more
5825 declarative method, it also means you don't have to worry whether
5826 you're updating a toolbar or menubar identifier. The same handler can
5827 update a menu item and toolbar button, if the ID values are the same.
5828
5829 Instead of directly manipulating the menu or button, you call
5830 functions in the event object, such as `Check`. wxWidgets will
5831 determine whether such a call has been made, and which UI element to
5832 update.
5833
5834 These events will work for popup menus as well as menubars. Just
5835 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5836 any UI events for the window that owns the menu.
5837
5838 If you find that the overhead of UI update processing is affecting
5839 your application, you can do one or both of the following:
5840
5841 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5842 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5843 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5844 receive update events. No other windows will receive update
5845 events.
5846
5847 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5848 value to set the delay between updates. You may need to call
5849 `wx.Window.UpdateWindowUI` at critical points, for example when
5850 a dialog is about to be shown, in case the user sees a slight
5851 delay before windows are updated.
5852
5853 Note that although events are sent in idle time, defining a EVT_IDLE
5854 handler for a window does not affect this because the events are sent
5855 from an internal idle handler.
5856
5857 wxWidgets tries to optimize update events on some platforms. On
5858 Windows and GTK+, events for menubar items are only sent when the menu
5859 is about to be shown, and not in idle time.
5860
5861 """
d55e5bfc
RD
5862 def __repr__(self):
5863 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5864 def __init__(self, *args, **kwargs):
5ba5649b
RD
5865 """
5866 __init__(self, int commandId=0) -> UpdateUIEvent
5867
5868 Constructor
5869 """
d55e5bfc
RD
5870 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
5871 self.this = newobj.this
5872 self.thisown = 1
5873 del newobj.thisown
5874 def GetChecked(*args, **kwargs):
5ba5649b
RD
5875 """
5876 GetChecked(self) -> bool
5877
5878 Returns ``True`` if the UI element should be checked.
5879 """
d55e5bfc
RD
5880 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5881
5882 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5883 """
5884 GetEnabled(self) -> bool
5885
5886 Returns ``True`` if the UI element should be enabled.
5887 """
d55e5bfc
RD
5888 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5889
5890 def GetText(*args, **kwargs):
5ba5649b
RD
5891 """
5892 GetText(self) -> String
5893
5894 Returns the text that should be set for the UI element.
5895 """
d55e5bfc
RD
5896 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5897
5898 def GetSetText(*args, **kwargs):
5ba5649b
RD
5899 """
5900 GetSetText(self) -> bool
5901
5902 Returns ``True`` if the application has called `SetText`. For
5903 wxWidgets internal use only.
5904 """
d55e5bfc
RD
5905 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5906
5907 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5908 """
5909 GetSetChecked(self) -> bool
5910
5911 Returns ``True`` if the application has called `Check`. For wxWidgets
5912 internal use only.
5913 """
d55e5bfc
RD
5914 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5915
5916 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5917 """
5918 GetSetEnabled(self) -> bool
5919
5920 Returns ``True`` if the application has called `Enable`. For wxWidgets
5921 internal use only.
5922 """
d55e5bfc
RD
5923 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5924
5925 def Check(*args, **kwargs):
5ba5649b
RD
5926 """
5927 Check(self, bool check)
5928
5929 Check or uncheck the UI element.
5930 """
d55e5bfc
RD
5931 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5932
5933 def Enable(*args, **kwargs):
5ba5649b
RD
5934 """
5935 Enable(self, bool enable)
5936
5937 Enable or disable the UI element.
5938 """
d55e5bfc
RD
5939 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5940
5941 def SetText(*args, **kwargs):
5ba5649b
RD
5942 """
5943 SetText(self, String text)
5944
5945 Sets the text for this UI element.
5946 """
d55e5bfc
RD
5947 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5948
5949 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5950 """
5951 SetUpdateInterval(long updateInterval)
5952
5953 Sets the interval between updates in milliseconds. Set to -1 to
5954 disable updates, or to 0 to update as frequently as possible. The
5955 default is 0.
5956
5957 Use this to reduce the overhead of UI update events if your
5958 application has a lot of windows. If you set the value to -1 or
5959 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5960 at appropriate points in your application, such as when a dialog is
5961 about to be shown.
5962 """
d55e5bfc
RD
5963 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5964
5965 SetUpdateInterval = staticmethod(SetUpdateInterval)
5966 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5967 """
5968 GetUpdateInterval() -> long
5969
5970 Returns the current interval between updates in milliseconds. -1
5971 disables updates, 0 updates as frequently as possible.
5972 """
d55e5bfc
RD
5973 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5974
5975 GetUpdateInterval = staticmethod(GetUpdateInterval)
5976 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5977 """
5978 CanUpdate(Window win) -> bool
5979
5980 Returns ``True`` if it is appropriate to update (send UI update events
5981 to) this window.
5982
5983 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5984 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5985 events were last sent in idle time, and the update interval, to
5986 determine whether events should be sent to this window now. By default
5987 this will always return true because the update mode is initially
5988 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5989 events will be sent as often as possible. You can reduce the frequency
5990 that events are sent by changing the mode and/or setting an update
5991 interval.
5992
5993 """
d55e5bfc
RD
5994 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5995
5996 CanUpdate = staticmethod(CanUpdate)
5997 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5998 """
5999 ResetUpdateTime()
6000
6001 Used internally to reset the last-updated time to the current time. It
6002 is assumed that update events are normally sent in idle time, so this
6003 is called at the end of idle processing.
6004 """
d55e5bfc
RD
6005 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
6006
6007 ResetUpdateTime = staticmethod(ResetUpdateTime)
6008 def SetMode(*args, **kwargs):
5ba5649b
RD
6009 """
6010 SetMode(int mode)
6011
6012 Specify how wxWidgets will send update events: to all windows, or only
6013 to those which specify that they will process the events.
6014
6015 The mode may be one of the following values:
6016
6017 ============================= ==========================================
6018 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6019 is the default setting.
6020 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6021 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6022 style set.
6023 ============================= ==========================================
6024
6025 """
d55e5bfc
RD
6026 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
6027
6028 SetMode = staticmethod(SetMode)
6029 def GetMode(*args, **kwargs):
5ba5649b
RD
6030 """
6031 GetMode() -> int
6032
6033 Returns a value specifying how wxWidgets will send update events: to
6034 all windows, or only to those which specify that they will process the
6035 events.
6036 """
d55e5bfc
RD
6037 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
6038
6039 GetMode = staticmethod(GetMode)
6040
6041class UpdateUIEventPtr(UpdateUIEvent):
6042 def __init__(self, this):
6043 self.this = this
6044 if not hasattr(self,"thisown"): self.thisown = 0
6045 self.__class__ = UpdateUIEvent
6046_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
6047
6048def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6049 """
6050 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6051
6052 Sets the interval between updates in milliseconds. Set to -1 to
6053 disable updates, or to 0 to update as frequently as possible. The
6054 default is 0.
6055
6056 Use this to reduce the overhead of UI update events if your
6057 application has a lot of windows. If you set the value to -1 or
6058 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6059 at appropriate points in your application, such as when a dialog is
6060 about to be shown.
6061 """
d55e5bfc
RD
6062 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
6063
6064def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6065 """
6066 UpdateUIEvent_GetUpdateInterval() -> long
6067
6068 Returns the current interval between updates in milliseconds. -1
6069 disables updates, 0 updates as frequently as possible.
6070 """
d55e5bfc
RD
6071 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
6072
6073def UpdateUIEvent_CanUpdate(*args, **kwargs):
5ba5649b
RD
6074 """
6075 UpdateUIEvent_CanUpdate(Window win) -> bool
6076
6077 Returns ``True`` if it is appropriate to update (send UI update events
6078 to) this window.
6079
6080 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6081 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6082 events were last sent in idle time, and the update interval, to
6083 determine whether events should be sent to this window now. By default
6084 this will always return true because the update mode is initially
6085 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6086 events will be sent as often as possible. You can reduce the frequency
6087 that events are sent by changing the mode and/or setting an update
6088 interval.
6089
6090 """
d55e5bfc
RD
6091 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
6092
6093def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6094 """
6095 UpdateUIEvent_ResetUpdateTime()
6096
6097 Used internally to reset the last-updated time to the current time. It
6098 is assumed that update events are normally sent in idle time, so this
6099 is called at the end of idle processing.
6100 """
d55e5bfc
RD
6101 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
6102
6103def UpdateUIEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6104 """
6105 UpdateUIEvent_SetMode(int mode)
6106
6107 Specify how wxWidgets will send update events: to all windows, or only
6108 to those which specify that they will process the events.
6109
6110 The mode may be one of the following values:
6111
6112 ============================= ==========================================
6113 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6114 is the default setting.
6115 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6116 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6117 style set.
6118 ============================= ==========================================
6119
6120 """
d55e5bfc
RD
6121 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
6122
6123def UpdateUIEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6124 """
6125 UpdateUIEvent_GetMode() -> int
6126
6127 Returns a value specifying how wxWidgets will send update events: to
6128 all windows, or only to those which specify that they will process the
6129 events.
6130 """
d55e5bfc
RD
6131 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
6132
6133#---------------------------------------------------------------------------
6134
6135class SysColourChangedEvent(Event):
5ba5649b
RD
6136 """
6137 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6138 when the user changes the colour settings using the control
6139 panel. This is only applicable under Windows.
6140
6141 The default event handler for this event propagates the event to child
6142 windows, since Windows only sends the events to top-level windows. If
6143 intercepting this event for a top-level window, remember to call
6144 `Skip` so the the base class handler will still be executed, or to
6145 pass the event on to the window's children explicitly.
6146
6147 """
d55e5bfc
RD
6148 def __repr__(self):
6149 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6150 def __init__(self, *args, **kwargs):
5ba5649b
RD
6151 """
6152 __init__(self) -> SysColourChangedEvent
6153
6154 Constructor
6155 """
d55e5bfc
RD
6156 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
6157 self.this = newobj.this
6158 self.thisown = 1
6159 del newobj.thisown
6160
6161class SysColourChangedEventPtr(SysColourChangedEvent):
6162 def __init__(self, this):
6163 self.this = this
6164 if not hasattr(self,"thisown"): self.thisown = 0
6165 self.__class__ = SysColourChangedEvent
6166_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
6167
6168#---------------------------------------------------------------------------
6169
6170class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6171 """
6172 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6173 a window that loses its mouse capture. This is called even if
6174 `wx.Window.ReleaseMouse` was called by the application code. Handling
6175 this event allows an application to cater for unexpected capture
6176 releases which might otherwise confuse mouse handling code.
6177
6178 This event is implemented under Windows only.
6179 """
d55e5bfc
RD
6180 def __repr__(self):
6181 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6182 def __init__(self, *args, **kwargs):
5ba5649b
RD
6183 """
6184 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6185
6186 Constructor
6187 """
d55e5bfc
RD
6188 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
6189 self.this = newobj.this
6190 self.thisown = 1
6191 del newobj.thisown
6192 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6193 """
6194 GetCapturedWindow(self) -> Window
6195
6196 Returns the window that gained the capture, or ``None`` if it was a
6197 non-wxWidgets window.
6198 """
d55e5bfc
RD
6199 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
6200
6201
6202class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
6203 def __init__(self, this):
6204 self.this = this
6205 if not hasattr(self,"thisown"): self.thisown = 0
6206 self.__class__ = MouseCaptureChangedEvent
6207_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
6208
6209#---------------------------------------------------------------------------
6210
6211class DisplayChangedEvent(Event):
5ba5649b
RD
6212 """
6213 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6214 resolution has changed.
6215
6216 This event is implemented under Windows only.
6217 """
d55e5bfc
RD
6218 def __repr__(self):
6219 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6220 def __init__(self, *args, **kwargs):
6221 """__init__(self) -> DisplayChangedEvent"""
6222 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
6223 self.this = newobj.this
6224 self.thisown = 1
6225 del newobj.thisown
6226
6227class DisplayChangedEventPtr(DisplayChangedEvent):
6228 def __init__(self, this):
6229 self.this = this
6230 if not hasattr(self,"thisown"): self.thisown = 0
6231 self.__class__ = DisplayChangedEvent
6232_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
6233
6234#---------------------------------------------------------------------------
6235
6236class PaletteChangedEvent(Event):
5ba5649b
RD
6237 """
6238 An EVT_PALETTE_CHANGED event is sent when the system palette has
6239 changed, thereby giving each window a chance to redo their own to
6240 match.
6241
6242 This event is implemented under Windows only.
6243 """
d55e5bfc
RD
6244 def __repr__(self):
6245 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6246 def __init__(self, *args, **kwargs):
5ba5649b
RD
6247 """
6248 __init__(self, int id=0) -> PaletteChangedEvent
6249
6250 An EVT_PALETTE_CHANGED event is sent when the system palette has
6251 changed, thereby giving each window a chance to redo their own to
6252 match.
6253
6254 This event is implemented under Windows only.
6255 """
d55e5bfc
RD
6256 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
6257 self.this = newobj.this
6258 self.thisown = 1
6259 del newobj.thisown
6260 def SetChangedWindow(*args, **kwargs):
6261 """SetChangedWindow(self, Window win)"""
6262 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6263
6264 def GetChangedWindow(*args, **kwargs):
6265 """GetChangedWindow(self) -> Window"""
6266 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6267
6268
6269class PaletteChangedEventPtr(PaletteChangedEvent):
6270 def __init__(self, this):
6271 self.this = this
6272 if not hasattr(self,"thisown"): self.thisown = 0
6273 self.__class__ = PaletteChangedEvent
6274_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
6275
6276#---------------------------------------------------------------------------
6277
6278class QueryNewPaletteEvent(Event):
5ba5649b
RD
6279 """
6280 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6281 focus and should re-do its palette.
6282
6283 This event is implemented under Windows only.
6284 """
d55e5bfc
RD
6285 def __repr__(self):
6286 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6287 def __init__(self, *args, **kwargs):
5ba5649b
RD
6288 """
6289 __init__(self, int winid=0) -> QueryNewPaletteEvent
6290
6291 Constructor.
6292 """
d55e5bfc
RD
6293 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
6294 self.this = newobj.this
6295 self.thisown = 1
6296 del newobj.thisown
6297 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6298 """
6299 SetPaletteRealized(self, bool realized)
6300
6301 App should set this if it changes the palette.
6302 """
d55e5bfc
RD
6303 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6304
6305 def GetPaletteRealized(*args, **kwargs):
6306 """GetPaletteRealized(self) -> bool"""
6307 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6308
6309
6310class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
6311 def __init__(self, this):
6312 self.this = this
6313 if not hasattr(self,"thisown"): self.thisown = 0
6314 self.__class__ = QueryNewPaletteEvent
6315_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
6316
6317#---------------------------------------------------------------------------
6318
6319class NavigationKeyEvent(Event):
5ba5649b
RD
6320 """
6321 EVT_NAVIGATION_KEY events are used to control moving the focus between
6322 widgets, otherwise known as tab-traversal. You woudl normally not
6323 catch navigation events in applications as there are already
6324 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6325 it useful to send navigation events in certain situations to change
6326 the focus in certain ways, although it's probably easier to just call
6327 `wx.Window.Navigate`.
6328 """
d55e5bfc
RD
6329 def __repr__(self):
6330 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6331 def __init__(self, *args, **kwargs):
6332 """__init__(self) -> NavigationKeyEvent"""
6333 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
6334 self.this = newobj.this
6335 self.thisown = 1
6336 del newobj.thisown
6337 def GetDirection(*args, **kwargs):
5ba5649b
RD
6338 """
6339 GetDirection(self) -> bool
6340
6341 Returns ``True`` if the direction is forward, ``False`` otherwise.
6342 """
d55e5bfc
RD
6343 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6344
6345 def SetDirection(*args, **kwargs):
5ba5649b
RD
6346 """
6347 SetDirection(self, bool forward)
6348
6349 Specify the direction that the navigation should take. Usually the
6350 difference between using Tab and Shift-Tab.
6351 """
d55e5bfc
RD
6352 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6353
6354 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6355 """
6356 IsWindowChange(self) -> bool
6357
6358 Returns ``True`` if window change is allowed.
6359 """
d55e5bfc
RD
6360 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6361
6362 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6363 """
6364 SetWindowChange(self, bool ischange)
6365
6366 Specify if the navigation should be able to change parent windows.
6367 For example, changing notebook pages, etc. This is usually implemented
6368 by using Control-Tab.
6369 """
d55e5bfc
RD
6370 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6371
68350608 6372 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6373 """
6374 IsFromTab(self) -> bool
6375
6376 Returns ``True`` if the navigation event is originated from the Tab
6377 key.
6378 """
68350608
RD
6379 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6380
6381 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6382 """
6383 SetFromTab(self, bool bIs)
6384
6385 Set to true under MSW if the event was generated using the tab key.
6386 This is required for proper navogation over radio buttons.
6387 """
68350608
RD
6388 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6389
908b74cd 6390 def SetFlags(*args, **kwargs):
5ba5649b
RD
6391 """
6392 SetFlags(self, long flags)
6393
6394 Set the navigation flags to a combination of the following:
6395
6396 * wx.NavigationKeyEvent.IsBackward
6397 * wx.NavigationKeyEvent.IsForward
6398 * wx.NavigationKeyEvent.WinChange
6399 * wx.NavigationKeyEvent.FromTab
6400
6401 """
908b74cd
RD
6402 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6403
d55e5bfc 6404 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6405 """
6406 GetCurrentFocus(self) -> Window
6407
6408 Returns the child window which currenty has the focus. May be
6409 ``None``.
6410 """
d55e5bfc
RD
6411 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6412
6413 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6414 """
6415 SetCurrentFocus(self, Window win)
6416
6417 Set the window that has the focus.
6418 """
d55e5bfc
RD
6419 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6420
b0f7404b 6421 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6422 IsForward = _core_.NavigationKeyEvent_IsForward
6423 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6424 FromTab = _core_.NavigationKeyEvent_FromTab
d55e5bfc
RD
6425
6426class NavigationKeyEventPtr(NavigationKeyEvent):
6427 def __init__(self, this):
6428 self.this = this
6429 if not hasattr(self,"thisown"): self.thisown = 0
6430 self.__class__ = NavigationKeyEvent
6431_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
6432
6433#---------------------------------------------------------------------------
6434
6435class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6436 """
6437 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6438 underlying GUI object) exists.
6439 """
d55e5bfc
RD
6440 def __repr__(self):
6441 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6442 def __init__(self, *args, **kwargs):
5ba5649b
RD
6443 """
6444 __init__(self, Window win=None) -> WindowCreateEvent
6445
6446 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6447 underlying GUI object) exists.
6448 """
d55e5bfc
RD
6449 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
6450 self.this = newobj.this
6451 self.thisown = 1
6452 del newobj.thisown
6453 def GetWindow(*args, **kwargs):
5ba5649b
RD
6454 """
6455 GetWindow(self) -> Window
6456
6457 Returns the window that this event refers to.
6458 """
d55e5bfc
RD
6459 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6460
6461
6462class WindowCreateEventPtr(WindowCreateEvent):
6463 def __init__(self, this):
6464 self.this = this
6465 if not hasattr(self,"thisown"): self.thisown = 0
6466 self.__class__ = WindowCreateEvent
6467_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
6468
6469class WindowDestroyEvent(CommandEvent):
5ba5649b
RD
6470 """
6471 The EVT_WINDOW_DESTROY event is sent right before the window is
6472 destroyed.
6473 """
d55e5bfc
RD
6474 def __repr__(self):
6475 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6476 def __init__(self, *args, **kwargs):
5ba5649b
RD
6477 """
6478 __init__(self, Window win=None) -> WindowDestroyEvent
6479
6480 The EVT_WINDOW_DESTROY event is sent right before the window is
6481 destroyed.
6482 """
d55e5bfc
RD
6483 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
6484 self.this = newobj.this
6485 self.thisown = 1
6486 del newobj.thisown
6487 def GetWindow(*args, **kwargs):
5ba5649b
RD
6488 """
6489 GetWindow(self) -> Window
6490
6491 Returns the window that this event refers to.
6492 """
d55e5bfc
RD
6493 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6494
6495
6496class WindowDestroyEventPtr(WindowDestroyEvent):
6497 def __init__(self, this):
6498 self.this = this
6499 if not hasattr(self,"thisown"): self.thisown = 0
6500 self.__class__ = WindowDestroyEvent
6501_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
6502
6503#---------------------------------------------------------------------------
6504
6505class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6506 """
6507 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6508 give the application a chance to show a context (popup) menu.
6509 """
d55e5bfc
RD
6510 def __repr__(self):
6511 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6512 def __init__(self, *args, **kwargs):
5ba5649b
RD
6513 """
6514 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6515
6516 Constructor.
6517 """
d55e5bfc
RD
6518 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
6519 self.this = newobj.this
6520 self.thisown = 1
6521 del newobj.thisown
6522 def GetPosition(*args, **kwargs):
5ba5649b
RD
6523 """
6524 GetPosition(self) -> Point
6525
6526 Returns the position (in screen coordinants) at which the menu should
6527 be shown.
6528 """
d55e5bfc
RD
6529 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6530
6531 def SetPosition(*args, **kwargs):
5ba5649b
RD
6532 """
6533 SetPosition(self, Point pos)
6534
6535 Sets the position at which the menu should be shown.
6536 """
d55e5bfc
RD
6537 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6538
6539
6540class ContextMenuEventPtr(ContextMenuEvent):
6541 def __init__(self, this):
6542 self.this = this
6543 if not hasattr(self,"thisown"): self.thisown = 0
6544 self.__class__ = ContextMenuEvent
6545_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
6546
6547#---------------------------------------------------------------------------
6548
6549IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6550IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6551class IdleEvent(Event):
5ba5649b
RD
6552 """
6553 This class is used for EVT_IDLE events, which are generated and sent
6554 when the application *becomes* idle. In other words, the when the
6555 event queue becomes empty then idle events are sent to all windows (by
6556 default) and as long as none of them call `RequestMore` then there are
6557 no more idle events until after the system event queue has some normal
6558 events and then becomes empty again.
6559
6560 By default, idle events are sent to all windows. If this is causing a
6561 significant overhead in your application, you can call
6562 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6563 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6564 which should receive idle events. Then idle events will only be sent
6565 to those windows and not to any others.
6566 """
d55e5bfc
RD
6567 def __repr__(self):
6568 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6569 def __init__(self, *args, **kwargs):
5ba5649b
RD
6570 """
6571 __init__(self) -> IdleEvent
6572
6573 Constructor
6574 """
d55e5bfc
RD
6575 newobj = _core_.new_IdleEvent(*args, **kwargs)
6576 self.this = newobj.this
6577 self.thisown = 1
6578 del newobj.thisown
6579 def RequestMore(*args, **kwargs):
5ba5649b
RD
6580 """
6581 RequestMore(self, bool needMore=True)
6582
6583 Tells wxWidgets that more processing is required. This function can be
6584 called by an EVT_IDLE handler for a window to indicate that the
6585 application should forward the EVT_IDLE event once more to the
6586 application windows. If no window calls this function during its
6587 EVT_IDLE handler, then the application will remain in a passive event
6588 loop until a new event is posted to the application by the windowing
6589 system.
6590 """
d55e5bfc
RD
6591 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6592
6593 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6594 """
6595 MoreRequested(self) -> bool
6596
6597 Returns ``True`` if the OnIdle function processing this event
6598 requested more processing time.
6599 """
d55e5bfc
RD
6600 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6601
6602 def SetMode(*args, **kwargs):
5ba5649b
RD
6603 """
6604 SetMode(int mode)
6605
6606 Static method for specifying how wxWidgets will send idle events: to
6607 all windows, or only to those which specify that they will process the
6608 events.
6609
6610 The mode can be one of the following values:
6611
6612 ========================= ========================================
6613 wx.IDLE_PROCESS_ALL Send idle events to all windows
6614 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6615 the wx.WS_EX_PROCESS_IDLE extra style
6616 flag set.
6617 ========================= ========================================
6618
6619 """
d55e5bfc
RD
6620 return _core_.IdleEvent_SetMode(*args, **kwargs)
6621
6622 SetMode = staticmethod(SetMode)
6623 def GetMode(*args, **kwargs):
5ba5649b
RD
6624 """
6625 GetMode() -> int
6626
6627 Static method returning a value specifying how wxWidgets will send
6628 idle events: to all windows, or only to those which specify that they
6629 will process the events.
6630 """
d55e5bfc
RD
6631 return _core_.IdleEvent_GetMode(*args, **kwargs)
6632
6633 GetMode = staticmethod(GetMode)
6634 def CanSend(*args, **kwargs):
5ba5649b
RD
6635 """
6636 CanSend(Window win) -> bool
6637
6638 Returns ``True`` if it is appropriate to send idle events to this
6639 window.
6640
6641 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6642 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6643 events should be sent to this window now. By default this will always
6644 return ``True`` because the update mode is initially
6645 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6646 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6647 """
d55e5bfc
RD
6648 return _core_.IdleEvent_CanSend(*args, **kwargs)
6649
6650 CanSend = staticmethod(CanSend)
6651
6652class IdleEventPtr(IdleEvent):
6653 def __init__(self, this):
6654 self.this = this
6655 if not hasattr(self,"thisown"): self.thisown = 0
6656 self.__class__ = IdleEvent
6657_core_.IdleEvent_swigregister(IdleEventPtr)
6658
6659def IdleEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6660 """
6661 IdleEvent_SetMode(int mode)
6662
6663 Static method for specifying how wxWidgets will send idle events: to
6664 all windows, or only to those which specify that they will process the
6665 events.
6666
6667 The mode can be one of the following values:
6668
6669 ========================= ========================================
6670 wx.IDLE_PROCESS_ALL Send idle events to all windows
6671 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6672 the wx.WS_EX_PROCESS_IDLE extra style
6673 flag set.
6674 ========================= ========================================
6675
6676 """
d55e5bfc
RD
6677 return _core_.IdleEvent_SetMode(*args, **kwargs)
6678
6679def IdleEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6680 """
6681 IdleEvent_GetMode() -> int
6682
6683 Static method returning a value specifying how wxWidgets will send
6684 idle events: to all windows, or only to those which specify that they
6685 will process the events.
6686 """
d55e5bfc
RD
6687 return _core_.IdleEvent_GetMode(*args, **kwargs)
6688
6689def IdleEvent_CanSend(*args, **kwargs):
5ba5649b
RD
6690 """
6691 IdleEvent_CanSend(Window win) -> bool
6692
6693 Returns ``True`` if it is appropriate to send idle events to this
6694 window.
6695
6696 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6697 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6698 events should be sent to this window now. By default this will always
6699 return ``True`` because the update mode is initially
6700 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6701 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6702 """
d55e5bfc
RD
6703 return _core_.IdleEvent_CanSend(*args, **kwargs)
6704
6705#---------------------------------------------------------------------------
6706
6707class PyEvent(Event):
5ba5649b
RD
6708 """
6709 wx.PyEvent can be used as a base class for implementing custom event
6710 types in Python. You should derived from this class instead of
6711 `wx.Event` because this class is Python-aware and is able to transport
6712 its Python bits safely through the wxWidgets event system and have
6713 them still be there when the event handler is invoked.
6714
6715 :see: `wx.PyCommandEvent`
6716
6717 """
d55e5bfc
RD
6718 def __repr__(self):
6719 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6720 def __init__(self, *args, **kwargs):
5ba5649b 6721 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
d55e5bfc
RD
6722 newobj = _core_.new_PyEvent(*args, **kwargs)
6723 self.this = newobj.this
6724 self.thisown = 1
6725 del newobj.thisown
5ba5649b 6726 self._SetSelf(self)
d55e5bfc
RD
6727
6728 def __del__(self, destroy=_core_.delete_PyEvent):
6729 """__del__(self)"""
6730 try:
6731 if self.thisown: destroy(self)
6732 except: pass
6733
5ba5649b
RD
6734 def _SetSelf(*args, **kwargs):
6735 """_SetSelf(self, PyObject self)"""
6736 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6737
5ba5649b
RD
6738 def _GetSelf(*args, **kwargs):
6739 """_GetSelf(self) -> PyObject"""
6740 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc
RD
6741
6742
6743class PyEventPtr(PyEvent):
6744 def __init__(self, this):
6745 self.this = this
6746 if not hasattr(self,"thisown"): self.thisown = 0
6747 self.__class__ = PyEvent
6748_core_.PyEvent_swigregister(PyEventPtr)
6749
6750class PyCommandEvent(CommandEvent):
5ba5649b
RD
6751 """
6752 wx.PyCommandEvent can be used as a base class for implementing custom
6753 event types in Python, where the event shoudl travel up to parent
6754 windows looking for a handler. You should derived from this class
6755 instead of `wx.CommandEvent` because this class is Python-aware and is
6756 able to transport its Python bits safely through the wxWidgets event
6757 system and have them still be there when the event handler is invoked.
6758
6759 :see: `wx.PyEvent`
6760
6761 """
d55e5bfc
RD
6762 def __repr__(self):
6763 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6764 def __init__(self, *args, **kwargs):
5ba5649b 6765 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
d55e5bfc
RD
6766 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
6767 self.this = newobj.this
6768 self.thisown = 1
6769 del newobj.thisown
5ba5649b 6770 self._SetSelf(self)
d55e5bfc
RD
6771
6772 def __del__(self, destroy=_core_.delete_PyCommandEvent):
6773 """__del__(self)"""
6774 try:
6775 if self.thisown: destroy(self)
6776 except: pass
6777
5ba5649b
RD
6778 def _SetSelf(*args, **kwargs):
6779 """_SetSelf(self, PyObject self)"""
6780 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6781
5ba5649b
RD
6782 def _GetSelf(*args, **kwargs):
6783 """_GetSelf(self) -> PyObject"""
6784 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc
RD
6785
6786
6787class PyCommandEventPtr(PyCommandEvent):
6788 def __init__(self, this):
6789 self.this = this
6790 if not hasattr(self,"thisown"): self.thisown = 0
6791 self.__class__ = PyCommandEvent
6792_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
6793
53aa7709 6794class DateEvent(CommandEvent):
5ba5649b
RD
6795 """
6796 This event class holds information about a date change event and is
6797 used together with `wx.DatePickerCtrl`. It also serves as a base class
6798 for `wx.calendar.CalendarEvent`. Bind these event types with
6799 EVT_DATE_CHANGED.
6800 """
53aa7709
RD
6801 def __repr__(self):
6802 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6803 def __init__(self, *args, **kwargs):
6804 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6805 newobj = _core_.new_DateEvent(*args, **kwargs)
6806 self.this = newobj.this
6807 self.thisown = 1
6808 del newobj.thisown
6809 def GetDate(*args, **kwargs):
5ba5649b
RD
6810 """
6811 GetDate(self) -> DateTime
6812
6813 Returns the date.
6814 """
53aa7709
RD
6815 return _core_.DateEvent_GetDate(*args, **kwargs)
6816
6817 def SetDate(*args, **kwargs):
5ba5649b
RD
6818 """
6819 SetDate(self, DateTime date)
6820
6821 Sets the date carried by the event, normally only used by the library
6822 internally.
6823 """
53aa7709
RD
6824 return _core_.DateEvent_SetDate(*args, **kwargs)
6825
6826
6827class DateEventPtr(DateEvent):
6828 def __init__(self, this):
6829 self.this = this
6830 if not hasattr(self,"thisown"): self.thisown = 0
6831 self.__class__ = DateEvent
6832_core_.DateEvent_swigregister(DateEventPtr)
6833
6834wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6835EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6836
d55e5bfc
RD
6837#---------------------------------------------------------------------------
6838
6839PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6840PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6841PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6842PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6843PRINT_WINDOWS = _core_.PRINT_WINDOWS
6844PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6845class PyApp(EvtHandler):
c24da6d6
RD
6846 """
6847 The ``wx.PyApp`` class is an *implementation detail*, please use the
6848 `wx.App` class (or some other derived class) instead.
6849 """
d55e5bfc
RD
6850 def __repr__(self):
6851 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6852 def __init__(self, *args, **kwargs):
6853 """
6854 __init__(self) -> PyApp
6855
6856 Create a new application object, starting the bootstrap process.
6857 """
6858 newobj = _core_.new_PyApp(*args, **kwargs)
6859 self.this = newobj.this
6860 self.thisown = 1
6861 del newobj.thisown
70b7a5fe
RD
6862 self._setCallbackInfo(self, PyApp, False)
6863 self._setOORInfo(self, False)
d55e5bfc
RD
6864
6865 def __del__(self, destroy=_core_.delete_PyApp):
6866 """__del__(self)"""
6867 try:
6868 if self.thisown: destroy(self)
6869 except: pass
6870
6871 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 6872 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
d55e5bfc
RD
6873 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6874
6875 def GetAppName(*args, **kwargs):
6876 """
6877 GetAppName(self) -> String
6878
6879 Get the application name.
6880 """
6881 return _core_.PyApp_GetAppName(*args, **kwargs)
6882
6883 def SetAppName(*args, **kwargs):
6884 """
6885 SetAppName(self, String name)
6886
c24da6d6
RD
6887 Set the application name. This value may be used automatically by
6888 `wx.Config` and such.
d55e5bfc
RD
6889 """
6890 return _core_.PyApp_SetAppName(*args, **kwargs)
6891
6892 def GetClassName(*args, **kwargs):
6893 """
6894 GetClassName(self) -> String
6895
6896 Get the application's class name.
6897 """
6898 return _core_.PyApp_GetClassName(*args, **kwargs)
6899
6900 def SetClassName(*args, **kwargs):
6901 """
6902 SetClassName(self, String name)
6903
c24da6d6
RD
6904 Set the application's class name. This value may be used for
6905 X-resources if applicable for the platform
d55e5bfc
RD
6906 """
6907 return _core_.PyApp_SetClassName(*args, **kwargs)
6908
6909 def GetVendorName(*args, **kwargs):
6910 """
6911 GetVendorName(self) -> String
6912
6913 Get the application's vendor name.
6914 """
6915 return _core_.PyApp_GetVendorName(*args, **kwargs)
6916
6917 def SetVendorName(*args, **kwargs):
6918 """
6919 SetVendorName(self, String name)
6920
c24da6d6
RD
6921 Set the application's vendor name. This value may be used
6922 automatically by `wx.Config` and such.
d55e5bfc
RD
6923 """
6924 return _core_.PyApp_SetVendorName(*args, **kwargs)
6925
6926 def GetTraits(*args, **kwargs):
6927 """
6928 GetTraits(self) -> wxAppTraits
6929
c24da6d6
RD
6930 Return (and create if necessary) the app traits object to which we
6931 delegate for everything which either should be configurable by the
6932 user (then he can change the default behaviour simply by overriding
6933 CreateTraits() and returning his own traits object) or which is
6934 GUI/console dependent as then wx.AppTraits allows us to abstract the
6935 differences behind the common facade.
6936
6937 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc
RD
6938 """
6939 return _core_.PyApp_GetTraits(*args, **kwargs)
6940
6941 def ProcessPendingEvents(*args, **kwargs):
6942 """
6943 ProcessPendingEvents(self)
6944
c24da6d6
RD
6945 Process all events in the Pending Events list -- it is necessary to
6946 call this function to process posted events. This normally happens
6947 during each event loop iteration.
d55e5bfc
RD
6948 """
6949 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6950
6951 def Yield(*args, **kwargs):
6952 """
6953 Yield(self, bool onlyIfNeeded=False) -> bool
6954
c24da6d6
RD
6955 Process all currently pending events right now, instead of waiting
6956 until return to the event loop. It is an error to call ``Yield``
6957 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6958
c24da6d6 6959 :warning: This function is dangerous as it can lead to unexpected
79fccf9d
RD
6960 reentrancies (i.e. when called from an event handler it may
6961 result in calling the same event handler again), use with
6962 extreme care or, better, don't use at all!
d55e5bfc 6963
c24da6d6 6964 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
79fccf9d 6965
d55e5bfc
RD
6966 """
6967 return _core_.PyApp_Yield(*args, **kwargs)
6968
6969 def WakeUpIdle(*args, **kwargs):
6970 """
6971 WakeUpIdle(self)
6972
c24da6d6
RD
6973 Make sure that idle events are sent again.
6974 :see: `wx.WakeUpIdle`
d55e5bfc
RD
6975 """
6976 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6977
84f85550
RD
6978 def IsMainLoopRunning(*args, **kwargs):
6979 """
6980 IsMainLoopRunning() -> bool
6981
6982 Returns True if we're running the main loop, i.e. if the events can
6983 currently be dispatched.
6984 """
6985 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6986
6987 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6988 def MainLoop(*args, **kwargs):
6989 """
6990 MainLoop(self) -> int
6991
c24da6d6
RD
6992 Execute the main GUI loop, the function doesn't normally return until
6993 all top level windows have been closed and destroyed.
d55e5bfc
RD
6994 """
6995 return _core_.PyApp_MainLoop(*args, **kwargs)
6996
6997 def Exit(*args, **kwargs):
6998 """
6999 Exit(self)
7000
7001 Exit the main loop thus terminating the application.
c24da6d6 7002 :see: `wx.Exit`
d55e5bfc
RD
7003 """
7004 return _core_.PyApp_Exit(*args, **kwargs)
7005
7006 def ExitMainLoop(*args, **kwargs):
7007 """
7008 ExitMainLoop(self)
7009
c24da6d6
RD
7010 Exit the main GUI loop during the next iteration of the main
7011 loop, (i.e. it does not stop the program immediately!)
d55e5bfc
RD
7012 """
7013 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
7014
7015 def Pending(*args, **kwargs):
7016 """
7017 Pending(self) -> bool
7018
7019 Returns True if there are unprocessed events in the event queue.
7020 """
7021 return _core_.PyApp_Pending(*args, **kwargs)
7022
7023 def Dispatch(*args, **kwargs):
7024 """
7025 Dispatch(self) -> bool
7026
7027 Process the first event in the event queue (blocks until an event
7028 appears if there are none currently)
7029 """
7030 return _core_.PyApp_Dispatch(*args, **kwargs)
7031
7032 def ProcessIdle(*args, **kwargs):
7033 """
7034 ProcessIdle(self) -> bool
7035
c24da6d6
RD
7036 Called from the MainLoop when the application becomes idle (there are
7037 no pending events) and sends a `wx.IdleEvent` to all interested
7038 parties. Returns True if more idle events are needed, False if not.
d55e5bfc
RD
7039 """
7040 return _core_.PyApp_ProcessIdle(*args, **kwargs)
7041
7042 def SendIdleEvents(*args, **kwargs):
7043 """
7044 SendIdleEvents(self, Window win, IdleEvent event) -> bool
7045
c24da6d6
RD
7046 Send idle event to window and all subwindows. Returns True if more
7047 idle time is requested.
d55e5bfc
RD
7048 """
7049 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
7050
7051 def IsActive(*args, **kwargs):
7052 """
7053 IsActive(self) -> bool
7054
7055 Return True if our app has focus.
7056 """
7057 return _core_.PyApp_IsActive(*args, **kwargs)
7058
7059 def SetTopWindow(*args, **kwargs):
7060 """
7061 SetTopWindow(self, Window win)
7062
c24da6d6 7063 Set the *main* top level window
d55e5bfc
RD
7064 """
7065 return _core_.PyApp_SetTopWindow(*args, **kwargs)
7066
7067 def GetTopWindow(*args, **kwargs):
7068 """
7069 GetTopWindow(self) -> Window
7070
c24da6d6
RD
7071 Return the *main* top level window (if it hadn't been set previously
7072 with SetTopWindow(), will return just some top level window and, if
7073 there not any, will return None)
d55e5bfc
RD
7074 """
7075 return _core_.PyApp_GetTopWindow(*args, **kwargs)
7076
7077 def SetExitOnFrameDelete(*args, **kwargs):
7078 """
7079 SetExitOnFrameDelete(self, bool flag)
7080
c24da6d6
RD
7081 Control the exit behaviour: by default, the program will exit the main
7082 loop (and so, usually, terminate) when the last top-level program
7083 window is deleted. Beware that if you disable this behaviour (with
7084 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7085 explicitly from somewhere.
d55e5bfc
RD
7086 """
7087 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
7088
7089 def GetExitOnFrameDelete(*args, **kwargs):
7090 """
7091 GetExitOnFrameDelete(self) -> bool
7092
7093 Get the current exit behaviour setting.
7094 """
7095 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
7096
7097 def SetUseBestVisual(*args, **kwargs):
7098 """
7099 SetUseBestVisual(self, bool flag)
7100
c24da6d6
RD
7101 Set whether the app should try to use the best available visual on
7102 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc
RD
7103 """
7104 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
7105
7106 def GetUseBestVisual(*args, **kwargs):
7107 """
7108 GetUseBestVisual(self) -> bool
7109
7110 Get current UseBestVisual setting.
7111 """
7112 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
7113
7114 def SetPrintMode(*args, **kwargs):
7115 """SetPrintMode(self, int mode)"""
7116 return _core_.PyApp_SetPrintMode(*args, **kwargs)
7117
7118 def GetPrintMode(*args, **kwargs):
7119 """GetPrintMode(self) -> int"""
7120 return _core_.PyApp_GetPrintMode(*args, **kwargs)
7121
7122 def SetAssertMode(*args, **kwargs):
7123 """
7124 SetAssertMode(self, int mode)
7125
79fccf9d 7126 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc
RD
7127 """
7128 return _core_.PyApp_SetAssertMode(*args, **kwargs)
7129
7130 def GetAssertMode(*args, **kwargs):
7131 """
7132 GetAssertMode(self) -> int
7133
7134 Get the current OnAssert behaviour setting.
7135 """
7136 return _core_.PyApp_GetAssertMode(*args, **kwargs)
7137
7138 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 7139 """GetMacSupportPCMenuShortcuts() -> bool"""
d55e5bfc
RD
7140 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
7141
7142 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7143 def GetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 7144 """GetMacAboutMenuItemId() -> long"""
d55e5bfc
RD
7145 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
7146
7147 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7148 def GetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 7149 """GetMacPreferencesMenuItemId() -> long"""
d55e5bfc
RD
7150 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
7151
7152 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7153 def GetMacExitMenuItemId(*args, **kwargs):
c24da6d6 7154 """GetMacExitMenuItemId() -> long"""
d55e5bfc
RD
7155 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
7156
7157 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7158 def GetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 7159 """GetMacHelpMenuTitleName() -> String"""
d55e5bfc
RD
7160 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
7161
7162 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7163 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 7164 """SetMacSupportPCMenuShortcuts(bool val)"""
d55e5bfc
RD
7165 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7166
7167 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7168 def SetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 7169 """SetMacAboutMenuItemId(long val)"""
d55e5bfc
RD
7170 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7171
7172 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7173 def SetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 7174 """SetMacPreferencesMenuItemId(long val)"""
d55e5bfc
RD
7175 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7176
7177 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7178 def SetMacExitMenuItemId(*args, **kwargs):
c24da6d6 7179 """SetMacExitMenuItemId(long val)"""
d55e5bfc
RD
7180 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7181
7182 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7183 def SetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 7184 """SetMacHelpMenuTitleName(String val)"""
d55e5bfc
RD
7185 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7186
7187 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7188 def _BootstrapApp(*args, **kwargs):
7189 """
7190 _BootstrapApp(self)
7191
7192 For internal use only
7193 """
7194 return _core_.PyApp__BootstrapApp(*args, **kwargs)
7195
7196 def GetComCtl32Version(*args, **kwargs):
7197 """
c24da6d6 7198 GetComCtl32Version() -> int
d55e5bfc 7199
c24da6d6
RD
7200 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7201 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
7202 """
7203 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
7204
7205 GetComCtl32Version = staticmethod(GetComCtl32Version)
7206
7207class PyAppPtr(PyApp):
7208 def __init__(self, this):
7209 self.this = this
7210 if not hasattr(self,"thisown"): self.thisown = 0
7211 self.__class__ = PyApp
7212_core_.PyApp_swigregister(PyAppPtr)
7213
84f85550
RD
7214def PyApp_IsMainLoopRunning(*args, **kwargs):
7215 """
7216 PyApp_IsMainLoopRunning() -> bool
7217
7218 Returns True if we're running the main loop, i.e. if the events can
7219 currently be dispatched.
7220 """
7221 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7222
d55e5bfc
RD
7223def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
7224 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7225 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
7226
7227def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
7228 """PyApp_GetMacAboutMenuItemId() -> long"""
7229 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
7230
7231def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
7232 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7233 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
7234
7235def PyApp_GetMacExitMenuItemId(*args, **kwargs):
7236 """PyApp_GetMacExitMenuItemId() -> long"""
7237 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
7238
7239def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
7240 """PyApp_GetMacHelpMenuTitleName() -> String"""
7241 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
7242
7243def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7244 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7245 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7246
7247def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7248 """PyApp_SetMacAboutMenuItemId(long val)"""
7249 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7250
7251def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7252 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7253 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7254
7255def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7256 """PyApp_SetMacExitMenuItemId(long val)"""
7257 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7258
7259def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7260 """PyApp_SetMacHelpMenuTitleName(String val)"""
7261 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7262
7263def PyApp_GetComCtl32Version(*args, **kwargs):
7264 """
7265 PyApp_GetComCtl32Version() -> int
7266
c24da6d6
RD
7267 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7268 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
7269 """
7270 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
7271
7272#---------------------------------------------------------------------------
7273
7274
7275def Exit(*args, **kwargs):
7276 """
7277 Exit()
7278
7279 Force an exit of the application. Convenience for wx.GetApp().Exit()
7280 """
7281 return _core_.Exit(*args, **kwargs)
7282
7283def Yield(*args, **kwargs):
7284 """
7285 Yield() -> bool
7286
7287 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7288 """
7289 return _core_.Yield(*args, **kwargs)
7290
7291def YieldIfNeeded(*args, **kwargs):
7292 """
7293 YieldIfNeeded() -> bool
7294
7295 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7296 """
7297 return _core_.YieldIfNeeded(*args, **kwargs)
7298
7299def SafeYield(*args, **kwargs):
7300 """
7301 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7302
c24da6d6
RD
7303 This function is similar to `wx.Yield`, except that it disables the
7304 user input to all program windows before calling `wx.Yield` and
7305 re-enables it again afterwards. If ``win`` is not None, this window
7306 will remain enabled, allowing the implementation of some limited user
7307 interaction.
d55e5bfc 7308
c24da6d6 7309 :Returns: the result of the call to `wx.Yield`.
d55e5bfc
RD
7310 """
7311 return _core_.SafeYield(*args, **kwargs)
7312
7313def WakeUpIdle(*args, **kwargs):
7314 """
7315 WakeUpIdle()
7316
c24da6d6
RD
7317 Cause the message queue to become empty again, so idle events will be
7318 sent.
d55e5bfc
RD
7319 """
7320 return _core_.WakeUpIdle(*args, **kwargs)
7321
7322def PostEvent(*args, **kwargs):
7323 """
7324 PostEvent(EvtHandler dest, Event event)
7325
c24da6d6
RD
7326 Send an event to a window or other wx.EvtHandler to be processed
7327 later.
d55e5bfc
RD
7328 """
7329 return _core_.PostEvent(*args, **kwargs)
7330
7331def App_CleanUp(*args, **kwargs):
7332 """
7333 App_CleanUp()
7334
79fccf9d 7335 For internal use only, it is used to cleanup after wxWidgets when
c24da6d6 7336 Python shuts down.
d55e5bfc
RD
7337 """
7338 return _core_.App_CleanUp(*args, **kwargs)
7339
7340def GetApp(*args, **kwargs):
7341 """
7342 GetApp() -> PyApp
7343
7344 Return a reference to the current wx.App object.
7345 """
7346 return _core_.GetApp(*args, **kwargs)
5cbf236d
RD
7347
7348def SetDefaultPyEncoding(*args, **kwargs):
7349 """
7350 SetDefaultPyEncoding(string encoding)
7351
7352 Sets the encoding that wxPython will use when it needs to convert a
7353 Python string or unicode object to or from a wxString.
62d32a5f
RD
7354
7355 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7356 but please be aware that the default encoding within the same locale
7357 may be slightly different on different platforms. For example, please
7358 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7359 between the common latin/roman encodings.
5cbf236d
RD
7360 """
7361 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7362
7363def GetDefaultPyEncoding(*args, **kwargs):
7364 """
7365 GetDefaultPyEncoding() -> string
7366
7367 Gets the current encoding that wxPython will use when it needs to
7368 convert a Python string or unicode object to or from a wxString.
7369 """
7370 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d55e5bfc
RD
7371#----------------------------------------------------------------------
7372
7373class PyOnDemandOutputWindow:
7374 """
7375 A class that can be used for redirecting Python's stdout and
7376 stderr streams. It will do nothing until something is wrriten to
7377 the stream at which point it will create a Frame with a text area
7378 and write the text there.
7379 """
7380 def __init__(self, title = "wxPython: stdout/stderr"):
7381 self.frame = None
7382 self.title = title
412d302d
RD
7383 self.pos = wx.DefaultPosition
7384 self.size = (450, 300)
d55e5bfc
RD
7385 self.parent = None
7386
7387 def SetParent(self, parent):
7388 """Set the window to be used as the popup Frame's parent."""
7389 self.parent = parent
7390
7391
7392 def CreateOutputWindow(self, st):
412d302d
RD
7393 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7394 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7395 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7396 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7397 self.text.AppendText(st)
d55e5bfc
RD
7398 self.frame.Show(True)
7399 EVT_CLOSE(self.frame, self.OnCloseWindow)
7400
7401
7402 def OnCloseWindow(self, event):
7403 if self.frame is not None:
7404 self.frame.Destroy()
7405 self.frame = None
7406 self.text = None
7407
7408
7409 # These methods provide the file-like output behaviour.
7410 def write(self, text):
7411 """
7412 Create the output window if needed and write the string to it.
7413 If not called in the context of the gui thread then uses
7414 CallAfter to do the work there.
7415 """
7416 if self.frame is None:
7417 if not wx.Thread_IsMain():
7418 wx.CallAfter(self.CreateOutputWindow, text)
7419 else:
7420 self.CreateOutputWindow(text)
7421 else:
7422 if not wx.Thread_IsMain():
7423 wx.CallAfter(self.text.AppendText, text)
7424 else:
7425 self.text.AppendText(text)
7426
7427
7428 def close(self):
7429 if self.frame is not None:
7430 wx.CallAfter(self.frame.Close)
7431
7432
19272049
RD
7433 def flush(self):
7434 pass
7435
7436
d55e5bfc
RD
7437
7438#----------------------------------------------------------------------
7439
7440_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7441
7442class App(wx.PyApp):
7443 """
c24da6d6
RD
7444 The ``wx.App`` class represents the application and is used to:
7445
7446 * bootstrap the wxPython system and initialize the underlying
7447 gui toolkit
7448 * set and get application-wide properties
7449 * implement the windowing system main message or event loop,
7450 and to dispatch events to window instances
7451 * etc.
7452
7453 Every application must have a ``wx.App`` instance, and all
7454 creation of UI objects should be delayed until after the
7455 ``wx.App`` object has been created in order to ensure that the gui
7456 platform and wxWidgets have been fully initialized.
7457
7458 Normally you would derive from this class and implement an
7459 ``OnInit`` method that creates a frame and then calls
7460 ``self.SetTopWindow(frame)``.
7461
7462 :see: `wx.PySimpleApp` for a simpler app class that can be used
79fccf9d 7463 directly.
d55e5bfc 7464 """
c24da6d6 7465
d55e5bfc
RD
7466 outputWindowClass = PyOnDemandOutputWindow
7467
c24da6d6
RD
7468 def __init__(self, redirect=_defRedirect, filename=None,
7469 useBestVisual=False, clearSigInt=True):
7470 """
7471 Construct a ``wx.App`` object.
7472
7473 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7474 redirected? Defaults to True on Windows and Mac, False
7475 otherwise. If `filename` is None then output will be
7476 redirected to a window that pops up as needed. (You can
7477 control what kind of window is created for the output by
7478 resetting the class variable ``outputWindowClass`` to a
7479 class of your choosing.)
7480
7481 :param filename: The name of a file to redirect output to, if
7482 redirect is True.
7483
7484 :param useBestVisual: Should the app try to use the best
7485 available visual provided by the system (only relevant on
7486 systems that have more than one visual.) This parameter
7487 must be used instead of calling `SetUseBestVisual` later
7488 on because it must be set before the underlying GUI
7489 toolkit is initialized.
7490
7491 :param clearSigInt: Should SIGINT be cleared? This allows the
7492 app to terminate upon a Ctrl-C in the console like other
7493 GUI apps will.
7494
7495 :note: You should override OnInit to do applicaition
7496 initialization to ensure that the system, toolkit and
7497 wxWidgets are fully initialized.
7498 """
d55e5bfc
RD
7499 wx.PyApp.__init__(self)
7500
7501 if wx.Platform == "__WXMAC__":
7502 try:
7503 import MacOS
7504 if not MacOS.WMAvailable():
7505 print """\
7506This program needs access to the screen. Please run with 'pythonw',
7507not 'python', and only when you are logged in on the main display of
7508your Mac."""
7509 _sys.exit(1)
b1f29bf7
RD
7510 except SystemExit:
7511 raise
d55e5bfc
RD
7512 except:
7513 pass
7514
7515 # This has to be done before OnInit
7516 self.SetUseBestVisual(useBestVisual)
7517
7518 # Set the default handler for SIGINT. This fixes a problem
7519 # where if Ctrl-C is pressed in the console that started this
7520 # app then it will not appear to do anything, (not even send
7521 # KeyboardInterrupt???) but will later segfault on exit. By
7522 # setting the default handler then the app will exit, as
7523 # expected (depending on platform.)
c24da6d6
RD
7524 if clearSigInt:
7525 try:
7526 import signal
7527 signal.signal(signal.SIGINT, signal.SIG_DFL)
7528 except:
7529 pass
d55e5bfc
RD
7530
7531 # Save and redirect the stdio to a window?
7532 self.stdioWin = None
7533 self.saveStdio = (_sys.stdout, _sys.stderr)
7534 if redirect:
7535 self.RedirectStdio(filename)
7536
8fb0e70a
RD
7537 # Use Python's install prefix as the default
7538 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7539
d55e5bfc
RD
7540 # This finishes the initialization of wxWindows and then calls
7541 # the OnInit that should be present in the derived class
7542 self._BootstrapApp()
7543
7544
66af7a75
RD
7545 def __del__(self, destroy=wx.PyApp.__del__):
7546 self.RestoreStdio() # Just in case the MainLoop was overridden
7547 destroy(self)
d55e5bfc 7548
70b7a5fe
RD
7549 def Destroy(self):
7550 wx.PyApp.Destroy(self)
7551 self.thisown = 0
d55e5bfc
RD
7552
7553 def SetTopWindow(self, frame):
7554 """Set the \"main\" top level window"""
7555 if self.stdioWin:
7556 self.stdioWin.SetParent(frame)
7557 wx.PyApp.SetTopWindow(self, frame)
7558
7559
7560 def MainLoop(self):
7561 """Execute the main GUI event loop"""
7562 wx.PyApp.MainLoop(self)
7563 self.RestoreStdio()
7564
7565
7566 def RedirectStdio(self, filename=None):
7567 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7568 if filename:
7569 _sys.stdout = _sys.stderr = open(filename, 'a')
7570 else:
7571 self.stdioWin = self.outputWindowClass()
7572 _sys.stdout = _sys.stderr = self.stdioWin
7573
7574
7575 def RestoreStdio(self):
66af7a75
RD
7576 try:
7577 _sys.stdout, _sys.stderr = self.saveStdio
7578 except:
7579 pass
d55e5bfc
RD
7580
7581
412d302d
RD
7582 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7583 """
7584 Set the title, position and/or size of the output window if
f5b96ee1
RD
7585 the stdio has been redirected. This should be called before
7586 any output would cause the output window to be created.
412d302d
RD
7587 """
7588 if self.stdioWin:
7589 if title is not None:
7590 self.stdioWin.title = title
7591 if pos is not None:
7592 self.stdioWin.pos = pos
7593 if size is not None:
7594 self.stdioWin.size = size
7595
7596
7597
d55e5bfc 7598
c24da6d6 7599# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7600App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7601App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7602App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7603App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7604App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7605App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7606App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7607App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7608App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7609App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7610App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7611
7612#----------------------------------------------------------------------------
7613
7614class PySimpleApp(wx.App):
7615 """
7616 A simple application class. You can just create one of these and
7617 then then make your top level windows later, and not have to worry
c24da6d6 7618 about OnInit. For example::
d55e5bfc 7619
c24da6d6
RD
7620 app = wx.PySimpleApp()
7621 frame = wx.Frame(None, title='Hello World')
7622 frame.Show()
7623 app.MainLoop()
7624
7625 :see: `wx.App`
7626 """
7627
7628 def __init__(self, redirect=False, filename=None,
7629 useBestVisual=False, clearSigInt=True):
7630 """
7631 :see: `wx.App.__init__`
7632 """
7633 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7634
7635 def OnInit(self):
d55e5bfc
RD
7636 return True
7637
7638
c24da6d6 7639
d55e5bfc
RD
7640# Is anybody using this one?
7641class PyWidgetTester(wx.App):
7642 def __init__(self, size = (250, 100)):
7643 self.size = size
7644 wx.App.__init__(self, 0)
7645
7646 def OnInit(self):
7647 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7648 self.SetTopWindow(self.frame)
7649 return True
7650
c24da6d6
RD
7651 def SetWidget(self, widgetClass, *args, **kwargs):
7652 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7653 self.frame.Show(True)
7654
7655#----------------------------------------------------------------------------
7656# DO NOT hold any other references to this object. This is how we
c24da6d6 7657# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7658# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
c24da6d6 7659# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7660
7661class __wxPyCleanup:
7662 def __init__(self):
7663 self.cleanup = _core_.App_CleanUp
7664 def __del__(self):
7665 self.cleanup()
7666
7667_sys.__wxPythonCleanup = __wxPyCleanup()
7668
7669## # another possible solution, but it gets called too early...
c24da6d6
RD
7670## import atexit
7671## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7672
7673
7674#----------------------------------------------------------------------------
7675
7676#---------------------------------------------------------------------------
7677
ae8162c8 7678class EventLoop(object):
093d3ff1 7679 """Proxy of C++ EventLoop class"""
ae8162c8
RD
7680 def __repr__(self):
7681 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7682 def __init__(self, *args, **kwargs):
7683 """__init__(self) -> EventLoop"""
7684 newobj = _core_.new_EventLoop(*args, **kwargs)
7685 self.this = newobj.this
7686 self.thisown = 1
7687 del newobj.thisown
7688 def __del__(self, destroy=_core_.delete_EventLoop):
7689 """__del__(self)"""
7690 try:
7691 if self.thisown: destroy(self)
7692 except: pass
7693
7694 def Run(*args, **kwargs):
7695 """Run(self) -> int"""
7696 return _core_.EventLoop_Run(*args, **kwargs)
7697
7698 def Exit(*args, **kwargs):
7699 """Exit(self, int rc=0)"""
7700 return _core_.EventLoop_Exit(*args, **kwargs)
7701
7702 def Pending(*args, **kwargs):
7703 """Pending(self) -> bool"""
7704 return _core_.EventLoop_Pending(*args, **kwargs)
7705
7706 def Dispatch(*args, **kwargs):
7707 """Dispatch(self) -> bool"""
7708 return _core_.EventLoop_Dispatch(*args, **kwargs)
7709
7710 def IsRunning(*args, **kwargs):
7711 """IsRunning(self) -> bool"""
7712 return _core_.EventLoop_IsRunning(*args, **kwargs)
7713
7714 def GetActive(*args, **kwargs):
7715 """GetActive() -> EventLoop"""
7716 return _core_.EventLoop_GetActive(*args, **kwargs)
7717
7718 GetActive = staticmethod(GetActive)
7719 def SetActive(*args, **kwargs):
7720 """SetActive(EventLoop loop)"""
7721 return _core_.EventLoop_SetActive(*args, **kwargs)
7722
7723 SetActive = staticmethod(SetActive)
7724
7725class EventLoopPtr(EventLoop):
7726 def __init__(self, this):
7727 self.this = this
7728 if not hasattr(self,"thisown"): self.thisown = 0
7729 self.__class__ = EventLoop
7730_core_.EventLoop_swigregister(EventLoopPtr)
7731
7732def EventLoop_GetActive(*args, **kwargs):
7733 """EventLoop_GetActive() -> EventLoop"""
7734 return _core_.EventLoop_GetActive(*args, **kwargs)
7735
7736def EventLoop_SetActive(*args, **kwargs):
7737 """EventLoop_SetActive(EventLoop loop)"""
7738 return _core_.EventLoop_SetActive(*args, **kwargs)
7739
7740#---------------------------------------------------------------------------
7741
d55e5bfc 7742class AcceleratorEntry(object):
c24da6d6
RD
7743 """
7744 A class used to define items in an `wx.AcceleratorTable`. wxPython
7745 programs can choose to use wx.AcceleratorEntry objects, but using a
7746 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
79fccf9d 7747 as well. See `__init__` for of the tuple values.
c24da6d6
RD
7748
7749 :see: `wx.AcceleratorTable`
7750 """
d55e5bfc
RD
7751 def __repr__(self):
7752 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7753 def __init__(self, *args, **kwargs):
c24da6d6
RD
7754 """
7755 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7756
7757 Construct a wx.AcceleratorEntry.
c24da6d6 7758 """
d55e5bfc
RD
7759 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
7760 self.this = newobj.this
7761 self.thisown = 1
7762 del newobj.thisown
7763 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
7764 """__del__(self)"""
7765 try:
7766 if self.thisown: destroy(self)
7767 except: pass
7768
7769 def Set(*args, **kwargs):
c24da6d6
RD
7770 """
7771 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7772
c24da6d6
RD
7773 (Re)set the attributes of a wx.AcceleratorEntry.
7774 :see `__init__`
7775 """
7776 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7777
7778 def GetFlags(*args, **kwargs):
c24da6d6
RD
7779 """
7780 GetFlags(self) -> int
7781
7782 Get the AcceleratorEntry's flags.
7783 """
d55e5bfc
RD
7784 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7785
7786 def GetKeyCode(*args, **kwargs):
c24da6d6
RD
7787 """
7788 GetKeyCode(self) -> int
7789
7790 Get the AcceleratorEntry's keycode.
7791 """
d55e5bfc
RD
7792 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7793
7794 def GetCommand(*args, **kwargs):
c24da6d6
RD
7795 """
7796 GetCommand(self) -> int
7797
7798 Get the AcceleratorEntry's command ID.
7799 """
d55e5bfc
RD
7800 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7801
7802
7803class AcceleratorEntryPtr(AcceleratorEntry):
7804 def __init__(self, this):
7805 self.this = this
7806 if not hasattr(self,"thisown"): self.thisown = 0
7807 self.__class__ = AcceleratorEntry
7808_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
7809
7810class AcceleratorTable(Object):
c24da6d6
RD
7811 """
7812 An accelerator table allows the application to specify a table of
7813 keyboard shortcuts for menus or other commands. On Windows, menu or
7814 button commands are supported; on GTK, only menu commands are
7815 supported.
c24da6d6 7816 """
d55e5bfc
RD
7817 def __repr__(self):
7818 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7819 def __init__(self, *args, **kwargs):
7820 """
7821 __init__(entries) -> AcceleratorTable
7822
c24da6d6
RD
7823 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7824 items or or of 3-tuples (flags, keyCode, cmdID)
7825
7826 :see: `wx.AcceleratorEntry`
d55e5bfc
RD
7827 """
7828 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
7829 self.this = newobj.this
7830 self.thisown = 1
7831 del newobj.thisown
7832 def __del__(self, destroy=_core_.delete_AcceleratorTable):
7833 """__del__(self)"""
7834 try:
7835 if self.thisown: destroy(self)
7836 except: pass
7837
7838 def Ok(*args, **kwargs):
7839 """Ok(self) -> bool"""
7840 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7841
7842
7843class AcceleratorTablePtr(AcceleratorTable):
7844 def __init__(self, this):
7845 self.this = this
7846 if not hasattr(self,"thisown"): self.thisown = 0
7847 self.__class__ = AcceleratorTable
7848_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
7849
7850
7851def GetAccelFromString(*args, **kwargs):
7852 """GetAccelFromString(String label) -> AcceleratorEntry"""
7853 return _core_.GetAccelFromString(*args, **kwargs)
7854#---------------------------------------------------------------------------
7855
7856class VisualAttributes(object):
7857 """struct containing all the visual attributes of a control"""
7858 def __repr__(self):
7859 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7860 def __init__(self, *args, **kwargs):
7861 """
7862 __init__(self) -> VisualAttributes
7863
7864 struct containing all the visual attributes of a control
7865 """
7866 newobj = _core_.new_VisualAttributes(*args, **kwargs)
7867 self.this = newobj.this
7868 self.thisown = 1
7869 del newobj.thisown
7870 def __del__(self, destroy=_core_.delete_VisualAttributes):
7871 """__del__(self)"""
7872 try:
7873 if self.thisown: destroy(self)
7874 except: pass
7875
7876 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7877 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7878 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
7879
7880class VisualAttributesPtr(VisualAttributes):
7881 def __init__(self, this):
7882 self.this = this
7883 if not hasattr(self,"thisown"): self.thisown = 0
7884 self.__class__ = VisualAttributes
7885_core_.VisualAttributes_swigregister(VisualAttributesPtr)
7886NullAcceleratorTable = cvar.NullAcceleratorTable
7887PanelNameStr = cvar.PanelNameStr
7888
7889WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7890WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7891WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7892WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7893WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7894class Window(EvtHandler):
7895 """
7896 wx.Window is the base class for all windows and represents any visible
7897 object on the screen. All controls, top level windows and so on are
7898 wx.Windows. Sizers and device contexts are not however, as they don't
7899 appear on screen themselves.
7900
7901 """
7902 def __repr__(self):
7903 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7904 def __init__(self, *args, **kwargs):
7905 """
7906 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7907 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7908
7909 Construct and show a generic Window.
7910 """
7911 newobj = _core_.new_Window(*args, **kwargs)
7912 self.this = newobj.this
7913 self.thisown = 1
7914 del newobj.thisown
7915 self._setOORInfo(self)
7916
7917 def Create(*args, **kwargs):
7918 """
7919 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7920 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7921
7922 Create the GUI part of the Window for 2-phase creation mode.
7923 """
7924 return _core_.Window_Create(*args, **kwargs)
7925
7926 def Close(*args, **kwargs):
7927 """
7928 Close(self, bool force=False) -> bool
7929
7930 This function simply generates a EVT_CLOSE event whose handler usually
7931 tries to close the window. It doesn't close the window itself,
7932 however. If force is False (the default) then the window's close
7933 handler will be allowed to veto the destruction of the window.
d55e5bfc
RD
7934 """
7935 return _core_.Window_Close(*args, **kwargs)
7936
7937 def Destroy(*args, **kwargs):
7938 """
7939 Destroy(self) -> bool
7940
7941 Destroys the window safely. Frames and dialogs are not destroyed
7942 immediately when this function is called -- they are added to a list
7943 of windows to be deleted on idle time, when all the window's events
7944 have been processed. This prevents problems with events being sent to
7945 non-existent windows.
7946
7947 Returns True if the window has either been successfully deleted, or it
7948 has been added to the list of windows pending real deletion.
7949 """
7950 return _core_.Window_Destroy(*args, **kwargs)
7951
7952 def DestroyChildren(*args, **kwargs):
7953 """
7954 DestroyChildren(self) -> bool
7955
79fccf9d
RD
7956 Destroys all children of a window. Called automatically by the
7957 destructor.
d55e5bfc
RD
7958 """
7959 return _core_.Window_DestroyChildren(*args, **kwargs)
7960
7961 def IsBeingDeleted(*args, **kwargs):
7962 """
7963 IsBeingDeleted(self) -> bool
7964
7965 Is the window in the process of being deleted?
7966 """
7967 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7968
d55e5bfc
RD
7969 def SetLabel(*args, **kwargs):
7970 """
7971 SetLabel(self, String label)
7972
7973 Set the text which the window shows in its label if applicable.
7974 """
7975 return _core_.Window_SetLabel(*args, **kwargs)
7976
7977 def GetLabel(*args, **kwargs):
7978 """
7979 GetLabel(self) -> String
7980
79fccf9d
RD
7981 Generic way of getting a label from any window, for identification
7982 purposes. The interpretation of this function differs from class to
7983 class. For frames and dialogs, the value returned is the title. For
7984 buttons or static text controls, it is the button text. This function
7985 can be useful for meta-programs such as testing tools or special-needs
7986 access programs)which need to identify windows by name.
d55e5bfc
RD
7987 """
7988 return _core_.Window_GetLabel(*args, **kwargs)
7989
7990 def SetName(*args, **kwargs):
7991 """
7992 SetName(self, String name)
7993
79fccf9d
RD
7994 Sets the window's name. The window name is used for ressource setting
7995 in X, it is not the same as the window title/label
d55e5bfc
RD
7996 """
7997 return _core_.Window_SetName(*args, **kwargs)
7998
7999 def GetName(*args, **kwargs):
8000 """
8001 GetName(self) -> String
8002
79fccf9d
RD
8003 Returns the windows name. This name is not guaranteed to be unique;
8004 it is up to the programmer to supply an appropriate name in the window
8005 constructor or via wx.Window.SetName.
d55e5bfc
RD
8006 """
8007 return _core_.Window_GetName(*args, **kwargs)
8008
8009 def SetWindowVariant(*args, **kwargs):
8010 """
8011 SetWindowVariant(self, int variant)
8012
79fccf9d
RD
8013 Sets the variant of the window/font size to use for this window, if
8014 the platform supports variants, for example, wxMac.
d55e5bfc
RD
8015 """
8016 return _core_.Window_SetWindowVariant(*args, **kwargs)
8017
8018 def GetWindowVariant(*args, **kwargs):
8019 """GetWindowVariant(self) -> int"""
8020 return _core_.Window_GetWindowVariant(*args, **kwargs)
8021
8022 def SetId(*args, **kwargs):
8023 """
8024 SetId(self, int winid)
8025
8026 Sets the identifier of the window. Each window has an integer
8027 identifier. If the application has not provided one, an identifier
8028 will be generated. Normally, the identifier should be provided on
8029 creation and should not be modified subsequently.
8030 """
8031 return _core_.Window_SetId(*args, **kwargs)
8032
8033 def GetId(*args, **kwargs):
8034 """
8035 GetId(self) -> int
8036
8037 Returns the identifier of the window. Each window has an integer
8038 identifier. If the application has not provided one (or the default Id
8039 -1 is used) then an unique identifier with a negative value will be
8040 generated.
8041 """
8042 return _core_.Window_GetId(*args, **kwargs)
8043
8044 def NewControlId(*args, **kwargs):
8045 """
c24da6d6 8046 NewControlId() -> int
d55e5bfc
RD
8047
8048 Generate a control id for the controls which were not given one.
8049 """
8050 return _core_.Window_NewControlId(*args, **kwargs)
8051
8052 NewControlId = staticmethod(NewControlId)
8053 def NextControlId(*args, **kwargs):
8054 """
c24da6d6 8055 NextControlId(int winid) -> int
d55e5bfc
RD
8056
8057 Get the id of the control following the one with the given
79fccf9d 8058 autogenerated) id
d55e5bfc
RD
8059 """
8060 return _core_.Window_NextControlId(*args, **kwargs)
8061
8062 NextControlId = staticmethod(NextControlId)
8063 def PrevControlId(*args, **kwargs):
8064 """
c24da6d6 8065 PrevControlId(int winid) -> int
d55e5bfc
RD
8066
8067 Get the id of the control preceding the one with the given
79fccf9d 8068 autogenerated) id
d55e5bfc
RD
8069 """
8070 return _core_.Window_PrevControlId(*args, **kwargs)
8071
8072 PrevControlId = staticmethod(PrevControlId)
8073 def SetSize(*args, **kwargs):
8074 """
8075 SetSize(self, Size size)
8076
8077 Sets the size of the window in pixels.
8078 """
8079 return _core_.Window_SetSize(*args, **kwargs)
8080
8081 def SetDimensions(*args, **kwargs):
8082 """
8083 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8084
8085 Sets the position and size of the window in pixels. The sizeFlags
8086 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
8087 equal to -1.
8088
8089 ======================== ======================================
8090 wx.SIZE_AUTO A -1 indicates that a class-specific
8091 default should be used.
8092 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8093 -1 values are supplied.
8094 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8095 interpreted as real dimensions, not
8096 default values.
8097 ======================== ======================================
8098
d55e5bfc
RD
8099 """
8100 return _core_.Window_SetDimensions(*args, **kwargs)
8101
8102 def SetRect(*args, **kwargs):
8103 """
8104 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8105
8106 Sets the position and size of the window in pixels using a wx.Rect.
8107 """
8108 return _core_.Window_SetRect(*args, **kwargs)
8109
8110 def SetSizeWH(*args, **kwargs):
8111 """
8112 SetSizeWH(self, int width, int height)
8113
8114 Sets the size of the window in pixels.
8115 """
8116 return _core_.Window_SetSizeWH(*args, **kwargs)
8117
8118 def Move(*args, **kwargs):
8119 """
8120 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8121
8122 Moves the window to the given position.
8123 """
8124 return _core_.Window_Move(*args, **kwargs)
8125
8126 SetPosition = Move
8127 def MoveXY(*args, **kwargs):
8128 """
8129 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8130
8131 Moves the window to the given position.
8132 """
8133 return _core_.Window_MoveXY(*args, **kwargs)
8134
f8167d6e
RD
8135 def SetBestFittingSize(*args, **kwargs):
8136 """
8137 SetBestFittingSize(self, Size size=DefaultSize)
8138
8139 A 'Smart' SetSize that will fill in default size components with the
8140 window's *best size* values. Also set's the minsize for use with sizers.
8141 """
8142 return _core_.Window_SetBestFittingSize(*args, **kwargs)
8143
d55e5bfc
RD
8144 def Raise(*args, **kwargs):
8145 """
8146 Raise(self)
8147
8148 Raises the window to the top of the window hierarchy if it is a
8149 managed window (dialog or frame).
8150 """
8151 return _core_.Window_Raise(*args, **kwargs)
8152
8153 def Lower(*args, **kwargs):
8154 """
8155 Lower(self)
8156
8157 Lowers the window to the bottom of the window hierarchy if it is a
8158 managed window (dialog or frame).
8159 """
8160 return _core_.Window_Lower(*args, **kwargs)
8161
8162 def SetClientSize(*args, **kwargs):
8163 """
8164 SetClientSize(self, Size size)
8165
8166 This sets the size of the window client area in pixels. Using this
8167 function to size a window tends to be more device-independent than
8168 wx.Window.SetSize, since the application need not worry about what
8169 dimensions the border or title bar have when trying to fit the window
8170 around panel items, for example.
8171 """
8172 return _core_.Window_SetClientSize(*args, **kwargs)
8173
8174 def SetClientSizeWH(*args, **kwargs):
8175 """
8176 SetClientSizeWH(self, int width, int height)
8177
8178 This sets the size of the window client area in pixels. Using this
8179 function to size a window tends to be more device-independent than
8180 wx.Window.SetSize, since the application need not worry about what
8181 dimensions the border or title bar have when trying to fit the window
8182 around panel items, for example.
8183 """
8184 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8185
8186 def SetClientRect(*args, **kwargs):
8187 """
8188 SetClientRect(self, Rect rect)
8189
8190 This sets the size of the window client area in pixels. Using this
8191 function to size a window tends to be more device-independent than
8192 wx.Window.SetSize, since the application need not worry about what
8193 dimensions the border or title bar have when trying to fit the window
8194 around panel items, for example.
8195 """
8196 return _core_.Window_SetClientRect(*args, **kwargs)
8197
8198 def GetPosition(*args, **kwargs):
8199 """
8200 GetPosition(self) -> Point
8201
8202 Get the window's position.
8203 """
8204 return _core_.Window_GetPosition(*args, **kwargs)
8205
8206 def GetPositionTuple(*args, **kwargs):
8207 """
8208 GetPositionTuple() -> (x,y)
8209
8210 Get the window's position.
8211 """
8212 return _core_.Window_GetPositionTuple(*args, **kwargs)
8213
8214 def GetSize(*args, **kwargs):
8215 """
8216 GetSize(self) -> Size
8217
8218 Get the window size.
8219 """
8220 return _core_.Window_GetSize(*args, **kwargs)
8221
8222 def GetSizeTuple(*args, **kwargs):
8223 """
8224 GetSizeTuple() -> (width, height)
8225
8226 Get the window size.
8227 """
8228 return _core_.Window_GetSizeTuple(*args, **kwargs)
8229
8230 def GetRect(*args, **kwargs):
8231 """
8232 GetRect(self) -> Rect
8233
8234 Returns the size and position of the window as a wx.Rect object.
8235 """
8236 return _core_.Window_GetRect(*args, **kwargs)
8237
8238 def GetClientSize(*args, **kwargs):
8239 """
8240 GetClientSize(self) -> Size
8241
8242 This gets the size of the window's 'client area' in pixels. The client
8243 area is the area which may be drawn on by the programmer, excluding
8244 title bar, border, scrollbars, etc.
8245 """
8246 return _core_.Window_GetClientSize(*args, **kwargs)
8247
8248 def GetClientSizeTuple(*args, **kwargs):
8249 """
8250 GetClientSizeTuple() -> (width, height)
8251
8252 This gets the size of the window's 'client area' in pixels. The client
8253 area is the area which may be drawn on by the programmer, excluding
8254 title bar, border, scrollbars, etc.
8255 """
8256 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8257
8258 def GetClientAreaOrigin(*args, **kwargs):
8259 """
8260 GetClientAreaOrigin(self) -> Point
8261
8262 Get the origin of the client area of the window relative to the
8263 window's top left corner (the client area may be shifted because of
8264 the borders, scrollbars, other decorations...)
8265 """
8266 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8267
8268 def GetClientRect(*args, **kwargs):
8269 """
8270 GetClientRect(self) -> Rect
8271
629f3c1b 8272 Get the client area position and size as a `wx.Rect` object.
d55e5bfc
RD
8273 """
8274 return _core_.Window_GetClientRect(*args, **kwargs)
8275
8276 def GetBestSize(*args, **kwargs):
8277 """
8278 GetBestSize(self) -> Size
8279
248ed943 8280 This function returns the best acceptable minimal size for the
79fccf9d
RD
8281 window, if applicable. For example, for a static text control, it will
8282 be the minimal size such that the control label is not truncated. For
8283 windows containing subwindows (suzh aswx.Panel), the size returned by
8284 this function will be the same as the size the window would have had
8285 after calling Fit.
d55e5bfc
RD
8286 """
8287 return _core_.Window_GetBestSize(*args, **kwargs)
8288
8289 def GetBestSizeTuple(*args, **kwargs):
8290 """
8291 GetBestSizeTuple() -> (width, height)
8292
248ed943 8293 This function returns the best acceptable minimal size for the
79fccf9d
RD
8294 window, if applicable. For example, for a static text control, it will
8295 be the minimal size such that the control label is not truncated. For
8296 windows containing subwindows (suzh aswx.Panel), the size returned by
8297 this function will be the same as the size the window would have had
8298 after calling Fit.
d55e5bfc
RD
8299 """
8300 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8301
a001823c
RD
8302 def InvalidateBestSize(*args, **kwargs):
8303 """
8304 InvalidateBestSize(self)
8305
8306 Reset the cached best size value so it will be recalculated the next
8307 time it is needed.
8308 """
8309 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8310
e2813725
RD
8311 def CacheBestSize(*args, **kwargs):
8312 """
8313 CacheBestSize(self, Size size)
8314
8315 Cache the best size so it doesn't need to be calculated again, (at least until
8316 some properties of the window change.)
8317 """
8318 return _core_.Window_CacheBestSize(*args, **kwargs)
8319
a001823c
RD
8320 def GetBestFittingSize(*args, **kwargs):
8321 """
8322 GetBestFittingSize(self) -> Size
8323
8324 This function will merge the window's best size into the window's
8325 minimum size, giving priority to the min size components, and returns
8326 the results.
8327
8328 """
8329 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8330
d55e5bfc
RD
8331 def GetAdjustedBestSize(*args, **kwargs):
8332 """
8333 GetAdjustedBestSize(self) -> Size
8334
8335 This method is similar to GetBestSize, except in one
8336 thing. GetBestSize should return the minimum untruncated size of the
8337 window, while this method will return the largest of BestSize and any
8338 user specified minimum size. ie. it is the minimum size the window
8339 should currently be drawn at, not the minimal size it can possibly
8340 tolerate.
8341 """
8342 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
8343
8344 def Center(*args, **kwargs):
8345 """
8346 Center(self, int direction=BOTH)
8347
8348 Centers the window. The parameter specifies the direction for
8349 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8350 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8351 on the entire screen and not on its parent window. If it is a
8352 top-level window and has no parent then it will always be centered
8353 relative to the screen.
8354 """
8355 return _core_.Window_Center(*args, **kwargs)
8356
8357 Centre = Center
8358 def CenterOnScreen(*args, **kwargs):
8359 """
8360 CenterOnScreen(self, int dir=BOTH)
8361
8362 Center on screen (only works for top level windows)
8363 """
8364 return _core_.Window_CenterOnScreen(*args, **kwargs)
8365
8366 CentreOnScreen = CenterOnScreen
8367 def CenterOnParent(*args, **kwargs):
8368 """
8369 CenterOnParent(self, int dir=BOTH)
8370
8371 Center with respect to the the parent window
8372 """
8373 return _core_.Window_CenterOnParent(*args, **kwargs)
8374
8375 CentreOnParent = CenterOnParent
8376 def Fit(*args, **kwargs):
8377 """
8378 Fit(self)
8379
8380 Sizes the window so that it fits around its subwindows. This function
8381 won't do anything if there are no subwindows and will only really work
8382 correctly if sizers are used for the subwindows layout. Also, if the
8383 window has exactly one subwindow it is better (faster and the result
8384 is more precise as Fit adds some margin to account for fuzziness of
8385 its calculations) to call window.SetClientSize(child.GetSize())
8386 instead of calling Fit.
8387 """
8388 return _core_.Window_Fit(*args, **kwargs)
8389
8390 def FitInside(*args, **kwargs):
8391 """
8392 FitInside(self)
8393
8394 Similar to Fit, but sizes the interior (virtual) size of a
8395 window. Mainly useful with scrolled windows to reset scrollbars after
8396 sizing changes that do not trigger a size event, and/or scrolled
8397 windows without an interior sizer. This function similarly won't do
8398 anything if there are no subwindows.
8399 """
8400 return _core_.Window_FitInside(*args, **kwargs)
8401
03837c5c 8402 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8403 """
8404 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8405 int incH=-1)
d55e5bfc
RD
8406
8407 Allows specification of minimum and maximum window sizes, and window
8408 size increments. If a pair of values is not set (or set to -1), the
8409 default values will be used. If this function is called, the user
908b74cd
RD
8410 will not be able to size the window outside the given bounds (if it is
8411 a top-level window.) Sizers will also inspect the minimum window size
8412 and will use that value if set when calculating layout.
8413
8414 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8415 """
03837c5c 8416 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8417
03837c5c
RD
8418 def SetSizeHintsSz(*args, **kwargs):
8419 """
8420 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8421
8422 Allows specification of minimum and maximum window sizes, and window
8423 size increments. If a pair of values is not set (or set to -1), the
8424 default values will be used. If this function is called, the user
8425 will not be able to size the window outside the given bounds (if it is
8426 a top-level window.) Sizers will also inspect the minimum window size
8427 and will use that value if set when calculating layout.
8428
8429 The resizing increments are only significant under Motif or Xt.
8430 """
8431 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8432
8433 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8434 """
908b74cd 8435 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8436
8437 Allows specification of minimum and maximum virtual window sizes. If a
8438 pair of values is not set (or set to -1), the default values will be
8439 used. If this function is called, the user will not be able to size
8440 the virtual area of the window outside the given bounds.
8441 """
03837c5c
RD
8442 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8443
8444 def SetVirtualSizeHintsSz(*args, **kwargs):
8445 """
8446 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8447
8448 Allows specification of minimum and maximum virtual window sizes. If a
8449 pair of values is not set (or set to -1), the default values will be
8450 used. If this function is called, the user will not be able to size
8451 the virtual area of the window outside the given bounds.
8452 """
8453 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8454
908b74cd
RD
8455 def GetMaxSize(*args, **kwargs):
8456 """GetMaxSize(self) -> Size"""
8457 return _core_.Window_GetMaxSize(*args, **kwargs)
8458
8459 def GetMinSize(*args, **kwargs):
8460 """GetMinSize(self) -> Size"""
8461 return _core_.Window_GetMinSize(*args, **kwargs)
8462
8463 def SetMinSize(*args, **kwargs):
8464 """
8465 SetMinSize(self, Size minSize)
8466
8467 A more convenient method than `SetSizeHints` for setting just the
8468 min size.
8469 """
8470 return _core_.Window_SetMinSize(*args, **kwargs)
8471
8472 def SetMaxSize(*args, **kwargs):
8473 """
8474 SetMaxSize(self, Size maxSize)
8475
8476 A more convenient method than `SetSizeHints` for setting just the
8477 max size.
8478 """
8479 return _core_.Window_SetMaxSize(*args, **kwargs)
8480
d55e5bfc
RD
8481 def GetMinWidth(*args, **kwargs):
8482 """GetMinWidth(self) -> int"""
8483 return _core_.Window_GetMinWidth(*args, **kwargs)
8484
8485 def GetMinHeight(*args, **kwargs):
8486 """GetMinHeight(self) -> int"""
8487 return _core_.Window_GetMinHeight(*args, **kwargs)
8488
8489 def GetMaxWidth(*args, **kwargs):
8490 """GetMaxWidth(self) -> int"""
8491 return _core_.Window_GetMaxWidth(*args, **kwargs)
8492
8493 def GetMaxHeight(*args, **kwargs):
8494 """GetMaxHeight(self) -> int"""
8495 return _core_.Window_GetMaxHeight(*args, **kwargs)
8496
d55e5bfc
RD
8497 def SetVirtualSize(*args, **kwargs):
8498 """
8499 SetVirtualSize(self, Size size)
8500
8501 Set the the virtual size of a window in pixels. For most windows this
8502 is just the client area of the window, but for some like scrolled
8503 windows it is more or less independent of the screen window size.
8504 """
8505 return _core_.Window_SetVirtualSize(*args, **kwargs)
8506
8507 def SetVirtualSizeWH(*args, **kwargs):
8508 """
8509 SetVirtualSizeWH(self, int w, int h)
8510
8511 Set the the virtual size of a window in pixels. For most windows this
8512 is just the client area of the window, but for some like scrolled
8513 windows it is more or less independent of the screen window size.
8514 """
8515 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8516
8517 def GetVirtualSize(*args, **kwargs):
8518 """
8519 GetVirtualSize(self) -> Size
8520
8521 Get the the virtual size of the window in pixels. For most windows
8522 this is just the client area of the window, but for some like scrolled
8523 windows it is more or less independent of the screen window size.
8524 """
8525 return _core_.Window_GetVirtualSize(*args, **kwargs)
8526
8527 def GetVirtualSizeTuple(*args, **kwargs):
8528 """
8529 GetVirtualSizeTuple() -> (width, height)
8530
8531 Get the the virtual size of the window in pixels. For most windows
8532 this is just the client area of the window, but for some like scrolled
8533 windows it is more or less independent of the screen window size.
8534 """
8535 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8536
8537 def GetBestVirtualSize(*args, **kwargs):
8538 """
8539 GetBestVirtualSize(self) -> Size
8540
8541 Return the largest of ClientSize and BestSize (as determined by a
8542 sizer, interior children, or other means)
8543 """
8544 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8545
8546 def Show(*args, **kwargs):
8547 """
8548 Show(self, bool show=True) -> bool
8549
8550 Shows or hides the window. You may need to call Raise for a top level
8551 window if you want to bring it to top, although this is not needed if
8552 Show is called immediately after the frame creation. Returns True if
8553 the window has been shown or hidden or False if nothing was done
8554 because it already was in the requested state.
8555 """
8556 return _core_.Window_Show(*args, **kwargs)
8557
8558 def Hide(*args, **kwargs):
8559 """
8560 Hide(self) -> bool
8561
8562 Equivalent to calling Show(False).
8563 """
8564 return _core_.Window_Hide(*args, **kwargs)
8565
8566 def Enable(*args, **kwargs):
8567 """
8568 Enable(self, bool enable=True) -> bool
8569
8570 Enable or disable the window for user input. Note that when a parent
8571 window is disabled, all of its children are disabled as well and they
8572 are reenabled again when the parent is. Returns true if the window
8573 has been enabled or disabled, false if nothing was done, i.e. if the
8574 window had already been in the specified state.
8575 """
8576 return _core_.Window_Enable(*args, **kwargs)
8577
8578 def Disable(*args, **kwargs):
8579 """
8580 Disable(self) -> bool
8581
8582 Disables the window, same as Enable(false).
8583 """
8584 return _core_.Window_Disable(*args, **kwargs)
8585
8586 def IsShown(*args, **kwargs):
8587 """
8588 IsShown(self) -> bool
8589
8590 Returns true if the window is shown, false if it has been hidden.
8591 """
8592 return _core_.Window_IsShown(*args, **kwargs)
8593
8594 def IsEnabled(*args, **kwargs):
8595 """
8596 IsEnabled(self) -> bool
8597
8598 Returns true if the window is enabled for input, false otherwise.
8599 """
8600 return _core_.Window_IsEnabled(*args, **kwargs)
8601
8602 def SetWindowStyleFlag(*args, **kwargs):
8603 """
8604 SetWindowStyleFlag(self, long style)
8605
79fccf9d
RD
8606 Sets the style of the window. Please note that some styles cannot be
8607 changed after the window creation and that Refresh() might need to be
8608 called after changing the others for the change to take place
8609 immediately.
d55e5bfc
RD
8610 """
8611 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8612
8613 def GetWindowStyleFlag(*args, **kwargs):
8614 """
8615 GetWindowStyleFlag(self) -> long
8616
8617 Gets the window style that was passed to the constructor or Create
8618 method.
8619 """
8620 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8621
8622 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8623 def HasFlag(*args, **kwargs):
8624 """
8625 HasFlag(self, int flag) -> bool
8626
8627 Test if the given style is set for this window.
8628 """
8629 return _core_.Window_HasFlag(*args, **kwargs)
8630
8631 def IsRetained(*args, **kwargs):
8632 """
8633 IsRetained(self) -> bool
8634
8635 Returns true if the window is retained, false otherwise. Retained
8636 windows are only available on X platforms.
8637 """
8638 return _core_.Window_IsRetained(*args, **kwargs)
8639
8640 def SetExtraStyle(*args, **kwargs):
8641 """
8642 SetExtraStyle(self, long exStyle)
8643
8644 Sets the extra style bits for the window. Extra styles are the less
8645 often used style bits which can't be set with the constructor or with
8646 SetWindowStyleFlag()
8647 """
8648 return _core_.Window_SetExtraStyle(*args, **kwargs)
8649
8650 def GetExtraStyle(*args, **kwargs):
8651 """
8652 GetExtraStyle(self) -> long
8653
8654 Returns the extra style bits for the window.
8655 """
8656 return _core_.Window_GetExtraStyle(*args, **kwargs)
8657
8658 def MakeModal(*args, **kwargs):
8659 """
8660 MakeModal(self, bool modal=True)
8661
8662 Disables all other windows in the application so that the user can
8663 only interact with this window. Passing False will reverse this
8664 effect.
8665 """
8666 return _core_.Window_MakeModal(*args, **kwargs)
8667
8668 def SetThemeEnabled(*args, **kwargs):
8669 """
8670 SetThemeEnabled(self, bool enableTheme)
8671
8672 This function tells a window if it should use the system's "theme"
8673 code to draw the windows' background instead if its own background
8674 drawing code. This will only have an effect on platforms that support
8675 the notion of themes in user defined windows. One such platform is
8676 GTK+ where windows can have (very colourful) backgrounds defined by a
8677 user's selected theme.
8678
8679 Dialogs, notebook pages and the status bar have this flag set to true
8680 by default so that the default look and feel is simulated best.
8681 """
8682 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8683
8684 def GetThemeEnabled(*args, **kwargs):
8685 """
8686 GetThemeEnabled(self) -> bool
8687
8688 Return the themeEnabled flag.
8689 """
8690 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8691
8692 def SetFocus(*args, **kwargs):
8693 """
8694 SetFocus(self)
8695
8696 Set's the focus to this window, allowing it to receive keyboard input.
8697 """
8698 return _core_.Window_SetFocus(*args, **kwargs)
8699
8700 def SetFocusFromKbd(*args, **kwargs):
8701 """
8702 SetFocusFromKbd(self)
8703
8704 Set focus to this window as the result of a keyboard action. Normally
8705 only called internally.
8706 """
8707 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8708
8709 def FindFocus(*args, **kwargs):
8710 """
c24da6d6 8711 FindFocus() -> Window
d55e5bfc
RD
8712
8713 Returns the window or control that currently has the keyboard focus,
8714 or None.
8715 """
8716 return _core_.Window_FindFocus(*args, **kwargs)
8717
8718 FindFocus = staticmethod(FindFocus)
8719 def AcceptsFocus(*args, **kwargs):
8720 """
8721 AcceptsFocus(self) -> bool
8722
8723 Can this window have focus?
8724 """
8725 return _core_.Window_AcceptsFocus(*args, **kwargs)
8726
8727 def AcceptsFocusFromKeyboard(*args, **kwargs):
8728 """
8729 AcceptsFocusFromKeyboard(self) -> bool
8730
8731 Can this window be given focus by keyboard navigation? if not, the
8732 only way to give it focus (provided it accepts it at all) is to click
8733 it.
8734 """
8735 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8736
8737 def GetDefaultItem(*args, **kwargs):
8738 """
8739 GetDefaultItem(self) -> Window
8740
8741 Get the default child of this parent, i.e. the one which is activated
8742 by pressing <Enter> such as the OK button on a wx.Dialog.
8743 """
8744 return _core_.Window_GetDefaultItem(*args, **kwargs)
8745
8746 def SetDefaultItem(*args, **kwargs):
8747 """
8748 SetDefaultItem(self, Window child) -> Window
8749
8750 Set this child as default, return the old default.
8751 """
8752 return _core_.Window_SetDefaultItem(*args, **kwargs)
8753
8754 def SetTmpDefaultItem(*args, **kwargs):
8755 """
8756 SetTmpDefaultItem(self, Window win)
8757
8758 Set this child as temporary default
8759 """
8760 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
8761
908b74cd
RD
8762 def Navigate(*args, **kwargs):
8763 """
8764 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8765
a8eff060
RD
8766 Does keyboard navigation from this window to another, by sending a
8767 `wx.NavigationKeyEvent`.
908b74cd
RD
8768 """
8769 return _core_.Window_Navigate(*args, **kwargs)
8770
bf26d883
RD
8771 def MoveAfterInTabOrder(*args, **kwargs):
8772 """
8773 MoveAfterInTabOrder(self, Window win)
8774
8775 Moves this window in the tab navigation order after the specified
8776 sibling window. This means that when the user presses the TAB key on
8777 that other window, the focus switches to this window.
8778
8779 The default tab order is the same as creation order. This function
8780 and `MoveBeforeInTabOrder` allow to change it after creating all the
8781 windows.
8782
8783 """
8784 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8785
8786 def MoveBeforeInTabOrder(*args, **kwargs):
8787 """
8788 MoveBeforeInTabOrder(self, Window win)
8789
8790 Same as `MoveAfterInTabOrder` except that it inserts this window just
8791 before win instead of putting it right after it.
8792 """
8793 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8794
d55e5bfc
RD
8795 def GetChildren(*args, **kwargs):
8796 """
8797 GetChildren(self) -> PyObject
8798
8799 Returns a list of the window's children. NOTE: Currently this is a
8800 copy of the child window list maintained by the window, so the return
8801 value of this function is only valid as long as the window's children
8802 do not change.
8803 """
8804 return _core_.Window_GetChildren(*args, **kwargs)
8805
8806 def GetParent(*args, **kwargs):
8807 """
8808 GetParent(self) -> Window
8809
8810 Returns the parent window of this window, or None if there isn't one.
8811 """
8812 return _core_.Window_GetParent(*args, **kwargs)
8813
8814 def GetGrandParent(*args, **kwargs):
8815 """
8816 GetGrandParent(self) -> Window
8817
79fccf9d
RD
8818 Returns the parent of the parent of this window, or None if there
8819 isn't one.
d55e5bfc
RD
8820 """
8821 return _core_.Window_GetGrandParent(*args, **kwargs)
8822
8823 def IsTopLevel(*args, **kwargs):
8824 """
8825 IsTopLevel(self) -> bool
8826
8827 Returns true if the given window is a top-level one. Currently all
8828 frames and dialogs are always considered to be top-level windows (even
8829 if they have a parent window).
8830 """
8831 return _core_.Window_IsTopLevel(*args, **kwargs)
8832
8833 def Reparent(*args, **kwargs):
8834 """
8835 Reparent(self, Window newParent) -> bool
8836
8837 Reparents the window, i.e the window will be removed from its current
8838 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8839 re-inserted into another. Available on Windows and GTK. Returns True
8840 if the parent was changed, False otherwise (error or newParent ==
8841 oldParent)
8842 """
8843 return _core_.Window_Reparent(*args, **kwargs)
8844
8845 def AddChild(*args, **kwargs):
8846 """
8847 AddChild(self, Window child)
8848
8849 Adds a child window. This is called automatically by window creation
8850 functions so should not be required by the application programmer.
8851 """
8852 return _core_.Window_AddChild(*args, **kwargs)
8853
8854 def RemoveChild(*args, **kwargs):
8855 """
8856 RemoveChild(self, Window child)
8857
8858 Removes a child window. This is called automatically by window
8859 deletion functions so should not be required by the application
8860 programmer.
8861 """
8862 return _core_.Window_RemoveChild(*args, **kwargs)
8863
8864 def FindWindowById(*args, **kwargs):
8865 """
8866 FindWindowById(self, long winid) -> Window
8867
8868 Find a chld of this window by window ID
8869 """
8870 return _core_.Window_FindWindowById(*args, **kwargs)
8871
8872 def FindWindowByName(*args, **kwargs):
8873 """
8874 FindWindowByName(self, String name) -> Window
8875
8876 Find a child of this window by name
8877 """
8878 return _core_.Window_FindWindowByName(*args, **kwargs)
8879
8880 def GetEventHandler(*args, **kwargs):
8881 """
8882 GetEventHandler(self) -> EvtHandler
8883
8884 Returns the event handler for this window. By default, the window is
8885 its own event handler.
8886 """
8887 return _core_.Window_GetEventHandler(*args, **kwargs)
8888
8889 def SetEventHandler(*args, **kwargs):
8890 """
8891 SetEventHandler(self, EvtHandler handler)
8892
8893 Sets the event handler for this window. An event handler is an object
8894 that is capable of processing the events sent to a window. By default,
8895 the window is its own event handler, but an application may wish to
8896 substitute another, for example to allow central implementation of
8897 event-handling for a variety of different window classes.
8898
79fccf9d 8899 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
8900 up a chain of event handlers, where an event not handled by one event
8901 handler is handed to the next one in the chain.
8902 """
8903 return _core_.Window_SetEventHandler(*args, **kwargs)
8904
8905 def PushEventHandler(*args, **kwargs):
8906 """
8907 PushEventHandler(self, EvtHandler handler)
8908
8909 Pushes this event handler onto the event handler stack for the window.
8910 An event handler is an object that is capable of processing the events
8911 sent to a window. By default, the window is its own event handler, but
8912 an application may wish to substitute another, for example to allow
8913 central implementation of event-handling for a variety of different
8914 window classes.
8915
8916 wx.Window.PushEventHandler allows an application to set up a chain of
8917 event handlers, where an event not handled by one event handler is
79fccf9d 8918 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
8919 remove the event handler.
8920 """
8921 return _core_.Window_PushEventHandler(*args, **kwargs)
8922
8923 def PopEventHandler(*args, **kwargs):
8924 """
8925 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8926
8927 Removes and returns the top-most event handler on the event handler
8928 stack. If deleteHandler is True then the wx.EvtHandler object will be
8929 destroyed after it is popped.
8930 """
8931 return _core_.Window_PopEventHandler(*args, **kwargs)
8932
8933 def RemoveEventHandler(*args, **kwargs):
8934 """
8935 RemoveEventHandler(self, EvtHandler handler) -> bool
8936
79fccf9d
RD
8937 Find the given handler in the event handler chain and remove (but not
8938 delete) it from the event handler chain, return True if it was found
8939 and False otherwise (this also results in an assert failure so this
8940 function should only be called when the handler is supposed to be
8941 there.)
d55e5bfc
RD
8942 """
8943 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8944
8945 def SetValidator(*args, **kwargs):
8946 """
8947 SetValidator(self, Validator validator)
8948
8949 Deletes the current validator (if any) and sets the window validator,
8950 having called wx.Validator.Clone to create a new validator of this
8951 type.
8952 """
8953 return _core_.Window_SetValidator(*args, **kwargs)
8954
8955 def GetValidator(*args, **kwargs):
8956 """
8957 GetValidator(self) -> Validator
8958
8959 Returns a pointer to the current validator for the window, or None if
8960 there is none.
8961 """
8962 return _core_.Window_GetValidator(*args, **kwargs)
8963
8964 def Validate(*args, **kwargs):
8965 """
8966 Validate(self) -> bool
8967
8968 Validates the current values of the child controls using their
79fccf9d
RD
8969 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8970 style flag set, the method will also call Validate() of all child
8971 windows. Returns false if any of the validations failed.
d55e5bfc
RD
8972 """
8973 return _core_.Window_Validate(*args, **kwargs)
8974
8975 def TransferDataToWindow(*args, **kwargs):
8976 """
8977 TransferDataToWindow(self) -> bool
8978
79fccf9d
RD
8979 Transfers values to child controls from data areas specified by their
8980 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8981 style flag set, the method will also call TransferDataToWindow() of
8982 all child windows.
d55e5bfc
RD
8983 """
8984 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8985
8986 def TransferDataFromWindow(*args, **kwargs):
8987 """
8988 TransferDataFromWindow(self) -> bool
8989
79fccf9d
RD
8990 Transfers values from child controls to data areas specified by their
8991 validators. Returns false if a transfer failed. If the window has
8992 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8993 also call TransferDataFromWindow() of all child windows.
d55e5bfc
RD
8994 """
8995 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8996
8997 def InitDialog(*args, **kwargs):
8998 """
8999 InitDialog(self)
9000
79fccf9d
RD
9001 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9002 to the dialog via validators.
d55e5bfc
RD
9003 """
9004 return _core_.Window_InitDialog(*args, **kwargs)
9005
9006 def SetAcceleratorTable(*args, **kwargs):
9007 """
9008 SetAcceleratorTable(self, AcceleratorTable accel)
9009
9010 Sets the accelerator table for this window.
9011 """
9012 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
9013
9014 def GetAcceleratorTable(*args, **kwargs):
9015 """
9016 GetAcceleratorTable(self) -> AcceleratorTable
9017
9018 Gets the accelerator table for this window.
9019 """
9020 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
9021
9022 def RegisterHotKey(*args, **kwargs):
9023 """
9024 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9025
9026 Registers a system wide hotkey. Every time the user presses the hotkey
9027 registered here, this window will receive a hotkey event. It will
9028 receive the event even if the application is in the background and
9029 does not have the input focus because the user is working with some
9030 other application. To bind an event handler function to this hotkey
9031 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9032 hotkey was registered successfully.
9033 """
9034 return _core_.Window_RegisterHotKey(*args, **kwargs)
9035
9036 def UnregisterHotKey(*args, **kwargs):
9037 """
9038 UnregisterHotKey(self, int hotkeyId) -> bool
9039
9040 Unregisters a system wide hotkey.
9041 """
9042 return _core_.Window_UnregisterHotKey(*args, **kwargs)
9043
9044 def ConvertDialogPointToPixels(*args, **kwargs):
9045 """
9046 ConvertDialogPointToPixels(self, Point pt) -> Point
9047
9048 Converts a point or size from dialog units to pixels. Dialog units
9049 are used for maintaining a dialog's proportions even if the font
9050 changes. For the x dimension, the dialog units are multiplied by the
9051 average character width and then divided by 4. For the y dimension,
9052 the dialog units are multiplied by the average character height and
9053 then divided by 8.
9054 """
9055 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
9056
9057 def ConvertDialogSizeToPixels(*args, **kwargs):
9058 """
9059 ConvertDialogSizeToPixels(self, Size sz) -> Size
9060
9061 Converts a point or size from dialog units to pixels. Dialog units
9062 are used for maintaining a dialog's proportions even if the font
9063 changes. For the x dimension, the dialog units are multiplied by the
9064 average character width and then divided by 4. For the y dimension,
9065 the dialog units are multiplied by the average character height and
9066 then divided by 8.
9067 """
9068 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
9069
9070 def DLG_PNT(*args, **kwargs):
9071 """
9072 DLG_PNT(self, Point pt) -> Point
9073
9074 Converts a point or size from dialog units to pixels. Dialog units
9075 are used for maintaining a dialog's proportions even if the font
9076 changes. For the x dimension, the dialog units are multiplied by the
9077 average character width and then divided by 4. For the y dimension,
9078 the dialog units are multiplied by the average character height and
9079 then divided by 8.
9080 """
9081 return _core_.Window_DLG_PNT(*args, **kwargs)
9082
9083 def DLG_SZE(*args, **kwargs):
9084 """
9085 DLG_SZE(self, Size sz) -> Size
9086
9087 Converts a point or size from dialog units to pixels. Dialog units
9088 are used for maintaining a dialog's proportions even if the font
9089 changes. For the x dimension, the dialog units are multiplied by the
9090 average character width and then divided by 4. For the y dimension,
9091 the dialog units are multiplied by the average character height and
9092 then divided by 8.
9093 """
9094 return _core_.Window_DLG_SZE(*args, **kwargs)
9095
9096 def ConvertPixelPointToDialog(*args, **kwargs):
9097 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9098 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
9099
9100 def ConvertPixelSizeToDialog(*args, **kwargs):
9101 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9102 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
9103
9104 def WarpPointer(*args, **kwargs):
9105 """
9106 WarpPointer(self, int x, int y)
9107
9108 Moves the pointer to the given position on the window.
9109
9110 NOTE: This function is not supported under Mac because Apple Human
9111 Interface Guidelines forbid moving the mouse cursor programmatically.
9112 """
9113 return _core_.Window_WarpPointer(*args, **kwargs)
9114
9115 def CaptureMouse(*args, **kwargs):
9116 """
9117 CaptureMouse(self)
9118
9119 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9120 release the capture.
9121
9122 Note that wxWindows maintains the stack of windows having captured the
9123 mouse and when the mouse is released the capture returns to the window
9124 which had had captured it previously and it is only really released if
9125 there were no previous window. In particular, this means that you must
9126 release the mouse as many times as you capture it.
9127 """
9128 return _core_.Window_CaptureMouse(*args, **kwargs)
9129
9130 def ReleaseMouse(*args, **kwargs):
9131 """
9132 ReleaseMouse(self)
9133
9134 Releases mouse input captured with wx.Window.CaptureMouse.
9135 """
9136 return _core_.Window_ReleaseMouse(*args, **kwargs)
9137
9138 def GetCapture(*args, **kwargs):
9139 """
c24da6d6 9140 GetCapture() -> Window
d55e5bfc
RD
9141
9142 Returns the window which currently captures the mouse or None
9143 """
9144 return _core_.Window_GetCapture(*args, **kwargs)
9145
9146 GetCapture = staticmethod(GetCapture)
9147 def HasCapture(*args, **kwargs):
9148 """
9149 HasCapture(self) -> bool
9150
9151 Returns true if this window has the current mouse capture.
9152 """
9153 return _core_.Window_HasCapture(*args, **kwargs)
9154
9155 def Refresh(*args, **kwargs):
9156 """
9157 Refresh(self, bool eraseBackground=True, Rect rect=None)
9158
9159 Mark the specified rectangle (or the whole window) as "dirty" so it
9160 will be repainted. Causes an EVT_PAINT event to be generated and sent
9161 to the window.
9162 """
9163 return _core_.Window_Refresh(*args, **kwargs)
9164
9165 def RefreshRect(*args, **kwargs):
9166 """
fef4c27a 9167 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
9168
9169 Redraws the contents of the given rectangle: the area inside it will
9170 be repainted. This is the same as Refresh but has a nicer syntax.
9171 """
9172 return _core_.Window_RefreshRect(*args, **kwargs)
9173
9174 def Update(*args, **kwargs):
9175 """
9176 Update(self)
9177
9178 Calling this method immediately repaints the invalidated area of the
9179 window instead of waiting for the EVT_PAINT event to happen, (normally
9180 this would usually only happen when the flow of control returns to the
9181 event loop.) Notice that this function doesn't refresh the window and
9182 does nothing if the window has been already repainted. Use Refresh
9183 first if you want to immediately redraw the window (or some portion of
9184 it) unconditionally.
9185 """
9186 return _core_.Window_Update(*args, **kwargs)
9187
9188 def ClearBackground(*args, **kwargs):
9189 """
9190 ClearBackground(self)
9191
9192 Clears the window by filling it with the current background
9193 colour. Does not cause an erase background event to be generated.
9194 """
9195 return _core_.Window_ClearBackground(*args, **kwargs)
9196
9197 def Freeze(*args, **kwargs):
9198 """
9199 Freeze(self)
9200
79fccf9d
RD
9201 Freezes the window or, in other words, prevents any updates from
9202 taking place on screen, the window is not redrawn at all. Thaw must be
9203 called to reenable window redrawing. Calls to Freeze/Thaw may be
9204 nested, with the actual Thaw being delayed until all the nesting has
9205 been undone.
d55e5bfc
RD
9206
9207 This method is useful for visual appearance optimization (for example,
9208 it is a good idea to use it before inserting large amount of text into
9209 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9210 for all controls so it is mostly just a hint to wxWindows and not a
9211 mandatory directive.
9212 """
9213 return _core_.Window_Freeze(*args, **kwargs)
9214
9215 def Thaw(*args, **kwargs):
9216 """
9217 Thaw(self)
9218
9219 Reenables window updating after a previous call to Freeze. Calls to
79fccf9d
RD
9220 Freeze/Thaw may be nested, so Thaw must be called the same number of
9221 times that Freeze was before the window will be updated.
d55e5bfc
RD
9222 """
9223 return _core_.Window_Thaw(*args, **kwargs)
9224
9225 def PrepareDC(*args, **kwargs):
9226 """
9227 PrepareDC(self, DC dc)
9228
9229 Call this function to prepare the device context for drawing a
9230 scrolled image. It sets the device origin according to the current
9231 scroll position.
9232 """
9233 return _core_.Window_PrepareDC(*args, **kwargs)
9234
9235 def GetUpdateRegion(*args, **kwargs):
9236 """
9237 GetUpdateRegion(self) -> Region
9238
9239 Returns the region specifying which parts of the window have been
9240 damaged. Should only be called within an EVT_PAINT handler.
9241 """
9242 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9243
9244 def GetUpdateClientRect(*args, **kwargs):
9245 """
9246 GetUpdateClientRect(self) -> Rect
9247
9248 Get the update rectangle region bounding box in client coords.
9249 """
9250 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9251
9252 def IsExposed(*args, **kwargs):
9253 """
9254 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9255
9256 Returns true if the given point or rectangle area has been exposed
9257 since the last repaint. Call this in an paint event handler to
9258 optimize redrawing by only redrawing those areas, which have been
9259 exposed.
9260 """
9261 return _core_.Window_IsExposed(*args, **kwargs)
9262
9263 def IsExposedPoint(*args, **kwargs):
9264 """
9265 IsExposedPoint(self, Point pt) -> bool
9266
9267 Returns true if the given point or rectangle area has been exposed
9268 since the last repaint. Call this in an paint event handler to
9269 optimize redrawing by only redrawing those areas, which have been
9270 exposed.
9271 """
9272 return _core_.Window_IsExposedPoint(*args, **kwargs)
9273
9274 def IsExposedRect(*args, **kwargs):
9275 """
9276 IsExposedRect(self, Rect rect) -> bool
9277
9278 Returns true if the given point or rectangle area has been exposed
9279 since the last repaint. Call this in an paint event handler to
9280 optimize redrawing by only redrawing those areas, which have been
9281 exposed.
9282 """
9283 return _core_.Window_IsExposedRect(*args, **kwargs)
9284
9285 def GetDefaultAttributes(*args, **kwargs):
9286 """
9287 GetDefaultAttributes(self) -> VisualAttributes
9288
79fccf9d
RD
9289 Get the default attributes for an instance of this class. This is
9290 useful if you want to use the same font or colour in your own control
9291 as in a standard control -- which is a much better idea than hard
9292 coding specific colours or fonts which might look completely out of
caef1a4d 9293 place on the user's system, especially if it uses themes.
d55e5bfc
RD
9294 """
9295 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9296
9297 def GetClassDefaultAttributes(*args, **kwargs):
9298 """
c24da6d6 9299 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9300
79fccf9d
RD
9301 Get the default attributes for this class. This is useful if you want
9302 to use the same font or colour in your own control as in a standard
9303 control -- which is a much better idea than hard coding specific
caef1a4d
RD
9304 colours or fonts which might look completely out of place on the
9305 user's system, especially if it uses themes.
d55e5bfc
RD
9306
9307 The variant parameter is only relevant under Mac currently and is
79fccf9d 9308 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
9309 the returned font. See `wx.Window.SetWindowVariant` for more about
9310 this.
d55e5bfc
RD
9311 """
9312 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9313
9314 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9315 def SetBackgroundColour(*args, **kwargs):
9316 """
9317 SetBackgroundColour(self, Colour colour) -> bool
9318
9319 Sets the background colour of the window. Returns True if the colour
9320 was changed. The background colour is usually painted by the default
9321 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9322 automatically under GTK. Using `wx.NullColour` will reset the window
9323 to the default background colour.
d55e5bfc 9324
caef1a4d 9325 Note that setting the background colour may not cause an immediate
f8167d6e 9326 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
9327 calling this function.
9328
f8167d6e
RD
9329 Using this function will disable attempts to use themes for this
9330 window, if the system supports them. Use with care since usually the
9331 themes represent the appearance chosen by the user to be used for all
9332 applications on the system.
d55e5bfc
RD
9333 """
9334 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9335
412d302d
RD
9336 def SetOwnBackgroundColour(*args, **kwargs):
9337 """SetOwnBackgroundColour(self, Colour colour)"""
9338 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9339
9340 def SetForegroundColour(*args, **kwargs):
9341 """
9342 SetForegroundColour(self, Colour colour) -> bool
9343
9344 Sets the foreground colour of the window. Returns True is the colour
9345 was changed. The interpretation of foreground colour is dependent on
9346 the window class; it may be the text colour or other colour, or it may
9347 not be used at all.
9348 """
9349 return _core_.Window_SetForegroundColour(*args, **kwargs)
9350
fa47d7a7
VS
9351 def SetOwnForegroundColour(*args, **kwargs):
9352 """SetOwnForegroundColour(self, Colour colour)"""
9353 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9354
9355 def GetBackgroundColour(*args, **kwargs):
9356 """
9357 GetBackgroundColour(self) -> Colour
9358
9359 Returns the background colour of the window.
9360 """
9361 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9362
9363 def GetForegroundColour(*args, **kwargs):
9364 """
9365 GetForegroundColour(self) -> Colour
9366
9367 Returns the foreground colour of the window. The interpretation of
9368 foreground colour is dependent on the window class; it may be the text
9369 colour or other colour, or it may not be used at all.
9370 """
9371 return _core_.Window_GetForegroundColour(*args, **kwargs)
9372
dcb8fc74
RD
9373 def InheritsBackgroundColour(*args, **kwargs):
9374 """InheritsBackgroundColour(self) -> bool"""
9375 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9376
9377 def UseBgCol(*args, **kwargs):
9378 """UseBgCol(self) -> bool"""
9379 return _core_.Window_UseBgCol(*args, **kwargs)
9380
0f63ec68
RD
9381 def SetBackgroundStyle(*args, **kwargs):
9382 """
9383 SetBackgroundStyle(self, int style) -> bool
9384
9385 Returns the background style of the window. The background style
9386 indicates how the background of the window is drawn.
9387
9388 ====================== ========================================
9389 wx.BG_STYLE_SYSTEM The background colour or pattern should
9390 be determined by the system
9391 wx.BG_STYLE_COLOUR The background should be a solid colour
9392 wx.BG_STYLE_CUSTOM The background will be implemented by the
9393 application.
9394 ====================== ========================================
9395
9396 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9397 a custom background, such as a tiled bitmap. Currently the style has
9398 no effect on other platforms.
9399
9400 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9401 """
9402 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9403
9404 def GetBackgroundStyle(*args, **kwargs):
9405 """
9406 GetBackgroundStyle(self) -> int
9407
9408 Returns the background style of the window.
9409
9410 :see: `SetBackgroundStyle`
9411 """
9412 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9413
51b83b37
RD
9414 def HasTransparentBackground(*args, **kwargs):
9415 """
9416 HasTransparentBackground(self) -> bool
9417
9418 Returns True if this window's background is transparent (as, for
9419 example, for `wx.StaticText`) and should show the parent window's
9420 background.
9421
9422 This method is mostly used internally by the library itself and you
9423 normally shouldn't have to call it. You may, however, have to override
9424 it in your custom control classes to ensure that background is painted
9425 correctly.
9426 """
9427 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9428
d55e5bfc
RD
9429 def SetCursor(*args, **kwargs):
9430 """
9431 SetCursor(self, Cursor cursor) -> bool
9432
9433 Sets the window's cursor. Notice that the window cursor also sets it
9434 for the children of the window implicitly.
9435
9436 The cursor may be wx.NullCursor in which case the window cursor will
9437 be reset back to default.
9438 """
9439 return _core_.Window_SetCursor(*args, **kwargs)
9440
9441 def GetCursor(*args, **kwargs):
9442 """
9443 GetCursor(self) -> Cursor
9444
9445 Return the cursor associated with this window.
9446 """
9447 return _core_.Window_GetCursor(*args, **kwargs)
9448
9449 def SetFont(*args, **kwargs):
9450 """
9451 SetFont(self, Font font) -> bool
9452
9453 Sets the font for this window.
9454 """
9455 return _core_.Window_SetFont(*args, **kwargs)
9456
fa47d7a7
VS
9457 def SetOwnFont(*args, **kwargs):
9458 """SetOwnFont(self, Font font)"""
9459 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9460
9461 def GetFont(*args, **kwargs):
9462 """
9463 GetFont(self) -> Font
9464
9465 Returns the default font used for this window.
9466 """
9467 return _core_.Window_GetFont(*args, **kwargs)
9468
9469 def SetCaret(*args, **kwargs):
9470 """
9471 SetCaret(self, Caret caret)
9472
9473 Sets the caret associated with the window.
9474 """
9475 return _core_.Window_SetCaret(*args, **kwargs)
9476
9477 def GetCaret(*args, **kwargs):
9478 """
9479 GetCaret(self) -> Caret
9480
9481 Returns the caret associated with the window.
9482 """
9483 return _core_.Window_GetCaret(*args, **kwargs)
9484
9485 def GetCharHeight(*args, **kwargs):
9486 """
9487 GetCharHeight(self) -> int
9488
9489 Get the (average) character size for the current font.
9490 """
9491 return _core_.Window_GetCharHeight(*args, **kwargs)
9492
9493 def GetCharWidth(*args, **kwargs):
9494 """
9495 GetCharWidth(self) -> int
9496
9497 Get the (average) character size for the current font.
9498 """
9499 return _core_.Window_GetCharWidth(*args, **kwargs)
9500
9501 def GetTextExtent(*args, **kwargs):
a8eff060
RD
9502 """
9503 GetTextExtent(String string) -> (width, height)
9504
9505 Get the width and height of the text using the current font.
9506 """
d55e5bfc
RD
9507 return _core_.Window_GetTextExtent(*args, **kwargs)
9508
9509 def GetFullTextExtent(*args, **kwargs):
9510 """
9511 GetFullTextExtent(String string, Font font=None) ->
9512 (width, height, descent, externalLeading)
9513
9514 Get the width, height, decent and leading of the text using the
9515 current or specified font.
9516 """
9517 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9518
9519 def ClientToScreenXY(*args, **kwargs):
9520 """
9521 ClientToScreenXY(int x, int y) -> (x,y)
9522
9523 Converts to screen coordinates from coordinates relative to this window.
9524 """
9525 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9526
9527 def ScreenToClientXY(*args, **kwargs):
9528 """
9529 ScreenToClientXY(int x, int y) -> (x,y)
9530
9531 Converts from screen to client window coordinates.
9532 """
9533 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9534
9535 def ClientToScreen(*args, **kwargs):
9536 """
9537 ClientToScreen(self, Point pt) -> Point
9538
9539 Converts to screen coordinates from coordinates relative to this window.
9540 """
9541 return _core_.Window_ClientToScreen(*args, **kwargs)
9542
9543 def ScreenToClient(*args, **kwargs):
9544 """
9545 ScreenToClient(self, Point pt) -> Point
9546
9547 Converts from screen to client window coordinates.
9548 """
9549 return _core_.Window_ScreenToClient(*args, **kwargs)
9550
9551 def HitTestXY(*args, **kwargs):
9552 """
9553 HitTestXY(self, int x, int y) -> int
9554
9555 Test where the given (in client coords) point lies
9556 """
9557 return _core_.Window_HitTestXY(*args, **kwargs)
9558
9559 def HitTest(*args, **kwargs):
9560 """
9561 HitTest(self, Point pt) -> int
9562
9563 Test where the given (in client coords) point lies
9564 """
9565 return _core_.Window_HitTest(*args, **kwargs)
9566
9567 def GetBorder(*args):
9568 """
9569 GetBorder(self, long flags) -> int
9570 GetBorder(self) -> int
9571
9572 Get border for the flags of this window
9573 """
9574 return _core_.Window_GetBorder(*args)
9575
9576 def UpdateWindowUI(*args, **kwargs):
9577 """
9578 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9579
9580 This function sends EVT_UPDATE_UI events to the window. The particular
9581 implementation depends on the window; for example a wx.ToolBar will
9582 send an update UI event for each toolbar button, and a wx.Frame will
9583 send an update UI event for each menubar menu item. You can call this
9584 function from your application to ensure that your UI is up-to-date at
9585 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9586 concerned). This may be necessary if you have called
5ba5649b 9587 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9588 limit the overhead that wxWindows incurs by sending update UI events
9589 in idle time.
d55e5bfc
RD
9590 """
9591 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9592
9593 def PopupMenuXY(*args, **kwargs):
9594 """
7a0b95b0 9595 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9596
7a0b95b0
RD
9597 Pops up the given menu at the specified coordinates, relative to this window,
9598 and returns control when the user has dismissed the menu. If a menu item is
9599 selected, the corresponding menu event is generated and will be processed as
9600 usual. If the default position is given then the current position of the
9601 mouse cursor will be used.
d55e5bfc
RD
9602 """
9603 return _core_.Window_PopupMenuXY(*args, **kwargs)
9604
9605 def PopupMenu(*args, **kwargs):
9606 """
7a0b95b0 9607 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9608
7a0b95b0
RD
9609 Pops up the given menu at the specified coordinates, relative to this window,
9610 and returns control when the user has dismissed the menu. If a menu item is
9611 selected, the corresponding menu event is generated and will be processed as
9612 usual. If the default position is given then the current position of the
9613 mouse cursor will be used.
d55e5bfc
RD
9614 """
9615 return _core_.Window_PopupMenu(*args, **kwargs)
9616
9617 def GetHandle(*args, **kwargs):
9618 """
9619 GetHandle(self) -> long
9620
9621 Returns the platform-specific handle (as a long integer) of the
9622 physical window. Currently on wxMac it returns the handle of the
9623 toplevel parent of the window.
9624 """
9625 return _core_.Window_GetHandle(*args, **kwargs)
9626
629e65c2
RD
9627 def AssociateHandle(*args, **kwargs):
9628 """
9629 AssociateHandle(self, long handle)
9630
9631 Associate the window with a new native handle
9632 """
9633 return _core_.Window_AssociateHandle(*args, **kwargs)
9634
9635 def DissociateHandle(*args, **kwargs):
9636 """
9637 DissociateHandle(self)
9638
9639 Dissociate the current native handle from the window
9640 """
9641 return _core_.Window_DissociateHandle(*args, **kwargs)
9642
d55e5bfc
RD
9643 def OnPaint(*args, **kwargs):
9644 """OnPaint(self, PaintEvent event)"""
9645 return _core_.Window_OnPaint(*args, **kwargs)
9646
9647 def HasScrollbar(*args, **kwargs):
9648 """
9649 HasScrollbar(self, int orient) -> bool
9650
9651 Does the window have the scrollbar for this orientation?
9652 """
9653 return _core_.Window_HasScrollbar(*args, **kwargs)
9654
9655 def SetScrollbar(*args, **kwargs):
9656 """
79fccf9d 9657 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9658 bool refresh=True)
9659
9660 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc
RD
9661 """
9662 return _core_.Window_SetScrollbar(*args, **kwargs)
9663
9664 def SetScrollPos(*args, **kwargs):
9665 """
9666 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9667
9668 Sets the position of one of the built-in scrollbars.
9669 """
9670 return _core_.Window_SetScrollPos(*args, **kwargs)
9671
9672 def GetScrollPos(*args, **kwargs):
9673 """
9674 GetScrollPos(self, int orientation) -> int
9675
9676 Returns the built-in scrollbar position.
9677 """
9678 return _core_.Window_GetScrollPos(*args, **kwargs)
9679
9680 def GetScrollThumb(*args, **kwargs):
9681 """
9682 GetScrollThumb(self, int orientation) -> int
9683
9684 Returns the built-in scrollbar thumb size.
9685 """
9686 return _core_.Window_GetScrollThumb(*args, **kwargs)
9687
9688 def GetScrollRange(*args, **kwargs):
9689 """
9690 GetScrollRange(self, int orientation) -> int
9691
9692 Returns the built-in scrollbar range.
9693 """
9694 return _core_.Window_GetScrollRange(*args, **kwargs)
9695
9696 def ScrollWindow(*args, **kwargs):
9697 """
9698 ScrollWindow(self, int dx, int dy, Rect rect=None)
9699
9700 Physically scrolls the pixels in the window and move child windows
9701 accordingly. Use this function to optimise your scrolling
9702 implementations, to minimise the area that must be redrawn. Note that
9703 it is rarely required to call this function from a user program.
d55e5bfc
RD
9704 """
9705 return _core_.Window_ScrollWindow(*args, **kwargs)
9706
9707 def ScrollLines(*args, **kwargs):
9708 """
9709 ScrollLines(self, int lines) -> bool
9710
9711 If the platform and window class supports it, scrolls the window by
9712 the given number of lines down, if lines is positive, or up if lines
9713 is negative. Returns True if the window was scrolled, False if it was
9714 already on top/bottom and nothing was done.
9715 """
9716 return _core_.Window_ScrollLines(*args, **kwargs)
9717
9718 def ScrollPages(*args, **kwargs):
9719 """
9720 ScrollPages(self, int pages) -> bool
9721
79fccf9d 9722 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9723 the given number of pages down, if pages is positive, or up if pages
9724 is negative. Returns True if the window was scrolled, False if it was
9725 already on top/bottom and nothing was done.
9726 """
9727 return _core_.Window_ScrollPages(*args, **kwargs)
9728
9729 def LineUp(*args, **kwargs):
9730 """
9731 LineUp(self) -> bool
9732
9733 This is just a wrapper for ScrollLines(-1).
9734 """
9735 return _core_.Window_LineUp(*args, **kwargs)
9736
9737 def LineDown(*args, **kwargs):
9738 """
9739 LineDown(self) -> bool
9740
9741 This is just a wrapper for ScrollLines(1).
9742 """
9743 return _core_.Window_LineDown(*args, **kwargs)
9744
9745 def PageUp(*args, **kwargs):
9746 """
9747 PageUp(self) -> bool
9748
9749 This is just a wrapper for ScrollPages(-1).
9750 """
9751 return _core_.Window_PageUp(*args, **kwargs)
9752
9753 def PageDown(*args, **kwargs):
9754 """
9755 PageDown(self) -> bool
9756
9757 This is just a wrapper for ScrollPages(1).
9758 """
9759 return _core_.Window_PageDown(*args, **kwargs)
9760
9761 def SetHelpText(*args, **kwargs):
9762 """
9763 SetHelpText(self, String text)
9764
9765 Sets the help text to be used as context-sensitive help for this
9766 window. Note that the text is actually stored by the current
9767 wxHelpProvider implementation, and not in the window object itself.
9768 """
9769 return _core_.Window_SetHelpText(*args, **kwargs)
9770
9771 def SetHelpTextForId(*args, **kwargs):
9772 """
9773 SetHelpTextForId(self, String text)
9774
9775 Associate this help text with all windows with the same id as this
9776 one.
9777 """
9778 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9779
9780 def GetHelpText(*args, **kwargs):
9781 """
9782 GetHelpText(self) -> String
9783
9784 Gets the help text to be used as context-sensitive help for this
9785 window. Note that the text is actually stored by the current
9786 wxHelpProvider implementation, and not in the window object itself.
9787 """
9788 return _core_.Window_GetHelpText(*args, **kwargs)
9789
9790 def SetToolTipString(*args, **kwargs):
9791 """
9792 SetToolTipString(self, String tip)
9793
9794 Attach a tooltip to the window.
9795 """
9796 return _core_.Window_SetToolTipString(*args, **kwargs)
9797
9798 def SetToolTip(*args, **kwargs):
9799 """
9800 SetToolTip(self, ToolTip tip)
9801
9802 Attach a tooltip to the window.
9803 """
9804 return _core_.Window_SetToolTip(*args, **kwargs)
9805
9806 def GetToolTip(*args, **kwargs):
9807 """
9808 GetToolTip(self) -> ToolTip
9809
9810 get the associated tooltip or None if none
9811 """
9812 return _core_.Window_GetToolTip(*args, **kwargs)
9813
9814 def SetDropTarget(*args, **kwargs):
9815 """
9816 SetDropTarget(self, DropTarget dropTarget)
9817
9818 Associates a drop target with this window. If the window already has
9819 a drop target, it is deleted.
9820 """
9821 return _core_.Window_SetDropTarget(*args, **kwargs)
9822
9823 def GetDropTarget(*args, **kwargs):
9824 """
9825 GetDropTarget(self) -> DropTarget
9826
9827 Returns the associated drop target, which may be None.
9828 """
9829 return _core_.Window_GetDropTarget(*args, **kwargs)
9830
9831 def DragAcceptFiles(*args, **kwargs):
9832 """
9833 DragAcceptFiles(self, bool accept)
9834
9835 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
5ba5649b 9836 Only functional on Windows.
d55e5bfc
RD
9837 """
9838 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9839
9840 def SetConstraints(*args, **kwargs):
9841 """
9842 SetConstraints(self, LayoutConstraints constraints)
9843
9844 Sets the window to have the given layout constraints. If an existing
9845 layout constraints object is already owned by the window, it will be
9846 deleted. Pass None to disassociate and delete the window's current
9847 constraints.
9848
9849 You must call SetAutoLayout to tell a window to use the constraints
9850 automatically in its default EVT_SIZE handler; otherwise, you must
9851 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9852 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9853 effect.
9854 """
9855 return _core_.Window_SetConstraints(*args, **kwargs)
9856
9857 def GetConstraints(*args, **kwargs):
9858 """
9859 GetConstraints(self) -> LayoutConstraints
9860
9861 Returns a pointer to the window's layout constraints, or None if there
9862 are none.
9863 """
9864 return _core_.Window_GetConstraints(*args, **kwargs)
9865
9866 def SetAutoLayout(*args, **kwargs):
9867 """
9868 SetAutoLayout(self, bool autoLayout)
9869
9870 Determines whether the Layout function will be called automatically
9871 when the window is resized. It is called implicitly by SetSizer but
9872 if you use SetConstraints you should call it manually or otherwise the
9873 window layout won't be correctly updated when its size changes.
9874 """
9875 return _core_.Window_SetAutoLayout(*args, **kwargs)
9876
9877 def GetAutoLayout(*args, **kwargs):
9878 """
9879 GetAutoLayout(self) -> bool
9880
9881 Returns the current autoLayout setting
9882 """
9883 return _core_.Window_GetAutoLayout(*args, **kwargs)
9884
9885 def Layout(*args, **kwargs):
9886 """
9887 Layout(self) -> bool
9888
9889 Invokes the constraint-based layout algorithm or the sizer-based
9890 algorithm for this window. See SetAutoLayout: when auto layout is on,
9891 this function gets called automatically by the default EVT_SIZE
9892 handler when the window is resized.
9893 """
9894 return _core_.Window_Layout(*args, **kwargs)
9895
9896 def SetSizer(*args, **kwargs):
9897 """
9898 SetSizer(self, Sizer sizer, bool deleteOld=True)
9899
9900 Sets the window to have the given layout sizer. The window will then
9901 own the object, and will take care of its deletion. If an existing
9902 layout sizer object is already owned by the window, it will be deleted
9903 if the deleteOld parameter is true. Note that this function will also
9904 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 9905 non-None, and False otherwise.
d55e5bfc
RD
9906 """
9907 return _core_.Window_SetSizer(*args, **kwargs)
9908
9909 def SetSizerAndFit(*args, **kwargs):
9910 """
9911 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9912
9913 The same as SetSizer, except it also sets the size hints for the
9914 window based on the sizer's minimum size.
9915 """
9916 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9917
9918 def GetSizer(*args, **kwargs):
9919 """
9920 GetSizer(self) -> Sizer
9921
9922 Return the sizer associated with the window by a previous call to
9923 SetSizer or None if there isn't one.
9924 """
9925 return _core_.Window_GetSizer(*args, **kwargs)
9926
9927 def SetContainingSizer(*args, **kwargs):
9928 """
9929 SetContainingSizer(self, Sizer sizer)
9930
9931 This normally does not need to be called by application code. It is
9932 called internally when a window is added to a sizer, and is used so
9933 the window can remove itself from the sizer when it is destroyed.
9934 """
9935 return _core_.Window_SetContainingSizer(*args, **kwargs)
9936
9937 def GetContainingSizer(*args, **kwargs):
9938 """
9939 GetContainingSizer(self) -> Sizer
9940
9941 Return the sizer that this window is a member of, if any, otherwise None.
9942 """
9943 return _core_.Window_GetContainingSizer(*args, **kwargs)
9944
9945 def InheritAttributes(*args, **kwargs):
9946 """
9947 InheritAttributes(self)
9948
79fccf9d
RD
9949 This function is (or should be, in case of custom controls) called
9950 during window creation to intelligently set up the window visual
9951 attributes, that is the font and the foreground and background
9952 colours.
9953
9954 By 'intelligently' the following is meant: by default, all windows use
9955 their own default attributes. However if some of the parent's
9956 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9957 SetOwnFont) and if the corresponding attribute hadn't been
79fccf9d
RD
9958 explicitly set for this window itself, then this window takes the same
9959 value as used by the parent. In addition, if the window overrides
9960 ShouldInheritColours to return false, the colours will not be changed
9961 no matter what and only the font might.
9962
ec9b55ca
RD
9963 This rather complicated logic is necessary in order to accommodate the
9964 different usage scenarios. The most common one is when all default
79fccf9d
RD
9965 attributes are used and in this case, nothing should be inherited as
9966 in modern GUIs different controls use different fonts (and colours)
9967 than their siblings so they can't inherit the same value from the
9968 parent. However it was also deemed desirable to allow to simply change
9969 the attributes of all children at once by just changing the font or
9970 colour of their common parent, hence in this case we do inherit the
9971 parents attributes.
9972
d55e5bfc
RD
9973 """
9974 return _core_.Window_InheritAttributes(*args, **kwargs)
9975
9976 def ShouldInheritColours(*args, **kwargs):
9977 """
9978 ShouldInheritColours(self) -> bool
9979
9980 Return true from here to allow the colours of this window to be
79fccf9d
RD
9981 changed by InheritAttributes, returning false forbids inheriting them
9982 from the parent window.
d55e5bfc 9983
79fccf9d
RD
9984 The base class version returns false, but this method is overridden in
9985 wxControl where it returns true.
d55e5bfc
RD
9986 """
9987 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9988
9989 def PostCreate(self, pre):
9990 """
9991 Phase 3 of the 2-phase create <wink!>
9992 Call this method after precreating the window with the 2-phase create method.
9993 """
9994 self.this = pre.this
9995 self.thisown = pre.thisown
9996 pre.thisown = 0
9997 if hasattr(self, '_setOORInfo'):
9998 self._setOORInfo(self)
9999 if hasattr(self, '_setCallbackInfo'):
10000 self._setCallbackInfo(self, self.__class__)
10001
10002
10003class WindowPtr(Window):
10004 def __init__(self, this):
10005 self.this = this
10006 if not hasattr(self,"thisown"): self.thisown = 0
10007 self.__class__ = Window
10008_core_.Window_swigregister(WindowPtr)
10009
10010def PreWindow(*args, **kwargs):
10011 """
10012 PreWindow() -> Window
10013
10014 Precreate a Window for 2-phase creation.
10015 """
10016 val = _core_.new_PreWindow(*args, **kwargs)
10017 val.thisown = 1
10018 return val
10019
10020def Window_NewControlId(*args, **kwargs):
10021 """
10022 Window_NewControlId() -> int
10023
10024 Generate a control id for the controls which were not given one.
10025 """
10026 return _core_.Window_NewControlId(*args, **kwargs)
10027
10028def Window_NextControlId(*args, **kwargs):
10029 """
10030 Window_NextControlId(int winid) -> int
10031
10032 Get the id of the control following the one with the given
79fccf9d 10033 autogenerated) id
d55e5bfc
RD
10034 """
10035 return _core_.Window_NextControlId(*args, **kwargs)
10036
10037def Window_PrevControlId(*args, **kwargs):
10038 """
10039 Window_PrevControlId(int winid) -> int
10040
10041 Get the id of the control preceding the one with the given
79fccf9d 10042 autogenerated) id
d55e5bfc
RD
10043 """
10044 return _core_.Window_PrevControlId(*args, **kwargs)
10045
10046def Window_FindFocus(*args, **kwargs):
10047 """
10048 Window_FindFocus() -> Window
10049
10050 Returns the window or control that currently has the keyboard focus,
10051 or None.
10052 """
10053 return _core_.Window_FindFocus(*args, **kwargs)
10054
10055def Window_GetCapture(*args, **kwargs):
10056 """
10057 Window_GetCapture() -> Window
10058
10059 Returns the window which currently captures the mouse or None
10060 """
10061 return _core_.Window_GetCapture(*args, **kwargs)
10062
10063def Window_GetClassDefaultAttributes(*args, **kwargs):
10064 """
10065 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10066
79fccf9d
RD
10067 Get the default attributes for this class. This is useful if you want
10068 to use the same font or colour in your own control as in a standard
10069 control -- which is a much better idea than hard coding specific
caef1a4d
RD
10070 colours or fonts which might look completely out of place on the
10071 user's system, especially if it uses themes.
d55e5bfc
RD
10072
10073 The variant parameter is only relevant under Mac currently and is
79fccf9d 10074 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
10075 the returned font. See `wx.Window.SetWindowVariant` for more about
10076 this.
d55e5bfc
RD
10077 """
10078 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
10079
10080def DLG_PNT(win, point_or_x, y=None):
10081 """
10082 Convenience function for converting a Point or (x,y) in
10083 dialog units to pixel units.
10084 """
10085 if y is None:
10086 return win.ConvertDialogPointToPixels(point_or_x)
10087 else:
10088 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10089
10090def DLG_SZE(win, size_width, height=None):
10091 """
10092 Convenience function for converting a Size or (w,h) in
10093 dialog units to pixel units.
10094 """
10095 if height is None:
10096 return win.ConvertDialogSizeToPixels(size_width)
10097 else:
10098 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10099
10100
10101def FindWindowById(*args, **kwargs):
10102 """
10103 FindWindowById(long id, Window parent=None) -> Window
10104
10105 Find the first window in the application with the given id. If parent
10106 is None, the search will start from all top-level frames and dialog
10107 boxes; if non-None, the search will be limited to the given window
10108 hierarchy. The search is recursive in both cases.
10109 """
10110 return _core_.FindWindowById(*args, **kwargs)
10111
10112def FindWindowByName(*args, **kwargs):
10113 """
10114 FindWindowByName(String name, Window parent=None) -> Window
10115
10116 Find a window by its name (as given in a window constructor or Create
10117 function call). If parent is None, the search will start from all
10118 top-level frames and dialog boxes; if non-None, the search will be
10119 limited to the given window hierarchy. The search is recursive in both
10120 cases.
10121
10122 If no window with such name is found, wx.FindWindowByLabel is called.
10123 """
10124 return _core_.FindWindowByName(*args, **kwargs)
10125
10126def FindWindowByLabel(*args, **kwargs):
10127 """
10128 FindWindowByLabel(String label, Window parent=None) -> Window
10129
10130 Find a window by its label. Depending on the type of window, the label
10131 may be a window title or panel item label. If parent is None, the
10132 search will start from all top-level frames and dialog boxes; if
10133 non-None, the search will be limited to the given window
10134 hierarchy. The search is recursive in both cases.
10135 """
10136 return _core_.FindWindowByLabel(*args, **kwargs)
10137
10138def Window_FromHWND(*args, **kwargs):
10139 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10140 return _core_.Window_FromHWND(*args, **kwargs)
3215336e
RD
10141
10142def GetTopLevelWindows(*args, **kwargs):
10143 """
10144 GetTopLevelWindows() -> PyObject
10145
10146 Returns a list of the the application's top-level windows, (frames,
10147 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10148 by wxWidgets, and so it is only valid as long as no top-level windows
10149 are closed or new top-level windows are created.
10150
10151 """
10152 return _core_.GetTopLevelWindows(*args, **kwargs)
d55e5bfc
RD
10153#---------------------------------------------------------------------------
10154
10155class Validator(EvtHandler):
093d3ff1 10156 """Proxy of C++ Validator class"""
d55e5bfc
RD
10157 def __repr__(self):
10158 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10159 def __init__(self, *args, **kwargs):
10160 """__init__(self) -> Validator"""
10161 newobj = _core_.new_Validator(*args, **kwargs)
10162 self.this = newobj.this
10163 self.thisown = 1
10164 del newobj.thisown
10165 self._setOORInfo(self)
10166
10167 def Clone(*args, **kwargs):
10168 """Clone(self) -> Validator"""
10169 return _core_.Validator_Clone(*args, **kwargs)
10170
10171 def Validate(*args, **kwargs):
10172 """Validate(self, Window parent) -> bool"""
10173 return _core_.Validator_Validate(*args, **kwargs)
10174
10175 def TransferToWindow(*args, **kwargs):
10176 """TransferToWindow(self) -> bool"""
10177 return _core_.Validator_TransferToWindow(*args, **kwargs)
10178
10179 def TransferFromWindow(*args, **kwargs):
10180 """TransferFromWindow(self) -> bool"""
10181 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10182
10183 def GetWindow(*args, **kwargs):
10184 """GetWindow(self) -> Window"""
10185 return _core_.Validator_GetWindow(*args, **kwargs)
10186
10187 def SetWindow(*args, **kwargs):
10188 """SetWindow(self, Window window)"""
10189 return _core_.Validator_SetWindow(*args, **kwargs)
10190
10191 def IsSilent(*args, **kwargs):
c24da6d6 10192 """IsSilent() -> bool"""
d55e5bfc
RD
10193 return _core_.Validator_IsSilent(*args, **kwargs)
10194
10195 IsSilent = staticmethod(IsSilent)
10196 def SetBellOnError(*args, **kwargs):
c24da6d6 10197 """SetBellOnError(int doIt=True)"""
d55e5bfc
RD
10198 return _core_.Validator_SetBellOnError(*args, **kwargs)
10199
10200 SetBellOnError = staticmethod(SetBellOnError)
10201
10202class ValidatorPtr(Validator):
10203 def __init__(self, this):
10204 self.this = this
10205 if not hasattr(self,"thisown"): self.thisown = 0
10206 self.__class__ = Validator
10207_core_.Validator_swigregister(ValidatorPtr)
10208
10209def Validator_IsSilent(*args, **kwargs):
10210 """Validator_IsSilent() -> bool"""
10211 return _core_.Validator_IsSilent(*args, **kwargs)
10212
10213def Validator_SetBellOnError(*args, **kwargs):
10214 """Validator_SetBellOnError(int doIt=True)"""
10215 return _core_.Validator_SetBellOnError(*args, **kwargs)
10216
10217class PyValidator(Validator):
093d3ff1 10218 """Proxy of C++ PyValidator class"""
d55e5bfc
RD
10219 def __repr__(self):
10220 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10221 def __init__(self, *args, **kwargs):
10222 """__init__(self) -> PyValidator"""
10223 newobj = _core_.new_PyValidator(*args, **kwargs)
10224 self.this = newobj.this
10225 self.thisown = 1
10226 del newobj.thisown
10227
10228 self._setCallbackInfo(self, PyValidator, 1)
10229 self._setOORInfo(self)
10230
10231 def _setCallbackInfo(*args, **kwargs):
10232 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10233 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10234
10235
10236class PyValidatorPtr(PyValidator):
10237 def __init__(self, this):
10238 self.this = this
10239 if not hasattr(self,"thisown"): self.thisown = 0
10240 self.__class__ = PyValidator
10241_core_.PyValidator_swigregister(PyValidatorPtr)
10242
10243#---------------------------------------------------------------------------
10244
10245class Menu(EvtHandler):
093d3ff1 10246 """Proxy of C++ Menu class"""
d55e5bfc
RD
10247 def __repr__(self):
10248 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10249 def __init__(self, *args, **kwargs):
10250 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10251 newobj = _core_.new_Menu(*args, **kwargs)
10252 self.this = newobj.this
10253 self.thisown = 1
10254 del newobj.thisown
10255 self._setOORInfo(self)
10256
10257 def Append(*args, **kwargs):
10258 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10259 return _core_.Menu_Append(*args, **kwargs)
10260
10261 def AppendSeparator(*args, **kwargs):
10262 """AppendSeparator(self) -> MenuItem"""
10263 return _core_.Menu_AppendSeparator(*args, **kwargs)
10264
10265 def AppendCheckItem(*args, **kwargs):
10266 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10267 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10268
10269 def AppendRadioItem(*args, **kwargs):
10270 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10271 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10272
10273 def AppendMenu(*args, **kwargs):
10274 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10275 return _core_.Menu_AppendMenu(*args, **kwargs)
10276
10277 def AppendItem(*args, **kwargs):
10278 """AppendItem(self, MenuItem item) -> MenuItem"""
10279 return _core_.Menu_AppendItem(*args, **kwargs)
10280
10281 def Break(*args, **kwargs):
10282 """Break(self)"""
10283 return _core_.Menu_Break(*args, **kwargs)
10284
10285 def InsertItem(*args, **kwargs):
10286 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10287 return _core_.Menu_InsertItem(*args, **kwargs)
10288
10289 def Insert(*args, **kwargs):
10290 """
10291 Insert(self, size_t pos, int id, String text, String help=EmptyString,
10292 int kind=ITEM_NORMAL) -> MenuItem
10293 """
10294 return _core_.Menu_Insert(*args, **kwargs)
10295
10296 def InsertSeparator(*args, **kwargs):
10297 """InsertSeparator(self, size_t pos) -> MenuItem"""
10298 return _core_.Menu_InsertSeparator(*args, **kwargs)
10299
10300 def InsertCheckItem(*args, **kwargs):
10301 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10302 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10303
10304 def InsertRadioItem(*args, **kwargs):
10305 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10306 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10307
10308 def InsertMenu(*args, **kwargs):
10309 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10310 return _core_.Menu_InsertMenu(*args, **kwargs)
10311
10312 def PrependItem(*args, **kwargs):
10313 """PrependItem(self, MenuItem item) -> MenuItem"""
10314 return _core_.Menu_PrependItem(*args, **kwargs)
10315
10316 def Prepend(*args, **kwargs):
10317 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10318 return _core_.Menu_Prepend(*args, **kwargs)
10319
10320 def PrependSeparator(*args, **kwargs):
10321 """PrependSeparator(self) -> MenuItem"""
10322 return _core_.Menu_PrependSeparator(*args, **kwargs)
10323
10324 def PrependCheckItem(*args, **kwargs):
10325 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10326 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10327
10328 def PrependRadioItem(*args, **kwargs):
10329 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10330 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10331
10332 def PrependMenu(*args, **kwargs):
10333 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10334 return _core_.Menu_PrependMenu(*args, **kwargs)
10335
10336 def Remove(*args, **kwargs):
10337 """Remove(self, int id) -> MenuItem"""
10338 return _core_.Menu_Remove(*args, **kwargs)
10339
10340 def RemoveItem(*args, **kwargs):
10341 """RemoveItem(self, MenuItem item) -> MenuItem"""
10342 return _core_.Menu_RemoveItem(*args, **kwargs)
10343
10344 def Delete(*args, **kwargs):
10345 """Delete(self, int id) -> bool"""
10346 return _core_.Menu_Delete(*args, **kwargs)
10347
10348 def DeleteItem(*args, **kwargs):
10349 """DeleteItem(self, MenuItem item) -> bool"""
10350 return _core_.Menu_DeleteItem(*args, **kwargs)
10351
10352 def Destroy(*args, **kwargs):
10353 """
10354 Destroy(self)
10355
10356 Deletes the C++ object this Python object is a proxy for.
10357 """
10358 return _core_.Menu_Destroy(*args, **kwargs)
10359
10360 def DestroyId(*args, **kwargs):
10361 """
10362 DestroyId(self, int id) -> bool
10363
10364 Deletes the C++ object this Python object is a proxy for.
10365 """
10366 return _core_.Menu_DestroyId(*args, **kwargs)
10367
10368 def DestroyItem(*args, **kwargs):
10369 """
10370 DestroyItem(self, MenuItem item) -> bool
10371
10372 Deletes the C++ object this Python object is a proxy for.
10373 """
10374 return _core_.Menu_DestroyItem(*args, **kwargs)
10375
10376 def GetMenuItemCount(*args, **kwargs):
10377 """GetMenuItemCount(self) -> size_t"""
10378 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10379
10380 def GetMenuItems(*args, **kwargs):
10381 """GetMenuItems(self) -> PyObject"""
10382 return _core_.Menu_GetMenuItems(*args, **kwargs)
10383
10384 def FindItem(*args, **kwargs):
10385 """FindItem(self, String item) -> int"""
10386 return _core_.Menu_FindItem(*args, **kwargs)
10387
10388 def FindItemById(*args, **kwargs):
10389 """FindItemById(self, int id) -> MenuItem"""
10390 return _core_.Menu_FindItemById(*args, **kwargs)
10391
10392 def FindItemByPosition(*args, **kwargs):
10393 """FindItemByPosition(self, size_t position) -> MenuItem"""
10394 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10395
10396 def Enable(*args, **kwargs):
10397 """Enable(self, int id, bool enable)"""
10398 return _core_.Menu_Enable(*args, **kwargs)
10399
10400 def IsEnabled(*args, **kwargs):
10401 """IsEnabled(self, int id) -> bool"""
10402 return _core_.Menu_IsEnabled(*args, **kwargs)
10403
10404 def Check(*args, **kwargs):
10405 """Check(self, int id, bool check)"""
10406 return _core_.Menu_Check(*args, **kwargs)
10407
10408 def IsChecked(*args, **kwargs):
10409 """IsChecked(self, int id) -> bool"""
10410 return _core_.Menu_IsChecked(*args, **kwargs)
10411
10412 def SetLabel(*args, **kwargs):
10413 """SetLabel(self, int id, String label)"""
10414 return _core_.Menu_SetLabel(*args, **kwargs)
10415
10416 def GetLabel(*args, **kwargs):
10417 """GetLabel(self, int id) -> String"""
10418 return _core_.Menu_GetLabel(*args, **kwargs)
10419
10420 def SetHelpString(*args, **kwargs):
10421 """SetHelpString(self, int id, String helpString)"""
10422 return _core_.Menu_SetHelpString(*args, **kwargs)
10423
10424 def GetHelpString(*args, **kwargs):
10425 """GetHelpString(self, int id) -> String"""
10426 return _core_.Menu_GetHelpString(*args, **kwargs)
10427
10428 def SetTitle(*args, **kwargs):
10429 """SetTitle(self, String title)"""
10430 return _core_.Menu_SetTitle(*args, **kwargs)
10431
10432 def GetTitle(*args, **kwargs):
10433 """GetTitle(self) -> String"""
10434 return _core_.Menu_GetTitle(*args, **kwargs)
10435
10436 def SetEventHandler(*args, **kwargs):
10437 """SetEventHandler(self, EvtHandler handler)"""
10438 return _core_.Menu_SetEventHandler(*args, **kwargs)
10439
10440 def GetEventHandler(*args, **kwargs):
10441 """GetEventHandler(self) -> EvtHandler"""
10442 return _core_.Menu_GetEventHandler(*args, **kwargs)
10443
10444 def SetInvokingWindow(*args, **kwargs):
10445 """SetInvokingWindow(self, Window win)"""
10446 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10447
10448 def GetInvokingWindow(*args, **kwargs):
10449 """GetInvokingWindow(self) -> Window"""
10450 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10451
10452 def GetStyle(*args, **kwargs):
10453 """GetStyle(self) -> long"""
10454 return _core_.Menu_GetStyle(*args, **kwargs)
10455
10456 def UpdateUI(*args, **kwargs):
10457 """UpdateUI(self, EvtHandler source=None)"""
10458 return _core_.Menu_UpdateUI(*args, **kwargs)
10459
10460 def GetMenuBar(*args, **kwargs):
10461 """GetMenuBar(self) -> MenuBar"""
10462 return _core_.Menu_GetMenuBar(*args, **kwargs)
10463
10464 def Attach(*args, **kwargs):
10465 """Attach(self, wxMenuBarBase menubar)"""
10466 return _core_.Menu_Attach(*args, **kwargs)
10467
10468 def Detach(*args, **kwargs):
10469 """Detach(self)"""
10470 return _core_.Menu_Detach(*args, **kwargs)
10471
10472 def IsAttached(*args, **kwargs):
10473 """IsAttached(self) -> bool"""
10474 return _core_.Menu_IsAttached(*args, **kwargs)
10475
10476 def SetParent(*args, **kwargs):
10477 """SetParent(self, Menu parent)"""
10478 return _core_.Menu_SetParent(*args, **kwargs)
10479
10480 def GetParent(*args, **kwargs):
10481 """GetParent(self) -> Menu"""
10482 return _core_.Menu_GetParent(*args, **kwargs)
10483
10484
10485class MenuPtr(Menu):
10486 def __init__(self, this):
10487 self.this = this
10488 if not hasattr(self,"thisown"): self.thisown = 0
10489 self.__class__ = Menu
10490_core_.Menu_swigregister(MenuPtr)
10491DefaultValidator = cvar.DefaultValidator
10492
10493#---------------------------------------------------------------------------
10494
10495class MenuBar(Window):
093d3ff1 10496 """Proxy of C++ MenuBar class"""
d55e5bfc
RD
10497 def __repr__(self):
10498 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10499 def __init__(self, *args, **kwargs):
10500 """__init__(self, long style=0) -> MenuBar"""
10501 newobj = _core_.new_MenuBar(*args, **kwargs)
10502 self.this = newobj.this
10503 self.thisown = 1
10504 del newobj.thisown
10505 self._setOORInfo(self)
10506
10507 def Append(*args, **kwargs):
10508 """Append(self, Menu menu, String title) -> bool"""
10509 return _core_.MenuBar_Append(*args, **kwargs)
10510
10511 def Insert(*args, **kwargs):
10512 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10513 return _core_.MenuBar_Insert(*args, **kwargs)
10514
10515 def GetMenuCount(*args, **kwargs):
10516 """GetMenuCount(self) -> size_t"""
10517 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10518
10519 def GetMenu(*args, **kwargs):
10520 """GetMenu(self, size_t pos) -> Menu"""
10521 return _core_.MenuBar_GetMenu(*args, **kwargs)
10522
10523 def Replace(*args, **kwargs):
10524 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10525 return _core_.MenuBar_Replace(*args, **kwargs)
10526
10527 def Remove(*args, **kwargs):
10528 """Remove(self, size_t pos) -> Menu"""
10529 return _core_.MenuBar_Remove(*args, **kwargs)
10530
10531 def EnableTop(*args, **kwargs):
10532 """EnableTop(self, size_t pos, bool enable)"""
10533 return _core_.MenuBar_EnableTop(*args, **kwargs)
10534
10535 def IsEnabledTop(*args, **kwargs):
10536 """IsEnabledTop(self, size_t pos) -> bool"""
10537 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10538
10539 def SetLabelTop(*args, **kwargs):
10540 """SetLabelTop(self, size_t pos, String label)"""
10541 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10542
10543 def GetLabelTop(*args, **kwargs):
10544 """GetLabelTop(self, size_t pos) -> String"""
10545 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10546
10547 def FindMenuItem(*args, **kwargs):
10548 """FindMenuItem(self, String menu, String item) -> int"""
10549 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10550
10551 def FindItemById(*args, **kwargs):
10552 """FindItemById(self, int id) -> MenuItem"""
10553 return _core_.MenuBar_FindItemById(*args, **kwargs)
10554
10555 def FindMenu(*args, **kwargs):
10556 """FindMenu(self, String title) -> int"""
10557 return _core_.MenuBar_FindMenu(*args, **kwargs)
10558
10559 def Enable(*args, **kwargs):
10560 """Enable(self, int id, bool enable)"""
10561 return _core_.MenuBar_Enable(*args, **kwargs)
10562
10563 def Check(*args, **kwargs):
10564 """Check(self, int id, bool check)"""
10565 return _core_.MenuBar_Check(*args, **kwargs)
10566
10567 def IsChecked(*args, **kwargs):
10568 """IsChecked(self, int id) -> bool"""
10569 return _core_.MenuBar_IsChecked(*args, **kwargs)
10570
10571 def IsEnabled(*args, **kwargs):
10572 """IsEnabled(self, int id) -> bool"""
10573 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10574
10575 def SetLabel(*args, **kwargs):
10576 """SetLabel(self, int id, String label)"""
10577 return _core_.MenuBar_SetLabel(*args, **kwargs)
10578
10579 def GetLabel(*args, **kwargs):
10580 """GetLabel(self, int id) -> String"""
10581 return _core_.MenuBar_GetLabel(*args, **kwargs)
10582
10583 def SetHelpString(*args, **kwargs):
10584 """SetHelpString(self, int id, String helpString)"""
10585 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10586
10587 def GetHelpString(*args, **kwargs):
10588 """GetHelpString(self, int id) -> String"""
10589 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10590
10591 def GetFrame(*args, **kwargs):
10592 """GetFrame(self) -> wxFrame"""
10593 return _core_.MenuBar_GetFrame(*args, **kwargs)
10594
10595 def IsAttached(*args, **kwargs):
10596 """IsAttached(self) -> bool"""
10597 return _core_.MenuBar_IsAttached(*args, **kwargs)
10598
10599 def Attach(*args, **kwargs):
10600 """Attach(self, wxFrame frame)"""
10601 return _core_.MenuBar_Attach(*args, **kwargs)
10602
10603 def Detach(*args, **kwargs):
10604 """Detach(self)"""
10605 return _core_.MenuBar_Detach(*args, **kwargs)
10606
db67f999
RD
10607 def SetAutoWindowMenu(*args, **kwargs):
10608 """SetAutoWindowMenu(bool enable)"""
10609 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10610
10611 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10612 def GetAutoWindowMenu(*args, **kwargs):
10613 """GetAutoWindowMenu() -> bool"""
10614 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10615
10616 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
d55e5bfc
RD
10617
10618class MenuBarPtr(MenuBar):
10619 def __init__(self, this):
10620 self.this = this
10621 if not hasattr(self,"thisown"): self.thisown = 0
10622 self.__class__ = MenuBar
10623_core_.MenuBar_swigregister(MenuBarPtr)
10624
db67f999
RD
10625def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10626 """MenuBar_SetAutoWindowMenu(bool enable)"""
10627 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10628
10629def MenuBar_GetAutoWindowMenu(*args, **kwargs):
10630 """MenuBar_GetAutoWindowMenu() -> bool"""
10631 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10632
d55e5bfc
RD
10633#---------------------------------------------------------------------------
10634
10635class MenuItem(Object):
093d3ff1 10636 """Proxy of C++ MenuItem class"""
d55e5bfc
RD
10637 def __repr__(self):
10638 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10639 def __init__(self, *args, **kwargs):
10640 """
10641 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10642 String help=EmptyString, int kind=ITEM_NORMAL,
10643 Menu subMenu=None) -> MenuItem
10644 """
10645 newobj = _core_.new_MenuItem(*args, **kwargs)
10646 self.this = newobj.this
10647 self.thisown = 1
10648 del newobj.thisown
10649 def GetMenu(*args, **kwargs):
10650 """GetMenu(self) -> Menu"""
10651 return _core_.MenuItem_GetMenu(*args, **kwargs)
10652
10653 def SetMenu(*args, **kwargs):
10654 """SetMenu(self, Menu menu)"""
10655 return _core_.MenuItem_SetMenu(*args, **kwargs)
10656
10657 def SetId(*args, **kwargs):
10658 """SetId(self, int id)"""
10659 return _core_.MenuItem_SetId(*args, **kwargs)
10660
10661 def GetId(*args, **kwargs):
10662 """GetId(self) -> int"""
10663 return _core_.MenuItem_GetId(*args, **kwargs)
10664
10665 def IsSeparator(*args, **kwargs):
10666 """IsSeparator(self) -> bool"""
10667 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10668
10669 def SetText(*args, **kwargs):
10670 """SetText(self, String str)"""
10671 return _core_.MenuItem_SetText(*args, **kwargs)
10672
10673 def GetLabel(*args, **kwargs):
10674 """GetLabel(self) -> String"""
10675 return _core_.MenuItem_GetLabel(*args, **kwargs)
10676
10677 def GetText(*args, **kwargs):
10678 """GetText(self) -> String"""
10679 return _core_.MenuItem_GetText(*args, **kwargs)
10680
10681 def GetLabelFromText(*args, **kwargs):
c24da6d6 10682 """GetLabelFromText(String text) -> String"""
d55e5bfc
RD
10683 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10684
10685 GetLabelFromText = staticmethod(GetLabelFromText)
10686 def GetKind(*args, **kwargs):
10687 """GetKind(self) -> int"""
10688 return _core_.MenuItem_GetKind(*args, **kwargs)
10689
10690 def SetKind(*args, **kwargs):
10691 """SetKind(self, int kind)"""
10692 return _core_.MenuItem_SetKind(*args, **kwargs)
10693
10694 def SetCheckable(*args, **kwargs):
10695 """SetCheckable(self, bool checkable)"""
10696 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10697
10698 def IsCheckable(*args, **kwargs):
10699 """IsCheckable(self) -> bool"""
10700 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10701
10702 def IsSubMenu(*args, **kwargs):
10703 """IsSubMenu(self) -> bool"""
10704 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10705
10706 def SetSubMenu(*args, **kwargs):
10707 """SetSubMenu(self, Menu menu)"""
10708 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10709
10710 def GetSubMenu(*args, **kwargs):
10711 """GetSubMenu(self) -> Menu"""
10712 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10713
10714 def Enable(*args, **kwargs):
10715 """Enable(self, bool enable=True)"""
10716 return _core_.MenuItem_Enable(*args, **kwargs)
10717
10718 def IsEnabled(*args, **kwargs):
10719 """IsEnabled(self) -> bool"""
10720 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10721
10722 def Check(*args, **kwargs):
10723 """Check(self, bool check=True)"""
10724 return _core_.MenuItem_Check(*args, **kwargs)
10725
10726 def IsChecked(*args, **kwargs):
10727 """IsChecked(self) -> bool"""
10728 return _core_.MenuItem_IsChecked(*args, **kwargs)
10729
10730 def Toggle(*args, **kwargs):
10731 """Toggle(self)"""
10732 return _core_.MenuItem_Toggle(*args, **kwargs)
10733
10734 def SetHelp(*args, **kwargs):
10735 """SetHelp(self, String str)"""
10736 return _core_.MenuItem_SetHelp(*args, **kwargs)
10737
10738 def GetHelp(*args, **kwargs):
10739 """GetHelp(self) -> String"""
10740 return _core_.MenuItem_GetHelp(*args, **kwargs)
10741
10742 def GetAccel(*args, **kwargs):
10743 """GetAccel(self) -> AcceleratorEntry"""
10744 return _core_.MenuItem_GetAccel(*args, **kwargs)
10745
10746 def SetAccel(*args, **kwargs):
10747 """SetAccel(self, AcceleratorEntry accel)"""
10748 return _core_.MenuItem_SetAccel(*args, **kwargs)
10749
10750 def SetFont(*args, **kwargs):
10751 """SetFont(self, Font font)"""
10752 return _core_.MenuItem_SetFont(*args, **kwargs)
10753
10754 def GetFont(*args, **kwargs):
10755 """GetFont(self) -> Font"""
10756 return _core_.MenuItem_GetFont(*args, **kwargs)
10757
10758 def SetTextColour(*args, **kwargs):
10759 """SetTextColour(self, Colour colText)"""
10760 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10761
10762 def GetTextColour(*args, **kwargs):
10763 """GetTextColour(self) -> Colour"""
10764 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10765
10766 def SetBackgroundColour(*args, **kwargs):
10767 """SetBackgroundColour(self, Colour colBack)"""
10768 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10769
10770 def GetBackgroundColour(*args, **kwargs):
10771 """GetBackgroundColour(self) -> Colour"""
10772 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10773
10774 def SetBitmaps(*args, **kwargs):
10775 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10776 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10777
10778 def SetDisabledBitmap(*args, **kwargs):
10779 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10780 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10781
10782 def GetDisabledBitmap(*args, **kwargs):
10783 """GetDisabledBitmap(self) -> Bitmap"""
10784 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10785
10786 def SetMarginWidth(*args, **kwargs):
10787 """SetMarginWidth(self, int nWidth)"""
10788 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10789
10790 def GetMarginWidth(*args, **kwargs):
10791 """GetMarginWidth(self) -> int"""
10792 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10793
10794 def GetDefaultMarginWidth(*args, **kwargs):
c24da6d6 10795 """GetDefaultMarginWidth() -> int"""
d55e5bfc
RD
10796 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10797
10798 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10799 def IsOwnerDrawn(*args, **kwargs):
10800 """IsOwnerDrawn(self) -> bool"""
10801 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10802
10803 def SetOwnerDrawn(*args, **kwargs):
10804 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10805 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10806
10807 def ResetOwnerDrawn(*args, **kwargs):
10808 """ResetOwnerDrawn(self)"""
10809 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10810
10811 def SetBitmap(*args, **kwargs):
10812 """SetBitmap(self, Bitmap bitmap)"""
10813 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10814
10815 def GetBitmap(*args, **kwargs):
10816 """GetBitmap(self) -> Bitmap"""
10817 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10818
10819
10820class MenuItemPtr(MenuItem):
10821 def __init__(self, this):
10822 self.this = this
10823 if not hasattr(self,"thisown"): self.thisown = 0
10824 self.__class__ = MenuItem
10825_core_.MenuItem_swigregister(MenuItemPtr)
10826
10827def MenuItem_GetLabelFromText(*args, **kwargs):
10828 """MenuItem_GetLabelFromText(String text) -> String"""
10829 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10830
10831def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
10832 """MenuItem_GetDefaultMarginWidth() -> int"""
10833 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10834
10835#---------------------------------------------------------------------------
10836
10837class Control(Window):
10838 """
10839 This is the base class for a control or 'widget'.
10840
79fccf9d
RD
10841 A control is generally a small window which processes user input
10842 and/or displays one or more item of data.
d55e5bfc
RD
10843 """
10844 def __repr__(self):
10845 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10846 def __init__(self, *args, **kwargs):
10847 """
248ed943
RD
10848 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10849 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
10850 String name=ControlNameStr) -> Control
10851
79fccf9d
RD
10852 Create a Control. Normally you should only call this from a subclass'
10853 __init__ as a plain old wx.Control is not very useful.
d55e5bfc
RD
10854 """
10855 newobj = _core_.new_Control(*args, **kwargs)
10856 self.this = newobj.this
10857 self.thisown = 1
10858 del newobj.thisown
10859 self._setOORInfo(self)
10860
10861 def Create(*args, **kwargs):
10862 """
248ed943
RD
10863 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10864 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
10865 String name=ControlNameStr) -> bool
10866
10867 Do the 2nd phase and create the GUI control.
10868 """
10869 return _core_.Control_Create(*args, **kwargs)
10870
10871 def Command(*args, **kwargs):
10872 """
10873 Command(self, CommandEvent event)
10874
79fccf9d
RD
10875 Simulates the effect of the user issuing a command to the item.
10876
10877 :see: `wx.CommandEvent`
10878
d55e5bfc
RD
10879 """
10880 return _core_.Control_Command(*args, **kwargs)
10881
10882 def GetLabel(*args, **kwargs):
10883 """
10884 GetLabel(self) -> String
10885
10886 Return a control's text.
10887 """
10888 return _core_.Control_GetLabel(*args, **kwargs)
10889
10890 def SetLabel(*args, **kwargs):
10891 """
10892 SetLabel(self, String label)
10893
10894 Sets the item's text.
10895 """
10896 return _core_.Control_SetLabel(*args, **kwargs)
10897
a001823c 10898 def GetClassDefaultAttributes(*args, **kwargs):
f8167d6e 10899 """
a001823c 10900 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
f8167d6e 10901
a001823c
RD
10902 Get the default attributes for this class. This is useful if you want
10903 to use the same font or colour in your own control as in a standard
10904 control -- which is a much better idea than hard coding specific
10905 colours or fonts which might look completely out of place on the
10906 user's system, especially if it uses themes.
f8167d6e 10907
a001823c
RD
10908 The variant parameter is only relevant under Mac currently and is
10909 ignore under other platforms. Under Mac, it will change the size of
10910 the returned font. See `wx.Window.SetWindowVariant` for more about
10911 this.
f8167d6e 10912 """
d55e5bfc
RD
10913 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10914
10915 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10916
10917class ControlPtr(Control):
10918 def __init__(self, this):
10919 self.this = this
10920 if not hasattr(self,"thisown"): self.thisown = 0
10921 self.__class__ = Control
10922_core_.Control_swigregister(ControlPtr)
10923ControlNameStr = cvar.ControlNameStr
10924
10925def PreControl(*args, **kwargs):
10926 """
10927 PreControl() -> Control
10928
10929 Precreate a Control control for 2-phase creation
10930 """
10931 val = _core_.new_PreControl(*args, **kwargs)
10932 val.thisown = 1
10933 return val
10934
10935def Control_GetClassDefaultAttributes(*args, **kwargs):
a001823c
RD
10936 """
10937 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10938
10939 Get the default attributes for this class. This is useful if you want
10940 to use the same font or colour in your own control as in a standard
10941 control -- which is a much better idea than hard coding specific
10942 colours or fonts which might look completely out of place on the
10943 user's system, especially if it uses themes.
10944
10945 The variant parameter is only relevant under Mac currently and is
10946 ignore under other platforms. Under Mac, it will change the size of
10947 the returned font. See `wx.Window.SetWindowVariant` for more about
10948 this.
10949 """
d55e5bfc
RD
10950 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10951
10952#---------------------------------------------------------------------------
10953
10954class ItemContainer(object):
10955 """
53aa7709
RD
10956 The wx.ItemContainer class defines an interface which is implemented
10957 by all controls which have string subitems, each of which may be
10958 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10959 as `wx.ComboBox` which implements an extended interface deriving from
79fccf9d 10960 this one.
d55e5bfc 10961
79fccf9d
RD
10962 It defines the methods for accessing the control's items and although
10963 each of the derived classes implements them differently, they still
10964 all conform to the same interface.
d55e5bfc 10965
79fccf9d
RD
10966 The items in a wx.ItemContainer have (non empty) string labels and,
10967 optionally, client data associated with them.
d55e5bfc
RD
10968
10969 """
10970 def __init__(self): raise RuntimeError, "No constructor defined"
10971 def __repr__(self):
10972 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10973 def Append(*args, **kwargs):
10974 """
10975 Append(self, String item, PyObject clientData=None) -> int
10976
79fccf9d
RD
10977 Adds the item to the control, associating the given data with the item
10978 if not None. The return value is the index of the newly added item
10979 which may be different from the last one if the control is sorted (e.g.
10980 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc
RD
10981 """
10982 return _core_.ItemContainer_Append(*args, **kwargs)
10983
10984 def AppendItems(*args, **kwargs):
10985 """
f5b96ee1 10986 AppendItems(self, List strings)
d55e5bfc 10987
79fccf9d
RD
10988 Apend several items at once to the control. Notice that calling this
10989 method may be much faster than appending the items one by one if you
10990 need to add a lot of items.
d55e5bfc
RD
10991 """
10992 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10993
10994 def Insert(*args, **kwargs):
10995 """
10996 Insert(self, String item, int pos, PyObject clientData=None) -> int
10997
79fccf9d 10998 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
10999 optionally associating some data object with the item.
11000 """
11001 return _core_.ItemContainer_Insert(*args, **kwargs)
11002
11003 def Clear(*args, **kwargs):
11004 """
11005 Clear(self)
11006
11007 Removes all items from the control.
11008 """
11009 return _core_.ItemContainer_Clear(*args, **kwargs)
11010
11011 def Delete(*args, **kwargs):
11012 """
11013 Delete(self, int n)
11014
79fccf9d
RD
11015 Deletes the item at the zero-based index 'n' from the control. Note
11016 that it is an error (signalled by a `wx.PyAssertionError` exception if
11017 enabled) to remove an item with the index negative or greater or equal
11018 than the number of items in the control.
d55e5bfc
RD
11019 """
11020 return _core_.ItemContainer_Delete(*args, **kwargs)
11021
53aa7709
RD
11022 def GetClientData(*args, **kwargs):
11023 """
11024 GetClientData(self, int n) -> PyObject
11025
11026 Returns the client data associated with the given item, (if any.)
11027 """
11028 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11029
11030 def SetClientData(*args, **kwargs):
11031 """
11032 SetClientData(self, int n, PyObject clientData)
11033
11034 Associate the given client data with the item at position n.
11035 """
11036 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11037
d55e5bfc
RD
11038 def GetCount(*args, **kwargs):
11039 """
11040 GetCount(self) -> int
11041
11042 Returns the number of items in the control.
11043 """
11044 return _core_.ItemContainer_GetCount(*args, **kwargs)
11045
11046 def IsEmpty(*args, **kwargs):
11047 """
11048 IsEmpty(self) -> bool
11049
11050 Returns True if the control is empty or False if it has some items.
11051 """
11052 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
11053
11054 def GetString(*args, **kwargs):
11055 """
11056 GetString(self, int n) -> String
11057
11058 Returns the label of the item with the given index.
11059 """
11060 return _core_.ItemContainer_GetString(*args, **kwargs)
11061
11062 def GetStrings(*args, **kwargs):
11063 """GetStrings(self) -> wxArrayString"""
11064 return _core_.ItemContainer_GetStrings(*args, **kwargs)
11065
11066 def SetString(*args, **kwargs):
11067 """
11068 SetString(self, int n, String s)
11069
11070 Sets the label for the given item.
11071 """
11072 return _core_.ItemContainer_SetString(*args, **kwargs)
11073
11074 def FindString(*args, **kwargs):
11075 """
11076 FindString(self, String s) -> int
11077
11078 Finds an item whose label matches the given string. Returns the
79fccf9d
RD
11079 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11080 found.
d55e5bfc
RD
11081 """
11082 return _core_.ItemContainer_FindString(*args, **kwargs)
11083
53aa7709 11084 def SetSelection(*args, **kwargs):
d55e5bfc 11085 """
53aa7709 11086 SetSelection(self, int n)
d55e5bfc
RD
11087
11088 Sets the item at index 'n' to be the selected item.
11089 """
53aa7709 11090 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 11091
d55e5bfc
RD
11092 def GetSelection(*args, **kwargs):
11093 """
11094 GetSelection(self) -> int
11095
79fccf9d
RD
11096 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11097 is selected.
d55e5bfc
RD
11098 """
11099 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11100
53aa7709
RD
11101 def SetStringSelection(*args, **kwargs):
11102 """SetStringSelection(self, String s) -> bool"""
11103 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11104
d55e5bfc
RD
11105 def GetStringSelection(*args, **kwargs):
11106 """
11107 GetStringSelection(self) -> String
11108
79fccf9d
RD
11109 Returns the label of the selected item or an empty string if no item
11110 is selected.
d55e5bfc
RD
11111 """
11112 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11113
53aa7709 11114 def Select(*args, **kwargs):
d55e5bfc 11115 """
53aa7709 11116 Select(self, int n)
d55e5bfc 11117
53aa7709
RD
11118 This is the same as `SetSelection` and exists only because it is
11119 slightly more natural for controls which support multiple selection.
d55e5bfc 11120 """
53aa7709 11121 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc
RD
11122
11123
11124class ItemContainerPtr(ItemContainer):
11125 def __init__(self, this):
11126 self.this = this
11127 if not hasattr(self,"thisown"): self.thisown = 0
11128 self.__class__ = ItemContainer
11129_core_.ItemContainer_swigregister(ItemContainerPtr)
11130
11131#---------------------------------------------------------------------------
11132
11133class ControlWithItems(Control,ItemContainer):
11134 """
79fccf9d
RD
11135 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11136 wx.Control class, and is used for the base class of various controls
11137 that have items.
d55e5bfc
RD
11138 """
11139 def __init__(self): raise RuntimeError, "No constructor defined"
11140 def __repr__(self):
11141 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11142
11143class ControlWithItemsPtr(ControlWithItems):
11144 def __init__(self, this):
11145 self.this = this
11146 if not hasattr(self,"thisown"): self.thisown = 0
11147 self.__class__ = ControlWithItems
11148_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
11149
11150#---------------------------------------------------------------------------
11151
11152class SizerItem(Object):
248ed943
RD
11153 """
11154 The wx.SizerItem class is used to track the position, size and other
11155 attributes of each item managed by a `wx.Sizer`. In normal usage user
11156 code should never need to deal directly with a wx.SizerItem, but
11157 custom classes derived from `wx.PySizer` will probably need to use the
11158 collection of wx.SizerItems held by wx.Sizer when calculating layout.
11159
11160 :see: `wx.Sizer`, `wx.GBSizerItem`
11161 """
d55e5bfc
RD
11162 def __repr__(self):
11163 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11164 def __init__(self, *args, **kwargs):
248ed943
RD
11165 """
11166 __init__(self) -> SizerItem
11167
11168 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11169 size will need to be set before this item can be used in a Sizer.
11170
11171 You will probably never need to create a wx.SizerItem directly as they
11172 are created automatically when the sizer's Add, Insert or Prepend
11173 methods are called.
11174
11175 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11176 """
d55e5bfc
RD
11177 newobj = _core_.new_SizerItem(*args, **kwargs)
11178 self.this = newobj.this
11179 self.thisown = 1
11180 del newobj.thisown
11181 def DeleteWindows(*args, **kwargs):
248ed943
RD
11182 """
11183 DeleteWindows(self)
11184
11185 Destroy the window or the windows in a subsizer, depending on the type
11186 of item.
11187 """
d55e5bfc
RD
11188 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
11189
11190 def DetachSizer(*args, **kwargs):
248ed943
RD
11191 """
11192 DetachSizer(self)
11193
11194 Enable deleting the SizerItem without destroying the contained sizer.
11195 """
d55e5bfc
RD
11196 return _core_.SizerItem_DetachSizer(*args, **kwargs)
11197
11198 def GetSize(*args, **kwargs):
248ed943
RD
11199 """
11200 GetSize(self) -> Size
11201
11202 Get the current size of the item, as set in the last Layout.
11203 """
d55e5bfc
RD
11204 return _core_.SizerItem_GetSize(*args, **kwargs)
11205
11206 def CalcMin(*args, **kwargs):
248ed943
RD
11207 """
11208 CalcMin(self) -> Size
11209
11210 Calculates the minimum desired size for the item, including any space
11211 needed by borders.
11212 """
d55e5bfc
RD
11213 return _core_.SizerItem_CalcMin(*args, **kwargs)
11214
11215 def SetDimension(*args, **kwargs):
248ed943
RD
11216 """
11217 SetDimension(self, Point pos, Size size)
11218
11219 Set the position and size of the space allocated for this item by the
11220 sizer, and adjust the position and size of the item (window or
11221 subsizer) to be within that space taking alignment and borders into
11222 account.
11223 """
d55e5bfc
RD
11224 return _core_.SizerItem_SetDimension(*args, **kwargs)
11225
11226 def GetMinSize(*args, **kwargs):
248ed943
RD
11227 """
11228 GetMinSize(self) -> Size
11229
11230 Get the minimum size needed for the item.
11231 """
d55e5bfc
RD
11232 return _core_.SizerItem_GetMinSize(*args, **kwargs)
11233
a001823c
RD
11234 def GetMinSizeWithBorder(*args, **kwargs):
11235 """
11236 GetMinSizeWithBorder(self) -> Size
11237
11238 Get the minimum size needed for the item with space for the borders
11239 added, if needed.
11240 """
11241 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11242
d55e5bfc
RD
11243 def SetInitSize(*args, **kwargs):
11244 """SetInitSize(self, int x, int y)"""
11245 return _core_.SizerItem_SetInitSize(*args, **kwargs)
11246
11247 def SetRatioWH(*args, **kwargs):
248ed943
RD
11248 """
11249 SetRatioWH(self, int width, int height)
11250
11251 Set the ratio item attribute.
11252 """
d55e5bfc
RD
11253 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
11254
11255 def SetRatioSize(*args, **kwargs):
248ed943
RD
11256 """
11257 SetRatioSize(self, Size size)
11258
11259 Set the ratio item attribute.
11260 """
d55e5bfc
RD
11261 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
11262
11263 def SetRatio(*args, **kwargs):
248ed943
RD
11264 """
11265 SetRatio(self, float ratio)
11266
11267 Set the ratio item attribute.
11268 """
d55e5bfc
RD
11269 return _core_.SizerItem_SetRatio(*args, **kwargs)
11270
11271 def GetRatio(*args, **kwargs):
248ed943
RD
11272 """
11273 GetRatio(self) -> float
11274
11275 Set the ratio item attribute.
11276 """
d55e5bfc
RD
11277 return _core_.SizerItem_GetRatio(*args, **kwargs)
11278
c1cb24a4
RD
11279 def GetRect(*args, **kwargs):
11280 """
11281 GetRect(self) -> Rect
11282
11283 Returns the rectangle that the sizer item should occupy
11284 """
11285 return _core_.SizerItem_GetRect(*args, **kwargs)
11286
d55e5bfc 11287 def IsWindow(*args, **kwargs):
248ed943
RD
11288 """
11289 IsWindow(self) -> bool
11290
11291 Is this sizer item a window?
11292 """
d55e5bfc
RD
11293 return _core_.SizerItem_IsWindow(*args, **kwargs)
11294
11295 def IsSizer(*args, **kwargs):
248ed943
RD
11296 """
11297 IsSizer(self) -> bool
11298
11299 Is this sizer item a subsizer?
11300 """
d55e5bfc
RD
11301 return _core_.SizerItem_IsSizer(*args, **kwargs)
11302
11303 def IsSpacer(*args, **kwargs):
248ed943
RD
11304 """
11305 IsSpacer(self) -> bool
11306
11307 Is this sizer item a spacer?
11308 """
d55e5bfc
RD
11309 return _core_.SizerItem_IsSpacer(*args, **kwargs)
11310
11311 def SetProportion(*args, **kwargs):
248ed943
RD
11312 """
11313 SetProportion(self, int proportion)
11314
11315 Set the proportion value for this item.
11316 """
d55e5bfc
RD
11317 return _core_.SizerItem_SetProportion(*args, **kwargs)
11318
11319 def GetProportion(*args, **kwargs):
248ed943
RD
11320 """
11321 GetProportion(self) -> int
11322
11323 Get the proportion value for this item.
11324 """
d55e5bfc
RD
11325 return _core_.SizerItem_GetProportion(*args, **kwargs)
11326
248ed943
RD
11327 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11328 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 11329 def SetFlag(*args, **kwargs):
248ed943
RD
11330 """
11331 SetFlag(self, int flag)
11332
11333 Set the flag value for this item.
11334 """
d55e5bfc
RD
11335 return _core_.SizerItem_SetFlag(*args, **kwargs)
11336
11337 def GetFlag(*args, **kwargs):
248ed943
RD
11338 """
11339 GetFlag(self) -> int
11340
11341 Get the flag value for this item.
11342 """
d55e5bfc
RD
11343 return _core_.SizerItem_GetFlag(*args, **kwargs)
11344
11345 def SetBorder(*args, **kwargs):
248ed943
RD
11346 """
11347 SetBorder(self, int border)
11348
11349 Set the border value for this item.
11350 """
d55e5bfc
RD
11351 return _core_.SizerItem_SetBorder(*args, **kwargs)
11352
11353 def GetBorder(*args, **kwargs):
248ed943
RD
11354 """
11355 GetBorder(self) -> int
11356
11357 Get the border value for this item.
11358 """
d55e5bfc
RD
11359 return _core_.SizerItem_GetBorder(*args, **kwargs)
11360
11361 def GetWindow(*args, **kwargs):
248ed943
RD
11362 """
11363 GetWindow(self) -> Window
11364
11365 Get the window (if any) that is managed by this sizer item.
11366 """
d55e5bfc
RD
11367 return _core_.SizerItem_GetWindow(*args, **kwargs)
11368
11369 def SetWindow(*args, **kwargs):
248ed943
RD
11370 """
11371 SetWindow(self, Window window)
11372
11373 Set the window to be managed by this sizer item.
11374 """
d55e5bfc
RD
11375 return _core_.SizerItem_SetWindow(*args, **kwargs)
11376
11377 def GetSizer(*args, **kwargs):
248ed943
RD
11378 """
11379 GetSizer(self) -> Sizer
11380
11381 Get the subsizer (if any) that is managed by this sizer item.
11382 """
d55e5bfc
RD
11383 return _core_.SizerItem_GetSizer(*args, **kwargs)
11384
11385 def SetSizer(*args, **kwargs):
248ed943
RD
11386 """
11387 SetSizer(self, Sizer sizer)
11388
11389 Set the subsizer to be managed by this sizer item.
11390 """
d55e5bfc
RD
11391 return _core_.SizerItem_SetSizer(*args, **kwargs)
11392
11393 def GetSpacer(*args, **kwargs):
248ed943
RD
11394 """
11395 GetSpacer(self) -> Size
11396
11397 Get the size of the spacer managed by this sizer item.
11398 """
d55e5bfc
RD
11399 return _core_.SizerItem_GetSpacer(*args, **kwargs)
11400
11401 def SetSpacer(*args, **kwargs):
248ed943
RD
11402 """
11403 SetSpacer(self, Size size)
11404
11405 Set the size of the spacer to be managed by this sizer item.
11406 """
d55e5bfc
RD
11407 return _core_.SizerItem_SetSpacer(*args, **kwargs)
11408
11409 def Show(*args, **kwargs):
248ed943
RD
11410 """
11411 Show(self, bool show)
11412
11413 Set the show item attribute, which sizers use to determine if the item
11414 is to be made part of the layout or not. If the item is tracking a
11415 window then it is shown or hidden as needed.
11416 """
d55e5bfc
RD
11417 return _core_.SizerItem_Show(*args, **kwargs)
11418
11419 def IsShown(*args, **kwargs):
248ed943
RD
11420 """
11421 IsShown(self) -> bool
11422
11423 Is the item to be shown in the layout?
11424 """
d55e5bfc
RD
11425 return _core_.SizerItem_IsShown(*args, **kwargs)
11426
11427 def GetPosition(*args, **kwargs):
248ed943
RD
11428 """
11429 GetPosition(self) -> Point
11430
11431 Returns the current position of the item, as set in the last Layout.
11432 """
d55e5bfc
RD
11433 return _core_.SizerItem_GetPosition(*args, **kwargs)
11434
11435 def GetUserData(*args, **kwargs):
248ed943
RD
11436 """
11437 GetUserData(self) -> PyObject
11438
11439 Returns the userData associated with this sizer item, or None if there
11440 isn't any.
11441 """
d55e5bfc
RD
11442 return _core_.SizerItem_GetUserData(*args, **kwargs)
11443
11444
11445class SizerItemPtr(SizerItem):
11446 def __init__(self, this):
11447 self.this = this
11448 if not hasattr(self,"thisown"): self.thisown = 0
11449 self.__class__ = SizerItem
11450_core_.SizerItem_swigregister(SizerItemPtr)
11451
248ed943 11452def SizerItemWindow(*args, **kwargs):
d55e5bfc 11453 """
248ed943
RD
11454 SizerItemWindow(Window window, int proportion, int flag, int border,
11455 PyObject userData=None) -> SizerItem
11456
11457 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 11458 """
248ed943 11459 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
11460 val.thisown = 1
11461 return val
11462
248ed943 11463def SizerItemSpacer(*args, **kwargs):
d55e5bfc 11464 """
248ed943
RD
11465 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11466 PyObject userData=None) -> SizerItem
11467
11468 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 11469 """
248ed943 11470 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
11471 val.thisown = 1
11472 return val
11473
11474def SizerItemSizer(*args, **kwargs):
11475 """
11476 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
11477 PyObject userData=None) -> SizerItem
11478
11479 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc
RD
11480 """
11481 val = _core_.new_SizerItemSizer(*args, **kwargs)
11482 val.thisown = 1
11483 return val
11484
11485class Sizer(Object):
248ed943
RD
11486 """
11487 wx.Sizer is the abstract base class used for laying out subwindows in
11488 a window. You cannot use wx.Sizer directly; instead, you will have to
11489 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11490 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11491 and `wx.GridBagSizer`.
11492
11493 The concept implemented by sizers in wxWidgets is closely related to
11494 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11495 toolkit or the Qt toolkit. It is based upon the idea of the individual
11496 subwindows reporting their minimal required size and their ability to
11497 get stretched if the size of the parent window has changed. This will
11498 most often mean that the programmer does not set the original size of
11499 a dialog in the beginning, rather the dialog will assigned a sizer and
11500 this sizer will be queried about the recommended size. The sizer in
11501 turn will query its children, which can be normal windows or contorls,
11502 empty space or other sizers, so that a hierarchy of sizers can be
11503 constructed. Note that wxSizer does not derive from wxWindow and thus
11504 do not interfere with tab ordering and requires very little resources
11505 compared to a real window on screen.
11506
11507 What makes sizers so well fitted for use in wxWidgets is the fact that
11508 every control reports its own minimal size and the algorithm can
11509 handle differences in font sizes or different window (dialog item)
11510 sizes on different platforms without problems. If for example the
11511 standard font as well as the overall design of Mac widgets requires
11512 more space than on Windows, then the initial size of a dialog using a
11513 sizer will automatically be bigger on Mac than on Windows.
11514 """
d55e5bfc
RD
11515 def __init__(self): raise RuntimeError, "No constructor defined"
11516 def __repr__(self):
11517 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11518 def _setOORInfo(*args, **kwargs):
11519 """_setOORInfo(self, PyObject _self)"""
11520 return _core_.Sizer__setOORInfo(*args, **kwargs)
11521
11522 def Add(*args, **kwargs):
11523 """
248ed943 11524 Add(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11525 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11526
11527 Appends a child item to the sizer.
d55e5bfc
RD
11528 """
11529 return _core_.Sizer_Add(*args, **kwargs)
11530
11531 def Insert(*args, **kwargs):
11532 """
248ed943 11533 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11534 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11535
11536 Inserts a new item into the list of items managed by this sizer before
11537 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc
RD
11538 """
11539 return _core_.Sizer_Insert(*args, **kwargs)
11540
11541 def Prepend(*args, **kwargs):
11542 """
248ed943 11543 Prepend(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11544 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11545
11546 Adds a new item to the begining of the list of sizer items managed by
11547 this sizer. See `Add` for a description of the parameters.
d55e5bfc
RD
11548 """
11549 return _core_.Sizer_Prepend(*args, **kwargs)
11550
11551 def Remove(*args, **kwargs):
248ed943
RD
11552 """
11553 Remove(self, item) -> bool
11554
11555 Removes an item from the sizer and destroys it. This method does not
11556 cause any layout or resizing to take place, call `Layout` to update
11557 the layout on screen after removing a child from the sizer. The
11558 *item* parameter can be either a window, a sizer, or the zero-based
11559 index of an item to remove. Returns True if the child item was found
11560 and removed.
11561 """
d55e5bfc
RD
11562 return _core_.Sizer_Remove(*args, **kwargs)
11563
1a6bba1e 11564 def Detach(*args, **kwargs):
248ed943
RD
11565 """
11566 Detach(self, item) -> bool
11567
11568 Detaches an item from the sizer without destroying it. This method
11569 does not cause any layout or resizing to take place, call `Layout` to
11570 do so. The *item* parameter can be either a window, a sizer, or the
11571 zero-based index of the item to be detached. Returns True if the child item
11572 was found and detached.
11573 """
1a6bba1e
RD
11574 return _core_.Sizer_Detach(*args, **kwargs)
11575
c1cb24a4
RD
11576 def GetItem(*args, **kwargs):
11577 """
11578 GetItem(self, item) -> wx.SizerItem
11579
11580 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11581 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11582 the item to be found.
c1cb24a4
RD
11583 """
11584 return _core_.Sizer_GetItem(*args, **kwargs)
11585
d55e5bfc
RD
11586 def _SetItemMinSize(*args, **kwargs):
11587 """_SetItemMinSize(self, PyObject item, Size size)"""
11588 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11589
248ed943
RD
11590 def SetItemMinSize(self, item, *args):
11591 """
11592 SetItemMinSize(self, item, Size size)
11593
11594 Sets the minimum size that will be allocated for an item in the sizer.
11595 The *item* parameter can be either a window, a sizer, or the
11596 zero-based index of the item. If a window or sizer is given then it
11597 will be searched for recursivly in subsizers if neccessary.
11598 """
11599 if len(args) == 2:
11600 # for backward compatibility accept separate width,height args too
11601 return self._SetItemMinSize(item, args)
11602 else:
11603 return self._SetItemMinSize(item, args[0])
11604
d55e5bfc 11605 def AddItem(*args, **kwargs):
248ed943
RD
11606 """
11607 AddItem(self, SizerItem item)
11608
11609 Adds a `wx.SizerItem` to the sizer.
11610 """
d55e5bfc
RD
11611 return _core_.Sizer_AddItem(*args, **kwargs)
11612
11613 def InsertItem(*args, **kwargs):
248ed943
RD
11614 """
11615 InsertItem(self, int index, SizerItem item)
11616
11617 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11618 """
d55e5bfc
RD
11619 return _core_.Sizer_InsertItem(*args, **kwargs)
11620
11621 def PrependItem(*args, **kwargs):
248ed943
RD
11622 """
11623 PrependItem(self, SizerItem item)
11624
11625 Prepends a `wx.SizerItem` to the sizer.
11626 """
d55e5bfc
RD
11627 return _core_.Sizer_PrependItem(*args, **kwargs)
11628
248ed943 11629 def AddMany(self, items):
c24da6d6
RD
11630 """
11631 AddMany is a convenience method for adding several items
11632 to a sizer at one time. Simply pass it a list of tuples,
11633 where each tuple consists of the parameters that you
11634 would normally pass to the `Add` method.
11635 """
248ed943
RD
11636 for item in items:
11637 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11638 item = (item, )
11639 self.Add(*item)
d55e5bfc
RD
11640
11641 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11642 def AddWindow(self, *args, **kw):
11643 """Compatibility alias for `Add`."""
11644 return self.Add(*args, **kw)
11645 def AddSizer(self, *args, **kw):
11646 """Compatibility alias for `Add`."""
11647 return self.Add(*args, **kw)
11648 def AddSpacer(self, *args, **kw):
11649 """Compatibility alias for `Add`."""
11650 return self.Add(*args, **kw)
11651
11652 def PrependWindow(self, *args, **kw):
11653 """Compatibility alias for `Prepend`."""
11654 return self.Prepend(*args, **kw)
11655 def PrependSizer(self, *args, **kw):
11656 """Compatibility alias for `Prepend`."""
11657 return self.Prepend(*args, **kw)
11658 def PrependSpacer(self, *args, **kw):
11659 """Compatibility alias for `Prepend`."""
11660 return self.Prepend(*args, **kw)
11661
11662 def InsertWindow(self, *args, **kw):
11663 """Compatibility alias for `Insert`."""
11664 return self.Insert(*args, **kw)
11665 def InsertSizer(self, *args, **kw):
11666 """Compatibility alias for `Insert`."""
11667 return self.Insert(*args, **kw)
11668 def InsertSpacer(self, *args, **kw):
11669 """Compatibility alias for `Insert`."""
11670 return self.Insert(*args, **kw)
11671
11672 def RemoveWindow(self, *args, **kw):
11673 """Compatibility alias for `Remove`."""
11674 return self.Remove(*args, **kw)
11675 def RemoveSizer(self, *args, **kw):
11676 """Compatibility alias for `Remove`."""
11677 return self.Remove(*args, **kw)
11678 def RemovePos(self, *args, **kw):
11679 """Compatibility alias for `Remove`."""
11680 return self.Remove(*args, **kw)
d55e5bfc
RD
11681
11682
d55e5bfc 11683 def SetDimension(*args, **kwargs):
248ed943
RD
11684 """
11685 SetDimension(self, int x, int y, int width, int height)
11686
11687 Call this to force the sizer to take the given dimension and thus
11688 force the items owned by the sizer to resize themselves according to
11689 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11690 methods.
11691 """
d55e5bfc
RD
11692 return _core_.Sizer_SetDimension(*args, **kwargs)
11693
11694 def SetMinSize(*args, **kwargs):
248ed943
RD
11695 """
11696 SetMinSize(self, Size size)
11697
11698 Call this to give the sizer a minimal size. Normally, the sizer will
11699 calculate its minimal size based purely on how much space its children
11700 need. After calling this method `GetMinSize` will return either the
11701 minimal size as requested by its children or the minimal size set
11702 here, depending on which is bigger.
11703 """
d55e5bfc
RD
11704 return _core_.Sizer_SetMinSize(*args, **kwargs)
11705
11706 def GetSize(*args, **kwargs):
248ed943
RD
11707 """
11708 GetSize(self) -> Size
11709
11710 Returns the current size of the space managed by the sizer.
11711 """
d55e5bfc
RD
11712 return _core_.Sizer_GetSize(*args, **kwargs)
11713
11714 def GetPosition(*args, **kwargs):
248ed943
RD
11715 """
11716 GetPosition(self) -> Point
11717
11718 Returns the current position of the sizer's managed space.
11719 """
d55e5bfc
RD
11720 return _core_.Sizer_GetPosition(*args, **kwargs)
11721
11722 def GetMinSize(*args, **kwargs):
248ed943
RD
11723 """
11724 GetMinSize(self) -> Size
11725
11726 Returns the minimal size of the sizer. This is either the combined
11727 minimal size of all the children and their borders or the minimal size
11728 set by SetMinSize, depending on which is bigger.
11729 """
d55e5bfc
RD
11730 return _core_.Sizer_GetMinSize(*args, **kwargs)
11731
11732 def GetSizeTuple(self):
1a6bba1e 11733 return self.GetSize().Get()
d55e5bfc 11734 def GetPositionTuple(self):
1a6bba1e 11735 return self.GetPosition().Get()
d55e5bfc 11736 def GetMinSizeTuple(self):
1a6bba1e 11737 return self.GetMinSize().Get()
d55e5bfc
RD
11738
11739 def RecalcSizes(*args, **kwargs):
248ed943
RD
11740 """
11741 RecalcSizes(self)
11742
11743 Using the sizes calculated by `CalcMin` reposition and resize all the
11744 items managed by this sizer. You should not need to call this directly as
11745 it is called by `Layout`.
11746 """
d55e5bfc
RD
11747 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11748
11749 def CalcMin(*args, **kwargs):
248ed943
RD
11750 """
11751 CalcMin(self) -> Size
11752
11753 This method is where the sizer will do the actual calculation of its
11754 children's minimal sizes. You should not need to call this directly as
11755 it is called by `Layout`.
11756 """
d55e5bfc
RD
11757 return _core_.Sizer_CalcMin(*args, **kwargs)
11758
11759 def Layout(*args, **kwargs):
248ed943
RD
11760 """
11761 Layout(self)
11762
11763 This method will force the recalculation and layout of the items
11764 controlled by the sizer using the current space allocated to the
11765 sizer. Normally this is called automatically from the owning window's
11766 EVT_SIZE handler, but it is also useful to call it from user code when
11767 one of the items in a sizer change size, or items are added or
11768 removed.
11769 """
d55e5bfc
RD
11770 return _core_.Sizer_Layout(*args, **kwargs)
11771
11772 def Fit(*args, **kwargs):
248ed943
RD
11773 """
11774 Fit(self, Window window) -> Size
11775
11776 Tell the sizer to resize the *window* to match the sizer's minimal
11777 size. This is commonly done in the constructor of the window itself in
11778 order to set its initial size to match the needs of the children as
11779 determined by the sizer. Returns the new size.
11780
11781 For a top level window this is the total window size, not the client size.
11782 """
d55e5bfc
RD
11783 return _core_.Sizer_Fit(*args, **kwargs)
11784
11785 def FitInside(*args, **kwargs):
248ed943
RD
11786 """
11787 FitInside(self, Window window)
11788
11789 Tell the sizer to resize the *virtual size* of the *window* to match the
11790 sizer's minimal size. This will not alter the on screen size of the
11791 window, but may cause the addition/removal/alteration of scrollbars
11792 required to view the virtual area in windows which manage it.
11793
11794 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11795
11796 """
d55e5bfc
RD
11797 return _core_.Sizer_FitInside(*args, **kwargs)
11798
11799 def SetSizeHints(*args, **kwargs):
248ed943
RD
11800 """
11801 SetSizeHints(self, Window window)
11802
11803 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11804 match the sizer's minimal size. This is commonly done in the
11805 constructor of the window itself if the window is resizable (as are
11806 many dialogs under Unix and frames on probably all platforms) in order
11807 to prevent the window from being sized smaller than the minimal size
11808 required by the sizer.
11809 """
d55e5bfc
RD
11810 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11811
11812 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
11813 """
11814 SetVirtualSizeHints(self, Window window)
11815
11816 Tell the sizer to set the minimal size of the window virtual area to
11817 match the sizer's minimal size. For windows with managed scrollbars
11818 this will set them appropriately.
11819
11820 :see: `wx.ScrolledWindow.SetScrollbars`
11821
11822 """
d55e5bfc
RD
11823 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11824
11825 def Clear(*args, **kwargs):
248ed943
RD
11826 """
11827 Clear(self, bool deleteWindows=False)
11828
11829 Clear all items from the sizer, optionally destroying the window items
11830 as well.
11831 """
d55e5bfc
RD
11832 return _core_.Sizer_Clear(*args, **kwargs)
11833
11834 def DeleteWindows(*args, **kwargs):
248ed943
RD
11835 """
11836 DeleteWindows(self)
11837
11838 Destroy all windows managed by the sizer.
11839 """
d55e5bfc
RD
11840 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11841
11842 def GetChildren(*args, **kwargs):
248ed943 11843 """
51b83b37 11844 GetChildren(self) -> list
248ed943
RD
11845
11846 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11847 """
d55e5bfc
RD
11848 return _core_.Sizer_GetChildren(*args, **kwargs)
11849
11850 def Show(*args, **kwargs):
248ed943 11851 """
ae8162c8 11852 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 11853
248ed943
RD
11854 Shows or hides an item managed by the sizer. To make a sizer item
11855 disappear or reappear, use Show followed by `Layout`. The *item*
11856 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
11857 the item. Use the recursive parameter to show or hide an item in a
11858 subsizer. Returns True if the item was found.
248ed943
RD
11859 """
11860 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
11861
11862 def IsShown(*args, **kwargs):
248ed943
RD
11863 """
11864 IsShown(self, item)
11865
11866 Determines if the item is currently shown. sizer. To make a sizer
11867 item disappear or reappear, use Show followed by `Layout`. The *item*
11868 parameter can be either a window, a sizer, or the zero-based index of
11869 the item.
11870 """
d55e5bfc
RD
11871 return _core_.Sizer_IsShown(*args, **kwargs)
11872
629e65c2 11873 def Hide(self, item, recursive=False):
248ed943 11874 """
27fb7603 11875 A convenience method for `Show` (item, False, recursive).
248ed943 11876 """
06759a38 11877 return self.Show(item, False, recursive)
248ed943 11878
d55e5bfc 11879 def ShowItems(*args, **kwargs):
248ed943
RD
11880 """
11881 ShowItems(self, bool show)
11882
84f85550 11883 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 11884 """
d55e5bfc
RD
11885 return _core_.Sizer_ShowItems(*args, **kwargs)
11886
11887
11888class SizerPtr(Sizer):
11889 def __init__(self, this):
11890 self.this = this
11891 if not hasattr(self,"thisown"): self.thisown = 0
11892 self.__class__ = Sizer
11893_core_.Sizer_swigregister(SizerPtr)
11894
11895class PySizer(Sizer):
248ed943
RD
11896 """
11897 wx.PySizer is a special version of `wx.Sizer` that has been
11898 instrumented to allow the C++ virtual methods to be overloaded in
11899 Python derived classes. You would derive from this class if you are
11900 wanting to implement a custom sizer in Python code. Simply implement
11901 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11902 For example::
11903
11904 class MySizer(wx.PySizer):
11905 def __init__(self):
11906 wx.PySizer.__init__(self)
11907
11908 def CalcMin(self):
11909 for item in self.GetChildren():
11910 # calculate the total minimum width and height needed
11911 # by all items in the sizer according to this sizer's
11912 # layout algorithm.
11913 ...
11914 return wx.Size(width, height)
11915
11916 def RecalcSizes(self):
11917 # find the space allotted to this sizer
11918 pos = self.GetPosition()
11919 size = self.GetSize()
11920 for item in self.GetChildren():
11921 # Recalculate (if necessary) the position and size of
11922 # each item and then call item.SetDimension to do the
11923 # actual positioning and sizing of the items within the
11924 # space alloted to this sizer.
11925 ...
11926 item.SetDimension(itemPos, itemSize)
11927
11928
11929 When `Layout` is called it first calls `CalcMin` followed by
11930 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 11931 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
11932
11933 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11934
11935
11936 """
d55e5bfc
RD
11937 def __repr__(self):
11938 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11939 def __init__(self, *args, **kwargs):
248ed943
RD
11940 """
11941 __init__(self) -> PySizer
11942
11943 Creates a wx.PySizer. Must be called from the __init__ in the derived
11944 class.
11945 """
d55e5bfc
RD
11946 newobj = _core_.new_PySizer(*args, **kwargs)
11947 self.this = newobj.this
11948 self.thisown = 1
11949 del newobj.thisown
11950 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11951
11952 def _setCallbackInfo(*args, **kwargs):
11953 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11954 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11955
11956
11957class PySizerPtr(PySizer):
11958 def __init__(self, this):
11959 self.this = this
11960 if not hasattr(self,"thisown"): self.thisown = 0
11961 self.__class__ = PySizer
11962_core_.PySizer_swigregister(PySizerPtr)
11963
11964#---------------------------------------------------------------------------
11965
11966class BoxSizer(Sizer):
248ed943
RD
11967 """
11968 The basic idea behind a box sizer is that windows will most often be
11969 laid out in rather simple basic geometry, typically in a row or a
11970 column or nested hierarchies of either. A wx.BoxSizer will lay out
11971 its items in a simple row or column, depending on the orientation
11972 parameter passed to the constructor.
11973 """
d55e5bfc
RD
11974 def __repr__(self):
11975 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11976 def __init__(self, *args, **kwargs):
248ed943
RD
11977 """
11978 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11979
11980 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11981 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11982 sizer.
11983 """
d55e5bfc
RD
11984 newobj = _core_.new_BoxSizer(*args, **kwargs)
11985 self.this = newobj.this
11986 self.thisown = 1
11987 del newobj.thisown
11988 self._setOORInfo(self)
11989
11990 def GetOrientation(*args, **kwargs):
248ed943
RD
11991 """
11992 GetOrientation(self) -> int
11993
11994 Returns the current orientation of the sizer.
11995 """
d55e5bfc
RD
11996 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11997
11998 def SetOrientation(*args, **kwargs):
248ed943
RD
11999 """
12000 SetOrientation(self, int orient)
d55e5bfc 12001
248ed943
RD
12002 Resets the orientation of the sizer.
12003 """
12004 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc
RD
12005
12006
12007class BoxSizerPtr(BoxSizer):
12008 def __init__(self, this):
12009 self.this = this
12010 if not hasattr(self,"thisown"): self.thisown = 0
12011 self.__class__ = BoxSizer
12012_core_.BoxSizer_swigregister(BoxSizerPtr)
12013
12014#---------------------------------------------------------------------------
12015
12016class StaticBoxSizer(BoxSizer):
248ed943
RD
12017 """
12018 wx.StaticBoxSizer derives from and functions identically to the
12019 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12020 manages. Note that this static box must be created separately and
12021 passed to the sizer constructor.
12022 """
d55e5bfc
RD
12023 def __repr__(self):
12024 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12025 def __init__(self, *args, **kwargs):
248ed943
RD
12026 """
12027 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12028
12029 Constructor. It takes an associated static box and the orientation
12030 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12031 ``wx.HORIZONTAL``.
12032 """
d55e5bfc
RD
12033 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
12034 self.this = newobj.this
12035 self.thisown = 1
12036 del newobj.thisown
12037 self._setOORInfo(self)
12038
12039 def GetStaticBox(*args, **kwargs):
248ed943
RD
12040 """
12041 GetStaticBox(self) -> StaticBox
d55e5bfc 12042
248ed943
RD
12043 Returns the static box associated with this sizer.
12044 """
12045 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc
RD
12046
12047
12048class StaticBoxSizerPtr(StaticBoxSizer):
12049 def __init__(self, this):
12050 self.this = this
12051 if not hasattr(self,"thisown"): self.thisown = 0
12052 self.__class__ = StaticBoxSizer
12053_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
12054
12055#---------------------------------------------------------------------------
12056
12057class GridSizer(Sizer):
248ed943
RD
12058 """
12059 A grid sizer is a sizer which lays out its children in a
12060 two-dimensional table with all cells having the same size. In other
12061 words, the width of each cell within the grid is the width of the
12062 widest item added to the sizer and the height of each grid cell is the
12063 height of the tallest item. An optional vertical and/or horizontal
12064 gap between items can also be specified (in pixels.)
12065
12066 Items are placed in the cells of the grid in the order they are added,
12067 in row-major order. In other words, the first row is filled first,
12068 then the second, and so on until all items have been added. (If
12069 neccessary, additional rows will be added as items are added.) If you
12070 need to have greater control over the cells that items are placed in
12071 then use the `wx.GridBagSizer`.
12072
12073 """
d55e5bfc
RD
12074 def __repr__(self):
12075 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12076 def __init__(self, *args, **kwargs):
248ed943
RD
12077 """
12078 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12079
12080 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12081 of columns and rows in the sizer - if either of the parameters is
12082 zero, it will be calculated to from the total number of children in
12083 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12084 define extra space between all children.
12085 """
d55e5bfc
RD
12086 newobj = _core_.new_GridSizer(*args, **kwargs)
12087 self.this = newobj.this
12088 self.thisown = 1
12089 del newobj.thisown
12090 self._setOORInfo(self)
12091
d55e5bfc 12092 def SetCols(*args, **kwargs):
248ed943
RD
12093 """
12094 SetCols(self, int cols)
12095
12096 Sets the number of columns in the sizer.
12097 """
d55e5bfc
RD
12098 return _core_.GridSizer_SetCols(*args, **kwargs)
12099
12100 def SetRows(*args, **kwargs):
248ed943
RD
12101 """
12102 SetRows(self, int rows)
12103
12104 Sets the number of rows in the sizer.
12105 """
d55e5bfc
RD
12106 return _core_.GridSizer_SetRows(*args, **kwargs)
12107
12108 def SetVGap(*args, **kwargs):
248ed943
RD
12109 """
12110 SetVGap(self, int gap)
12111
12112 Sets the vertical gap (in pixels) between the cells in the sizer.
12113 """
d55e5bfc
RD
12114 return _core_.GridSizer_SetVGap(*args, **kwargs)
12115
12116 def SetHGap(*args, **kwargs):
248ed943
RD
12117 """
12118 SetHGap(self, int gap)
12119
12120 Sets the horizontal gap (in pixels) between cells in the sizer
12121 """
d55e5bfc
RD
12122 return _core_.GridSizer_SetHGap(*args, **kwargs)
12123
12124 def GetCols(*args, **kwargs):
248ed943
RD
12125 """
12126 GetCols(self) -> int
12127
12128 Returns the number of columns in the sizer.
12129 """
d55e5bfc
RD
12130 return _core_.GridSizer_GetCols(*args, **kwargs)
12131
12132 def GetRows(*args, **kwargs):
248ed943
RD
12133 """
12134 GetRows(self) -> int
12135
12136 Returns the number of rows in the sizer.
12137 """
d55e5bfc
RD
12138 return _core_.GridSizer_GetRows(*args, **kwargs)
12139
12140 def GetVGap(*args, **kwargs):
248ed943
RD
12141 """
12142 GetVGap(self) -> int
12143
12144 Returns the vertical gap (in pixels) between the cells in the sizer.
12145 """
d55e5bfc
RD
12146 return _core_.GridSizer_GetVGap(*args, **kwargs)
12147
12148 def GetHGap(*args, **kwargs):
248ed943
RD
12149 """
12150 GetHGap(self) -> int
12151
12152 Returns the horizontal gap (in pixels) between cells in the sizer.
12153 """
d55e5bfc
RD
12154 return _core_.GridSizer_GetHGap(*args, **kwargs)
12155
12156
12157class GridSizerPtr(GridSizer):
12158 def __init__(self, this):
12159 self.this = this
12160 if not hasattr(self,"thisown"): self.thisown = 0
12161 self.__class__ = GridSizer
12162_core_.GridSizer_swigregister(GridSizerPtr)
12163
12164#---------------------------------------------------------------------------
12165
12166FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12167FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12168FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12169class FlexGridSizer(GridSizer):
248ed943
RD
12170 """
12171 A flex grid sizer is a sizer which lays out its children in a
12172 two-dimensional table with all table cells in one row having the same
12173 height and all cells in one column having the same width, but all
12174 rows or all columns are not necessarily the same height or width as in
12175 the `wx.GridSizer`.
12176
12177 wx.FlexGridSizer can also size items equally in one direction but
12178 unequally ("flexibly") in the other. If the sizer is only flexible
12179 in one direction (this can be changed using `SetFlexibleDirection`), it
12180 needs to be decided how the sizer should grow in the other ("non
12181 flexible") direction in order to fill the available space. The
12182 `SetNonFlexibleGrowMode` method serves this purpose.
12183
12184
12185 """
d55e5bfc
RD
12186 def __repr__(self):
12187 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12188 def __init__(self, *args, **kwargs):
248ed943
RD
12189 """
12190 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12191
12192 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12193 number of columns and rows in the sizer - if either of the parameters
12194 is zero, it will be calculated to from the total number of children in
12195 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12196 define extra space between all children.
12197 """
d55e5bfc
RD
12198 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
12199 self.this = newobj.this
12200 self.thisown = 1
12201 del newobj.thisown
12202 self._setOORInfo(self)
12203
248ed943
RD
12204 def AddGrowableRow(*args, **kwargs):
12205 """
12206 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 12207
248ed943
RD
12208 Specifies that row *idx* (starting from zero) should be grown if there
12209 is extra space available to the sizer.
d55e5bfc 12210
248ed943
RD
12211 The *proportion* parameter has the same meaning as the stretch factor
12212 for the box sizers except that if all proportions are 0, then all
12213 columns are resized equally (instead of not being resized at all).
12214 """
d55e5bfc
RD
12215 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
12216
12217 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
12218 """
12219 RemoveGrowableRow(self, size_t idx)
12220
12221 Specifies that row *idx* is no longer growable.
12222 """
d55e5bfc
RD
12223 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
12224
12225 def AddGrowableCol(*args, **kwargs):
248ed943
RD
12226 """
12227 AddGrowableCol(self, size_t idx, int proportion=0)
12228
12229 Specifies that column *idx* (starting from zero) should be grown if
12230 there is extra space available to the sizer.
12231
12232 The *proportion* parameter has the same meaning as the stretch factor
12233 for the box sizers except that if all proportions are 0, then all
12234 columns are resized equally (instead of not being resized at all).
12235 """
d55e5bfc
RD
12236 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
12237
12238 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
12239 """
12240 RemoveGrowableCol(self, size_t idx)
12241
12242 Specifies that column *idx* is no longer growable.
12243 """
d55e5bfc
RD
12244 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
12245
12246 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
12247 """
12248 SetFlexibleDirection(self, int direction)
12249
12250 Specifies whether the sizer should flexibly resize its columns, rows,
12251 or both. Argument *direction* can be one of the following values. Any
12252 other value is ignored.
12253
12254 ============== =======================================
12255 wx.VERTICAL Rows are flexibly sized.
12256 wx.HORIZONTAL Columns are flexibly sized.
12257 wx.BOTH Both rows and columns are flexibly sized
12258 (this is the default value).
12259 ============== =======================================
12260
12261 Note that this method does not trigger relayout.
12262
12263 """
d55e5bfc
RD
12264 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
12265
12266 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
12267 """
12268 GetFlexibleDirection(self) -> int
12269
12270 Returns a value that specifies whether the sizer
12271 flexibly resizes its columns, rows, or both (default).
12272
12273 :see: `SetFlexibleDirection`
12274 """
d55e5bfc
RD
12275 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
12276
12277 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12278 """
12279 SetNonFlexibleGrowMode(self, int mode)
12280
12281 Specifies how the sizer should grow in the non-flexible direction if
12282 there is one (so `SetFlexibleDirection` must have been called
12283 previously). Argument *mode* can be one of the following values:
12284
12285 ========================== =================================================
12286 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12287 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12288 `AddGrowableCol` and `AddGrowableRow`. In this
12289 case equal sizing applies to minimum sizes of
12290 columns or rows (this is the default value).
12291 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12292 the non flexible direction, whether they are
12293 growable or not in the flexbile direction.
12294 ========================== =================================================
12295
12296 Note that this method does not trigger relayout.
12297
12298
12299 """
d55e5bfc
RD
12300 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
12301
12302 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12303 """
12304 GetNonFlexibleGrowMode(self) -> int
12305
12306 Returns the value that specifies how the sizer grows in the
12307 non-flexible direction if there is one.
12308
12309 :see: `SetNonFlexibleGrowMode`
12310 """
d55e5bfc
RD
12311 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
12312
12313 def GetRowHeights(*args, **kwargs):
a8eff060
RD
12314 """
12315 GetRowHeights(self) -> list
12316
12317 Returns a list of integers representing the heights of each of the
12318 rows in the sizer.
12319 """
d55e5bfc
RD
12320 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
12321
12322 def GetColWidths(*args, **kwargs):
a8eff060
RD
12323 """
12324 GetColWidths(self) -> list
12325
12326 Returns a list of integers representing the widths of each of the
12327 columns in the sizer.
12328 """
d55e5bfc
RD
12329 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
12330
12331
12332class FlexGridSizerPtr(FlexGridSizer):
12333 def __init__(self, this):
12334 self.this = this
12335 if not hasattr(self,"thisown"): self.thisown = 0
12336 self.__class__ = FlexGridSizer
12337_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
12338
62d32a5f
RD
12339class StdDialogButtonSizer(BoxSizer):
12340 """
12341 A special sizer that knows how to order and position standard buttons
12342 in order to conform to the current platform's standards. You simply
12343 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12344 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
12345 will take care of the rest.
12346
12347 """
12348 def __repr__(self):
12349 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12350 def __init__(self, *args, **kwargs):
12351 """__init__(self) -> StdDialogButtonSizer"""
12352 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
12353 self.this = newobj.this
12354 self.thisown = 1
12355 del newobj.thisown
12356 def AddButton(*args, **kwargs):
12357 """
12358 AddButton(self, wxButton button)
12359
12360 Use this to add the buttons to this sizer. Do not use the `Add`
12361 method in the base class.
12362 """
12363 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12364
53aa7709 12365 def Realize(*args, **kwargs):
62d32a5f 12366 """
53aa7709 12367 Realize(self)
62d32a5f
RD
12368
12369 This funciton needs to be called after all the buttons have been added
12370 to the sizer. It will reorder them and position them in a platform
12371 specifc manner.
12372 """
53aa7709 12373 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12374
12375 def SetAffirmativeButton(*args, **kwargs):
12376 """SetAffirmativeButton(self, wxButton button)"""
12377 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12378
12379 def SetNegativeButton(*args, **kwargs):
12380 """SetNegativeButton(self, wxButton button)"""
12381 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12382
12383 def SetCancelButton(*args, **kwargs):
12384 """SetCancelButton(self, wxButton button)"""
12385 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
12386
12387 def GetAffirmativeButton(*args, **kwargs):
12388 """GetAffirmativeButton(self) -> wxButton"""
12389 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12390
12391 def GetApplyButton(*args, **kwargs):
12392 """GetApplyButton(self) -> wxButton"""
12393 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12394
12395 def GetNegativeButton(*args, **kwargs):
12396 """GetNegativeButton(self) -> wxButton"""
12397 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12398
12399 def GetCancelButton(*args, **kwargs):
12400 """GetCancelButton(self) -> wxButton"""
12401 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12402
12403 def GetHelpButton(*args, **kwargs):
12404 """GetHelpButton(self) -> wxButton"""
12405 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12406
12407
12408class StdDialogButtonSizerPtr(StdDialogButtonSizer):
12409 def __init__(self, this):
12410 self.this = this
12411 if not hasattr(self,"thisown"): self.thisown = 0
12412 self.__class__ = StdDialogButtonSizer
12413_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
12414
d55e5bfc
RD
12415#---------------------------------------------------------------------------
12416
12417class GBPosition(object):
248ed943
RD
12418 """
12419 This class represents the position of an item in a virtual grid of
12420 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12421 typemaps that will automatically convert from a 2-element sequence of
12422 integers to a wx.GBPosition, so you can use the more pythonic
12423 representation of the position nearly transparently in Python code.
12424 """
d55e5bfc
RD
12425 def __repr__(self):
12426 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12427 def __init__(self, *args, **kwargs):
248ed943
RD
12428 """
12429 __init__(self, int row=0, int col=0) -> GBPosition
12430
12431 This class represents the position of an item in a virtual grid of
12432 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12433 typemaps that will automatically convert from a 2-element sequence of
12434 integers to a wx.GBPosition, so you can use the more pythonic
12435 representation of the position nearly transparently in Python code.
12436 """
d55e5bfc
RD
12437 newobj = _core_.new_GBPosition(*args, **kwargs)
12438 self.this = newobj.this
12439 self.thisown = 1
12440 del newobj.thisown
12441 def GetRow(*args, **kwargs):
12442 """GetRow(self) -> int"""
12443 return _core_.GBPosition_GetRow(*args, **kwargs)
12444
12445 def GetCol(*args, **kwargs):
12446 """GetCol(self) -> int"""
12447 return _core_.GBPosition_GetCol(*args, **kwargs)
12448
12449 def SetRow(*args, **kwargs):
12450 """SetRow(self, int row)"""
12451 return _core_.GBPosition_SetRow(*args, **kwargs)
12452
12453 def SetCol(*args, **kwargs):
12454 """SetCol(self, int col)"""
12455 return _core_.GBPosition_SetCol(*args, **kwargs)
12456
12457 def __eq__(*args, **kwargs):
12458 """__eq__(self, GBPosition other) -> bool"""
12459 return _core_.GBPosition___eq__(*args, **kwargs)
12460
12461 def __ne__(*args, **kwargs):
12462 """__ne__(self, GBPosition other) -> bool"""
12463 return _core_.GBPosition___ne__(*args, **kwargs)
12464
12465 def Set(*args, **kwargs):
12466 """Set(self, int row=0, int col=0)"""
12467 return _core_.GBPosition_Set(*args, **kwargs)
12468
12469 def Get(*args, **kwargs):
12470 """Get(self) -> PyObject"""
12471 return _core_.GBPosition_Get(*args, **kwargs)
12472
79fccf9d 12473 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12474 def __str__(self): return str(self.Get())
12475 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12476 def __len__(self): return len(self.Get())
12477 def __getitem__(self, index): return self.Get()[index]
12478 def __setitem__(self, index, val):
12479 if index == 0: self.SetRow(val)
12480 elif index == 1: self.SetCol(val)
12481 else: raise IndexError
12482 def __nonzero__(self): return self.Get() != (0,0)
12483 __safe_for_unpickling__ = True
12484 def __reduce__(self): return (wx.GBPosition, self.Get())
12485
12486 row = property(GetRow, SetRow)
12487 col = property(GetCol, SetCol)
12488
12489
12490class GBPositionPtr(GBPosition):
12491 def __init__(self, this):
12492 self.this = this
12493 if not hasattr(self,"thisown"): self.thisown = 0
12494 self.__class__ = GBPosition
12495_core_.GBPosition_swigregister(GBPositionPtr)
12496
12497class GBSpan(object):
248ed943
RD
12498 """
12499 This class is used to hold the row and column spanning attributes of
12500 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12501 automatically convert from a 2-element sequence of integers to a
12502 wx.GBSpan, so you can use the more pythonic representation of the span
12503 nearly transparently in Python code.
12504
12505 """
d55e5bfc
RD
12506 def __repr__(self):
12507 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12508 def __init__(self, *args, **kwargs):
248ed943
RD
12509 """
12510 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12511
12512 Construct a new wxGBSpan, optionally setting the rowspan and
12513 colspan. The default is (1,1). (Meaning that the item occupies one
12514 cell in each direction.
12515 """
d55e5bfc
RD
12516 newobj = _core_.new_GBSpan(*args, **kwargs)
12517 self.this = newobj.this
12518 self.thisown = 1
12519 del newobj.thisown
12520 def GetRowspan(*args, **kwargs):
12521 """GetRowspan(self) -> int"""
12522 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12523
12524 def GetColspan(*args, **kwargs):
12525 """GetColspan(self) -> int"""
12526 return _core_.GBSpan_GetColspan(*args, **kwargs)
12527
12528 def SetRowspan(*args, **kwargs):
12529 """SetRowspan(self, int rowspan)"""
12530 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12531
12532 def SetColspan(*args, **kwargs):
12533 """SetColspan(self, int colspan)"""
12534 return _core_.GBSpan_SetColspan(*args, **kwargs)
12535
12536 def __eq__(*args, **kwargs):
12537 """__eq__(self, GBSpan other) -> bool"""
12538 return _core_.GBSpan___eq__(*args, **kwargs)
12539
12540 def __ne__(*args, **kwargs):
12541 """__ne__(self, GBSpan other) -> bool"""
12542 return _core_.GBSpan___ne__(*args, **kwargs)
12543
12544 def Set(*args, **kwargs):
12545 """Set(self, int rowspan=1, int colspan=1)"""
12546 return _core_.GBSpan_Set(*args, **kwargs)
12547
12548 def Get(*args, **kwargs):
12549 """Get(self) -> PyObject"""
12550 return _core_.GBSpan_Get(*args, **kwargs)
12551
79fccf9d 12552 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12553 def __str__(self): return str(self.Get())
12554 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12555 def __len__(self): return len(self.Get())
12556 def __getitem__(self, index): return self.Get()[index]
12557 def __setitem__(self, index, val):
12558 if index == 0: self.SetRowspan(val)
12559 elif index == 1: self.SetColspan(val)
12560 else: raise IndexError
12561 def __nonzero__(self): return self.Get() != (0,0)
12562 __safe_for_unpickling__ = True
12563 def __reduce__(self): return (wx.GBSpan, self.Get())
12564
12565 rowspan = property(GetRowspan, SetRowspan)
12566 colspan = property(GetColspan, SetColspan)
12567
12568
12569class GBSpanPtr(GBSpan):
12570 def __init__(self, this):
12571 self.this = this
12572 if not hasattr(self,"thisown"): self.thisown = 0
12573 self.__class__ = GBSpan
12574_core_.GBSpan_swigregister(GBSpanPtr)
12575
12576class GBSizerItem(SizerItem):
248ed943
RD
12577 """
12578 The wx.GBSizerItem class is used to track the additional data about
12579 items in a `wx.GridBagSizer` such as the item's position in the grid
12580 and how many rows or columns it spans.
12581
12582 """
d55e5bfc
RD
12583 def __repr__(self):
12584 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12585 def __init__(self, *args, **kwargs):
248ed943
RD
12586 """
12587 __init__(self) -> GBSizerItem
12588
12589 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12590 size will need to be set, as well as a position and span before this
12591 item can be used in a Sizer.
12592
12593 You will probably never need to create a wx.GBSizerItem directly as they
12594 are created automatically when the sizer's Add method is called.
12595 """
d55e5bfc
RD
12596 newobj = _core_.new_GBSizerItem(*args, **kwargs)
12597 self.this = newobj.this
12598 self.thisown = 1
12599 del newobj.thisown
12600 def GetPos(*args, **kwargs):
248ed943
RD
12601 """
12602 GetPos(self) -> GBPosition
12603
12604 Get the grid position of the item
12605 """
d55e5bfc
RD
12606 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12607
12608 def GetPosTuple(self): return self.GetPos().Get()
12609 def GetSpan(*args, **kwargs):
248ed943
RD
12610 """
12611 GetSpan(self) -> GBSpan
12612
12613 Get the row and column spanning of the item
12614 """
d55e5bfc
RD
12615 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12616
12617 def GetSpanTuple(self): return self.GetSpan().Get()
12618 def SetPos(*args, **kwargs):
248ed943
RD
12619 """
12620 SetPos(self, GBPosition pos) -> bool
12621
12622 If the item is already a member of a sizer then first ensure that
12623 there is no other item that would intersect with this one at the new
12624 position, then set the new position. Returns True if the change is
12625 successful and after the next Layout() the item will be moved.
12626 """
d55e5bfc
RD
12627 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12628
12629 def SetSpan(*args, **kwargs):
248ed943
RD
12630 """
12631 SetSpan(self, GBSpan span) -> bool
12632
12633 If the item is already a member of a sizer then first ensure that
12634 there is no other item that would intersect with this one with its new
12635 spanning size, then set the new spanning. Returns True if the change
12636 is successful and after the next Layout() the item will be resized.
12637
12638 """
d55e5bfc
RD
12639 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12640
248ed943 12641 def Intersects(*args, **kwargs):
d55e5bfc
RD
12642 """
12643 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12644
12645 Returns True if this item and the other item instersect.
d55e5bfc 12646 """
248ed943
RD
12647 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12648
12649 def IntersectsPos(*args, **kwargs):
12650 """
12651 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12652
12653 Returns True if the given pos/span would intersect with this item.
12654 """
12655 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12656
12657 def GetEndPos(*args, **kwargs):
248ed943
RD
12658 """
12659 GetEndPos(self) -> GBPosition
12660
12661 Get the row and column of the endpoint of this item.
12662 """
d55e5bfc
RD
12663 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12664
12665 def GetGBSizer(*args, **kwargs):
248ed943
RD
12666 """
12667 GetGBSizer(self) -> GridBagSizer
12668
12669 Get the sizer this item is a member of.
12670 """
d55e5bfc
RD
12671 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12672
12673 def SetGBSizer(*args, **kwargs):
248ed943
RD
12674 """
12675 SetGBSizer(self, GridBagSizer sizer)
12676
12677 Set the sizer this item is a member of.
12678 """
d55e5bfc
RD
12679 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12680
12681
12682class GBSizerItemPtr(GBSizerItem):
12683 def __init__(self, this):
12684 self.this = this
12685 if not hasattr(self,"thisown"): self.thisown = 0
12686 self.__class__ = GBSizerItem
12687_core_.GBSizerItem_swigregister(GBSizerItemPtr)
12688DefaultSpan = cvar.DefaultSpan
12689
12690def GBSizerItemWindow(*args, **kwargs):
12691 """
12692 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12693 int border, PyObject userData=None) -> GBSizerItem
12694
12695 Construct a `wx.GBSizerItem` for a window.
d55e5bfc
RD
12696 """
12697 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
12698 val.thisown = 1
12699 return val
12700
12701def GBSizerItemSizer(*args, **kwargs):
12702 """
12703 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12704 int border, PyObject userData=None) -> GBSizerItem
12705
12706 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc
RD
12707 """
12708 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
12709 val.thisown = 1
12710 return val
12711
12712def GBSizerItemSpacer(*args, **kwargs):
12713 """
12714 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12715 int flag, int border, PyObject userData=None) -> GBSizerItem
12716
12717 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc
RD
12718 """
12719 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
12720 val.thisown = 1
12721 return val
12722
12723class GridBagSizer(FlexGridSizer):
248ed943
RD
12724 """
12725 A `wx.Sizer` that can lay out items in a virtual grid like a
12726 `wx.FlexGridSizer` but in this case explicit positioning of the items
12727 is allowed using `wx.GBPosition`, and items can optionally span more
12728 than one row and/or column using `wx.GBSpan`. The total size of the
12729 virtual grid is determined by the largest row and column that items are
12730 positioned at, adjusted for spanning.
12731
12732 """
d55e5bfc
RD
12733 def __repr__(self):
12734 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12735 def __init__(self, *args, **kwargs):
248ed943
RD
12736 """
12737 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12738
12739 Constructor, with optional parameters to specify the gap between the
12740 rows and columns.
12741 """
d55e5bfc
RD
12742 newobj = _core_.new_GridBagSizer(*args, **kwargs)
12743 self.this = newobj.this
12744 self.thisown = 1
12745 del newobj.thisown
c9c2cf70
RD
12746 self._setOORInfo(self)
12747
d55e5bfc
RD
12748 def Add(*args, **kwargs):
12749 """
248ed943 12750 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
c1cb24a4 12751 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12752
12753 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12754 more than one row or column as specified with *span*. The remaining
12755 args behave similarly to `wx.Sizer.Add`.
12756
12757 Returns True if the item was successfully placed at the given cell
12758 position, False if something was already there.
12759
d55e5bfc
RD
12760 """
12761 return _core_.GridBagSizer_Add(*args, **kwargs)
12762
12763 def AddItem(*args, **kwargs):
248ed943 12764 """
c1cb24a4 12765 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
12766
12767 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12768 the item was successfully placed at its given cell position, False if
12769 something was already there.
12770 """
d55e5bfc
RD
12771 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12772
84f85550
RD
12773 def GetCellSize(*args, **kwargs):
12774 """
12775 GetCellSize(self, int row, int col) -> Size
12776
12777 Get the size of the specified cell, including hgap and
12778 vgap. Only valid after a Layout.
12779 """
12780 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12781
d55e5bfc 12782 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
12783 """
12784 GetEmptyCellSize(self) -> Size
12785
12786 Get the size used for cells in the grid with no item.
12787 """
d55e5bfc
RD
12788 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12789
12790 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
12791 """
12792 SetEmptyCellSize(self, Size sz)
12793
12794 Set the size used for cells in the grid with no item.
12795 """
d55e5bfc
RD
12796 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12797
12798 def GetItemPosition(*args):
12799 """
248ed943
RD
12800 GetItemPosition(self, item) -> GBPosition
12801
12802 Get the grid position of the specified *item* where *item* is either a
12803 window or subsizer that is a member of this sizer, or a zero-based
12804 index of an item.
d55e5bfc
RD
12805 """
12806 return _core_.GridBagSizer_GetItemPosition(*args)
12807
12808 def SetItemPosition(*args):
12809 """
248ed943
RD
12810 SetItemPosition(self, item, GBPosition pos) -> bool
12811
12812 Set the grid position of the specified *item* where *item* is either a
12813 window or subsizer that is a member of this sizer, or a zero-based
12814 index of an item. Returns True on success. If the move is not
12815 allowed (because an item is already there) then False is returned.
12816
d55e5bfc
RD
12817 """
12818 return _core_.GridBagSizer_SetItemPosition(*args)
12819
12820 def GetItemSpan(*args):
12821 """
248ed943
RD
12822 GetItemSpan(self, item) -> GBSpan
12823
12824 Get the row/col spanning of the specified *item* where *item* is
12825 either a window or subsizer that is a member of this sizer, or a
12826 zero-based index of an item.
d55e5bfc
RD
12827 """
12828 return _core_.GridBagSizer_GetItemSpan(*args)
12829
12830 def SetItemSpan(*args):
12831 """
248ed943
RD
12832 SetItemSpan(self, item, GBSpan span) -> bool
12833
12834 Set the row/col spanning of the specified *item* where *item* is
12835 either a window or subsizer that is a member of this sizer, or a
12836 zero-based index of an item. Returns True on success. If the move is
12837 not allowed (because an item is already there) then False is returned.
d55e5bfc
RD
12838 """
12839 return _core_.GridBagSizer_SetItemSpan(*args)
12840
12841 def FindItem(*args):
12842 """
248ed943
RD
12843 FindItem(self, item) -> GBSizerItem
12844
12845 Find the sizer item for the given window or subsizer, returns None if
12846 not found. (non-recursive)
d55e5bfc
RD
12847 """
12848 return _core_.GridBagSizer_FindItem(*args)
12849
12850 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
12851 """
12852 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12853
12854 Return the sizer item for the given grid cell, or None if there is no
12855 item at that position. (non-recursive)
12856 """
d55e5bfc
RD
12857 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12858
12859 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
12860 """
12861 FindItemAtPoint(self, Point pt) -> GBSizerItem
12862
12863 Return the sizer item located at the point given in *pt*, or None if
12864 there is no item at that point. The (x,y) coordinates in pt correspond
12865 to the client coordinates of the window using the sizer for
12866 layout. (non-recursive)
12867 """
d55e5bfc
RD
12868 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12869
248ed943
RD
12870 def CheckForIntersection(*args, **kwargs):
12871 """
12872 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 12873
248ed943
RD
12874 Look at all items and see if any intersect (or would overlap) the
12875 given *item*. Returns True if so, False if there would be no overlap.
12876 If an *excludeItem* is given then it will not be checked for
12877 intersection, for example it may be the item we are checking the
12878 position of.
d55e5bfc 12879
248ed943
RD
12880 """
12881 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 12882
248ed943 12883 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 12884 """
248ed943
RD
12885 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12886
12887 Look at all items and see if any intersect (or would overlap) the
12888 given position and span. Returns True if so, False if there would be
12889 no overlap. If an *excludeItem* is given then it will not be checked
12890 for intersection, for example it may be the item we are checking the
12891 position of.
d55e5bfc 12892 """
248ed943 12893 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc
RD
12894
12895
12896class GridBagSizerPtr(GridBagSizer):
12897 def __init__(self, this):
12898 self.this = this
12899 if not hasattr(self,"thisown"): self.thisown = 0
12900 self.__class__ = GridBagSizer
12901_core_.GridBagSizer_swigregister(GridBagSizerPtr)
12902
12903#---------------------------------------------------------------------------
12904
12905Left = _core_.Left
12906Top = _core_.Top
12907Right = _core_.Right
12908Bottom = _core_.Bottom
12909Width = _core_.Width
12910Height = _core_.Height
12911Centre = _core_.Centre
12912Center = _core_.Center
12913CentreX = _core_.CentreX
12914CentreY = _core_.CentreY
12915Unconstrained = _core_.Unconstrained
12916AsIs = _core_.AsIs
12917PercentOf = _core_.PercentOf
12918Above = _core_.Above
12919Below = _core_.Below
12920LeftOf = _core_.LeftOf
12921RightOf = _core_.RightOf
12922SameAs = _core_.SameAs
12923Absolute = _core_.Absolute
12924class IndividualLayoutConstraint(Object):
12925 """
79fccf9d
RD
12926 Objects of this class are stored in the `wx.LayoutConstraints` class as
12927 one of eight possible constraints that a window can be involved in.
12928 You will never need to create an instance of
12929 wx.IndividualLayoutConstraint, rather you should create a
12930 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 12931 that it contains.
d55e5bfc
RD
12932 """
12933 def __init__(self): raise RuntimeError, "No constructor defined"
12934 def __repr__(self):
12935 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12936 def Set(*args, **kwargs):
79fccf9d
RD
12937 """
12938 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12939
12940 Sets the properties of the constraint. Normally called by one of the
12941 convenience functions such as Above, RightOf, SameAs.
12942 """
d55e5bfc
RD
12943 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12944
12945 def LeftOf(*args, **kwargs):
12946 """
12947 LeftOf(self, Window sibling, int marg=0)
12948
79fccf9d
RD
12949 Constrains this edge to be to the left of the given window, with an
12950 optional margin. Implicitly, this is relative to the left edge of the
12951 other window.
d55e5bfc
RD
12952 """
12953 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12954
12955 def RightOf(*args, **kwargs):
12956 """
12957 RightOf(self, Window sibling, int marg=0)
12958
79fccf9d
RD
12959 Constrains this edge to be to the right of the given window, with an
12960 optional margin. Implicitly, this is relative to the right edge of the
12961 other window.
d55e5bfc
RD
12962 """
12963 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12964
12965 def Above(*args, **kwargs):
12966 """
12967 Above(self, Window sibling, int marg=0)
12968
79fccf9d
RD
12969 Constrains this edge to be above the given window, with an optional
12970 margin. Implicitly, this is relative to the top edge of the other
12971 window.
d55e5bfc
RD
12972 """
12973 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12974
12975 def Below(*args, **kwargs):
12976 """
12977 Below(self, Window sibling, int marg=0)
12978
79fccf9d
RD
12979 Constrains this edge to be below the given window, with an optional
12980 margin. Implicitly, this is relative to the bottom edge of the other
12981 window.
d55e5bfc
RD
12982 """
12983 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12984
12985 def SameAs(*args, **kwargs):
12986 """
12987 SameAs(self, Window otherW, int edge, int marg=0)
12988
79fccf9d
RD
12989 Constrains this edge or dimension to be to the same as the edge of the
12990 given window, with an optional margin.
d55e5bfc
RD
12991 """
12992 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12993
12994 def PercentOf(*args, **kwargs):
12995 """
12996 PercentOf(self, Window otherW, int wh, int per)
12997
79fccf9d
RD
12998 Constrains this edge or dimension to be to a percentage of the given
12999 window, with an optional margin.
d55e5bfc
RD
13000 """
13001 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
13002
13003 def Absolute(*args, **kwargs):
13004 """
13005 Absolute(self, int val)
13006
79fccf9d 13007 Constrains this edge or dimension to be the given absolute value.
d55e5bfc
RD
13008 """
13009 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
13010
13011 def Unconstrained(*args, **kwargs):
13012 """
13013 Unconstrained(self)
13014
79fccf9d
RD
13015 Sets this edge or dimension to be unconstrained, that is, dependent on
13016 other edges and dimensions from which this value can be deduced.
d55e5bfc
RD
13017 """
13018 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
13019
13020 def AsIs(*args, **kwargs):
13021 """
13022 AsIs(self)
13023
79fccf9d
RD
13024 Sets this edge or constraint to be whatever the window's value is at
13025 the moment. If either of the width and height constraints are *as is*,
13026 the window will not be resized, but moved instead. This is important
13027 when considering panel items which are intended to have a default
13028 size, such as a button, which may take its size from the size of the
13029 button label.
d55e5bfc
RD
13030 """
13031 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
13032
13033 def GetOtherWindow(*args, **kwargs):
13034 """GetOtherWindow(self) -> Window"""
13035 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
13036
13037 def GetMyEdge(*args, **kwargs):
13038 """GetMyEdge(self) -> int"""
13039 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
13040
13041 def SetEdge(*args, **kwargs):
13042 """SetEdge(self, int which)"""
13043 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
13044
13045 def SetValue(*args, **kwargs):
13046 """SetValue(self, int v)"""
13047 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
13048
13049 def GetMargin(*args, **kwargs):
13050 """GetMargin(self) -> int"""
13051 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
13052
13053 def SetMargin(*args, **kwargs):
13054 """SetMargin(self, int m)"""
13055 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
13056
13057 def GetValue(*args, **kwargs):
13058 """GetValue(self) -> int"""
13059 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
13060
13061 def GetPercent(*args, **kwargs):
13062 """GetPercent(self) -> int"""
13063 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
13064
13065 def GetOtherEdge(*args, **kwargs):
13066 """GetOtherEdge(self) -> int"""
13067 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
13068
13069 def GetDone(*args, **kwargs):
13070 """GetDone(self) -> bool"""
13071 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
13072
13073 def SetDone(*args, **kwargs):
13074 """SetDone(self, bool d)"""
13075 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
13076
13077 def GetRelationship(*args, **kwargs):
13078 """GetRelationship(self) -> int"""
13079 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
13080
13081 def SetRelationship(*args, **kwargs):
13082 """SetRelationship(self, int r)"""
13083 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
13084
13085 def ResetIfWin(*args, **kwargs):
13086 """
13087 ResetIfWin(self, Window otherW) -> bool
13088
13089 Reset constraint if it mentions otherWin
13090 """
13091 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
13092
13093 def SatisfyConstraint(*args, **kwargs):
13094 """
13095 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13096
13097 Try to satisfy constraint
13098 """
13099 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
13100
13101 def GetEdge(*args, **kwargs):
13102 """
13103 GetEdge(self, int which, Window thisWin, Window other) -> int
13104
13105 Get the value of this edge or dimension, or if this
13106 is not determinable, -1.
13107 """
13108 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
13109
13110
13111class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
13112 def __init__(self, this):
13113 self.this = this
13114 if not hasattr(self,"thisown"): self.thisown = 0
13115 self.__class__ = IndividualLayoutConstraint
13116_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
13117
13118class LayoutConstraints(Object):
13119 """
79fccf9d
RD
13120 **Note:** constraints are now deprecated and you should use sizers
13121 instead.
d55e5bfc 13122
79fccf9d
RD
13123 Objects of this class can be associated with a window to define its
13124 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
13125
13126 The class consists of the following eight constraints of class
13127 wx.IndividualLayoutConstraint, some or all of which should be accessed
13128 directly to set the appropriate constraints.
13129
13130 * left: represents the left hand edge of the window
13131 * right: represents the right hand edge of the window
13132 * top: represents the top edge of the window
13133 * bottom: represents the bottom edge of the window
13134 * width: represents the width of the window
13135 * height: represents the height of the window
13136 * centreX: represents the horizontal centre point of the window
13137 * centreY: represents the vertical centre point of the window
13138
79fccf9d
RD
13139 Most constraints are initially set to have the relationship
13140 wxUnconstrained, which means that their values should be calculated by
13141 looking at known constraints. The exceptions are width and height,
13142 which are set to wxAsIs to ensure that if the user does not specify a
13143 constraint, the existing width and height will be used, to be
13144 compatible with panel items which often have take a default size. If
13145 the constraint is ``wx.AsIs``, the dimension will not be changed.
13146
13147 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
13148
13149 """
13150 def __repr__(self):
13151 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
13152 left = property(_core_.LayoutConstraints_left_get)
13153 top = property(_core_.LayoutConstraints_top_get)
13154 right = property(_core_.LayoutConstraints_right_get)
13155 bottom = property(_core_.LayoutConstraints_bottom_get)
13156 width = property(_core_.LayoutConstraints_width_get)
13157 height = property(_core_.LayoutConstraints_height_get)
13158 centreX = property(_core_.LayoutConstraints_centreX_get)
13159 centreY = property(_core_.LayoutConstraints_centreY_get)
13160 def __init__(self, *args, **kwargs):
13161 """__init__(self) -> LayoutConstraints"""
13162 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
13163 self.this = newobj.this
13164 self.thisown = 1
13165 del newobj.thisown
13166 def SatisfyConstraints(*args, **kwargs):
13167 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13168 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
13169
13170 def AreSatisfied(*args, **kwargs):
13171 """AreSatisfied(self) -> bool"""
13172 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
13173
13174
13175class LayoutConstraintsPtr(LayoutConstraints):
13176 def __init__(self, this):
13177 self.this = this
13178 if not hasattr(self,"thisown"): self.thisown = 0
13179 self.__class__ = LayoutConstraints
13180_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
13181
13182#----------------------------------------------------------------------------
13183
13184# Use Python's bool constants if available, make some if not
13185try:
13186 True
13187except NameError:
13188 __builtins__.True = 1==1
13189 __builtins__.False = 1==0
13190 def bool(value): return not not value
13191 __builtins__.bool = bool
13192
13193
13194
13195# workarounds for bad wxRTTI names
13196__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13197__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13198__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13199
13200
13201#----------------------------------------------------------------------------
13202# Load version numbers from __version__... Ensure that major and minor
0f63ec68 13203# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
13204
13205from __version__ import *
13206__version__ = VERSION_STRING
13207
0f63ec68
RD
13208assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13209assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
13210if RELEASE_VERSION != _core_.RELEASE_VERSION:
13211 import warnings
0f63ec68 13212 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
13213
13214#----------------------------------------------------------------------------
13215
70b7a5fe
RD
13216# Set wxPython's default string<-->unicode conversion encoding from
13217# the locale, but only if Python's default hasn't been changed. (We
13218# assume that if the user has customized it already then that is the
13219# encoding we need to use as well.)
13220#
13221# The encoding selected here is used when string or unicode objects
13222# need to be converted in order to pass them to wxWidgets. Please be
13223# aware that the default encoding within the same locale may be
13224# slightly different on different platforms. For example, please see
62d32a5f
RD
13225# http://www.alanwood.net/demos/charsetdiffs.html for differences
13226# between the common latin/roman encodings.
396fb509
RD
13227
13228default = _sys.getdefaultencoding()
13229if default == 'ascii':
13230 import locale
13231 import codecs
13232 try:
13233 default = locale.getdefaultlocale()[1]
13234 codecs.lookup(default)
70b7a5fe 13235 except (ValueError, LookupError, TypeError):
396fb509
RD
13236 default = _sys.getdefaultencoding()
13237 del locale
13238 del codecs
5cbf236d
RD
13239if default:
13240 wx.SetDefaultPyEncoding(default)
13241del default
5cbf236d
RD
13242
13243#----------------------------------------------------------------------------
13244
d55e5bfc
RD
13245class PyDeadObjectError(AttributeError):
13246 pass
13247
13248class _wxPyDeadObject(object):
13249 """
13250 Instances of wx objects that are OOR capable will have their __class__
13251 changed to this class when the C++ object is deleted. This should help
13252 prevent crashes due to referencing a bogus C++ pointer.
13253 """
13254 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13255 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13256
13257 def __repr__(self):
13258 if not hasattr(self, "_name"):
13259 self._name = "[unknown]"
13260 return self.reprStr % self._name
13261
13262 def __getattr__(self, *args):
13263 if not hasattr(self, "_name"):
13264 self._name = "[unknown]"
13265 raise PyDeadObjectError(self.attrStr % self._name)
13266
13267 def __nonzero__(self):
13268 return 0
13269
13270
13271
13272class PyUnbornObjectError(AttributeError):
13273 pass
13274
13275class _wxPyUnbornObject(object):
13276 """
13277 Some stock objects are created when the wx._core module is
13278 imported, but their C++ instance is not created until the wx.App
13279 object is created and initialized. These object instances will
13280 temporarily have their __class__ changed to this class so an
13281 exception will be raised if they are used before the C++ instance
13282 is ready.
13283 """
13284
13285 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13286 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13287
13288 def __repr__(self):
13289 #if not hasattr(self, "_name"):
13290 # self._name = "[unknown]"
13291 return self.reprStr #% self._name
13292
13293 def __getattr__(self, *args):
13294 #if not hasattr(self, "_name"):
13295 # self._name = "[unknown]"
13296 raise PyUnbornObjectError(self.attrStr) # % self._name )
13297
13298 def __nonzero__(self):
13299 return 0
13300
13301
13302#----------------------------------------------------------------------------
d55e5bfc
RD
13303
13304def CallAfter(callable, *args, **kw):
13305 """
13306 Call the specified function after the current and pending event
13307 handlers have been completed. This is also good for making GUI
0439c23b
RD
13308 method calls from non-GUI threads. Any extra positional or
13309 keyword args are passed on to the callable when it is called.
13310
13311 :see: `wx.FutureCall`
d55e5bfc
RD
13312 """
13313 app = wx.GetApp()
a001823c 13314 assert app is not None, 'No wx.App created yet'
d55e5bfc 13315
891bb194
RD
13316 if not hasattr(app, "_CallAfterId"):
13317 app._CallAfterId = wx.NewEventType()
13318 app.Connect(-1, -1, app._CallAfterId,
13319 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 13320 evt = wx.PyEvent()
891bb194 13321 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
13322 evt.callable = callable
13323 evt.args = args
13324 evt.kw = kw
13325 wx.PostEvent(app, evt)
13326
d55e5bfc
RD
13327#----------------------------------------------------------------------------
13328
13329
13330class FutureCall:
13331 """
8ac8dba0 13332 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
13333 object once after the given amount of milliseconds, passing any
13334 positional or keyword args. The return value of the callable is
0439c23b 13335 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
13336
13337 If you don't need to get the return value or restart the timer
13338 then there is no need to hold a reference to this object. It will
13339 hold a reference to itself while the timer is running (the timer
13340 has a reference to self.Notify) but the cycle will be broken when
13341 the timer completes, automatically cleaning up the wx.FutureCall
13342 object.
0439c23b
RD
13343
13344 :see: `wx.CallAfter`
d55e5bfc
RD
13345 """
13346 def __init__(self, millis, callable, *args, **kwargs):
13347 self.millis = millis
13348 self.callable = callable
13349 self.SetArgs(*args, **kwargs)
13350 self.runCount = 0
13351 self.running = False
13352 self.hasRun = False
13353 self.result = None
13354 self.timer = None
13355 self.Start()
13356
13357 def __del__(self):
13358 self.Stop()
13359
13360
13361 def Start(self, millis=None, *args, **kwargs):
13362 """
13363 (Re)start the timer
13364 """
13365 self.hasRun = False
13366 if millis is not None:
13367 self.millis = millis
13368 if args or kwargs:
13369 self.SetArgs(*args, **kwargs)
13370 self.Stop()
13371 self.timer = wx.PyTimer(self.Notify)
13372 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13373 self.running = True
13374 Restart = Start
13375
13376
13377 def Stop(self):
13378 """
13379 Stop and destroy the timer.
13380 """
13381 if self.timer is not None:
13382 self.timer.Stop()
13383 self.timer = None
13384
13385
13386 def GetInterval(self):
13387 if self.timer is not None:
13388 return self.timer.GetInterval()
13389 else:
13390 return 0
13391
13392
13393 def IsRunning(self):
13394 return self.timer is not None and self.timer.IsRunning()
13395
13396
13397 def SetArgs(self, *args, **kwargs):
13398 """
13399 (Re)set the args passed to the callable object. This is
13400 useful in conjunction with Restart if you want to schedule a
13401 new call to the same callable object but with different
13402 parameters.
13403 """
13404 self.args = args
13405 self.kwargs = kwargs
13406
13407
13408 def HasRun(self):
13409 return self.hasRun
13410
13411 def GetResult(self):
13412 return self.result
13413
13414 def Notify(self):
13415 """
13416 The timer has expired so call the callable.
13417 """
13418 if self.callable and getattr(self.callable, 'im_self', True):
13419 self.runCount += 1
13420 self.running = False
13421 self.result = self.callable(*self.args, **self.kwargs)
13422 self.hasRun = True
13423 if not self.running:
13424 # if it wasn't restarted, then cleanup
13425 wx.CallAfter(self.Stop)
13426
13427
13428
13429#----------------------------------------------------------------------------
13430# Control which items in this module should be documented by epydoc.
13431# We allow only classes and functions, which will help reduce the size
13432# of the docs by filtering out the zillions of constants, EVT objects,
13433# and etc that don't make much sense by themselves, but are instead
13434# documented (or will be) as part of the classes/functions/methods
13435# where they should be used.
13436
c24da6d6
RD
13437class __DocFilter:
13438 """
13439 A filter for epydoc that only allows non-Ptr classes and
13440 fucntions, in order to reduce the clutter in the API docs.
13441 """
13442 def __init__(self, globals):
13443 self._globals = globals
13444
13445 def __call__(self, name):
13446 import types
13447 obj = self._globals.get(name, None)
13448 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13449 return False
13450 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
13451 return False
13452 return True
d55e5bfc
RD
13453
13454#----------------------------------------------------------------------------
13455#----------------------------------------------------------------------------
13456
13457# Import other modules in this package that should show up in the
13458# "core" wx namespace
13459from _gdi import *
13460from _windows import *
13461from _controls import *
13462from _misc import *
13463
13464
13465# Fixup the stock objects since they can't be used yet. (They will be
13466# restored in wx.PyApp.OnInit.)
13467_core_._wxPyFixStockObjects()
13468
13469#----------------------------------------------------------------------------
13470#----------------------------------------------------------------------------
13471
13472