]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
reSWIGged
[wxWidgets.git] / wxPython / src / mac / _core.py
CommitLineData
d55e5bfc
RD
1# This file was created automatically by SWIG.
2# Don't modify this file, modify the SWIG interface instead.
3
5b5c9bc7 4import _core_
d55e5bfc 5
36ed4f51
RD
6def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name) or (name == "thisown"):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
24 method = class_type.__swig_getmethods__.get(name,None)
25 if method: return method(self)
26 raise AttributeError,name
27
28import types
29try:
30 _object = types.ObjectType
31 _newclass = 1
32except AttributeError:
33 class _object : pass
34 _newclass = 0
35del types
36
37
38def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
d55e5bfc
RD
47#// Give a reference to the dictionary of this module to the C++ extension
48#// code.
49_core_._wxPySetDictionary(vars())
50
51#// A little trick to make 'wx' be a reference to this module so wx.Names can
52#// be used here.
53import sys as _sys
54wx = _sys.modules[__name__]
55
d6c14a4c
RD
56
57#----------------------------------------------------------------------------
58
59def _deprecated(callable, msg=None):
60 """
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
63 """
64 if msg is None:
65 msg = "%s is deprecated" % callable
66 def deprecatedWrapper(*args, **kwargs):
67 import warnings
68 warnings.warn(msg, DeprecationWarning, stacklevel=2)
69 return callable(*args, **kwargs)
70 deprecatedWrapper.__doc__ = msg
71 return deprecatedWrapper
72
73
74#----------------------------------------------------------------------------
75
5b5c9bc7
RD
76NOT_FOUND = _core_.NOT_FOUND
77VSCROLL = _core_.VSCROLL
78HSCROLL = _core_.HSCROLL
79CAPTION = _core_.CAPTION
80DOUBLE_BORDER = _core_.DOUBLE_BORDER
81SUNKEN_BORDER = _core_.SUNKEN_BORDER
82RAISED_BORDER = _core_.RAISED_BORDER
83BORDER = _core_.BORDER
84SIMPLE_BORDER = _core_.SIMPLE_BORDER
85STATIC_BORDER = _core_.STATIC_BORDER
86TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
87NO_BORDER = _core_.NO_BORDER
88DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 89DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
5b5c9bc7
RD
90TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
91WANTS_CHARS = _core_.WANTS_CHARS
92POPUP_WINDOW = _core_.POPUP_WINDOW
93CENTER_FRAME = _core_.CENTER_FRAME
94CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
95CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
96CLIP_CHILDREN = _core_.CLIP_CHILDREN
97CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
98ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
99RETAINED = _core_.RETAINED
100BACKINGSTORE = _core_.BACKINGSTORE
101COLOURED = _core_.COLOURED
102FIXED_LENGTH = _core_.FIXED_LENGTH
103LB_NEEDED_SB = _core_.LB_NEEDED_SB
104LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
105LB_SORT = _core_.LB_SORT
106LB_SINGLE = _core_.LB_SINGLE
107LB_MULTIPLE = _core_.LB_MULTIPLE
108LB_EXTENDED = _core_.LB_EXTENDED
109LB_OWNERDRAW = _core_.LB_OWNERDRAW
110LB_HSCROLL = _core_.LB_HSCROLL
111PROCESS_ENTER = _core_.PROCESS_ENTER
112PASSWORD = _core_.PASSWORD
113CB_SIMPLE = _core_.CB_SIMPLE
114CB_DROPDOWN = _core_.CB_DROPDOWN
115CB_SORT = _core_.CB_SORT
116CB_READONLY = _core_.CB_READONLY
117RA_HORIZONTAL = _core_.RA_HORIZONTAL
118RA_VERTICAL = _core_.RA_VERTICAL
119RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
120RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
121RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
122RB_GROUP = _core_.RB_GROUP
123RB_SINGLE = _core_.RB_SINGLE
124SB_HORIZONTAL = _core_.SB_HORIZONTAL
125SB_VERTICAL = _core_.SB_VERTICAL
126RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
127ST_SIZEGRIP = _core_.ST_SIZEGRIP
128ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
129FLOOD_SURFACE = _core_.FLOOD_SURFACE
130FLOOD_BORDER = _core_.FLOOD_BORDER
131ODDEVEN_RULE = _core_.ODDEVEN_RULE
132WINDING_RULE = _core_.WINDING_RULE
133TOOL_TOP = _core_.TOOL_TOP
134TOOL_BOTTOM = _core_.TOOL_BOTTOM
135TOOL_LEFT = _core_.TOOL_LEFT
136TOOL_RIGHT = _core_.TOOL_RIGHT
137OK = _core_.OK
138YES_NO = _core_.YES_NO
139CANCEL = _core_.CANCEL
140YES = _core_.YES
141NO = _core_.NO
142NO_DEFAULT = _core_.NO_DEFAULT
143YES_DEFAULT = _core_.YES_DEFAULT
144ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
145ICON_HAND = _core_.ICON_HAND
146ICON_QUESTION = _core_.ICON_QUESTION
147ICON_INFORMATION = _core_.ICON_INFORMATION
148ICON_STOP = _core_.ICON_STOP
149ICON_ASTERISK = _core_.ICON_ASTERISK
150ICON_MASK = _core_.ICON_MASK
151ICON_WARNING = _core_.ICON_WARNING
152ICON_ERROR = _core_.ICON_ERROR
153FORWARD = _core_.FORWARD
154BACKWARD = _core_.BACKWARD
155RESET = _core_.RESET
156HELP = _core_.HELP
157MORE = _core_.MORE
158SETUP = _core_.SETUP
159SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
160SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
161SIZE_AUTO = _core_.SIZE_AUTO
162SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
163SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
164PORTRAIT = _core_.PORTRAIT
165LANDSCAPE = _core_.LANDSCAPE
166PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
167PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
168PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
169PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
170ID_ANY = _core_.ID_ANY
171ID_SEPARATOR = _core_.ID_SEPARATOR
172ID_LOWEST = _core_.ID_LOWEST
173ID_OPEN = _core_.ID_OPEN
174ID_CLOSE = _core_.ID_CLOSE
175ID_NEW = _core_.ID_NEW
176ID_SAVE = _core_.ID_SAVE
177ID_SAVEAS = _core_.ID_SAVEAS
178ID_REVERT = _core_.ID_REVERT
179ID_EXIT = _core_.ID_EXIT
180ID_UNDO = _core_.ID_UNDO
181ID_REDO = _core_.ID_REDO
182ID_HELP = _core_.ID_HELP
183ID_PRINT = _core_.ID_PRINT
184ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
185ID_PREVIEW = _core_.ID_PREVIEW
186ID_ABOUT = _core_.ID_ABOUT
187ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
188ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
189ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
190ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
191ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
192ID_PREFERENCES = _core_.ID_PREFERENCES
193ID_CUT = _core_.ID_CUT
194ID_COPY = _core_.ID_COPY
195ID_PASTE = _core_.ID_PASTE
196ID_CLEAR = _core_.ID_CLEAR
197ID_FIND = _core_.ID_FIND
198ID_DUPLICATE = _core_.ID_DUPLICATE
199ID_SELECTALL = _core_.ID_SELECTALL
200ID_DELETE = _core_.ID_DELETE
201ID_REPLACE = _core_.ID_REPLACE
202ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
203ID_PROPERTIES = _core_.ID_PROPERTIES
204ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
205ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
206ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
207ID_VIEW_LIST = _core_.ID_VIEW_LIST
208ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
209ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
210ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
211ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
212ID_FILE1 = _core_.ID_FILE1
213ID_FILE2 = _core_.ID_FILE2
214ID_FILE3 = _core_.ID_FILE3
215ID_FILE4 = _core_.ID_FILE4
216ID_FILE5 = _core_.ID_FILE5
217ID_FILE6 = _core_.ID_FILE6
218ID_FILE7 = _core_.ID_FILE7
219ID_FILE8 = _core_.ID_FILE8
220ID_FILE9 = _core_.ID_FILE9
221ID_OK = _core_.ID_OK
222ID_CANCEL = _core_.ID_CANCEL
223ID_APPLY = _core_.ID_APPLY
224ID_YES = _core_.ID_YES
225ID_NO = _core_.ID_NO
226ID_STATIC = _core_.ID_STATIC
227ID_FORWARD = _core_.ID_FORWARD
228ID_BACKWARD = _core_.ID_BACKWARD
229ID_DEFAULT = _core_.ID_DEFAULT
230ID_MORE = _core_.ID_MORE
231ID_SETUP = _core_.ID_SETUP
232ID_RESET = _core_.ID_RESET
233ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
234ID_YESTOALL = _core_.ID_YESTOALL
235ID_NOTOALL = _core_.ID_NOTOALL
236ID_ABORT = _core_.ID_ABORT
237ID_RETRY = _core_.ID_RETRY
238ID_IGNORE = _core_.ID_IGNORE
239ID_ADD = _core_.ID_ADD
240ID_REMOVE = _core_.ID_REMOVE
241ID_UP = _core_.ID_UP
242ID_DOWN = _core_.ID_DOWN
243ID_HOME = _core_.ID_HOME
244ID_REFRESH = _core_.ID_REFRESH
245ID_STOP = _core_.ID_STOP
246ID_INDEX = _core_.ID_INDEX
247ID_BOLD = _core_.ID_BOLD
248ID_ITALIC = _core_.ID_ITALIC
249ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
250ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
251ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
252ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
253ID_UNDERLINE = _core_.ID_UNDERLINE
254ID_INDENT = _core_.ID_INDENT
255ID_UNINDENT = _core_.ID_UNINDENT
256ID_ZOOM_100 = _core_.ID_ZOOM_100
257ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
258ID_ZOOM_IN = _core_.ID_ZOOM_IN
259ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
260ID_UNDELETE = _core_.ID_UNDELETE
261ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
262ID_HIGHEST = _core_.ID_HIGHEST
263OPEN = _core_.OPEN
264SAVE = _core_.SAVE
265HIDE_READONLY = _core_.HIDE_READONLY
266OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
267FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
268MULTIPLE = _core_.MULTIPLE
269CHANGE_DIR = _core_.CHANGE_DIR
270ACCEL_ALT = _core_.ACCEL_ALT
271ACCEL_CTRL = _core_.ACCEL_CTRL
272ACCEL_SHIFT = _core_.ACCEL_SHIFT
273ACCEL_NORMAL = _core_.ACCEL_NORMAL
274PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
275PD_APP_MODAL = _core_.PD_APP_MODAL
276PD_CAN_ABORT = _core_.PD_CAN_ABORT
277PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
278PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
279PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
280PD_SMOOTH = _core_.PD_SMOOTH
281PD_CAN_SKIP = _core_.PD_CAN_SKIP
282DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
283DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
284MENU_TEAROFF = _core_.MENU_TEAROFF
285MB_DOCKABLE = _core_.MB_DOCKABLE
286NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
287FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
288LI_HORIZONTAL = _core_.LI_HORIZONTAL
289LI_VERTICAL = _core_.LI_VERTICAL
290WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
291WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
292WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
293WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
294WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
295WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
296MM_TEXT = _core_.MM_TEXT
297MM_LOMETRIC = _core_.MM_LOMETRIC
298MM_HIMETRIC = _core_.MM_HIMETRIC
299MM_LOENGLISH = _core_.MM_LOENGLISH
300MM_HIENGLISH = _core_.MM_HIENGLISH
301MM_TWIPS = _core_.MM_TWIPS
302MM_ISOTROPIC = _core_.MM_ISOTROPIC
303MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
304MM_POINTS = _core_.MM_POINTS
305MM_METRIC = _core_.MM_METRIC
306CENTRE = _core_.CENTRE
307CENTER = _core_.CENTER
308HORIZONTAL = _core_.HORIZONTAL
309VERTICAL = _core_.VERTICAL
310BOTH = _core_.BOTH
311LEFT = _core_.LEFT
312RIGHT = _core_.RIGHT
313UP = _core_.UP
314DOWN = _core_.DOWN
315TOP = _core_.TOP
316BOTTOM = _core_.BOTTOM
317NORTH = _core_.NORTH
318SOUTH = _core_.SOUTH
319WEST = _core_.WEST
320EAST = _core_.EAST
321ALL = _core_.ALL
322ALIGN_NOT = _core_.ALIGN_NOT
323ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
324ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
325ALIGN_LEFT = _core_.ALIGN_LEFT
326ALIGN_TOP = _core_.ALIGN_TOP
327ALIGN_RIGHT = _core_.ALIGN_RIGHT
328ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
329ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
330ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
331ALIGN_CENTER = _core_.ALIGN_CENTER
332ALIGN_CENTRE = _core_.ALIGN_CENTRE
333ALIGN_MASK = _core_.ALIGN_MASK
334STRETCH_NOT = _core_.STRETCH_NOT
335SHRINK = _core_.SHRINK
336GROW = _core_.GROW
337EXPAND = _core_.EXPAND
338SHAPED = _core_.SHAPED
339FIXED_MINSIZE = _core_.FIXED_MINSIZE
340TILE = _core_.TILE
341ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
342BORDER_DEFAULT = _core_.BORDER_DEFAULT
343BORDER_NONE = _core_.BORDER_NONE
344BORDER_STATIC = _core_.BORDER_STATIC
345BORDER_SIMPLE = _core_.BORDER_SIMPLE
346BORDER_RAISED = _core_.BORDER_RAISED
347BORDER_SUNKEN = _core_.BORDER_SUNKEN
348BORDER_DOUBLE = _core_.BORDER_DOUBLE
349BORDER_MASK = _core_.BORDER_MASK
350BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
351BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
352BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
353DEFAULT = _core_.DEFAULT
354DECORATIVE = _core_.DECORATIVE
355ROMAN = _core_.ROMAN
356SCRIPT = _core_.SCRIPT
357SWISS = _core_.SWISS
358MODERN = _core_.MODERN
359TELETYPE = _core_.TELETYPE
360VARIABLE = _core_.VARIABLE
361FIXED = _core_.FIXED
362NORMAL = _core_.NORMAL
363LIGHT = _core_.LIGHT
364BOLD = _core_.BOLD
365ITALIC = _core_.ITALIC
366SLANT = _core_.SLANT
367SOLID = _core_.SOLID
368DOT = _core_.DOT
369LONG_DASH = _core_.LONG_DASH
370SHORT_DASH = _core_.SHORT_DASH
371DOT_DASH = _core_.DOT_DASH
372USER_DASH = _core_.USER_DASH
373TRANSPARENT = _core_.TRANSPARENT
374STIPPLE = _core_.STIPPLE
d04418a7
RD
375STIPPLE_MASK = _core_.STIPPLE_MASK
376STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
5b5c9bc7
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
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
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
599DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
600DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
601DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
602ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
603ITEM_NORMAL = _core_.ITEM_NORMAL
604ITEM_CHECK = _core_.ITEM_CHECK
605ITEM_RADIO = _core_.ITEM_RADIO
606ITEM_MAX = _core_.ITEM_MAX
607HT_NOWHERE = _core_.HT_NOWHERE
608HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
609HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
610HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
611HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
612HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
613HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
614HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
615HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
616HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
617HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
618HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
619HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
620HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
621HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
622HT_MAX = _core_.HT_MAX
623MOD_NONE = _core_.MOD_NONE
624MOD_ALT = _core_.MOD_ALT
625MOD_CONTROL = _core_.MOD_CONTROL
626MOD_SHIFT = _core_.MOD_SHIFT
627MOD_WIN = _core_.MOD_WIN
628UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
629UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
630UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d55e5bfc
RD
631#---------------------------------------------------------------------------
632
5b5c9bc7 633class Object(object):
d55e5bfc
RD
634 """
635 The base class for most wx objects, although in wxPython not
636 much functionality is needed nor exposed.
637 """
638 def __init__(self): raise RuntimeError, "No constructor defined"
639 def __repr__(self):
640 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
641 def GetClassName(*args, **kwargs):
642 """
5b5c9bc7 643 GetClassName(self) -> String
d55e5bfc
RD
644
645 Returns the class name of the C++ class using wxRTTI.
646 """
5b5c9bc7 647 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
648
649 def Destroy(*args, **kwargs):
650 """
651 Destroy(self)
652
653 Deletes the C++ object this Python object is a proxy for.
654 """
5b5c9bc7 655 return _core_.Object_Destroy(*args, **kwargs)
d55e5bfc
RD
656
657
5b5c9bc7 658class ObjectPtr(Object):
d55e5bfc
RD
659 def __init__(self, this):
660 self.this = this
661 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
662 self.__class__ = Object
663_core_.Object_swigregister(ObjectPtr)
664_wxPySetDictionary = _core_._wxPySetDictionary
d55e5bfc 665
5b5c9bc7 666_wxPyFixStockObjects = _core_._wxPyFixStockObjects
d55e5bfc 667
5b5c9bc7 668cvar = _core_.cvar
d55e5bfc
RD
669EmptyString = cvar.EmptyString
670
671#---------------------------------------------------------------------------
672
5b5c9bc7
RD
673BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
674BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
675BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
676BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
677BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
678BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
679BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
680BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
681BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
682BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
683BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
684BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
685BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
686BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
687BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
688BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
689BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
690BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
691BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
692BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
693CURSOR_NONE = _core_.CURSOR_NONE
694CURSOR_ARROW = _core_.CURSOR_ARROW
695CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
696CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
697CURSOR_CHAR = _core_.CURSOR_CHAR
698CURSOR_CROSS = _core_.CURSOR_CROSS
699CURSOR_HAND = _core_.CURSOR_HAND
700CURSOR_IBEAM = _core_.CURSOR_IBEAM
701CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
702CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
703CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
704CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
705CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
706CURSOR_PENCIL = _core_.CURSOR_PENCIL
707CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
708CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
709CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
710CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
711CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
712CURSOR_SIZENS = _core_.CURSOR_SIZENS
713CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
714CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
715CURSOR_SIZING = _core_.CURSOR_SIZING
716CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
717CURSOR_WAIT = _core_.CURSOR_WAIT
718CURSOR_WATCH = _core_.CURSOR_WATCH
719CURSOR_BLANK = _core_.CURSOR_BLANK
720CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
721CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
722CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
723CURSOR_MAX = _core_.CURSOR_MAX
d55e5bfc
RD
724#---------------------------------------------------------------------------
725
5b5c9bc7 726class Size(object):
d55e5bfc 727 """
15817c7e 728 wx.Size is a useful data structure used to represent the size of
36ed4f51
RD
729 something. It simply contians integer width and height
730 proprtites. In most places in wxPython where a wx.Size is
731 expected a (width, height) tuple can be used instead.
d55e5bfc
RD
732 """
733 def __repr__(self):
734 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
735 width = property(_core_.Size_width_get, _core_.Size_width_set)
736 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc
RD
737 x = width; y = height
738 def __init__(self, *args, **kwargs):
739 """
5b5c9bc7 740 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
741
742 Creates a size object.
743 """
5b5c9bc7 744 newobj = _core_.new_Size(*args, **kwargs)
d55e5bfc
RD
745 self.this = newobj.this
746 self.thisown = 1
747 del newobj.thisown
5b5c9bc7 748 def __del__(self, destroy=_core_.delete_Size):
d55e5bfc
RD
749 """__del__(self)"""
750 try:
751 if self.thisown: destroy(self)
752 except: pass
753
754 def __eq__(*args, **kwargs):
755 """
5b5c9bc7 756 __eq__(self, Size sz) -> bool
d55e5bfc
RD
757
758 Test for equality of wx.Size objects.
759 """
5b5c9bc7 760 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
761
762 def __ne__(*args, **kwargs):
763 """
5b5c9bc7 764 __ne__(self, Size sz) -> bool
d55e5bfc
RD
765
766 Test for inequality.
767 """
5b5c9bc7 768 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
769
770 def __add__(*args, **kwargs):
771 """
5b5c9bc7 772 __add__(self, Size sz) -> Size
d55e5bfc
RD
773
774 Add sz's proprties to this and return the result.
775 """
5b5c9bc7 776 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
777
778 def __sub__(*args, **kwargs):
779 """
5b5c9bc7 780 __sub__(self, Size sz) -> Size
d55e5bfc
RD
781
782 Subtract sz's properties from this and return the result.
783 """
5b5c9bc7 784 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
785
786 def IncTo(*args, **kwargs):
787 """
5b5c9bc7 788 IncTo(self, Size sz)
d55e5bfc
RD
789
790 Increments this object so that both of its dimensions are not less
791 than the corresponding dimensions of the size.
792 """
5b5c9bc7 793 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
794
795 def DecTo(*args, **kwargs):
796 """
5b5c9bc7 797 DecTo(self, Size sz)
d55e5bfc
RD
798
799 Decrements this object so that both of its dimensions are not greater
800 than the corresponding dimensions of the size.
801 """
5b5c9bc7 802 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc
RD
803
804 def Set(*args, **kwargs):
805 """
806 Set(self, int w, int h)
807
808 Set both width and height.
809 """
5b5c9bc7 810 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
811
812 def SetWidth(*args, **kwargs):
813 """SetWidth(self, int w)"""
5b5c9bc7 814 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
815
816 def SetHeight(*args, **kwargs):
817 """SetHeight(self, int h)"""
5b5c9bc7 818 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
819
820 def GetWidth(*args, **kwargs):
821 """GetWidth(self) -> int"""
5b5c9bc7 822 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
823
824 def GetHeight(*args, **kwargs):
825 """GetHeight(self) -> int"""
5b5c9bc7 826 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
827
828 def IsFullySpecified(*args, **kwargs):
829 """
830 IsFullySpecified(self) -> bool
831
832 Returns True if both components of the size are non-default values.
833 """
5b5c9bc7 834 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
835
836 def SetDefaults(*args, **kwargs):
837 """
5b5c9bc7 838 SetDefaults(self, Size size)
d55e5bfc 839
15817c7e
RD
840 Combine this size with the other one replacing the default components
841 of this object (i.e. equal to -1) with those of the other.
d55e5bfc 842 """
5b5c9bc7 843 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
844
845 def Get(*args, **kwargs):
846 """
847 Get() -> (width,height)
848
849 Returns the width and height properties as a tuple.
850 """
5b5c9bc7 851 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 852
15817c7e 853 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
854 def __str__(self): return str(self.Get())
855 def __repr__(self): return 'wx.Size'+str(self.Get())
856 def __len__(self): return len(self.Get())
857 def __getitem__(self, index): return self.Get()[index]
858 def __setitem__(self, index, val):
859 if index == 0: self.width = val
860 elif index == 1: self.height = val
861 else: raise IndexError
862 def __nonzero__(self): return self.Get() != (0,0)
863 __safe_for_unpickling__ = True
864 def __reduce__(self): return (wx.Size, self.Get())
865
866
5b5c9bc7 867class SizePtr(Size):
d55e5bfc
RD
868 def __init__(self, this):
869 self.this = this
870 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
871 self.__class__ = Size
872_core_.Size_swigregister(SizePtr)
d55e5bfc
RD
873
874#---------------------------------------------------------------------------
875
5b5c9bc7 876class RealPoint(object):
d55e5bfc 877 """
15817c7e
RD
878 A data structure for representing a point or position with floating
879 point x and y properties. In wxPython most places that expect a
880 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc
RD
881 """
882 def __repr__(self):
883 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
884 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
885 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
d55e5bfc
RD
886 def __init__(self, *args, **kwargs):
887 """
5b5c9bc7 888 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
889
890 Create a wx.RealPoint object
891 """
5b5c9bc7 892 newobj = _core_.new_RealPoint(*args, **kwargs)
d55e5bfc
RD
893 self.this = newobj.this
894 self.thisown = 1
895 del newobj.thisown
5b5c9bc7 896 def __del__(self, destroy=_core_.delete_RealPoint):
d55e5bfc
RD
897 """__del__(self)"""
898 try:
899 if self.thisown: destroy(self)
900 except: pass
901
902 def __eq__(*args, **kwargs):
903 """
5b5c9bc7 904 __eq__(self, RealPoint pt) -> bool
d55e5bfc
RD
905
906 Test for equality of wx.RealPoint objects.
907 """
5b5c9bc7 908 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
909
910 def __ne__(*args, **kwargs):
911 """
5b5c9bc7 912 __ne__(self, RealPoint pt) -> bool
d55e5bfc
RD
913
914 Test for inequality of wx.RealPoint objects.
915 """
5b5c9bc7 916 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
917
918 def __add__(*args, **kwargs):
919 """
5b5c9bc7 920 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
921
922 Add pt's proprties to this and return the result.
923 """
5b5c9bc7 924 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
925
926 def __sub__(*args, **kwargs):
927 """
5b5c9bc7 928 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
929
930 Subtract pt's proprties from this and return the result
931 """
5b5c9bc7 932 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
933
934 def Set(*args, **kwargs):
935 """
936 Set(self, double x, double y)
937
938 Set both the x and y properties
939 """
5b5c9bc7 940 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
941
942 def Get(*args, **kwargs):
943 """
944 Get() -> (x,y)
945
946 Return the x and y properties as a tuple.
947 """
5b5c9bc7 948 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 949
15817c7e 950 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
951 def __str__(self): return str(self.Get())
952 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
953 def __len__(self): return len(self.Get())
954 def __getitem__(self, index): return self.Get()[index]
955 def __setitem__(self, index, val):
956 if index == 0: self.x = val
957 elif index == 1: self.y = val
958 else: raise IndexError
959 def __nonzero__(self): return self.Get() != (0.0, 0.0)
960 __safe_for_unpickling__ = True
961 def __reduce__(self): return (wx.RealPoint, self.Get())
962
963
5b5c9bc7 964class RealPointPtr(RealPoint):
d55e5bfc
RD
965 def __init__(self, this):
966 self.this = this
967 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
968 self.__class__ = RealPoint
969_core_.RealPoint_swigregister(RealPointPtr)
d55e5bfc
RD
970
971#---------------------------------------------------------------------------
972
5b5c9bc7 973class Point(object):
d55e5bfc 974 """
15817c7e
RD
975 A data structure for representing a point or position with integer x
976 and y properties. Most places in wxPython that expect a wx.Point can
977 also accept a (x,y) tuple.
d55e5bfc
RD
978 """
979 def __repr__(self):
980 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
981 x = property(_core_.Point_x_get, _core_.Point_x_set)
982 y = property(_core_.Point_y_get, _core_.Point_y_set)
d55e5bfc
RD
983 def __init__(self, *args, **kwargs):
984 """
5b5c9bc7 985 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
986
987 Create a wx.Point object
988 """
5b5c9bc7 989 newobj = _core_.new_Point(*args, **kwargs)
d55e5bfc
RD
990 self.this = newobj.this
991 self.thisown = 1
992 del newobj.thisown
5b5c9bc7 993 def __del__(self, destroy=_core_.delete_Point):
d55e5bfc
RD
994 """__del__(self)"""
995 try:
996 if self.thisown: destroy(self)
997 except: pass
998
999 def __eq__(*args, **kwargs):
1000 """
5b5c9bc7 1001 __eq__(self, Point pt) -> bool
d55e5bfc
RD
1002
1003 Test for equality of wx.Point objects.
1004 """
5b5c9bc7 1005 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1006
1007 def __ne__(*args, **kwargs):
1008 """
5b5c9bc7 1009 __ne__(self, Point pt) -> bool
d55e5bfc
RD
1010
1011 Test for inequality of wx.Point objects.
1012 """
5b5c9bc7 1013 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1014
1015 def __add__(*args, **kwargs):
1016 """
5b5c9bc7 1017 __add__(self, Point pt) -> Point
d55e5bfc
RD
1018
1019 Add pt's proprties to this and return the result.
1020 """
5b5c9bc7 1021 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1022
1023 def __sub__(*args, **kwargs):
1024 """
5b5c9bc7 1025 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1026
1027 Subtract pt's proprties from this and return the result
1028 """
5b5c9bc7 1029 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1030
1031 def __iadd__(*args, **kwargs):
1032 """
5b5c9bc7 1033 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1034
1035 Add pt to this object.
1036 """
5b5c9bc7 1037 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1038
1039 def __isub__(*args, **kwargs):
1040 """
5b5c9bc7 1041 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1042
1043 Subtract pt from this object.
1044 """
5b5c9bc7 1045 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1046
1047 def Set(*args, **kwargs):
1048 """
1049 Set(self, long x, long y)
1050
1051 Set both the x and y properties
1052 """
5b5c9bc7 1053 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1054
1055 def Get(*args, **kwargs):
1056 """
1057 Get() -> (x,y)
1058
1059 Return the x and y properties as a tuple.
1060 """
5b5c9bc7 1061 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1062
15817c7e 1063 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1064 def __str__(self): return str(self.Get())
1065 def __repr__(self): return 'wx.Point'+str(self.Get())
1066 def __len__(self): return len(self.Get())
1067 def __getitem__(self, index): return self.Get()[index]
1068 def __setitem__(self, index, val):
1069 if index == 0: self.x = val
1070 elif index == 1: self.y = val
1071 else: raise IndexError
1072 def __nonzero__(self): return self.Get() != (0,0)
1073 __safe_for_unpickling__ = True
1074 def __reduce__(self): return (wx.Point, self.Get())
1075
1076
5b5c9bc7 1077class PointPtr(Point):
d55e5bfc
RD
1078 def __init__(self, this):
1079 self.this = this
1080 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1081 self.__class__ = Point
1082_core_.Point_swigregister(PointPtr)
d55e5bfc
RD
1083
1084#---------------------------------------------------------------------------
1085
5b5c9bc7 1086class Rect(object):
d55e5bfc 1087 """
15817c7e
RD
1088 A class for representing and manipulating rectangles. It has x, y,
1089 width and height properties. In wxPython most palces that expect a
1090 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc
RD
1091 """
1092 def __repr__(self):
1093 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1094 def __init__(self, *args, **kwargs):
1095 """
5b5c9bc7 1096 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1097
1098 Create a new Rect object.
1099 """
5b5c9bc7 1100 newobj = _core_.new_Rect(*args, **kwargs)
d55e5bfc
RD
1101 self.this = newobj.this
1102 self.thisown = 1
1103 del newobj.thisown
5b5c9bc7 1104 def __del__(self, destroy=_core_.delete_Rect):
d55e5bfc
RD
1105 """__del__(self)"""
1106 try:
1107 if self.thisown: destroy(self)
1108 except: pass
1109
1110 def GetX(*args, **kwargs):
1111 """GetX(self) -> int"""
5b5c9bc7 1112 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1113
1114 def SetX(*args, **kwargs):
1115 """SetX(self, int x)"""
5b5c9bc7 1116 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1117
1118 def GetY(*args, **kwargs):
1119 """GetY(self) -> int"""
5b5c9bc7 1120 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1121
1122 def SetY(*args, **kwargs):
1123 """SetY(self, int y)"""
5b5c9bc7 1124 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1125
1126 def GetWidth(*args, **kwargs):
1127 """GetWidth(self) -> int"""
5b5c9bc7 1128 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1129
1130 def SetWidth(*args, **kwargs):
1131 """SetWidth(self, int w)"""
5b5c9bc7 1132 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1133
1134 def GetHeight(*args, **kwargs):
1135 """GetHeight(self) -> int"""
5b5c9bc7 1136 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1137
1138 def SetHeight(*args, **kwargs):
1139 """SetHeight(self, int h)"""
5b5c9bc7 1140 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1141
1142 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1143 """GetPosition(self) -> Point"""
1144 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1145
1146 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1147 """SetPosition(self, Point p)"""
1148 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1149
1150 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1151 """GetSize(self) -> Size"""
1152 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1153
1154 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1155 """SetSize(self, Size s)"""
1156 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1157
aff4cc5c
RD
1158 def IsEmpty(*args, **kwargs):
1159 """IsEmpty(self) -> bool"""
5b5c9bc7 1160 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1161
d55e5bfc 1162 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1163 """GetTopLeft(self) -> Point"""
1164 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1165
1166 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1167 """SetTopLeft(self, Point p)"""
1168 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1169
1170 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1171 """GetBottomRight(self) -> Point"""
1172 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1173
1174 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1175 """SetBottomRight(self, Point p)"""
1176 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc
RD
1177
1178 def GetLeft(*args, **kwargs):
1179 """GetLeft(self) -> int"""
5b5c9bc7 1180 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1181
1182 def GetTop(*args, **kwargs):
1183 """GetTop(self) -> int"""
5b5c9bc7 1184 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1185
1186 def GetBottom(*args, **kwargs):
1187 """GetBottom(self) -> int"""
5b5c9bc7 1188 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1189
1190 def GetRight(*args, **kwargs):
1191 """GetRight(self) -> int"""
5b5c9bc7 1192 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1193
1194 def SetLeft(*args, **kwargs):
1195 """SetLeft(self, int left)"""
5b5c9bc7 1196 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1197
1198 def SetRight(*args, **kwargs):
1199 """SetRight(self, int right)"""
5b5c9bc7 1200 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1201
1202 def SetTop(*args, **kwargs):
1203 """SetTop(self, int top)"""
5b5c9bc7 1204 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1205
1206 def SetBottom(*args, **kwargs):
1207 """SetBottom(self, int bottom)"""
5b5c9bc7 1208 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
1209
1210 position = property(GetPosition, SetPosition)
1211 size = property(GetSize, SetSize)
1212 left = property(GetLeft, SetLeft)
1213 right = property(GetRight, SetRight)
1214 top = property(GetTop, SetTop)
1215 bottom = property(GetBottom, SetBottom)
1216
1217 def Inflate(*args, **kwargs):
1218 """
5b5c9bc7 1219 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1220
091fdbfa
RD
1221 Increases the size of the rectangle.
1222
1223 The left border is moved farther left and the right border is moved
1224 farther right by ``dx``. The upper border is moved farther up and the
1225 bottom border is moved farther down by ``dy``. (Note the the width and
1226 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1227 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1228 opposite happens: the rectangle size decreases in the respective
1229 direction.
1230
1231 The change is made to the rectangle inplace, if instead you need a
1232 copy that is inflated, preserving the original then make the copy
1233 first::
1234
1235 copy = wx.Rect(*original)
1236 copy.Inflate(10,15)
1237
1238
d55e5bfc 1239 """
5b5c9bc7 1240 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1241
1242 def Deflate(*args, **kwargs):
1243 """
5b5c9bc7 1244 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1245
091fdbfa
RD
1246 Decrease the rectangle size. This method is the opposite of `Inflate`
1247 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1248 `Inflate` for a full description.
d55e5bfc 1249 """
5b5c9bc7 1250 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1251
1252 def OffsetXY(*args, **kwargs):
1253 """
1254 OffsetXY(self, int dx, int dy)
1255
15817c7e
RD
1256 Moves the rectangle by the specified offset. If dx is positive, the
1257 rectangle is moved to the right, if dy is positive, it is moved to the
1258 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc 1259 """
5b5c9bc7 1260 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1261
1262 def Offset(*args, **kwargs):
1263 """
5b5c9bc7 1264 Offset(self, Point pt)
d55e5bfc
RD
1265
1266 Same as OffsetXY but uses dx,dy from Point
1267 """
5b5c9bc7 1268 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1269
1270 def Intersect(*args, **kwargs):
1271 """
5b5c9bc7 1272 Intersect(self, Rect rect) -> Rect
d55e5bfc 1273
5cbf236d 1274 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1275 """
5b5c9bc7 1276 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1277
5cbf236d
RD
1278 def Union(*args, **kwargs):
1279 """
5b5c9bc7 1280 Union(self, Rect rect) -> Rect
5cbf236d
RD
1281
1282 Returns the union of this rectangle and rect.
1283 """
5b5c9bc7 1284 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1285
d55e5bfc
RD
1286 def __add__(*args, **kwargs):
1287 """
5b5c9bc7 1288 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1289
1290 Add the properties of rect to this rectangle and return the result.
1291 """
5b5c9bc7 1292 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1293
1294 def __iadd__(*args, **kwargs):
1295 """
5b5c9bc7 1296 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1297
1298 Add the properties of rect to this rectangle, updating this rectangle.
1299 """
5b5c9bc7 1300 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1301
1302 def __eq__(*args, **kwargs):
1303 """
5b5c9bc7 1304 __eq__(self, Rect rect) -> bool
d55e5bfc
RD
1305
1306 Test for equality.
1307 """
5b5c9bc7 1308 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1309
1310 def __ne__(*args, **kwargs):
1311 """
5b5c9bc7 1312 __ne__(self, Rect rect) -> bool
d55e5bfc
RD
1313
1314 Test for inequality.
1315 """
5b5c9bc7 1316 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc
RD
1317
1318 def InsideXY(*args, **kwargs):
1319 """
1320 InsideXY(self, int x, int y) -> bool
1321
1322 Return True if the point is (not strcitly) inside the rect.
1323 """
5b5c9bc7 1324 return _core_.Rect_InsideXY(*args, **kwargs)
d55e5bfc
RD
1325
1326 def Inside(*args, **kwargs):
1327 """
5b5c9bc7 1328 Inside(self, Point pt) -> bool
d55e5bfc
RD
1329
1330 Return True if the point is (not strcitly) inside the rect.
1331 """
5b5c9bc7 1332 return _core_.Rect_Inside(*args, **kwargs)
d55e5bfc
RD
1333
1334 def Intersects(*args, **kwargs):
1335 """
5b5c9bc7 1336 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1337
1338 Returns True if the rectangles have a non empty intersection.
1339 """
5b5c9bc7 1340 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1341
5b5c9bc7
RD
1342 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1343 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1344 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1345 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
d55e5bfc
RD
1346 def Set(*args, **kwargs):
1347 """
1348 Set(self, int x=0, int y=0, int width=0, int height=0)
1349
1350 Set all rectangle properties.
1351 """
5b5c9bc7 1352 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1353
1354 def Get(*args, **kwargs):
1355 """
1356 Get() -> (x,y,width,height)
1357
1358 Return the rectangle properties as a tuple.
1359 """
5b5c9bc7 1360 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1361
15817c7e 1362 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1363 def __str__(self): return str(self.Get())
1364 def __repr__(self): return 'wx.Rect'+str(self.Get())
1365 def __len__(self): return len(self.Get())
1366 def __getitem__(self, index): return self.Get()[index]
1367 def __setitem__(self, index, val):
1368 if index == 0: self.x = val
1369 elif index == 1: self.y = val
1370 elif index == 2: self.width = val
1371 elif index == 3: self.height = val
1372 else: raise IndexError
1373 def __nonzero__(self): return self.Get() != (0,0,0,0)
1374 __safe_for_unpickling__ = True
1375 def __reduce__(self): return (wx.Rect, self.Get())
1376
1377
5b5c9bc7 1378class RectPtr(Rect):
d55e5bfc
RD
1379 def __init__(self, this):
1380 self.this = this
1381 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1382 self.__class__ = Rect
1383_core_.Rect_swigregister(RectPtr)
d55e5bfc
RD
1384
1385def RectPP(*args, **kwargs):
1386 """
5b5c9bc7 1387 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1388
1389 Create a new Rect object from Points representing two corners.
1390 """
5b5c9bc7 1391 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1392 val.thisown = 1
1393 return val
1394
1395def RectPS(*args, **kwargs):
1396 """
5b5c9bc7 1397 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1398
1399 Create a new Rect from a position and size.
1400 """
5b5c9bc7 1401 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1402 val.thisown = 1
1403 return val
1404
070c48b4
RD
1405def RectS(*args, **kwargs):
1406 """
5b5c9bc7 1407 RectS(Size size) -> Rect
070c48b4
RD
1408
1409 Create a new Rect from a size only.
1410 """
5b5c9bc7 1411 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1412 val.thisown = 1
1413 return val
1414
d55e5bfc 1415
5b5c9bc7 1416def IntersectRect(*args, **kwargs):
d55e5bfc
RD
1417 """
1418 IntersectRect(Rect r1, Rect r2) -> Rect
1419
1420 Calculate and return the intersection of r1 and r2.
1421 """
5b5c9bc7 1422 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1423#---------------------------------------------------------------------------
1424
5b5c9bc7 1425class Point2D(object):
15817c7e
RD
1426 """
1427 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1428 with floating point values.
1429 """
d55e5bfc
RD
1430 def __repr__(self):
1431 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1432 def __init__(self, *args, **kwargs):
1433 """
5b5c9bc7 1434 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1435
1436 Create a w.Point2D object.
1437 """
5b5c9bc7 1438 newobj = _core_.new_Point2D(*args, **kwargs)
d55e5bfc
RD
1439 self.this = newobj.this
1440 self.thisown = 1
1441 del newobj.thisown
1442 def GetFloor(*args, **kwargs):
fd2dc343
RD
1443 """
1444 GetFloor() -> (x,y)
1445
1446 Convert to integer
1447 """
5b5c9bc7 1448 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1449
1450 def GetRounded(*args, **kwargs):
fd2dc343
RD
1451 """
1452 GetRounded() -> (x,y)
1453
1454 Convert to integer
1455 """
5b5c9bc7 1456 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1457
1458 def GetVectorLength(*args, **kwargs):
1459 """GetVectorLength(self) -> double"""
5b5c9bc7 1460 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1461
1462 def GetVectorAngle(*args, **kwargs):
1463 """GetVectorAngle(self) -> double"""
5b5c9bc7 1464 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1465
1466 def SetVectorLength(*args, **kwargs):
1467 """SetVectorLength(self, double length)"""
5b5c9bc7 1468 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1469
1470 def SetVectorAngle(*args, **kwargs):
1471 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1472 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1473
1474 def SetPolarCoordinates(self, angle, length):
1475 self.SetVectorLength(length)
1476 self.SetVectorAngle(angle)
1477 def Normalize(self):
1478 self.SetVectorLength(1.0)
1479
1480 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1481 """GetDistance(self, Point2D pt) -> double"""
1482 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1483
1484 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1485 """GetDistanceSquare(self, Point2D pt) -> double"""
1486 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1487
1488 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1489 """GetDotProduct(self, Point2D vec) -> double"""
1490 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1491
1492 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1493 """GetCrossProduct(self, Point2D vec) -> double"""
1494 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1495
1496 def __neg__(*args, **kwargs):
1497 """
5b5c9bc7 1498 __neg__(self) -> Point2D
d55e5bfc
RD
1499
1500 the reflection of this point
1501 """
5b5c9bc7 1502 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1503
1504 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1505 """__iadd__(self, Point2D pt) -> Point2D"""
1506 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1507
1508 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1509 """__isub__(self, Point2D pt) -> Point2D"""
1510 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1511
1512 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1513 """__imul__(self, Point2D pt) -> Point2D"""
1514 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1515
1516 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1517 """__idiv__(self, Point2D pt) -> Point2D"""
1518 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1519
1520 def __eq__(*args, **kwargs):
1521 """
5b5c9bc7 1522 __eq__(self, Point2D pt) -> bool
d55e5bfc
RD
1523
1524 Test for equality
1525 """
5b5c9bc7 1526 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1527
1528 def __ne__(*args, **kwargs):
1529 """
5b5c9bc7 1530 __ne__(self, Point2D pt) -> bool
d55e5bfc
RD
1531
1532 Test for inequality
1533 """
5b5c9bc7 1534 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1535
5b5c9bc7
RD
1536 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1537 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1538 def Set(*args, **kwargs):
1539 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1540 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1541
1542 def Get(*args, **kwargs):
1543 """
1544 Get() -> (x,y)
1545
1546 Return x and y properties as a tuple.
1547 """
5b5c9bc7 1548 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1549
15817c7e 1550 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1551 def __str__(self): return str(self.Get())
1552 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1553 def __len__(self): return len(self.Get())
1554 def __getitem__(self, index): return self.Get()[index]
1555 def __setitem__(self, index, val):
1556 if index == 0: self.x = val
1557 elif index == 1: self.y = val
1558 else: raise IndexError
1559 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1560 __safe_for_unpickling__ = True
1561 def __reduce__(self): return (wx.Point2D, self.Get())
1562
1563
5b5c9bc7 1564class Point2DPtr(Point2D):
d55e5bfc
RD
1565 def __init__(self, this):
1566 self.this = this
1567 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1568 self.__class__ = Point2D
1569_core_.Point2D_swigregister(Point2DPtr)
d55e5bfc
RD
1570
1571def Point2DCopy(*args, **kwargs):
1572 """
5b5c9bc7 1573 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1574
1575 Create a w.Point2D object.
1576 """
5b5c9bc7 1577 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1578 val.thisown = 1
1579 return val
1580
1581def Point2DFromPoint(*args, **kwargs):
1582 """
5b5c9bc7 1583 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1584
1585 Create a w.Point2D object.
1586 """
5b5c9bc7 1587 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1588 val.thisown = 1
1589 return val
1590
1591#---------------------------------------------------------------------------
1592
5b5c9bc7
RD
1593FromStart = _core_.FromStart
1594FromCurrent = _core_.FromCurrent
1595FromEnd = _core_.FromEnd
d55e5bfc 1596class InputStream(object):
36ed4f51 1597 """Proxy of C++ InputStream class"""
d55e5bfc
RD
1598 def __repr__(self):
1599 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1600 def __init__(self, *args, **kwargs):
1601 """__init__(self, PyObject p) -> InputStream"""
5b5c9bc7 1602 newobj = _core_.new_InputStream(*args, **kwargs)
d55e5bfc
RD
1603 self.this = newobj.this
1604 self.thisown = 1
1605 del newobj.thisown
5b5c9bc7 1606 def __del__(self, destroy=_core_.delete_InputStream):
8fb0e70a
RD
1607 """__del__(self)"""
1608 try:
1609 if self.thisown: destroy(self)
1610 except: pass
1611
d55e5bfc
RD
1612 def close(*args, **kwargs):
1613 """close(self)"""
5b5c9bc7 1614 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1615
1616 def flush(*args, **kwargs):
1617 """flush(self)"""
5b5c9bc7 1618 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1619
1620 def eof(*args, **kwargs):
1621 """eof(self) -> bool"""
5b5c9bc7 1622 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1623
1624 def read(*args, **kwargs):
1625 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1626 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1627
1628 def readline(*args, **kwargs):
1629 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1630 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1631
1632 def readlines(*args, **kwargs):
1633 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1634 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1635
1636 def seek(*args, **kwargs):
1637 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1638 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1639
1640 def tell(*args, **kwargs):
1641 """tell(self) -> int"""
5b5c9bc7 1642 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1643
1644 def Peek(*args, **kwargs):
1645 """Peek(self) -> char"""
5b5c9bc7 1646 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1647
1648 def GetC(*args, **kwargs):
1649 """GetC(self) -> char"""
5b5c9bc7 1650 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1651
1652 def LastRead(*args, **kwargs):
1653 """LastRead(self) -> size_t"""
5b5c9bc7 1654 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1655
1656 def CanRead(*args, **kwargs):
1657 """CanRead(self) -> bool"""
5b5c9bc7 1658 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1659
1660 def Eof(*args, **kwargs):
1661 """Eof(self) -> bool"""
5b5c9bc7 1662 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1663
1664 def Ungetch(*args, **kwargs):
1665 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1666 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1667
1668 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1669 """SeekI(self, long pos, int mode=FromStart) -> long"""
1670 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1671
1672 def TellI(*args, **kwargs):
1673 """TellI(self) -> long"""
5b5c9bc7 1674 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc
RD
1675
1676
1677class InputStreamPtr(InputStream):
1678 def __init__(self, this):
1679 self.this = this
1680 if not hasattr(self,"thisown"): self.thisown = 0
1681 self.__class__ = InputStream
5b5c9bc7
RD
1682_core_.InputStream_swigregister(InputStreamPtr)
1683DefaultPosition = cvar.DefaultPosition
1684DefaultSize = cvar.DefaultSize
d55e5bfc 1685
5b5c9bc7
RD
1686class OutputStream(object):
1687 """Proxy of C++ OutputStream class"""
d55e5bfc
RD
1688 def __init__(self): raise RuntimeError, "No constructor defined"
1689 def __repr__(self):
1690 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1691 def write(*args, **kwargs):
1692 """write(self, PyObject obj)"""
5b5c9bc7 1693 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc
RD
1694
1695
5b5c9bc7 1696class OutputStreamPtr(OutputStream):
d55e5bfc
RD
1697 def __init__(self, this):
1698 self.this = this
1699 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1700 self.__class__ = OutputStream
1701_core_.OutputStream_swigregister(OutputStreamPtr)
d55e5bfc
RD
1702
1703#---------------------------------------------------------------------------
1704
5b5c9bc7
RD
1705class FSFile(Object):
1706 """Proxy of C++ FSFile class"""
d55e5bfc
RD
1707 def __repr__(self):
1708 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1709 def __init__(self, *args, **kwargs):
1710 """
5b5c9bc7
RD
1711 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1712 DateTime modif) -> FSFile
d55e5bfc 1713 """
5b5c9bc7 1714 newobj = _core_.new_FSFile(*args, **kwargs)
d55e5bfc
RD
1715 self.this = newobj.this
1716 self.thisown = 1
1717 del newobj.thisown
e2950dbb 1718 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1719
5b5c9bc7 1720 def __del__(self, destroy=_core_.delete_FSFile):
d55e5bfc
RD
1721 """__del__(self)"""
1722 try:
1723 if self.thisown: destroy(self)
1724 except: pass
1725
1726 def GetStream(*args, **kwargs):
5b5c9bc7
RD
1727 """GetStream(self) -> InputStream"""
1728 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc
RD
1729
1730 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1731 """GetMimeType(self) -> String"""
1732 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1733
1734 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
1735 """GetLocation(self) -> String"""
1736 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
1737
1738 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1739 """GetAnchor(self) -> String"""
1740 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1741
1742 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
1743 """GetModificationTime(self) -> DateTime"""
1744 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc
RD
1745
1746
5b5c9bc7 1747class FSFilePtr(FSFile):
d55e5bfc
RD
1748 def __init__(self, this):
1749 self.this = this
1750 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1751 self.__class__ = FSFile
1752_core_.FSFile_swigregister(FSFilePtr)
d55e5bfc
RD
1753
1754class CPPFileSystemHandler(object):
36ed4f51 1755 """Proxy of C++ CPPFileSystemHandler class"""
d55e5bfc
RD
1756 def __init__(self): raise RuntimeError, "No constructor defined"
1757 def __repr__(self):
1758 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1759
1760class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1761 def __init__(self, this):
1762 self.this = this
1763 if not hasattr(self,"thisown"): self.thisown = 0
1764 self.__class__ = CPPFileSystemHandler
5b5c9bc7 1765_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
d55e5bfc
RD
1766
1767class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1768 """Proxy of C++ FileSystemHandler class"""
d55e5bfc
RD
1769 def __repr__(self):
1770 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1771 def __init__(self, *args, **kwargs):
1772 """__init__(self) -> FileSystemHandler"""
5b5c9bc7 1773 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
d55e5bfc
RD
1774 self.this = newobj.this
1775 self.thisown = 1
1776 del newobj.thisown
1777 self._setCallbackInfo(self, FileSystemHandler)
1778
1779 def _setCallbackInfo(*args, **kwargs):
1780 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 1781 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
1782
1783 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1784 """CanOpen(self, String location) -> bool"""
1785 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1786
1787 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1788 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1789 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1790
1791 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1792 """FindFirst(self, String spec, int flags=0) -> String"""
1793 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1794
1795 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1796 """FindNext(self) -> String"""
1797 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1798
1799 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
1800 """GetProtocol(self, String location) -> String"""
1801 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
1802
1803 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
1804 """GetLeftLocation(self, String location) -> String"""
1805 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
1806
1807 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1808 """GetAnchor(self, String location) -> String"""
1809 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1810
1811 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
1812 """GetRightLocation(self, String location) -> String"""
1813 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
1814
1815 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
1816 """GetMimeTypeFromExt(self, String location) -> String"""
1817 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc
RD
1818
1819
1820class FileSystemHandlerPtr(FileSystemHandler):
1821 def __init__(self, this):
1822 self.this = this
1823 if not hasattr(self,"thisown"): self.thisown = 0
1824 self.__class__ = FileSystemHandler
5b5c9bc7 1825_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
d55e5bfc 1826
5b5c9bc7
RD
1827class FileSystem(Object):
1828 """Proxy of C++ FileSystem class"""
d55e5bfc
RD
1829 def __repr__(self):
1830 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1831 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1832 """__init__(self) -> FileSystem"""
1833 newobj = _core_.new_FileSystem(*args, **kwargs)
d55e5bfc
RD
1834 self.this = newobj.this
1835 self.thisown = 1
1836 del newobj.thisown
5b5c9bc7 1837 def __del__(self, destroy=_core_.delete_FileSystem):
d55e5bfc
RD
1838 """__del__(self)"""
1839 try:
1840 if self.thisown: destroy(self)
1841 except: pass
1842
1843 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
1844 """ChangePathTo(self, String location, bool is_dir=False)"""
1845 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
1846
1847 def GetPath(*args, **kwargs):
5b5c9bc7
RD
1848 """GetPath(self) -> String"""
1849 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
1850
1851 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1852 """OpenFile(self, String location) -> FSFile"""
1853 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
1854
1855 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1856 """FindFirst(self, String spec, int flags=0) -> String"""
1857 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
1858
1859 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1860 """FindNext(self) -> String"""
1861 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
1862
1863 def AddHandler(*args, **kwargs):
d6c14a4c 1864 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 1865 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
1866
1867 AddHandler = staticmethod(AddHandler)
1868 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1869 """CleanUpHandlers()"""
5b5c9bc7 1870 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
1871
1872 CleanUpHandlers = staticmethod(CleanUpHandlers)
1873 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
1874 """FileNameToURL(String filename) -> String"""
1875 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
1876
1877 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 1878 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
1879 """URLToFileName(String url) -> String"""
1880 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
1881
1882 URLToFileName = staticmethod(URLToFileName)
d55e5bfc 1883
5b5c9bc7 1884class FileSystemPtr(FileSystem):
d55e5bfc
RD
1885 def __init__(self, this):
1886 self.this = this
1887 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1888 self.__class__ = FileSystem
1889_core_.FileSystem_swigregister(FileSystemPtr)
d55e5bfc 1890
5b5c9bc7
RD
1891def FileSystem_AddHandler(*args, **kwargs):
1892 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1893 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1894
5b5c9bc7
RD
1895def FileSystem_CleanUpHandlers(*args, **kwargs):
1896 """FileSystem_CleanUpHandlers()"""
1897 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc 1898
5b5c9bc7
RD
1899def FileSystem_FileNameToURL(*args, **kwargs):
1900 """FileSystem_FileNameToURL(String filename) -> String"""
1901 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1902
5b5c9bc7
RD
1903def FileSystem_URLToFileName(*args, **kwargs):
1904 """FileSystem_URLToFileName(String url) -> String"""
1905 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1906
5b5c9bc7
RD
1907class InternetFSHandler(CPPFileSystemHandler):
1908 """Proxy of C++ InternetFSHandler class"""
d55e5bfc
RD
1909 def __repr__(self):
1910 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1911 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1912 """__init__(self) -> InternetFSHandler"""
1913 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
d55e5bfc
RD
1914 self.this = newobj.this
1915 self.thisown = 1
1916 del newobj.thisown
1917 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1918 """CanOpen(self, String location) -> bool"""
1919 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1920
1921 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1922 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1923 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1924
1925
5b5c9bc7 1926class InternetFSHandlerPtr(InternetFSHandler):
d55e5bfc
RD
1927 def __init__(self, this):
1928 self.this = this
1929 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1930 self.__class__ = InternetFSHandler
1931_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
d55e5bfc 1932
5b5c9bc7
RD
1933class ZipFSHandler(CPPFileSystemHandler):
1934 """Proxy of C++ ZipFSHandler class"""
d55e5bfc
RD
1935 def __repr__(self):
1936 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1937 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
1938 """__init__(self) -> ZipFSHandler"""
1939 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
d55e5bfc
RD
1940 self.this = newobj.this
1941 self.thisown = 1
1942 del newobj.thisown
1943 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1944 """CanOpen(self, String location) -> bool"""
1945 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1946
1947 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1948 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1949 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1950
1951 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1952 """FindFirst(self, String spec, int flags=0) -> String"""
1953 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1954
1955 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1956 """FindNext(self) -> String"""
1957 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1958
1959
5b5c9bc7 1960class ZipFSHandlerPtr(ZipFSHandler):
d55e5bfc
RD
1961 def __init__(self, this):
1962 self.this = this
1963 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
1964 self.__class__ = ZipFSHandler
1965_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
d55e5bfc
RD
1966
1967
1968def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
5b5c9bc7
RD
1969 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1970 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1971
1972def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
5b5c9bc7
RD
1973 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1974 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1975
1976def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
5b5c9bc7
RD
1977 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1978 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
1979def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1980 """
1981 Add 'file' to the memory filesystem. The dataItem parameter can
1982 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1983 arbitrary data. If a bitmap or image is used then the imgType
1984 parameter should specify what kind of image file it should be
1985 written as, wx.BITMAP_TYPE_PNG, etc.
1986 """
1987 if isinstance(dataItem, wx.Image):
1988 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1989 elif isinstance(dataItem, wx.Bitmap):
1990 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1991 elif type(dataItem) == str:
1992 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1993 else:
1994 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc 1995
5b5c9bc7
RD
1996class MemoryFSHandler(CPPFileSystemHandler):
1997 """Proxy of C++ MemoryFSHandler class"""
d55e5bfc
RD
1998 def __repr__(self):
1999 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2000 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2001 """__init__(self) -> MemoryFSHandler"""
2002 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
d55e5bfc
RD
2003 self.this = newobj.this
2004 self.thisown = 1
2005 del newobj.thisown
2006 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
2007 """RemoveFile(String filename)"""
2008 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
2009
2010 RemoveFile = staticmethod(RemoveFile)
2011 AddFile = staticmethod(MemoryFSHandler_AddFile)
2012 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2013 """CanOpen(self, String location) -> bool"""
2014 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2015
2016 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2017 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2018 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2019
2020 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2021 """FindFirst(self, String spec, int flags=0) -> String"""
2022 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2023
2024 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2025 """FindNext(self) -> String"""
2026 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
2027
2028
5b5c9bc7 2029class MemoryFSHandlerPtr(MemoryFSHandler):
d55e5bfc
RD
2030 def __init__(self, this):
2031 self.this = this
2032 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2033 self.__class__ = MemoryFSHandler
2034_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
d55e5bfc 2035
5b5c9bc7
RD
2036def MemoryFSHandler_RemoveFile(*args, **kwargs):
2037 """MemoryFSHandler_RemoveFile(String filename)"""
2038 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 2039
5b5c9bc7
RD
2040IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2041IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2042IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
2043#---------------------------------------------------------------------------
2044
5b5c9bc7 2045class ImageHandler(Object):
27fb7603
RD
2046 """
2047 This is the base class for implementing image file loading/saving, and
2048 image creation from data. It is used within `wx.Image` and is not
2049 normally seen by the application.
2050 """
d55e5bfc
RD
2051 def __init__(self): raise RuntimeError, "No constructor defined"
2052 def __repr__(self):
2053 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2054 def GetName(*args, **kwargs):
5b5c9bc7
RD
2055 """GetName(self) -> String"""
2056 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
2057
2058 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
2059 """GetExtension(self) -> String"""
2060 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
2061
2062 def GetType(*args, **kwargs):
2063 """GetType(self) -> long"""
5b5c9bc7 2064 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
2065
2066 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
2067 """GetMimeType(self) -> String"""
2068 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
2069
2070 def CanRead(*args, **kwargs):
5b5c9bc7
RD
2071 """CanRead(self, String name) -> bool"""
2072 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc
RD
2073
2074 def SetName(*args, **kwargs):
5b5c9bc7
RD
2075 """SetName(self, String name)"""
2076 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
2077
2078 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2079 """SetExtension(self, String extension)"""
2080 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2081
2082 def SetType(*args, **kwargs):
2083 """SetType(self, long type)"""
5b5c9bc7 2084 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2085
2086 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2087 """SetMimeType(self, String mimetype)"""
2088 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc
RD
2089
2090
5b5c9bc7 2091class ImageHandlerPtr(ImageHandler):
d55e5bfc
RD
2092 def __init__(self, this):
2093 self.this = this
2094 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2095 self.__class__ = ImageHandler
2096_core_.ImageHandler_swigregister(ImageHandlerPtr)
d55e5bfc 2097
5b5c9bc7
RD
2098class ImageHistogram(object):
2099 """Proxy of C++ ImageHistogram class"""
d55e5bfc
RD
2100 def __repr__(self):
2101 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2102 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
2103 """__init__(self) -> ImageHistogram"""
2104 newobj = _core_.new_ImageHistogram(*args, **kwargs)
d55e5bfc
RD
2105 self.this = newobj.this
2106 self.thisown = 1
2107 del newobj.thisown
2108 def MakeKey(*args, **kwargs):
2109 """
7a27cf7c 2110 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2111
2112 Get the key in the histogram for the given RGB values
2113 """
5b5c9bc7 2114 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2115
2116 MakeKey = staticmethod(MakeKey)
2117 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2118 """
2119 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2120
2121 Find first colour that is not used in the image and has higher RGB
2122 values than startR, startG, startB. Returns a tuple consisting of a
2123 success flag and rgb values.
2124 """
5b5c9bc7 2125 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2126
f1cbd8fa
RD
2127 def GetCount(*args, **kwargs):
2128 """
2129 GetCount(self, unsigned long key) -> unsigned long
2130
2131 Returns the pixel count for the given key. Use `MakeKey` to create a
2132 key value from a RGB tripple.
2133 """
5b5c9bc7 2134 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2135
2136 def GetCountRGB(*args, **kwargs):
2137 """
7a27cf7c 2138 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2139
2140 Returns the pixel count for the given RGB values.
2141 """
5b5c9bc7 2142 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2143
2144 def GetCountColour(*args, **kwargs):
2145 """
5b5c9bc7 2146 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2147
2148 Returns the pixel count for the given `wx.Colour` value.
2149 """
5b5c9bc7 2150 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2151
d55e5bfc 2152
5b5c9bc7 2153class ImageHistogramPtr(ImageHistogram):
d55e5bfc
RD
2154 def __init__(self, this):
2155 self.this = this
2156 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2157 self.__class__ = ImageHistogram
2158_core_.ImageHistogram_swigregister(ImageHistogramPtr)
d55e5bfc 2159
5b5c9bc7 2160def ImageHistogram_MakeKey(*args, **kwargs):
d55e5bfc 2161 """
7a27cf7c 2162 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2163
2164 Get the key in the histogram for the given RGB values
2165 """
5b5c9bc7 2166 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2167
5b5c9bc7 2168class Image(Object):
7a27cf7c
RD
2169 """
2170 A platform-independent image class. An image can be created from
2171 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2172 variety of formats. Functions are available to set and get image
2173 bits, so it can be used for basic image manipulation.
2174
2175 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2176 platform-specific `wx.Bitmap` object must be created from it using the
2177 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2178 device context, using `wx.DC.DrawBitmap`.
2179
2180 One colour value of the image may be used as a mask colour which will
2181 lead to the automatic creation of a `wx.Mask` object associated to the
2182 bitmap object.
2183
2184 wx.Image supports alpha channel data, that is in addition to a byte
2185 for the red, green and blue colour components for each pixel it also
2186 stores a byte representing the pixel opacity. An alpha value of 0
2187 corresponds to a transparent pixel (null opacity) while a value of 255
2188 means that the pixel is 100% opaque.
2189
2190 Unlike RGB data, not all images have an alpha channel and before using
2191 `GetAlpha` you should check if this image contains an alpha channel
2192 with `HasAlpha`. Note that currently only images loaded from PNG files
2193 with transparency information will have an alpha channel.
2194 """
d55e5bfc
RD
2195 def __repr__(self):
2196 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2197 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2198 """
2199 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2200
2201 Loads an image from a file.
2202 """
5b5c9bc7 2203 newobj = _core_.new_Image(*args, **kwargs)
d55e5bfc
RD
2204 self.this = newobj.this
2205 self.thisown = 1
2206 del newobj.thisown
5b5c9bc7 2207 def __del__(self, destroy=_core_.delete_Image):
d55e5bfc
RD
2208 """__del__(self)"""
2209 try:
2210 if self.thisown: destroy(self)
2211 except: pass
2212
2213 def Create(*args, **kwargs):
7a27cf7c
RD
2214 """
2215 Create(self, int width, int height, bool clear=True)
2216
2217 Creates a fresh image. If clear is ``True``, the new image will be
2218 initialized to black. Otherwise, the image data will be uninitialized.
2219 """
5b5c9bc7 2220 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2221
2222 def Destroy(*args, **kwargs):
2223 """
2224 Destroy(self)
2225
7a27cf7c 2226 Destroys the image data.
d55e5bfc 2227 """
5b5c9bc7 2228 return _core_.Image_Destroy(*args, **kwargs)
d55e5bfc
RD
2229
2230 def Scale(*args, **kwargs):
7a27cf7c
RD
2231 """
2232 Scale(self, int width, int height) -> Image
2233
2234 Returns a scaled version of the image. This is also useful for scaling
2235 bitmaps in general as the only other way to scale bitmaps is to blit a
2236 `wx.MemoryDC` into another `wx.MemoryDC`.
2237 """
5b5c9bc7 2238 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc
RD
2239
2240 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2241 """
2242 ShrinkBy(self, int xFactor, int yFactor) -> Image
2243
2244 Return a version of the image scaled smaller by the given factors.
2245 """
5b5c9bc7 2246 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
2247
2248 def Rescale(*args, **kwargs):
7a27cf7c
RD
2249 """
2250 Rescale(self, int width, int height) -> Image
2251
2252 Changes the size of the image in-place by scaling it: after a call to
2253 this function, the image will have the given width and height.
2254
2255 Returns the (modified) image itself.
2256 """
5b5c9bc7 2257 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 2258
aff4cc5c 2259 def Resize(*args, **kwargs):
7a27cf7c
RD
2260 """
2261 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2262
2263 Changes the size of the image in-place without scaling it, by adding
2264 either a border with the given colour or cropping as necessary. The
2265 image is pasted into a new image with the given size and background
2266 colour at the position pos relative to the upper left of the new
2267 image. If red = green = blue = -1 then use either the current mask
2268 colour if set or find, use, and set a suitable mask colour for any
2269 newly exposed areas.
2270
2271 Returns the (modified) image itself.
2272 """
5b5c9bc7 2273 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 2274
d55e5bfc 2275 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2276 """
2277 SetRGB(self, int x, int y, byte r, byte g, byte b)
2278
2279 Sets the pixel at the given coordinate. This routine performs
2280 bounds-checks for the coordinate so it can be considered a safe way to
2281 manipulate the data, but in some cases this might be too slow so that
2282 the data will have to be set directly. In that case you will have to
2283 get access to the image data using the `GetData` method.
2284 """
5b5c9bc7 2285 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 2286
aff4cc5c 2287 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2288 """
2289 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2290
2291 Sets the colour of the pixels within the given rectangle. This routine
2292 performs bounds-checks for the rectangle so it can be considered a
2293 safe way to manipulate the data.
2294 """
5b5c9bc7 2295 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 2296
d55e5bfc 2297 def GetRed(*args, **kwargs):
7a27cf7c
RD
2298 """
2299 GetRed(self, int x, int y) -> byte
2300
2301 Returns the red intensity at the given coordinate.
2302 """
5b5c9bc7 2303 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
2304
2305 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2306 """
2307 GetGreen(self, int x, int y) -> byte
2308
2309 Returns the green intensity at the given coordinate.
2310 """
5b5c9bc7 2311 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
2312
2313 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2314 """
2315 GetBlue(self, int x, int y) -> byte
2316
2317 Returns the blue intensity at the given coordinate.
2318 """
5b5c9bc7 2319 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
2320
2321 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2322 """
2323 SetAlpha(self, int x, int y, byte alpha)
2324
2325 Sets the alpha value for the given pixel. This function should only be
2326 called if the image has alpha channel data, use `HasAlpha` to check
2327 for this.
2328 """
5b5c9bc7 2329 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
2330
2331 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2332 """
2333 GetAlpha(self, int x, int y) -> byte
2334
2335 Returns the alpha value for the given pixel. This function may only be
2336 called for the images with alpha channel, use `HasAlpha` to check for
2337 this.
2338
2339 The returned value is the *opacity* of the image, i.e. the value of 0
2340 corresponds to the fully transparent pixels while the value of 255 to
2341 the fully opaque pixels.
2342 """
5b5c9bc7 2343 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
2344
2345 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2346 """
2347 HasAlpha(self) -> bool
2348
2349 Returns true if this image has alpha channel, false otherwise.
2350 """
5b5c9bc7 2351 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 2352
68350608
RD
2353 def InitAlpha(*args, **kwargs):
2354 """
2355 InitAlpha(self)
2356
2357 Initializes the image alpha channel data. It is an error to call it if
2358 the image already has alpha data. If it doesn't, alpha data will be by
2359 default initialized to all pixels being fully opaque. But if the image
2360 has a a mask colour, all mask pixels will be completely transparent.
2361 """
5b5c9bc7
RD
2362 return _core_.Image_InitAlpha(*args, **kwargs)
2363
2364 def IsTransparent(*args, **kwargs):
2365 """
7a27cf7c 2366 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2367
7a27cf7c
RD
2368 Returns ``True`` if this pixel is masked or has an alpha value less
2369 than the spcified threshold.
5b5c9bc7
RD
2370 """
2371 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2372
d55e5bfc 2373 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2374 """
2375 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2376
2377 Find first colour that is not used in the image and has higher RGB
2378 values than startR, startG, startB. Returns a tuple consisting of a
2379 success flag and rgb values.
2380 """
5b5c9bc7 2381 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2382
4cf4100f
RD
2383 def ConvertAlphaToMask(*args, **kwargs):
2384 """
5b5c9bc7 2385 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2386
7a27cf7c
RD
2387 If the image has alpha channel, this method converts it to mask. All
2388 pixels with alpha value less than ``threshold`` are replaced with the
2389 mask colour and the alpha channel is removed. The mask colour is
2390 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2391
2392 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2393 nothing.
2394 """
5b5c9bc7 2395 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 2396
8fb0e70a
RD
2397 def ConvertColourToAlpha(*args, **kwargs):
2398 """
7a27cf7c 2399 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2400
2401 This method converts an image where the original alpha information is
2402 only available as a shades of a colour (actually shades of grey)
2403 typically when you draw anti-aliased text into a bitmap. The DC
2404 drawing routines draw grey values on the black background although
2405 they actually mean to draw white with differnt alpha values. This
2406 method reverses it, assuming a black (!) background and white text.
2407 The method will then fill up the whole image with the colour given.
2408 """
5b5c9bc7 2409 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 2410
d55e5bfc 2411 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2412 """
2413 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2414
2415 Sets the image's mask so that the pixels that have RGB value of
2416 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2417 by first finding an unused colour in the image, setting this colour as
2418 the mask colour and then using this colour to draw all pixels in the
2419 image who corresponding pixel in mask has given RGB value.
2420
2421 Returns ``False`` if ``mask`` does not have same dimensions as the
2422 image or if there is no unused colour left. Returns ``True`` if the
2423 mask was successfully applied.
2424
2425 Note that this method involves computing the histogram, which is
2426 computationally intensive operation.
2427 """
5b5c9bc7 2428 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
2429
2430 def CanRead(*args, **kwargs):
7a27cf7c
RD
2431 """
2432 CanRead(String filename) -> bool
2433
2434 Returns True if the image handlers can read this file.
2435 """
5b5c9bc7 2436 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2437
2438 CanRead = staticmethod(CanRead)
2439 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2440 """
2441 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2442
2443 If the image file contains more than one image and the image handler
2444 is capable of retrieving these individually, this function will return
2445 the number of available images.
2446 """
5b5c9bc7 2447 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2448
2449 GetImageCount = staticmethod(GetImageCount)
2450 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2451 """
2452 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2453
2454 Loads an image from a file. If no handler type is provided, the
2455 library will try to autodetect the format.
2456 """
5b5c9bc7 2457 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
2458
2459 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2460 """
2461 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2462
2463 Loads an image from a file, specifying the image type with a MIME type
2464 string.
2465 """
5b5c9bc7 2466 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
2467
2468 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2469 """
2470 SaveFile(self, String name, int type) -> bool
2471
2472 Saves an image in the named file.
2473 """
5b5c9bc7 2474 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
2475
2476 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2477 """
2478 SaveMimeFile(self, String name, String mimetype) -> bool
2479
2480 Saves an image in the named file.
2481 """
5b5c9bc7 2482 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
2483
2484 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2485 """
2486 CanReadStream(InputStream stream) -> bool
2487
2488 Returns True if the image handlers can read an image file from the
2489 data currently on the input stream, or a readable Python file-like
2490 object.
2491 """
5b5c9bc7 2492 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2493
2494 CanReadStream = staticmethod(CanReadStream)
2495 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2496 """
2497 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2498
2499 Loads an image from an input stream or a readable Python file-like
2500 object. If no handler type is provided, the library will try to
2501 autodetect the format.
2502 """
5b5c9bc7 2503 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
2504
2505 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2506 """
2507 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2508
2509 Loads an image from an input stream or a readable Python file-like
2510 object, using a MIME type string to specify the image file format.
2511 """
5b5c9bc7 2512 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc
RD
2513
2514 def Ok(*args, **kwargs):
7a27cf7c
RD
2515 """
2516 Ok(self) -> bool
2517
2518 Returns true if image data is present.
2519 """
5b5c9bc7 2520 return _core_.Image_Ok(*args, **kwargs)
d55e5bfc
RD
2521
2522 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2523 """
2524 GetWidth(self) -> int
2525
2526 Gets the width of the image in pixels.
2527 """
5b5c9bc7 2528 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2529
2530 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2531 """
2532 GetHeight(self) -> int
2533
2534 Gets the height of the image in pixels.
2535 """
5b5c9bc7 2536 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2537
2538 def GetSize(*args, **kwargs):
7a27cf7c
RD
2539 """
2540 GetSize(self) -> Size
2541
2542 Returns the size of the image in pixels.
2543 """
5b5c9bc7 2544 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2545
2546 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2547 """
2548 GetSubImage(self, Rect rect) -> Image
2549
2550 Returns a sub image of the current one as long as the rect belongs
2551 entirely to the image.
2552 """
5b5c9bc7 2553 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2554
aff4cc5c 2555 def Size(*args, **kwargs):
7a27cf7c
RD
2556 """
2557 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2558
2559 Returns a resized version of this image without scaling it by adding
2560 either a border with the given colour or cropping as necessary. The
2561 image is pasted into a new image with the given size and background
2562 colour at the position ``pos`` relative to the upper left of the new
2563 image. If red = green = blue = -1 then use either the current mask
2564 colour if set or find, use, and set a suitable mask colour for any
2565 newly exposed areas.
2566 """
5b5c9bc7 2567 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2568
d55e5bfc 2569 def Copy(*args, **kwargs):
7a27cf7c
RD
2570 """
2571 Copy(self) -> Image
2572
2573 Returns an identical copy of the image.
2574 """
5b5c9bc7 2575 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2576
2577 def Paste(*args, **kwargs):
7a27cf7c
RD
2578 """
2579 Paste(self, Image image, int x, int y)
2580
2581 Pastes ``image`` into this instance and takes care of the mask colour
2582 and any out of bounds problems.
2583 """
5b5c9bc7 2584 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2585
2586 def GetData(*args, **kwargs):
bb2ef2cc
RD
2587 """
2588 GetData(self) -> PyObject
2589
2590 Returns a string containing a copy of the RGB bytes of the image.
2591 """
5b5c9bc7 2592 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2593
2594 def SetData(*args, **kwargs):
bb2ef2cc
RD
2595 """
2596 SetData(self, buffer data)
2597
2598 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2599 either a string or a buffer object holding the data and the length of
2600 the data must be width*height*3.
2601 """
5b5c9bc7 2602 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2603
2604 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2605 """
2606 GetDataBuffer(self) -> PyObject
2607
2608 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2609 image data buffer inside the wx.Image. You need to ensure that you do
2610 not use this buffer object after the image has been destroyed.
bb2ef2cc 2611 """
5b5c9bc7 2612 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2613
2614 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2615 """
2616 SetDataBuffer(self, buffer data)
2617
2618 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2619 object. This can save making an extra copy of the data but you must
2620 ensure that the buffer object lives longer than the wx.Image does.
bb2ef2cc 2621 """
5b5c9bc7 2622 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2623
2624 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2625 """
2626 GetAlphaData(self) -> PyObject
2627
2628 Returns a string containing a copy of the alpha bytes of the image.
2629 """
5b5c9bc7 2630 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2631
2632 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2633 """
2634 SetAlphaData(self, buffer alpha)
2635
2636 Resets the Image's alpha data from a buffer of bytes. Accepts either
2637 a string or a buffer object holding the data and the length of the
2638 data must be width*height.
2639 """
5b5c9bc7 2640 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2641
2642 def GetAlphaBuffer(*args, **kwargs):
2643 """GetAlphaBuffer(self) -> PyObject"""
5b5c9bc7 2644 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2645
2646 def SetAlphaBuffer(*args, **kwargs):
bb2ef2cc 2647 """SetAlphaBuffer(self, buffer alpha)"""
5b5c9bc7 2648 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2649
2650 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2651 """
2652 SetMaskColour(self, byte r, byte g, byte b)
2653
2654 Sets the mask colour for this image (and tells the image to use the
2655 mask).
2656 """
5b5c9bc7 2657 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 2658
aff4cc5c
RD
2659 def GetOrFindMaskColour(*args, **kwargs):
2660 """
2661 GetOrFindMaskColour() -> (r,g,b)
2662
2663 Get the current mask colour or find a suitable colour.
2664 """
5b5c9bc7 2665 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2666
d55e5bfc 2667 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2668 """
2669 GetMaskRed(self) -> byte
2670
2671 Gets the red component of the mask colour.
2672 """
5b5c9bc7 2673 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
2674
2675 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2676 """
2677 GetMaskGreen(self) -> byte
2678
2679 Gets the green component of the mask colour.
2680 """
5b5c9bc7 2681 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
2682
2683 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2684 """
2685 GetMaskBlue(self) -> byte
2686
2687 Gets the blue component of the mask colour.
2688 """
5b5c9bc7 2689 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
2690
2691 def SetMask(*args, **kwargs):
7a27cf7c
RD
2692 """
2693 SetMask(self, bool mask=True)
2694
2695 Specifies whether there is a mask or not. The area of the mask is
2696 determined by the current mask colour.
2697 """
5b5c9bc7 2698 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
2699
2700 def HasMask(*args, **kwargs):
7a27cf7c
RD
2701 """
2702 HasMask(self) -> bool
2703
2704 Returns ``True`` if there is a mask active, ``False`` otherwise.
2705 """
5b5c9bc7 2706 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2707
2708 def Rotate(*args, **kwargs):
2709 """
5b5c9bc7
RD
2710 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2711 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2712
2713 Rotates the image about the given point, by ``angle`` radians. Passing
2714 ``True`` to ``interpolating`` results in better image quality, but is
2715 slower. If the image has a mask, then the mask colour is used for the
2716 uncovered pixels in the rotated image background. Otherwise, black
2717 will be used as the fill colour.
2718
2719 Returns the rotated image, leaving this image intact.
d55e5bfc 2720 """
5b5c9bc7 2721 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
2722
2723 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2724 """
2725 Rotate90(self, bool clockwise=True) -> Image
2726
2727 Returns a copy of the image rotated 90 degrees in the direction
2728 indicated by ``clockwise``.
2729 """
5b5c9bc7 2730 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
2731
2732 def Mirror(*args, **kwargs):
7a27cf7c
RD
2733 """
2734 Mirror(self, bool horizontally=True) -> Image
2735
2736 Returns a mirrored copy of the image. The parameter ``horizontally``
2737 indicates the orientation.
2738 """
5b5c9bc7 2739 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2740
2741 def Replace(*args, **kwargs):
2742 """
7a27cf7c
RD
2743 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2744
2745 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2746 ``(r2,g2,b2)``.
d55e5bfc 2747 """
5b5c9bc7 2748 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc
RD
2749
2750 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2751 """
2752 ConvertToMono(self, byte r, byte g, byte b) -> Image
2753
2754 Returns monochromatic version of the image. The returned image has
2755 white colour where the original has ``(r,g,b)`` colour and black
2756 colour everywhere else.
2757 """
5b5c9bc7 2758 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2759
2760 def SetOption(*args, **kwargs):
7a27cf7c
RD
2761 """
2762 SetOption(self, String name, String value)
2763
2764 Sets an image handler defined option. For example, when saving as a
2765 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2766 number between 0 and 100 (0 is terrible, 100 is very good).
2767 """
5b5c9bc7 2768 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2769
2770 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2771 """
2772 SetOptionInt(self, String name, int value)
2773
2774 Sets an image option as an integer.
2775 """
5b5c9bc7 2776 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2777
2778 def GetOption(*args, **kwargs):
7a27cf7c
RD
2779 """
2780 GetOption(self, String name) -> String
2781
2782 Gets the value of an image handler option.
2783 """
5b5c9bc7 2784 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2785
2786 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2787 """
2788 GetOptionInt(self, String name) -> int
2789
2790 Gets the value of an image handler option as an integer. If the given
2791 option is not present, the function returns 0.
2792 """
5b5c9bc7 2793 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2794
2795 def HasOption(*args, **kwargs):
7a27cf7c
RD
2796 """
2797 HasOption(self, String name) -> bool
2798
2799 Returns true if the given option is present.
2800 """
5b5c9bc7 2801 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
2802
2803 def CountColours(*args, **kwargs):
2804 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 2805 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
2806
2807 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
2808 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2809 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
2810
2811 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
2812 """AddHandler(ImageHandler handler)"""
2813 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2814
2815 AddHandler = staticmethod(AddHandler)
2816 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
2817 """InsertHandler(ImageHandler handler)"""
2818 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2819
2820 InsertHandler = staticmethod(InsertHandler)
2821 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
2822 """RemoveHandler(String name) -> bool"""
2823 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
2824
2825 RemoveHandler = staticmethod(RemoveHandler)
2826 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2827 """
2828 GetImageExtWildcard() -> String
2829
2830 Iterates all registered wxImageHandler objects, and returns a string
2831 containing file extension masks suitable for passing to file open/save
2832 dialog boxes.
2833 """
5b5c9bc7 2834 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
2835
2836 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2837 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
2838 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2839 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
2840
2841 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2842 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 2843 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc
RD
2844
2845 def __nonzero__(self): return self.Ok()
2846
5b5c9bc7 2847class ImagePtr(Image):
d55e5bfc
RD
2848 def __init__(self, this):
2849 self.this = this
2850 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
2851 self.__class__ = Image
2852_core_.Image_swigregister(ImagePtr)
d55e5bfc
RD
2853
2854def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2855 """
2856 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2857
2858 Loads an image from a file, using a MIME type string (such as
2859 'image/jpeg') to specify image type.
2860 """
5b5c9bc7 2861 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
2862 val.thisown = 1
2863 return val
2864
2865def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2866 """
2867 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2868
2869 Loads an image from an input stream, or any readable Python file-like
2870 object.
2871 """
5b5c9bc7 2872 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
2873 val.thisown = 1
2874 return val
2875
2876def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2877 """
2878 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2879
2880 Loads an image from an input stream, or any readable Python file-like
2881 object, specifying the image format with a MIME type string.
2882 """
5b5c9bc7 2883 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
2884 val.thisown = 1
2885 return val
2886
d6c14a4c 2887def EmptyImage(*args, **kwargs):
bb2ef2cc 2888 """
5b5c9bc7 2889 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
2890
2891 Construct an empty image of a given size, optionally setting all
2892 pixels to black.
2893 """
5b5c9bc7 2894 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2895 val.thisown = 1
2896 return val
2897
2898def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 2899 """
5b5c9bc7 2900 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
2901
2902 Construct an Image from a `wx.Bitmap`.
2903 """
5b5c9bc7 2904 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
2905 val.thisown = 1
2906 return val
2907
2908def ImageFromData(*args, **kwargs):
bb2ef2cc 2909 """
5b5c9bc7 2910 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
2911
2912 Construct an Image from a buffer of RGB bytes. Accepts either a
2913 string or a buffer object holding the data and the length of the data
2914 must be width*height*3.
2915 """
5b5c9bc7 2916 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
2917 val.thisown = 1
2918 return val
2919
03e46024 2920def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 2921 """
5b5c9bc7 2922 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
2923
2924 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2925 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2926 length of the data must be width*height*3 bytes, and the length of the
2927 alpha data must be width*height bytes.
bb2ef2cc 2928 """
5b5c9bc7 2929 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
2930 val.thisown = 1
2931 return val
2932
5b5c9bc7 2933def Image_CanRead(*args, **kwargs):
7a27cf7c
RD
2934 """
2935 Image_CanRead(String filename) -> bool
2936
2937 Returns True if the image handlers can read this file.
2938 """
5b5c9bc7 2939 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 2940
5b5c9bc7 2941def Image_GetImageCount(*args, **kwargs):
7a27cf7c
RD
2942 """
2943 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2944
2945 If the image file contains more than one image and the image handler
2946 is capable of retrieving these individually, this function will return
2947 the number of available images.
2948 """
5b5c9bc7 2949 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 2950
5b5c9bc7 2951def Image_CanReadStream(*args, **kwargs):
7a27cf7c
RD
2952 """
2953 Image_CanReadStream(InputStream stream) -> bool
2954
2955 Returns True if the image handlers can read an image file from the
2956 data currently on the input stream, or a readable Python file-like
2957 object.
2958 """
5b5c9bc7 2959 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 2960
5b5c9bc7
RD
2961def Image_AddHandler(*args, **kwargs):
2962 """Image_AddHandler(ImageHandler handler)"""
2963 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 2964
5b5c9bc7
RD
2965def Image_InsertHandler(*args, **kwargs):
2966 """Image_InsertHandler(ImageHandler handler)"""
2967 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 2968
5b5c9bc7
RD
2969def Image_RemoveHandler(*args, **kwargs):
2970 """Image_RemoveHandler(String name) -> bool"""
2971 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 2972
5b5c9bc7 2973def Image_GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2974 """
2975 Image_GetImageExtWildcard() -> String
2976
2977 Iterates all registered wxImageHandler objects, and returns a string
2978 containing file extension masks suitable for passing to file open/save
2979 dialog boxes.
2980 """
5b5c9bc7 2981 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc 2982
68e533f8
RD
2983def InitAllImageHandlers():
2984 """
2985 The former functionality of InitAllImageHanders is now done internal to
2986 the _core_ extension module and so this function has become a simple NOP.
2987 """
2988 pass
d55e5bfc 2989
5b5c9bc7
RD
2990IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2991IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2992PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
2993PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
2994PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
2995BMP_24BPP = _core_.BMP_24BPP
2996BMP_8BPP = _core_.BMP_8BPP
2997BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2998BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2999BMP_8BPP_RED = _core_.BMP_8BPP_RED
3000BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3001BMP_4BPP = _core_.BMP_4BPP
3002BMP_1BPP = _core_.BMP_1BPP
3003BMP_1BPP_BW = _core_.BMP_1BPP_BW
3004class BMPHandler(ImageHandler):
27fb7603 3005 """A `wx.ImageHandler` for \*.bmp bitmap files."""
d55e5bfc
RD
3006 def __repr__(self):
3007 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3008 def __init__(self, *args, **kwargs):
27fb7603
RD
3009 """
3010 __init__(self) -> BMPHandler
3011
3012 A `wx.ImageHandler` for \*.bmp bitmap files.
3013 """
5b5c9bc7 3014 newobj = _core_.new_BMPHandler(*args, **kwargs)
d55e5bfc
RD
3015 self.this = newobj.this
3016 self.thisown = 1
3017 del newobj.thisown
3018
5b5c9bc7 3019class BMPHandlerPtr(BMPHandler):
d55e5bfc
RD
3020 def __init__(self, this):
3021 self.this = this
3022 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3023 self.__class__ = BMPHandler
3024_core_.BMPHandler_swigregister(BMPHandlerPtr)
3025NullImage = cvar.NullImage
68350608 3026IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3027IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3028IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3029IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3030IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3031IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3032IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3033IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3034IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3035IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3036IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3037IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3038IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3039IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3040IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3041
5b5c9bc7 3042class ICOHandler(BMPHandler):
27fb7603 3043 """A `wx.ImageHandler` for \*.ico icon files."""
d55e5bfc
RD
3044 def __repr__(self):
3045 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3046 def __init__(self, *args, **kwargs):
27fb7603
RD
3047 """
3048 __init__(self) -> ICOHandler
3049
3050 A `wx.ImageHandler` for \*.ico icon files.
3051 """
5b5c9bc7 3052 newobj = _core_.new_ICOHandler(*args, **kwargs)
d55e5bfc
RD
3053 self.this = newobj.this
3054 self.thisown = 1
3055 del newobj.thisown
3056
5b5c9bc7 3057class ICOHandlerPtr(ICOHandler):
d55e5bfc
RD
3058 def __init__(self, this):
3059 self.this = this
3060 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3061 self.__class__ = ICOHandler
3062_core_.ICOHandler_swigregister(ICOHandlerPtr)
d55e5bfc 3063
5b5c9bc7 3064class CURHandler(ICOHandler):
27fb7603 3065 """A `wx.ImageHandler` for \*.cur cursor files."""
d55e5bfc
RD
3066 def __repr__(self):
3067 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3068 def __init__(self, *args, **kwargs):
27fb7603
RD
3069 """
3070 __init__(self) -> CURHandler
3071
3072 A `wx.ImageHandler` for \*.cur cursor files.
3073 """
5b5c9bc7 3074 newobj = _core_.new_CURHandler(*args, **kwargs)
d55e5bfc
RD
3075 self.this = newobj.this
3076 self.thisown = 1
3077 del newobj.thisown
3078
5b5c9bc7 3079class CURHandlerPtr(CURHandler):
d55e5bfc
RD
3080 def __init__(self, this):
3081 self.this = this
3082 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3083 self.__class__ = CURHandler
3084_core_.CURHandler_swigregister(CURHandlerPtr)
d55e5bfc 3085
5b5c9bc7 3086class ANIHandler(CURHandler):
27fb7603 3087 """A `wx.ImageHandler` for \*.ani animated cursor files."""
d55e5bfc
RD
3088 def __repr__(self):
3089 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3090 def __init__(self, *args, **kwargs):
27fb7603
RD
3091 """
3092 __init__(self) -> ANIHandler
3093
3094 A `wx.ImageHandler` for \*.ani animated cursor files.
3095 """
5b5c9bc7 3096 newobj = _core_.new_ANIHandler(*args, **kwargs)
d55e5bfc
RD
3097 self.this = newobj.this
3098 self.thisown = 1
3099 del newobj.thisown
3100
5b5c9bc7 3101class ANIHandlerPtr(ANIHandler):
d55e5bfc
RD
3102 def __init__(self, this):
3103 self.this = this
3104 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3105 self.__class__ = ANIHandler
3106_core_.ANIHandler_swigregister(ANIHandlerPtr)
d55e5bfc 3107
5b5c9bc7 3108class PNGHandler(ImageHandler):
27fb7603 3109 """A `wx.ImageHandler` for PNG image files."""
d55e5bfc
RD
3110 def __repr__(self):
3111 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3112 def __init__(self, *args, **kwargs):
27fb7603
RD
3113 """
3114 __init__(self) -> PNGHandler
3115
3116 A `wx.ImageHandler` for PNG image files.
3117 """
5b5c9bc7 3118 newobj = _core_.new_PNGHandler(*args, **kwargs)
d55e5bfc
RD
3119 self.this = newobj.this
3120 self.thisown = 1
3121 del newobj.thisown
3122
5b5c9bc7 3123class PNGHandlerPtr(PNGHandler):
d55e5bfc
RD
3124 def __init__(self, this):
3125 self.this = this
3126 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3127 self.__class__ = PNGHandler
3128_core_.PNGHandler_swigregister(PNGHandlerPtr)
d55e5bfc 3129
5b5c9bc7 3130class GIFHandler(ImageHandler):
27fb7603 3131 """A `wx.ImageHandler` for GIF image files."""
d55e5bfc
RD
3132 def __repr__(self):
3133 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3134 def __init__(self, *args, **kwargs):
27fb7603
RD
3135 """
3136 __init__(self) -> GIFHandler
3137
3138 A `wx.ImageHandler` for GIF image files.
3139 """
5b5c9bc7 3140 newobj = _core_.new_GIFHandler(*args, **kwargs)
d55e5bfc
RD
3141 self.this = newobj.this
3142 self.thisown = 1
3143 del newobj.thisown
3144
5b5c9bc7 3145class GIFHandlerPtr(GIFHandler):
d55e5bfc
RD
3146 def __init__(self, this):
3147 self.this = this
3148 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3149 self.__class__ = GIFHandler
3150_core_.GIFHandler_swigregister(GIFHandlerPtr)
d55e5bfc 3151
5b5c9bc7 3152class PCXHandler(ImageHandler):
27fb7603 3153 """A `wx.ImageHandler` for PCX imager files."""
d55e5bfc
RD
3154 def __repr__(self):
3155 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3156 def __init__(self, *args, **kwargs):
27fb7603
RD
3157 """
3158 __init__(self) -> PCXHandler
3159
3160 A `wx.ImageHandler` for PCX imager files.
3161 """
5b5c9bc7 3162 newobj = _core_.new_PCXHandler(*args, **kwargs)
d55e5bfc
RD
3163 self.this = newobj.this
3164 self.thisown = 1
3165 del newobj.thisown
3166
5b5c9bc7 3167class PCXHandlerPtr(PCXHandler):
d55e5bfc
RD
3168 def __init__(self, this):
3169 self.this = this
3170 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3171 self.__class__ = PCXHandler
3172_core_.PCXHandler_swigregister(PCXHandlerPtr)
d55e5bfc 3173
5b5c9bc7 3174class JPEGHandler(ImageHandler):
27fb7603 3175 """A `wx.ImageHandler` for JPEG/JPG image files."""
d55e5bfc
RD
3176 def __repr__(self):
3177 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3178 def __init__(self, *args, **kwargs):
27fb7603
RD
3179 """
3180 __init__(self) -> JPEGHandler
3181
3182 A `wx.ImageHandler` for JPEG/JPG image files.
3183 """
5b5c9bc7 3184 newobj = _core_.new_JPEGHandler(*args, **kwargs)
d55e5bfc
RD
3185 self.this = newobj.this
3186 self.thisown = 1
3187 del newobj.thisown
3188
5b5c9bc7 3189class JPEGHandlerPtr(JPEGHandler):
d55e5bfc
RD
3190 def __init__(self, this):
3191 self.this = this
3192 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3193 self.__class__ = JPEGHandler
3194_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
d55e5bfc 3195
5b5c9bc7 3196class PNMHandler(ImageHandler):
27fb7603 3197 """A `wx.ImageHandler` for PNM image files."""
d55e5bfc
RD
3198 def __repr__(self):
3199 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3200 def __init__(self, *args, **kwargs):
27fb7603
RD
3201 """
3202 __init__(self) -> PNMHandler
3203
3204 A `wx.ImageHandler` for PNM image files.
3205 """
5b5c9bc7 3206 newobj = _core_.new_PNMHandler(*args, **kwargs)
d55e5bfc
RD
3207 self.this = newobj.this
3208 self.thisown = 1
3209 del newobj.thisown
3210
5b5c9bc7 3211class PNMHandlerPtr(PNMHandler):
d55e5bfc
RD
3212 def __init__(self, this):
3213 self.this = this
3214 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3215 self.__class__ = PNMHandler
3216_core_.PNMHandler_swigregister(PNMHandlerPtr)
d55e5bfc 3217
5b5c9bc7 3218class XPMHandler(ImageHandler):
27fb7603 3219 """A `wx.ImageHandler` for XPM image."""
d55e5bfc
RD
3220 def __repr__(self):
3221 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3222 def __init__(self, *args, **kwargs):
27fb7603
RD
3223 """
3224 __init__(self) -> XPMHandler
3225
3226 A `wx.ImageHandler` for XPM image.
3227 """
5b5c9bc7 3228 newobj = _core_.new_XPMHandler(*args, **kwargs)
d55e5bfc
RD
3229 self.this = newobj.this
3230 self.thisown = 1
3231 del newobj.thisown
3232
5b5c9bc7 3233class XPMHandlerPtr(XPMHandler):
d55e5bfc
RD
3234 def __init__(self, this):
3235 self.this = this
3236 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3237 self.__class__ = XPMHandler
3238_core_.XPMHandler_swigregister(XPMHandlerPtr)
d55e5bfc 3239
5b5c9bc7 3240class TIFFHandler(ImageHandler):
27fb7603 3241 """A `wx.ImageHandler` for TIFF image files."""
d55e5bfc
RD
3242 def __repr__(self):
3243 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3244 def __init__(self, *args, **kwargs):
27fb7603
RD
3245 """
3246 __init__(self) -> TIFFHandler
3247
3248 A `wx.ImageHandler` for TIFF image files.
3249 """
5b5c9bc7 3250 newobj = _core_.new_TIFFHandler(*args, **kwargs)
d55e5bfc
RD
3251 self.this = newobj.this
3252 self.thisown = 1
3253 del newobj.thisown
3254
5b5c9bc7 3255class TIFFHandlerPtr(TIFFHandler):
d55e5bfc
RD
3256 def __init__(self, this):
3257 self.this = this
3258 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3259 self.__class__ = TIFFHandler
3260_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
d55e5bfc 3261
5b5c9bc7
RD
3262QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3263QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3264class Quantize(object):
c0de73ae
RD
3265 """Performs quantization, or colour reduction, on a wxImage."""
3266 def __init__(self): raise RuntimeError, "No constructor defined"
3267 def __repr__(self):
3268 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3269 def Quantize(*args, **kwargs):
3270 """
5b5c9bc7 3271 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3272
3273 Reduce the colours in the source image and put the result into the
3274 destination image, setting the palette in the destination if
3275 needed. Both images may be the same, to overwrite the source image.
3276 """
5b5c9bc7 3277 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3278
3279 Quantize = staticmethod(Quantize)
3280
5b5c9bc7 3281class QuantizePtr(Quantize):
c0de73ae
RD
3282 def __init__(self, this):
3283 self.this = this
3284 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3285 self.__class__ = Quantize
3286_core_.Quantize_swigregister(QuantizePtr)
c0de73ae 3287
5b5c9bc7 3288def Quantize_Quantize(*args, **kwargs):
c0de73ae 3289 """
5b5c9bc7 3290 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3291
3292 Reduce the colours in the source image and put the result into the
3293 destination image, setting the palette in the destination if
3294 needed. Both images may be the same, to overwrite the source image.
3295 """
5b5c9bc7 3296 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3297
d55e5bfc
RD
3298#---------------------------------------------------------------------------
3299
5b5c9bc7
RD
3300class EvtHandler(Object):
3301 """Proxy of C++ EvtHandler class"""
d55e5bfc
RD
3302 def __repr__(self):
3303 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3304 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
3305 """__init__(self) -> EvtHandler"""
3306 newobj = _core_.new_EvtHandler(*args, **kwargs)
d55e5bfc
RD
3307 self.this = newobj.this
3308 self.thisown = 1
3309 del newobj.thisown
3310 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3311 """GetNextHandler(self) -> EvtHandler"""
3312 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3313
3314 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3315 """GetPreviousHandler(self) -> EvtHandler"""
3316 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3317
3318 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3319 """SetNextHandler(self, EvtHandler handler)"""
3320 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3321
3322 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3323 """SetPreviousHandler(self, EvtHandler handler)"""
3324 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3325
3326 def GetEvtHandlerEnabled(*args, **kwargs):
3327 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3328 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3329
3330 def SetEvtHandlerEnabled(*args, **kwargs):
3331 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3332 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3333
3334 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3335 """ProcessEvent(self, Event event) -> bool"""
3336 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3337
3338 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3339 """AddPendingEvent(self, Event event)"""
3340 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3341
3342 def ProcessPendingEvents(*args, **kwargs):
3343 """ProcessPendingEvents(self)"""
5b5c9bc7 3344 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3345
3346 def Connect(*args, **kwargs):
3347 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3348 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3349
3350 def Disconnect(*args, **kwargs):
3351 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3352 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3353
3354 def _setOORInfo(*args, **kwargs):
36ed4f51 3355 """_setOORInfo(self, PyObject _self, bool incref=True)"""
5b5c9bc7 3356 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
d55e5bfc
RD
3357
3358 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3359 """
3360 Bind an event to an event handler.
3361
a5ee0656
RD
3362 :param event: One of the EVT_* objects that specifies the
3363 type of event to bind,
d55e5bfc 3364
a5ee0656
RD
3365 :param handler: A callable object to be invoked when the
3366 event is delivered to self. Pass None to
3367 disconnect an event handler.
d55e5bfc 3368
a5ee0656
RD
3369 :param source: Sometimes the event originates from a
3370 different window than self, but you still
3371 want to catch it in self. (For example, a
3372 button event delivered to a frame.) By
3373 passing the source of the event, the event
3374 handling system is able to differentiate
3375 between the same event type from different
3376 controls.
d55e5bfc 3377
a5ee0656
RD
3378 :param id: Used to spcify the event source by ID instead
3379 of instance.
3380
3381 :param id2: Used when it is desirable to bind a handler
3382 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3383 """
3384 if source is not None:
3385 id = source.GetId()
3386 event.Bind(self, id, id2, handler)
3387
d6c14a4c
RD
3388 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3389 """
3390 Disconencts the event handler binding for event from self.
3391 Returns True if successful.
3392 """
3393 if source is not None:
3394 id = source.GetId()
3395 return event.Unbind(self, id, id2)
d55e5bfc
RD
3396
3397
5b5c9bc7 3398class EvtHandlerPtr(EvtHandler):
d55e5bfc
RD
3399 def __init__(self, this):
3400 self.this = this
3401 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3402 self.__class__ = EvtHandler
3403_core_.EvtHandler_swigregister(EvtHandlerPtr)
d55e5bfc
RD
3404
3405#---------------------------------------------------------------------------
3406
3407class PyEventBinder(object):
3408 """
3409 Instances of this class are used to bind specific events to event
3410 handlers.
3411 """
3412 def __init__(self, evtType, expectedIDs=0):
3413 if expectedIDs not in [0, 1, 2]:
3414 raise ValueError, "Invalid number of expectedIDs"
3415 self.expectedIDs = expectedIDs
3416
3417 if type(evtType) == list or type(evtType) == tuple:
3418 self.evtType = evtType
3419 else:
3420 self.evtType = [evtType]
3421
3422
3423 def Bind(self, target, id1, id2, function):
3424 """Bind this set of event types to target."""
3425 for et in self.evtType:
3426 target.Connect(id1, id2, et, function)
3427
d6c14a4c
RD
3428
3429 def Unbind(self, target, id1, id2):
3430 """Remove an event binding."""
3431 success = 0
3432 for et in self.evtType:
3433 success += target.Disconnect(id1, id2, et)
3434 return success != 0
3435
d55e5bfc
RD
3436
3437 def __call__(self, *args):
3438 """
3439 For backwards compatibility with the old EVT_* functions.
3440 Should be called with either (window, func), (window, ID,
3441 func) or (window, ID1, ID2, func) parameters depending on the
3442 type of the event.
3443 """
3444 assert len(args) == 2 + self.expectedIDs
3445 id1 = wx.ID_ANY
3446 id2 = wx.ID_ANY
3447 target = args[0]
3448 if self.expectedIDs == 0:
3449 func = args[1]
3450 elif self.expectedIDs == 1:
3451 id1 = args[1]
3452 func = args[2]
3453 elif self.expectedIDs == 2:
3454 id1 = args[1]
3455 id2 = args[2]
3456 func = args[3]
3457 else:
3458 raise ValueError, "Unexpected number of IDs"
3459
3460 self.Bind(target, id1, id2, func)
3461
3462
3463# These two are square pegs that don't fit the PyEventBinder hole...
3464def EVT_COMMAND(win, id, cmd, func):
3465 win.Connect(id, -1, cmd, func)
3466def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3467 win.Connect(id1, id2, cmd, func)
3468
3469
3470#---------------------------------------------------------------------------
3471
3472#---------------------------------------------------------------------------
3473
5b5c9bc7
RD
3474EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3475EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3476
3477def NewEventType(*args, **kwargs):
3478 """NewEventType() -> wxEventType"""
3479 return _core_.NewEventType(*args, **kwargs)
3480wxEVT_NULL = _core_.wxEVT_NULL
3481wxEVT_FIRST = _core_.wxEVT_FIRST
3482wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3483wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3484wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3485wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3486wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3487wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3488wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3489wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3490wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3491wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3492wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3493wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3494wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3495wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3496wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3497wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3498wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3499wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3500wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3501wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3502wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3503wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3504wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3505wxEVT_MOTION = _core_.wxEVT_MOTION
3506wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3507wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3508wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3509wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3510wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3511wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3512wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3513wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3514wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3515wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3516wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3517wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3518wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3519wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3520wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3521wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3522wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3523wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3524wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3525wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3526wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3527wxEVT_CHAR = _core_.wxEVT_CHAR
3528wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3529wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3530wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3531wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3532wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3533wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3534wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3535wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3536wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3537wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3538wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3539wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3540wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3541wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3542wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
3543wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3544wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3545wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3546wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3547wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3548wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3549wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3550wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3551wxEVT_SIZE = _core_.wxEVT_SIZE
3552wxEVT_MOVE = _core_.wxEVT_MOVE
3553wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3554wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3555wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3556wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3557wxEVT_POWER = _core_.wxEVT_POWER
3558wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3559wxEVT_CREATE = _core_.wxEVT_CREATE
3560wxEVT_DESTROY = _core_.wxEVT_DESTROY
3561wxEVT_SHOW = _core_.wxEVT_SHOW
3562wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3563wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3564wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3565wxEVT_PAINT = _core_.wxEVT_PAINT
3566wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3567wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3568wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3569wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3570wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3571wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3572wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3573wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3574wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3575wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3576wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3577wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3578wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3579wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3580wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3581wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3582wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3583wxEVT_IDLE = _core_.wxEVT_IDLE
3584wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3585wxEVT_SIZING = _core_.wxEVT_SIZING
3586wxEVT_MOVING = _core_.wxEVT_MOVING
3587wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
3588wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3589wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3590wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3591wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3592wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3593wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3594wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3595#
3596# Create some event binders
3597EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3598EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3599EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3600EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3601EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3602EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3603EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3604EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3605EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3606EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3607EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3608EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3609EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3610EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3611EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3612EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3613EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3614EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3615EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3616EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3617EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3618EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3619EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3620EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3621EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3622EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3623EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3624EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3625EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3626EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3627EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3628EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3629EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3630EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3631EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3632EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3633EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3634EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3635EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3636EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3637EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3638
3639EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3640EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3641EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3642EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3643EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3644EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3645EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3646EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3647EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3648EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3649EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3650EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3651EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3652
3653EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3654 wxEVT_LEFT_UP,
3655 wxEVT_MIDDLE_DOWN,
3656 wxEVT_MIDDLE_UP,
3657 wxEVT_RIGHT_DOWN,
3658 wxEVT_RIGHT_UP,
3659 wxEVT_MOTION,
3660 wxEVT_LEFT_DCLICK,
3661 wxEVT_MIDDLE_DCLICK,
3662 wxEVT_RIGHT_DCLICK,
3663 wxEVT_ENTER_WINDOW,
3664 wxEVT_LEAVE_WINDOW,
3665 wxEVT_MOUSEWHEEL
3666 ])
3667
3668
3669# Scrolling from wxWindow (sent to wxScrolledWindow)
3670EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3671 wxEVT_SCROLLWIN_BOTTOM,
3672 wxEVT_SCROLLWIN_LINEUP,
3673 wxEVT_SCROLLWIN_LINEDOWN,
3674 wxEVT_SCROLLWIN_PAGEUP,
3675 wxEVT_SCROLLWIN_PAGEDOWN,
3676 wxEVT_SCROLLWIN_THUMBTRACK,
3677 wxEVT_SCROLLWIN_THUMBRELEASE,
3678 ])
3679
3680EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3681EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3682EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3683EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3684EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3685EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3686EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3687EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3688
27fb7603 3689# Scrolling from wx.Slider and wx.ScrollBar
d55e5bfc
RD
3690EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3691 wxEVT_SCROLL_BOTTOM,
3692 wxEVT_SCROLL_LINEUP,
3693 wxEVT_SCROLL_LINEDOWN,
3694 wxEVT_SCROLL_PAGEUP,
3695 wxEVT_SCROLL_PAGEDOWN,
3696 wxEVT_SCROLL_THUMBTRACK,
3697 wxEVT_SCROLL_THUMBRELEASE,
3698 wxEVT_SCROLL_ENDSCROLL,
3699 ])
3700
3701EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3702EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3703EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3704EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3705EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3706EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3707EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3708EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3709EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3710
27fb7603 3711# Scrolling from wx.Slider and wx.ScrollBar, with an id
d55e5bfc
RD
3712EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3713 wxEVT_SCROLL_BOTTOM,
3714 wxEVT_SCROLL_LINEUP,
3715 wxEVT_SCROLL_LINEDOWN,
3716 wxEVT_SCROLL_PAGEUP,
3717 wxEVT_SCROLL_PAGEDOWN,
3718 wxEVT_SCROLL_THUMBTRACK,
3719 wxEVT_SCROLL_THUMBRELEASE,
3720 wxEVT_SCROLL_ENDSCROLL,
3721 ], 1)
3722
3723EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3724EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3725EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3726EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3727EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3728EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3729EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3730EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3731EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3732
3733EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3734EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3735EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3736EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3737EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3738EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3739EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3740EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3741EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3742EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3743
3744EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3745EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3746EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3747EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3748EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3749EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3750EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3751EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3752EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3753
3754
3755EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3756EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3757EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3758EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3759EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3760EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3761EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3762
3763EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3764
3765EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3766EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3767
3768EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3769
3770
3771
3772#---------------------------------------------------------------------------
3773
5b5c9bc7 3774class Event(Object):
27fb7603
RD
3775 """
3776 An event is a structure holding information about an event passed to a
3777 callback or member function. wx.Event is an abstract base class for
3778 other event classes
3779 """
d55e5bfc
RD
3780 def __init__(self): raise RuntimeError, "No constructor defined"
3781 def __repr__(self):
3782 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7 3783 def __del__(self, destroy=_core_.delete_Event):
d55e5bfc
RD
3784 """__del__(self)"""
3785 try:
3786 if self.thisown: destroy(self)
3787 except: pass
3788
3789 def SetEventType(*args, **kwargs):
27fb7603
RD
3790 """
3791 SetEventType(self, wxEventType typ)
3792
3793 Sets the specific type of the event.
3794 """
5b5c9bc7 3795 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
3796
3797 def GetEventType(*args, **kwargs):
27fb7603
RD
3798 """
3799 GetEventType(self) -> wxEventType
3800
3801 Returns the identifier of the given event type, such as
3802 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3803 """
5b5c9bc7 3804 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
3805
3806 def GetEventObject(*args, **kwargs):
27fb7603
RD
3807 """
3808 GetEventObject(self) -> Object
3809
3810 Returns the object (usually a window) associated with the event, if
3811 any.
3812 """
5b5c9bc7 3813 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
3814
3815 def SetEventObject(*args, **kwargs):
27fb7603
RD
3816 """
3817 SetEventObject(self, Object obj)
3818
3819 Sets the originating object, or in other words, obj is normally the
3820 object that is sending the event.
3821 """
5b5c9bc7 3822 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
3823
3824 def GetTimestamp(*args, **kwargs):
3825 """GetTimestamp(self) -> long"""
5b5c9bc7 3826 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
3827
3828 def SetTimestamp(*args, **kwargs):
3829 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 3830 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
3831
3832 def GetId(*args, **kwargs):
27fb7603
RD
3833 """
3834 GetId(self) -> int
3835
3836 Returns the identifier associated with this event, such as a button
3837 command id.
3838 """
5b5c9bc7 3839 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
3840
3841 def SetId(*args, **kwargs):
27fb7603
RD
3842 """
3843 SetId(self, int Id)
3844
3845 Set's the ID for the event. This is usually the ID of the window that
3846 is sending the event, but it can also be a command id from a menu
3847 item, etc.
3848 """
5b5c9bc7 3849 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
3850
3851 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3852 """
3853 IsCommandEvent(self) -> bool
3854
3855 Returns true if the event is or is derived from `wx.CommandEvent` else
3856 it returns false. Note: Exists only for optimization purposes.
3857 """
5b5c9bc7 3858 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
3859
3860 def Skip(*args, **kwargs):
51b83b37
RD
3861 """
3862 Skip(self, bool skip=True)
3863
3864 Called by an event handler, it controls whether additional event
3865 handlers bound to this event will be called after the current event
3866 handler returns. Skip(false) (the default setting) will prevent
3867 additional event handlers from being called and control will be
3868 returned to the sender of the event immediately after the current
3869 handler has finished. Skip(True) will cause the event processing
3870 system to continue searching for a handler function for this event.
3871
3872 """
5b5c9bc7 3873 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
3874
3875 def GetSkipped(*args, **kwargs):
27fb7603
RD
3876 """
3877 GetSkipped(self) -> bool
3878
3879 Returns true if the event handler should be skipped, false otherwise.
3880 :see: `Skip`
3881 """
5b5c9bc7 3882 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
3883
3884 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3885 """
3886 ShouldPropagate(self) -> bool
3887
3888 Test if this event should be propagated to the parent window or not,
3889 i.e. if the propagation level is currently greater than 0.
3890 """
5b5c9bc7 3891 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
3892
3893 def StopPropagation(*args, **kwargs):
27fb7603
RD
3894 """
3895 StopPropagation(self) -> int
3896
3897 Stop the event from propagating to its parent window. Returns the old
3898 propagation level value which may be later passed to
3899 `ResumePropagation` to allow propagating the event again.
3900 """
5b5c9bc7 3901 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
3902
3903 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3904 """
3905 ResumePropagation(self, int propagationLevel)
3906
3907 Resume the event propagation by restoring the propagation level. (For
3908 example, you can use the value returned by an earlier call to
3909 `StopPropagation`.)
3910
3911 """
5b5c9bc7 3912 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
3913
3914 def Clone(*args, **kwargs):
5b5c9bc7
RD
3915 """Clone(self) -> Event"""
3916 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc
RD
3917
3918
5b5c9bc7 3919class EventPtr(Event):
d55e5bfc
RD
3920 def __init__(self, this):
3921 self.this = this
3922 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3923 self.__class__ = Event
3924_core_.Event_swigregister(EventPtr)
d55e5bfc
RD
3925
3926#---------------------------------------------------------------------------
3927
5b5c9bc7 3928class PropagationDisabler(object):
27fb7603
RD
3929 """
3930 Helper class to temporarily change an event not to propagate. Simply
3931 create an instance of this class and then whe it is destroyed the
3932 propogation of the event will be restored.
3933 """
d55e5bfc
RD
3934 def __repr__(self):
3935 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3936 def __init__(self, *args, **kwargs):
27fb7603
RD
3937 """
3938 __init__(self, Event event) -> PropagationDisabler
3939
3940 Helper class to temporarily change an event not to propagate. Simply
3941 create an instance of this class and then whe it is destroyed the
3942 propogation of the event will be restored.
3943 """
5b5c9bc7 3944 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
d55e5bfc
RD
3945 self.this = newobj.this
3946 self.thisown = 1
3947 del newobj.thisown
5b5c9bc7 3948 def __del__(self, destroy=_core_.delete_PropagationDisabler):
d55e5bfc
RD
3949 """__del__(self)"""
3950 try:
3951 if self.thisown: destroy(self)
3952 except: pass
3953
3954
5b5c9bc7 3955class PropagationDisablerPtr(PropagationDisabler):
d55e5bfc
RD
3956 def __init__(self, this):
3957 self.this = this
3958 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3959 self.__class__ = PropagationDisabler
3960_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
d55e5bfc 3961
5b5c9bc7 3962class PropagateOnce(object):
27fb7603
RD
3963 """
3964 A helper class that will temporarily lower propagation level of an
3965 event. Simply create an instance of this class and then whe it is
3966 destroyed the propogation of the event will be restored.
3967 """
d55e5bfc
RD
3968 def __repr__(self):
3969 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3970 def __init__(self, *args, **kwargs):
27fb7603
RD
3971 """
3972 __init__(self, Event event) -> PropagateOnce
3973
3974 A helper class that will temporarily lower propagation level of an
3975 event. Simply create an instance of this class and then whe it is
3976 destroyed the propogation of the event will be restored.
3977 """
5b5c9bc7 3978 newobj = _core_.new_PropagateOnce(*args, **kwargs)
d55e5bfc
RD
3979 self.this = newobj.this
3980 self.thisown = 1
3981 del newobj.thisown
5b5c9bc7 3982 def __del__(self, destroy=_core_.delete_PropagateOnce):
d55e5bfc
RD
3983 """__del__(self)"""
3984 try:
3985 if self.thisown: destroy(self)
3986 except: pass
3987
3988
5b5c9bc7 3989class PropagateOncePtr(PropagateOnce):
d55e5bfc
RD
3990 def __init__(self, this):
3991 self.this = this
3992 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
3993 self.__class__ = PropagateOnce
3994_core_.PropagateOnce_swigregister(PropagateOncePtr)
d55e5bfc
RD
3995
3996#---------------------------------------------------------------------------
3997
5b5c9bc7 3998class CommandEvent(Event):
27fb7603
RD
3999 """
4000 This event class contains information about command events, which
4001 originate from a variety of simple controls, as well as menus and
4002 toolbars.
4003 """
d55e5bfc
RD
4004 def __repr__(self):
4005 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4006 def __init__(self, *args, **kwargs):
27fb7603
RD
4007 """
4008 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4009
4010 This event class contains information about command events, which
4011 originate from a variety of simple controls, as well as menus and
4012 toolbars.
4013 """
5b5c9bc7 4014 newobj = _core_.new_CommandEvent(*args, **kwargs)
d55e5bfc
RD
4015 self.this = newobj.this
4016 self.thisown = 1
4017 del newobj.thisown
4018 def GetSelection(*args, **kwargs):
27fb7603
RD
4019 """
4020 GetSelection(self) -> int
4021
4022 Returns item index for a listbox or choice selection event (not valid
4023 for a deselection).
4024 """
5b5c9bc7 4025 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
4026
4027 def SetString(*args, **kwargs):
5b5c9bc7
RD
4028 """SetString(self, String s)"""
4029 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
4030
4031 def GetString(*args, **kwargs):
27fb7603
RD
4032 """
4033 GetString(self) -> String
4034
4035 Returns item string for a listbox or choice selection event (not valid
4036 for a deselection).
4037 """
5b5c9bc7 4038 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
4039
4040 def IsChecked(*args, **kwargs):
27fb7603
RD
4041 """
4042 IsChecked(self) -> bool
4043
4044 This method can be used with checkbox and menu events: for the
4045 checkboxes, the method returns true for a selection event and false
4046 for a deselection one. For the menu events, this method indicates if
4047 the menu item just has become checked or unchecked (and thus only
4048 makes sense for checkable menu items).
4049 """
5b5c9bc7 4050 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
4051
4052 Checked = IsChecked
4053 def IsSelection(*args, **kwargs):
27fb7603
RD
4054 """
4055 IsSelection(self) -> bool
4056
4057 For a listbox or similar event, returns true if it is a selection,
4058 false if it is a deselection.
4059 """
5b5c9bc7 4060 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
4061
4062 def SetExtraLong(*args, **kwargs):
4063 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 4064 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
4065
4066 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4067 """
4068 GetExtraLong(self) -> long
4069
5ba5649b
RD
4070 Returns extra information dependant on the event objects type. If the
4071 event comes from a listbox selection, it is a boolean determining
4072 whether the event was a selection (true) or a deselection (false). A
4073 listbox deselection only occurs for multiple-selection boxes, and in
4074 this case the index and string values are indeterminate and the
4075 listbox must be examined by the application.
27fb7603 4076 """
5b5c9bc7 4077 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
4078
4079 def SetInt(*args, **kwargs):
4080 """SetInt(self, int i)"""
5b5c9bc7 4081 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
4082
4083 def GetInt(*args, **kwargs):
27fb7603
RD
4084 """
4085 GetInt(self) -> long
4086
5ba5649b
RD
4087 Returns the integer identifier corresponding to a listbox, choice or
4088 radiobox selection (only if the event was a selection, not a
4089 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4090 """
5b5c9bc7 4091 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc
RD
4092
4093 def Clone(*args, **kwargs):
5b5c9bc7
RD
4094 """Clone(self) -> Event"""
4095 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc
RD
4096
4097
5b5c9bc7 4098class CommandEventPtr(CommandEvent):
d55e5bfc
RD
4099 def __init__(self, this):
4100 self.this = this
4101 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4102 self.__class__ = CommandEvent
4103_core_.CommandEvent_swigregister(CommandEventPtr)
d55e5bfc
RD
4104
4105#---------------------------------------------------------------------------
4106
5b5c9bc7 4107class NotifyEvent(CommandEvent):
27fb7603
RD
4108 """
4109 An instance of this class (or one of its derived classes) is sent from
4110 a control when the control's state is being changed and the control
4111 allows that change to be prevented from happening. The event handler
4112 can call `Veto` or `Allow` to tell the control what to do.
4113 """
d55e5bfc
RD
4114 def __repr__(self):
4115 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4116 def __init__(self, *args, **kwargs):
27fb7603
RD
4117 """
4118 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4119
4120 An instance of this class (or one of its derived classes) is sent from
4121 a control when the control's state is being changed and the control
4122 allows that change to be prevented from happening. The event handler
4123 can call `Veto` or `Allow` to tell the control what to do.
4124 """
5b5c9bc7 4125 newobj = _core_.new_NotifyEvent(*args, **kwargs)
d55e5bfc
RD
4126 self.this = newobj.this
4127 self.thisown = 1
4128 del newobj.thisown
4129 def Veto(*args, **kwargs):
27fb7603
RD
4130 """
4131 Veto(self)
4132
4133 Prevents the change announced by this event from happening.
4134
4135 It is in general a good idea to notify the user about the reasons for
4136 vetoing the change because otherwise the applications behaviour (which
4137 just refuses to do what the user wants) might be quite surprising.
4138 """
5b5c9bc7 4139 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4140
4141 def Allow(*args, **kwargs):
27fb7603
RD
4142 """
4143 Allow(self)
4144
4145 This is the opposite of `Veto`: it explicitly allows the event to be
4146 processed. For most events it is not necessary to call this method as
4147 the events are allowed anyhow but some are forbidden by default (this
4148 will be mentioned in the corresponding event description).
4149 """
5b5c9bc7 4150 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4151
4152 def IsAllowed(*args, **kwargs):
27fb7603
RD
4153 """
4154 IsAllowed(self) -> bool
4155
4156 Returns true if the change is allowed (`Veto` hasn't been called) or
4157 false otherwise (if it was).
4158 """
5b5c9bc7 4159 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc
RD
4160
4161
5b5c9bc7 4162class NotifyEventPtr(NotifyEvent):
d55e5bfc
RD
4163 def __init__(self, this):
4164 self.this = this
4165 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4166 self.__class__ = NotifyEvent
4167_core_.NotifyEvent_swigregister(NotifyEventPtr)
d55e5bfc
RD
4168
4169#---------------------------------------------------------------------------
4170
5b5c9bc7 4171class ScrollEvent(CommandEvent):
27fb7603
RD
4172 """
4173 A scroll event holds information about events sent from stand-alone
4174 scrollbars and sliders. Note that scrolled windows do not send
4175 instnaces of this event class, but send the `wx.ScrollWinEvent`
4176 instead.
4177 """
d55e5bfc
RD
4178 def __repr__(self):
4179 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4180 def __init__(self, *args, **kwargs):
4181 """
4182 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4183 int orient=0) -> ScrollEvent
d55e5bfc 4184 """
5b5c9bc7 4185 newobj = _core_.new_ScrollEvent(*args, **kwargs)
d55e5bfc
RD
4186 self.this = newobj.this
4187 self.thisown = 1
4188 del newobj.thisown
4189 def GetOrientation(*args, **kwargs):
27fb7603
RD
4190 """
4191 GetOrientation(self) -> int
4192
4193 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4194 the scrollbar.
4195 """
5b5c9bc7 4196 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4197
4198 def GetPosition(*args, **kwargs):
27fb7603
RD
4199 """
4200 GetPosition(self) -> int
4201
4202 Returns the position of the scrollbar.
4203 """
5b5c9bc7 4204 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4205
4206 def SetOrientation(*args, **kwargs):
4207 """SetOrientation(self, int orient)"""
5b5c9bc7 4208 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4209
4210 def SetPosition(*args, **kwargs):
4211 """SetPosition(self, int pos)"""
5b5c9bc7 4212 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
4213
4214
5b5c9bc7 4215class ScrollEventPtr(ScrollEvent):
d55e5bfc
RD
4216 def __init__(self, this):
4217 self.this = this
4218 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4219 self.__class__ = ScrollEvent
4220_core_.ScrollEvent_swigregister(ScrollEventPtr)
d55e5bfc
RD
4221
4222#---------------------------------------------------------------------------
4223
5b5c9bc7 4224class ScrollWinEvent(Event):
27fb7603
RD
4225 """
4226 A wx.ScrollWinEvent holds information about scrolling and is sent from
4227 scrolling windows.
4228 """
d55e5bfc
RD
4229 def __repr__(self):
4230 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4231 def __init__(self, *args, **kwargs):
27fb7603
RD
4232 """
4233 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4234
4235 A wx.ScrollWinEvent holds information about scrolling and is sent from
4236 scrolling windows.
4237 """
5b5c9bc7 4238 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
d55e5bfc
RD
4239 self.this = newobj.this
4240 self.thisown = 1
4241 del newobj.thisown
4242 def GetOrientation(*args, **kwargs):
27fb7603
RD
4243 """
4244 GetOrientation(self) -> int
4245
4246 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4247 the scrollbar.
4248 """
5b5c9bc7 4249 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4250
4251 def GetPosition(*args, **kwargs):
27fb7603
RD
4252 """
4253 GetPosition(self) -> int
4254
4255 Returns the position of the scrollbar for the thumb track and release
4256 events. Note that this field can't be used for the other events, you
4257 need to query the window itself for the current position in that case.
4258 """
5b5c9bc7 4259 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4260
4261 def SetOrientation(*args, **kwargs):
4262 """SetOrientation(self, int orient)"""
5b5c9bc7 4263 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4264
4265 def SetPosition(*args, **kwargs):
4266 """SetPosition(self, int pos)"""
5b5c9bc7 4267 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
4268
4269
5b5c9bc7 4270class ScrollWinEventPtr(ScrollWinEvent):
d55e5bfc
RD
4271 def __init__(self, this):
4272 self.this = this
4273 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4274 self.__class__ = ScrollWinEvent
4275_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
d55e5bfc
RD
4276
4277#---------------------------------------------------------------------------
4278
5b5c9bc7
RD
4279MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4280MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4281MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4282MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4283MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4284class MouseEvent(Event):
27fb7603
RD
4285 """
4286 This event class contains information about the events generated by
4287 the mouse: they include mouse buttons press and release events and
4288 mouse move events.
4289
4290 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4291 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4292 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4293 a middle button so a portable application should avoid relying on the
4294 events from it.
4295
4296 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4297 the former returns true when the event corresponds to the left mouse
4298 button click while the latter returns true if the left mouse button is
4299 currently being pressed. For example, when the user is dragging the
4300 mouse you can use `LeftIsDown` to test whether the left mouse button
4301 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4302 `LeftIsDown` will also return true in wxWidgets whatever the
4303 underlying GUI behaviour is (which is platform-dependent). The same
4304 applies, of course, to other mouse buttons as well.
4305 """
d55e5bfc
RD
4306 def __repr__(self):
4307 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4308 def __init__(self, *args, **kwargs):
27fb7603
RD
4309 """
4310 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4311
4312 Constructs a wx.MouseEvent. Valid event types are:
4313
4314 * wxEVT_ENTER_WINDOW
4315 * wxEVT_LEAVE_WINDOW
4316 * wxEVT_LEFT_DOWN
4317 * wxEVT_LEFT_UP
4318 * wxEVT_LEFT_DCLICK
4319 * wxEVT_MIDDLE_DOWN
4320 * wxEVT_MIDDLE_UP
4321 * wxEVT_MIDDLE_DCLICK
4322 * wxEVT_RIGHT_DOWN
4323 * wxEVT_RIGHT_UP
4324 * wxEVT_RIGHT_DCLICK
4325 * wxEVT_MOTION
4326 * wxEVT_MOUSEWHEEL
4327 """
5b5c9bc7 4328 newobj = _core_.new_MouseEvent(*args, **kwargs)
d55e5bfc
RD
4329 self.this = newobj.this
4330 self.thisown = 1
4331 del newobj.thisown
4332 def IsButton(*args, **kwargs):
27fb7603
RD
4333 """
4334 IsButton(self) -> bool
4335
4336 Returns true if the event was a mouse button event (not necessarily a
4337 button down event - that may be tested using `ButtonDown`).
4338 """
5b5c9bc7 4339 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4340
4341 def ButtonDown(*args, **kwargs):
27fb7603
RD
4342 """
4343 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4344
5ba5649b
RD
4345 If the argument is omitted, this returns true if the event was any
4346 mouse button down event. Otherwise the argument specifies which
4347 button-down event shold be checked for (see `Button` for the possible
4348 values).
27fb7603 4349 """
5b5c9bc7 4350 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4351
4352 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4353 """
4354 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4355
4356 If the argument is omitted, this returns true if the event was any
4357 mouse double click event. Otherwise the argument specifies which
4358 double click event to check for (see `Button` for the possible
4359 values).
4360 """
5b5c9bc7 4361 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4362
4363 def ButtonUp(*args, **kwargs):
27fb7603
RD
4364 """
4365 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4366
4367 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4368 mouse button up event. Otherwise the argument specifies which button
4369 up event to check for (see `Button` for the possible values).
27fb7603 4370 """
5b5c9bc7 4371 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4372
4373 def Button(*args, **kwargs):
27fb7603
RD
4374 """
4375 Button(self, int button) -> bool
4376
4377 Returns true if the identified mouse button is changing state. Valid
4378 values of button are:
4379
4380 ==================== =====================================
4381 wx.MOUSE_BTN_LEFT check if left button was pressed
4382 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4383 wx.MOUSE_BTN_RIGHT check if right button was pressed
4384 wx.MOUSE_BTN_ANY check if any button was pressed
4385 ==================== =====================================
4386
4387 """
5b5c9bc7 4388 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4389
4390 def ButtonIsDown(*args, **kwargs):
4391 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4392 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4393
4394 def GetButton(*args, **kwargs):
27fb7603
RD
4395 """
4396 GetButton(self) -> int
4397
4398 Returns the mouse button which generated this event or
4399 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4400 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4401 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4402 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4403 right buttons respectively.
4404 """
5b5c9bc7 4405 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4406
4407 def ControlDown(*args, **kwargs):
27fb7603
RD
4408 """
4409 ControlDown(self) -> bool
4410
4411 Returns true if the control key was down at the time of the event.
4412 """
5b5c9bc7 4413 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4414
4415 def MetaDown(*args, **kwargs):
27fb7603
RD
4416 """
4417 MetaDown(self) -> bool
4418
4419 Returns true if the Meta key was down at the time of the event.
4420 """
5b5c9bc7 4421 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4422
4423 def AltDown(*args, **kwargs):
27fb7603
RD
4424 """
4425 AltDown(self) -> bool
4426
4427 Returns true if the Alt key was down at the time of the event.
4428 """
5b5c9bc7 4429 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4430
4431 def ShiftDown(*args, **kwargs):
27fb7603
RD
4432 """
4433 ShiftDown(self) -> bool
4434
4435 Returns true if the Shift key was down at the time of the event.
4436 """
5b5c9bc7 4437 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4438
412d302d
RD
4439 def CmdDown(*args, **kwargs):
4440 """
4441 CmdDown(self) -> bool
4442
4443 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4444 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4445 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4446 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4447 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4448 purpose. So for non-Mac platforms this is the same as `ControlDown`
4449 and Macs this is the same as `MetaDown`.
4450 """
5b5c9bc7 4451 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4452
d55e5bfc 4453 def LeftDown(*args, **kwargs):
27fb7603
RD
4454 """
4455 LeftDown(self) -> bool
4456
4457 Returns true if the left mouse button state changed to down.
4458 """
5b5c9bc7 4459 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4460
4461 def MiddleDown(*args, **kwargs):
27fb7603
RD
4462 """
4463 MiddleDown(self) -> bool
4464
4465 Returns true if the middle mouse button state changed to down.
4466 """
5b5c9bc7 4467 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4468
4469 def RightDown(*args, **kwargs):
27fb7603
RD
4470 """
4471 RightDown(self) -> bool
4472
4473 Returns true if the right mouse button state changed to down.
4474 """
5b5c9bc7 4475 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4476
4477 def LeftUp(*args, **kwargs):
27fb7603
RD
4478 """
4479 LeftUp(self) -> bool
4480
4481 Returns true if the left mouse button state changed to up.
4482 """
5b5c9bc7 4483 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4484
4485 def MiddleUp(*args, **kwargs):
27fb7603
RD
4486 """
4487 MiddleUp(self) -> bool
4488
4489 Returns true if the middle mouse button state changed to up.
4490 """
5b5c9bc7 4491 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4492
4493 def RightUp(*args, **kwargs):
27fb7603
RD
4494 """
4495 RightUp(self) -> bool
4496
4497 Returns true if the right mouse button state changed to up.
4498 """
5b5c9bc7 4499 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4500
4501 def LeftDClick(*args, **kwargs):
27fb7603
RD
4502 """
4503 LeftDClick(self) -> bool
4504
4505 Returns true if the event was a left button double click.
4506 """
5b5c9bc7 4507 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4508
4509 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4510 """
4511 MiddleDClick(self) -> bool
4512
4513 Returns true if the event was a middle button double click.
4514 """
5b5c9bc7 4515 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4516
4517 def RightDClick(*args, **kwargs):
27fb7603
RD
4518 """
4519 RightDClick(self) -> bool
4520
4521 Returns true if the event was a right button double click.
4522 """
5b5c9bc7 4523 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4524
4525 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4526 """
4527 LeftIsDown(self) -> bool
4528
4529 Returns true if the left mouse button is currently down, independent
4530 of the current event type.
4531
4532 Please notice that it is not the same as LeftDown which returns true
4533 if the left mouse button was just pressed. Rather, it describes the
4534 state of the mouse button before the event happened.
4535
4536 This event is usually used in the mouse event handlers which process
4537 "move mouse" messages to determine whether the user is (still)
4538 dragging the mouse.
4539 """
5b5c9bc7 4540 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4541
4542 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4543 """
4544 MiddleIsDown(self) -> bool
4545
4546 Returns true if the middle mouse button is currently down, independent
4547 of the current event type.
4548 """
5b5c9bc7 4549 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4550
4551 def RightIsDown(*args, **kwargs):
27fb7603
RD
4552 """
4553 RightIsDown(self) -> bool
4554
4555 Returns true if the right mouse button is currently down, independent
4556 of the current event type.
4557 """
5b5c9bc7 4558 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4559
4560 def Dragging(*args, **kwargs):
27fb7603
RD
4561 """
4562 Dragging(self) -> bool
4563
4564 Returns true if this was a dragging event (motion while a button is
4565 depressed).
4566 """
5b5c9bc7 4567 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4568
4569 def Moving(*args, **kwargs):
27fb7603
RD
4570 """
4571 Moving(self) -> bool
4572
4573 Returns true if this was a motion event and no mouse buttons were
4574 pressed. If any mouse button is held pressed, then this method returns
4575 false and Dragging returns true.
4576 """
5b5c9bc7 4577 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4578
4579 def Entering(*args, **kwargs):
27fb7603
RD
4580 """
4581 Entering(self) -> bool
4582
4583 Returns true if the mouse was entering the window.
4584 """
5b5c9bc7 4585 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4586
4587 def Leaving(*args, **kwargs):
27fb7603
RD
4588 """
4589 Leaving(self) -> bool
4590
4591 Returns true if the mouse was leaving the window.
4592 """
5b5c9bc7 4593 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4594
4595 def GetPosition(*args, **kwargs):
4596 """
5b5c9bc7 4597 GetPosition(self) -> Point
d55e5bfc 4598
27fb7603
RD
4599 Returns the pixel position of the mouse in window coordinates when the
4600 event happened.
d55e5bfc 4601 """
5b5c9bc7 4602 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4603
4604 def GetPositionTuple(*args, **kwargs):
4605 """
4606 GetPositionTuple() -> (x,y)
4607
27fb7603
RD
4608 Returns the pixel position of the mouse in window coordinates when the
4609 event happened.
d55e5bfc 4610 """
5b5c9bc7 4611 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4612
4613 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4614 """
4615 GetLogicalPosition(self, DC dc) -> Point
4616
4617 Returns the logical mouse position in pixels (i.e. translated
4618 according to the translation set for the DC, which usually indicates
4619 that the window has been scrolled).
4620 """
5b5c9bc7 4621 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
4622
4623 def GetX(*args, **kwargs):
27fb7603
RD
4624 """
4625 GetX(self) -> int
4626
4627 Returns X coordinate of the physical mouse event position.
4628 """
5b5c9bc7 4629 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4630
4631 def GetY(*args, **kwargs):
27fb7603
RD
4632 """
4633 GetY(self) -> int
4634
4635 Returns Y coordinate of the physical mouse event position.
4636 """
5b5c9bc7 4637 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4638
4639 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4640 """
4641 GetWheelRotation(self) -> int
4642
4643 Get wheel rotation, positive or negative indicates direction of
4644 rotation. Current devices all send an event when rotation is equal to
4645 +/-WheelDelta, but this allows for finer resolution devices to be
4646 created in the future. Because of this you shouldn't assume that one
4647 event is equal to 1 line or whatever, but you should be able to either
4648 do partial line scrolling or wait until +/-WheelDelta rotation values
4649 have been accumulated before scrolling.
4650 """
5b5c9bc7 4651 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
4652
4653 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4654 """
4655 GetWheelDelta(self) -> int
4656
4657 Get wheel delta, normally 120. This is the threshold for action to be
4658 taken, and one such action (for example, scrolling one increment)
4659 should occur for each delta.
4660 """
5b5c9bc7 4661 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
4662
4663 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4664 """
4665 GetLinesPerAction(self) -> int
4666
4667 Returns the configured number of lines (or whatever) to be scrolled
4668 per wheel action. Defaults to three.
4669 """
5b5c9bc7 4670 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
4671
4672 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4673 """
4674 IsPageScroll(self) -> bool
4675
4676 Returns true if the system has been setup to do page scrolling with
4677 the mouse wheel instead of line scrolling.
4678 """
5b5c9bc7
RD
4679 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4680
4681 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4682 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4683 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4684 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4685 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4686 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4687 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4688 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4689 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4690 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4691 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4692 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
4693
4694class MouseEventPtr(MouseEvent):
d55e5bfc
RD
4695 def __init__(self, this):
4696 self.this = this
4697 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4698 self.__class__ = MouseEvent
4699_core_.MouseEvent_swigregister(MouseEventPtr)
d55e5bfc
RD
4700
4701#---------------------------------------------------------------------------
4702
5b5c9bc7 4703class SetCursorEvent(Event):
5ba5649b
RD
4704 """
4705 A SetCursorEvent is generated when the mouse cursor is about to be set
4706 as a result of mouse motion. This event gives the application the
4707 chance to perform specific mouse cursor processing based on the
4708 current position of the mouse within the window. Use the `SetCursor`
4709 method to specify the cursor you want to be displayed.
4710 """
d55e5bfc
RD
4711 def __repr__(self):
4712 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4713 def __init__(self, *args, **kwargs):
5ba5649b
RD
4714 """
4715 __init__(self, int x=0, int y=0) -> SetCursorEvent
4716
4717 Construct a new `wx.SetCursorEvent`.
4718 """
5b5c9bc7 4719 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
d55e5bfc
RD
4720 self.this = newobj.this
4721 self.thisown = 1
4722 del newobj.thisown
4723 def GetX(*args, **kwargs):
5ba5649b
RD
4724 """
4725 GetX(self) -> int
4726
4727 Returns the X coordinate of the mouse in client coordinates.
4728 """
5b5c9bc7 4729 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4730
4731 def GetY(*args, **kwargs):
5ba5649b
RD
4732 """
4733 GetY(self) -> int
4734
4735 Returns the Y coordinate of the mouse in client coordinates.
4736 """
5b5c9bc7 4737 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4738
4739 def SetCursor(*args, **kwargs):
5ba5649b
RD
4740 """
4741 SetCursor(self, Cursor cursor)
4742
4743 Sets the cursor associated with this event.
4744 """
5b5c9bc7 4745 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
4746
4747 def GetCursor(*args, **kwargs):
5ba5649b
RD
4748 """
4749 GetCursor(self) -> Cursor
4750
4751 Returns a reference to the cursor specified by this event.
4752 """
5b5c9bc7 4753 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
4754
4755 def HasCursor(*args, **kwargs):
5ba5649b
RD
4756 """
4757 HasCursor(self) -> bool
4758
4759 Returns true if the cursor specified by this event is a valid cursor.
4760 """
5b5c9bc7 4761 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc
RD
4762
4763
5b5c9bc7 4764class SetCursorEventPtr(SetCursorEvent):
d55e5bfc
RD
4765 def __init__(self, this):
4766 self.this = this
4767 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
4768 self.__class__ = SetCursorEvent
4769_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
d55e5bfc
RD
4770
4771#---------------------------------------------------------------------------
4772
5b5c9bc7 4773class KeyEvent(Event):
5ba5649b
RD
4774 """
4775 This event class contains information about keypress and character
4776 events. These events are only sent to the widget that currently has
4777 the keyboard focus.
4778
4779 Notice that there are three different kinds of keyboard events in
4780 wxWidgets: key down and up events and char events. The difference
4781 between the first two is clear - the first corresponds to a key press
4782 and the second to a key release - otherwise they are identical. Just
4783 note that if the key is maintained in a pressed state you will
4784 typically get a lot of (automatically generated) down events but only
4785 one up so it is wrong to assume that there is one up event
4786 corresponding to each down one.
4787
4788 Both key events provide untranslated key codes while the char event
4789 carries the translated one. The untranslated code for alphanumeric
4790 keys is always an upper case value. For the other keys it is one of
4791 WXK_XXX values from the keycodes table. The translated key is, in
4792 general, the character the user expects to appear as the result of the
4793 key combination when typing the text into a text entry zone, for
4794 example.
4795
4796 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4797 and the standard US keyboard): when the 'A' key is pressed, the key
4798 down event key code is equal to ASCII A == 65. But the char event key
4799 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4800 'A' keys simultaneously , the key code in key down event will still be
4801 just 'A' while the char event key code parameter will now be 'A' as
4802 well.
4803
4804 Although in this simple case it is clear that the correct key code
4805 could be found in the key down event handler by checking the value
4806 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4807 as for non alphanumeric keys or non-US keyboard layouts the
4808 translation is keyboard-layout dependent and can only be done properly
4809 by the system itself.
4810
4811 Another kind of translation is done when the control key is pressed:
4812 for example, for CTRL-A key press the key down event still carries the
4813 same key code 'A' as usual but the char event will have key code of 1,
4814 the ASCII value of this key combination.
4815
4816 You may discover how the other keys on your system behave
4817 interactively by running the KeyEvents sample in the wxPython demo and
4818 pressing some keys while the blue box at the top has the keyboard
4819 focus.
4820
4821 **Note**: If a key down event is caught and the event handler does not
4822 call event.Skip() then the coresponding char event will not
4823 happen. This is by design and enables the programs that handle both
4824 types of events to be a bit simpler.
4825
4826 **Note for Windows programmers**: The key and char events in wxWidgets
4827 are similar to but slightly different from Windows WM_KEYDOWN and
4828 WM_CHAR events. In particular, Alt-x combination will generate a char
4829 event in wxWidgets (unless it is used as an accelerator).
4830
4831 **Tip**: be sure to call event.Skip() for events that you don't
4832 process in key event function, otherwise menu shortcuts may cease to
4833 work under Windows.
4834
4835 """
d55e5bfc
RD
4836 def __repr__(self):
4837 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4838 def __init__(self, *args, **kwargs):
5ba5649b
RD
4839 """
4840 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
4841
4842 Construct a new `wx.KeyEvent`. Valid event types are:
4843 *
4844 """
5b5c9bc7 4845 newobj = _core_.new_KeyEvent(*args, **kwargs)
d55e5bfc
RD
4846 self.this = newobj.this
4847 self.thisown = 1
4848 del newobj.thisown
4849 def ControlDown(*args, **kwargs):
5ba5649b
RD
4850 """
4851 ControlDown(self) -> bool
4852
4853 Returns ``True`` if the Control key was down at the time of the event.
4854 """
5b5c9bc7 4855 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4856
4857 def MetaDown(*args, **kwargs):
5ba5649b
RD
4858 """
4859 MetaDown(self) -> bool
4860
4861 Returns ``True`` if the Meta key was down at the time of the event.
4862 """
5b5c9bc7 4863 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4864
4865 def AltDown(*args, **kwargs):
5ba5649b
RD
4866 """
4867 AltDown(self) -> bool
4868
4869 Returns ``True`` if the Alt key was down at the time of the event.
4870 """
5b5c9bc7 4871 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4872
4873 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4874 """
4875 ShiftDown(self) -> bool
4876
4877 Returns ``True`` if the Shift key was down at the time of the event.
4878 """
5b5c9bc7 4879 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4880
412d302d
RD
4881 def CmdDown(*args, **kwargs):
4882 """
4883 CmdDown(self) -> bool
4884
4885 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4886 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4887 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4888 because Cmd key is used for the same thing under Mac as Ctrl
4889 elsewhere. The Ctrl still exists, it's just not used for this
4890 purpose. So for non-Mac platforms this is the same as `ControlDown`
4891 and Macs this is the same as `MetaDown`.
4892 """
5b5c9bc7 4893 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 4894
d55e5bfc 4895 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4896 """
4897 HasModifiers(self) -> bool
4898
4899 Returns true if either CTRL or ALT keys was down at the time of the
4900 key event. Note that this function does not take into account neither
4901 SHIFT nor META key states (the reason for ignoring the latter is that
4902 it is common for NUMLOCK key to be configured as META under X but the
4903 key presses even while NUMLOCK is on should be still processed
4904 normally).
4905 """
5b5c9bc7 4906 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
4907
4908 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4909 """
4910 GetKeyCode(self) -> int
4911
4912 Returns the virtual key code. ASCII events return normal ASCII values,
4913 while non-ASCII events return values such as WXK_LEFT for the left
4914 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4915 codes.
4916
4917 Note that in Unicode build, the returned value is meaningful only if
4918 the user entered a character that can be represented in current
4919 locale's default charset. You can obtain the corresponding Unicode
4920 character using `GetUnicodeKey`.
4921 """
5b5c9bc7 4922 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
4923
4924 KeyCode = GetKeyCode
bb4524c4 4925 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4926 """
4927 GetUnicodeKey(self) -> int
4928
4929 Returns the Unicode character corresponding to this key event. This
4930 function is only meaningfule in a Unicode build of wxPython.
4931 """
5b5c9bc7 4932 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 4933
bb4524c4 4934 GetUniChar = GetUnicodeKey
d55e5bfc 4935 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4936 """
4937 GetRawKeyCode(self) -> unsigned int
4938
4939 Returns the raw key code for this event. This is a platform-dependent
4940 scan code which should only be used in advanced
4941 applications. Currently the raw key codes are not supported by all
4942 ports.
4943 """
5b5c9bc7 4944 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
4945
4946 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4947 """
4948 GetRawKeyFlags(self) -> unsigned int
4949
4950 Returns the low level key flags for this event. The flags are
4951 platform-dependent and should only be used in advanced applications.
4952 Currently the raw key flags are not supported by all ports.
4953 """
5b5c9bc7 4954 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
4955
4956 def GetPosition(*args, **kwargs):
4957 """
5b5c9bc7 4958 GetPosition(self) -> Point
d55e5bfc 4959
5ba5649b 4960 Find the position of the event, if applicable.
d55e5bfc 4961 """
5b5c9bc7 4962 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4963
4964 def GetPositionTuple(*args, **kwargs):
4965 """
4966 GetPositionTuple() -> (x,y)
4967
5ba5649b 4968 Find the position of the event, if applicable.
d55e5bfc 4969 """
5b5c9bc7 4970 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4971
4972 def GetX(*args, **kwargs):
5ba5649b
RD
4973 """
4974 GetX(self) -> int
4975
4976 Returns the X position (in client coordinates) of the event, if
4977 applicable.
4978 """
5b5c9bc7 4979 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4980
4981 def GetY(*args, **kwargs):
5ba5649b
RD
4982 """
4983 GetY(self) -> int
4984
4985 Returns the Y position (in client coordinates) of the event, if
4986 applicable.
4987 """
5b5c9bc7
RD
4988 return _core_.KeyEvent_GetY(*args, **kwargs)
4989
4990 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4991 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4992 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4993 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4994 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4995 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4996 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4997 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4998 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4999 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
5000
5001class KeyEventPtr(KeyEvent):
d55e5bfc
RD
5002 def __init__(self, this):
5003 self.this = this
5004 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5005 self.__class__ = KeyEvent
5006_core_.KeyEvent_swigregister(KeyEventPtr)
d55e5bfc
RD
5007
5008#---------------------------------------------------------------------------
5009
5b5c9bc7 5010class SizeEvent(Event):
5ba5649b
RD
5011 """
5012 A size event holds information about size change events. The EVT_SIZE
5013 handler function will be called when the window it is bound to has
5014 been resized.
5015
5016 Note that the size passed is of the whole window: call
5017 `wx.Window.GetClientSize` for the area which may be used by the
5018 application.
5019
5020 When a window is resized, usually only a small part of the window is
5021 damaged and and that area is all that is in the update region for the
5022 next paint event. However, if your drawing depends on the size of the
5023 window, you may need to clear the DC explicitly and repaint the whole
5024 window. In which case, you may need to call `wx.Window.Refresh` to
5025 invalidate the entire window.
5026
5027 """
d55e5bfc
RD
5028 def __repr__(self):
5029 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5030 def __init__(self, *args, **kwargs):
5ba5649b
RD
5031 """
5032 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5033
5034 Construct a new ``wx.SizeEvent``.
5035 """
5b5c9bc7 5036 newobj = _core_.new_SizeEvent(*args, **kwargs)
d55e5bfc
RD
5037 self.this = newobj.this
5038 self.thisown = 1
5039 del newobj.thisown
5040 def GetSize(*args, **kwargs):
5ba5649b
RD
5041 """
5042 GetSize(self) -> Size
5043
5044 Returns the entire size of the window generating the size change
5045 event.
5046 """
5b5c9bc7 5047 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
5048
5049 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5050 """GetRect(self) -> Rect"""
5051 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5052
5053 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5054 """SetRect(self, Rect rect)"""
5055 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5056
5057 def SetSize(*args, **kwargs):
5b5c9bc7
RD
5058 """SetSize(self, Size size)"""
5059 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 5060
5b5c9bc7
RD
5061 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5062 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
d55e5bfc 5063
5b5c9bc7 5064class SizeEventPtr(SizeEvent):
d55e5bfc
RD
5065 def __init__(self, this):
5066 self.this = this
5067 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5068 self.__class__ = SizeEvent
5069_core_.SizeEvent_swigregister(SizeEventPtr)
d55e5bfc
RD
5070
5071#---------------------------------------------------------------------------
5072
5b5c9bc7 5073class MoveEvent(Event):
5ba5649b
RD
5074 """
5075 This event object is sent for EVT_MOVE event bindings when a window is
5076 moved to a new position.
5077 """
d55e5bfc
RD
5078 def __repr__(self):
5079 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5080 def __init__(self, *args, **kwargs):
5ba5649b
RD
5081 """
5082 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5083
5084 Constructor.
5085 """
5b5c9bc7 5086 newobj = _core_.new_MoveEvent(*args, **kwargs)
d55e5bfc
RD
5087 self.this = newobj.this
5088 self.thisown = 1
5089 del newobj.thisown
5090 def GetPosition(*args, **kwargs):
5ba5649b
RD
5091 """
5092 GetPosition(self) -> Point
5093
5094 Returns the position of the window generating the move change event.
5095 """
5b5c9bc7 5096 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5097
5098 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5099 """GetRect(self) -> Rect"""
5100 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5101
5102 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5103 """SetRect(self, Rect rect)"""
5104 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5105
5106 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
5107 """SetPosition(self, Point pos)"""
5108 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 5109
fef4c27a
RD
5110 m_pos = property(GetPosition, SetPosition)
5111 m_rect = property(GetRect, SetRect)
5112
d55e5bfc 5113
5b5c9bc7 5114class MoveEventPtr(MoveEvent):
d55e5bfc
RD
5115 def __init__(self, this):
5116 self.this = this
5117 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5118 self.__class__ = MoveEvent
5119_core_.MoveEvent_swigregister(MoveEventPtr)
d55e5bfc
RD
5120
5121#---------------------------------------------------------------------------
5122
5b5c9bc7 5123class PaintEvent(Event):
5ba5649b
RD
5124 """
5125 A paint event is sent when a window's contents needs to be repainted.
5126 Note that in an EVT_PAINT handler the application must *always* create
5127 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5128 Windows assumes that the window has not been painted yet and will send
5129 the event again, causing endless refreshes.
5130
5131 You can optimize painting by retrieving the rectangles that have been
5132 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5133 and only repainting these rectangles. The rectangles are in terms of
5134 the client area, and are unscrolled, so you will need to do some
5135 calculations using the current view position to obtain logical,
5136 scrolled units.
5137
5138 """
d55e5bfc
RD
5139 def __repr__(self):
5140 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5141 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
5142 """__init__(self, int Id=0) -> PaintEvent"""
5143 newobj = _core_.new_PaintEvent(*args, **kwargs)
d55e5bfc
RD
5144 self.this = newobj.this
5145 self.thisown = 1
5146 del newobj.thisown
5147
5b5c9bc7 5148class PaintEventPtr(PaintEvent):
d55e5bfc
RD
5149 def __init__(self, this):
5150 self.this = this
5151 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5152 self.__class__ = PaintEvent
5153_core_.PaintEvent_swigregister(PaintEventPtr)
d55e5bfc 5154
5b5c9bc7
RD
5155class NcPaintEvent(Event):
5156 """Proxy of C++ NcPaintEvent class"""
d55e5bfc
RD
5157 def __repr__(self):
5158 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5159 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
5160 """__init__(self, int winid=0) -> NcPaintEvent"""
5161 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
d55e5bfc
RD
5162 self.this = newobj.this
5163 self.thisown = 1
5164 del newobj.thisown
5165
5b5c9bc7 5166class NcPaintEventPtr(NcPaintEvent):
d55e5bfc
RD
5167 def __init__(self, this):
5168 self.this = this
5169 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5170 self.__class__ = NcPaintEvent
5171_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
d55e5bfc
RD
5172
5173#---------------------------------------------------------------------------
5174
5b5c9bc7 5175class EraseEvent(Event):
5ba5649b
RD
5176 """
5177 An erase event is sent whenever the background of a window needs to be
5178 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5179 binder. On some platforms, such as GTK+, this event is simulated
5180 (simply generated just before the paint event) and may cause flicker.
5181
5182 To paint a custom background use the `GetDC` method and use the returned
5183 device context if it is not ``None``, otherwise create a temporary
5184 `wx.ClientDC` and draw on that.
5185
5186 """
d55e5bfc
RD
5187 def __repr__(self):
5188 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5189 def __init__(self, *args, **kwargs):
5ba5649b
RD
5190 """
5191 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5192
5193 Constructor
5194 """
5b5c9bc7 5195 newobj = _core_.new_EraseEvent(*args, **kwargs)
d55e5bfc
RD
5196 self.this = newobj.this
5197 self.thisown = 1
5198 del newobj.thisown
5199 def GetDC(*args, **kwargs):
5ba5649b
RD
5200 """
5201 GetDC(self) -> DC
5202
5203 Returns the device context the event handler should draw upon. If
5204 ``None`` is returned then create a temporary `wx.ClientDC` and use
5205 that instead.
5206 """
5b5c9bc7 5207 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc
RD
5208
5209
5b5c9bc7 5210class EraseEventPtr(EraseEvent):
d55e5bfc
RD
5211 def __init__(self, this):
5212 self.this = this
5213 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5214 self.__class__ = EraseEvent
5215_core_.EraseEvent_swigregister(EraseEventPtr)
d55e5bfc
RD
5216
5217#---------------------------------------------------------------------------
5218
5b5c9bc7 5219class FocusEvent(Event):
5ba5649b
RD
5220 """
5221 A focus event is sent when a window's focus changes. The window losing
5222 focus receives an EVT_KILL_FOCUS event while the window gaining it
5223 gets an EVT_SET_FOCUS event.
5224
5225 Notice that the set focus event happens both when the user gives focus
5226 to the window (whether using the mouse or keyboard) and when it is
5227 done from the program itself using `wx.Window.SetFocus`.
5228
5229 """
d55e5bfc
RD
5230 def __repr__(self):
5231 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5232 def __init__(self, *args, **kwargs):
5ba5649b
RD
5233 """
5234 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5235
5236 Constructor
5237 """
5b5c9bc7 5238 newobj = _core_.new_FocusEvent(*args, **kwargs)
d55e5bfc
RD
5239 self.this = newobj.this
5240 self.thisown = 1
5241 del newobj.thisown
5242 def GetWindow(*args, **kwargs):
5ba5649b
RD
5243 """
5244 GetWindow(self) -> Window
5245
5246 Returns the other window associated with this event, that is the
5247 window which had the focus before for the EVT_SET_FOCUS event and the
5248 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5249
5250 Warning: the window returned may be None!
5251 """
5b5c9bc7 5252 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5253
5254 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5255 """SetWindow(self, Window win)"""
5256 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc
RD
5257
5258
5b5c9bc7 5259class FocusEventPtr(FocusEvent):
d55e5bfc
RD
5260 def __init__(self, this):
5261 self.this = this
5262 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5263 self.__class__ = FocusEvent
5264_core_.FocusEvent_swigregister(FocusEventPtr)
d55e5bfc
RD
5265
5266#---------------------------------------------------------------------------
5267
5b5c9bc7 5268class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5269 """
5270 wx.ChildFocusEvent notifies the parent that a child has received the
5271 focus. Unlike `wx.FocusEvent` it is propagated up the window
5272 heirarchy.
5273 """
d55e5bfc
RD
5274 def __repr__(self):
5275 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5276 def __init__(self, *args, **kwargs):
5ba5649b
RD
5277 """
5278 __init__(self, Window win=None) -> ChildFocusEvent
5279
5280 Constructor
5281 """
5b5c9bc7 5282 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
d55e5bfc
RD
5283 self.this = newobj.this
5284 self.thisown = 1
5285 del newobj.thisown
5286 def GetWindow(*args, **kwargs):
5ba5649b
RD
5287 """
5288 GetWindow(self) -> Window
5289
5290 The window which has just received the focus.
5291 """
5b5c9bc7 5292 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5293
5294
5b5c9bc7 5295class ChildFocusEventPtr(ChildFocusEvent):
d55e5bfc
RD
5296 def __init__(self, this):
5297 self.this = this
5298 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5299 self.__class__ = ChildFocusEvent
5300_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
d55e5bfc
RD
5301
5302#---------------------------------------------------------------------------
5303
5b5c9bc7 5304class ActivateEvent(Event):
5ba5649b
RD
5305 """
5306 An activate event is sent when a top-level window or the entire
5307 application is being activated or deactivated.
5308
5309 A top-level window (a dialog or frame) receives an activate event when
5310 is being activated or deactivated. This is indicated visually by the
5311 title bar changing colour, and a subwindow gaining the keyboard focus.
5312 An application is activated or deactivated when one of its frames
5313 becomes activated, or a frame becomes inactivate resulting in all
5314 application frames being inactive.
5315
5316 Please note that usually you should call event.Skip() in your handlers
5317 for these events so the default handlers will still be called, as not
5318 doing so can result in strange effects.
5319
5320 """
d55e5bfc
RD
5321 def __repr__(self):
5322 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5323 def __init__(self, *args, **kwargs):
5ba5649b
RD
5324 """
5325 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5326
5327 Constructor
5328 """
5b5c9bc7 5329 newobj = _core_.new_ActivateEvent(*args, **kwargs)
d55e5bfc
RD
5330 self.this = newobj.this
5331 self.thisown = 1
5332 del newobj.thisown
5333 def GetActive(*args, **kwargs):
5ba5649b
RD
5334 """
5335 GetActive(self) -> bool
5336
5337 Returns true if the application or window is being activated, false
5338 otherwise.
5339 """
5b5c9bc7 5340 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc
RD
5341
5342
5b5c9bc7 5343class ActivateEventPtr(ActivateEvent):
d55e5bfc
RD
5344 def __init__(self, this):
5345 self.this = this
5346 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5347 self.__class__ = ActivateEvent
5348_core_.ActivateEvent_swigregister(ActivateEventPtr)
d55e5bfc
RD
5349
5350#---------------------------------------------------------------------------
5351
5b5c9bc7 5352class InitDialogEvent(Event):
5ba5649b
RD
5353 """
5354 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5355 any window when `wx.Window.InitDialog` is called. Handlers for this
5356 event can transfer data to the window, or anything else that should be
5357 done before the user begins editing the form. The default handler
5358 calls `wx.Window.TransferDataToWindow`.
5359 """
d55e5bfc
RD
5360 def __repr__(self):
5361 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5362 def __init__(self, *args, **kwargs):
5ba5649b
RD
5363 """
5364 __init__(self, int Id=0) -> InitDialogEvent
5365
5366 Constructor
5367 """
5b5c9bc7 5368 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
d55e5bfc
RD
5369 self.this = newobj.this
5370 self.thisown = 1
5371 del newobj.thisown
5372
5b5c9bc7 5373class InitDialogEventPtr(InitDialogEvent):
d55e5bfc
RD
5374 def __init__(self, this):
5375 self.this = this
5376 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5377 self.__class__ = InitDialogEvent
5378_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
d55e5bfc
RD
5379
5380#---------------------------------------------------------------------------
5381
5b5c9bc7 5382class MenuEvent(Event):
5ba5649b
RD
5383 """
5384 This class is used for a variety of menu-related events. Note that
5385 these do not include menu command events, which are handled by sending
5386 `wx.CommandEvent` objects.
5387
5388 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5389 text in the first field of the status bar.
5390 """
d55e5bfc
RD
5391 def __repr__(self):
5392 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5393 def __init__(self, *args, **kwargs):
5ba5649b
RD
5394 """
5395 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5396
5397 Constructor
5398 """
5b5c9bc7 5399 newobj = _core_.new_MenuEvent(*args, **kwargs)
d55e5bfc
RD
5400 self.this = newobj.this
5401 self.thisown = 1
5402 del newobj.thisown
5403 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5404 """
5405 GetMenuId(self) -> int
5406
5407 Returns the menu identifier associated with the event. This method
5408 should be only used with the HIGHLIGHT events.
5409 """
5b5c9bc7 5410 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5411
5412 def IsPopup(*args, **kwargs):
5ba5649b
RD
5413 """
5414 IsPopup(self) -> bool
5415
5416 Returns ``True`` if the menu which is being opened or closed is a
5417 popup menu, ``False`` if it is a normal one. This method should only
5418 be used with the OPEN and CLOSE events.
5419 """
5b5c9bc7 5420 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5421
5422 def GetMenu(*args, **kwargs):
5ba5649b
RD
5423 """
5424 GetMenu(self) -> Menu
5425
5426 Returns the menu which is being opened or closed. This method should
5427 only be used with the OPEN and CLOSE events.
5428 """
5b5c9bc7 5429 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc
RD
5430
5431
5b5c9bc7 5432class MenuEventPtr(MenuEvent):
d55e5bfc
RD
5433 def __init__(self, this):
5434 self.this = this
5435 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5436 self.__class__ = MenuEvent
5437_core_.MenuEvent_swigregister(MenuEventPtr)
d55e5bfc
RD
5438
5439#---------------------------------------------------------------------------
5440
5b5c9bc7 5441class CloseEvent(Event):
5ba5649b
RD
5442 """
5443 This event class contains information about window and session close
5444 events.
5445
5446 The handler function for EVT_CLOSE is called when the user has tried
5447 to close a a frame or dialog box using the window manager controls or
5448 the system menu. It can also be invoked by the application itself
5449 programmatically, for example by calling the `wx.Window.Close`
5450 function.
5451
5452 You should check whether the application is forcing the deletion of
5453 the window using `CanVeto`. If it returns ``False``, you must destroy
5454 the window using `wx.Window.Destroy`. If the return value is ``True``,
5455 it is up to you whether you respond by destroying the window or not.
5456 For example you may wish to display a message dialog prompting to save
5457 files or to cancel the close.
5458
5459 If you don't destroy the window, you should call `Veto` to let the
5460 calling code know that you did not destroy the window. This allows the
5461 `wx.Window.Close` function to return ``True`` or ``False`` depending
5462 on whether the close instruction was honored or not.
5463 """
d55e5bfc
RD
5464 def __repr__(self):
5465 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5466 def __init__(self, *args, **kwargs):
5ba5649b
RD
5467 """
5468 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5469
5470 Constructor.
5471 """
5b5c9bc7 5472 newobj = _core_.new_CloseEvent(*args, **kwargs)
d55e5bfc
RD
5473 self.this = newobj.this
5474 self.thisown = 1
5475 del newobj.thisown
5476 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5477 """
5478 SetLoggingOff(self, bool logOff)
5479
5480 Sets the 'logging off' flag.
5481 """
5b5c9bc7 5482 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5483
5484 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5485 """
5486 GetLoggingOff(self) -> bool
5487
5488 Returns true if the user is logging off.
5489 """
5b5c9bc7 5490 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5491
5492 def Veto(*args, **kwargs):
5ba5649b
RD
5493 """
5494 Veto(self, bool veto=True)
5495
5496 Call this from your event handler to veto a system shutdown or to
5497 signal to the calling application that a window close did not happen.
5498
5499 You can only veto a shutdown or close if `CanVeto` returns true.
5500 """
5b5c9bc7 5501 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5502
5ba5649b
RD
5503 def GetVeto(*args, **kwargs):
5504 """GetVeto(self) -> bool"""
5505 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5506
d55e5bfc 5507 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5508 """
5509 SetCanVeto(self, bool canVeto)
5510
5511 Sets the 'can veto' flag.
5512 """
5b5c9bc7 5513 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5514
5515 def CanVeto(*args, **kwargs):
5ba5649b
RD
5516 """
5517 CanVeto(self) -> bool
d55e5bfc 5518
5ba5649b
RD
5519 Returns true if you can veto a system shutdown or a window close
5520 event. Vetoing a window close event is not possible if the calling
5521 code wishes to force the application to exit, and so this function
5522 must be called to check this.
5523 """
5524 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc
RD
5525
5526
5b5c9bc7 5527class CloseEventPtr(CloseEvent):
d55e5bfc
RD
5528 def __init__(self, this):
5529 self.this = this
5530 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5531 self.__class__ = CloseEvent
5532_core_.CloseEvent_swigregister(CloseEventPtr)
d55e5bfc
RD
5533
5534#---------------------------------------------------------------------------
5535
5b5c9bc7 5536class ShowEvent(Event):
5ba5649b 5537 """An EVT_SHOW event is sent when a window is shown or hidden."""
d55e5bfc
RD
5538 def __repr__(self):
5539 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5540 def __init__(self, *args, **kwargs):
5ba5649b
RD
5541 """
5542 __init__(self, int winid=0, bool show=False) -> ShowEvent
5543
5544 An EVT_SHOW event is sent when a window is shown or hidden.
5545 """
5b5c9bc7 5546 newobj = _core_.new_ShowEvent(*args, **kwargs)
d55e5bfc
RD
5547 self.this = newobj.this
5548 self.thisown = 1
5549 del newobj.thisown
5550 def SetShow(*args, **kwargs):
5551 """SetShow(self, bool show)"""
5b5c9bc7 5552 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5553
5554 def GetShow(*args, **kwargs):
5555 """GetShow(self) -> bool"""
5b5c9bc7 5556 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc
RD
5557
5558
5b5c9bc7 5559class ShowEventPtr(ShowEvent):
d55e5bfc
RD
5560 def __init__(self, this):
5561 self.this = this
5562 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5563 self.__class__ = ShowEvent
5564_core_.ShowEvent_swigregister(ShowEventPtr)
d55e5bfc
RD
5565
5566#---------------------------------------------------------------------------
5567
5b5c9bc7 5568class IconizeEvent(Event):
5ba5649b
RD
5569 """
5570 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5571 restored.
5572 """
d55e5bfc
RD
5573 def __repr__(self):
5574 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5575 def __init__(self, *args, **kwargs):
5ba5649b
RD
5576 """
5577 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5578
5579 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5580 restored.
5581 """
5b5c9bc7 5582 newobj = _core_.new_IconizeEvent(*args, **kwargs)
d55e5bfc
RD
5583 self.this = newobj.this
5584 self.thisown = 1
5585 del newobj.thisown
5586 def Iconized(*args, **kwargs):
5ba5649b
RD
5587 """
5588 Iconized(self) -> bool
5589
5590 Returns ``True`` if the frame has been iconized, ``False`` if it has
5591 been restored.
5592 """
5b5c9bc7 5593 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc
RD
5594
5595
5b5c9bc7 5596class IconizeEventPtr(IconizeEvent):
d55e5bfc
RD
5597 def __init__(self, this):
5598 self.this = this
5599 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5600 self.__class__ = IconizeEvent
5601_core_.IconizeEvent_swigregister(IconizeEventPtr)
d55e5bfc
RD
5602
5603#---------------------------------------------------------------------------
5604
5b5c9bc7 5605class MaximizeEvent(Event):
5ba5649b 5606 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
d55e5bfc
RD
5607 def __repr__(self):
5608 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5609 def __init__(self, *args, **kwargs):
5ba5649b
RD
5610 """
5611 __init__(self, int id=0) -> MaximizeEvent
5612
5613 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5614 """
5b5c9bc7 5615 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
d55e5bfc
RD
5616 self.this = newobj.this
5617 self.thisown = 1
5618 del newobj.thisown
5619
5b5c9bc7 5620class MaximizeEventPtr(MaximizeEvent):
d55e5bfc
RD
5621 def __init__(self, this):
5622 self.this = this
5623 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5624 self.__class__ = MaximizeEvent
5625_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
d55e5bfc
RD
5626
5627#---------------------------------------------------------------------------
5628
5b5c9bc7 5629class DropFilesEvent(Event):
5ba5649b
RD
5630 """
5631 This class is used for drop files events, that is, when files have
5632 been dropped onto the window. This functionality is only available
5633 under Windows. The window must have previously been enabled for
5634 dropping by calling `wx.Window.DragAcceptFiles`.
5635
5636 Important note: this is a separate implementation to the more general
5637 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5638 implementation uses the older, Windows message-based approach of
5639 dropping files.
5640
5641 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5642 events.
5643
5644 """
d55e5bfc
RD
5645 def __init__(self): raise RuntimeError, "No constructor defined"
5646 def __repr__(self):
5647 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5648 def GetPosition(*args, **kwargs):
5ba5649b
RD
5649 """
5650 GetPosition(self) -> Point
5651
5652 Returns the position at which the files were dropped.
5653 """
5b5c9bc7 5654 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5655
5656 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5657 """
5658 GetNumberOfFiles(self) -> int
5659
5660 Returns the number of files dropped.
5661 """
5b5c9bc7 5662 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5663
5664 def GetFiles(*args, **kwargs):
5ba5649b
RD
5665 """
5666 GetFiles(self) -> PyObject
5667
5668 Returns a list of the filenames that were dropped.
5669 """
5b5c9bc7 5670 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc
RD
5671
5672
5b5c9bc7 5673class DropFilesEventPtr(DropFilesEvent):
d55e5bfc
RD
5674 def __init__(self, this):
5675 self.this = this
5676 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5677 self.__class__ = DropFilesEvent
5678_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
d55e5bfc
RD
5679
5680#---------------------------------------------------------------------------
5681
5b5c9bc7
RD
5682UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5683UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5684class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5685 """
5686 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5687 wxWidgets to give an application the chance to update various user
5688 interface elements.
5689
5690 Without update UI events, an application has to work hard to
5691 check/uncheck, enable/disable, and set the text for elements such as
5692 menu items and toolbar buttons. The code for doing this has to be
5693 mixed up with the code that is invoked when an action is invoked for a
5694 menu item or button.
5695
5696 With update UI events, you define an event handler to look at the
5697 state of the application and change UI elements accordingly. wxWidgets
5698 will call your handler functions in idle time, so you don't have to
5699 worry where to call this code. In addition to being a clearer and more
5700 declarative method, it also means you don't have to worry whether
5701 you're updating a toolbar or menubar identifier. The same handler can
5702 update a menu item and toolbar button, if the ID values are the same.
5703
5704 Instead of directly manipulating the menu or button, you call
5705 functions in the event object, such as `Check`. wxWidgets will
5706 determine whether such a call has been made, and which UI element to
5707 update.
5708
5709 These events will work for popup menus as well as menubars. Just
5710 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5711 any UI events for the window that owns the menu.
5712
5713 If you find that the overhead of UI update processing is affecting
5714 your application, you can do one or both of the following:
5715
5716 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5717 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5718 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5719 receive update events. No other windows will receive update
5720 events.
5721
5722 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5723 value to set the delay between updates. You may need to call
5724 `wx.Window.UpdateWindowUI` at critical points, for example when
5725 a dialog is about to be shown, in case the user sees a slight
5726 delay before windows are updated.
5727
5728 Note that although events are sent in idle time, defining a EVT_IDLE
5729 handler for a window does not affect this because the events are sent
5730 from an internal idle handler.
5731
5732 wxWidgets tries to optimize update events on some platforms. On
5733 Windows and GTK+, events for menubar items are only sent when the menu
5734 is about to be shown, and not in idle time.
5735
5736 """
d55e5bfc
RD
5737 def __repr__(self):
5738 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5739 def __init__(self, *args, **kwargs):
5ba5649b
RD
5740 """
5741 __init__(self, int commandId=0) -> UpdateUIEvent
5742
5743 Constructor
5744 """
5b5c9bc7 5745 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
d55e5bfc
RD
5746 self.this = newobj.this
5747 self.thisown = 1
5748 del newobj.thisown
5749 def GetChecked(*args, **kwargs):
5ba5649b
RD
5750 """
5751 GetChecked(self) -> bool
5752
5753 Returns ``True`` if the UI element should be checked.
5754 """
5b5c9bc7 5755 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
5756
5757 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5758 """
5759 GetEnabled(self) -> bool
5760
5761 Returns ``True`` if the UI element should be enabled.
5762 """
5b5c9bc7 5763 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc
RD
5764
5765 def GetText(*args, **kwargs):
5ba5649b
RD
5766 """
5767 GetText(self) -> String
5768
5769 Returns the text that should be set for the UI element.
5770 """
5b5c9bc7 5771 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
5772
5773 def GetSetText(*args, **kwargs):
5ba5649b
RD
5774 """
5775 GetSetText(self) -> bool
5776
5777 Returns ``True`` if the application has called `SetText`. For
5778 wxWidgets internal use only.
5779 """
5b5c9bc7 5780 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
5781
5782 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5783 """
5784 GetSetChecked(self) -> bool
5785
5786 Returns ``True`` if the application has called `Check`. For wxWidgets
5787 internal use only.
5788 """
5b5c9bc7 5789 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
5790
5791 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5792 """
5793 GetSetEnabled(self) -> bool
5794
5795 Returns ``True`` if the application has called `Enable`. For wxWidgets
5796 internal use only.
5797 """
5b5c9bc7 5798 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc
RD
5799
5800 def Check(*args, **kwargs):
5ba5649b
RD
5801 """
5802 Check(self, bool check)
5803
5804 Check or uncheck the UI element.
5805 """
5b5c9bc7 5806 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
5807
5808 def Enable(*args, **kwargs):
5ba5649b
RD
5809 """
5810 Enable(self, bool enable)
5811
5812 Enable or disable the UI element.
5813 """
5b5c9bc7 5814 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc
RD
5815
5816 def SetText(*args, **kwargs):
5ba5649b
RD
5817 """
5818 SetText(self, String text)
5819
5820 Sets the text for this UI element.
5821 """
5b5c9bc7 5822 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
5823
5824 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5825 """
5826 SetUpdateInterval(long updateInterval)
5827
5828 Sets the interval between updates in milliseconds. Set to -1 to
5829 disable updates, or to 0 to update as frequently as possible. The
5830 default is 0.
5831
5832 Use this to reduce the overhead of UI update events if your
5833 application has a lot of windows. If you set the value to -1 or
5834 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5835 at appropriate points in your application, such as when a dialog is
5836 about to be shown.
5837 """
5b5c9bc7 5838 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5839
5840 SetUpdateInterval = staticmethod(SetUpdateInterval)
5841 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5842 """
5843 GetUpdateInterval() -> long
5844
5845 Returns the current interval between updates in milliseconds. -1
5846 disables updates, 0 updates as frequently as possible.
5847 """
5b5c9bc7 5848 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5849
5850 GetUpdateInterval = staticmethod(GetUpdateInterval)
5851 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5852 """
5853 CanUpdate(Window win) -> bool
5854
5855 Returns ``True`` if it is appropriate to update (send UI update events
5856 to) this window.
5857
5858 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5859 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5860 events were last sent in idle time, and the update interval, to
5861 determine whether events should be sent to this window now. By default
5862 this will always return true because the update mode is initially
5863 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5864 events will be sent as often as possible. You can reduce the frequency
5865 that events are sent by changing the mode and/or setting an update
5866 interval.
5867
5868 """
5b5c9bc7 5869 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
5870
5871 CanUpdate = staticmethod(CanUpdate)
5872 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5873 """
5874 ResetUpdateTime()
5875
5876 Used internally to reset the last-updated time to the current time. It
5877 is assumed that update events are normally sent in idle time, so this
5878 is called at the end of idle processing.
5879 """
5b5c9bc7 5880 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
5881
5882 ResetUpdateTime = staticmethod(ResetUpdateTime)
5883 def SetMode(*args, **kwargs):
5ba5649b
RD
5884 """
5885 SetMode(int mode)
5886
5887 Specify how wxWidgets will send update events: to all windows, or only
5888 to those which specify that they will process the events.
5889
5890 The mode may be one of the following values:
5891
5892 ============================= ==========================================
5893 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5894 is the default setting.
5895 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5896 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5897 style set.
5898 ============================= ==========================================
5899
5900 """
5b5c9bc7 5901 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
5902
5903 SetMode = staticmethod(SetMode)
5904 def GetMode(*args, **kwargs):
5ba5649b
RD
5905 """
5906 GetMode() -> int
5907
5908 Returns a value specifying how wxWidgets will send update events: to
5909 all windows, or only to those which specify that they will process the
5910 events.
5911 """
5b5c9bc7 5912 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
5913
5914 GetMode = staticmethod(GetMode)
5915
5b5c9bc7 5916class UpdateUIEventPtr(UpdateUIEvent):
d55e5bfc
RD
5917 def __init__(self, this):
5918 self.this = this
5919 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
5920 self.__class__ = UpdateUIEvent
5921_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
d55e5bfc 5922
5b5c9bc7 5923def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5924 """
5925 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5926
5927 Sets the interval between updates in milliseconds. Set to -1 to
5928 disable updates, or to 0 to update as frequently as possible. The
5929 default is 0.
5930
5931 Use this to reduce the overhead of UI update events if your
5932 application has a lot of windows. If you set the value to -1 or
5933 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5934 at appropriate points in your application, such as when a dialog is
5935 about to be shown.
5936 """
5b5c9bc7 5937 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5938
5b5c9bc7 5939def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5940 """
5941 UpdateUIEvent_GetUpdateInterval() -> long
5942
5943 Returns the current interval between updates in milliseconds. -1
5944 disables updates, 0 updates as frequently as possible.
5945 """
5b5c9bc7 5946 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc 5947
5b5c9bc7 5948def UpdateUIEvent_CanUpdate(*args, **kwargs):
5ba5649b
RD
5949 """
5950 UpdateUIEvent_CanUpdate(Window win) -> bool
5951
5952 Returns ``True`` if it is appropriate to update (send UI update events
5953 to) this window.
5954
5955 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5956 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5957 events were last sent in idle time, and the update interval, to
5958 determine whether events should be sent to this window now. By default
5959 this will always return true because the update mode is initially
5960 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5961 events will be sent as often as possible. You can reduce the frequency
5962 that events are sent by changing the mode and/or setting an update
5963 interval.
5964
5965 """
5b5c9bc7 5966 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 5967
5b5c9bc7 5968def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5969 """
5970 UpdateUIEvent_ResetUpdateTime()
5971
5972 Used internally to reset the last-updated time to the current time. It
5973 is assumed that update events are normally sent in idle time, so this
5974 is called at the end of idle processing.
5975 """
5b5c9bc7 5976 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc 5977
5b5c9bc7 5978def UpdateUIEvent_SetMode(*args, **kwargs):
5ba5649b
RD
5979 """
5980 UpdateUIEvent_SetMode(int mode)
5981
5982 Specify how wxWidgets will send update events: to all windows, or only
5983 to those which specify that they will process the events.
5984
5985 The mode may be one of the following values:
5986
5987 ============================= ==========================================
5988 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5989 is the default setting.
5990 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5991 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5992 style set.
5993 ============================= ==========================================
5994
5995 """
5b5c9bc7 5996 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 5997
5b5c9bc7 5998def UpdateUIEvent_GetMode(*args, **kwargs):
5ba5649b
RD
5999 """
6000 UpdateUIEvent_GetMode() -> int
6001
6002 Returns a value specifying how wxWidgets will send update events: to
6003 all windows, or only to those which specify that they will process the
6004 events.
6005 """
5b5c9bc7 6006 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6007
6008#---------------------------------------------------------------------------
6009
5b5c9bc7 6010class SysColourChangedEvent(Event):
5ba5649b
RD
6011 """
6012 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6013 when the user changes the colour settings using the control
6014 panel. This is only applicable under Windows.
6015
6016 The default event handler for this event propagates the event to child
6017 windows, since Windows only sends the events to top-level windows. If
6018 intercepting this event for a top-level window, remember to call
6019 `Skip` so the the base class handler will still be executed, or to
6020 pass the event on to the window's children explicitly.
6021
6022 """
d55e5bfc
RD
6023 def __repr__(self):
6024 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6025 def __init__(self, *args, **kwargs):
5ba5649b
RD
6026 """
6027 __init__(self) -> SysColourChangedEvent
6028
6029 Constructor
6030 """
5b5c9bc7 6031 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
d55e5bfc
RD
6032 self.this = newobj.this
6033 self.thisown = 1
6034 del newobj.thisown
6035
5b5c9bc7 6036class SysColourChangedEventPtr(SysColourChangedEvent):
d55e5bfc
RD
6037 def __init__(self, this):
6038 self.this = this
6039 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6040 self.__class__ = SysColourChangedEvent
6041_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
d55e5bfc
RD
6042
6043#---------------------------------------------------------------------------
6044
5b5c9bc7 6045class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6046 """
6047 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6048 a window that loses its mouse capture. This is called even if
6049 `wx.Window.ReleaseMouse` was called by the application code. Handling
6050 this event allows an application to cater for unexpected capture
6051 releases which might otherwise confuse mouse handling code.
6052
6053 This event is implemented under Windows only.
6054 """
d55e5bfc
RD
6055 def __repr__(self):
6056 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6057 def __init__(self, *args, **kwargs):
5ba5649b
RD
6058 """
6059 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6060
6061 Constructor
6062 """
5b5c9bc7 6063 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
d55e5bfc
RD
6064 self.this = newobj.this
6065 self.thisown = 1
6066 del newobj.thisown
6067 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6068 """
6069 GetCapturedWindow(self) -> Window
6070
6071 Returns the window that gained the capture, or ``None`` if it was a
6072 non-wxWidgets window.
6073 """
5b5c9bc7 6074 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc
RD
6075
6076
5b5c9bc7 6077class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
d55e5bfc
RD
6078 def __init__(self, this):
6079 self.this = this
6080 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6081 self.__class__ = MouseCaptureChangedEvent
6082_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
d55e5bfc
RD
6083
6084#---------------------------------------------------------------------------
6085
5b5c9bc7 6086class DisplayChangedEvent(Event):
5ba5649b
RD
6087 """
6088 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6089 resolution has changed.
6090
6091 This event is implemented under Windows only.
6092 """
d55e5bfc
RD
6093 def __repr__(self):
6094 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6095 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
6096 """__init__(self) -> DisplayChangedEvent"""
6097 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
d55e5bfc
RD
6098 self.this = newobj.this
6099 self.thisown = 1
6100 del newobj.thisown
6101
5b5c9bc7 6102class DisplayChangedEventPtr(DisplayChangedEvent):
d55e5bfc
RD
6103 def __init__(self, this):
6104 self.this = this
6105 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6106 self.__class__ = DisplayChangedEvent
6107_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
d55e5bfc
RD
6108
6109#---------------------------------------------------------------------------
6110
5b5c9bc7 6111class PaletteChangedEvent(Event):
5ba5649b
RD
6112 """
6113 An EVT_PALETTE_CHANGED event is sent when the system palette has
6114 changed, thereby giving each window a chance to redo their own to
6115 match.
6116
6117 This event is implemented under Windows only.
6118 """
d55e5bfc
RD
6119 def __repr__(self):
6120 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6121 def __init__(self, *args, **kwargs):
5ba5649b
RD
6122 """
6123 __init__(self, int id=0) -> PaletteChangedEvent
6124
6125 An EVT_PALETTE_CHANGED event is sent when the system palette has
6126 changed, thereby giving each window a chance to redo their own to
6127 match.
6128
6129 This event is implemented under Windows only.
6130 """
5b5c9bc7 6131 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
d55e5bfc
RD
6132 self.this = newobj.this
6133 self.thisown = 1
6134 del newobj.thisown
6135 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6136 """SetChangedWindow(self, Window win)"""
6137 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
6138
6139 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6140 """GetChangedWindow(self) -> Window"""
6141 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc
RD
6142
6143
5b5c9bc7 6144class PaletteChangedEventPtr(PaletteChangedEvent):
d55e5bfc
RD
6145 def __init__(self, this):
6146 self.this = this
6147 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6148 self.__class__ = PaletteChangedEvent
6149_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
d55e5bfc
RD
6150
6151#---------------------------------------------------------------------------
6152
5b5c9bc7 6153class QueryNewPaletteEvent(Event):
5ba5649b
RD
6154 """
6155 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6156 focus and should re-do its palette.
6157
6158 This event is implemented under Windows only.
6159 """
d55e5bfc
RD
6160 def __repr__(self):
6161 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6162 def __init__(self, *args, **kwargs):
5ba5649b
RD
6163 """
6164 __init__(self, int winid=0) -> QueryNewPaletteEvent
6165
6166 Constructor.
6167 """
5b5c9bc7 6168 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
d55e5bfc
RD
6169 self.this = newobj.this
6170 self.thisown = 1
6171 del newobj.thisown
6172 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6173 """
6174 SetPaletteRealized(self, bool realized)
6175
6176 App should set this if it changes the palette.
6177 """
5b5c9bc7 6178 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
6179
6180 def GetPaletteRealized(*args, **kwargs):
6181 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 6182 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
6183
6184
5b5c9bc7 6185class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
d55e5bfc
RD
6186 def __init__(self, this):
6187 self.this = this
6188 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6189 self.__class__ = QueryNewPaletteEvent
6190_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
d55e5bfc
RD
6191
6192#---------------------------------------------------------------------------
6193
5b5c9bc7 6194class NavigationKeyEvent(Event):
5ba5649b
RD
6195 """
6196 EVT_NAVIGATION_KEY events are used to control moving the focus between
6197 widgets, otherwise known as tab-traversal. You woudl normally not
6198 catch navigation events in applications as there are already
6199 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6200 it useful to send navigation events in certain situations to change
6201 the focus in certain ways, although it's probably easier to just call
6202 `wx.Window.Navigate`.
6203 """
d55e5bfc
RD
6204 def __repr__(self):
6205 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6206 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
6207 """__init__(self) -> NavigationKeyEvent"""
6208 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
d55e5bfc
RD
6209 self.this = newobj.this
6210 self.thisown = 1
6211 del newobj.thisown
6212 def GetDirection(*args, **kwargs):
5ba5649b
RD
6213 """
6214 GetDirection(self) -> bool
6215
6216 Returns ``True`` if the direction is forward, ``False`` otherwise.
6217 """
5b5c9bc7 6218 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
6219
6220 def SetDirection(*args, **kwargs):
5ba5649b
RD
6221 """
6222 SetDirection(self, bool forward)
6223
6224 Specify the direction that the navigation should take. Usually the
6225 difference between using Tab and Shift-Tab.
6226 """
5b5c9bc7 6227 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
6228
6229 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6230 """
6231 IsWindowChange(self) -> bool
6232
6233 Returns ``True`` if window change is allowed.
6234 """
5b5c9bc7 6235 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
6236
6237 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6238 """
6239 SetWindowChange(self, bool ischange)
6240
6241 Specify if the navigation should be able to change parent windows.
6242 For example, changing notebook pages, etc. This is usually implemented
6243 by using Control-Tab.
6244 """
5b5c9bc7 6245 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 6246
68350608 6247 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6248 """
6249 IsFromTab(self) -> bool
6250
6251 Returns ``True`` if the navigation event is originated from the Tab
6252 key.
6253 """
5b5c9bc7 6254 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
6255
6256 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6257 """
6258 SetFromTab(self, bool bIs)
6259
6260 Set to true under MSW if the event was generated using the tab key.
6261 This is required for proper navogation over radio buttons.
6262 """
5b5c9bc7 6263 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 6264
908b74cd 6265 def SetFlags(*args, **kwargs):
5ba5649b
RD
6266 """
6267 SetFlags(self, long flags)
6268
6269 Set the navigation flags to a combination of the following:
6270
6271 * wx.NavigationKeyEvent.IsBackward
6272 * wx.NavigationKeyEvent.IsForward
6273 * wx.NavigationKeyEvent.WinChange
6274 * wx.NavigationKeyEvent.FromTab
6275
6276 """
5b5c9bc7 6277 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6278
d55e5bfc 6279 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6280 """
6281 GetCurrentFocus(self) -> Window
6282
6283 Returns the child window which currenty has the focus. May be
6284 ``None``.
6285 """
5b5c9bc7 6286 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6287
6288 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6289 """
6290 SetCurrentFocus(self, Window win)
6291
6292 Set the window that has the focus.
6293 """
5b5c9bc7 6294 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6295
5b5c9bc7
RD
6296 IsBackward = _core_.NavigationKeyEvent_IsBackward
6297 IsForward = _core_.NavigationKeyEvent_IsForward
6298 WinChange = _core_.NavigationKeyEvent_WinChange
6299 FromTab = _core_.NavigationKeyEvent_FromTab
d55e5bfc 6300
5b5c9bc7 6301class NavigationKeyEventPtr(NavigationKeyEvent):
d55e5bfc
RD
6302 def __init__(self, this):
6303 self.this = this
6304 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6305 self.__class__ = NavigationKeyEvent
6306_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
d55e5bfc
RD
6307
6308#---------------------------------------------------------------------------
6309
5b5c9bc7 6310class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6311 """
6312 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6313 underlying GUI object) exists.
6314 """
d55e5bfc
RD
6315 def __repr__(self):
6316 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6317 def __init__(self, *args, **kwargs):
5ba5649b
RD
6318 """
6319 __init__(self, Window win=None) -> WindowCreateEvent
6320
6321 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6322 underlying GUI object) exists.
6323 """
5b5c9bc7 6324 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
d55e5bfc
RD
6325 self.this = newobj.this
6326 self.thisown = 1
6327 del newobj.thisown
6328 def GetWindow(*args, **kwargs):
5ba5649b
RD
6329 """
6330 GetWindow(self) -> Window
6331
6332 Returns the window that this event refers to.
6333 """
5b5c9bc7 6334 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
6335
6336
5b5c9bc7 6337class WindowCreateEventPtr(WindowCreateEvent):
d55e5bfc
RD
6338 def __init__(self, this):
6339 self.this = this
6340 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6341 self.__class__ = WindowCreateEvent
6342_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
d55e5bfc 6343
5b5c9bc7 6344class WindowDestroyEvent(CommandEvent):
5ba5649b
RD
6345 """
6346 The EVT_WINDOW_DESTROY event is sent right before the window is
6347 destroyed.
6348 """
d55e5bfc
RD
6349 def __repr__(self):
6350 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6351 def __init__(self, *args, **kwargs):
5ba5649b
RD
6352 """
6353 __init__(self, Window win=None) -> WindowDestroyEvent
6354
6355 The EVT_WINDOW_DESTROY event is sent right before the window is
6356 destroyed.
6357 """
5b5c9bc7 6358 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
d55e5bfc
RD
6359 self.this = newobj.this
6360 self.thisown = 1
6361 del newobj.thisown
6362 def GetWindow(*args, **kwargs):
5ba5649b
RD
6363 """
6364 GetWindow(self) -> Window
6365
6366 Returns the window that this event refers to.
6367 """
5b5c9bc7 6368 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
6369
6370
5b5c9bc7 6371class WindowDestroyEventPtr(WindowDestroyEvent):
d55e5bfc
RD
6372 def __init__(self, this):
6373 self.this = this
6374 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6375 self.__class__ = WindowDestroyEvent
6376_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
d55e5bfc
RD
6377
6378#---------------------------------------------------------------------------
6379
5b5c9bc7 6380class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6381 """
6382 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6383 give the application a chance to show a context (popup) menu.
6384 """
d55e5bfc
RD
6385 def __repr__(self):
6386 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6387 def __init__(self, *args, **kwargs):
5ba5649b
RD
6388 """
6389 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6390
6391 Constructor.
6392 """
5b5c9bc7 6393 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
d55e5bfc
RD
6394 self.this = newobj.this
6395 self.thisown = 1
6396 del newobj.thisown
6397 def GetPosition(*args, **kwargs):
5ba5649b
RD
6398 """
6399 GetPosition(self) -> Point
6400
6401 Returns the position (in screen coordinants) at which the menu should
6402 be shown.
6403 """
5b5c9bc7 6404 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6405
6406 def SetPosition(*args, **kwargs):
5ba5649b
RD
6407 """
6408 SetPosition(self, Point pos)
6409
6410 Sets the position at which the menu should be shown.
6411 """
5b5c9bc7 6412 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc
RD
6413
6414
5b5c9bc7 6415class ContextMenuEventPtr(ContextMenuEvent):
d55e5bfc
RD
6416 def __init__(self, this):
6417 self.this = this
6418 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6419 self.__class__ = ContextMenuEvent
6420_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
d55e5bfc
RD
6421
6422#---------------------------------------------------------------------------
6423
5b5c9bc7
RD
6424IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6425IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6426class IdleEvent(Event):
5ba5649b
RD
6427 """
6428 This class is used for EVT_IDLE events, which are generated and sent
6429 when the application *becomes* idle. In other words, the when the
6430 event queue becomes empty then idle events are sent to all windows (by
6431 default) and as long as none of them call `RequestMore` then there are
6432 no more idle events until after the system event queue has some normal
6433 events and then becomes empty again.
6434
6435 By default, idle events are sent to all windows. If this is causing a
6436 significant overhead in your application, you can call
6437 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6438 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6439 which should receive idle events. Then idle events will only be sent
6440 to those windows and not to any others.
6441 """
d55e5bfc
RD
6442 def __repr__(self):
6443 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6444 def __init__(self, *args, **kwargs):
5ba5649b
RD
6445 """
6446 __init__(self) -> IdleEvent
6447
6448 Constructor
6449 """
5b5c9bc7 6450 newobj = _core_.new_IdleEvent(*args, **kwargs)
d55e5bfc
RD
6451 self.this = newobj.this
6452 self.thisown = 1
6453 del newobj.thisown
6454 def RequestMore(*args, **kwargs):
5ba5649b
RD
6455 """
6456 RequestMore(self, bool needMore=True)
6457
6458 Tells wxWidgets that more processing is required. This function can be
6459 called by an EVT_IDLE handler for a window to indicate that the
6460 application should forward the EVT_IDLE event once more to the
6461 application windows. If no window calls this function during its
6462 EVT_IDLE handler, then the application will remain in a passive event
6463 loop until a new event is posted to the application by the windowing
6464 system.
6465 """
5b5c9bc7 6466 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6467
6468 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6469 """
6470 MoreRequested(self) -> bool
6471
6472 Returns ``True`` if the OnIdle function processing this event
6473 requested more processing time.
6474 """
5b5c9bc7 6475 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6476
6477 def SetMode(*args, **kwargs):
5ba5649b
RD
6478 """
6479 SetMode(int mode)
6480
6481 Static method for specifying how wxWidgets will send idle events: to
6482 all windows, or only to those which specify that they will process the
6483 events.
6484
6485 The mode can be one of the following values:
6486
6487 ========================= ========================================
6488 wx.IDLE_PROCESS_ALL Send idle events to all windows
6489 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6490 the wx.WS_EX_PROCESS_IDLE extra style
6491 flag set.
6492 ========================= ========================================
6493
6494 """
5b5c9bc7 6495 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6496
6497 SetMode = staticmethod(SetMode)
6498 def GetMode(*args, **kwargs):
5ba5649b
RD
6499 """
6500 GetMode() -> int
6501
6502 Static method returning a value specifying how wxWidgets will send
6503 idle events: to all windows, or only to those which specify that they
6504 will process the events.
6505 """
5b5c9bc7 6506 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6507
6508 GetMode = staticmethod(GetMode)
6509 def CanSend(*args, **kwargs):
5ba5649b
RD
6510 """
6511 CanSend(Window win) -> bool
6512
6513 Returns ``True`` if it is appropriate to send idle events to this
6514 window.
6515
6516 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6517 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6518 events should be sent to this window now. By default this will always
6519 return ``True`` because the update mode is initially
6520 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6521 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6522 """
5b5c9bc7 6523 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6524
6525 CanSend = staticmethod(CanSend)
6526
5b5c9bc7 6527class IdleEventPtr(IdleEvent):
d55e5bfc
RD
6528 def __init__(self, this):
6529 self.this = this
6530 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6531 self.__class__ = IdleEvent
6532_core_.IdleEvent_swigregister(IdleEventPtr)
d55e5bfc 6533
5b5c9bc7 6534def IdleEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6535 """
6536 IdleEvent_SetMode(int mode)
6537
6538 Static method for specifying how wxWidgets will send idle events: to
6539 all windows, or only to those which specify that they will process the
6540 events.
6541
6542 The mode can be one of the following values:
6543
6544 ========================= ========================================
6545 wx.IDLE_PROCESS_ALL Send idle events to all windows
6546 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6547 the wx.WS_EX_PROCESS_IDLE extra style
6548 flag set.
6549 ========================= ========================================
6550
6551 """
5b5c9bc7 6552 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6553
5b5c9bc7 6554def IdleEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6555 """
6556 IdleEvent_GetMode() -> int
6557
6558 Static method returning a value specifying how wxWidgets will send
6559 idle events: to all windows, or only to those which specify that they
6560 will process the events.
6561 """
5b5c9bc7 6562 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc 6563
5b5c9bc7 6564def IdleEvent_CanSend(*args, **kwargs):
5ba5649b
RD
6565 """
6566 IdleEvent_CanSend(Window win) -> bool
6567
6568 Returns ``True`` if it is appropriate to send idle events to this
6569 window.
6570
6571 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6572 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6573 events should be sent to this window now. By default this will always
6574 return ``True`` because the update mode is initially
6575 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6576 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6577 """
5b5c9bc7 6578 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6579
6580#---------------------------------------------------------------------------
6581
5b5c9bc7 6582class PyEvent(Event):
5ba5649b
RD
6583 """
6584 wx.PyEvent can be used as a base class for implementing custom event
6585 types in Python. You should derived from this class instead of
6586 `wx.Event` because this class is Python-aware and is able to transport
6587 its Python bits safely through the wxWidgets event system and have
6588 them still be there when the event handler is invoked.
6589
6590 :see: `wx.PyCommandEvent`
6591
6592 """
d55e5bfc
RD
6593 def __repr__(self):
6594 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6595 def __init__(self, *args, **kwargs):
5ba5649b 6596 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
5b5c9bc7 6597 newobj = _core_.new_PyEvent(*args, **kwargs)
d55e5bfc
RD
6598 self.this = newobj.this
6599 self.thisown = 1
6600 del newobj.thisown
5ba5649b 6601 self._SetSelf(self)
d55e5bfc 6602
5b5c9bc7 6603 def __del__(self, destroy=_core_.delete_PyEvent):
d55e5bfc
RD
6604 """__del__(self)"""
6605 try:
6606 if self.thisown: destroy(self)
6607 except: pass
6608
5ba5649b
RD
6609 def _SetSelf(*args, **kwargs):
6610 """_SetSelf(self, PyObject self)"""
6611 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6612
5ba5649b
RD
6613 def _GetSelf(*args, **kwargs):
6614 """_GetSelf(self) -> PyObject"""
6615 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc
RD
6616
6617
5b5c9bc7 6618class PyEventPtr(PyEvent):
d55e5bfc
RD
6619 def __init__(self, this):
6620 self.this = this
6621 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6622 self.__class__ = PyEvent
6623_core_.PyEvent_swigregister(PyEventPtr)
d55e5bfc 6624
5b5c9bc7 6625class PyCommandEvent(CommandEvent):
5ba5649b
RD
6626 """
6627 wx.PyCommandEvent can be used as a base class for implementing custom
6628 event types in Python, where the event shoudl travel up to parent
6629 windows looking for a handler. You should derived from this class
6630 instead of `wx.CommandEvent` because this class is Python-aware and is
6631 able to transport its Python bits safely through the wxWidgets event
6632 system and have them still be there when the event handler is invoked.
6633
6634 :see: `wx.PyEvent`
6635
6636 """
d55e5bfc
RD
6637 def __repr__(self):
6638 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6639 def __init__(self, *args, **kwargs):
5ba5649b 6640 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
5b5c9bc7 6641 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
d55e5bfc
RD
6642 self.this = newobj.this
6643 self.thisown = 1
6644 del newobj.thisown
5ba5649b 6645 self._SetSelf(self)
d55e5bfc 6646
5b5c9bc7 6647 def __del__(self, destroy=_core_.delete_PyCommandEvent):
d55e5bfc
RD
6648 """__del__(self)"""
6649 try:
6650 if self.thisown: destroy(self)
6651 except: pass
6652
5ba5649b
RD
6653 def _SetSelf(*args, **kwargs):
6654 """_SetSelf(self, PyObject self)"""
6655 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6656
5ba5649b
RD
6657 def _GetSelf(*args, **kwargs):
6658 """_GetSelf(self) -> PyObject"""
6659 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc
RD
6660
6661
5b5c9bc7 6662class PyCommandEventPtr(PyCommandEvent):
d55e5bfc
RD
6663 def __init__(self, this):
6664 self.this = this
6665 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6666 self.__class__ = PyCommandEvent
6667_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
d55e5bfc 6668
5b5c9bc7 6669class DateEvent(CommandEvent):
5ba5649b
RD
6670 """
6671 This event class holds information about a date change event and is
6672 used together with `wx.DatePickerCtrl`. It also serves as a base class
6673 for `wx.calendar.CalendarEvent`. Bind these event types with
6674 EVT_DATE_CHANGED.
6675 """
53aa7709
RD
6676 def __repr__(self):
6677 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6678 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
6679 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6680 newobj = _core_.new_DateEvent(*args, **kwargs)
53aa7709
RD
6681 self.this = newobj.this
6682 self.thisown = 1
6683 del newobj.thisown
6684 def GetDate(*args, **kwargs):
5ba5649b
RD
6685 """
6686 GetDate(self) -> DateTime
6687
6688 Returns the date.
6689 """
5b5c9bc7 6690 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6691
6692 def SetDate(*args, **kwargs):
5ba5649b
RD
6693 """
6694 SetDate(self, DateTime date)
6695
6696 Sets the date carried by the event, normally only used by the library
6697 internally.
6698 """
5b5c9bc7 6699 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709
RD
6700
6701
5b5c9bc7 6702class DateEventPtr(DateEvent):
53aa7709
RD
6703 def __init__(self, this):
6704 self.this = this
6705 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
6706 self.__class__ = DateEvent
6707_core_.DateEvent_swigregister(DateEventPtr)
53aa7709 6708
5b5c9bc7 6709wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
6710EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6711
d55e5bfc
RD
6712#---------------------------------------------------------------------------
6713
5b5c9bc7
RD
6714PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6715PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6716PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6717PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6718PRINT_WINDOWS = _core_.PRINT_WINDOWS
6719PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6720class PyApp(EvtHandler):
d6c14a4c
RD
6721 """
6722 The ``wx.PyApp`` class is an *implementation detail*, please use the
6723 `wx.App` class (or some other derived class) instead.
6724 """
d55e5bfc
RD
6725 def __repr__(self):
6726 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6727 def __init__(self, *args, **kwargs):
6728 """
5b5c9bc7 6729 __init__(self) -> PyApp
d55e5bfc
RD
6730
6731 Create a new application object, starting the bootstrap process.
6732 """
5b5c9bc7 6733 newobj = _core_.new_PyApp(*args, **kwargs)
d55e5bfc
RD
6734 self.this = newobj.this
6735 self.thisown = 1
6736 del newobj.thisown
7993762b
RD
6737 self._setCallbackInfo(self, PyApp, False)
6738 self._setOORInfo(self, False)
d55e5bfc 6739
5b5c9bc7 6740 def __del__(self, destroy=_core_.delete_PyApp):
d55e5bfc
RD
6741 """__del__(self)"""
6742 try:
6743 if self.thisown: destroy(self)
6744 except: pass
6745
6746 def _setCallbackInfo(*args, **kwargs):
7993762b 6747 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5b5c9bc7 6748 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
6749
6750 def GetAppName(*args, **kwargs):
6751 """
5b5c9bc7 6752 GetAppName(self) -> String
d55e5bfc
RD
6753
6754 Get the application name.
6755 """
5b5c9bc7 6756 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
6757
6758 def SetAppName(*args, **kwargs):
6759 """
5b5c9bc7 6760 SetAppName(self, String name)
d55e5bfc 6761
d6c14a4c
RD
6762 Set the application name. This value may be used automatically by
6763 `wx.Config` and such.
d55e5bfc 6764 """
5b5c9bc7 6765 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
6766
6767 def GetClassName(*args, **kwargs):
6768 """
5b5c9bc7 6769 GetClassName(self) -> String
d55e5bfc
RD
6770
6771 Get the application's class name.
6772 """
5b5c9bc7 6773 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
6774
6775 def SetClassName(*args, **kwargs):
6776 """
5b5c9bc7 6777 SetClassName(self, String name)
d55e5bfc 6778
d6c14a4c
RD
6779 Set the application's class name. This value may be used for
6780 X-resources if applicable for the platform
d55e5bfc 6781 """
5b5c9bc7 6782 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
6783
6784 def GetVendorName(*args, **kwargs):
6785 """
5b5c9bc7 6786 GetVendorName(self) -> String
d55e5bfc
RD
6787
6788 Get the application's vendor name.
6789 """
5b5c9bc7 6790 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
6791
6792 def SetVendorName(*args, **kwargs):
6793 """
5b5c9bc7 6794 SetVendorName(self, String name)
d55e5bfc 6795
d6c14a4c
RD
6796 Set the application's vendor name. This value may be used
6797 automatically by `wx.Config` and such.
d55e5bfc 6798 """
5b5c9bc7 6799 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
6800
6801 def GetTraits(*args, **kwargs):
6802 """
6803 GetTraits(self) -> wxAppTraits
6804
d6c14a4c
RD
6805 Return (and create if necessary) the app traits object to which we
6806 delegate for everything which either should be configurable by the
6807 user (then he can change the default behaviour simply by overriding
6808 CreateTraits() and returning his own traits object) or which is
6809 GUI/console dependent as then wx.AppTraits allows us to abstract the
6810 differences behind the common facade.
6811
6812 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 6813 """
5b5c9bc7 6814 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
6815
6816 def ProcessPendingEvents(*args, **kwargs):
6817 """
6818 ProcessPendingEvents(self)
6819
d6c14a4c
RD
6820 Process all events in the Pending Events list -- it is necessary to
6821 call this function to process posted events. This normally happens
6822 during each event loop iteration.
d55e5bfc 6823 """
5b5c9bc7 6824 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
6825
6826 def Yield(*args, **kwargs):
6827 """
6828 Yield(self, bool onlyIfNeeded=False) -> bool
6829
d6c14a4c
RD
6830 Process all currently pending events right now, instead of waiting
6831 until return to the event loop. It is an error to call ``Yield``
6832 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6833
d6c14a4c 6834 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
6835 reentrancies (i.e. when called from an event handler it may
6836 result in calling the same event handler again), use with
6837 extreme care or, better, don't use at all!
d55e5bfc 6838
d6c14a4c 6839 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 6840
d55e5bfc 6841 """
5b5c9bc7 6842 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
6843
6844 def WakeUpIdle(*args, **kwargs):
6845 """
6846 WakeUpIdle(self)
6847
d6c14a4c
RD
6848 Make sure that idle events are sent again.
6849 :see: `wx.WakeUpIdle`
d55e5bfc 6850 """
5b5c9bc7 6851 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 6852
84f85550
RD
6853 def IsMainLoopRunning(*args, **kwargs):
6854 """
6855 IsMainLoopRunning() -> bool
6856
6857 Returns True if we're running the main loop, i.e. if the events can
6858 currently be dispatched.
6859 """
5b5c9bc7 6860 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
6861
6862 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6863 def MainLoop(*args, **kwargs):
6864 """
6865 MainLoop(self) -> int
6866
d6c14a4c
RD
6867 Execute the main GUI loop, the function doesn't normally return until
6868 all top level windows have been closed and destroyed.
d55e5bfc 6869 """
5b5c9bc7 6870 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
6871
6872 def Exit(*args, **kwargs):
6873 """
6874 Exit(self)
6875
6876 Exit the main loop thus terminating the application.
d6c14a4c 6877 :see: `wx.Exit`
d55e5bfc 6878 """
5b5c9bc7 6879 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc
RD
6880
6881 def ExitMainLoop(*args, **kwargs):
6882 """
6883 ExitMainLoop(self)
6884
d6c14a4c
RD
6885 Exit the main GUI loop during the next iteration of the main
6886 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 6887 """
5b5c9bc7 6888 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
6889
6890 def Pending(*args, **kwargs):
6891 """
6892 Pending(self) -> bool
6893
6894 Returns True if there are unprocessed events in the event queue.
6895 """
5b5c9bc7 6896 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
6897
6898 def Dispatch(*args, **kwargs):
6899 """
6900 Dispatch(self) -> bool
6901
6902 Process the first event in the event queue (blocks until an event
6903 appears if there are none currently)
6904 """
5b5c9bc7 6905 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
6906
6907 def ProcessIdle(*args, **kwargs):
6908 """
6909 ProcessIdle(self) -> bool
6910
d6c14a4c
RD
6911 Called from the MainLoop when the application becomes idle (there are
6912 no pending events) and sends a `wx.IdleEvent` to all interested
6913 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 6914 """
5b5c9bc7 6915 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
6916
6917 def SendIdleEvents(*args, **kwargs):
6918 """
5b5c9bc7 6919 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 6920
d6c14a4c
RD
6921 Send idle event to window and all subwindows. Returns True if more
6922 idle time is requested.
d55e5bfc 6923 """
5b5c9bc7 6924 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
6925
6926 def IsActive(*args, **kwargs):
6927 """
6928 IsActive(self) -> bool
6929
6930 Return True if our app has focus.
6931 """
5b5c9bc7 6932 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
6933
6934 def SetTopWindow(*args, **kwargs):
6935 """
5b5c9bc7 6936 SetTopWindow(self, Window win)
d55e5bfc 6937
d6c14a4c 6938 Set the *main* top level window
d55e5bfc 6939 """
5b5c9bc7 6940 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
6941
6942 def GetTopWindow(*args, **kwargs):
6943 """
5b5c9bc7 6944 GetTopWindow(self) -> Window
d55e5bfc 6945
d6c14a4c
RD
6946 Return the *main* top level window (if it hadn't been set previously
6947 with SetTopWindow(), will return just some top level window and, if
6948 there not any, will return None)
d55e5bfc 6949 """
5b5c9bc7 6950 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
6951
6952 def SetExitOnFrameDelete(*args, **kwargs):
6953 """
6954 SetExitOnFrameDelete(self, bool flag)
6955
d6c14a4c
RD
6956 Control the exit behaviour: by default, the program will exit the main
6957 loop (and so, usually, terminate) when the last top-level program
6958 window is deleted. Beware that if you disable this behaviour (with
6959 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6960 explicitly from somewhere.
d55e5bfc 6961 """
5b5c9bc7 6962 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6963
6964 def GetExitOnFrameDelete(*args, **kwargs):
6965 """
6966 GetExitOnFrameDelete(self) -> bool
6967
6968 Get the current exit behaviour setting.
6969 """
5b5c9bc7 6970 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6971
6972 def SetUseBestVisual(*args, **kwargs):
6973 """
6974 SetUseBestVisual(self, bool flag)
6975
d6c14a4c
RD
6976 Set whether the app should try to use the best available visual on
6977 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 6978 """
5b5c9bc7 6979 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6980
6981 def GetUseBestVisual(*args, **kwargs):
6982 """
6983 GetUseBestVisual(self) -> bool
6984
6985 Get current UseBestVisual setting.
6986 """
5b5c9bc7 6987 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6988
6989 def SetPrintMode(*args, **kwargs):
6990 """SetPrintMode(self, int mode)"""
5b5c9bc7 6991 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
6992
6993 def GetPrintMode(*args, **kwargs):
6994 """GetPrintMode(self) -> int"""
5b5c9bc7 6995 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
6996
6997 def SetAssertMode(*args, **kwargs):
6998 """
6999 SetAssertMode(self, int mode)
7000
15817c7e 7001 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 7002 """
5b5c9bc7 7003 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
7004
7005 def GetAssertMode(*args, **kwargs):
7006 """
7007 GetAssertMode(self) -> int
7008
7009 Get the current OnAssert behaviour setting.
7010 """
5b5c9bc7 7011 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
7012
7013 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7014 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 7015 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7016
7017 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7018 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7019 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 7020 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7021
7022 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7023 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7024 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 7025 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7026
7027 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7028 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7029 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 7030 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7031
7032 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7033 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7034 """GetMacHelpMenuTitleName() -> String"""
7035 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7036
7037 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7038 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7039 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 7040 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7041
7042 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7043 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7044 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 7045 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7046
7047 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7048 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7049 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 7050 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7051
7052 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7053 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7054 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 7055 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7056
7057 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7058 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7059 """SetMacHelpMenuTitleName(String val)"""
7060 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7061
7062 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7063 def _BootstrapApp(*args, **kwargs):
7064 """
7065 _BootstrapApp(self)
7066
7067 For internal use only
7068 """
5b5c9bc7 7069 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
7070
7071 def GetComCtl32Version(*args, **kwargs):
7072 """
d6c14a4c 7073 GetComCtl32Version() -> int
d55e5bfc 7074
d6c14a4c
RD
7075 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7076 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7077 """
5b5c9bc7 7078 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
7079
7080 GetComCtl32Version = staticmethod(GetComCtl32Version)
7081
5b5c9bc7 7082class PyAppPtr(PyApp):
d55e5bfc
RD
7083 def __init__(self, this):
7084 self.this = this
7085 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7086 self.__class__ = PyApp
7087_core_.PyApp_swigregister(PyAppPtr)
d55e5bfc 7088
5b5c9bc7 7089def PyApp_IsMainLoopRunning(*args, **kwargs):
84f85550 7090 """
5b5c9bc7 7091 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
7092
7093 Returns True if we're running the main loop, i.e. if the events can
7094 currently be dispatched.
7095 """
5b5c9bc7 7096 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550 7097
5b5c9bc7
RD
7098def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
7099 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7100 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 7101
5b5c9bc7
RD
7102def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
7103 """PyApp_GetMacAboutMenuItemId() -> long"""
7104 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 7105
5b5c9bc7
RD
7106def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
7107 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7108 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 7109
5b5c9bc7
RD
7110def PyApp_GetMacExitMenuItemId(*args, **kwargs):
7111 """PyApp_GetMacExitMenuItemId() -> long"""
7112 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 7113
5b5c9bc7
RD
7114def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
7115 """PyApp_GetMacHelpMenuTitleName() -> String"""
7116 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7117
5b5c9bc7
RD
7118def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7119 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7120 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 7121
5b5c9bc7
RD
7122def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7123 """PyApp_SetMacAboutMenuItemId(long val)"""
7124 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 7125
5b5c9bc7
RD
7126def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7127 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7128 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 7129
5b5c9bc7
RD
7130def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7131 """PyApp_SetMacExitMenuItemId(long val)"""
7132 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 7133
5b5c9bc7
RD
7134def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
7135 """PyApp_SetMacHelpMenuTitleName(String val)"""
7136 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7137
5b5c9bc7 7138def PyApp_GetComCtl32Version(*args, **kwargs):
d55e5bfc 7139 """
5b5c9bc7 7140 PyApp_GetComCtl32Version() -> int
d55e5bfc 7141
d6c14a4c
RD
7142 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7143 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7144 """
5b5c9bc7 7145 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
7146
7147#---------------------------------------------------------------------------
7148
7149
5b5c9bc7 7150def Exit(*args, **kwargs):
d55e5bfc 7151 """
5b5c9bc7 7152 Exit()
d55e5bfc
RD
7153
7154 Force an exit of the application. Convenience for wx.GetApp().Exit()
7155 """
5b5c9bc7 7156 return _core_.Exit(*args, **kwargs)
d55e5bfc 7157
5b5c9bc7 7158def Yield(*args, **kwargs):
d55e5bfc 7159 """
5b5c9bc7 7160 Yield() -> bool
d55e5bfc
RD
7161
7162 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7163 """
5b5c9bc7 7164 return _core_.Yield(*args, **kwargs)
d55e5bfc 7165
5b5c9bc7 7166def YieldIfNeeded(*args, **kwargs):
d55e5bfc 7167 """
5b5c9bc7 7168 YieldIfNeeded() -> bool
d55e5bfc
RD
7169
7170 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7171 """
5b5c9bc7 7172 return _core_.YieldIfNeeded(*args, **kwargs)
d55e5bfc 7173
5b5c9bc7 7174def SafeYield(*args, **kwargs):
d55e5bfc 7175 """
5b5c9bc7 7176 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 7177
d6c14a4c
RD
7178 This function is similar to `wx.Yield`, except that it disables the
7179 user input to all program windows before calling `wx.Yield` and
7180 re-enables it again afterwards. If ``win`` is not None, this window
7181 will remain enabled, allowing the implementation of some limited user
7182 interaction.
d55e5bfc 7183
d6c14a4c 7184 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 7185 """
5b5c9bc7 7186 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 7187
5b5c9bc7 7188def WakeUpIdle(*args, **kwargs):
d55e5bfc 7189 """
5b5c9bc7 7190 WakeUpIdle()
d55e5bfc 7191
d6c14a4c
RD
7192 Cause the message queue to become empty again, so idle events will be
7193 sent.
d55e5bfc 7194 """
5b5c9bc7 7195 return _core_.WakeUpIdle(*args, **kwargs)
d55e5bfc 7196
5b5c9bc7 7197def PostEvent(*args, **kwargs):
d55e5bfc 7198 """
5b5c9bc7 7199 PostEvent(EvtHandler dest, Event event)
d55e5bfc 7200
d6c14a4c
RD
7201 Send an event to a window or other wx.EvtHandler to be processed
7202 later.
d55e5bfc 7203 """
5b5c9bc7 7204 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 7205
5b5c9bc7 7206def App_CleanUp(*args, **kwargs):
d55e5bfc 7207 """
5b5c9bc7 7208 App_CleanUp()
d55e5bfc 7209
15817c7e 7210 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 7211 Python shuts down.
d55e5bfc 7212 """
5b5c9bc7 7213 return _core_.App_CleanUp(*args, **kwargs)
d55e5bfc
RD
7214
7215def GetApp(*args, **kwargs):
7216 """
5b5c9bc7 7217 GetApp() -> PyApp
d55e5bfc
RD
7218
7219 Return a reference to the current wx.App object.
7220 """
5b5c9bc7 7221 return _core_.GetApp(*args, **kwargs)
5cbf236d 7222
5b5c9bc7 7223def SetDefaultPyEncoding(*args, **kwargs):
5cbf236d
RD
7224 """
7225 SetDefaultPyEncoding(string encoding)
7226
7227 Sets the encoding that wxPython will use when it needs to convert a
7228 Python string or unicode object to or from a wxString.
62d32a5f
RD
7229
7230 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7231 but please be aware that the default encoding within the same locale
7232 may be slightly different on different platforms. For example, please
7233 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7234 between the common latin/roman encodings.
5cbf236d 7235 """
5b5c9bc7 7236 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7237
5b5c9bc7 7238def GetDefaultPyEncoding(*args, **kwargs):
5cbf236d
RD
7239 """
7240 GetDefaultPyEncoding() -> string
7241
7242 Gets the current encoding that wxPython will use when it needs to
7243 convert a Python string or unicode object to or from a wxString.
7244 """
5b5c9bc7 7245 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d55e5bfc
RD
7246#----------------------------------------------------------------------
7247
7248class PyOnDemandOutputWindow:
7249 """
7250 A class that can be used for redirecting Python's stdout and
7251 stderr streams. It will do nothing until something is wrriten to
7252 the stream at which point it will create a Frame with a text area
7253 and write the text there.
7254 """
7255 def __init__(self, title = "wxPython: stdout/stderr"):
7256 self.frame = None
7257 self.title = title
412d302d
RD
7258 self.pos = wx.DefaultPosition
7259 self.size = (450, 300)
d55e5bfc
RD
7260 self.parent = None
7261
7262 def SetParent(self, parent):
7263 """Set the window to be used as the popup Frame's parent."""
7264 self.parent = parent
7265
7266
7267 def CreateOutputWindow(self, st):
412d302d
RD
7268 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7269 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7270 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7271 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7272 self.text.AppendText(st)
d55e5bfc
RD
7273 self.frame.Show(True)
7274 EVT_CLOSE(self.frame, self.OnCloseWindow)
7275
7276
7277 def OnCloseWindow(self, event):
7278 if self.frame is not None:
7279 self.frame.Destroy()
7280 self.frame = None
7281 self.text = None
7282
7283
7284 # These methods provide the file-like output behaviour.
7285 def write(self, text):
7286 """
7287 Create the output window if needed and write the string to it.
7288 If not called in the context of the gui thread then uses
7289 CallAfter to do the work there.
7290 """
7291 if self.frame is None:
7292 if not wx.Thread_IsMain():
7293 wx.CallAfter(self.CreateOutputWindow, text)
7294 else:
7295 self.CreateOutputWindow(text)
7296 else:
7297 if not wx.Thread_IsMain():
7298 wx.CallAfter(self.text.AppendText, text)
7299 else:
7300 self.text.AppendText(text)
7301
7302
7303 def close(self):
7304 if self.frame is not None:
7305 wx.CallAfter(self.frame.Close)
7306
7307
bb4524c4
RD
7308 def flush(self):
7309 pass
7310
7311
d55e5bfc
RD
7312
7313#----------------------------------------------------------------------
7314
7315_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7316
7317class App(wx.PyApp):
7318 """
d6c14a4c
RD
7319 The ``wx.App`` class represents the application and is used to:
7320
7321 * bootstrap the wxPython system and initialize the underlying
7322 gui toolkit
7323 * set and get application-wide properties
7324 * implement the windowing system main message or event loop,
7325 and to dispatch events to window instances
7326 * etc.
7327
7328 Every application must have a ``wx.App`` instance, and all
7329 creation of UI objects should be delayed until after the
7330 ``wx.App`` object has been created in order to ensure that the gui
7331 platform and wxWidgets have been fully initialized.
7332
7333 Normally you would derive from this class and implement an
7334 ``OnInit`` method that creates a frame and then calls
7335 ``self.SetTopWindow(frame)``.
7336
7337 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7338 directly.
d55e5bfc 7339 """
d6c14a4c 7340
d55e5bfc
RD
7341 outputWindowClass = PyOnDemandOutputWindow
7342
d6c14a4c
RD
7343 def __init__(self, redirect=_defRedirect, filename=None,
7344 useBestVisual=False, clearSigInt=True):
7345 """
7346 Construct a ``wx.App`` object.
7347
7348 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7349 redirected? Defaults to True on Windows and Mac, False
7350 otherwise. If `filename` is None then output will be
7351 redirected to a window that pops up as needed. (You can
7352 control what kind of window is created for the output by
7353 resetting the class variable ``outputWindowClass`` to a
7354 class of your choosing.)
7355
7356 :param filename: The name of a file to redirect output to, if
7357 redirect is True.
7358
7359 :param useBestVisual: Should the app try to use the best
7360 available visual provided by the system (only relevant on
7361 systems that have more than one visual.) This parameter
7362 must be used instead of calling `SetUseBestVisual` later
7363 on because it must be set before the underlying GUI
7364 toolkit is initialized.
7365
7366 :param clearSigInt: Should SIGINT be cleared? This allows the
7367 app to terminate upon a Ctrl-C in the console like other
7368 GUI apps will.
7369
7370 :note: You should override OnInit to do applicaition
7371 initialization to ensure that the system, toolkit and
7372 wxWidgets are fully initialized.
7373 """
d55e5bfc
RD
7374 wx.PyApp.__init__(self)
7375
7376 if wx.Platform == "__WXMAC__":
7377 try:
7378 import MacOS
7379 if not MacOS.WMAvailable():
7380 print """\
7381This program needs access to the screen. Please run with 'pythonw',
7382not 'python', and only when you are logged in on the main display of
7383your Mac."""
7384 _sys.exit(1)
0346c964
RD
7385 except SystemExit:
7386 raise
d55e5bfc
RD
7387 except:
7388 pass
7389
7390 # This has to be done before OnInit
7391 self.SetUseBestVisual(useBestVisual)
7392
7393 # Set the default handler for SIGINT. This fixes a problem
7394 # where if Ctrl-C is pressed in the console that started this
7395 # app then it will not appear to do anything, (not even send
7396 # KeyboardInterrupt???) but will later segfault on exit. By
7397 # setting the default handler then the app will exit, as
7398 # expected (depending on platform.)
d6c14a4c
RD
7399 if clearSigInt:
7400 try:
7401 import signal
7402 signal.signal(signal.SIGINT, signal.SIG_DFL)
7403 except:
7404 pass
d55e5bfc
RD
7405
7406 # Save and redirect the stdio to a window?
7407 self.stdioWin = None
7408 self.saveStdio = (_sys.stdout, _sys.stderr)
7409 if redirect:
7410 self.RedirectStdio(filename)
7411
8fb0e70a
RD
7412 # Use Python's install prefix as the default
7413 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7414
d55e5bfc
RD
7415 # This finishes the initialization of wxWindows and then calls
7416 # the OnInit that should be present in the derived class
7417 self._BootstrapApp()
7418
7419
66af7a75
RD
7420 def __del__(self, destroy=wx.PyApp.__del__):
7421 self.RestoreStdio() # Just in case the MainLoop was overridden
7422 destroy(self)
d55e5bfc 7423
7993762b
RD
7424 def Destroy(self):
7425 wx.PyApp.Destroy(self)
7426 self.thisown = 0
d55e5bfc
RD
7427
7428 def SetTopWindow(self, frame):
7429 """Set the \"main\" top level window"""
7430 if self.stdioWin:
7431 self.stdioWin.SetParent(frame)
7432 wx.PyApp.SetTopWindow(self, frame)
7433
7434
7435 def MainLoop(self):
7436 """Execute the main GUI event loop"""
7437 wx.PyApp.MainLoop(self)
7438 self.RestoreStdio()
7439
7440
7441 def RedirectStdio(self, filename=None):
7442 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7443 if filename:
7444 _sys.stdout = _sys.stderr = open(filename, 'a')
7445 else:
7446 self.stdioWin = self.outputWindowClass()
7447 _sys.stdout = _sys.stderr = self.stdioWin
7448
7449
7450 def RestoreStdio(self):
66af7a75
RD
7451 try:
7452 _sys.stdout, _sys.stderr = self.saveStdio
7453 except:
7454 pass
d55e5bfc
RD
7455
7456
412d302d
RD
7457 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7458 """
7459 Set the title, position and/or size of the output window if
f5b96ee1
RD
7460 the stdio has been redirected. This should be called before
7461 any output would cause the output window to be created.
412d302d
RD
7462 """
7463 if self.stdioWin:
7464 if title is not None:
7465 self.stdioWin.title = title
7466 if pos is not None:
7467 self.stdioWin.pos = pos
7468 if size is not None:
7469 self.stdioWin.size = size
7470
7471
7472
d55e5bfc 7473
d6c14a4c 7474# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7475App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7476App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7477App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7478App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7479App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7480App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7481App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7482App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7483App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7484App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7485App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7486
7487#----------------------------------------------------------------------------
7488
7489class PySimpleApp(wx.App):
7490 """
7491 A simple application class. You can just create one of these and
7492 then then make your top level windows later, and not have to worry
d6c14a4c 7493 about OnInit. For example::
d55e5bfc 7494
d6c14a4c
RD
7495 app = wx.PySimpleApp()
7496 frame = wx.Frame(None, title='Hello World')
7497 frame.Show()
7498 app.MainLoop()
7499
7500 :see: `wx.App`
7501 """
7502
7503 def __init__(self, redirect=False, filename=None,
7504 useBestVisual=False, clearSigInt=True):
7505 """
7506 :see: `wx.App.__init__`
7507 """
7508 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7509
7510 def OnInit(self):
d55e5bfc
RD
7511 return True
7512
7513
d6c14a4c 7514
d55e5bfc
RD
7515# Is anybody using this one?
7516class PyWidgetTester(wx.App):
7517 def __init__(self, size = (250, 100)):
7518 self.size = size
7519 wx.App.__init__(self, 0)
7520
7521 def OnInit(self):
7522 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7523 self.SetTopWindow(self.frame)
7524 return True
7525
d6c14a4c
RD
7526 def SetWidget(self, widgetClass, *args, **kwargs):
7527 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7528 self.frame.Show(True)
7529
7530#----------------------------------------------------------------------------
7531# DO NOT hold any other references to this object. This is how we
d6c14a4c 7532# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7533# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7534# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7535
7536class __wxPyCleanup:
7537 def __init__(self):
7538 self.cleanup = _core_.App_CleanUp
7539 def __del__(self):
7540 self.cleanup()
7541
7542_sys.__wxPythonCleanup = __wxPyCleanup()
7543
7544## # another possible solution, but it gets called too early...
d6c14a4c
RD
7545## import atexit
7546## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7547
7548
7549#----------------------------------------------------------------------------
7550
7551#---------------------------------------------------------------------------
7552
5b5c9bc7
RD
7553class EventLoop(object):
7554 """Proxy of C++ EventLoop class"""
b411df4a
RD
7555 def __repr__(self):
7556 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7557 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
7558 """__init__(self) -> EventLoop"""
7559 newobj = _core_.new_EventLoop(*args, **kwargs)
b411df4a
RD
7560 self.this = newobj.this
7561 self.thisown = 1
7562 del newobj.thisown
5b5c9bc7 7563 def __del__(self, destroy=_core_.delete_EventLoop):
b411df4a
RD
7564 """__del__(self)"""
7565 try:
7566 if self.thisown: destroy(self)
7567 except: pass
7568
7569 def Run(*args, **kwargs):
7570 """Run(self) -> int"""
5b5c9bc7 7571 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7572
7573 def Exit(*args, **kwargs):
7574 """Exit(self, int rc=0)"""
5b5c9bc7 7575 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7576
7577 def Pending(*args, **kwargs):
7578 """Pending(self) -> bool"""
5b5c9bc7 7579 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7580
7581 def Dispatch(*args, **kwargs):
7582 """Dispatch(self) -> bool"""
5b5c9bc7 7583 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7584
7585 def IsRunning(*args, **kwargs):
7586 """IsRunning(self) -> bool"""
5b5c9bc7 7587 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7588
7589 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7590 """GetActive() -> EventLoop"""
7591 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7592
7593 GetActive = staticmethod(GetActive)
7594 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7595 """SetActive(EventLoop loop)"""
7596 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7597
7598 SetActive = staticmethod(SetActive)
7599
5b5c9bc7 7600class EventLoopPtr(EventLoop):
b411df4a
RD
7601 def __init__(self, this):
7602 self.this = this
7603 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7604 self.__class__ = EventLoop
7605_core_.EventLoop_swigregister(EventLoopPtr)
b411df4a 7606
5b5c9bc7
RD
7607def EventLoop_GetActive(*args, **kwargs):
7608 """EventLoop_GetActive() -> EventLoop"""
7609 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a 7610
5b5c9bc7
RD
7611def EventLoop_SetActive(*args, **kwargs):
7612 """EventLoop_SetActive(EventLoop loop)"""
7613 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7614
7615#---------------------------------------------------------------------------
7616
5b5c9bc7 7617class AcceleratorEntry(object):
d6c14a4c
RD
7618 """
7619 A class used to define items in an `wx.AcceleratorTable`. wxPython
7620 programs can choose to use wx.AcceleratorEntry objects, but using a
7621 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 7622 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
7623
7624 :see: `wx.AcceleratorTable`
7625 """
d55e5bfc
RD
7626 def __repr__(self):
7627 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7628 def __init__(self, *args, **kwargs):
d6c14a4c 7629 """
5b5c9bc7 7630 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
7631
7632 Construct a wx.AcceleratorEntry.
d6c14a4c 7633 """
5b5c9bc7 7634 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
d55e5bfc
RD
7635 self.this = newobj.this
7636 self.thisown = 1
7637 del newobj.thisown
5b5c9bc7 7638 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
d55e5bfc
RD
7639 """__del__(self)"""
7640 try:
7641 if self.thisown: destroy(self)
7642 except: pass
7643
7644 def Set(*args, **kwargs):
d6c14a4c
RD
7645 """
7646 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7647
d6c14a4c
RD
7648 (Re)set the attributes of a wx.AcceleratorEntry.
7649 :see `__init__`
7650 """
5b5c9bc7 7651 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7652
7653 def GetFlags(*args, **kwargs):
d6c14a4c
RD
7654 """
7655 GetFlags(self) -> int
7656
7657 Get the AcceleratorEntry's flags.
7658 """
5b5c9bc7 7659 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
7660
7661 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
7662 """
7663 GetKeyCode(self) -> int
7664
7665 Get the AcceleratorEntry's keycode.
7666 """
5b5c9bc7 7667 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
7668
7669 def GetCommand(*args, **kwargs):
d6c14a4c
RD
7670 """
7671 GetCommand(self) -> int
7672
7673 Get the AcceleratorEntry's command ID.
7674 """
5b5c9bc7 7675 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc
RD
7676
7677
5b5c9bc7 7678class AcceleratorEntryPtr(AcceleratorEntry):
d55e5bfc
RD
7679 def __init__(self, this):
7680 self.this = this
7681 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7682 self.__class__ = AcceleratorEntry
7683_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
d55e5bfc 7684
5b5c9bc7 7685class AcceleratorTable(Object):
d6c14a4c
RD
7686 """
7687 An accelerator table allows the application to specify a table of
7688 keyboard shortcuts for menus or other commands. On Windows, menu or
7689 button commands are supported; on GTK, only menu commands are
7690 supported.
d6c14a4c 7691 """
d55e5bfc
RD
7692 def __repr__(self):
7693 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7694 def __init__(self, *args, **kwargs):
7695 """
7696 __init__(entries) -> AcceleratorTable
7697
d6c14a4c
RD
7698 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7699 items or or of 3-tuples (flags, keyCode, cmdID)
7700
7701 :see: `wx.AcceleratorEntry`
d55e5bfc 7702 """
5b5c9bc7 7703 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
d55e5bfc
RD
7704 self.this = newobj.this
7705 self.thisown = 1
7706 del newobj.thisown
5b5c9bc7 7707 def __del__(self, destroy=_core_.delete_AcceleratorTable):
d55e5bfc
RD
7708 """__del__(self)"""
7709 try:
7710 if self.thisown: destroy(self)
7711 except: pass
7712
7713 def Ok(*args, **kwargs):
7714 """Ok(self) -> bool"""
5b5c9bc7 7715 return _core_.AcceleratorTable_Ok(*args, **kwargs)
d55e5bfc
RD
7716
7717
5b5c9bc7 7718class AcceleratorTablePtr(AcceleratorTable):
d55e5bfc
RD
7719 def __init__(self, this):
7720 self.this = this
7721 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7722 self.__class__ = AcceleratorTable
7723_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
d55e5bfc
RD
7724
7725
5b5c9bc7
RD
7726def GetAccelFromString(*args, **kwargs):
7727 """GetAccelFromString(String label) -> AcceleratorEntry"""
7728 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7729#---------------------------------------------------------------------------
7730
5b5c9bc7 7731class VisualAttributes(object):
d55e5bfc
RD
7732 """struct containing all the visual attributes of a control"""
7733 def __repr__(self):
7734 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7735 def __init__(self, *args, **kwargs):
7736 """
5b5c9bc7 7737 __init__(self) -> VisualAttributes
d55e5bfc
RD
7738
7739 struct containing all the visual attributes of a control
7740 """
5b5c9bc7 7741 newobj = _core_.new_VisualAttributes(*args, **kwargs)
d55e5bfc
RD
7742 self.this = newobj.this
7743 self.thisown = 1
7744 del newobj.thisown
5b5c9bc7 7745 def __del__(self, destroy=_core_.delete_VisualAttributes):
d55e5bfc
RD
7746 """__del__(self)"""
7747 try:
7748 if self.thisown: destroy(self)
7749 except: pass
7750
5b5c9bc7
RD
7751 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7752 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7753 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
d55e5bfc 7754
5b5c9bc7 7755class VisualAttributesPtr(VisualAttributes):
d55e5bfc
RD
7756 def __init__(self, this):
7757 self.this = this
7758 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
7759 self.__class__ = VisualAttributes
7760_core_.VisualAttributes_swigregister(VisualAttributesPtr)
7761NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
7762PanelNameStr = cvar.PanelNameStr
7763
5b5c9bc7
RD
7764WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7765WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7766WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7767WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7768WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7769class Window(EvtHandler):
d55e5bfc
RD
7770 """
7771 wx.Window is the base class for all windows and represents any visible
7772 object on the screen. All controls, top level windows and so on are
7773 wx.Windows. Sizers and device contexts are not however, as they don't
7774 appear on screen themselves.
7775
7776 """
7777 def __repr__(self):
7778 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7779 def __init__(self, *args, **kwargs):
7780 """
5b5c9bc7
RD
7781 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7782 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
7783
7784 Construct and show a generic Window.
7785 """
5b5c9bc7 7786 newobj = _core_.new_Window(*args, **kwargs)
d55e5bfc
RD
7787 self.this = newobj.this
7788 self.thisown = 1
7789 del newobj.thisown
7790 self._setOORInfo(self)
7791
7792 def Create(*args, **kwargs):
7793 """
5b5c9bc7
RD
7794 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7795 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
7796
7797 Create the GUI part of the Window for 2-phase creation mode.
7798 """
5b5c9bc7 7799 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
7800
7801 def Close(*args, **kwargs):
7802 """
7803 Close(self, bool force=False) -> bool
7804
7805 This function simply generates a EVT_CLOSE event whose handler usually
7806 tries to close the window. It doesn't close the window itself,
7807 however. If force is False (the default) then the window's close
7808 handler will be allowed to veto the destruction of the window.
d55e5bfc 7809 """
5b5c9bc7 7810 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
7811
7812 def Destroy(*args, **kwargs):
7813 """
7814 Destroy(self) -> bool
7815
7816 Destroys the window safely. Frames and dialogs are not destroyed
7817 immediately when this function is called -- they are added to a list
7818 of windows to be deleted on idle time, when all the window's events
7819 have been processed. This prevents problems with events being sent to
7820 non-existent windows.
7821
7822 Returns True if the window has either been successfully deleted, or it
7823 has been added to the list of windows pending real deletion.
7824 """
5b5c9bc7 7825 return _core_.Window_Destroy(*args, **kwargs)
d55e5bfc
RD
7826
7827 def DestroyChildren(*args, **kwargs):
7828 """
7829 DestroyChildren(self) -> bool
7830
15817c7e
RD
7831 Destroys all children of a window. Called automatically by the
7832 destructor.
d55e5bfc 7833 """
5b5c9bc7 7834 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
7835
7836 def IsBeingDeleted(*args, **kwargs):
7837 """
7838 IsBeingDeleted(self) -> bool
7839
7840 Is the window in the process of being deleted?
7841 """
5b5c9bc7 7842 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc
RD
7843
7844 def SetTitle(*args, **kwargs):
7845 """
5b5c9bc7 7846 SetTitle(self, String title)
d55e5bfc
RD
7847
7848 Sets the window's title. Applicable only to frames and dialogs.
7849 """
5b5c9bc7 7850 return _core_.Window_SetTitle(*args, **kwargs)
d55e5bfc
RD
7851
7852 def GetTitle(*args, **kwargs):
7853 """
5b5c9bc7 7854 GetTitle(self) -> String
d55e5bfc
RD
7855
7856 Gets the window's title. Applicable only to frames and dialogs.
7857 """
5b5c9bc7 7858 return _core_.Window_GetTitle(*args, **kwargs)
d55e5bfc
RD
7859
7860 def SetLabel(*args, **kwargs):
7861 """
5b5c9bc7 7862 SetLabel(self, String label)
d55e5bfc
RD
7863
7864 Set the text which the window shows in its label if applicable.
7865 """
5b5c9bc7 7866 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
7867
7868 def GetLabel(*args, **kwargs):
7869 """
5b5c9bc7 7870 GetLabel(self) -> String
d55e5bfc 7871
15817c7e
RD
7872 Generic way of getting a label from any window, for identification
7873 purposes. The interpretation of this function differs from class to
7874 class. For frames and dialogs, the value returned is the title. For
7875 buttons or static text controls, it is the button text. This function
7876 can be useful for meta-programs such as testing tools or special-needs
7877 access programs)which need to identify windows by name.
d55e5bfc 7878 """
5b5c9bc7 7879 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
7880
7881 def SetName(*args, **kwargs):
7882 """
5b5c9bc7 7883 SetName(self, String name)
d55e5bfc 7884
15817c7e
RD
7885 Sets the window's name. The window name is used for ressource setting
7886 in X, it is not the same as the window title/label
d55e5bfc 7887 """
5b5c9bc7 7888 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
7889
7890 def GetName(*args, **kwargs):
7891 """
5b5c9bc7 7892 GetName(self) -> String
d55e5bfc 7893
15817c7e
RD
7894 Returns the windows name. This name is not guaranteed to be unique;
7895 it is up to the programmer to supply an appropriate name in the window
7896 constructor or via wx.Window.SetName.
d55e5bfc 7897 """
5b5c9bc7 7898 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
7899
7900 def SetWindowVariant(*args, **kwargs):
7901 """
7902 SetWindowVariant(self, int variant)
7903
15817c7e
RD
7904 Sets the variant of the window/font size to use for this window, if
7905 the platform supports variants, for example, wxMac.
d55e5bfc 7906 """
5b5c9bc7 7907 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7908
7909 def GetWindowVariant(*args, **kwargs):
7910 """GetWindowVariant(self) -> int"""
5b5c9bc7 7911 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7912
7913 def SetId(*args, **kwargs):
7914 """
7915 SetId(self, int winid)
7916
7917 Sets the identifier of the window. Each window has an integer
7918 identifier. If the application has not provided one, an identifier
7919 will be generated. Normally, the identifier should be provided on
7920 creation and should not be modified subsequently.
7921 """
5b5c9bc7 7922 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
7923
7924 def GetId(*args, **kwargs):
7925 """
7926 GetId(self) -> int
7927
7928 Returns the identifier of the window. Each window has an integer
7929 identifier. If the application has not provided one (or the default Id
7930 -1 is used) then an unique identifier with a negative value will be
7931 generated.
7932 """
5b5c9bc7 7933 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
7934
7935 def NewControlId(*args, **kwargs):
7936 """
d6c14a4c 7937 NewControlId() -> int
d55e5bfc
RD
7938
7939 Generate a control id for the controls which were not given one.
7940 """
5b5c9bc7 7941 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
7942
7943 NewControlId = staticmethod(NewControlId)
7944 def NextControlId(*args, **kwargs):
7945 """
d6c14a4c 7946 NextControlId(int winid) -> int
d55e5bfc
RD
7947
7948 Get the id of the control following the one with the given
15817c7e 7949 autogenerated) id
d55e5bfc 7950 """
5b5c9bc7 7951 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
7952
7953 NextControlId = staticmethod(NextControlId)
7954 def PrevControlId(*args, **kwargs):
7955 """
d6c14a4c 7956 PrevControlId(int winid) -> int
d55e5bfc
RD
7957
7958 Get the id of the control preceding the one with the given
15817c7e 7959 autogenerated) id
d55e5bfc 7960 """
5b5c9bc7 7961 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
7962
7963 PrevControlId = staticmethod(PrevControlId)
7964 def SetSize(*args, **kwargs):
7965 """
5b5c9bc7 7966 SetSize(self, Size size)
d55e5bfc
RD
7967
7968 Sets the size of the window in pixels.
7969 """
5b5c9bc7 7970 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
7971
7972 def SetDimensions(*args, **kwargs):
7973 """
5b5c9bc7 7974 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7975
7976 Sets the position and size of the window in pixels. The sizeFlags
7977 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
7978 equal to -1.
7979
7980 ======================== ======================================
7981 wx.SIZE_AUTO A -1 indicates that a class-specific
7982 default should be used.
7983 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7984 -1 values are supplied.
7985 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7986 interpreted as real dimensions, not
7987 default values.
7988 ======================== ======================================
7989
d55e5bfc 7990 """
5b5c9bc7 7991 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
7992
7993 def SetRect(*args, **kwargs):
7994 """
5b5c9bc7 7995 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7996
7997 Sets the position and size of the window in pixels using a wx.Rect.
7998 """
5b5c9bc7 7999 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
8000
8001 def SetSizeWH(*args, **kwargs):
8002 """
8003 SetSizeWH(self, int width, int height)
8004
8005 Sets the size of the window in pixels.
8006 """
5b5c9bc7 8007 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
8008
8009 def Move(*args, **kwargs):
8010 """
5b5c9bc7 8011 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8012
8013 Moves the window to the given position.
8014 """
5b5c9bc7 8015 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
8016
8017 SetPosition = Move
8018 def MoveXY(*args, **kwargs):
8019 """
5b5c9bc7 8020 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8021
8022 Moves the window to the given position.
8023 """
5b5c9bc7 8024 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 8025
f8167d6e
RD
8026 def SetBestFittingSize(*args, **kwargs):
8027 """
5b5c9bc7 8028 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
8029
8030 A 'Smart' SetSize that will fill in default size components with the
8031 window's *best size* values. Also set's the minsize for use with sizers.
8032 """
5b5c9bc7 8033 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 8034
d55e5bfc
RD
8035 def Raise(*args, **kwargs):
8036 """
8037 Raise(self)
8038
8039 Raises the window to the top of the window hierarchy if it is a
8040 managed window (dialog or frame).
8041 """
5b5c9bc7 8042 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
8043
8044 def Lower(*args, **kwargs):
8045 """
8046 Lower(self)
8047
8048 Lowers the window to the bottom of the window hierarchy if it is a
8049 managed window (dialog or frame).
8050 """
5b5c9bc7 8051 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
8052
8053 def SetClientSize(*args, **kwargs):
8054 """
5b5c9bc7 8055 SetClientSize(self, Size size)
d55e5bfc
RD
8056
8057 This sets the size of the window client area in pixels. Using this
8058 function to size a window tends to be more device-independent than
8059 wx.Window.SetSize, since the application need not worry about what
8060 dimensions the border or title bar have when trying to fit the window
8061 around panel items, for example.
8062 """
5b5c9bc7 8063 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
8064
8065 def SetClientSizeWH(*args, **kwargs):
8066 """
8067 SetClientSizeWH(self, int width, int height)
8068
8069 This sets the size of the window client area in pixels. Using this
8070 function to size a window tends to be more device-independent than
8071 wx.Window.SetSize, since the application need not worry about what
8072 dimensions the border or title bar have when trying to fit the window
8073 around panel items, for example.
8074 """
5b5c9bc7 8075 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
8076
8077 def SetClientRect(*args, **kwargs):
8078 """
5b5c9bc7 8079 SetClientRect(self, Rect rect)
d55e5bfc
RD
8080
8081 This sets the size of the window client area in pixels. Using this
8082 function to size a window tends to be more device-independent than
8083 wx.Window.SetSize, since the application need not worry about what
8084 dimensions the border or title bar have when trying to fit the window
8085 around panel items, for example.
8086 """
5b5c9bc7 8087 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
8088
8089 def GetPosition(*args, **kwargs):
8090 """
5b5c9bc7 8091 GetPosition(self) -> Point
d55e5bfc
RD
8092
8093 Get the window's position.
8094 """
5b5c9bc7 8095 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
8096
8097 def GetPositionTuple(*args, **kwargs):
8098 """
8099 GetPositionTuple() -> (x,y)
8100
8101 Get the window's position.
8102 """
5b5c9bc7 8103 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
8104
8105 def GetSize(*args, **kwargs):
8106 """
5b5c9bc7 8107 GetSize(self) -> Size
d55e5bfc
RD
8108
8109 Get the window size.
8110 """
5b5c9bc7 8111 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
8112
8113 def GetSizeTuple(*args, **kwargs):
8114 """
8115 GetSizeTuple() -> (width, height)
8116
8117 Get the window size.
8118 """
5b5c9bc7 8119 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
8120
8121 def GetRect(*args, **kwargs):
8122 """
5b5c9bc7 8123 GetRect(self) -> Rect
d55e5bfc
RD
8124
8125 Returns the size and position of the window as a wx.Rect object.
8126 """
5b5c9bc7 8127 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
8128
8129 def GetClientSize(*args, **kwargs):
8130 """
5b5c9bc7 8131 GetClientSize(self) -> Size
d55e5bfc
RD
8132
8133 This gets the size of the window's 'client area' in pixels. The client
8134 area is the area which may be drawn on by the programmer, excluding
8135 title bar, border, scrollbars, etc.
8136 """
5b5c9bc7 8137 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
8138
8139 def GetClientSizeTuple(*args, **kwargs):
8140 """
8141 GetClientSizeTuple() -> (width, height)
8142
8143 This gets the size of the window's 'client area' in pixels. The client
8144 area is the area which may be drawn on by the programmer, excluding
8145 title bar, border, scrollbars, etc.
8146 """
5b5c9bc7 8147 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
8148
8149 def GetClientAreaOrigin(*args, **kwargs):
8150 """
5b5c9bc7 8151 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
8152
8153 Get the origin of the client area of the window relative to the
8154 window's top left corner (the client area may be shifted because of
8155 the borders, scrollbars, other decorations...)
8156 """
5b5c9bc7 8157 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
8158
8159 def GetClientRect(*args, **kwargs):
8160 """
5b5c9bc7 8161 GetClientRect(self) -> Rect
d55e5bfc 8162
0439c23b 8163 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 8164 """
5b5c9bc7 8165 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
8166
8167 def GetBestSize(*args, **kwargs):
8168 """
5b5c9bc7 8169 GetBestSize(self) -> Size
d55e5bfc 8170
bfddbb17 8171 This function returns the best acceptable minimal size for the
15817c7e
RD
8172 window, if applicable. For example, for a static text control, it will
8173 be the minimal size such that the control label is not truncated. For
8174 windows containing subwindows (suzh aswx.Panel), the size returned by
8175 this function will be the same as the size the window would have had
8176 after calling Fit.
d55e5bfc 8177 """
5b5c9bc7 8178 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
8179
8180 def GetBestSizeTuple(*args, **kwargs):
8181 """
8182 GetBestSizeTuple() -> (width, height)
8183
bfddbb17 8184 This function returns the best acceptable minimal size for the
15817c7e
RD
8185 window, if applicable. For example, for a static text control, it will
8186 be the minimal size such that the control label is not truncated. For
8187 windows containing subwindows (suzh aswx.Panel), the size returned by
8188 this function will be the same as the size the window would have had
8189 after calling Fit.
d55e5bfc 8190 """
5b5c9bc7 8191 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 8192
a001823c
RD
8193 def InvalidateBestSize(*args, **kwargs):
8194 """
8195 InvalidateBestSize(self)
8196
8197 Reset the cached best size value so it will be recalculated the next
8198 time it is needed.
8199 """
5b5c9bc7 8200 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c
RD
8201
8202 def GetBestFittingSize(*args, **kwargs):
8203 """
5b5c9bc7 8204 GetBestFittingSize(self) -> Size
a001823c
RD
8205
8206 This function will merge the window's best size into the window's
8207 minimum size, giving priority to the min size components, and returns
8208 the results.
8209
8210 """
5b5c9bc7 8211 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 8212
d55e5bfc
RD
8213 def GetAdjustedBestSize(*args, **kwargs):
8214 """
5b5c9bc7 8215 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
8216
8217 This method is similar to GetBestSize, except in one
8218 thing. GetBestSize should return the minimum untruncated size of the
8219 window, while this method will return the largest of BestSize and any
8220 user specified minimum size. ie. it is the minimum size the window
8221 should currently be drawn at, not the minimal size it can possibly
8222 tolerate.
8223 """
5b5c9bc7 8224 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
8225
8226 def Center(*args, **kwargs):
8227 """
5b5c9bc7 8228 Center(self, int direction=BOTH)
d55e5bfc
RD
8229
8230 Centers the window. The parameter specifies the direction for
8231 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8232 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8233 on the entire screen and not on its parent window. If it is a
8234 top-level window and has no parent then it will always be centered
8235 relative to the screen.
8236 """
5b5c9bc7 8237 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
8238
8239 Centre = Center
8240 def CenterOnScreen(*args, **kwargs):
8241 """
5b5c9bc7 8242 CenterOnScreen(self, int dir=BOTH)
d55e5bfc
RD
8243
8244 Center on screen (only works for top level windows)
8245 """
5b5c9bc7 8246 return _core_.Window_CenterOnScreen(*args, **kwargs)
d55e5bfc
RD
8247
8248 CentreOnScreen = CenterOnScreen
8249 def CenterOnParent(*args, **kwargs):
8250 """
5b5c9bc7 8251 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
8252
8253 Center with respect to the the parent window
8254 """
5b5c9bc7 8255 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
8256
8257 CentreOnParent = CenterOnParent
8258 def Fit(*args, **kwargs):
8259 """
8260 Fit(self)
8261
8262 Sizes the window so that it fits around its subwindows. This function
8263 won't do anything if there are no subwindows and will only really work
8264 correctly if sizers are used for the subwindows layout. Also, if the
8265 window has exactly one subwindow it is better (faster and the result
8266 is more precise as Fit adds some margin to account for fuzziness of
8267 its calculations) to call window.SetClientSize(child.GetSize())
8268 instead of calling Fit.
8269 """
5b5c9bc7 8270 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
8271
8272 def FitInside(*args, **kwargs):
8273 """
8274 FitInside(self)
8275
8276 Similar to Fit, but sizes the interior (virtual) size of a
8277 window. Mainly useful with scrolled windows to reset scrollbars after
8278 sizing changes that do not trigger a size event, and/or scrolled
8279 windows without an interior sizer. This function similarly won't do
8280 anything if there are no subwindows.
8281 """
5b5c9bc7 8282 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 8283
03837c5c 8284 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8285 """
8286 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8287 int incH=-1)
d55e5bfc
RD
8288
8289 Allows specification of minimum and maximum window sizes, and window
8290 size increments. If a pair of values is not set (or set to -1), the
8291 default values will be used. If this function is called, the user
908b74cd
RD
8292 will not be able to size the window outside the given bounds (if it is
8293 a top-level window.) Sizers will also inspect the minimum window size
8294 and will use that value if set when calculating layout.
8295
8296 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8297 """
5b5c9bc7 8298 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8299
03837c5c
RD
8300 def SetSizeHintsSz(*args, **kwargs):
8301 """
5b5c9bc7 8302 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
8303
8304 Allows specification of minimum and maximum window sizes, and window
8305 size increments. If a pair of values is not set (or set to -1), the
8306 default values will be used. If this function is called, the user
8307 will not be able to size the window outside the given bounds (if it is
8308 a top-level window.) Sizers will also inspect the minimum window size
8309 and will use that value if set when calculating layout.
8310
8311 The resizing increments are only significant under Motif or Xt.
8312 """
5b5c9bc7 8313 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
8314
8315 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8316 """
908b74cd 8317 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8318
8319 Allows specification of minimum and maximum virtual window sizes. If a
8320 pair of values is not set (or set to -1), the default values will be
8321 used. If this function is called, the user will not be able to size
8322 the virtual area of the window outside the given bounds.
8323 """
5b5c9bc7 8324 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
8325
8326 def SetVirtualSizeHintsSz(*args, **kwargs):
8327 """
5b5c9bc7 8328 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
8329
8330 Allows specification of minimum and maximum virtual window sizes. If a
8331 pair of values is not set (or set to -1), the default values will be
8332 used. If this function is called, the user will not be able to size
8333 the virtual area of the window outside the given bounds.
8334 """
5b5c9bc7 8335 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8336
908b74cd 8337 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
8338 """GetMaxSize(self) -> Size"""
8339 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8340
8341 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8342 """GetMinSize(self) -> Size"""
8343 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8344
8345 def SetMinSize(*args, **kwargs):
8346 """
5b5c9bc7 8347 SetMinSize(self, Size minSize)
908b74cd
RD
8348
8349 A more convenient method than `SetSizeHints` for setting just the
8350 min size.
8351 """
5b5c9bc7 8352 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8353
8354 def SetMaxSize(*args, **kwargs):
8355 """
5b5c9bc7 8356 SetMaxSize(self, Size maxSize)
908b74cd
RD
8357
8358 A more convenient method than `SetSizeHints` for setting just the
8359 max size.
8360 """
5b5c9bc7 8361 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8362
d55e5bfc
RD
8363 def GetMinWidth(*args, **kwargs):
8364 """GetMinWidth(self) -> int"""
5b5c9bc7 8365 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8366
8367 def GetMinHeight(*args, **kwargs):
8368 """GetMinHeight(self) -> int"""
5b5c9bc7 8369 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8370
8371 def GetMaxWidth(*args, **kwargs):
8372 """GetMaxWidth(self) -> int"""
5b5c9bc7 8373 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8374
8375 def GetMaxHeight(*args, **kwargs):
8376 """GetMaxHeight(self) -> int"""
5b5c9bc7 8377 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8378
d55e5bfc
RD
8379 def SetVirtualSize(*args, **kwargs):
8380 """
5b5c9bc7 8381 SetVirtualSize(self, Size size)
d55e5bfc
RD
8382
8383 Set the the virtual size of a window in pixels. For most windows this
8384 is just the client area of the window, but for some like scrolled
8385 windows it is more or less independent of the screen window size.
8386 """
5b5c9bc7 8387 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8388
8389 def SetVirtualSizeWH(*args, **kwargs):
8390 """
8391 SetVirtualSizeWH(self, int w, int h)
8392
8393 Set the the virtual size of a window in pixels. For most windows this
8394 is just the client area of the window, but for some like scrolled
8395 windows it is more or less independent of the screen window size.
8396 """
5b5c9bc7 8397 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8398
8399 def GetVirtualSize(*args, **kwargs):
8400 """
5b5c9bc7 8401 GetVirtualSize(self) -> Size
d55e5bfc
RD
8402
8403 Get the the virtual size of the window in pixels. For most windows
8404 this is just the client area of the window, but for some like scrolled
8405 windows it is more or less independent of the screen window size.
8406 """
5b5c9bc7 8407 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8408
8409 def GetVirtualSizeTuple(*args, **kwargs):
8410 """
8411 GetVirtualSizeTuple() -> (width, height)
8412
8413 Get the the virtual size of the window in pixels. For most windows
8414 this is just the client area of the window, but for some like scrolled
8415 windows it is more or less independent of the screen window size.
8416 """
5b5c9bc7 8417 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
8418
8419 def GetBestVirtualSize(*args, **kwargs):
8420 """
5b5c9bc7 8421 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8422
8423 Return the largest of ClientSize and BestSize (as determined by a
8424 sizer, interior children, or other means)
8425 """
5b5c9bc7 8426 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8427
8428 def Show(*args, **kwargs):
8429 """
8430 Show(self, bool show=True) -> bool
8431
8432 Shows or hides the window. You may need to call Raise for a top level
8433 window if you want to bring it to top, although this is not needed if
8434 Show is called immediately after the frame creation. Returns True if
8435 the window has been shown or hidden or False if nothing was done
8436 because it already was in the requested state.
8437 """
5b5c9bc7 8438 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8439
8440 def Hide(*args, **kwargs):
8441 """
8442 Hide(self) -> bool
8443
8444 Equivalent to calling Show(False).
8445 """
5b5c9bc7 8446 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8447
8448 def Enable(*args, **kwargs):
8449 """
8450 Enable(self, bool enable=True) -> bool
8451
8452 Enable or disable the window for user input. Note that when a parent
8453 window is disabled, all of its children are disabled as well and they
8454 are reenabled again when the parent is. Returns true if the window
8455 has been enabled or disabled, false if nothing was done, i.e. if the
8456 window had already been in the specified state.
8457 """
5b5c9bc7 8458 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8459
8460 def Disable(*args, **kwargs):
8461 """
8462 Disable(self) -> bool
8463
8464 Disables the window, same as Enable(false).
8465 """
5b5c9bc7 8466 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8467
8468 def IsShown(*args, **kwargs):
8469 """
8470 IsShown(self) -> bool
8471
8472 Returns true if the window is shown, false if it has been hidden.
8473 """
5b5c9bc7 8474 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8475
8476 def IsEnabled(*args, **kwargs):
8477 """
8478 IsEnabled(self) -> bool
8479
8480 Returns true if the window is enabled for input, false otherwise.
8481 """
5b5c9bc7 8482 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8483
8484 def SetWindowStyleFlag(*args, **kwargs):
8485 """
8486 SetWindowStyleFlag(self, long style)
8487
15817c7e
RD
8488 Sets the style of the window. Please note that some styles cannot be
8489 changed after the window creation and that Refresh() might need to be
8490 called after changing the others for the change to take place
8491 immediately.
d55e5bfc 8492 """
5b5c9bc7 8493 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8494
8495 def GetWindowStyleFlag(*args, **kwargs):
8496 """
8497 GetWindowStyleFlag(self) -> long
8498
8499 Gets the window style that was passed to the constructor or Create
8500 method.
8501 """
5b5c9bc7 8502 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8503
8504 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8505 def HasFlag(*args, **kwargs):
8506 """
8507 HasFlag(self, int flag) -> bool
8508
8509 Test if the given style is set for this window.
8510 """
5b5c9bc7 8511 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8512
8513 def IsRetained(*args, **kwargs):
8514 """
8515 IsRetained(self) -> bool
8516
8517 Returns true if the window is retained, false otherwise. Retained
8518 windows are only available on X platforms.
8519 """
5b5c9bc7 8520 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
8521
8522 def SetExtraStyle(*args, **kwargs):
8523 """
8524 SetExtraStyle(self, long exStyle)
8525
8526 Sets the extra style bits for the window. Extra styles are the less
8527 often used style bits which can't be set with the constructor or with
8528 SetWindowStyleFlag()
8529 """
5b5c9bc7 8530 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8531
8532 def GetExtraStyle(*args, **kwargs):
8533 """
8534 GetExtraStyle(self) -> long
8535
8536 Returns the extra style bits for the window.
8537 """
5b5c9bc7 8538 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8539
8540 def MakeModal(*args, **kwargs):
8541 """
8542 MakeModal(self, bool modal=True)
8543
8544 Disables all other windows in the application so that the user can
8545 only interact with this window. Passing False will reverse this
8546 effect.
8547 """
5b5c9bc7 8548 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
8549
8550 def SetThemeEnabled(*args, **kwargs):
8551 """
8552 SetThemeEnabled(self, bool enableTheme)
8553
8554 This function tells a window if it should use the system's "theme"
8555 code to draw the windows' background instead if its own background
8556 drawing code. This will only have an effect on platforms that support
8557 the notion of themes in user defined windows. One such platform is
8558 GTK+ where windows can have (very colourful) backgrounds defined by a
8559 user's selected theme.
8560
8561 Dialogs, notebook pages and the status bar have this flag set to true
8562 by default so that the default look and feel is simulated best.
8563 """
5b5c9bc7 8564 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8565
8566 def GetThemeEnabled(*args, **kwargs):
8567 """
8568 GetThemeEnabled(self) -> bool
8569
8570 Return the themeEnabled flag.
8571 """
5b5c9bc7 8572 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8573
8574 def SetFocus(*args, **kwargs):
8575 """
8576 SetFocus(self)
8577
8578 Set's the focus to this window, allowing it to receive keyboard input.
8579 """
5b5c9bc7 8580 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
8581
8582 def SetFocusFromKbd(*args, **kwargs):
8583 """
8584 SetFocusFromKbd(self)
8585
8586 Set focus to this window as the result of a keyboard action. Normally
8587 only called internally.
8588 """
5b5c9bc7 8589 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
8590
8591 def FindFocus(*args, **kwargs):
8592 """
5b5c9bc7 8593 FindFocus() -> Window
d55e5bfc
RD
8594
8595 Returns the window or control that currently has the keyboard focus,
8596 or None.
8597 """
5b5c9bc7 8598 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
8599
8600 FindFocus = staticmethod(FindFocus)
8601 def AcceptsFocus(*args, **kwargs):
8602 """
8603 AcceptsFocus(self) -> bool
8604
8605 Can this window have focus?
8606 """
5b5c9bc7 8607 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
8608
8609 def AcceptsFocusFromKeyboard(*args, **kwargs):
8610 """
8611 AcceptsFocusFromKeyboard(self) -> bool
8612
8613 Can this window be given focus by keyboard navigation? if not, the
8614 only way to give it focus (provided it accepts it at all) is to click
8615 it.
8616 """
5b5c9bc7 8617 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc
RD
8618
8619 def GetDefaultItem(*args, **kwargs):
8620 """
5b5c9bc7 8621 GetDefaultItem(self) -> Window
d55e5bfc
RD
8622
8623 Get the default child of this parent, i.e. the one which is activated
8624 by pressing <Enter> such as the OK button on a wx.Dialog.
8625 """
5b5c9bc7 8626 return _core_.Window_GetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8627
8628 def SetDefaultItem(*args, **kwargs):
8629 """
5b5c9bc7 8630 SetDefaultItem(self, Window child) -> Window
d55e5bfc
RD
8631
8632 Set this child as default, return the old default.
8633 """
5b5c9bc7 8634 return _core_.Window_SetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8635
8636 def SetTmpDefaultItem(*args, **kwargs):
8637 """
5b5c9bc7 8638 SetTmpDefaultItem(self, Window win)
d55e5bfc
RD
8639
8640 Set this child as temporary default
8641 """
5b5c9bc7 8642 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
d55e5bfc 8643
908b74cd
RD
8644 def Navigate(*args, **kwargs):
8645 """
8646 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8647
fd2dc343
RD
8648 Does keyboard navigation from this window to another, by sending a
8649 `wx.NavigationKeyEvent`.
908b74cd 8650 """
5b5c9bc7 8651 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 8652
bf26d883
RD
8653 def MoveAfterInTabOrder(*args, **kwargs):
8654 """
5b5c9bc7 8655 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
8656
8657 Moves this window in the tab navigation order after the specified
8658 sibling window. This means that when the user presses the TAB key on
8659 that other window, the focus switches to this window.
8660
8661 The default tab order is the same as creation order. This function
8662 and `MoveBeforeInTabOrder` allow to change it after creating all the
8663 windows.
8664
8665 """
5b5c9bc7 8666 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
8667
8668 def MoveBeforeInTabOrder(*args, **kwargs):
8669 """
5b5c9bc7 8670 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
8671
8672 Same as `MoveAfterInTabOrder` except that it inserts this window just
8673 before win instead of putting it right after it.
8674 """
5b5c9bc7 8675 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 8676
d55e5bfc
RD
8677 def GetChildren(*args, **kwargs):
8678 """
8679 GetChildren(self) -> PyObject
8680
8681 Returns a list of the window's children. NOTE: Currently this is a
8682 copy of the child window list maintained by the window, so the return
8683 value of this function is only valid as long as the window's children
8684 do not change.
8685 """
5b5c9bc7 8686 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
8687
8688 def GetParent(*args, **kwargs):
8689 """
5b5c9bc7 8690 GetParent(self) -> Window
d55e5bfc
RD
8691
8692 Returns the parent window of this window, or None if there isn't one.
8693 """
5b5c9bc7 8694 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
8695
8696 def GetGrandParent(*args, **kwargs):
8697 """
5b5c9bc7 8698 GetGrandParent(self) -> Window
d55e5bfc 8699
15817c7e
RD
8700 Returns the parent of the parent of this window, or None if there
8701 isn't one.
d55e5bfc 8702 """
5b5c9bc7 8703 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
8704
8705 def IsTopLevel(*args, **kwargs):
8706 """
8707 IsTopLevel(self) -> bool
8708
8709 Returns true if the given window is a top-level one. Currently all
8710 frames and dialogs are always considered to be top-level windows (even
8711 if they have a parent window).
8712 """
5b5c9bc7 8713 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
8714
8715 def Reparent(*args, **kwargs):
8716 """
5b5c9bc7 8717 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
8718
8719 Reparents the window, i.e the window will be removed from its current
8720 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8721 re-inserted into another. Available on Windows and GTK. Returns True
8722 if the parent was changed, False otherwise (error or newParent ==
8723 oldParent)
8724 """
5b5c9bc7 8725 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
8726
8727 def AddChild(*args, **kwargs):
8728 """
5b5c9bc7 8729 AddChild(self, Window child)
d55e5bfc
RD
8730
8731 Adds a child window. This is called automatically by window creation
8732 functions so should not be required by the application programmer.
8733 """
5b5c9bc7 8734 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
8735
8736 def RemoveChild(*args, **kwargs):
8737 """
5b5c9bc7 8738 RemoveChild(self, Window child)
d55e5bfc
RD
8739
8740 Removes a child window. This is called automatically by window
8741 deletion functions so should not be required by the application
8742 programmer.
8743 """
5b5c9bc7 8744 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc
RD
8745
8746 def FindWindowById(*args, **kwargs):
8747 """
5b5c9bc7 8748 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
8749
8750 Find a chld of this window by window ID
8751 """
5b5c9bc7 8752 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
8753
8754 def FindWindowByName(*args, **kwargs):
8755 """
5b5c9bc7 8756 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
8757
8758 Find a child of this window by name
8759 """
5b5c9bc7 8760 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
8761
8762 def GetEventHandler(*args, **kwargs):
8763 """
5b5c9bc7 8764 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
8765
8766 Returns the event handler for this window. By default, the window is
8767 its own event handler.
8768 """
5b5c9bc7 8769 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
8770
8771 def SetEventHandler(*args, **kwargs):
8772 """
5b5c9bc7 8773 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8774
8775 Sets the event handler for this window. An event handler is an object
8776 that is capable of processing the events sent to a window. By default,
8777 the window is its own event handler, but an application may wish to
8778 substitute another, for example to allow central implementation of
8779 event-handling for a variety of different window classes.
8780
15817c7e 8781 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
8782 up a chain of event handlers, where an event not handled by one event
8783 handler is handed to the next one in the chain.
8784 """
5b5c9bc7 8785 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
8786
8787 def PushEventHandler(*args, **kwargs):
8788 """
5b5c9bc7 8789 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8790
8791 Pushes this event handler onto the event handler stack for the window.
8792 An event handler is an object that is capable of processing the events
8793 sent to a window. By default, the window is its own event handler, but
8794 an application may wish to substitute another, for example to allow
8795 central implementation of event-handling for a variety of different
8796 window classes.
8797
8798 wx.Window.PushEventHandler allows an application to set up a chain of
8799 event handlers, where an event not handled by one event handler is
15817c7e 8800 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
8801 remove the event handler.
8802 """
5b5c9bc7 8803 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
8804
8805 def PopEventHandler(*args, **kwargs):
8806 """
5b5c9bc7 8807 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
8808
8809 Removes and returns the top-most event handler on the event handler
8810 stack. If deleteHandler is True then the wx.EvtHandler object will be
8811 destroyed after it is popped.
8812 """
5b5c9bc7 8813 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
8814
8815 def RemoveEventHandler(*args, **kwargs):
8816 """
5b5c9bc7 8817 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 8818
15817c7e
RD
8819 Find the given handler in the event handler chain and remove (but not
8820 delete) it from the event handler chain, return True if it was found
8821 and False otherwise (this also results in an assert failure so this
8822 function should only be called when the handler is supposed to be
8823 there.)
d55e5bfc 8824 """
5b5c9bc7 8825 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
8826
8827 def SetValidator(*args, **kwargs):
8828 """
5b5c9bc7 8829 SetValidator(self, Validator validator)
d55e5bfc
RD
8830
8831 Deletes the current validator (if any) and sets the window validator,
8832 having called wx.Validator.Clone to create a new validator of this
8833 type.
8834 """
5b5c9bc7 8835 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
8836
8837 def GetValidator(*args, **kwargs):
8838 """
5b5c9bc7 8839 GetValidator(self) -> Validator
d55e5bfc
RD
8840
8841 Returns a pointer to the current validator for the window, or None if
8842 there is none.
8843 """
5b5c9bc7 8844 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
8845
8846 def Validate(*args, **kwargs):
8847 """
8848 Validate(self) -> bool
8849
8850 Validates the current values of the child controls using their
15817c7e
RD
8851 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8852 style flag set, the method will also call Validate() of all child
8853 windows. Returns false if any of the validations failed.
d55e5bfc 8854 """
5b5c9bc7 8855 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
8856
8857 def TransferDataToWindow(*args, **kwargs):
8858 """
8859 TransferDataToWindow(self) -> bool
8860
15817c7e
RD
8861 Transfers values to child controls from data areas specified by their
8862 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8863 style flag set, the method will also call TransferDataToWindow() of
8864 all child windows.
d55e5bfc 8865 """
5b5c9bc7 8866 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
8867
8868 def TransferDataFromWindow(*args, **kwargs):
8869 """
8870 TransferDataFromWindow(self) -> bool
8871
15817c7e
RD
8872 Transfers values from child controls to data areas specified by their
8873 validators. Returns false if a transfer failed. If the window has
8874 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8875 also call TransferDataFromWindow() of all child windows.
d55e5bfc 8876 """
5b5c9bc7 8877 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
8878
8879 def InitDialog(*args, **kwargs):
8880 """
8881 InitDialog(self)
8882
15817c7e
RD
8883 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8884 to the dialog via validators.
d55e5bfc 8885 """
5b5c9bc7 8886 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
8887
8888 def SetAcceleratorTable(*args, **kwargs):
8889 """
5b5c9bc7 8890 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
8891
8892 Sets the accelerator table for this window.
8893 """
5b5c9bc7 8894 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8895
8896 def GetAcceleratorTable(*args, **kwargs):
8897 """
5b5c9bc7 8898 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
8899
8900 Gets the accelerator table for this window.
8901 """
5b5c9bc7 8902 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8903
8904 def RegisterHotKey(*args, **kwargs):
8905 """
8906 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8907
8908 Registers a system wide hotkey. Every time the user presses the hotkey
8909 registered here, this window will receive a hotkey event. It will
8910 receive the event even if the application is in the background and
8911 does not have the input focus because the user is working with some
8912 other application. To bind an event handler function to this hotkey
8913 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8914 hotkey was registered successfully.
8915 """
5b5c9bc7 8916 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
8917
8918 def UnregisterHotKey(*args, **kwargs):
8919 """
8920 UnregisterHotKey(self, int hotkeyId) -> bool
8921
8922 Unregisters a system wide hotkey.
8923 """
5b5c9bc7 8924 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
8925
8926 def ConvertDialogPointToPixels(*args, **kwargs):
8927 """
5b5c9bc7 8928 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
8929
8930 Converts a point or size from dialog units to pixels. Dialog units
8931 are used for maintaining a dialog's proportions even if the font
8932 changes. For the x dimension, the dialog units are multiplied by the
8933 average character width and then divided by 4. For the y dimension,
8934 the dialog units are multiplied by the average character height and
8935 then divided by 8.
8936 """
5b5c9bc7 8937 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
8938
8939 def ConvertDialogSizeToPixels(*args, **kwargs):
8940 """
5b5c9bc7 8941 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
8942
8943 Converts a point or size from dialog units to pixels. Dialog units
8944 are used for maintaining a dialog's proportions even if the font
8945 changes. For the x dimension, the dialog units are multiplied by the
8946 average character width and then divided by 4. For the y dimension,
8947 the dialog units are multiplied by the average character height and
8948 then divided by 8.
8949 """
5b5c9bc7 8950 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
8951
8952 def DLG_PNT(*args, **kwargs):
8953 """
5b5c9bc7 8954 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
8955
8956 Converts a point or size from dialog units to pixels. Dialog units
8957 are used for maintaining a dialog's proportions even if the font
8958 changes. For the x dimension, the dialog units are multiplied by the
8959 average character width and then divided by 4. For the y dimension,
8960 the dialog units are multiplied by the average character height and
8961 then divided by 8.
8962 """
5b5c9bc7 8963 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
8964
8965 def DLG_SZE(*args, **kwargs):
8966 """
5b5c9bc7 8967 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
8968
8969 Converts a point or size from dialog units to pixels. Dialog units
8970 are used for maintaining a dialog's proportions even if the font
8971 changes. For the x dimension, the dialog units are multiplied by the
8972 average character width and then divided by 4. For the y dimension,
8973 the dialog units are multiplied by the average character height and
8974 then divided by 8.
8975 """
5b5c9bc7 8976 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
8977
8978 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
8979 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8980 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
8981
8982 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
8983 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8984 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
8985
8986 def WarpPointer(*args, **kwargs):
8987 """
8988 WarpPointer(self, int x, int y)
8989
8990 Moves the pointer to the given position on the window.
8991
8992 NOTE: This function is not supported under Mac because Apple Human
8993 Interface Guidelines forbid moving the mouse cursor programmatically.
8994 """
5b5c9bc7 8995 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
8996
8997 def CaptureMouse(*args, **kwargs):
8998 """
8999 CaptureMouse(self)
9000
9001 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9002 release the capture.
9003
9004 Note that wxWindows maintains the stack of windows having captured the
9005 mouse and when the mouse is released the capture returns to the window
9006 which had had captured it previously and it is only really released if
9007 there were no previous window. In particular, this means that you must
9008 release the mouse as many times as you capture it.
9009 """
5b5c9bc7 9010 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
9011
9012 def ReleaseMouse(*args, **kwargs):
9013 """
9014 ReleaseMouse(self)
9015
9016 Releases mouse input captured with wx.Window.CaptureMouse.
9017 """
5b5c9bc7 9018 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
9019
9020 def GetCapture(*args, **kwargs):
9021 """
5b5c9bc7 9022 GetCapture() -> Window
d55e5bfc
RD
9023
9024 Returns the window which currently captures the mouse or None
9025 """
5b5c9bc7 9026 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
9027
9028 GetCapture = staticmethod(GetCapture)
9029 def HasCapture(*args, **kwargs):
9030 """
9031 HasCapture(self) -> bool
9032
9033 Returns true if this window has the current mouse capture.
9034 """
5b5c9bc7 9035 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
9036
9037 def Refresh(*args, **kwargs):
9038 """
5b5c9bc7 9039 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
9040
9041 Mark the specified rectangle (or the whole window) as "dirty" so it
9042 will be repainted. Causes an EVT_PAINT event to be generated and sent
9043 to the window.
9044 """
5b5c9bc7 9045 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
9046
9047 def RefreshRect(*args, **kwargs):
9048 """
5b5c9bc7 9049 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
9050
9051 Redraws the contents of the given rectangle: the area inside it will
9052 be repainted. This is the same as Refresh but has a nicer syntax.
9053 """
5b5c9bc7 9054 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
9055
9056 def Update(*args, **kwargs):
9057 """
9058 Update(self)
9059
9060 Calling this method immediately repaints the invalidated area of the
9061 window instead of waiting for the EVT_PAINT event to happen, (normally
9062 this would usually only happen when the flow of control returns to the
9063 event loop.) Notice that this function doesn't refresh the window and
9064 does nothing if the window has been already repainted. Use Refresh
9065 first if you want to immediately redraw the window (or some portion of
9066 it) unconditionally.
9067 """
5b5c9bc7 9068 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
9069
9070 def ClearBackground(*args, **kwargs):
9071 """
9072 ClearBackground(self)
9073
9074 Clears the window by filling it with the current background
9075 colour. Does not cause an erase background event to be generated.
9076 """
5b5c9bc7 9077 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
9078
9079 def Freeze(*args, **kwargs):
9080 """
9081 Freeze(self)
9082
15817c7e
RD
9083 Freezes the window or, in other words, prevents any updates from
9084 taking place on screen, the window is not redrawn at all. Thaw must be
9085 called to reenable window redrawing. Calls to Freeze/Thaw may be
9086 nested, with the actual Thaw being delayed until all the nesting has
9087 been undone.
d55e5bfc
RD
9088
9089 This method is useful for visual appearance optimization (for example,
9090 it is a good idea to use it before inserting large amount of text into
9091 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9092 for all controls so it is mostly just a hint to wxWindows and not a
9093 mandatory directive.
9094 """
5b5c9bc7 9095 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc
RD
9096
9097 def Thaw(*args, **kwargs):
9098 """
9099 Thaw(self)
9100
9101 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
9102 Freeze/Thaw may be nested, so Thaw must be called the same number of
9103 times that Freeze was before the window will be updated.
d55e5bfc 9104 """
5b5c9bc7 9105 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
9106
9107 def PrepareDC(*args, **kwargs):
9108 """
5b5c9bc7 9109 PrepareDC(self, DC dc)
d55e5bfc
RD
9110
9111 Call this function to prepare the device context for drawing a
9112 scrolled image. It sets the device origin according to the current
9113 scroll position.
9114 """
5b5c9bc7 9115 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc
RD
9116
9117 def GetUpdateRegion(*args, **kwargs):
9118 """
5b5c9bc7 9119 GetUpdateRegion(self) -> Region
d55e5bfc
RD
9120
9121 Returns the region specifying which parts of the window have been
9122 damaged. Should only be called within an EVT_PAINT handler.
9123 """
5b5c9bc7 9124 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
9125
9126 def GetUpdateClientRect(*args, **kwargs):
9127 """
5b5c9bc7 9128 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
9129
9130 Get the update rectangle region bounding box in client coords.
9131 """
5b5c9bc7 9132 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
9133
9134 def IsExposed(*args, **kwargs):
9135 """
9136 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9137
9138 Returns true if the given point or rectangle area has been exposed
9139 since the last repaint. Call this in an paint event handler to
9140 optimize redrawing by only redrawing those areas, which have been
9141 exposed.
9142 """
5b5c9bc7 9143 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
9144
9145 def IsExposedPoint(*args, **kwargs):
9146 """
5b5c9bc7 9147 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
9148
9149 Returns true if the given point or rectangle area has been exposed
9150 since the last repaint. Call this in an paint event handler to
9151 optimize redrawing by only redrawing those areas, which have been
9152 exposed.
9153 """
5b5c9bc7 9154 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
9155
9156 def IsExposedRect(*args, **kwargs):
9157 """
5b5c9bc7 9158 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
9159
9160 Returns true if the given point or rectangle area has been exposed
9161 since the last repaint. Call this in an paint event handler to
9162 optimize redrawing by only redrawing those areas, which have been
9163 exposed.
9164 """
5b5c9bc7 9165 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
9166
9167 def GetDefaultAttributes(*args, **kwargs):
9168 """
5b5c9bc7 9169 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 9170
15817c7e
RD
9171 Get the default attributes for an instance of this class. This is
9172 useful if you want to use the same font or colour in your own control
9173 as in a standard control -- which is a much better idea than hard
9174 coding specific colours or fonts which might look completely out of
a5ee0656 9175 place on the user's system, especially if it uses themes.
d55e5bfc 9176 """
5b5c9bc7 9177 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9178
9179 def GetClassDefaultAttributes(*args, **kwargs):
9180 """
5b5c9bc7 9181 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9182
15817c7e
RD
9183 Get the default attributes for this class. This is useful if you want
9184 to use the same font or colour in your own control as in a standard
9185 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9186 colours or fonts which might look completely out of place on the
9187 user's system, especially if it uses themes.
d55e5bfc
RD
9188
9189 The variant parameter is only relevant under Mac currently and is
15817c7e 9190 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9191 the returned font. See `wx.Window.SetWindowVariant` for more about
9192 this.
d55e5bfc 9193 """
5b5c9bc7 9194 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9195
9196 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9197 def SetBackgroundColour(*args, **kwargs):
9198 """
5b5c9bc7 9199 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9200
9201 Sets the background colour of the window. Returns True if the colour
9202 was changed. The background colour is usually painted by the default
9203 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9204 automatically under GTK. Using `wx.NullColour` will reset the window
9205 to the default background colour.
d55e5bfc 9206
a5ee0656 9207 Note that setting the background colour may not cause an immediate
f8167d6e 9208 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
9209 calling this function.
9210
f8167d6e
RD
9211 Using this function will disable attempts to use themes for this
9212 window, if the system supports them. Use with care since usually the
9213 themes represent the appearance chosen by the user to be used for all
9214 applications on the system.
d55e5bfc 9215 """
5b5c9bc7 9216 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 9217
412d302d 9218 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
9219 """SetOwnBackgroundColour(self, Colour colour)"""
9220 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9221
9222 def SetForegroundColour(*args, **kwargs):
9223 """
5b5c9bc7 9224 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9225
9226 Sets the foreground colour of the window. Returns True is the colour
9227 was changed. The interpretation of foreground colour is dependent on
9228 the window class; it may be the text colour or other colour, or it may
9229 not be used at all.
9230 """
5b5c9bc7 9231 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 9232
fa47d7a7 9233 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
9234 """SetOwnForegroundColour(self, Colour colour)"""
9235 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9236
9237 def GetBackgroundColour(*args, **kwargs):
9238 """
5b5c9bc7 9239 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
9240
9241 Returns the background colour of the window.
9242 """
5b5c9bc7 9243 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9244
9245 def GetForegroundColour(*args, **kwargs):
9246 """
5b5c9bc7 9247 GetForegroundColour(self) -> Colour
d55e5bfc
RD
9248
9249 Returns the foreground colour of the window. The interpretation of
9250 foreground colour is dependent on the window class; it may be the text
9251 colour or other colour, or it may not be used at all.
9252 """
5b5c9bc7 9253 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 9254
dcb8fc74
RD
9255 def InheritsBackgroundColour(*args, **kwargs):
9256 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 9257 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
9258
9259 def UseBgCol(*args, **kwargs):
9260 """UseBgCol(self) -> bool"""
5b5c9bc7 9261 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 9262
0f63ec68
RD
9263 def SetBackgroundStyle(*args, **kwargs):
9264 """
9265 SetBackgroundStyle(self, int style) -> bool
9266
9267 Returns the background style of the window. The background style
9268 indicates how the background of the window is drawn.
9269
9270 ====================== ========================================
9271 wx.BG_STYLE_SYSTEM The background colour or pattern should
9272 be determined by the system
9273 wx.BG_STYLE_COLOUR The background should be a solid colour
9274 wx.BG_STYLE_CUSTOM The background will be implemented by the
9275 application.
9276 ====================== ========================================
9277
9278 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9279 a custom background, such as a tiled bitmap. Currently the style has
9280 no effect on other platforms.
9281
9282 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9283 """
5b5c9bc7 9284 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
9285
9286 def GetBackgroundStyle(*args, **kwargs):
9287 """
9288 GetBackgroundStyle(self) -> int
9289
9290 Returns the background style of the window.
9291
9292 :see: `SetBackgroundStyle`
9293 """
5b5c9bc7 9294 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 9295
51b83b37
RD
9296 def HasTransparentBackground(*args, **kwargs):
9297 """
9298 HasTransparentBackground(self) -> bool
9299
9300 Returns True if this window's background is transparent (as, for
9301 example, for `wx.StaticText`) and should show the parent window's
9302 background.
9303
9304 This method is mostly used internally by the library itself and you
9305 normally shouldn't have to call it. You may, however, have to override
9306 it in your custom control classes to ensure that background is painted
9307 correctly.
9308 """
5b5c9bc7 9309 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 9310
d55e5bfc
RD
9311 def SetCursor(*args, **kwargs):
9312 """
5b5c9bc7 9313 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
9314
9315 Sets the window's cursor. Notice that the window cursor also sets it
9316 for the children of the window implicitly.
9317
9318 The cursor may be wx.NullCursor in which case the window cursor will
9319 be reset back to default.
9320 """
5b5c9bc7 9321 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
9322
9323 def GetCursor(*args, **kwargs):
9324 """
5b5c9bc7 9325 GetCursor(self) -> Cursor
d55e5bfc
RD
9326
9327 Return the cursor associated with this window.
9328 """
5b5c9bc7 9329 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
9330
9331 def SetFont(*args, **kwargs):
9332 """
5b5c9bc7 9333 SetFont(self, Font font) -> bool
d55e5bfc
RD
9334
9335 Sets the font for this window.
9336 """
5b5c9bc7 9337 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9338
fa47d7a7 9339 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9340 """SetOwnFont(self, Font font)"""
9341 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9342
9343 def GetFont(*args, **kwargs):
9344 """
5b5c9bc7 9345 GetFont(self) -> Font
d55e5bfc
RD
9346
9347 Returns the default font used for this window.
9348 """
5b5c9bc7 9349 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9350
9351 def SetCaret(*args, **kwargs):
9352 """
5b5c9bc7 9353 SetCaret(self, Caret caret)
d55e5bfc
RD
9354
9355 Sets the caret associated with the window.
9356 """
5b5c9bc7 9357 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9358
9359 def GetCaret(*args, **kwargs):
9360 """
5b5c9bc7 9361 GetCaret(self) -> Caret
d55e5bfc
RD
9362
9363 Returns the caret associated with the window.
9364 """
5b5c9bc7 9365 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9366
9367 def GetCharHeight(*args, **kwargs):
9368 """
9369 GetCharHeight(self) -> int
9370
9371 Get the (average) character size for the current font.
9372 """
5b5c9bc7 9373 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9374
9375 def GetCharWidth(*args, **kwargs):
9376 """
9377 GetCharWidth(self) -> int
9378
9379 Get the (average) character size for the current font.
9380 """
5b5c9bc7 9381 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9382
9383 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9384 """
9385 GetTextExtent(String string) -> (width, height)
9386
9387 Get the width and height of the text using the current font.
9388 """
5b5c9bc7 9389 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9390
9391 def GetFullTextExtent(*args, **kwargs):
9392 """
9393 GetFullTextExtent(String string, Font font=None) ->
9394 (width, height, descent, externalLeading)
9395
9396 Get the width, height, decent and leading of the text using the
9397 current or specified font.
9398 """
5b5c9bc7 9399 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9400
9401 def ClientToScreenXY(*args, **kwargs):
9402 """
9403 ClientToScreenXY(int x, int y) -> (x,y)
9404
9405 Converts to screen coordinates from coordinates relative to this window.
9406 """
5b5c9bc7 9407 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9408
9409 def ScreenToClientXY(*args, **kwargs):
9410 """
9411 ScreenToClientXY(int x, int y) -> (x,y)
9412
9413 Converts from screen to client window coordinates.
9414 """
5b5c9bc7 9415 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9416
9417 def ClientToScreen(*args, **kwargs):
9418 """
5b5c9bc7 9419 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9420
9421 Converts to screen coordinates from coordinates relative to this window.
9422 """
5b5c9bc7 9423 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9424
9425 def ScreenToClient(*args, **kwargs):
9426 """
5b5c9bc7 9427 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9428
9429 Converts from screen to client window coordinates.
9430 """
5b5c9bc7 9431 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9432
9433 def HitTestXY(*args, **kwargs):
9434 """
9435 HitTestXY(self, int x, int y) -> int
9436
9437 Test where the given (in client coords) point lies
9438 """
5b5c9bc7 9439 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9440
9441 def HitTest(*args, **kwargs):
9442 """
5b5c9bc7 9443 HitTest(self, Point pt) -> int
d55e5bfc
RD
9444
9445 Test where the given (in client coords) point lies
9446 """
5b5c9bc7 9447 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9448
9449 def GetBorder(*args):
9450 """
9451 GetBorder(self, long flags) -> int
9452 GetBorder(self) -> int
9453
9454 Get border for the flags of this window
9455 """
5b5c9bc7 9456 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9457
9458 def UpdateWindowUI(*args, **kwargs):
9459 """
5b5c9bc7 9460 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9461
9462 This function sends EVT_UPDATE_UI events to the window. The particular
9463 implementation depends on the window; for example a wx.ToolBar will
9464 send an update UI event for each toolbar button, and a wx.Frame will
9465 send an update UI event for each menubar menu item. You can call this
9466 function from your application to ensure that your UI is up-to-date at
9467 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9468 concerned). This may be necessary if you have called
5ba5649b 9469 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9470 limit the overhead that wxWindows incurs by sending update UI events
9471 in idle time.
d55e5bfc 9472 """
5b5c9bc7 9473 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9474
9475 def PopupMenuXY(*args, **kwargs):
9476 """
5b5c9bc7 9477 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9478
b0503257
RD
9479 Pops up the given menu at the specified coordinates, relative to this window,
9480 and returns control when the user has dismissed the menu. If a menu item is
9481 selected, the corresponding menu event is generated and will be processed as
9482 usual. If the default position is given then the current position of the
9483 mouse cursor will be used.
d55e5bfc 9484 """
5b5c9bc7 9485 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9486
9487 def PopupMenu(*args, **kwargs):
9488 """
5b5c9bc7 9489 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9490
b0503257
RD
9491 Pops up the given menu at the specified coordinates, relative to this window,
9492 and returns control when the user has dismissed the menu. If a menu item is
9493 selected, the corresponding menu event is generated and will be processed as
9494 usual. If the default position is given then the current position of the
9495 mouse cursor will be used.
d55e5bfc 9496 """
5b5c9bc7 9497 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc
RD
9498
9499 def GetHandle(*args, **kwargs):
9500 """
9501 GetHandle(self) -> long
9502
9503 Returns the platform-specific handle (as a long integer) of the
9504 physical window. Currently on wxMac it returns the handle of the
9505 toplevel parent of the window.
9506 """
5b5c9bc7 9507 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 9508
629e65c2
RD
9509 def AssociateHandle(*args, **kwargs):
9510 """
9511 AssociateHandle(self, long handle)
9512
9513 Associate the window with a new native handle
9514 """
5b5c9bc7 9515 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
9516
9517 def DissociateHandle(*args, **kwargs):
9518 """
9519 DissociateHandle(self)
9520
9521 Dissociate the current native handle from the window
9522 """
5b5c9bc7 9523 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 9524
d55e5bfc
RD
9525 def HasScrollbar(*args, **kwargs):
9526 """
9527 HasScrollbar(self, int orient) -> bool
9528
9529 Does the window have the scrollbar for this orientation?
9530 """
5b5c9bc7 9531 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
9532
9533 def SetScrollbar(*args, **kwargs):
9534 """
15817c7e 9535 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9536 bool refresh=True)
9537
9538 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 9539 """
5b5c9bc7 9540 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
9541
9542 def SetScrollPos(*args, **kwargs):
9543 """
9544 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9545
9546 Sets the position of one of the built-in scrollbars.
9547 """
5b5c9bc7 9548 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
9549
9550 def GetScrollPos(*args, **kwargs):
9551 """
9552 GetScrollPos(self, int orientation) -> int
9553
9554 Returns the built-in scrollbar position.
9555 """
5b5c9bc7 9556 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
9557
9558 def GetScrollThumb(*args, **kwargs):
9559 """
9560 GetScrollThumb(self, int orientation) -> int
9561
9562 Returns the built-in scrollbar thumb size.
9563 """
5b5c9bc7 9564 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
9565
9566 def GetScrollRange(*args, **kwargs):
9567 """
9568 GetScrollRange(self, int orientation) -> int
9569
9570 Returns the built-in scrollbar range.
9571 """
5b5c9bc7 9572 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
9573
9574 def ScrollWindow(*args, **kwargs):
9575 """
5b5c9bc7 9576 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
9577
9578 Physically scrolls the pixels in the window and move child windows
9579 accordingly. Use this function to optimise your scrolling
9580 implementations, to minimise the area that must be redrawn. Note that
9581 it is rarely required to call this function from a user program.
d55e5bfc 9582 """
5b5c9bc7 9583 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
9584
9585 def ScrollLines(*args, **kwargs):
9586 """
9587 ScrollLines(self, int lines) -> bool
9588
9589 If the platform and window class supports it, scrolls the window by
9590 the given number of lines down, if lines is positive, or up if lines
9591 is negative. Returns True if the window was scrolled, False if it was
9592 already on top/bottom and nothing was done.
9593 """
5b5c9bc7 9594 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
9595
9596 def ScrollPages(*args, **kwargs):
9597 """
9598 ScrollPages(self, int pages) -> bool
9599
15817c7e 9600 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9601 the given number of pages down, if pages is positive, or up if pages
9602 is negative. Returns True if the window was scrolled, False if it was
9603 already on top/bottom and nothing was done.
9604 """
5b5c9bc7 9605 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
9606
9607 def LineUp(*args, **kwargs):
9608 """
9609 LineUp(self) -> bool
9610
9611 This is just a wrapper for ScrollLines(-1).
9612 """
5b5c9bc7 9613 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
9614
9615 def LineDown(*args, **kwargs):
9616 """
9617 LineDown(self) -> bool
9618
9619 This is just a wrapper for ScrollLines(1).
9620 """
5b5c9bc7 9621 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
9622
9623 def PageUp(*args, **kwargs):
9624 """
9625 PageUp(self) -> bool
9626
9627 This is just a wrapper for ScrollPages(-1).
9628 """
5b5c9bc7 9629 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
9630
9631 def PageDown(*args, **kwargs):
9632 """
9633 PageDown(self) -> bool
9634
9635 This is just a wrapper for ScrollPages(1).
9636 """
5b5c9bc7 9637 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
9638
9639 def SetHelpText(*args, **kwargs):
9640 """
5b5c9bc7 9641 SetHelpText(self, String text)
d55e5bfc
RD
9642
9643 Sets the help text to be used as context-sensitive help for this
9644 window. Note that the text is actually stored by the current
9645 wxHelpProvider implementation, and not in the window object itself.
9646 """
5b5c9bc7 9647 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
9648
9649 def SetHelpTextForId(*args, **kwargs):
9650 """
5b5c9bc7 9651 SetHelpTextForId(self, String text)
d55e5bfc
RD
9652
9653 Associate this help text with all windows with the same id as this
9654 one.
9655 """
5b5c9bc7 9656 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc
RD
9657
9658 def GetHelpText(*args, **kwargs):
9659 """
5b5c9bc7 9660 GetHelpText(self) -> String
d55e5bfc
RD
9661
9662 Gets the help text to be used as context-sensitive help for this
9663 window. Note that the text is actually stored by the current
9664 wxHelpProvider implementation, and not in the window object itself.
9665 """
5b5c9bc7 9666 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
9667
9668 def SetToolTipString(*args, **kwargs):
9669 """
5b5c9bc7 9670 SetToolTipString(self, String tip)
d55e5bfc
RD
9671
9672 Attach a tooltip to the window.
9673 """
5b5c9bc7 9674 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
9675
9676 def SetToolTip(*args, **kwargs):
9677 """
5b5c9bc7 9678 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
9679
9680 Attach a tooltip to the window.
9681 """
5b5c9bc7 9682 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
9683
9684 def GetToolTip(*args, **kwargs):
9685 """
5b5c9bc7 9686 GetToolTip(self) -> ToolTip
d55e5bfc
RD
9687
9688 get the associated tooltip or None if none
9689 """
5b5c9bc7 9690 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
9691
9692 def SetDropTarget(*args, **kwargs):
9693 """
5b5c9bc7 9694 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
9695
9696 Associates a drop target with this window. If the window already has
9697 a drop target, it is deleted.
9698 """
5b5c9bc7 9699 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
9700
9701 def GetDropTarget(*args, **kwargs):
9702 """
5b5c9bc7 9703 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
9704
9705 Returns the associated drop target, which may be None.
9706 """
5b5c9bc7 9707 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 9708
5ba5649b
RD
9709 def DragAcceptFiles(*args, **kwargs):
9710 """
9711 DragAcceptFiles(self, bool accept)
9712
9713 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9714 Only functional on Windows.
9715 """
9716 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9717
d55e5bfc
RD
9718 def SetConstraints(*args, **kwargs):
9719 """
5b5c9bc7 9720 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
9721
9722 Sets the window to have the given layout constraints. If an existing
9723 layout constraints object is already owned by the window, it will be
9724 deleted. Pass None to disassociate and delete the window's current
9725 constraints.
9726
9727 You must call SetAutoLayout to tell a window to use the constraints
9728 automatically in its default EVT_SIZE handler; otherwise, you must
9729 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9730 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9731 effect.
9732 """
5b5c9bc7 9733 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
9734
9735 def GetConstraints(*args, **kwargs):
9736 """
5b5c9bc7 9737 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
9738
9739 Returns a pointer to the window's layout constraints, or None if there
9740 are none.
9741 """
5b5c9bc7 9742 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
9743
9744 def SetAutoLayout(*args, **kwargs):
9745 """
9746 SetAutoLayout(self, bool autoLayout)
9747
9748 Determines whether the Layout function will be called automatically
9749 when the window is resized. It is called implicitly by SetSizer but
9750 if you use SetConstraints you should call it manually or otherwise the
9751 window layout won't be correctly updated when its size changes.
9752 """
5b5c9bc7 9753 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9754
9755 def GetAutoLayout(*args, **kwargs):
9756 """
9757 GetAutoLayout(self) -> bool
9758
9759 Returns the current autoLayout setting
9760 """
5b5c9bc7 9761 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9762
9763 def Layout(*args, **kwargs):
9764 """
9765 Layout(self) -> bool
9766
9767 Invokes the constraint-based layout algorithm or the sizer-based
9768 algorithm for this window. See SetAutoLayout: when auto layout is on,
9769 this function gets called automatically by the default EVT_SIZE
9770 handler when the window is resized.
9771 """
5b5c9bc7 9772 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
9773
9774 def SetSizer(*args, **kwargs):
9775 """
5b5c9bc7 9776 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9777
9778 Sets the window to have the given layout sizer. The window will then
9779 own the object, and will take care of its deletion. If an existing
9780 layout sizer object is already owned by the window, it will be deleted
9781 if the deleteOld parameter is true. Note that this function will also
9782 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 9783 non-None, and False otherwise.
d55e5bfc 9784 """
5b5c9bc7 9785 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
9786
9787 def SetSizerAndFit(*args, **kwargs):
9788 """
5b5c9bc7 9789 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9790
9791 The same as SetSizer, except it also sets the size hints for the
9792 window based on the sizer's minimum size.
9793 """
5b5c9bc7 9794 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
9795
9796 def GetSizer(*args, **kwargs):
9797 """
5b5c9bc7 9798 GetSizer(self) -> Sizer
d55e5bfc
RD
9799
9800 Return the sizer associated with the window by a previous call to
9801 SetSizer or None if there isn't one.
9802 """
5b5c9bc7 9803 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
9804
9805 def SetContainingSizer(*args, **kwargs):
9806 """
5b5c9bc7 9807 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
9808
9809 This normally does not need to be called by application code. It is
9810 called internally when a window is added to a sizer, and is used so
9811 the window can remove itself from the sizer when it is destroyed.
9812 """
5b5c9bc7 9813 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9814
9815 def GetContainingSizer(*args, **kwargs):
9816 """
5b5c9bc7 9817 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
9818
9819 Return the sizer that this window is a member of, if any, otherwise None.
9820 """
5b5c9bc7 9821 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9822
9823 def InheritAttributes(*args, **kwargs):
9824 """
9825 InheritAttributes(self)
9826
15817c7e
RD
9827 This function is (or should be, in case of custom controls) called
9828 during window creation to intelligently set up the window visual
9829 attributes, that is the font and the foreground and background
9830 colours.
9831
9832 By 'intelligently' the following is meant: by default, all windows use
9833 their own default attributes. However if some of the parent's
9834 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9835 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
9836 explicitly set for this window itself, then this window takes the same
9837 value as used by the parent. In addition, if the window overrides
9838 ShouldInheritColours to return false, the colours will not be changed
9839 no matter what and only the font might.
9840
a7bb0a9d
RD
9841 This rather complicated logic is necessary in order to accommodate the
9842 different usage scenarios. The most common one is when all default
15817c7e
RD
9843 attributes are used and in this case, nothing should be inherited as
9844 in modern GUIs different controls use different fonts (and colours)
9845 than their siblings so they can't inherit the same value from the
9846 parent. However it was also deemed desirable to allow to simply change
9847 the attributes of all children at once by just changing the font or
9848 colour of their common parent, hence in this case we do inherit the
9849 parents attributes.
9850
d55e5bfc 9851 """
5b5c9bc7 9852 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
9853
9854 def ShouldInheritColours(*args, **kwargs):
9855 """
9856 ShouldInheritColours(self) -> bool
9857
9858 Return true from here to allow the colours of this window to be
15817c7e
RD
9859 changed by InheritAttributes, returning false forbids inheriting them
9860 from the parent window.
d55e5bfc 9861
15817c7e
RD
9862 The base class version returns false, but this method is overridden in
9863 wxControl where it returns true.
d55e5bfc 9864 """
5b5c9bc7 9865 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc
RD
9866
9867 def PostCreate(self, pre):
9868 """
9869 Phase 3 of the 2-phase create <wink!>
9870 Call this method after precreating the window with the 2-phase create method.
9871 """
9872 self.this = pre.this
9873 self.thisown = pre.thisown
9874 pre.thisown = 0
9875 if hasattr(self, '_setOORInfo'):
9876 self._setOORInfo(self)
9877 if hasattr(self, '_setCallbackInfo'):
9878 self._setCallbackInfo(self, self.__class__)
9879
9880
5b5c9bc7 9881class WindowPtr(Window):
d55e5bfc
RD
9882 def __init__(self, this):
9883 self.this = this
9884 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
9885 self.__class__ = Window
9886_core_.Window_swigregister(WindowPtr)
d55e5bfc
RD
9887
9888def PreWindow(*args, **kwargs):
9889 """
5b5c9bc7 9890 PreWindow() -> Window
d55e5bfc
RD
9891
9892 Precreate a Window for 2-phase creation.
9893 """
5b5c9bc7 9894 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
9895 val.thisown = 1
9896 return val
9897
5b5c9bc7 9898def Window_NewControlId(*args, **kwargs):
d55e5bfc 9899 """
5b5c9bc7 9900 Window_NewControlId() -> int
d55e5bfc
RD
9901
9902 Generate a control id for the controls which were not given one.
9903 """
5b5c9bc7 9904 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc 9905
5b5c9bc7 9906def Window_NextControlId(*args, **kwargs):
d55e5bfc 9907 """
5b5c9bc7 9908 Window_NextControlId(int winid) -> int
d55e5bfc
RD
9909
9910 Get the id of the control following the one with the given
15817c7e 9911 autogenerated) id
d55e5bfc 9912 """
5b5c9bc7 9913 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 9914
5b5c9bc7 9915def Window_PrevControlId(*args, **kwargs):
d55e5bfc 9916 """
5b5c9bc7 9917 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
9918
9919 Get the id of the control preceding the one with the given
15817c7e 9920 autogenerated) id
d55e5bfc 9921 """
5b5c9bc7 9922 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 9923
5b5c9bc7 9924def Window_FindFocus(*args, **kwargs):
d55e5bfc 9925 """
5b5c9bc7 9926 Window_FindFocus() -> Window
d55e5bfc
RD
9927
9928 Returns the window or control that currently has the keyboard focus,
9929 or None.
9930 """
5b5c9bc7 9931 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc 9932
5b5c9bc7 9933def Window_GetCapture(*args, **kwargs):
d55e5bfc 9934 """
5b5c9bc7 9935 Window_GetCapture() -> Window
d55e5bfc
RD
9936
9937 Returns the window which currently captures the mouse or None
9938 """
5b5c9bc7 9939 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc 9940
5b5c9bc7 9941def Window_GetClassDefaultAttributes(*args, **kwargs):
d55e5bfc 9942 """
5b5c9bc7 9943 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9944
15817c7e
RD
9945 Get the default attributes for this class. This is useful if you want
9946 to use the same font or colour in your own control as in a standard
9947 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9948 colours or fonts which might look completely out of place on the
9949 user's system, especially if it uses themes.
d55e5bfc
RD
9950
9951 The variant parameter is only relevant under Mac currently and is
15817c7e 9952 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9953 the returned font. See `wx.Window.SetWindowVariant` for more about
9954 this.
d55e5bfc 9955 """
5b5c9bc7 9956 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9957
9958def DLG_PNT(win, point_or_x, y=None):
9959 """
9960 Convenience function for converting a Point or (x,y) in
9961 dialog units to pixel units.
9962 """
9963 if y is None:
9964 return win.ConvertDialogPointToPixels(point_or_x)
9965 else:
9966 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9967
9968def DLG_SZE(win, size_width, height=None):
9969 """
9970 Convenience function for converting a Size or (w,h) in
9971 dialog units to pixel units.
9972 """
9973 if height is None:
9974 return win.ConvertDialogSizeToPixels(size_width)
9975 else:
9976 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9977
9978
5b5c9bc7 9979def FindWindowById(*args, **kwargs):
d55e5bfc 9980 """
5b5c9bc7 9981 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
9982
9983 Find the first window in the application with the given id. If parent
9984 is None, the search will start from all top-level frames and dialog
9985 boxes; if non-None, the search will be limited to the given window
9986 hierarchy. The search is recursive in both cases.
9987 """
5b5c9bc7 9988 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 9989
5b5c9bc7 9990def FindWindowByName(*args, **kwargs):
d55e5bfc 9991 """
5b5c9bc7 9992 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
9993
9994 Find a window by its name (as given in a window constructor or Create
9995 function call). If parent is None, the search will start from all
9996 top-level frames and dialog boxes; if non-None, the search will be
9997 limited to the given window hierarchy. The search is recursive in both
9998 cases.
9999
10000 If no window with such name is found, wx.FindWindowByLabel is called.
10001 """
5b5c9bc7 10002 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 10003
5b5c9bc7 10004def FindWindowByLabel(*args, **kwargs):
d55e5bfc 10005 """
5b5c9bc7 10006 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
10007
10008 Find a window by its label. Depending on the type of window, the label
10009 may be a window title or panel item label. If parent is None, the
10010 search will start from all top-level frames and dialog boxes; if
10011 non-None, the search will be limited to the given window
10012 hierarchy. The search is recursive in both cases.
10013 """
5b5c9bc7 10014 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 10015
5b5c9bc7
RD
10016def Window_FromHWND(*args, **kwargs):
10017 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10018 return _core_.Window_FromHWND(*args, **kwargs)
3215336e
RD
10019
10020def GetTopLevelWindows(*args, **kwargs):
10021 """
10022 GetTopLevelWindows() -> PyObject
10023
10024 Returns a list of the the application's top-level windows, (frames,
10025 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10026 by wxWidgets, and so it is only valid as long as no top-level windows
10027 are closed or new top-level windows are created.
10028
10029 """
10030 return _core_.GetTopLevelWindows(*args, **kwargs)
d55e5bfc
RD
10031#---------------------------------------------------------------------------
10032
5b5c9bc7
RD
10033class Validator(EvtHandler):
10034 """Proxy of C++ Validator class"""
d55e5bfc
RD
10035 def __repr__(self):
10036 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10037 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10038 """__init__(self) -> Validator"""
10039 newobj = _core_.new_Validator(*args, **kwargs)
d55e5bfc
RD
10040 self.this = newobj.this
10041 self.thisown = 1
10042 del newobj.thisown
10043 self._setOORInfo(self)
10044
10045 def Clone(*args, **kwargs):
5b5c9bc7
RD
10046 """Clone(self) -> Validator"""
10047 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
10048
10049 def Validate(*args, **kwargs):
5b5c9bc7
RD
10050 """Validate(self, Window parent) -> bool"""
10051 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
10052
10053 def TransferToWindow(*args, **kwargs):
10054 """TransferToWindow(self) -> bool"""
5b5c9bc7 10055 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
10056
10057 def TransferFromWindow(*args, **kwargs):
10058 """TransferFromWindow(self) -> bool"""
5b5c9bc7 10059 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
10060
10061 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
10062 """GetWindow(self) -> Window"""
10063 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
10064
10065 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
10066 """SetWindow(self, Window window)"""
10067 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
10068
10069 def IsSilent(*args, **kwargs):
d6c14a4c 10070 """IsSilent() -> bool"""
5b5c9bc7 10071 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
10072
10073 IsSilent = staticmethod(IsSilent)
10074 def SetBellOnError(*args, **kwargs):
d6c14a4c 10075 """SetBellOnError(int doIt=True)"""
5b5c9bc7 10076 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
10077
10078 SetBellOnError = staticmethod(SetBellOnError)
10079
5b5c9bc7 10080class ValidatorPtr(Validator):
d55e5bfc
RD
10081 def __init__(self, this):
10082 self.this = this
10083 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10084 self.__class__ = Validator
10085_core_.Validator_swigregister(ValidatorPtr)
d55e5bfc 10086
5b5c9bc7
RD
10087def Validator_IsSilent(*args, **kwargs):
10088 """Validator_IsSilent() -> bool"""
10089 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc 10090
5b5c9bc7
RD
10091def Validator_SetBellOnError(*args, **kwargs):
10092 """Validator_SetBellOnError(int doIt=True)"""
10093 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 10094
5b5c9bc7
RD
10095class PyValidator(Validator):
10096 """Proxy of C++ PyValidator class"""
d55e5bfc
RD
10097 def __repr__(self):
10098 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10099 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10100 """__init__(self) -> PyValidator"""
10101 newobj = _core_.new_PyValidator(*args, **kwargs)
d55e5bfc
RD
10102 self.this = newobj.this
10103 self.thisown = 1
10104 del newobj.thisown
10105
10106 self._setCallbackInfo(self, PyValidator, 1)
10107 self._setOORInfo(self)
10108
10109 def _setCallbackInfo(*args, **kwargs):
10110 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 10111 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
10112
10113
5b5c9bc7 10114class PyValidatorPtr(PyValidator):
d55e5bfc
RD
10115 def __init__(self, this):
10116 self.this = this
10117 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10118 self.__class__ = PyValidator
10119_core_.PyValidator_swigregister(PyValidatorPtr)
d55e5bfc
RD
10120
10121#---------------------------------------------------------------------------
10122
5b5c9bc7
RD
10123class Menu(EvtHandler):
10124 """Proxy of C++ Menu class"""
d55e5bfc
RD
10125 def __repr__(self):
10126 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10127 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10128 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
10129 newobj = _core_.new_Menu(*args, **kwargs)
d55e5bfc
RD
10130 self.this = newobj.this
10131 self.thisown = 1
10132 del newobj.thisown
10133 self._setOORInfo(self)
10134
10135 def Append(*args, **kwargs):
5b5c9bc7
RD
10136 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10137 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
10138
10139 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
10140 """AppendSeparator(self) -> MenuItem"""
10141 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
10142
10143 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
10144 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10145 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
10146
10147 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
10148 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10149 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
10150
10151 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
10152 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10153 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc
RD
10154
10155 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
10156 """AppendItem(self, MenuItem item) -> MenuItem"""
10157 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc
RD
10158
10159 def Break(*args, **kwargs):
10160 """Break(self)"""
5b5c9bc7 10161 return _core_.Menu_Break(*args, **kwargs)
d55e5bfc
RD
10162
10163 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
10164 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10165 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc
RD
10166
10167 def Insert(*args, **kwargs):
10168 """
5b5c9bc7
RD
10169 Insert(self, size_t pos, int id, String text, String help=EmptyString,
10170 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 10171 """
5b5c9bc7 10172 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
10173
10174 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
10175 """InsertSeparator(self, size_t pos) -> MenuItem"""
10176 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
10177
10178 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
10179 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10180 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
10181
10182 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
10183 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10184 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
10185
10186 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
10187 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10188 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc
RD
10189
10190 def PrependItem(*args, **kwargs):
5b5c9bc7
RD
10191 """PrependItem(self, MenuItem item) -> MenuItem"""
10192 return _core_.Menu_PrependItem(*args, **kwargs)
d55e5bfc
RD
10193
10194 def Prepend(*args, **kwargs):
5b5c9bc7
RD
10195 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
10196 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
10197
10198 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
10199 """PrependSeparator(self) -> MenuItem"""
10200 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
10201
10202 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
10203 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10204 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
10205
10206 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
10207 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10208 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
10209
10210 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
10211 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10212 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
10213
10214 def Remove(*args, **kwargs):
5b5c9bc7
RD
10215 """Remove(self, int id) -> MenuItem"""
10216 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
10217
10218 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
10219 """RemoveItem(self, MenuItem item) -> MenuItem"""
10220 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
10221
10222 def Delete(*args, **kwargs):
10223 """Delete(self, int id) -> bool"""
5b5c9bc7 10224 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
10225
10226 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
10227 """DeleteItem(self, MenuItem item) -> bool"""
10228 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
10229
10230 def Destroy(*args, **kwargs):
10231 """
10232 Destroy(self)
10233
10234 Deletes the C++ object this Python object is a proxy for.
10235 """
5b5c9bc7 10236 return _core_.Menu_Destroy(*args, **kwargs)
d55e5bfc
RD
10237
10238 def DestroyId(*args, **kwargs):
10239 """
10240 DestroyId(self, int id) -> bool
10241
10242 Deletes the C++ object this Python object is a proxy for.
10243 """
5b5c9bc7 10244 return _core_.Menu_DestroyId(*args, **kwargs)
d55e5bfc
RD
10245
10246 def DestroyItem(*args, **kwargs):
10247 """
5b5c9bc7 10248 DestroyItem(self, MenuItem item) -> bool
d55e5bfc
RD
10249
10250 Deletes the C++ object this Python object is a proxy for.
10251 """
5b5c9bc7 10252 return _core_.Menu_DestroyItem(*args, **kwargs)
d55e5bfc
RD
10253
10254 def GetMenuItemCount(*args, **kwargs):
10255 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 10256 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
10257
10258 def GetMenuItems(*args, **kwargs):
10259 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 10260 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
10261
10262 def FindItem(*args, **kwargs):
5b5c9bc7
RD
10263 """FindItem(self, String item) -> int"""
10264 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
10265
10266 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10267 """FindItemById(self, int id) -> MenuItem"""
10268 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
10269
10270 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
10271 """FindItemByPosition(self, size_t position) -> MenuItem"""
10272 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
10273
10274 def Enable(*args, **kwargs):
10275 """Enable(self, int id, bool enable)"""
5b5c9bc7 10276 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
10277
10278 def IsEnabled(*args, **kwargs):
10279 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10280 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10281
10282 def Check(*args, **kwargs):
10283 """Check(self, int id, bool check)"""
5b5c9bc7 10284 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
10285
10286 def IsChecked(*args, **kwargs):
10287 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10288 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
10289
10290 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10291 """SetLabel(self, int id, String label)"""
10292 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
10293
10294 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10295 """GetLabel(self, int id) -> String"""
10296 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
10297
10298 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10299 """SetHelpString(self, int id, String helpString)"""
10300 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10301
10302 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10303 """GetHelpString(self, int id) -> String"""
10304 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10305
10306 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
10307 """SetTitle(self, String title)"""
10308 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
10309
10310 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
10311 """GetTitle(self) -> String"""
10312 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
10313
10314 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10315 """SetEventHandler(self, EvtHandler handler)"""
10316 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
10317
10318 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10319 """GetEventHandler(self) -> EvtHandler"""
10320 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
10321
10322 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10323 """SetInvokingWindow(self, Window win)"""
10324 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10325
10326 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10327 """GetInvokingWindow(self) -> Window"""
10328 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10329
10330 def GetStyle(*args, **kwargs):
10331 """GetStyle(self) -> long"""
5b5c9bc7 10332 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
10333
10334 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10335 """UpdateUI(self, EvtHandler source=None)"""
10336 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10337
10338 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10339 """GetMenuBar(self) -> MenuBar"""
10340 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10341
10342 def Attach(*args, **kwargs):
10343 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10344 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10345
10346 def Detach(*args, **kwargs):
10347 """Detach(self)"""
5b5c9bc7 10348 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10349
10350 def IsAttached(*args, **kwargs):
10351 """IsAttached(self) -> bool"""
5b5c9bc7 10352 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10353
10354 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10355 """SetParent(self, Menu parent)"""
10356 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10357
10358 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10359 """GetParent(self) -> Menu"""
10360 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc
RD
10361
10362
5b5c9bc7 10363class MenuPtr(Menu):
d55e5bfc
RD
10364 def __init__(self, this):
10365 self.this = this
10366 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10367 self.__class__ = Menu
10368_core_.Menu_swigregister(MenuPtr)
10369DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10370
10371#---------------------------------------------------------------------------
10372
5b5c9bc7
RD
10373class MenuBar(Window):
10374 """Proxy of C++ MenuBar class"""
d55e5bfc
RD
10375 def __repr__(self):
10376 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10377 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
10378 """__init__(self, long style=0) -> MenuBar"""
10379 newobj = _core_.new_MenuBar(*args, **kwargs)
d55e5bfc
RD
10380 self.this = newobj.this
10381 self.thisown = 1
10382 del newobj.thisown
10383 self._setOORInfo(self)
10384
10385 def Append(*args, **kwargs):
5b5c9bc7
RD
10386 """Append(self, Menu menu, String title) -> bool"""
10387 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10388
10389 def Insert(*args, **kwargs):
5b5c9bc7
RD
10390 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10391 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10392
10393 def GetMenuCount(*args, **kwargs):
10394 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10395 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10396
10397 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10398 """GetMenu(self, size_t pos) -> Menu"""
10399 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10400
10401 def Replace(*args, **kwargs):
5b5c9bc7
RD
10402 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10403 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
10404
10405 def Remove(*args, **kwargs):
5b5c9bc7
RD
10406 """Remove(self, size_t pos) -> Menu"""
10407 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
10408
10409 def EnableTop(*args, **kwargs):
10410 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 10411 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
10412
10413 def IsEnabledTop(*args, **kwargs):
10414 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 10415 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
10416
10417 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10418 """SetLabelTop(self, size_t pos, String label)"""
10419 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
10420
10421 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10422 """GetLabelTop(self, size_t pos) -> String"""
10423 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
10424
10425 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
10426 """FindMenuItem(self, String menu, String item) -> int"""
10427 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
10428
10429 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10430 """FindItemById(self, int id) -> MenuItem"""
10431 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
10432
10433 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
10434 """FindMenu(self, String title) -> int"""
10435 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
10436
10437 def Enable(*args, **kwargs):
10438 """Enable(self, int id, bool enable)"""
5b5c9bc7 10439 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
10440
10441 def Check(*args, **kwargs):
10442 """Check(self, int id, bool check)"""
5b5c9bc7 10443 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
10444
10445 def IsChecked(*args, **kwargs):
10446 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10447 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
10448
10449 def IsEnabled(*args, **kwargs):
10450 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10451 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10452
10453 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10454 """SetLabel(self, int id, String label)"""
10455 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
10456
10457 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10458 """GetLabel(self, int id) -> String"""
10459 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
10460
10461 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10462 """SetHelpString(self, int id, String helpString)"""
10463 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10464
10465 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10466 """GetHelpString(self, int id) -> String"""
10467 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10468
10469 def GetFrame(*args, **kwargs):
10470 """GetFrame(self) -> wxFrame"""
5b5c9bc7 10471 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
10472
10473 def IsAttached(*args, **kwargs):
10474 """IsAttached(self) -> bool"""
5b5c9bc7 10475 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
10476
10477 def Attach(*args, **kwargs):
10478 """Attach(self, wxFrame frame)"""
5b5c9bc7 10479 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
10480
10481 def Detach(*args, **kwargs):
10482 """Detach(self)"""
5b5c9bc7 10483 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc
RD
10484
10485
5b5c9bc7 10486class MenuBarPtr(MenuBar):
d55e5bfc
RD
10487 def __init__(self, this):
10488 self.this = this
10489 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10490 self.__class__ = MenuBar
10491_core_.MenuBar_swigregister(MenuBarPtr)
d55e5bfc
RD
10492
10493#---------------------------------------------------------------------------
10494
5b5c9bc7
RD
10495class MenuItem(Object):
10496 """Proxy of C++ MenuItem class"""
d55e5bfc
RD
10497 def __repr__(self):
10498 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10499 def __init__(self, *args, **kwargs):
10500 """
5b5c9bc7
RD
10501 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10502 String help=EmptyString, int kind=ITEM_NORMAL,
10503 Menu subMenu=None) -> MenuItem
d55e5bfc 10504 """
5b5c9bc7 10505 newobj = _core_.new_MenuItem(*args, **kwargs)
d55e5bfc
RD
10506 self.this = newobj.this
10507 self.thisown = 1
10508 del newobj.thisown
10509 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10510 """GetMenu(self) -> Menu"""
10511 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
10512
10513 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
10514 """SetMenu(self, Menu menu)"""
10515 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
10516
10517 def SetId(*args, **kwargs):
10518 """SetId(self, int id)"""
5b5c9bc7 10519 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
10520
10521 def GetId(*args, **kwargs):
10522 """GetId(self) -> int"""
5b5c9bc7 10523 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
10524
10525 def IsSeparator(*args, **kwargs):
10526 """IsSeparator(self) -> bool"""
5b5c9bc7 10527 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
10528
10529 def SetText(*args, **kwargs):
5b5c9bc7
RD
10530 """SetText(self, String str)"""
10531 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
10532
10533 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10534 """GetLabel(self) -> String"""
10535 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
10536
10537 def GetText(*args, **kwargs):
5b5c9bc7
RD
10538 """GetText(self) -> String"""
10539 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
10540
10541 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
10542 """GetLabelFromText(String text) -> String"""
10543 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
10544
10545 GetLabelFromText = staticmethod(GetLabelFromText)
10546 def GetKind(*args, **kwargs):
10547 """GetKind(self) -> int"""
5b5c9bc7 10548 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
10549
10550 def SetKind(*args, **kwargs):
10551 """SetKind(self, int kind)"""
5b5c9bc7 10552 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
10553
10554 def SetCheckable(*args, **kwargs):
10555 """SetCheckable(self, bool checkable)"""
5b5c9bc7 10556 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
10557
10558 def IsCheckable(*args, **kwargs):
10559 """IsCheckable(self) -> bool"""
5b5c9bc7 10560 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
10561
10562 def IsSubMenu(*args, **kwargs):
10563 """IsSubMenu(self) -> bool"""
5b5c9bc7 10564 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
10565
10566 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10567 """SetSubMenu(self, Menu menu)"""
10568 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
10569
10570 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10571 """GetSubMenu(self) -> Menu"""
10572 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
10573
10574 def Enable(*args, **kwargs):
10575 """Enable(self, bool enable=True)"""
5b5c9bc7 10576 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
10577
10578 def IsEnabled(*args, **kwargs):
10579 """IsEnabled(self) -> bool"""
5b5c9bc7 10580 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10581
10582 def Check(*args, **kwargs):
10583 """Check(self, bool check=True)"""
5b5c9bc7 10584 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
10585
10586 def IsChecked(*args, **kwargs):
10587 """IsChecked(self) -> bool"""
5b5c9bc7 10588 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
10589
10590 def Toggle(*args, **kwargs):
10591 """Toggle(self)"""
5b5c9bc7 10592 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
10593
10594 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
10595 """SetHelp(self, String str)"""
10596 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
10597
10598 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
10599 """GetHelp(self) -> String"""
10600 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
10601
10602 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
10603 """GetAccel(self) -> AcceleratorEntry"""
10604 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
10605
10606 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
10607 """SetAccel(self, AcceleratorEntry accel)"""
10608 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 10609
c1280d1e 10610 def SetFont(*args, **kwargs):
5b5c9bc7
RD
10611 """SetFont(self, Font font)"""
10612 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
10613
10614 def GetFont(*args, **kwargs):
5b5c9bc7
RD
10615 """GetFont(self) -> Font"""
10616 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
10617
10618 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
10619 """SetTextColour(self, Colour colText)"""
10620 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
10621
10622 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
10623 """GetTextColour(self) -> Colour"""
10624 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
10625
10626 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10627 """SetBackgroundColour(self, Colour colBack)"""
10628 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10629
10630 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10631 """GetBackgroundColour(self) -> Colour"""
10632 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10633
10634 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
10635 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10636 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
10637
10638 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10639 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10640 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10641
10642 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10643 """GetDisabledBitmap(self) -> Bitmap"""
10644 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10645
10646 def SetMarginWidth(*args, **kwargs):
10647 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 10648 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
10649
10650 def GetMarginWidth(*args, **kwargs):
10651 """GetMarginWidth(self) -> int"""
5b5c9bc7 10652 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 10653
d55e5bfc 10654 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 10655 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 10656 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10657
10658 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10659 def IsOwnerDrawn(*args, **kwargs):
10660 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 10661 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10662
10663 def SetOwnerDrawn(*args, **kwargs):
10664 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 10665 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10666
10667 def ResetOwnerDrawn(*args, **kwargs):
10668 """ResetOwnerDrawn(self)"""
5b5c9bc7 10669 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 10670
d55e5bfc 10671 def SetBitmap(*args, **kwargs):
5b5c9bc7
RD
10672 """SetBitmap(self, Bitmap bitmap)"""
10673 return _core_.MenuItem_SetBitmap(*args, **kwargs)
d55e5bfc
RD
10674
10675 def GetBitmap(*args, **kwargs):
5b5c9bc7
RD
10676 """GetBitmap(self) -> Bitmap"""
10677 return _core_.MenuItem_GetBitmap(*args, **kwargs)
d55e5bfc
RD
10678
10679
5b5c9bc7 10680class MenuItemPtr(MenuItem):
d55e5bfc
RD
10681 def __init__(self, this):
10682 self.this = this
10683 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10684 self.__class__ = MenuItem
10685_core_.MenuItem_swigregister(MenuItemPtr)
d55e5bfc 10686
5b5c9bc7
RD
10687def MenuItem_GetLabelFromText(*args, **kwargs):
10688 """MenuItem_GetLabelFromText(String text) -> String"""
10689 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10690
5b5c9bc7
RD
10691def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
10692 """MenuItem_GetDefaultMarginWidth() -> int"""
10693 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10694
10695#---------------------------------------------------------------------------
10696
5b5c9bc7 10697class Control(Window):
d55e5bfc
RD
10698 """
10699 This is the base class for a control or 'widget'.
10700
15817c7e
RD
10701 A control is generally a small window which processes user input
10702 and/or displays one or more item of data.
d55e5bfc
RD
10703 """
10704 def __repr__(self):
10705 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10706 def __init__(self, *args, **kwargs):
10707 """
5b5c9bc7
RD
10708 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10709 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10710 String name=ControlNameStr) -> Control
d55e5bfc 10711
15817c7e
RD
10712 Create a Control. Normally you should only call this from a subclass'
10713 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10714 """
5b5c9bc7 10715 newobj = _core_.new_Control(*args, **kwargs)
d55e5bfc
RD
10716 self.this = newobj.this
10717 self.thisown = 1
10718 del newobj.thisown
10719 self._setOORInfo(self)
10720
10721 def Create(*args, **kwargs):
10722 """
5b5c9bc7
RD
10723 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10724 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10725 String name=ControlNameStr) -> bool
d55e5bfc
RD
10726
10727 Do the 2nd phase and create the GUI control.
10728 """
5b5c9bc7 10729 return _core_.Control_Create(*args, **kwargs)
d55e5bfc
RD
10730
10731 def Command(*args, **kwargs):
10732 """
5b5c9bc7 10733 Command(self, CommandEvent event)
d55e5bfc 10734
15817c7e
RD
10735 Simulates the effect of the user issuing a command to the item.
10736
10737 :see: `wx.CommandEvent`
10738
d55e5bfc 10739 """
5b5c9bc7 10740 return _core_.Control_Command(*args, **kwargs)
d55e5bfc
RD
10741
10742 def GetLabel(*args, **kwargs):
10743 """
5b5c9bc7 10744 GetLabel(self) -> String
d55e5bfc
RD
10745
10746 Return a control's text.
10747 """
5b5c9bc7 10748 return _core_.Control_GetLabel(*args, **kwargs)
d55e5bfc
RD
10749
10750 def SetLabel(*args, **kwargs):
10751 """
5b5c9bc7 10752 SetLabel(self, String label)
d55e5bfc
RD
10753
10754 Sets the item's text.
10755 """
5b5c9bc7 10756 return _core_.Control_SetLabel(*args, **kwargs)
d55e5bfc
RD
10757
10758 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 10759 """
5b5c9bc7 10760 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10761
10762 Get the default attributes for this class. This is useful if you want
10763 to use the same font or colour in your own control as in a standard
10764 control -- which is a much better idea than hard coding specific
10765 colours or fonts which might look completely out of place on the
10766 user's system, especially if it uses themes.
10767
10768 The variant parameter is only relevant under Mac currently and is
10769 ignore under other platforms. Under Mac, it will change the size of
10770 the returned font. See `wx.Window.SetWindowVariant` for more about
10771 this.
10772 """
5b5c9bc7 10773 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10774
10775 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
10776
5b5c9bc7 10777class ControlPtr(Control):
d55e5bfc
RD
10778 def __init__(self, this):
10779 self.this = this
10780 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10781 self.__class__ = Control
10782_core_.Control_swigregister(ControlPtr)
d55e5bfc
RD
10783ControlNameStr = cvar.ControlNameStr
10784
10785def PreControl(*args, **kwargs):
10786 """
5b5c9bc7 10787 PreControl() -> Control
d55e5bfc
RD
10788
10789 Precreate a Control control for 2-phase creation
10790 """
5b5c9bc7 10791 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
10792 val.thisown = 1
10793 return val
10794
5b5c9bc7 10795def Control_GetClassDefaultAttributes(*args, **kwargs):
110da5b0 10796 """
5b5c9bc7 10797 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10798
10799 Get the default attributes for this class. This is useful if you want
10800 to use the same font or colour in your own control as in a standard
10801 control -- which is a much better idea than hard coding specific
10802 colours or fonts which might look completely out of place on the
10803 user's system, especially if it uses themes.
10804
10805 The variant parameter is only relevant under Mac currently and is
10806 ignore under other platforms. Under Mac, it will change the size of
10807 the returned font. See `wx.Window.SetWindowVariant` for more about
10808 this.
10809 """
5b5c9bc7 10810 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10811
10812#---------------------------------------------------------------------------
10813
5b5c9bc7 10814class ItemContainer(object):
d55e5bfc 10815 """
53aa7709
RD
10816 The wx.ItemContainer class defines an interface which is implemented
10817 by all controls which have string subitems, each of which may be
10818 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10819 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 10820 this one.
d55e5bfc 10821
15817c7e
RD
10822 It defines the methods for accessing the control's items and although
10823 each of the derived classes implements them differently, they still
10824 all conform to the same interface.
d55e5bfc 10825
15817c7e
RD
10826 The items in a wx.ItemContainer have (non empty) string labels and,
10827 optionally, client data associated with them.
d55e5bfc
RD
10828
10829 """
10830 def __init__(self): raise RuntimeError, "No constructor defined"
10831 def __repr__(self):
10832 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10833 def Append(*args, **kwargs):
10834 """
5b5c9bc7 10835 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 10836
15817c7e
RD
10837 Adds the item to the control, associating the given data with the item
10838 if not None. The return value is the index of the newly added item
10839 which may be different from the last one if the control is sorted (e.g.
10840 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 10841 """
5b5c9bc7 10842 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
10843
10844 def AppendItems(*args, **kwargs):
10845 """
f5b96ee1 10846 AppendItems(self, List strings)
d55e5bfc 10847
15817c7e
RD
10848 Apend several items at once to the control. Notice that calling this
10849 method may be much faster than appending the items one by one if you
10850 need to add a lot of items.
d55e5bfc 10851 """
5b5c9bc7 10852 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
10853
10854 def Insert(*args, **kwargs):
10855 """
5b5c9bc7 10856 Insert(self, String item, int pos, PyObject clientData=None) -> int
d55e5bfc 10857
15817c7e 10858 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
10859 optionally associating some data object with the item.
10860 """
5b5c9bc7 10861 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
10862
10863 def Clear(*args, **kwargs):
10864 """
10865 Clear(self)
10866
10867 Removes all items from the control.
10868 """
5b5c9bc7 10869 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
10870
10871 def Delete(*args, **kwargs):
10872 """
10873 Delete(self, int n)
10874
15817c7e
RD
10875 Deletes the item at the zero-based index 'n' from the control. Note
10876 that it is an error (signalled by a `wx.PyAssertionError` exception if
10877 enabled) to remove an item with the index negative or greater or equal
10878 than the number of items in the control.
d55e5bfc 10879 """
5b5c9bc7 10880 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 10881
53aa7709
RD
10882 def GetClientData(*args, **kwargs):
10883 """
10884 GetClientData(self, int n) -> PyObject
10885
10886 Returns the client data associated with the given item, (if any.)
10887 """
5b5c9bc7 10888 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
10889
10890 def SetClientData(*args, **kwargs):
10891 """
10892 SetClientData(self, int n, PyObject clientData)
10893
10894 Associate the given client data with the item at position n.
10895 """
5b5c9bc7 10896 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 10897
d55e5bfc
RD
10898 def GetCount(*args, **kwargs):
10899 """
10900 GetCount(self) -> int
10901
10902 Returns the number of items in the control.
10903 """
5b5c9bc7 10904 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
10905
10906 def IsEmpty(*args, **kwargs):
10907 """
10908 IsEmpty(self) -> bool
10909
10910 Returns True if the control is empty or False if it has some items.
10911 """
5b5c9bc7 10912 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
10913
10914 def GetString(*args, **kwargs):
10915 """
5b5c9bc7 10916 GetString(self, int n) -> String
d55e5bfc
RD
10917
10918 Returns the label of the item with the given index.
10919 """
5b5c9bc7 10920 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
10921
10922 def GetStrings(*args, **kwargs):
10923 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 10924 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
10925
10926 def SetString(*args, **kwargs):
10927 """
5b5c9bc7 10928 SetString(self, int n, String s)
d55e5bfc
RD
10929
10930 Sets the label for the given item.
10931 """
5b5c9bc7 10932 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
10933
10934 def FindString(*args, **kwargs):
10935 """
5b5c9bc7 10936 FindString(self, String s) -> int
d55e5bfc
RD
10937
10938 Finds an item whose label matches the given string. Returns the
15817c7e
RD
10939 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10940 found.
d55e5bfc 10941 """
5b5c9bc7 10942 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 10943
53aa7709 10944 def SetSelection(*args, **kwargs):
d55e5bfc 10945 """
53aa7709 10946 SetSelection(self, int n)
d55e5bfc
RD
10947
10948 Sets the item at index 'n' to be the selected item.
10949 """
5b5c9bc7 10950 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 10951
d55e5bfc
RD
10952 def GetSelection(*args, **kwargs):
10953 """
10954 GetSelection(self) -> int
10955
15817c7e
RD
10956 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10957 is selected.
d55e5bfc 10958 """
5b5c9bc7 10959 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 10960
53aa7709 10961 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
10962 """SetStringSelection(self, String s) -> bool"""
10963 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 10964
d55e5bfc
RD
10965 def GetStringSelection(*args, **kwargs):
10966 """
5b5c9bc7 10967 GetStringSelection(self) -> String
d55e5bfc 10968
15817c7e
RD
10969 Returns the label of the selected item or an empty string if no item
10970 is selected.
d55e5bfc 10971 """
5b5c9bc7 10972 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 10973
53aa7709 10974 def Select(*args, **kwargs):
d55e5bfc 10975 """
53aa7709 10976 Select(self, int n)
d55e5bfc 10977
53aa7709
RD
10978 This is the same as `SetSelection` and exists only because it is
10979 slightly more natural for controls which support multiple selection.
d55e5bfc 10980 """
5b5c9bc7 10981 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc
RD
10982
10983
5b5c9bc7 10984class ItemContainerPtr(ItemContainer):
d55e5bfc
RD
10985 def __init__(self, this):
10986 self.this = this
10987 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
10988 self.__class__ = ItemContainer
10989_core_.ItemContainer_swigregister(ItemContainerPtr)
d55e5bfc
RD
10990
10991#---------------------------------------------------------------------------
10992
5b5c9bc7 10993class ControlWithItems(Control,ItemContainer):
d55e5bfc 10994 """
15817c7e
RD
10995 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10996 wx.Control class, and is used for the base class of various controls
10997 that have items.
d55e5bfc
RD
10998 """
10999 def __init__(self): raise RuntimeError, "No constructor defined"
11000 def __repr__(self):
11001 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11002
5b5c9bc7 11003class ControlWithItemsPtr(ControlWithItems):
d55e5bfc
RD
11004 def __init__(self, this):
11005 self.this = this
11006 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11007 self.__class__ = ControlWithItems
11008_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
d55e5bfc
RD
11009
11010#---------------------------------------------------------------------------
11011
5b5c9bc7 11012class SizerItem(Object):
bfddbb17
RD
11013 """
11014 The wx.SizerItem class is used to track the position, size and other
11015 attributes of each item managed by a `wx.Sizer`. In normal usage user
11016 code should never need to deal directly with a wx.SizerItem, but
11017 custom classes derived from `wx.PySizer` will probably need to use the
11018 collection of wx.SizerItems held by wx.Sizer when calculating layout.
11019
11020 :see: `wx.Sizer`, `wx.GBSizerItem`
11021 """
d55e5bfc
RD
11022 def __repr__(self):
11023 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11024 def __init__(self, *args, **kwargs):
bfddbb17 11025 """
5b5c9bc7 11026 __init__(self) -> SizerItem
bfddbb17
RD
11027
11028 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11029 size will need to be set before this item can be used in a Sizer.
11030
11031 You will probably never need to create a wx.SizerItem directly as they
11032 are created automatically when the sizer's Add, Insert or Prepend
11033 methods are called.
11034
11035 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11036 """
5b5c9bc7 11037 newobj = _core_.new_SizerItem(*args, **kwargs)
d55e5bfc
RD
11038 self.this = newobj.this
11039 self.thisown = 1
11040 del newobj.thisown
11041 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11042 """
11043 DeleteWindows(self)
11044
11045 Destroy the window or the windows in a subsizer, depending on the type
11046 of item.
11047 """
5b5c9bc7 11048 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11049
11050 def DetachSizer(*args, **kwargs):
bfddbb17
RD
11051 """
11052 DetachSizer(self)
11053
11054 Enable deleting the SizerItem without destroying the contained sizer.
11055 """
5b5c9bc7 11056 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
11057
11058 def GetSize(*args, **kwargs):
bfddbb17 11059 """
5b5c9bc7 11060 GetSize(self) -> Size
bfddbb17
RD
11061
11062 Get the current size of the item, as set in the last Layout.
11063 """
5b5c9bc7 11064 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
11065
11066 def CalcMin(*args, **kwargs):
bfddbb17 11067 """
5b5c9bc7 11068 CalcMin(self) -> Size
bfddbb17
RD
11069
11070 Calculates the minimum desired size for the item, including any space
11071 needed by borders.
11072 """
5b5c9bc7 11073 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
11074
11075 def SetDimension(*args, **kwargs):
bfddbb17 11076 """
5b5c9bc7 11077 SetDimension(self, Point pos, Size size)
bfddbb17
RD
11078
11079 Set the position and size of the space allocated for this item by the
11080 sizer, and adjust the position and size of the item (window or
11081 subsizer) to be within that space taking alignment and borders into
11082 account.
11083 """
5b5c9bc7 11084 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
11085
11086 def GetMinSize(*args, **kwargs):
bfddbb17 11087 """
5b5c9bc7 11088 GetMinSize(self) -> Size
bfddbb17
RD
11089
11090 Get the minimum size needed for the item.
11091 """
5b5c9bc7 11092 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 11093
a001823c
RD
11094 def GetMinSizeWithBorder(*args, **kwargs):
11095 """
5b5c9bc7 11096 GetMinSizeWithBorder(self) -> Size
a001823c
RD
11097
11098 Get the minimum size needed for the item with space for the borders
11099 added, if needed.
11100 """
5b5c9bc7 11101 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 11102
d55e5bfc
RD
11103 def SetInitSize(*args, **kwargs):
11104 """SetInitSize(self, int x, int y)"""
5b5c9bc7 11105 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
11106
11107 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
11108 """
11109 SetRatioWH(self, int width, int height)
11110
11111 Set the ratio item attribute.
11112 """
5b5c9bc7 11113 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
11114
11115 def SetRatioSize(*args, **kwargs):
bfddbb17 11116 """
5b5c9bc7 11117 SetRatioSize(self, Size size)
bfddbb17
RD
11118
11119 Set the ratio item attribute.
11120 """
5b5c9bc7 11121 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
11122
11123 def SetRatio(*args, **kwargs):
bfddbb17
RD
11124 """
11125 SetRatio(self, float ratio)
11126
11127 Set the ratio item attribute.
11128 """
5b5c9bc7 11129 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
11130
11131 def GetRatio(*args, **kwargs):
bfddbb17
RD
11132 """
11133 GetRatio(self) -> float
11134
11135 Set the ratio item attribute.
11136 """
5b5c9bc7 11137 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 11138
070c48b4
RD
11139 def GetRect(*args, **kwargs):
11140 """
5b5c9bc7 11141 GetRect(self) -> Rect
070c48b4
RD
11142
11143 Returns the rectangle that the sizer item should occupy
11144 """
5b5c9bc7 11145 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 11146
d55e5bfc 11147 def IsWindow(*args, **kwargs):
bfddbb17
RD
11148 """
11149 IsWindow(self) -> bool
11150
11151 Is this sizer item a window?
11152 """
5b5c9bc7 11153 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
11154
11155 def IsSizer(*args, **kwargs):
bfddbb17
RD
11156 """
11157 IsSizer(self) -> bool
11158
11159 Is this sizer item a subsizer?
11160 """
5b5c9bc7 11161 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
11162
11163 def IsSpacer(*args, **kwargs):
bfddbb17
RD
11164 """
11165 IsSpacer(self) -> bool
11166
11167 Is this sizer item a spacer?
11168 """
5b5c9bc7 11169 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
11170
11171 def SetProportion(*args, **kwargs):
bfddbb17
RD
11172 """
11173 SetProportion(self, int proportion)
11174
11175 Set the proportion value for this item.
11176 """
5b5c9bc7 11177 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
11178
11179 def GetProportion(*args, **kwargs):
bfddbb17
RD
11180 """
11181 GetProportion(self) -> int
11182
11183 Get the proportion value for this item.
11184 """
5b5c9bc7 11185 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 11186
bfddbb17
RD
11187 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11188 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 11189 def SetFlag(*args, **kwargs):
bfddbb17
RD
11190 """
11191 SetFlag(self, int flag)
11192
11193 Set the flag value for this item.
11194 """
5b5c9bc7 11195 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
11196
11197 def GetFlag(*args, **kwargs):
bfddbb17
RD
11198 """
11199 GetFlag(self) -> int
11200
11201 Get the flag value for this item.
11202 """
5b5c9bc7 11203 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
11204
11205 def SetBorder(*args, **kwargs):
bfddbb17
RD
11206 """
11207 SetBorder(self, int border)
11208
11209 Set the border value for this item.
11210 """
5b5c9bc7 11211 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
11212
11213 def GetBorder(*args, **kwargs):
bfddbb17
RD
11214 """
11215 GetBorder(self) -> int
11216
11217 Get the border value for this item.
11218 """
5b5c9bc7 11219 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
11220
11221 def GetWindow(*args, **kwargs):
bfddbb17 11222 """
5b5c9bc7 11223 GetWindow(self) -> Window
bfddbb17
RD
11224
11225 Get the window (if any) that is managed by this sizer item.
11226 """
5b5c9bc7 11227 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
11228
11229 def SetWindow(*args, **kwargs):
bfddbb17 11230 """
5b5c9bc7 11231 SetWindow(self, Window window)
bfddbb17
RD
11232
11233 Set the window to be managed by this sizer item.
11234 """
5b5c9bc7 11235 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
11236
11237 def GetSizer(*args, **kwargs):
bfddbb17 11238 """
5b5c9bc7 11239 GetSizer(self) -> Sizer
bfddbb17
RD
11240
11241 Get the subsizer (if any) that is managed by this sizer item.
11242 """
5b5c9bc7 11243 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
11244
11245 def SetSizer(*args, **kwargs):
bfddbb17 11246 """
5b5c9bc7 11247 SetSizer(self, Sizer sizer)
bfddbb17
RD
11248
11249 Set the subsizer to be managed by this sizer item.
11250 """
5b5c9bc7 11251 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
11252
11253 def GetSpacer(*args, **kwargs):
bfddbb17 11254 """
5b5c9bc7 11255 GetSpacer(self) -> Size
bfddbb17
RD
11256
11257 Get the size of the spacer managed by this sizer item.
11258 """
5b5c9bc7 11259 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
11260
11261 def SetSpacer(*args, **kwargs):
bfddbb17 11262 """
5b5c9bc7 11263 SetSpacer(self, Size size)
bfddbb17
RD
11264
11265 Set the size of the spacer to be managed by this sizer item.
11266 """
5b5c9bc7 11267 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
11268
11269 def Show(*args, **kwargs):
bfddbb17
RD
11270 """
11271 Show(self, bool show)
11272
11273 Set the show item attribute, which sizers use to determine if the item
11274 is to be made part of the layout or not. If the item is tracking a
11275 window then it is shown or hidden as needed.
11276 """
5b5c9bc7 11277 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
11278
11279 def IsShown(*args, **kwargs):
bfddbb17
RD
11280 """
11281 IsShown(self) -> bool
11282
11283 Is the item to be shown in the layout?
11284 """
5b5c9bc7 11285 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
11286
11287 def GetPosition(*args, **kwargs):
bfddbb17 11288 """
5b5c9bc7 11289 GetPosition(self) -> Point
bfddbb17
RD
11290
11291 Returns the current position of the item, as set in the last Layout.
11292 """
5b5c9bc7 11293 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
11294
11295 def GetUserData(*args, **kwargs):
bfddbb17
RD
11296 """
11297 GetUserData(self) -> PyObject
11298
11299 Returns the userData associated with this sizer item, or None if there
11300 isn't any.
11301 """
5b5c9bc7 11302 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc
RD
11303
11304
5b5c9bc7 11305class SizerItemPtr(SizerItem):
d55e5bfc
RD
11306 def __init__(self, this):
11307 self.this = this
11308 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11309 self.__class__ = SizerItem
11310_core_.SizerItem_swigregister(SizerItemPtr)
d55e5bfc 11311
bfddbb17 11312def SizerItemWindow(*args, **kwargs):
d55e5bfc 11313 """
5b5c9bc7
RD
11314 SizerItemWindow(Window window, int proportion, int flag, int border,
11315 PyObject userData=None) -> SizerItem
bfddbb17
RD
11316
11317 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 11318 """
5b5c9bc7 11319 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
11320 val.thisown = 1
11321 return val
11322
bfddbb17 11323def SizerItemSpacer(*args, **kwargs):
d55e5bfc 11324 """
bfddbb17 11325 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 11326 PyObject userData=None) -> SizerItem
bfddbb17
RD
11327
11328 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 11329 """
5b5c9bc7 11330 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
11331 val.thisown = 1
11332 return val
11333
11334def SizerItemSizer(*args, **kwargs):
11335 """
5b5c9bc7
RD
11336 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11337 PyObject userData=None) -> SizerItem
bfddbb17
RD
11338
11339 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 11340 """
5b5c9bc7 11341 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
11342 val.thisown = 1
11343 return val
11344
5b5c9bc7 11345class Sizer(Object):
bfddbb17
RD
11346 """
11347 wx.Sizer is the abstract base class used for laying out subwindows in
11348 a window. You cannot use wx.Sizer directly; instead, you will have to
11349 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11350 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11351 and `wx.GridBagSizer`.
11352
11353 The concept implemented by sizers in wxWidgets is closely related to
11354 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11355 toolkit or the Qt toolkit. It is based upon the idea of the individual
11356 subwindows reporting their minimal required size and their ability to
11357 get stretched if the size of the parent window has changed. This will
11358 most often mean that the programmer does not set the original size of
11359 a dialog in the beginning, rather the dialog will assigned a sizer and
11360 this sizer will be queried about the recommended size. The sizer in
11361 turn will query its children, which can be normal windows or contorls,
11362 empty space or other sizers, so that a hierarchy of sizers can be
11363 constructed. Note that wxSizer does not derive from wxWindow and thus
11364 do not interfere with tab ordering and requires very little resources
11365 compared to a real window on screen.
11366
11367 What makes sizers so well fitted for use in wxWidgets is the fact that
11368 every control reports its own minimal size and the algorithm can
11369 handle differences in font sizes or different window (dialog item)
11370 sizes on different platforms without problems. If for example the
11371 standard font as well as the overall design of Mac widgets requires
11372 more space than on Windows, then the initial size of a dialog using a
11373 sizer will automatically be bigger on Mac than on Windows.
11374 """
d55e5bfc
RD
11375 def __init__(self): raise RuntimeError, "No constructor defined"
11376 def __repr__(self):
11377 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11378 def _setOORInfo(*args, **kwargs):
11379 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 11380 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
11381
11382 def Add(*args, **kwargs):
11383 """
bfddbb17 11384 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11385 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11386
11387 Appends a child item to the sizer.
d55e5bfc 11388 """
5b5c9bc7 11389 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
11390
11391 def Insert(*args, **kwargs):
11392 """
bfddbb17 11393 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 11394 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11395
11396 Inserts a new item into the list of items managed by this sizer before
11397 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 11398 """
5b5c9bc7 11399 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
11400
11401 def Prepend(*args, **kwargs):
11402 """
bfddbb17 11403 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11404 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11405
11406 Adds a new item to the begining of the list of sizer items managed by
11407 this sizer. See `Add` for a description of the parameters.
d55e5bfc 11408 """
5b5c9bc7 11409 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
11410
11411 def Remove(*args, **kwargs):
bfddbb17
RD
11412 """
11413 Remove(self, item) -> bool
11414
11415 Removes an item from the sizer and destroys it. This method does not
11416 cause any layout or resizing to take place, call `Layout` to update
11417 the layout on screen after removing a child from the sizer. The
11418 *item* parameter can be either a window, a sizer, or the zero-based
11419 index of an item to remove. Returns True if the child item was found
11420 and removed.
11421 """
5b5c9bc7 11422 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 11423
1a6bba1e 11424 def Detach(*args, **kwargs):
bfddbb17
RD
11425 """
11426 Detach(self, item) -> bool
11427
11428 Detaches an item from the sizer without destroying it. This method
11429 does not cause any layout or resizing to take place, call `Layout` to
11430 do so. The *item* parameter can be either a window, a sizer, or the
11431 zero-based index of the item to be detached. Returns True if the child item
11432 was found and detached.
11433 """
5b5c9bc7 11434 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 11435
070c48b4
RD
11436 def GetItem(*args, **kwargs):
11437 """
11438 GetItem(self, item) -> wx.SizerItem
11439
11440 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11441 parameter can be either a window, a sizer, or the zero-based index of
11442 the item to be detached.
11443 """
5b5c9bc7 11444 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 11445
d55e5bfc 11446 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
11447 """_SetItemMinSize(self, PyObject item, Size size)"""
11448 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 11449
bfddbb17
RD
11450 def SetItemMinSize(self, item, *args):
11451 """
11452 SetItemMinSize(self, item, Size size)
11453
11454 Sets the minimum size that will be allocated for an item in the sizer.
11455 The *item* parameter can be either a window, a sizer, or the
11456 zero-based index of the item. If a window or sizer is given then it
11457 will be searched for recursivly in subsizers if neccessary.
11458 """
11459 if len(args) == 2:
11460 # for backward compatibility accept separate width,height args too
11461 return self._SetItemMinSize(item, args)
11462 else:
11463 return self._SetItemMinSize(item, args[0])
11464
d55e5bfc 11465 def AddItem(*args, **kwargs):
bfddbb17
RD
11466 """
11467 AddItem(self, SizerItem item)
11468
11469 Adds a `wx.SizerItem` to the sizer.
11470 """
5b5c9bc7 11471 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
11472
11473 def InsertItem(*args, **kwargs):
bfddbb17
RD
11474 """
11475 InsertItem(self, int index, SizerItem item)
11476
11477 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11478 """
5b5c9bc7 11479 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
11480
11481 def PrependItem(*args, **kwargs):
bfddbb17
RD
11482 """
11483 PrependItem(self, SizerItem item)
11484
11485 Prepends a `wx.SizerItem` to the sizer.
11486 """
5b5c9bc7 11487 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 11488
bfddbb17 11489 def AddMany(self, items):
d6c14a4c
RD
11490 """
11491 AddMany is a convenience method for adding several items
11492 to a sizer at one time. Simply pass it a list of tuples,
11493 where each tuple consists of the parameters that you
11494 would normally pass to the `Add` method.
11495 """
bfddbb17
RD
11496 for item in items:
11497 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11498 item = (item, )
11499 self.Add(*item)
d55e5bfc
RD
11500
11501 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
11502 def AddWindow(self, *args, **kw):
11503 """Compatibility alias for `Add`."""
11504 return self.Add(*args, **kw)
11505 def AddSizer(self, *args, **kw):
11506 """Compatibility alias for `Add`."""
11507 return self.Add(*args, **kw)
11508 def AddSpacer(self, *args, **kw):
11509 """Compatibility alias for `Add`."""
11510 return self.Add(*args, **kw)
11511
11512 def PrependWindow(self, *args, **kw):
11513 """Compatibility alias for `Prepend`."""
11514 return self.Prepend(*args, **kw)
11515 def PrependSizer(self, *args, **kw):
11516 """Compatibility alias for `Prepend`."""
11517 return self.Prepend(*args, **kw)
11518 def PrependSpacer(self, *args, **kw):
11519 """Compatibility alias for `Prepend`."""
11520 return self.Prepend(*args, **kw)
11521
11522 def InsertWindow(self, *args, **kw):
11523 """Compatibility alias for `Insert`."""
11524 return self.Insert(*args, **kw)
11525 def InsertSizer(self, *args, **kw):
11526 """Compatibility alias for `Insert`."""
11527 return self.Insert(*args, **kw)
11528 def InsertSpacer(self, *args, **kw):
11529 """Compatibility alias for `Insert`."""
11530 return self.Insert(*args, **kw)
11531
11532 def RemoveWindow(self, *args, **kw):
11533 """Compatibility alias for `Remove`."""
11534 return self.Remove(*args, **kw)
11535 def RemoveSizer(self, *args, **kw):
11536 """Compatibility alias for `Remove`."""
11537 return self.Remove(*args, **kw)
11538 def RemovePos(self, *args, **kw):
11539 """Compatibility alias for `Remove`."""
11540 return self.Remove(*args, **kw)
d55e5bfc
RD
11541
11542
d55e5bfc 11543 def SetDimension(*args, **kwargs):
bfddbb17
RD
11544 """
11545 SetDimension(self, int x, int y, int width, int height)
11546
11547 Call this to force the sizer to take the given dimension and thus
11548 force the items owned by the sizer to resize themselves according to
11549 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11550 methods.
11551 """
5b5c9bc7 11552 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
11553
11554 def SetMinSize(*args, **kwargs):
bfddbb17 11555 """
5b5c9bc7 11556 SetMinSize(self, Size size)
bfddbb17
RD
11557
11558 Call this to give the sizer a minimal size. Normally, the sizer will
11559 calculate its minimal size based purely on how much space its children
11560 need. After calling this method `GetMinSize` will return either the
11561 minimal size as requested by its children or the minimal size set
11562 here, depending on which is bigger.
11563 """
5b5c9bc7 11564 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
11565
11566 def GetSize(*args, **kwargs):
bfddbb17 11567 """
5b5c9bc7 11568 GetSize(self) -> Size
bfddbb17
RD
11569
11570 Returns the current size of the space managed by the sizer.
11571 """
5b5c9bc7 11572 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
11573
11574 def GetPosition(*args, **kwargs):
bfddbb17 11575 """
5b5c9bc7 11576 GetPosition(self) -> Point
bfddbb17
RD
11577
11578 Returns the current position of the sizer's managed space.
11579 """
5b5c9bc7 11580 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
11581
11582 def GetMinSize(*args, **kwargs):
bfddbb17 11583 """
5b5c9bc7 11584 GetMinSize(self) -> Size
bfddbb17
RD
11585
11586 Returns the minimal size of the sizer. This is either the combined
11587 minimal size of all the children and their borders or the minimal size
11588 set by SetMinSize, depending on which is bigger.
11589 """
5b5c9bc7 11590 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
11591
11592 def GetSizeTuple(self):
1a6bba1e 11593 return self.GetSize().Get()
d55e5bfc 11594 def GetPositionTuple(self):
1a6bba1e 11595 return self.GetPosition().Get()
d55e5bfc 11596 def GetMinSizeTuple(self):
1a6bba1e 11597 return self.GetMinSize().Get()
d55e5bfc
RD
11598
11599 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
11600 """
11601 RecalcSizes(self)
11602
11603 Using the sizes calculated by `CalcMin` reposition and resize all the
11604 items managed by this sizer. You should not need to call this directly as
11605 it is called by `Layout`.
11606 """
5b5c9bc7 11607 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
11608
11609 def CalcMin(*args, **kwargs):
bfddbb17 11610 """
5b5c9bc7 11611 CalcMin(self) -> Size
bfddbb17
RD
11612
11613 This method is where the sizer will do the actual calculation of its
11614 children's minimal sizes. You should not need to call this directly as
11615 it is called by `Layout`.
11616 """
5b5c9bc7 11617 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
11618
11619 def Layout(*args, **kwargs):
bfddbb17
RD
11620 """
11621 Layout(self)
11622
11623 This method will force the recalculation and layout of the items
11624 controlled by the sizer using the current space allocated to the
11625 sizer. Normally this is called automatically from the owning window's
11626 EVT_SIZE handler, but it is also useful to call it from user code when
11627 one of the items in a sizer change size, or items are added or
11628 removed.
11629 """
5b5c9bc7 11630 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
11631
11632 def Fit(*args, **kwargs):
bfddbb17 11633 """
5b5c9bc7 11634 Fit(self, Window window) -> Size
bfddbb17
RD
11635
11636 Tell the sizer to resize the *window* to match the sizer's minimal
11637 size. This is commonly done in the constructor of the window itself in
11638 order to set its initial size to match the needs of the children as
11639 determined by the sizer. Returns the new size.
11640
11641 For a top level window this is the total window size, not the client size.
11642 """
5b5c9bc7 11643 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
11644
11645 def FitInside(*args, **kwargs):
bfddbb17 11646 """
5b5c9bc7 11647 FitInside(self, Window window)
bfddbb17
RD
11648
11649 Tell the sizer to resize the *virtual size* of the *window* to match the
11650 sizer's minimal size. This will not alter the on screen size of the
11651 window, but may cause the addition/removal/alteration of scrollbars
11652 required to view the virtual area in windows which manage it.
11653
11654 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11655
11656 """
5b5c9bc7 11657 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
11658
11659 def SetSizeHints(*args, **kwargs):
bfddbb17 11660 """
5b5c9bc7 11661 SetSizeHints(self, Window window)
bfddbb17
RD
11662
11663 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11664 match the sizer's minimal size. This is commonly done in the
11665 constructor of the window itself if the window is resizable (as are
11666 many dialogs under Unix and frames on probably all platforms) in order
11667 to prevent the window from being sized smaller than the minimal size
11668 required by the sizer.
11669 """
5b5c9bc7 11670 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
11671
11672 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 11673 """
5b5c9bc7 11674 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
11675
11676 Tell the sizer to set the minimal size of the window virtual area to
11677 match the sizer's minimal size. For windows with managed scrollbars
11678 this will set them appropriately.
11679
11680 :see: `wx.ScrolledWindow.SetScrollbars`
11681
11682 """
5b5c9bc7 11683 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
11684
11685 def Clear(*args, **kwargs):
bfddbb17
RD
11686 """
11687 Clear(self, bool deleteWindows=False)
11688
11689 Clear all items from the sizer, optionally destroying the window items
11690 as well.
11691 """
5b5c9bc7 11692 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
11693
11694 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11695 """
11696 DeleteWindows(self)
11697
11698 Destroy all windows managed by the sizer.
11699 """
5b5c9bc7 11700 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11701
11702 def GetChildren(*args, **kwargs):
bfddbb17 11703 """
51b83b37 11704 GetChildren(self) -> list
bfddbb17
RD
11705
11706 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11707 """
5b5c9bc7 11708 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
11709
11710 def Show(*args, **kwargs):
bfddbb17 11711 """
b411df4a 11712 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 11713
bfddbb17
RD
11714 Shows or hides an item managed by the sizer. To make a sizer item
11715 disappear or reappear, use Show followed by `Layout`. The *item*
11716 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
11717 the item. Use the recursive parameter to show or hide an item in a
11718 subsizer. Returns True if the item was found.
bfddbb17 11719 """
5b5c9bc7 11720 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
11721
11722 def IsShown(*args, **kwargs):
bfddbb17
RD
11723 """
11724 IsShown(self, item)
11725
11726 Determines if the item is currently shown. sizer. To make a sizer
11727 item disappear or reappear, use Show followed by `Layout`. The *item*
11728 parameter can be either a window, a sizer, or the zero-based index of
11729 the item.
11730 """
5b5c9bc7 11731 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 11732
629e65c2 11733 def Hide(self, item, recursive=False):
bfddbb17 11734 """
27fb7603 11735 A convenience method for `Show` (item, False, recursive).
bfddbb17 11736 """
06759a38 11737 return self.Show(item, False, recursive)
bfddbb17 11738
d55e5bfc 11739 def ShowItems(*args, **kwargs):
bfddbb17
RD
11740 """
11741 ShowItems(self, bool show)
11742
84f85550 11743 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 11744 """
5b5c9bc7 11745 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc
RD
11746
11747
5b5c9bc7 11748class SizerPtr(Sizer):
d55e5bfc
RD
11749 def __init__(self, this):
11750 self.this = this
11751 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11752 self.__class__ = Sizer
11753_core_.Sizer_swigregister(SizerPtr)
d55e5bfc 11754
5b5c9bc7 11755class PySizer(Sizer):
bfddbb17
RD
11756 """
11757 wx.PySizer is a special version of `wx.Sizer` that has been
11758 instrumented to allow the C++ virtual methods to be overloaded in
11759 Python derived classes. You would derive from this class if you are
11760 wanting to implement a custom sizer in Python code. Simply implement
11761 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11762 For example::
11763
11764 class MySizer(wx.PySizer):
11765 def __init__(self):
11766 wx.PySizer.__init__(self)
11767
11768 def CalcMin(self):
11769 for item in self.GetChildren():
11770 # calculate the total minimum width and height needed
11771 # by all items in the sizer according to this sizer's
11772 # layout algorithm.
11773 ...
11774 return wx.Size(width, height)
11775
11776 def RecalcSizes(self):
11777 # find the space allotted to this sizer
11778 pos = self.GetPosition()
11779 size = self.GetSize()
11780 for item in self.GetChildren():
11781 # Recalculate (if necessary) the position and size of
11782 # each item and then call item.SetDimension to do the
11783 # actual positioning and sizing of the items within the
11784 # space alloted to this sizer.
11785 ...
11786 item.SetDimension(itemPos, itemSize)
11787
11788
11789 When `Layout` is called it first calls `CalcMin` followed by
11790 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 11791 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
11792
11793 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11794
11795
11796 """
d55e5bfc
RD
11797 def __repr__(self):
11798 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11799 def __init__(self, *args, **kwargs):
bfddbb17 11800 """
5b5c9bc7 11801 __init__(self) -> PySizer
bfddbb17
RD
11802
11803 Creates a wx.PySizer. Must be called from the __init__ in the derived
11804 class.
11805 """
5b5c9bc7 11806 newobj = _core_.new_PySizer(*args, **kwargs)
d55e5bfc
RD
11807 self.this = newobj.this
11808 self.thisown = 1
11809 del newobj.thisown
11810 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11811
11812 def _setCallbackInfo(*args, **kwargs):
11813 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 11814 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
11815
11816
5b5c9bc7 11817class PySizerPtr(PySizer):
d55e5bfc
RD
11818 def __init__(self, this):
11819 self.this = this
11820 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11821 self.__class__ = PySizer
11822_core_.PySizer_swigregister(PySizerPtr)
d55e5bfc
RD
11823
11824#---------------------------------------------------------------------------
11825
5b5c9bc7 11826class BoxSizer(Sizer):
bfddbb17
RD
11827 """
11828 The basic idea behind a box sizer is that windows will most often be
11829 laid out in rather simple basic geometry, typically in a row or a
11830 column or nested hierarchies of either. A wx.BoxSizer will lay out
11831 its items in a simple row or column, depending on the orientation
11832 parameter passed to the constructor.
11833 """
d55e5bfc
RD
11834 def __repr__(self):
11835 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11836 def __init__(self, *args, **kwargs):
bfddbb17 11837 """
5b5c9bc7 11838 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
11839
11840 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11841 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11842 sizer.
11843 """
5b5c9bc7 11844 newobj = _core_.new_BoxSizer(*args, **kwargs)
d55e5bfc
RD
11845 self.this = newobj.this
11846 self.thisown = 1
11847 del newobj.thisown
11848 self._setOORInfo(self)
11849
11850 def GetOrientation(*args, **kwargs):
bfddbb17
RD
11851 """
11852 GetOrientation(self) -> int
11853
11854 Returns the current orientation of the sizer.
11855 """
5b5c9bc7 11856 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
11857
11858 def SetOrientation(*args, **kwargs):
bfddbb17
RD
11859 """
11860 SetOrientation(self, int orient)
d55e5bfc 11861
bfddbb17
RD
11862 Resets the orientation of the sizer.
11863 """
5b5c9bc7 11864 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc
RD
11865
11866
5b5c9bc7 11867class BoxSizerPtr(BoxSizer):
d55e5bfc
RD
11868 def __init__(self, this):
11869 self.this = this
11870 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11871 self.__class__ = BoxSizer
11872_core_.BoxSizer_swigregister(BoxSizerPtr)
d55e5bfc
RD
11873
11874#---------------------------------------------------------------------------
11875
5b5c9bc7 11876class StaticBoxSizer(BoxSizer):
bfddbb17
RD
11877 """
11878 wx.StaticBoxSizer derives from and functions identically to the
11879 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11880 manages. Note that this static box must be created separately and
11881 passed to the sizer constructor.
11882 """
d55e5bfc
RD
11883 def __repr__(self):
11884 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11885 def __init__(self, *args, **kwargs):
bfddbb17 11886 """
5b5c9bc7 11887 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
11888
11889 Constructor. It takes an associated static box and the orientation
11890 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11891 ``wx.HORIZONTAL``.
11892 """
5b5c9bc7 11893 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
d55e5bfc
RD
11894 self.this = newobj.this
11895 self.thisown = 1
11896 del newobj.thisown
11897 self._setOORInfo(self)
11898
11899 def GetStaticBox(*args, **kwargs):
bfddbb17 11900 """
5b5c9bc7 11901 GetStaticBox(self) -> StaticBox
d55e5bfc 11902
bfddbb17
RD
11903 Returns the static box associated with this sizer.
11904 """
5b5c9bc7 11905 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc
RD
11906
11907
5b5c9bc7 11908class StaticBoxSizerPtr(StaticBoxSizer):
d55e5bfc
RD
11909 def __init__(self, this):
11910 self.this = this
11911 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
11912 self.__class__ = StaticBoxSizer
11913_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
d55e5bfc
RD
11914
11915#---------------------------------------------------------------------------
11916
5b5c9bc7 11917class GridSizer(Sizer):
bfddbb17
RD
11918 """
11919 A grid sizer is a sizer which lays out its children in a
11920 two-dimensional table with all cells having the same size. In other
11921 words, the width of each cell within the grid is the width of the
11922 widest item added to the sizer and the height of each grid cell is the
11923 height of the tallest item. An optional vertical and/or horizontal
11924 gap between items can also be specified (in pixels.)
11925
11926 Items are placed in the cells of the grid in the order they are added,
11927 in row-major order. In other words, the first row is filled first,
11928 then the second, and so on until all items have been added. (If
11929 neccessary, additional rows will be added as items are added.) If you
11930 need to have greater control over the cells that items are placed in
11931 then use the `wx.GridBagSizer`.
11932
11933 """
d55e5bfc
RD
11934 def __repr__(self):
11935 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11936 def __init__(self, *args, **kwargs):
bfddbb17 11937 """
5b5c9bc7 11938 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
11939
11940 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11941 of columns and rows in the sizer - if either of the parameters is
11942 zero, it will be calculated to from the total number of children in
11943 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11944 define extra space between all children.
11945 """
5b5c9bc7 11946 newobj = _core_.new_GridSizer(*args, **kwargs)
d55e5bfc
RD
11947 self.this = newobj.this
11948 self.thisown = 1
11949 del newobj.thisown
11950 self._setOORInfo(self)
11951
d55e5bfc 11952 def SetCols(*args, **kwargs):
bfddbb17
RD
11953 """
11954 SetCols(self, int cols)
11955
11956 Sets the number of columns in the sizer.
11957 """
5b5c9bc7 11958 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
11959
11960 def SetRows(*args, **kwargs):
bfddbb17
RD
11961 """
11962 SetRows(self, int rows)
11963
11964 Sets the number of rows in the sizer.
11965 """
5b5c9bc7 11966 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
11967
11968 def SetVGap(*args, **kwargs):
bfddbb17
RD
11969 """
11970 SetVGap(self, int gap)
11971
11972 Sets the vertical gap (in pixels) between the cells in the sizer.
11973 """
5b5c9bc7 11974 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
11975
11976 def SetHGap(*args, **kwargs):
bfddbb17
RD
11977 """
11978 SetHGap(self, int gap)
11979
11980 Sets the horizontal gap (in pixels) between cells in the sizer
11981 """
5b5c9bc7 11982 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
11983
11984 def GetCols(*args, **kwargs):
bfddbb17
RD
11985 """
11986 GetCols(self) -> int
11987
11988 Returns the number of columns in the sizer.
11989 """
5b5c9bc7 11990 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
11991
11992 def GetRows(*args, **kwargs):
bfddbb17
RD
11993 """
11994 GetRows(self) -> int
11995
11996 Returns the number of rows in the sizer.
11997 """
5b5c9bc7 11998 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
11999
12000 def GetVGap(*args, **kwargs):
bfddbb17
RD
12001 """
12002 GetVGap(self) -> int
12003
12004 Returns the vertical gap (in pixels) between the cells in the sizer.
12005 """
5b5c9bc7 12006 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
12007
12008 def GetHGap(*args, **kwargs):
bfddbb17
RD
12009 """
12010 GetHGap(self) -> int
12011
12012 Returns the horizontal gap (in pixels) between cells in the sizer.
12013 """
5b5c9bc7 12014 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc
RD
12015
12016
5b5c9bc7 12017class GridSizerPtr(GridSizer):
d55e5bfc
RD
12018 def __init__(self, this):
12019 self.this = this
12020 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12021 self.__class__ = GridSizer
12022_core_.GridSizer_swigregister(GridSizerPtr)
d55e5bfc
RD
12023
12024#---------------------------------------------------------------------------
12025
5b5c9bc7
RD
12026FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12027FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12028FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12029class FlexGridSizer(GridSizer):
bfddbb17
RD
12030 """
12031 A flex grid sizer is a sizer which lays out its children in a
12032 two-dimensional table with all table cells in one row having the same
12033 height and all cells in one column having the same width, but all
12034 rows or all columns are not necessarily the same height or width as in
12035 the `wx.GridSizer`.
12036
12037 wx.FlexGridSizer can also size items equally in one direction but
12038 unequally ("flexibly") in the other. If the sizer is only flexible
12039 in one direction (this can be changed using `SetFlexibleDirection`), it
12040 needs to be decided how the sizer should grow in the other ("non
12041 flexible") direction in order to fill the available space. The
12042 `SetNonFlexibleGrowMode` method serves this purpose.
12043
12044
12045 """
d55e5bfc
RD
12046 def __repr__(self):
12047 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12048 def __init__(self, *args, **kwargs):
bfddbb17 12049 """
5b5c9bc7 12050 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
12051
12052 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12053 number of columns and rows in the sizer - if either of the parameters
12054 is zero, it will be calculated to from the total number of children in
12055 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12056 define extra space between all children.
12057 """
5b5c9bc7 12058 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
d55e5bfc
RD
12059 self.this = newobj.this
12060 self.thisown = 1
12061 del newobj.thisown
12062 self._setOORInfo(self)
12063
bfddbb17
RD
12064 def AddGrowableRow(*args, **kwargs):
12065 """
12066 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 12067
bfddbb17
RD
12068 Specifies that row *idx* (starting from zero) should be grown if there
12069 is extra space available to the sizer.
d55e5bfc 12070
bfddbb17
RD
12071 The *proportion* parameter has the same meaning as the stretch factor
12072 for the box sizers except that if all proportions are 0, then all
12073 columns are resized equally (instead of not being resized at all).
12074 """
5b5c9bc7 12075 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
12076
12077 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
12078 """
12079 RemoveGrowableRow(self, size_t idx)
12080
12081 Specifies that row *idx* is no longer growable.
12082 """
5b5c9bc7 12083 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
12084
12085 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
12086 """
12087 AddGrowableCol(self, size_t idx, int proportion=0)
12088
12089 Specifies that column *idx* (starting from zero) should be grown if
12090 there is extra space available to the sizer.
12091
12092 The *proportion* parameter has the same meaning as the stretch factor
12093 for the box sizers except that if all proportions are 0, then all
12094 columns are resized equally (instead of not being resized at all).
12095 """
5b5c9bc7 12096 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
12097
12098 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
12099 """
12100 RemoveGrowableCol(self, size_t idx)
12101
12102 Specifies that column *idx* is no longer growable.
12103 """
5b5c9bc7 12104 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
12105
12106 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
12107 """
12108 SetFlexibleDirection(self, int direction)
12109
12110 Specifies whether the sizer should flexibly resize its columns, rows,
12111 or both. Argument *direction* can be one of the following values. Any
12112 other value is ignored.
12113
12114 ============== =======================================
12115 wx.VERTICAL Rows are flexibly sized.
12116 wx.HORIZONTAL Columns are flexibly sized.
12117 wx.BOTH Both rows and columns are flexibly sized
12118 (this is the default value).
12119 ============== =======================================
12120
12121 Note that this method does not trigger relayout.
12122
12123 """
5b5c9bc7 12124 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
12125
12126 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
12127 """
12128 GetFlexibleDirection(self) -> int
12129
12130 Returns a value that specifies whether the sizer
12131 flexibly resizes its columns, rows, or both (default).
12132
12133 :see: `SetFlexibleDirection`
12134 """
5b5c9bc7 12135 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
12136
12137 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
12138 """
12139 SetNonFlexibleGrowMode(self, int mode)
12140
12141 Specifies how the sizer should grow in the non-flexible direction if
12142 there is one (so `SetFlexibleDirection` must have been called
12143 previously). Argument *mode* can be one of the following values:
12144
12145 ========================== =================================================
12146 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12147 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12148 `AddGrowableCol` and `AddGrowableRow`. In this
12149 case equal sizing applies to minimum sizes of
12150 columns or rows (this is the default value).
12151 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12152 the non flexible direction, whether they are
12153 growable or not in the flexbile direction.
12154 ========================== =================================================
12155
12156 Note that this method does not trigger relayout.
12157
12158
12159 """
5b5c9bc7 12160 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
12161
12162 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
12163 """
12164 GetNonFlexibleGrowMode(self) -> int
12165
12166 Returns the value that specifies how the sizer grows in the
12167 non-flexible direction if there is one.
12168
12169 :see: `SetNonFlexibleGrowMode`
12170 """
5b5c9bc7 12171 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
12172
12173 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
12174 """
12175 GetRowHeights(self) -> list
12176
12177 Returns a list of integers representing the heights of each of the
12178 rows in the sizer.
12179 """
5b5c9bc7 12180 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
12181
12182 def GetColWidths(*args, **kwargs):
fd2dc343
RD
12183 """
12184 GetColWidths(self) -> list
12185
12186 Returns a list of integers representing the widths of each of the
12187 columns in the sizer.
12188 """
5b5c9bc7 12189 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc
RD
12190
12191
5b5c9bc7 12192class FlexGridSizerPtr(FlexGridSizer):
d55e5bfc
RD
12193 def __init__(self, this):
12194 self.this = this
12195 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12196 self.__class__ = FlexGridSizer
12197_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
d55e5bfc 12198
5b5c9bc7 12199class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
12200 """
12201 A special sizer that knows how to order and position standard buttons
12202 in order to conform to the current platform's standards. You simply
12203 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12204 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
12205 will take care of the rest.
12206
12207 """
12208 def __repr__(self):
12209 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12210 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
12211 """__init__(self) -> StdDialogButtonSizer"""
12212 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
62d32a5f
RD
12213 self.this = newobj.this
12214 self.thisown = 1
12215 del newobj.thisown
12216 def AddButton(*args, **kwargs):
12217 """
12218 AddButton(self, wxButton button)
12219
12220 Use this to add the buttons to this sizer. Do not use the `Add`
12221 method in the base class.
12222 """
5b5c9bc7 12223 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 12224
53aa7709 12225 def Realize(*args, **kwargs):
62d32a5f 12226 """
53aa7709 12227 Realize(self)
62d32a5f
RD
12228
12229 This funciton needs to be called after all the buttons have been added
12230 to the sizer. It will reorder them and position them in a platform
12231 specifc manner.
12232 """
5b5c9bc7 12233 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12234
12235 def SetAffirmativeButton(*args, **kwargs):
12236 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 12237 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
12238
12239 def SetNegativeButton(*args, **kwargs):
12240 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 12241 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
12242
12243 def SetCancelButton(*args, **kwargs):
12244 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 12245 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
12246
12247 def GetAffirmativeButton(*args, **kwargs):
12248 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 12249 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
12250
12251 def GetApplyButton(*args, **kwargs):
12252 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 12253 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
12254
12255 def GetNegativeButton(*args, **kwargs):
12256 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 12257 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
12258
12259 def GetCancelButton(*args, **kwargs):
12260 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 12261 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
12262
12263 def GetHelpButton(*args, **kwargs):
12264 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 12265 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f
RD
12266
12267
5b5c9bc7 12268class StdDialogButtonSizerPtr(StdDialogButtonSizer):
62d32a5f
RD
12269 def __init__(self, this):
12270 self.this = this
12271 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12272 self.__class__ = StdDialogButtonSizer
12273_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
62d32a5f 12274
d55e5bfc
RD
12275#---------------------------------------------------------------------------
12276
5b5c9bc7 12277class GBPosition(object):
bfddbb17
RD
12278 """
12279 This class represents the position of an item in a virtual grid of
12280 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12281 typemaps that will automatically convert from a 2-element sequence of
12282 integers to a wx.GBPosition, so you can use the more pythonic
12283 representation of the position nearly transparently in Python code.
12284 """
d55e5bfc
RD
12285 def __repr__(self):
12286 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12287 def __init__(self, *args, **kwargs):
bfddbb17 12288 """
5b5c9bc7 12289 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
12290
12291 This class represents the position of an item in a virtual grid of
12292 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12293 typemaps that will automatically convert from a 2-element sequence of
12294 integers to a wx.GBPosition, so you can use the more pythonic
12295 representation of the position nearly transparently in Python code.
12296 """
5b5c9bc7 12297 newobj = _core_.new_GBPosition(*args, **kwargs)
d55e5bfc
RD
12298 self.this = newobj.this
12299 self.thisown = 1
12300 del newobj.thisown
12301 def GetRow(*args, **kwargs):
12302 """GetRow(self) -> int"""
5b5c9bc7 12303 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
12304
12305 def GetCol(*args, **kwargs):
12306 """GetCol(self) -> int"""
5b5c9bc7 12307 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
12308
12309 def SetRow(*args, **kwargs):
12310 """SetRow(self, int row)"""
5b5c9bc7 12311 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
12312
12313 def SetCol(*args, **kwargs):
12314 """SetCol(self, int col)"""
5b5c9bc7 12315 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
12316
12317 def __eq__(*args, **kwargs):
5b5c9bc7
RD
12318 """__eq__(self, GBPosition other) -> bool"""
12319 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
12320
12321 def __ne__(*args, **kwargs):
5b5c9bc7
RD
12322 """__ne__(self, GBPosition other) -> bool"""
12323 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
12324
12325 def Set(*args, **kwargs):
12326 """Set(self, int row=0, int col=0)"""
5b5c9bc7 12327 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
12328
12329 def Get(*args, **kwargs):
12330 """Get(self) -> PyObject"""
5b5c9bc7 12331 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 12332
15817c7e 12333 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12334 def __str__(self): return str(self.Get())
12335 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12336 def __len__(self): return len(self.Get())
12337 def __getitem__(self, index): return self.Get()[index]
12338 def __setitem__(self, index, val):
12339 if index == 0: self.SetRow(val)
12340 elif index == 1: self.SetCol(val)
12341 else: raise IndexError
12342 def __nonzero__(self): return self.Get() != (0,0)
12343 __safe_for_unpickling__ = True
12344 def __reduce__(self): return (wx.GBPosition, self.Get())
12345
12346 row = property(GetRow, SetRow)
12347 col = property(GetCol, SetCol)
12348
12349
5b5c9bc7 12350class GBPositionPtr(GBPosition):
d55e5bfc
RD
12351 def __init__(self, this):
12352 self.this = this
12353 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12354 self.__class__ = GBPosition
12355_core_.GBPosition_swigregister(GBPositionPtr)
d55e5bfc 12356
5b5c9bc7 12357class GBSpan(object):
bfddbb17
RD
12358 """
12359 This class is used to hold the row and column spanning attributes of
12360 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12361 automatically convert from a 2-element sequence of integers to a
12362 wx.GBSpan, so you can use the more pythonic representation of the span
12363 nearly transparently in Python code.
12364
12365 """
d55e5bfc
RD
12366 def __repr__(self):
12367 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12368 def __init__(self, *args, **kwargs):
bfddbb17 12369 """
5b5c9bc7 12370 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
12371
12372 Construct a new wxGBSpan, optionally setting the rowspan and
12373 colspan. The default is (1,1). (Meaning that the item occupies one
12374 cell in each direction.
12375 """
5b5c9bc7 12376 newobj = _core_.new_GBSpan(*args, **kwargs)
d55e5bfc
RD
12377 self.this = newobj.this
12378 self.thisown = 1
12379 del newobj.thisown
12380 def GetRowspan(*args, **kwargs):
12381 """GetRowspan(self) -> int"""
5b5c9bc7 12382 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
12383
12384 def GetColspan(*args, **kwargs):
12385 """GetColspan(self) -> int"""
5b5c9bc7 12386 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
12387
12388 def SetRowspan(*args, **kwargs):
12389 """SetRowspan(self, int rowspan)"""
5b5c9bc7 12390 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
12391
12392 def SetColspan(*args, **kwargs):
12393 """SetColspan(self, int colspan)"""
5b5c9bc7 12394 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
12395
12396 def __eq__(*args, **kwargs):
5b5c9bc7
RD
12397 """__eq__(self, GBSpan other) -> bool"""
12398 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
12399
12400 def __ne__(*args, **kwargs):
5b5c9bc7
RD
12401 """__ne__(self, GBSpan other) -> bool"""
12402 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
12403
12404 def Set(*args, **kwargs):
12405 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 12406 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
12407
12408 def Get(*args, **kwargs):
12409 """Get(self) -> PyObject"""
5b5c9bc7 12410 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 12411
15817c7e 12412 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12413 def __str__(self): return str(self.Get())
12414 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12415 def __len__(self): return len(self.Get())
12416 def __getitem__(self, index): return self.Get()[index]
12417 def __setitem__(self, index, val):
12418 if index == 0: self.SetRowspan(val)
12419 elif index == 1: self.SetColspan(val)
12420 else: raise IndexError
12421 def __nonzero__(self): return self.Get() != (0,0)
12422 __safe_for_unpickling__ = True
12423 def __reduce__(self): return (wx.GBSpan, self.Get())
12424
12425 rowspan = property(GetRowspan, SetRowspan)
12426 colspan = property(GetColspan, SetColspan)
12427
12428
5b5c9bc7 12429class GBSpanPtr(GBSpan):
d55e5bfc
RD
12430 def __init__(self, this):
12431 self.this = this
12432 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12433 self.__class__ = GBSpan
12434_core_.GBSpan_swigregister(GBSpanPtr)
d55e5bfc 12435
5b5c9bc7 12436class GBSizerItem(SizerItem):
bfddbb17
RD
12437 """
12438 The wx.GBSizerItem class is used to track the additional data about
12439 items in a `wx.GridBagSizer` such as the item's position in the grid
12440 and how many rows or columns it spans.
12441
12442 """
d55e5bfc
RD
12443 def __repr__(self):
12444 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12445 def __init__(self, *args, **kwargs):
bfddbb17 12446 """
5b5c9bc7 12447 __init__(self) -> GBSizerItem
bfddbb17
RD
12448
12449 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12450 size will need to be set, as well as a position and span before this
12451 item can be used in a Sizer.
12452
12453 You will probably never need to create a wx.GBSizerItem directly as they
12454 are created automatically when the sizer's Add method is called.
12455 """
5b5c9bc7 12456 newobj = _core_.new_GBSizerItem(*args, **kwargs)
d55e5bfc
RD
12457 self.this = newobj.this
12458 self.thisown = 1
12459 del newobj.thisown
12460 def GetPos(*args, **kwargs):
bfddbb17 12461 """
5b5c9bc7 12462 GetPos(self) -> GBPosition
bfddbb17
RD
12463
12464 Get the grid position of the item
12465 """
5b5c9bc7 12466 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
12467
12468 def GetPosTuple(self): return self.GetPos().Get()
12469 def GetSpan(*args, **kwargs):
bfddbb17 12470 """
5b5c9bc7 12471 GetSpan(self) -> GBSpan
bfddbb17
RD
12472
12473 Get the row and column spanning of the item
12474 """
5b5c9bc7 12475 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
12476
12477 def GetSpanTuple(self): return self.GetSpan().Get()
12478 def SetPos(*args, **kwargs):
bfddbb17 12479 """
5b5c9bc7 12480 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
12481
12482 If the item is already a member of a sizer then first ensure that
12483 there is no other item that would intersect with this one at the new
12484 position, then set the new position. Returns True if the change is
12485 successful and after the next Layout() the item will be moved.
12486 """
5b5c9bc7 12487 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
12488
12489 def SetSpan(*args, **kwargs):
bfddbb17 12490 """
5b5c9bc7 12491 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
12492
12493 If the item is already a member of a sizer then first ensure that
12494 there is no other item that would intersect with this one with its new
12495 spanning size, then set the new spanning. Returns True if the change
12496 is successful and after the next Layout() the item will be resized.
12497
12498 """
5b5c9bc7 12499 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 12500
bfddbb17 12501 def Intersects(*args, **kwargs):
d55e5bfc 12502 """
5b5c9bc7 12503 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
12504
12505 Returns True if this item and the other item instersect.
d55e5bfc 12506 """
5b5c9bc7 12507 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
12508
12509 def IntersectsPos(*args, **kwargs):
12510 """
5b5c9bc7 12511 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
12512
12513 Returns True if the given pos/span would intersect with this item.
12514 """
5b5c9bc7 12515 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12516
12517 def GetEndPos(*args, **kwargs):
bfddbb17 12518 """
5b5c9bc7 12519 GetEndPos(self) -> GBPosition
bfddbb17
RD
12520
12521 Get the row and column of the endpoint of this item.
12522 """
5b5c9bc7 12523 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
12524
12525 def GetGBSizer(*args, **kwargs):
bfddbb17 12526 """
5b5c9bc7 12527 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
12528
12529 Get the sizer this item is a member of.
12530 """
5b5c9bc7 12531 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
12532
12533 def SetGBSizer(*args, **kwargs):
bfddbb17 12534 """
5b5c9bc7 12535 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
12536
12537 Set the sizer this item is a member of.
12538 """
5b5c9bc7 12539 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc
RD
12540
12541
5b5c9bc7 12542class GBSizerItemPtr(GBSizerItem):
d55e5bfc
RD
12543 def __init__(self, this):
12544 self.this = this
12545 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12546 self.__class__ = GBSizerItem
12547_core_.GBSizerItem_swigregister(GBSizerItemPtr)
12548DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
12549
12550def GBSizerItemWindow(*args, **kwargs):
12551 """
5b5c9bc7
RD
12552 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12553 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12554
12555 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 12556 """
5b5c9bc7 12557 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12558 val.thisown = 1
12559 return val
12560
12561def GBSizerItemSizer(*args, **kwargs):
12562 """
5b5c9bc7
RD
12563 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12564 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12565
12566 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 12567 """
5b5c9bc7 12568 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12569 val.thisown = 1
12570 return val
12571
12572def GBSizerItemSpacer(*args, **kwargs):
12573 """
5b5c9bc7
RD
12574 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12575 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12576
12577 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 12578 """
5b5c9bc7 12579 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12580 val.thisown = 1
12581 return val
12582
5b5c9bc7 12583class GridBagSizer(FlexGridSizer):
bfddbb17
RD
12584 """
12585 A `wx.Sizer` that can lay out items in a virtual grid like a
12586 `wx.FlexGridSizer` but in this case explicit positioning of the items
12587 is allowed using `wx.GBPosition`, and items can optionally span more
12588 than one row and/or column using `wx.GBSpan`. The total size of the
12589 virtual grid is determined by the largest row and column that items are
12590 positioned at, adjusted for spanning.
12591
12592 """
d55e5bfc
RD
12593 def __repr__(self):
12594 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12595 def __init__(self, *args, **kwargs):
bfddbb17 12596 """
5b5c9bc7 12597 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
12598
12599 Constructor, with optional parameters to specify the gap between the
12600 rows and columns.
12601 """
5b5c9bc7 12602 newobj = _core_.new_GridBagSizer(*args, **kwargs)
d55e5bfc
RD
12603 self.this = newobj.this
12604 self.thisown = 1
12605 del newobj.thisown
03e46024
RD
12606 self._setOORInfo(self)
12607
d55e5bfc
RD
12608 def Add(*args, **kwargs):
12609 """
bfddbb17 12610 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 12611 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
12612
12613 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12614 more than one row or column as specified with *span*. The remaining
12615 args behave similarly to `wx.Sizer.Add`.
12616
12617 Returns True if the item was successfully placed at the given cell
12618 position, False if something was already there.
12619
d55e5bfc 12620 """
5b5c9bc7 12621 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
12622
12623 def AddItem(*args, **kwargs):
bfddbb17 12624 """
070c48b4 12625 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
12626
12627 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12628 the item was successfully placed at its given cell position, False if
12629 something was already there.
12630 """
5b5c9bc7 12631 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 12632
84f85550
RD
12633 def GetCellSize(*args, **kwargs):
12634 """
5b5c9bc7 12635 GetCellSize(self, int row, int col) -> Size
84f85550
RD
12636
12637 Get the size of the specified cell, including hgap and
12638 vgap. Only valid after a Layout.
12639 """
5b5c9bc7 12640 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 12641
d55e5bfc 12642 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 12643 """
5b5c9bc7 12644 GetEmptyCellSize(self) -> Size
bfddbb17
RD
12645
12646 Get the size used for cells in the grid with no item.
12647 """
5b5c9bc7 12648 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12649
12650 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 12651 """
5b5c9bc7 12652 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
12653
12654 Set the size used for cells in the grid with no item.
12655 """
5b5c9bc7 12656 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12657
12658 def GetItemPosition(*args):
12659 """
bfddbb17
RD
12660 GetItemPosition(self, item) -> GBPosition
12661
12662 Get the grid position of the specified *item* where *item* is either a
12663 window or subsizer that is a member of this sizer, or a zero-based
12664 index of an item.
d55e5bfc 12665 """
5b5c9bc7 12666 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
12667
12668 def SetItemPosition(*args):
12669 """
bfddbb17
RD
12670 SetItemPosition(self, item, GBPosition pos) -> bool
12671
12672 Set the grid position of the specified *item* where *item* is either a
12673 window or subsizer that is a member of this sizer, or a zero-based
12674 index of an item. Returns True on success. If the move is not
12675 allowed (because an item is already there) then False is returned.
12676
d55e5bfc 12677 """
5b5c9bc7 12678 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
12679
12680 def GetItemSpan(*args):
12681 """
bfddbb17
RD
12682 GetItemSpan(self, item) -> GBSpan
12683
12684 Get the row/col spanning of the specified *item* where *item* is
12685 either a window or subsizer that is a member of this sizer, or a
12686 zero-based index of an item.
d55e5bfc 12687 """
5b5c9bc7 12688 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
12689
12690 def SetItemSpan(*args):
12691 """
bfddbb17
RD
12692 SetItemSpan(self, item, GBSpan span) -> bool
12693
12694 Set the row/col spanning of the specified *item* where *item* is
12695 either a window or subsizer that is a member of this sizer, or a
12696 zero-based index of an item. Returns True on success. If the move is
12697 not allowed (because an item is already there) then False is returned.
d55e5bfc 12698 """
5b5c9bc7 12699 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
12700
12701 def FindItem(*args):
12702 """
bfddbb17
RD
12703 FindItem(self, item) -> GBSizerItem
12704
12705 Find the sizer item for the given window or subsizer, returns None if
12706 not found. (non-recursive)
d55e5bfc 12707 """
5b5c9bc7 12708 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
12709
12710 def FindItemAtPosition(*args, **kwargs):
bfddbb17 12711 """
5b5c9bc7 12712 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
12713
12714 Return the sizer item for the given grid cell, or None if there is no
12715 item at that position. (non-recursive)
12716 """
5b5c9bc7 12717 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
12718
12719 def FindItemAtPoint(*args, **kwargs):
bfddbb17 12720 """
5b5c9bc7 12721 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
12722
12723 Return the sizer item located at the point given in *pt*, or None if
12724 there is no item at that point. The (x,y) coordinates in pt correspond
12725 to the client coordinates of the window using the sizer for
12726 layout. (non-recursive)
12727 """
5b5c9bc7 12728 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 12729
bfddbb17
RD
12730 def CheckForIntersection(*args, **kwargs):
12731 """
5b5c9bc7 12732 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 12733
bfddbb17
RD
12734 Look at all items and see if any intersect (or would overlap) the
12735 given *item*. Returns True if so, False if there would be no overlap.
12736 If an *excludeItem* is given then it will not be checked for
12737 intersection, for example it may be the item we are checking the
12738 position of.
d55e5bfc 12739
bfddbb17 12740 """
5b5c9bc7 12741 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 12742
bfddbb17 12743 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 12744 """
5b5c9bc7 12745 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
12746
12747 Look at all items and see if any intersect (or would overlap) the
12748 given position and span. Returns True if so, False if there would be
12749 no overlap. If an *excludeItem* is given then it will not be checked
12750 for intersection, for example it may be the item we are checking the
12751 position of.
d55e5bfc 12752 """
5b5c9bc7 12753 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc
RD
12754
12755
5b5c9bc7 12756class GridBagSizerPtr(GridBagSizer):
d55e5bfc
RD
12757 def __init__(self, this):
12758 self.this = this
12759 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12760 self.__class__ = GridBagSizer
12761_core_.GridBagSizer_swigregister(GridBagSizerPtr)
d55e5bfc
RD
12762
12763#---------------------------------------------------------------------------
12764
5b5c9bc7
RD
12765Left = _core_.Left
12766Top = _core_.Top
12767Right = _core_.Right
12768Bottom = _core_.Bottom
12769Width = _core_.Width
12770Height = _core_.Height
12771Centre = _core_.Centre
12772Center = _core_.Center
12773CentreX = _core_.CentreX
12774CentreY = _core_.CentreY
12775Unconstrained = _core_.Unconstrained
12776AsIs = _core_.AsIs
12777PercentOf = _core_.PercentOf
12778Above = _core_.Above
12779Below = _core_.Below
12780LeftOf = _core_.LeftOf
12781RightOf = _core_.RightOf
12782SameAs = _core_.SameAs
12783Absolute = _core_.Absolute
12784class IndividualLayoutConstraint(Object):
d55e5bfc 12785 """
15817c7e
RD
12786 Objects of this class are stored in the `wx.LayoutConstraints` class as
12787 one of eight possible constraints that a window can be involved in.
12788 You will never need to create an instance of
12789 wx.IndividualLayoutConstraint, rather you should create a
12790 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 12791 that it contains.
d55e5bfc
RD
12792 """
12793 def __init__(self): raise RuntimeError, "No constructor defined"
12794 def __repr__(self):
12795 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12796 def Set(*args, **kwargs):
15817c7e 12797 """
5b5c9bc7 12798 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
12799
12800 Sets the properties of the constraint. Normally called by one of the
12801 convenience functions such as Above, RightOf, SameAs.
12802 """
5b5c9bc7 12803 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
12804
12805 def LeftOf(*args, **kwargs):
12806 """
5b5c9bc7 12807 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 12808
15817c7e
RD
12809 Constrains this edge to be to the left of the given window, with an
12810 optional margin. Implicitly, this is relative to the left edge of the
12811 other window.
d55e5bfc 12812 """
5b5c9bc7 12813 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
12814
12815 def RightOf(*args, **kwargs):
12816 """
5b5c9bc7 12817 RightOf(self, Window sibling, int marg=0)
d55e5bfc 12818
15817c7e
RD
12819 Constrains this edge to be to the right of the given window, with an
12820 optional margin. Implicitly, this is relative to the right edge of the
12821 other window.
d55e5bfc 12822 """
5b5c9bc7 12823 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
12824
12825 def Above(*args, **kwargs):
12826 """
5b5c9bc7 12827 Above(self, Window sibling, int marg=0)
d55e5bfc 12828
15817c7e
RD
12829 Constrains this edge to be above the given window, with an optional
12830 margin. Implicitly, this is relative to the top edge of the other
12831 window.
d55e5bfc 12832 """
5b5c9bc7 12833 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
12834
12835 def Below(*args, **kwargs):
12836 """
5b5c9bc7 12837 Below(self, Window sibling, int marg=0)
d55e5bfc 12838
15817c7e
RD
12839 Constrains this edge to be below the given window, with an optional
12840 margin. Implicitly, this is relative to the bottom edge of the other
12841 window.
d55e5bfc 12842 """
5b5c9bc7 12843 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
12844
12845 def SameAs(*args, **kwargs):
12846 """
5b5c9bc7 12847 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 12848
15817c7e
RD
12849 Constrains this edge or dimension to be to the same as the edge of the
12850 given window, with an optional margin.
d55e5bfc 12851 """
5b5c9bc7 12852 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
12853
12854 def PercentOf(*args, **kwargs):
12855 """
5b5c9bc7 12856 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 12857
15817c7e
RD
12858 Constrains this edge or dimension to be to a percentage of the given
12859 window, with an optional margin.
d55e5bfc 12860 """
5b5c9bc7 12861 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
12862
12863 def Absolute(*args, **kwargs):
12864 """
12865 Absolute(self, int val)
12866
15817c7e 12867 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 12868 """
5b5c9bc7 12869 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
12870
12871 def Unconstrained(*args, **kwargs):
12872 """
12873 Unconstrained(self)
12874
15817c7e
RD
12875 Sets this edge or dimension to be unconstrained, that is, dependent on
12876 other edges and dimensions from which this value can be deduced.
d55e5bfc 12877 """
5b5c9bc7 12878 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
12879
12880 def AsIs(*args, **kwargs):
12881 """
12882 AsIs(self)
12883
15817c7e
RD
12884 Sets this edge or constraint to be whatever the window's value is at
12885 the moment. If either of the width and height constraints are *as is*,
12886 the window will not be resized, but moved instead. This is important
12887 when considering panel items which are intended to have a default
12888 size, such as a button, which may take its size from the size of the
12889 button label.
d55e5bfc 12890 """
5b5c9bc7 12891 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
12892
12893 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
12894 """GetOtherWindow(self) -> Window"""
12895 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
12896
12897 def GetMyEdge(*args, **kwargs):
12898 """GetMyEdge(self) -> int"""
5b5c9bc7 12899 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
12900
12901 def SetEdge(*args, **kwargs):
12902 """SetEdge(self, int which)"""
5b5c9bc7 12903 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
12904
12905 def SetValue(*args, **kwargs):
12906 """SetValue(self, int v)"""
5b5c9bc7 12907 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
12908
12909 def GetMargin(*args, **kwargs):
12910 """GetMargin(self) -> int"""
5b5c9bc7 12911 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
12912
12913 def SetMargin(*args, **kwargs):
12914 """SetMargin(self, int m)"""
5b5c9bc7 12915 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
12916
12917 def GetValue(*args, **kwargs):
12918 """GetValue(self) -> int"""
5b5c9bc7 12919 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
12920
12921 def GetPercent(*args, **kwargs):
12922 """GetPercent(self) -> int"""
5b5c9bc7 12923 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
12924
12925 def GetOtherEdge(*args, **kwargs):
12926 """GetOtherEdge(self) -> int"""
5b5c9bc7 12927 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
12928
12929 def GetDone(*args, **kwargs):
12930 """GetDone(self) -> bool"""
5b5c9bc7 12931 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
12932
12933 def SetDone(*args, **kwargs):
12934 """SetDone(self, bool d)"""
5b5c9bc7 12935 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
12936
12937 def GetRelationship(*args, **kwargs):
12938 """GetRelationship(self) -> int"""
5b5c9bc7 12939 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
12940
12941 def SetRelationship(*args, **kwargs):
12942 """SetRelationship(self, int r)"""
5b5c9bc7 12943 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
12944
12945 def ResetIfWin(*args, **kwargs):
12946 """
5b5c9bc7 12947 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
12948
12949 Reset constraint if it mentions otherWin
12950 """
5b5c9bc7 12951 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
12952
12953 def SatisfyConstraint(*args, **kwargs):
12954 """
5b5c9bc7 12955 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
12956
12957 Try to satisfy constraint
12958 """
5b5c9bc7 12959 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
12960
12961 def GetEdge(*args, **kwargs):
12962 """
5b5c9bc7 12963 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
12964
12965 Get the value of this edge or dimension, or if this
12966 is not determinable, -1.
12967 """
5b5c9bc7 12968 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc
RD
12969
12970
5b5c9bc7 12971class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
d55e5bfc
RD
12972 def __init__(self, this):
12973 self.this = this
12974 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
12975 self.__class__ = IndividualLayoutConstraint
12976_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
d55e5bfc 12977
5b5c9bc7 12978class LayoutConstraints(Object):
d55e5bfc 12979 """
15817c7e
RD
12980 **Note:** constraints are now deprecated and you should use sizers
12981 instead.
d55e5bfc 12982
15817c7e
RD
12983 Objects of this class can be associated with a window to define its
12984 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
12985
12986 The class consists of the following eight constraints of class
12987 wx.IndividualLayoutConstraint, some or all of which should be accessed
12988 directly to set the appropriate constraints.
12989
12990 * left: represents the left hand edge of the window
12991 * right: represents the right hand edge of the window
12992 * top: represents the top edge of the window
12993 * bottom: represents the bottom edge of the window
12994 * width: represents the width of the window
12995 * height: represents the height of the window
12996 * centreX: represents the horizontal centre point of the window
12997 * centreY: represents the vertical centre point of the window
12998
15817c7e
RD
12999 Most constraints are initially set to have the relationship
13000 wxUnconstrained, which means that their values should be calculated by
13001 looking at known constraints. The exceptions are width and height,
13002 which are set to wxAsIs to ensure that if the user does not specify a
13003 constraint, the existing width and height will be used, to be
13004 compatible with panel items which often have take a default size. If
13005 the constraint is ``wx.AsIs``, the dimension will not be changed.
13006
13007 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
13008
13009 """
13010 def __repr__(self):
13011 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5b5c9bc7
RD
13012 left = property(_core_.LayoutConstraints_left_get)
13013 top = property(_core_.LayoutConstraints_top_get)
13014 right = property(_core_.LayoutConstraints_right_get)
13015 bottom = property(_core_.LayoutConstraints_bottom_get)
13016 width = property(_core_.LayoutConstraints_width_get)
13017 height = property(_core_.LayoutConstraints_height_get)
13018 centreX = property(_core_.LayoutConstraints_centreX_get)
13019 centreY = property(_core_.LayoutConstraints_centreY_get)
d55e5bfc 13020 def __init__(self, *args, **kwargs):
5b5c9bc7
RD
13021 """__init__(self) -> LayoutConstraints"""
13022 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
d55e5bfc
RD
13023 self.this = newobj.this
13024 self.thisown = 1
13025 del newobj.thisown
13026 def SatisfyConstraints(*args, **kwargs):
13027 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 13028 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
13029
13030 def AreSatisfied(*args, **kwargs):
13031 """AreSatisfied(self) -> bool"""
5b5c9bc7 13032 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc
RD
13033
13034
5b5c9bc7 13035class LayoutConstraintsPtr(LayoutConstraints):
d55e5bfc
RD
13036 def __init__(self, this):
13037 self.this = this
13038 if not hasattr(self,"thisown"): self.thisown = 0
5b5c9bc7
RD
13039 self.__class__ = LayoutConstraints
13040_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
d55e5bfc
RD
13041
13042#----------------------------------------------------------------------------
13043
13044# Use Python's bool constants if available, make some if not
13045try:
13046 True
13047except NameError:
13048 __builtins__.True = 1==1
13049 __builtins__.False = 1==0
13050 def bool(value): return not not value
13051 __builtins__.bool = bool
13052
13053
13054
13055# workarounds for bad wxRTTI names
13056__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13057__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13058__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13059
13060
13061#----------------------------------------------------------------------------
13062# Load version numbers from __version__... Ensure that major and minor
0f63ec68 13063# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
13064
13065from __version__ import *
13066__version__ = VERSION_STRING
13067
0f63ec68
RD
13068assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13069assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
13070if RELEASE_VERSION != _core_.RELEASE_VERSION:
13071 import warnings
0f63ec68 13072 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
13073
13074#----------------------------------------------------------------------------
13075
7993762b
RD
13076# Set wxPython's default string<-->unicode conversion encoding from
13077# the locale, but only if Python's default hasn't been changed. (We
13078# assume that if the user has customized it already then that is the
13079# encoding we need to use as well.)
13080#
13081# The encoding selected here is used when string or unicode objects
13082# need to be converted in order to pass them to wxWidgets. Please be
13083# aware that the default encoding within the same locale may be
13084# slightly different on different platforms. For example, please see
62d32a5f
RD
13085# http://www.alanwood.net/demos/charsetdiffs.html for differences
13086# between the common latin/roman encodings.
3837a853
RD
13087
13088default = _sys.getdefaultencoding()
13089if default == 'ascii':
13090 import locale
13091 import codecs
13092 try:
13093 default = locale.getdefaultlocale()[1]
13094 codecs.lookup(default)
7993762b 13095 except (ValueError, LookupError, TypeError):
3837a853
RD
13096 default = _sys.getdefaultencoding()
13097 del locale
13098 del codecs
5cbf236d
RD
13099if default:
13100 wx.SetDefaultPyEncoding(default)
13101del default
5cbf236d
RD
13102
13103#----------------------------------------------------------------------------
13104
d55e5bfc
RD
13105class PyDeadObjectError(AttributeError):
13106 pass
13107
13108class _wxPyDeadObject(object):
13109 """
13110 Instances of wx objects that are OOR capable will have their __class__
13111 changed to this class when the C++ object is deleted. This should help
13112 prevent crashes due to referencing a bogus C++ pointer.
13113 """
13114 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13115 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13116
13117 def __repr__(self):
13118 if not hasattr(self, "_name"):
13119 self._name = "[unknown]"
13120 return self.reprStr % self._name
13121
13122 def __getattr__(self, *args):
13123 if not hasattr(self, "_name"):
13124 self._name = "[unknown]"
13125 raise PyDeadObjectError(self.attrStr % self._name)
13126
13127 def __nonzero__(self):
13128 return 0
13129
13130
13131
13132class PyUnbornObjectError(AttributeError):
13133 pass
13134
13135class _wxPyUnbornObject(object):
13136 """
13137 Some stock objects are created when the wx._core module is
13138 imported, but their C++ instance is not created until the wx.App
13139 object is created and initialized. These object instances will
13140 temporarily have their __class__ changed to this class so an
13141 exception will be raised if they are used before the C++ instance
13142 is ready.
13143 """
13144
13145 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13146 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13147
13148 def __repr__(self):
13149 #if not hasattr(self, "_name"):
13150 # self._name = "[unknown]"
13151 return self.reprStr #% self._name
13152
13153 def __getattr__(self, *args):
13154 #if not hasattr(self, "_name"):
13155 # self._name = "[unknown]"
13156 raise PyUnbornObjectError(self.attrStr) # % self._name )
13157
13158 def __nonzero__(self):
13159 return 0
13160
13161
13162#----------------------------------------------------------------------------
d55e5bfc
RD
13163
13164def CallAfter(callable, *args, **kw):
13165 """
13166 Call the specified function after the current and pending event
13167 handlers have been completed. This is also good for making GUI
0439c23b
RD
13168 method calls from non-GUI threads. Any extra positional or
13169 keyword args are passed on to the callable when it is called.
13170
13171 :see: `wx.FutureCall`
d55e5bfc
RD
13172 """
13173 app = wx.GetApp()
a001823c 13174 assert app is not None, 'No wx.App created yet'
d55e5bfc 13175
891bb194
RD
13176 if not hasattr(app, "_CallAfterId"):
13177 app._CallAfterId = wx.NewEventType()
13178 app.Connect(-1, -1, app._CallAfterId,
13179 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 13180 evt = wx.PyEvent()
891bb194 13181 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
13182 evt.callable = callable
13183 evt.args = args
13184 evt.kw = kw
13185 wx.PostEvent(app, evt)
13186
d55e5bfc
RD
13187#----------------------------------------------------------------------------
13188
13189
13190class FutureCall:
13191 """
6e0de3df 13192 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
13193 object once after the given amount of milliseconds, passing any
13194 positional or keyword args. The return value of the callable is
0439c23b 13195 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
13196
13197 If you don't need to get the return value or restart the timer
13198 then there is no need to hold a reference to this object. It will
13199 hold a reference to itself while the timer is running (the timer
13200 has a reference to self.Notify) but the cycle will be broken when
13201 the timer completes, automatically cleaning up the wx.FutureCall
13202 object.
0439c23b
RD
13203
13204 :see: `wx.CallAfter`
d55e5bfc
RD
13205 """
13206 def __init__(self, millis, callable, *args, **kwargs):
13207 self.millis = millis
13208 self.callable = callable
13209 self.SetArgs(*args, **kwargs)
13210 self.runCount = 0
13211 self.running = False
13212 self.hasRun = False
13213 self.result = None
13214 self.timer = None
13215 self.Start()
13216
13217 def __del__(self):
13218 self.Stop()
13219
13220
13221 def Start(self, millis=None, *args, **kwargs):
13222 """
13223 (Re)start the timer
13224 """
13225 self.hasRun = False
13226 if millis is not None:
13227 self.millis = millis
13228 if args or kwargs:
13229 self.SetArgs(*args, **kwargs)
13230 self.Stop()
13231 self.timer = wx.PyTimer(self.Notify)
13232 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13233 self.running = True
13234 Restart = Start
13235
13236
13237 def Stop(self):
13238 """
13239 Stop and destroy the timer.
13240 """
13241 if self.timer is not None:
13242 self.timer.Stop()
13243 self.timer = None
13244
13245
13246 def GetInterval(self):
13247 if self.timer is not None:
13248 return self.timer.GetInterval()
13249 else:
13250 return 0
13251
13252
13253 def IsRunning(self):
13254 return self.timer is not None and self.timer.IsRunning()
13255
13256
13257 def SetArgs(self, *args, **kwargs):
13258 """
13259 (Re)set the args passed to the callable object. This is
13260 useful in conjunction with Restart if you want to schedule a
13261 new call to the same callable object but with different
13262 parameters.
13263 """
13264 self.args = args
13265 self.kwargs = kwargs
13266
13267
13268 def HasRun(self):
13269 return self.hasRun
13270
13271 def GetResult(self):
13272 return self.result
13273
13274 def Notify(self):
13275 """
13276 The timer has expired so call the callable.
13277 """
13278 if self.callable and getattr(self.callable, 'im_self', True):
13279 self.runCount += 1
13280 self.running = False
13281 self.result = self.callable(*self.args, **self.kwargs)
13282 self.hasRun = True
13283 if not self.running:
13284 # if it wasn't restarted, then cleanup
13285 wx.CallAfter(self.Stop)
13286
13287
13288
13289#----------------------------------------------------------------------------
13290# Control which items in this module should be documented by epydoc.
13291# We allow only classes and functions, which will help reduce the size
13292# of the docs by filtering out the zillions of constants, EVT objects,
13293# and etc that don't make much sense by themselves, but are instead
13294# documented (or will be) as part of the classes/functions/methods
13295# where they should be used.
13296
d6c14a4c
RD
13297class __DocFilter:
13298 """
13299 A filter for epydoc that only allows non-Ptr classes and
13300 fucntions, in order to reduce the clutter in the API docs.
13301 """
13302 def __init__(self, globals):
13303 self._globals = globals
13304
13305 def __call__(self, name):
13306 import types
13307 obj = self._globals.get(name, None)
13308 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13309 return False
13310 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
13311 return False
13312 return True
d55e5bfc
RD
13313
13314#----------------------------------------------------------------------------
13315#----------------------------------------------------------------------------
13316
13317# Import other modules in this package that should show up in the
13318# "core" wx namespace
13319from _gdi import *
13320from _windows import *
13321from _controls import *
13322from _misc import *
13323
13324
13325# Fixup the stock objects since they can't be used yet. (They will be
13326# restored in wx.PyApp.OnInit.)
13327_core_._wxPyFixStockObjects()
13328
13329#----------------------------------------------------------------------------
13330#----------------------------------------------------------------------------
13331
13332