]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/msw/_core.py
reSWIGged
[wxWidgets.git] / wxPython / src / msw / _core.py
CommitLineData
d55e5bfc
RD
1# This file was created automatically by SWIG.
2# Don't modify this file, modify the SWIG interface instead.
3
4import _core_
5
093d3ff1
RD
6def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name) or (name == "thisown"):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
24 method = class_type.__swig_getmethods__.get(name,None)
25 if method: return method(self)
26 raise AttributeError,name
27
28import types
29try:
30 _object = types.ObjectType
31 _newclass = 1
32except AttributeError:
33 class _object : pass
34 _newclass = 0
35del types
36
37
38def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
d55e5bfc
RD
47#// Give a reference to the dictionary of this module to the C++ extension
48#// code.
49_core_._wxPySetDictionary(vars())
50
51#// A little trick to make 'wx' be a reference to this module so wx.Names can
52#// be used here.
53import sys as _sys
54wx = _sys.modules[__name__]
55
c24da6d6
RD
56
57#----------------------------------------------------------------------------
58
59def _deprecated(callable, msg=None):
60 """
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
63 """
64 if msg is None:
65 msg = "%s is deprecated" % callable
66 def deprecatedWrapper(*args, **kwargs):
67 import warnings
68 warnings.warn(msg, DeprecationWarning, stacklevel=2)
69 return callable(*args, **kwargs)
70 deprecatedWrapper.__doc__ = msg
71 return deprecatedWrapper
72
73
74#----------------------------------------------------------------------------
75
d55e5bfc
RD
76NOT_FOUND = _core_.NOT_FOUND
77VSCROLL = _core_.VSCROLL
78HSCROLL = _core_.HSCROLL
79CAPTION = _core_.CAPTION
80DOUBLE_BORDER = _core_.DOUBLE_BORDER
81SUNKEN_BORDER = _core_.SUNKEN_BORDER
82RAISED_BORDER = _core_.RAISED_BORDER
83BORDER = _core_.BORDER
84SIMPLE_BORDER = _core_.SIMPLE_BORDER
85STATIC_BORDER = _core_.STATIC_BORDER
86TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
87NO_BORDER = _core_.NO_BORDER
88TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
89WANTS_CHARS = _core_.WANTS_CHARS
90POPUP_WINDOW = _core_.POPUP_WINDOW
91CENTER_FRAME = _core_.CENTER_FRAME
92CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
93CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
d55e5bfc
RD
94CLIP_CHILDREN = _core_.CLIP_CHILDREN
95CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
96ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
97RETAINED = _core_.RETAINED
98BACKINGSTORE = _core_.BACKINGSTORE
99COLOURED = _core_.COLOURED
100FIXED_LENGTH = _core_.FIXED_LENGTH
101LB_NEEDED_SB = _core_.LB_NEEDED_SB
102LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
103LB_SORT = _core_.LB_SORT
104LB_SINGLE = _core_.LB_SINGLE
105LB_MULTIPLE = _core_.LB_MULTIPLE
106LB_EXTENDED = _core_.LB_EXTENDED
107LB_OWNERDRAW = _core_.LB_OWNERDRAW
108LB_HSCROLL = _core_.LB_HSCROLL
109PROCESS_ENTER = _core_.PROCESS_ENTER
110PASSWORD = _core_.PASSWORD
111CB_SIMPLE = _core_.CB_SIMPLE
112CB_DROPDOWN = _core_.CB_DROPDOWN
113CB_SORT = _core_.CB_SORT
114CB_READONLY = _core_.CB_READONLY
115RA_HORIZONTAL = _core_.RA_HORIZONTAL
116RA_VERTICAL = _core_.RA_VERTICAL
117RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
118RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 119RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
d55e5bfc
RD
120RB_GROUP = _core_.RB_GROUP
121RB_SINGLE = _core_.RB_SINGLE
d55e5bfc
RD
122SB_HORIZONTAL = _core_.SB_HORIZONTAL
123SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 124RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
d55e5bfc
RD
125ST_SIZEGRIP = _core_.ST_SIZEGRIP
126ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
127FLOOD_SURFACE = _core_.FLOOD_SURFACE
128FLOOD_BORDER = _core_.FLOOD_BORDER
129ODDEVEN_RULE = _core_.ODDEVEN_RULE
130WINDING_RULE = _core_.WINDING_RULE
131TOOL_TOP = _core_.TOOL_TOP
132TOOL_BOTTOM = _core_.TOOL_BOTTOM
133TOOL_LEFT = _core_.TOOL_LEFT
134TOOL_RIGHT = _core_.TOOL_RIGHT
135OK = _core_.OK
136YES_NO = _core_.YES_NO
137CANCEL = _core_.CANCEL
138YES = _core_.YES
139NO = _core_.NO
140NO_DEFAULT = _core_.NO_DEFAULT
141YES_DEFAULT = _core_.YES_DEFAULT
142ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
143ICON_HAND = _core_.ICON_HAND
144ICON_QUESTION = _core_.ICON_QUESTION
145ICON_INFORMATION = _core_.ICON_INFORMATION
146ICON_STOP = _core_.ICON_STOP
147ICON_ASTERISK = _core_.ICON_ASTERISK
148ICON_MASK = _core_.ICON_MASK
149ICON_WARNING = _core_.ICON_WARNING
150ICON_ERROR = _core_.ICON_ERROR
151FORWARD = _core_.FORWARD
152BACKWARD = _core_.BACKWARD
153RESET = _core_.RESET
154HELP = _core_.HELP
155MORE = _core_.MORE
156SETUP = _core_.SETUP
157SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
158SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
159SIZE_AUTO = _core_.SIZE_AUTO
160SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
161SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
162PORTRAIT = _core_.PORTRAIT
163LANDSCAPE = _core_.LANDSCAPE
164PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
165PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
166PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
167PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
168ID_ANY = _core_.ID_ANY
169ID_SEPARATOR = _core_.ID_SEPARATOR
170ID_LOWEST = _core_.ID_LOWEST
171ID_OPEN = _core_.ID_OPEN
172ID_CLOSE = _core_.ID_CLOSE
173ID_NEW = _core_.ID_NEW
174ID_SAVE = _core_.ID_SAVE
175ID_SAVEAS = _core_.ID_SAVEAS
176ID_REVERT = _core_.ID_REVERT
177ID_EXIT = _core_.ID_EXIT
178ID_UNDO = _core_.ID_UNDO
179ID_REDO = _core_.ID_REDO
180ID_HELP = _core_.ID_HELP
181ID_PRINT = _core_.ID_PRINT
182ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
183ID_PREVIEW = _core_.ID_PREVIEW
184ID_ABOUT = _core_.ID_ABOUT
185ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
186ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
187ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
188ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
189ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
190ID_PREFERENCES = _core_.ID_PREFERENCES
191ID_CUT = _core_.ID_CUT
192ID_COPY = _core_.ID_COPY
193ID_PASTE = _core_.ID_PASTE
194ID_CLEAR = _core_.ID_CLEAR
195ID_FIND = _core_.ID_FIND
196ID_DUPLICATE = _core_.ID_DUPLICATE
197ID_SELECTALL = _core_.ID_SELECTALL
198ID_DELETE = _core_.ID_DELETE
199ID_REPLACE = _core_.ID_REPLACE
200ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
201ID_PROPERTIES = _core_.ID_PROPERTIES
202ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
203ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
204ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
205ID_VIEW_LIST = _core_.ID_VIEW_LIST
206ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
207ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
208ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
209ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
210ID_FILE1 = _core_.ID_FILE1
211ID_FILE2 = _core_.ID_FILE2
212ID_FILE3 = _core_.ID_FILE3
213ID_FILE4 = _core_.ID_FILE4
214ID_FILE5 = _core_.ID_FILE5
215ID_FILE6 = _core_.ID_FILE6
216ID_FILE7 = _core_.ID_FILE7
217ID_FILE8 = _core_.ID_FILE8
218ID_FILE9 = _core_.ID_FILE9
219ID_OK = _core_.ID_OK
220ID_CANCEL = _core_.ID_CANCEL
221ID_APPLY = _core_.ID_APPLY
222ID_YES = _core_.ID_YES
223ID_NO = _core_.ID_NO
224ID_STATIC = _core_.ID_STATIC
225ID_FORWARD = _core_.ID_FORWARD
226ID_BACKWARD = _core_.ID_BACKWARD
227ID_DEFAULT = _core_.ID_DEFAULT
228ID_MORE = _core_.ID_MORE
229ID_SETUP = _core_.ID_SETUP
230ID_RESET = _core_.ID_RESET
231ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
232ID_YESTOALL = _core_.ID_YESTOALL
233ID_NOTOALL = _core_.ID_NOTOALL
234ID_ABORT = _core_.ID_ABORT
235ID_RETRY = _core_.ID_RETRY
236ID_IGNORE = _core_.ID_IGNORE
0f63ec68
RD
237ID_ADD = _core_.ID_ADD
238ID_REMOVE = _core_.ID_REMOVE
239ID_UP = _core_.ID_UP
240ID_DOWN = _core_.ID_DOWN
241ID_HOME = _core_.ID_HOME
242ID_REFRESH = _core_.ID_REFRESH
243ID_STOP = _core_.ID_STOP
244ID_INDEX = _core_.ID_INDEX
245ID_BOLD = _core_.ID_BOLD
246ID_ITALIC = _core_.ID_ITALIC
247ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
248ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
249ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
250ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
251ID_UNDERLINE = _core_.ID_UNDERLINE
252ID_INDENT = _core_.ID_INDENT
253ID_UNINDENT = _core_.ID_UNINDENT
254ID_ZOOM_100 = _core_.ID_ZOOM_100
255ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
256ID_ZOOM_IN = _core_.ID_ZOOM_IN
257ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
258ID_UNDELETE = _core_.ID_UNDELETE
259ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
d55e5bfc
RD
260ID_HIGHEST = _core_.ID_HIGHEST
261OPEN = _core_.OPEN
262SAVE = _core_.SAVE
263HIDE_READONLY = _core_.HIDE_READONLY
264OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
265FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
266MULTIPLE = _core_.MULTIPLE
267CHANGE_DIR = _core_.CHANGE_DIR
268ACCEL_ALT = _core_.ACCEL_ALT
269ACCEL_CTRL = _core_.ACCEL_CTRL
270ACCEL_SHIFT = _core_.ACCEL_SHIFT
271ACCEL_NORMAL = _core_.ACCEL_NORMAL
272PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
273PD_APP_MODAL = _core_.PD_APP_MODAL
274PD_CAN_ABORT = _core_.PD_CAN_ABORT
275PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
276PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
277PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
62d32a5f
RD
278PD_SMOOTH = _core_.PD_SMOOTH
279PD_CAN_SKIP = _core_.PD_CAN_SKIP
d55e5bfc
RD
280DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
281DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
282MENU_TEAROFF = _core_.MENU_TEAROFF
283MB_DOCKABLE = _core_.MB_DOCKABLE
284NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
285FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
286LI_HORIZONTAL = _core_.LI_HORIZONTAL
287LI_VERTICAL = _core_.LI_VERTICAL
288WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
289WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
290WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
291WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
292WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
293WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
294MM_TEXT = _core_.MM_TEXT
295MM_LOMETRIC = _core_.MM_LOMETRIC
296MM_HIMETRIC = _core_.MM_HIMETRIC
297MM_LOENGLISH = _core_.MM_LOENGLISH
298MM_HIENGLISH = _core_.MM_HIENGLISH
299MM_TWIPS = _core_.MM_TWIPS
300MM_ISOTROPIC = _core_.MM_ISOTROPIC
301MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
302MM_POINTS = _core_.MM_POINTS
303MM_METRIC = _core_.MM_METRIC
304CENTRE = _core_.CENTRE
305CENTER = _core_.CENTER
306HORIZONTAL = _core_.HORIZONTAL
307VERTICAL = _core_.VERTICAL
308BOTH = _core_.BOTH
309LEFT = _core_.LEFT
310RIGHT = _core_.RIGHT
311UP = _core_.UP
312DOWN = _core_.DOWN
313TOP = _core_.TOP
314BOTTOM = _core_.BOTTOM
315NORTH = _core_.NORTH
316SOUTH = _core_.SOUTH
317WEST = _core_.WEST
318EAST = _core_.EAST
319ALL = _core_.ALL
320ALIGN_NOT = _core_.ALIGN_NOT
321ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
322ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
323ALIGN_LEFT = _core_.ALIGN_LEFT
324ALIGN_TOP = _core_.ALIGN_TOP
325ALIGN_RIGHT = _core_.ALIGN_RIGHT
326ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
327ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
328ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
329ALIGN_CENTER = _core_.ALIGN_CENTER
330ALIGN_CENTRE = _core_.ALIGN_CENTRE
331ALIGN_MASK = _core_.ALIGN_MASK
332STRETCH_NOT = _core_.STRETCH_NOT
333SHRINK = _core_.SHRINK
334GROW = _core_.GROW
335EXPAND = _core_.EXPAND
336SHAPED = _core_.SHAPED
337FIXED_MINSIZE = _core_.FIXED_MINSIZE
338TILE = _core_.TILE
339ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
340BORDER_DEFAULT = _core_.BORDER_DEFAULT
341BORDER_NONE = _core_.BORDER_NONE
342BORDER_STATIC = _core_.BORDER_STATIC
343BORDER_SIMPLE = _core_.BORDER_SIMPLE
344BORDER_RAISED = _core_.BORDER_RAISED
345BORDER_SUNKEN = _core_.BORDER_SUNKEN
346BORDER_DOUBLE = _core_.BORDER_DOUBLE
347BORDER_MASK = _core_.BORDER_MASK
0f63ec68
RD
348BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
349BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
350BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
d55e5bfc
RD
351DEFAULT = _core_.DEFAULT
352DECORATIVE = _core_.DECORATIVE
353ROMAN = _core_.ROMAN
354SCRIPT = _core_.SCRIPT
355SWISS = _core_.SWISS
356MODERN = _core_.MODERN
357TELETYPE = _core_.TELETYPE
358VARIABLE = _core_.VARIABLE
359FIXED = _core_.FIXED
360NORMAL = _core_.NORMAL
361LIGHT = _core_.LIGHT
362BOLD = _core_.BOLD
363ITALIC = _core_.ITALIC
364SLANT = _core_.SLANT
365SOLID = _core_.SOLID
366DOT = _core_.DOT
367LONG_DASH = _core_.LONG_DASH
368SHORT_DASH = _core_.SHORT_DASH
369DOT_DASH = _core_.DOT_DASH
370USER_DASH = _core_.USER_DASH
371TRANSPARENT = _core_.TRANSPARENT
372STIPPLE = _core_.STIPPLE
373BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
374CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
375FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
376CROSS_HATCH = _core_.CROSS_HATCH
377HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
378VERTICAL_HATCH = _core_.VERTICAL_HATCH
379JOIN_BEVEL = _core_.JOIN_BEVEL
380JOIN_MITER = _core_.JOIN_MITER
381JOIN_ROUND = _core_.JOIN_ROUND
382CAP_ROUND = _core_.CAP_ROUND
383CAP_PROJECTING = _core_.CAP_PROJECTING
384CAP_BUTT = _core_.CAP_BUTT
385CLEAR = _core_.CLEAR
386XOR = _core_.XOR
387INVERT = _core_.INVERT
388OR_REVERSE = _core_.OR_REVERSE
389AND_REVERSE = _core_.AND_REVERSE
390COPY = _core_.COPY
391AND = _core_.AND
392AND_INVERT = _core_.AND_INVERT
393NO_OP = _core_.NO_OP
394NOR = _core_.NOR
395EQUIV = _core_.EQUIV
396SRC_INVERT = _core_.SRC_INVERT
397OR_INVERT = _core_.OR_INVERT
398NAND = _core_.NAND
399OR = _core_.OR
400SET = _core_.SET
401WXK_BACK = _core_.WXK_BACK
402WXK_TAB = _core_.WXK_TAB
403WXK_RETURN = _core_.WXK_RETURN
404WXK_ESCAPE = _core_.WXK_ESCAPE
405WXK_SPACE = _core_.WXK_SPACE
406WXK_DELETE = _core_.WXK_DELETE
407WXK_START = _core_.WXK_START
408WXK_LBUTTON = _core_.WXK_LBUTTON
409WXK_RBUTTON = _core_.WXK_RBUTTON
410WXK_CANCEL = _core_.WXK_CANCEL
411WXK_MBUTTON = _core_.WXK_MBUTTON
412WXK_CLEAR = _core_.WXK_CLEAR
413WXK_SHIFT = _core_.WXK_SHIFT
414WXK_ALT = _core_.WXK_ALT
415WXK_CONTROL = _core_.WXK_CONTROL
416WXK_MENU = _core_.WXK_MENU
417WXK_PAUSE = _core_.WXK_PAUSE
418WXK_CAPITAL = _core_.WXK_CAPITAL
419WXK_PRIOR = _core_.WXK_PRIOR
420WXK_NEXT = _core_.WXK_NEXT
421WXK_END = _core_.WXK_END
422WXK_HOME = _core_.WXK_HOME
423WXK_LEFT = _core_.WXK_LEFT
424WXK_UP = _core_.WXK_UP
425WXK_RIGHT = _core_.WXK_RIGHT
426WXK_DOWN = _core_.WXK_DOWN
427WXK_SELECT = _core_.WXK_SELECT
428WXK_PRINT = _core_.WXK_PRINT
429WXK_EXECUTE = _core_.WXK_EXECUTE
430WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
431WXK_INSERT = _core_.WXK_INSERT
432WXK_HELP = _core_.WXK_HELP
433WXK_NUMPAD0 = _core_.WXK_NUMPAD0
434WXK_NUMPAD1 = _core_.WXK_NUMPAD1
435WXK_NUMPAD2 = _core_.WXK_NUMPAD2
436WXK_NUMPAD3 = _core_.WXK_NUMPAD3
437WXK_NUMPAD4 = _core_.WXK_NUMPAD4
438WXK_NUMPAD5 = _core_.WXK_NUMPAD5
439WXK_NUMPAD6 = _core_.WXK_NUMPAD6
440WXK_NUMPAD7 = _core_.WXK_NUMPAD7
441WXK_NUMPAD8 = _core_.WXK_NUMPAD8
442WXK_NUMPAD9 = _core_.WXK_NUMPAD9
443WXK_MULTIPLY = _core_.WXK_MULTIPLY
444WXK_ADD = _core_.WXK_ADD
445WXK_SEPARATOR = _core_.WXK_SEPARATOR
446WXK_SUBTRACT = _core_.WXK_SUBTRACT
447WXK_DECIMAL = _core_.WXK_DECIMAL
448WXK_DIVIDE = _core_.WXK_DIVIDE
449WXK_F1 = _core_.WXK_F1
450WXK_F2 = _core_.WXK_F2
451WXK_F3 = _core_.WXK_F3
452WXK_F4 = _core_.WXK_F4
453WXK_F5 = _core_.WXK_F5
454WXK_F6 = _core_.WXK_F6
455WXK_F7 = _core_.WXK_F7
456WXK_F8 = _core_.WXK_F8
457WXK_F9 = _core_.WXK_F9
458WXK_F10 = _core_.WXK_F10
459WXK_F11 = _core_.WXK_F11
460WXK_F12 = _core_.WXK_F12
461WXK_F13 = _core_.WXK_F13
462WXK_F14 = _core_.WXK_F14
463WXK_F15 = _core_.WXK_F15
464WXK_F16 = _core_.WXK_F16
465WXK_F17 = _core_.WXK_F17
466WXK_F18 = _core_.WXK_F18
467WXK_F19 = _core_.WXK_F19
468WXK_F20 = _core_.WXK_F20
469WXK_F21 = _core_.WXK_F21
470WXK_F22 = _core_.WXK_F22
471WXK_F23 = _core_.WXK_F23
472WXK_F24 = _core_.WXK_F24
473WXK_NUMLOCK = _core_.WXK_NUMLOCK
474WXK_SCROLL = _core_.WXK_SCROLL
475WXK_PAGEUP = _core_.WXK_PAGEUP
476WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
477WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
478WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
479WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
480WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
481WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
482WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
483WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
484WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
485WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
486WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
487WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
488WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
489WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
490WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
491WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
492WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
493WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
494WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
495WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
496WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
497WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
498WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
499WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
500WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
501WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
502WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
503WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
504WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
505WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
506WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
507WXK_COMMAND = _core_.WXK_COMMAND
508WXK_SPECIAL1 = _core_.WXK_SPECIAL1
509WXK_SPECIAL2 = _core_.WXK_SPECIAL2
510WXK_SPECIAL3 = _core_.WXK_SPECIAL3
511WXK_SPECIAL4 = _core_.WXK_SPECIAL4
512WXK_SPECIAL5 = _core_.WXK_SPECIAL5
513WXK_SPECIAL6 = _core_.WXK_SPECIAL6
514WXK_SPECIAL7 = _core_.WXK_SPECIAL7
515WXK_SPECIAL8 = _core_.WXK_SPECIAL8
516WXK_SPECIAL9 = _core_.WXK_SPECIAL9
517WXK_SPECIAL10 = _core_.WXK_SPECIAL10
518WXK_SPECIAL11 = _core_.WXK_SPECIAL11
519WXK_SPECIAL12 = _core_.WXK_SPECIAL12
520WXK_SPECIAL13 = _core_.WXK_SPECIAL13
521WXK_SPECIAL14 = _core_.WXK_SPECIAL14
522WXK_SPECIAL15 = _core_.WXK_SPECIAL15
523WXK_SPECIAL16 = _core_.WXK_SPECIAL16
524WXK_SPECIAL17 = _core_.WXK_SPECIAL17
525WXK_SPECIAL18 = _core_.WXK_SPECIAL18
526WXK_SPECIAL19 = _core_.WXK_SPECIAL19
527WXK_SPECIAL20 = _core_.WXK_SPECIAL20
d55e5bfc
RD
528PAPER_NONE = _core_.PAPER_NONE
529PAPER_LETTER = _core_.PAPER_LETTER
530PAPER_LEGAL = _core_.PAPER_LEGAL
531PAPER_A4 = _core_.PAPER_A4
532PAPER_CSHEET = _core_.PAPER_CSHEET
533PAPER_DSHEET = _core_.PAPER_DSHEET
534PAPER_ESHEET = _core_.PAPER_ESHEET
535PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
536PAPER_TABLOID = _core_.PAPER_TABLOID
537PAPER_LEDGER = _core_.PAPER_LEDGER
538PAPER_STATEMENT = _core_.PAPER_STATEMENT
539PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
540PAPER_A3 = _core_.PAPER_A3
541PAPER_A4SMALL = _core_.PAPER_A4SMALL
542PAPER_A5 = _core_.PAPER_A5
543PAPER_B4 = _core_.PAPER_B4
544PAPER_B5 = _core_.PAPER_B5
545PAPER_FOLIO = _core_.PAPER_FOLIO
546PAPER_QUARTO = _core_.PAPER_QUARTO
547PAPER_10X14 = _core_.PAPER_10X14
548PAPER_11X17 = _core_.PAPER_11X17
549PAPER_NOTE = _core_.PAPER_NOTE
550PAPER_ENV_9 = _core_.PAPER_ENV_9
551PAPER_ENV_10 = _core_.PAPER_ENV_10
552PAPER_ENV_11 = _core_.PAPER_ENV_11
553PAPER_ENV_12 = _core_.PAPER_ENV_12
554PAPER_ENV_14 = _core_.PAPER_ENV_14
555PAPER_ENV_DL = _core_.PAPER_ENV_DL
556PAPER_ENV_C5 = _core_.PAPER_ENV_C5
557PAPER_ENV_C3 = _core_.PAPER_ENV_C3
558PAPER_ENV_C4 = _core_.PAPER_ENV_C4
559PAPER_ENV_C6 = _core_.PAPER_ENV_C6
560PAPER_ENV_C65 = _core_.PAPER_ENV_C65
561PAPER_ENV_B4 = _core_.PAPER_ENV_B4
562PAPER_ENV_B5 = _core_.PAPER_ENV_B5
563PAPER_ENV_B6 = _core_.PAPER_ENV_B6
564PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
565PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
566PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
567PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
568PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
569PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
570PAPER_ISO_B4 = _core_.PAPER_ISO_B4
571PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
572PAPER_9X11 = _core_.PAPER_9X11
573PAPER_10X11 = _core_.PAPER_10X11
574PAPER_15X11 = _core_.PAPER_15X11
575PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
576PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
577PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
578PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
579PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
580PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
581PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
582PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
583PAPER_A_PLUS = _core_.PAPER_A_PLUS
584PAPER_B_PLUS = _core_.PAPER_B_PLUS
585PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
586PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
587PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
588PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
589PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
590PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
591PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
592PAPER_A2 = _core_.PAPER_A2
593PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
594PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
595DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
596DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
597DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
598ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
599ITEM_NORMAL = _core_.ITEM_NORMAL
600ITEM_CHECK = _core_.ITEM_CHECK
601ITEM_RADIO = _core_.ITEM_RADIO
602ITEM_MAX = _core_.ITEM_MAX
603HT_NOWHERE = _core_.HT_NOWHERE
604HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
605HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
606HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
607HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
608HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
609HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
610HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
611HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
612HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
613HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
614HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
615HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
616HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
617HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
618HT_MAX = _core_.HT_MAX
619MOD_NONE = _core_.MOD_NONE
620MOD_ALT = _core_.MOD_ALT
621MOD_CONTROL = _core_.MOD_CONTROL
622MOD_SHIFT = _core_.MOD_SHIFT
623MOD_WIN = _core_.MOD_WIN
624UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
625UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
626UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
627#---------------------------------------------------------------------------
628
629class Object(object):
630 """
631 The base class for most wx objects, although in wxPython not
632 much functionality is needed nor exposed.
633 """
634 def __init__(self): raise RuntimeError, "No constructor defined"
635 def __repr__(self):
636 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
637 def GetClassName(*args, **kwargs):
638 """
639 GetClassName(self) -> String
640
641 Returns the class name of the C++ class using wxRTTI.
642 """
643 return _core_.Object_GetClassName(*args, **kwargs)
644
645 def Destroy(*args, **kwargs):
646 """
647 Destroy(self)
648
649 Deletes the C++ object this Python object is a proxy for.
650 """
651 return _core_.Object_Destroy(*args, **kwargs)
652
653
654class ObjectPtr(Object):
655 def __init__(self, this):
656 self.this = this
657 if not hasattr(self,"thisown"): self.thisown = 0
658 self.__class__ = Object
659_core_.Object_swigregister(ObjectPtr)
660_wxPySetDictionary = _core_._wxPySetDictionary
661
662_wxPyFixStockObjects = _core_._wxPyFixStockObjects
663
664cvar = _core_.cvar
665EmptyString = cvar.EmptyString
666
667#---------------------------------------------------------------------------
668
669BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
670BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
671BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
672BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
673BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
674BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
675BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
676BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
677BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
678BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
679BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
680BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
681BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
682BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
683BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
684BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
685BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
686BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
687BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
688BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
689CURSOR_NONE = _core_.CURSOR_NONE
690CURSOR_ARROW = _core_.CURSOR_ARROW
691CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
692CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
693CURSOR_CHAR = _core_.CURSOR_CHAR
694CURSOR_CROSS = _core_.CURSOR_CROSS
695CURSOR_HAND = _core_.CURSOR_HAND
696CURSOR_IBEAM = _core_.CURSOR_IBEAM
697CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
698CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
699CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
700CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
701CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
702CURSOR_PENCIL = _core_.CURSOR_PENCIL
703CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
704CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
705CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
706CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
707CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
708CURSOR_SIZENS = _core_.CURSOR_SIZENS
709CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
710CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
711CURSOR_SIZING = _core_.CURSOR_SIZING
712CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
713CURSOR_WAIT = _core_.CURSOR_WAIT
714CURSOR_WATCH = _core_.CURSOR_WATCH
715CURSOR_BLANK = _core_.CURSOR_BLANK
716CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
717CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
718CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
719CURSOR_MAX = _core_.CURSOR_MAX
720#---------------------------------------------------------------------------
721
722class Size(object):
723 """
79fccf9d 724 wx.Size is a useful data structure used to represent the size of
093d3ff1
RD
725 something. It simply contians integer width and height
726 proprtites. In most places in wxPython where a wx.Size is
727 expected a (width, height) tuple can be used instead.
d55e5bfc
RD
728 """
729 def __repr__(self):
730 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
731 width = property(_core_.Size_width_get, _core_.Size_width_set)
732 height = property(_core_.Size_height_get, _core_.Size_height_set)
733 x = width; y = height
734 def __init__(self, *args, **kwargs):
735 """
736 __init__(self, int w=0, int h=0) -> Size
737
738 Creates a size object.
739 """
740 newobj = _core_.new_Size(*args, **kwargs)
741 self.this = newobj.this
742 self.thisown = 1
743 del newobj.thisown
744 def __del__(self, destroy=_core_.delete_Size):
745 """__del__(self)"""
746 try:
747 if self.thisown: destroy(self)
748 except: pass
749
750 def __eq__(*args, **kwargs):
751 """
752 __eq__(self, Size sz) -> bool
753
754 Test for equality of wx.Size objects.
755 """
756 return _core_.Size___eq__(*args, **kwargs)
757
758 def __ne__(*args, **kwargs):
759 """
760 __ne__(self, Size sz) -> bool
761
762 Test for inequality.
763 """
764 return _core_.Size___ne__(*args, **kwargs)
765
766 def __add__(*args, **kwargs):
767 """
768 __add__(self, Size sz) -> Size
769
770 Add sz's proprties to this and return the result.
771 """
772 return _core_.Size___add__(*args, **kwargs)
773
774 def __sub__(*args, **kwargs):
775 """
776 __sub__(self, Size sz) -> Size
777
778 Subtract sz's properties from this and return the result.
779 """
780 return _core_.Size___sub__(*args, **kwargs)
781
782 def IncTo(*args, **kwargs):
783 """
784 IncTo(self, Size sz)
785
786 Increments this object so that both of its dimensions are not less
787 than the corresponding dimensions of the size.
788 """
789 return _core_.Size_IncTo(*args, **kwargs)
790
791 def DecTo(*args, **kwargs):
792 """
793 DecTo(self, Size sz)
794
795 Decrements this object so that both of its dimensions are not greater
796 than the corresponding dimensions of the size.
797 """
798 return _core_.Size_DecTo(*args, **kwargs)
799
800 def Set(*args, **kwargs):
801 """
802 Set(self, int w, int h)
803
804 Set both width and height.
805 """
806 return _core_.Size_Set(*args, **kwargs)
807
808 def SetWidth(*args, **kwargs):
809 """SetWidth(self, int w)"""
810 return _core_.Size_SetWidth(*args, **kwargs)
811
812 def SetHeight(*args, **kwargs):
813 """SetHeight(self, int h)"""
814 return _core_.Size_SetHeight(*args, **kwargs)
815
816 def GetWidth(*args, **kwargs):
817 """GetWidth(self) -> int"""
818 return _core_.Size_GetWidth(*args, **kwargs)
819
820 def GetHeight(*args, **kwargs):
821 """GetHeight(self) -> int"""
822 return _core_.Size_GetHeight(*args, **kwargs)
823
824 def IsFullySpecified(*args, **kwargs):
825 """
826 IsFullySpecified(self) -> bool
827
828 Returns True if both components of the size are non-default values.
829 """
830 return _core_.Size_IsFullySpecified(*args, **kwargs)
831
832 def SetDefaults(*args, **kwargs):
833 """
834 SetDefaults(self, Size size)
835
79fccf9d
RD
836 Combine this size with the other one replacing the default components
837 of this object (i.e. equal to -1) with those of the other.
d55e5bfc
RD
838 """
839 return _core_.Size_SetDefaults(*args, **kwargs)
840
841 def Get(*args, **kwargs):
842 """
843 Get() -> (width,height)
844
845 Returns the width and height properties as a tuple.
846 """
847 return _core_.Size_Get(*args, **kwargs)
848
79fccf9d 849 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
850 def __str__(self): return str(self.Get())
851 def __repr__(self): return 'wx.Size'+str(self.Get())
852 def __len__(self): return len(self.Get())
853 def __getitem__(self, index): return self.Get()[index]
854 def __setitem__(self, index, val):
855 if index == 0: self.width = val
856 elif index == 1: self.height = val
857 else: raise IndexError
858 def __nonzero__(self): return self.Get() != (0,0)
859 __safe_for_unpickling__ = True
860 def __reduce__(self): return (wx.Size, self.Get())
861
862
863class SizePtr(Size):
864 def __init__(self, this):
865 self.this = this
866 if not hasattr(self,"thisown"): self.thisown = 0
867 self.__class__ = Size
868_core_.Size_swigregister(SizePtr)
869
870#---------------------------------------------------------------------------
871
872class RealPoint(object):
873 """
79fccf9d
RD
874 A data structure for representing a point or position with floating
875 point x and y properties. In wxPython most places that expect a
876 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc
RD
877 """
878 def __repr__(self):
879 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
880 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
881 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
882 def __init__(self, *args, **kwargs):
883 """
884 __init__(self, double x=0.0, double y=0.0) -> RealPoint
885
886 Create a wx.RealPoint object
887 """
888 newobj = _core_.new_RealPoint(*args, **kwargs)
889 self.this = newobj.this
890 self.thisown = 1
891 del newobj.thisown
892 def __del__(self, destroy=_core_.delete_RealPoint):
893 """__del__(self)"""
894 try:
895 if self.thisown: destroy(self)
896 except: pass
897
898 def __eq__(*args, **kwargs):
899 """
900 __eq__(self, RealPoint pt) -> bool
901
902 Test for equality of wx.RealPoint objects.
903 """
904 return _core_.RealPoint___eq__(*args, **kwargs)
905
906 def __ne__(*args, **kwargs):
907 """
908 __ne__(self, RealPoint pt) -> bool
909
910 Test for inequality of wx.RealPoint objects.
911 """
912 return _core_.RealPoint___ne__(*args, **kwargs)
913
914 def __add__(*args, **kwargs):
915 """
916 __add__(self, RealPoint pt) -> RealPoint
917
918 Add pt's proprties to this and return the result.
919 """
920 return _core_.RealPoint___add__(*args, **kwargs)
921
922 def __sub__(*args, **kwargs):
923 """
924 __sub__(self, RealPoint pt) -> RealPoint
925
926 Subtract pt's proprties from this and return the result
927 """
928 return _core_.RealPoint___sub__(*args, **kwargs)
929
930 def Set(*args, **kwargs):
931 """
932 Set(self, double x, double y)
933
934 Set both the x and y properties
935 """
936 return _core_.RealPoint_Set(*args, **kwargs)
937
938 def Get(*args, **kwargs):
939 """
940 Get() -> (x,y)
941
942 Return the x and y properties as a tuple.
943 """
944 return _core_.RealPoint_Get(*args, **kwargs)
945
79fccf9d 946 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
947 def __str__(self): return str(self.Get())
948 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
949 def __len__(self): return len(self.Get())
950 def __getitem__(self, index): return self.Get()[index]
951 def __setitem__(self, index, val):
952 if index == 0: self.x = val
953 elif index == 1: self.y = val
954 else: raise IndexError
955 def __nonzero__(self): return self.Get() != (0.0, 0.0)
956 __safe_for_unpickling__ = True
957 def __reduce__(self): return (wx.RealPoint, self.Get())
958
959
960class RealPointPtr(RealPoint):
961 def __init__(self, this):
962 self.this = this
963 if not hasattr(self,"thisown"): self.thisown = 0
964 self.__class__ = RealPoint
965_core_.RealPoint_swigregister(RealPointPtr)
966
967#---------------------------------------------------------------------------
968
969class Point(object):
970 """
79fccf9d
RD
971 A data structure for representing a point or position with integer x
972 and y properties. Most places in wxPython that expect a wx.Point can
973 also accept a (x,y) tuple.
d55e5bfc
RD
974 """
975 def __repr__(self):
976 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
977 x = property(_core_.Point_x_get, _core_.Point_x_set)
978 y = property(_core_.Point_y_get, _core_.Point_y_set)
979 def __init__(self, *args, **kwargs):
980 """
981 __init__(self, int x=0, int y=0) -> Point
982
983 Create a wx.Point object
984 """
985 newobj = _core_.new_Point(*args, **kwargs)
986 self.this = newobj.this
987 self.thisown = 1
988 del newobj.thisown
989 def __del__(self, destroy=_core_.delete_Point):
990 """__del__(self)"""
991 try:
992 if self.thisown: destroy(self)
993 except: pass
994
995 def __eq__(*args, **kwargs):
996 """
997 __eq__(self, Point pt) -> bool
998
999 Test for equality of wx.Point objects.
1000 """
1001 return _core_.Point___eq__(*args, **kwargs)
1002
1003 def __ne__(*args, **kwargs):
1004 """
1005 __ne__(self, Point pt) -> bool
1006
1007 Test for inequality of wx.Point objects.
1008 """
1009 return _core_.Point___ne__(*args, **kwargs)
1010
1011 def __add__(*args, **kwargs):
1012 """
1013 __add__(self, Point pt) -> Point
1014
1015 Add pt's proprties to this and return the result.
1016 """
1017 return _core_.Point___add__(*args, **kwargs)
1018
1019 def __sub__(*args, **kwargs):
1020 """
1021 __sub__(self, Point pt) -> Point
1022
1023 Subtract pt's proprties from this and return the result
1024 """
1025 return _core_.Point___sub__(*args, **kwargs)
1026
1027 def __iadd__(*args, **kwargs):
1028 """
1029 __iadd__(self, Point pt) -> Point
1030
1031 Add pt to this object.
1032 """
1033 return _core_.Point___iadd__(*args, **kwargs)
1034
1035 def __isub__(*args, **kwargs):
1036 """
1037 __isub__(self, Point pt) -> Point
1038
1039 Subtract pt from this object.
1040 """
1041 return _core_.Point___isub__(*args, **kwargs)
1042
1043 def Set(*args, **kwargs):
1044 """
1045 Set(self, long x, long y)
1046
1047 Set both the x and y properties
1048 """
1049 return _core_.Point_Set(*args, **kwargs)
1050
1051 def Get(*args, **kwargs):
1052 """
1053 Get() -> (x,y)
1054
1055 Return the x and y properties as a tuple.
1056 """
1057 return _core_.Point_Get(*args, **kwargs)
1058
79fccf9d 1059 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1060 def __str__(self): return str(self.Get())
1061 def __repr__(self): return 'wx.Point'+str(self.Get())
1062 def __len__(self): return len(self.Get())
1063 def __getitem__(self, index): return self.Get()[index]
1064 def __setitem__(self, index, val):
1065 if index == 0: self.x = val
1066 elif index == 1: self.y = val
1067 else: raise IndexError
1068 def __nonzero__(self): return self.Get() != (0,0)
1069 __safe_for_unpickling__ = True
1070 def __reduce__(self): return (wx.Point, self.Get())
1071
1072
1073class PointPtr(Point):
1074 def __init__(self, this):
1075 self.this = this
1076 if not hasattr(self,"thisown"): self.thisown = 0
1077 self.__class__ = Point
1078_core_.Point_swigregister(PointPtr)
1079
1080#---------------------------------------------------------------------------
1081
1082class Rect(object):
1083 """
79fccf9d
RD
1084 A class for representing and manipulating rectangles. It has x, y,
1085 width and height properties. In wxPython most palces that expect a
1086 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc
RD
1087 """
1088 def __repr__(self):
1089 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1090 def __init__(self, *args, **kwargs):
1091 """
1092 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1093
1094 Create a new Rect object.
1095 """
1096 newobj = _core_.new_Rect(*args, **kwargs)
1097 self.this = newobj.this
1098 self.thisown = 1
1099 del newobj.thisown
1100 def __del__(self, destroy=_core_.delete_Rect):
1101 """__del__(self)"""
1102 try:
1103 if self.thisown: destroy(self)
1104 except: pass
1105
1106 def GetX(*args, **kwargs):
1107 """GetX(self) -> int"""
1108 return _core_.Rect_GetX(*args, **kwargs)
1109
1110 def SetX(*args, **kwargs):
1111 """SetX(self, int x)"""
1112 return _core_.Rect_SetX(*args, **kwargs)
1113
1114 def GetY(*args, **kwargs):
1115 """GetY(self) -> int"""
1116 return _core_.Rect_GetY(*args, **kwargs)
1117
1118 def SetY(*args, **kwargs):
1119 """SetY(self, int y)"""
1120 return _core_.Rect_SetY(*args, **kwargs)
1121
1122 def GetWidth(*args, **kwargs):
1123 """GetWidth(self) -> int"""
1124 return _core_.Rect_GetWidth(*args, **kwargs)
1125
1126 def SetWidth(*args, **kwargs):
1127 """SetWidth(self, int w)"""
1128 return _core_.Rect_SetWidth(*args, **kwargs)
1129
1130 def GetHeight(*args, **kwargs):
1131 """GetHeight(self) -> int"""
1132 return _core_.Rect_GetHeight(*args, **kwargs)
1133
1134 def SetHeight(*args, **kwargs):
1135 """SetHeight(self, int h)"""
1136 return _core_.Rect_SetHeight(*args, **kwargs)
1137
1138 def GetPosition(*args, **kwargs):
1139 """GetPosition(self) -> Point"""
1140 return _core_.Rect_GetPosition(*args, **kwargs)
1141
1142 def SetPosition(*args, **kwargs):
1143 """SetPosition(self, Point p)"""
1144 return _core_.Rect_SetPosition(*args, **kwargs)
1145
1146 def GetSize(*args, **kwargs):
1147 """GetSize(self) -> Size"""
1148 return _core_.Rect_GetSize(*args, **kwargs)
1149
1150 def SetSize(*args, **kwargs):
1151 """SetSize(self, Size s)"""
1152 return _core_.Rect_SetSize(*args, **kwargs)
1153
aff4cc5c
RD
1154 def IsEmpty(*args, **kwargs):
1155 """IsEmpty(self) -> bool"""
1156 return _core_.Rect_IsEmpty(*args, **kwargs)
1157
d55e5bfc
RD
1158 def GetTopLeft(*args, **kwargs):
1159 """GetTopLeft(self) -> Point"""
1160 return _core_.Rect_GetTopLeft(*args, **kwargs)
1161
1162 def SetTopLeft(*args, **kwargs):
1163 """SetTopLeft(self, Point p)"""
1164 return _core_.Rect_SetTopLeft(*args, **kwargs)
1165
1166 def GetBottomRight(*args, **kwargs):
1167 """GetBottomRight(self) -> Point"""
1168 return _core_.Rect_GetBottomRight(*args, **kwargs)
1169
1170 def SetBottomRight(*args, **kwargs):
1171 """SetBottomRight(self, Point p)"""
1172 return _core_.Rect_SetBottomRight(*args, **kwargs)
1173
1174 def GetLeft(*args, **kwargs):
1175 """GetLeft(self) -> int"""
1176 return _core_.Rect_GetLeft(*args, **kwargs)
1177
1178 def GetTop(*args, **kwargs):
1179 """GetTop(self) -> int"""
1180 return _core_.Rect_GetTop(*args, **kwargs)
1181
1182 def GetBottom(*args, **kwargs):
1183 """GetBottom(self) -> int"""
1184 return _core_.Rect_GetBottom(*args, **kwargs)
1185
1186 def GetRight(*args, **kwargs):
1187 """GetRight(self) -> int"""
1188 return _core_.Rect_GetRight(*args, **kwargs)
1189
1190 def SetLeft(*args, **kwargs):
1191 """SetLeft(self, int left)"""
1192 return _core_.Rect_SetLeft(*args, **kwargs)
1193
1194 def SetRight(*args, **kwargs):
1195 """SetRight(self, int right)"""
1196 return _core_.Rect_SetRight(*args, **kwargs)
1197
1198 def SetTop(*args, **kwargs):
1199 """SetTop(self, int top)"""
1200 return _core_.Rect_SetTop(*args, **kwargs)
1201
1202 def SetBottom(*args, **kwargs):
1203 """SetBottom(self, int bottom)"""
1204 return _core_.Rect_SetBottom(*args, **kwargs)
1205
1206 position = property(GetPosition, SetPosition)
1207 size = property(GetSize, SetSize)
1208 left = property(GetLeft, SetLeft)
1209 right = property(GetRight, SetRight)
1210 top = property(GetTop, SetTop)
1211 bottom = property(GetBottom, SetBottom)
1212
1213 def Inflate(*args, **kwargs):
1214 """
1215 Inflate(self, int dx, int dy) -> Rect
1216
091fdbfa
RD
1217 Increases the size of the rectangle.
1218
1219 The left border is moved farther left and the right border is moved
1220 farther right by ``dx``. The upper border is moved farther up and the
1221 bottom border is moved farther down by ``dy``. (Note the the width and
1222 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1223 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1224 opposite happens: the rectangle size decreases in the respective
1225 direction.
1226
1227 The change is made to the rectangle inplace, if instead you need a
1228 copy that is inflated, preserving the original then make the copy
1229 first::
1230
1231 copy = wx.Rect(*original)
1232 copy.Inflate(10,15)
1233
1234
d55e5bfc
RD
1235 """
1236 return _core_.Rect_Inflate(*args, **kwargs)
1237
1238 def Deflate(*args, **kwargs):
1239 """
1240 Deflate(self, int dx, int dy) -> Rect
1241
091fdbfa
RD
1242 Decrease the rectangle size. This method is the opposite of `Inflate`
1243 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1244 `Inflate` for a full description.
d55e5bfc
RD
1245 """
1246 return _core_.Rect_Deflate(*args, **kwargs)
1247
1248 def OffsetXY(*args, **kwargs):
1249 """
1250 OffsetXY(self, int dx, int dy)
1251
79fccf9d
RD
1252 Moves the rectangle by the specified offset. If dx is positive, the
1253 rectangle is moved to the right, if dy is positive, it is moved to the
1254 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc
RD
1255 """
1256 return _core_.Rect_OffsetXY(*args, **kwargs)
1257
1258 def Offset(*args, **kwargs):
1259 """
1260 Offset(self, Point pt)
1261
1262 Same as OffsetXY but uses dx,dy from Point
1263 """
1264 return _core_.Rect_Offset(*args, **kwargs)
1265
1266 def Intersect(*args, **kwargs):
1267 """
1268 Intersect(self, Rect rect) -> Rect
1269
b519803b 1270 Returns the intersectsion of this rectangle and rect.
d55e5bfc
RD
1271 """
1272 return _core_.Rect_Intersect(*args, **kwargs)
1273
b519803b
RD
1274 def Union(*args, **kwargs):
1275 """
1276 Union(self, Rect rect) -> Rect
1277
1278 Returns the union of this rectangle and rect.
1279 """
1280 return _core_.Rect_Union(*args, **kwargs)
1281
d55e5bfc
RD
1282 def __add__(*args, **kwargs):
1283 """
1284 __add__(self, Rect rect) -> Rect
1285
1286 Add the properties of rect to this rectangle and return the result.
1287 """
1288 return _core_.Rect___add__(*args, **kwargs)
1289
1290 def __iadd__(*args, **kwargs):
1291 """
1292 __iadd__(self, Rect rect) -> Rect
1293
1294 Add the properties of rect to this rectangle, updating this rectangle.
1295 """
1296 return _core_.Rect___iadd__(*args, **kwargs)
1297
1298 def __eq__(*args, **kwargs):
1299 """
1300 __eq__(self, Rect rect) -> bool
1301
1302 Test for equality.
1303 """
1304 return _core_.Rect___eq__(*args, **kwargs)
1305
1306 def __ne__(*args, **kwargs):
1307 """
1308 __ne__(self, Rect rect) -> bool
1309
1310 Test for inequality.
1311 """
1312 return _core_.Rect___ne__(*args, **kwargs)
1313
1314 def InsideXY(*args, **kwargs):
1315 """
1316 InsideXY(self, int x, int y) -> bool
1317
1318 Return True if the point is (not strcitly) inside the rect.
1319 """
1320 return _core_.Rect_InsideXY(*args, **kwargs)
1321
1322 def Inside(*args, **kwargs):
1323 """
1324 Inside(self, Point pt) -> bool
1325
1326 Return True if the point is (not strcitly) inside the rect.
1327 """
1328 return _core_.Rect_Inside(*args, **kwargs)
1329
1330 def Intersects(*args, **kwargs):
1331 """
1332 Intersects(self, Rect rect) -> bool
1333
1334 Returns True if the rectangles have a non empty intersection.
1335 """
1336 return _core_.Rect_Intersects(*args, **kwargs)
1337
1338 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1339 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1340 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1341 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1342 def Set(*args, **kwargs):
1343 """
1344 Set(self, int x=0, int y=0, int width=0, int height=0)
1345
1346 Set all rectangle properties.
1347 """
1348 return _core_.Rect_Set(*args, **kwargs)
1349
1350 def Get(*args, **kwargs):
1351 """
1352 Get() -> (x,y,width,height)
1353
1354 Return the rectangle properties as a tuple.
1355 """
1356 return _core_.Rect_Get(*args, **kwargs)
1357
79fccf9d 1358 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1359 def __str__(self): return str(self.Get())
1360 def __repr__(self): return 'wx.Rect'+str(self.Get())
1361 def __len__(self): return len(self.Get())
1362 def __getitem__(self, index): return self.Get()[index]
1363 def __setitem__(self, index, val):
1364 if index == 0: self.x = val
1365 elif index == 1: self.y = val
1366 elif index == 2: self.width = val
1367 elif index == 3: self.height = val
1368 else: raise IndexError
1369 def __nonzero__(self): return self.Get() != (0,0,0,0)
1370 __safe_for_unpickling__ = True
1371 def __reduce__(self): return (wx.Rect, self.Get())
1372
1373
1374class RectPtr(Rect):
1375 def __init__(self, this):
1376 self.this = this
1377 if not hasattr(self,"thisown"): self.thisown = 0
1378 self.__class__ = Rect
1379_core_.Rect_swigregister(RectPtr)
1380
1381def RectPP(*args, **kwargs):
1382 """
1383 RectPP(Point topLeft, Point bottomRight) -> Rect
1384
1385 Create a new Rect object from Points representing two corners.
1386 """
1387 val = _core_.new_RectPP(*args, **kwargs)
1388 val.thisown = 1
1389 return val
1390
1391def RectPS(*args, **kwargs):
1392 """
1393 RectPS(Point pos, Size size) -> Rect
1394
1395 Create a new Rect from a position and size.
1396 """
1397 val = _core_.new_RectPS(*args, **kwargs)
1398 val.thisown = 1
1399 return val
1400
c1cb24a4
RD
1401def RectS(*args, **kwargs):
1402 """
1403 RectS(Size size) -> Rect
1404
1405 Create a new Rect from a size only.
1406 """
1407 val = _core_.new_RectS(*args, **kwargs)
1408 val.thisown = 1
1409 return val
1410
d55e5bfc
RD
1411
1412def IntersectRect(*args, **kwargs):
1413 """
1414 IntersectRect(Rect r1, Rect r2) -> Rect
1415
1416 Calculate and return the intersection of r1 and r2.
1417 """
1418 return _core_.IntersectRect(*args, **kwargs)
1419#---------------------------------------------------------------------------
1420
1421class Point2D(object):
79fccf9d
RD
1422 """
1423 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1424 with floating point values.
1425 """
d55e5bfc
RD
1426 def __repr__(self):
1427 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1428 def __init__(self, *args, **kwargs):
1429 """
1430 __init__(self, double x=0.0, double y=0.0) -> Point2D
1431
1432 Create a w.Point2D object.
1433 """
1434 newobj = _core_.new_Point2D(*args, **kwargs)
1435 self.this = newobj.this
1436 self.thisown = 1
1437 del newobj.thisown
1438 def GetFloor(*args, **kwargs):
a8eff060
RD
1439 """
1440 GetFloor() -> (x,y)
1441
1442 Convert to integer
1443 """
d55e5bfc
RD
1444 return _core_.Point2D_GetFloor(*args, **kwargs)
1445
1446 def GetRounded(*args, **kwargs):
a8eff060
RD
1447 """
1448 GetRounded() -> (x,y)
1449
1450 Convert to integer
1451 """
d55e5bfc
RD
1452 return _core_.Point2D_GetRounded(*args, **kwargs)
1453
1454 def GetVectorLength(*args, **kwargs):
1455 """GetVectorLength(self) -> double"""
1456 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1457
1458 def GetVectorAngle(*args, **kwargs):
1459 """GetVectorAngle(self) -> double"""
1460 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1461
1462 def SetVectorLength(*args, **kwargs):
1463 """SetVectorLength(self, double length)"""
1464 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1465
1466 def SetVectorAngle(*args, **kwargs):
1467 """SetVectorAngle(self, double degrees)"""
1468 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1469
1470 def SetPolarCoordinates(self, angle, length):
1471 self.SetVectorLength(length)
1472 self.SetVectorAngle(angle)
1473 def Normalize(self):
1474 self.SetVectorLength(1.0)
1475
1476 def GetDistance(*args, **kwargs):
1477 """GetDistance(self, Point2D pt) -> double"""
1478 return _core_.Point2D_GetDistance(*args, **kwargs)
1479
1480 def GetDistanceSquare(*args, **kwargs):
1481 """GetDistanceSquare(self, Point2D pt) -> double"""
1482 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1483
1484 def GetDotProduct(*args, **kwargs):
1485 """GetDotProduct(self, Point2D vec) -> double"""
1486 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1487
1488 def GetCrossProduct(*args, **kwargs):
1489 """GetCrossProduct(self, Point2D vec) -> double"""
1490 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1491
1492 def __neg__(*args, **kwargs):
1493 """
1494 __neg__(self) -> Point2D
1495
1496 the reflection of this point
1497 """
1498 return _core_.Point2D___neg__(*args, **kwargs)
1499
1500 def __iadd__(*args, **kwargs):
1501 """__iadd__(self, Point2D pt) -> Point2D"""
1502 return _core_.Point2D___iadd__(*args, **kwargs)
1503
1504 def __isub__(*args, **kwargs):
1505 """__isub__(self, Point2D pt) -> Point2D"""
1506 return _core_.Point2D___isub__(*args, **kwargs)
1507
1508 def __imul__(*args, **kwargs):
1509 """__imul__(self, Point2D pt) -> Point2D"""
1510 return _core_.Point2D___imul__(*args, **kwargs)
1511
1512 def __idiv__(*args, **kwargs):
1513 """__idiv__(self, Point2D pt) -> Point2D"""
1514 return _core_.Point2D___idiv__(*args, **kwargs)
1515
1516 def __eq__(*args, **kwargs):
1517 """
1518 __eq__(self, Point2D pt) -> bool
1519
1520 Test for equality
1521 """
1522 return _core_.Point2D___eq__(*args, **kwargs)
1523
1524 def __ne__(*args, **kwargs):
1525 """
1526 __ne__(self, Point2D pt) -> bool
1527
1528 Test for inequality
1529 """
1530 return _core_.Point2D___ne__(*args, **kwargs)
1531
1532 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1533 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1534 def Set(*args, **kwargs):
1535 """Set(self, double x=0, double y=0)"""
1536 return _core_.Point2D_Set(*args, **kwargs)
1537
1538 def Get(*args, **kwargs):
1539 """
1540 Get() -> (x,y)
1541
1542 Return x and y properties as a tuple.
1543 """
1544 return _core_.Point2D_Get(*args, **kwargs)
1545
79fccf9d 1546 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1547 def __str__(self): return str(self.Get())
1548 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1549 def __len__(self): return len(self.Get())
1550 def __getitem__(self, index): return self.Get()[index]
1551 def __setitem__(self, index, val):
1552 if index == 0: self.x = val
1553 elif index == 1: self.y = val
1554 else: raise IndexError
1555 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1556 __safe_for_unpickling__ = True
1557 def __reduce__(self): return (wx.Point2D, self.Get())
1558
1559
1560class Point2DPtr(Point2D):
1561 def __init__(self, this):
1562 self.this = this
1563 if not hasattr(self,"thisown"): self.thisown = 0
1564 self.__class__ = Point2D
1565_core_.Point2D_swigregister(Point2DPtr)
1566
1567def Point2DCopy(*args, **kwargs):
1568 """
1569 Point2DCopy(Point2D pt) -> Point2D
1570
1571 Create a w.Point2D object.
1572 """
1573 val = _core_.new_Point2DCopy(*args, **kwargs)
1574 val.thisown = 1
1575 return val
1576
1577def Point2DFromPoint(*args, **kwargs):
1578 """
1579 Point2DFromPoint(Point pt) -> Point2D
1580
1581 Create a w.Point2D object.
1582 """
1583 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1584 val.thisown = 1
1585 return val
1586
1587#---------------------------------------------------------------------------
1588
1589FromStart = _core_.FromStart
1590FromCurrent = _core_.FromCurrent
1591FromEnd = _core_.FromEnd
1592class InputStream(object):
093d3ff1 1593 """Proxy of C++ InputStream class"""
d55e5bfc
RD
1594 def __repr__(self):
1595 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1596 def __init__(self, *args, **kwargs):
1597 """__init__(self, PyObject p) -> InputStream"""
1598 newobj = _core_.new_InputStream(*args, **kwargs)
1599 self.this = newobj.this
1600 self.thisown = 1
1601 del newobj.thisown
8fb0e70a
RD
1602 def __del__(self, destroy=_core_.delete_InputStream):
1603 """__del__(self)"""
1604 try:
1605 if self.thisown: destroy(self)
1606 except: pass
1607
d55e5bfc
RD
1608 def close(*args, **kwargs):
1609 """close(self)"""
1610 return _core_.InputStream_close(*args, **kwargs)
1611
1612 def flush(*args, **kwargs):
1613 """flush(self)"""
1614 return _core_.InputStream_flush(*args, **kwargs)
1615
1616 def eof(*args, **kwargs):
1617 """eof(self) -> bool"""
1618 return _core_.InputStream_eof(*args, **kwargs)
1619
1620 def read(*args, **kwargs):
1621 """read(self, int size=-1) -> PyObject"""
1622 return _core_.InputStream_read(*args, **kwargs)
1623
1624 def readline(*args, **kwargs):
1625 """readline(self, int size=-1) -> PyObject"""
1626 return _core_.InputStream_readline(*args, **kwargs)
1627
1628 def readlines(*args, **kwargs):
1629 """readlines(self, int sizehint=-1) -> PyObject"""
1630 return _core_.InputStream_readlines(*args, **kwargs)
1631
1632 def seek(*args, **kwargs):
1633 """seek(self, int offset, int whence=0)"""
1634 return _core_.InputStream_seek(*args, **kwargs)
1635
1636 def tell(*args, **kwargs):
1637 """tell(self) -> int"""
1638 return _core_.InputStream_tell(*args, **kwargs)
1639
1640 def Peek(*args, **kwargs):
1641 """Peek(self) -> char"""
1642 return _core_.InputStream_Peek(*args, **kwargs)
1643
1644 def GetC(*args, **kwargs):
1645 """GetC(self) -> char"""
1646 return _core_.InputStream_GetC(*args, **kwargs)
1647
1648 def LastRead(*args, **kwargs):
1649 """LastRead(self) -> size_t"""
1650 return _core_.InputStream_LastRead(*args, **kwargs)
1651
1652 def CanRead(*args, **kwargs):
1653 """CanRead(self) -> bool"""
1654 return _core_.InputStream_CanRead(*args, **kwargs)
1655
1656 def Eof(*args, **kwargs):
1657 """Eof(self) -> bool"""
1658 return _core_.InputStream_Eof(*args, **kwargs)
1659
1660 def Ungetch(*args, **kwargs):
1661 """Ungetch(self, char c) -> bool"""
1662 return _core_.InputStream_Ungetch(*args, **kwargs)
1663
1664 def SeekI(*args, **kwargs):
1665 """SeekI(self, long pos, int mode=FromStart) -> long"""
1666 return _core_.InputStream_SeekI(*args, **kwargs)
1667
1668 def TellI(*args, **kwargs):
1669 """TellI(self) -> long"""
1670 return _core_.InputStream_TellI(*args, **kwargs)
1671
1672
1673class InputStreamPtr(InputStream):
1674 def __init__(self, this):
1675 self.this = this
1676 if not hasattr(self,"thisown"): self.thisown = 0
1677 self.__class__ = InputStream
1678_core_.InputStream_swigregister(InputStreamPtr)
1679DefaultPosition = cvar.DefaultPosition
1680DefaultSize = cvar.DefaultSize
1681
1682class OutputStream(object):
093d3ff1 1683 """Proxy of C++ OutputStream class"""
d55e5bfc
RD
1684 def __init__(self): raise RuntimeError, "No constructor defined"
1685 def __repr__(self):
1686 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1687 def write(*args, **kwargs):
1688 """write(self, PyObject obj)"""
1689 return _core_.OutputStream_write(*args, **kwargs)
1690
1691
1692class OutputStreamPtr(OutputStream):
1693 def __init__(self, this):
1694 self.this = this
1695 if not hasattr(self,"thisown"): self.thisown = 0
1696 self.__class__ = OutputStream
1697_core_.OutputStream_swigregister(OutputStreamPtr)
1698
1699#---------------------------------------------------------------------------
1700
1701class FSFile(Object):
093d3ff1 1702 """Proxy of C++ FSFile class"""
d55e5bfc
RD
1703 def __repr__(self):
1704 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1705 def __init__(self, *args, **kwargs):
1706 """
1707 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1708 DateTime modif) -> FSFile
1709 """
1710 newobj = _core_.new_FSFile(*args, **kwargs)
1711 self.this = newobj.this
1712 self.thisown = 1
1713 del newobj.thisown
e2950dbb 1714 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1715
d55e5bfc
RD
1716 def __del__(self, destroy=_core_.delete_FSFile):
1717 """__del__(self)"""
1718 try:
1719 if self.thisown: destroy(self)
1720 except: pass
1721
1722 def GetStream(*args, **kwargs):
1723 """GetStream(self) -> InputStream"""
1724 return _core_.FSFile_GetStream(*args, **kwargs)
1725
1726 def GetMimeType(*args, **kwargs):
1727 """GetMimeType(self) -> String"""
1728 return _core_.FSFile_GetMimeType(*args, **kwargs)
1729
1730 def GetLocation(*args, **kwargs):
1731 """GetLocation(self) -> String"""
1732 return _core_.FSFile_GetLocation(*args, **kwargs)
1733
1734 def GetAnchor(*args, **kwargs):
1735 """GetAnchor(self) -> String"""
1736 return _core_.FSFile_GetAnchor(*args, **kwargs)
1737
1738 def GetModificationTime(*args, **kwargs):
1739 """GetModificationTime(self) -> DateTime"""
1740 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1741
1742
1743class FSFilePtr(FSFile):
1744 def __init__(self, this):
1745 self.this = this
1746 if not hasattr(self,"thisown"): self.thisown = 0
1747 self.__class__ = FSFile
1748_core_.FSFile_swigregister(FSFilePtr)
1749
1750class CPPFileSystemHandler(object):
093d3ff1 1751 """Proxy of C++ CPPFileSystemHandler class"""
d55e5bfc
RD
1752 def __init__(self): raise RuntimeError, "No constructor defined"
1753 def __repr__(self):
1754 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1755
1756class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1757 def __init__(self, this):
1758 self.this = this
1759 if not hasattr(self,"thisown"): self.thisown = 0
1760 self.__class__ = CPPFileSystemHandler
1761_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
1762
1763class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1764 """Proxy of C++ FileSystemHandler class"""
d55e5bfc
RD
1765 def __repr__(self):
1766 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1767 def __init__(self, *args, **kwargs):
1768 """__init__(self) -> FileSystemHandler"""
1769 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
1770 self.this = newobj.this
1771 self.thisown = 1
1772 del newobj.thisown
1773 self._setCallbackInfo(self, FileSystemHandler)
1774
1775 def _setCallbackInfo(*args, **kwargs):
1776 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1777 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1778
1779 def CanOpen(*args, **kwargs):
1780 """CanOpen(self, String location) -> bool"""
1781 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1782
1783 def OpenFile(*args, **kwargs):
1784 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1785 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1786
1787 def FindFirst(*args, **kwargs):
1788 """FindFirst(self, String spec, int flags=0) -> String"""
1789 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1790
1791 def FindNext(*args, **kwargs):
1792 """FindNext(self) -> String"""
1793 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1794
1795 def GetProtocol(*args, **kwargs):
1796 """GetProtocol(self, String location) -> String"""
1797 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1798
1799 def GetLeftLocation(*args, **kwargs):
1800 """GetLeftLocation(self, String location) -> String"""
1801 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1802
1803 def GetAnchor(*args, **kwargs):
1804 """GetAnchor(self, String location) -> String"""
1805 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1806
1807 def GetRightLocation(*args, **kwargs):
1808 """GetRightLocation(self, String location) -> String"""
1809 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1810
1811 def GetMimeTypeFromExt(*args, **kwargs):
1812 """GetMimeTypeFromExt(self, String location) -> String"""
1813 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1814
1815
1816class FileSystemHandlerPtr(FileSystemHandler):
1817 def __init__(self, this):
1818 self.this = this
1819 if not hasattr(self,"thisown"): self.thisown = 0
1820 self.__class__ = FileSystemHandler
1821_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
1822
1823class FileSystem(Object):
093d3ff1 1824 """Proxy of C++ FileSystem class"""
d55e5bfc
RD
1825 def __repr__(self):
1826 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1827 def __init__(self, *args, **kwargs):
1828 """__init__(self) -> FileSystem"""
1829 newobj = _core_.new_FileSystem(*args, **kwargs)
1830 self.this = newobj.this
1831 self.thisown = 1
1832 del newobj.thisown
1833 def __del__(self, destroy=_core_.delete_FileSystem):
1834 """__del__(self)"""
1835 try:
1836 if self.thisown: destroy(self)
1837 except: pass
1838
1839 def ChangePathTo(*args, **kwargs):
1840 """ChangePathTo(self, String location, bool is_dir=False)"""
1841 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1842
1843 def GetPath(*args, **kwargs):
1844 """GetPath(self) -> String"""
1845 return _core_.FileSystem_GetPath(*args, **kwargs)
1846
1847 def OpenFile(*args, **kwargs):
1848 """OpenFile(self, String location) -> FSFile"""
1849 return _core_.FileSystem_OpenFile(*args, **kwargs)
1850
1851 def FindFirst(*args, **kwargs):
1852 """FindFirst(self, String spec, int flags=0) -> String"""
1853 return _core_.FileSystem_FindFirst(*args, **kwargs)
1854
1855 def FindNext(*args, **kwargs):
1856 """FindNext(self) -> String"""
1857 return _core_.FileSystem_FindNext(*args, **kwargs)
1858
1859 def AddHandler(*args, **kwargs):
c24da6d6 1860 """AddHandler(CPPFileSystemHandler handler)"""
d55e5bfc
RD
1861 return _core_.FileSystem_AddHandler(*args, **kwargs)
1862
1863 AddHandler = staticmethod(AddHandler)
1864 def CleanUpHandlers(*args, **kwargs):
c24da6d6 1865 """CleanUpHandlers()"""
d55e5bfc
RD
1866 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1867
1868 CleanUpHandlers = staticmethod(CleanUpHandlers)
1869 def FileNameToURL(*args, **kwargs):
c24da6d6 1870 """FileNameToURL(String filename) -> String"""
d55e5bfc
RD
1871 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1872
1873 FileNameToURL = staticmethod(FileNameToURL)
ae8162c8
RD
1874 def URLToFileName(*args, **kwargs):
1875 """URLToFileName(String url) -> String"""
1876 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1877
1878 URLToFileName = staticmethod(URLToFileName)
d55e5bfc
RD
1879
1880class FileSystemPtr(FileSystem):
1881 def __init__(self, this):
1882 self.this = this
1883 if not hasattr(self,"thisown"): self.thisown = 0
1884 self.__class__ = FileSystem
1885_core_.FileSystem_swigregister(FileSystemPtr)
1886
1887def FileSystem_AddHandler(*args, **kwargs):
1888 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1889 return _core_.FileSystem_AddHandler(*args, **kwargs)
1890
1891def FileSystem_CleanUpHandlers(*args, **kwargs):
1892 """FileSystem_CleanUpHandlers()"""
1893 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1894
1895def FileSystem_FileNameToURL(*args, **kwargs):
1896 """FileSystem_FileNameToURL(String filename) -> String"""
1897 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1898
d55e5bfc
RD
1899def FileSystem_URLToFileName(*args, **kwargs):
1900 """FileSystem_URLToFileName(String url) -> String"""
1901 return _core_.FileSystem_URLToFileName(*args, **kwargs)
ae8162c8 1902
d55e5bfc 1903class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1904 """Proxy of C++ InternetFSHandler class"""
d55e5bfc
RD
1905 def __repr__(self):
1906 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1907 def __init__(self, *args, **kwargs):
1908 """__init__(self) -> InternetFSHandler"""
1909 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
1910 self.this = newobj.this
1911 self.thisown = 1
1912 del newobj.thisown
1913 def CanOpen(*args, **kwargs):
1914 """CanOpen(self, String location) -> bool"""
1915 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1916
1917 def OpenFile(*args, **kwargs):
1918 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1919 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1920
1921
1922class InternetFSHandlerPtr(InternetFSHandler):
1923 def __init__(self, this):
1924 self.this = this
1925 if not hasattr(self,"thisown"): self.thisown = 0
1926 self.__class__ = InternetFSHandler
1927_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
1928
1929class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1930 """Proxy of C++ ZipFSHandler class"""
d55e5bfc
RD
1931 def __repr__(self):
1932 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1933 def __init__(self, *args, **kwargs):
1934 """__init__(self) -> ZipFSHandler"""
1935 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
1936 self.this = newobj.this
1937 self.thisown = 1
1938 del newobj.thisown
1939 def CanOpen(*args, **kwargs):
1940 """CanOpen(self, String location) -> bool"""
1941 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1942
1943 def OpenFile(*args, **kwargs):
1944 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1945 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1946
1947 def FindFirst(*args, **kwargs):
1948 """FindFirst(self, String spec, int flags=0) -> String"""
1949 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1950
1951 def FindNext(*args, **kwargs):
1952 """FindNext(self) -> String"""
1953 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1954
1955
1956class ZipFSHandlerPtr(ZipFSHandler):
1957 def __init__(self, this):
1958 self.this = this
1959 if not hasattr(self,"thisown"): self.thisown = 0
1960 self.__class__ = ZipFSHandler
1961_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
1962
1963
1964def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1965 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1966 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1967
1968def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1969 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1970 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1971
1972def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1973 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1974 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
ae8162c8
RD
1975def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1976 """
1977 Add 'file' to the memory filesystem. The dataItem parameter can
1978 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1979 arbitrary data. If a bitmap or image is used then the imgType
1980 parameter should specify what kind of image file it should be
1981 written as, wx.BITMAP_TYPE_PNG, etc.
1982 """
1983 if isinstance(dataItem, wx.Image):
1984 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1985 elif isinstance(dataItem, wx.Bitmap):
1986 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1987 elif type(dataItem) == str:
1988 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1989 else:
1990 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc
RD
1991
1992class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 1993 """Proxy of C++ MemoryFSHandler class"""
d55e5bfc
RD
1994 def __repr__(self):
1995 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1996 def __init__(self, *args, **kwargs):
1997 """__init__(self) -> MemoryFSHandler"""
1998 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
1999 self.this = newobj.this
2000 self.thisown = 1
2001 del newobj.thisown
2002 def RemoveFile(*args, **kwargs):
c24da6d6 2003 """RemoveFile(String filename)"""
d55e5bfc
RD
2004 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2005
2006 RemoveFile = staticmethod(RemoveFile)
2007 AddFile = staticmethod(MemoryFSHandler_AddFile)
2008 def CanOpen(*args, **kwargs):
2009 """CanOpen(self, String location) -> bool"""
2010 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2011
2012 def OpenFile(*args, **kwargs):
2013 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2014 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2015
2016 def FindFirst(*args, **kwargs):
2017 """FindFirst(self, String spec, int flags=0) -> String"""
2018 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2019
2020 def FindNext(*args, **kwargs):
2021 """FindNext(self) -> String"""
2022 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2023
2024
2025class MemoryFSHandlerPtr(MemoryFSHandler):
2026 def __init__(self, this):
2027 self.this = this
2028 if not hasattr(self,"thisown"): self.thisown = 0
2029 self.__class__ = MemoryFSHandler
2030_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
2031
2032def MemoryFSHandler_RemoveFile(*args, **kwargs):
2033 """MemoryFSHandler_RemoveFile(String filename)"""
2034 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2035
2036#---------------------------------------------------------------------------
2037
2038class ImageHandler(Object):
093d3ff1 2039 """Proxy of C++ ImageHandler class"""
d55e5bfc
RD
2040 def __init__(self): raise RuntimeError, "No constructor defined"
2041 def __repr__(self):
2042 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2043 def GetName(*args, **kwargs):
2044 """GetName(self) -> String"""
2045 return _core_.ImageHandler_GetName(*args, **kwargs)
2046
2047 def GetExtension(*args, **kwargs):
2048 """GetExtension(self) -> String"""
2049 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2050
2051 def GetType(*args, **kwargs):
2052 """GetType(self) -> long"""
2053 return _core_.ImageHandler_GetType(*args, **kwargs)
2054
2055 def GetMimeType(*args, **kwargs):
2056 """GetMimeType(self) -> String"""
2057 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2058
2059 def CanRead(*args, **kwargs):
2060 """CanRead(self, String name) -> bool"""
2061 return _core_.ImageHandler_CanRead(*args, **kwargs)
2062
2063 def SetName(*args, **kwargs):
2064 """SetName(self, String name)"""
2065 return _core_.ImageHandler_SetName(*args, **kwargs)
2066
2067 def SetExtension(*args, **kwargs):
2068 """SetExtension(self, String extension)"""
2069 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2070
2071 def SetType(*args, **kwargs):
2072 """SetType(self, long type)"""
2073 return _core_.ImageHandler_SetType(*args, **kwargs)
2074
2075 def SetMimeType(*args, **kwargs):
2076 """SetMimeType(self, String mimetype)"""
2077 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2078
2079
2080class ImageHandlerPtr(ImageHandler):
2081 def __init__(self, this):
2082 self.this = this
2083 if not hasattr(self,"thisown"): self.thisown = 0
2084 self.__class__ = ImageHandler
2085_core_.ImageHandler_swigregister(ImageHandlerPtr)
2086
2087class ImageHistogram(object):
093d3ff1 2088 """Proxy of C++ ImageHistogram class"""
d55e5bfc
RD
2089 def __repr__(self):
2090 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2091 def __init__(self, *args, **kwargs):
2092 """__init__(self) -> ImageHistogram"""
2093 newobj = _core_.new_ImageHistogram(*args, **kwargs)
2094 self.this = newobj.this
2095 self.thisown = 1
2096 del newobj.thisown
2097 def MakeKey(*args, **kwargs):
2098 """
c24da6d6 2099 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
d55e5bfc
RD
2100
2101 Get the key in the histogram for the given RGB values
2102 """
2103 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2104
2105 MakeKey = staticmethod(MakeKey)
2106 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2107 """
2108 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2109
2110 Find first colour that is not used in the image and has higher RGB
2111 values than startR, startG, startB. Returns a tuple consisting of a
2112 success flag and rgb values.
2113 """
d55e5bfc
RD
2114 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2115
f1cbd8fa
RD
2116 def GetCount(*args, **kwargs):
2117 """
2118 GetCount(self, unsigned long key) -> unsigned long
2119
2120 Returns the pixel count for the given key. Use `MakeKey` to create a
2121 key value from a RGB tripple.
2122 """
2123 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2124
2125 def GetCountRGB(*args, **kwargs):
2126 """
2127 GetCountRGB(self, unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2128
2129 Returns the pixel count for the given RGB values.
2130 """
2131 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2132
2133 def GetCountColour(*args, **kwargs):
2134 """
2135 GetCountColour(self, Colour colour) -> unsigned long
2136
2137 Returns the pixel count for the given `wx.Colour` value.
2138 """
2139 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2140
d55e5bfc
RD
2141
2142class ImageHistogramPtr(ImageHistogram):
2143 def __init__(self, this):
2144 self.this = this
2145 if not hasattr(self,"thisown"): self.thisown = 0
2146 self.__class__ = ImageHistogram
2147_core_.ImageHistogram_swigregister(ImageHistogramPtr)
2148
2149def ImageHistogram_MakeKey(*args, **kwargs):
2150 """
2151 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2152
2153 Get the key in the histogram for the given RGB values
2154 """
2155 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2156
2157class Image(Object):
093d3ff1 2158 """Proxy of C++ Image class"""
d55e5bfc
RD
2159 def __repr__(self):
2160 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2161 def __init__(self, *args, **kwargs):
2162 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2163 newobj = _core_.new_Image(*args, **kwargs)
2164 self.this = newobj.this
2165 self.thisown = 1
2166 del newobj.thisown
2167 def __del__(self, destroy=_core_.delete_Image):
2168 """__del__(self)"""
2169 try:
2170 if self.thisown: destroy(self)
2171 except: pass
2172
2173 def Create(*args, **kwargs):
2174 """Create(self, int width, int height)"""
2175 return _core_.Image_Create(*args, **kwargs)
2176
2177 def Destroy(*args, **kwargs):
2178 """
2179 Destroy(self)
2180
2181 Deletes the C++ object this Python object is a proxy for.
2182 """
2183 return _core_.Image_Destroy(*args, **kwargs)
2184
2185 def Scale(*args, **kwargs):
2186 """Scale(self, int width, int height) -> Image"""
2187 return _core_.Image_Scale(*args, **kwargs)
2188
2189 def ShrinkBy(*args, **kwargs):
2190 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
2191 return _core_.Image_ShrinkBy(*args, **kwargs)
2192
2193 def Rescale(*args, **kwargs):
2194 """Rescale(self, int width, int height) -> Image"""
2195 return _core_.Image_Rescale(*args, **kwargs)
2196
aff4cc5c
RD
2197 def Resize(*args, **kwargs):
2198 """Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image"""
2199 return _core_.Image_Resize(*args, **kwargs)
2200
d55e5bfc
RD
2201 def SetRGB(*args, **kwargs):
2202 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
2203 return _core_.Image_SetRGB(*args, **kwargs)
2204
aff4cc5c
RD
2205 def SetRGBRect(*args, **kwargs):
2206 """SetRGBRect(self, Rect rect, unsigned char r, unsigned char g, unsigned char b)"""
2207 return _core_.Image_SetRGBRect(*args, **kwargs)
2208
d55e5bfc
RD
2209 def GetRed(*args, **kwargs):
2210 """GetRed(self, int x, int y) -> unsigned char"""
2211 return _core_.Image_GetRed(*args, **kwargs)
2212
2213 def GetGreen(*args, **kwargs):
2214 """GetGreen(self, int x, int y) -> unsigned char"""
2215 return _core_.Image_GetGreen(*args, **kwargs)
2216
2217 def GetBlue(*args, **kwargs):
2218 """GetBlue(self, int x, int y) -> unsigned char"""
2219 return _core_.Image_GetBlue(*args, **kwargs)
2220
2221 def SetAlpha(*args, **kwargs):
2222 """SetAlpha(self, int x, int y, unsigned char alpha)"""
2223 return _core_.Image_SetAlpha(*args, **kwargs)
2224
2225 def GetAlpha(*args, **kwargs):
2226 """GetAlpha(self, int x, int y) -> unsigned char"""
2227 return _core_.Image_GetAlpha(*args, **kwargs)
2228
2229 def HasAlpha(*args, **kwargs):
2230 """HasAlpha(self) -> bool"""
2231 return _core_.Image_HasAlpha(*args, **kwargs)
2232
68350608
RD
2233 def InitAlpha(*args, **kwargs):
2234 """
2235 InitAlpha(self)
2236
2237 Initializes the image alpha channel data. It is an error to call it if
2238 the image already has alpha data. If it doesn't, alpha data will be by
2239 default initialized to all pixels being fully opaque. But if the image
2240 has a a mask colour, all mask pixels will be completely transparent.
2241 """
2242 return _core_.Image_InitAlpha(*args, **kwargs)
2243
d55e5bfc 2244 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2245 """
2246 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2247
2248 Find first colour that is not used in the image and has higher RGB
2249 values than startR, startG, startB. Returns a tuple consisting of a
2250 success flag and rgb values.
2251 """
d55e5bfc
RD
2252 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2253
4cf4100f
RD
2254 def ConvertAlphaToMask(*args, **kwargs):
2255 """
2256 ConvertAlphaToMask(self, byte threshold=128) -> bool
2257
2258 If the image has alpha channel, this method converts it to mask. All pixels
2259 with alpha value less than ``threshold`` are replaced with mask colour and the
2260 alpha channel is removed. Mask colour is chosen automatically using
2261 `FindFirstUnusedColour`.
2262
2263 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2264 nothing.
2265 """
2266 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2267
8fb0e70a
RD
2268 def ConvertColourToAlpha(*args, **kwargs):
2269 """
2270 ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool
2271
2272 This method converts an image where the original alpha information is
2273 only available as a shades of a colour (actually shades of grey)
2274 typically when you draw anti-aliased text into a bitmap. The DC
2275 drawing routines draw grey values on the black background although
2276 they actually mean to draw white with differnt alpha values. This
2277 method reverses it, assuming a black (!) background and white text.
2278 The method will then fill up the whole image with the colour given.
2279 """
2280 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2281
d55e5bfc
RD
2282 def SetMaskFromImage(*args, **kwargs):
2283 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
2284 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2285
2286 def CanRead(*args, **kwargs):
c24da6d6 2287 """CanRead(String name) -> bool"""
d55e5bfc
RD
2288 return _core_.Image_CanRead(*args, **kwargs)
2289
2290 CanRead = staticmethod(CanRead)
2291 def GetImageCount(*args, **kwargs):
c24da6d6 2292 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
d55e5bfc
RD
2293 return _core_.Image_GetImageCount(*args, **kwargs)
2294
2295 GetImageCount = staticmethod(GetImageCount)
2296 def LoadFile(*args, **kwargs):
2297 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2298 return _core_.Image_LoadFile(*args, **kwargs)
2299
2300 def LoadMimeFile(*args, **kwargs):
2301 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
2302 return _core_.Image_LoadMimeFile(*args, **kwargs)
2303
2304 def SaveFile(*args, **kwargs):
2305 """SaveFile(self, String name, int type) -> bool"""
2306 return _core_.Image_SaveFile(*args, **kwargs)
2307
2308 def SaveMimeFile(*args, **kwargs):
2309 """SaveMimeFile(self, String name, String mimetype) -> bool"""
2310 return _core_.Image_SaveMimeFile(*args, **kwargs)
2311
2312 def CanReadStream(*args, **kwargs):
c24da6d6 2313 """CanReadStream(InputStream stream) -> bool"""
d55e5bfc
RD
2314 return _core_.Image_CanReadStream(*args, **kwargs)
2315
2316 CanReadStream = staticmethod(CanReadStream)
2317 def LoadStream(*args, **kwargs):
2318 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2319 return _core_.Image_LoadStream(*args, **kwargs)
2320
2321 def LoadMimeStream(*args, **kwargs):
2322 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
2323 return _core_.Image_LoadMimeStream(*args, **kwargs)
2324
2325 def Ok(*args, **kwargs):
2326 """Ok(self) -> bool"""
2327 return _core_.Image_Ok(*args, **kwargs)
2328
2329 def GetWidth(*args, **kwargs):
2330 """GetWidth(self) -> int"""
2331 return _core_.Image_GetWidth(*args, **kwargs)
2332
2333 def GetHeight(*args, **kwargs):
2334 """GetHeight(self) -> int"""
2335 return _core_.Image_GetHeight(*args, **kwargs)
2336
2337 def GetSize(*args, **kwargs):
2338 """GetSize(self) -> Size"""
2339 return _core_.Image_GetSize(*args, **kwargs)
2340
2341 def GetSubImage(*args, **kwargs):
2342 """GetSubImage(self, Rect rect) -> Image"""
2343 return _core_.Image_GetSubImage(*args, **kwargs)
2344
aff4cc5c
RD
2345 def Size(*args, **kwargs):
2346 """Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image"""
2347 return _core_.Image_Size(*args, **kwargs)
2348
d55e5bfc
RD
2349 def Copy(*args, **kwargs):
2350 """Copy(self) -> Image"""
2351 return _core_.Image_Copy(*args, **kwargs)
2352
2353 def Paste(*args, **kwargs):
2354 """Paste(self, Image image, int x, int y)"""
2355 return _core_.Image_Paste(*args, **kwargs)
2356
2357 def GetData(*args, **kwargs):
ea939623
RD
2358 """
2359 GetData(self) -> PyObject
2360
2361 Returns a string containing a copy of the RGB bytes of the image.
2362 """
d55e5bfc
RD
2363 return _core_.Image_GetData(*args, **kwargs)
2364
2365 def SetData(*args, **kwargs):
ea939623
RD
2366 """
2367 SetData(self, buffer data)
2368
2369 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2370 either a string or a buffer object holding the data and the length of
2371 the data must be width*height*3.
2372 """
d55e5bfc
RD
2373 return _core_.Image_SetData(*args, **kwargs)
2374
2375 def GetDataBuffer(*args, **kwargs):
ea939623
RD
2376 """
2377 GetDataBuffer(self) -> PyObject
2378
2379 Returns a writable Python buffer object that is pointing at the RGB
2380 image data buffer inside the wx.Image.
2381 """
d55e5bfc
RD
2382 return _core_.Image_GetDataBuffer(*args, **kwargs)
2383
2384 def SetDataBuffer(*args, **kwargs):
ea939623
RD
2385 """
2386 SetDataBuffer(self, buffer data)
2387
2388 Sets the internal image data pointer to point at a Python buffer
2389 object. This can save a copy of the data but you must ensure that the
2390 buffer object lives longer than the wx.Image does.
2391 """
d55e5bfc
RD
2392 return _core_.Image_SetDataBuffer(*args, **kwargs)
2393
2394 def GetAlphaData(*args, **kwargs):
ea939623
RD
2395 """
2396 GetAlphaData(self) -> PyObject
2397
2398 Returns a string containing a copy of the alpha bytes of the image.
2399 """
d55e5bfc
RD
2400 return _core_.Image_GetAlphaData(*args, **kwargs)
2401
2402 def SetAlphaData(*args, **kwargs):
ea939623
RD
2403 """
2404 SetAlphaData(self, buffer alpha)
2405
2406 Resets the Image's alpha data from a buffer of bytes. Accepts either
2407 a string or a buffer object holding the data and the length of the
2408 data must be width*height.
2409 """
d55e5bfc
RD
2410 return _core_.Image_SetAlphaData(*args, **kwargs)
2411
2412 def GetAlphaBuffer(*args, **kwargs):
2413 """GetAlphaBuffer(self) -> PyObject"""
2414 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2415
2416 def SetAlphaBuffer(*args, **kwargs):
ea939623 2417 """SetAlphaBuffer(self, buffer alpha)"""
d55e5bfc
RD
2418 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2419
2420 def SetMaskColour(*args, **kwargs):
2421 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
2422 return _core_.Image_SetMaskColour(*args, **kwargs)
2423
aff4cc5c
RD
2424 def GetOrFindMaskColour(*args, **kwargs):
2425 """
2426 GetOrFindMaskColour() -> (r,g,b)
2427
2428 Get the current mask colour or find a suitable colour.
2429 """
2430 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2431
d55e5bfc
RD
2432 def GetMaskRed(*args, **kwargs):
2433 """GetMaskRed(self) -> unsigned char"""
2434 return _core_.Image_GetMaskRed(*args, **kwargs)
2435
2436 def GetMaskGreen(*args, **kwargs):
2437 """GetMaskGreen(self) -> unsigned char"""
2438 return _core_.Image_GetMaskGreen(*args, **kwargs)
2439
2440 def GetMaskBlue(*args, **kwargs):
2441 """GetMaskBlue(self) -> unsigned char"""
2442 return _core_.Image_GetMaskBlue(*args, **kwargs)
2443
2444 def SetMask(*args, **kwargs):
2445 """SetMask(self, bool mask=True)"""
2446 return _core_.Image_SetMask(*args, **kwargs)
2447
2448 def HasMask(*args, **kwargs):
2449 """HasMask(self) -> bool"""
2450 return _core_.Image_HasMask(*args, **kwargs)
2451
2452 def Rotate(*args, **kwargs):
2453 """
2454 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2455 Point offset_after_rotation=None) -> Image
2456 """
2457 return _core_.Image_Rotate(*args, **kwargs)
2458
2459 def Rotate90(*args, **kwargs):
2460 """Rotate90(self, bool clockwise=True) -> Image"""
2461 return _core_.Image_Rotate90(*args, **kwargs)
2462
2463 def Mirror(*args, **kwargs):
2464 """Mirror(self, bool horizontally=True) -> Image"""
2465 return _core_.Image_Mirror(*args, **kwargs)
2466
2467 def Replace(*args, **kwargs):
2468 """
2469 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
2470 unsigned char r2, unsigned char g2, unsigned char b2)
2471 """
2472 return _core_.Image_Replace(*args, **kwargs)
2473
2474 def ConvertToMono(*args, **kwargs):
2475 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
2476 return _core_.Image_ConvertToMono(*args, **kwargs)
2477
2478 def SetOption(*args, **kwargs):
2479 """SetOption(self, String name, String value)"""
2480 return _core_.Image_SetOption(*args, **kwargs)
2481
2482 def SetOptionInt(*args, **kwargs):
2483 """SetOptionInt(self, String name, int value)"""
2484 return _core_.Image_SetOptionInt(*args, **kwargs)
2485
2486 def GetOption(*args, **kwargs):
2487 """GetOption(self, String name) -> String"""
2488 return _core_.Image_GetOption(*args, **kwargs)
2489
2490 def GetOptionInt(*args, **kwargs):
2491 """GetOptionInt(self, String name) -> int"""
2492 return _core_.Image_GetOptionInt(*args, **kwargs)
2493
2494 def HasOption(*args, **kwargs):
2495 """HasOption(self, String name) -> bool"""
2496 return _core_.Image_HasOption(*args, **kwargs)
2497
2498 def CountColours(*args, **kwargs):
2499 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2500 return _core_.Image_CountColours(*args, **kwargs)
2501
2502 def ComputeHistogram(*args, **kwargs):
2503 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2504 return _core_.Image_ComputeHistogram(*args, **kwargs)
2505
2506 def AddHandler(*args, **kwargs):
c24da6d6 2507 """AddHandler(ImageHandler handler)"""
d55e5bfc
RD
2508 return _core_.Image_AddHandler(*args, **kwargs)
2509
2510 AddHandler = staticmethod(AddHandler)
2511 def InsertHandler(*args, **kwargs):
c24da6d6 2512 """InsertHandler(ImageHandler handler)"""
d55e5bfc
RD
2513 return _core_.Image_InsertHandler(*args, **kwargs)
2514
2515 InsertHandler = staticmethod(InsertHandler)
2516 def RemoveHandler(*args, **kwargs):
c24da6d6 2517 """RemoveHandler(String name) -> bool"""
d55e5bfc
RD
2518 return _core_.Image_RemoveHandler(*args, **kwargs)
2519
2520 RemoveHandler = staticmethod(RemoveHandler)
2521 def GetImageExtWildcard(*args, **kwargs):
c24da6d6 2522 """GetImageExtWildcard() -> String"""
d55e5bfc
RD
2523 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2524
2525 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2526 def ConvertToBitmap(*args, **kwargs):
1fbf26be 2527 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
d55e5bfc
RD
2528 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2529
2530 def ConvertToMonoBitmap(*args, **kwargs):
2531 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
2532 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2533
2534 def __nonzero__(self): return self.Ok()
2535
2536class ImagePtr(Image):
2537 def __init__(self, this):
2538 self.this = this
2539 if not hasattr(self,"thisown"): self.thisown = 0
2540 self.__class__ = Image
2541_core_.Image_swigregister(ImagePtr)
2542
2543def ImageFromMime(*args, **kwargs):
2544 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
2545 val = _core_.new_ImageFromMime(*args, **kwargs)
2546 val.thisown = 1
2547 return val
2548
2549def ImageFromStream(*args, **kwargs):
2550 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2551 val = _core_.new_ImageFromStream(*args, **kwargs)
2552 val.thisown = 1
2553 return val
2554
2555def ImageFromStreamMime(*args, **kwargs):
2556 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
2557 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2558 val.thisown = 1
2559 return val
2560
c24da6d6 2561def EmptyImage(*args, **kwargs):
ea939623
RD
2562 """
2563 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2564
2565 Construct an empty image of a given size, optionally setting all
2566 pixels to black.
2567 """
c24da6d6 2568 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2569 val.thisown = 1
2570 return val
2571
2572def ImageFromBitmap(*args, **kwargs):
ea939623
RD
2573 """
2574 ImageFromBitmap(Bitmap bitmap) -> Image
2575
2576 Construct an Image from a `wx.Bitmap`.
2577 """
d55e5bfc
RD
2578 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2579 val.thisown = 1
2580 return val
2581
2582def ImageFromData(*args, **kwargs):
ea939623
RD
2583 """
2584 ImageFromData(int width, int height, buffer data) -> Image
2585
2586 Construct an Image from a buffer of RGB bytes. Accepts either a
2587 string or a buffer object holding the data and the length of the data
2588 must be width*height*3.
2589 """
d55e5bfc
RD
2590 val = _core_.new_ImageFromData(*args, **kwargs)
2591 val.thisown = 1
2592 return val
2593
c9c2cf70 2594def ImageFromDataWithAlpha(*args, **kwargs):
ea939623
RD
2595 """
2596 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2597
2598 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2599 Accepts either a string or a buffer object holding the data and the
2600 length of the data must be width*height*3.
2601 """
c9c2cf70
RD
2602 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2603 val.thisown = 1
2604 return val
2605
d55e5bfc
RD
2606def Image_CanRead(*args, **kwargs):
2607 """Image_CanRead(String name) -> bool"""
2608 return _core_.Image_CanRead(*args, **kwargs)
2609
2610def Image_GetImageCount(*args, **kwargs):
2611 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2612 return _core_.Image_GetImageCount(*args, **kwargs)
2613
2614def Image_CanReadStream(*args, **kwargs):
2615 """Image_CanReadStream(InputStream stream) -> bool"""
2616 return _core_.Image_CanReadStream(*args, **kwargs)
2617
2618def Image_AddHandler(*args, **kwargs):
2619 """Image_AddHandler(ImageHandler handler)"""
2620 return _core_.Image_AddHandler(*args, **kwargs)
2621
2622def Image_InsertHandler(*args, **kwargs):
2623 """Image_InsertHandler(ImageHandler handler)"""
2624 return _core_.Image_InsertHandler(*args, **kwargs)
2625
2626def Image_RemoveHandler(*args, **kwargs):
2627 """Image_RemoveHandler(String name) -> bool"""
2628 return _core_.Image_RemoveHandler(*args, **kwargs)
2629
2630def Image_GetImageExtWildcard(*args, **kwargs):
2631 """Image_GetImageExtWildcard() -> String"""
2632 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2633
a07a67e6
RD
2634def InitAllImageHandlers():
2635 """
2636 The former functionality of InitAllImageHanders is now done internal to
2637 the _core_ extension module and so this function has become a simple NOP.
2638 """
2639 pass
d55e5bfc 2640
d55e5bfc
RD
2641IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2642IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
2643PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
2644PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
2645PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
d55e5bfc
RD
2646BMP_24BPP = _core_.BMP_24BPP
2647BMP_8BPP = _core_.BMP_8BPP
2648BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2649BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2650BMP_8BPP_RED = _core_.BMP_8BPP_RED
2651BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2652BMP_4BPP = _core_.BMP_4BPP
2653BMP_1BPP = _core_.BMP_1BPP
2654BMP_1BPP_BW = _core_.BMP_1BPP_BW
2655class BMPHandler(ImageHandler):
093d3ff1 2656 """Proxy of C++ BMPHandler class"""
d55e5bfc
RD
2657 def __repr__(self):
2658 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2659 def __init__(self, *args, **kwargs):
2660 """__init__(self) -> BMPHandler"""
2661 newobj = _core_.new_BMPHandler(*args, **kwargs)
2662 self.this = newobj.this
2663 self.thisown = 1
2664 del newobj.thisown
2665
2666class BMPHandlerPtr(BMPHandler):
2667 def __init__(self, this):
2668 self.this = this
2669 if not hasattr(self,"thisown"): self.thisown = 0
2670 self.__class__ = BMPHandler
2671_core_.BMPHandler_swigregister(BMPHandlerPtr)
2672NullImage = cvar.NullImage
68350608 2673IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
2674IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2675IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2676IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2677IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
2678IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
2679IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 2680IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 2681IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
2682IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
2683IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
2684IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
2685IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
2686IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
2687IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc
RD
2688
2689class ICOHandler(BMPHandler):
093d3ff1 2690 """Proxy of C++ ICOHandler class"""
d55e5bfc
RD
2691 def __repr__(self):
2692 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2693 def __init__(self, *args, **kwargs):
2694 """__init__(self) -> ICOHandler"""
2695 newobj = _core_.new_ICOHandler(*args, **kwargs)
2696 self.this = newobj.this
2697 self.thisown = 1
2698 del newobj.thisown
2699
2700class ICOHandlerPtr(ICOHandler):
2701 def __init__(self, this):
2702 self.this = this
2703 if not hasattr(self,"thisown"): self.thisown = 0
2704 self.__class__ = ICOHandler
2705_core_.ICOHandler_swigregister(ICOHandlerPtr)
2706
2707class CURHandler(ICOHandler):
093d3ff1 2708 """Proxy of C++ CURHandler class"""
d55e5bfc
RD
2709 def __repr__(self):
2710 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2711 def __init__(self, *args, **kwargs):
2712 """__init__(self) -> CURHandler"""
2713 newobj = _core_.new_CURHandler(*args, **kwargs)
2714 self.this = newobj.this
2715 self.thisown = 1
2716 del newobj.thisown
2717
2718class CURHandlerPtr(CURHandler):
2719 def __init__(self, this):
2720 self.this = this
2721 if not hasattr(self,"thisown"): self.thisown = 0
2722 self.__class__ = CURHandler
2723_core_.CURHandler_swigregister(CURHandlerPtr)
2724
2725class ANIHandler(CURHandler):
093d3ff1 2726 """Proxy of C++ ANIHandler class"""
d55e5bfc
RD
2727 def __repr__(self):
2728 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2729 def __init__(self, *args, **kwargs):
2730 """__init__(self) -> ANIHandler"""
2731 newobj = _core_.new_ANIHandler(*args, **kwargs)
2732 self.this = newobj.this
2733 self.thisown = 1
2734 del newobj.thisown
2735
2736class ANIHandlerPtr(ANIHandler):
2737 def __init__(self, this):
2738 self.this = this
2739 if not hasattr(self,"thisown"): self.thisown = 0
2740 self.__class__ = ANIHandler
2741_core_.ANIHandler_swigregister(ANIHandlerPtr)
2742
2743class PNGHandler(ImageHandler):
093d3ff1 2744 """Proxy of C++ PNGHandler class"""
d55e5bfc
RD
2745 def __repr__(self):
2746 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2747 def __init__(self, *args, **kwargs):
2748 """__init__(self) -> PNGHandler"""
2749 newobj = _core_.new_PNGHandler(*args, **kwargs)
2750 self.this = newobj.this
2751 self.thisown = 1
2752 del newobj.thisown
2753
2754class PNGHandlerPtr(PNGHandler):
2755 def __init__(self, this):
2756 self.this = this
2757 if not hasattr(self,"thisown"): self.thisown = 0
2758 self.__class__ = PNGHandler
2759_core_.PNGHandler_swigregister(PNGHandlerPtr)
2760
2761class GIFHandler(ImageHandler):
093d3ff1 2762 """Proxy of C++ GIFHandler class"""
d55e5bfc
RD
2763 def __repr__(self):
2764 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2765 def __init__(self, *args, **kwargs):
2766 """__init__(self) -> GIFHandler"""
2767 newobj = _core_.new_GIFHandler(*args, **kwargs)
2768 self.this = newobj.this
2769 self.thisown = 1
2770 del newobj.thisown
2771
2772class GIFHandlerPtr(GIFHandler):
2773 def __init__(self, this):
2774 self.this = this
2775 if not hasattr(self,"thisown"): self.thisown = 0
2776 self.__class__ = GIFHandler
2777_core_.GIFHandler_swigregister(GIFHandlerPtr)
2778
2779class PCXHandler(ImageHandler):
093d3ff1 2780 """Proxy of C++ PCXHandler class"""
d55e5bfc
RD
2781 def __repr__(self):
2782 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2783 def __init__(self, *args, **kwargs):
2784 """__init__(self) -> PCXHandler"""
2785 newobj = _core_.new_PCXHandler(*args, **kwargs)
2786 self.this = newobj.this
2787 self.thisown = 1
2788 del newobj.thisown
2789
2790class PCXHandlerPtr(PCXHandler):
2791 def __init__(self, this):
2792 self.this = this
2793 if not hasattr(self,"thisown"): self.thisown = 0
2794 self.__class__ = PCXHandler
2795_core_.PCXHandler_swigregister(PCXHandlerPtr)
2796
2797class JPEGHandler(ImageHandler):
093d3ff1 2798 """Proxy of C++ JPEGHandler class"""
d55e5bfc
RD
2799 def __repr__(self):
2800 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2801 def __init__(self, *args, **kwargs):
2802 """__init__(self) -> JPEGHandler"""
2803 newobj = _core_.new_JPEGHandler(*args, **kwargs)
2804 self.this = newobj.this
2805 self.thisown = 1
2806 del newobj.thisown
2807
2808class JPEGHandlerPtr(JPEGHandler):
2809 def __init__(self, this):
2810 self.this = this
2811 if not hasattr(self,"thisown"): self.thisown = 0
2812 self.__class__ = JPEGHandler
2813_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
2814
2815class PNMHandler(ImageHandler):
093d3ff1 2816 """Proxy of C++ PNMHandler class"""
d55e5bfc
RD
2817 def __repr__(self):
2818 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2819 def __init__(self, *args, **kwargs):
2820 """__init__(self) -> PNMHandler"""
2821 newobj = _core_.new_PNMHandler(*args, **kwargs)
2822 self.this = newobj.this
2823 self.thisown = 1
2824 del newobj.thisown
2825
2826class PNMHandlerPtr(PNMHandler):
2827 def __init__(self, this):
2828 self.this = this
2829 if not hasattr(self,"thisown"): self.thisown = 0
2830 self.__class__ = PNMHandler
2831_core_.PNMHandler_swigregister(PNMHandlerPtr)
2832
2833class XPMHandler(ImageHandler):
093d3ff1 2834 """Proxy of C++ XPMHandler class"""
d55e5bfc
RD
2835 def __repr__(self):
2836 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2837 def __init__(self, *args, **kwargs):
2838 """__init__(self) -> XPMHandler"""
2839 newobj = _core_.new_XPMHandler(*args, **kwargs)
2840 self.this = newobj.this
2841 self.thisown = 1
2842 del newobj.thisown
2843
2844class XPMHandlerPtr(XPMHandler):
2845 def __init__(self, this):
2846 self.this = this
2847 if not hasattr(self,"thisown"): self.thisown = 0
2848 self.__class__ = XPMHandler
2849_core_.XPMHandler_swigregister(XPMHandlerPtr)
2850
2851class TIFFHandler(ImageHandler):
093d3ff1 2852 """Proxy of C++ TIFFHandler class"""
d55e5bfc
RD
2853 def __repr__(self):
2854 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2855 def __init__(self, *args, **kwargs):
2856 """__init__(self) -> TIFFHandler"""
2857 newobj = _core_.new_TIFFHandler(*args, **kwargs)
2858 self.this = newobj.this
2859 self.thisown = 1
2860 del newobj.thisown
2861
2862class TIFFHandlerPtr(TIFFHandler):
2863 def __init__(self, this):
2864 self.this = this
2865 if not hasattr(self,"thisown"): self.thisown = 0
2866 self.__class__ = TIFFHandler
2867_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
2868
c0de73ae
RD
2869QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
2870QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
2871class Quantize(object):
2872 """Performs quantization, or colour reduction, on a wxImage."""
2873 def __init__(self): raise RuntimeError, "No constructor defined"
2874 def __repr__(self):
2875 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2876 def Quantize(*args, **kwargs):
2877 """
2878 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2879
2880 Reduce the colours in the source image and put the result into the
2881 destination image, setting the palette in the destination if
2882 needed. Both images may be the same, to overwrite the source image.
2883 """
2884 return _core_.Quantize_Quantize(*args, **kwargs)
2885
2886 Quantize = staticmethod(Quantize)
2887
2888class QuantizePtr(Quantize):
2889 def __init__(self, this):
2890 self.this = this
2891 if not hasattr(self,"thisown"): self.thisown = 0
2892 self.__class__ = Quantize
2893_core_.Quantize_swigregister(QuantizePtr)
2894
2895def Quantize_Quantize(*args, **kwargs):
2896 """
2897 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2898
2899 Reduce the colours in the source image and put the result into the
2900 destination image, setting the palette in the destination if
2901 needed. Both images may be the same, to overwrite the source image.
2902 """
2903 return _core_.Quantize_Quantize(*args, **kwargs)
2904
d55e5bfc
RD
2905#---------------------------------------------------------------------------
2906
2907class EvtHandler(Object):
093d3ff1 2908 """Proxy of C++ EvtHandler class"""
d55e5bfc
RD
2909 def __repr__(self):
2910 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2911 def __init__(self, *args, **kwargs):
2912 """__init__(self) -> EvtHandler"""
2913 newobj = _core_.new_EvtHandler(*args, **kwargs)
2914 self.this = newobj.this
2915 self.thisown = 1
2916 del newobj.thisown
2917 def GetNextHandler(*args, **kwargs):
2918 """GetNextHandler(self) -> EvtHandler"""
2919 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
2920
2921 def GetPreviousHandler(*args, **kwargs):
2922 """GetPreviousHandler(self) -> EvtHandler"""
2923 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
2924
2925 def SetNextHandler(*args, **kwargs):
2926 """SetNextHandler(self, EvtHandler handler)"""
2927 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
2928
2929 def SetPreviousHandler(*args, **kwargs):
2930 """SetPreviousHandler(self, EvtHandler handler)"""
2931 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
2932
2933 def GetEvtHandlerEnabled(*args, **kwargs):
2934 """GetEvtHandlerEnabled(self) -> bool"""
2935 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
2936
2937 def SetEvtHandlerEnabled(*args, **kwargs):
2938 """SetEvtHandlerEnabled(self, bool enabled)"""
2939 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
2940
2941 def ProcessEvent(*args, **kwargs):
2942 """ProcessEvent(self, Event event) -> bool"""
2943 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
2944
2945 def AddPendingEvent(*args, **kwargs):
2946 """AddPendingEvent(self, Event event)"""
2947 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
2948
2949 def ProcessPendingEvents(*args, **kwargs):
2950 """ProcessPendingEvents(self)"""
2951 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
2952
2953 def Connect(*args, **kwargs):
2954 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
2955 return _core_.EvtHandler_Connect(*args, **kwargs)
2956
2957 def Disconnect(*args, **kwargs):
2958 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
2959 return _core_.EvtHandler_Disconnect(*args, **kwargs)
2960
2961 def _setOORInfo(*args, **kwargs):
093d3ff1 2962 """_setOORInfo(self, PyObject _self, bool incref=True)"""
d55e5bfc
RD
2963 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
2964
2965 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2966 """
2967 Bind an event to an event handler.
2968
caef1a4d
RD
2969 :param event: One of the EVT_* objects that specifies the
2970 type of event to bind,
d55e5bfc 2971
caef1a4d
RD
2972 :param handler: A callable object to be invoked when the
2973 event is delivered to self. Pass None to
2974 disconnect an event handler.
d55e5bfc 2975
caef1a4d
RD
2976 :param source: Sometimes the event originates from a
2977 different window than self, but you still
2978 want to catch it in self. (For example, a
2979 button event delivered to a frame.) By
2980 passing the source of the event, the event
2981 handling system is able to differentiate
2982 between the same event type from different
2983 controls.
d55e5bfc 2984
caef1a4d
RD
2985 :param id: Used to spcify the event source by ID instead
2986 of instance.
2987
2988 :param id2: Used when it is desirable to bind a handler
2989 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
2990 """
2991 if source is not None:
2992 id = source.GetId()
2993 event.Bind(self, id, id2, handler)
2994
c24da6d6
RD
2995 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2996 """
2997 Disconencts the event handler binding for event from self.
2998 Returns True if successful.
2999 """
3000 if source is not None:
3001 id = source.GetId()
3002 return event.Unbind(self, id, id2)
d55e5bfc
RD
3003
3004
3005class EvtHandlerPtr(EvtHandler):
3006 def __init__(self, this):
3007 self.this = this
3008 if not hasattr(self,"thisown"): self.thisown = 0
3009 self.__class__ = EvtHandler
3010_core_.EvtHandler_swigregister(EvtHandlerPtr)
3011
3012#---------------------------------------------------------------------------
3013
3014class PyEventBinder(object):
3015 """
3016 Instances of this class are used to bind specific events to event
3017 handlers.
3018 """
3019 def __init__(self, evtType, expectedIDs=0):
3020 if expectedIDs not in [0, 1, 2]:
3021 raise ValueError, "Invalid number of expectedIDs"
3022 self.expectedIDs = expectedIDs
3023
3024 if type(evtType) == list or type(evtType) == tuple:
3025 self.evtType = evtType
3026 else:
3027 self.evtType = [evtType]
3028
3029
3030 def Bind(self, target, id1, id2, function):
3031 """Bind this set of event types to target."""
3032 for et in self.evtType:
3033 target.Connect(id1, id2, et, function)
3034
c24da6d6
RD
3035
3036 def Unbind(self, target, id1, id2):
3037 """Remove an event binding."""
3038 success = 0
3039 for et in self.evtType:
3040 success += target.Disconnect(id1, id2, et)
3041 return success != 0
3042
d55e5bfc
RD
3043
3044 def __call__(self, *args):
3045 """
3046 For backwards compatibility with the old EVT_* functions.
3047 Should be called with either (window, func), (window, ID,
3048 func) or (window, ID1, ID2, func) parameters depending on the
3049 type of the event.
3050 """
3051 assert len(args) == 2 + self.expectedIDs
3052 id1 = wx.ID_ANY
3053 id2 = wx.ID_ANY
3054 target = args[0]
3055 if self.expectedIDs == 0:
3056 func = args[1]
3057 elif self.expectedIDs == 1:
3058 id1 = args[1]
3059 func = args[2]
3060 elif self.expectedIDs == 2:
3061 id1 = args[1]
3062 id2 = args[2]
3063 func = args[3]
3064 else:
3065 raise ValueError, "Unexpected number of IDs"
3066
3067 self.Bind(target, id1, id2, func)
3068
3069
3070# These two are square pegs that don't fit the PyEventBinder hole...
3071def EVT_COMMAND(win, id, cmd, func):
3072 win.Connect(id, -1, cmd, func)
3073def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3074 win.Connect(id1, id2, cmd, func)
3075
3076
3077#---------------------------------------------------------------------------
3078
3079#---------------------------------------------------------------------------
3080
3081EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3082EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3083
3084def NewEventType(*args, **kwargs):
3085 """NewEventType() -> wxEventType"""
3086 return _core_.NewEventType(*args, **kwargs)
3087wxEVT_NULL = _core_.wxEVT_NULL
3088wxEVT_FIRST = _core_.wxEVT_FIRST
3089wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3090wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3091wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3092wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3093wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3094wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3095wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3096wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3097wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3098wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3099wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3100wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3101wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3102wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3103wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3104wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3105wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3106wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3107wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3108wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3109wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3110wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3111wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3112wxEVT_MOTION = _core_.wxEVT_MOTION
3113wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3114wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3115wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3116wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3117wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3118wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3119wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3120wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3121wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3122wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3123wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3124wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3125wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3126wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3127wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3128wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3129wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3130wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3131wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3132wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3133wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3134wxEVT_CHAR = _core_.wxEVT_CHAR
3135wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3136wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3137wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3138wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3139wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3140wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3141wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3142wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3143wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3144wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3145wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3146wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3147wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3148wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3149wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
3150wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3151wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3152wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3153wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3154wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3155wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3156wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3157wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3158wxEVT_SIZE = _core_.wxEVT_SIZE
3159wxEVT_MOVE = _core_.wxEVT_MOVE
3160wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3161wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3162wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3163wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3164wxEVT_POWER = _core_.wxEVT_POWER
3165wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3166wxEVT_CREATE = _core_.wxEVT_CREATE
3167wxEVT_DESTROY = _core_.wxEVT_DESTROY
3168wxEVT_SHOW = _core_.wxEVT_SHOW
3169wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3170wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3171wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3172wxEVT_PAINT = _core_.wxEVT_PAINT
3173wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3174wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3175wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3176wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3177wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3178wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3179wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3180wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3181wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3182wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3183wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3184wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3185wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3186wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3187wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3188wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3189wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3190wxEVT_IDLE = _core_.wxEVT_IDLE
3191wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3192wxEVT_SIZING = _core_.wxEVT_SIZING
3193wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3194wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
d55e5bfc
RD
3195wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3196wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3197wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3198wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3199wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3200wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3201wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3202#
3203# Create some event binders
3204EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3205EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3206EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3207EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3208EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3209EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3210EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3211EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3212EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3213EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3214EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3215EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3216EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3217EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3218EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3219EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3220EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3221EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3222EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3223EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3224EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3225EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3226EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3227EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3228EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3229EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3230EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3231EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3232EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3233EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3234EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3235EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3236EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3237EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3238EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3239EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3240EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3241EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3242EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3243EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3244EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3245
3246EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3247EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3248EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3249EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3250EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3251EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3252EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3253EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3254EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3255EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3256EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3257EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3258EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3259
3260EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3261 wxEVT_LEFT_UP,
3262 wxEVT_MIDDLE_DOWN,
3263 wxEVT_MIDDLE_UP,
3264 wxEVT_RIGHT_DOWN,
3265 wxEVT_RIGHT_UP,
3266 wxEVT_MOTION,
3267 wxEVT_LEFT_DCLICK,
3268 wxEVT_MIDDLE_DCLICK,
3269 wxEVT_RIGHT_DCLICK,
3270 wxEVT_ENTER_WINDOW,
3271 wxEVT_LEAVE_WINDOW,
3272 wxEVT_MOUSEWHEEL
3273 ])
3274
3275
3276# Scrolling from wxWindow (sent to wxScrolledWindow)
3277EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3278 wxEVT_SCROLLWIN_BOTTOM,
3279 wxEVT_SCROLLWIN_LINEUP,
3280 wxEVT_SCROLLWIN_LINEDOWN,
3281 wxEVT_SCROLLWIN_PAGEUP,
3282 wxEVT_SCROLLWIN_PAGEDOWN,
3283 wxEVT_SCROLLWIN_THUMBTRACK,
3284 wxEVT_SCROLLWIN_THUMBRELEASE,
3285 ])
3286
3287EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3288EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3289EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3290EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3291EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3292EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3293EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3294EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3295
3296# Scrolling from wxSlider and wxScrollBar
3297EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3298 wxEVT_SCROLL_BOTTOM,
3299 wxEVT_SCROLL_LINEUP,
3300 wxEVT_SCROLL_LINEDOWN,
3301 wxEVT_SCROLL_PAGEUP,
3302 wxEVT_SCROLL_PAGEDOWN,
3303 wxEVT_SCROLL_THUMBTRACK,
3304 wxEVT_SCROLL_THUMBRELEASE,
3305 wxEVT_SCROLL_ENDSCROLL,
3306 ])
3307
3308EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3309EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3310EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3311EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3312EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3313EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3314EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3315EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3316EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3317
3318# Scrolling from wxSlider and wxScrollBar, with an id
3319EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3320 wxEVT_SCROLL_BOTTOM,
3321 wxEVT_SCROLL_LINEUP,
3322 wxEVT_SCROLL_LINEDOWN,
3323 wxEVT_SCROLL_PAGEUP,
3324 wxEVT_SCROLL_PAGEDOWN,
3325 wxEVT_SCROLL_THUMBTRACK,
3326 wxEVT_SCROLL_THUMBRELEASE,
3327 wxEVT_SCROLL_ENDSCROLL,
3328 ], 1)
3329
3330EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3331EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3332EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3333EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3334EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3335EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3336EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3337EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3338EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3339
3340EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3341EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3342EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3343EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3344EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3345EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3346EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3347EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3348EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3349EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3350
3351EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3352EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3353EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3354EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3355EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3356EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3357EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3358EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3359EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3360
3361
3362EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3363EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3364EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3365EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3366EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3367EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3368EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3369
3370EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3371
3372EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3373EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3374
3375EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3376
3377
3378
3379#---------------------------------------------------------------------------
3380
3381class Event(Object):
093d3ff1 3382 """Proxy of C++ Event class"""
d55e5bfc
RD
3383 def __init__(self): raise RuntimeError, "No constructor defined"
3384 def __repr__(self):
3385 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3386 def __del__(self, destroy=_core_.delete_Event):
3387 """__del__(self)"""
3388 try:
3389 if self.thisown: destroy(self)
3390 except: pass
3391
3392 def SetEventType(*args, **kwargs):
3393 """SetEventType(self, wxEventType typ)"""
3394 return _core_.Event_SetEventType(*args, **kwargs)
3395
3396 def GetEventType(*args, **kwargs):
3397 """GetEventType(self) -> wxEventType"""
3398 return _core_.Event_GetEventType(*args, **kwargs)
3399
3400 def GetEventObject(*args, **kwargs):
3401 """GetEventObject(self) -> Object"""
3402 return _core_.Event_GetEventObject(*args, **kwargs)
3403
3404 def SetEventObject(*args, **kwargs):
3405 """SetEventObject(self, Object obj)"""
3406 return _core_.Event_SetEventObject(*args, **kwargs)
3407
3408 def GetTimestamp(*args, **kwargs):
3409 """GetTimestamp(self) -> long"""
3410 return _core_.Event_GetTimestamp(*args, **kwargs)
3411
3412 def SetTimestamp(*args, **kwargs):
3413 """SetTimestamp(self, long ts=0)"""
3414 return _core_.Event_SetTimestamp(*args, **kwargs)
3415
3416 def GetId(*args, **kwargs):
3417 """GetId(self) -> int"""
3418 return _core_.Event_GetId(*args, **kwargs)
3419
3420 def SetId(*args, **kwargs):
3421 """SetId(self, int Id)"""
3422 return _core_.Event_SetId(*args, **kwargs)
3423
3424 def IsCommandEvent(*args, **kwargs):
3425 """IsCommandEvent(self) -> bool"""
3426 return _core_.Event_IsCommandEvent(*args, **kwargs)
3427
3428 def Skip(*args, **kwargs):
51b83b37
RD
3429 """
3430 Skip(self, bool skip=True)
3431
3432 Called by an event handler, it controls whether additional event
3433 handlers bound to this event will be called after the current event
3434 handler returns. Skip(false) (the default setting) will prevent
3435 additional event handlers from being called and control will be
3436 returned to the sender of the event immediately after the current
3437 handler has finished. Skip(True) will cause the event processing
3438 system to continue searching for a handler function for this event.
3439
3440 """
d55e5bfc
RD
3441 return _core_.Event_Skip(*args, **kwargs)
3442
3443 def GetSkipped(*args, **kwargs):
3444 """GetSkipped(self) -> bool"""
3445 return _core_.Event_GetSkipped(*args, **kwargs)
3446
3447 def ShouldPropagate(*args, **kwargs):
3448 """ShouldPropagate(self) -> bool"""
3449 return _core_.Event_ShouldPropagate(*args, **kwargs)
3450
3451 def StopPropagation(*args, **kwargs):
3452 """StopPropagation(self) -> int"""
3453 return _core_.Event_StopPropagation(*args, **kwargs)
3454
3455 def ResumePropagation(*args, **kwargs):
3456 """ResumePropagation(self, int propagationLevel)"""
3457 return _core_.Event_ResumePropagation(*args, **kwargs)
3458
3459 def Clone(*args, **kwargs):
3460 """Clone(self) -> Event"""
3461 return _core_.Event_Clone(*args, **kwargs)
3462
3463
3464class EventPtr(Event):
3465 def __init__(self, this):
3466 self.this = this
3467 if not hasattr(self,"thisown"): self.thisown = 0
3468 self.__class__ = Event
3469_core_.Event_swigregister(EventPtr)
3470
3471#---------------------------------------------------------------------------
3472
3473class PropagationDisabler(object):
093d3ff1 3474 """Proxy of C++ PropagationDisabler class"""
d55e5bfc
RD
3475 def __repr__(self):
3476 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3477 def __init__(self, *args, **kwargs):
3478 """__init__(self, Event event) -> PropagationDisabler"""
3479 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
3480 self.this = newobj.this
3481 self.thisown = 1
3482 del newobj.thisown
3483 def __del__(self, destroy=_core_.delete_PropagationDisabler):
3484 """__del__(self)"""
3485 try:
3486 if self.thisown: destroy(self)
3487 except: pass
3488
3489
3490class PropagationDisablerPtr(PropagationDisabler):
3491 def __init__(self, this):
3492 self.this = this
3493 if not hasattr(self,"thisown"): self.thisown = 0
3494 self.__class__ = PropagationDisabler
3495_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
3496
3497class PropagateOnce(object):
093d3ff1 3498 """Proxy of C++ PropagateOnce class"""
d55e5bfc
RD
3499 def __repr__(self):
3500 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3501 def __init__(self, *args, **kwargs):
3502 """__init__(self, Event event) -> PropagateOnce"""
3503 newobj = _core_.new_PropagateOnce(*args, **kwargs)
3504 self.this = newobj.this
3505 self.thisown = 1
3506 del newobj.thisown
3507 def __del__(self, destroy=_core_.delete_PropagateOnce):
3508 """__del__(self)"""
3509 try:
3510 if self.thisown: destroy(self)
3511 except: pass
3512
3513
3514class PropagateOncePtr(PropagateOnce):
3515 def __init__(self, this):
3516 self.this = this
3517 if not hasattr(self,"thisown"): self.thisown = 0
3518 self.__class__ = PropagateOnce
3519_core_.PropagateOnce_swigregister(PropagateOncePtr)
3520
3521#---------------------------------------------------------------------------
3522
3523class CommandEvent(Event):
093d3ff1 3524 """Proxy of C++ CommandEvent class"""
d55e5bfc
RD
3525 def __repr__(self):
3526 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3527 def __init__(self, *args, **kwargs):
3528 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
3529 newobj = _core_.new_CommandEvent(*args, **kwargs)
3530 self.this = newobj.this
3531 self.thisown = 1
3532 del newobj.thisown
3533 def GetSelection(*args, **kwargs):
3534 """GetSelection(self) -> int"""
3535 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3536
3537 def SetString(*args, **kwargs):
3538 """SetString(self, String s)"""
3539 return _core_.CommandEvent_SetString(*args, **kwargs)
3540
3541 def GetString(*args, **kwargs):
3542 """GetString(self) -> String"""
3543 return _core_.CommandEvent_GetString(*args, **kwargs)
3544
3545 def IsChecked(*args, **kwargs):
3546 """IsChecked(self) -> bool"""
3547 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3548
3549 Checked = IsChecked
3550 def IsSelection(*args, **kwargs):
3551 """IsSelection(self) -> bool"""
3552 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3553
3554 def SetExtraLong(*args, **kwargs):
3555 """SetExtraLong(self, long extraLong)"""
3556 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3557
3558 def GetExtraLong(*args, **kwargs):
3559 """GetExtraLong(self) -> long"""
3560 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3561
3562 def SetInt(*args, **kwargs):
3563 """SetInt(self, int i)"""
3564 return _core_.CommandEvent_SetInt(*args, **kwargs)
3565
3566 def GetInt(*args, **kwargs):
3567 """GetInt(self) -> long"""
3568 return _core_.CommandEvent_GetInt(*args, **kwargs)
3569
3570 def Clone(*args, **kwargs):
3571 """Clone(self) -> Event"""
3572 return _core_.CommandEvent_Clone(*args, **kwargs)
3573
3574
3575class CommandEventPtr(CommandEvent):
3576 def __init__(self, this):
3577 self.this = this
3578 if not hasattr(self,"thisown"): self.thisown = 0
3579 self.__class__ = CommandEvent
3580_core_.CommandEvent_swigregister(CommandEventPtr)
3581
3582#---------------------------------------------------------------------------
3583
3584class NotifyEvent(CommandEvent):
093d3ff1 3585 """Proxy of C++ NotifyEvent class"""
d55e5bfc
RD
3586 def __repr__(self):
3587 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3588 def __init__(self, *args, **kwargs):
3589 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
3590 newobj = _core_.new_NotifyEvent(*args, **kwargs)
3591 self.this = newobj.this
3592 self.thisown = 1
3593 del newobj.thisown
3594 def Veto(*args, **kwargs):
3595 """Veto(self)"""
3596 return _core_.NotifyEvent_Veto(*args, **kwargs)
3597
3598 def Allow(*args, **kwargs):
3599 """Allow(self)"""
3600 return _core_.NotifyEvent_Allow(*args, **kwargs)
3601
3602 def IsAllowed(*args, **kwargs):
3603 """IsAllowed(self) -> bool"""
3604 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
3605
3606
3607class NotifyEventPtr(NotifyEvent):
3608 def __init__(self, this):
3609 self.this = this
3610 if not hasattr(self,"thisown"): self.thisown = 0
3611 self.__class__ = NotifyEvent
3612_core_.NotifyEvent_swigregister(NotifyEventPtr)
3613
3614#---------------------------------------------------------------------------
3615
3616class ScrollEvent(CommandEvent):
093d3ff1 3617 """Proxy of C++ ScrollEvent class"""
d55e5bfc
RD
3618 def __repr__(self):
3619 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3620 def __init__(self, *args, **kwargs):
3621 """
3622 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
3623 int orient=0) -> ScrollEvent
3624 """
3625 newobj = _core_.new_ScrollEvent(*args, **kwargs)
3626 self.this = newobj.this
3627 self.thisown = 1
3628 del newobj.thisown
3629 def GetOrientation(*args, **kwargs):
3630 """GetOrientation(self) -> int"""
3631 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
3632
3633 def GetPosition(*args, **kwargs):
3634 """GetPosition(self) -> int"""
3635 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
3636
3637 def SetOrientation(*args, **kwargs):
3638 """SetOrientation(self, int orient)"""
3639 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
3640
3641 def SetPosition(*args, **kwargs):
3642 """SetPosition(self, int pos)"""
3643 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
3644
3645
3646class ScrollEventPtr(ScrollEvent):
3647 def __init__(self, this):
3648 self.this = this
3649 if not hasattr(self,"thisown"): self.thisown = 0
3650 self.__class__ = ScrollEvent
3651_core_.ScrollEvent_swigregister(ScrollEventPtr)
3652
3653#---------------------------------------------------------------------------
3654
3655class ScrollWinEvent(Event):
093d3ff1 3656 """Proxy of C++ ScrollWinEvent class"""
d55e5bfc
RD
3657 def __repr__(self):
3658 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3659 def __init__(self, *args, **kwargs):
3660 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
3661 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
3662 self.this = newobj.this
3663 self.thisown = 1
3664 del newobj.thisown
3665 def GetOrientation(*args, **kwargs):
3666 """GetOrientation(self) -> int"""
3667 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
3668
3669 def GetPosition(*args, **kwargs):
3670 """GetPosition(self) -> int"""
3671 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
3672
3673 def SetOrientation(*args, **kwargs):
3674 """SetOrientation(self, int orient)"""
3675 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
3676
3677 def SetPosition(*args, **kwargs):
3678 """SetPosition(self, int pos)"""
3679 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
3680
3681
3682class ScrollWinEventPtr(ScrollWinEvent):
3683 def __init__(self, this):
3684 self.this = this
3685 if not hasattr(self,"thisown"): self.thisown = 0
3686 self.__class__ = ScrollWinEvent
3687_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
3688
3689#---------------------------------------------------------------------------
3690
3691MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3692MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3693MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3694MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3695MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
3696class MouseEvent(Event):
093d3ff1 3697 """Proxy of C++ MouseEvent class"""
d55e5bfc
RD
3698 def __repr__(self):
3699 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3700 def __init__(self, *args, **kwargs):
3701 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
3702 newobj = _core_.new_MouseEvent(*args, **kwargs)
3703 self.this = newobj.this
3704 self.thisown = 1
3705 del newobj.thisown
3706 def IsButton(*args, **kwargs):
3707 """IsButton(self) -> bool"""
3708 return _core_.MouseEvent_IsButton(*args, **kwargs)
3709
3710 def ButtonDown(*args, **kwargs):
3711 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
3712 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
3713
3714 def ButtonDClick(*args, **kwargs):
3715 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
3716 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
3717
3718 def ButtonUp(*args, **kwargs):
3719 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
3720 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
3721
3722 def Button(*args, **kwargs):
3723 """Button(self, int but) -> bool"""
3724 return _core_.MouseEvent_Button(*args, **kwargs)
3725
3726 def ButtonIsDown(*args, **kwargs):
3727 """ButtonIsDown(self, int but) -> bool"""
3728 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
3729
3730 def GetButton(*args, **kwargs):
3731 """GetButton(self) -> int"""
3732 return _core_.MouseEvent_GetButton(*args, **kwargs)
3733
3734 def ControlDown(*args, **kwargs):
3735 """ControlDown(self) -> bool"""
3736 return _core_.MouseEvent_ControlDown(*args, **kwargs)
3737
3738 def MetaDown(*args, **kwargs):
3739 """MetaDown(self) -> bool"""
3740 return _core_.MouseEvent_MetaDown(*args, **kwargs)
3741
3742 def AltDown(*args, **kwargs):
3743 """AltDown(self) -> bool"""
3744 return _core_.MouseEvent_AltDown(*args, **kwargs)
3745
3746 def ShiftDown(*args, **kwargs):
3747 """ShiftDown(self) -> bool"""
3748 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
3749
412d302d
RD
3750 def CmdDown(*args, **kwargs):
3751 """
3752 CmdDown(self) -> bool
3753
3754 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3755 platforms but the special "Apple" (a.k.a as "Command") key on
3756 Macs: it makes often sense to use it instead of, say, `ControlDown`
3757 because Cmd key is used for the same thing under Mac as Ctrl
3758 elsewhere. The Ctrl still exists, it's just not used for this
3759 purpose. So for non-Mac platforms this is the same as `ControlDown`
3760 and Macs this is the same as `MetaDown`.
3761 """
3762 return _core_.MouseEvent_CmdDown(*args, **kwargs)
3763
d55e5bfc
RD
3764 def LeftDown(*args, **kwargs):
3765 """LeftDown(self) -> bool"""
3766 return _core_.MouseEvent_LeftDown(*args, **kwargs)
3767
3768 def MiddleDown(*args, **kwargs):
3769 """MiddleDown(self) -> bool"""
3770 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
3771
3772 def RightDown(*args, **kwargs):
3773 """RightDown(self) -> bool"""
3774 return _core_.MouseEvent_RightDown(*args, **kwargs)
3775
3776 def LeftUp(*args, **kwargs):
3777 """LeftUp(self) -> bool"""
3778 return _core_.MouseEvent_LeftUp(*args, **kwargs)
3779
3780 def MiddleUp(*args, **kwargs):
3781 """MiddleUp(self) -> bool"""
3782 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
3783
3784 def RightUp(*args, **kwargs):
3785 """RightUp(self) -> bool"""
3786 return _core_.MouseEvent_RightUp(*args, **kwargs)
3787
3788 def LeftDClick(*args, **kwargs):
3789 """LeftDClick(self) -> bool"""
3790 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
3791
3792 def MiddleDClick(*args, **kwargs):
3793 """MiddleDClick(self) -> bool"""
3794 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
3795
3796 def RightDClick(*args, **kwargs):
3797 """RightDClick(self) -> bool"""
3798 return _core_.MouseEvent_RightDClick(*args, **kwargs)
3799
3800 def LeftIsDown(*args, **kwargs):
3801 """LeftIsDown(self) -> bool"""
3802 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
3803
3804 def MiddleIsDown(*args, **kwargs):
3805 """MiddleIsDown(self) -> bool"""
3806 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
3807
3808 def RightIsDown(*args, **kwargs):
3809 """RightIsDown(self) -> bool"""
3810 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
3811
3812 def Dragging(*args, **kwargs):
3813 """Dragging(self) -> bool"""
3814 return _core_.MouseEvent_Dragging(*args, **kwargs)
3815
3816 def Moving(*args, **kwargs):
3817 """Moving(self) -> bool"""
3818 return _core_.MouseEvent_Moving(*args, **kwargs)
3819
3820 def Entering(*args, **kwargs):
3821 """Entering(self) -> bool"""
3822 return _core_.MouseEvent_Entering(*args, **kwargs)
3823
3824 def Leaving(*args, **kwargs):
3825 """Leaving(self) -> bool"""
3826 return _core_.MouseEvent_Leaving(*args, **kwargs)
3827
3828 def GetPosition(*args, **kwargs):
3829 """
3830 GetPosition(self) -> Point
3831
79fccf9d
RD
3832 Returns the position of the mouse in window coordinates when the event
3833 happened.
d55e5bfc
RD
3834 """
3835 return _core_.MouseEvent_GetPosition(*args, **kwargs)
3836
3837 def GetPositionTuple(*args, **kwargs):
3838 """
3839 GetPositionTuple() -> (x,y)
3840
79fccf9d
RD
3841 Returns the position of the mouse in window coordinates when the event
3842 happened.
d55e5bfc
RD
3843 """
3844 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
3845
3846 def GetLogicalPosition(*args, **kwargs):
3847 """GetLogicalPosition(self, DC dc) -> Point"""
3848 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
3849
3850 def GetX(*args, **kwargs):
3851 """GetX(self) -> int"""
3852 return _core_.MouseEvent_GetX(*args, **kwargs)
3853
3854 def GetY(*args, **kwargs):
3855 """GetY(self) -> int"""
3856 return _core_.MouseEvent_GetY(*args, **kwargs)
3857
3858 def GetWheelRotation(*args, **kwargs):
3859 """GetWheelRotation(self) -> int"""
3860 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
3861
3862 def GetWheelDelta(*args, **kwargs):
3863 """GetWheelDelta(self) -> int"""
3864 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
3865
3866 def GetLinesPerAction(*args, **kwargs):
3867 """GetLinesPerAction(self) -> int"""
3868 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
3869
3870 def IsPageScroll(*args, **kwargs):
3871 """IsPageScroll(self) -> bool"""
3872 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3873
3874 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3875 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3876 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3877 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3878 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3879 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3880 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3881 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3882 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3883 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3884 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3885 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
3886
3887class MouseEventPtr(MouseEvent):
3888 def __init__(self, this):
3889 self.this = this
3890 if not hasattr(self,"thisown"): self.thisown = 0
3891 self.__class__ = MouseEvent
3892_core_.MouseEvent_swigregister(MouseEventPtr)
3893
3894#---------------------------------------------------------------------------
3895
3896class SetCursorEvent(Event):
093d3ff1 3897 """Proxy of C++ SetCursorEvent class"""
d55e5bfc
RD
3898 def __repr__(self):
3899 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3900 def __init__(self, *args, **kwargs):
3901 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
3902 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
3903 self.this = newobj.this
3904 self.thisown = 1
3905 del newobj.thisown
3906 def GetX(*args, **kwargs):
3907 """GetX(self) -> int"""
3908 return _core_.SetCursorEvent_GetX(*args, **kwargs)
3909
3910 def GetY(*args, **kwargs):
3911 """GetY(self) -> int"""
3912 return _core_.SetCursorEvent_GetY(*args, **kwargs)
3913
3914 def SetCursor(*args, **kwargs):
3915 """SetCursor(self, Cursor cursor)"""
3916 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
3917
3918 def GetCursor(*args, **kwargs):
3919 """GetCursor(self) -> Cursor"""
3920 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
3921
3922 def HasCursor(*args, **kwargs):
3923 """HasCursor(self) -> bool"""
3924 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
3925
3926
3927class SetCursorEventPtr(SetCursorEvent):
3928 def __init__(self, this):
3929 self.this = this
3930 if not hasattr(self,"thisown"): self.thisown = 0
3931 self.__class__ = SetCursorEvent
3932_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
3933
3934#---------------------------------------------------------------------------
3935
3936class KeyEvent(Event):
093d3ff1 3937 """Proxy of C++ KeyEvent class"""
d55e5bfc
RD
3938 def __repr__(self):
3939 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3940 def __init__(self, *args, **kwargs):
3941 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
3942 newobj = _core_.new_KeyEvent(*args, **kwargs)
3943 self.this = newobj.this
3944 self.thisown = 1
3945 del newobj.thisown
3946 def ControlDown(*args, **kwargs):
3947 """ControlDown(self) -> bool"""
3948 return _core_.KeyEvent_ControlDown(*args, **kwargs)
3949
3950 def MetaDown(*args, **kwargs):
3951 """MetaDown(self) -> bool"""
3952 return _core_.KeyEvent_MetaDown(*args, **kwargs)
3953
3954 def AltDown(*args, **kwargs):
3955 """AltDown(self) -> bool"""
3956 return _core_.KeyEvent_AltDown(*args, **kwargs)
3957
3958 def ShiftDown(*args, **kwargs):
3959 """ShiftDown(self) -> bool"""
3960 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
3961
412d302d
RD
3962 def CmdDown(*args, **kwargs):
3963 """
3964 CmdDown(self) -> bool
3965
3966 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3967 platforms but the special "Apple" (a.k.a as "Command") key on
3968 Macs: it makes often sense to use it instead of, say, `ControlDown`
3969 because Cmd key is used for the same thing under Mac as Ctrl
3970 elsewhere. The Ctrl still exists, it's just not used for this
3971 purpose. So for non-Mac platforms this is the same as `ControlDown`
3972 and Macs this is the same as `MetaDown`.
3973 """
3974 return _core_.KeyEvent_CmdDown(*args, **kwargs)
3975
d55e5bfc
RD
3976 def HasModifiers(*args, **kwargs):
3977 """HasModifiers(self) -> bool"""
3978 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
3979
3980 def GetKeyCode(*args, **kwargs):
3981 """GetKeyCode(self) -> int"""
3982 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
3983
3984 KeyCode = GetKeyCode
19272049
RD
3985 def GetUnicodeKey(*args, **kwargs):
3986 """GetUnicodeKey(self) -> int"""
3987 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 3988
19272049 3989 GetUniChar = GetUnicodeKey
d55e5bfc
RD
3990 def GetRawKeyCode(*args, **kwargs):
3991 """GetRawKeyCode(self) -> unsigned int"""
3992 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
3993
3994 def GetRawKeyFlags(*args, **kwargs):
3995 """GetRawKeyFlags(self) -> unsigned int"""
3996 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
3997
3998 def GetPosition(*args, **kwargs):
3999 """
4000 GetPosition(self) -> Point
4001
4002 Find the position of the event.
4003 """
4004 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4005
4006 def GetPositionTuple(*args, **kwargs):
4007 """
4008 GetPositionTuple() -> (x,y)
4009
4010 Find the position of the event.
4011 """
4012 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4013
4014 def GetX(*args, **kwargs):
4015 """GetX(self) -> int"""
4016 return _core_.KeyEvent_GetX(*args, **kwargs)
4017
4018 def GetY(*args, **kwargs):
4019 """GetY(self) -> int"""
4020 return _core_.KeyEvent_GetY(*args, **kwargs)
4021
4022 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4023 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4024 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4025 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4026 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4027 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4028 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4029 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4030 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4031 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
4032
4033class KeyEventPtr(KeyEvent):
4034 def __init__(self, this):
4035 self.this = this
4036 if not hasattr(self,"thisown"): self.thisown = 0
4037 self.__class__ = KeyEvent
4038_core_.KeyEvent_swigregister(KeyEventPtr)
4039
4040#---------------------------------------------------------------------------
4041
4042class SizeEvent(Event):
093d3ff1 4043 """Proxy of C++ SizeEvent class"""
d55e5bfc
RD
4044 def __repr__(self):
4045 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4046 def __init__(self, *args, **kwargs):
4047 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
4048 newobj = _core_.new_SizeEvent(*args, **kwargs)
4049 self.this = newobj.this
4050 self.thisown = 1
4051 del newobj.thisown
4052 def GetSize(*args, **kwargs):
4053 """GetSize(self) -> Size"""
4054 return _core_.SizeEvent_GetSize(*args, **kwargs)
4055
4056 def GetRect(*args, **kwargs):
4057 """GetRect(self) -> Rect"""
4058 return _core_.SizeEvent_GetRect(*args, **kwargs)
4059
4060 def SetRect(*args, **kwargs):
4061 """SetRect(self, Rect rect)"""
4062 return _core_.SizeEvent_SetRect(*args, **kwargs)
4063
4064 def SetSize(*args, **kwargs):
4065 """SetSize(self, Size size)"""
4066 return _core_.SizeEvent_SetSize(*args, **kwargs)
4067
4068 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4069 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
4070
4071class SizeEventPtr(SizeEvent):
4072 def __init__(self, this):
4073 self.this = this
4074 if not hasattr(self,"thisown"): self.thisown = 0
4075 self.__class__ = SizeEvent
4076_core_.SizeEvent_swigregister(SizeEventPtr)
4077
4078#---------------------------------------------------------------------------
4079
4080class MoveEvent(Event):
093d3ff1 4081 """Proxy of C++ MoveEvent class"""
d55e5bfc
RD
4082 def __repr__(self):
4083 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4084 def __init__(self, *args, **kwargs):
4085 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
4086 newobj = _core_.new_MoveEvent(*args, **kwargs)
4087 self.this = newobj.this
4088 self.thisown = 1
4089 del newobj.thisown
4090 def GetPosition(*args, **kwargs):
4091 """GetPosition(self) -> Point"""
4092 return _core_.MoveEvent_GetPosition(*args, **kwargs)
4093
4094 def GetRect(*args, **kwargs):
4095 """GetRect(self) -> Rect"""
4096 return _core_.MoveEvent_GetRect(*args, **kwargs)
4097
4098 def SetRect(*args, **kwargs):
4099 """SetRect(self, Rect rect)"""
4100 return _core_.MoveEvent_SetRect(*args, **kwargs)
4101
4102 def SetPosition(*args, **kwargs):
4103 """SetPosition(self, Point pos)"""
4104 return _core_.MoveEvent_SetPosition(*args, **kwargs)
4105
fef4c27a
RD
4106 m_pos = property(GetPosition, SetPosition)
4107 m_rect = property(GetRect, SetRect)
4108
d55e5bfc
RD
4109
4110class MoveEventPtr(MoveEvent):
4111 def __init__(self, this):
4112 self.this = this
4113 if not hasattr(self,"thisown"): self.thisown = 0
4114 self.__class__ = MoveEvent
4115_core_.MoveEvent_swigregister(MoveEventPtr)
4116
4117#---------------------------------------------------------------------------
4118
4119class PaintEvent(Event):
093d3ff1 4120 """Proxy of C++ PaintEvent class"""
d55e5bfc
RD
4121 def __repr__(self):
4122 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4123 def __init__(self, *args, **kwargs):
4124 """__init__(self, int Id=0) -> PaintEvent"""
4125 newobj = _core_.new_PaintEvent(*args, **kwargs)
4126 self.this = newobj.this
4127 self.thisown = 1
4128 del newobj.thisown
4129
4130class PaintEventPtr(PaintEvent):
4131 def __init__(self, this):
4132 self.this = this
4133 if not hasattr(self,"thisown"): self.thisown = 0
4134 self.__class__ = PaintEvent
4135_core_.PaintEvent_swigregister(PaintEventPtr)
4136
4137class NcPaintEvent(Event):
093d3ff1 4138 """Proxy of C++ NcPaintEvent class"""
d55e5bfc
RD
4139 def __repr__(self):
4140 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4141 def __init__(self, *args, **kwargs):
4142 """__init__(self, int winid=0) -> NcPaintEvent"""
4143 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
4144 self.this = newobj.this
4145 self.thisown = 1
4146 del newobj.thisown
4147
4148class NcPaintEventPtr(NcPaintEvent):
4149 def __init__(self, this):
4150 self.this = this
4151 if not hasattr(self,"thisown"): self.thisown = 0
4152 self.__class__ = NcPaintEvent
4153_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
4154
4155#---------------------------------------------------------------------------
4156
4157class EraseEvent(Event):
093d3ff1 4158 """Proxy of C++ EraseEvent class"""
d55e5bfc
RD
4159 def __repr__(self):
4160 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4161 def __init__(self, *args, **kwargs):
4162 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
4163 newobj = _core_.new_EraseEvent(*args, **kwargs)
4164 self.this = newobj.this
4165 self.thisown = 1
4166 del newobj.thisown
4167 def GetDC(*args, **kwargs):
4168 """GetDC(self) -> DC"""
4169 return _core_.EraseEvent_GetDC(*args, **kwargs)
4170
4171
4172class EraseEventPtr(EraseEvent):
4173 def __init__(self, this):
4174 self.this = this
4175 if not hasattr(self,"thisown"): self.thisown = 0
4176 self.__class__ = EraseEvent
4177_core_.EraseEvent_swigregister(EraseEventPtr)
4178
4179#---------------------------------------------------------------------------
4180
4181class FocusEvent(Event):
093d3ff1 4182 """Proxy of C++ FocusEvent class"""
d55e5bfc
RD
4183 def __repr__(self):
4184 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4185 def __init__(self, *args, **kwargs):
4186 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
4187 newobj = _core_.new_FocusEvent(*args, **kwargs)
4188 self.this = newobj.this
4189 self.thisown = 1
4190 del newobj.thisown
4191 def GetWindow(*args, **kwargs):
4192 """GetWindow(self) -> Window"""
4193 return _core_.FocusEvent_GetWindow(*args, **kwargs)
4194
4195 def SetWindow(*args, **kwargs):
4196 """SetWindow(self, Window win)"""
4197 return _core_.FocusEvent_SetWindow(*args, **kwargs)
4198
4199
4200class FocusEventPtr(FocusEvent):
4201 def __init__(self, this):
4202 self.this = this
4203 if not hasattr(self,"thisown"): self.thisown = 0
4204 self.__class__ = FocusEvent
4205_core_.FocusEvent_swigregister(FocusEventPtr)
4206
4207#---------------------------------------------------------------------------
4208
4209class ChildFocusEvent(CommandEvent):
093d3ff1 4210 """Proxy of C++ ChildFocusEvent class"""
d55e5bfc
RD
4211 def __repr__(self):
4212 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4213 def __init__(self, *args, **kwargs):
4214 """__init__(self, Window win=None) -> ChildFocusEvent"""
4215 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
4216 self.this = newobj.this
4217 self.thisown = 1
4218 del newobj.thisown
4219 def GetWindow(*args, **kwargs):
4220 """GetWindow(self) -> Window"""
4221 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
4222
4223
4224class ChildFocusEventPtr(ChildFocusEvent):
4225 def __init__(self, this):
4226 self.this = this
4227 if not hasattr(self,"thisown"): self.thisown = 0
4228 self.__class__ = ChildFocusEvent
4229_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
4230
4231#---------------------------------------------------------------------------
4232
4233class ActivateEvent(Event):
093d3ff1 4234 """Proxy of C++ ActivateEvent class"""
d55e5bfc
RD
4235 def __repr__(self):
4236 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4237 def __init__(self, *args, **kwargs):
4238 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
4239 newobj = _core_.new_ActivateEvent(*args, **kwargs)
4240 self.this = newobj.this
4241 self.thisown = 1
4242 del newobj.thisown
4243 def GetActive(*args, **kwargs):
4244 """GetActive(self) -> bool"""
4245 return _core_.ActivateEvent_GetActive(*args, **kwargs)
4246
4247
4248class ActivateEventPtr(ActivateEvent):
4249 def __init__(self, this):
4250 self.this = this
4251 if not hasattr(self,"thisown"): self.thisown = 0
4252 self.__class__ = ActivateEvent
4253_core_.ActivateEvent_swigregister(ActivateEventPtr)
4254
4255#---------------------------------------------------------------------------
4256
4257class InitDialogEvent(Event):
093d3ff1 4258 """Proxy of C++ InitDialogEvent class"""
d55e5bfc
RD
4259 def __repr__(self):
4260 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4261 def __init__(self, *args, **kwargs):
4262 """__init__(self, int Id=0) -> InitDialogEvent"""
4263 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
4264 self.this = newobj.this
4265 self.thisown = 1
4266 del newobj.thisown
4267
4268class InitDialogEventPtr(InitDialogEvent):
4269 def __init__(self, this):
4270 self.this = this
4271 if not hasattr(self,"thisown"): self.thisown = 0
4272 self.__class__ = InitDialogEvent
4273_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
4274
4275#---------------------------------------------------------------------------
4276
4277class MenuEvent(Event):
093d3ff1 4278 """Proxy of C++ MenuEvent class"""
d55e5bfc
RD
4279 def __repr__(self):
4280 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4281 def __init__(self, *args, **kwargs):
4282 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
4283 newobj = _core_.new_MenuEvent(*args, **kwargs)
4284 self.this = newobj.this
4285 self.thisown = 1
4286 del newobj.thisown
4287 def GetMenuId(*args, **kwargs):
4288 """GetMenuId(self) -> int"""
4289 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
4290
4291 def IsPopup(*args, **kwargs):
4292 """IsPopup(self) -> bool"""
4293 return _core_.MenuEvent_IsPopup(*args, **kwargs)
4294
4295 def GetMenu(*args, **kwargs):
4296 """GetMenu(self) -> Menu"""
4297 return _core_.MenuEvent_GetMenu(*args, **kwargs)
4298
4299
4300class MenuEventPtr(MenuEvent):
4301 def __init__(self, this):
4302 self.this = this
4303 if not hasattr(self,"thisown"): self.thisown = 0
4304 self.__class__ = MenuEvent
4305_core_.MenuEvent_swigregister(MenuEventPtr)
4306
4307#---------------------------------------------------------------------------
4308
4309class CloseEvent(Event):
093d3ff1 4310 """Proxy of C++ CloseEvent class"""
d55e5bfc
RD
4311 def __repr__(self):
4312 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4313 def __init__(self, *args, **kwargs):
4314 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
4315 newobj = _core_.new_CloseEvent(*args, **kwargs)
4316 self.this = newobj.this
4317 self.thisown = 1
4318 del newobj.thisown
4319 def SetLoggingOff(*args, **kwargs):
4320 """SetLoggingOff(self, bool logOff)"""
4321 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
4322
4323 def GetLoggingOff(*args, **kwargs):
4324 """GetLoggingOff(self) -> bool"""
4325 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
4326
4327 def Veto(*args, **kwargs):
4328 """Veto(self, bool veto=True)"""
4329 return _core_.CloseEvent_Veto(*args, **kwargs)
4330
4331 def SetCanVeto(*args, **kwargs):
4332 """SetCanVeto(self, bool canVeto)"""
4333 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
4334
4335 def CanVeto(*args, **kwargs):
4336 """CanVeto(self) -> bool"""
4337 return _core_.CloseEvent_CanVeto(*args, **kwargs)
4338
4339 def GetVeto(*args, **kwargs):
4340 """GetVeto(self) -> bool"""
4341 return _core_.CloseEvent_GetVeto(*args, **kwargs)
4342
4343
4344class CloseEventPtr(CloseEvent):
4345 def __init__(self, this):
4346 self.this = this
4347 if not hasattr(self,"thisown"): self.thisown = 0
4348 self.__class__ = CloseEvent
4349_core_.CloseEvent_swigregister(CloseEventPtr)
4350
4351#---------------------------------------------------------------------------
4352
4353class ShowEvent(Event):
093d3ff1 4354 """Proxy of C++ ShowEvent class"""
d55e5bfc
RD
4355 def __repr__(self):
4356 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4357 def __init__(self, *args, **kwargs):
4358 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
4359 newobj = _core_.new_ShowEvent(*args, **kwargs)
4360 self.this = newobj.this
4361 self.thisown = 1
4362 del newobj.thisown
4363 def SetShow(*args, **kwargs):
4364 """SetShow(self, bool show)"""
4365 return _core_.ShowEvent_SetShow(*args, **kwargs)
4366
4367 def GetShow(*args, **kwargs):
4368 """GetShow(self) -> bool"""
4369 return _core_.ShowEvent_GetShow(*args, **kwargs)
4370
4371
4372class ShowEventPtr(ShowEvent):
4373 def __init__(self, this):
4374 self.this = this
4375 if not hasattr(self,"thisown"): self.thisown = 0
4376 self.__class__ = ShowEvent
4377_core_.ShowEvent_swigregister(ShowEventPtr)
4378
4379#---------------------------------------------------------------------------
4380
4381class IconizeEvent(Event):
093d3ff1 4382 """Proxy of C++ IconizeEvent class"""
d55e5bfc
RD
4383 def __repr__(self):
4384 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4385 def __init__(self, *args, **kwargs):
4386 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
4387 newobj = _core_.new_IconizeEvent(*args, **kwargs)
4388 self.this = newobj.this
4389 self.thisown = 1
4390 del newobj.thisown
4391 def Iconized(*args, **kwargs):
4392 """Iconized(self) -> bool"""
4393 return _core_.IconizeEvent_Iconized(*args, **kwargs)
4394
4395
4396class IconizeEventPtr(IconizeEvent):
4397 def __init__(self, this):
4398 self.this = this
4399 if not hasattr(self,"thisown"): self.thisown = 0
4400 self.__class__ = IconizeEvent
4401_core_.IconizeEvent_swigregister(IconizeEventPtr)
4402
4403#---------------------------------------------------------------------------
4404
4405class MaximizeEvent(Event):
093d3ff1 4406 """Proxy of C++ MaximizeEvent class"""
d55e5bfc
RD
4407 def __repr__(self):
4408 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4409 def __init__(self, *args, **kwargs):
4410 """__init__(self, int id=0) -> MaximizeEvent"""
4411 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
4412 self.this = newobj.this
4413 self.thisown = 1
4414 del newobj.thisown
4415
4416class MaximizeEventPtr(MaximizeEvent):
4417 def __init__(self, this):
4418 self.this = this
4419 if not hasattr(self,"thisown"): self.thisown = 0
4420 self.__class__ = MaximizeEvent
4421_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
4422
4423#---------------------------------------------------------------------------
4424
4425class DropFilesEvent(Event):
093d3ff1 4426 """Proxy of C++ DropFilesEvent class"""
d55e5bfc
RD
4427 def __init__(self): raise RuntimeError, "No constructor defined"
4428 def __repr__(self):
4429 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4430 def GetPosition(*args, **kwargs):
4431 """GetPosition(self) -> Point"""
4432 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
4433
4434 def GetNumberOfFiles(*args, **kwargs):
4435 """GetNumberOfFiles(self) -> int"""
4436 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
4437
4438 def GetFiles(*args, **kwargs):
4439 """GetFiles(self) -> PyObject"""
4440 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
4441
4442
4443class DropFilesEventPtr(DropFilesEvent):
4444 def __init__(self, this):
4445 self.this = this
4446 if not hasattr(self,"thisown"): self.thisown = 0
4447 self.__class__ = DropFilesEvent
4448_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
4449
4450#---------------------------------------------------------------------------
4451
4452UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4453UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
4454class UpdateUIEvent(CommandEvent):
093d3ff1 4455 """Proxy of C++ UpdateUIEvent class"""
d55e5bfc
RD
4456 def __repr__(self):
4457 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4458 def __init__(self, *args, **kwargs):
4459 """__init__(self, int commandId=0) -> UpdateUIEvent"""
4460 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
4461 self.this = newobj.this
4462 self.thisown = 1
4463 del newobj.thisown
4464 def GetChecked(*args, **kwargs):
4465 """GetChecked(self) -> bool"""
4466 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
4467
4468 def GetEnabled(*args, **kwargs):
4469 """GetEnabled(self) -> bool"""
4470 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
4471
4472 def GetText(*args, **kwargs):
4473 """GetText(self) -> String"""
4474 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
4475
4476 def GetSetText(*args, **kwargs):
4477 """GetSetText(self) -> bool"""
4478 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
4479
4480 def GetSetChecked(*args, **kwargs):
4481 """GetSetChecked(self) -> bool"""
4482 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
4483
4484 def GetSetEnabled(*args, **kwargs):
4485 """GetSetEnabled(self) -> bool"""
4486 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
4487
4488 def Check(*args, **kwargs):
4489 """Check(self, bool check)"""
4490 return _core_.UpdateUIEvent_Check(*args, **kwargs)
4491
4492 def Enable(*args, **kwargs):
4493 """Enable(self, bool enable)"""
4494 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
4495
4496 def SetText(*args, **kwargs):
4497 """SetText(self, String text)"""
4498 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
4499
4500 def SetUpdateInterval(*args, **kwargs):
c24da6d6 4501 """SetUpdateInterval(long updateInterval)"""
d55e5bfc
RD
4502 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4503
4504 SetUpdateInterval = staticmethod(SetUpdateInterval)
4505 def GetUpdateInterval(*args, **kwargs):
c24da6d6 4506 """GetUpdateInterval() -> long"""
d55e5bfc
RD
4507 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4508
4509 GetUpdateInterval = staticmethod(GetUpdateInterval)
4510 def CanUpdate(*args, **kwargs):
c24da6d6 4511 """CanUpdate(Window win) -> bool"""
d55e5bfc
RD
4512 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4513
4514 CanUpdate = staticmethod(CanUpdate)
4515 def ResetUpdateTime(*args, **kwargs):
c24da6d6 4516 """ResetUpdateTime()"""
d55e5bfc
RD
4517 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4518
4519 ResetUpdateTime = staticmethod(ResetUpdateTime)
4520 def SetMode(*args, **kwargs):
c24da6d6 4521 """SetMode(int mode)"""
d55e5bfc
RD
4522 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4523
4524 SetMode = staticmethod(SetMode)
4525 def GetMode(*args, **kwargs):
c24da6d6 4526 """GetMode() -> int"""
d55e5bfc
RD
4527 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4528
4529 GetMode = staticmethod(GetMode)
4530
4531class UpdateUIEventPtr(UpdateUIEvent):
4532 def __init__(self, this):
4533 self.this = this
4534 if not hasattr(self,"thisown"): self.thisown = 0
4535 self.__class__ = UpdateUIEvent
4536_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
4537
4538def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4539 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
4540 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4541
4542def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4543 """UpdateUIEvent_GetUpdateInterval() -> long"""
4544 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4545
4546def UpdateUIEvent_CanUpdate(*args, **kwargs):
4547 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
4548 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4549
4550def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4551 """UpdateUIEvent_ResetUpdateTime()"""
4552 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4553
4554def UpdateUIEvent_SetMode(*args, **kwargs):
4555 """UpdateUIEvent_SetMode(int mode)"""
4556 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4557
4558def UpdateUIEvent_GetMode(*args, **kwargs):
4559 """UpdateUIEvent_GetMode() -> int"""
4560 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4561
4562#---------------------------------------------------------------------------
4563
4564class SysColourChangedEvent(Event):
093d3ff1 4565 """Proxy of C++ SysColourChangedEvent class"""
d55e5bfc
RD
4566 def __repr__(self):
4567 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4568 def __init__(self, *args, **kwargs):
4569 """__init__(self) -> SysColourChangedEvent"""
4570 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
4571 self.this = newobj.this
4572 self.thisown = 1
4573 del newobj.thisown
4574
4575class SysColourChangedEventPtr(SysColourChangedEvent):
4576 def __init__(self, this):
4577 self.this = this
4578 if not hasattr(self,"thisown"): self.thisown = 0
4579 self.__class__ = SysColourChangedEvent
4580_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
4581
4582#---------------------------------------------------------------------------
4583
4584class MouseCaptureChangedEvent(Event):
093d3ff1 4585 """Proxy of C++ MouseCaptureChangedEvent class"""
d55e5bfc
RD
4586 def __repr__(self):
4587 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4588 def __init__(self, *args, **kwargs):
4589 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
4590 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
4591 self.this = newobj.this
4592 self.thisown = 1
4593 del newobj.thisown
4594 def GetCapturedWindow(*args, **kwargs):
4595 """GetCapturedWindow(self) -> Window"""
4596 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
4597
4598
4599class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
4600 def __init__(self, this):
4601 self.this = this
4602 if not hasattr(self,"thisown"): self.thisown = 0
4603 self.__class__ = MouseCaptureChangedEvent
4604_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
4605
4606#---------------------------------------------------------------------------
4607
4608class DisplayChangedEvent(Event):
093d3ff1 4609 """Proxy of C++ DisplayChangedEvent class"""
d55e5bfc
RD
4610 def __repr__(self):
4611 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4612 def __init__(self, *args, **kwargs):
4613 """__init__(self) -> DisplayChangedEvent"""
4614 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
4615 self.this = newobj.this
4616 self.thisown = 1
4617 del newobj.thisown
4618
4619class DisplayChangedEventPtr(DisplayChangedEvent):
4620 def __init__(self, this):
4621 self.this = this
4622 if not hasattr(self,"thisown"): self.thisown = 0
4623 self.__class__ = DisplayChangedEvent
4624_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
4625
4626#---------------------------------------------------------------------------
4627
4628class PaletteChangedEvent(Event):
093d3ff1 4629 """Proxy of C++ PaletteChangedEvent class"""
d55e5bfc
RD
4630 def __repr__(self):
4631 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4632 def __init__(self, *args, **kwargs):
4633 """__init__(self, int id=0) -> PaletteChangedEvent"""
4634 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
4635 self.this = newobj.this
4636 self.thisown = 1
4637 del newobj.thisown
4638 def SetChangedWindow(*args, **kwargs):
4639 """SetChangedWindow(self, Window win)"""
4640 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
4641
4642 def GetChangedWindow(*args, **kwargs):
4643 """GetChangedWindow(self) -> Window"""
4644 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
4645
4646
4647class PaletteChangedEventPtr(PaletteChangedEvent):
4648 def __init__(self, this):
4649 self.this = this
4650 if not hasattr(self,"thisown"): self.thisown = 0
4651 self.__class__ = PaletteChangedEvent
4652_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
4653
4654#---------------------------------------------------------------------------
4655
4656class QueryNewPaletteEvent(Event):
093d3ff1 4657 """Proxy of C++ QueryNewPaletteEvent class"""
d55e5bfc
RD
4658 def __repr__(self):
4659 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4660 def __init__(self, *args, **kwargs):
4661 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
4662 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
4663 self.this = newobj.this
4664 self.thisown = 1
4665 del newobj.thisown
4666 def SetPaletteRealized(*args, **kwargs):
4667 """SetPaletteRealized(self, bool realized)"""
4668 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
4669
4670 def GetPaletteRealized(*args, **kwargs):
4671 """GetPaletteRealized(self) -> bool"""
4672 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
4673
4674
4675class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
4676 def __init__(self, this):
4677 self.this = this
4678 if not hasattr(self,"thisown"): self.thisown = 0
4679 self.__class__ = QueryNewPaletteEvent
4680_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
4681
4682#---------------------------------------------------------------------------
4683
4684class NavigationKeyEvent(Event):
093d3ff1 4685 """Proxy of C++ NavigationKeyEvent class"""
d55e5bfc
RD
4686 def __repr__(self):
4687 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4688 def __init__(self, *args, **kwargs):
4689 """__init__(self) -> NavigationKeyEvent"""
4690 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
4691 self.this = newobj.this
4692 self.thisown = 1
4693 del newobj.thisown
4694 def GetDirection(*args, **kwargs):
4695 """GetDirection(self) -> bool"""
4696 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
4697
4698 def SetDirection(*args, **kwargs):
908b74cd 4699 """SetDirection(self, bool forward)"""
d55e5bfc
RD
4700 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
4701
4702 def IsWindowChange(*args, **kwargs):
4703 """IsWindowChange(self) -> bool"""
4704 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
4705
4706 def SetWindowChange(*args, **kwargs):
908b74cd 4707 """SetWindowChange(self, bool ischange)"""
d55e5bfc
RD
4708 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
4709
68350608
RD
4710 def IsFromTab(*args, **kwargs):
4711 """IsFromTab(self) -> bool"""
4712 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
4713
4714 def SetFromTab(*args, **kwargs):
4715 """SetFromTab(self, bool bIs)"""
4716 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
4717
908b74cd
RD
4718 def SetFlags(*args, **kwargs):
4719 """SetFlags(self, long flags)"""
4720 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
4721
d55e5bfc
RD
4722 def GetCurrentFocus(*args, **kwargs):
4723 """GetCurrentFocus(self) -> Window"""
4724 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
4725
4726 def SetCurrentFocus(*args, **kwargs):
4727 """SetCurrentFocus(self, Window win)"""
4728 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
4729
b0f7404b 4730 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
4731 IsForward = _core_.NavigationKeyEvent_IsForward
4732 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 4733 FromTab = _core_.NavigationKeyEvent_FromTab
d55e5bfc
RD
4734
4735class NavigationKeyEventPtr(NavigationKeyEvent):
4736 def __init__(self, this):
4737 self.this = this
4738 if not hasattr(self,"thisown"): self.thisown = 0
4739 self.__class__ = NavigationKeyEvent
4740_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
4741
4742#---------------------------------------------------------------------------
4743
4744class WindowCreateEvent(CommandEvent):
093d3ff1 4745 """Proxy of C++ WindowCreateEvent class"""
d55e5bfc
RD
4746 def __repr__(self):
4747 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4748 def __init__(self, *args, **kwargs):
4749 """__init__(self, Window win=None) -> WindowCreateEvent"""
4750 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
4751 self.this = newobj.this
4752 self.thisown = 1
4753 del newobj.thisown
4754 def GetWindow(*args, **kwargs):
4755 """GetWindow(self) -> Window"""
4756 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
4757
4758
4759class WindowCreateEventPtr(WindowCreateEvent):
4760 def __init__(self, this):
4761 self.this = this
4762 if not hasattr(self,"thisown"): self.thisown = 0
4763 self.__class__ = WindowCreateEvent
4764_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
4765
4766class WindowDestroyEvent(CommandEvent):
093d3ff1 4767 """Proxy of C++ WindowDestroyEvent class"""
d55e5bfc
RD
4768 def __repr__(self):
4769 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4770 def __init__(self, *args, **kwargs):
4771 """__init__(self, Window win=None) -> WindowDestroyEvent"""
4772 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
4773 self.this = newobj.this
4774 self.thisown = 1
4775 del newobj.thisown
4776 def GetWindow(*args, **kwargs):
4777 """GetWindow(self) -> Window"""
4778 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
4779
4780
4781class WindowDestroyEventPtr(WindowDestroyEvent):
4782 def __init__(self, this):
4783 self.this = this
4784 if not hasattr(self,"thisown"): self.thisown = 0
4785 self.__class__ = WindowDestroyEvent
4786_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
4787
4788#---------------------------------------------------------------------------
4789
4790class ContextMenuEvent(CommandEvent):
093d3ff1 4791 """Proxy of C++ ContextMenuEvent class"""
d55e5bfc
RD
4792 def __repr__(self):
4793 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4794 def __init__(self, *args, **kwargs):
4795 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
4796 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
4797 self.this = newobj.this
4798 self.thisown = 1
4799 del newobj.thisown
4800 def GetPosition(*args, **kwargs):
4801 """GetPosition(self) -> Point"""
4802 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
4803
4804 def SetPosition(*args, **kwargs):
4805 """SetPosition(self, Point pos)"""
4806 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
4807
4808
4809class ContextMenuEventPtr(ContextMenuEvent):
4810 def __init__(self, this):
4811 self.this = this
4812 if not hasattr(self,"thisown"): self.thisown = 0
4813 self.__class__ = ContextMenuEvent
4814_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
4815
4816#---------------------------------------------------------------------------
4817
4818IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4819IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
4820class IdleEvent(Event):
093d3ff1 4821 """Proxy of C++ IdleEvent class"""
d55e5bfc
RD
4822 def __repr__(self):
4823 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4824 def __init__(self, *args, **kwargs):
4825 """__init__(self) -> IdleEvent"""
4826 newobj = _core_.new_IdleEvent(*args, **kwargs)
4827 self.this = newobj.this
4828 self.thisown = 1
4829 del newobj.thisown
4830 def RequestMore(*args, **kwargs):
4831 """RequestMore(self, bool needMore=True)"""
4832 return _core_.IdleEvent_RequestMore(*args, **kwargs)
4833
4834 def MoreRequested(*args, **kwargs):
4835 """MoreRequested(self) -> bool"""
4836 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
4837
4838 def SetMode(*args, **kwargs):
c24da6d6 4839 """SetMode(int mode)"""
d55e5bfc
RD
4840 return _core_.IdleEvent_SetMode(*args, **kwargs)
4841
4842 SetMode = staticmethod(SetMode)
4843 def GetMode(*args, **kwargs):
c24da6d6 4844 """GetMode() -> int"""
d55e5bfc
RD
4845 return _core_.IdleEvent_GetMode(*args, **kwargs)
4846
4847 GetMode = staticmethod(GetMode)
4848 def CanSend(*args, **kwargs):
c24da6d6 4849 """CanSend(Window win) -> bool"""
d55e5bfc
RD
4850 return _core_.IdleEvent_CanSend(*args, **kwargs)
4851
4852 CanSend = staticmethod(CanSend)
4853
4854class IdleEventPtr(IdleEvent):
4855 def __init__(self, this):
4856 self.this = this
4857 if not hasattr(self,"thisown"): self.thisown = 0
4858 self.__class__ = IdleEvent
4859_core_.IdleEvent_swigregister(IdleEventPtr)
4860
4861def IdleEvent_SetMode(*args, **kwargs):
4862 """IdleEvent_SetMode(int mode)"""
4863 return _core_.IdleEvent_SetMode(*args, **kwargs)
4864
4865def IdleEvent_GetMode(*args, **kwargs):
4866 """IdleEvent_GetMode() -> int"""
4867 return _core_.IdleEvent_GetMode(*args, **kwargs)
4868
4869def IdleEvent_CanSend(*args, **kwargs):
4870 """IdleEvent_CanSend(Window win) -> bool"""
4871 return _core_.IdleEvent_CanSend(*args, **kwargs)
4872
4873#---------------------------------------------------------------------------
4874
4875class PyEvent(Event):
093d3ff1 4876 """Proxy of C++ PyEvent class"""
d55e5bfc
RD
4877 def __repr__(self):
4878 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4879 def __init__(self, *args, **kwargs):
4880 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
4881 newobj = _core_.new_PyEvent(*args, **kwargs)
4882 self.this = newobj.this
4883 self.thisown = 1
4884 del newobj.thisown
4885 self.SetSelf(self)
4886
4887 def __del__(self, destroy=_core_.delete_PyEvent):
4888 """__del__(self)"""
4889 try:
4890 if self.thisown: destroy(self)
4891 except: pass
4892
4893 def SetSelf(*args, **kwargs):
4894 """SetSelf(self, PyObject self)"""
4895 return _core_.PyEvent_SetSelf(*args, **kwargs)
4896
4897 def GetSelf(*args, **kwargs):
4898 """GetSelf(self) -> PyObject"""
4899 return _core_.PyEvent_GetSelf(*args, **kwargs)
4900
4901
4902class PyEventPtr(PyEvent):
4903 def __init__(self, this):
4904 self.this = this
4905 if not hasattr(self,"thisown"): self.thisown = 0
4906 self.__class__ = PyEvent
4907_core_.PyEvent_swigregister(PyEventPtr)
4908
4909class PyCommandEvent(CommandEvent):
093d3ff1 4910 """Proxy of C++ PyCommandEvent class"""
d55e5bfc
RD
4911 def __repr__(self):
4912 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4913 def __init__(self, *args, **kwargs):
4914 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
4915 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
4916 self.this = newobj.this
4917 self.thisown = 1
4918 del newobj.thisown
4919 self.SetSelf(self)
4920
4921 def __del__(self, destroy=_core_.delete_PyCommandEvent):
4922 """__del__(self)"""
4923 try:
4924 if self.thisown: destroy(self)
4925 except: pass
4926
4927 def SetSelf(*args, **kwargs):
4928 """SetSelf(self, PyObject self)"""
4929 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
4930
4931 def GetSelf(*args, **kwargs):
4932 """GetSelf(self) -> PyObject"""
4933 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
4934
4935
4936class PyCommandEventPtr(PyCommandEvent):
4937 def __init__(self, this):
4938 self.this = this
4939 if not hasattr(self,"thisown"): self.thisown = 0
4940 self.__class__ = PyCommandEvent
4941_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
4942
53aa7709
RD
4943class DateEvent(CommandEvent):
4944 """Proxy of C++ DateEvent class"""
4945 def __repr__(self):
4946 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4947 def __init__(self, *args, **kwargs):
4948 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
4949 newobj = _core_.new_DateEvent(*args, **kwargs)
4950 self.this = newobj.this
4951 self.thisown = 1
4952 del newobj.thisown
4953 def GetDate(*args, **kwargs):
4954 """GetDate(self) -> DateTime"""
4955 return _core_.DateEvent_GetDate(*args, **kwargs)
4956
4957 def SetDate(*args, **kwargs):
4958 """SetDate(self, DateTime date)"""
4959 return _core_.DateEvent_SetDate(*args, **kwargs)
4960
4961
4962class DateEventPtr(DateEvent):
4963 def __init__(self, this):
4964 self.this = this
4965 if not hasattr(self,"thisown"): self.thisown = 0
4966 self.__class__ = DateEvent
4967_core_.DateEvent_swigregister(DateEventPtr)
4968
4969wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
4970EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
4971
d55e5bfc
RD
4972#---------------------------------------------------------------------------
4973
4974PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4975PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4976PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4977PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4978PRINT_WINDOWS = _core_.PRINT_WINDOWS
4979PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
4980class PyApp(EvtHandler):
c24da6d6
RD
4981 """
4982 The ``wx.PyApp`` class is an *implementation detail*, please use the
4983 `wx.App` class (or some other derived class) instead.
4984 """
d55e5bfc
RD
4985 def __repr__(self):
4986 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4987 def __init__(self, *args, **kwargs):
4988 """
4989 __init__(self) -> PyApp
4990
4991 Create a new application object, starting the bootstrap process.
4992 """
4993 newobj = _core_.new_PyApp(*args, **kwargs)
4994 self.this = newobj.this
4995 self.thisown = 1
4996 del newobj.thisown
4997 self._setCallbackInfo(self, PyApp)
4998 self._setOORInfo(self)
4999
5000 def __del__(self, destroy=_core_.delete_PyApp):
5001 """__del__(self)"""
5002 try:
5003 if self.thisown: destroy(self)
5004 except: pass
5005
5006 def _setCallbackInfo(*args, **kwargs):
5007 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5008 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
5009
5010 def GetAppName(*args, **kwargs):
5011 """
5012 GetAppName(self) -> String
5013
5014 Get the application name.
5015 """
5016 return _core_.PyApp_GetAppName(*args, **kwargs)
5017
5018 def SetAppName(*args, **kwargs):
5019 """
5020 SetAppName(self, String name)
5021
c24da6d6
RD
5022 Set the application name. This value may be used automatically by
5023 `wx.Config` and such.
d55e5bfc
RD
5024 """
5025 return _core_.PyApp_SetAppName(*args, **kwargs)
5026
5027 def GetClassName(*args, **kwargs):
5028 """
5029 GetClassName(self) -> String
5030
5031 Get the application's class name.
5032 """
5033 return _core_.PyApp_GetClassName(*args, **kwargs)
5034
5035 def SetClassName(*args, **kwargs):
5036 """
5037 SetClassName(self, String name)
5038
c24da6d6
RD
5039 Set the application's class name. This value may be used for
5040 X-resources if applicable for the platform
d55e5bfc
RD
5041 """
5042 return _core_.PyApp_SetClassName(*args, **kwargs)
5043
5044 def GetVendorName(*args, **kwargs):
5045 """
5046 GetVendorName(self) -> String
5047
5048 Get the application's vendor name.
5049 """
5050 return _core_.PyApp_GetVendorName(*args, **kwargs)
5051
5052 def SetVendorName(*args, **kwargs):
5053 """
5054 SetVendorName(self, String name)
5055
c24da6d6
RD
5056 Set the application's vendor name. This value may be used
5057 automatically by `wx.Config` and such.
d55e5bfc
RD
5058 """
5059 return _core_.PyApp_SetVendorName(*args, **kwargs)
5060
5061 def GetTraits(*args, **kwargs):
5062 """
5063 GetTraits(self) -> wxAppTraits
5064
c24da6d6
RD
5065 Return (and create if necessary) the app traits object to which we
5066 delegate for everything which either should be configurable by the
5067 user (then he can change the default behaviour simply by overriding
5068 CreateTraits() and returning his own traits object) or which is
5069 GUI/console dependent as then wx.AppTraits allows us to abstract the
5070 differences behind the common facade.
5071
5072 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc
RD
5073 """
5074 return _core_.PyApp_GetTraits(*args, **kwargs)
5075
5076 def ProcessPendingEvents(*args, **kwargs):
5077 """
5078 ProcessPendingEvents(self)
5079
c24da6d6
RD
5080 Process all events in the Pending Events list -- it is necessary to
5081 call this function to process posted events. This normally happens
5082 during each event loop iteration.
d55e5bfc
RD
5083 """
5084 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
5085
5086 def Yield(*args, **kwargs):
5087 """
5088 Yield(self, bool onlyIfNeeded=False) -> bool
5089
c24da6d6
RD
5090 Process all currently pending events right now, instead of waiting
5091 until return to the event loop. It is an error to call ``Yield``
5092 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 5093
c24da6d6 5094 :warning: This function is dangerous as it can lead to unexpected
79fccf9d
RD
5095 reentrancies (i.e. when called from an event handler it may
5096 result in calling the same event handler again), use with
5097 extreme care or, better, don't use at all!
d55e5bfc 5098
c24da6d6 5099 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
79fccf9d 5100
d55e5bfc
RD
5101 """
5102 return _core_.PyApp_Yield(*args, **kwargs)
5103
5104 def WakeUpIdle(*args, **kwargs):
5105 """
5106 WakeUpIdle(self)
5107
c24da6d6
RD
5108 Make sure that idle events are sent again.
5109 :see: `wx.WakeUpIdle`
d55e5bfc
RD
5110 """
5111 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
5112
84f85550
RD
5113 def IsMainLoopRunning(*args, **kwargs):
5114 """
5115 IsMainLoopRunning() -> bool
5116
5117 Returns True if we're running the main loop, i.e. if the events can
5118 currently be dispatched.
5119 """
5120 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5121
5122 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
5123 def MainLoop(*args, **kwargs):
5124 """
5125 MainLoop(self) -> int
5126
c24da6d6
RD
5127 Execute the main GUI loop, the function doesn't normally return until
5128 all top level windows have been closed and destroyed.
d55e5bfc
RD
5129 """
5130 return _core_.PyApp_MainLoop(*args, **kwargs)
5131
5132 def Exit(*args, **kwargs):
5133 """
5134 Exit(self)
5135
5136 Exit the main loop thus terminating the application.
c24da6d6 5137 :see: `wx.Exit`
d55e5bfc
RD
5138 """
5139 return _core_.PyApp_Exit(*args, **kwargs)
5140
5141 def ExitMainLoop(*args, **kwargs):
5142 """
5143 ExitMainLoop(self)
5144
c24da6d6
RD
5145 Exit the main GUI loop during the next iteration of the main
5146 loop, (i.e. it does not stop the program immediately!)
d55e5bfc
RD
5147 """
5148 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
5149
5150 def Pending(*args, **kwargs):
5151 """
5152 Pending(self) -> bool
5153
5154 Returns True if there are unprocessed events in the event queue.
5155 """
5156 return _core_.PyApp_Pending(*args, **kwargs)
5157
5158 def Dispatch(*args, **kwargs):
5159 """
5160 Dispatch(self) -> bool
5161
5162 Process the first event in the event queue (blocks until an event
5163 appears if there are none currently)
5164 """
5165 return _core_.PyApp_Dispatch(*args, **kwargs)
5166
5167 def ProcessIdle(*args, **kwargs):
5168 """
5169 ProcessIdle(self) -> bool
5170
c24da6d6
RD
5171 Called from the MainLoop when the application becomes idle (there are
5172 no pending events) and sends a `wx.IdleEvent` to all interested
5173 parties. Returns True if more idle events are needed, False if not.
d55e5bfc
RD
5174 """
5175 return _core_.PyApp_ProcessIdle(*args, **kwargs)
5176
5177 def SendIdleEvents(*args, **kwargs):
5178 """
5179 SendIdleEvents(self, Window win, IdleEvent event) -> bool
5180
c24da6d6
RD
5181 Send idle event to window and all subwindows. Returns True if more
5182 idle time is requested.
d55e5bfc
RD
5183 """
5184 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
5185
5186 def IsActive(*args, **kwargs):
5187 """
5188 IsActive(self) -> bool
5189
5190 Return True if our app has focus.
5191 """
5192 return _core_.PyApp_IsActive(*args, **kwargs)
5193
5194 def SetTopWindow(*args, **kwargs):
5195 """
5196 SetTopWindow(self, Window win)
5197
c24da6d6 5198 Set the *main* top level window
d55e5bfc
RD
5199 """
5200 return _core_.PyApp_SetTopWindow(*args, **kwargs)
5201
5202 def GetTopWindow(*args, **kwargs):
5203 """
5204 GetTopWindow(self) -> Window
5205
c24da6d6
RD
5206 Return the *main* top level window (if it hadn't been set previously
5207 with SetTopWindow(), will return just some top level window and, if
5208 there not any, will return None)
d55e5bfc
RD
5209 """
5210 return _core_.PyApp_GetTopWindow(*args, **kwargs)
5211
5212 def SetExitOnFrameDelete(*args, **kwargs):
5213 """
5214 SetExitOnFrameDelete(self, bool flag)
5215
c24da6d6
RD
5216 Control the exit behaviour: by default, the program will exit the main
5217 loop (and so, usually, terminate) when the last top-level program
5218 window is deleted. Beware that if you disable this behaviour (with
5219 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
5220 explicitly from somewhere.
d55e5bfc
RD
5221 """
5222 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
5223
5224 def GetExitOnFrameDelete(*args, **kwargs):
5225 """
5226 GetExitOnFrameDelete(self) -> bool
5227
5228 Get the current exit behaviour setting.
5229 """
5230 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
5231
5232 def SetUseBestVisual(*args, **kwargs):
5233 """
5234 SetUseBestVisual(self, bool flag)
5235
c24da6d6
RD
5236 Set whether the app should try to use the best available visual on
5237 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc
RD
5238 """
5239 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
5240
5241 def GetUseBestVisual(*args, **kwargs):
5242 """
5243 GetUseBestVisual(self) -> bool
5244
5245 Get current UseBestVisual setting.
5246 """
5247 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
5248
5249 def SetPrintMode(*args, **kwargs):
5250 """SetPrintMode(self, int mode)"""
5251 return _core_.PyApp_SetPrintMode(*args, **kwargs)
5252
5253 def GetPrintMode(*args, **kwargs):
5254 """GetPrintMode(self) -> int"""
5255 return _core_.PyApp_GetPrintMode(*args, **kwargs)
5256
5257 def SetAssertMode(*args, **kwargs):
5258 """
5259 SetAssertMode(self, int mode)
5260
79fccf9d 5261 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc
RD
5262 """
5263 return _core_.PyApp_SetAssertMode(*args, **kwargs)
5264
5265 def GetAssertMode(*args, **kwargs):
5266 """
5267 GetAssertMode(self) -> int
5268
5269 Get the current OnAssert behaviour setting.
5270 """
5271 return _core_.PyApp_GetAssertMode(*args, **kwargs)
5272
5273 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 5274 """GetMacSupportPCMenuShortcuts() -> bool"""
d55e5bfc
RD
5275 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5276
5277 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
5278 def GetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 5279 """GetMacAboutMenuItemId() -> long"""
d55e5bfc
RD
5280 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5281
5282 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
5283 def GetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 5284 """GetMacPreferencesMenuItemId() -> long"""
d55e5bfc
RD
5285 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5286
5287 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
5288 def GetMacExitMenuItemId(*args, **kwargs):
c24da6d6 5289 """GetMacExitMenuItemId() -> long"""
d55e5bfc
RD
5290 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5291
5292 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
5293 def GetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 5294 """GetMacHelpMenuTitleName() -> String"""
d55e5bfc
RD
5295 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5296
5297 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
5298 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 5299 """SetMacSupportPCMenuShortcuts(bool val)"""
d55e5bfc
RD
5300 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5301
5302 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
5303 def SetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 5304 """SetMacAboutMenuItemId(long val)"""
d55e5bfc
RD
5305 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5306
5307 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
5308 def SetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 5309 """SetMacPreferencesMenuItemId(long val)"""
d55e5bfc
RD
5310 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5311
5312 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
5313 def SetMacExitMenuItemId(*args, **kwargs):
c24da6d6 5314 """SetMacExitMenuItemId(long val)"""
d55e5bfc
RD
5315 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5316
5317 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
5318 def SetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 5319 """SetMacHelpMenuTitleName(String val)"""
d55e5bfc
RD
5320 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5321
5322 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
5323 def _BootstrapApp(*args, **kwargs):
5324 """
5325 _BootstrapApp(self)
5326
5327 For internal use only
5328 """
5329 return _core_.PyApp__BootstrapApp(*args, **kwargs)
5330
5331 def GetComCtl32Version(*args, **kwargs):
5332 """
c24da6d6 5333 GetComCtl32Version() -> int
d55e5bfc 5334
c24da6d6
RD
5335 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5336 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
5337 """
5338 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5339
5340 GetComCtl32Version = staticmethod(GetComCtl32Version)
5341
5342class PyAppPtr(PyApp):
5343 def __init__(self, this):
5344 self.this = this
5345 if not hasattr(self,"thisown"): self.thisown = 0
5346 self.__class__ = PyApp
5347_core_.PyApp_swigregister(PyAppPtr)
5348
84f85550
RD
5349def PyApp_IsMainLoopRunning(*args, **kwargs):
5350 """
5351 PyApp_IsMainLoopRunning() -> bool
5352
5353 Returns True if we're running the main loop, i.e. if the events can
5354 currently be dispatched.
5355 """
5356 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5357
d55e5bfc
RD
5358def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
5359 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
5360 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5361
5362def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
5363 """PyApp_GetMacAboutMenuItemId() -> long"""
5364 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5365
5366def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
5367 """PyApp_GetMacPreferencesMenuItemId() -> long"""
5368 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5369
5370def PyApp_GetMacExitMenuItemId(*args, **kwargs):
5371 """PyApp_GetMacExitMenuItemId() -> long"""
5372 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5373
5374def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
5375 """PyApp_GetMacHelpMenuTitleName() -> String"""
5376 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5377
5378def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
5379 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
5380 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5381
5382def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
5383 """PyApp_SetMacAboutMenuItemId(long val)"""
5384 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5385
5386def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
5387 """PyApp_SetMacPreferencesMenuItemId(long val)"""
5388 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5389
5390def PyApp_SetMacExitMenuItemId(*args, **kwargs):
5391 """PyApp_SetMacExitMenuItemId(long val)"""
5392 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5393
5394def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
5395 """PyApp_SetMacHelpMenuTitleName(String val)"""
5396 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5397
5398def PyApp_GetComCtl32Version(*args, **kwargs):
5399 """
5400 PyApp_GetComCtl32Version() -> int
5401
c24da6d6
RD
5402 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5403 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
5404 """
5405 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5406
5407#---------------------------------------------------------------------------
5408
5409
5410def Exit(*args, **kwargs):
5411 """
5412 Exit()
5413
5414 Force an exit of the application. Convenience for wx.GetApp().Exit()
5415 """
5416 return _core_.Exit(*args, **kwargs)
5417
5418def Yield(*args, **kwargs):
5419 """
5420 Yield() -> bool
5421
5422 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
5423 """
5424 return _core_.Yield(*args, **kwargs)
5425
5426def YieldIfNeeded(*args, **kwargs):
5427 """
5428 YieldIfNeeded() -> bool
5429
5430 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
5431 """
5432 return _core_.YieldIfNeeded(*args, **kwargs)
5433
5434def SafeYield(*args, **kwargs):
5435 """
5436 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
5437
c24da6d6
RD
5438 This function is similar to `wx.Yield`, except that it disables the
5439 user input to all program windows before calling `wx.Yield` and
5440 re-enables it again afterwards. If ``win`` is not None, this window
5441 will remain enabled, allowing the implementation of some limited user
5442 interaction.
d55e5bfc 5443
c24da6d6 5444 :Returns: the result of the call to `wx.Yield`.
d55e5bfc
RD
5445 """
5446 return _core_.SafeYield(*args, **kwargs)
5447
5448def WakeUpIdle(*args, **kwargs):
5449 """
5450 WakeUpIdle()
5451
c24da6d6
RD
5452 Cause the message queue to become empty again, so idle events will be
5453 sent.
d55e5bfc
RD
5454 """
5455 return _core_.WakeUpIdle(*args, **kwargs)
5456
5457def PostEvent(*args, **kwargs):
5458 """
5459 PostEvent(EvtHandler dest, Event event)
5460
c24da6d6
RD
5461 Send an event to a window or other wx.EvtHandler to be processed
5462 later.
d55e5bfc
RD
5463 """
5464 return _core_.PostEvent(*args, **kwargs)
5465
5466def App_CleanUp(*args, **kwargs):
5467 """
5468 App_CleanUp()
5469
79fccf9d 5470 For internal use only, it is used to cleanup after wxWidgets when
c24da6d6 5471 Python shuts down.
d55e5bfc
RD
5472 """
5473 return _core_.App_CleanUp(*args, **kwargs)
5474
5475def GetApp(*args, **kwargs):
5476 """
5477 GetApp() -> PyApp
5478
5479 Return a reference to the current wx.App object.
5480 """
5481 return _core_.GetApp(*args, **kwargs)
5cbf236d
RD
5482
5483def SetDefaultPyEncoding(*args, **kwargs):
5484 """
5485 SetDefaultPyEncoding(string encoding)
5486
5487 Sets the encoding that wxPython will use when it needs to convert a
5488 Python string or unicode object to or from a wxString.
62d32a5f
RD
5489
5490 The default encoding is the value of ``locale.getdefaultlocale()[1]``
5491 but please be aware that the default encoding within the same locale
5492 may be slightly different on different platforms. For example, please
5493 see http://www.alanwood.net/demos/charsetdiffs.html for differences
5494 between the common latin/roman encodings.
5cbf236d
RD
5495 """
5496 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5497
5498def GetDefaultPyEncoding(*args, **kwargs):
5499 """
5500 GetDefaultPyEncoding() -> string
5501
5502 Gets the current encoding that wxPython will use when it needs to
5503 convert a Python string or unicode object to or from a wxString.
5504 """
5505 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d55e5bfc
RD
5506#----------------------------------------------------------------------
5507
5508class PyOnDemandOutputWindow:
5509 """
5510 A class that can be used for redirecting Python's stdout and
5511 stderr streams. It will do nothing until something is wrriten to
5512 the stream at which point it will create a Frame with a text area
5513 and write the text there.
5514 """
5515 def __init__(self, title = "wxPython: stdout/stderr"):
5516 self.frame = None
5517 self.title = title
412d302d
RD
5518 self.pos = wx.DefaultPosition
5519 self.size = (450, 300)
d55e5bfc
RD
5520 self.parent = None
5521
5522 def SetParent(self, parent):
5523 """Set the window to be used as the popup Frame's parent."""
5524 self.parent = parent
5525
5526
5527 def CreateOutputWindow(self, st):
412d302d
RD
5528 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
5529 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 5530 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 5531 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 5532 self.text.AppendText(st)
d55e5bfc
RD
5533 self.frame.Show(True)
5534 EVT_CLOSE(self.frame, self.OnCloseWindow)
5535
5536
5537 def OnCloseWindow(self, event):
5538 if self.frame is not None:
5539 self.frame.Destroy()
5540 self.frame = None
5541 self.text = None
5542
5543
5544 # These methods provide the file-like output behaviour.
5545 def write(self, text):
5546 """
5547 Create the output window if needed and write the string to it.
5548 If not called in the context of the gui thread then uses
5549 CallAfter to do the work there.
5550 """
5551 if self.frame is None:
5552 if not wx.Thread_IsMain():
5553 wx.CallAfter(self.CreateOutputWindow, text)
5554 else:
5555 self.CreateOutputWindow(text)
5556 else:
5557 if not wx.Thread_IsMain():
5558 wx.CallAfter(self.text.AppendText, text)
5559 else:
5560 self.text.AppendText(text)
5561
5562
5563 def close(self):
5564 if self.frame is not None:
5565 wx.CallAfter(self.frame.Close)
5566
5567
19272049
RD
5568 def flush(self):
5569 pass
5570
5571
d55e5bfc
RD
5572
5573#----------------------------------------------------------------------
5574
5575_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5576
5577class App(wx.PyApp):
5578 """
c24da6d6
RD
5579 The ``wx.App`` class represents the application and is used to:
5580
5581 * bootstrap the wxPython system and initialize the underlying
5582 gui toolkit
5583 * set and get application-wide properties
5584 * implement the windowing system main message or event loop,
5585 and to dispatch events to window instances
5586 * etc.
5587
5588 Every application must have a ``wx.App`` instance, and all
5589 creation of UI objects should be delayed until after the
5590 ``wx.App`` object has been created in order to ensure that the gui
5591 platform and wxWidgets have been fully initialized.
5592
5593 Normally you would derive from this class and implement an
5594 ``OnInit`` method that creates a frame and then calls
5595 ``self.SetTopWindow(frame)``.
5596
5597 :see: `wx.PySimpleApp` for a simpler app class that can be used
79fccf9d 5598 directly.
d55e5bfc 5599 """
c24da6d6 5600
d55e5bfc
RD
5601 outputWindowClass = PyOnDemandOutputWindow
5602
c24da6d6
RD
5603 def __init__(self, redirect=_defRedirect, filename=None,
5604 useBestVisual=False, clearSigInt=True):
5605 """
5606 Construct a ``wx.App`` object.
5607
5608 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5609 redirected? Defaults to True on Windows and Mac, False
5610 otherwise. If `filename` is None then output will be
5611 redirected to a window that pops up as needed. (You can
5612 control what kind of window is created for the output by
5613 resetting the class variable ``outputWindowClass`` to a
5614 class of your choosing.)
5615
5616 :param filename: The name of a file to redirect output to, if
5617 redirect is True.
5618
5619 :param useBestVisual: Should the app try to use the best
5620 available visual provided by the system (only relevant on
5621 systems that have more than one visual.) This parameter
5622 must be used instead of calling `SetUseBestVisual` later
5623 on because it must be set before the underlying GUI
5624 toolkit is initialized.
5625
5626 :param clearSigInt: Should SIGINT be cleared? This allows the
5627 app to terminate upon a Ctrl-C in the console like other
5628 GUI apps will.
5629
5630 :note: You should override OnInit to do applicaition
5631 initialization to ensure that the system, toolkit and
5632 wxWidgets are fully initialized.
5633 """
d55e5bfc
RD
5634 wx.PyApp.__init__(self)
5635
5636 if wx.Platform == "__WXMAC__":
5637 try:
5638 import MacOS
5639 if not MacOS.WMAvailable():
5640 print """\
5641This program needs access to the screen. Please run with 'pythonw',
5642not 'python', and only when you are logged in on the main display of
5643your Mac."""
5644 _sys.exit(1)
b1f29bf7
RD
5645 except SystemExit:
5646 raise
d55e5bfc
RD
5647 except:
5648 pass
5649
5650 # This has to be done before OnInit
5651 self.SetUseBestVisual(useBestVisual)
5652
5653 # Set the default handler for SIGINT. This fixes a problem
5654 # where if Ctrl-C is pressed in the console that started this
5655 # app then it will not appear to do anything, (not even send
5656 # KeyboardInterrupt???) but will later segfault on exit. By
5657 # setting the default handler then the app will exit, as
5658 # expected (depending on platform.)
c24da6d6
RD
5659 if clearSigInt:
5660 try:
5661 import signal
5662 signal.signal(signal.SIGINT, signal.SIG_DFL)
5663 except:
5664 pass
d55e5bfc
RD
5665
5666 # Save and redirect the stdio to a window?
5667 self.stdioWin = None
5668 self.saveStdio = (_sys.stdout, _sys.stderr)
5669 if redirect:
5670 self.RedirectStdio(filename)
5671
8fb0e70a
RD
5672 # Use Python's install prefix as the default
5673 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
5674
d55e5bfc
RD
5675 # This finishes the initialization of wxWindows and then calls
5676 # the OnInit that should be present in the derived class
5677 self._BootstrapApp()
5678
5679
5680 def __del__(self):
5681 try:
5682 self.RestoreStdio() # Just in case the MainLoop was overridden
5683 except:
5684 pass
5685
5686
5687 def SetTopWindow(self, frame):
5688 """Set the \"main\" top level window"""
5689 if self.stdioWin:
5690 self.stdioWin.SetParent(frame)
5691 wx.PyApp.SetTopWindow(self, frame)
5692
5693
5694 def MainLoop(self):
5695 """Execute the main GUI event loop"""
5696 wx.PyApp.MainLoop(self)
5697 self.RestoreStdio()
5698
5699
5700 def RedirectStdio(self, filename=None):
5701 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
5702 if filename:
5703 _sys.stdout = _sys.stderr = open(filename, 'a')
5704 else:
5705 self.stdioWin = self.outputWindowClass()
5706 _sys.stdout = _sys.stderr = self.stdioWin
5707
5708
5709 def RestoreStdio(self):
5710 _sys.stdout, _sys.stderr = self.saveStdio
5711
5712
412d302d
RD
5713 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
5714 """
5715 Set the title, position and/or size of the output window if
f5b96ee1
RD
5716 the stdio has been redirected. This should be called before
5717 any output would cause the output window to be created.
412d302d
RD
5718 """
5719 if self.stdioWin:
5720 if title is not None:
5721 self.stdioWin.title = title
5722 if pos is not None:
5723 self.stdioWin.pos = pos
5724 if size is not None:
5725 self.stdioWin.size = size
5726
5727
5728
d55e5bfc 5729
c24da6d6 5730# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
5731App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5732App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5733App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5734App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5735App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5736App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5737App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5738App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5739App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5740App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5741App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
5742
5743#----------------------------------------------------------------------------
5744
5745class PySimpleApp(wx.App):
5746 """
5747 A simple application class. You can just create one of these and
5748 then then make your top level windows later, and not have to worry
c24da6d6 5749 about OnInit. For example::
d55e5bfc 5750
c24da6d6
RD
5751 app = wx.PySimpleApp()
5752 frame = wx.Frame(None, title='Hello World')
5753 frame.Show()
5754 app.MainLoop()
5755
5756 :see: `wx.App`
5757 """
5758
5759 def __init__(self, redirect=False, filename=None,
5760 useBestVisual=False, clearSigInt=True):
5761 """
5762 :see: `wx.App.__init__`
5763 """
5764 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
5765
5766 def OnInit(self):
d55e5bfc
RD
5767 return True
5768
5769
c24da6d6 5770
d55e5bfc
RD
5771# Is anybody using this one?
5772class PyWidgetTester(wx.App):
5773 def __init__(self, size = (250, 100)):
5774 self.size = size
5775 wx.App.__init__(self, 0)
5776
5777 def OnInit(self):
5778 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
5779 self.SetTopWindow(self.frame)
5780 return True
5781
c24da6d6
RD
5782 def SetWidget(self, widgetClass, *args, **kwargs):
5783 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
5784 self.frame.Show(True)
5785
5786#----------------------------------------------------------------------------
5787# DO NOT hold any other references to this object. This is how we
c24da6d6 5788# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 5789# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
c24da6d6 5790# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
5791
5792class __wxPyCleanup:
5793 def __init__(self):
5794 self.cleanup = _core_.App_CleanUp
5795 def __del__(self):
5796 self.cleanup()
5797
5798_sys.__wxPythonCleanup = __wxPyCleanup()
5799
5800## # another possible solution, but it gets called too early...
c24da6d6
RD
5801## import atexit
5802## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
5803
5804
5805#----------------------------------------------------------------------------
5806
5807#---------------------------------------------------------------------------
5808
ae8162c8 5809class EventLoop(object):
093d3ff1 5810 """Proxy of C++ EventLoop class"""
ae8162c8
RD
5811 def __repr__(self):
5812 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5813 def __init__(self, *args, **kwargs):
5814 """__init__(self) -> EventLoop"""
5815 newobj = _core_.new_EventLoop(*args, **kwargs)
5816 self.this = newobj.this
5817 self.thisown = 1
5818 del newobj.thisown
5819 def __del__(self, destroy=_core_.delete_EventLoop):
5820 """__del__(self)"""
5821 try:
5822 if self.thisown: destroy(self)
5823 except: pass
5824
5825 def Run(*args, **kwargs):
5826 """Run(self) -> int"""
5827 return _core_.EventLoop_Run(*args, **kwargs)
5828
5829 def Exit(*args, **kwargs):
5830 """Exit(self, int rc=0)"""
5831 return _core_.EventLoop_Exit(*args, **kwargs)
5832
5833 def Pending(*args, **kwargs):
5834 """Pending(self) -> bool"""
5835 return _core_.EventLoop_Pending(*args, **kwargs)
5836
5837 def Dispatch(*args, **kwargs):
5838 """Dispatch(self) -> bool"""
5839 return _core_.EventLoop_Dispatch(*args, **kwargs)
5840
5841 def IsRunning(*args, **kwargs):
5842 """IsRunning(self) -> bool"""
5843 return _core_.EventLoop_IsRunning(*args, **kwargs)
5844
5845 def GetActive(*args, **kwargs):
5846 """GetActive() -> EventLoop"""
5847 return _core_.EventLoop_GetActive(*args, **kwargs)
5848
5849 GetActive = staticmethod(GetActive)
5850 def SetActive(*args, **kwargs):
5851 """SetActive(EventLoop loop)"""
5852 return _core_.EventLoop_SetActive(*args, **kwargs)
5853
5854 SetActive = staticmethod(SetActive)
5855
5856class EventLoopPtr(EventLoop):
5857 def __init__(self, this):
5858 self.this = this
5859 if not hasattr(self,"thisown"): self.thisown = 0
5860 self.__class__ = EventLoop
5861_core_.EventLoop_swigregister(EventLoopPtr)
5862
5863def EventLoop_GetActive(*args, **kwargs):
5864 """EventLoop_GetActive() -> EventLoop"""
5865 return _core_.EventLoop_GetActive(*args, **kwargs)
5866
5867def EventLoop_SetActive(*args, **kwargs):
5868 """EventLoop_SetActive(EventLoop loop)"""
5869 return _core_.EventLoop_SetActive(*args, **kwargs)
5870
5871#---------------------------------------------------------------------------
5872
d55e5bfc 5873class AcceleratorEntry(object):
c24da6d6
RD
5874 """
5875 A class used to define items in an `wx.AcceleratorTable`. wxPython
5876 programs can choose to use wx.AcceleratorEntry objects, but using a
5877 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
79fccf9d 5878 as well. See `__init__` for of the tuple values.
c24da6d6
RD
5879
5880 :see: `wx.AcceleratorTable`
5881 """
d55e5bfc
RD
5882 def __repr__(self):
5883 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5884 def __init__(self, *args, **kwargs):
c24da6d6
RD
5885 """
5886 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
5887
5888 Construct a wx.AcceleratorEntry.
c24da6d6 5889 """
d55e5bfc
RD
5890 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
5891 self.this = newobj.this
5892 self.thisown = 1
5893 del newobj.thisown
5894 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
5895 """__del__(self)"""
5896 try:
5897 if self.thisown: destroy(self)
5898 except: pass
5899
5900 def Set(*args, **kwargs):
c24da6d6
RD
5901 """
5902 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 5903
c24da6d6
RD
5904 (Re)set the attributes of a wx.AcceleratorEntry.
5905 :see `__init__`
5906 """
5907 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
5908
5909 def GetFlags(*args, **kwargs):
c24da6d6
RD
5910 """
5911 GetFlags(self) -> int
5912
5913 Get the AcceleratorEntry's flags.
5914 """
d55e5bfc
RD
5915 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
5916
5917 def GetKeyCode(*args, **kwargs):
c24da6d6
RD
5918 """
5919 GetKeyCode(self) -> int
5920
5921 Get the AcceleratorEntry's keycode.
5922 """
d55e5bfc
RD
5923 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
5924
5925 def GetCommand(*args, **kwargs):
c24da6d6
RD
5926 """
5927 GetCommand(self) -> int
5928
5929 Get the AcceleratorEntry's command ID.
5930 """
d55e5bfc
RD
5931 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
5932
5933
5934class AcceleratorEntryPtr(AcceleratorEntry):
5935 def __init__(self, this):
5936 self.this = this
5937 if not hasattr(self,"thisown"): self.thisown = 0
5938 self.__class__ = AcceleratorEntry
5939_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
5940
5941class AcceleratorTable(Object):
c24da6d6
RD
5942 """
5943 An accelerator table allows the application to specify a table of
5944 keyboard shortcuts for menus or other commands. On Windows, menu or
5945 button commands are supported; on GTK, only menu commands are
5946 supported.
c24da6d6 5947 """
d55e5bfc
RD
5948 def __repr__(self):
5949 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5950 def __init__(self, *args, **kwargs):
5951 """
5952 __init__(entries) -> AcceleratorTable
5953
c24da6d6
RD
5954 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5955 items or or of 3-tuples (flags, keyCode, cmdID)
5956
5957 :see: `wx.AcceleratorEntry`
d55e5bfc
RD
5958 """
5959 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
5960 self.this = newobj.this
5961 self.thisown = 1
5962 del newobj.thisown
5963 def __del__(self, destroy=_core_.delete_AcceleratorTable):
5964 """__del__(self)"""
5965 try:
5966 if self.thisown: destroy(self)
5967 except: pass
5968
5969 def Ok(*args, **kwargs):
5970 """Ok(self) -> bool"""
5971 return _core_.AcceleratorTable_Ok(*args, **kwargs)
5972
5973
5974class AcceleratorTablePtr(AcceleratorTable):
5975 def __init__(self, this):
5976 self.this = this
5977 if not hasattr(self,"thisown"): self.thisown = 0
5978 self.__class__ = AcceleratorTable
5979_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
5980
5981
5982def GetAccelFromString(*args, **kwargs):
5983 """GetAccelFromString(String label) -> AcceleratorEntry"""
5984 return _core_.GetAccelFromString(*args, **kwargs)
5985#---------------------------------------------------------------------------
5986
5987class VisualAttributes(object):
5988 """struct containing all the visual attributes of a control"""
5989 def __repr__(self):
5990 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5991 def __init__(self, *args, **kwargs):
5992 """
5993 __init__(self) -> VisualAttributes
5994
5995 struct containing all the visual attributes of a control
5996 """
5997 newobj = _core_.new_VisualAttributes(*args, **kwargs)
5998 self.this = newobj.this
5999 self.thisown = 1
6000 del newobj.thisown
6001 def __del__(self, destroy=_core_.delete_VisualAttributes):
6002 """__del__(self)"""
6003 try:
6004 if self.thisown: destroy(self)
6005 except: pass
6006
6007 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
6008 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
6009 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
6010
6011class VisualAttributesPtr(VisualAttributes):
6012 def __init__(self, this):
6013 self.this = this
6014 if not hasattr(self,"thisown"): self.thisown = 0
6015 self.__class__ = VisualAttributes
6016_core_.VisualAttributes_swigregister(VisualAttributesPtr)
6017NullAcceleratorTable = cvar.NullAcceleratorTable
6018PanelNameStr = cvar.PanelNameStr
6019
6020WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
6021WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
6022WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
6023WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
6024WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
6025class Window(EvtHandler):
6026 """
6027 wx.Window is the base class for all windows and represents any visible
6028 object on the screen. All controls, top level windows and so on are
6029 wx.Windows. Sizers and device contexts are not however, as they don't
6030 appear on screen themselves.
6031
6032 """
6033 def __repr__(self):
6034 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6035 def __init__(self, *args, **kwargs):
6036 """
6037 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
6038 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
6039
6040 Construct and show a generic Window.
6041 """
6042 newobj = _core_.new_Window(*args, **kwargs)
6043 self.this = newobj.this
6044 self.thisown = 1
6045 del newobj.thisown
6046 self._setOORInfo(self)
6047
6048 def Create(*args, **kwargs):
6049 """
6050 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
6051 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
6052
6053 Create the GUI part of the Window for 2-phase creation mode.
6054 """
6055 return _core_.Window_Create(*args, **kwargs)
6056
6057 def Close(*args, **kwargs):
6058 """
6059 Close(self, bool force=False) -> bool
6060
6061 This function simply generates a EVT_CLOSE event whose handler usually
6062 tries to close the window. It doesn't close the window itself,
6063 however. If force is False (the default) then the window's close
6064 handler will be allowed to veto the destruction of the window.
d55e5bfc
RD
6065 """
6066 return _core_.Window_Close(*args, **kwargs)
6067
6068 def Destroy(*args, **kwargs):
6069 """
6070 Destroy(self) -> bool
6071
6072 Destroys the window safely. Frames and dialogs are not destroyed
6073 immediately when this function is called -- they are added to a list
6074 of windows to be deleted on idle time, when all the window's events
6075 have been processed. This prevents problems with events being sent to
6076 non-existent windows.
6077
6078 Returns True if the window has either been successfully deleted, or it
6079 has been added to the list of windows pending real deletion.
6080 """
6081 return _core_.Window_Destroy(*args, **kwargs)
6082
6083 def DestroyChildren(*args, **kwargs):
6084 """
6085 DestroyChildren(self) -> bool
6086
79fccf9d
RD
6087 Destroys all children of a window. Called automatically by the
6088 destructor.
d55e5bfc
RD
6089 """
6090 return _core_.Window_DestroyChildren(*args, **kwargs)
6091
6092 def IsBeingDeleted(*args, **kwargs):
6093 """
6094 IsBeingDeleted(self) -> bool
6095
6096 Is the window in the process of being deleted?
6097 """
6098 return _core_.Window_IsBeingDeleted(*args, **kwargs)
6099
6100 def SetTitle(*args, **kwargs):
6101 """
6102 SetTitle(self, String title)
6103
6104 Sets the window's title. Applicable only to frames and dialogs.
6105 """
6106 return _core_.Window_SetTitle(*args, **kwargs)
6107
6108 def GetTitle(*args, **kwargs):
6109 """
6110 GetTitle(self) -> String
6111
6112 Gets the window's title. Applicable only to frames and dialogs.
6113 """
6114 return _core_.Window_GetTitle(*args, **kwargs)
6115
6116 def SetLabel(*args, **kwargs):
6117 """
6118 SetLabel(self, String label)
6119
6120 Set the text which the window shows in its label if applicable.
6121 """
6122 return _core_.Window_SetLabel(*args, **kwargs)
6123
6124 def GetLabel(*args, **kwargs):
6125 """
6126 GetLabel(self) -> String
6127
79fccf9d
RD
6128 Generic way of getting a label from any window, for identification
6129 purposes. The interpretation of this function differs from class to
6130 class. For frames and dialogs, the value returned is the title. For
6131 buttons or static text controls, it is the button text. This function
6132 can be useful for meta-programs such as testing tools or special-needs
6133 access programs)which need to identify windows by name.
d55e5bfc
RD
6134 """
6135 return _core_.Window_GetLabel(*args, **kwargs)
6136
6137 def SetName(*args, **kwargs):
6138 """
6139 SetName(self, String name)
6140
79fccf9d
RD
6141 Sets the window's name. The window name is used for ressource setting
6142 in X, it is not the same as the window title/label
d55e5bfc
RD
6143 """
6144 return _core_.Window_SetName(*args, **kwargs)
6145
6146 def GetName(*args, **kwargs):
6147 """
6148 GetName(self) -> String
6149
79fccf9d
RD
6150 Returns the windows name. This name is not guaranteed to be unique;
6151 it is up to the programmer to supply an appropriate name in the window
6152 constructor or via wx.Window.SetName.
d55e5bfc
RD
6153 """
6154 return _core_.Window_GetName(*args, **kwargs)
6155
6156 def SetWindowVariant(*args, **kwargs):
6157 """
6158 SetWindowVariant(self, int variant)
6159
79fccf9d
RD
6160 Sets the variant of the window/font size to use for this window, if
6161 the platform supports variants, for example, wxMac.
d55e5bfc
RD
6162 """
6163 return _core_.Window_SetWindowVariant(*args, **kwargs)
6164
6165 def GetWindowVariant(*args, **kwargs):
6166 """GetWindowVariant(self) -> int"""
6167 return _core_.Window_GetWindowVariant(*args, **kwargs)
6168
6169 def SetId(*args, **kwargs):
6170 """
6171 SetId(self, int winid)
6172
6173 Sets the identifier of the window. Each window has an integer
6174 identifier. If the application has not provided one, an identifier
6175 will be generated. Normally, the identifier should be provided on
6176 creation and should not be modified subsequently.
6177 """
6178 return _core_.Window_SetId(*args, **kwargs)
6179
6180 def GetId(*args, **kwargs):
6181 """
6182 GetId(self) -> int
6183
6184 Returns the identifier of the window. Each window has an integer
6185 identifier. If the application has not provided one (or the default Id
6186 -1 is used) then an unique identifier with a negative value will be
6187 generated.
6188 """
6189 return _core_.Window_GetId(*args, **kwargs)
6190
6191 def NewControlId(*args, **kwargs):
6192 """
c24da6d6 6193 NewControlId() -> int
d55e5bfc
RD
6194
6195 Generate a control id for the controls which were not given one.
6196 """
6197 return _core_.Window_NewControlId(*args, **kwargs)
6198
6199 NewControlId = staticmethod(NewControlId)
6200 def NextControlId(*args, **kwargs):
6201 """
c24da6d6 6202 NextControlId(int winid) -> int
d55e5bfc
RD
6203
6204 Get the id of the control following the one with the given
79fccf9d 6205 autogenerated) id
d55e5bfc
RD
6206 """
6207 return _core_.Window_NextControlId(*args, **kwargs)
6208
6209 NextControlId = staticmethod(NextControlId)
6210 def PrevControlId(*args, **kwargs):
6211 """
c24da6d6 6212 PrevControlId(int winid) -> int
d55e5bfc
RD
6213
6214 Get the id of the control preceding the one with the given
79fccf9d 6215 autogenerated) id
d55e5bfc
RD
6216 """
6217 return _core_.Window_PrevControlId(*args, **kwargs)
6218
6219 PrevControlId = staticmethod(PrevControlId)
6220 def SetSize(*args, **kwargs):
6221 """
6222 SetSize(self, Size size)
6223
6224 Sets the size of the window in pixels.
6225 """
6226 return _core_.Window_SetSize(*args, **kwargs)
6227
6228 def SetDimensions(*args, **kwargs):
6229 """
6230 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
6231
6232 Sets the position and size of the window in pixels. The sizeFlags
6233 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
6234 equal to -1.
6235
6236 ======================== ======================================
6237 wx.SIZE_AUTO A -1 indicates that a class-specific
6238 default should be used.
6239 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
6240 -1 values are supplied.
6241 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
6242 interpreted as real dimensions, not
6243 default values.
6244 ======================== ======================================
6245
d55e5bfc
RD
6246 """
6247 return _core_.Window_SetDimensions(*args, **kwargs)
6248
6249 def SetRect(*args, **kwargs):
6250 """
6251 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
6252
6253 Sets the position and size of the window in pixels using a wx.Rect.
6254 """
6255 return _core_.Window_SetRect(*args, **kwargs)
6256
6257 def SetSizeWH(*args, **kwargs):
6258 """
6259 SetSizeWH(self, int width, int height)
6260
6261 Sets the size of the window in pixels.
6262 """
6263 return _core_.Window_SetSizeWH(*args, **kwargs)
6264
6265 def Move(*args, **kwargs):
6266 """
6267 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
6268
6269 Moves the window to the given position.
6270 """
6271 return _core_.Window_Move(*args, **kwargs)
6272
6273 SetPosition = Move
6274 def MoveXY(*args, **kwargs):
6275 """
6276 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
6277
6278 Moves the window to the given position.
6279 """
6280 return _core_.Window_MoveXY(*args, **kwargs)
6281
f8167d6e
RD
6282 def SetBestFittingSize(*args, **kwargs):
6283 """
6284 SetBestFittingSize(self, Size size=DefaultSize)
6285
6286 A 'Smart' SetSize that will fill in default size components with the
6287 window's *best size* values. Also set's the minsize for use with sizers.
6288 """
6289 return _core_.Window_SetBestFittingSize(*args, **kwargs)
6290
d55e5bfc
RD
6291 def Raise(*args, **kwargs):
6292 """
6293 Raise(self)
6294
6295 Raises the window to the top of the window hierarchy if it is a
6296 managed window (dialog or frame).
6297 """
6298 return _core_.Window_Raise(*args, **kwargs)
6299
6300 def Lower(*args, **kwargs):
6301 """
6302 Lower(self)
6303
6304 Lowers the window to the bottom of the window hierarchy if it is a
6305 managed window (dialog or frame).
6306 """
6307 return _core_.Window_Lower(*args, **kwargs)
6308
6309 def SetClientSize(*args, **kwargs):
6310 """
6311 SetClientSize(self, Size size)
6312
6313 This sets the size of the window client area in pixels. Using this
6314 function to size a window tends to be more device-independent than
6315 wx.Window.SetSize, since the application need not worry about what
6316 dimensions the border or title bar have when trying to fit the window
6317 around panel items, for example.
6318 """
6319 return _core_.Window_SetClientSize(*args, **kwargs)
6320
6321 def SetClientSizeWH(*args, **kwargs):
6322 """
6323 SetClientSizeWH(self, int width, int height)
6324
6325 This sets the size of the window client area in pixels. Using this
6326 function to size a window tends to be more device-independent than
6327 wx.Window.SetSize, since the application need not worry about what
6328 dimensions the border or title bar have when trying to fit the window
6329 around panel items, for example.
6330 """
6331 return _core_.Window_SetClientSizeWH(*args, **kwargs)
6332
6333 def SetClientRect(*args, **kwargs):
6334 """
6335 SetClientRect(self, Rect rect)
6336
6337 This sets the size of the window client area in pixels. Using this
6338 function to size a window tends to be more device-independent than
6339 wx.Window.SetSize, since the application need not worry about what
6340 dimensions the border or title bar have when trying to fit the window
6341 around panel items, for example.
6342 """
6343 return _core_.Window_SetClientRect(*args, **kwargs)
6344
6345 def GetPosition(*args, **kwargs):
6346 """
6347 GetPosition(self) -> Point
6348
6349 Get the window's position.
6350 """
6351 return _core_.Window_GetPosition(*args, **kwargs)
6352
6353 def GetPositionTuple(*args, **kwargs):
6354 """
6355 GetPositionTuple() -> (x,y)
6356
6357 Get the window's position.
6358 """
6359 return _core_.Window_GetPositionTuple(*args, **kwargs)
6360
6361 def GetSize(*args, **kwargs):
6362 """
6363 GetSize(self) -> Size
6364
6365 Get the window size.
6366 """
6367 return _core_.Window_GetSize(*args, **kwargs)
6368
6369 def GetSizeTuple(*args, **kwargs):
6370 """
6371 GetSizeTuple() -> (width, height)
6372
6373 Get the window size.
6374 """
6375 return _core_.Window_GetSizeTuple(*args, **kwargs)
6376
6377 def GetRect(*args, **kwargs):
6378 """
6379 GetRect(self) -> Rect
6380
6381 Returns the size and position of the window as a wx.Rect object.
6382 """
6383 return _core_.Window_GetRect(*args, **kwargs)
6384
6385 def GetClientSize(*args, **kwargs):
6386 """
6387 GetClientSize(self) -> Size
6388
6389 This gets the size of the window's 'client area' in pixels. The client
6390 area is the area which may be drawn on by the programmer, excluding
6391 title bar, border, scrollbars, etc.
6392 """
6393 return _core_.Window_GetClientSize(*args, **kwargs)
6394
6395 def GetClientSizeTuple(*args, **kwargs):
6396 """
6397 GetClientSizeTuple() -> (width, height)
6398
6399 This gets the size of the window's 'client area' in pixels. The client
6400 area is the area which may be drawn on by the programmer, excluding
6401 title bar, border, scrollbars, etc.
6402 """
6403 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
6404
6405 def GetClientAreaOrigin(*args, **kwargs):
6406 """
6407 GetClientAreaOrigin(self) -> Point
6408
6409 Get the origin of the client area of the window relative to the
6410 window's top left corner (the client area may be shifted because of
6411 the borders, scrollbars, other decorations...)
6412 """
6413 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
6414
6415 def GetClientRect(*args, **kwargs):
6416 """
6417 GetClientRect(self) -> Rect
6418
629f3c1b 6419 Get the client area position and size as a `wx.Rect` object.
d55e5bfc
RD
6420 """
6421 return _core_.Window_GetClientRect(*args, **kwargs)
6422
6423 def GetBestSize(*args, **kwargs):
6424 """
6425 GetBestSize(self) -> Size
6426
248ed943 6427 This function returns the best acceptable minimal size for the
79fccf9d
RD
6428 window, if applicable. For example, for a static text control, it will
6429 be the minimal size such that the control label is not truncated. For
6430 windows containing subwindows (suzh aswx.Panel), the size returned by
6431 this function will be the same as the size the window would have had
6432 after calling Fit.
d55e5bfc
RD
6433 """
6434 return _core_.Window_GetBestSize(*args, **kwargs)
6435
6436 def GetBestSizeTuple(*args, **kwargs):
6437 """
6438 GetBestSizeTuple() -> (width, height)
6439
248ed943 6440 This function returns the best acceptable minimal size for the
79fccf9d
RD
6441 window, if applicable. For example, for a static text control, it will
6442 be the minimal size such that the control label is not truncated. For
6443 windows containing subwindows (suzh aswx.Panel), the size returned by
6444 this function will be the same as the size the window would have had
6445 after calling Fit.
d55e5bfc
RD
6446 """
6447 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
6448
a001823c
RD
6449 def InvalidateBestSize(*args, **kwargs):
6450 """
6451 InvalidateBestSize(self)
6452
6453 Reset the cached best size value so it will be recalculated the next
6454 time it is needed.
6455 """
6456 return _core_.Window_InvalidateBestSize(*args, **kwargs)
6457
6458 def GetBestFittingSize(*args, **kwargs):
6459 """
6460 GetBestFittingSize(self) -> Size
6461
6462 This function will merge the window's best size into the window's
6463 minimum size, giving priority to the min size components, and returns
6464 the results.
6465
6466 """
6467 return _core_.Window_GetBestFittingSize(*args, **kwargs)
6468
d55e5bfc
RD
6469 def GetAdjustedBestSize(*args, **kwargs):
6470 """
6471 GetAdjustedBestSize(self) -> Size
6472
6473 This method is similar to GetBestSize, except in one
6474 thing. GetBestSize should return the minimum untruncated size of the
6475 window, while this method will return the largest of BestSize and any
6476 user specified minimum size. ie. it is the minimum size the window
6477 should currently be drawn at, not the minimal size it can possibly
6478 tolerate.
6479 """
6480 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
6481
6482 def Center(*args, **kwargs):
6483 """
6484 Center(self, int direction=BOTH)
6485
6486 Centers the window. The parameter specifies the direction for
6487 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
6488 also include wx.CENTER_ON_SCREEN flag if you want to center the window
6489 on the entire screen and not on its parent window. If it is a
6490 top-level window and has no parent then it will always be centered
6491 relative to the screen.
6492 """
6493 return _core_.Window_Center(*args, **kwargs)
6494
6495 Centre = Center
6496 def CenterOnScreen(*args, **kwargs):
6497 """
6498 CenterOnScreen(self, int dir=BOTH)
6499
6500 Center on screen (only works for top level windows)
6501 """
6502 return _core_.Window_CenterOnScreen(*args, **kwargs)
6503
6504 CentreOnScreen = CenterOnScreen
6505 def CenterOnParent(*args, **kwargs):
6506 """
6507 CenterOnParent(self, int dir=BOTH)
6508
6509 Center with respect to the the parent window
6510 """
6511 return _core_.Window_CenterOnParent(*args, **kwargs)
6512
6513 CentreOnParent = CenterOnParent
6514 def Fit(*args, **kwargs):
6515 """
6516 Fit(self)
6517
6518 Sizes the window so that it fits around its subwindows. This function
6519 won't do anything if there are no subwindows and will only really work
6520 correctly if sizers are used for the subwindows layout. Also, if the
6521 window has exactly one subwindow it is better (faster and the result
6522 is more precise as Fit adds some margin to account for fuzziness of
6523 its calculations) to call window.SetClientSize(child.GetSize())
6524 instead of calling Fit.
6525 """
6526 return _core_.Window_Fit(*args, **kwargs)
6527
6528 def FitInside(*args, **kwargs):
6529 """
6530 FitInside(self)
6531
6532 Similar to Fit, but sizes the interior (virtual) size of a
6533 window. Mainly useful with scrolled windows to reset scrollbars after
6534 sizing changes that do not trigger a size event, and/or scrolled
6535 windows without an interior sizer. This function similarly won't do
6536 anything if there are no subwindows.
6537 """
6538 return _core_.Window_FitInside(*args, **kwargs)
6539
03837c5c 6540 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
6541 """
6542 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
6543 int incH=-1)
d55e5bfc
RD
6544
6545 Allows specification of minimum and maximum window sizes, and window
6546 size increments. If a pair of values is not set (or set to -1), the
6547 default values will be used. If this function is called, the user
908b74cd
RD
6548 will not be able to size the window outside the given bounds (if it is
6549 a top-level window.) Sizers will also inspect the minimum window size
6550 and will use that value if set when calculating layout.
6551
6552 The resizing increments are only significant under Motif or Xt.
d55e5bfc 6553 """
03837c5c 6554 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 6555
03837c5c
RD
6556 def SetSizeHintsSz(*args, **kwargs):
6557 """
6558 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
6559
6560 Allows specification of minimum and maximum window sizes, and window
6561 size increments. If a pair of values is not set (or set to -1), the
6562 default values will be used. If this function is called, the user
6563 will not be able to size the window outside the given bounds (if it is
6564 a top-level window.) Sizers will also inspect the minimum window size
6565 and will use that value if set when calculating layout.
6566
6567 The resizing increments are only significant under Motif or Xt.
6568 """
6569 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
6570
6571 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 6572 """
908b74cd 6573 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
6574
6575 Allows specification of minimum and maximum virtual window sizes. If a
6576 pair of values is not set (or set to -1), the default values will be
6577 used. If this function is called, the user will not be able to size
6578 the virtual area of the window outside the given bounds.
6579 """
03837c5c
RD
6580 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
6581
6582 def SetVirtualSizeHintsSz(*args, **kwargs):
6583 """
6584 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
6585
6586 Allows specification of minimum and maximum virtual window sizes. If a
6587 pair of values is not set (or set to -1), the default values will be
6588 used. If this function is called, the user will not be able to size
6589 the virtual area of the window outside the given bounds.
6590 """
6591 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 6592
908b74cd
RD
6593 def GetMaxSize(*args, **kwargs):
6594 """GetMaxSize(self) -> Size"""
6595 return _core_.Window_GetMaxSize(*args, **kwargs)
6596
6597 def GetMinSize(*args, **kwargs):
6598 """GetMinSize(self) -> Size"""
6599 return _core_.Window_GetMinSize(*args, **kwargs)
6600
6601 def SetMinSize(*args, **kwargs):
6602 """
6603 SetMinSize(self, Size minSize)
6604
6605 A more convenient method than `SetSizeHints` for setting just the
6606 min size.
6607 """
6608 return _core_.Window_SetMinSize(*args, **kwargs)
6609
6610 def SetMaxSize(*args, **kwargs):
6611 """
6612 SetMaxSize(self, Size maxSize)
6613
6614 A more convenient method than `SetSizeHints` for setting just the
6615 max size.
6616 """
6617 return _core_.Window_SetMaxSize(*args, **kwargs)
6618
d55e5bfc
RD
6619 def GetMinWidth(*args, **kwargs):
6620 """GetMinWidth(self) -> int"""
6621 return _core_.Window_GetMinWidth(*args, **kwargs)
6622
6623 def GetMinHeight(*args, **kwargs):
6624 """GetMinHeight(self) -> int"""
6625 return _core_.Window_GetMinHeight(*args, **kwargs)
6626
6627 def GetMaxWidth(*args, **kwargs):
6628 """GetMaxWidth(self) -> int"""
6629 return _core_.Window_GetMaxWidth(*args, **kwargs)
6630
6631 def GetMaxHeight(*args, **kwargs):
6632 """GetMaxHeight(self) -> int"""
6633 return _core_.Window_GetMaxHeight(*args, **kwargs)
6634
d55e5bfc
RD
6635 def SetVirtualSize(*args, **kwargs):
6636 """
6637 SetVirtualSize(self, Size size)
6638
6639 Set the the virtual size of a window in pixels. For most windows this
6640 is just the client area of the window, but for some like scrolled
6641 windows it is more or less independent of the screen window size.
6642 """
6643 return _core_.Window_SetVirtualSize(*args, **kwargs)
6644
6645 def SetVirtualSizeWH(*args, **kwargs):
6646 """
6647 SetVirtualSizeWH(self, int w, int h)
6648
6649 Set the the virtual size of a window in pixels. For most windows this
6650 is just the client area of the window, but for some like scrolled
6651 windows it is more or less independent of the screen window size.
6652 """
6653 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
6654
6655 def GetVirtualSize(*args, **kwargs):
6656 """
6657 GetVirtualSize(self) -> Size
6658
6659 Get the the virtual size of the window in pixels. For most windows
6660 this is just the client area of the window, but for some like scrolled
6661 windows it is more or less independent of the screen window size.
6662 """
6663 return _core_.Window_GetVirtualSize(*args, **kwargs)
6664
6665 def GetVirtualSizeTuple(*args, **kwargs):
6666 """
6667 GetVirtualSizeTuple() -> (width, height)
6668
6669 Get the the virtual size of the window in pixels. For most windows
6670 this is just the client area of the window, but for some like scrolled
6671 windows it is more or less independent of the screen window size.
6672 """
6673 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
6674
6675 def GetBestVirtualSize(*args, **kwargs):
6676 """
6677 GetBestVirtualSize(self) -> Size
6678
6679 Return the largest of ClientSize and BestSize (as determined by a
6680 sizer, interior children, or other means)
6681 """
6682 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
6683
6684 def Show(*args, **kwargs):
6685 """
6686 Show(self, bool show=True) -> bool
6687
6688 Shows or hides the window. You may need to call Raise for a top level
6689 window if you want to bring it to top, although this is not needed if
6690 Show is called immediately after the frame creation. Returns True if
6691 the window has been shown or hidden or False if nothing was done
6692 because it already was in the requested state.
6693 """
6694 return _core_.Window_Show(*args, **kwargs)
6695
6696 def Hide(*args, **kwargs):
6697 """
6698 Hide(self) -> bool
6699
6700 Equivalent to calling Show(False).
6701 """
6702 return _core_.Window_Hide(*args, **kwargs)
6703
6704 def Enable(*args, **kwargs):
6705 """
6706 Enable(self, bool enable=True) -> bool
6707
6708 Enable or disable the window for user input. Note that when a parent
6709 window is disabled, all of its children are disabled as well and they
6710 are reenabled again when the parent is. Returns true if the window
6711 has been enabled or disabled, false if nothing was done, i.e. if the
6712 window had already been in the specified state.
6713 """
6714 return _core_.Window_Enable(*args, **kwargs)
6715
6716 def Disable(*args, **kwargs):
6717 """
6718 Disable(self) -> bool
6719
6720 Disables the window, same as Enable(false).
6721 """
6722 return _core_.Window_Disable(*args, **kwargs)
6723
6724 def IsShown(*args, **kwargs):
6725 """
6726 IsShown(self) -> bool
6727
6728 Returns true if the window is shown, false if it has been hidden.
6729 """
6730 return _core_.Window_IsShown(*args, **kwargs)
6731
6732 def IsEnabled(*args, **kwargs):
6733 """
6734 IsEnabled(self) -> bool
6735
6736 Returns true if the window is enabled for input, false otherwise.
6737 """
6738 return _core_.Window_IsEnabled(*args, **kwargs)
6739
6740 def SetWindowStyleFlag(*args, **kwargs):
6741 """
6742 SetWindowStyleFlag(self, long style)
6743
79fccf9d
RD
6744 Sets the style of the window. Please note that some styles cannot be
6745 changed after the window creation and that Refresh() might need to be
6746 called after changing the others for the change to take place
6747 immediately.
d55e5bfc
RD
6748 """
6749 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
6750
6751 def GetWindowStyleFlag(*args, **kwargs):
6752 """
6753 GetWindowStyleFlag(self) -> long
6754
6755 Gets the window style that was passed to the constructor or Create
6756 method.
6757 """
6758 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
6759
6760 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
6761 def HasFlag(*args, **kwargs):
6762 """
6763 HasFlag(self, int flag) -> bool
6764
6765 Test if the given style is set for this window.
6766 """
6767 return _core_.Window_HasFlag(*args, **kwargs)
6768
6769 def IsRetained(*args, **kwargs):
6770 """
6771 IsRetained(self) -> bool
6772
6773 Returns true if the window is retained, false otherwise. Retained
6774 windows are only available on X platforms.
6775 """
6776 return _core_.Window_IsRetained(*args, **kwargs)
6777
6778 def SetExtraStyle(*args, **kwargs):
6779 """
6780 SetExtraStyle(self, long exStyle)
6781
6782 Sets the extra style bits for the window. Extra styles are the less
6783 often used style bits which can't be set with the constructor or with
6784 SetWindowStyleFlag()
6785 """
6786 return _core_.Window_SetExtraStyle(*args, **kwargs)
6787
6788 def GetExtraStyle(*args, **kwargs):
6789 """
6790 GetExtraStyle(self) -> long
6791
6792 Returns the extra style bits for the window.
6793 """
6794 return _core_.Window_GetExtraStyle(*args, **kwargs)
6795
6796 def MakeModal(*args, **kwargs):
6797 """
6798 MakeModal(self, bool modal=True)
6799
6800 Disables all other windows in the application so that the user can
6801 only interact with this window. Passing False will reverse this
6802 effect.
6803 """
6804 return _core_.Window_MakeModal(*args, **kwargs)
6805
6806 def SetThemeEnabled(*args, **kwargs):
6807 """
6808 SetThemeEnabled(self, bool enableTheme)
6809
6810 This function tells a window if it should use the system's "theme"
6811 code to draw the windows' background instead if its own background
6812 drawing code. This will only have an effect on platforms that support
6813 the notion of themes in user defined windows. One such platform is
6814 GTK+ where windows can have (very colourful) backgrounds defined by a
6815 user's selected theme.
6816
6817 Dialogs, notebook pages and the status bar have this flag set to true
6818 by default so that the default look and feel is simulated best.
6819 """
6820 return _core_.Window_SetThemeEnabled(*args, **kwargs)
6821
6822 def GetThemeEnabled(*args, **kwargs):
6823 """
6824 GetThemeEnabled(self) -> bool
6825
6826 Return the themeEnabled flag.
6827 """
6828 return _core_.Window_GetThemeEnabled(*args, **kwargs)
6829
6830 def SetFocus(*args, **kwargs):
6831 """
6832 SetFocus(self)
6833
6834 Set's the focus to this window, allowing it to receive keyboard input.
6835 """
6836 return _core_.Window_SetFocus(*args, **kwargs)
6837
6838 def SetFocusFromKbd(*args, **kwargs):
6839 """
6840 SetFocusFromKbd(self)
6841
6842 Set focus to this window as the result of a keyboard action. Normally
6843 only called internally.
6844 """
6845 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
6846
6847 def FindFocus(*args, **kwargs):
6848 """
c24da6d6 6849 FindFocus() -> Window
d55e5bfc
RD
6850
6851 Returns the window or control that currently has the keyboard focus,
6852 or None.
6853 """
6854 return _core_.Window_FindFocus(*args, **kwargs)
6855
6856 FindFocus = staticmethod(FindFocus)
6857 def AcceptsFocus(*args, **kwargs):
6858 """
6859 AcceptsFocus(self) -> bool
6860
6861 Can this window have focus?
6862 """
6863 return _core_.Window_AcceptsFocus(*args, **kwargs)
6864
6865 def AcceptsFocusFromKeyboard(*args, **kwargs):
6866 """
6867 AcceptsFocusFromKeyboard(self) -> bool
6868
6869 Can this window be given focus by keyboard navigation? if not, the
6870 only way to give it focus (provided it accepts it at all) is to click
6871 it.
6872 """
6873 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
6874
6875 def GetDefaultItem(*args, **kwargs):
6876 """
6877 GetDefaultItem(self) -> Window
6878
6879 Get the default child of this parent, i.e. the one which is activated
6880 by pressing <Enter> such as the OK button on a wx.Dialog.
6881 """
6882 return _core_.Window_GetDefaultItem(*args, **kwargs)
6883
6884 def SetDefaultItem(*args, **kwargs):
6885 """
6886 SetDefaultItem(self, Window child) -> Window
6887
6888 Set this child as default, return the old default.
6889 """
6890 return _core_.Window_SetDefaultItem(*args, **kwargs)
6891
6892 def SetTmpDefaultItem(*args, **kwargs):
6893 """
6894 SetTmpDefaultItem(self, Window win)
6895
6896 Set this child as temporary default
6897 """
6898 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
6899
908b74cd
RD
6900 def Navigate(*args, **kwargs):
6901 """
6902 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6903
a8eff060
RD
6904 Does keyboard navigation from this window to another, by sending a
6905 `wx.NavigationKeyEvent`.
908b74cd
RD
6906 """
6907 return _core_.Window_Navigate(*args, **kwargs)
6908
bf26d883
RD
6909 def MoveAfterInTabOrder(*args, **kwargs):
6910 """
6911 MoveAfterInTabOrder(self, Window win)
6912
6913 Moves this window in the tab navigation order after the specified
6914 sibling window. This means that when the user presses the TAB key on
6915 that other window, the focus switches to this window.
6916
6917 The default tab order is the same as creation order. This function
6918 and `MoveBeforeInTabOrder` allow to change it after creating all the
6919 windows.
6920
6921 """
6922 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
6923
6924 def MoveBeforeInTabOrder(*args, **kwargs):
6925 """
6926 MoveBeforeInTabOrder(self, Window win)
6927
6928 Same as `MoveAfterInTabOrder` except that it inserts this window just
6929 before win instead of putting it right after it.
6930 """
6931 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
6932
d55e5bfc
RD
6933 def GetChildren(*args, **kwargs):
6934 """
6935 GetChildren(self) -> PyObject
6936
6937 Returns a list of the window's children. NOTE: Currently this is a
6938 copy of the child window list maintained by the window, so the return
6939 value of this function is only valid as long as the window's children
6940 do not change.
6941 """
6942 return _core_.Window_GetChildren(*args, **kwargs)
6943
6944 def GetParent(*args, **kwargs):
6945 """
6946 GetParent(self) -> Window
6947
6948 Returns the parent window of this window, or None if there isn't one.
6949 """
6950 return _core_.Window_GetParent(*args, **kwargs)
6951
6952 def GetGrandParent(*args, **kwargs):
6953 """
6954 GetGrandParent(self) -> Window
6955
79fccf9d
RD
6956 Returns the parent of the parent of this window, or None if there
6957 isn't one.
d55e5bfc
RD
6958 """
6959 return _core_.Window_GetGrandParent(*args, **kwargs)
6960
6961 def IsTopLevel(*args, **kwargs):
6962 """
6963 IsTopLevel(self) -> bool
6964
6965 Returns true if the given window is a top-level one. Currently all
6966 frames and dialogs are always considered to be top-level windows (even
6967 if they have a parent window).
6968 """
6969 return _core_.Window_IsTopLevel(*args, **kwargs)
6970
6971 def Reparent(*args, **kwargs):
6972 """
6973 Reparent(self, Window newParent) -> bool
6974
6975 Reparents the window, i.e the window will be removed from its current
6976 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6977 re-inserted into another. Available on Windows and GTK. Returns True
6978 if the parent was changed, False otherwise (error or newParent ==
6979 oldParent)
6980 """
6981 return _core_.Window_Reparent(*args, **kwargs)
6982
6983 def AddChild(*args, **kwargs):
6984 """
6985 AddChild(self, Window child)
6986
6987 Adds a child window. This is called automatically by window creation
6988 functions so should not be required by the application programmer.
6989 """
6990 return _core_.Window_AddChild(*args, **kwargs)
6991
6992 def RemoveChild(*args, **kwargs):
6993 """
6994 RemoveChild(self, Window child)
6995
6996 Removes a child window. This is called automatically by window
6997 deletion functions so should not be required by the application
6998 programmer.
6999 """
7000 return _core_.Window_RemoveChild(*args, **kwargs)
7001
7002 def FindWindowById(*args, **kwargs):
7003 """
7004 FindWindowById(self, long winid) -> Window
7005
7006 Find a chld of this window by window ID
7007 """
7008 return _core_.Window_FindWindowById(*args, **kwargs)
7009
7010 def FindWindowByName(*args, **kwargs):
7011 """
7012 FindWindowByName(self, String name) -> Window
7013
7014 Find a child of this window by name
7015 """
7016 return _core_.Window_FindWindowByName(*args, **kwargs)
7017
7018 def GetEventHandler(*args, **kwargs):
7019 """
7020 GetEventHandler(self) -> EvtHandler
7021
7022 Returns the event handler for this window. By default, the window is
7023 its own event handler.
7024 """
7025 return _core_.Window_GetEventHandler(*args, **kwargs)
7026
7027 def SetEventHandler(*args, **kwargs):
7028 """
7029 SetEventHandler(self, EvtHandler handler)
7030
7031 Sets the event handler for this window. An event handler is an object
7032 that is capable of processing the events sent to a window. By default,
7033 the window is its own event handler, but an application may wish to
7034 substitute another, for example to allow central implementation of
7035 event-handling for a variety of different window classes.
7036
79fccf9d 7037 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
7038 up a chain of event handlers, where an event not handled by one event
7039 handler is handed to the next one in the chain.
7040 """
7041 return _core_.Window_SetEventHandler(*args, **kwargs)
7042
7043 def PushEventHandler(*args, **kwargs):
7044 """
7045 PushEventHandler(self, EvtHandler handler)
7046
7047 Pushes this event handler onto the event handler stack for the window.
7048 An event handler is an object that is capable of processing the events
7049 sent to a window. By default, the window is its own event handler, but
7050 an application may wish to substitute another, for example to allow
7051 central implementation of event-handling for a variety of different
7052 window classes.
7053
7054 wx.Window.PushEventHandler allows an application to set up a chain of
7055 event handlers, where an event not handled by one event handler is
79fccf9d 7056 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
7057 remove the event handler.
7058 """
7059 return _core_.Window_PushEventHandler(*args, **kwargs)
7060
7061 def PopEventHandler(*args, **kwargs):
7062 """
7063 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
7064
7065 Removes and returns the top-most event handler on the event handler
7066 stack. If deleteHandler is True then the wx.EvtHandler object will be
7067 destroyed after it is popped.
7068 """
7069 return _core_.Window_PopEventHandler(*args, **kwargs)
7070
7071 def RemoveEventHandler(*args, **kwargs):
7072 """
7073 RemoveEventHandler(self, EvtHandler handler) -> bool
7074
79fccf9d
RD
7075 Find the given handler in the event handler chain and remove (but not
7076 delete) it from the event handler chain, return True if it was found
7077 and False otherwise (this also results in an assert failure so this
7078 function should only be called when the handler is supposed to be
7079 there.)
d55e5bfc
RD
7080 """
7081 return _core_.Window_RemoveEventHandler(*args, **kwargs)
7082
7083 def SetValidator(*args, **kwargs):
7084 """
7085 SetValidator(self, Validator validator)
7086
7087 Deletes the current validator (if any) and sets the window validator,
7088 having called wx.Validator.Clone to create a new validator of this
7089 type.
7090 """
7091 return _core_.Window_SetValidator(*args, **kwargs)
7092
7093 def GetValidator(*args, **kwargs):
7094 """
7095 GetValidator(self) -> Validator
7096
7097 Returns a pointer to the current validator for the window, or None if
7098 there is none.
7099 """
7100 return _core_.Window_GetValidator(*args, **kwargs)
7101
7102 def Validate(*args, **kwargs):
7103 """
7104 Validate(self) -> bool
7105
7106 Validates the current values of the child controls using their
79fccf9d
RD
7107 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7108 style flag set, the method will also call Validate() of all child
7109 windows. Returns false if any of the validations failed.
d55e5bfc
RD
7110 """
7111 return _core_.Window_Validate(*args, **kwargs)
7112
7113 def TransferDataToWindow(*args, **kwargs):
7114 """
7115 TransferDataToWindow(self) -> bool
7116
79fccf9d
RD
7117 Transfers values to child controls from data areas specified by their
7118 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
7119 style flag set, the method will also call TransferDataToWindow() of
7120 all child windows.
d55e5bfc
RD
7121 """
7122 return _core_.Window_TransferDataToWindow(*args, **kwargs)
7123
7124 def TransferDataFromWindow(*args, **kwargs):
7125 """
7126 TransferDataFromWindow(self) -> bool
7127
79fccf9d
RD
7128 Transfers values from child controls to data areas specified by their
7129 validators. Returns false if a transfer failed. If the window has
7130 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
7131 also call TransferDataFromWindow() of all child windows.
d55e5bfc
RD
7132 """
7133 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
7134
7135 def InitDialog(*args, **kwargs):
7136 """
7137 InitDialog(self)
7138
79fccf9d
RD
7139 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
7140 to the dialog via validators.
d55e5bfc
RD
7141 """
7142 return _core_.Window_InitDialog(*args, **kwargs)
7143
7144 def SetAcceleratorTable(*args, **kwargs):
7145 """
7146 SetAcceleratorTable(self, AcceleratorTable accel)
7147
7148 Sets the accelerator table for this window.
7149 """
7150 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
7151
7152 def GetAcceleratorTable(*args, **kwargs):
7153 """
7154 GetAcceleratorTable(self) -> AcceleratorTable
7155
7156 Gets the accelerator table for this window.
7157 """
7158 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
7159
7160 def RegisterHotKey(*args, **kwargs):
7161 """
7162 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
7163
7164 Registers a system wide hotkey. Every time the user presses the hotkey
7165 registered here, this window will receive a hotkey event. It will
7166 receive the event even if the application is in the background and
7167 does not have the input focus because the user is working with some
7168 other application. To bind an event handler function to this hotkey
7169 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
7170 hotkey was registered successfully.
7171 """
7172 return _core_.Window_RegisterHotKey(*args, **kwargs)
7173
7174 def UnregisterHotKey(*args, **kwargs):
7175 """
7176 UnregisterHotKey(self, int hotkeyId) -> bool
7177
7178 Unregisters a system wide hotkey.
7179 """
7180 return _core_.Window_UnregisterHotKey(*args, **kwargs)
7181
7182 def ConvertDialogPointToPixels(*args, **kwargs):
7183 """
7184 ConvertDialogPointToPixels(self, Point pt) -> Point
7185
7186 Converts a point or size from dialog units to pixels. Dialog units
7187 are used for maintaining a dialog's proportions even if the font
7188 changes. For the x dimension, the dialog units are multiplied by the
7189 average character width and then divided by 4. For the y dimension,
7190 the dialog units are multiplied by the average character height and
7191 then divided by 8.
7192 """
7193 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
7194
7195 def ConvertDialogSizeToPixels(*args, **kwargs):
7196 """
7197 ConvertDialogSizeToPixels(self, Size sz) -> Size
7198
7199 Converts a point or size from dialog units to pixels. Dialog units
7200 are used for maintaining a dialog's proportions even if the font
7201 changes. For the x dimension, the dialog units are multiplied by the
7202 average character width and then divided by 4. For the y dimension,
7203 the dialog units are multiplied by the average character height and
7204 then divided by 8.
7205 """
7206 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
7207
7208 def DLG_PNT(*args, **kwargs):
7209 """
7210 DLG_PNT(self, Point pt) -> Point
7211
7212 Converts a point or size from dialog units to pixels. Dialog units
7213 are used for maintaining a dialog's proportions even if the font
7214 changes. For the x dimension, the dialog units are multiplied by the
7215 average character width and then divided by 4. For the y dimension,
7216 the dialog units are multiplied by the average character height and
7217 then divided by 8.
7218 """
7219 return _core_.Window_DLG_PNT(*args, **kwargs)
7220
7221 def DLG_SZE(*args, **kwargs):
7222 """
7223 DLG_SZE(self, Size sz) -> Size
7224
7225 Converts a point or size from dialog units to pixels. Dialog units
7226 are used for maintaining a dialog's proportions even if the font
7227 changes. For the x dimension, the dialog units are multiplied by the
7228 average character width and then divided by 4. For the y dimension,
7229 the dialog units are multiplied by the average character height and
7230 then divided by 8.
7231 """
7232 return _core_.Window_DLG_SZE(*args, **kwargs)
7233
7234 def ConvertPixelPointToDialog(*args, **kwargs):
7235 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
7236 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
7237
7238 def ConvertPixelSizeToDialog(*args, **kwargs):
7239 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
7240 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
7241
7242 def WarpPointer(*args, **kwargs):
7243 """
7244 WarpPointer(self, int x, int y)
7245
7246 Moves the pointer to the given position on the window.
7247
7248 NOTE: This function is not supported under Mac because Apple Human
7249 Interface Guidelines forbid moving the mouse cursor programmatically.
7250 """
7251 return _core_.Window_WarpPointer(*args, **kwargs)
7252
7253 def CaptureMouse(*args, **kwargs):
7254 """
7255 CaptureMouse(self)
7256
7257 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
7258 release the capture.
7259
7260 Note that wxWindows maintains the stack of windows having captured the
7261 mouse and when the mouse is released the capture returns to the window
7262 which had had captured it previously and it is only really released if
7263 there were no previous window. In particular, this means that you must
7264 release the mouse as many times as you capture it.
7265 """
7266 return _core_.Window_CaptureMouse(*args, **kwargs)
7267
7268 def ReleaseMouse(*args, **kwargs):
7269 """
7270 ReleaseMouse(self)
7271
7272 Releases mouse input captured with wx.Window.CaptureMouse.
7273 """
7274 return _core_.Window_ReleaseMouse(*args, **kwargs)
7275
7276 def GetCapture(*args, **kwargs):
7277 """
c24da6d6 7278 GetCapture() -> Window
d55e5bfc
RD
7279
7280 Returns the window which currently captures the mouse or None
7281 """
7282 return _core_.Window_GetCapture(*args, **kwargs)
7283
7284 GetCapture = staticmethod(GetCapture)
7285 def HasCapture(*args, **kwargs):
7286 """
7287 HasCapture(self) -> bool
7288
7289 Returns true if this window has the current mouse capture.
7290 """
7291 return _core_.Window_HasCapture(*args, **kwargs)
7292
7293 def Refresh(*args, **kwargs):
7294 """
7295 Refresh(self, bool eraseBackground=True, Rect rect=None)
7296
7297 Mark the specified rectangle (or the whole window) as "dirty" so it
7298 will be repainted. Causes an EVT_PAINT event to be generated and sent
7299 to the window.
7300 """
7301 return _core_.Window_Refresh(*args, **kwargs)
7302
7303 def RefreshRect(*args, **kwargs):
7304 """
fef4c27a 7305 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
7306
7307 Redraws the contents of the given rectangle: the area inside it will
7308 be repainted. This is the same as Refresh but has a nicer syntax.
7309 """
7310 return _core_.Window_RefreshRect(*args, **kwargs)
7311
7312 def Update(*args, **kwargs):
7313 """
7314 Update(self)
7315
7316 Calling this method immediately repaints the invalidated area of the
7317 window instead of waiting for the EVT_PAINT event to happen, (normally
7318 this would usually only happen when the flow of control returns to the
7319 event loop.) Notice that this function doesn't refresh the window and
7320 does nothing if the window has been already repainted. Use Refresh
7321 first if you want to immediately redraw the window (or some portion of
7322 it) unconditionally.
7323 """
7324 return _core_.Window_Update(*args, **kwargs)
7325
7326 def ClearBackground(*args, **kwargs):
7327 """
7328 ClearBackground(self)
7329
7330 Clears the window by filling it with the current background
7331 colour. Does not cause an erase background event to be generated.
7332 """
7333 return _core_.Window_ClearBackground(*args, **kwargs)
7334
7335 def Freeze(*args, **kwargs):
7336 """
7337 Freeze(self)
7338
79fccf9d
RD
7339 Freezes the window or, in other words, prevents any updates from
7340 taking place on screen, the window is not redrawn at all. Thaw must be
7341 called to reenable window redrawing. Calls to Freeze/Thaw may be
7342 nested, with the actual Thaw being delayed until all the nesting has
7343 been undone.
d55e5bfc
RD
7344
7345 This method is useful for visual appearance optimization (for example,
7346 it is a good idea to use it before inserting large amount of text into
7347 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
7348 for all controls so it is mostly just a hint to wxWindows and not a
7349 mandatory directive.
7350 """
7351 return _core_.Window_Freeze(*args, **kwargs)
7352
7353 def Thaw(*args, **kwargs):
7354 """
7355 Thaw(self)
7356
7357 Reenables window updating after a previous call to Freeze. Calls to
79fccf9d
RD
7358 Freeze/Thaw may be nested, so Thaw must be called the same number of
7359 times that Freeze was before the window will be updated.
d55e5bfc
RD
7360 """
7361 return _core_.Window_Thaw(*args, **kwargs)
7362
7363 def PrepareDC(*args, **kwargs):
7364 """
7365 PrepareDC(self, DC dc)
7366
7367 Call this function to prepare the device context for drawing a
7368 scrolled image. It sets the device origin according to the current
7369 scroll position.
7370 """
7371 return _core_.Window_PrepareDC(*args, **kwargs)
7372
7373 def GetUpdateRegion(*args, **kwargs):
7374 """
7375 GetUpdateRegion(self) -> Region
7376
7377 Returns the region specifying which parts of the window have been
7378 damaged. Should only be called within an EVT_PAINT handler.
7379 """
7380 return _core_.Window_GetUpdateRegion(*args, **kwargs)
7381
7382 def GetUpdateClientRect(*args, **kwargs):
7383 """
7384 GetUpdateClientRect(self) -> Rect
7385
7386 Get the update rectangle region bounding box in client coords.
7387 """
7388 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
7389
7390 def IsExposed(*args, **kwargs):
7391 """
7392 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
7393
7394 Returns true if the given point or rectangle area has been exposed
7395 since the last repaint. Call this in an paint event handler to
7396 optimize redrawing by only redrawing those areas, which have been
7397 exposed.
7398 """
7399 return _core_.Window_IsExposed(*args, **kwargs)
7400
7401 def IsExposedPoint(*args, **kwargs):
7402 """
7403 IsExposedPoint(self, Point pt) -> bool
7404
7405 Returns true if the given point or rectangle area has been exposed
7406 since the last repaint. Call this in an paint event handler to
7407 optimize redrawing by only redrawing those areas, which have been
7408 exposed.
7409 """
7410 return _core_.Window_IsExposedPoint(*args, **kwargs)
7411
7412 def IsExposedRect(*args, **kwargs):
7413 """
7414 IsExposedRect(self, Rect rect) -> bool
7415
7416 Returns true if the given point or rectangle area has been exposed
7417 since the last repaint. Call this in an paint event handler to
7418 optimize redrawing by only redrawing those areas, which have been
7419 exposed.
7420 """
7421 return _core_.Window_IsExposedRect(*args, **kwargs)
7422
7423 def GetDefaultAttributes(*args, **kwargs):
7424 """
7425 GetDefaultAttributes(self) -> VisualAttributes
7426
79fccf9d
RD
7427 Get the default attributes for an instance of this class. This is
7428 useful if you want to use the same font or colour in your own control
7429 as in a standard control -- which is a much better idea than hard
7430 coding specific colours or fonts which might look completely out of
caef1a4d 7431 place on the user's system, especially if it uses themes.
d55e5bfc
RD
7432 """
7433 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
7434
7435 def GetClassDefaultAttributes(*args, **kwargs):
7436 """
c24da6d6 7437 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 7438
79fccf9d
RD
7439 Get the default attributes for this class. This is useful if you want
7440 to use the same font or colour in your own control as in a standard
7441 control -- which is a much better idea than hard coding specific
caef1a4d
RD
7442 colours or fonts which might look completely out of place on the
7443 user's system, especially if it uses themes.
d55e5bfc
RD
7444
7445 The variant parameter is only relevant under Mac currently and is
79fccf9d 7446 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
7447 the returned font. See `wx.Window.SetWindowVariant` for more about
7448 this.
d55e5bfc
RD
7449 """
7450 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
7451
7452 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
7453 def SetBackgroundColour(*args, **kwargs):
7454 """
7455 SetBackgroundColour(self, Colour colour) -> bool
7456
7457 Sets the background colour of the window. Returns True if the colour
7458 was changed. The background colour is usually painted by the default
7459 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
7460 automatically under GTK. Using `wx.NullColour` will reset the window
7461 to the default background colour.
d55e5bfc 7462
caef1a4d 7463 Note that setting the background colour may not cause an immediate
f8167d6e 7464 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
7465 calling this function.
7466
f8167d6e
RD
7467 Using this function will disable attempts to use themes for this
7468 window, if the system supports them. Use with care since usually the
7469 themes represent the appearance chosen by the user to be used for all
7470 applications on the system.
d55e5bfc
RD
7471 """
7472 return _core_.Window_SetBackgroundColour(*args, **kwargs)
7473
412d302d
RD
7474 def SetOwnBackgroundColour(*args, **kwargs):
7475 """SetOwnBackgroundColour(self, Colour colour)"""
7476 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
7477
7478 def SetForegroundColour(*args, **kwargs):
7479 """
7480 SetForegroundColour(self, Colour colour) -> bool
7481
7482 Sets the foreground colour of the window. Returns True is the colour
7483 was changed. The interpretation of foreground colour is dependent on
7484 the window class; it may be the text colour or other colour, or it may
7485 not be used at all.
7486 """
7487 return _core_.Window_SetForegroundColour(*args, **kwargs)
7488
fa47d7a7
VS
7489 def SetOwnForegroundColour(*args, **kwargs):
7490 """SetOwnForegroundColour(self, Colour colour)"""
7491 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
7492
7493 def GetBackgroundColour(*args, **kwargs):
7494 """
7495 GetBackgroundColour(self) -> Colour
7496
7497 Returns the background colour of the window.
7498 """
7499 return _core_.Window_GetBackgroundColour(*args, **kwargs)
7500
7501 def GetForegroundColour(*args, **kwargs):
7502 """
7503 GetForegroundColour(self) -> Colour
7504
7505 Returns the foreground colour of the window. The interpretation of
7506 foreground colour is dependent on the window class; it may be the text
7507 colour or other colour, or it may not be used at all.
7508 """
7509 return _core_.Window_GetForegroundColour(*args, **kwargs)
7510
dcb8fc74
RD
7511 def InheritsBackgroundColour(*args, **kwargs):
7512 """InheritsBackgroundColour(self) -> bool"""
7513 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
7514
7515 def UseBgCol(*args, **kwargs):
7516 """UseBgCol(self) -> bool"""
7517 return _core_.Window_UseBgCol(*args, **kwargs)
7518
0f63ec68
RD
7519 def SetBackgroundStyle(*args, **kwargs):
7520 """
7521 SetBackgroundStyle(self, int style) -> bool
7522
7523 Returns the background style of the window. The background style
7524 indicates how the background of the window is drawn.
7525
7526 ====================== ========================================
7527 wx.BG_STYLE_SYSTEM The background colour or pattern should
7528 be determined by the system
7529 wx.BG_STYLE_COLOUR The background should be a solid colour
7530 wx.BG_STYLE_CUSTOM The background will be implemented by the
7531 application.
7532 ====================== ========================================
7533
7534 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
7535 a custom background, such as a tiled bitmap. Currently the style has
7536 no effect on other platforms.
7537
7538 :see: `GetBackgroundStyle`, `SetBackgroundColour`
7539 """
7540 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
7541
7542 def GetBackgroundStyle(*args, **kwargs):
7543 """
7544 GetBackgroundStyle(self) -> int
7545
7546 Returns the background style of the window.
7547
7548 :see: `SetBackgroundStyle`
7549 """
7550 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
7551
51b83b37
RD
7552 def HasTransparentBackground(*args, **kwargs):
7553 """
7554 HasTransparentBackground(self) -> bool
7555
7556 Returns True if this window's background is transparent (as, for
7557 example, for `wx.StaticText`) and should show the parent window's
7558 background.
7559
7560 This method is mostly used internally by the library itself and you
7561 normally shouldn't have to call it. You may, however, have to override
7562 it in your custom control classes to ensure that background is painted
7563 correctly.
7564 """
7565 return _core_.Window_HasTransparentBackground(*args, **kwargs)
7566
d55e5bfc
RD
7567 def SetCursor(*args, **kwargs):
7568 """
7569 SetCursor(self, Cursor cursor) -> bool
7570
7571 Sets the window's cursor. Notice that the window cursor also sets it
7572 for the children of the window implicitly.
7573
7574 The cursor may be wx.NullCursor in which case the window cursor will
7575 be reset back to default.
7576 """
7577 return _core_.Window_SetCursor(*args, **kwargs)
7578
7579 def GetCursor(*args, **kwargs):
7580 """
7581 GetCursor(self) -> Cursor
7582
7583 Return the cursor associated with this window.
7584 """
7585 return _core_.Window_GetCursor(*args, **kwargs)
7586
7587 def SetFont(*args, **kwargs):
7588 """
7589 SetFont(self, Font font) -> bool
7590
7591 Sets the font for this window.
7592 """
7593 return _core_.Window_SetFont(*args, **kwargs)
7594
fa47d7a7
VS
7595 def SetOwnFont(*args, **kwargs):
7596 """SetOwnFont(self, Font font)"""
7597 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
7598
7599 def GetFont(*args, **kwargs):
7600 """
7601 GetFont(self) -> Font
7602
7603 Returns the default font used for this window.
7604 """
7605 return _core_.Window_GetFont(*args, **kwargs)
7606
7607 def SetCaret(*args, **kwargs):
7608 """
7609 SetCaret(self, Caret caret)
7610
7611 Sets the caret associated with the window.
7612 """
7613 return _core_.Window_SetCaret(*args, **kwargs)
7614
7615 def GetCaret(*args, **kwargs):
7616 """
7617 GetCaret(self) -> Caret
7618
7619 Returns the caret associated with the window.
7620 """
7621 return _core_.Window_GetCaret(*args, **kwargs)
7622
7623 def GetCharHeight(*args, **kwargs):
7624 """
7625 GetCharHeight(self) -> int
7626
7627 Get the (average) character size for the current font.
7628 """
7629 return _core_.Window_GetCharHeight(*args, **kwargs)
7630
7631 def GetCharWidth(*args, **kwargs):
7632 """
7633 GetCharWidth(self) -> int
7634
7635 Get the (average) character size for the current font.
7636 """
7637 return _core_.Window_GetCharWidth(*args, **kwargs)
7638
7639 def GetTextExtent(*args, **kwargs):
a8eff060
RD
7640 """
7641 GetTextExtent(String string) -> (width, height)
7642
7643 Get the width and height of the text using the current font.
7644 """
d55e5bfc
RD
7645 return _core_.Window_GetTextExtent(*args, **kwargs)
7646
7647 def GetFullTextExtent(*args, **kwargs):
7648 """
7649 GetFullTextExtent(String string, Font font=None) ->
7650 (width, height, descent, externalLeading)
7651
7652 Get the width, height, decent and leading of the text using the
7653 current or specified font.
7654 """
7655 return _core_.Window_GetFullTextExtent(*args, **kwargs)
7656
7657 def ClientToScreenXY(*args, **kwargs):
7658 """
7659 ClientToScreenXY(int x, int y) -> (x,y)
7660
7661 Converts to screen coordinates from coordinates relative to this window.
7662 """
7663 return _core_.Window_ClientToScreenXY(*args, **kwargs)
7664
7665 def ScreenToClientXY(*args, **kwargs):
7666 """
7667 ScreenToClientXY(int x, int y) -> (x,y)
7668
7669 Converts from screen to client window coordinates.
7670 """
7671 return _core_.Window_ScreenToClientXY(*args, **kwargs)
7672
7673 def ClientToScreen(*args, **kwargs):
7674 """
7675 ClientToScreen(self, Point pt) -> Point
7676
7677 Converts to screen coordinates from coordinates relative to this window.
7678 """
7679 return _core_.Window_ClientToScreen(*args, **kwargs)
7680
7681 def ScreenToClient(*args, **kwargs):
7682 """
7683 ScreenToClient(self, Point pt) -> Point
7684
7685 Converts from screen to client window coordinates.
7686 """
7687 return _core_.Window_ScreenToClient(*args, **kwargs)
7688
7689 def HitTestXY(*args, **kwargs):
7690 """
7691 HitTestXY(self, int x, int y) -> int
7692
7693 Test where the given (in client coords) point lies
7694 """
7695 return _core_.Window_HitTestXY(*args, **kwargs)
7696
7697 def HitTest(*args, **kwargs):
7698 """
7699 HitTest(self, Point pt) -> int
7700
7701 Test where the given (in client coords) point lies
7702 """
7703 return _core_.Window_HitTest(*args, **kwargs)
7704
7705 def GetBorder(*args):
7706 """
7707 GetBorder(self, long flags) -> int
7708 GetBorder(self) -> int
7709
7710 Get border for the flags of this window
7711 """
7712 return _core_.Window_GetBorder(*args)
7713
7714 def UpdateWindowUI(*args, **kwargs):
7715 """
7716 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
7717
7718 This function sends EVT_UPDATE_UI events to the window. The particular
7719 implementation depends on the window; for example a wx.ToolBar will
7720 send an update UI event for each toolbar button, and a wx.Frame will
7721 send an update UI event for each menubar menu item. You can call this
7722 function from your application to ensure that your UI is up-to-date at
7723 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7724 concerned). This may be necessary if you have called
7725 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7726 limit the overhead that wxWindows incurs by sending update UI events
7727 in idle time.
d55e5bfc
RD
7728 """
7729 return _core_.Window_UpdateWindowUI(*args, **kwargs)
7730
7731 def PopupMenuXY(*args, **kwargs):
7732 """
7a0b95b0 7733 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 7734
7a0b95b0
RD
7735 Pops up the given menu at the specified coordinates, relative to this window,
7736 and returns control when the user has dismissed the menu. If a menu item is
7737 selected, the corresponding menu event is generated and will be processed as
7738 usual. If the default position is given then the current position of the
7739 mouse cursor will be used.
d55e5bfc
RD
7740 """
7741 return _core_.Window_PopupMenuXY(*args, **kwargs)
7742
7743 def PopupMenu(*args, **kwargs):
7744 """
7a0b95b0 7745 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 7746
7a0b95b0
RD
7747 Pops up the given menu at the specified coordinates, relative to this window,
7748 and returns control when the user has dismissed the menu. If a menu item is
7749 selected, the corresponding menu event is generated and will be processed as
7750 usual. If the default position is given then the current position of the
7751 mouse cursor will be used.
d55e5bfc
RD
7752 """
7753 return _core_.Window_PopupMenu(*args, **kwargs)
7754
7755 def GetHandle(*args, **kwargs):
7756 """
7757 GetHandle(self) -> long
7758
7759 Returns the platform-specific handle (as a long integer) of the
7760 physical window. Currently on wxMac it returns the handle of the
7761 toplevel parent of the window.
7762 """
7763 return _core_.Window_GetHandle(*args, **kwargs)
7764
629e65c2
RD
7765 def AssociateHandle(*args, **kwargs):
7766 """
7767 AssociateHandle(self, long handle)
7768
7769 Associate the window with a new native handle
7770 """
7771 return _core_.Window_AssociateHandle(*args, **kwargs)
7772
7773 def DissociateHandle(*args, **kwargs):
7774 """
7775 DissociateHandle(self)
7776
7777 Dissociate the current native handle from the window
7778 """
7779 return _core_.Window_DissociateHandle(*args, **kwargs)
7780
d55e5bfc
RD
7781 def OnPaint(*args, **kwargs):
7782 """OnPaint(self, PaintEvent event)"""
7783 return _core_.Window_OnPaint(*args, **kwargs)
7784
7785 def HasScrollbar(*args, **kwargs):
7786 """
7787 HasScrollbar(self, int orient) -> bool
7788
7789 Does the window have the scrollbar for this orientation?
7790 """
7791 return _core_.Window_HasScrollbar(*args, **kwargs)
7792
7793 def SetScrollbar(*args, **kwargs):
7794 """
79fccf9d 7795 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
7796 bool refresh=True)
7797
7798 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc
RD
7799 """
7800 return _core_.Window_SetScrollbar(*args, **kwargs)
7801
7802 def SetScrollPos(*args, **kwargs):
7803 """
7804 SetScrollPos(self, int orientation, int pos, bool refresh=True)
7805
7806 Sets the position of one of the built-in scrollbars.
7807 """
7808 return _core_.Window_SetScrollPos(*args, **kwargs)
7809
7810 def GetScrollPos(*args, **kwargs):
7811 """
7812 GetScrollPos(self, int orientation) -> int
7813
7814 Returns the built-in scrollbar position.
7815 """
7816 return _core_.Window_GetScrollPos(*args, **kwargs)
7817
7818 def GetScrollThumb(*args, **kwargs):
7819 """
7820 GetScrollThumb(self, int orientation) -> int
7821
7822 Returns the built-in scrollbar thumb size.
7823 """
7824 return _core_.Window_GetScrollThumb(*args, **kwargs)
7825
7826 def GetScrollRange(*args, **kwargs):
7827 """
7828 GetScrollRange(self, int orientation) -> int
7829
7830 Returns the built-in scrollbar range.
7831 """
7832 return _core_.Window_GetScrollRange(*args, **kwargs)
7833
7834 def ScrollWindow(*args, **kwargs):
7835 """
7836 ScrollWindow(self, int dx, int dy, Rect rect=None)
7837
7838 Physically scrolls the pixels in the window and move child windows
7839 accordingly. Use this function to optimise your scrolling
7840 implementations, to minimise the area that must be redrawn. Note that
7841 it is rarely required to call this function from a user program.
d55e5bfc
RD
7842 """
7843 return _core_.Window_ScrollWindow(*args, **kwargs)
7844
7845 def ScrollLines(*args, **kwargs):
7846 """
7847 ScrollLines(self, int lines) -> bool
7848
7849 If the platform and window class supports it, scrolls the window by
7850 the given number of lines down, if lines is positive, or up if lines
7851 is negative. Returns True if the window was scrolled, False if it was
7852 already on top/bottom and nothing was done.
7853 """
7854 return _core_.Window_ScrollLines(*args, **kwargs)
7855
7856 def ScrollPages(*args, **kwargs):
7857 """
7858 ScrollPages(self, int pages) -> bool
7859
79fccf9d 7860 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
7861 the given number of pages down, if pages is positive, or up if pages
7862 is negative. Returns True if the window was scrolled, False if it was
7863 already on top/bottom and nothing was done.
7864 """
7865 return _core_.Window_ScrollPages(*args, **kwargs)
7866
7867 def LineUp(*args, **kwargs):
7868 """
7869 LineUp(self) -> bool
7870
7871 This is just a wrapper for ScrollLines(-1).
7872 """
7873 return _core_.Window_LineUp(*args, **kwargs)
7874
7875 def LineDown(*args, **kwargs):
7876 """
7877 LineDown(self) -> bool
7878
7879 This is just a wrapper for ScrollLines(1).
7880 """
7881 return _core_.Window_LineDown(*args, **kwargs)
7882
7883 def PageUp(*args, **kwargs):
7884 """
7885 PageUp(self) -> bool
7886
7887 This is just a wrapper for ScrollPages(-1).
7888 """
7889 return _core_.Window_PageUp(*args, **kwargs)
7890
7891 def PageDown(*args, **kwargs):
7892 """
7893 PageDown(self) -> bool
7894
7895 This is just a wrapper for ScrollPages(1).
7896 """
7897 return _core_.Window_PageDown(*args, **kwargs)
7898
7899 def SetHelpText(*args, **kwargs):
7900 """
7901 SetHelpText(self, String text)
7902
7903 Sets the help text to be used as context-sensitive help for this
7904 window. Note that the text is actually stored by the current
7905 wxHelpProvider implementation, and not in the window object itself.
7906 """
7907 return _core_.Window_SetHelpText(*args, **kwargs)
7908
7909 def SetHelpTextForId(*args, **kwargs):
7910 """
7911 SetHelpTextForId(self, String text)
7912
7913 Associate this help text with all windows with the same id as this
7914 one.
7915 """
7916 return _core_.Window_SetHelpTextForId(*args, **kwargs)
7917
7918 def GetHelpText(*args, **kwargs):
7919 """
7920 GetHelpText(self) -> String
7921
7922 Gets the help text to be used as context-sensitive help for this
7923 window. Note that the text is actually stored by the current
7924 wxHelpProvider implementation, and not in the window object itself.
7925 """
7926 return _core_.Window_GetHelpText(*args, **kwargs)
7927
7928 def SetToolTipString(*args, **kwargs):
7929 """
7930 SetToolTipString(self, String tip)
7931
7932 Attach a tooltip to the window.
7933 """
7934 return _core_.Window_SetToolTipString(*args, **kwargs)
7935
7936 def SetToolTip(*args, **kwargs):
7937 """
7938 SetToolTip(self, ToolTip tip)
7939
7940 Attach a tooltip to the window.
7941 """
7942 return _core_.Window_SetToolTip(*args, **kwargs)
7943
7944 def GetToolTip(*args, **kwargs):
7945 """
7946 GetToolTip(self) -> ToolTip
7947
7948 get the associated tooltip or None if none
7949 """
7950 return _core_.Window_GetToolTip(*args, **kwargs)
7951
7952 def SetDropTarget(*args, **kwargs):
7953 """
7954 SetDropTarget(self, DropTarget dropTarget)
7955
7956 Associates a drop target with this window. If the window already has
7957 a drop target, it is deleted.
7958 """
7959 return _core_.Window_SetDropTarget(*args, **kwargs)
7960
7961 def GetDropTarget(*args, **kwargs):
7962 """
7963 GetDropTarget(self) -> DropTarget
7964
7965 Returns the associated drop target, which may be None.
7966 """
7967 return _core_.Window_GetDropTarget(*args, **kwargs)
7968
7969 def DragAcceptFiles(*args, **kwargs):
7970 """
7971 DragAcceptFiles(self, bool accept)
7972
7973 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
7974 Only available on Windows.
7975 """
7976 return _core_.Window_DragAcceptFiles(*args, **kwargs)
7977
7978 def SetConstraints(*args, **kwargs):
7979 """
7980 SetConstraints(self, LayoutConstraints constraints)
7981
7982 Sets the window to have the given layout constraints. If an existing
7983 layout constraints object is already owned by the window, it will be
7984 deleted. Pass None to disassociate and delete the window's current
7985 constraints.
7986
7987 You must call SetAutoLayout to tell a window to use the constraints
7988 automatically in its default EVT_SIZE handler; otherwise, you must
7989 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7990 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7991 effect.
7992 """
7993 return _core_.Window_SetConstraints(*args, **kwargs)
7994
7995 def GetConstraints(*args, **kwargs):
7996 """
7997 GetConstraints(self) -> LayoutConstraints
7998
7999 Returns a pointer to the window's layout constraints, or None if there
8000 are none.
8001 """
8002 return _core_.Window_GetConstraints(*args, **kwargs)
8003
8004 def SetAutoLayout(*args, **kwargs):
8005 """
8006 SetAutoLayout(self, bool autoLayout)
8007
8008 Determines whether the Layout function will be called automatically
8009 when the window is resized. It is called implicitly by SetSizer but
8010 if you use SetConstraints you should call it manually or otherwise the
8011 window layout won't be correctly updated when its size changes.
8012 """
8013 return _core_.Window_SetAutoLayout(*args, **kwargs)
8014
8015 def GetAutoLayout(*args, **kwargs):
8016 """
8017 GetAutoLayout(self) -> bool
8018
8019 Returns the current autoLayout setting
8020 """
8021 return _core_.Window_GetAutoLayout(*args, **kwargs)
8022
8023 def Layout(*args, **kwargs):
8024 """
8025 Layout(self) -> bool
8026
8027 Invokes the constraint-based layout algorithm or the sizer-based
8028 algorithm for this window. See SetAutoLayout: when auto layout is on,
8029 this function gets called automatically by the default EVT_SIZE
8030 handler when the window is resized.
8031 """
8032 return _core_.Window_Layout(*args, **kwargs)
8033
8034 def SetSizer(*args, **kwargs):
8035 """
8036 SetSizer(self, Sizer sizer, bool deleteOld=True)
8037
8038 Sets the window to have the given layout sizer. The window will then
8039 own the object, and will take care of its deletion. If an existing
8040 layout sizer object is already owned by the window, it will be deleted
8041 if the deleteOld parameter is true. Note that this function will also
8042 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 8043 non-None, and False otherwise.
d55e5bfc
RD
8044 """
8045 return _core_.Window_SetSizer(*args, **kwargs)
8046
8047 def SetSizerAndFit(*args, **kwargs):
8048 """
8049 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
8050
8051 The same as SetSizer, except it also sets the size hints for the
8052 window based on the sizer's minimum size.
8053 """
8054 return _core_.Window_SetSizerAndFit(*args, **kwargs)
8055
8056 def GetSizer(*args, **kwargs):
8057 """
8058 GetSizer(self) -> Sizer
8059
8060 Return the sizer associated with the window by a previous call to
8061 SetSizer or None if there isn't one.
8062 """
8063 return _core_.Window_GetSizer(*args, **kwargs)
8064
8065 def SetContainingSizer(*args, **kwargs):
8066 """
8067 SetContainingSizer(self, Sizer sizer)
8068
8069 This normally does not need to be called by application code. It is
8070 called internally when a window is added to a sizer, and is used so
8071 the window can remove itself from the sizer when it is destroyed.
8072 """
8073 return _core_.Window_SetContainingSizer(*args, **kwargs)
8074
8075 def GetContainingSizer(*args, **kwargs):
8076 """
8077 GetContainingSizer(self) -> Sizer
8078
8079 Return the sizer that this window is a member of, if any, otherwise None.
8080 """
8081 return _core_.Window_GetContainingSizer(*args, **kwargs)
8082
8083 def InheritAttributes(*args, **kwargs):
8084 """
8085 InheritAttributes(self)
8086
79fccf9d
RD
8087 This function is (or should be, in case of custom controls) called
8088 during window creation to intelligently set up the window visual
8089 attributes, that is the font and the foreground and background
8090 colours.
8091
8092 By 'intelligently' the following is meant: by default, all windows use
8093 their own default attributes. However if some of the parent's
8094 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 8095 SetOwnFont) and if the corresponding attribute hadn't been
79fccf9d
RD
8096 explicitly set for this window itself, then this window takes the same
8097 value as used by the parent. In addition, if the window overrides
8098 ShouldInheritColours to return false, the colours will not be changed
8099 no matter what and only the font might.
8100
ec9b55ca
RD
8101 This rather complicated logic is necessary in order to accommodate the
8102 different usage scenarios. The most common one is when all default
79fccf9d
RD
8103 attributes are used and in this case, nothing should be inherited as
8104 in modern GUIs different controls use different fonts (and colours)
8105 than their siblings so they can't inherit the same value from the
8106 parent. However it was also deemed desirable to allow to simply change
8107 the attributes of all children at once by just changing the font or
8108 colour of their common parent, hence in this case we do inherit the
8109 parents attributes.
8110
d55e5bfc
RD
8111 """
8112 return _core_.Window_InheritAttributes(*args, **kwargs)
8113
8114 def ShouldInheritColours(*args, **kwargs):
8115 """
8116 ShouldInheritColours(self) -> bool
8117
8118 Return true from here to allow the colours of this window to be
79fccf9d
RD
8119 changed by InheritAttributes, returning false forbids inheriting them
8120 from the parent window.
d55e5bfc 8121
79fccf9d
RD
8122 The base class version returns false, but this method is overridden in
8123 wxControl where it returns true.
d55e5bfc
RD
8124 """
8125 return _core_.Window_ShouldInheritColours(*args, **kwargs)
8126
8127 def PostCreate(self, pre):
8128 """
8129 Phase 3 of the 2-phase create <wink!>
8130 Call this method after precreating the window with the 2-phase create method.
8131 """
8132 self.this = pre.this
8133 self.thisown = pre.thisown
8134 pre.thisown = 0
8135 if hasattr(self, '_setOORInfo'):
8136 self._setOORInfo(self)
8137 if hasattr(self, '_setCallbackInfo'):
8138 self._setCallbackInfo(self, self.__class__)
8139
8140
8141class WindowPtr(Window):
8142 def __init__(self, this):
8143 self.this = this
8144 if not hasattr(self,"thisown"): self.thisown = 0
8145 self.__class__ = Window
8146_core_.Window_swigregister(WindowPtr)
8147
8148def PreWindow(*args, **kwargs):
8149 """
8150 PreWindow() -> Window
8151
8152 Precreate a Window for 2-phase creation.
8153 """
8154 val = _core_.new_PreWindow(*args, **kwargs)
8155 val.thisown = 1
8156 return val
8157
8158def Window_NewControlId(*args, **kwargs):
8159 """
8160 Window_NewControlId() -> int
8161
8162 Generate a control id for the controls which were not given one.
8163 """
8164 return _core_.Window_NewControlId(*args, **kwargs)
8165
8166def Window_NextControlId(*args, **kwargs):
8167 """
8168 Window_NextControlId(int winid) -> int
8169
8170 Get the id of the control following the one with the given
79fccf9d 8171 autogenerated) id
d55e5bfc
RD
8172 """
8173 return _core_.Window_NextControlId(*args, **kwargs)
8174
8175def Window_PrevControlId(*args, **kwargs):
8176 """
8177 Window_PrevControlId(int winid) -> int
8178
8179 Get the id of the control preceding the one with the given
79fccf9d 8180 autogenerated) id
d55e5bfc
RD
8181 """
8182 return _core_.Window_PrevControlId(*args, **kwargs)
8183
8184def Window_FindFocus(*args, **kwargs):
8185 """
8186 Window_FindFocus() -> Window
8187
8188 Returns the window or control that currently has the keyboard focus,
8189 or None.
8190 """
8191 return _core_.Window_FindFocus(*args, **kwargs)
8192
8193def Window_GetCapture(*args, **kwargs):
8194 """
8195 Window_GetCapture() -> Window
8196
8197 Returns the window which currently captures the mouse or None
8198 """
8199 return _core_.Window_GetCapture(*args, **kwargs)
8200
8201def Window_GetClassDefaultAttributes(*args, **kwargs):
8202 """
8203 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8204
79fccf9d
RD
8205 Get the default attributes for this class. This is useful if you want
8206 to use the same font or colour in your own control as in a standard
8207 control -- which is a much better idea than hard coding specific
caef1a4d
RD
8208 colours or fonts which might look completely out of place on the
8209 user's system, especially if it uses themes.
d55e5bfc
RD
8210
8211 The variant parameter is only relevant under Mac currently and is
79fccf9d 8212 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
8213 the returned font. See `wx.Window.SetWindowVariant` for more about
8214 this.
d55e5bfc
RD
8215 """
8216 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8217
8218def DLG_PNT(win, point_or_x, y=None):
8219 """
8220 Convenience function for converting a Point or (x,y) in
8221 dialog units to pixel units.
8222 """
8223 if y is None:
8224 return win.ConvertDialogPointToPixels(point_or_x)
8225 else:
8226 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
8227
8228def DLG_SZE(win, size_width, height=None):
8229 """
8230 Convenience function for converting a Size or (w,h) in
8231 dialog units to pixel units.
8232 """
8233 if height is None:
8234 return win.ConvertDialogSizeToPixels(size_width)
8235 else:
8236 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
8237
8238
8239def FindWindowById(*args, **kwargs):
8240 """
8241 FindWindowById(long id, Window parent=None) -> Window
8242
8243 Find the first window in the application with the given id. If parent
8244 is None, the search will start from all top-level frames and dialog
8245 boxes; if non-None, the search will be limited to the given window
8246 hierarchy. The search is recursive in both cases.
8247 """
8248 return _core_.FindWindowById(*args, **kwargs)
8249
8250def FindWindowByName(*args, **kwargs):
8251 """
8252 FindWindowByName(String name, Window parent=None) -> Window
8253
8254 Find a window by its name (as given in a window constructor or Create
8255 function call). If parent is None, the search will start from all
8256 top-level frames and dialog boxes; if non-None, the search will be
8257 limited to the given window hierarchy. The search is recursive in both
8258 cases.
8259
8260 If no window with such name is found, wx.FindWindowByLabel is called.
8261 """
8262 return _core_.FindWindowByName(*args, **kwargs)
8263
8264def FindWindowByLabel(*args, **kwargs):
8265 """
8266 FindWindowByLabel(String label, Window parent=None) -> Window
8267
8268 Find a window by its label. Depending on the type of window, the label
8269 may be a window title or panel item label. If parent is None, the
8270 search will start from all top-level frames and dialog boxes; if
8271 non-None, the search will be limited to the given window
8272 hierarchy. The search is recursive in both cases.
8273 """
8274 return _core_.FindWindowByLabel(*args, **kwargs)
8275
8276def Window_FromHWND(*args, **kwargs):
8277 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
8278 return _core_.Window_FromHWND(*args, **kwargs)
8279#---------------------------------------------------------------------------
8280
8281class Validator(EvtHandler):
093d3ff1 8282 """Proxy of C++ Validator class"""
d55e5bfc
RD
8283 def __repr__(self):
8284 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8285 def __init__(self, *args, **kwargs):
8286 """__init__(self) -> Validator"""
8287 newobj = _core_.new_Validator(*args, **kwargs)
8288 self.this = newobj.this
8289 self.thisown = 1
8290 del newobj.thisown
8291 self._setOORInfo(self)
8292
8293 def Clone(*args, **kwargs):
8294 """Clone(self) -> Validator"""
8295 return _core_.Validator_Clone(*args, **kwargs)
8296
8297 def Validate(*args, **kwargs):
8298 """Validate(self, Window parent) -> bool"""
8299 return _core_.Validator_Validate(*args, **kwargs)
8300
8301 def TransferToWindow(*args, **kwargs):
8302 """TransferToWindow(self) -> bool"""
8303 return _core_.Validator_TransferToWindow(*args, **kwargs)
8304
8305 def TransferFromWindow(*args, **kwargs):
8306 """TransferFromWindow(self) -> bool"""
8307 return _core_.Validator_TransferFromWindow(*args, **kwargs)
8308
8309 def GetWindow(*args, **kwargs):
8310 """GetWindow(self) -> Window"""
8311 return _core_.Validator_GetWindow(*args, **kwargs)
8312
8313 def SetWindow(*args, **kwargs):
8314 """SetWindow(self, Window window)"""
8315 return _core_.Validator_SetWindow(*args, **kwargs)
8316
8317 def IsSilent(*args, **kwargs):
c24da6d6 8318 """IsSilent() -> bool"""
d55e5bfc
RD
8319 return _core_.Validator_IsSilent(*args, **kwargs)
8320
8321 IsSilent = staticmethod(IsSilent)
8322 def SetBellOnError(*args, **kwargs):
c24da6d6 8323 """SetBellOnError(int doIt=True)"""
d55e5bfc
RD
8324 return _core_.Validator_SetBellOnError(*args, **kwargs)
8325
8326 SetBellOnError = staticmethod(SetBellOnError)
8327
8328class ValidatorPtr(Validator):
8329 def __init__(self, this):
8330 self.this = this
8331 if not hasattr(self,"thisown"): self.thisown = 0
8332 self.__class__ = Validator
8333_core_.Validator_swigregister(ValidatorPtr)
8334
8335def Validator_IsSilent(*args, **kwargs):
8336 """Validator_IsSilent() -> bool"""
8337 return _core_.Validator_IsSilent(*args, **kwargs)
8338
8339def Validator_SetBellOnError(*args, **kwargs):
8340 """Validator_SetBellOnError(int doIt=True)"""
8341 return _core_.Validator_SetBellOnError(*args, **kwargs)
8342
8343class PyValidator(Validator):
093d3ff1 8344 """Proxy of C++ PyValidator class"""
d55e5bfc
RD
8345 def __repr__(self):
8346 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8347 def __init__(self, *args, **kwargs):
8348 """__init__(self) -> PyValidator"""
8349 newobj = _core_.new_PyValidator(*args, **kwargs)
8350 self.this = newobj.this
8351 self.thisown = 1
8352 del newobj.thisown
8353
8354 self._setCallbackInfo(self, PyValidator, 1)
8355 self._setOORInfo(self)
8356
8357 def _setCallbackInfo(*args, **kwargs):
8358 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
8359 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
8360
8361
8362class PyValidatorPtr(PyValidator):
8363 def __init__(self, this):
8364 self.this = this
8365 if not hasattr(self,"thisown"): self.thisown = 0
8366 self.__class__ = PyValidator
8367_core_.PyValidator_swigregister(PyValidatorPtr)
8368
8369#---------------------------------------------------------------------------
8370
8371class Menu(EvtHandler):
093d3ff1 8372 """Proxy of C++ Menu class"""
d55e5bfc
RD
8373 def __repr__(self):
8374 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8375 def __init__(self, *args, **kwargs):
8376 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
8377 newobj = _core_.new_Menu(*args, **kwargs)
8378 self.this = newobj.this
8379 self.thisown = 1
8380 del newobj.thisown
8381 self._setOORInfo(self)
8382
8383 def Append(*args, **kwargs):
8384 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8385 return _core_.Menu_Append(*args, **kwargs)
8386
8387 def AppendSeparator(*args, **kwargs):
8388 """AppendSeparator(self) -> MenuItem"""
8389 return _core_.Menu_AppendSeparator(*args, **kwargs)
8390
8391 def AppendCheckItem(*args, **kwargs):
8392 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8393 return _core_.Menu_AppendCheckItem(*args, **kwargs)
8394
8395 def AppendRadioItem(*args, **kwargs):
8396 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8397 return _core_.Menu_AppendRadioItem(*args, **kwargs)
8398
8399 def AppendMenu(*args, **kwargs):
8400 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8401 return _core_.Menu_AppendMenu(*args, **kwargs)
8402
8403 def AppendItem(*args, **kwargs):
8404 """AppendItem(self, MenuItem item) -> MenuItem"""
8405 return _core_.Menu_AppendItem(*args, **kwargs)
8406
8407 def Break(*args, **kwargs):
8408 """Break(self)"""
8409 return _core_.Menu_Break(*args, **kwargs)
8410
8411 def InsertItem(*args, **kwargs):
8412 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
8413 return _core_.Menu_InsertItem(*args, **kwargs)
8414
8415 def Insert(*args, **kwargs):
8416 """
8417 Insert(self, size_t pos, int id, String text, String help=EmptyString,
8418 int kind=ITEM_NORMAL) -> MenuItem
8419 """
8420 return _core_.Menu_Insert(*args, **kwargs)
8421
8422 def InsertSeparator(*args, **kwargs):
8423 """InsertSeparator(self, size_t pos) -> MenuItem"""
8424 return _core_.Menu_InsertSeparator(*args, **kwargs)
8425
8426 def InsertCheckItem(*args, **kwargs):
8427 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8428 return _core_.Menu_InsertCheckItem(*args, **kwargs)
8429
8430 def InsertRadioItem(*args, **kwargs):
8431 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8432 return _core_.Menu_InsertRadioItem(*args, **kwargs)
8433
8434 def InsertMenu(*args, **kwargs):
8435 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8436 return _core_.Menu_InsertMenu(*args, **kwargs)
8437
8438 def PrependItem(*args, **kwargs):
8439 """PrependItem(self, MenuItem item) -> MenuItem"""
8440 return _core_.Menu_PrependItem(*args, **kwargs)
8441
8442 def Prepend(*args, **kwargs):
8443 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8444 return _core_.Menu_Prepend(*args, **kwargs)
8445
8446 def PrependSeparator(*args, **kwargs):
8447 """PrependSeparator(self) -> MenuItem"""
8448 return _core_.Menu_PrependSeparator(*args, **kwargs)
8449
8450 def PrependCheckItem(*args, **kwargs):
8451 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8452 return _core_.Menu_PrependCheckItem(*args, **kwargs)
8453
8454 def PrependRadioItem(*args, **kwargs):
8455 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8456 return _core_.Menu_PrependRadioItem(*args, **kwargs)
8457
8458 def PrependMenu(*args, **kwargs):
8459 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8460 return _core_.Menu_PrependMenu(*args, **kwargs)
8461
8462 def Remove(*args, **kwargs):
8463 """Remove(self, int id) -> MenuItem"""
8464 return _core_.Menu_Remove(*args, **kwargs)
8465
8466 def RemoveItem(*args, **kwargs):
8467 """RemoveItem(self, MenuItem item) -> MenuItem"""
8468 return _core_.Menu_RemoveItem(*args, **kwargs)
8469
8470 def Delete(*args, **kwargs):
8471 """Delete(self, int id) -> bool"""
8472 return _core_.Menu_Delete(*args, **kwargs)
8473
8474 def DeleteItem(*args, **kwargs):
8475 """DeleteItem(self, MenuItem item) -> bool"""
8476 return _core_.Menu_DeleteItem(*args, **kwargs)
8477
8478 def Destroy(*args, **kwargs):
8479 """
8480 Destroy(self)
8481
8482 Deletes the C++ object this Python object is a proxy for.
8483 """
8484 return _core_.Menu_Destroy(*args, **kwargs)
8485
8486 def DestroyId(*args, **kwargs):
8487 """
8488 DestroyId(self, int id) -> bool
8489
8490 Deletes the C++ object this Python object is a proxy for.
8491 """
8492 return _core_.Menu_DestroyId(*args, **kwargs)
8493
8494 def DestroyItem(*args, **kwargs):
8495 """
8496 DestroyItem(self, MenuItem item) -> bool
8497
8498 Deletes the C++ object this Python object is a proxy for.
8499 """
8500 return _core_.Menu_DestroyItem(*args, **kwargs)
8501
8502 def GetMenuItemCount(*args, **kwargs):
8503 """GetMenuItemCount(self) -> size_t"""
8504 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
8505
8506 def GetMenuItems(*args, **kwargs):
8507 """GetMenuItems(self) -> PyObject"""
8508 return _core_.Menu_GetMenuItems(*args, **kwargs)
8509
8510 def FindItem(*args, **kwargs):
8511 """FindItem(self, String item) -> int"""
8512 return _core_.Menu_FindItem(*args, **kwargs)
8513
8514 def FindItemById(*args, **kwargs):
8515 """FindItemById(self, int id) -> MenuItem"""
8516 return _core_.Menu_FindItemById(*args, **kwargs)
8517
8518 def FindItemByPosition(*args, **kwargs):
8519 """FindItemByPosition(self, size_t position) -> MenuItem"""
8520 return _core_.Menu_FindItemByPosition(*args, **kwargs)
8521
8522 def Enable(*args, **kwargs):
8523 """Enable(self, int id, bool enable)"""
8524 return _core_.Menu_Enable(*args, **kwargs)
8525
8526 def IsEnabled(*args, **kwargs):
8527 """IsEnabled(self, int id) -> bool"""
8528 return _core_.Menu_IsEnabled(*args, **kwargs)
8529
8530 def Check(*args, **kwargs):
8531 """Check(self, int id, bool check)"""
8532 return _core_.Menu_Check(*args, **kwargs)
8533
8534 def IsChecked(*args, **kwargs):
8535 """IsChecked(self, int id) -> bool"""
8536 return _core_.Menu_IsChecked(*args, **kwargs)
8537
8538 def SetLabel(*args, **kwargs):
8539 """SetLabel(self, int id, String label)"""
8540 return _core_.Menu_SetLabel(*args, **kwargs)
8541
8542 def GetLabel(*args, **kwargs):
8543 """GetLabel(self, int id) -> String"""
8544 return _core_.Menu_GetLabel(*args, **kwargs)
8545
8546 def SetHelpString(*args, **kwargs):
8547 """SetHelpString(self, int id, String helpString)"""
8548 return _core_.Menu_SetHelpString(*args, **kwargs)
8549
8550 def GetHelpString(*args, **kwargs):
8551 """GetHelpString(self, int id) -> String"""
8552 return _core_.Menu_GetHelpString(*args, **kwargs)
8553
8554 def SetTitle(*args, **kwargs):
8555 """SetTitle(self, String title)"""
8556 return _core_.Menu_SetTitle(*args, **kwargs)
8557
8558 def GetTitle(*args, **kwargs):
8559 """GetTitle(self) -> String"""
8560 return _core_.Menu_GetTitle(*args, **kwargs)
8561
8562 def SetEventHandler(*args, **kwargs):
8563 """SetEventHandler(self, EvtHandler handler)"""
8564 return _core_.Menu_SetEventHandler(*args, **kwargs)
8565
8566 def GetEventHandler(*args, **kwargs):
8567 """GetEventHandler(self) -> EvtHandler"""
8568 return _core_.Menu_GetEventHandler(*args, **kwargs)
8569
8570 def SetInvokingWindow(*args, **kwargs):
8571 """SetInvokingWindow(self, Window win)"""
8572 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
8573
8574 def GetInvokingWindow(*args, **kwargs):
8575 """GetInvokingWindow(self) -> Window"""
8576 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
8577
8578 def GetStyle(*args, **kwargs):
8579 """GetStyle(self) -> long"""
8580 return _core_.Menu_GetStyle(*args, **kwargs)
8581
8582 def UpdateUI(*args, **kwargs):
8583 """UpdateUI(self, EvtHandler source=None)"""
8584 return _core_.Menu_UpdateUI(*args, **kwargs)
8585
8586 def GetMenuBar(*args, **kwargs):
8587 """GetMenuBar(self) -> MenuBar"""
8588 return _core_.Menu_GetMenuBar(*args, **kwargs)
8589
8590 def Attach(*args, **kwargs):
8591 """Attach(self, wxMenuBarBase menubar)"""
8592 return _core_.Menu_Attach(*args, **kwargs)
8593
8594 def Detach(*args, **kwargs):
8595 """Detach(self)"""
8596 return _core_.Menu_Detach(*args, **kwargs)
8597
8598 def IsAttached(*args, **kwargs):
8599 """IsAttached(self) -> bool"""
8600 return _core_.Menu_IsAttached(*args, **kwargs)
8601
8602 def SetParent(*args, **kwargs):
8603 """SetParent(self, Menu parent)"""
8604 return _core_.Menu_SetParent(*args, **kwargs)
8605
8606 def GetParent(*args, **kwargs):
8607 """GetParent(self) -> Menu"""
8608 return _core_.Menu_GetParent(*args, **kwargs)
8609
8610
8611class MenuPtr(Menu):
8612 def __init__(self, this):
8613 self.this = this
8614 if not hasattr(self,"thisown"): self.thisown = 0
8615 self.__class__ = Menu
8616_core_.Menu_swigregister(MenuPtr)
8617DefaultValidator = cvar.DefaultValidator
8618
8619#---------------------------------------------------------------------------
8620
8621class MenuBar(Window):
093d3ff1 8622 """Proxy of C++ MenuBar class"""
d55e5bfc
RD
8623 def __repr__(self):
8624 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8625 def __init__(self, *args, **kwargs):
8626 """__init__(self, long style=0) -> MenuBar"""
8627 newobj = _core_.new_MenuBar(*args, **kwargs)
8628 self.this = newobj.this
8629 self.thisown = 1
8630 del newobj.thisown
8631 self._setOORInfo(self)
8632
8633 def Append(*args, **kwargs):
8634 """Append(self, Menu menu, String title) -> bool"""
8635 return _core_.MenuBar_Append(*args, **kwargs)
8636
8637 def Insert(*args, **kwargs):
8638 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
8639 return _core_.MenuBar_Insert(*args, **kwargs)
8640
8641 def GetMenuCount(*args, **kwargs):
8642 """GetMenuCount(self) -> size_t"""
8643 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
8644
8645 def GetMenu(*args, **kwargs):
8646 """GetMenu(self, size_t pos) -> Menu"""
8647 return _core_.MenuBar_GetMenu(*args, **kwargs)
8648
8649 def Replace(*args, **kwargs):
8650 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
8651 return _core_.MenuBar_Replace(*args, **kwargs)
8652
8653 def Remove(*args, **kwargs):
8654 """Remove(self, size_t pos) -> Menu"""
8655 return _core_.MenuBar_Remove(*args, **kwargs)
8656
8657 def EnableTop(*args, **kwargs):
8658 """EnableTop(self, size_t pos, bool enable)"""
8659 return _core_.MenuBar_EnableTop(*args, **kwargs)
8660
8661 def IsEnabledTop(*args, **kwargs):
8662 """IsEnabledTop(self, size_t pos) -> bool"""
8663 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
8664
8665 def SetLabelTop(*args, **kwargs):
8666 """SetLabelTop(self, size_t pos, String label)"""
8667 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
8668
8669 def GetLabelTop(*args, **kwargs):
8670 """GetLabelTop(self, size_t pos) -> String"""
8671 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
8672
8673 def FindMenuItem(*args, **kwargs):
8674 """FindMenuItem(self, String menu, String item) -> int"""
8675 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
8676
8677 def FindItemById(*args, **kwargs):
8678 """FindItemById(self, int id) -> MenuItem"""
8679 return _core_.MenuBar_FindItemById(*args, **kwargs)
8680
8681 def FindMenu(*args, **kwargs):
8682 """FindMenu(self, String title) -> int"""
8683 return _core_.MenuBar_FindMenu(*args, **kwargs)
8684
8685 def Enable(*args, **kwargs):
8686 """Enable(self, int id, bool enable)"""
8687 return _core_.MenuBar_Enable(*args, **kwargs)
8688
8689 def Check(*args, **kwargs):
8690 """Check(self, int id, bool check)"""
8691 return _core_.MenuBar_Check(*args, **kwargs)
8692
8693 def IsChecked(*args, **kwargs):
8694 """IsChecked(self, int id) -> bool"""
8695 return _core_.MenuBar_IsChecked(*args, **kwargs)
8696
8697 def IsEnabled(*args, **kwargs):
8698 """IsEnabled(self, int id) -> bool"""
8699 return _core_.MenuBar_IsEnabled(*args, **kwargs)
8700
8701 def SetLabel(*args, **kwargs):
8702 """SetLabel(self, int id, String label)"""
8703 return _core_.MenuBar_SetLabel(*args, **kwargs)
8704
8705 def GetLabel(*args, **kwargs):
8706 """GetLabel(self, int id) -> String"""
8707 return _core_.MenuBar_GetLabel(*args, **kwargs)
8708
8709 def SetHelpString(*args, **kwargs):
8710 """SetHelpString(self, int id, String helpString)"""
8711 return _core_.MenuBar_SetHelpString(*args, **kwargs)
8712
8713 def GetHelpString(*args, **kwargs):
8714 """GetHelpString(self, int id) -> String"""
8715 return _core_.MenuBar_GetHelpString(*args, **kwargs)
8716
8717 def GetFrame(*args, **kwargs):
8718 """GetFrame(self) -> wxFrame"""
8719 return _core_.MenuBar_GetFrame(*args, **kwargs)
8720
8721 def IsAttached(*args, **kwargs):
8722 """IsAttached(self) -> bool"""
8723 return _core_.MenuBar_IsAttached(*args, **kwargs)
8724
8725 def Attach(*args, **kwargs):
8726 """Attach(self, wxFrame frame)"""
8727 return _core_.MenuBar_Attach(*args, **kwargs)
8728
8729 def Detach(*args, **kwargs):
8730 """Detach(self)"""
8731 return _core_.MenuBar_Detach(*args, **kwargs)
8732
8733
8734class MenuBarPtr(MenuBar):
8735 def __init__(self, this):
8736 self.this = this
8737 if not hasattr(self,"thisown"): self.thisown = 0
8738 self.__class__ = MenuBar
8739_core_.MenuBar_swigregister(MenuBarPtr)
8740
8741#---------------------------------------------------------------------------
8742
8743class MenuItem(Object):
093d3ff1 8744 """Proxy of C++ MenuItem class"""
d55e5bfc
RD
8745 def __repr__(self):
8746 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8747 def __init__(self, *args, **kwargs):
8748 """
8749 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
8750 String help=EmptyString, int kind=ITEM_NORMAL,
8751 Menu subMenu=None) -> MenuItem
8752 """
8753 newobj = _core_.new_MenuItem(*args, **kwargs)
8754 self.this = newobj.this
8755 self.thisown = 1
8756 del newobj.thisown
8757 def GetMenu(*args, **kwargs):
8758 """GetMenu(self) -> Menu"""
8759 return _core_.MenuItem_GetMenu(*args, **kwargs)
8760
8761 def SetMenu(*args, **kwargs):
8762 """SetMenu(self, Menu menu)"""
8763 return _core_.MenuItem_SetMenu(*args, **kwargs)
8764
8765 def SetId(*args, **kwargs):
8766 """SetId(self, int id)"""
8767 return _core_.MenuItem_SetId(*args, **kwargs)
8768
8769 def GetId(*args, **kwargs):
8770 """GetId(self) -> int"""
8771 return _core_.MenuItem_GetId(*args, **kwargs)
8772
8773 def IsSeparator(*args, **kwargs):
8774 """IsSeparator(self) -> bool"""
8775 return _core_.MenuItem_IsSeparator(*args, **kwargs)
8776
8777 def SetText(*args, **kwargs):
8778 """SetText(self, String str)"""
8779 return _core_.MenuItem_SetText(*args, **kwargs)
8780
8781 def GetLabel(*args, **kwargs):
8782 """GetLabel(self) -> String"""
8783 return _core_.MenuItem_GetLabel(*args, **kwargs)
8784
8785 def GetText(*args, **kwargs):
8786 """GetText(self) -> String"""
8787 return _core_.MenuItem_GetText(*args, **kwargs)
8788
8789 def GetLabelFromText(*args, **kwargs):
c24da6d6 8790 """GetLabelFromText(String text) -> String"""
d55e5bfc
RD
8791 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8792
8793 GetLabelFromText = staticmethod(GetLabelFromText)
8794 def GetKind(*args, **kwargs):
8795 """GetKind(self) -> int"""
8796 return _core_.MenuItem_GetKind(*args, **kwargs)
8797
8798 def SetKind(*args, **kwargs):
8799 """SetKind(self, int kind)"""
8800 return _core_.MenuItem_SetKind(*args, **kwargs)
8801
8802 def SetCheckable(*args, **kwargs):
8803 """SetCheckable(self, bool checkable)"""
8804 return _core_.MenuItem_SetCheckable(*args, **kwargs)
8805
8806 def IsCheckable(*args, **kwargs):
8807 """IsCheckable(self) -> bool"""
8808 return _core_.MenuItem_IsCheckable(*args, **kwargs)
8809
8810 def IsSubMenu(*args, **kwargs):
8811 """IsSubMenu(self) -> bool"""
8812 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
8813
8814 def SetSubMenu(*args, **kwargs):
8815 """SetSubMenu(self, Menu menu)"""
8816 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
8817
8818 def GetSubMenu(*args, **kwargs):
8819 """GetSubMenu(self) -> Menu"""
8820 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
8821
8822 def Enable(*args, **kwargs):
8823 """Enable(self, bool enable=True)"""
8824 return _core_.MenuItem_Enable(*args, **kwargs)
8825
8826 def IsEnabled(*args, **kwargs):
8827 """IsEnabled(self) -> bool"""
8828 return _core_.MenuItem_IsEnabled(*args, **kwargs)
8829
8830 def Check(*args, **kwargs):
8831 """Check(self, bool check=True)"""
8832 return _core_.MenuItem_Check(*args, **kwargs)
8833
8834 def IsChecked(*args, **kwargs):
8835 """IsChecked(self) -> bool"""
8836 return _core_.MenuItem_IsChecked(*args, **kwargs)
8837
8838 def Toggle(*args, **kwargs):
8839 """Toggle(self)"""
8840 return _core_.MenuItem_Toggle(*args, **kwargs)
8841
8842 def SetHelp(*args, **kwargs):
8843 """SetHelp(self, String str)"""
8844 return _core_.MenuItem_SetHelp(*args, **kwargs)
8845
8846 def GetHelp(*args, **kwargs):
8847 """GetHelp(self) -> String"""
8848 return _core_.MenuItem_GetHelp(*args, **kwargs)
8849
8850 def GetAccel(*args, **kwargs):
8851 """GetAccel(self) -> AcceleratorEntry"""
8852 return _core_.MenuItem_GetAccel(*args, **kwargs)
8853
8854 def SetAccel(*args, **kwargs):
8855 """SetAccel(self, AcceleratorEntry accel)"""
8856 return _core_.MenuItem_SetAccel(*args, **kwargs)
8857
8858 def SetFont(*args, **kwargs):
8859 """SetFont(self, Font font)"""
8860 return _core_.MenuItem_SetFont(*args, **kwargs)
8861
8862 def GetFont(*args, **kwargs):
8863 """GetFont(self) -> Font"""
8864 return _core_.MenuItem_GetFont(*args, **kwargs)
8865
8866 def SetTextColour(*args, **kwargs):
8867 """SetTextColour(self, Colour colText)"""
8868 return _core_.MenuItem_SetTextColour(*args, **kwargs)
8869
8870 def GetTextColour(*args, **kwargs):
8871 """GetTextColour(self) -> Colour"""
8872 return _core_.MenuItem_GetTextColour(*args, **kwargs)
8873
8874 def SetBackgroundColour(*args, **kwargs):
8875 """SetBackgroundColour(self, Colour colBack)"""
8876 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
8877
8878 def GetBackgroundColour(*args, **kwargs):
8879 """GetBackgroundColour(self) -> Colour"""
8880 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
8881
8882 def SetBitmaps(*args, **kwargs):
8883 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
8884 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
8885
8886 def SetDisabledBitmap(*args, **kwargs):
8887 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
8888 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
8889
8890 def GetDisabledBitmap(*args, **kwargs):
8891 """GetDisabledBitmap(self) -> Bitmap"""
8892 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
8893
8894 def SetMarginWidth(*args, **kwargs):
8895 """SetMarginWidth(self, int nWidth)"""
8896 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
8897
8898 def GetMarginWidth(*args, **kwargs):
8899 """GetMarginWidth(self) -> int"""
8900 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
8901
8902 def GetDefaultMarginWidth(*args, **kwargs):
c24da6d6 8903 """GetDefaultMarginWidth() -> int"""
d55e5bfc
RD
8904 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8905
8906 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
8907 def IsOwnerDrawn(*args, **kwargs):
8908 """IsOwnerDrawn(self) -> bool"""
8909 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
8910
8911 def SetOwnerDrawn(*args, **kwargs):
8912 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
8913 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
8914
8915 def ResetOwnerDrawn(*args, **kwargs):
8916 """ResetOwnerDrawn(self)"""
8917 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
8918
8919 def SetBitmap(*args, **kwargs):
8920 """SetBitmap(self, Bitmap bitmap)"""
8921 return _core_.MenuItem_SetBitmap(*args, **kwargs)
8922
8923 def GetBitmap(*args, **kwargs):
8924 """GetBitmap(self) -> Bitmap"""
8925 return _core_.MenuItem_GetBitmap(*args, **kwargs)
8926
8927
8928class MenuItemPtr(MenuItem):
8929 def __init__(self, this):
8930 self.this = this
8931 if not hasattr(self,"thisown"): self.thisown = 0
8932 self.__class__ = MenuItem
8933_core_.MenuItem_swigregister(MenuItemPtr)
8934
8935def MenuItem_GetLabelFromText(*args, **kwargs):
8936 """MenuItem_GetLabelFromText(String text) -> String"""
8937 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8938
8939def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8940 """MenuItem_GetDefaultMarginWidth() -> int"""
8941 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8942
8943#---------------------------------------------------------------------------
8944
8945class Control(Window):
8946 """
8947 This is the base class for a control or 'widget'.
8948
79fccf9d
RD
8949 A control is generally a small window which processes user input
8950 and/or displays one or more item of data.
d55e5bfc
RD
8951 """
8952 def __repr__(self):
8953 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8954 def __init__(self, *args, **kwargs):
8955 """
248ed943
RD
8956 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8957 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
8958 String name=ControlNameStr) -> Control
8959
79fccf9d
RD
8960 Create a Control. Normally you should only call this from a subclass'
8961 __init__ as a plain old wx.Control is not very useful.
d55e5bfc
RD
8962 """
8963 newobj = _core_.new_Control(*args, **kwargs)
8964 self.this = newobj.this
8965 self.thisown = 1
8966 del newobj.thisown
8967 self._setOORInfo(self)
8968
8969 def Create(*args, **kwargs):
8970 """
248ed943
RD
8971 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8972 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
8973 String name=ControlNameStr) -> bool
8974
8975 Do the 2nd phase and create the GUI control.
8976 """
8977 return _core_.Control_Create(*args, **kwargs)
8978
8979 def Command(*args, **kwargs):
8980 """
8981 Command(self, CommandEvent event)
8982
79fccf9d
RD
8983 Simulates the effect of the user issuing a command to the item.
8984
8985 :see: `wx.CommandEvent`
8986
d55e5bfc
RD
8987 """
8988 return _core_.Control_Command(*args, **kwargs)
8989
8990 def GetLabel(*args, **kwargs):
8991 """
8992 GetLabel(self) -> String
8993
8994 Return a control's text.
8995 """
8996 return _core_.Control_GetLabel(*args, **kwargs)
8997
8998 def SetLabel(*args, **kwargs):
8999 """
9000 SetLabel(self, String label)
9001
9002 Sets the item's text.
9003 """
9004 return _core_.Control_SetLabel(*args, **kwargs)
9005
a001823c 9006 def GetClassDefaultAttributes(*args, **kwargs):
f8167d6e 9007 """
a001823c 9008 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
f8167d6e 9009
a001823c
RD
9010 Get the default attributes for this class. This is useful if you want
9011 to use the same font or colour in your own control as in a standard
9012 control -- which is a much better idea than hard coding specific
9013 colours or fonts which might look completely out of place on the
9014 user's system, especially if it uses themes.
f8167d6e 9015
a001823c
RD
9016 The variant parameter is only relevant under Mac currently and is
9017 ignore under other platforms. Under Mac, it will change the size of
9018 the returned font. See `wx.Window.SetWindowVariant` for more about
9019 this.
f8167d6e 9020 """
d55e5bfc
RD
9021 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
9022
9023 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9024
9025class ControlPtr(Control):
9026 def __init__(self, this):
9027 self.this = this
9028 if not hasattr(self,"thisown"): self.thisown = 0
9029 self.__class__ = Control
9030_core_.Control_swigregister(ControlPtr)
9031ControlNameStr = cvar.ControlNameStr
9032
9033def PreControl(*args, **kwargs):
9034 """
9035 PreControl() -> Control
9036
9037 Precreate a Control control for 2-phase creation
9038 """
9039 val = _core_.new_PreControl(*args, **kwargs)
9040 val.thisown = 1
9041 return val
9042
9043def Control_GetClassDefaultAttributes(*args, **kwargs):
a001823c
RD
9044 """
9045 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9046
9047 Get the default attributes for this class. This is useful if you want
9048 to use the same font or colour in your own control as in a standard
9049 control -- which is a much better idea than hard coding specific
9050 colours or fonts which might look completely out of place on the
9051 user's system, especially if it uses themes.
9052
9053 The variant parameter is only relevant under Mac currently and is
9054 ignore under other platforms. Under Mac, it will change the size of
9055 the returned font. See `wx.Window.SetWindowVariant` for more about
9056 this.
9057 """
d55e5bfc
RD
9058 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
9059
9060#---------------------------------------------------------------------------
9061
9062class ItemContainer(object):
9063 """
53aa7709
RD
9064 The wx.ItemContainer class defines an interface which is implemented
9065 by all controls which have string subitems, each of which may be
9066 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
9067 as `wx.ComboBox` which implements an extended interface deriving from
79fccf9d 9068 this one.
d55e5bfc 9069
79fccf9d
RD
9070 It defines the methods for accessing the control's items and although
9071 each of the derived classes implements them differently, they still
9072 all conform to the same interface.
d55e5bfc 9073
79fccf9d
RD
9074 The items in a wx.ItemContainer have (non empty) string labels and,
9075 optionally, client data associated with them.
d55e5bfc
RD
9076
9077 """
9078 def __init__(self): raise RuntimeError, "No constructor defined"
9079 def __repr__(self):
9080 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9081 def Append(*args, **kwargs):
9082 """
9083 Append(self, String item, PyObject clientData=None) -> int
9084
79fccf9d
RD
9085 Adds the item to the control, associating the given data with the item
9086 if not None. The return value is the index of the newly added item
9087 which may be different from the last one if the control is sorted (e.g.
9088 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc
RD
9089 """
9090 return _core_.ItemContainer_Append(*args, **kwargs)
9091
9092 def AppendItems(*args, **kwargs):
9093 """
f5b96ee1 9094 AppendItems(self, List strings)
d55e5bfc 9095
79fccf9d
RD
9096 Apend several items at once to the control. Notice that calling this
9097 method may be much faster than appending the items one by one if you
9098 need to add a lot of items.
d55e5bfc
RD
9099 """
9100 return _core_.ItemContainer_AppendItems(*args, **kwargs)
9101
9102 def Insert(*args, **kwargs):
9103 """
9104 Insert(self, String item, int pos, PyObject clientData=None) -> int
9105
79fccf9d 9106 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
9107 optionally associating some data object with the item.
9108 """
9109 return _core_.ItemContainer_Insert(*args, **kwargs)
9110
9111 def Clear(*args, **kwargs):
9112 """
9113 Clear(self)
9114
9115 Removes all items from the control.
9116 """
9117 return _core_.ItemContainer_Clear(*args, **kwargs)
9118
9119 def Delete(*args, **kwargs):
9120 """
9121 Delete(self, int n)
9122
79fccf9d
RD
9123 Deletes the item at the zero-based index 'n' from the control. Note
9124 that it is an error (signalled by a `wx.PyAssertionError` exception if
9125 enabled) to remove an item with the index negative or greater or equal
9126 than the number of items in the control.
d55e5bfc
RD
9127 """
9128 return _core_.ItemContainer_Delete(*args, **kwargs)
9129
53aa7709
RD
9130 def GetClientData(*args, **kwargs):
9131 """
9132 GetClientData(self, int n) -> PyObject
9133
9134 Returns the client data associated with the given item, (if any.)
9135 """
9136 return _core_.ItemContainer_GetClientData(*args, **kwargs)
9137
9138 def SetClientData(*args, **kwargs):
9139 """
9140 SetClientData(self, int n, PyObject clientData)
9141
9142 Associate the given client data with the item at position n.
9143 """
9144 return _core_.ItemContainer_SetClientData(*args, **kwargs)
9145
d55e5bfc
RD
9146 def GetCount(*args, **kwargs):
9147 """
9148 GetCount(self) -> int
9149
9150 Returns the number of items in the control.
9151 """
9152 return _core_.ItemContainer_GetCount(*args, **kwargs)
9153
9154 def IsEmpty(*args, **kwargs):
9155 """
9156 IsEmpty(self) -> bool
9157
9158 Returns True if the control is empty or False if it has some items.
9159 """
9160 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
9161
9162 def GetString(*args, **kwargs):
9163 """
9164 GetString(self, int n) -> String
9165
9166 Returns the label of the item with the given index.
9167 """
9168 return _core_.ItemContainer_GetString(*args, **kwargs)
9169
9170 def GetStrings(*args, **kwargs):
9171 """GetStrings(self) -> wxArrayString"""
9172 return _core_.ItemContainer_GetStrings(*args, **kwargs)
9173
9174 def SetString(*args, **kwargs):
9175 """
9176 SetString(self, int n, String s)
9177
9178 Sets the label for the given item.
9179 """
9180 return _core_.ItemContainer_SetString(*args, **kwargs)
9181
9182 def FindString(*args, **kwargs):
9183 """
9184 FindString(self, String s) -> int
9185
9186 Finds an item whose label matches the given string. Returns the
79fccf9d
RD
9187 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
9188 found.
d55e5bfc
RD
9189 """
9190 return _core_.ItemContainer_FindString(*args, **kwargs)
9191
53aa7709 9192 def SetSelection(*args, **kwargs):
d55e5bfc 9193 """
53aa7709 9194 SetSelection(self, int n)
d55e5bfc
RD
9195
9196 Sets the item at index 'n' to be the selected item.
9197 """
53aa7709 9198 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 9199
d55e5bfc
RD
9200 def GetSelection(*args, **kwargs):
9201 """
9202 GetSelection(self) -> int
9203
79fccf9d
RD
9204 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
9205 is selected.
d55e5bfc
RD
9206 """
9207 return _core_.ItemContainer_GetSelection(*args, **kwargs)
9208
53aa7709
RD
9209 def SetStringSelection(*args, **kwargs):
9210 """SetStringSelection(self, String s) -> bool"""
9211 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
9212
d55e5bfc
RD
9213 def GetStringSelection(*args, **kwargs):
9214 """
9215 GetStringSelection(self) -> String
9216
79fccf9d
RD
9217 Returns the label of the selected item or an empty string if no item
9218 is selected.
d55e5bfc
RD
9219 """
9220 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
9221
53aa7709 9222 def Select(*args, **kwargs):
d55e5bfc 9223 """
53aa7709 9224 Select(self, int n)
d55e5bfc 9225
53aa7709
RD
9226 This is the same as `SetSelection` and exists only because it is
9227 slightly more natural for controls which support multiple selection.
d55e5bfc 9228 """
53aa7709 9229 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc
RD
9230
9231
9232class ItemContainerPtr(ItemContainer):
9233 def __init__(self, this):
9234 self.this = this
9235 if not hasattr(self,"thisown"): self.thisown = 0
9236 self.__class__ = ItemContainer
9237_core_.ItemContainer_swigregister(ItemContainerPtr)
9238
9239#---------------------------------------------------------------------------
9240
9241class ControlWithItems(Control,ItemContainer):
9242 """
79fccf9d
RD
9243 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
9244 wx.Control class, and is used for the base class of various controls
9245 that have items.
d55e5bfc
RD
9246 """
9247 def __init__(self): raise RuntimeError, "No constructor defined"
9248 def __repr__(self):
9249 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9250
9251class ControlWithItemsPtr(ControlWithItems):
9252 def __init__(self, this):
9253 self.this = this
9254 if not hasattr(self,"thisown"): self.thisown = 0
9255 self.__class__ = ControlWithItems
9256_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
9257
9258#---------------------------------------------------------------------------
9259
9260class SizerItem(Object):
248ed943
RD
9261 """
9262 The wx.SizerItem class is used to track the position, size and other
9263 attributes of each item managed by a `wx.Sizer`. In normal usage user
9264 code should never need to deal directly with a wx.SizerItem, but
9265 custom classes derived from `wx.PySizer` will probably need to use the
9266 collection of wx.SizerItems held by wx.Sizer when calculating layout.
9267
9268 :see: `wx.Sizer`, `wx.GBSizerItem`
9269 """
d55e5bfc
RD
9270 def __repr__(self):
9271 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9272 def __init__(self, *args, **kwargs):
248ed943
RD
9273 """
9274 __init__(self) -> SizerItem
9275
9276 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
9277 size will need to be set before this item can be used in a Sizer.
9278
9279 You will probably never need to create a wx.SizerItem directly as they
9280 are created automatically when the sizer's Add, Insert or Prepend
9281 methods are called.
9282
9283 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
9284 """
d55e5bfc
RD
9285 newobj = _core_.new_SizerItem(*args, **kwargs)
9286 self.this = newobj.this
9287 self.thisown = 1
9288 del newobj.thisown
9289 def DeleteWindows(*args, **kwargs):
248ed943
RD
9290 """
9291 DeleteWindows(self)
9292
9293 Destroy the window or the windows in a subsizer, depending on the type
9294 of item.
9295 """
d55e5bfc
RD
9296 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
9297
9298 def DetachSizer(*args, **kwargs):
248ed943
RD
9299 """
9300 DetachSizer(self)
9301
9302 Enable deleting the SizerItem without destroying the contained sizer.
9303 """
d55e5bfc
RD
9304 return _core_.SizerItem_DetachSizer(*args, **kwargs)
9305
9306 def GetSize(*args, **kwargs):
248ed943
RD
9307 """
9308 GetSize(self) -> Size
9309
9310 Get the current size of the item, as set in the last Layout.
9311 """
d55e5bfc
RD
9312 return _core_.SizerItem_GetSize(*args, **kwargs)
9313
9314 def CalcMin(*args, **kwargs):
248ed943
RD
9315 """
9316 CalcMin(self) -> Size
9317
9318 Calculates the minimum desired size for the item, including any space
9319 needed by borders.
9320 """
d55e5bfc
RD
9321 return _core_.SizerItem_CalcMin(*args, **kwargs)
9322
9323 def SetDimension(*args, **kwargs):
248ed943
RD
9324 """
9325 SetDimension(self, Point pos, Size size)
9326
9327 Set the position and size of the space allocated for this item by the
9328 sizer, and adjust the position and size of the item (window or
9329 subsizer) to be within that space taking alignment and borders into
9330 account.
9331 """
d55e5bfc
RD
9332 return _core_.SizerItem_SetDimension(*args, **kwargs)
9333
9334 def GetMinSize(*args, **kwargs):
248ed943
RD
9335 """
9336 GetMinSize(self) -> Size
9337
9338 Get the minimum size needed for the item.
9339 """
d55e5bfc
RD
9340 return _core_.SizerItem_GetMinSize(*args, **kwargs)
9341
a001823c
RD
9342 def GetMinSizeWithBorder(*args, **kwargs):
9343 """
9344 GetMinSizeWithBorder(self) -> Size
9345
9346 Get the minimum size needed for the item with space for the borders
9347 added, if needed.
9348 """
9349 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
9350
d55e5bfc
RD
9351 def SetInitSize(*args, **kwargs):
9352 """SetInitSize(self, int x, int y)"""
9353 return _core_.SizerItem_SetInitSize(*args, **kwargs)
9354
9355 def SetRatioWH(*args, **kwargs):
248ed943
RD
9356 """
9357 SetRatioWH(self, int width, int height)
9358
9359 Set the ratio item attribute.
9360 """
d55e5bfc
RD
9361 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
9362
9363 def SetRatioSize(*args, **kwargs):
248ed943
RD
9364 """
9365 SetRatioSize(self, Size size)
9366
9367 Set the ratio item attribute.
9368 """
d55e5bfc
RD
9369 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
9370
9371 def SetRatio(*args, **kwargs):
248ed943
RD
9372 """
9373 SetRatio(self, float ratio)
9374
9375 Set the ratio item attribute.
9376 """
d55e5bfc
RD
9377 return _core_.SizerItem_SetRatio(*args, **kwargs)
9378
9379 def GetRatio(*args, **kwargs):
248ed943
RD
9380 """
9381 GetRatio(self) -> float
9382
9383 Set the ratio item attribute.
9384 """
d55e5bfc
RD
9385 return _core_.SizerItem_GetRatio(*args, **kwargs)
9386
c1cb24a4
RD
9387 def GetRect(*args, **kwargs):
9388 """
9389 GetRect(self) -> Rect
9390
9391 Returns the rectangle that the sizer item should occupy
9392 """
9393 return _core_.SizerItem_GetRect(*args, **kwargs)
9394
d55e5bfc 9395 def IsWindow(*args, **kwargs):
248ed943
RD
9396 """
9397 IsWindow(self) -> bool
9398
9399 Is this sizer item a window?
9400 """
d55e5bfc
RD
9401 return _core_.SizerItem_IsWindow(*args, **kwargs)
9402
9403 def IsSizer(*args, **kwargs):
248ed943
RD
9404 """
9405 IsSizer(self) -> bool
9406
9407 Is this sizer item a subsizer?
9408 """
d55e5bfc
RD
9409 return _core_.SizerItem_IsSizer(*args, **kwargs)
9410
9411 def IsSpacer(*args, **kwargs):
248ed943
RD
9412 """
9413 IsSpacer(self) -> bool
9414
9415 Is this sizer item a spacer?
9416 """
d55e5bfc
RD
9417 return _core_.SizerItem_IsSpacer(*args, **kwargs)
9418
9419 def SetProportion(*args, **kwargs):
248ed943
RD
9420 """
9421 SetProportion(self, int proportion)
9422
9423 Set the proportion value for this item.
9424 """
d55e5bfc
RD
9425 return _core_.SizerItem_SetProportion(*args, **kwargs)
9426
9427 def GetProportion(*args, **kwargs):
248ed943
RD
9428 """
9429 GetProportion(self) -> int
9430
9431 Get the proportion value for this item.
9432 """
d55e5bfc
RD
9433 return _core_.SizerItem_GetProportion(*args, **kwargs)
9434
248ed943
RD
9435 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
9436 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 9437 def SetFlag(*args, **kwargs):
248ed943
RD
9438 """
9439 SetFlag(self, int flag)
9440
9441 Set the flag value for this item.
9442 """
d55e5bfc
RD
9443 return _core_.SizerItem_SetFlag(*args, **kwargs)
9444
9445 def GetFlag(*args, **kwargs):
248ed943
RD
9446 """
9447 GetFlag(self) -> int
9448
9449 Get the flag value for this item.
9450 """
d55e5bfc
RD
9451 return _core_.SizerItem_GetFlag(*args, **kwargs)
9452
9453 def SetBorder(*args, **kwargs):
248ed943
RD
9454 """
9455 SetBorder(self, int border)
9456
9457 Set the border value for this item.
9458 """
d55e5bfc
RD
9459 return _core_.SizerItem_SetBorder(*args, **kwargs)
9460
9461 def GetBorder(*args, **kwargs):
248ed943
RD
9462 """
9463 GetBorder(self) -> int
9464
9465 Get the border value for this item.
9466 """
d55e5bfc
RD
9467 return _core_.SizerItem_GetBorder(*args, **kwargs)
9468
9469 def GetWindow(*args, **kwargs):
248ed943
RD
9470 """
9471 GetWindow(self) -> Window
9472
9473 Get the window (if any) that is managed by this sizer item.
9474 """
d55e5bfc
RD
9475 return _core_.SizerItem_GetWindow(*args, **kwargs)
9476
9477 def SetWindow(*args, **kwargs):
248ed943
RD
9478 """
9479 SetWindow(self, Window window)
9480
9481 Set the window to be managed by this sizer item.
9482 """
d55e5bfc
RD
9483 return _core_.SizerItem_SetWindow(*args, **kwargs)
9484
9485 def GetSizer(*args, **kwargs):
248ed943
RD
9486 """
9487 GetSizer(self) -> Sizer
9488
9489 Get the subsizer (if any) that is managed by this sizer item.
9490 """
d55e5bfc
RD
9491 return _core_.SizerItem_GetSizer(*args, **kwargs)
9492
9493 def SetSizer(*args, **kwargs):
248ed943
RD
9494 """
9495 SetSizer(self, Sizer sizer)
9496
9497 Set the subsizer to be managed by this sizer item.
9498 """
d55e5bfc
RD
9499 return _core_.SizerItem_SetSizer(*args, **kwargs)
9500
9501 def GetSpacer(*args, **kwargs):
248ed943
RD
9502 """
9503 GetSpacer(self) -> Size
9504
9505 Get the size of the spacer managed by this sizer item.
9506 """
d55e5bfc
RD
9507 return _core_.SizerItem_GetSpacer(*args, **kwargs)
9508
9509 def SetSpacer(*args, **kwargs):
248ed943
RD
9510 """
9511 SetSpacer(self, Size size)
9512
9513 Set the size of the spacer to be managed by this sizer item.
9514 """
d55e5bfc
RD
9515 return _core_.SizerItem_SetSpacer(*args, **kwargs)
9516
9517 def Show(*args, **kwargs):
248ed943
RD
9518 """
9519 Show(self, bool show)
9520
9521 Set the show item attribute, which sizers use to determine if the item
9522 is to be made part of the layout or not. If the item is tracking a
9523 window then it is shown or hidden as needed.
9524 """
d55e5bfc
RD
9525 return _core_.SizerItem_Show(*args, **kwargs)
9526
9527 def IsShown(*args, **kwargs):
248ed943
RD
9528 """
9529 IsShown(self) -> bool
9530
9531 Is the item to be shown in the layout?
9532 """
d55e5bfc
RD
9533 return _core_.SizerItem_IsShown(*args, **kwargs)
9534
9535 def GetPosition(*args, **kwargs):
248ed943
RD
9536 """
9537 GetPosition(self) -> Point
9538
9539 Returns the current position of the item, as set in the last Layout.
9540 """
d55e5bfc
RD
9541 return _core_.SizerItem_GetPosition(*args, **kwargs)
9542
9543 def GetUserData(*args, **kwargs):
248ed943
RD
9544 """
9545 GetUserData(self) -> PyObject
9546
9547 Returns the userData associated with this sizer item, or None if there
9548 isn't any.
9549 """
d55e5bfc
RD
9550 return _core_.SizerItem_GetUserData(*args, **kwargs)
9551
9552
9553class SizerItemPtr(SizerItem):
9554 def __init__(self, this):
9555 self.this = this
9556 if not hasattr(self,"thisown"): self.thisown = 0
9557 self.__class__ = SizerItem
9558_core_.SizerItem_swigregister(SizerItemPtr)
9559
248ed943 9560def SizerItemWindow(*args, **kwargs):
d55e5bfc 9561 """
248ed943
RD
9562 SizerItemWindow(Window window, int proportion, int flag, int border,
9563 PyObject userData=None) -> SizerItem
9564
9565 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 9566 """
248ed943 9567 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
9568 val.thisown = 1
9569 return val
9570
248ed943 9571def SizerItemSpacer(*args, **kwargs):
d55e5bfc 9572 """
248ed943
RD
9573 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
9574 PyObject userData=None) -> SizerItem
9575
9576 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 9577 """
248ed943 9578 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
9579 val.thisown = 1
9580 return val
9581
9582def SizerItemSizer(*args, **kwargs):
9583 """
9584 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
9585 PyObject userData=None) -> SizerItem
9586
9587 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc
RD
9588 """
9589 val = _core_.new_SizerItemSizer(*args, **kwargs)
9590 val.thisown = 1
9591 return val
9592
9593class Sizer(Object):
248ed943
RD
9594 """
9595 wx.Sizer is the abstract base class used for laying out subwindows in
9596 a window. You cannot use wx.Sizer directly; instead, you will have to
9597 use one of the sizer classes derived from it such as `wx.BoxSizer`,
9598 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
9599 and `wx.GridBagSizer`.
9600
9601 The concept implemented by sizers in wxWidgets is closely related to
9602 layout tools in other GUI toolkits, such as Java's AWT, the GTK
9603 toolkit or the Qt toolkit. It is based upon the idea of the individual
9604 subwindows reporting their minimal required size and their ability to
9605 get stretched if the size of the parent window has changed. This will
9606 most often mean that the programmer does not set the original size of
9607 a dialog in the beginning, rather the dialog will assigned a sizer and
9608 this sizer will be queried about the recommended size. The sizer in
9609 turn will query its children, which can be normal windows or contorls,
9610 empty space or other sizers, so that a hierarchy of sizers can be
9611 constructed. Note that wxSizer does not derive from wxWindow and thus
9612 do not interfere with tab ordering and requires very little resources
9613 compared to a real window on screen.
9614
9615 What makes sizers so well fitted for use in wxWidgets is the fact that
9616 every control reports its own minimal size and the algorithm can
9617 handle differences in font sizes or different window (dialog item)
9618 sizes on different platforms without problems. If for example the
9619 standard font as well as the overall design of Mac widgets requires
9620 more space than on Windows, then the initial size of a dialog using a
9621 sizer will automatically be bigger on Mac than on Windows.
9622 """
d55e5bfc
RD
9623 def __init__(self): raise RuntimeError, "No constructor defined"
9624 def __repr__(self):
9625 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9626 def _setOORInfo(*args, **kwargs):
9627 """_setOORInfo(self, PyObject _self)"""
9628 return _core_.Sizer__setOORInfo(*args, **kwargs)
9629
9630 def Add(*args, **kwargs):
9631 """
248ed943 9632 Add(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 9633 PyObject userData=None) -> wx.SizerItem
248ed943
RD
9634
9635 Appends a child item to the sizer.
d55e5bfc
RD
9636 """
9637 return _core_.Sizer_Add(*args, **kwargs)
9638
9639 def Insert(*args, **kwargs):
9640 """
248ed943 9641 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 9642 PyObject userData=None) -> wx.SizerItem
248ed943
RD
9643
9644 Inserts a new item into the list of items managed by this sizer before
9645 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc
RD
9646 """
9647 return _core_.Sizer_Insert(*args, **kwargs)
9648
9649 def Prepend(*args, **kwargs):
9650 """
248ed943 9651 Prepend(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 9652 PyObject userData=None) -> wx.SizerItem
248ed943
RD
9653
9654 Adds a new item to the begining of the list of sizer items managed by
9655 this sizer. See `Add` for a description of the parameters.
d55e5bfc
RD
9656 """
9657 return _core_.Sizer_Prepend(*args, **kwargs)
9658
9659 def Remove(*args, **kwargs):
248ed943
RD
9660 """
9661 Remove(self, item) -> bool
9662
9663 Removes an item from the sizer and destroys it. This method does not
9664 cause any layout or resizing to take place, call `Layout` to update
9665 the layout on screen after removing a child from the sizer. The
9666 *item* parameter can be either a window, a sizer, or the zero-based
9667 index of an item to remove. Returns True if the child item was found
9668 and removed.
9669 """
d55e5bfc
RD
9670 return _core_.Sizer_Remove(*args, **kwargs)
9671
1a6bba1e 9672 def Detach(*args, **kwargs):
248ed943
RD
9673 """
9674 Detach(self, item) -> bool
9675
9676 Detaches an item from the sizer without destroying it. This method
9677 does not cause any layout or resizing to take place, call `Layout` to
9678 do so. The *item* parameter can be either a window, a sizer, or the
9679 zero-based index of the item to be detached. Returns True if the child item
9680 was found and detached.
9681 """
1a6bba1e
RD
9682 return _core_.Sizer_Detach(*args, **kwargs)
9683
c1cb24a4
RD
9684 def GetItem(*args, **kwargs):
9685 """
9686 GetItem(self, item) -> wx.SizerItem
9687
9688 Returns the `wx.SizerItem` which holds the *item* given. The *item*
9689 parameter can be either a window, a sizer, or the zero-based index of
9690 the item to be detached.
9691 """
9692 return _core_.Sizer_GetItem(*args, **kwargs)
9693
d55e5bfc
RD
9694 def _SetItemMinSize(*args, **kwargs):
9695 """_SetItemMinSize(self, PyObject item, Size size)"""
9696 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
9697
248ed943
RD
9698 def SetItemMinSize(self, item, *args):
9699 """
9700 SetItemMinSize(self, item, Size size)
9701
9702 Sets the minimum size that will be allocated for an item in the sizer.
9703 The *item* parameter can be either a window, a sizer, or the
9704 zero-based index of the item. If a window or sizer is given then it
9705 will be searched for recursivly in subsizers if neccessary.
9706 """
9707 if len(args) == 2:
9708 # for backward compatibility accept separate width,height args too
9709 return self._SetItemMinSize(item, args)
9710 else:
9711 return self._SetItemMinSize(item, args[0])
9712
d55e5bfc 9713 def AddItem(*args, **kwargs):
248ed943
RD
9714 """
9715 AddItem(self, SizerItem item)
9716
9717 Adds a `wx.SizerItem` to the sizer.
9718 """
d55e5bfc
RD
9719 return _core_.Sizer_AddItem(*args, **kwargs)
9720
9721 def InsertItem(*args, **kwargs):
248ed943
RD
9722 """
9723 InsertItem(self, int index, SizerItem item)
9724
9725 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
9726 """
d55e5bfc
RD
9727 return _core_.Sizer_InsertItem(*args, **kwargs)
9728
9729 def PrependItem(*args, **kwargs):
248ed943
RD
9730 """
9731 PrependItem(self, SizerItem item)
9732
9733 Prepends a `wx.SizerItem` to the sizer.
9734 """
d55e5bfc
RD
9735 return _core_.Sizer_PrependItem(*args, **kwargs)
9736
248ed943 9737 def AddMany(self, items):
c24da6d6
RD
9738 """
9739 AddMany is a convenience method for adding several items
9740 to a sizer at one time. Simply pass it a list of tuples,
9741 where each tuple consists of the parameters that you
9742 would normally pass to the `Add` method.
9743 """
248ed943
RD
9744 for item in items:
9745 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
9746 item = (item, )
9747 self.Add(*item)
d55e5bfc
RD
9748
9749 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
9750 def AddWindow(self, *args, **kw):
9751 """Compatibility alias for `Add`."""
9752 return self.Add(*args, **kw)
9753 def AddSizer(self, *args, **kw):
9754 """Compatibility alias for `Add`."""
9755 return self.Add(*args, **kw)
9756 def AddSpacer(self, *args, **kw):
9757 """Compatibility alias for `Add`."""
9758 return self.Add(*args, **kw)
9759
9760 def PrependWindow(self, *args, **kw):
9761 """Compatibility alias for `Prepend`."""
9762 return self.Prepend(*args, **kw)
9763 def PrependSizer(self, *args, **kw):
9764 """Compatibility alias for `Prepend`."""
9765 return self.Prepend(*args, **kw)
9766 def PrependSpacer(self, *args, **kw):
9767 """Compatibility alias for `Prepend`."""
9768 return self.Prepend(*args, **kw)
9769
9770 def InsertWindow(self, *args, **kw):
9771 """Compatibility alias for `Insert`."""
9772 return self.Insert(*args, **kw)
9773 def InsertSizer(self, *args, **kw):
9774 """Compatibility alias for `Insert`."""
9775 return self.Insert(*args, **kw)
9776 def InsertSpacer(self, *args, **kw):
9777 """Compatibility alias for `Insert`."""
9778 return self.Insert(*args, **kw)
9779
9780 def RemoveWindow(self, *args, **kw):
9781 """Compatibility alias for `Remove`."""
9782 return self.Remove(*args, **kw)
9783 def RemoveSizer(self, *args, **kw):
9784 """Compatibility alias for `Remove`."""
9785 return self.Remove(*args, **kw)
9786 def RemovePos(self, *args, **kw):
9787 """Compatibility alias for `Remove`."""
9788 return self.Remove(*args, **kw)
d55e5bfc
RD
9789
9790
d55e5bfc 9791 def SetDimension(*args, **kwargs):
248ed943
RD
9792 """
9793 SetDimension(self, int x, int y, int width, int height)
9794
9795 Call this to force the sizer to take the given dimension and thus
9796 force the items owned by the sizer to resize themselves according to
9797 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
9798 methods.
9799 """
d55e5bfc
RD
9800 return _core_.Sizer_SetDimension(*args, **kwargs)
9801
9802 def SetMinSize(*args, **kwargs):
248ed943
RD
9803 """
9804 SetMinSize(self, Size size)
9805
9806 Call this to give the sizer a minimal size. Normally, the sizer will
9807 calculate its minimal size based purely on how much space its children
9808 need. After calling this method `GetMinSize` will return either the
9809 minimal size as requested by its children or the minimal size set
9810 here, depending on which is bigger.
9811 """
d55e5bfc
RD
9812 return _core_.Sizer_SetMinSize(*args, **kwargs)
9813
9814 def GetSize(*args, **kwargs):
248ed943
RD
9815 """
9816 GetSize(self) -> Size
9817
9818 Returns the current size of the space managed by the sizer.
9819 """
d55e5bfc
RD
9820 return _core_.Sizer_GetSize(*args, **kwargs)
9821
9822 def GetPosition(*args, **kwargs):
248ed943
RD
9823 """
9824 GetPosition(self) -> Point
9825
9826 Returns the current position of the sizer's managed space.
9827 """
d55e5bfc
RD
9828 return _core_.Sizer_GetPosition(*args, **kwargs)
9829
9830 def GetMinSize(*args, **kwargs):
248ed943
RD
9831 """
9832 GetMinSize(self) -> Size
9833
9834 Returns the minimal size of the sizer. This is either the combined
9835 minimal size of all the children and their borders or the minimal size
9836 set by SetMinSize, depending on which is bigger.
9837 """
d55e5bfc
RD
9838 return _core_.Sizer_GetMinSize(*args, **kwargs)
9839
9840 def GetSizeTuple(self):
1a6bba1e 9841 return self.GetSize().Get()
d55e5bfc 9842 def GetPositionTuple(self):
1a6bba1e 9843 return self.GetPosition().Get()
d55e5bfc 9844 def GetMinSizeTuple(self):
1a6bba1e 9845 return self.GetMinSize().Get()
d55e5bfc
RD
9846
9847 def RecalcSizes(*args, **kwargs):
248ed943
RD
9848 """
9849 RecalcSizes(self)
9850
9851 Using the sizes calculated by `CalcMin` reposition and resize all the
9852 items managed by this sizer. You should not need to call this directly as
9853 it is called by `Layout`.
9854 """
d55e5bfc
RD
9855 return _core_.Sizer_RecalcSizes(*args, **kwargs)
9856
9857 def CalcMin(*args, **kwargs):
248ed943
RD
9858 """
9859 CalcMin(self) -> Size
9860
9861 This method is where the sizer will do the actual calculation of its
9862 children's minimal sizes. You should not need to call this directly as
9863 it is called by `Layout`.
9864 """
d55e5bfc
RD
9865 return _core_.Sizer_CalcMin(*args, **kwargs)
9866
9867 def Layout(*args, **kwargs):
248ed943
RD
9868 """
9869 Layout(self)
9870
9871 This method will force the recalculation and layout of the items
9872 controlled by the sizer using the current space allocated to the
9873 sizer. Normally this is called automatically from the owning window's
9874 EVT_SIZE handler, but it is also useful to call it from user code when
9875 one of the items in a sizer change size, or items are added or
9876 removed.
9877 """
d55e5bfc
RD
9878 return _core_.Sizer_Layout(*args, **kwargs)
9879
9880 def Fit(*args, **kwargs):
248ed943
RD
9881 """
9882 Fit(self, Window window) -> Size
9883
9884 Tell the sizer to resize the *window* to match the sizer's minimal
9885 size. This is commonly done in the constructor of the window itself in
9886 order to set its initial size to match the needs of the children as
9887 determined by the sizer. Returns the new size.
9888
9889 For a top level window this is the total window size, not the client size.
9890 """
d55e5bfc
RD
9891 return _core_.Sizer_Fit(*args, **kwargs)
9892
9893 def FitInside(*args, **kwargs):
248ed943
RD
9894 """
9895 FitInside(self, Window window)
9896
9897 Tell the sizer to resize the *virtual size* of the *window* to match the
9898 sizer's minimal size. This will not alter the on screen size of the
9899 window, but may cause the addition/removal/alteration of scrollbars
9900 required to view the virtual area in windows which manage it.
9901
9902 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9903
9904 """
d55e5bfc
RD
9905 return _core_.Sizer_FitInside(*args, **kwargs)
9906
9907 def SetSizeHints(*args, **kwargs):
248ed943
RD
9908 """
9909 SetSizeHints(self, Window window)
9910
9911 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9912 match the sizer's minimal size. This is commonly done in the
9913 constructor of the window itself if the window is resizable (as are
9914 many dialogs under Unix and frames on probably all platforms) in order
9915 to prevent the window from being sized smaller than the minimal size
9916 required by the sizer.
9917 """
d55e5bfc
RD
9918 return _core_.Sizer_SetSizeHints(*args, **kwargs)
9919
9920 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
9921 """
9922 SetVirtualSizeHints(self, Window window)
9923
9924 Tell the sizer to set the minimal size of the window virtual area to
9925 match the sizer's minimal size. For windows with managed scrollbars
9926 this will set them appropriately.
9927
9928 :see: `wx.ScrolledWindow.SetScrollbars`
9929
9930 """
d55e5bfc
RD
9931 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
9932
9933 def Clear(*args, **kwargs):
248ed943
RD
9934 """
9935 Clear(self, bool deleteWindows=False)
9936
9937 Clear all items from the sizer, optionally destroying the window items
9938 as well.
9939 """
d55e5bfc
RD
9940 return _core_.Sizer_Clear(*args, **kwargs)
9941
9942 def DeleteWindows(*args, **kwargs):
248ed943
RD
9943 """
9944 DeleteWindows(self)
9945
9946 Destroy all windows managed by the sizer.
9947 """
d55e5bfc
RD
9948 return _core_.Sizer_DeleteWindows(*args, **kwargs)
9949
9950 def GetChildren(*args, **kwargs):
248ed943 9951 """
51b83b37 9952 GetChildren(self) -> list
248ed943
RD
9953
9954 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9955 """
d55e5bfc
RD
9956 return _core_.Sizer_GetChildren(*args, **kwargs)
9957
9958 def Show(*args, **kwargs):
248ed943 9959 """
ae8162c8 9960 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 9961
248ed943
RD
9962 Shows or hides an item managed by the sizer. To make a sizer item
9963 disappear or reappear, use Show followed by `Layout`. The *item*
9964 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
9965 the item. Use the recursive parameter to show or hide an item in a
9966 subsizer. Returns True if the item was found.
248ed943
RD
9967 """
9968 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
9969
9970 def IsShown(*args, **kwargs):
248ed943
RD
9971 """
9972 IsShown(self, item)
9973
9974 Determines if the item is currently shown. sizer. To make a sizer
9975 item disappear or reappear, use Show followed by `Layout`. The *item*
9976 parameter can be either a window, a sizer, or the zero-based index of
9977 the item.
9978 """
d55e5bfc
RD
9979 return _core_.Sizer_IsShown(*args, **kwargs)
9980
629e65c2 9981 def Hide(self, item, recursive=False):
248ed943 9982 """
88c6b281 9983 A convenience method for `Show`(item, False, recursive).
248ed943 9984 """
06759a38 9985 return self.Show(item, False, recursive)
248ed943 9986
d55e5bfc 9987 def ShowItems(*args, **kwargs):
248ed943
RD
9988 """
9989 ShowItems(self, bool show)
9990
84f85550 9991 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 9992 """
d55e5bfc
RD
9993 return _core_.Sizer_ShowItems(*args, **kwargs)
9994
9995
9996class SizerPtr(Sizer):
9997 def __init__(self, this):
9998 self.this = this
9999 if not hasattr(self,"thisown"): self.thisown = 0
10000 self.__class__ = Sizer
10001_core_.Sizer_swigregister(SizerPtr)
10002
10003class PySizer(Sizer):
248ed943
RD
10004 """
10005 wx.PySizer is a special version of `wx.Sizer` that has been
10006 instrumented to allow the C++ virtual methods to be overloaded in
10007 Python derived classes. You would derive from this class if you are
10008 wanting to implement a custom sizer in Python code. Simply implement
10009 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
10010 For example::
10011
10012 class MySizer(wx.PySizer):
10013 def __init__(self):
10014 wx.PySizer.__init__(self)
10015
10016 def CalcMin(self):
10017 for item in self.GetChildren():
10018 # calculate the total minimum width and height needed
10019 # by all items in the sizer according to this sizer's
10020 # layout algorithm.
10021 ...
10022 return wx.Size(width, height)
10023
10024 def RecalcSizes(self):
10025 # find the space allotted to this sizer
10026 pos = self.GetPosition()
10027 size = self.GetSize()
10028 for item in self.GetChildren():
10029 # Recalculate (if necessary) the position and size of
10030 # each item and then call item.SetDimension to do the
10031 # actual positioning and sizing of the items within the
10032 # space alloted to this sizer.
10033 ...
10034 item.SetDimension(itemPos, itemSize)
10035
10036
10037 When `Layout` is called it first calls `CalcMin` followed by
10038 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 10039 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
10040
10041 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
10042
10043
10044 """
d55e5bfc
RD
10045 def __repr__(self):
10046 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10047 def __init__(self, *args, **kwargs):
248ed943
RD
10048 """
10049 __init__(self) -> PySizer
10050
10051 Creates a wx.PySizer. Must be called from the __init__ in the derived
10052 class.
10053 """
d55e5bfc
RD
10054 newobj = _core_.new_PySizer(*args, **kwargs)
10055 self.this = newobj.this
10056 self.thisown = 1
10057 del newobj.thisown
10058 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
10059
10060 def _setCallbackInfo(*args, **kwargs):
10061 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
10062 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
10063
10064
10065class PySizerPtr(PySizer):
10066 def __init__(self, this):
10067 self.this = this
10068 if not hasattr(self,"thisown"): self.thisown = 0
10069 self.__class__ = PySizer
10070_core_.PySizer_swigregister(PySizerPtr)
10071
10072#---------------------------------------------------------------------------
10073
10074class BoxSizer(Sizer):
248ed943
RD
10075 """
10076 The basic idea behind a box sizer is that windows will most often be
10077 laid out in rather simple basic geometry, typically in a row or a
10078 column or nested hierarchies of either. A wx.BoxSizer will lay out
10079 its items in a simple row or column, depending on the orientation
10080 parameter passed to the constructor.
10081 """
d55e5bfc
RD
10082 def __repr__(self):
10083 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10084 def __init__(self, *args, **kwargs):
248ed943
RD
10085 """
10086 __init__(self, int orient=HORIZONTAL) -> BoxSizer
10087
10088 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
10089 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
10090 sizer.
10091 """
d55e5bfc
RD
10092 newobj = _core_.new_BoxSizer(*args, **kwargs)
10093 self.this = newobj.this
10094 self.thisown = 1
10095 del newobj.thisown
10096 self._setOORInfo(self)
10097
10098 def GetOrientation(*args, **kwargs):
248ed943
RD
10099 """
10100 GetOrientation(self) -> int
10101
10102 Returns the current orientation of the sizer.
10103 """
d55e5bfc
RD
10104 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
10105
10106 def SetOrientation(*args, **kwargs):
248ed943
RD
10107 """
10108 SetOrientation(self, int orient)
d55e5bfc 10109
248ed943
RD
10110 Resets the orientation of the sizer.
10111 """
10112 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc
RD
10113
10114
10115class BoxSizerPtr(BoxSizer):
10116 def __init__(self, this):
10117 self.this = this
10118 if not hasattr(self,"thisown"): self.thisown = 0
10119 self.__class__ = BoxSizer
10120_core_.BoxSizer_swigregister(BoxSizerPtr)
10121
10122#---------------------------------------------------------------------------
10123
10124class StaticBoxSizer(BoxSizer):
248ed943
RD
10125 """
10126 wx.StaticBoxSizer derives from and functions identically to the
10127 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
10128 manages. Note that this static box must be created separately and
10129 passed to the sizer constructor.
10130 """
d55e5bfc
RD
10131 def __repr__(self):
10132 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10133 def __init__(self, *args, **kwargs):
248ed943
RD
10134 """
10135 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
10136
10137 Constructor. It takes an associated static box and the orientation
10138 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
10139 ``wx.HORIZONTAL``.
10140 """
d55e5bfc
RD
10141 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
10142 self.this = newobj.this
10143 self.thisown = 1
10144 del newobj.thisown
10145 self._setOORInfo(self)
10146
10147 def GetStaticBox(*args, **kwargs):
248ed943
RD
10148 """
10149 GetStaticBox(self) -> StaticBox
d55e5bfc 10150
248ed943
RD
10151 Returns the static box associated with this sizer.
10152 """
10153 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc
RD
10154
10155
10156class StaticBoxSizerPtr(StaticBoxSizer):
10157 def __init__(self, this):
10158 self.this = this
10159 if not hasattr(self,"thisown"): self.thisown = 0
10160 self.__class__ = StaticBoxSizer
10161_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
10162
10163#---------------------------------------------------------------------------
10164
10165class GridSizer(Sizer):
248ed943
RD
10166 """
10167 A grid sizer is a sizer which lays out its children in a
10168 two-dimensional table with all cells having the same size. In other
10169 words, the width of each cell within the grid is the width of the
10170 widest item added to the sizer and the height of each grid cell is the
10171 height of the tallest item. An optional vertical and/or horizontal
10172 gap between items can also be specified (in pixels.)
10173
10174 Items are placed in the cells of the grid in the order they are added,
10175 in row-major order. In other words, the first row is filled first,
10176 then the second, and so on until all items have been added. (If
10177 neccessary, additional rows will be added as items are added.) If you
10178 need to have greater control over the cells that items are placed in
10179 then use the `wx.GridBagSizer`.
10180
10181 """
d55e5bfc
RD
10182 def __repr__(self):
10183 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10184 def __init__(self, *args, **kwargs):
248ed943
RD
10185 """
10186 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
10187
10188 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
10189 of columns and rows in the sizer - if either of the parameters is
10190 zero, it will be calculated to from the total number of children in
10191 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
10192 define extra space between all children.
10193 """
d55e5bfc
RD
10194 newobj = _core_.new_GridSizer(*args, **kwargs)
10195 self.this = newobj.this
10196 self.thisown = 1
10197 del newobj.thisown
10198 self._setOORInfo(self)
10199
d55e5bfc 10200 def SetCols(*args, **kwargs):
248ed943
RD
10201 """
10202 SetCols(self, int cols)
10203
10204 Sets the number of columns in the sizer.
10205 """
d55e5bfc
RD
10206 return _core_.GridSizer_SetCols(*args, **kwargs)
10207
10208 def SetRows(*args, **kwargs):
248ed943
RD
10209 """
10210 SetRows(self, int rows)
10211
10212 Sets the number of rows in the sizer.
10213 """
d55e5bfc
RD
10214 return _core_.GridSizer_SetRows(*args, **kwargs)
10215
10216 def SetVGap(*args, **kwargs):
248ed943
RD
10217 """
10218 SetVGap(self, int gap)
10219
10220 Sets the vertical gap (in pixels) between the cells in the sizer.
10221 """
d55e5bfc
RD
10222 return _core_.GridSizer_SetVGap(*args, **kwargs)
10223
10224 def SetHGap(*args, **kwargs):
248ed943
RD
10225 """
10226 SetHGap(self, int gap)
10227
10228 Sets the horizontal gap (in pixels) between cells in the sizer
10229 """
d55e5bfc
RD
10230 return _core_.GridSizer_SetHGap(*args, **kwargs)
10231
10232 def GetCols(*args, **kwargs):
248ed943
RD
10233 """
10234 GetCols(self) -> int
10235
10236 Returns the number of columns in the sizer.
10237 """
d55e5bfc
RD
10238 return _core_.GridSizer_GetCols(*args, **kwargs)
10239
10240 def GetRows(*args, **kwargs):
248ed943
RD
10241 """
10242 GetRows(self) -> int
10243
10244 Returns the number of rows in the sizer.
10245 """
d55e5bfc
RD
10246 return _core_.GridSizer_GetRows(*args, **kwargs)
10247
10248 def GetVGap(*args, **kwargs):
248ed943
RD
10249 """
10250 GetVGap(self) -> int
10251
10252 Returns the vertical gap (in pixels) between the cells in the sizer.
10253 """
d55e5bfc
RD
10254 return _core_.GridSizer_GetVGap(*args, **kwargs)
10255
10256 def GetHGap(*args, **kwargs):
248ed943
RD
10257 """
10258 GetHGap(self) -> int
10259
10260 Returns the horizontal gap (in pixels) between cells in the sizer.
10261 """
d55e5bfc
RD
10262 return _core_.GridSizer_GetHGap(*args, **kwargs)
10263
10264
10265class GridSizerPtr(GridSizer):
10266 def __init__(self, this):
10267 self.this = this
10268 if not hasattr(self,"thisown"): self.thisown = 0
10269 self.__class__ = GridSizer
10270_core_.GridSizer_swigregister(GridSizerPtr)
10271
10272#---------------------------------------------------------------------------
10273
10274FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
10275FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
10276FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
10277class FlexGridSizer(GridSizer):
248ed943
RD
10278 """
10279 A flex grid sizer is a sizer which lays out its children in a
10280 two-dimensional table with all table cells in one row having the same
10281 height and all cells in one column having the same width, but all
10282 rows or all columns are not necessarily the same height or width as in
10283 the `wx.GridSizer`.
10284
10285 wx.FlexGridSizer can also size items equally in one direction but
10286 unequally ("flexibly") in the other. If the sizer is only flexible
10287 in one direction (this can be changed using `SetFlexibleDirection`), it
10288 needs to be decided how the sizer should grow in the other ("non
10289 flexible") direction in order to fill the available space. The
10290 `SetNonFlexibleGrowMode` method serves this purpose.
10291
10292
10293 """
d55e5bfc
RD
10294 def __repr__(self):
10295 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10296 def __init__(self, *args, **kwargs):
248ed943
RD
10297 """
10298 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
10299
10300 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
10301 number of columns and rows in the sizer - if either of the parameters
10302 is zero, it will be calculated to from the total number of children in
10303 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
10304 define extra space between all children.
10305 """
d55e5bfc
RD
10306 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
10307 self.this = newobj.this
10308 self.thisown = 1
10309 del newobj.thisown
10310 self._setOORInfo(self)
10311
248ed943
RD
10312 def AddGrowableRow(*args, **kwargs):
10313 """
10314 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 10315
248ed943
RD
10316 Specifies that row *idx* (starting from zero) should be grown if there
10317 is extra space available to the sizer.
d55e5bfc 10318
248ed943
RD
10319 The *proportion* parameter has the same meaning as the stretch factor
10320 for the box sizers except that if all proportions are 0, then all
10321 columns are resized equally (instead of not being resized at all).
10322 """
d55e5bfc
RD
10323 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
10324
10325 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
10326 """
10327 RemoveGrowableRow(self, size_t idx)
10328
10329 Specifies that row *idx* is no longer growable.
10330 """
d55e5bfc
RD
10331 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
10332
10333 def AddGrowableCol(*args, **kwargs):
248ed943
RD
10334 """
10335 AddGrowableCol(self, size_t idx, int proportion=0)
10336
10337 Specifies that column *idx* (starting from zero) should be grown if
10338 there is extra space available to the sizer.
10339
10340 The *proportion* parameter has the same meaning as the stretch factor
10341 for the box sizers except that if all proportions are 0, then all
10342 columns are resized equally (instead of not being resized at all).
10343 """
d55e5bfc
RD
10344 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
10345
10346 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
10347 """
10348 RemoveGrowableCol(self, size_t idx)
10349
10350 Specifies that column *idx* is no longer growable.
10351 """
d55e5bfc
RD
10352 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
10353
10354 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
10355 """
10356 SetFlexibleDirection(self, int direction)
10357
10358 Specifies whether the sizer should flexibly resize its columns, rows,
10359 or both. Argument *direction* can be one of the following values. Any
10360 other value is ignored.
10361
10362 ============== =======================================
10363 wx.VERTICAL Rows are flexibly sized.
10364 wx.HORIZONTAL Columns are flexibly sized.
10365 wx.BOTH Both rows and columns are flexibly sized
10366 (this is the default value).
10367 ============== =======================================
10368
10369 Note that this method does not trigger relayout.
10370
10371 """
d55e5bfc
RD
10372 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
10373
10374 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
10375 """
10376 GetFlexibleDirection(self) -> int
10377
10378 Returns a value that specifies whether the sizer
10379 flexibly resizes its columns, rows, or both (default).
10380
10381 :see: `SetFlexibleDirection`
10382 """
d55e5bfc
RD
10383 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
10384
10385 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
10386 """
10387 SetNonFlexibleGrowMode(self, int mode)
10388
10389 Specifies how the sizer should grow in the non-flexible direction if
10390 there is one (so `SetFlexibleDirection` must have been called
10391 previously). Argument *mode* can be one of the following values:
10392
10393 ========================== =================================================
10394 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
10395 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
10396 `AddGrowableCol` and `AddGrowableRow`. In this
10397 case equal sizing applies to minimum sizes of
10398 columns or rows (this is the default value).
10399 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
10400 the non flexible direction, whether they are
10401 growable or not in the flexbile direction.
10402 ========================== =================================================
10403
10404 Note that this method does not trigger relayout.
10405
10406
10407 """
d55e5bfc
RD
10408 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
10409
10410 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
10411 """
10412 GetNonFlexibleGrowMode(self) -> int
10413
10414 Returns the value that specifies how the sizer grows in the
10415 non-flexible direction if there is one.
10416
10417 :see: `SetNonFlexibleGrowMode`
10418 """
d55e5bfc
RD
10419 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
10420
10421 def GetRowHeights(*args, **kwargs):
a8eff060
RD
10422 """
10423 GetRowHeights(self) -> list
10424
10425 Returns a list of integers representing the heights of each of the
10426 rows in the sizer.
10427 """
d55e5bfc
RD
10428 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
10429
10430 def GetColWidths(*args, **kwargs):
a8eff060
RD
10431 """
10432 GetColWidths(self) -> list
10433
10434 Returns a list of integers representing the widths of each of the
10435 columns in the sizer.
10436 """
d55e5bfc
RD
10437 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
10438
10439
10440class FlexGridSizerPtr(FlexGridSizer):
10441 def __init__(self, this):
10442 self.this = this
10443 if not hasattr(self,"thisown"): self.thisown = 0
10444 self.__class__ = FlexGridSizer
10445_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
10446
62d32a5f
RD
10447class StdDialogButtonSizer(BoxSizer):
10448 """
10449 A special sizer that knows how to order and position standard buttons
10450 in order to conform to the current platform's standards. You simply
10451 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 10452 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
10453 will take care of the rest.
10454
10455 """
10456 def __repr__(self):
10457 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10458 def __init__(self, *args, **kwargs):
10459 """__init__(self) -> StdDialogButtonSizer"""
10460 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
10461 self.this = newobj.this
10462 self.thisown = 1
10463 del newobj.thisown
10464 def AddButton(*args, **kwargs):
10465 """
10466 AddButton(self, wxButton button)
10467
10468 Use this to add the buttons to this sizer. Do not use the `Add`
10469 method in the base class.
10470 """
10471 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
10472
53aa7709 10473 def Realize(*args, **kwargs):
62d32a5f 10474 """
53aa7709 10475 Realize(self)
62d32a5f
RD
10476
10477 This funciton needs to be called after all the buttons have been added
10478 to the sizer. It will reorder them and position them in a platform
10479 specifc manner.
10480 """
53aa7709 10481 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
10482
10483 def SetAffirmativeButton(*args, **kwargs):
10484 """SetAffirmativeButton(self, wxButton button)"""
10485 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
10486
10487 def SetNegativeButton(*args, **kwargs):
10488 """SetNegativeButton(self, wxButton button)"""
10489 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
10490
10491 def SetCancelButton(*args, **kwargs):
10492 """SetCancelButton(self, wxButton button)"""
10493 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
10494
10495 def GetAffirmativeButton(*args, **kwargs):
10496 """GetAffirmativeButton(self) -> wxButton"""
10497 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
10498
10499 def GetApplyButton(*args, **kwargs):
10500 """GetApplyButton(self) -> wxButton"""
10501 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
10502
10503 def GetNegativeButton(*args, **kwargs):
10504 """GetNegativeButton(self) -> wxButton"""
10505 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
10506
10507 def GetCancelButton(*args, **kwargs):
10508 """GetCancelButton(self) -> wxButton"""
10509 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
10510
10511 def GetHelpButton(*args, **kwargs):
10512 """GetHelpButton(self) -> wxButton"""
10513 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
10514
10515
10516class StdDialogButtonSizerPtr(StdDialogButtonSizer):
10517 def __init__(self, this):
10518 self.this = this
10519 if not hasattr(self,"thisown"): self.thisown = 0
10520 self.__class__ = StdDialogButtonSizer
10521_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
10522
d55e5bfc
RD
10523#---------------------------------------------------------------------------
10524
10525class GBPosition(object):
248ed943
RD
10526 """
10527 This class represents the position of an item in a virtual grid of
10528 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10529 typemaps that will automatically convert from a 2-element sequence of
10530 integers to a wx.GBPosition, so you can use the more pythonic
10531 representation of the position nearly transparently in Python code.
10532 """
d55e5bfc
RD
10533 def __repr__(self):
10534 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10535 def __init__(self, *args, **kwargs):
248ed943
RD
10536 """
10537 __init__(self, int row=0, int col=0) -> GBPosition
10538
10539 This class represents the position of an item in a virtual grid of
10540 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10541 typemaps that will automatically convert from a 2-element sequence of
10542 integers to a wx.GBPosition, so you can use the more pythonic
10543 representation of the position nearly transparently in Python code.
10544 """
d55e5bfc
RD
10545 newobj = _core_.new_GBPosition(*args, **kwargs)
10546 self.this = newobj.this
10547 self.thisown = 1
10548 del newobj.thisown
10549 def GetRow(*args, **kwargs):
10550 """GetRow(self) -> int"""
10551 return _core_.GBPosition_GetRow(*args, **kwargs)
10552
10553 def GetCol(*args, **kwargs):
10554 """GetCol(self) -> int"""
10555 return _core_.GBPosition_GetCol(*args, **kwargs)
10556
10557 def SetRow(*args, **kwargs):
10558 """SetRow(self, int row)"""
10559 return _core_.GBPosition_SetRow(*args, **kwargs)
10560
10561 def SetCol(*args, **kwargs):
10562 """SetCol(self, int col)"""
10563 return _core_.GBPosition_SetCol(*args, **kwargs)
10564
10565 def __eq__(*args, **kwargs):
10566 """__eq__(self, GBPosition other) -> bool"""
10567 return _core_.GBPosition___eq__(*args, **kwargs)
10568
10569 def __ne__(*args, **kwargs):
10570 """__ne__(self, GBPosition other) -> bool"""
10571 return _core_.GBPosition___ne__(*args, **kwargs)
10572
10573 def Set(*args, **kwargs):
10574 """Set(self, int row=0, int col=0)"""
10575 return _core_.GBPosition_Set(*args, **kwargs)
10576
10577 def Get(*args, **kwargs):
10578 """Get(self) -> PyObject"""
10579 return _core_.GBPosition_Get(*args, **kwargs)
10580
79fccf9d 10581 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
10582 def __str__(self): return str(self.Get())
10583 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
10584 def __len__(self): return len(self.Get())
10585 def __getitem__(self, index): return self.Get()[index]
10586 def __setitem__(self, index, val):
10587 if index == 0: self.SetRow(val)
10588 elif index == 1: self.SetCol(val)
10589 else: raise IndexError
10590 def __nonzero__(self): return self.Get() != (0,0)
10591 __safe_for_unpickling__ = True
10592 def __reduce__(self): return (wx.GBPosition, self.Get())
10593
10594 row = property(GetRow, SetRow)
10595 col = property(GetCol, SetCol)
10596
10597
10598class GBPositionPtr(GBPosition):
10599 def __init__(self, this):
10600 self.this = this
10601 if not hasattr(self,"thisown"): self.thisown = 0
10602 self.__class__ = GBPosition
10603_core_.GBPosition_swigregister(GBPositionPtr)
10604
10605class GBSpan(object):
248ed943
RD
10606 """
10607 This class is used to hold the row and column spanning attributes of
10608 items in a `wx.GridBagSizer`. wxPython has typemaps that will
10609 automatically convert from a 2-element sequence of integers to a
10610 wx.GBSpan, so you can use the more pythonic representation of the span
10611 nearly transparently in Python code.
10612
10613 """
d55e5bfc
RD
10614 def __repr__(self):
10615 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10616 def __init__(self, *args, **kwargs):
248ed943
RD
10617 """
10618 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
10619
10620 Construct a new wxGBSpan, optionally setting the rowspan and
10621 colspan. The default is (1,1). (Meaning that the item occupies one
10622 cell in each direction.
10623 """
d55e5bfc
RD
10624 newobj = _core_.new_GBSpan(*args, **kwargs)
10625 self.this = newobj.this
10626 self.thisown = 1
10627 del newobj.thisown
10628 def GetRowspan(*args, **kwargs):
10629 """GetRowspan(self) -> int"""
10630 return _core_.GBSpan_GetRowspan(*args, **kwargs)
10631
10632 def GetColspan(*args, **kwargs):
10633 """GetColspan(self) -> int"""
10634 return _core_.GBSpan_GetColspan(*args, **kwargs)
10635
10636 def SetRowspan(*args, **kwargs):
10637 """SetRowspan(self, int rowspan)"""
10638 return _core_.GBSpan_SetRowspan(*args, **kwargs)
10639
10640 def SetColspan(*args, **kwargs):
10641 """SetColspan(self, int colspan)"""
10642 return _core_.GBSpan_SetColspan(*args, **kwargs)
10643
10644 def __eq__(*args, **kwargs):
10645 """__eq__(self, GBSpan other) -> bool"""
10646 return _core_.GBSpan___eq__(*args, **kwargs)
10647
10648 def __ne__(*args, **kwargs):
10649 """__ne__(self, GBSpan other) -> bool"""
10650 return _core_.GBSpan___ne__(*args, **kwargs)
10651
10652 def Set(*args, **kwargs):
10653 """Set(self, int rowspan=1, int colspan=1)"""
10654 return _core_.GBSpan_Set(*args, **kwargs)
10655
10656 def Get(*args, **kwargs):
10657 """Get(self) -> PyObject"""
10658 return _core_.GBSpan_Get(*args, **kwargs)
10659
79fccf9d 10660 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
10661 def __str__(self): return str(self.Get())
10662 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
10663 def __len__(self): return len(self.Get())
10664 def __getitem__(self, index): return self.Get()[index]
10665 def __setitem__(self, index, val):
10666 if index == 0: self.SetRowspan(val)
10667 elif index == 1: self.SetColspan(val)
10668 else: raise IndexError
10669 def __nonzero__(self): return self.Get() != (0,0)
10670 __safe_for_unpickling__ = True
10671 def __reduce__(self): return (wx.GBSpan, self.Get())
10672
10673 rowspan = property(GetRowspan, SetRowspan)
10674 colspan = property(GetColspan, SetColspan)
10675
10676
10677class GBSpanPtr(GBSpan):
10678 def __init__(self, this):
10679 self.this = this
10680 if not hasattr(self,"thisown"): self.thisown = 0
10681 self.__class__ = GBSpan
10682_core_.GBSpan_swigregister(GBSpanPtr)
10683
10684class GBSizerItem(SizerItem):
248ed943
RD
10685 """
10686 The wx.GBSizerItem class is used to track the additional data about
10687 items in a `wx.GridBagSizer` such as the item's position in the grid
10688 and how many rows or columns it spans.
10689
10690 """
d55e5bfc
RD
10691 def __repr__(self):
10692 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10693 def __init__(self, *args, **kwargs):
248ed943
RD
10694 """
10695 __init__(self) -> GBSizerItem
10696
10697 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
10698 size will need to be set, as well as a position and span before this
10699 item can be used in a Sizer.
10700
10701 You will probably never need to create a wx.GBSizerItem directly as they
10702 are created automatically when the sizer's Add method is called.
10703 """
d55e5bfc
RD
10704 newobj = _core_.new_GBSizerItem(*args, **kwargs)
10705 self.this = newobj.this
10706 self.thisown = 1
10707 del newobj.thisown
10708 def GetPos(*args, **kwargs):
248ed943
RD
10709 """
10710 GetPos(self) -> GBPosition
10711
10712 Get the grid position of the item
10713 """
d55e5bfc
RD
10714 return _core_.GBSizerItem_GetPos(*args, **kwargs)
10715
10716 def GetPosTuple(self): return self.GetPos().Get()
10717 def GetSpan(*args, **kwargs):
248ed943
RD
10718 """
10719 GetSpan(self) -> GBSpan
10720
10721 Get the row and column spanning of the item
10722 """
d55e5bfc
RD
10723 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
10724
10725 def GetSpanTuple(self): return self.GetSpan().Get()
10726 def SetPos(*args, **kwargs):
248ed943
RD
10727 """
10728 SetPos(self, GBPosition pos) -> bool
10729
10730 If the item is already a member of a sizer then first ensure that
10731 there is no other item that would intersect with this one at the new
10732 position, then set the new position. Returns True if the change is
10733 successful and after the next Layout() the item will be moved.
10734 """
d55e5bfc
RD
10735 return _core_.GBSizerItem_SetPos(*args, **kwargs)
10736
10737 def SetSpan(*args, **kwargs):
248ed943
RD
10738 """
10739 SetSpan(self, GBSpan span) -> bool
10740
10741 If the item is already a member of a sizer then first ensure that
10742 there is no other item that would intersect with this one with its new
10743 spanning size, then set the new spanning. Returns True if the change
10744 is successful and after the next Layout() the item will be resized.
10745
10746 """
d55e5bfc
RD
10747 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
10748
248ed943 10749 def Intersects(*args, **kwargs):
d55e5bfc
RD
10750 """
10751 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
10752
10753 Returns True if this item and the other item instersect.
d55e5bfc 10754 """
248ed943
RD
10755 return _core_.GBSizerItem_Intersects(*args, **kwargs)
10756
10757 def IntersectsPos(*args, **kwargs):
10758 """
10759 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
10760
10761 Returns True if the given pos/span would intersect with this item.
10762 """
10763 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
10764
10765 def GetEndPos(*args, **kwargs):
248ed943
RD
10766 """
10767 GetEndPos(self) -> GBPosition
10768
10769 Get the row and column of the endpoint of this item.
10770 """
d55e5bfc
RD
10771 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
10772
10773 def GetGBSizer(*args, **kwargs):
248ed943
RD
10774 """
10775 GetGBSizer(self) -> GridBagSizer
10776
10777 Get the sizer this item is a member of.
10778 """
d55e5bfc
RD
10779 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
10780
10781 def SetGBSizer(*args, **kwargs):
248ed943
RD
10782 """
10783 SetGBSizer(self, GridBagSizer sizer)
10784
10785 Set the sizer this item is a member of.
10786 """
d55e5bfc
RD
10787 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
10788
10789
10790class GBSizerItemPtr(GBSizerItem):
10791 def __init__(self, this):
10792 self.this = this
10793 if not hasattr(self,"thisown"): self.thisown = 0
10794 self.__class__ = GBSizerItem
10795_core_.GBSizerItem_swigregister(GBSizerItemPtr)
10796DefaultSpan = cvar.DefaultSpan
10797
10798def GBSizerItemWindow(*args, **kwargs):
10799 """
10800 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
10801 int border, PyObject userData=None) -> GBSizerItem
10802
10803 Construct a `wx.GBSizerItem` for a window.
d55e5bfc
RD
10804 """
10805 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
10806 val.thisown = 1
10807 return val
10808
10809def GBSizerItemSizer(*args, **kwargs):
10810 """
10811 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
10812 int border, PyObject userData=None) -> GBSizerItem
10813
10814 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc
RD
10815 """
10816 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
10817 val.thisown = 1
10818 return val
10819
10820def GBSizerItemSpacer(*args, **kwargs):
10821 """
10822 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
10823 int flag, int border, PyObject userData=None) -> GBSizerItem
10824
10825 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc
RD
10826 """
10827 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
10828 val.thisown = 1
10829 return val
10830
10831class GridBagSizer(FlexGridSizer):
248ed943
RD
10832 """
10833 A `wx.Sizer` that can lay out items in a virtual grid like a
10834 `wx.FlexGridSizer` but in this case explicit positioning of the items
10835 is allowed using `wx.GBPosition`, and items can optionally span more
10836 than one row and/or column using `wx.GBSpan`. The total size of the
10837 virtual grid is determined by the largest row and column that items are
10838 positioned at, adjusted for spanning.
10839
10840 """
d55e5bfc
RD
10841 def __repr__(self):
10842 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10843 def __init__(self, *args, **kwargs):
248ed943
RD
10844 """
10845 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
10846
10847 Constructor, with optional parameters to specify the gap between the
10848 rows and columns.
10849 """
d55e5bfc
RD
10850 newobj = _core_.new_GridBagSizer(*args, **kwargs)
10851 self.this = newobj.this
10852 self.thisown = 1
10853 del newobj.thisown
c9c2cf70
RD
10854 self._setOORInfo(self)
10855
d55e5bfc
RD
10856 def Add(*args, **kwargs):
10857 """
248ed943 10858 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
c1cb24a4 10859 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
10860
10861 Adds an item to the sizer at the grid cell *pos*, optionally spanning
10862 more than one row or column as specified with *span*. The remaining
10863 args behave similarly to `wx.Sizer.Add`.
10864
10865 Returns True if the item was successfully placed at the given cell
10866 position, False if something was already there.
10867
d55e5bfc
RD
10868 """
10869 return _core_.GridBagSizer_Add(*args, **kwargs)
10870
10871 def AddItem(*args, **kwargs):
248ed943 10872 """
c1cb24a4 10873 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
10874
10875 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
10876 the item was successfully placed at its given cell position, False if
10877 something was already there.
10878 """
d55e5bfc
RD
10879 return _core_.GridBagSizer_AddItem(*args, **kwargs)
10880
84f85550
RD
10881 def GetCellSize(*args, **kwargs):
10882 """
10883 GetCellSize(self, int row, int col) -> Size
10884
10885 Get the size of the specified cell, including hgap and
10886 vgap. Only valid after a Layout.
10887 """
10888 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
10889
d55e5bfc 10890 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
10891 """
10892 GetEmptyCellSize(self) -> Size
10893
10894 Get the size used for cells in the grid with no item.
10895 """
d55e5bfc
RD
10896 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
10897
10898 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
10899 """
10900 SetEmptyCellSize(self, Size sz)
10901
10902 Set the size used for cells in the grid with no item.
10903 """
d55e5bfc
RD
10904 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
10905
10906 def GetItemPosition(*args):
10907 """
248ed943
RD
10908 GetItemPosition(self, item) -> GBPosition
10909
10910 Get the grid position of the specified *item* where *item* is either a
10911 window or subsizer that is a member of this sizer, or a zero-based
10912 index of an item.
d55e5bfc
RD
10913 """
10914 return _core_.GridBagSizer_GetItemPosition(*args)
10915
10916 def SetItemPosition(*args):
10917 """
248ed943
RD
10918 SetItemPosition(self, item, GBPosition pos) -> bool
10919
10920 Set the grid position of the specified *item* where *item* is either a
10921 window or subsizer that is a member of this sizer, or a zero-based
10922 index of an item. Returns True on success. If the move is not
10923 allowed (because an item is already there) then False is returned.
10924
d55e5bfc
RD
10925 """
10926 return _core_.GridBagSizer_SetItemPosition(*args)
10927
10928 def GetItemSpan(*args):
10929 """
248ed943
RD
10930 GetItemSpan(self, item) -> GBSpan
10931
10932 Get the row/col spanning of the specified *item* where *item* is
10933 either a window or subsizer that is a member of this sizer, or a
10934 zero-based index of an item.
d55e5bfc
RD
10935 """
10936 return _core_.GridBagSizer_GetItemSpan(*args)
10937
10938 def SetItemSpan(*args):
10939 """
248ed943
RD
10940 SetItemSpan(self, item, GBSpan span) -> bool
10941
10942 Set the row/col spanning of the specified *item* where *item* is
10943 either a window or subsizer that is a member of this sizer, or a
10944 zero-based index of an item. Returns True on success. If the move is
10945 not allowed (because an item is already there) then False is returned.
d55e5bfc
RD
10946 """
10947 return _core_.GridBagSizer_SetItemSpan(*args)
10948
10949 def FindItem(*args):
10950 """
248ed943
RD
10951 FindItem(self, item) -> GBSizerItem
10952
10953 Find the sizer item for the given window or subsizer, returns None if
10954 not found. (non-recursive)
d55e5bfc
RD
10955 """
10956 return _core_.GridBagSizer_FindItem(*args)
10957
10958 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
10959 """
10960 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
10961
10962 Return the sizer item for the given grid cell, or None if there is no
10963 item at that position. (non-recursive)
10964 """
d55e5bfc
RD
10965 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
10966
10967 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
10968 """
10969 FindItemAtPoint(self, Point pt) -> GBSizerItem
10970
10971 Return the sizer item located at the point given in *pt*, or None if
10972 there is no item at that point. The (x,y) coordinates in pt correspond
10973 to the client coordinates of the window using the sizer for
10974 layout. (non-recursive)
10975 """
d55e5bfc
RD
10976 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
10977
248ed943
RD
10978 def CheckForIntersection(*args, **kwargs):
10979 """
10980 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 10981
248ed943
RD
10982 Look at all items and see if any intersect (or would overlap) the
10983 given *item*. Returns True if so, False if there would be no overlap.
10984 If an *excludeItem* is given then it will not be checked for
10985 intersection, for example it may be the item we are checking the
10986 position of.
d55e5bfc 10987
248ed943
RD
10988 """
10989 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 10990
248ed943 10991 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 10992 """
248ed943
RD
10993 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
10994
10995 Look at all items and see if any intersect (or would overlap) the
10996 given position and span. Returns True if so, False if there would be
10997 no overlap. If an *excludeItem* is given then it will not be checked
10998 for intersection, for example it may be the item we are checking the
10999 position of.
d55e5bfc 11000 """
248ed943 11001 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc
RD
11002
11003
11004class GridBagSizerPtr(GridBagSizer):
11005 def __init__(self, this):
11006 self.this = this
11007 if not hasattr(self,"thisown"): self.thisown = 0
11008 self.__class__ = GridBagSizer
11009_core_.GridBagSizer_swigregister(GridBagSizerPtr)
11010
11011#---------------------------------------------------------------------------
11012
11013Left = _core_.Left
11014Top = _core_.Top
11015Right = _core_.Right
11016Bottom = _core_.Bottom
11017Width = _core_.Width
11018Height = _core_.Height
11019Centre = _core_.Centre
11020Center = _core_.Center
11021CentreX = _core_.CentreX
11022CentreY = _core_.CentreY
11023Unconstrained = _core_.Unconstrained
11024AsIs = _core_.AsIs
11025PercentOf = _core_.PercentOf
11026Above = _core_.Above
11027Below = _core_.Below
11028LeftOf = _core_.LeftOf
11029RightOf = _core_.RightOf
11030SameAs = _core_.SameAs
11031Absolute = _core_.Absolute
11032class IndividualLayoutConstraint(Object):
11033 """
79fccf9d
RD
11034 Objects of this class are stored in the `wx.LayoutConstraints` class as
11035 one of eight possible constraints that a window can be involved in.
11036 You will never need to create an instance of
11037 wx.IndividualLayoutConstraint, rather you should create a
11038 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 11039 that it contains.
d55e5bfc
RD
11040 """
11041 def __init__(self): raise RuntimeError, "No constructor defined"
11042 def __repr__(self):
11043 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11044 def Set(*args, **kwargs):
79fccf9d
RD
11045 """
11046 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
11047
11048 Sets the properties of the constraint. Normally called by one of the
11049 convenience functions such as Above, RightOf, SameAs.
11050 """
d55e5bfc
RD
11051 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
11052
11053 def LeftOf(*args, **kwargs):
11054 """
11055 LeftOf(self, Window sibling, int marg=0)
11056
79fccf9d
RD
11057 Constrains this edge to be to the left of the given window, with an
11058 optional margin. Implicitly, this is relative to the left edge of the
11059 other window.
d55e5bfc
RD
11060 """
11061 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
11062
11063 def RightOf(*args, **kwargs):
11064 """
11065 RightOf(self, Window sibling, int marg=0)
11066
79fccf9d
RD
11067 Constrains this edge to be to the right of the given window, with an
11068 optional margin. Implicitly, this is relative to the right edge of the
11069 other window.
d55e5bfc
RD
11070 """
11071 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
11072
11073 def Above(*args, **kwargs):
11074 """
11075 Above(self, Window sibling, int marg=0)
11076
79fccf9d
RD
11077 Constrains this edge to be above the given window, with an optional
11078 margin. Implicitly, this is relative to the top edge of the other
11079 window.
d55e5bfc
RD
11080 """
11081 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
11082
11083 def Below(*args, **kwargs):
11084 """
11085 Below(self, Window sibling, int marg=0)
11086
79fccf9d
RD
11087 Constrains this edge to be below the given window, with an optional
11088 margin. Implicitly, this is relative to the bottom edge of the other
11089 window.
d55e5bfc
RD
11090 """
11091 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
11092
11093 def SameAs(*args, **kwargs):
11094 """
11095 SameAs(self, Window otherW, int edge, int marg=0)
11096
79fccf9d
RD
11097 Constrains this edge or dimension to be to the same as the edge of the
11098 given window, with an optional margin.
d55e5bfc
RD
11099 """
11100 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
11101
11102 def PercentOf(*args, **kwargs):
11103 """
11104 PercentOf(self, Window otherW, int wh, int per)
11105
79fccf9d
RD
11106 Constrains this edge or dimension to be to a percentage of the given
11107 window, with an optional margin.
d55e5bfc
RD
11108 """
11109 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
11110
11111 def Absolute(*args, **kwargs):
11112 """
11113 Absolute(self, int val)
11114
79fccf9d 11115 Constrains this edge or dimension to be the given absolute value.
d55e5bfc
RD
11116 """
11117 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
11118
11119 def Unconstrained(*args, **kwargs):
11120 """
11121 Unconstrained(self)
11122
79fccf9d
RD
11123 Sets this edge or dimension to be unconstrained, that is, dependent on
11124 other edges and dimensions from which this value can be deduced.
d55e5bfc
RD
11125 """
11126 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
11127
11128 def AsIs(*args, **kwargs):
11129 """
11130 AsIs(self)
11131
79fccf9d
RD
11132 Sets this edge or constraint to be whatever the window's value is at
11133 the moment. If either of the width and height constraints are *as is*,
11134 the window will not be resized, but moved instead. This is important
11135 when considering panel items which are intended to have a default
11136 size, such as a button, which may take its size from the size of the
11137 button label.
d55e5bfc
RD
11138 """
11139 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
11140
11141 def GetOtherWindow(*args, **kwargs):
11142 """GetOtherWindow(self) -> Window"""
11143 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
11144
11145 def GetMyEdge(*args, **kwargs):
11146 """GetMyEdge(self) -> int"""
11147 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
11148
11149 def SetEdge(*args, **kwargs):
11150 """SetEdge(self, int which)"""
11151 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
11152
11153 def SetValue(*args, **kwargs):
11154 """SetValue(self, int v)"""
11155 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
11156
11157 def GetMargin(*args, **kwargs):
11158 """GetMargin(self) -> int"""
11159 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
11160
11161 def SetMargin(*args, **kwargs):
11162 """SetMargin(self, int m)"""
11163 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
11164
11165 def GetValue(*args, **kwargs):
11166 """GetValue(self) -> int"""
11167 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
11168
11169 def GetPercent(*args, **kwargs):
11170 """GetPercent(self) -> int"""
11171 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
11172
11173 def GetOtherEdge(*args, **kwargs):
11174 """GetOtherEdge(self) -> int"""
11175 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
11176
11177 def GetDone(*args, **kwargs):
11178 """GetDone(self) -> bool"""
11179 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
11180
11181 def SetDone(*args, **kwargs):
11182 """SetDone(self, bool d)"""
11183 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
11184
11185 def GetRelationship(*args, **kwargs):
11186 """GetRelationship(self) -> int"""
11187 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
11188
11189 def SetRelationship(*args, **kwargs):
11190 """SetRelationship(self, int r)"""
11191 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
11192
11193 def ResetIfWin(*args, **kwargs):
11194 """
11195 ResetIfWin(self, Window otherW) -> bool
11196
11197 Reset constraint if it mentions otherWin
11198 """
11199 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
11200
11201 def SatisfyConstraint(*args, **kwargs):
11202 """
11203 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
11204
11205 Try to satisfy constraint
11206 """
11207 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
11208
11209 def GetEdge(*args, **kwargs):
11210 """
11211 GetEdge(self, int which, Window thisWin, Window other) -> int
11212
11213 Get the value of this edge or dimension, or if this
11214 is not determinable, -1.
11215 """
11216 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
11217
11218
11219class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
11220 def __init__(self, this):
11221 self.this = this
11222 if not hasattr(self,"thisown"): self.thisown = 0
11223 self.__class__ = IndividualLayoutConstraint
11224_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
11225
11226class LayoutConstraints(Object):
11227 """
79fccf9d
RD
11228 **Note:** constraints are now deprecated and you should use sizers
11229 instead.
d55e5bfc 11230
79fccf9d
RD
11231 Objects of this class can be associated with a window to define its
11232 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
11233
11234 The class consists of the following eight constraints of class
11235 wx.IndividualLayoutConstraint, some or all of which should be accessed
11236 directly to set the appropriate constraints.
11237
11238 * left: represents the left hand edge of the window
11239 * right: represents the right hand edge of the window
11240 * top: represents the top edge of the window
11241 * bottom: represents the bottom edge of the window
11242 * width: represents the width of the window
11243 * height: represents the height of the window
11244 * centreX: represents the horizontal centre point of the window
11245 * centreY: represents the vertical centre point of the window
11246
79fccf9d
RD
11247 Most constraints are initially set to have the relationship
11248 wxUnconstrained, which means that their values should be calculated by
11249 looking at known constraints. The exceptions are width and height,
11250 which are set to wxAsIs to ensure that if the user does not specify a
11251 constraint, the existing width and height will be used, to be
11252 compatible with panel items which often have take a default size. If
11253 the constraint is ``wx.AsIs``, the dimension will not be changed.
11254
11255 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
11256
11257 """
11258 def __repr__(self):
11259 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11260 left = property(_core_.LayoutConstraints_left_get)
11261 top = property(_core_.LayoutConstraints_top_get)
11262 right = property(_core_.LayoutConstraints_right_get)
11263 bottom = property(_core_.LayoutConstraints_bottom_get)
11264 width = property(_core_.LayoutConstraints_width_get)
11265 height = property(_core_.LayoutConstraints_height_get)
11266 centreX = property(_core_.LayoutConstraints_centreX_get)
11267 centreY = property(_core_.LayoutConstraints_centreY_get)
11268 def __init__(self, *args, **kwargs):
11269 """__init__(self) -> LayoutConstraints"""
11270 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
11271 self.this = newobj.this
11272 self.thisown = 1
11273 del newobj.thisown
11274 def SatisfyConstraints(*args, **kwargs):
11275 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
11276 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
11277
11278 def AreSatisfied(*args, **kwargs):
11279 """AreSatisfied(self) -> bool"""
11280 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
11281
11282
11283class LayoutConstraintsPtr(LayoutConstraints):
11284 def __init__(self, this):
11285 self.this = this
11286 if not hasattr(self,"thisown"): self.thisown = 0
11287 self.__class__ = LayoutConstraints
11288_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
11289
11290#----------------------------------------------------------------------------
11291
11292# Use Python's bool constants if available, make some if not
11293try:
11294 True
11295except NameError:
11296 __builtins__.True = 1==1
11297 __builtins__.False = 1==0
11298 def bool(value): return not not value
11299 __builtins__.bool = bool
11300
11301
11302
11303# workarounds for bad wxRTTI names
11304__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
11305__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
11306__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
11307
11308
11309#----------------------------------------------------------------------------
11310# Load version numbers from __version__... Ensure that major and minor
0f63ec68 11311# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
11312
11313from __version__ import *
11314__version__ = VERSION_STRING
11315
0f63ec68
RD
11316assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
11317assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
11318if RELEASE_VERSION != _core_.RELEASE_VERSION:
11319 import warnings
0f63ec68 11320 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
11321
11322#----------------------------------------------------------------------------
11323
62d32a5f
RD
11324# Set the default string<-->unicode conversion encoding from the
11325# locale. This encoding is used when string or unicode objects need
11326# to be converted in order to pass them to wxWidgets. Please be aware
11327# that the default encoding within the same locale may be slightly
11328# different on different platforms. For example, please see
11329# http://www.alanwood.net/demos/charsetdiffs.html for differences
11330# between the common latin/roman encodings.
396fb509
RD
11331
11332default = _sys.getdefaultencoding()
11333if default == 'ascii':
11334 import locale
11335 import codecs
11336 try:
11337 default = locale.getdefaultlocale()[1]
11338 codecs.lookup(default)
11339 except (ValueError, LookupError):
11340 default = _sys.getdefaultencoding()
11341 del locale
11342 del codecs
5cbf236d
RD
11343if default:
11344 wx.SetDefaultPyEncoding(default)
11345del default
5cbf236d
RD
11346
11347#----------------------------------------------------------------------------
11348
d55e5bfc
RD
11349class PyDeadObjectError(AttributeError):
11350 pass
11351
11352class _wxPyDeadObject(object):
11353 """
11354 Instances of wx objects that are OOR capable will have their __class__
11355 changed to this class when the C++ object is deleted. This should help
11356 prevent crashes due to referencing a bogus C++ pointer.
11357 """
11358 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
11359 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
11360
11361 def __repr__(self):
11362 if not hasattr(self, "_name"):
11363 self._name = "[unknown]"
11364 return self.reprStr % self._name
11365
11366 def __getattr__(self, *args):
11367 if not hasattr(self, "_name"):
11368 self._name = "[unknown]"
11369 raise PyDeadObjectError(self.attrStr % self._name)
11370
11371 def __nonzero__(self):
11372 return 0
11373
11374
11375
11376class PyUnbornObjectError(AttributeError):
11377 pass
11378
11379class _wxPyUnbornObject(object):
11380 """
11381 Some stock objects are created when the wx._core module is
11382 imported, but their C++ instance is not created until the wx.App
11383 object is created and initialized. These object instances will
11384 temporarily have their __class__ changed to this class so an
11385 exception will be raised if they are used before the C++ instance
11386 is ready.
11387 """
11388
11389 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
11390 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
11391
11392 def __repr__(self):
11393 #if not hasattr(self, "_name"):
11394 # self._name = "[unknown]"
11395 return self.reprStr #% self._name
11396
11397 def __getattr__(self, *args):
11398 #if not hasattr(self, "_name"):
11399 # self._name = "[unknown]"
11400 raise PyUnbornObjectError(self.attrStr) # % self._name )
11401
11402 def __nonzero__(self):
11403 return 0
11404
11405
11406#----------------------------------------------------------------------------
d55e5bfc
RD
11407
11408def CallAfter(callable, *args, **kw):
11409 """
11410 Call the specified function after the current and pending event
11411 handlers have been completed. This is also good for making GUI
0439c23b
RD
11412 method calls from non-GUI threads. Any extra positional or
11413 keyword args are passed on to the callable when it is called.
11414
11415 :see: `wx.FutureCall`
d55e5bfc
RD
11416 """
11417 app = wx.GetApp()
a001823c 11418 assert app is not None, 'No wx.App created yet'
d55e5bfc 11419
891bb194
RD
11420 if not hasattr(app, "_CallAfterId"):
11421 app._CallAfterId = wx.NewEventType()
11422 app.Connect(-1, -1, app._CallAfterId,
11423 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 11424 evt = wx.PyEvent()
891bb194 11425 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
11426 evt.callable = callable
11427 evt.args = args
11428 evt.kw = kw
11429 wx.PostEvent(app, evt)
11430
d55e5bfc
RD
11431#----------------------------------------------------------------------------
11432
11433
11434class FutureCall:
11435 """
8ac8dba0 11436 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
11437 object once after the given amount of milliseconds, passing any
11438 positional or keyword args. The return value of the callable is
0439c23b 11439 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
11440
11441 If you don't need to get the return value or restart the timer
11442 then there is no need to hold a reference to this object. It will
11443 hold a reference to itself while the timer is running (the timer
11444 has a reference to self.Notify) but the cycle will be broken when
11445 the timer completes, automatically cleaning up the wx.FutureCall
11446 object.
0439c23b
RD
11447
11448 :see: `wx.CallAfter`
d55e5bfc
RD
11449 """
11450 def __init__(self, millis, callable, *args, **kwargs):
11451 self.millis = millis
11452 self.callable = callable
11453 self.SetArgs(*args, **kwargs)
11454 self.runCount = 0
11455 self.running = False
11456 self.hasRun = False
11457 self.result = None
11458 self.timer = None
11459 self.Start()
11460
11461 def __del__(self):
11462 self.Stop()
11463
11464
11465 def Start(self, millis=None, *args, **kwargs):
11466 """
11467 (Re)start the timer
11468 """
11469 self.hasRun = False
11470 if millis is not None:
11471 self.millis = millis
11472 if args or kwargs:
11473 self.SetArgs(*args, **kwargs)
11474 self.Stop()
11475 self.timer = wx.PyTimer(self.Notify)
11476 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
11477 self.running = True
11478 Restart = Start
11479
11480
11481 def Stop(self):
11482 """
11483 Stop and destroy the timer.
11484 """
11485 if self.timer is not None:
11486 self.timer.Stop()
11487 self.timer = None
11488
11489
11490 def GetInterval(self):
11491 if self.timer is not None:
11492 return self.timer.GetInterval()
11493 else:
11494 return 0
11495
11496
11497 def IsRunning(self):
11498 return self.timer is not None and self.timer.IsRunning()
11499
11500
11501 def SetArgs(self, *args, **kwargs):
11502 """
11503 (Re)set the args passed to the callable object. This is
11504 useful in conjunction with Restart if you want to schedule a
11505 new call to the same callable object but with different
11506 parameters.
11507 """
11508 self.args = args
11509 self.kwargs = kwargs
11510
11511
11512 def HasRun(self):
11513 return self.hasRun
11514
11515 def GetResult(self):
11516 return self.result
11517
11518 def Notify(self):
11519 """
11520 The timer has expired so call the callable.
11521 """
11522 if self.callable and getattr(self.callable, 'im_self', True):
11523 self.runCount += 1
11524 self.running = False
11525 self.result = self.callable(*self.args, **self.kwargs)
11526 self.hasRun = True
11527 if not self.running:
11528 # if it wasn't restarted, then cleanup
11529 wx.CallAfter(self.Stop)
11530
11531
11532
11533#----------------------------------------------------------------------------
11534# Control which items in this module should be documented by epydoc.
11535# We allow only classes and functions, which will help reduce the size
11536# of the docs by filtering out the zillions of constants, EVT objects,
11537# and etc that don't make much sense by themselves, but are instead
11538# documented (or will be) as part of the classes/functions/methods
11539# where they should be used.
11540
c24da6d6
RD
11541class __DocFilter:
11542 """
11543 A filter for epydoc that only allows non-Ptr classes and
11544 fucntions, in order to reduce the clutter in the API docs.
11545 """
11546 def __init__(self, globals):
11547 self._globals = globals
11548
11549 def __call__(self, name):
11550 import types
11551 obj = self._globals.get(name, None)
11552 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
11553 return False
11554 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
11555 return False
11556 return True
d55e5bfc
RD
11557
11558#----------------------------------------------------------------------------
11559#----------------------------------------------------------------------------
11560
11561# Import other modules in this package that should show up in the
11562# "core" wx namespace
11563from _gdi import *
11564from _windows import *
11565from _controls import *
11566from _misc import *
11567
11568
11569# Fixup the stock objects since they can't be used yet. (They will be
11570# restored in wx.PyApp.OnInit.)
11571_core_._wxPyFixStockObjects()
11572
11573#----------------------------------------------------------------------------
11574#----------------------------------------------------------------------------
11575
11576