]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
log wxChoice events in the same format as wxComboBox ones to make it simpler to compa...
[wxWidgets.git] / wxPython / src / gtk / _core.py
CommitLineData
32fe5131 1# This file was created automatically by SWIG 1.3.27.
d14a1e28
RD
2# Don't modify this file, modify the SWIG interface instead.
3
54f9ee45 4import _core_
d14a1e28 5
093d3ff1
RD
6def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name) or (name == "thisown"):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
24 method = class_type.__swig_getmethods__.get(name,None)
25 if method: return method(self)
26 raise AttributeError,name
27
28import types
29try:
30 _object = types.ObjectType
31 _newclass = 1
32except AttributeError:
33 class _object : pass
34 _newclass = 0
35del types
36
37
38def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
d14a1e28
RD
47#// Give a reference to the dictionary of this module to the C++ extension
48#// code.
54f9ee45 49_core_._wxPySetDictionary(vars())
d14a1e28
RD
50
51#// A little trick to make 'wx' be a reference to this module so wx.Names can
52#// be used here.
53import sys as _sys
54wx = _sys.modules[__name__]
55
66c033b4
RD
56
57#----------------------------------------------------------------------------
58
59def _deprecated(callable, msg=None):
60 """
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
63 """
64 if msg is None:
65 msg = "%s is deprecated" % callable
66 def deprecatedWrapper(*args, **kwargs):
67 import warnings
68 warnings.warn(msg, DeprecationWarning, stacklevel=2)
69 return callable(*args, **kwargs)
70 deprecatedWrapper.__doc__ = msg
71 return deprecatedWrapper
72
73
74#----------------------------------------------------------------------------
75
54f9ee45
RD
76NOT_FOUND = _core_.NOT_FOUND
77VSCROLL = _core_.VSCROLL
78HSCROLL = _core_.HSCROLL
79CAPTION = _core_.CAPTION
80DOUBLE_BORDER = _core_.DOUBLE_BORDER
81SUNKEN_BORDER = _core_.SUNKEN_BORDER
82RAISED_BORDER = _core_.RAISED_BORDER
83BORDER = _core_.BORDER
84SIMPLE_BORDER = _core_.SIMPLE_BORDER
85STATIC_BORDER = _core_.STATIC_BORDER
86TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
87NO_BORDER = _core_.NO_BORDER
bcd0d7b6 88DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 89DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
54f9ee45
RD
90TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
91WANTS_CHARS = _core_.WANTS_CHARS
92POPUP_WINDOW = _core_.POPUP_WINDOW
93CENTER_FRAME = _core_.CENTER_FRAME
94CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
95CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
54f9ee45
RD
96CLIP_CHILDREN = _core_.CLIP_CHILDREN
97CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
98ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
99RETAINED = _core_.RETAINED
100BACKINGSTORE = _core_.BACKINGSTORE
101COLOURED = _core_.COLOURED
102FIXED_LENGTH = _core_.FIXED_LENGTH
103LB_NEEDED_SB = _core_.LB_NEEDED_SB
104LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
105LB_SORT = _core_.LB_SORT
106LB_SINGLE = _core_.LB_SINGLE
107LB_MULTIPLE = _core_.LB_MULTIPLE
108LB_EXTENDED = _core_.LB_EXTENDED
109LB_OWNERDRAW = _core_.LB_OWNERDRAW
110LB_HSCROLL = _core_.LB_HSCROLL
111PROCESS_ENTER = _core_.PROCESS_ENTER
112PASSWORD = _core_.PASSWORD
113CB_SIMPLE = _core_.CB_SIMPLE
114CB_DROPDOWN = _core_.CB_DROPDOWN
115CB_SORT = _core_.CB_SORT
116CB_READONLY = _core_.CB_READONLY
117RA_HORIZONTAL = _core_.RA_HORIZONTAL
118RA_VERTICAL = _core_.RA_VERTICAL
119RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
120RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 121RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
54f9ee45
RD
122RB_GROUP = _core_.RB_GROUP
123RB_SINGLE = _core_.RB_SINGLE
54f9ee45
RD
124SB_HORIZONTAL = _core_.SB_HORIZONTAL
125SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 126RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
54f9ee45
RD
127ST_SIZEGRIP = _core_.ST_SIZEGRIP
128ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
129FLOOD_SURFACE = _core_.FLOOD_SURFACE
130FLOOD_BORDER = _core_.FLOOD_BORDER
131ODDEVEN_RULE = _core_.ODDEVEN_RULE
132WINDING_RULE = _core_.WINDING_RULE
133TOOL_TOP = _core_.TOOL_TOP
134TOOL_BOTTOM = _core_.TOOL_BOTTOM
135TOOL_LEFT = _core_.TOOL_LEFT
136TOOL_RIGHT = _core_.TOOL_RIGHT
137OK = _core_.OK
138YES_NO = _core_.YES_NO
139CANCEL = _core_.CANCEL
140YES = _core_.YES
141NO = _core_.NO
142NO_DEFAULT = _core_.NO_DEFAULT
143YES_DEFAULT = _core_.YES_DEFAULT
144ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
145ICON_HAND = _core_.ICON_HAND
146ICON_QUESTION = _core_.ICON_QUESTION
147ICON_INFORMATION = _core_.ICON_INFORMATION
148ICON_STOP = _core_.ICON_STOP
149ICON_ASTERISK = _core_.ICON_ASTERISK
150ICON_MASK = _core_.ICON_MASK
151ICON_WARNING = _core_.ICON_WARNING
152ICON_ERROR = _core_.ICON_ERROR
153FORWARD = _core_.FORWARD
154BACKWARD = _core_.BACKWARD
155RESET = _core_.RESET
156HELP = _core_.HELP
157MORE = _core_.MORE
158SETUP = _core_.SETUP
159SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
160SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
161SIZE_AUTO = _core_.SIZE_AUTO
162SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
163SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 164SIZE_FORCE = _core_.SIZE_FORCE
54f9ee45
RD
165PORTRAIT = _core_.PORTRAIT
166LANDSCAPE = _core_.LANDSCAPE
167PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
168PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
169PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
170PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
171ID_ANY = _core_.ID_ANY
172ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 173ID_NONE = _core_.ID_NONE
54f9ee45
RD
174ID_LOWEST = _core_.ID_LOWEST
175ID_OPEN = _core_.ID_OPEN
176ID_CLOSE = _core_.ID_CLOSE
177ID_NEW = _core_.ID_NEW
178ID_SAVE = _core_.ID_SAVE
179ID_SAVEAS = _core_.ID_SAVEAS
180ID_REVERT = _core_.ID_REVERT
181ID_EXIT = _core_.ID_EXIT
182ID_UNDO = _core_.ID_UNDO
183ID_REDO = _core_.ID_REDO
184ID_HELP = _core_.ID_HELP
185ID_PRINT = _core_.ID_PRINT
186ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
187ID_PREVIEW = _core_.ID_PREVIEW
188ID_ABOUT = _core_.ID_ABOUT
189ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
190ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
191ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
192ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
193ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
194ID_PREFERENCES = _core_.ID_PREFERENCES
195ID_CUT = _core_.ID_CUT
196ID_COPY = _core_.ID_COPY
197ID_PASTE = _core_.ID_PASTE
198ID_CLEAR = _core_.ID_CLEAR
199ID_FIND = _core_.ID_FIND
200ID_DUPLICATE = _core_.ID_DUPLICATE
201ID_SELECTALL = _core_.ID_SELECTALL
202ID_DELETE = _core_.ID_DELETE
203ID_REPLACE = _core_.ID_REPLACE
204ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
205ID_PROPERTIES = _core_.ID_PROPERTIES
206ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
207ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
208ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
209ID_VIEW_LIST = _core_.ID_VIEW_LIST
210ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
211ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
212ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
213ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
214ID_FILE1 = _core_.ID_FILE1
215ID_FILE2 = _core_.ID_FILE2
216ID_FILE3 = _core_.ID_FILE3
217ID_FILE4 = _core_.ID_FILE4
218ID_FILE5 = _core_.ID_FILE5
219ID_FILE6 = _core_.ID_FILE6
220ID_FILE7 = _core_.ID_FILE7
221ID_FILE8 = _core_.ID_FILE8
222ID_FILE9 = _core_.ID_FILE9
223ID_OK = _core_.ID_OK
224ID_CANCEL = _core_.ID_CANCEL
225ID_APPLY = _core_.ID_APPLY
226ID_YES = _core_.ID_YES
227ID_NO = _core_.ID_NO
228ID_STATIC = _core_.ID_STATIC
229ID_FORWARD = _core_.ID_FORWARD
230ID_BACKWARD = _core_.ID_BACKWARD
231ID_DEFAULT = _core_.ID_DEFAULT
232ID_MORE = _core_.ID_MORE
233ID_SETUP = _core_.ID_SETUP
234ID_RESET = _core_.ID_RESET
235ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
236ID_YESTOALL = _core_.ID_YESTOALL
237ID_NOTOALL = _core_.ID_NOTOALL
238ID_ABORT = _core_.ID_ABORT
239ID_RETRY = _core_.ID_RETRY
240ID_IGNORE = _core_.ID_IGNORE
7bc1e663
RD
241ID_ADD = _core_.ID_ADD
242ID_REMOVE = _core_.ID_REMOVE
243ID_UP = _core_.ID_UP
244ID_DOWN = _core_.ID_DOWN
245ID_HOME = _core_.ID_HOME
246ID_REFRESH = _core_.ID_REFRESH
247ID_STOP = _core_.ID_STOP
248ID_INDEX = _core_.ID_INDEX
249ID_BOLD = _core_.ID_BOLD
250ID_ITALIC = _core_.ID_ITALIC
251ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
252ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
253ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
254ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
255ID_UNDERLINE = _core_.ID_UNDERLINE
256ID_INDENT = _core_.ID_INDENT
257ID_UNINDENT = _core_.ID_UNINDENT
258ID_ZOOM_100 = _core_.ID_ZOOM_100
259ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
260ID_ZOOM_IN = _core_.ID_ZOOM_IN
261ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
262ID_UNDELETE = _core_.ID_UNDELETE
263ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
54f9ee45
RD
264ID_HIGHEST = _core_.ID_HIGHEST
265OPEN = _core_.OPEN
266SAVE = _core_.SAVE
267HIDE_READONLY = _core_.HIDE_READONLY
268OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
269FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
270MULTIPLE = _core_.MULTIPLE
271CHANGE_DIR = _core_.CHANGE_DIR
272ACCEL_ALT = _core_.ACCEL_ALT
273ACCEL_CTRL = _core_.ACCEL_CTRL
274ACCEL_SHIFT = _core_.ACCEL_SHIFT
275ACCEL_NORMAL = _core_.ACCEL_NORMAL
276PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
277PD_APP_MODAL = _core_.PD_APP_MODAL
278PD_CAN_ABORT = _core_.PD_CAN_ABORT
279PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
280PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
281PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
e505d15e
RD
282PD_SMOOTH = _core_.PD_SMOOTH
283PD_CAN_SKIP = _core_.PD_CAN_SKIP
54f9ee45
RD
284DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
285DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
286MENU_TEAROFF = _core_.MENU_TEAROFF
287MB_DOCKABLE = _core_.MB_DOCKABLE
288NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
289FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
290LI_HORIZONTAL = _core_.LI_HORIZONTAL
291LI_VERTICAL = _core_.LI_VERTICAL
292WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
293WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
294WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
295WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
296WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
297WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
298MM_TEXT = _core_.MM_TEXT
299MM_LOMETRIC = _core_.MM_LOMETRIC
300MM_HIMETRIC = _core_.MM_HIMETRIC
301MM_LOENGLISH = _core_.MM_LOENGLISH
302MM_HIENGLISH = _core_.MM_HIENGLISH
303MM_TWIPS = _core_.MM_TWIPS
304MM_ISOTROPIC = _core_.MM_ISOTROPIC
305MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
306MM_POINTS = _core_.MM_POINTS
307MM_METRIC = _core_.MM_METRIC
308CENTRE = _core_.CENTRE
309CENTER = _core_.CENTER
310HORIZONTAL = _core_.HORIZONTAL
311VERTICAL = _core_.VERTICAL
312BOTH = _core_.BOTH
313LEFT = _core_.LEFT
314RIGHT = _core_.RIGHT
315UP = _core_.UP
316DOWN = _core_.DOWN
317TOP = _core_.TOP
318BOTTOM = _core_.BOTTOM
319NORTH = _core_.NORTH
320SOUTH = _core_.SOUTH
321WEST = _core_.WEST
322EAST = _core_.EAST
323ALL = _core_.ALL
324ALIGN_NOT = _core_.ALIGN_NOT
325ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
326ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
327ALIGN_LEFT = _core_.ALIGN_LEFT
328ALIGN_TOP = _core_.ALIGN_TOP
329ALIGN_RIGHT = _core_.ALIGN_RIGHT
330ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
331ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
332ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
333ALIGN_CENTER = _core_.ALIGN_CENTER
334ALIGN_CENTRE = _core_.ALIGN_CENTRE
335ALIGN_MASK = _core_.ALIGN_MASK
336STRETCH_NOT = _core_.STRETCH_NOT
337SHRINK = _core_.SHRINK
338GROW = _core_.GROW
339EXPAND = _core_.EXPAND
340SHAPED = _core_.SHAPED
341FIXED_MINSIZE = _core_.FIXED_MINSIZE
342TILE = _core_.TILE
343ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
344BORDER_DEFAULT = _core_.BORDER_DEFAULT
345BORDER_NONE = _core_.BORDER_NONE
346BORDER_STATIC = _core_.BORDER_STATIC
347BORDER_SIMPLE = _core_.BORDER_SIMPLE
348BORDER_RAISED = _core_.BORDER_RAISED
349BORDER_SUNKEN = _core_.BORDER_SUNKEN
350BORDER_DOUBLE = _core_.BORDER_DOUBLE
351BORDER_MASK = _core_.BORDER_MASK
7bc1e663
RD
352BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
353BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
354BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
54f9ee45
RD
355DEFAULT = _core_.DEFAULT
356DECORATIVE = _core_.DECORATIVE
357ROMAN = _core_.ROMAN
358SCRIPT = _core_.SCRIPT
359SWISS = _core_.SWISS
360MODERN = _core_.MODERN
361TELETYPE = _core_.TELETYPE
362VARIABLE = _core_.VARIABLE
363FIXED = _core_.FIXED
364NORMAL = _core_.NORMAL
365LIGHT = _core_.LIGHT
366BOLD = _core_.BOLD
367ITALIC = _core_.ITALIC
368SLANT = _core_.SLANT
369SOLID = _core_.SOLID
370DOT = _core_.DOT
371LONG_DASH = _core_.LONG_DASH
372SHORT_DASH = _core_.SHORT_DASH
373DOT_DASH = _core_.DOT_DASH
374USER_DASH = _core_.USER_DASH
375TRANSPARENT = _core_.TRANSPARENT
376STIPPLE = _core_.STIPPLE
d04418a7
RD
377STIPPLE_MASK = _core_.STIPPLE_MASK
378STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
54f9ee45
RD
379BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
380CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
381FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
382CROSS_HATCH = _core_.CROSS_HATCH
383HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
384VERTICAL_HATCH = _core_.VERTICAL_HATCH
385JOIN_BEVEL = _core_.JOIN_BEVEL
386JOIN_MITER = _core_.JOIN_MITER
387JOIN_ROUND = _core_.JOIN_ROUND
388CAP_ROUND = _core_.CAP_ROUND
389CAP_PROJECTING = _core_.CAP_PROJECTING
390CAP_BUTT = _core_.CAP_BUTT
391CLEAR = _core_.CLEAR
392XOR = _core_.XOR
393INVERT = _core_.INVERT
394OR_REVERSE = _core_.OR_REVERSE
395AND_REVERSE = _core_.AND_REVERSE
396COPY = _core_.COPY
397AND = _core_.AND
398AND_INVERT = _core_.AND_INVERT
399NO_OP = _core_.NO_OP
400NOR = _core_.NOR
401EQUIV = _core_.EQUIV
402SRC_INVERT = _core_.SRC_INVERT
403OR_INVERT = _core_.OR_INVERT
404NAND = _core_.NAND
405OR = _core_.OR
406SET = _core_.SET
407WXK_BACK = _core_.WXK_BACK
408WXK_TAB = _core_.WXK_TAB
409WXK_RETURN = _core_.WXK_RETURN
410WXK_ESCAPE = _core_.WXK_ESCAPE
411WXK_SPACE = _core_.WXK_SPACE
412WXK_DELETE = _core_.WXK_DELETE
413WXK_START = _core_.WXK_START
414WXK_LBUTTON = _core_.WXK_LBUTTON
415WXK_RBUTTON = _core_.WXK_RBUTTON
416WXK_CANCEL = _core_.WXK_CANCEL
417WXK_MBUTTON = _core_.WXK_MBUTTON
418WXK_CLEAR = _core_.WXK_CLEAR
419WXK_SHIFT = _core_.WXK_SHIFT
420WXK_ALT = _core_.WXK_ALT
421WXK_CONTROL = _core_.WXK_CONTROL
422WXK_MENU = _core_.WXK_MENU
423WXK_PAUSE = _core_.WXK_PAUSE
424WXK_CAPITAL = _core_.WXK_CAPITAL
425WXK_PRIOR = _core_.WXK_PRIOR
426WXK_NEXT = _core_.WXK_NEXT
427WXK_END = _core_.WXK_END
428WXK_HOME = _core_.WXK_HOME
429WXK_LEFT = _core_.WXK_LEFT
430WXK_UP = _core_.WXK_UP
431WXK_RIGHT = _core_.WXK_RIGHT
432WXK_DOWN = _core_.WXK_DOWN
433WXK_SELECT = _core_.WXK_SELECT
434WXK_PRINT = _core_.WXK_PRINT
435WXK_EXECUTE = _core_.WXK_EXECUTE
436WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
437WXK_INSERT = _core_.WXK_INSERT
438WXK_HELP = _core_.WXK_HELP
439WXK_NUMPAD0 = _core_.WXK_NUMPAD0
440WXK_NUMPAD1 = _core_.WXK_NUMPAD1
441WXK_NUMPAD2 = _core_.WXK_NUMPAD2
442WXK_NUMPAD3 = _core_.WXK_NUMPAD3
443WXK_NUMPAD4 = _core_.WXK_NUMPAD4
444WXK_NUMPAD5 = _core_.WXK_NUMPAD5
445WXK_NUMPAD6 = _core_.WXK_NUMPAD6
446WXK_NUMPAD7 = _core_.WXK_NUMPAD7
447WXK_NUMPAD8 = _core_.WXK_NUMPAD8
448WXK_NUMPAD9 = _core_.WXK_NUMPAD9
449WXK_MULTIPLY = _core_.WXK_MULTIPLY
450WXK_ADD = _core_.WXK_ADD
451WXK_SEPARATOR = _core_.WXK_SEPARATOR
452WXK_SUBTRACT = _core_.WXK_SUBTRACT
453WXK_DECIMAL = _core_.WXK_DECIMAL
454WXK_DIVIDE = _core_.WXK_DIVIDE
455WXK_F1 = _core_.WXK_F1
456WXK_F2 = _core_.WXK_F2
457WXK_F3 = _core_.WXK_F3
458WXK_F4 = _core_.WXK_F4
459WXK_F5 = _core_.WXK_F5
460WXK_F6 = _core_.WXK_F6
461WXK_F7 = _core_.WXK_F7
462WXK_F8 = _core_.WXK_F8
463WXK_F9 = _core_.WXK_F9
464WXK_F10 = _core_.WXK_F10
465WXK_F11 = _core_.WXK_F11
466WXK_F12 = _core_.WXK_F12
467WXK_F13 = _core_.WXK_F13
468WXK_F14 = _core_.WXK_F14
469WXK_F15 = _core_.WXK_F15
470WXK_F16 = _core_.WXK_F16
471WXK_F17 = _core_.WXK_F17
472WXK_F18 = _core_.WXK_F18
473WXK_F19 = _core_.WXK_F19
474WXK_F20 = _core_.WXK_F20
475WXK_F21 = _core_.WXK_F21
476WXK_F22 = _core_.WXK_F22
477WXK_F23 = _core_.WXK_F23
478WXK_F24 = _core_.WXK_F24
479WXK_NUMLOCK = _core_.WXK_NUMLOCK
480WXK_SCROLL = _core_.WXK_SCROLL
481WXK_PAGEUP = _core_.WXK_PAGEUP
482WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
483WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
484WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
485WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
486WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
487WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
488WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
489WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
490WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
491WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
492WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
493WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
494WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
495WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
496WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
497WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
498WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
499WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
500WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
501WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
502WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
503WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
504WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
505WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
506WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
507WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
508WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
509WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
510WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
511WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
512WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
513WXK_COMMAND = _core_.WXK_COMMAND
514WXK_SPECIAL1 = _core_.WXK_SPECIAL1
515WXK_SPECIAL2 = _core_.WXK_SPECIAL2
516WXK_SPECIAL3 = _core_.WXK_SPECIAL3
517WXK_SPECIAL4 = _core_.WXK_SPECIAL4
518WXK_SPECIAL5 = _core_.WXK_SPECIAL5
519WXK_SPECIAL6 = _core_.WXK_SPECIAL6
520WXK_SPECIAL7 = _core_.WXK_SPECIAL7
521WXK_SPECIAL8 = _core_.WXK_SPECIAL8
522WXK_SPECIAL9 = _core_.WXK_SPECIAL9
523WXK_SPECIAL10 = _core_.WXK_SPECIAL10
524WXK_SPECIAL11 = _core_.WXK_SPECIAL11
525WXK_SPECIAL12 = _core_.WXK_SPECIAL12
526WXK_SPECIAL13 = _core_.WXK_SPECIAL13
527WXK_SPECIAL14 = _core_.WXK_SPECIAL14
528WXK_SPECIAL15 = _core_.WXK_SPECIAL15
529WXK_SPECIAL16 = _core_.WXK_SPECIAL16
530WXK_SPECIAL17 = _core_.WXK_SPECIAL17
531WXK_SPECIAL18 = _core_.WXK_SPECIAL18
532WXK_SPECIAL19 = _core_.WXK_SPECIAL19
533WXK_SPECIAL20 = _core_.WXK_SPECIAL20
54f9ee45
RD
534PAPER_NONE = _core_.PAPER_NONE
535PAPER_LETTER = _core_.PAPER_LETTER
536PAPER_LEGAL = _core_.PAPER_LEGAL
537PAPER_A4 = _core_.PAPER_A4
538PAPER_CSHEET = _core_.PAPER_CSHEET
539PAPER_DSHEET = _core_.PAPER_DSHEET
540PAPER_ESHEET = _core_.PAPER_ESHEET
541PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
542PAPER_TABLOID = _core_.PAPER_TABLOID
543PAPER_LEDGER = _core_.PAPER_LEDGER
544PAPER_STATEMENT = _core_.PAPER_STATEMENT
545PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
546PAPER_A3 = _core_.PAPER_A3
547PAPER_A4SMALL = _core_.PAPER_A4SMALL
548PAPER_A5 = _core_.PAPER_A5
549PAPER_B4 = _core_.PAPER_B4
550PAPER_B5 = _core_.PAPER_B5
551PAPER_FOLIO = _core_.PAPER_FOLIO
552PAPER_QUARTO = _core_.PAPER_QUARTO
553PAPER_10X14 = _core_.PAPER_10X14
554PAPER_11X17 = _core_.PAPER_11X17
555PAPER_NOTE = _core_.PAPER_NOTE
556PAPER_ENV_9 = _core_.PAPER_ENV_9
557PAPER_ENV_10 = _core_.PAPER_ENV_10
558PAPER_ENV_11 = _core_.PAPER_ENV_11
559PAPER_ENV_12 = _core_.PAPER_ENV_12
560PAPER_ENV_14 = _core_.PAPER_ENV_14
561PAPER_ENV_DL = _core_.PAPER_ENV_DL
562PAPER_ENV_C5 = _core_.PAPER_ENV_C5
563PAPER_ENV_C3 = _core_.PAPER_ENV_C3
564PAPER_ENV_C4 = _core_.PAPER_ENV_C4
565PAPER_ENV_C6 = _core_.PAPER_ENV_C6
566PAPER_ENV_C65 = _core_.PAPER_ENV_C65
567PAPER_ENV_B4 = _core_.PAPER_ENV_B4
568PAPER_ENV_B5 = _core_.PAPER_ENV_B5
569PAPER_ENV_B6 = _core_.PAPER_ENV_B6
570PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
571PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
572PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
573PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
574PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
575PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
576PAPER_ISO_B4 = _core_.PAPER_ISO_B4
577PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
578PAPER_9X11 = _core_.PAPER_9X11
579PAPER_10X11 = _core_.PAPER_10X11
580PAPER_15X11 = _core_.PAPER_15X11
581PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
582PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
583PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
584PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
585PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
586PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
587PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
588PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
589PAPER_A_PLUS = _core_.PAPER_A_PLUS
590PAPER_B_PLUS = _core_.PAPER_B_PLUS
591PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
592PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
593PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
594PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
595PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
596PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
597PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
598PAPER_A2 = _core_.PAPER_A2
599PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
600PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
6c75a4cf
RD
601PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
602PAPER_A6 = _core_.PAPER_A6
603PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
604PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
605PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
606PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
607PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
608PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
609PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
610PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
611PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
612PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
613PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
614PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
615PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
616PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
617PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
618PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
619PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
620PAPER_B6_JIS = _core_.PAPER_B6_JIS
621PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
622PAPER_12X11 = _core_.PAPER_12X11
623PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
624PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
625PAPER_P16K = _core_.PAPER_P16K
626PAPER_P32K = _core_.PAPER_P32K
627PAPER_P32KBIG = _core_.PAPER_P32KBIG
628PAPER_PENV_1 = _core_.PAPER_PENV_1
629PAPER_PENV_2 = _core_.PAPER_PENV_2
630PAPER_PENV_3 = _core_.PAPER_PENV_3
631PAPER_PENV_4 = _core_.PAPER_PENV_4
632PAPER_PENV_5 = _core_.PAPER_PENV_5
633PAPER_PENV_6 = _core_.PAPER_PENV_6
634PAPER_PENV_7 = _core_.PAPER_PENV_7
635PAPER_PENV_8 = _core_.PAPER_PENV_8
636PAPER_PENV_9 = _core_.PAPER_PENV_9
637PAPER_PENV_10 = _core_.PAPER_PENV_10
638PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
639PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
640PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
641PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
642PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
643PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
644PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
645PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
646PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
647PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
648PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
649PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
650PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
54f9ee45
RD
651DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
652DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
653DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
654ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
655ITEM_NORMAL = _core_.ITEM_NORMAL
656ITEM_CHECK = _core_.ITEM_CHECK
657ITEM_RADIO = _core_.ITEM_RADIO
658ITEM_MAX = _core_.ITEM_MAX
659HT_NOWHERE = _core_.HT_NOWHERE
660HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
661HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
662HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
663HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
664HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
665HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
666HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
667HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
668HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
669HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
670HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
671HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
672HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
673HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
674HT_MAX = _core_.HT_MAX
675MOD_NONE = _core_.MOD_NONE
676MOD_ALT = _core_.MOD_ALT
677MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 678MOD_ALTGR = _core_.MOD_ALTGR
54f9ee45 679MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 680MOD_META = _core_.MOD_META
54f9ee45 681MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
682MOD_CMD = _core_.MOD_CMD
683MOD_ALL = _core_.MOD_ALL
54f9ee45
RD
684UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
685UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
686UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d14a1e28
RD
687#---------------------------------------------------------------------------
688
689class Object(object):
0df68c9f
RD
690 """
691 The base class for most wx objects, although in wxPython not
692 much functionality is needed nor exposed.
693 """
d14a1e28
RD
694 def __init__(self): raise RuntimeError, "No constructor defined"
695 def __repr__(self):
696 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 697 def GetClassName(*args, **kwargs):
0df68c9f 698 """
a95a7133 699 GetClassName(self) -> String
e811c8ce 700
a95a7133 701 Returns the class name of the C++ class using wxRTTI.
0df68c9f 702 """
54f9ee45 703 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
704
705 def Destroy(*args, **kwargs):
0df68c9f 706 """
a95a7133 707 Destroy(self)
e811c8ce 708
0df68c9f
RD
709 Deletes the C++ object this Python object is a proxy for.
710 """
7e08d4ef
RD
711 val = _core_.Object_Destroy(*args, **kwargs)
712 args[0].thisown = 0
713 return val
e811c8ce 714
d14a1e28
RD
715
716class ObjectPtr(Object):
717 def __init__(self, this):
718 self.this = this
719 if not hasattr(self,"thisown"): self.thisown = 0
720 self.__class__ = Object
54f9ee45
RD
721_core_.Object_swigregister(ObjectPtr)
722_wxPySetDictionary = _core_._wxPySetDictionary
d14a1e28 723
54f9ee45 724_wxPyFixStockObjects = _core_._wxPyFixStockObjects
3a04f143 725
54f9ee45 726cvar = _core_.cvar
196addbf 727EmptyString = cvar.EmptyString
d14a1e28
RD
728
729#---------------------------------------------------------------------------
730
54f9ee45
RD
731BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
732BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
733BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
734BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
735BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
736BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
737BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
738BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
739BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
740BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
741BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
742BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
743BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
744BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
745BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
746BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
747BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
748BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
749BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
750BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
751CURSOR_NONE = _core_.CURSOR_NONE
752CURSOR_ARROW = _core_.CURSOR_ARROW
753CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
754CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
755CURSOR_CHAR = _core_.CURSOR_CHAR
756CURSOR_CROSS = _core_.CURSOR_CROSS
757CURSOR_HAND = _core_.CURSOR_HAND
758CURSOR_IBEAM = _core_.CURSOR_IBEAM
759CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
760CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
761CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
762CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
763CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
764CURSOR_PENCIL = _core_.CURSOR_PENCIL
765CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
766CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
767CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
768CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
769CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
770CURSOR_SIZENS = _core_.CURSOR_SIZENS
771CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
772CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
773CURSOR_SIZING = _core_.CURSOR_SIZING
774CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
775CURSOR_WAIT = _core_.CURSOR_WAIT
776CURSOR_WATCH = _core_.CURSOR_WATCH
777CURSOR_BLANK = _core_.CURSOR_BLANK
778CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
779CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
780CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
781CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
782#---------------------------------------------------------------------------
783
784class Size(object):
0df68c9f 785 """
41e2b43e 786 wx.Size is a useful data structure used to represent the size of
093d3ff1
RD
787 something. It simply contians integer width and height
788 proprtites. In most places in wxPython where a wx.Size is
789 expected a (width, height) tuple can be used instead.
0df68c9f 790 """
e811c8ce
RD
791 def __repr__(self):
792 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
793 width = property(_core_.Size_width_get, _core_.Size_width_set)
794 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 795 x = width; y = height
d14a1e28 796 def __init__(self, *args, **kwargs):
0df68c9f 797 """
a95a7133 798 __init__(self, int w=0, int h=0) -> Size
e811c8ce 799
0df68c9f
RD
800 Creates a size object.
801 """
54f9ee45 802 newobj = _core_.new_Size(*args, **kwargs)
d14a1e28
RD
803 self.this = newobj.this
804 self.thisown = 1
805 del newobj.thisown
54f9ee45 806 def __del__(self, destroy=_core_.delete_Size):
a95a7133 807 """__del__(self)"""
d14a1e28
RD
808 try:
809 if self.thisown: destroy(self)
810 except: pass
e811c8ce
RD
811
812 def __eq__(*args, **kwargs):
0df68c9f 813 """
a95a7133 814 __eq__(self, Size sz) -> bool
e811c8ce 815
0df68c9f
RD
816 Test for equality of wx.Size objects.
817 """
54f9ee45 818 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
819
820 def __ne__(*args, **kwargs):
0df68c9f 821 """
a95a7133 822 __ne__(self, Size sz) -> bool
e811c8ce 823
0df68c9f
RD
824 Test for inequality.
825 """
54f9ee45 826 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
827
828 def __add__(*args, **kwargs):
0df68c9f 829 """
a95a7133 830 __add__(self, Size sz) -> Size
e811c8ce 831
0df68c9f
RD
832 Add sz's proprties to this and return the result.
833 """
54f9ee45 834 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
835
836 def __sub__(*args, **kwargs):
0df68c9f 837 """
a95a7133 838 __sub__(self, Size sz) -> Size
e811c8ce 839
0df68c9f
RD
840 Subtract sz's properties from this and return the result.
841 """
54f9ee45 842 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
843
844 def IncTo(*args, **kwargs):
0df68c9f 845 """
a95a7133 846 IncTo(self, Size sz)
e811c8ce 847
0df68c9f
RD
848 Increments this object so that both of its dimensions are not less
849 than the corresponding dimensions of the size.
850 """
54f9ee45 851 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
852
853 def DecTo(*args, **kwargs):
0df68c9f 854 """
a95a7133 855 DecTo(self, Size sz)
e811c8ce 856
0df68c9f
RD
857 Decrements this object so that both of its dimensions are not greater
858 than the corresponding dimensions of the size.
859 """
54f9ee45 860 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce
RD
861
862 def Set(*args, **kwargs):
0df68c9f 863 """
a95a7133 864 Set(self, int w, int h)
e811c8ce 865
0df68c9f
RD
866 Set both width and height.
867 """
54f9ee45 868 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
869
870 def SetWidth(*args, **kwargs):
a95a7133 871 """SetWidth(self, int w)"""
54f9ee45 872 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
873
874 def SetHeight(*args, **kwargs):
a95a7133 875 """SetHeight(self, int h)"""
54f9ee45 876 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
877
878 def GetWidth(*args, **kwargs):
a95a7133 879 """GetWidth(self) -> int"""
54f9ee45 880 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
881
882 def GetHeight(*args, **kwargs):
a95a7133 883 """GetHeight(self) -> int"""
54f9ee45 884 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 885
74a57fcd
RD
886 def IsFullySpecified(*args, **kwargs):
887 """
a95a7133 888 IsFullySpecified(self) -> bool
74a57fcd
RD
889
890 Returns True if both components of the size are non-default values.
891 """
54f9ee45 892 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
893
894 def SetDefaults(*args, **kwargs):
895 """
a95a7133 896 SetDefaults(self, Size size)
74a57fcd 897
41e2b43e
RD
898 Combine this size with the other one replacing the default components
899 of this object (i.e. equal to -1) with those of the other.
74a57fcd 900 """
54f9ee45 901 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 902
e811c8ce 903 def Get(*args, **kwargs):
0df68c9f
RD
904 """
905 Get() -> (width,height)
e811c8ce 906
0df68c9f
RD
907 Returns the width and height properties as a tuple.
908 """
54f9ee45 909 return _core_.Size_Get(*args, **kwargs)
e811c8ce 910
41e2b43e 911 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
912 def __str__(self): return str(self.Get())
913 def __repr__(self): return 'wx.Size'+str(self.Get())
914 def __len__(self): return len(self.Get())
915 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
916 def __setitem__(self, index, val):
917 if index == 0: self.width = val
918 elif index == 1: self.height = val
919 else: raise IndexError
e811c8ce 920 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
921 __safe_for_unpickling__ = True
922 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28
RD
923
924
925class SizePtr(Size):
926 def __init__(self, this):
927 self.this = this
928 if not hasattr(self,"thisown"): self.thisown = 0
929 self.__class__ = Size
54f9ee45 930_core_.Size_swigregister(SizePtr)
d14a1e28
RD
931
932#---------------------------------------------------------------------------
933
934class RealPoint(object):
0df68c9f 935 """
41e2b43e
RD
936 A data structure for representing a point or position with floating
937 point x and y properties. In wxPython most places that expect a
938 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 939 """
e811c8ce
RD
940 def __repr__(self):
941 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
942 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
943 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
d14a1e28 944 def __init__(self, *args, **kwargs):
0df68c9f 945 """
a95a7133 946 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 947
0df68c9f
RD
948 Create a wx.RealPoint object
949 """
54f9ee45 950 newobj = _core_.new_RealPoint(*args, **kwargs)
d14a1e28
RD
951 self.this = newobj.this
952 self.thisown = 1
953 del newobj.thisown
54f9ee45 954 def __del__(self, destroy=_core_.delete_RealPoint):
a95a7133 955 """__del__(self)"""
d14a1e28
RD
956 try:
957 if self.thisown: destroy(self)
958 except: pass
e811c8ce
RD
959
960 def __eq__(*args, **kwargs):
0df68c9f 961 """
a95a7133 962 __eq__(self, RealPoint pt) -> bool
e811c8ce 963
0df68c9f
RD
964 Test for equality of wx.RealPoint objects.
965 """
54f9ee45 966 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
967
968 def __ne__(*args, **kwargs):
0df68c9f 969 """
a95a7133 970 __ne__(self, RealPoint pt) -> bool
e811c8ce 971
0df68c9f
RD
972 Test for inequality of wx.RealPoint objects.
973 """
54f9ee45 974 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
975
976 def __add__(*args, **kwargs):
0df68c9f 977 """
a95a7133 978 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 979
0df68c9f
RD
980 Add pt's proprties to this and return the result.
981 """
54f9ee45 982 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
983
984 def __sub__(*args, **kwargs):
0df68c9f 985 """
a95a7133 986 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 987
0df68c9f
RD
988 Subtract pt's proprties from this and return the result
989 """
54f9ee45 990 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
991
992 def Set(*args, **kwargs):
0df68c9f 993 """
a95a7133 994 Set(self, double x, double y)
e811c8ce 995
0df68c9f
RD
996 Set both the x and y properties
997 """
54f9ee45 998 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
999
1000 def Get(*args, **kwargs):
0df68c9f
RD
1001 """
1002 Get() -> (x,y)
e811c8ce 1003
0df68c9f
RD
1004 Return the x and y properties as a tuple.
1005 """
54f9ee45 1006 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 1007
41e2b43e 1008 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1009 def __str__(self): return str(self.Get())
1010 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1011 def __len__(self): return len(self.Get())
1012 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1013 def __setitem__(self, index, val):
e811c8ce
RD
1014 if index == 0: self.x = val
1015 elif index == 1: self.y = val
d14a1e28 1016 else: raise IndexError
e811c8ce 1017 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1018 __safe_for_unpickling__ = True
1019 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28
RD
1020
1021
1022class RealPointPtr(RealPoint):
1023 def __init__(self, this):
1024 self.this = this
1025 if not hasattr(self,"thisown"): self.thisown = 0
1026 self.__class__ = RealPoint
54f9ee45 1027_core_.RealPoint_swigregister(RealPointPtr)
d14a1e28
RD
1028
1029#---------------------------------------------------------------------------
1030
1031class Point(object):
0df68c9f 1032 """
41e2b43e
RD
1033 A data structure for representing a point or position with integer x
1034 and y properties. Most places in wxPython that expect a wx.Point can
1035 also accept a (x,y) tuple.
0df68c9f 1036 """
e811c8ce
RD
1037 def __repr__(self):
1038 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
1039 x = property(_core_.Point_x_get, _core_.Point_x_set)
1040 y = property(_core_.Point_y_get, _core_.Point_y_set)
d14a1e28 1041 def __init__(self, *args, **kwargs):
0df68c9f 1042 """
a95a7133 1043 __init__(self, int x=0, int y=0) -> Point
e811c8ce 1044
0df68c9f
RD
1045 Create a wx.Point object
1046 """
54f9ee45 1047 newobj = _core_.new_Point(*args, **kwargs)
d14a1e28
RD
1048 self.this = newobj.this
1049 self.thisown = 1
1050 del newobj.thisown
54f9ee45 1051 def __del__(self, destroy=_core_.delete_Point):
a95a7133 1052 """__del__(self)"""
d14a1e28
RD
1053 try:
1054 if self.thisown: destroy(self)
1055 except: pass
e811c8ce
RD
1056
1057 def __eq__(*args, **kwargs):
0df68c9f 1058 """
a95a7133 1059 __eq__(self, Point pt) -> bool
e811c8ce 1060
0df68c9f
RD
1061 Test for equality of wx.Point objects.
1062 """
54f9ee45 1063 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
1064
1065 def __ne__(*args, **kwargs):
0df68c9f 1066 """
a95a7133 1067 __ne__(self, Point pt) -> bool
e811c8ce 1068
0df68c9f
RD
1069 Test for inequality of wx.Point objects.
1070 """
54f9ee45 1071 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
1072
1073 def __add__(*args, **kwargs):
0df68c9f 1074 """
a95a7133 1075 __add__(self, Point pt) -> Point
e811c8ce 1076
0df68c9f
RD
1077 Add pt's proprties to this and return the result.
1078 """
54f9ee45 1079 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
1080
1081 def __sub__(*args, **kwargs):
0df68c9f 1082 """
a95a7133 1083 __sub__(self, Point pt) -> Point
e811c8ce 1084
0df68c9f
RD
1085 Subtract pt's proprties from this and return the result
1086 """
54f9ee45 1087 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
1088
1089 def __iadd__(*args, **kwargs):
0df68c9f 1090 """
a95a7133 1091 __iadd__(self, Point pt) -> Point
e811c8ce 1092
0df68c9f
RD
1093 Add pt to this object.
1094 """
54f9ee45 1095 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
1096
1097 def __isub__(*args, **kwargs):
0df68c9f 1098 """
a95a7133 1099 __isub__(self, Point pt) -> Point
e811c8ce 1100
0df68c9f
RD
1101 Subtract pt from this object.
1102 """
54f9ee45 1103 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
1104
1105 def Set(*args, **kwargs):
0df68c9f 1106 """
a95a7133 1107 Set(self, long x, long y)
e811c8ce 1108
0df68c9f
RD
1109 Set both the x and y properties
1110 """
54f9ee45 1111 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
1112
1113 def Get(*args, **kwargs):
0df68c9f
RD
1114 """
1115 Get() -> (x,y)
e811c8ce 1116
0df68c9f
RD
1117 Return the x and y properties as a tuple.
1118 """
54f9ee45 1119 return _core_.Point_Get(*args, **kwargs)
e811c8ce 1120
41e2b43e 1121 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1122 def __str__(self): return str(self.Get())
1123 def __repr__(self): return 'wx.Point'+str(self.Get())
1124 def __len__(self): return len(self.Get())
1125 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1126 def __setitem__(self, index, val):
1127 if index == 0: self.x = val
1128 elif index == 1: self.y = val
1129 else: raise IndexError
e811c8ce 1130 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
1131 __safe_for_unpickling__ = True
1132 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28
RD
1133
1134
1135class PointPtr(Point):
1136 def __init__(self, this):
1137 self.this = this
1138 if not hasattr(self,"thisown"): self.thisown = 0
1139 self.__class__ = Point
54f9ee45 1140_core_.Point_swigregister(PointPtr)
d14a1e28
RD
1141
1142#---------------------------------------------------------------------------
1143
1144class Rect(object):
0df68c9f 1145 """
41e2b43e
RD
1146 A class for representing and manipulating rectangles. It has x, y,
1147 width and height properties. In wxPython most palces that expect a
1148 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1149 """
e811c8ce
RD
1150 def __repr__(self):
1151 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1152 def __init__(self, *args, **kwargs):
0df68c9f 1153 """
a95a7133 1154 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1155
0df68c9f
RD
1156 Create a new Rect object.
1157 """
54f9ee45 1158 newobj = _core_.new_Rect(*args, **kwargs)
d14a1e28
RD
1159 self.this = newobj.this
1160 self.thisown = 1
1161 del newobj.thisown
54f9ee45 1162 def __del__(self, destroy=_core_.delete_Rect):
a95a7133 1163 """__del__(self)"""
d14a1e28
RD
1164 try:
1165 if self.thisown: destroy(self)
1166 except: pass
e811c8ce
RD
1167
1168 def GetX(*args, **kwargs):
a95a7133 1169 """GetX(self) -> int"""
54f9ee45 1170 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1171
1172 def SetX(*args, **kwargs):
a95a7133 1173 """SetX(self, int x)"""
54f9ee45 1174 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1175
1176 def GetY(*args, **kwargs):
a95a7133 1177 """GetY(self) -> int"""
54f9ee45 1178 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1179
1180 def SetY(*args, **kwargs):
a95a7133 1181 """SetY(self, int y)"""
54f9ee45 1182 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1183
1184 def GetWidth(*args, **kwargs):
a95a7133 1185 """GetWidth(self) -> int"""
54f9ee45 1186 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1187
1188 def SetWidth(*args, **kwargs):
a95a7133 1189 """SetWidth(self, int w)"""
54f9ee45 1190 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1191
1192 def GetHeight(*args, **kwargs):
a95a7133 1193 """GetHeight(self) -> int"""
54f9ee45 1194 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1195
1196 def SetHeight(*args, **kwargs):
a95a7133 1197 """SetHeight(self, int h)"""
54f9ee45 1198 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1199
1200 def GetPosition(*args, **kwargs):
a95a7133 1201 """GetPosition(self) -> Point"""
54f9ee45 1202 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1203
1204 def SetPosition(*args, **kwargs):
a95a7133 1205 """SetPosition(self, Point p)"""
54f9ee45 1206 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1207
1208 def GetSize(*args, **kwargs):
a95a7133 1209 """GetSize(self) -> Size"""
54f9ee45 1210 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1211
1212 def SetSize(*args, **kwargs):
a95a7133 1213 """SetSize(self, Size s)"""
54f9ee45 1214 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1215
aff4cc5c
RD
1216 def IsEmpty(*args, **kwargs):
1217 """IsEmpty(self) -> bool"""
1218 return _core_.Rect_IsEmpty(*args, **kwargs)
1219
c9c7117a 1220 def GetTopLeft(*args, **kwargs):
a95a7133 1221 """GetTopLeft(self) -> Point"""
54f9ee45 1222 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1223
1224 def SetTopLeft(*args, **kwargs):
a95a7133 1225 """SetTopLeft(self, Point p)"""
54f9ee45 1226 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1227
1228 def GetBottomRight(*args, **kwargs):
a95a7133 1229 """GetBottomRight(self) -> Point"""
54f9ee45 1230 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1231
1232 def SetBottomRight(*args, **kwargs):
a95a7133 1233 """SetBottomRight(self, Point p)"""
54f9ee45 1234 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1235
e811c8ce 1236 def GetLeft(*args, **kwargs):
a95a7133 1237 """GetLeft(self) -> int"""
54f9ee45 1238 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1239
1240 def GetTop(*args, **kwargs):
a95a7133 1241 """GetTop(self) -> int"""
54f9ee45 1242 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1243
1244 def GetBottom(*args, **kwargs):
a95a7133 1245 """GetBottom(self) -> int"""
54f9ee45 1246 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1247
1248 def GetRight(*args, **kwargs):
a95a7133 1249 """GetRight(self) -> int"""
54f9ee45 1250 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1251
1252 def SetLeft(*args, **kwargs):
a95a7133 1253 """SetLeft(self, int left)"""
54f9ee45 1254 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1255
1256 def SetRight(*args, **kwargs):
a95a7133 1257 """SetRight(self, int right)"""
54f9ee45 1258 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1259
1260 def SetTop(*args, **kwargs):
a95a7133 1261 """SetTop(self, int top)"""
54f9ee45 1262 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1263
1264 def SetBottom(*args, **kwargs):
a95a7133 1265 """SetBottom(self, int bottom)"""
54f9ee45 1266 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1267
1268 position = property(GetPosition, SetPosition)
1269 size = property(GetSize, SetSize)
1270 left = property(GetLeft, SetLeft)
1271 right = property(GetRight, SetRight)
1272 top = property(GetTop, SetTop)
1273 bottom = property(GetBottom, SetBottom)
1274
1275 def Inflate(*args, **kwargs):
0df68c9f 1276 """
a95a7133 1277 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1278
8e738329
RD
1279 Increases the size of the rectangle.
1280
1281 The left border is moved farther left and the right border is moved
1282 farther right by ``dx``. The upper border is moved farther up and the
1283 bottom border is moved farther down by ``dy``. (Note the the width and
1284 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1285 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1286 opposite happens: the rectangle size decreases in the respective
1287 direction.
1288
1289 The change is made to the rectangle inplace, if instead you need a
1290 copy that is inflated, preserving the original then make the copy
1291 first::
1292
1293 copy = wx.Rect(*original)
1294 copy.Inflate(10,15)
1295
1296
0df68c9f 1297 """
54f9ee45 1298 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1299
1300 def Deflate(*args, **kwargs):
0df68c9f 1301 """
a95a7133 1302 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1303
8e738329
RD
1304 Decrease the rectangle size. This method is the opposite of `Inflate`
1305 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1306 `Inflate` for a full description.
0df68c9f 1307 """
54f9ee45 1308 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1309
1310 def OffsetXY(*args, **kwargs):
0df68c9f 1311 """
a95a7133 1312 OffsetXY(self, int dx, int dy)
e811c8ce 1313
41e2b43e
RD
1314 Moves the rectangle by the specified offset. If dx is positive, the
1315 rectangle is moved to the right, if dy is positive, it is moved to the
1316 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1317 """
54f9ee45 1318 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1319
1320 def Offset(*args, **kwargs):
0df68c9f 1321 """
a95a7133 1322 Offset(self, Point pt)
e811c8ce 1323
b1fcee84 1324 Same as `OffsetXY` but uses dx,dy from Point
0df68c9f 1325 """
54f9ee45 1326 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1327
1328 def Intersect(*args, **kwargs):
0df68c9f 1329 """
a95a7133 1330 Intersect(self, Rect rect) -> Rect
e811c8ce 1331
5cbf236d 1332 Returns the intersectsion of this rectangle and rect.
0df68c9f 1333 """
54f9ee45 1334 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce 1335
5cbf236d
RD
1336 def Union(*args, **kwargs):
1337 """
1338 Union(self, Rect rect) -> Rect
1339
1340 Returns the union of this rectangle and rect.
1341 """
1342 return _core_.Rect_Union(*args, **kwargs)
1343
e811c8ce 1344 def __add__(*args, **kwargs):
0df68c9f 1345 """
a95a7133 1346 __add__(self, Rect rect) -> Rect
e811c8ce 1347
0df68c9f
RD
1348 Add the properties of rect to this rectangle and return the result.
1349 """
54f9ee45 1350 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1351
1352 def __iadd__(*args, **kwargs):
0df68c9f 1353 """
a95a7133 1354 __iadd__(self, Rect rect) -> Rect
e811c8ce 1355
0df68c9f
RD
1356 Add the properties of rect to this rectangle, updating this rectangle.
1357 """
54f9ee45 1358 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1359
1360 def __eq__(*args, **kwargs):
0df68c9f 1361 """
a95a7133 1362 __eq__(self, Rect rect) -> bool
e811c8ce 1363
0df68c9f
RD
1364 Test for equality.
1365 """
54f9ee45 1366 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1367
1368 def __ne__(*args, **kwargs):
0df68c9f 1369 """
a95a7133 1370 __ne__(self, Rect rect) -> bool
e811c8ce 1371
0df68c9f
RD
1372 Test for inequality.
1373 """
54f9ee45 1374 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce
RD
1375
1376 def InsideXY(*args, **kwargs):
0df68c9f 1377 """
a95a7133 1378 InsideXY(self, int x, int y) -> bool
e811c8ce 1379
0df68c9f
RD
1380 Return True if the point is (not strcitly) inside the rect.
1381 """
54f9ee45 1382 return _core_.Rect_InsideXY(*args, **kwargs)
e811c8ce
RD
1383
1384 def Inside(*args, **kwargs):
0df68c9f 1385 """
a95a7133 1386 Inside(self, Point pt) -> bool
e811c8ce 1387
0df68c9f
RD
1388 Return True if the point is (not strcitly) inside the rect.
1389 """
54f9ee45 1390 return _core_.Rect_Inside(*args, **kwargs)
e811c8ce
RD
1391
1392 def Intersects(*args, **kwargs):
0df68c9f 1393 """
a95a7133 1394 Intersects(self, Rect rect) -> bool
e811c8ce 1395
0df68c9f
RD
1396 Returns True if the rectangles have a non empty intersection.
1397 """
54f9ee45 1398 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1399
b1fcee84
RD
1400 def CenterIn(*args, **kwargs):
1401 """
1402 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1403
1404 Center this rectangle within the one passed to the method, which is
1405 usually, but not necessarily, the larger one.
1406 """
1407 return _core_.Rect_CenterIn(*args, **kwargs)
1408
1409 CentreIn = CenterIn
54f9ee45
RD
1410 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1411 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1412 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1413 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1414 def Set(*args, **kwargs):
0df68c9f 1415 """
a95a7133 1416 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1417
0df68c9f
RD
1418 Set all rectangle properties.
1419 """
54f9ee45 1420 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1421
1422 def Get(*args, **kwargs):
0df68c9f
RD
1423 """
1424 Get() -> (x,y,width,height)
e811c8ce 1425
0df68c9f
RD
1426 Return the rectangle properties as a tuple.
1427 """
54f9ee45 1428 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1429
41e2b43e 1430 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1431 def __str__(self): return str(self.Get())
1432 def __repr__(self): return 'wx.Rect'+str(self.Get())
1433 def __len__(self): return len(self.Get())
1434 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1435 def __setitem__(self, index, val):
1436 if index == 0: self.x = val
1437 elif index == 1: self.y = val
1438 elif index == 2: self.width = val
1439 elif index == 3: self.height = val
1440 else: raise IndexError
e811c8ce 1441 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1442 __safe_for_unpickling__ = True
1443 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28
RD
1444
1445
1446class RectPtr(Rect):
1447 def __init__(self, this):
1448 self.this = this
1449 if not hasattr(self,"thisown"): self.thisown = 0
1450 self.__class__ = Rect
54f9ee45 1451_core_.Rect_swigregister(RectPtr)
d14a1e28
RD
1452
1453def RectPP(*args, **kwargs):
0df68c9f
RD
1454 """
1455 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1456
0df68c9f
RD
1457 Create a new Rect object from Points representing two corners.
1458 """
54f9ee45 1459 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1460 val.thisown = 1
1461 return val
1462
1463def RectPS(*args, **kwargs):
0df68c9f
RD
1464 """
1465 RectPS(Point pos, Size size) -> Rect
e811c8ce 1466
0df68c9f
RD
1467 Create a new Rect from a position and size.
1468 """
54f9ee45 1469 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1470 val.thisown = 1
1471 return val
1472
d3b6e4ff
RD
1473def RectS(*args, **kwargs):
1474 """
1475 RectS(Size size) -> Rect
1476
1477 Create a new Rect from a size only.
1478 """
1479 val = _core_.new_RectS(*args, **kwargs)
1480 val.thisown = 1
1481 return val
1482
d14a1e28 1483
e811c8ce 1484def IntersectRect(*args, **kwargs):
0df68c9f
RD
1485 """
1486 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1487
0df68c9f
RD
1488 Calculate and return the intersection of r1 and r2.
1489 """
54f9ee45 1490 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1491#---------------------------------------------------------------------------
1492
1493class Point2D(object):
41e2b43e
RD
1494 """
1495 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1496 with floating point values.
1497 """
e811c8ce
RD
1498 def __repr__(self):
1499 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1500 def __init__(self, *args, **kwargs):
0df68c9f 1501 """
a95a7133 1502 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1503
0df68c9f
RD
1504 Create a w.Point2D object.
1505 """
54f9ee45 1506 newobj = _core_.new_Point2D(*args, **kwargs)
d14a1e28
RD
1507 self.this = newobj.this
1508 self.thisown = 1
1509 del newobj.thisown
e811c8ce 1510 def GetFloor(*args, **kwargs):
fd2dc343
RD
1511 """
1512 GetFloor() -> (x,y)
1513
1514 Convert to integer
1515 """
54f9ee45 1516 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1517
1518 def GetRounded(*args, **kwargs):
fd2dc343
RD
1519 """
1520 GetRounded() -> (x,y)
1521
1522 Convert to integer
1523 """
54f9ee45 1524 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1525
1526 def GetVectorLength(*args, **kwargs):
a95a7133 1527 """GetVectorLength(self) -> double"""
54f9ee45 1528 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1529
1530 def GetVectorAngle(*args, **kwargs):
a95a7133 1531 """GetVectorAngle(self) -> double"""
54f9ee45 1532 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1533
1534 def SetVectorLength(*args, **kwargs):
a95a7133 1535 """SetVectorLength(self, double length)"""
54f9ee45 1536 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1537
1538 def SetVectorAngle(*args, **kwargs):
a95a7133 1539 """SetVectorAngle(self, double degrees)"""
54f9ee45 1540 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1541
d14a1e28
RD
1542 def SetPolarCoordinates(self, angle, length):
1543 self.SetVectorLength(length)
1544 self.SetVectorAngle(angle)
1545 def Normalize(self):
1546 self.SetVectorLength(1.0)
1547
e811c8ce 1548 def GetDistance(*args, **kwargs):
a95a7133 1549 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1550 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1551
1552 def GetDistanceSquare(*args, **kwargs):
a95a7133 1553 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1554 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1555
1556 def GetDotProduct(*args, **kwargs):
a95a7133 1557 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1558 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1559
1560 def GetCrossProduct(*args, **kwargs):
a95a7133 1561 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1562 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1563
1564 def __neg__(*args, **kwargs):
0df68c9f 1565 """
a95a7133 1566 __neg__(self) -> Point2D
e811c8ce 1567
0df68c9f
RD
1568 the reflection of this point
1569 """
54f9ee45 1570 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1571
1572 def __iadd__(*args, **kwargs):
a95a7133 1573 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1574 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1575
1576 def __isub__(*args, **kwargs):
a95a7133 1577 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1578 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1579
1580 def __imul__(*args, **kwargs):
a95a7133 1581 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1582 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1583
1584 def __idiv__(*args, **kwargs):
a95a7133 1585 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1586 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1587
1588 def __eq__(*args, **kwargs):
0df68c9f 1589 """
a95a7133 1590 __eq__(self, Point2D pt) -> bool
e811c8ce 1591
0df68c9f
RD
1592 Test for equality
1593 """
54f9ee45 1594 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1595
1596 def __ne__(*args, **kwargs):
0df68c9f 1597 """
a95a7133 1598 __ne__(self, Point2D pt) -> bool
e811c8ce 1599
0df68c9f
RD
1600 Test for inequality
1601 """
54f9ee45 1602 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1603
54f9ee45
RD
1604 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1605 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1606 def Set(*args, **kwargs):
a95a7133 1607 """Set(self, double x=0, double y=0)"""
54f9ee45 1608 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1609
1610 def Get(*args, **kwargs):
0df68c9f
RD
1611 """
1612 Get() -> (x,y)
e811c8ce 1613
0df68c9f
RD
1614 Return x and y properties as a tuple.
1615 """
54f9ee45 1616 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1617
41e2b43e 1618 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1619 def __str__(self): return str(self.Get())
1620 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1621 def __len__(self): return len(self.Get())
1622 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1623 def __setitem__(self, index, val):
e811c8ce
RD
1624 if index == 0: self.x = val
1625 elif index == 1: self.y = val
d14a1e28 1626 else: raise IndexError
e811c8ce 1627 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1628 __safe_for_unpickling__ = True
1629 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28
RD
1630
1631
1632class Point2DPtr(Point2D):
1633 def __init__(self, this):
1634 self.this = this
1635 if not hasattr(self,"thisown"): self.thisown = 0
1636 self.__class__ = Point2D
54f9ee45 1637_core_.Point2D_swigregister(Point2DPtr)
d14a1e28
RD
1638
1639def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1640 """
1641 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1642
0df68c9f
RD
1643 Create a w.Point2D object.
1644 """
54f9ee45 1645 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1646 val.thisown = 1
1647 return val
1648
1649def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1650 """
1651 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1652
0df68c9f
RD
1653 Create a w.Point2D object.
1654 """
54f9ee45 1655 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1656 val.thisown = 1
1657 return val
1658
1659#---------------------------------------------------------------------------
1660
54f9ee45
RD
1661FromStart = _core_.FromStart
1662FromCurrent = _core_.FromCurrent
1663FromEnd = _core_.FromEnd
d14a1e28 1664class InputStream(object):
093d3ff1 1665 """Proxy of C++ InputStream class"""
e811c8ce
RD
1666 def __repr__(self):
1667 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1668 def __init__(self, *args, **kwargs):
a95a7133 1669 """__init__(self, PyObject p) -> InputStream"""
54f9ee45 1670 newobj = _core_.new_InputStream(*args, **kwargs)
d14a1e28
RD
1671 self.this = newobj.this
1672 self.thisown = 1
1673 del newobj.thisown
8fb0e70a
RD
1674 def __del__(self, destroy=_core_.delete_InputStream):
1675 """__del__(self)"""
1676 try:
1677 if self.thisown: destroy(self)
1678 except: pass
1679
e811c8ce 1680 def close(*args, **kwargs):
a95a7133 1681 """close(self)"""
54f9ee45 1682 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1683
1684 def flush(*args, **kwargs):
a95a7133 1685 """flush(self)"""
54f9ee45 1686 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1687
1688 def eof(*args, **kwargs):
a95a7133 1689 """eof(self) -> bool"""
54f9ee45 1690 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1691
1692 def read(*args, **kwargs):
a95a7133 1693 """read(self, int size=-1) -> PyObject"""
54f9ee45 1694 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1695
1696 def readline(*args, **kwargs):
a95a7133 1697 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1698 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1699
1700 def readlines(*args, **kwargs):
a95a7133 1701 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1702 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1703
1704 def seek(*args, **kwargs):
a95a7133 1705 """seek(self, int offset, int whence=0)"""
54f9ee45 1706 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1707
1708 def tell(*args, **kwargs):
a95a7133 1709 """tell(self) -> int"""
54f9ee45 1710 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1711
1712 def Peek(*args, **kwargs):
a95a7133 1713 """Peek(self) -> char"""
54f9ee45 1714 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1715
1716 def GetC(*args, **kwargs):
a95a7133 1717 """GetC(self) -> char"""
54f9ee45 1718 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1719
1720 def LastRead(*args, **kwargs):
a95a7133 1721 """LastRead(self) -> size_t"""
54f9ee45 1722 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1723
1724 def CanRead(*args, **kwargs):
a95a7133 1725 """CanRead(self) -> bool"""
54f9ee45 1726 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1727
1728 def Eof(*args, **kwargs):
a95a7133 1729 """Eof(self) -> bool"""
54f9ee45 1730 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1731
1732 def Ungetch(*args, **kwargs):
a95a7133 1733 """Ungetch(self, char c) -> bool"""
54f9ee45 1734 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1735
1736 def SeekI(*args, **kwargs):
a95a7133 1737 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1738 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1739
1740 def TellI(*args, **kwargs):
a95a7133 1741 """TellI(self) -> long"""
54f9ee45 1742 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1743
d14a1e28
RD
1744
1745class InputStreamPtr(InputStream):
1746 def __init__(self, this):
1747 self.this = this
1748 if not hasattr(self,"thisown"): self.thisown = 0
1749 self.__class__ = InputStream
54f9ee45 1750_core_.InputStream_swigregister(InputStreamPtr)
d14a1e28
RD
1751DefaultPosition = cvar.DefaultPosition
1752DefaultSize = cvar.DefaultSize
1753
1754class OutputStream(object):
093d3ff1 1755 """Proxy of C++ OutputStream class"""
d14a1e28
RD
1756 def __init__(self): raise RuntimeError, "No constructor defined"
1757 def __repr__(self):
1758 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 1759 def write(*args, **kwargs):
a95a7133 1760 """write(self, PyObject obj)"""
54f9ee45 1761 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 1762
d14a1e28
RD
1763
1764class OutputStreamPtr(OutputStream):
1765 def __init__(self, this):
1766 self.this = this
1767 if not hasattr(self,"thisown"): self.thisown = 0
1768 self.__class__ = OutputStream
54f9ee45 1769_core_.OutputStream_swigregister(OutputStreamPtr)
d14a1e28
RD
1770
1771#---------------------------------------------------------------------------
1772
1773class FSFile(Object):
093d3ff1 1774 """Proxy of C++ FSFile class"""
e811c8ce
RD
1775 def __repr__(self):
1776 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1777 def __init__(self, *args, **kwargs):
0df68c9f 1778 """
a95a7133 1779 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 1780 DateTime modif) -> FSFile
0df68c9f 1781 """
54f9ee45 1782 newobj = _core_.new_FSFile(*args, **kwargs)
d14a1e28
RD
1783 self.this = newobj.this
1784 self.thisown = 1
1785 del newobj.thisown
e2950dbb 1786 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1787
54f9ee45 1788 def __del__(self, destroy=_core_.delete_FSFile):
a95a7133 1789 """__del__(self)"""
d14a1e28
RD
1790 try:
1791 if self.thisown: destroy(self)
1792 except: pass
e811c8ce
RD
1793
1794 def GetStream(*args, **kwargs):
a95a7133 1795 """GetStream(self) -> InputStream"""
54f9ee45 1796 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce
RD
1797
1798 def GetMimeType(*args, **kwargs):
a95a7133 1799 """GetMimeType(self) -> String"""
54f9ee45 1800 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
1801
1802 def GetLocation(*args, **kwargs):
a95a7133 1803 """GetLocation(self) -> String"""
54f9ee45 1804 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
1805
1806 def GetAnchor(*args, **kwargs):
a95a7133 1807 """GetAnchor(self) -> String"""
54f9ee45 1808 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
1809
1810 def GetModificationTime(*args, **kwargs):
a95a7133 1811 """GetModificationTime(self) -> DateTime"""
54f9ee45 1812 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 1813
d14a1e28
RD
1814
1815class FSFilePtr(FSFile):
1816 def __init__(self, this):
1817 self.this = this
1818 if not hasattr(self,"thisown"): self.thisown = 0
1819 self.__class__ = FSFile
54f9ee45 1820_core_.FSFile_swigregister(FSFilePtr)
d14a1e28
RD
1821
1822class CPPFileSystemHandler(object):
093d3ff1 1823 """Proxy of C++ CPPFileSystemHandler class"""
d14a1e28
RD
1824 def __init__(self): raise RuntimeError, "No constructor defined"
1825 def __repr__(self):
1826 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1827
1828class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1829 def __init__(self, this):
1830 self.this = this
1831 if not hasattr(self,"thisown"): self.thisown = 0
1832 self.__class__ = CPPFileSystemHandler
54f9ee45 1833_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
d14a1e28
RD
1834
1835class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1836 """Proxy of C++ FileSystemHandler class"""
e811c8ce
RD
1837 def __repr__(self):
1838 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1839 def __init__(self, *args, **kwargs):
a95a7133 1840 """__init__(self) -> FileSystemHandler"""
54f9ee45 1841 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
d14a1e28
RD
1842 self.this = newobj.this
1843 self.thisown = 1
1844 del newobj.thisown
1845 self._setCallbackInfo(self, FileSystemHandler)
e811c8ce
RD
1846
1847 def _setCallbackInfo(*args, **kwargs):
a95a7133 1848 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 1849 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
1850
1851 def CanOpen(*args, **kwargs):
a95a7133 1852 """CanOpen(self, String location) -> bool"""
54f9ee45 1853 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1854
1855 def OpenFile(*args, **kwargs):
a95a7133 1856 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1857 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1858
1859 def FindFirst(*args, **kwargs):
a95a7133 1860 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1861 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1862
1863 def FindNext(*args, **kwargs):
a95a7133 1864 """FindNext(self) -> String"""
54f9ee45 1865 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
1866
1867 def GetProtocol(*args, **kwargs):
a95a7133 1868 """GetProtocol(self, String location) -> String"""
54f9ee45 1869 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
1870
1871 def GetLeftLocation(*args, **kwargs):
a95a7133 1872 """GetLeftLocation(self, String location) -> String"""
54f9ee45 1873 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
1874
1875 def GetAnchor(*args, **kwargs):
a95a7133 1876 """GetAnchor(self, String location) -> String"""
54f9ee45 1877 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
1878
1879 def GetRightLocation(*args, **kwargs):
a95a7133 1880 """GetRightLocation(self, String location) -> String"""
54f9ee45 1881 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
1882
1883 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 1884 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 1885 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 1886
d14a1e28
RD
1887
1888class FileSystemHandlerPtr(FileSystemHandler):
1889 def __init__(self, this):
1890 self.this = this
1891 if not hasattr(self,"thisown"): self.thisown = 0
1892 self.__class__ = FileSystemHandler
54f9ee45 1893_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
d14a1e28
RD
1894
1895class FileSystem(Object):
093d3ff1 1896 """Proxy of C++ FileSystem class"""
e811c8ce
RD
1897 def __repr__(self):
1898 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1899 def __init__(self, *args, **kwargs):
a95a7133 1900 """__init__(self) -> FileSystem"""
54f9ee45 1901 newobj = _core_.new_FileSystem(*args, **kwargs)
d14a1e28
RD
1902 self.this = newobj.this
1903 self.thisown = 1
1904 del newobj.thisown
54f9ee45 1905 def __del__(self, destroy=_core_.delete_FileSystem):
a95a7133 1906 """__del__(self)"""
d14a1e28
RD
1907 try:
1908 if self.thisown: destroy(self)
1909 except: pass
e811c8ce
RD
1910
1911 def ChangePathTo(*args, **kwargs):
a95a7133 1912 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 1913 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
1914
1915 def GetPath(*args, **kwargs):
a95a7133 1916 """GetPath(self) -> String"""
54f9ee45 1917 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
1918
1919 def OpenFile(*args, **kwargs):
a95a7133 1920 """OpenFile(self, String location) -> FSFile"""
54f9ee45 1921 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
1922
1923 def FindFirst(*args, **kwargs):
a95a7133 1924 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1925 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
1926
1927 def FindNext(*args, **kwargs):
a95a7133 1928 """FindNext(self) -> String"""
54f9ee45 1929 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
1930
1931 def AddHandler(*args, **kwargs):
66c033b4 1932 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1933 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
1934
1935 AddHandler = staticmethod(AddHandler)
1936 def CleanUpHandlers(*args, **kwargs):
66c033b4 1937 """CleanUpHandlers()"""
54f9ee45 1938 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
1939
1940 CleanUpHandlers = staticmethod(CleanUpHandlers)
1941 def FileNameToURL(*args, **kwargs):
66c033b4 1942 """FileNameToURL(String filename) -> String"""
54f9ee45 1943 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
1944
1945 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
1946 def URLToFileName(*args, **kwargs):
1947 """URLToFileName(String url) -> String"""
1948 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1949
1950 URLToFileName = staticmethod(URLToFileName)
d14a1e28
RD
1951
1952class FileSystemPtr(FileSystem):
1953 def __init__(self, this):
1954 self.this = this
1955 if not hasattr(self,"thisown"): self.thisown = 0
1956 self.__class__ = FileSystem
54f9ee45 1957_core_.FileSystem_swigregister(FileSystemPtr)
d14a1e28 1958
e811c8ce
RD
1959def FileSystem_AddHandler(*args, **kwargs):
1960 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1961 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 1962
e811c8ce
RD
1963def FileSystem_CleanUpHandlers(*args, **kwargs):
1964 """FileSystem_CleanUpHandlers()"""
54f9ee45 1965 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d14a1e28 1966
e811c8ce 1967def FileSystem_FileNameToURL(*args, **kwargs):
196addbf 1968 """FileSystem_FileNameToURL(String filename) -> String"""
54f9ee45 1969 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 1970
e811c8ce 1971def FileSystem_URLToFileName(*args, **kwargs):
196addbf 1972 """FileSystem_URLToFileName(String url) -> String"""
54f9ee45 1973 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 1974
d14a1e28 1975class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1976 """Proxy of C++ InternetFSHandler class"""
e811c8ce
RD
1977 def __repr__(self):
1978 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1979 def __init__(self, *args, **kwargs):
a95a7133 1980 """__init__(self) -> InternetFSHandler"""
54f9ee45 1981 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
d14a1e28
RD
1982 self.this = newobj.this
1983 self.thisown = 1
1984 del newobj.thisown
e811c8ce 1985 def CanOpen(*args, **kwargs):
a95a7133 1986 """CanOpen(self, String location) -> bool"""
54f9ee45 1987 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1988
1989 def OpenFile(*args, **kwargs):
a95a7133 1990 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1991 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 1992
d14a1e28
RD
1993
1994class InternetFSHandlerPtr(InternetFSHandler):
1995 def __init__(self, this):
1996 self.this = this
1997 if not hasattr(self,"thisown"): self.thisown = 0
1998 self.__class__ = InternetFSHandler
54f9ee45 1999_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
d14a1e28
RD
2000
2001class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 2002 """Proxy of C++ ZipFSHandler class"""
e811c8ce
RD
2003 def __repr__(self):
2004 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2005 def __init__(self, *args, **kwargs):
a95a7133 2006 """__init__(self) -> ZipFSHandler"""
54f9ee45 2007 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
d14a1e28
RD
2008 self.this = newobj.this
2009 self.thisown = 1
2010 del newobj.thisown
e811c8ce 2011 def CanOpen(*args, **kwargs):
a95a7133 2012 """CanOpen(self, String location) -> bool"""
54f9ee45 2013 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2014
2015 def OpenFile(*args, **kwargs):
a95a7133 2016 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2017 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2018
2019 def FindFirst(*args, **kwargs):
a95a7133 2020 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2021 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2022
2023 def FindNext(*args, **kwargs):
a95a7133 2024 """FindNext(self) -> String"""
54f9ee45 2025 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 2026
d14a1e28
RD
2027
2028class ZipFSHandlerPtr(ZipFSHandler):
2029 def __init__(self, this):
2030 self.this = this
2031 if not hasattr(self,"thisown"): self.thisown = 0
2032 self.__class__ = ZipFSHandler
54f9ee45 2033_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
d14a1e28
RD
2034
2035
e811c8ce 2036def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
196addbf 2037 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
54f9ee45 2038 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 2039
e811c8ce 2040def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
196addbf 2041 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
54f9ee45 2042 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 2043
e811c8ce 2044def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
196addbf 2045 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
54f9ee45 2046 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
2047def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2048 """
2049 Add 'file' to the memory filesystem. The dataItem parameter can
2050 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2051 arbitrary data. If a bitmap or image is used then the imgType
2052 parameter should specify what kind of image file it should be
2053 written as, wx.BITMAP_TYPE_PNG, etc.
2054 """
2055 if isinstance(dataItem, wx.Image):
2056 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2057 elif isinstance(dataItem, wx.Bitmap):
2058 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2059 elif type(dataItem) == str:
2060 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2061 else:
2062 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
2063
2064class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 2065 """Proxy of C++ MemoryFSHandler class"""
e811c8ce
RD
2066 def __repr__(self):
2067 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2068 def __init__(self, *args, **kwargs):
a95a7133 2069 """__init__(self) -> MemoryFSHandler"""
54f9ee45 2070 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
d14a1e28
RD
2071 self.this = newobj.this
2072 self.thisown = 1
2073 del newobj.thisown
e811c8ce 2074 def RemoveFile(*args, **kwargs):
66c033b4 2075 """RemoveFile(String filename)"""
54f9ee45 2076 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
2077
2078 RemoveFile = staticmethod(RemoveFile)
d14a1e28 2079 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 2080 def CanOpen(*args, **kwargs):
a95a7133 2081 """CanOpen(self, String location) -> bool"""
54f9ee45 2082 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2083
2084 def OpenFile(*args, **kwargs):
a95a7133 2085 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2086 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2087
2088 def FindFirst(*args, **kwargs):
a95a7133 2089 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2090 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2091
2092 def FindNext(*args, **kwargs):
a95a7133 2093 """FindNext(self) -> String"""
54f9ee45 2094 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 2095
d14a1e28
RD
2096
2097class MemoryFSHandlerPtr(MemoryFSHandler):
2098 def __init__(self, this):
2099 self.this = this
2100 if not hasattr(self,"thisown"): self.thisown = 0
2101 self.__class__ = MemoryFSHandler
54f9ee45 2102_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
d14a1e28 2103
e811c8ce 2104def MemoryFSHandler_RemoveFile(*args, **kwargs):
196addbf 2105 """MemoryFSHandler_RemoveFile(String filename)"""
54f9ee45 2106 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28 2107
bcd0d7b6
RD
2108IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2109IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2110IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d14a1e28
RD
2111#---------------------------------------------------------------------------
2112
2113class ImageHandler(Object):
27fb7603
RD
2114 """
2115 This is the base class for implementing image file loading/saving, and
2116 image creation from data. It is used within `wx.Image` and is not
2117 normally seen by the application.
2118 """
d14a1e28
RD
2119 def __init__(self): raise RuntimeError, "No constructor defined"
2120 def __repr__(self):
2121 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 2122 def GetName(*args, **kwargs):
a95a7133 2123 """GetName(self) -> String"""
54f9ee45 2124 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
2125
2126 def GetExtension(*args, **kwargs):
a95a7133 2127 """GetExtension(self) -> String"""
54f9ee45 2128 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
2129
2130 def GetType(*args, **kwargs):
a95a7133 2131 """GetType(self) -> long"""
54f9ee45 2132 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
2133
2134 def GetMimeType(*args, **kwargs):
a95a7133 2135 """GetMimeType(self) -> String"""
54f9ee45 2136 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
2137
2138 def CanRead(*args, **kwargs):
a95a7133 2139 """CanRead(self, String name) -> bool"""
54f9ee45 2140 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce
RD
2141
2142 def SetName(*args, **kwargs):
a95a7133 2143 """SetName(self, String name)"""
54f9ee45 2144 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
2145
2146 def SetExtension(*args, **kwargs):
a95a7133 2147 """SetExtension(self, String extension)"""
54f9ee45 2148 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
2149
2150 def SetType(*args, **kwargs):
a95a7133 2151 """SetType(self, long type)"""
54f9ee45 2152 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
2153
2154 def SetMimeType(*args, **kwargs):
a95a7133 2155 """SetMimeType(self, String mimetype)"""
54f9ee45 2156 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 2157
d14a1e28
RD
2158
2159class ImageHandlerPtr(ImageHandler):
2160 def __init__(self, this):
2161 self.this = this
2162 if not hasattr(self,"thisown"): self.thisown = 0
2163 self.__class__ = ImageHandler
54f9ee45 2164_core_.ImageHandler_swigregister(ImageHandlerPtr)
d14a1e28 2165
943e8dfd
RD
2166class PyImageHandler(ImageHandler):
2167 """
2168 This is the base class for implementing image file loading/saving, and
2169 image creation from data, all written in Python. To create a custom
2170 image handler derive a new class from wx.PyImageHandler and provide
2171 the following methods::
2172
2173 def DoCanRead(self, stream) --> bool
2174 '''Check if this handler can read the image on the stream'''
2175
2176 def LoadFile(self, image, stream, verbose, index) --> bool
2177 '''Load image data from the stream and load it into image.'''
2178
2179 def SaveFile(self, image, stream, verbose) --> bool
2180 '''Save the iamge data in image to the stream using
2181 this handler's image file format.'''
2182
2183 def GetImageCount(self, stream) --> int
2184 '''If this image format can hold more than one image,
2185 how many does the image on the stream have?'''
2186
2187 To activate your handler create an instance of it and pass it to
2188 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2189 `SetExtension` from your constructor.
2190
2191 """
2192 def __repr__(self):
2193 return "<%s.%s; proxy of C++ wxPyImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2194 def __init__(self, *args, **kwargs):
2195 """
2196 __init__(self) -> PyImageHandler
2197
2198 This is the base class for implementing image file loading/saving, and
2199 image creation from data, all written in Python. To create a custom
2200 image handler derive a new class from wx.PyImageHandler and provide
2201 the following methods::
2202
2203 def DoCanRead(self, stream) --> bool
2204 '''Check if this handler can read the image on the stream'''
2205
2206 def LoadFile(self, image, stream, verbose, index) --> bool
2207 '''Load image data from the stream and load it into image.'''
2208
2209 def SaveFile(self, image, stream, verbose) --> bool
2210 '''Save the iamge data in image to the stream using
2211 this handler's image file format.'''
2212
2213 def GetImageCount(self, stream) --> int
2214 '''If this image format can hold more than one image,
2215 how many does the image on the stream have?'''
2216
2217 To activate your handler create an instance of it and pass it to
2218 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2219 `SetExtension` from your constructor.
2220
2221 """
2222 newobj = _core_.new_PyImageHandler(*args, **kwargs)
2223 self.this = newobj.this
2224 self.thisown = 1
2225 del newobj.thisown
2226 self._SetSelf(self)
2227
2228 def _SetSelf(*args, **kwargs):
2229 """_SetSelf(self, PyObject self)"""
2230 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2231
2232
2233class PyImageHandlerPtr(PyImageHandler):
2234 def __init__(self, this):
2235 self.this = this
2236 if not hasattr(self,"thisown"): self.thisown = 0
2237 self.__class__ = PyImageHandler
2238_core_.PyImageHandler_swigregister(PyImageHandlerPtr)
2239
d14a1e28 2240class ImageHistogram(object):
093d3ff1 2241 """Proxy of C++ ImageHistogram class"""
e811c8ce
RD
2242 def __repr__(self):
2243 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2244 def __init__(self, *args, **kwargs):
a95a7133 2245 """__init__(self) -> ImageHistogram"""
54f9ee45 2246 newobj = _core_.new_ImageHistogram(*args, **kwargs)
d14a1e28
RD
2247 self.this = newobj.this
2248 self.thisown = 1
2249 del newobj.thisown
e811c8ce 2250 def MakeKey(*args, **kwargs):
0df68c9f 2251 """
7a27cf7c 2252 MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2253
0df68c9f
RD
2254 Get the key in the histogram for the given RGB values
2255 """
54f9ee45 2256 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2257
2258 MakeKey = staticmethod(MakeKey)
2259 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2260 """
2261 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2262
2263 Find first colour that is not used in the image and has higher RGB
2264 values than startR, startG, startB. Returns a tuple consisting of a
2265 success flag and rgb values.
2266 """
54f9ee45 2267 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2268
f1cbd8fa
RD
2269 def GetCount(*args, **kwargs):
2270 """
2271 GetCount(self, unsigned long key) -> unsigned long
2272
2273 Returns the pixel count for the given key. Use `MakeKey` to create a
2274 key value from a RGB tripple.
2275 """
2276 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2277
2278 def GetCountRGB(*args, **kwargs):
2279 """
7a27cf7c 2280 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2281
2282 Returns the pixel count for the given RGB values.
2283 """
2284 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2285
2286 def GetCountColour(*args, **kwargs):
2287 """
2288 GetCountColour(self, Colour colour) -> unsigned long
2289
2290 Returns the pixel count for the given `wx.Colour` value.
2291 """
2292 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2293
d14a1e28
RD
2294
2295class ImageHistogramPtr(ImageHistogram):
2296 def __init__(self, this):
2297 self.this = this
2298 if not hasattr(self,"thisown"): self.thisown = 0
2299 self.__class__ = ImageHistogram
54f9ee45 2300_core_.ImageHistogram_swigregister(ImageHistogramPtr)
d14a1e28 2301
e811c8ce 2302def ImageHistogram_MakeKey(*args, **kwargs):
0df68c9f 2303 """
7a27cf7c 2304 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2305
0df68c9f
RD
2306 Get the key in the histogram for the given RGB values
2307 """
54f9ee45 2308 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28 2309
943e8dfd
RD
2310class Image_RGBValue(object):
2311 """
2312 An object that contains values for red, green and blue which represent
2313 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2314 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2315 color space.
2316 """
2317 def __repr__(self):
2318 return "<%s.%s; proxy of C++ wxImage_RGBValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2319 def __init__(self, *args, **kwargs):
2320 """
2321 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2322
2323 Constructor.
2324 """
2325 newobj = _core_.new_Image_RGBValue(*args, **kwargs)
2326 self.this = newobj.this
2327 self.thisown = 1
2328 del newobj.thisown
2329 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2330 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2331 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2332
2333class Image_RGBValuePtr(Image_RGBValue):
2334 def __init__(self, this):
2335 self.this = this
2336 if not hasattr(self,"thisown"): self.thisown = 0
2337 self.__class__ = Image_RGBValue
2338_core_.Image_RGBValue_swigregister(Image_RGBValuePtr)
2339
2340class Image_HSVValue(object):
2341 """
2342 An object that contains values for hue, saturation and value which
2343 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2344 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2345 color space.
2346 """
2347 def __repr__(self):
2348 return "<%s.%s; proxy of C++ wxImage_HSVValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2349 def __init__(self, *args, **kwargs):
2350 """
2351 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2352
2353 Constructor.
2354 """
2355 newobj = _core_.new_Image_HSVValue(*args, **kwargs)
2356 self.this = newobj.this
2357 self.thisown = 1
2358 del newobj.thisown
2359 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2360 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2361 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2362
2363class Image_HSVValuePtr(Image_HSVValue):
2364 def __init__(self, this):
2365 self.this = this
2366 if not hasattr(self,"thisown"): self.thisown = 0
2367 self.__class__ = Image_HSVValue
2368_core_.Image_HSVValue_swigregister(Image_HSVValuePtr)
2369
d14a1e28 2370class Image(Object):
7a27cf7c
RD
2371 """
2372 A platform-independent image class. An image can be created from
2373 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2374 variety of formats. Functions are available to set and get image
2375 bits, so it can be used for basic image manipulation.
2376
2377 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2378 platform-specific `wx.Bitmap` object must be created from it using the
2379 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2380 device context, using `wx.DC.DrawBitmap`.
2381
2382 One colour value of the image may be used as a mask colour which will
2383 lead to the automatic creation of a `wx.Mask` object associated to the
2384 bitmap object.
2385
2386 wx.Image supports alpha channel data, that is in addition to a byte
2387 for the red, green and blue colour components for each pixel it also
2388 stores a byte representing the pixel opacity. An alpha value of 0
2389 corresponds to a transparent pixel (null opacity) while a value of 255
2390 means that the pixel is 100% opaque.
2391
2392 Unlike RGB data, not all images have an alpha channel and before using
2393 `GetAlpha` you should check if this image contains an alpha channel
2394 with `HasAlpha`. Note that currently only images loaded from PNG files
2395 with transparency information will have an alpha channel.
2396 """
e811c8ce
RD
2397 def __repr__(self):
2398 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2399 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2400 """
2401 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2402
2403 Loads an image from a file.
2404 """
54f9ee45 2405 newobj = _core_.new_Image(*args, **kwargs)
d14a1e28
RD
2406 self.this = newobj.this
2407 self.thisown = 1
2408 del newobj.thisown
54f9ee45 2409 def __del__(self, destroy=_core_.delete_Image):
a95a7133 2410 """__del__(self)"""
d14a1e28
RD
2411 try:
2412 if self.thisown: destroy(self)
2413 except: pass
e811c8ce
RD
2414
2415 def Create(*args, **kwargs):
7a27cf7c
RD
2416 """
2417 Create(self, int width, int height, bool clear=True)
2418
2419 Creates a fresh image. If clear is ``True``, the new image will be
2420 initialized to black. Otherwise, the image data will be uninitialized.
2421 """
54f9ee45 2422 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2423
2424 def Destroy(*args, **kwargs):
0df68c9f 2425 """
a95a7133 2426 Destroy(self)
e811c8ce 2427
7a27cf7c 2428 Destroys the image data.
0df68c9f 2429 """
7e08d4ef
RD
2430 val = _core_.Image_Destroy(*args, **kwargs)
2431 args[0].thisown = 0
2432 return val
e811c8ce
RD
2433
2434 def Scale(*args, **kwargs):
7a27cf7c
RD
2435 """
2436 Scale(self, int width, int height) -> Image
2437
2438 Returns a scaled version of the image. This is also useful for scaling
2439 bitmaps in general as the only other way to scale bitmaps is to blit a
2440 `wx.MemoryDC` into another `wx.MemoryDC`.
2441 """
54f9ee45 2442 return _core_.Image_Scale(*args, **kwargs)
e811c8ce
RD
2443
2444 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2445 """
2446 ShrinkBy(self, int xFactor, int yFactor) -> Image
2447
2448 Return a version of the image scaled smaller by the given factors.
2449 """
54f9ee45 2450 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2451
2452 def Rescale(*args, **kwargs):
7a27cf7c
RD
2453 """
2454 Rescale(self, int width, int height) -> Image
2455
2456 Changes the size of the image in-place by scaling it: after a call to
2457 this function, the image will have the given width and height.
2458
2459 Returns the (modified) image itself.
2460 """
54f9ee45 2461 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce 2462
aff4cc5c 2463 def Resize(*args, **kwargs):
7a27cf7c
RD
2464 """
2465 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2466
2467 Changes the size of the image in-place without scaling it, by adding
2468 either a border with the given colour or cropping as necessary. The
2469 image is pasted into a new image with the given size and background
2470 colour at the position pos relative to the upper left of the new
2471 image. If red = green = blue = -1 then use either the current mask
2472 colour if set or find, use, and set a suitable mask colour for any
2473 newly exposed areas.
2474
2475 Returns the (modified) image itself.
2476 """
aff4cc5c
RD
2477 return _core_.Image_Resize(*args, **kwargs)
2478
e811c8ce 2479 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2480 """
2481 SetRGB(self, int x, int y, byte r, byte g, byte b)
2482
2483 Sets the pixel at the given coordinate. This routine performs
2484 bounds-checks for the coordinate so it can be considered a safe way to
2485 manipulate the data, but in some cases this might be too slow so that
2486 the data will have to be set directly. In that case you will have to
2487 get access to the image data using the `GetData` method.
2488 """
54f9ee45 2489 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce 2490
aff4cc5c 2491 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2492 """
2493 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2494
2495 Sets the colour of the pixels within the given rectangle. This routine
2496 performs bounds-checks for the rectangle so it can be considered a
2497 safe way to manipulate the data.
2498 """
aff4cc5c
RD
2499 return _core_.Image_SetRGBRect(*args, **kwargs)
2500
e811c8ce 2501 def GetRed(*args, **kwargs):
7a27cf7c
RD
2502 """
2503 GetRed(self, int x, int y) -> byte
2504
2505 Returns the red intensity at the given coordinate.
2506 """
54f9ee45 2507 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2508
2509 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2510 """
2511 GetGreen(self, int x, int y) -> byte
2512
2513 Returns the green intensity at the given coordinate.
2514 """
54f9ee45 2515 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2516
2517 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2518 """
2519 GetBlue(self, int x, int y) -> byte
2520
2521 Returns the blue intensity at the given coordinate.
2522 """
54f9ee45 2523 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2524
2525 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2526 """
2527 SetAlpha(self, int x, int y, byte alpha)
2528
2529 Sets the alpha value for the given pixel. This function should only be
2530 called if the image has alpha channel data, use `HasAlpha` to check
2531 for this.
2532 """
54f9ee45 2533 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2534
2535 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2536 """
2537 GetAlpha(self, int x, int y) -> byte
2538
2539 Returns the alpha value for the given pixel. This function may only be
2540 called for the images with alpha channel, use `HasAlpha` to check for
2541 this.
2542
2543 The returned value is the *opacity* of the image, i.e. the value of 0
2544 corresponds to the fully transparent pixels while the value of 255 to
2545 the fully opaque pixels.
2546 """
54f9ee45 2547 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2548
2549 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2550 """
2551 HasAlpha(self) -> bool
2552
2553 Returns true if this image has alpha channel, false otherwise.
2554 """
54f9ee45 2555 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce 2556
68350608
RD
2557 def InitAlpha(*args, **kwargs):
2558 """
2559 InitAlpha(self)
2560
2561 Initializes the image alpha channel data. It is an error to call it if
2562 the image already has alpha data. If it doesn't, alpha data will be by
2563 default initialized to all pixels being fully opaque. But if the image
2564 has a a mask colour, all mask pixels will be completely transparent.
2565 """
2566 return _core_.Image_InitAlpha(*args, **kwargs)
2567
bcd0d7b6
RD
2568 def IsTransparent(*args, **kwargs):
2569 """
7a27cf7c 2570 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
bcd0d7b6 2571
7a27cf7c
RD
2572 Returns ``True`` if this pixel is masked or has an alpha value less
2573 than the spcified threshold.
bcd0d7b6
RD
2574 """
2575 return _core_.Image_IsTransparent(*args, **kwargs)
2576
e811c8ce 2577 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2578 """
2579 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2580
2581 Find first colour that is not used in the image and has higher RGB
2582 values than startR, startG, startB. Returns a tuple consisting of a
2583 success flag and rgb values.
2584 """
54f9ee45 2585 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2586
4cf4100f
RD
2587 def ConvertAlphaToMask(*args, **kwargs):
2588 """
bcd0d7b6 2589 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2590
7a27cf7c
RD
2591 If the image has alpha channel, this method converts it to mask. All
2592 pixels with alpha value less than ``threshold`` are replaced with the
2593 mask colour and the alpha channel is removed. The mask colour is
2594 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2595
2596 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2597 nothing.
2598 """
2599 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2600
8fb0e70a
RD
2601 def ConvertColourToAlpha(*args, **kwargs):
2602 """
7a27cf7c 2603 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2604
2605 This method converts an image where the original alpha information is
2606 only available as a shades of a colour (actually shades of grey)
2607 typically when you draw anti-aliased text into a bitmap. The DC
2608 drawing routines draw grey values on the black background although
2609 they actually mean to draw white with differnt alpha values. This
2610 method reverses it, assuming a black (!) background and white text.
2611 The method will then fill up the whole image with the colour given.
2612 """
2613 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2614
e811c8ce 2615 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2616 """
2617 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2618
2619 Sets the image's mask so that the pixels that have RGB value of
2620 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2621 by first finding an unused colour in the image, setting this colour as
2622 the mask colour and then using this colour to draw all pixels in the
2623 image who corresponding pixel in mask has given RGB value.
2624
2625 Returns ``False`` if ``mask`` does not have same dimensions as the
2626 image or if there is no unused colour left. Returns ``True`` if the
2627 mask was successfully applied.
2628
2629 Note that this method involves computing the histogram, which is
2630 computationally intensive operation.
2631 """
54f9ee45 2632 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2633
2634 def CanRead(*args, **kwargs):
7a27cf7c
RD
2635 """
2636 CanRead(String filename) -> bool
2637
2638 Returns True if the image handlers can read this file.
2639 """
54f9ee45 2640 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2641
2642 CanRead = staticmethod(CanRead)
2643 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2644 """
2645 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2646
2647 If the image file contains more than one image and the image handler
2648 is capable of retrieving these individually, this function will return
2649 the number of available images.
2650 """
54f9ee45 2651 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2652
2653 GetImageCount = staticmethod(GetImageCount)
2654 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2655 """
2656 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2657
2658 Loads an image from a file. If no handler type is provided, the
2659 library will try to autodetect the format.
2660 """
54f9ee45 2661 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2662
2663 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2664 """
2665 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2666
2667 Loads an image from a file, specifying the image type with a MIME type
2668 string.
2669 """
54f9ee45 2670 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2671
2672 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2673 """
2674 SaveFile(self, String name, int type) -> bool
2675
2676 Saves an image in the named file.
2677 """
54f9ee45 2678 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2679
2680 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2681 """
2682 SaveMimeFile(self, String name, String mimetype) -> bool
2683
2684 Saves an image in the named file.
2685 """
54f9ee45 2686 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2687
2688 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2689 """
2690 CanReadStream(InputStream stream) -> bool
2691
2692 Returns True if the image handlers can read an image file from the
2693 data currently on the input stream, or a readable Python file-like
2694 object.
2695 """
54f9ee45 2696 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2697
2698 CanReadStream = staticmethod(CanReadStream)
2699 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2700 """
2701 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2702
2703 Loads an image from an input stream or a readable Python file-like
2704 object. If no handler type is provided, the library will try to
2705 autodetect the format.
2706 """
54f9ee45 2707 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2708
2709 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2710 """
2711 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2712
2713 Loads an image from an input stream or a readable Python file-like
2714 object, using a MIME type string to specify the image file format.
2715 """
54f9ee45 2716 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce
RD
2717
2718 def Ok(*args, **kwargs):
7a27cf7c
RD
2719 """
2720 Ok(self) -> bool
2721
2722 Returns true if image data is present.
2723 """
54f9ee45 2724 return _core_.Image_Ok(*args, **kwargs)
e811c8ce
RD
2725
2726 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2727 """
2728 GetWidth(self) -> int
2729
2730 Gets the width of the image in pixels.
2731 """
54f9ee45 2732 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2733
2734 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2735 """
2736 GetHeight(self) -> int
2737
2738 Gets the height of the image in pixels.
2739 """
54f9ee45 2740 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2741
b2df227b 2742 def GetSize(*args, **kwargs):
7a27cf7c
RD
2743 """
2744 GetSize(self) -> Size
2745
2746 Returns the size of the image in pixels.
2747 """
54f9ee45 2748 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2749
e811c8ce 2750 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2751 """
2752 GetSubImage(self, Rect rect) -> Image
2753
2754 Returns a sub image of the current one as long as the rect belongs
2755 entirely to the image.
2756 """
54f9ee45 2757 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce 2758
aff4cc5c 2759 def Size(*args, **kwargs):
7a27cf7c
RD
2760 """
2761 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2762
2763 Returns a resized version of this image without scaling it by adding
2764 either a border with the given colour or cropping as necessary. The
2765 image is pasted into a new image with the given size and background
2766 colour at the position ``pos`` relative to the upper left of the new
2767 image. If red = green = blue = -1 then use either the current mask
2768 colour if set or find, use, and set a suitable mask colour for any
2769 newly exposed areas.
2770 """
aff4cc5c
RD
2771 return _core_.Image_Size(*args, **kwargs)
2772
e811c8ce 2773 def Copy(*args, **kwargs):
7a27cf7c
RD
2774 """
2775 Copy(self) -> Image
2776
2777 Returns an identical copy of the image.
2778 """
54f9ee45 2779 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2780
2781 def Paste(*args, **kwargs):
7a27cf7c
RD
2782 """
2783 Paste(self, Image image, int x, int y)
2784
2785 Pastes ``image`` into this instance and takes care of the mask colour
2786 and any out of bounds problems.
2787 """
54f9ee45 2788 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2789
2790 def GetData(*args, **kwargs):
61d07ac7
RD
2791 """
2792 GetData(self) -> PyObject
2793
2794 Returns a string containing a copy of the RGB bytes of the image.
2795 """
54f9ee45 2796 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2797
2798 def SetData(*args, **kwargs):
61d07ac7
RD
2799 """
2800 SetData(self, buffer data)
2801
2802 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2803 either a string or a buffer object holding the data and the length of
2804 the data must be width*height*3.
2805 """
54f9ee45 2806 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
2807
2808 def GetDataBuffer(*args, **kwargs):
61d07ac7
RD
2809 """
2810 GetDataBuffer(self) -> PyObject
2811
2812 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2813 image data buffer inside the wx.Image. You need to ensure that you do
2814 not use this buffer object after the image has been destroyed.
61d07ac7 2815 """
54f9ee45 2816 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
2817
2818 def SetDataBuffer(*args, **kwargs):
61d07ac7
RD
2819 """
2820 SetDataBuffer(self, buffer data)
2821
2822 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2823 object. This can save making an extra copy of the data but you must
2824 ensure that the buffer object lives longer than the wx.Image does.
61d07ac7 2825 """
54f9ee45 2826 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
2827
2828 def GetAlphaData(*args, **kwargs):
61d07ac7
RD
2829 """
2830 GetAlphaData(self) -> PyObject
2831
2832 Returns a string containing a copy of the alpha bytes of the image.
2833 """
54f9ee45 2834 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
2835
2836 def SetAlphaData(*args, **kwargs):
61d07ac7
RD
2837 """
2838 SetAlphaData(self, buffer alpha)
2839
2840 Resets the Image's alpha data from a buffer of bytes. Accepts either
2841 a string or a buffer object holding the data and the length of the
2842 data must be width*height.
2843 """
54f9ee45 2844 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
2845
2846 def GetAlphaBuffer(*args, **kwargs):
a95a7133 2847 """GetAlphaBuffer(self) -> PyObject"""
54f9ee45 2848 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2849
2850 def SetAlphaBuffer(*args, **kwargs):
61d07ac7 2851 """SetAlphaBuffer(self, buffer alpha)"""
54f9ee45 2852 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2853
2854 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2855 """
2856 SetMaskColour(self, byte r, byte g, byte b)
2857
2858 Sets the mask colour for this image (and tells the image to use the
2859 mask).
2860 """
54f9ee45 2861 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce 2862
aff4cc5c
RD
2863 def GetOrFindMaskColour(*args, **kwargs):
2864 """
2865 GetOrFindMaskColour() -> (r,g,b)
2866
2867 Get the current mask colour or find a suitable colour.
2868 """
2869 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2870
e811c8ce 2871 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2872 """
2873 GetMaskRed(self) -> byte
2874
2875 Gets the red component of the mask colour.
2876 """
54f9ee45 2877 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
2878
2879 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2880 """
2881 GetMaskGreen(self) -> byte
2882
2883 Gets the green component of the mask colour.
2884 """
54f9ee45 2885 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
2886
2887 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2888 """
2889 GetMaskBlue(self) -> byte
2890
2891 Gets the blue component of the mask colour.
2892 """
54f9ee45 2893 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
2894
2895 def SetMask(*args, **kwargs):
7a27cf7c
RD
2896 """
2897 SetMask(self, bool mask=True)
2898
2899 Specifies whether there is a mask or not. The area of the mask is
2900 determined by the current mask colour.
2901 """
54f9ee45 2902 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
2903
2904 def HasMask(*args, **kwargs):
7a27cf7c
RD
2905 """
2906 HasMask(self) -> bool
2907
2908 Returns ``True`` if there is a mask active, ``False`` otherwise.
2909 """
54f9ee45 2910 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
2911
2912 def Rotate(*args, **kwargs):
0df68c9f 2913 """
a95a7133 2914 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f 2915 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2916
2917 Rotates the image about the given point, by ``angle`` radians. Passing
2918 ``True`` to ``interpolating`` results in better image quality, but is
2919 slower. If the image has a mask, then the mask colour is used for the
2920 uncovered pixels in the rotated image background. Otherwise, black
2921 will be used as the fill colour.
2922
2923 Returns the rotated image, leaving this image intact.
0df68c9f 2924 """
54f9ee45 2925 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
2926
2927 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2928 """
2929 Rotate90(self, bool clockwise=True) -> Image
2930
2931 Returns a copy of the image rotated 90 degrees in the direction
2932 indicated by ``clockwise``.
2933 """
54f9ee45 2934 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
2935
2936 def Mirror(*args, **kwargs):
7a27cf7c
RD
2937 """
2938 Mirror(self, bool horizontally=True) -> Image
2939
2940 Returns a mirrored copy of the image. The parameter ``horizontally``
2941 indicates the orientation.
2942 """
54f9ee45 2943 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
2944
2945 def Replace(*args, **kwargs):
0df68c9f 2946 """
7a27cf7c
RD
2947 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2948
2949 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2950 ``(r2,g2,b2)``.
0df68c9f 2951 """
54f9ee45 2952 return _core_.Image_Replace(*args, **kwargs)
e811c8ce 2953
32fe5131
RD
2954 def ConvertToGreyscale(*args, **kwargs):
2955 """
2956 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2957
2958 Convert to greyscale image. Uses the luminance component (Y) of the
2959 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2960 defaults to ITU-T BT.601
2961 """
2962 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2963
e811c8ce 2964 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2965 """
2966 ConvertToMono(self, byte r, byte g, byte b) -> Image
2967
2968 Returns monochromatic version of the image. The returned image has
2969 white colour where the original has ``(r,g,b)`` colour and black
2970 colour everywhere else.
2971 """
54f9ee45 2972 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
2973
2974 def SetOption(*args, **kwargs):
7a27cf7c
RD
2975 """
2976 SetOption(self, String name, String value)
2977
2978 Sets an image handler defined option. For example, when saving as a
2979 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2980 number between 0 and 100 (0 is terrible, 100 is very good).
2981 """
54f9ee45 2982 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
2983
2984 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2985 """
2986 SetOptionInt(self, String name, int value)
2987
2988 Sets an image option as an integer.
2989 """
54f9ee45 2990 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
2991
2992 def GetOption(*args, **kwargs):
7a27cf7c
RD
2993 """
2994 GetOption(self, String name) -> String
2995
2996 Gets the value of an image handler option.
2997 """
54f9ee45 2998 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
2999
3000 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
3001 """
3002 GetOptionInt(self, String name) -> int
3003
3004 Gets the value of an image handler option as an integer. If the given
3005 option is not present, the function returns 0.
3006 """
54f9ee45 3007 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
3008
3009 def HasOption(*args, **kwargs):
7a27cf7c
RD
3010 """
3011 HasOption(self, String name) -> bool
3012
3013 Returns true if the given option is present.
3014 """
54f9ee45 3015 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
3016
3017 def CountColours(*args, **kwargs):
a95a7133 3018 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 3019 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
3020
3021 def ComputeHistogram(*args, **kwargs):
a95a7133 3022 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 3023 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
3024
3025 def AddHandler(*args, **kwargs):
66c033b4 3026 """AddHandler(ImageHandler handler)"""
54f9ee45 3027 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
3028
3029 AddHandler = staticmethod(AddHandler)
3030 def InsertHandler(*args, **kwargs):
66c033b4 3031 """InsertHandler(ImageHandler handler)"""
54f9ee45 3032 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
3033
3034 InsertHandler = staticmethod(InsertHandler)
3035 def RemoveHandler(*args, **kwargs):
66c033b4 3036 """RemoveHandler(String name) -> bool"""
54f9ee45 3037 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
3038
3039 RemoveHandler = staticmethod(RemoveHandler)
3040 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3041 """
3042 GetImageExtWildcard() -> String
3043
3044 Iterates all registered wxImageHandler objects, and returns a string
3045 containing file extension masks suitable for passing to file open/save
3046 dialog boxes.
3047 """
54f9ee45 3048 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
3049
3050 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3051 def ConvertToBitmap(*args, **kwargs):
1fbf26be 3052 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 3053 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
3054
3055 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3056 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
54f9ee45 3057 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce 3058
943e8dfd
RD
3059 def RotateHue(*args, **kwargs):
3060 """
3061 RotateHue(self, double angle)
3062
3063 Rotates the hue of each pixel of the image. Hue is a double in the
3064 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3065 """
3066 return _core_.Image_RotateHue(*args, **kwargs)
3067
3068 def RGBtoHSV(*args, **kwargs):
3069 """
3070 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3071
3072 Converts a color in RGB color space to HSV color space.
3073 """
3074 return _core_.Image_RGBtoHSV(*args, **kwargs)
3075
3076 RGBtoHSV = staticmethod(RGBtoHSV)
3077 def HSVtoRGB(*args, **kwargs):
3078 """
3079 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3080
3081 Converts a color in HSV color space to RGB color space.
3082 """
3083 return _core_.Image_HSVtoRGB(*args, **kwargs)
3084
3085 HSVtoRGB = staticmethod(HSVtoRGB)
e811c8ce 3086 def __nonzero__(self): return self.Ok()
d14a1e28
RD
3087
3088class ImagePtr(Image):
3089 def __init__(self, this):
3090 self.this = this
3091 if not hasattr(self,"thisown"): self.thisown = 0
3092 self.__class__ = Image
54f9ee45 3093_core_.Image_swigregister(ImagePtr)
d14a1e28
RD
3094
3095def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3096 """
3097 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3098
3099 Loads an image from a file, using a MIME type string (such as
3100 'image/jpeg') to specify image type.
3101 """
54f9ee45 3102 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
3103 val.thisown = 1
3104 return val
3105
3106def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3107 """
3108 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3109
3110 Loads an image from an input stream, or any readable Python file-like
3111 object.
3112 """
54f9ee45 3113 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
3114 val.thisown = 1
3115 return val
3116
3117def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3118 """
3119 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3120
3121 Loads an image from an input stream, or any readable Python file-like
3122 object, specifying the image format with a MIME type string.
3123 """
54f9ee45 3124 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
3125 val.thisown = 1
3126 return val
3127
66c033b4 3128def EmptyImage(*args, **kwargs):
61d07ac7
RD
3129 """
3130 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3131
3132 Construct an empty image of a given size, optionally setting all
3133 pixels to black.
3134 """
66c033b4 3135 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
3136 val.thisown = 1
3137 return val
3138
3139def ImageFromBitmap(*args, **kwargs):
61d07ac7
RD
3140 """
3141 ImageFromBitmap(Bitmap bitmap) -> Image
3142
3143 Construct an Image from a `wx.Bitmap`.
3144 """
54f9ee45 3145 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
3146 val.thisown = 1
3147 return val
3148
3149def ImageFromData(*args, **kwargs):
61d07ac7
RD
3150 """
3151 ImageFromData(int width, int height, buffer data) -> Image
3152
3153 Construct an Image from a buffer of RGB bytes. Accepts either a
3154 string or a buffer object holding the data and the length of the data
3155 must be width*height*3.
3156 """
54f9ee45 3157 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
3158 val.thisown = 1
3159 return val
3160
1823fbb4 3161def ImageFromDataWithAlpha(*args, **kwargs):
61d07ac7
RD
3162 """
3163 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3164
3165 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3166 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3167 length of the data must be width*height*3 bytes, and the length of the
3168 alpha data must be width*height bytes.
61d07ac7 3169 """
1823fbb4
RD
3170 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
3171 val.thisown = 1
3172 return val
3173
e811c8ce 3174def Image_CanRead(*args, **kwargs):
7a27cf7c
RD
3175 """
3176 Image_CanRead(String filename) -> bool
3177
3178 Returns True if the image handlers can read this file.
3179 """
54f9ee45 3180 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 3181
e811c8ce 3182def Image_GetImageCount(*args, **kwargs):
7a27cf7c
RD
3183 """
3184 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3185
3186 If the image file contains more than one image and the image handler
3187 is capable of retrieving these individually, this function will return
3188 the number of available images.
3189 """
54f9ee45 3190 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 3191
e811c8ce 3192def Image_CanReadStream(*args, **kwargs):
7a27cf7c
RD
3193 """
3194 Image_CanReadStream(InputStream stream) -> bool
3195
3196 Returns True if the image handlers can read an image file from the
3197 data currently on the input stream, or a readable Python file-like
3198 object.
3199 """
54f9ee45 3200 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 3201
e811c8ce
RD
3202def Image_AddHandler(*args, **kwargs):
3203 """Image_AddHandler(ImageHandler handler)"""
54f9ee45 3204 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 3205
e811c8ce
RD
3206def Image_InsertHandler(*args, **kwargs):
3207 """Image_InsertHandler(ImageHandler handler)"""
54f9ee45 3208 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 3209
e811c8ce 3210def Image_RemoveHandler(*args, **kwargs):
196addbf 3211 """Image_RemoveHandler(String name) -> bool"""
54f9ee45 3212 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 3213
e811c8ce 3214def Image_GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3215 """
3216 Image_GetImageExtWildcard() -> String
3217
3218 Iterates all registered wxImageHandler objects, and returns a string
3219 containing file extension masks suitable for passing to file open/save
3220 dialog boxes.
3221 """
54f9ee45 3222 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d14a1e28 3223
943e8dfd
RD
3224def Image_RGBtoHSV(*args, **kwargs):
3225 """
3226 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3227
3228 Converts a color in RGB color space to HSV color space.
3229 """
3230 return _core_.Image_RGBtoHSV(*args, **kwargs)
3231
3232def Image_HSVtoRGB(*args, **kwargs):
3233 """
3234 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3235
3236 Converts a color in HSV color space to RGB color space.
3237 """
3238 return _core_.Image_HSVtoRGB(*args, **kwargs)
3239
5e4ca4a8
RD
3240def InitAllImageHandlers():
3241 """
3242 The former functionality of InitAllImageHanders is now done internal to
3243 the _core_ extension module and so this function has become a simple NOP.
3244 """
3245 pass
d14a1e28 3246
54f9ee45
RD
3247IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3248IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3249PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3250PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3251PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
54f9ee45
RD
3252BMP_24BPP = _core_.BMP_24BPP
3253BMP_8BPP = _core_.BMP_8BPP
3254BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3255BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3256BMP_8BPP_RED = _core_.BMP_8BPP_RED
3257BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3258BMP_4BPP = _core_.BMP_4BPP
3259BMP_1BPP = _core_.BMP_1BPP
3260BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 3261class BMPHandler(ImageHandler):
27fb7603 3262 """A `wx.ImageHandler` for \*.bmp bitmap files."""
e811c8ce
RD
3263 def __repr__(self):
3264 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3265 def __init__(self, *args, **kwargs):
27fb7603
RD
3266 """
3267 __init__(self) -> BMPHandler
3268
3269 A `wx.ImageHandler` for \*.bmp bitmap files.
3270 """
54f9ee45 3271 newobj = _core_.new_BMPHandler(*args, **kwargs)
d14a1e28
RD
3272 self.this = newobj.this
3273 self.thisown = 1
3274 del newobj.thisown
d14a1e28
RD
3275
3276class BMPHandlerPtr(BMPHandler):
3277 def __init__(self, this):
3278 self.this = this
3279 if not hasattr(self,"thisown"): self.thisown = 0
3280 self.__class__ = BMPHandler
54f9ee45 3281_core_.BMPHandler_swigregister(BMPHandlerPtr)
d14a1e28 3282NullImage = cvar.NullImage
0c243d93 3283IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d14a1e28
RD
3284IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3285IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3286IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3287IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
0c243d93
RD
3288IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3289IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d14a1e28 3290IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3291IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
0c243d93
RD
3292IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3293IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3294IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3295IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3296IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3297IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d14a1e28
RD
3298
3299class ICOHandler(BMPHandler):
27fb7603 3300 """A `wx.ImageHandler` for \*.ico icon files."""
e811c8ce
RD
3301 def __repr__(self):
3302 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3303 def __init__(self, *args, **kwargs):
27fb7603
RD
3304 """
3305 __init__(self) -> ICOHandler
3306
3307 A `wx.ImageHandler` for \*.ico icon files.
3308 """
54f9ee45 3309 newobj = _core_.new_ICOHandler(*args, **kwargs)
d14a1e28
RD
3310 self.this = newobj.this
3311 self.thisown = 1
3312 del newobj.thisown
d14a1e28
RD
3313
3314class ICOHandlerPtr(ICOHandler):
3315 def __init__(self, this):
3316 self.this = this
3317 if not hasattr(self,"thisown"): self.thisown = 0
3318 self.__class__ = ICOHandler
54f9ee45 3319_core_.ICOHandler_swigregister(ICOHandlerPtr)
d14a1e28
RD
3320
3321class CURHandler(ICOHandler):
27fb7603 3322 """A `wx.ImageHandler` for \*.cur cursor files."""
e811c8ce
RD
3323 def __repr__(self):
3324 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3325 def __init__(self, *args, **kwargs):
27fb7603
RD
3326 """
3327 __init__(self) -> CURHandler
3328
3329 A `wx.ImageHandler` for \*.cur cursor files.
3330 """
54f9ee45 3331 newobj = _core_.new_CURHandler(*args, **kwargs)
d14a1e28
RD
3332 self.this = newobj.this
3333 self.thisown = 1
3334 del newobj.thisown
d14a1e28
RD
3335
3336class CURHandlerPtr(CURHandler):
3337 def __init__(self, this):
3338 self.this = this
3339 if not hasattr(self,"thisown"): self.thisown = 0
3340 self.__class__ = CURHandler
54f9ee45 3341_core_.CURHandler_swigregister(CURHandlerPtr)
d14a1e28
RD
3342
3343class ANIHandler(CURHandler):
27fb7603 3344 """A `wx.ImageHandler` for \*.ani animated cursor files."""
e811c8ce
RD
3345 def __repr__(self):
3346 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3347 def __init__(self, *args, **kwargs):
27fb7603
RD
3348 """
3349 __init__(self) -> ANIHandler
3350
3351 A `wx.ImageHandler` for \*.ani animated cursor files.
3352 """
54f9ee45 3353 newobj = _core_.new_ANIHandler(*args, **kwargs)
d14a1e28
RD
3354 self.this = newobj.this
3355 self.thisown = 1
3356 del newobj.thisown
d14a1e28
RD
3357
3358class ANIHandlerPtr(ANIHandler):
3359 def __init__(self, this):
3360 self.this = this
3361 if not hasattr(self,"thisown"): self.thisown = 0
3362 self.__class__ = ANIHandler
54f9ee45 3363_core_.ANIHandler_swigregister(ANIHandlerPtr)
d14a1e28
RD
3364
3365class PNGHandler(ImageHandler):
27fb7603 3366 """A `wx.ImageHandler` for PNG image files."""
e811c8ce
RD
3367 def __repr__(self):
3368 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3369 def __init__(self, *args, **kwargs):
27fb7603
RD
3370 """
3371 __init__(self) -> PNGHandler
3372
3373 A `wx.ImageHandler` for PNG image files.
3374 """
54f9ee45 3375 newobj = _core_.new_PNGHandler(*args, **kwargs)
d14a1e28
RD
3376 self.this = newobj.this
3377 self.thisown = 1
3378 del newobj.thisown
d14a1e28
RD
3379
3380class PNGHandlerPtr(PNGHandler):
3381 def __init__(self, this):
3382 self.this = this
3383 if not hasattr(self,"thisown"): self.thisown = 0
3384 self.__class__ = PNGHandler
54f9ee45 3385_core_.PNGHandler_swigregister(PNGHandlerPtr)
d14a1e28
RD
3386
3387class GIFHandler(ImageHandler):
27fb7603 3388 """A `wx.ImageHandler` for GIF image files."""
e811c8ce
RD
3389 def __repr__(self):
3390 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3391 def __init__(self, *args, **kwargs):
27fb7603
RD
3392 """
3393 __init__(self) -> GIFHandler
3394
3395 A `wx.ImageHandler` for GIF image files.
3396 """
54f9ee45 3397 newobj = _core_.new_GIFHandler(*args, **kwargs)
d14a1e28
RD
3398 self.this = newobj.this
3399 self.thisown = 1
3400 del newobj.thisown
d14a1e28
RD
3401
3402class GIFHandlerPtr(GIFHandler):
3403 def __init__(self, this):
3404 self.this = this
3405 if not hasattr(self,"thisown"): self.thisown = 0
3406 self.__class__ = GIFHandler
54f9ee45 3407_core_.GIFHandler_swigregister(GIFHandlerPtr)
d14a1e28
RD
3408
3409class PCXHandler(ImageHandler):
27fb7603 3410 """A `wx.ImageHandler` for PCX imager files."""
e811c8ce
RD
3411 def __repr__(self):
3412 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3413 def __init__(self, *args, **kwargs):
27fb7603
RD
3414 """
3415 __init__(self) -> PCXHandler
3416
3417 A `wx.ImageHandler` for PCX imager files.
3418 """
54f9ee45 3419 newobj = _core_.new_PCXHandler(*args, **kwargs)
d14a1e28
RD
3420 self.this = newobj.this
3421 self.thisown = 1
3422 del newobj.thisown
d14a1e28
RD
3423
3424class PCXHandlerPtr(PCXHandler):
3425 def __init__(self, this):
3426 self.this = this
3427 if not hasattr(self,"thisown"): self.thisown = 0
3428 self.__class__ = PCXHandler
54f9ee45 3429_core_.PCXHandler_swigregister(PCXHandlerPtr)
d14a1e28
RD
3430
3431class JPEGHandler(ImageHandler):
27fb7603 3432 """A `wx.ImageHandler` for JPEG/JPG image files."""
e811c8ce
RD
3433 def __repr__(self):
3434 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3435 def __init__(self, *args, **kwargs):
27fb7603
RD
3436 """
3437 __init__(self) -> JPEGHandler
3438
3439 A `wx.ImageHandler` for JPEG/JPG image files.
3440 """
54f9ee45 3441 newobj = _core_.new_JPEGHandler(*args, **kwargs)
d14a1e28
RD
3442 self.this = newobj.this
3443 self.thisown = 1
3444 del newobj.thisown
d14a1e28
RD
3445
3446class JPEGHandlerPtr(JPEGHandler):
3447 def __init__(self, this):
3448 self.this = this
3449 if not hasattr(self,"thisown"): self.thisown = 0
3450 self.__class__ = JPEGHandler
54f9ee45 3451_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
d14a1e28
RD
3452
3453class PNMHandler(ImageHandler):
27fb7603 3454 """A `wx.ImageHandler` for PNM image files."""
e811c8ce
RD
3455 def __repr__(self):
3456 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3457 def __init__(self, *args, **kwargs):
27fb7603
RD
3458 """
3459 __init__(self) -> PNMHandler
3460
3461 A `wx.ImageHandler` for PNM image files.
3462 """
54f9ee45 3463 newobj = _core_.new_PNMHandler(*args, **kwargs)
d14a1e28
RD
3464 self.this = newobj.this
3465 self.thisown = 1
3466 del newobj.thisown
d14a1e28
RD
3467
3468class PNMHandlerPtr(PNMHandler):
3469 def __init__(self, this):
3470 self.this = this
3471 if not hasattr(self,"thisown"): self.thisown = 0
3472 self.__class__ = PNMHandler
54f9ee45 3473_core_.PNMHandler_swigregister(PNMHandlerPtr)
d14a1e28
RD
3474
3475class XPMHandler(ImageHandler):
27fb7603 3476 """A `wx.ImageHandler` for XPM image."""
e811c8ce
RD
3477 def __repr__(self):
3478 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3479 def __init__(self, *args, **kwargs):
27fb7603
RD
3480 """
3481 __init__(self) -> XPMHandler
3482
3483 A `wx.ImageHandler` for XPM image.
3484 """
54f9ee45 3485 newobj = _core_.new_XPMHandler(*args, **kwargs)
d14a1e28
RD
3486 self.this = newobj.this
3487 self.thisown = 1
3488 del newobj.thisown
d14a1e28
RD
3489
3490class XPMHandlerPtr(XPMHandler):
3491 def __init__(self, this):
3492 self.this = this
3493 if not hasattr(self,"thisown"): self.thisown = 0
3494 self.__class__ = XPMHandler
54f9ee45 3495_core_.XPMHandler_swigregister(XPMHandlerPtr)
d14a1e28
RD
3496
3497class TIFFHandler(ImageHandler):
27fb7603 3498 """A `wx.ImageHandler` for TIFF image files."""
e811c8ce
RD
3499 def __repr__(self):
3500 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3501 def __init__(self, *args, **kwargs):
27fb7603
RD
3502 """
3503 __init__(self) -> TIFFHandler
3504
3505 A `wx.ImageHandler` for TIFF image files.
3506 """
54f9ee45 3507 newobj = _core_.new_TIFFHandler(*args, **kwargs)
d14a1e28
RD
3508 self.this = newobj.this
3509 self.thisown = 1
3510 del newobj.thisown
d14a1e28
RD
3511
3512class TIFFHandlerPtr(TIFFHandler):
3513 def __init__(self, this):
3514 self.this = this
3515 if not hasattr(self,"thisown"): self.thisown = 0
3516 self.__class__ = TIFFHandler
54f9ee45 3517_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
d14a1e28 3518
c0de73ae
RD
3519QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3520QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3521class Quantize(object):
3522 """Performs quantization, or colour reduction, on a wxImage."""
3523 def __init__(self): raise RuntimeError, "No constructor defined"
3524 def __repr__(self):
3525 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3526 def Quantize(*args, **kwargs):
3527 """
3528 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3529
3530 Reduce the colours in the source image and put the result into the
3531 destination image, setting the palette in the destination if
3532 needed. Both images may be the same, to overwrite the source image.
3533 """
3534 return _core_.Quantize_Quantize(*args, **kwargs)
3535
3536 Quantize = staticmethod(Quantize)
3537
3538class QuantizePtr(Quantize):
3539 def __init__(self, this):
3540 self.this = this
3541 if not hasattr(self,"thisown"): self.thisown = 0
3542 self.__class__ = Quantize
3543_core_.Quantize_swigregister(QuantizePtr)
3544
3545def Quantize_Quantize(*args, **kwargs):
3546 """
3547 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3548
3549 Reduce the colours in the source image and put the result into the
3550 destination image, setting the palette in the destination if
3551 needed. Both images may be the same, to overwrite the source image.
3552 """
3553 return _core_.Quantize_Quantize(*args, **kwargs)
3554
d14a1e28
RD
3555#---------------------------------------------------------------------------
3556
3557class EvtHandler(Object):
093d3ff1 3558 """Proxy of C++ EvtHandler class"""
e811c8ce
RD
3559 def __repr__(self):
3560 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3561 def __init__(self, *args, **kwargs):
a95a7133 3562 """__init__(self) -> EvtHandler"""
54f9ee45 3563 newobj = _core_.new_EvtHandler(*args, **kwargs)
d14a1e28
RD
3564 self.this = newobj.this
3565 self.thisown = 1
3566 del newobj.thisown
e811c8ce 3567 def GetNextHandler(*args, **kwargs):
a95a7133 3568 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 3569 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
3570
3571 def GetPreviousHandler(*args, **kwargs):
a95a7133 3572 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 3573 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3574
3575 def SetNextHandler(*args, **kwargs):
a95a7133 3576 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 3577 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
3578
3579 def SetPreviousHandler(*args, **kwargs):
a95a7133 3580 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 3581 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3582
3583 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3584 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 3585 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3586
3587 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3588 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 3589 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3590
3591 def ProcessEvent(*args, **kwargs):
a95a7133 3592 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 3593 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
3594
3595 def AddPendingEvent(*args, **kwargs):
a95a7133 3596 """AddPendingEvent(self, Event event)"""
54f9ee45 3597 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
3598
3599 def ProcessPendingEvents(*args, **kwargs):
a95a7133 3600 """ProcessPendingEvents(self)"""
54f9ee45 3601 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
3602
3603 def Connect(*args, **kwargs):
a95a7133 3604 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 3605 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
3606
3607 def Disconnect(*args, **kwargs):
a95a7133 3608 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 3609 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
3610
3611 def _setOORInfo(*args, **kwargs):
689b42ee 3612 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3613 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3614 args[0].thisown = 0
3615 return val
e811c8ce 3616
d14a1e28
RD
3617 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3618 """
3619 Bind an event to an event handler.
3620
db3e571a
RD
3621 :param event: One of the EVT_* objects that specifies the
3622 type of event to bind,
d14a1e28 3623
db3e571a
RD
3624 :param handler: A callable object to be invoked when the
3625 event is delivered to self. Pass None to
3626 disconnect an event handler.
d14a1e28 3627
db3e571a
RD
3628 :param source: Sometimes the event originates from a
3629 different window than self, but you still
3630 want to catch it in self. (For example, a
3631 button event delivered to a frame.) By
3632 passing the source of the event, the event
3633 handling system is able to differentiate
3634 between the same event type from different
3635 controls.
d14a1e28 3636
db3e571a
RD
3637 :param id: Used to spcify the event source by ID instead
3638 of instance.
3639
3640 :param id2: Used when it is desirable to bind a handler
3641 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
3642 """
3643 if source is not None:
3644 id = source.GetId()
3645 event.Bind(self, id, id2, handler)
3646
66c033b4
RD
3647 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3648 """
3649 Disconencts the event handler binding for event from self.
3650 Returns True if successful.
3651 """
3652 if source is not None:
3653 id = source.GetId()
3654 return event.Unbind(self, id, id2)
d14a1e28 3655
d14a1e28
RD
3656
3657class EvtHandlerPtr(EvtHandler):
3658 def __init__(self, this):
3659 self.this = this
3660 if not hasattr(self,"thisown"): self.thisown = 0
3661 self.__class__ = EvtHandler
54f9ee45 3662_core_.EvtHandler_swigregister(EvtHandlerPtr)
d14a1e28
RD
3663
3664#---------------------------------------------------------------------------
3665
3666class PyEventBinder(object):
3667 """
3668 Instances of this class are used to bind specific events to event
3669 handlers.
3670 """
3671 def __init__(self, evtType, expectedIDs=0):
3672 if expectedIDs not in [0, 1, 2]:
3673 raise ValueError, "Invalid number of expectedIDs"
3674 self.expectedIDs = expectedIDs
3675
3676 if type(evtType) == list or type(evtType) == tuple:
3677 self.evtType = evtType
3678 else:
3679 self.evtType = [evtType]
3680
3681
3682 def Bind(self, target, id1, id2, function):
3683 """Bind this set of event types to target."""
3684 for et in self.evtType:
3685 target.Connect(id1, id2, et, function)
3686
66c033b4
RD
3687
3688 def Unbind(self, target, id1, id2):
3689 """Remove an event binding."""
3690 success = 0
3691 for et in self.evtType:
3692 success += target.Disconnect(id1, id2, et)
3693 return success != 0
3694
d14a1e28
RD
3695
3696 def __call__(self, *args):
3697 """
3698 For backwards compatibility with the old EVT_* functions.
3699 Should be called with either (window, func), (window, ID,
3700 func) or (window, ID1, ID2, func) parameters depending on the
3701 type of the event.
3702 """
3703 assert len(args) == 2 + self.expectedIDs
3704 id1 = wx.ID_ANY
3705 id2 = wx.ID_ANY
3706 target = args[0]
3707 if self.expectedIDs == 0:
3708 func = args[1]
3709 elif self.expectedIDs == 1:
3710 id1 = args[1]
3711 func = args[2]
3712 elif self.expectedIDs == 2:
3713 id1 = args[1]
3714 id2 = args[2]
3715 func = args[3]
3716 else:
3717 raise ValueError, "Unexpected number of IDs"
3718
3719 self.Bind(target, id1, id2, func)
3720
3721
3722# These two are square pegs that don't fit the PyEventBinder hole...
3723def EVT_COMMAND(win, id, cmd, func):
3724 win.Connect(id, -1, cmd, func)
3725def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3726 win.Connect(id1, id2, cmd, func)
3727
3728
3729#---------------------------------------------------------------------------
3730
3731#---------------------------------------------------------------------------
3732
54f9ee45
RD
3733EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3734EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 3735
e811c8ce
RD
3736def NewEventType(*args, **kwargs):
3737 """NewEventType() -> wxEventType"""
54f9ee45
RD
3738 return _core_.NewEventType(*args, **kwargs)
3739wxEVT_NULL = _core_.wxEVT_NULL
3740wxEVT_FIRST = _core_.wxEVT_FIRST
3741wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3742wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3743wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3744wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3745wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3746wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3747wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3748wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3749wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3750wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3751wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3752wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3753wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3754wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3755wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3756wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3757wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3758wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3759wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3760wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3761wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3762wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3763wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3764wxEVT_MOTION = _core_.wxEVT_MOTION
3765wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3766wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3767wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3768wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3769wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3770wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3771wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3772wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3773wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3774wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3775wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3776wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3777wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3778wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3779wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3780wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3781wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3782wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3783wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3784wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3785wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3786wxEVT_CHAR = _core_.wxEVT_CHAR
3787wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3788wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3789wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3790wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3791wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3792wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3793wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3794wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3795wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3796wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3797wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3798wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3799wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3800wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3801wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3802wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
54f9ee45
RD
3803wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3804wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3805wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3806wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3807wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3808wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3809wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3810wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3811wxEVT_SIZE = _core_.wxEVT_SIZE
3812wxEVT_MOVE = _core_.wxEVT_MOVE
3813wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3814wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3815wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3816wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3817wxEVT_POWER = _core_.wxEVT_POWER
3818wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3819wxEVT_CREATE = _core_.wxEVT_CREATE
3820wxEVT_DESTROY = _core_.wxEVT_DESTROY
3821wxEVT_SHOW = _core_.wxEVT_SHOW
3822wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3823wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3824wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3825wxEVT_PAINT = _core_.wxEVT_PAINT
3826wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3827wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3828wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3829wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3830wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3831wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3832wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3833wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3834wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3835wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3836wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3837wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3838wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3839wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3840wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3841wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3842wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3843wxEVT_IDLE = _core_.wxEVT_IDLE
3844wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3845wxEVT_SIZING = _core_.wxEVT_SIZING
3846wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3847wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
54f9ee45
RD
3848wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3849wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3850wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3851wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3852wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3853wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3854wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
3855#
3856# Create some event binders
3857EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3858EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3859EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3860EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3861EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3862EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3863EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3864EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3865EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3866EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3867EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3868EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3869EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3870EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3871EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3872EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3873EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3874EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3875EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3876EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3877EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3878EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3879EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3880EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3881EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d14a1e28
RD
3882EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3883EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3884EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3885EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3886EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3887EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3888EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3889EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3890EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3891EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3892EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3893EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3894EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3895EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3896EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3897EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3898
3899EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3900EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3901EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3902EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3903EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3904EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3905EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3906EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3907EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3908EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3909EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3910EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3911EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3912
3913EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3914 wxEVT_LEFT_UP,
3915 wxEVT_MIDDLE_DOWN,
3916 wxEVT_MIDDLE_UP,
3917 wxEVT_RIGHT_DOWN,
3918 wxEVT_RIGHT_UP,
3919 wxEVT_MOTION,
3920 wxEVT_LEFT_DCLICK,
3921 wxEVT_MIDDLE_DCLICK,
3922 wxEVT_RIGHT_DCLICK,
3923 wxEVT_ENTER_WINDOW,
3924 wxEVT_LEAVE_WINDOW,
3925 wxEVT_MOUSEWHEEL
3926 ])
3927
3928
3929# Scrolling from wxWindow (sent to wxScrolledWindow)
3930EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3931 wxEVT_SCROLLWIN_BOTTOM,
3932 wxEVT_SCROLLWIN_LINEUP,
3933 wxEVT_SCROLLWIN_LINEDOWN,
3934 wxEVT_SCROLLWIN_PAGEUP,
3935 wxEVT_SCROLLWIN_PAGEDOWN,
3936 wxEVT_SCROLLWIN_THUMBTRACK,
3937 wxEVT_SCROLLWIN_THUMBRELEASE,
3938 ])
3939
3940EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3941EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3942EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3943EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3944EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3945EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3946EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3947EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3948
27fb7603 3949# Scrolling from wx.Slider and wx.ScrollBar
d14a1e28
RD
3950EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3951 wxEVT_SCROLL_BOTTOM,
3952 wxEVT_SCROLL_LINEUP,
3953 wxEVT_SCROLL_LINEDOWN,
3954 wxEVT_SCROLL_PAGEUP,
3955 wxEVT_SCROLL_PAGEDOWN,
3956 wxEVT_SCROLL_THUMBTRACK,
3957 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3958 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3959 ])
3960
3961EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3962EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3963EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3964EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3965EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3966EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3967EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3968EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3969EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3970EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3971
27fb7603 3972# Scrolling from wx.Slider and wx.ScrollBar, with an id
d14a1e28
RD
3973EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3974 wxEVT_SCROLL_BOTTOM,
3975 wxEVT_SCROLL_LINEUP,
3976 wxEVT_SCROLL_LINEDOWN,
3977 wxEVT_SCROLL_PAGEUP,
3978 wxEVT_SCROLL_PAGEDOWN,
3979 wxEVT_SCROLL_THUMBTRACK,
3980 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3981 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3982 ], 1)
3983
3984EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3985EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3986EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3987EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3988EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3989EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3990EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3991EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3992EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3993EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d14a1e28 3994
d14a1e28
RD
3995EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3996EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3997EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3998EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3999EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
4000EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
4001EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
4002EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
4003EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
4004EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
4005
4006EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
4007EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
4008EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
4009EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
4010EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
4011EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
4012EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
4013EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
4014EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
4015
4016
4017EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
4018EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
4019EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
4020EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
4021EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
4022EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
4023EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
4024
4025EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4026
4027EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4028EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4029
4030EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4031
4032
4033
4034#---------------------------------------------------------------------------
4035
4036class Event(Object):
27fb7603
RD
4037 """
4038 An event is a structure holding information about an event passed to a
4039 callback or member function. wx.Event is an abstract base class for
4040 other event classes
4041 """
e811c8ce
RD
4042 def __init__(self): raise RuntimeError, "No constructor defined"
4043 def __repr__(self):
4044 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45 4045 def __del__(self, destroy=_core_.delete_Event):
a95a7133 4046 """__del__(self)"""
d14a1e28
RD
4047 try:
4048 if self.thisown: destroy(self)
4049 except: pass
e811c8ce
RD
4050
4051 def SetEventType(*args, **kwargs):
27fb7603
RD
4052 """
4053 SetEventType(self, wxEventType typ)
4054
4055 Sets the specific type of the event.
4056 """
54f9ee45 4057 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
4058
4059 def GetEventType(*args, **kwargs):
27fb7603
RD
4060 """
4061 GetEventType(self) -> wxEventType
4062
4063 Returns the identifier of the given event type, such as
4064 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4065 """
54f9ee45 4066 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
4067
4068 def GetEventObject(*args, **kwargs):
27fb7603
RD
4069 """
4070 GetEventObject(self) -> Object
4071
4072 Returns the object (usually a window) associated with the event, if
4073 any.
4074 """
54f9ee45 4075 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
4076
4077 def SetEventObject(*args, **kwargs):
27fb7603
RD
4078 """
4079 SetEventObject(self, Object obj)
4080
4081 Sets the originating object, or in other words, obj is normally the
4082 object that is sending the event.
4083 """
54f9ee45 4084 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
4085
4086 def GetTimestamp(*args, **kwargs):
a95a7133 4087 """GetTimestamp(self) -> long"""
54f9ee45 4088 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
4089
4090 def SetTimestamp(*args, **kwargs):
a95a7133 4091 """SetTimestamp(self, long ts=0)"""
54f9ee45 4092 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
4093
4094 def GetId(*args, **kwargs):
27fb7603
RD
4095 """
4096 GetId(self) -> int
4097
4098 Returns the identifier associated with this event, such as a button
4099 command id.
4100 """
54f9ee45 4101 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
4102
4103 def SetId(*args, **kwargs):
27fb7603
RD
4104 """
4105 SetId(self, int Id)
4106
4107 Set's the ID for the event. This is usually the ID of the window that
4108 is sending the event, but it can also be a command id from a menu
4109 item, etc.
4110 """
54f9ee45 4111 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
4112
4113 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4114 """
4115 IsCommandEvent(self) -> bool
4116
4117 Returns true if the event is or is derived from `wx.CommandEvent` else
4118 it returns false. Note: Exists only for optimization purposes.
4119 """
54f9ee45 4120 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
4121
4122 def Skip(*args, **kwargs):
51b83b37
RD
4123 """
4124 Skip(self, bool skip=True)
4125
4126 Called by an event handler, it controls whether additional event
4127 handlers bound to this event will be called after the current event
4128 handler returns. Skip(false) (the default setting) will prevent
4129 additional event handlers from being called and control will be
4130 returned to the sender of the event immediately after the current
4131 handler has finished. Skip(True) will cause the event processing
4132 system to continue searching for a handler function for this event.
4133
4134 """
54f9ee45 4135 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
4136
4137 def GetSkipped(*args, **kwargs):
27fb7603
RD
4138 """
4139 GetSkipped(self) -> bool
4140
4141 Returns true if the event handler should be skipped, false otherwise.
4142 :see: `Skip`
4143 """
54f9ee45 4144 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
4145
4146 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4147 """
4148 ShouldPropagate(self) -> bool
4149
4150 Test if this event should be propagated to the parent window or not,
4151 i.e. if the propagation level is currently greater than 0.
4152 """
54f9ee45 4153 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
4154
4155 def StopPropagation(*args, **kwargs):
27fb7603
RD
4156 """
4157 StopPropagation(self) -> int
4158
4159 Stop the event from propagating to its parent window. Returns the old
4160 propagation level value which may be later passed to
4161 `ResumePropagation` to allow propagating the event again.
4162 """
54f9ee45 4163 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
4164
4165 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4166 """
4167 ResumePropagation(self, int propagationLevel)
4168
4169 Resume the event propagation by restoring the propagation level. (For
4170 example, you can use the value returned by an earlier call to
4171 `StopPropagation`.)
4172
4173 """
54f9ee45 4174 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
4175
4176 def Clone(*args, **kwargs):
a95a7133 4177 """Clone(self) -> Event"""
54f9ee45 4178 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 4179
d14a1e28
RD
4180
4181class EventPtr(Event):
4182 def __init__(self, this):
4183 self.this = this
4184 if not hasattr(self,"thisown"): self.thisown = 0
4185 self.__class__ = Event
54f9ee45 4186_core_.Event_swigregister(EventPtr)
d14a1e28
RD
4187
4188#---------------------------------------------------------------------------
4189
4190class PropagationDisabler(object):
27fb7603
RD
4191 """
4192 Helper class to temporarily change an event not to propagate. Simply
4193 create an instance of this class and then whe it is destroyed the
4194 propogation of the event will be restored.
4195 """
e811c8ce
RD
4196 def __repr__(self):
4197 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4198 def __init__(self, *args, **kwargs):
27fb7603
RD
4199 """
4200 __init__(self, Event event) -> PropagationDisabler
4201
4202 Helper class to temporarily change an event not to propagate. Simply
4203 create an instance of this class and then whe it is destroyed the
4204 propogation of the event will be restored.
4205 """
54f9ee45 4206 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
d14a1e28
RD
4207 self.this = newobj.this
4208 self.thisown = 1
4209 del newobj.thisown
54f9ee45 4210 def __del__(self, destroy=_core_.delete_PropagationDisabler):
a95a7133 4211 """__del__(self)"""
d14a1e28
RD
4212 try:
4213 if self.thisown: destroy(self)
4214 except: pass
e811c8ce 4215
d14a1e28
RD
4216
4217class PropagationDisablerPtr(PropagationDisabler):
4218 def __init__(self, this):
4219 self.this = this
4220 if not hasattr(self,"thisown"): self.thisown = 0
4221 self.__class__ = PropagationDisabler
54f9ee45 4222_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
d14a1e28
RD
4223
4224class PropagateOnce(object):
27fb7603
RD
4225 """
4226 A helper class that will temporarily lower propagation level of an
4227 event. Simply create an instance of this class and then whe it is
4228 destroyed the propogation of the event will be restored.
4229 """
e811c8ce
RD
4230 def __repr__(self):
4231 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4232 def __init__(self, *args, **kwargs):
27fb7603
RD
4233 """
4234 __init__(self, Event event) -> PropagateOnce
4235
4236 A helper class that will temporarily lower propagation level of an
4237 event. Simply create an instance of this class and then whe it is
4238 destroyed the propogation of the event will be restored.
4239 """
54f9ee45 4240 newobj = _core_.new_PropagateOnce(*args, **kwargs)
d14a1e28
RD
4241 self.this = newobj.this
4242 self.thisown = 1
4243 del newobj.thisown
54f9ee45 4244 def __del__(self, destroy=_core_.delete_PropagateOnce):
a95a7133 4245 """__del__(self)"""
d14a1e28
RD
4246 try:
4247 if self.thisown: destroy(self)
4248 except: pass
e811c8ce 4249
d14a1e28
RD
4250
4251class PropagateOncePtr(PropagateOnce):
4252 def __init__(self, this):
4253 self.this = this
4254 if not hasattr(self,"thisown"): self.thisown = 0
4255 self.__class__ = PropagateOnce
54f9ee45 4256_core_.PropagateOnce_swigregister(PropagateOncePtr)
d14a1e28
RD
4257
4258#---------------------------------------------------------------------------
4259
4260class CommandEvent(Event):
27fb7603
RD
4261 """
4262 This event class contains information about command events, which
4263 originate from a variety of simple controls, as well as menus and
4264 toolbars.
4265 """
e811c8ce
RD
4266 def __repr__(self):
4267 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4268 def __init__(self, *args, **kwargs):
27fb7603
RD
4269 """
4270 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
4271
4272 This event class contains information about command events, which
4273 originate from a variety of simple controls, as well as menus and
4274 toolbars.
4275 """
54f9ee45 4276 newobj = _core_.new_CommandEvent(*args, **kwargs)
d14a1e28
RD
4277 self.this = newobj.this
4278 self.thisown = 1
4279 del newobj.thisown
e811c8ce 4280 def GetSelection(*args, **kwargs):
27fb7603
RD
4281 """
4282 GetSelection(self) -> int
4283
4284 Returns item index for a listbox or choice selection event (not valid
4285 for a deselection).
4286 """
54f9ee45 4287 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
4288
4289 def SetString(*args, **kwargs):
a95a7133 4290 """SetString(self, String s)"""
54f9ee45 4291 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
4292
4293 def GetString(*args, **kwargs):
27fb7603
RD
4294 """
4295 GetString(self) -> String
4296
4297 Returns item string for a listbox or choice selection event (not valid
4298 for a deselection).
4299 """
54f9ee45 4300 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
4301
4302 def IsChecked(*args, **kwargs):
27fb7603
RD
4303 """
4304 IsChecked(self) -> bool
4305
4306 This method can be used with checkbox and menu events: for the
4307 checkboxes, the method returns true for a selection event and false
4308 for a deselection one. For the menu events, this method indicates if
4309 the menu item just has become checked or unchecked (and thus only
4310 makes sense for checkable menu items).
4311 """
54f9ee45 4312 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 4313
242b7b46 4314 Checked = IsChecked
e811c8ce 4315 def IsSelection(*args, **kwargs):
27fb7603
RD
4316 """
4317 IsSelection(self) -> bool
4318
4319 For a listbox or similar event, returns true if it is a selection,
4320 false if it is a deselection.
4321 """
54f9ee45 4322 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
4323
4324 def SetExtraLong(*args, **kwargs):
a95a7133 4325 """SetExtraLong(self, long extraLong)"""
54f9ee45 4326 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
4327
4328 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4329 """
4330 GetExtraLong(self) -> long
4331
5ba5649b
RD
4332 Returns extra information dependant on the event objects type. If the
4333 event comes from a listbox selection, it is a boolean determining
4334 whether the event was a selection (true) or a deselection (false). A
4335 listbox deselection only occurs for multiple-selection boxes, and in
4336 this case the index and string values are indeterminate and the
4337 listbox must be examined by the application.
27fb7603 4338 """
54f9ee45 4339 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
4340
4341 def SetInt(*args, **kwargs):
a95a7133 4342 """SetInt(self, int i)"""
54f9ee45 4343 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
4344
4345 def GetInt(*args, **kwargs):
27fb7603
RD
4346 """
4347 GetInt(self) -> long
4348
5ba5649b
RD
4349 Returns the integer identifier corresponding to a listbox, choice or
4350 radiobox selection (only if the event was a selection, not a
4351 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4352 """
54f9ee45 4353 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce
RD
4354
4355 def Clone(*args, **kwargs):
a95a7133 4356 """Clone(self) -> Event"""
54f9ee45 4357 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 4358
d14a1e28
RD
4359
4360class CommandEventPtr(CommandEvent):
4361 def __init__(self, this):
4362 self.this = this
4363 if not hasattr(self,"thisown"): self.thisown = 0
4364 self.__class__ = CommandEvent
54f9ee45 4365_core_.CommandEvent_swigregister(CommandEventPtr)
d14a1e28
RD
4366
4367#---------------------------------------------------------------------------
4368
4369class NotifyEvent(CommandEvent):
27fb7603
RD
4370 """
4371 An instance of this class (or one of its derived classes) is sent from
4372 a control when the control's state is being changed and the control
4373 allows that change to be prevented from happening. The event handler
4374 can call `Veto` or `Allow` to tell the control what to do.
4375 """
e811c8ce
RD
4376 def __repr__(self):
4377 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4378 def __init__(self, *args, **kwargs):
27fb7603
RD
4379 """
4380 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4381
4382 An instance of this class (or one of its derived classes) is sent from
4383 a control when the control's state is being changed and the control
4384 allows that change to be prevented from happening. The event handler
4385 can call `Veto` or `Allow` to tell the control what to do.
4386 """
54f9ee45 4387 newobj = _core_.new_NotifyEvent(*args, **kwargs)
d14a1e28
RD
4388 self.this = newobj.this
4389 self.thisown = 1
4390 del newobj.thisown
e811c8ce 4391 def Veto(*args, **kwargs):
27fb7603
RD
4392 """
4393 Veto(self)
4394
4395 Prevents the change announced by this event from happening.
4396
4397 It is in general a good idea to notify the user about the reasons for
4398 vetoing the change because otherwise the applications behaviour (which
4399 just refuses to do what the user wants) might be quite surprising.
4400 """
54f9ee45 4401 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
4402
4403 def Allow(*args, **kwargs):
27fb7603
RD
4404 """
4405 Allow(self)
4406
4407 This is the opposite of `Veto`: it explicitly allows the event to be
4408 processed. For most events it is not necessary to call this method as
4409 the events are allowed anyhow but some are forbidden by default (this
4410 will be mentioned in the corresponding event description).
4411 """
54f9ee45 4412 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
4413
4414 def IsAllowed(*args, **kwargs):
27fb7603
RD
4415 """
4416 IsAllowed(self) -> bool
4417
4418 Returns true if the change is allowed (`Veto` hasn't been called) or
4419 false otherwise (if it was).
4420 """
54f9ee45 4421 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 4422
d14a1e28
RD
4423
4424class NotifyEventPtr(NotifyEvent):
4425 def __init__(self, this):
4426 self.this = this
4427 if not hasattr(self,"thisown"): self.thisown = 0
4428 self.__class__ = NotifyEvent
54f9ee45 4429_core_.NotifyEvent_swigregister(NotifyEventPtr)
d14a1e28
RD
4430
4431#---------------------------------------------------------------------------
4432
4433class ScrollEvent(CommandEvent):
27fb7603
RD
4434 """
4435 A scroll event holds information about events sent from stand-alone
4436 scrollbars and sliders. Note that scrolled windows do not send
4437 instnaces of this event class, but send the `wx.ScrollWinEvent`
4438 instead.
4439 """
e811c8ce
RD
4440 def __repr__(self):
4441 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4442 def __init__(self, *args, **kwargs):
0df68c9f 4443 """
a95a7133 4444 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
4445 int orient=0) -> ScrollEvent
4446 """
54f9ee45 4447 newobj = _core_.new_ScrollEvent(*args, **kwargs)
d14a1e28
RD
4448 self.this = newobj.this
4449 self.thisown = 1
4450 del newobj.thisown
e811c8ce 4451 def GetOrientation(*args, **kwargs):
27fb7603
RD
4452 """
4453 GetOrientation(self) -> int
4454
4455 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4456 the scrollbar.
4457 """
54f9ee45 4458 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4459
4460 def GetPosition(*args, **kwargs):
27fb7603
RD
4461 """
4462 GetPosition(self) -> int
4463
4464 Returns the position of the scrollbar.
4465 """
54f9ee45 4466 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4467
4468 def SetOrientation(*args, **kwargs):
a95a7133 4469 """SetOrientation(self, int orient)"""
54f9ee45 4470 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4471
4472 def SetPosition(*args, **kwargs):
a95a7133 4473 """SetPosition(self, int pos)"""
54f9ee45 4474 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 4475
d14a1e28
RD
4476
4477class ScrollEventPtr(ScrollEvent):
4478 def __init__(self, this):
4479 self.this = this
4480 if not hasattr(self,"thisown"): self.thisown = 0
4481 self.__class__ = ScrollEvent
54f9ee45 4482_core_.ScrollEvent_swigregister(ScrollEventPtr)
d14a1e28
RD
4483
4484#---------------------------------------------------------------------------
4485
4486class ScrollWinEvent(Event):
27fb7603
RD
4487 """
4488 A wx.ScrollWinEvent holds information about scrolling and is sent from
4489 scrolling windows.
4490 """
e811c8ce
RD
4491 def __repr__(self):
4492 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4493 def __init__(self, *args, **kwargs):
27fb7603
RD
4494 """
4495 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4496
4497 A wx.ScrollWinEvent holds information about scrolling and is sent from
4498 scrolling windows.
4499 """
54f9ee45 4500 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
d14a1e28
RD
4501 self.this = newobj.this
4502 self.thisown = 1
4503 del newobj.thisown
e811c8ce 4504 def GetOrientation(*args, **kwargs):
27fb7603
RD
4505 """
4506 GetOrientation(self) -> int
4507
4508 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4509 the scrollbar.
4510 """
54f9ee45 4511 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4512
4513 def GetPosition(*args, **kwargs):
27fb7603
RD
4514 """
4515 GetPosition(self) -> int
4516
4517 Returns the position of the scrollbar for the thumb track and release
4518 events. Note that this field can't be used for the other events, you
4519 need to query the window itself for the current position in that case.
4520 """
54f9ee45 4521 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4522
4523 def SetOrientation(*args, **kwargs):
a95a7133 4524 """SetOrientation(self, int orient)"""
54f9ee45 4525 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4526
4527 def SetPosition(*args, **kwargs):
a95a7133 4528 """SetPosition(self, int pos)"""
54f9ee45 4529 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 4530
d14a1e28
RD
4531
4532class ScrollWinEventPtr(ScrollWinEvent):
4533 def __init__(self, this):
4534 self.this = this
4535 if not hasattr(self,"thisown"): self.thisown = 0
4536 self.__class__ = ScrollWinEvent
54f9ee45 4537_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
d14a1e28
RD
4538
4539#---------------------------------------------------------------------------
4540
54f9ee45
RD
4541MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4542MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4543MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4544MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4545MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 4546class MouseEvent(Event):
27fb7603
RD
4547 """
4548 This event class contains information about the events generated by
4549 the mouse: they include mouse buttons press and release events and
4550 mouse move events.
4551
4552 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4553 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4554 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4555 a middle button so a portable application should avoid relying on the
4556 events from it.
4557
4558 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4559 the former returns true when the event corresponds to the left mouse
4560 button click while the latter returns true if the left mouse button is
4561 currently being pressed. For example, when the user is dragging the
4562 mouse you can use `LeftIsDown` to test whether the left mouse button
4563 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4564 `LeftIsDown` will also return true in wxWidgets whatever the
4565 underlying GUI behaviour is (which is platform-dependent). The same
4566 applies, of course, to other mouse buttons as well.
4567 """
e811c8ce
RD
4568 def __repr__(self):
4569 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4570 def __init__(self, *args, **kwargs):
27fb7603
RD
4571 """
4572 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4573
4574 Constructs a wx.MouseEvent. Valid event types are:
4575
4576 * wxEVT_ENTER_WINDOW
4577 * wxEVT_LEAVE_WINDOW
4578 * wxEVT_LEFT_DOWN
4579 * wxEVT_LEFT_UP
4580 * wxEVT_LEFT_DCLICK
4581 * wxEVT_MIDDLE_DOWN
4582 * wxEVT_MIDDLE_UP
4583 * wxEVT_MIDDLE_DCLICK
4584 * wxEVT_RIGHT_DOWN
4585 * wxEVT_RIGHT_UP
4586 * wxEVT_RIGHT_DCLICK
4587 * wxEVT_MOTION
4588 * wxEVT_MOUSEWHEEL
4589 """
54f9ee45 4590 newobj = _core_.new_MouseEvent(*args, **kwargs)
d14a1e28
RD
4591 self.this = newobj.this
4592 self.thisown = 1
4593 del newobj.thisown
e811c8ce 4594 def IsButton(*args, **kwargs):
27fb7603
RD
4595 """
4596 IsButton(self) -> bool
4597
4598 Returns true if the event was a mouse button event (not necessarily a
4599 button down event - that may be tested using `ButtonDown`).
4600 """
54f9ee45 4601 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
4602
4603 def ButtonDown(*args, **kwargs):
27fb7603
RD
4604 """
4605 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4606
5ba5649b
RD
4607 If the argument is omitted, this returns true if the event was any
4608 mouse button down event. Otherwise the argument specifies which
4609 button-down event shold be checked for (see `Button` for the possible
4610 values).
27fb7603 4611 """
54f9ee45 4612 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
4613
4614 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4615 """
4616 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4617
4618 If the argument is omitted, this returns true if the event was any
4619 mouse double click event. Otherwise the argument specifies which
4620 double click event to check for (see `Button` for the possible
4621 values).
4622 """
54f9ee45 4623 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
4624
4625 def ButtonUp(*args, **kwargs):
27fb7603
RD
4626 """
4627 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4628
4629 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4630 mouse button up event. Otherwise the argument specifies which button
4631 up event to check for (see `Button` for the possible values).
27fb7603 4632 """
54f9ee45 4633 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
4634
4635 def Button(*args, **kwargs):
27fb7603
RD
4636 """
4637 Button(self, int button) -> bool
4638
4639 Returns true if the identified mouse button is changing state. Valid
4640 values of button are:
4641
4642 ==================== =====================================
4643 wx.MOUSE_BTN_LEFT check if left button was pressed
4644 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4645 wx.MOUSE_BTN_RIGHT check if right button was pressed
4646 wx.MOUSE_BTN_ANY check if any button was pressed
4647 ==================== =====================================
4648
4649 """
54f9ee45 4650 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
4651
4652 def ButtonIsDown(*args, **kwargs):
a95a7133 4653 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 4654 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
4655
4656 def GetButton(*args, **kwargs):
27fb7603
RD
4657 """
4658 GetButton(self) -> int
4659
4660 Returns the mouse button which generated this event or
4661 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4662 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4663 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4664 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4665 right buttons respectively.
4666 """
54f9ee45 4667 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
4668
4669 def ControlDown(*args, **kwargs):
27fb7603
RD
4670 """
4671 ControlDown(self) -> bool
4672
4673 Returns true if the control key was down at the time of the event.
4674 """
54f9ee45 4675 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4676
4677 def MetaDown(*args, **kwargs):
27fb7603
RD
4678 """
4679 MetaDown(self) -> bool
4680
4681 Returns true if the Meta key was down at the time of the event.
4682 """
54f9ee45 4683 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4684
4685 def AltDown(*args, **kwargs):
27fb7603
RD
4686 """
4687 AltDown(self) -> bool
4688
4689 Returns true if the Alt key was down at the time of the event.
4690 """
54f9ee45 4691 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4692
4693 def ShiftDown(*args, **kwargs):
27fb7603
RD
4694 """
4695 ShiftDown(self) -> bool
4696
4697 Returns true if the Shift key was down at the time of the event.
4698 """
54f9ee45 4699 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 4700
412d302d
RD
4701 def CmdDown(*args, **kwargs):
4702 """
4703 CmdDown(self) -> bool
4704
4705 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4706 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4707 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4708 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4709 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4710 purpose. So for non-Mac platforms this is the same as `ControlDown`
4711 and Macs this is the same as `MetaDown`.
4712 """
4713 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4714
e811c8ce 4715 def LeftDown(*args, **kwargs):
27fb7603
RD
4716 """
4717 LeftDown(self) -> bool
4718
4719 Returns true if the left mouse button state changed to down.
4720 """
54f9ee45 4721 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
4722
4723 def MiddleDown(*args, **kwargs):
27fb7603
RD
4724 """
4725 MiddleDown(self) -> bool
4726
4727 Returns true if the middle mouse button state changed to down.
4728 """
54f9ee45 4729 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
4730
4731 def RightDown(*args, **kwargs):
27fb7603
RD
4732 """
4733 RightDown(self) -> bool
4734
4735 Returns true if the right mouse button state changed to down.
4736 """
54f9ee45 4737 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
4738
4739 def LeftUp(*args, **kwargs):
27fb7603
RD
4740 """
4741 LeftUp(self) -> bool
4742
4743 Returns true if the left mouse button state changed to up.
4744 """
54f9ee45 4745 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
4746
4747 def MiddleUp(*args, **kwargs):
27fb7603
RD
4748 """
4749 MiddleUp(self) -> bool
4750
4751 Returns true if the middle mouse button state changed to up.
4752 """
54f9ee45 4753 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
4754
4755 def RightUp(*args, **kwargs):
27fb7603
RD
4756 """
4757 RightUp(self) -> bool
4758
4759 Returns true if the right mouse button state changed to up.
4760 """
54f9ee45 4761 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
4762
4763 def LeftDClick(*args, **kwargs):
27fb7603
RD
4764 """
4765 LeftDClick(self) -> bool
4766
4767 Returns true if the event was a left button double click.
4768 """
54f9ee45 4769 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
4770
4771 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4772 """
4773 MiddleDClick(self) -> bool
4774
4775 Returns true if the event was a middle button double click.
4776 """
54f9ee45 4777 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
4778
4779 def RightDClick(*args, **kwargs):
27fb7603
RD
4780 """
4781 RightDClick(self) -> bool
4782
4783 Returns true if the event was a right button double click.
4784 """
54f9ee45 4785 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
4786
4787 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4788 """
4789 LeftIsDown(self) -> bool
4790
4791 Returns true if the left mouse button is currently down, independent
4792 of the current event type.
4793
4794 Please notice that it is not the same as LeftDown which returns true
4795 if the left mouse button was just pressed. Rather, it describes the
4796 state of the mouse button before the event happened.
4797
4798 This event is usually used in the mouse event handlers which process
4799 "move mouse" messages to determine whether the user is (still)
4800 dragging the mouse.
4801 """
54f9ee45 4802 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
4803
4804 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4805 """
4806 MiddleIsDown(self) -> bool
4807
4808 Returns true if the middle mouse button is currently down, independent
4809 of the current event type.
4810 """
54f9ee45 4811 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
4812
4813 def RightIsDown(*args, **kwargs):
27fb7603
RD
4814 """
4815 RightIsDown(self) -> bool
4816
4817 Returns true if the right mouse button is currently down, independent
4818 of the current event type.
4819 """
54f9ee45 4820 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
4821
4822 def Dragging(*args, **kwargs):
27fb7603
RD
4823 """
4824 Dragging(self) -> bool
4825
4826 Returns true if this was a dragging event (motion while a button is
4827 depressed).
4828 """
54f9ee45 4829 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
4830
4831 def Moving(*args, **kwargs):
27fb7603
RD
4832 """
4833 Moving(self) -> bool
4834
4835 Returns true if this was a motion event and no mouse buttons were
4836 pressed. If any mouse button is held pressed, then this method returns
4837 false and Dragging returns true.
4838 """
54f9ee45 4839 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
4840
4841 def Entering(*args, **kwargs):
27fb7603
RD
4842 """
4843 Entering(self) -> bool
4844
4845 Returns true if the mouse was entering the window.
4846 """
54f9ee45 4847 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
4848
4849 def Leaving(*args, **kwargs):
27fb7603
RD
4850 """
4851 Leaving(self) -> bool
4852
4853 Returns true if the mouse was leaving the window.
4854 """
54f9ee45 4855 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
4856
4857 def GetPosition(*args, **kwargs):
0df68c9f 4858 """
a95a7133 4859 GetPosition(self) -> Point
e811c8ce 4860
27fb7603
RD
4861 Returns the pixel position of the mouse in window coordinates when the
4862 event happened.
0df68c9f 4863 """
54f9ee45 4864 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4865
4866 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4867 """
4868 GetPositionTuple() -> (x,y)
e811c8ce 4869
27fb7603
RD
4870 Returns the pixel position of the mouse in window coordinates when the
4871 event happened.
0df68c9f 4872 """
54f9ee45 4873 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4874
4875 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4876 """
4877 GetLogicalPosition(self, DC dc) -> Point
4878
4879 Returns the logical mouse position in pixels (i.e. translated
4880 according to the translation set for the DC, which usually indicates
4881 that the window has been scrolled).
4882 """
54f9ee45 4883 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
4884
4885 def GetX(*args, **kwargs):
27fb7603
RD
4886 """
4887 GetX(self) -> int
4888
4889 Returns X coordinate of the physical mouse event position.
4890 """
54f9ee45 4891 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
4892
4893 def GetY(*args, **kwargs):
27fb7603
RD
4894 """
4895 GetY(self) -> int
4896
4897 Returns Y coordinate of the physical mouse event position.
4898 """
54f9ee45 4899 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
4900
4901 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4902 """
4903 GetWheelRotation(self) -> int
4904
4905 Get wheel rotation, positive or negative indicates direction of
4906 rotation. Current devices all send an event when rotation is equal to
4907 +/-WheelDelta, but this allows for finer resolution devices to be
4908 created in the future. Because of this you shouldn't assume that one
4909 event is equal to 1 line or whatever, but you should be able to either
4910 do partial line scrolling or wait until +/-WheelDelta rotation values
4911 have been accumulated before scrolling.
4912 """
54f9ee45 4913 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
4914
4915 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4916 """
4917 GetWheelDelta(self) -> int
4918
4919 Get wheel delta, normally 120. This is the threshold for action to be
4920 taken, and one such action (for example, scrolling one increment)
4921 should occur for each delta.
4922 """
54f9ee45 4923 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce
RD
4924
4925 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4926 """
4927 GetLinesPerAction(self) -> int
4928
4929 Returns the configured number of lines (or whatever) to be scrolled
4930 per wheel action. Defaults to three.
4931 """
54f9ee45 4932 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
4933
4934 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4935 """
4936 IsPageScroll(self) -> bool
4937
4938 Returns true if the system has been setup to do page scrolling with
4939 the mouse wheel instead of line scrolling.
4940 """
54f9ee45
RD
4941 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4942
4943 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4944 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4945 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4946 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4947 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4948 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4949 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4950 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4951 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4952 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4953 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4954 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
d14a1e28
RD
4955
4956class MouseEventPtr(MouseEvent):
4957 def __init__(self, this):
4958 self.this = this
4959 if not hasattr(self,"thisown"): self.thisown = 0
4960 self.__class__ = MouseEvent
54f9ee45 4961_core_.MouseEvent_swigregister(MouseEventPtr)
d14a1e28
RD
4962
4963#---------------------------------------------------------------------------
4964
4965class SetCursorEvent(Event):
5ba5649b
RD
4966 """
4967 A SetCursorEvent is generated when the mouse cursor is about to be set
4968 as a result of mouse motion. This event gives the application the
4969 chance to perform specific mouse cursor processing based on the
4970 current position of the mouse within the window. Use the `SetCursor`
4971 method to specify the cursor you want to be displayed.
4972 """
e811c8ce
RD
4973 def __repr__(self):
4974 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4975 def __init__(self, *args, **kwargs):
5ba5649b
RD
4976 """
4977 __init__(self, int x=0, int y=0) -> SetCursorEvent
4978
4979 Construct a new `wx.SetCursorEvent`.
4980 """
54f9ee45 4981 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
d14a1e28
RD
4982 self.this = newobj.this
4983 self.thisown = 1
4984 del newobj.thisown
e811c8ce 4985 def GetX(*args, **kwargs):
5ba5649b
RD
4986 """
4987 GetX(self) -> int
4988
4989 Returns the X coordinate of the mouse in client coordinates.
4990 """
54f9ee45 4991 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
4992
4993 def GetY(*args, **kwargs):
5ba5649b
RD
4994 """
4995 GetY(self) -> int
4996
4997 Returns the Y coordinate of the mouse in client coordinates.
4998 """
54f9ee45 4999 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
5000
5001 def SetCursor(*args, **kwargs):
5ba5649b
RD
5002 """
5003 SetCursor(self, Cursor cursor)
5004
5005 Sets the cursor associated with this event.
5006 """
54f9ee45 5007 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
5008
5009 def GetCursor(*args, **kwargs):
5ba5649b
RD
5010 """
5011 GetCursor(self) -> Cursor
5012
5013 Returns a reference to the cursor specified by this event.
5014 """
54f9ee45 5015 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
5016
5017 def HasCursor(*args, **kwargs):
5ba5649b
RD
5018 """
5019 HasCursor(self) -> bool
5020
5021 Returns true if the cursor specified by this event is a valid cursor.
5022 """
54f9ee45 5023 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 5024
d14a1e28
RD
5025
5026class SetCursorEventPtr(SetCursorEvent):
5027 def __init__(self, this):
5028 self.this = this
5029 if not hasattr(self,"thisown"): self.thisown = 0
5030 self.__class__ = SetCursorEvent
54f9ee45 5031_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
d14a1e28
RD
5032
5033#---------------------------------------------------------------------------
5034
5035class KeyEvent(Event):
5ba5649b
RD
5036 """
5037 This event class contains information about keypress and character
5038 events. These events are only sent to the widget that currently has
5039 the keyboard focus.
5040
5041 Notice that there are three different kinds of keyboard events in
5042 wxWidgets: key down and up events and char events. The difference
5043 between the first two is clear - the first corresponds to a key press
5044 and the second to a key release - otherwise they are identical. Just
5045 note that if the key is maintained in a pressed state you will
5046 typically get a lot of (automatically generated) down events but only
5047 one up so it is wrong to assume that there is one up event
5048 corresponding to each down one.
5049
5050 Both key events provide untranslated key codes while the char event
5051 carries the translated one. The untranslated code for alphanumeric
5052 keys is always an upper case value. For the other keys it is one of
5053 WXK_XXX values from the keycodes table. The translated key is, in
5054 general, the character the user expects to appear as the result of the
5055 key combination when typing the text into a text entry zone, for
5056 example.
5057
5058 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5059 and the standard US keyboard): when the 'A' key is pressed, the key
5060 down event key code is equal to ASCII A == 65. But the char event key
5061 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5062 'A' keys simultaneously , the key code in key down event will still be
5063 just 'A' while the char event key code parameter will now be 'A' as
5064 well.
5065
5066 Although in this simple case it is clear that the correct key code
5067 could be found in the key down event handler by checking the value
5068 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5069 as for non alphanumeric keys or non-US keyboard layouts the
5070 translation is keyboard-layout dependent and can only be done properly
5071 by the system itself.
5072
5073 Another kind of translation is done when the control key is pressed:
5074 for example, for CTRL-A key press the key down event still carries the
5075 same key code 'A' as usual but the char event will have key code of 1,
5076 the ASCII value of this key combination.
5077
5078 You may discover how the other keys on your system behave
5079 interactively by running the KeyEvents sample in the wxPython demo and
5080 pressing some keys while the blue box at the top has the keyboard
5081 focus.
5082
5083 **Note**: If a key down event is caught and the event handler does not
5084 call event.Skip() then the coresponding char event will not
5085 happen. This is by design and enables the programs that handle both
5086 types of events to be a bit simpler.
5087
5088 **Note for Windows programmers**: The key and char events in wxWidgets
5089 are similar to but slightly different from Windows WM_KEYDOWN and
5090 WM_CHAR events. In particular, Alt-x combination will generate a char
5091 event in wxWidgets (unless it is used as an accelerator).
5092
5093 **Tip**: be sure to call event.Skip() for events that you don't
5094 process in key event function, otherwise menu shortcuts may cease to
5095 work under Windows.
5096
5097 """
e811c8ce
RD
5098 def __repr__(self):
5099 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5100 def __init__(self, *args, **kwargs):
5ba5649b
RD
5101 """
5102 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
5103
5104 Construct a new `wx.KeyEvent`. Valid event types are:
5105 *
5106 """
54f9ee45 5107 newobj = _core_.new_KeyEvent(*args, **kwargs)
d14a1e28
RD
5108 self.this = newobj.this
5109 self.thisown = 1
5110 del newobj.thisown
b1fcee84
RD
5111 def GetModifiers(*args, **kwargs):
5112 """
5113 GetModifiers(self) -> int
5114
5115 Returns a bitmask of the current modifier settings. Can be used to
5116 check if the key event has exactly the given modifiers without having
5117 to explicitly check that the other modifiers are not down. For
5118 example::
5119
5120 if event.GetModifers() == wx.MOD_CONTROL:
5121 DoSomething()
5122
5123 """
5124 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
5125
e811c8ce 5126 def ControlDown(*args, **kwargs):
5ba5649b
RD
5127 """
5128 ControlDown(self) -> bool
5129
5130 Returns ``True`` if the Control key was down at the time of the event.
5131 """
54f9ee45 5132 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
5133
5134 def MetaDown(*args, **kwargs):
5ba5649b
RD
5135 """
5136 MetaDown(self) -> bool
5137
5138 Returns ``True`` if the Meta key was down at the time of the event.
5139 """
54f9ee45 5140 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
5141
5142 def AltDown(*args, **kwargs):
5ba5649b
RD
5143 """
5144 AltDown(self) -> bool
5145
5146 Returns ``True`` if the Alt key was down at the time of the event.
5147 """
54f9ee45 5148 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
5149
5150 def ShiftDown(*args, **kwargs):
5ba5649b
RD
5151 """
5152 ShiftDown(self) -> bool
5153
5154 Returns ``True`` if the Shift key was down at the time of the event.
5155 """
54f9ee45 5156 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 5157
412d302d
RD
5158 def CmdDown(*args, **kwargs):
5159 """
5160 CmdDown(self) -> bool
5161
5162 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5163 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5164 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5165 because Cmd key is used for the same thing under Mac as Ctrl
5166 elsewhere. The Ctrl still exists, it's just not used for this
5167 purpose. So for non-Mac platforms this is the same as `ControlDown`
5168 and Macs this is the same as `MetaDown`.
5169 """
5170 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5171
e811c8ce 5172 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5173 """
5174 HasModifiers(self) -> bool
5175
5176 Returns true if either CTRL or ALT keys was down at the time of the
5177 key event. Note that this function does not take into account neither
5178 SHIFT nor META key states (the reason for ignoring the latter is that
5179 it is common for NUMLOCK key to be configured as META under X but the
5180 key presses even while NUMLOCK is on should be still processed
5181 normally).
5182 """
54f9ee45 5183 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
5184
5185 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5186 """
5187 GetKeyCode(self) -> int
5188
5189 Returns the virtual key code. ASCII events return normal ASCII values,
5190 while non-ASCII events return values such as WXK_LEFT for the left
5191 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5192 codes.
5193
5194 Note that in Unicode build, the returned value is meaningful only if
5195 the user entered a character that can be represented in current
5196 locale's default charset. You can obtain the corresponding Unicode
5197 character using `GetUnicodeKey`.
5198 """
54f9ee45 5199 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 5200
d14a1e28 5201 KeyCode = GetKeyCode
19272049 5202 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5203 """
5204 GetUnicodeKey(self) -> int
5205
5206 Returns the Unicode character corresponding to this key event. This
5207 function is only meaningfule in a Unicode build of wxPython.
5208 """
19272049 5209 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 5210
19272049 5211 GetUniChar = GetUnicodeKey
e811c8ce 5212 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5213 """
5214 GetRawKeyCode(self) -> unsigned int
5215
5216 Returns the raw key code for this event. This is a platform-dependent
5217 scan code which should only be used in advanced
5218 applications. Currently the raw key codes are not supported by all
5219 ports.
5220 """
54f9ee45 5221 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
5222
5223 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5224 """
5225 GetRawKeyFlags(self) -> unsigned int
5226
5227 Returns the low level key flags for this event. The flags are
5228 platform-dependent and should only be used in advanced applications.
5229 Currently the raw key flags are not supported by all ports.
5230 """
54f9ee45 5231 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
5232
5233 def GetPosition(*args, **kwargs):
0df68c9f 5234 """
a95a7133 5235 GetPosition(self) -> Point
e811c8ce 5236
5ba5649b 5237 Find the position of the event, if applicable.
0df68c9f 5238 """
54f9ee45 5239 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5240
5241 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
5242 """
5243 GetPositionTuple() -> (x,y)
e811c8ce 5244
5ba5649b 5245 Find the position of the event, if applicable.
0df68c9f 5246 """
54f9ee45 5247 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
5248
5249 def GetX(*args, **kwargs):
5ba5649b
RD
5250 """
5251 GetX(self) -> int
5252
5253 Returns the X position (in client coordinates) of the event, if
5254 applicable.
5255 """
54f9ee45 5256 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
5257
5258 def GetY(*args, **kwargs):
5ba5649b
RD
5259 """
5260 GetY(self) -> int
5261
5262 Returns the Y position (in client coordinates) of the event, if
5263 applicable.
5264 """
54f9ee45
RD
5265 return _core_.KeyEvent_GetY(*args, **kwargs)
5266
5267 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5268 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5269 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5270 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5271 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5272 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5273 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5274 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5275 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5276 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
d14a1e28
RD
5277
5278class KeyEventPtr(KeyEvent):
5279 def __init__(self, this):
5280 self.this = this
5281 if not hasattr(self,"thisown"): self.thisown = 0
5282 self.__class__ = KeyEvent
54f9ee45 5283_core_.KeyEvent_swigregister(KeyEventPtr)
d14a1e28
RD
5284
5285#---------------------------------------------------------------------------
5286
5287class SizeEvent(Event):
5ba5649b
RD
5288 """
5289 A size event holds information about size change events. The EVT_SIZE
5290 handler function will be called when the window it is bound to has
5291 been resized.
5292
5293 Note that the size passed is of the whole window: call
5294 `wx.Window.GetClientSize` for the area which may be used by the
5295 application.
5296
5297 When a window is resized, usually only a small part of the window is
5298 damaged and and that area is all that is in the update region for the
5299 next paint event. However, if your drawing depends on the size of the
5300 window, you may need to clear the DC explicitly and repaint the whole
5301 window. In which case, you may need to call `wx.Window.Refresh` to
5302 invalidate the entire window.
5303
5304 """
e811c8ce
RD
5305 def __repr__(self):
5306 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5307 def __init__(self, *args, **kwargs):
5ba5649b
RD
5308 """
5309 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5310
5311 Construct a new ``wx.SizeEvent``.
5312 """
54f9ee45 5313 newobj = _core_.new_SizeEvent(*args, **kwargs)
d14a1e28
RD
5314 self.this = newobj.this
5315 self.thisown = 1
5316 del newobj.thisown
e811c8ce 5317 def GetSize(*args, **kwargs):
5ba5649b
RD
5318 """
5319 GetSize(self) -> Size
5320
5321 Returns the entire size of the window generating the size change
5322 event.
5323 """
54f9ee45 5324 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
5325
5326 def GetRect(*args, **kwargs):
a95a7133 5327 """GetRect(self) -> Rect"""
54f9ee45 5328 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5329
5330 def SetRect(*args, **kwargs):
a95a7133 5331 """SetRect(self, Rect rect)"""
54f9ee45 5332 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5333
5334 def SetSize(*args, **kwargs):
a95a7133 5335 """SetSize(self, Size size)"""
54f9ee45 5336 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 5337
54f9ee45
RD
5338 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5339 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
d14a1e28
RD
5340
5341class SizeEventPtr(SizeEvent):
5342 def __init__(self, this):
5343 self.this = this
5344 if not hasattr(self,"thisown"): self.thisown = 0
5345 self.__class__ = SizeEvent
54f9ee45 5346_core_.SizeEvent_swigregister(SizeEventPtr)
d14a1e28
RD
5347
5348#---------------------------------------------------------------------------
5349
5350class MoveEvent(Event):
5ba5649b
RD
5351 """
5352 This event object is sent for EVT_MOVE event bindings when a window is
5353 moved to a new position.
5354 """
e811c8ce
RD
5355 def __repr__(self):
5356 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5357 def __init__(self, *args, **kwargs):
5ba5649b
RD
5358 """
5359 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5360
5361 Constructor.
5362 """
54f9ee45 5363 newobj = _core_.new_MoveEvent(*args, **kwargs)
d14a1e28
RD
5364 self.this = newobj.this
5365 self.thisown = 1
5366 del newobj.thisown
e811c8ce 5367 def GetPosition(*args, **kwargs):
5ba5649b
RD
5368 """
5369 GetPosition(self) -> Point
5370
5371 Returns the position of the window generating the move change event.
5372 """
54f9ee45 5373 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5374
5375 def GetRect(*args, **kwargs):
a95a7133 5376 """GetRect(self) -> Rect"""
54f9ee45 5377 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5378
5379 def SetRect(*args, **kwargs):
a95a7133 5380 """SetRect(self, Rect rect)"""
54f9ee45 5381 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5382
5383 def SetPosition(*args, **kwargs):
a95a7133 5384 """SetPosition(self, Point pos)"""
54f9ee45 5385 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 5386
7557b9b5
RD
5387 m_pos = property(GetPosition, SetPosition)
5388 m_rect = property(GetRect, SetRect)
5389
d14a1e28
RD
5390
5391class MoveEventPtr(MoveEvent):
5392 def __init__(self, this):
5393 self.this = this
5394 if not hasattr(self,"thisown"): self.thisown = 0
5395 self.__class__ = MoveEvent
54f9ee45 5396_core_.MoveEvent_swigregister(MoveEventPtr)
d14a1e28
RD
5397
5398#---------------------------------------------------------------------------
5399
5400class PaintEvent(Event):
5ba5649b
RD
5401 """
5402 A paint event is sent when a window's contents needs to be repainted.
5403 Note that in an EVT_PAINT handler the application must *always* create
5404 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5405 Windows assumes that the window has not been painted yet and will send
5406 the event again, causing endless refreshes.
5407
5408 You can optimize painting by retrieving the rectangles that have been
5409 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5410 and only repainting these rectangles. The rectangles are in terms of
5411 the client area, and are unscrolled, so you will need to do some
5412 calculations using the current view position to obtain logical,
5413 scrolled units.
5414
5415 """
e811c8ce
RD
5416 def __repr__(self):
5417 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5418 def __init__(self, *args, **kwargs):
a95a7133 5419 """__init__(self, int Id=0) -> PaintEvent"""
54f9ee45 5420 newobj = _core_.new_PaintEvent(*args, **kwargs)
d14a1e28
RD
5421 self.this = newobj.this
5422 self.thisown = 1
5423 del newobj.thisown
d14a1e28
RD
5424
5425class PaintEventPtr(PaintEvent):
5426 def __init__(self, this):
5427 self.this = this
5428 if not hasattr(self,"thisown"): self.thisown = 0
5429 self.__class__ = PaintEvent
54f9ee45 5430_core_.PaintEvent_swigregister(PaintEventPtr)
d14a1e28
RD
5431
5432class NcPaintEvent(Event):
093d3ff1 5433 """Proxy of C++ NcPaintEvent class"""
e811c8ce
RD
5434 def __repr__(self):
5435 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5436 def __init__(self, *args, **kwargs):
a95a7133 5437 """__init__(self, int winid=0) -> NcPaintEvent"""
54f9ee45 5438 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
d14a1e28
RD
5439 self.this = newobj.this
5440 self.thisown = 1
5441 del newobj.thisown
d14a1e28
RD
5442
5443class NcPaintEventPtr(NcPaintEvent):
5444 def __init__(self, this):
5445 self.this = this
5446 if not hasattr(self,"thisown"): self.thisown = 0
5447 self.__class__ = NcPaintEvent
54f9ee45 5448_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
d14a1e28
RD
5449
5450#---------------------------------------------------------------------------
5451
5452class EraseEvent(Event):
5ba5649b
RD
5453 """
5454 An erase event is sent whenever the background of a window needs to be
5455 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5456 binder. On some platforms, such as GTK+, this event is simulated
5457 (simply generated just before the paint event) and may cause flicker.
5458
5459 To paint a custom background use the `GetDC` method and use the returned
5460 device context if it is not ``None``, otherwise create a temporary
5461 `wx.ClientDC` and draw on that.
5462
5463 """
e811c8ce
RD
5464 def __repr__(self):
5465 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5466 def __init__(self, *args, **kwargs):
5ba5649b
RD
5467 """
5468 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5469
5470 Constructor
5471 """
54f9ee45 5472 newobj = _core_.new_EraseEvent(*args, **kwargs)
d14a1e28
RD
5473 self.this = newobj.this
5474 self.thisown = 1
5475 del newobj.thisown
e811c8ce 5476 def GetDC(*args, **kwargs):
5ba5649b
RD
5477 """
5478 GetDC(self) -> DC
5479
5480 Returns the device context the event handler should draw upon. If
5481 ``None`` is returned then create a temporary `wx.ClientDC` and use
5482 that instead.
5483 """
54f9ee45 5484 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 5485
d14a1e28
RD
5486
5487class EraseEventPtr(EraseEvent):
5488 def __init__(self, this):
5489 self.this = this
5490 if not hasattr(self,"thisown"): self.thisown = 0
5491 self.__class__ = EraseEvent
54f9ee45 5492_core_.EraseEvent_swigregister(EraseEventPtr)
d14a1e28
RD
5493
5494#---------------------------------------------------------------------------
5495
5496class FocusEvent(Event):
5ba5649b
RD
5497 """
5498 A focus event is sent when a window's focus changes. The window losing
5499 focus receives an EVT_KILL_FOCUS event while the window gaining it
5500 gets an EVT_SET_FOCUS event.
5501
5502 Notice that the set focus event happens both when the user gives focus
5503 to the window (whether using the mouse or keyboard) and when it is
5504 done from the program itself using `wx.Window.SetFocus`.
5505
5506 """
e811c8ce
RD
5507 def __repr__(self):
5508 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5509 def __init__(self, *args, **kwargs):
5ba5649b
RD
5510 """
5511 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5512
5513 Constructor
5514 """
54f9ee45 5515 newobj = _core_.new_FocusEvent(*args, **kwargs)
d14a1e28
RD
5516 self.this = newobj.this
5517 self.thisown = 1
5518 del newobj.thisown
e811c8ce 5519 def GetWindow(*args, **kwargs):
5ba5649b
RD
5520 """
5521 GetWindow(self) -> Window
5522
5523 Returns the other window associated with this event, that is the
5524 window which had the focus before for the EVT_SET_FOCUS event and the
5525 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5526
5527 Warning: the window returned may be None!
5528 """
54f9ee45 5529 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
5530
5531 def SetWindow(*args, **kwargs):
a95a7133 5532 """SetWindow(self, Window win)"""
54f9ee45 5533 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 5534
d14a1e28
RD
5535
5536class FocusEventPtr(FocusEvent):
5537 def __init__(self, this):
5538 self.this = this
5539 if not hasattr(self,"thisown"): self.thisown = 0
5540 self.__class__ = FocusEvent
54f9ee45 5541_core_.FocusEvent_swigregister(FocusEventPtr)
d14a1e28
RD
5542
5543#---------------------------------------------------------------------------
5544
5545class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5546 """
5547 wx.ChildFocusEvent notifies the parent that a child has received the
5548 focus. Unlike `wx.FocusEvent` it is propagated up the window
5549 heirarchy.
5550 """
e811c8ce
RD
5551 def __repr__(self):
5552 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5553 def __init__(self, *args, **kwargs):
5ba5649b
RD
5554 """
5555 __init__(self, Window win=None) -> ChildFocusEvent
5556
5557 Constructor
5558 """
54f9ee45 5559 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
d14a1e28
RD
5560 self.this = newobj.this
5561 self.thisown = 1
5562 del newobj.thisown
e811c8ce 5563 def GetWindow(*args, **kwargs):
5ba5649b
RD
5564 """
5565 GetWindow(self) -> Window
5566
5567 The window which has just received the focus.
5568 """
54f9ee45 5569 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 5570
d14a1e28
RD
5571
5572class ChildFocusEventPtr(ChildFocusEvent):
5573 def __init__(self, this):
5574 self.this = this
5575 if not hasattr(self,"thisown"): self.thisown = 0
5576 self.__class__ = ChildFocusEvent
54f9ee45 5577_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
d14a1e28
RD
5578
5579#---------------------------------------------------------------------------
5580
5581class ActivateEvent(Event):
5ba5649b
RD
5582 """
5583 An activate event is sent when a top-level window or the entire
5584 application is being activated or deactivated.
5585
5586 A top-level window (a dialog or frame) receives an activate event when
5587 is being activated or deactivated. This is indicated visually by the
5588 title bar changing colour, and a subwindow gaining the keyboard focus.
5589 An application is activated or deactivated when one of its frames
5590 becomes activated, or a frame becomes inactivate resulting in all
5591 application frames being inactive.
5592
5593 Please note that usually you should call event.Skip() in your handlers
5594 for these events so the default handlers will still be called, as not
5595 doing so can result in strange effects.
5596
5597 """
e811c8ce
RD
5598 def __repr__(self):
5599 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5600 def __init__(self, *args, **kwargs):
5ba5649b
RD
5601 """
5602 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5603
5604 Constructor
5605 """
54f9ee45 5606 newobj = _core_.new_ActivateEvent(*args, **kwargs)
d14a1e28
RD
5607 self.this = newobj.this
5608 self.thisown = 1
5609 del newobj.thisown
e811c8ce 5610 def GetActive(*args, **kwargs):
5ba5649b
RD
5611 """
5612 GetActive(self) -> bool
5613
5614 Returns true if the application or window is being activated, false
5615 otherwise.
5616 """
54f9ee45 5617 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 5618
d14a1e28
RD
5619
5620class ActivateEventPtr(ActivateEvent):
5621 def __init__(self, this):
5622 self.this = this
5623 if not hasattr(self,"thisown"): self.thisown = 0
5624 self.__class__ = ActivateEvent
54f9ee45 5625_core_.ActivateEvent_swigregister(ActivateEventPtr)
d14a1e28
RD
5626
5627#---------------------------------------------------------------------------
5628
5629class InitDialogEvent(Event):
5ba5649b
RD
5630 """
5631 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5632 any window when `wx.Window.InitDialog` is called. Handlers for this
5633 event can transfer data to the window, or anything else that should be
5634 done before the user begins editing the form. The default handler
5635 calls `wx.Window.TransferDataToWindow`.
5636 """
e811c8ce
RD
5637 def __repr__(self):
5638 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5639 def __init__(self, *args, **kwargs):
5ba5649b
RD
5640 """
5641 __init__(self, int Id=0) -> InitDialogEvent
5642
5643 Constructor
5644 """
54f9ee45 5645 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
d14a1e28
RD
5646 self.this = newobj.this
5647 self.thisown = 1
5648 del newobj.thisown
d14a1e28
RD
5649
5650class InitDialogEventPtr(InitDialogEvent):
5651 def __init__(self, this):
5652 self.this = this
5653 if not hasattr(self,"thisown"): self.thisown = 0
5654 self.__class__ = InitDialogEvent
54f9ee45 5655_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
d14a1e28
RD
5656
5657#---------------------------------------------------------------------------
5658
5659class MenuEvent(Event):
5ba5649b
RD
5660 """
5661 This class is used for a variety of menu-related events. Note that
5662 these do not include menu command events, which are handled by sending
5663 `wx.CommandEvent` objects.
5664
5665 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5666 text in the first field of the status bar.
5667 """
e811c8ce
RD
5668 def __repr__(self):
5669 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5670 def __init__(self, *args, **kwargs):
5ba5649b
RD
5671 """
5672 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5673
5674 Constructor
5675 """
54f9ee45 5676 newobj = _core_.new_MenuEvent(*args, **kwargs)
d14a1e28
RD
5677 self.this = newobj.this
5678 self.thisown = 1
5679 del newobj.thisown
e811c8ce 5680 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5681 """
5682 GetMenuId(self) -> int
5683
5684 Returns the menu identifier associated with the event. This method
5685 should be only used with the HIGHLIGHT events.
5686 """
54f9ee45 5687 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
5688
5689 def IsPopup(*args, **kwargs):
5ba5649b
RD
5690 """
5691 IsPopup(self) -> bool
5692
5693 Returns ``True`` if the menu which is being opened or closed is a
5694 popup menu, ``False`` if it is a normal one. This method should only
5695 be used with the OPEN and CLOSE events.
5696 """
54f9ee45 5697 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
5698
5699 def GetMenu(*args, **kwargs):
5ba5649b
RD
5700 """
5701 GetMenu(self) -> Menu
5702
5703 Returns the menu which is being opened or closed. This method should
5704 only be used with the OPEN and CLOSE events.
5705 """
54f9ee45 5706 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 5707
d14a1e28
RD
5708
5709class MenuEventPtr(MenuEvent):
5710 def __init__(self, this):
5711 self.this = this
5712 if not hasattr(self,"thisown"): self.thisown = 0
5713 self.__class__ = MenuEvent
54f9ee45 5714_core_.MenuEvent_swigregister(MenuEventPtr)
d14a1e28
RD
5715
5716#---------------------------------------------------------------------------
5717
5718class CloseEvent(Event):
5ba5649b
RD
5719 """
5720 This event class contains information about window and session close
5721 events.
5722
5723 The handler function for EVT_CLOSE is called when the user has tried
5724 to close a a frame or dialog box using the window manager controls or
5725 the system menu. It can also be invoked by the application itself
5726 programmatically, for example by calling the `wx.Window.Close`
5727 function.
5728
5729 You should check whether the application is forcing the deletion of
5730 the window using `CanVeto`. If it returns ``False``, you must destroy
5731 the window using `wx.Window.Destroy`. If the return value is ``True``,
5732 it is up to you whether you respond by destroying the window or not.
5733 For example you may wish to display a message dialog prompting to save
5734 files or to cancel the close.
5735
5736 If you don't destroy the window, you should call `Veto` to let the
5737 calling code know that you did not destroy the window. This allows the
5738 `wx.Window.Close` function to return ``True`` or ``False`` depending
5739 on whether the close instruction was honored or not.
5740 """
e811c8ce
RD
5741 def __repr__(self):
5742 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5743 def __init__(self, *args, **kwargs):
5ba5649b
RD
5744 """
5745 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5746
5747 Constructor.
5748 """
54f9ee45 5749 newobj = _core_.new_CloseEvent(*args, **kwargs)
d14a1e28
RD
5750 self.this = newobj.this
5751 self.thisown = 1
5752 del newobj.thisown
e811c8ce 5753 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5754 """
5755 SetLoggingOff(self, bool logOff)
5756
5757 Sets the 'logging off' flag.
5758 """
54f9ee45 5759 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
5760
5761 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5762 """
5763 GetLoggingOff(self) -> bool
5764
6c75a4cf
RD
5765 Returns ``True`` if the user is logging off or ``False`` if the
5766 system is shutting down. This method can only be called for end
5767 session and query end session events, it doesn't make sense for close
5768 window event.
5ba5649b 5769 """
54f9ee45 5770 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
5771
5772 def Veto(*args, **kwargs):
5ba5649b
RD
5773 """
5774 Veto(self, bool veto=True)
5775
5776 Call this from your event handler to veto a system shutdown or to
5777 signal to the calling application that a window close did not happen.
5778
5779 You can only veto a shutdown or close if `CanVeto` returns true.
5780 """
54f9ee45 5781 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce 5782
5ba5649b
RD
5783 def GetVeto(*args, **kwargs):
5784 """GetVeto(self) -> bool"""
5785 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5786
e811c8ce 5787 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5788 """
5789 SetCanVeto(self, bool canVeto)
5790
5791 Sets the 'can veto' flag.
5792 """
54f9ee45 5793 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
5794
5795 def CanVeto(*args, **kwargs):
5ba5649b
RD
5796 """
5797 CanVeto(self) -> bool
e811c8ce 5798
5ba5649b
RD
5799 Returns true if you can veto a system shutdown or a window close
5800 event. Vetoing a window close event is not possible if the calling
5801 code wishes to force the application to exit, and so this function
5802 must be called to check this.
5803 """
5804 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce 5805
d14a1e28
RD
5806
5807class CloseEventPtr(CloseEvent):
5808 def __init__(self, this):
5809 self.this = this
5810 if not hasattr(self,"thisown"): self.thisown = 0
5811 self.__class__ = CloseEvent
54f9ee45 5812_core_.CloseEvent_swigregister(CloseEventPtr)
d14a1e28
RD
5813
5814#---------------------------------------------------------------------------
5815
5816class ShowEvent(Event):
5ba5649b 5817 """An EVT_SHOW event is sent when a window is shown or hidden."""
e811c8ce
RD
5818 def __repr__(self):
5819 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5820 def __init__(self, *args, **kwargs):
5ba5649b
RD
5821 """
5822 __init__(self, int winid=0, bool show=False) -> ShowEvent
5823
5824 An EVT_SHOW event is sent when a window is shown or hidden.
5825 """
54f9ee45 5826 newobj = _core_.new_ShowEvent(*args, **kwargs)
d14a1e28
RD
5827 self.this = newobj.this
5828 self.thisown = 1
5829 del newobj.thisown
e811c8ce 5830 def SetShow(*args, **kwargs):
a95a7133 5831 """SetShow(self, bool show)"""
54f9ee45 5832 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
5833
5834 def GetShow(*args, **kwargs):
a95a7133 5835 """GetShow(self) -> bool"""
54f9ee45 5836 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 5837
d14a1e28
RD
5838
5839class ShowEventPtr(ShowEvent):
5840 def __init__(self, this):
5841 self.this = this
5842 if not hasattr(self,"thisown"): self.thisown = 0
5843 self.__class__ = ShowEvent
54f9ee45 5844_core_.ShowEvent_swigregister(ShowEventPtr)
d14a1e28
RD
5845
5846#---------------------------------------------------------------------------
5847
5848class IconizeEvent(Event):
5ba5649b
RD
5849 """
5850 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5851 restored.
5852 """
e811c8ce
RD
5853 def __repr__(self):
5854 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5855 def __init__(self, *args, **kwargs):
5ba5649b
RD
5856 """
5857 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5858
5859 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5860 restored.
5861 """
54f9ee45 5862 newobj = _core_.new_IconizeEvent(*args, **kwargs)
d14a1e28
RD
5863 self.this = newobj.this
5864 self.thisown = 1
5865 del newobj.thisown
e811c8ce 5866 def Iconized(*args, **kwargs):
5ba5649b
RD
5867 """
5868 Iconized(self) -> bool
5869
5870 Returns ``True`` if the frame has been iconized, ``False`` if it has
5871 been restored.
5872 """
54f9ee45 5873 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 5874
d14a1e28
RD
5875
5876class IconizeEventPtr(IconizeEvent):
5877 def __init__(self, this):
5878 self.this = this
5879 if not hasattr(self,"thisown"): self.thisown = 0
5880 self.__class__ = IconizeEvent
54f9ee45 5881_core_.IconizeEvent_swigregister(IconizeEventPtr)
d14a1e28
RD
5882
5883#---------------------------------------------------------------------------
5884
5885class MaximizeEvent(Event):
5ba5649b 5886 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
e811c8ce
RD
5887 def __repr__(self):
5888 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5889 def __init__(self, *args, **kwargs):
5ba5649b
RD
5890 """
5891 __init__(self, int id=0) -> MaximizeEvent
5892
5893 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5894 """
54f9ee45 5895 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
d14a1e28
RD
5896 self.this = newobj.this
5897 self.thisown = 1
5898 del newobj.thisown
d14a1e28
RD
5899
5900class MaximizeEventPtr(MaximizeEvent):
5901 def __init__(self, this):
5902 self.this = this
5903 if not hasattr(self,"thisown"): self.thisown = 0
5904 self.__class__ = MaximizeEvent
54f9ee45 5905_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
d14a1e28
RD
5906
5907#---------------------------------------------------------------------------
5908
5909class DropFilesEvent(Event):
5ba5649b
RD
5910 """
5911 This class is used for drop files events, that is, when files have
5912 been dropped onto the window. This functionality is only available
5913 under Windows. The window must have previously been enabled for
5914 dropping by calling `wx.Window.DragAcceptFiles`.
5915
5916 Important note: this is a separate implementation to the more general
5917 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5918 implementation uses the older, Windows message-based approach of
5919 dropping files.
5920
5921 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5922 events.
5923
5924 """
d14a1e28
RD
5925 def __init__(self): raise RuntimeError, "No constructor defined"
5926 def __repr__(self):
5927 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 5928 def GetPosition(*args, **kwargs):
5ba5649b
RD
5929 """
5930 GetPosition(self) -> Point
5931
5932 Returns the position at which the files were dropped.
5933 """
54f9ee45 5934 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5935
5936 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5937 """
5938 GetNumberOfFiles(self) -> int
5939
5940 Returns the number of files dropped.
5941 """
54f9ee45 5942 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
5943
5944 def GetFiles(*args, **kwargs):
5ba5649b
RD
5945 """
5946 GetFiles(self) -> PyObject
5947
5948 Returns a list of the filenames that were dropped.
5949 """
54f9ee45 5950 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 5951
d14a1e28
RD
5952
5953class DropFilesEventPtr(DropFilesEvent):
5954 def __init__(self, this):
5955 self.this = this
5956 if not hasattr(self,"thisown"): self.thisown = 0
5957 self.__class__ = DropFilesEvent
54f9ee45 5958_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
d14a1e28
RD
5959
5960#---------------------------------------------------------------------------
5961
54f9ee45
RD
5962UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5963UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 5964class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5965 """
5966 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5967 wxWidgets to give an application the chance to update various user
5968 interface elements.
5969
5970 Without update UI events, an application has to work hard to
5971 check/uncheck, enable/disable, and set the text for elements such as
5972 menu items and toolbar buttons. The code for doing this has to be
5973 mixed up with the code that is invoked when an action is invoked for a
5974 menu item or button.
5975
5976 With update UI events, you define an event handler to look at the
5977 state of the application and change UI elements accordingly. wxWidgets
5978 will call your handler functions in idle time, so you don't have to
5979 worry where to call this code. In addition to being a clearer and more
5980 declarative method, it also means you don't have to worry whether
5981 you're updating a toolbar or menubar identifier. The same handler can
5982 update a menu item and toolbar button, if the ID values are the same.
5983
5984 Instead of directly manipulating the menu or button, you call
5985 functions in the event object, such as `Check`. wxWidgets will
5986 determine whether such a call has been made, and which UI element to
5987 update.
5988
5989 These events will work for popup menus as well as menubars. Just
5990 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5991 any UI events for the window that owns the menu.
5992
5993 If you find that the overhead of UI update processing is affecting
5994 your application, you can do one or both of the following:
5995
5996 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5997 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5998 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5999 receive update events. No other windows will receive update
6000 events.
6001
6002 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6003 value to set the delay between updates. You may need to call
6004 `wx.Window.UpdateWindowUI` at critical points, for example when
6005 a dialog is about to be shown, in case the user sees a slight
6006 delay before windows are updated.
6007
6008 Note that although events are sent in idle time, defining a EVT_IDLE
6009 handler for a window does not affect this because the events are sent
6010 from an internal idle handler.
6011
6012 wxWidgets tries to optimize update events on some platforms. On
6013 Windows and GTK+, events for menubar items are only sent when the menu
6014 is about to be shown, and not in idle time.
6015
6016 """
e811c8ce
RD
6017 def __repr__(self):
6018 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6019 def __init__(self, *args, **kwargs):
5ba5649b
RD
6020 """
6021 __init__(self, int commandId=0) -> UpdateUIEvent
6022
6023 Constructor
6024 """
54f9ee45 6025 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
d14a1e28
RD
6026 self.this = newobj.this
6027 self.thisown = 1
6028 del newobj.thisown
e811c8ce 6029 def GetChecked(*args, **kwargs):
5ba5649b
RD
6030 """
6031 GetChecked(self) -> bool
6032
6033 Returns ``True`` if the UI element should be checked.
6034 """
54f9ee45 6035 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
6036
6037 def GetEnabled(*args, **kwargs):
5ba5649b
RD
6038 """
6039 GetEnabled(self) -> bool
6040
6041 Returns ``True`` if the UI element should be enabled.
6042 """
54f9ee45 6043 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce 6044
b1fcee84
RD
6045 def GetShown(*args, **kwargs):
6046 """
6047 GetShown(self) -> bool
6048
6049 Returns ``True`` if the UI element should be shown.
6050 """
6051 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
6052
e811c8ce 6053 def GetText(*args, **kwargs):
5ba5649b
RD
6054 """
6055 GetText(self) -> String
6056
6057 Returns the text that should be set for the UI element.
6058 """
54f9ee45 6059 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
6060
6061 def GetSetText(*args, **kwargs):
5ba5649b
RD
6062 """
6063 GetSetText(self) -> bool
6064
6065 Returns ``True`` if the application has called `SetText`. For
6066 wxWidgets internal use only.
6067 """
54f9ee45 6068 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
6069
6070 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
6071 """
6072 GetSetChecked(self) -> bool
6073
6074 Returns ``True`` if the application has called `Check`. For wxWidgets
6075 internal use only.
6076 """
54f9ee45 6077 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
6078
6079 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
6080 """
6081 GetSetEnabled(self) -> bool
6082
6083 Returns ``True`` if the application has called `Enable`. For wxWidgets
6084 internal use only.
6085 """
54f9ee45 6086 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce 6087
b1fcee84
RD
6088 def GetSetShown(*args, **kwargs):
6089 """
6090 GetSetShown(self) -> bool
6091
6092 Returns ``True`` if the application has called `Show`. For wxWidgets
6093 internal use only.
6094 """
6095 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
6096
e811c8ce 6097 def Check(*args, **kwargs):
5ba5649b
RD
6098 """
6099 Check(self, bool check)
6100
6101 Check or uncheck the UI element.
6102 """
54f9ee45 6103 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
6104
6105 def Enable(*args, **kwargs):
5ba5649b
RD
6106 """
6107 Enable(self, bool enable)
6108
6109 Enable or disable the UI element.
6110 """
54f9ee45 6111 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce 6112
b1fcee84
RD
6113 def Show(*args, **kwargs):
6114 """
6115 Show(self, bool show)
6116
6117 Show or hide the UI element.
6118 """
6119 return _core_.UpdateUIEvent_Show(*args, **kwargs)
6120
e811c8ce 6121 def SetText(*args, **kwargs):
5ba5649b
RD
6122 """
6123 SetText(self, String text)
6124
6125 Sets the text for this UI element.
6126 """
54f9ee45 6127 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
6128
6129 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6130 """
6131 SetUpdateInterval(long updateInterval)
6132
6133 Sets the interval between updates in milliseconds. Set to -1 to
6134 disable updates, or to 0 to update as frequently as possible. The
6135 default is 0.
6136
6137 Use this to reduce the overhead of UI update events if your
6138 application has a lot of windows. If you set the value to -1 or
6139 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6140 at appropriate points in your application, such as when a dialog is
6141 about to be shown.
6142 """
54f9ee45 6143 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
6144
6145 SetUpdateInterval = staticmethod(SetUpdateInterval)
6146 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6147 """
6148 GetUpdateInterval() -> long
6149
6150 Returns the current interval between updates in milliseconds. -1
6151 disables updates, 0 updates as frequently as possible.
6152 """
54f9ee45 6153 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
6154
6155 GetUpdateInterval = staticmethod(GetUpdateInterval)
6156 def CanUpdate(*args, **kwargs):
5ba5649b
RD
6157 """
6158 CanUpdate(Window win) -> bool
6159
6160 Returns ``True`` if it is appropriate to update (send UI update events
6161 to) this window.
6162
6163 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6164 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6165 events were last sent in idle time, and the update interval, to
6166 determine whether events should be sent to this window now. By default
6167 this will always return true because the update mode is initially
6168 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6169 events will be sent as often as possible. You can reduce the frequency
6170 that events are sent by changing the mode and/or setting an update
6171 interval.
6172
6173 """
54f9ee45 6174 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
6175
6176 CanUpdate = staticmethod(CanUpdate)
6177 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6178 """
6179 ResetUpdateTime()
6180
6181 Used internally to reset the last-updated time to the current time. It
6182 is assumed that update events are normally sent in idle time, so this
6183 is called at the end of idle processing.
6184 """
54f9ee45 6185 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
6186
6187 ResetUpdateTime = staticmethod(ResetUpdateTime)
6188 def SetMode(*args, **kwargs):
5ba5649b
RD
6189 """
6190 SetMode(int mode)
6191
6192 Specify how wxWidgets will send update events: to all windows, or only
6193 to those which specify that they will process the events.
6194
6195 The mode may be one of the following values:
6196
6197 ============================= ==========================================
6198 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6199 is the default setting.
6200 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6201 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6202 style set.
6203 ============================= ==========================================
6204
6205 """
54f9ee45 6206 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6207
6208 SetMode = staticmethod(SetMode)
6209 def GetMode(*args, **kwargs):
5ba5649b
RD
6210 """
6211 GetMode() -> int
6212
6213 Returns a value specifying how wxWidgets will send update events: to
6214 all windows, or only to those which specify that they will process the
6215 events.
6216 """
54f9ee45 6217 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6218
6219 GetMode = staticmethod(GetMode)
d14a1e28
RD
6220
6221class UpdateUIEventPtr(UpdateUIEvent):
6222 def __init__(self, this):
6223 self.this = this
6224 if not hasattr(self,"thisown"): self.thisown = 0
6225 self.__class__ = UpdateUIEvent
54f9ee45 6226_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
d14a1e28 6227
e811c8ce 6228def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6229 """
6230 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6231
6232 Sets the interval between updates in milliseconds. Set to -1 to
6233 disable updates, or to 0 to update as frequently as possible. The
6234 default is 0.
6235
6236 Use this to reduce the overhead of UI update events if your
6237 application has a lot of windows. If you set the value to -1 or
6238 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6239 at appropriate points in your application, such as when a dialog is
6240 about to be shown.
6241 """
54f9ee45 6242 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 6243
e811c8ce 6244def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6245 """
6246 UpdateUIEvent_GetUpdateInterval() -> long
6247
6248 Returns the current interval between updates in milliseconds. -1
6249 disables updates, 0 updates as frequently as possible.
6250 """
54f9ee45 6251 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d14a1e28 6252
e811c8ce 6253def UpdateUIEvent_CanUpdate(*args, **kwargs):
5ba5649b
RD
6254 """
6255 UpdateUIEvent_CanUpdate(Window win) -> bool
6256
6257 Returns ``True`` if it is appropriate to update (send UI update events
6258 to) this window.
6259
6260 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6261 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6262 events were last sent in idle time, and the update interval, to
6263 determine whether events should be sent to this window now. By default
6264 this will always return true because the update mode is initially
6265 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6266 events will be sent as often as possible. You can reduce the frequency
6267 that events are sent by changing the mode and/or setting an update
6268 interval.
6269
6270 """
54f9ee45 6271 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 6272
e811c8ce 6273def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6274 """
6275 UpdateUIEvent_ResetUpdateTime()
6276
6277 Used internally to reset the last-updated time to the current time. It
6278 is assumed that update events are normally sent in idle time, so this
6279 is called at the end of idle processing.
6280 """
54f9ee45 6281 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d14a1e28 6282
e811c8ce 6283def UpdateUIEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6284 """
6285 UpdateUIEvent_SetMode(int mode)
6286
6287 Specify how wxWidgets will send update events: to all windows, or only
6288 to those which specify that they will process the events.
6289
6290 The mode may be one of the following values:
6291
6292 ============================= ==========================================
6293 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6294 is the default setting.
6295 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6296 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6297 style set.
6298 ============================= ==========================================
6299
6300 """
54f9ee45 6301 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 6302
e811c8ce 6303def UpdateUIEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6304 """
6305 UpdateUIEvent_GetMode() -> int
6306
6307 Returns a value specifying how wxWidgets will send update events: to
6308 all windows, or only to those which specify that they will process the
6309 events.
6310 """
54f9ee45 6311 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d14a1e28
RD
6312
6313#---------------------------------------------------------------------------
6314
6315class SysColourChangedEvent(Event):
5ba5649b
RD
6316 """
6317 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6318 when the user changes the colour settings using the control
6319 panel. This is only applicable under Windows.
6320
6321 The default event handler for this event propagates the event to child
6322 windows, since Windows only sends the events to top-level windows. If
6323 intercepting this event for a top-level window, remember to call
6324 `Skip` so the the base class handler will still be executed, or to
6325 pass the event on to the window's children explicitly.
6326
6327 """
e811c8ce
RD
6328 def __repr__(self):
6329 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6330 def __init__(self, *args, **kwargs):
5ba5649b
RD
6331 """
6332 __init__(self) -> SysColourChangedEvent
6333
6334 Constructor
6335 """
54f9ee45 6336 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
d14a1e28
RD
6337 self.this = newobj.this
6338 self.thisown = 1
6339 del newobj.thisown
d14a1e28
RD
6340
6341class SysColourChangedEventPtr(SysColourChangedEvent):
6342 def __init__(self, this):
6343 self.this = this
6344 if not hasattr(self,"thisown"): self.thisown = 0
6345 self.__class__ = SysColourChangedEvent
54f9ee45 6346_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
d14a1e28
RD
6347
6348#---------------------------------------------------------------------------
6349
6350class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6351 """
6352 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6353 a window that loses its mouse capture. This is called even if
6354 `wx.Window.ReleaseMouse` was called by the application code. Handling
6355 this event allows an application to cater for unexpected capture
6356 releases which might otherwise confuse mouse handling code.
6357
6358 This event is implemented under Windows only.
6359 """
e811c8ce
RD
6360 def __repr__(self):
6361 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6362 def __init__(self, *args, **kwargs):
5ba5649b
RD
6363 """
6364 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6365
6366 Constructor
6367 """
54f9ee45 6368 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
d14a1e28
RD
6369 self.this = newobj.this
6370 self.thisown = 1
6371 del newobj.thisown
e811c8ce 6372 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6373 """
6374 GetCapturedWindow(self) -> Window
6375
6376 Returns the window that gained the capture, or ``None`` if it was a
6377 non-wxWidgets window.
6378 """
54f9ee45 6379 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 6380
d14a1e28
RD
6381
6382class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
6383 def __init__(self, this):
6384 self.this = this
6385 if not hasattr(self,"thisown"): self.thisown = 0
6386 self.__class__ = MouseCaptureChangedEvent
54f9ee45 6387_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
d14a1e28
RD
6388
6389#---------------------------------------------------------------------------
6390
6391class DisplayChangedEvent(Event):
5ba5649b
RD
6392 """
6393 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6394 resolution has changed.
6395
6396 This event is implemented under Windows only.
6397 """
e811c8ce
RD
6398 def __repr__(self):
6399 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6400 def __init__(self, *args, **kwargs):
a95a7133 6401 """__init__(self) -> DisplayChangedEvent"""
54f9ee45 6402 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
d14a1e28
RD
6403 self.this = newobj.this
6404 self.thisown = 1
6405 del newobj.thisown
d14a1e28
RD
6406
6407class DisplayChangedEventPtr(DisplayChangedEvent):
6408 def __init__(self, this):
6409 self.this = this
6410 if not hasattr(self,"thisown"): self.thisown = 0
6411 self.__class__ = DisplayChangedEvent
54f9ee45 6412_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
d14a1e28
RD
6413
6414#---------------------------------------------------------------------------
6415
6416class PaletteChangedEvent(Event):
5ba5649b
RD
6417 """
6418 An EVT_PALETTE_CHANGED event is sent when the system palette has
6419 changed, thereby giving each window a chance to redo their own to
6420 match.
6421
6422 This event is implemented under Windows only.
6423 """
e811c8ce
RD
6424 def __repr__(self):
6425 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6426 def __init__(self, *args, **kwargs):
5ba5649b
RD
6427 """
6428 __init__(self, int id=0) -> PaletteChangedEvent
6429
6430 An EVT_PALETTE_CHANGED event is sent when the system palette has
6431 changed, thereby giving each window a chance to redo their own to
6432 match.
6433
6434 This event is implemented under Windows only.
6435 """
54f9ee45 6436 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
d14a1e28
RD
6437 self.this = newobj.this
6438 self.thisown = 1
6439 del newobj.thisown
e811c8ce 6440 def SetChangedWindow(*args, **kwargs):
a95a7133 6441 """SetChangedWindow(self, Window win)"""
54f9ee45 6442 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
6443
6444 def GetChangedWindow(*args, **kwargs):
a95a7133 6445 """GetChangedWindow(self) -> Window"""
54f9ee45 6446 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 6447
d14a1e28
RD
6448
6449class PaletteChangedEventPtr(PaletteChangedEvent):
6450 def __init__(self, this):
6451 self.this = this
6452 if not hasattr(self,"thisown"): self.thisown = 0
6453 self.__class__ = PaletteChangedEvent
54f9ee45 6454_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
d14a1e28
RD
6455
6456#---------------------------------------------------------------------------
6457
6458class QueryNewPaletteEvent(Event):
5ba5649b
RD
6459 """
6460 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6461 focus and should re-do its palette.
6462
6463 This event is implemented under Windows only.
6464 """
e811c8ce
RD
6465 def __repr__(self):
6466 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6467 def __init__(self, *args, **kwargs):
5ba5649b
RD
6468 """
6469 __init__(self, int winid=0) -> QueryNewPaletteEvent
6470
6471 Constructor.
6472 """
54f9ee45 6473 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
d14a1e28
RD
6474 self.this = newobj.this
6475 self.thisown = 1
6476 del newobj.thisown
e811c8ce 6477 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6478 """
6479 SetPaletteRealized(self, bool realized)
6480
6481 App should set this if it changes the palette.
6482 """
54f9ee45 6483 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
6484
6485 def GetPaletteRealized(*args, **kwargs):
a95a7133 6486 """GetPaletteRealized(self) -> bool"""
54f9ee45 6487 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 6488
d14a1e28
RD
6489
6490class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
6491 def __init__(self, this):
6492 self.this = this
6493 if not hasattr(self,"thisown"): self.thisown = 0
6494 self.__class__ = QueryNewPaletteEvent
54f9ee45 6495_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
d14a1e28
RD
6496
6497#---------------------------------------------------------------------------
6498
6499class NavigationKeyEvent(Event):
5ba5649b
RD
6500 """
6501 EVT_NAVIGATION_KEY events are used to control moving the focus between
6502 widgets, otherwise known as tab-traversal. You woudl normally not
6503 catch navigation events in applications as there are already
6504 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6505 it useful to send navigation events in certain situations to change
6506 the focus in certain ways, although it's probably easier to just call
6507 `wx.Window.Navigate`.
6508 """
e811c8ce
RD
6509 def __repr__(self):
6510 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6511 def __init__(self, *args, **kwargs):
a95a7133 6512 """__init__(self) -> NavigationKeyEvent"""
54f9ee45 6513 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
d14a1e28
RD
6514 self.this = newobj.this
6515 self.thisown = 1
6516 del newobj.thisown
e811c8ce 6517 def GetDirection(*args, **kwargs):
5ba5649b
RD
6518 """
6519 GetDirection(self) -> bool
6520
6521 Returns ``True`` if the direction is forward, ``False`` otherwise.
6522 """
54f9ee45 6523 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
6524
6525 def SetDirection(*args, **kwargs):
5ba5649b
RD
6526 """
6527 SetDirection(self, bool forward)
6528
6529 Specify the direction that the navigation should take. Usually the
6530 difference between using Tab and Shift-Tab.
6531 """
54f9ee45 6532 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
6533
6534 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6535 """
6536 IsWindowChange(self) -> bool
6537
6538 Returns ``True`` if window change is allowed.
6539 """
54f9ee45 6540 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
6541
6542 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6543 """
6544 SetWindowChange(self, bool ischange)
6545
6546 Specify if the navigation should be able to change parent windows.
6547 For example, changing notebook pages, etc. This is usually implemented
6548 by using Control-Tab.
6549 """
54f9ee45 6550 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 6551
68350608 6552 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6553 """
6554 IsFromTab(self) -> bool
6555
6556 Returns ``True`` if the navigation event is originated from the Tab
6557 key.
6558 """
68350608
RD
6559 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6560
6561 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6562 """
6563 SetFromTab(self, bool bIs)
6564
6565 Set to true under MSW if the event was generated using the tab key.
6566 This is required for proper navogation over radio buttons.
6567 """
68350608
RD
6568 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6569
908b74cd 6570 def SetFlags(*args, **kwargs):
5ba5649b
RD
6571 """
6572 SetFlags(self, long flags)
6573
6574 Set the navigation flags to a combination of the following:
6575
6576 * wx.NavigationKeyEvent.IsBackward
6577 * wx.NavigationKeyEvent.IsForward
6578 * wx.NavigationKeyEvent.WinChange
6579 * wx.NavigationKeyEvent.FromTab
6580
6581 """
908b74cd
RD
6582 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6583
e811c8ce 6584 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6585 """
6586 GetCurrentFocus(self) -> Window
6587
6588 Returns the child window which currenty has the focus. May be
6589 ``None``.
6590 """
54f9ee45 6591 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
6592
6593 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6594 """
6595 SetCurrentFocus(self, Window win)
6596
6597 Set the window that has the focus.
6598 """
54f9ee45 6599 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 6600
b0f7404b 6601 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6602 IsForward = _core_.NavigationKeyEvent_IsForward
6603 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6604 FromTab = _core_.NavigationKeyEvent_FromTab
d14a1e28
RD
6605
6606class NavigationKeyEventPtr(NavigationKeyEvent):
6607 def __init__(self, this):
6608 self.this = this
6609 if not hasattr(self,"thisown"): self.thisown = 0
6610 self.__class__ = NavigationKeyEvent
54f9ee45 6611_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
d14a1e28
RD
6612
6613#---------------------------------------------------------------------------
6614
6615class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6616 """
6617 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6618 underlying GUI object) exists.
6619 """
e811c8ce
RD
6620 def __repr__(self):
6621 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6622 def __init__(self, *args, **kwargs):
5ba5649b
RD
6623 """
6624 __init__(self, Window win=None) -> WindowCreateEvent
6625
6626 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6627 underlying GUI object) exists.
6628 """
54f9ee45 6629 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
d14a1e28
RD
6630 self.this = newobj.this
6631 self.thisown = 1
6632 del newobj.thisown
e811c8ce 6633 def GetWindow(*args, **kwargs):
5ba5649b
RD
6634 """
6635 GetWindow(self) -> Window
6636
6637 Returns the window that this event refers to.
6638 """
54f9ee45 6639 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 6640
d14a1e28
RD
6641
6642class WindowCreateEventPtr(WindowCreateEvent):
6643 def __init__(self, this):
6644 self.this = this
6645 if not hasattr(self,"thisown"): self.thisown = 0
6646 self.__class__ = WindowCreateEvent
54f9ee45 6647_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
d14a1e28
RD
6648
6649class WindowDestroyEvent(CommandEvent):
5ba5649b 6650 """
943e8dfd
RD
6651 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6652 when the GUI window is destroyed.
6653
6654 When a class derived from `wx.Window` is destroyed its destructor will
6655 have already run by the time this event is sent. Therefore this event
6656 will not usually be received at all by the window itself. Since it is
6657 received after the destructor has run, an object should not try to
6658 handle its own wx.WindowDestroyEvent, but it can be used to get
6659 notification of the destruction of another window.
5ba5649b 6660 """
e811c8ce
RD
6661 def __repr__(self):
6662 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6663 def __init__(self, *args, **kwargs):
5ba5649b
RD
6664 """
6665 __init__(self, Window win=None) -> WindowDestroyEvent
6666
943e8dfd
RD
6667 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6668 when the GUI window is destroyed.
6669
6670 When a class derived from `wx.Window` is destroyed its destructor will
6671 have already run by the time this event is sent. Therefore this event
6672 will not usually be received at all by the window itself. Since it is
6673 received after the destructor has run, an object should not try to
6674 handle its own wx.WindowDestroyEvent, but it can be used to get
6675 notification of the destruction of another window.
5ba5649b 6676 """
54f9ee45 6677 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
d14a1e28
RD
6678 self.this = newobj.this
6679 self.thisown = 1
6680 del newobj.thisown
e811c8ce 6681 def GetWindow(*args, **kwargs):
5ba5649b
RD
6682 """
6683 GetWindow(self) -> Window
6684
6685 Returns the window that this event refers to.
6686 """
54f9ee45 6687 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 6688
d14a1e28
RD
6689
6690class WindowDestroyEventPtr(WindowDestroyEvent):
6691 def __init__(self, this):
6692 self.this = this
6693 if not hasattr(self,"thisown"): self.thisown = 0
6694 self.__class__ = WindowDestroyEvent
54f9ee45 6695_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
d14a1e28
RD
6696
6697#---------------------------------------------------------------------------
6698
6699class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6700 """
6701 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6702 give the application a chance to show a context (popup) menu.
6703 """
e811c8ce
RD
6704 def __repr__(self):
6705 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6706 def __init__(self, *args, **kwargs):
5ba5649b
RD
6707 """
6708 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6709
6710 Constructor.
6711 """
54f9ee45 6712 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
d14a1e28
RD
6713 self.this = newobj.this
6714 self.thisown = 1
6715 del newobj.thisown
e811c8ce 6716 def GetPosition(*args, **kwargs):
5ba5649b
RD
6717 """
6718 GetPosition(self) -> Point
6719
6720 Returns the position (in screen coordinants) at which the menu should
6721 be shown.
6722 """
54f9ee45 6723 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
6724
6725 def SetPosition(*args, **kwargs):
5ba5649b
RD
6726 """
6727 SetPosition(self, Point pos)
6728
6729 Sets the position at which the menu should be shown.
6730 """
54f9ee45 6731 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 6732
d14a1e28
RD
6733
6734class ContextMenuEventPtr(ContextMenuEvent):
6735 def __init__(self, this):
6736 self.this = this
6737 if not hasattr(self,"thisown"): self.thisown = 0
6738 self.__class__ = ContextMenuEvent
54f9ee45 6739_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
d14a1e28
RD
6740
6741#---------------------------------------------------------------------------
6742
54f9ee45
RD
6743IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6744IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 6745class IdleEvent(Event):
5ba5649b
RD
6746 """
6747 This class is used for EVT_IDLE events, which are generated and sent
6748 when the application *becomes* idle. In other words, the when the
6749 event queue becomes empty then idle events are sent to all windows (by
6750 default) and as long as none of them call `RequestMore` then there are
6751 no more idle events until after the system event queue has some normal
6752 events and then becomes empty again.
6753
6754 By default, idle events are sent to all windows. If this is causing a
6755 significant overhead in your application, you can call
6756 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6757 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6758 which should receive idle events. Then idle events will only be sent
6759 to those windows and not to any others.
6760 """
e811c8ce
RD
6761 def __repr__(self):
6762 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6763 def __init__(self, *args, **kwargs):
5ba5649b
RD
6764 """
6765 __init__(self) -> IdleEvent
6766
6767 Constructor
6768 """
54f9ee45 6769 newobj = _core_.new_IdleEvent(*args, **kwargs)
d14a1e28
RD
6770 self.this = newobj.this
6771 self.thisown = 1
6772 del newobj.thisown
e811c8ce 6773 def RequestMore(*args, **kwargs):
5ba5649b
RD
6774 """
6775 RequestMore(self, bool needMore=True)
6776
6777 Tells wxWidgets that more processing is required. This function can be
6778 called by an EVT_IDLE handler for a window to indicate that the
6779 application should forward the EVT_IDLE event once more to the
6780 application windows. If no window calls this function during its
6781 EVT_IDLE handler, then the application will remain in a passive event
6782 loop until a new event is posted to the application by the windowing
6783 system.
6784 """
54f9ee45 6785 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
6786
6787 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6788 """
6789 MoreRequested(self) -> bool
6790
6791 Returns ``True`` if the OnIdle function processing this event
6792 requested more processing time.
6793 """
54f9ee45 6794 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
6795
6796 def SetMode(*args, **kwargs):
5ba5649b
RD
6797 """
6798 SetMode(int mode)
6799
6800 Static method for specifying how wxWidgets will send idle events: to
6801 all windows, or only to those which specify that they will process the
6802 events.
6803
6804 The mode can be one of the following values:
6805
6806 ========================= ========================================
6807 wx.IDLE_PROCESS_ALL Send idle events to all windows
6808 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6809 the wx.WS_EX_PROCESS_IDLE extra style
6810 flag set.
6811 ========================= ========================================
6812
6813 """
54f9ee45 6814 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6815
6816 SetMode = staticmethod(SetMode)
6817 def GetMode(*args, **kwargs):
5ba5649b
RD
6818 """
6819 GetMode() -> int
6820
6821 Static method returning a value specifying how wxWidgets will send
6822 idle events: to all windows, or only to those which specify that they
6823 will process the events.
6824 """
54f9ee45 6825 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6826
6827 GetMode = staticmethod(GetMode)
6828 def CanSend(*args, **kwargs):
5ba5649b
RD
6829 """
6830 CanSend(Window win) -> bool
6831
6832 Returns ``True`` if it is appropriate to send idle events to this
6833 window.
6834
6835 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6836 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6837 events should be sent to this window now. By default this will always
6838 return ``True`` because the update mode is initially
6839 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6840 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6841 """
54f9ee45 6842 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
6843
6844 CanSend = staticmethod(CanSend)
d14a1e28
RD
6845
6846class IdleEventPtr(IdleEvent):
6847 def __init__(self, this):
6848 self.this = this
6849 if not hasattr(self,"thisown"): self.thisown = 0
6850 self.__class__ = IdleEvent
54f9ee45 6851_core_.IdleEvent_swigregister(IdleEventPtr)
d14a1e28 6852
e811c8ce 6853def IdleEvent_SetMode(*args, **kwargs):
5ba5649b
RD
6854 """
6855 IdleEvent_SetMode(int mode)
6856
6857 Static method for specifying how wxWidgets will send idle events: to
6858 all windows, or only to those which specify that they will process the
6859 events.
6860
6861 The mode can be one of the following values:
6862
6863 ========================= ========================================
6864 wx.IDLE_PROCESS_ALL Send idle events to all windows
6865 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6866 the wx.WS_EX_PROCESS_IDLE extra style
6867 flag set.
6868 ========================= ========================================
6869
6870 """
54f9ee45 6871 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 6872
e811c8ce 6873def IdleEvent_GetMode(*args, **kwargs):
5ba5649b
RD
6874 """
6875 IdleEvent_GetMode() -> int
6876
6877 Static method returning a value specifying how wxWidgets will send
6878 idle events: to all windows, or only to those which specify that they
6879 will process the events.
6880 """
54f9ee45 6881 return _core_.IdleEvent_GetMode(*args, **kwargs)
d14a1e28 6882
e811c8ce 6883def IdleEvent_CanSend(*args, **kwargs):
5ba5649b
RD
6884 """
6885 IdleEvent_CanSend(Window win) -> bool
6886
6887 Returns ``True`` if it is appropriate to send idle events to this
6888 window.
6889
6890 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6891 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6892 events should be sent to this window now. By default this will always
6893 return ``True`` because the update mode is initially
6894 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6895 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6896 """
54f9ee45 6897 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
6898
6899#---------------------------------------------------------------------------
6900
6901class PyEvent(Event):
5ba5649b
RD
6902 """
6903 wx.PyEvent can be used as a base class for implementing custom event
6904 types in Python. You should derived from this class instead of
6905 `wx.Event` because this class is Python-aware and is able to transport
6906 its Python bits safely through the wxWidgets event system and have
6907 them still be there when the event handler is invoked.
6908
6909 :see: `wx.PyCommandEvent`
6910
6911 """
e811c8ce
RD
6912 def __repr__(self):
6913 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6914 def __init__(self, *args, **kwargs):
5ba5649b 6915 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
54f9ee45 6916 newobj = _core_.new_PyEvent(*args, **kwargs)
d14a1e28
RD
6917 self.this = newobj.this
6918 self.thisown = 1
6919 del newobj.thisown
5ba5649b 6920 self._SetSelf(self)
e811c8ce 6921
54f9ee45 6922 def __del__(self, destroy=_core_.delete_PyEvent):
a95a7133 6923 """__del__(self)"""
d14a1e28
RD
6924 try:
6925 if self.thisown: destroy(self)
6926 except: pass
e811c8ce 6927
5ba5649b
RD
6928 def _SetSelf(*args, **kwargs):
6929 """_SetSelf(self, PyObject self)"""
6930 return _core_.PyEvent__SetSelf(*args, **kwargs)
e811c8ce 6931
5ba5649b
RD
6932 def _GetSelf(*args, **kwargs):
6933 """_GetSelf(self) -> PyObject"""
6934 return _core_.PyEvent__GetSelf(*args, **kwargs)
e811c8ce 6935
d14a1e28
RD
6936
6937class PyEventPtr(PyEvent):
6938 def __init__(self, this):
6939 self.this = this
6940 if not hasattr(self,"thisown"): self.thisown = 0
6941 self.__class__ = PyEvent
54f9ee45 6942_core_.PyEvent_swigregister(PyEventPtr)
d14a1e28
RD
6943
6944class PyCommandEvent(CommandEvent):
5ba5649b
RD
6945 """
6946 wx.PyCommandEvent can be used as a base class for implementing custom
6947 event types in Python, where the event shoudl travel up to parent
6948 windows looking for a handler. You should derived from this class
6949 instead of `wx.CommandEvent` because this class is Python-aware and is
6950 able to transport its Python bits safely through the wxWidgets event
6951 system and have them still be there when the event handler is invoked.
6952
6953 :see: `wx.PyEvent`
6954
6955 """
e811c8ce
RD
6956 def __repr__(self):
6957 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 6958 def __init__(self, *args, **kwargs):
5ba5649b 6959 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
54f9ee45 6960 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
d14a1e28
RD
6961 self.this = newobj.this
6962 self.thisown = 1
6963 del newobj.thisown
5ba5649b 6964 self._SetSelf(self)
e811c8ce 6965
54f9ee45 6966 def __del__(self, destroy=_core_.delete_PyCommandEvent):
a95a7133 6967 """__del__(self)"""
d14a1e28
RD
6968 try:
6969 if self.thisown: destroy(self)
6970 except: pass
e811c8ce 6971
5ba5649b
RD
6972 def _SetSelf(*args, **kwargs):
6973 """_SetSelf(self, PyObject self)"""
6974 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
e811c8ce 6975
5ba5649b
RD
6976 def _GetSelf(*args, **kwargs):
6977 """_GetSelf(self) -> PyObject"""
6978 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
e811c8ce 6979
d14a1e28
RD
6980
6981class PyCommandEventPtr(PyCommandEvent):
6982 def __init__(self, this):
6983 self.this = this
6984 if not hasattr(self,"thisown"): self.thisown = 0
6985 self.__class__ = PyCommandEvent
54f9ee45 6986_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
d14a1e28 6987
53aa7709 6988class DateEvent(CommandEvent):
5ba5649b
RD
6989 """
6990 This event class holds information about a date change event and is
6991 used together with `wx.DatePickerCtrl`. It also serves as a base class
6992 for `wx.calendar.CalendarEvent`. Bind these event types with
6993 EVT_DATE_CHANGED.
6994 """
53aa7709
RD
6995 def __repr__(self):
6996 return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
6997 def __init__(self, *args, **kwargs):
6998 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
6999 newobj = _core_.new_DateEvent(*args, **kwargs)
7000 self.this = newobj.this
7001 self.thisown = 1
7002 del newobj.thisown
7003 def GetDate(*args, **kwargs):
5ba5649b
RD
7004 """
7005 GetDate(self) -> DateTime
7006
7007 Returns the date.
7008 """
53aa7709
RD
7009 return _core_.DateEvent_GetDate(*args, **kwargs)
7010
7011 def SetDate(*args, **kwargs):
5ba5649b
RD
7012 """
7013 SetDate(self, DateTime date)
7014
7015 Sets the date carried by the event, normally only used by the library
7016 internally.
7017 """
53aa7709
RD
7018 return _core_.DateEvent_SetDate(*args, **kwargs)
7019
7020
7021class DateEventPtr(DateEvent):
7022 def __init__(self, this):
7023 self.this = this
7024 if not hasattr(self,"thisown"): self.thisown = 0
7025 self.__class__ = DateEvent
7026_core_.DateEvent_swigregister(DateEventPtr)
7027
7028wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
7029EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
7030
d14a1e28
RD
7031#---------------------------------------------------------------------------
7032
54f9ee45
RD
7033PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
7034PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
7035PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
7036PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
7037PRINT_WINDOWS = _core_.PRINT_WINDOWS
7038PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 7039class PyApp(EvtHandler):
66c033b4
RD
7040 """
7041 The ``wx.PyApp`` class is an *implementation detail*, please use the
7042 `wx.App` class (or some other derived class) instead.
7043 """
e811c8ce
RD
7044 def __repr__(self):
7045 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 7046 def __init__(self, *args, **kwargs):
98e665d3 7047 """
a95a7133 7048 __init__(self) -> PyApp
98e665d3
RD
7049
7050 Create a new application object, starting the bootstrap process.
7051 """
54f9ee45 7052 newobj = _core_.new_PyApp(*args, **kwargs)
d14a1e28
RD
7053 self.this = newobj.this
7054 self.thisown = 1
7055 del newobj.thisown
70b7a5fe
RD
7056 self._setCallbackInfo(self, PyApp, False)
7057 self._setOORInfo(self, False)
e811c8ce 7058
54f9ee45 7059 def __del__(self, destroy=_core_.delete_PyApp):
a95a7133 7060 """__del__(self)"""
d14a1e28
RD
7061 try:
7062 if self.thisown: destroy(self)
7063 except: pass
e811c8ce
RD
7064
7065 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 7066 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
54f9ee45 7067 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
7068
7069 def GetAppName(*args, **kwargs):
0df68c9f 7070 """
a95a7133 7071 GetAppName(self) -> String
6c3b4aae 7072
0df68c9f
RD
7073 Get the application name.
7074 """
54f9ee45 7075 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
7076
7077 def SetAppName(*args, **kwargs):
0df68c9f 7078 """
a95a7133 7079 SetAppName(self, String name)
6c3b4aae 7080
66c033b4
RD
7081 Set the application name. This value may be used automatically by
7082 `wx.Config` and such.
0df68c9f 7083 """
54f9ee45 7084 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
7085
7086 def GetClassName(*args, **kwargs):
0df68c9f 7087 """
a95a7133 7088 GetClassName(self) -> String
e811c8ce 7089
0df68c9f
RD
7090 Get the application's class name.
7091 """
54f9ee45 7092 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
7093
7094 def SetClassName(*args, **kwargs):
0df68c9f 7095 """
a95a7133 7096 SetClassName(self, String name)
6c3b4aae 7097
66c033b4
RD
7098 Set the application's class name. This value may be used for
7099 X-resources if applicable for the platform
0df68c9f 7100 """
54f9ee45 7101 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
7102
7103 def GetVendorName(*args, **kwargs):
0df68c9f 7104 """
a95a7133 7105 GetVendorName(self) -> String
6c3b4aae 7106
0df68c9f
RD
7107 Get the application's vendor name.
7108 """
54f9ee45 7109 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
7110
7111 def SetVendorName(*args, **kwargs):
0df68c9f 7112 """
a95a7133 7113 SetVendorName(self, String name)
6c3b4aae 7114
66c033b4
RD
7115 Set the application's vendor name. This value may be used
7116 automatically by `wx.Config` and such.
0df68c9f 7117 """
54f9ee45 7118 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
7119
7120 def GetTraits(*args, **kwargs):
0df68c9f 7121 """
a95a7133 7122 GetTraits(self) -> wxAppTraits
6c3b4aae 7123
66c033b4
RD
7124 Return (and create if necessary) the app traits object to which we
7125 delegate for everything which either should be configurable by the
7126 user (then he can change the default behaviour simply by overriding
7127 CreateTraits() and returning his own traits object) or which is
7128 GUI/console dependent as then wx.AppTraits allows us to abstract the
7129 differences behind the common facade.
7130
7131 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 7132 """
54f9ee45 7133 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
7134
7135 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 7136 """
a95a7133 7137 ProcessPendingEvents(self)
6c3b4aae 7138
66c033b4
RD
7139 Process all events in the Pending Events list -- it is necessary to
7140 call this function to process posted events. This normally happens
7141 during each event loop iteration.
0df68c9f 7142 """
54f9ee45 7143 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
7144
7145 def Yield(*args, **kwargs):
0df68c9f 7146 """
a95a7133 7147 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 7148
66c033b4
RD
7149 Process all currently pending events right now, instead of waiting
7150 until return to the event loop. It is an error to call ``Yield``
7151 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 7152
66c033b4 7153 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
7154 reentrancies (i.e. when called from an event handler it may
7155 result in calling the same event handler again), use with
7156 extreme care or, better, don't use at all!
0df68c9f 7157
66c033b4 7158 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 7159
0df68c9f 7160 """
54f9ee45 7161 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
7162
7163 def WakeUpIdle(*args, **kwargs):
0df68c9f 7164 """
a95a7133 7165 WakeUpIdle(self)
6c3b4aae 7166
66c033b4
RD
7167 Make sure that idle events are sent again.
7168 :see: `wx.WakeUpIdle`
0df68c9f 7169 """
54f9ee45 7170 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 7171
1fc3b23a
RD
7172 def IsMainLoopRunning(*args, **kwargs):
7173 """
7174 IsMainLoopRunning() -> bool
7175
7176 Returns True if we're running the main loop, i.e. if the events can
7177 currently be dispatched.
7178 """
7179 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7180
7181 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 7182 def MainLoop(*args, **kwargs):
0df68c9f 7183 """
a95a7133 7184 MainLoop(self) -> int
6c3b4aae 7185
66c033b4
RD
7186 Execute the main GUI loop, the function doesn't normally return until
7187 all top level windows have been closed and destroyed.
0df68c9f 7188 """
54f9ee45 7189 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
7190
7191 def Exit(*args, **kwargs):
0df68c9f 7192 """
a95a7133 7193 Exit(self)
6c3b4aae 7194
0df68c9f 7195 Exit the main loop thus terminating the application.
66c033b4 7196 :see: `wx.Exit`
0df68c9f 7197 """
54f9ee45 7198 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce
RD
7199
7200 def ExitMainLoop(*args, **kwargs):
0df68c9f 7201 """
a95a7133 7202 ExitMainLoop(self)
6c3b4aae 7203
66c033b4
RD
7204 Exit the main GUI loop during the next iteration of the main
7205 loop, (i.e. it does not stop the program immediately!)
0df68c9f 7206 """
54f9ee45 7207 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
7208
7209 def Pending(*args, **kwargs):
0df68c9f 7210 """
a95a7133 7211 Pending(self) -> bool
6c3b4aae 7212
0df68c9f
RD
7213 Returns True if there are unprocessed events in the event queue.
7214 """
54f9ee45 7215 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
7216
7217 def Dispatch(*args, **kwargs):
0df68c9f 7218 """
a95a7133 7219 Dispatch(self) -> bool
6c3b4aae 7220
0df68c9f
RD
7221 Process the first event in the event queue (blocks until an event
7222 appears if there are none currently)
7223 """
54f9ee45 7224 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
7225
7226 def ProcessIdle(*args, **kwargs):
0df68c9f 7227 """
a95a7133 7228 ProcessIdle(self) -> bool
6c3b4aae 7229
66c033b4
RD
7230 Called from the MainLoop when the application becomes idle (there are
7231 no pending events) and sends a `wx.IdleEvent` to all interested
7232 parties. Returns True if more idle events are needed, False if not.
0df68c9f 7233 """
54f9ee45 7234 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
7235
7236 def SendIdleEvents(*args, **kwargs):
0df68c9f 7237 """
a95a7133 7238 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 7239
66c033b4
RD
7240 Send idle event to window and all subwindows. Returns True if more
7241 idle time is requested.
0df68c9f 7242 """
54f9ee45 7243 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
7244
7245 def IsActive(*args, **kwargs):
0df68c9f 7246 """
a95a7133 7247 IsActive(self) -> bool
6c3b4aae 7248
0df68c9f
RD
7249 Return True if our app has focus.
7250 """
54f9ee45 7251 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
7252
7253 def SetTopWindow(*args, **kwargs):
0df68c9f 7254 """
a95a7133 7255 SetTopWindow(self, Window win)
6c3b4aae 7256
66c033b4 7257 Set the *main* top level window
0df68c9f 7258 """
54f9ee45 7259 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
7260
7261 def GetTopWindow(*args, **kwargs):
0df68c9f 7262 """
a95a7133 7263 GetTopWindow(self) -> Window
6c3b4aae 7264
66c033b4
RD
7265 Return the *main* top level window (if it hadn't been set previously
7266 with SetTopWindow(), will return just some top level window and, if
7267 there not any, will return None)
0df68c9f 7268 """
54f9ee45 7269 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
7270
7271 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 7272 """
a95a7133 7273 SetExitOnFrameDelete(self, bool flag)
0df68c9f 7274
66c033b4
RD
7275 Control the exit behaviour: by default, the program will exit the main
7276 loop (and so, usually, terminate) when the last top-level program
7277 window is deleted. Beware that if you disable this behaviour (with
7278 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7279 explicitly from somewhere.
0df68c9f 7280 """
54f9ee45 7281 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
7282
7283 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 7284 """
a95a7133 7285 GetExitOnFrameDelete(self) -> bool
6c3b4aae 7286
0df68c9f
RD
7287 Get the current exit behaviour setting.
7288 """
54f9ee45 7289 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
7290
7291 def SetUseBestVisual(*args, **kwargs):
0df68c9f 7292 """
a95a7133 7293 SetUseBestVisual(self, bool flag)
6c3b4aae 7294
66c033b4
RD
7295 Set whether the app should try to use the best available visual on
7296 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 7297 """
54f9ee45 7298 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
7299
7300 def GetUseBestVisual(*args, **kwargs):
0df68c9f 7301 """
a95a7133 7302 GetUseBestVisual(self) -> bool
6c3b4aae 7303
0df68c9f
RD
7304 Get current UseBestVisual setting.
7305 """
54f9ee45 7306 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
7307
7308 def SetPrintMode(*args, **kwargs):
a95a7133 7309 """SetPrintMode(self, int mode)"""
54f9ee45 7310 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
7311
7312 def GetPrintMode(*args, **kwargs):
a95a7133 7313 """GetPrintMode(self) -> int"""
54f9ee45 7314 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 7315
e811c8ce 7316 def SetAssertMode(*args, **kwargs):
0df68c9f 7317 """
a95a7133 7318 SetAssertMode(self, int mode)
6c3b4aae 7319
41e2b43e 7320 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 7321 """
54f9ee45 7322 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 7323
6c3b4aae 7324 def GetAssertMode(*args, **kwargs):
0df68c9f 7325 """
a95a7133 7326 GetAssertMode(self) -> int
6c3b4aae 7327
0df68c9f
RD
7328 Get the current OnAssert behaviour setting.
7329 """
54f9ee45 7330 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 7331
e811c8ce 7332 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 7333 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 7334 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
7335
7336 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7337 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 7338 """GetMacAboutMenuItemId() -> long"""
54f9ee45 7339 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
7340
7341 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7342 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 7343 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 7344 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
7345
7346 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7347 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 7348 """GetMacExitMenuItemId() -> long"""
54f9ee45 7349 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
7350
7351 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7352 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 7353 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 7354 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
7355
7356 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7357 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 7358 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 7359 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
7360
7361 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7362 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 7363 """SetMacAboutMenuItemId(long val)"""
54f9ee45 7364 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
7365
7366 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7367 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 7368 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 7369 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
7370
7371 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7372 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 7373 """SetMacExitMenuItemId(long val)"""
54f9ee45 7374 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
7375
7376 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7377 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 7378 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 7379 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
7380
7381 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7382 def _BootstrapApp(*args, **kwargs):
0df68c9f 7383 """
a95a7133 7384 _BootstrapApp(self)
6c3b4aae 7385
0df68c9f
RD
7386 For internal use only
7387 """
54f9ee45 7388 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
7389
7390 def GetComCtl32Version(*args, **kwargs):
0df68c9f 7391 """
66c033b4 7392 GetComCtl32Version() -> int
6c3b4aae 7393
66c033b4
RD
7394 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7395 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7396 """
54f9ee45 7397 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
7398
7399 GetComCtl32Version = staticmethod(GetComCtl32Version)
d14a1e28
RD
7400
7401class PyAppPtr(PyApp):
7402 def __init__(self, this):
7403 self.this = this
7404 if not hasattr(self,"thisown"): self.thisown = 0
7405 self.__class__ = PyApp
54f9ee45 7406_core_.PyApp_swigregister(PyAppPtr)
d14a1e28 7407
1fc3b23a
RD
7408def PyApp_IsMainLoopRunning(*args, **kwargs):
7409 """
7410 PyApp_IsMainLoopRunning() -> bool
7411
7412 Returns True if we're running the main loop, i.e. if the events can
7413 currently be dispatched.
7414 """
7415 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
7416
e811c8ce
RD
7417def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
7418 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 7419 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 7420
e811c8ce
RD
7421def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
7422 """PyApp_GetMacAboutMenuItemId() -> long"""
54f9ee45 7423 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 7424
e811c8ce
RD
7425def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
7426 """PyApp_GetMacPreferencesMenuItemId() -> long"""
54f9ee45 7427 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 7428
e811c8ce
RD
7429def PyApp_GetMacExitMenuItemId(*args, **kwargs):
7430 """PyApp_GetMacExitMenuItemId() -> long"""
54f9ee45 7431 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d14a1e28 7432
e811c8ce 7433def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
196addbf 7434 """PyApp_GetMacHelpMenuTitleName() -> String"""
54f9ee45 7435 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 7436
e811c8ce
RD
7437def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
7438 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 7439 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 7440
e811c8ce
RD
7441def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
7442 """PyApp_SetMacAboutMenuItemId(long val)"""
54f9ee45 7443 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 7444
e811c8ce
RD
7445def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
7446 """PyApp_SetMacPreferencesMenuItemId(long val)"""
54f9ee45 7447 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 7448
e811c8ce
RD
7449def PyApp_SetMacExitMenuItemId(*args, **kwargs):
7450 """PyApp_SetMacExitMenuItemId(long val)"""
54f9ee45 7451 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 7452
e811c8ce 7453def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
196addbf 7454 """PyApp_SetMacHelpMenuTitleName(String val)"""
54f9ee45 7455 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 7456
e811c8ce 7457def PyApp_GetComCtl32Version(*args, **kwargs):
0df68c9f
RD
7458 """
7459 PyApp_GetComCtl32Version() -> int
6c3b4aae 7460
66c033b4
RD
7461 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7462 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7463 """
54f9ee45 7464 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d14a1e28
RD
7465
7466#---------------------------------------------------------------------------
7467
7468
e811c8ce 7469def Exit(*args, **kwargs):
0df68c9f
RD
7470 """
7471 Exit()
6c3b4aae 7472
0df68c9f
RD
7473 Force an exit of the application. Convenience for wx.GetApp().Exit()
7474 """
54f9ee45 7475 return _core_.Exit(*args, **kwargs)
d14a1e28 7476
e811c8ce 7477def Yield(*args, **kwargs):
0df68c9f
RD
7478 """
7479 Yield() -> bool
6c3b4aae 7480
0df68c9f
RD
7481 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7482 """
54f9ee45 7483 return _core_.Yield(*args, **kwargs)
d14a1e28 7484
e811c8ce 7485def YieldIfNeeded(*args, **kwargs):
0df68c9f
RD
7486 """
7487 YieldIfNeeded() -> bool
6c3b4aae 7488
0df68c9f
RD
7489 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7490 """
54f9ee45 7491 return _core_.YieldIfNeeded(*args, **kwargs)
d14a1e28 7492
e811c8ce 7493def SafeYield(*args, **kwargs):
0df68c9f
RD
7494 """
7495 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 7496
66c033b4
RD
7497 This function is similar to `wx.Yield`, except that it disables the
7498 user input to all program windows before calling `wx.Yield` and
7499 re-enables it again afterwards. If ``win`` is not None, this window
7500 will remain enabled, allowing the implementation of some limited user
7501 interaction.
6c3b4aae 7502
66c033b4 7503 :Returns: the result of the call to `wx.Yield`.
0df68c9f 7504 """
54f9ee45 7505 return _core_.SafeYield(*args, **kwargs)
d14a1e28 7506
e811c8ce 7507def WakeUpIdle(*args, **kwargs):
0df68c9f
RD
7508 """
7509 WakeUpIdle()
6c3b4aae 7510
66c033b4
RD
7511 Cause the message queue to become empty again, so idle events will be
7512 sent.
0df68c9f 7513 """
54f9ee45 7514 return _core_.WakeUpIdle(*args, **kwargs)
d14a1e28 7515
e811c8ce 7516def PostEvent(*args, **kwargs):
0df68c9f
RD
7517 """
7518 PostEvent(EvtHandler dest, Event event)
6c3b4aae 7519
66c033b4
RD
7520 Send an event to a window or other wx.EvtHandler to be processed
7521 later.
0df68c9f 7522 """
54f9ee45 7523 return _core_.PostEvent(*args, **kwargs)
d14a1e28 7524
e811c8ce 7525def App_CleanUp(*args, **kwargs):
0df68c9f
RD
7526 """
7527 App_CleanUp()
6c3b4aae 7528
41e2b43e 7529 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 7530 Python shuts down.
0df68c9f 7531 """
54f9ee45 7532 return _core_.App_CleanUp(*args, **kwargs)
d14a1e28 7533
e811c8ce 7534def GetApp(*args, **kwargs):
0df68c9f
RD
7535 """
7536 GetApp() -> PyApp
6c3b4aae 7537
196addbf 7538 Return a reference to the current wx.App object.
0df68c9f 7539 """
54f9ee45 7540 return _core_.GetApp(*args, **kwargs)
5cbf236d
RD
7541
7542def SetDefaultPyEncoding(*args, **kwargs):
7543 """
7544 SetDefaultPyEncoding(string encoding)
7545
7546 Sets the encoding that wxPython will use when it needs to convert a
7547 Python string or unicode object to or from a wxString.
e505d15e
RD
7548
7549 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7550 but please be aware that the default encoding within the same locale
7551 may be slightly different on different platforms. For example, please
7552 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7553 between the common latin/roman encodings.
5cbf236d
RD
7554 """
7555 return _core_.SetDefaultPyEncoding(*args, **kwargs)
7556
7557def GetDefaultPyEncoding(*args, **kwargs):
7558 """
7559 GetDefaultPyEncoding() -> string
7560
7561 Gets the current encoding that wxPython will use when it needs to
7562 convert a Python string or unicode object to or from a wxString.
7563 """
7564 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d14a1e28
RD
7565#----------------------------------------------------------------------
7566
7567class PyOnDemandOutputWindow:
6c3b4aae
RD
7568 """
7569 A class that can be used for redirecting Python's stdout and
7570 stderr streams. It will do nothing until something is wrriten to
7571 the stream at which point it will create a Frame with a text area
7572 and write the text there.
7573 """
d14a1e28
RD
7574 def __init__(self, title = "wxPython: stdout/stderr"):
7575 self.frame = None
7576 self.title = title
412d302d
RD
7577 self.pos = wx.DefaultPosition
7578 self.size = (450, 300)
d14a1e28
RD
7579 self.parent = None
7580
7581 def SetParent(self, parent):
6c3b4aae 7582 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
7583 self.parent = parent
7584
6c3b4aae
RD
7585
7586 def CreateOutputWindow(self, st):
412d302d
RD
7587 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7588 style=wx.DEFAULT_FRAME_STYLE)
196addbf 7589 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7590 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 7591 self.text.AppendText(st)
6c3b4aae
RD
7592 self.frame.Show(True)
7593 EVT_CLOSE(self.frame, self.OnCloseWindow)
7594
d14a1e28 7595
7409c0c6
RD
7596 def OnCloseWindow(self, event):
7597 if self.frame is not None:
7598 self.frame.Destroy()
7599 self.frame = None
7600 self.text = None
7601
7602
d14a1e28 7603 # These methods provide the file-like output behaviour.
6c3b4aae
RD
7604 def write(self, text):
7605 """
7606 Create the output window if needed and write the string to it.
7607 If not called in the context of the gui thread then uses
7608 CallAfter to do the work there.
7609 """
7610 if self.frame is None:
7611 if not wx.Thread_IsMain():
7612 wx.CallAfter(self.CreateOutputWindow, text)
7613 else:
7614 self.CreateOutputWindow(text)
7615 else:
7616 if not wx.Thread_IsMain():
7617 wx.CallAfter(self.text.AppendText, text)
7618 else:
7619 self.text.AppendText(text)
7620
d14a1e28
RD
7621
7622 def close(self):
6c3b4aae
RD
7623 if self.frame is not None:
7624 wx.CallAfter(self.frame.Close)
7625
d14a1e28 7626
19272049
RD
7627 def flush(self):
7628 pass
7629
7630
d14a1e28
RD
7631
7632#----------------------------------------------------------------------
d14a1e28
RD
7633
7634_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7635
7636class App(wx.PyApp):
6c3b4aae 7637 """
66c033b4
RD
7638 The ``wx.App`` class represents the application and is used to:
7639
7640 * bootstrap the wxPython system and initialize the underlying
7641 gui toolkit
7642 * set and get application-wide properties
7643 * implement the windowing system main message or event loop,
7644 and to dispatch events to window instances
7645 * etc.
7646
7647 Every application must have a ``wx.App`` instance, and all
7648 creation of UI objects should be delayed until after the
03e37cd5
RD
7649 ``wx.App`` object has been created in order to ensure that the gui
7650 platform and wxWidgets have been fully initialized.
66c033b4
RD
7651
7652 Normally you would derive from this class and implement an
7653 ``OnInit`` method that creates a frame and then calls
7654 ``self.SetTopWindow(frame)``.
7655
03e37cd5 7656 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 7657 directly.
6c3b4aae 7658 """
66c033b4 7659
d14a1e28
RD
7660 outputWindowClass = PyOnDemandOutputWindow
7661
03e37cd5
RD
7662 def __init__(self, redirect=_defRedirect, filename=None,
7663 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7664 """
7665 Construct a ``wx.App`` object.
7666
03e37cd5
RD
7667 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7668 redirected? Defaults to True on Windows and Mac, False
7669 otherwise. If `filename` is None then output will be
7670 redirected to a window that pops up as needed. (You can
7671 control what kind of window is created for the output by
7672 resetting the class variable ``outputWindowClass`` to a
7673 class of your choosing.)
66c033b4 7674
03e37cd5
RD
7675 :param filename: The name of a file to redirect output to, if
7676 redirect is True.
66c033b4
RD
7677
7678 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
7679 available visual provided by the system (only relevant on
7680 systems that have more than one visual.) This parameter
7681 must be used instead of calling `SetUseBestVisual` later
7682 on because it must be set before the underlying GUI
7683 toolkit is initialized.
7684
7685 :param clearSigInt: Should SIGINT be cleared? This allows the
7686 app to terminate upon a Ctrl-C in the console like other
7687 GUI apps will.
66c033b4
RD
7688
7689 :note: You should override OnInit to do applicaition
7690 initialization to ensure that the system, toolkit and
7691 wxWidgets are fully initialized.
7692 """
d14a1e28
RD
7693 wx.PyApp.__init__(self)
7694
7695 if wx.Platform == "__WXMAC__":
7696 try:
7697 import MacOS
7698 if not MacOS.WMAvailable():
7699 print """\
7700This program needs access to the screen. Please run with 'pythonw',
7701not 'python', and only when you are logged in on the main display of
7702your Mac."""
7703 _sys.exit(1)
36cadbf7
RD
7704 except SystemExit:
7705 raise
d14a1e28
RD
7706 except:
7707 pass
7708
7709 # This has to be done before OnInit
7710 self.SetUseBestVisual(useBestVisual)
7711
7712 # Set the default handler for SIGINT. This fixes a problem
7713 # where if Ctrl-C is pressed in the console that started this
7714 # app then it will not appear to do anything, (not even send
7715 # KeyboardInterrupt???) but will later segfault on exit. By
7716 # setting the default handler then the app will exit, as
7717 # expected (depending on platform.)
03e37cd5
RD
7718 if clearSigInt:
7719 try:
7720 import signal
7721 signal.signal(signal.SIGINT, signal.SIG_DFL)
7722 except:
7723 pass
d14a1e28
RD
7724
7725 # Save and redirect the stdio to a window?
7726 self.stdioWin = None
7727 self.saveStdio = (_sys.stdout, _sys.stderr)
7728 if redirect:
7729 self.RedirectStdio(filename)
7730
8fb0e70a
RD
7731 # Use Python's install prefix as the default
7732 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7733
d14a1e28
RD
7734 # This finishes the initialization of wxWindows and then calls
7735 # the OnInit that should be present in the derived class
7736 self._BootstrapApp()
7737
7738
02b455f2
RD
7739 def __del__(self, destroy=wx.PyApp.__del__):
7740 self.RestoreStdio() # Just in case the MainLoop was overridden
7741 destroy(self)
d14a1e28 7742
70b7a5fe
RD
7743 def Destroy(self):
7744 wx.PyApp.Destroy(self)
7745 self.thisown = 0
d14a1e28
RD
7746
7747 def SetTopWindow(self, frame):
1e0c8722 7748 """Set the \"main\" top level window"""
d14a1e28
RD
7749 if self.stdioWin:
7750 self.stdioWin.SetParent(frame)
7751 wx.PyApp.SetTopWindow(self, frame)
7752
7753
7754 def MainLoop(self):
1e0c8722 7755 """Execute the main GUI event loop"""
d14a1e28
RD
7756 wx.PyApp.MainLoop(self)
7757 self.RestoreStdio()
7758
7759
7409c0c6 7760 def RedirectStdio(self, filename=None):
1e0c8722 7761 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
7762 if filename:
7763 _sys.stdout = _sys.stderr = open(filename, 'a')
7764 else:
7765 self.stdioWin = self.outputWindowClass()
7766 _sys.stdout = _sys.stderr = self.stdioWin
7767
7768
7769 def RestoreStdio(self):
02b455f2
RD
7770 try:
7771 _sys.stdout, _sys.stderr = self.saveStdio
7772 except:
7773 pass
d14a1e28
RD
7774
7775
412d302d
RD
7776 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7777 """
7778 Set the title, position and/or size of the output window if
f5b96ee1
RD
7779 the stdio has been redirected. This should be called before
7780 any output would cause the output window to be created.
412d302d
RD
7781 """
7782 if self.stdioWin:
7783 if title is not None:
7784 self.stdioWin.title = title
7785 if pos is not None:
7786 self.stdioWin.pos = pos
7787 if size is not None:
7788 self.stdioWin.size = size
7789
7790
7791
d14a1e28 7792
66c033b4 7793# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
7794App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7795App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7796App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7797App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7798App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7799App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7800App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7801App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7802App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7803App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7804App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
7805
7806#----------------------------------------------------------------------------
7807
7808class PySimpleApp(wx.App):
6c3b4aae
RD
7809 """
7810 A simple application class. You can just create one of these and
7811 then then make your top level windows later, and not have to worry
66c033b4
RD
7812 about OnInit. For example::
7813
7814 app = wx.PySimpleApp()
7815 frame = wx.Frame(None, title='Hello World')
7816 frame.Show()
7817 app.MainLoop()
7818
7819 :see: `wx.App`
7820 """
6c3b4aae 7821
03e37cd5
RD
7822 def __init__(self, redirect=False, filename=None,
7823 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7824 """
7825 :see: `wx.App.__init__`
7826 """
03e37cd5 7827 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 7828
d14a1e28 7829 def OnInit(self):
d14a1e28
RD
7830 return True
7831
7832
66c033b4 7833
6c3b4aae 7834# Is anybody using this one?
d14a1e28
RD
7835class PyWidgetTester(wx.App):
7836 def __init__(self, size = (250, 100)):
7837 self.size = size
7838 wx.App.__init__(self, 0)
7839
7840 def OnInit(self):
196addbf 7841 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
7842 self.SetTopWindow(self.frame)
7843 return True
7844
66c033b4
RD
7845 def SetWidget(self, widgetClass, *args, **kwargs):
7846 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
7847 self.frame.Show(True)
7848
7849#----------------------------------------------------------------------------
7850# DO NOT hold any other references to this object. This is how we
66c033b4 7851# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 7852# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 7853# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
7854
7855class __wxPyCleanup:
7856 def __init__(self):
54f9ee45 7857 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
7858 def __del__(self):
7859 self.cleanup()
7860
7861_sys.__wxPythonCleanup = __wxPyCleanup()
7862
7863## # another possible solution, but it gets called too early...
66c033b4
RD
7864## import atexit
7865## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
7866
7867
7868#----------------------------------------------------------------------------
7869
7870#---------------------------------------------------------------------------
2ef75293
RD
7871
7872class EventLoop(object):
093d3ff1 7873 """Proxy of C++ EventLoop class"""
2ef75293
RD
7874 def __repr__(self):
7875 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7876 def __init__(self, *args, **kwargs):
7877 """__init__(self) -> EventLoop"""
7878 newobj = _core_.new_EventLoop(*args, **kwargs)
7879 self.this = newobj.this
7880 self.thisown = 1
7881 del newobj.thisown
7882 def __del__(self, destroy=_core_.delete_EventLoop):
7883 """__del__(self)"""
7884 try:
7885 if self.thisown: destroy(self)
7886 except: pass
7887
7888 def Run(*args, **kwargs):
7889 """Run(self) -> int"""
7890 return _core_.EventLoop_Run(*args, **kwargs)
7891
7892 def Exit(*args, **kwargs):
7893 """Exit(self, int rc=0)"""
7894 return _core_.EventLoop_Exit(*args, **kwargs)
7895
7896 def Pending(*args, **kwargs):
7897 """Pending(self) -> bool"""
7898 return _core_.EventLoop_Pending(*args, **kwargs)
7899
7900 def Dispatch(*args, **kwargs):
7901 """Dispatch(self) -> bool"""
7902 return _core_.EventLoop_Dispatch(*args, **kwargs)
7903
7904 def IsRunning(*args, **kwargs):
7905 """IsRunning(self) -> bool"""
7906 return _core_.EventLoop_IsRunning(*args, **kwargs)
7907
7908 def GetActive(*args, **kwargs):
7909 """GetActive() -> EventLoop"""
7910 return _core_.EventLoop_GetActive(*args, **kwargs)
7911
7912 GetActive = staticmethod(GetActive)
7913 def SetActive(*args, **kwargs):
7914 """SetActive(EventLoop loop)"""
7915 return _core_.EventLoop_SetActive(*args, **kwargs)
7916
7917 SetActive = staticmethod(SetActive)
7918
7919class EventLoopPtr(EventLoop):
7920 def __init__(self, this):
7921 self.this = this
7922 if not hasattr(self,"thisown"): self.thisown = 0
7923 self.__class__ = EventLoop
7924_core_.EventLoop_swigregister(EventLoopPtr)
7925
7926def EventLoop_GetActive(*args, **kwargs):
7927 """EventLoop_GetActive() -> EventLoop"""
7928 return _core_.EventLoop_GetActive(*args, **kwargs)
7929
7930def EventLoop_SetActive(*args, **kwargs):
7931 """EventLoop_SetActive(EventLoop loop)"""
7932 return _core_.EventLoop_SetActive(*args, **kwargs)
7933
091f5bed
RD
7934class EventLoopActivator(object):
7935 """Proxy of C++ EventLoopActivator class"""
7936 def __repr__(self):
7937 return "<%s.%s; proxy of C++ wxEventLoopActivator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7938 def __init__(self, *args, **kwargs):
7939 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
7940 newobj = _core_.new_EventLoopActivator(*args, **kwargs)
7941 self.this = newobj.this
7942 self.thisown = 1
7943 del newobj.thisown
7944 def __del__(self, destroy=_core_.delete_EventLoopActivator):
7945 """__del__(self)"""
7946 try:
7947 if self.thisown: destroy(self)
7948 except: pass
7949
7950
7951class EventLoopActivatorPtr(EventLoopActivator):
7952 def __init__(self, this):
7953 self.this = this
7954 if not hasattr(self,"thisown"): self.thisown = 0
7955 self.__class__ = EventLoopActivator
7956_core_.EventLoopActivator_swigregister(EventLoopActivatorPtr)
7957
2ef75293 7958#---------------------------------------------------------------------------
d14a1e28 7959
1e0c8722 7960class AcceleratorEntry(object):
66c033b4
RD
7961 """
7962 A class used to define items in an `wx.AcceleratorTable`. wxPython
7963 programs can choose to use wx.AcceleratorEntry objects, but using a
7964 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 7965 as well. See `__init__` for of the tuple values.
66c033b4
RD
7966
7967 :see: `wx.AcceleratorTable`
7968 """
1e0c8722
RD
7969 def __repr__(self):
7970 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7971 def __init__(self, *args, **kwargs):
66c033b4
RD
7972 """
7973 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7974
7975 Construct a wx.AcceleratorEntry.
66c033b4 7976 """
54f9ee45 7977 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
1e0c8722
RD
7978 self.this = newobj.this
7979 self.thisown = 1
7980 del newobj.thisown
54f9ee45 7981 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
a95a7133 7982 """__del__(self)"""
1e0c8722
RD
7983 try:
7984 if self.thisown: destroy(self)
7985 except: pass
7986
7987 def Set(*args, **kwargs):
66c033b4
RD
7988 """
7989 Set(self, int flags, int keyCode, int cmd)
1e0c8722 7990
66c033b4
RD
7991 (Re)set the attributes of a wx.AcceleratorEntry.
7992 :see `__init__`
7993 """
7994 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722
RD
7995
7996 def GetFlags(*args, **kwargs):
66c033b4
RD
7997 """
7998 GetFlags(self) -> int
7999
8000 Get the AcceleratorEntry's flags.
8001 """
54f9ee45 8002 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
8003
8004 def GetKeyCode(*args, **kwargs):
66c033b4
RD
8005 """
8006 GetKeyCode(self) -> int
8007
8008 Get the AcceleratorEntry's keycode.
8009 """
54f9ee45 8010 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
8011
8012 def GetCommand(*args, **kwargs):
66c033b4
RD
8013 """
8014 GetCommand(self) -> int
8015
8016 Get the AcceleratorEntry's command ID.
8017 """
54f9ee45 8018 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722
RD
8019
8020
8021class AcceleratorEntryPtr(AcceleratorEntry):
8022 def __init__(self, this):
8023 self.this = this
8024 if not hasattr(self,"thisown"): self.thisown = 0
8025 self.__class__ = AcceleratorEntry
54f9ee45 8026_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
1e0c8722
RD
8027
8028class AcceleratorTable(Object):
66c033b4
RD
8029 """
8030 An accelerator table allows the application to specify a table of
8031 keyboard shortcuts for menus or other commands. On Windows, menu or
8032 button commands are supported; on GTK, only menu commands are
8033 supported.
66c033b4 8034 """
1e0c8722
RD
8035 def __repr__(self):
8036 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8037 def __init__(self, *args, **kwargs):
0df68c9f
RD
8038 """
8039 __init__(entries) -> AcceleratorTable
1e0c8722 8040
66c033b4
RD
8041 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8042 items or or of 3-tuples (flags, keyCode, cmdID)
8043
8044 :see: `wx.AcceleratorEntry`
0df68c9f 8045 """
54f9ee45 8046 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
1e0c8722
RD
8047 self.this = newobj.this
8048 self.thisown = 1
8049 del newobj.thisown
54f9ee45 8050 def __del__(self, destroy=_core_.delete_AcceleratorTable):
a95a7133 8051 """__del__(self)"""
1e0c8722
RD
8052 try:
8053 if self.thisown: destroy(self)
8054 except: pass
8055
8056 def Ok(*args, **kwargs):
a95a7133 8057 """Ok(self) -> bool"""
54f9ee45 8058 return _core_.AcceleratorTable_Ok(*args, **kwargs)
1e0c8722
RD
8059
8060
8061class AcceleratorTablePtr(AcceleratorTable):
8062 def __init__(self, this):
8063 self.this = this
8064 if not hasattr(self,"thisown"): self.thisown = 0
8065 self.__class__ = AcceleratorTable
54f9ee45 8066_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
1e0c8722
RD
8067
8068
8069def GetAccelFromString(*args, **kwargs):
196addbf 8070 """GetAccelFromString(String label) -> AcceleratorEntry"""
54f9ee45 8071 return _core_.GetAccelFromString(*args, **kwargs)
1e0c8722
RD
8072#---------------------------------------------------------------------------
8073
74a57fcd
RD
8074class VisualAttributes(object):
8075 """struct containing all the visual attributes of a control"""
8076 def __repr__(self):
8077 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8078 def __init__(self, *args, **kwargs):
8079 """
a95a7133 8080 __init__(self) -> VisualAttributes
74a57fcd
RD
8081
8082 struct containing all the visual attributes of a control
8083 """
54f9ee45 8084 newobj = _core_.new_VisualAttributes(*args, **kwargs)
74a57fcd
RD
8085 self.this = newobj.this
8086 self.thisown = 1
8087 del newobj.thisown
54f9ee45 8088 def __del__(self, destroy=_core_.delete_VisualAttributes):
a95a7133 8089 """__del__(self)"""
74a57fcd
RD
8090 try:
8091 if self.thisown: destroy(self)
8092 except: pass
8093
54f9ee45
RD
8094 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
8095 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
8096 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
74a57fcd
RD
8097
8098class VisualAttributesPtr(VisualAttributes):
8099 def __init__(self, this):
8100 self.this = this
8101 if not hasattr(self,"thisown"): self.thisown = 0
8102 self.__class__ = VisualAttributes
54f9ee45 8103_core_.VisualAttributes_swigregister(VisualAttributesPtr)
74a57fcd
RD
8104NullAcceleratorTable = cvar.NullAcceleratorTable
8105PanelNameStr = cvar.PanelNameStr
8106
54f9ee45
RD
8107WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8108WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8109WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8110WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8111WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 8112class Window(EvtHandler):
15afbcd0
RD
8113 """
8114 wx.Window is the base class for all windows and represents any visible
8115 object on the screen. All controls, top level windows and so on are
8116 wx.Windows. Sizers and device contexts are not however, as they don't
8117 appear on screen themselves.
8118
8119 """
e811c8ce
RD
8120 def __repr__(self):
8121 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8122 def __init__(self, *args, **kwargs):
0df68c9f 8123 """
a95a7133 8124 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 8125 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
8126
8127 Construct and show a generic Window.
0df68c9f 8128 """
54f9ee45 8129 newobj = _core_.new_Window(*args, **kwargs)
d14a1e28
RD
8130 self.this = newobj.this
8131 self.thisown = 1
8132 del newobj.thisown
8133 self._setOORInfo(self)
d14a1e28 8134
e811c8ce 8135 def Create(*args, **kwargs):
0df68c9f 8136 """
a95a7133 8137 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 8138 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
8139
8140 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 8141 """
54f9ee45 8142 return _core_.Window_Create(*args, **kwargs)
d14a1e28 8143
e811c8ce 8144 def Close(*args, **kwargs):
15afbcd0 8145 """
a95a7133 8146 Close(self, bool force=False) -> bool
15afbcd0
RD
8147
8148 This function simply generates a EVT_CLOSE event whose handler usually
8149 tries to close the window. It doesn't close the window itself,
8150 however. If force is False (the default) then the window's close
8151 handler will be allowed to veto the destruction of the window.
15afbcd0 8152 """
54f9ee45 8153 return _core_.Window_Close(*args, **kwargs)
d14a1e28 8154
e811c8ce 8155 def Destroy(*args, **kwargs):
0df68c9f 8156 """
a95a7133 8157 Destroy(self) -> bool
d14a1e28 8158
15afbcd0
RD
8159 Destroys the window safely. Frames and dialogs are not destroyed
8160 immediately when this function is called -- they are added to a list
8161 of windows to be deleted on idle time, when all the window's events
8162 have been processed. This prevents problems with events being sent to
8163 non-existent windows.
8164
8165 Returns True if the window has either been successfully deleted, or it
8166 has been added to the list of windows pending real deletion.
0df68c9f 8167 """
7e08d4ef
RD
8168 val = _core_.Window_Destroy(*args, **kwargs)
8169 args[0].thisown = 0
8170 return val
d14a1e28 8171
e811c8ce 8172 def DestroyChildren(*args, **kwargs):
15afbcd0 8173 """
a95a7133 8174 DestroyChildren(self) -> bool
15afbcd0 8175
41e2b43e
RD
8176 Destroys all children of a window. Called automatically by the
8177 destructor.
15afbcd0 8178 """
54f9ee45 8179 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 8180
e811c8ce 8181 def IsBeingDeleted(*args, **kwargs):
15afbcd0 8182 """
a95a7133 8183 IsBeingDeleted(self) -> bool
15afbcd0
RD
8184
8185 Is the window in the process of being deleted?
8186 """
54f9ee45 8187 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 8188
e811c8ce 8189 def SetLabel(*args, **kwargs):
15afbcd0 8190 """
a95a7133 8191 SetLabel(self, String label)
15afbcd0
RD
8192
8193 Set the text which the window shows in its label if applicable.
8194 """
54f9ee45 8195 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 8196
e811c8ce 8197 def GetLabel(*args, **kwargs):
15afbcd0 8198 """
a95a7133 8199 GetLabel(self) -> String
15afbcd0 8200
41e2b43e
RD
8201 Generic way of getting a label from any window, for identification
8202 purposes. The interpretation of this function differs from class to
8203 class. For frames and dialogs, the value returned is the title. For
8204 buttons or static text controls, it is the button text. This function
8205 can be useful for meta-programs such as testing tools or special-needs
8206 access programs)which need to identify windows by name.
15afbcd0 8207 """
54f9ee45 8208 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 8209
e811c8ce 8210 def SetName(*args, **kwargs):
15afbcd0 8211 """
a95a7133 8212 SetName(self, String name)
15afbcd0 8213
41e2b43e
RD
8214 Sets the window's name. The window name is used for ressource setting
8215 in X, it is not the same as the window title/label
15afbcd0 8216 """
54f9ee45 8217 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 8218
e811c8ce 8219 def GetName(*args, **kwargs):
15afbcd0 8220 """
a95a7133 8221 GetName(self) -> String
15afbcd0 8222
41e2b43e
RD
8223 Returns the windows name. This name is not guaranteed to be unique;
8224 it is up to the programmer to supply an appropriate name in the window
8225 constructor or via wx.Window.SetName.
15afbcd0 8226 """
54f9ee45 8227 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 8228
4276dc52
RD
8229 def SetWindowVariant(*args, **kwargs):
8230 """
a95a7133 8231 SetWindowVariant(self, int variant)
4276dc52 8232
41e2b43e
RD
8233 Sets the variant of the window/font size to use for this window, if
8234 the platform supports variants, for example, wxMac.
4276dc52 8235 """
54f9ee45 8236 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
8237
8238 def GetWindowVariant(*args, **kwargs):
a95a7133 8239 """GetWindowVariant(self) -> int"""
54f9ee45 8240 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 8241
e811c8ce 8242 def SetId(*args, **kwargs):
15afbcd0 8243 """
a95a7133 8244 SetId(self, int winid)
15afbcd0
RD
8245
8246 Sets the identifier of the window. Each window has an integer
8247 identifier. If the application has not provided one, an identifier
8248 will be generated. Normally, the identifier should be provided on
8249 creation and should not be modified subsequently.
8250 """
54f9ee45 8251 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 8252
e811c8ce 8253 def GetId(*args, **kwargs):
15afbcd0 8254 """
a95a7133 8255 GetId(self) -> int
15afbcd0
RD
8256
8257 Returns the identifier of the window. Each window has an integer
8258 identifier. If the application has not provided one (or the default Id
8259 -1 is used) then an unique identifier with a negative value will be
8260 generated.
8261 """
54f9ee45 8262 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 8263
e811c8ce 8264 def NewControlId(*args, **kwargs):
15afbcd0 8265 """
66c033b4 8266 NewControlId() -> int
15afbcd0
RD
8267
8268 Generate a control id for the controls which were not given one.
8269 """
54f9ee45 8270 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 8271
e811c8ce
RD
8272 NewControlId = staticmethod(NewControlId)
8273 def NextControlId(*args, **kwargs):
15afbcd0 8274 """
66c033b4 8275 NextControlId(int winid) -> int
15afbcd0
RD
8276
8277 Get the id of the control following the one with the given
41e2b43e 8278 autogenerated) id
15afbcd0 8279 """
54f9ee45 8280 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 8281
e811c8ce
RD
8282 NextControlId = staticmethod(NextControlId)
8283 def PrevControlId(*args, **kwargs):
15afbcd0 8284 """
66c033b4 8285 PrevControlId(int winid) -> int
15afbcd0
RD
8286
8287 Get the id of the control preceding the one with the given
41e2b43e 8288 autogenerated) id
15afbcd0 8289 """
54f9ee45 8290 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 8291
e811c8ce
RD
8292 PrevControlId = staticmethod(PrevControlId)
8293 def SetSize(*args, **kwargs):
15afbcd0 8294 """
a95a7133 8295 SetSize(self, Size size)
15afbcd0
RD
8296
8297 Sets the size of the window in pixels.
8298 """
54f9ee45 8299 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 8300
e811c8ce 8301 def SetDimensions(*args, **kwargs):
15afbcd0 8302 """
a95a7133 8303 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
8304
8305 Sets the position and size of the window in pixels. The sizeFlags
8306 parameter indicates the interpretation of the other params if they are
e505d15e
RD
8307 equal to -1.
8308
8309 ======================== ======================================
8310 wx.SIZE_AUTO A -1 indicates that a class-specific
8311 default should be used.
8312 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8313 -1 values are supplied.
8314 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8315 interpreted as real dimensions, not
8316 default values.
8317 ======================== ======================================
8318
15afbcd0 8319 """
54f9ee45 8320 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 8321
e811c8ce 8322 def SetRect(*args, **kwargs):
15afbcd0 8323 """
a95a7133 8324 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
8325
8326 Sets the position and size of the window in pixels using a wx.Rect.
8327 """
54f9ee45 8328 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 8329
e811c8ce 8330 def SetSizeWH(*args, **kwargs):
15afbcd0 8331 """
a95a7133 8332 SetSizeWH(self, int width, int height)
15afbcd0
RD
8333
8334 Sets the size of the window in pixels.
8335 """
54f9ee45 8336 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 8337
e811c8ce 8338 def Move(*args, **kwargs):
15afbcd0 8339 """
a95a7133 8340 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
8341
8342 Moves the window to the given position.
8343 """
54f9ee45 8344 return _core_.Window_Move(*args, **kwargs)
d14a1e28 8345
e811c8ce
RD
8346 SetPosition = Move
8347 def MoveXY(*args, **kwargs):
15afbcd0 8348 """
a95a7133 8349 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
8350
8351 Moves the window to the given position.
8352 """
54f9ee45 8353 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 8354
f8167d6e
RD
8355 def SetBestFittingSize(*args, **kwargs):
8356 """
8357 SetBestFittingSize(self, Size size=DefaultSize)
8358
8359 A 'Smart' SetSize that will fill in default size components with the
8360 window's *best size* values. Also set's the minsize for use with sizers.
8361 """
8362 return _core_.Window_SetBestFittingSize(*args, **kwargs)
8363
e811c8ce 8364 def Raise(*args, **kwargs):
15afbcd0 8365 """
a95a7133 8366 Raise(self)
15afbcd0 8367
943e8dfd
RD
8368 Raises the window to the top of the window hierarchy. In current
8369 version of wxWidgets this works both for manage and child windows.
15afbcd0 8370 """
54f9ee45 8371 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
8372
8373 def Lower(*args, **kwargs):
15afbcd0 8374 """
a95a7133 8375 Lower(self)
15afbcd0 8376
943e8dfd
RD
8377 Lowers the window to the bottom of the window hierarchy. In current
8378 version of wxWidgets this works both for manage and child windows.
15afbcd0 8379 """
54f9ee45 8380 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
8381
8382 def SetClientSize(*args, **kwargs):
15afbcd0 8383 """
a95a7133 8384 SetClientSize(self, Size size)
15afbcd0
RD
8385
8386 This sets the size of the window client area in pixels. Using this
8387 function to size a window tends to be more device-independent than
8388 wx.Window.SetSize, since the application need not worry about what
8389 dimensions the border or title bar have when trying to fit the window
8390 around panel items, for example.
8391 """
54f9ee45 8392 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
8393
8394 def SetClientSizeWH(*args, **kwargs):
15afbcd0 8395 """
a95a7133 8396 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
8397
8398 This sets the size of the window client area in pixels. Using this
8399 function to size a window tends to be more device-independent than
8400 wx.Window.SetSize, since the application need not worry about what
8401 dimensions the border or title bar have when trying to fit the window
8402 around panel items, for example.
8403 """
54f9ee45 8404 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
8405
8406 def SetClientRect(*args, **kwargs):
15afbcd0 8407 """
a95a7133 8408 SetClientRect(self, Rect rect)
15afbcd0
RD
8409
8410 This sets the size of the window client area in pixels. Using this
8411 function to size a window tends to be more device-independent than
8412 wx.Window.SetSize, since the application need not worry about what
8413 dimensions the border or title bar have when trying to fit the window
8414 around panel items, for example.
8415 """
54f9ee45 8416 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
8417
8418 def GetPosition(*args, **kwargs):
0df68c9f 8419 """
a95a7133 8420 GetPosition(self) -> Point
e811c8ce 8421
0df68c9f
RD
8422 Get the window's position.
8423 """
54f9ee45 8424 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
8425
8426 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
8427 """
8428 GetPositionTuple() -> (x,y)
e811c8ce 8429
0df68c9f
RD
8430 Get the window's position.
8431 """
54f9ee45 8432 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
8433
8434 def GetSize(*args, **kwargs):
0df68c9f 8435 """
a95a7133 8436 GetSize(self) -> Size
e811c8ce 8437
0df68c9f
RD
8438 Get the window size.
8439 """
54f9ee45 8440 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
8441
8442 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
8443 """
8444 GetSizeTuple() -> (width, height)
e811c8ce 8445
0df68c9f
RD
8446 Get the window size.
8447 """
54f9ee45 8448 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
8449
8450 def GetRect(*args, **kwargs):
15afbcd0 8451 """
a95a7133 8452 GetRect(self) -> Rect
15afbcd0
RD
8453
8454 Returns the size and position of the window as a wx.Rect object.
8455 """
54f9ee45 8456 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
8457
8458 def GetClientSize(*args, **kwargs):
0df68c9f 8459 """
a95a7133 8460 GetClientSize(self) -> Size
e811c8ce 8461
15afbcd0
RD
8462 This gets the size of the window's 'client area' in pixels. The client
8463 area is the area which may be drawn on by the programmer, excluding
8464 title bar, border, scrollbars, etc.
0df68c9f 8465 """
54f9ee45 8466 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
8467
8468 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
8469 """
8470 GetClientSizeTuple() -> (width, height)
e811c8ce 8471
15afbcd0
RD
8472 This gets the size of the window's 'client area' in pixels. The client
8473 area is the area which may be drawn on by the programmer, excluding
8474 title bar, border, scrollbars, etc.
0df68c9f 8475 """
54f9ee45 8476 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
8477
8478 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 8479 """
a95a7133 8480 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
8481
8482 Get the origin of the client area of the window relative to the
8483 window's top left corner (the client area may be shifted because of
8484 the borders, scrollbars, other decorations...)
8485 """
54f9ee45 8486 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
8487
8488 def GetClientRect(*args, **kwargs):
15afbcd0 8489 """
a95a7133 8490 GetClientRect(self) -> Rect
15afbcd0 8491
61863841 8492 Get the client area position and size as a `wx.Rect` object.
15afbcd0 8493 """
54f9ee45 8494 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
8495
8496 def GetBestSize(*args, **kwargs):
0df68c9f 8497 """
a95a7133 8498 GetBestSize(self) -> Size
e811c8ce 8499
248ed943 8500 This function returns the best acceptable minimal size for the
41e2b43e
RD
8501 window, if applicable. For example, for a static text control, it will
8502 be the minimal size such that the control label is not truncated. For
8503 windows containing subwindows (suzh aswx.Panel), the size returned by
8504 this function will be the same as the size the window would have had
8505 after calling Fit.
0df68c9f 8506 """
54f9ee45 8507 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
8508
8509 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
8510 """
8511 GetBestSizeTuple() -> (width, height)
e811c8ce 8512
248ed943 8513 This function returns the best acceptable minimal size for the
41e2b43e
RD
8514 window, if applicable. For example, for a static text control, it will
8515 be the minimal size such that the control label is not truncated. For
8516 windows containing subwindows (suzh aswx.Panel), the size returned by
8517 this function will be the same as the size the window would have had
8518 after calling Fit.
0df68c9f 8519 """
54f9ee45 8520 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 8521
dfbb5885
RD
8522 def InvalidateBestSize(*args, **kwargs):
8523 """
8524 InvalidateBestSize(self)
8525
8526 Reset the cached best size value so it will be recalculated the next
8527 time it is needed.
8528 """
8529 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8530
e2813725
RD
8531 def CacheBestSize(*args, **kwargs):
8532 """
8533 CacheBestSize(self, Size size)
8534
8535 Cache the best size so it doesn't need to be calculated again, (at least until
8536 some properties of the window change.)
8537 """
8538 return _core_.Window_CacheBestSize(*args, **kwargs)
8539
dfbb5885
RD
8540 def GetBestFittingSize(*args, **kwargs):
8541 """
8542 GetBestFittingSize(self) -> Size
8543
8544 This function will merge the window's best size into the window's
8545 minimum size, giving priority to the min size components, and returns
8546 the results.
8547
8548 """
8549 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8550
e811c8ce 8551 def GetAdjustedBestSize(*args, **kwargs):
15afbcd0 8552 """
a95a7133 8553 GetAdjustedBestSize(self) -> Size
15afbcd0
RD
8554
8555 This method is similar to GetBestSize, except in one
8556 thing. GetBestSize should return the minimum untruncated size of the
8557 window, while this method will return the largest of BestSize and any
8558 user specified minimum size. ie. it is the minimum size the window
8559 should currently be drawn at, not the minimal size it can possibly
8560 tolerate.
8561 """
54f9ee45 8562 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
e811c8ce
RD
8563
8564 def Center(*args, **kwargs):
15afbcd0 8565 """
a95a7133 8566 Center(self, int direction=BOTH)
15afbcd0
RD
8567
8568 Centers the window. The parameter specifies the direction for
8569 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8570 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8571 on the entire screen and not on its parent window. If it is a
8572 top-level window and has no parent then it will always be centered
8573 relative to the screen.
8574 """
54f9ee45 8575 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
8576
8577 Centre = Center
e811c8ce 8578 def CenterOnParent(*args, **kwargs):
15afbcd0 8579 """
a95a7133 8580 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
8581
8582 Center with respect to the the parent window
8583 """
54f9ee45 8584 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
8585
8586 CentreOnParent = CenterOnParent
8587 def Fit(*args, **kwargs):
15afbcd0 8588 """
a95a7133 8589 Fit(self)
15afbcd0
RD
8590
8591 Sizes the window so that it fits around its subwindows. This function
8592 won't do anything if there are no subwindows and will only really work
8593 correctly if sizers are used for the subwindows layout. Also, if the
8594 window has exactly one subwindow it is better (faster and the result
8595 is more precise as Fit adds some margin to account for fuzziness of
8596 its calculations) to call window.SetClientSize(child.GetSize())
8597 instead of calling Fit.
8598 """
54f9ee45 8599 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
8600
8601 def FitInside(*args, **kwargs):
15afbcd0 8602 """
a95a7133 8603 FitInside(self)
15afbcd0
RD
8604
8605 Similar to Fit, but sizes the interior (virtual) size of a
8606 window. Mainly useful with scrolled windows to reset scrollbars after
8607 sizing changes that do not trigger a size event, and/or scrolled
8608 windows without an interior sizer. This function similarly won't do
8609 anything if there are no subwindows.
8610 """
54f9ee45 8611 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 8612
f16ab95d 8613 def SetSizeHints(*args, **kwargs):
0df68c9f 8614 """
a95a7133 8615 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 8616 int incH=-1)
15afbcd0
RD
8617
8618 Allows specification of minimum and maximum window sizes, and window
8619 size increments. If a pair of values is not set (or set to -1), the
8620 default values will be used. If this function is called, the user
908b74cd
RD
8621 will not be able to size the window outside the given bounds (if it is
8622 a top-level window.) Sizers will also inspect the minimum window size
8623 and will use that value if set when calculating layout.
8624
8625 The resizing increments are only significant under Motif or Xt.
0df68c9f 8626 """
f16ab95d 8627 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 8628
f16ab95d
RD
8629 def SetSizeHintsSz(*args, **kwargs):
8630 """
8631 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8632
8633 Allows specification of minimum and maximum window sizes, and window
8634 size increments. If a pair of values is not set (or set to -1), the
8635 default values will be used. If this function is called, the user
8636 will not be able to size the window outside the given bounds (if it is
8637 a top-level window.) Sizers will also inspect the minimum window size
8638 and will use that value if set when calculating layout.
8639
8640 The resizing increments are only significant under Motif or Xt.
8641 """
8642 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8643
8644 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 8645 """
908b74cd 8646 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
8647
8648 Allows specification of minimum and maximum virtual window sizes. If a
8649 pair of values is not set (or set to -1), the default values will be
8650 used. If this function is called, the user will not be able to size
8651 the virtual area of the window outside the given bounds.
8652 """
f16ab95d
RD
8653 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8654
8655 def SetVirtualSizeHintsSz(*args, **kwargs):
8656 """
8657 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8658
8659 Allows specification of minimum and maximum virtual window sizes. If a
8660 pair of values is not set (or set to -1), the default values will be
8661 used. If this function is called, the user will not be able to size
8662 the virtual area of the window outside the given bounds.
8663 """
8664 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 8665
908b74cd
RD
8666 def GetMaxSize(*args, **kwargs):
8667 """GetMaxSize(self) -> Size"""
8668 return _core_.Window_GetMaxSize(*args, **kwargs)
8669
8670 def GetMinSize(*args, **kwargs):
8671 """GetMinSize(self) -> Size"""
8672 return _core_.Window_GetMinSize(*args, **kwargs)
8673
8674 def SetMinSize(*args, **kwargs):
8675 """
8676 SetMinSize(self, Size minSize)
8677
8678 A more convenient method than `SetSizeHints` for setting just the
8679 min size.
8680 """
8681 return _core_.Window_SetMinSize(*args, **kwargs)
8682
8683 def SetMaxSize(*args, **kwargs):
8684 """
8685 SetMaxSize(self, Size maxSize)
8686
8687 A more convenient method than `SetSizeHints` for setting just the
8688 max size.
8689 """
8690 return _core_.Window_SetMaxSize(*args, **kwargs)
8691
e811c8ce 8692 def GetMinWidth(*args, **kwargs):
a95a7133 8693 """GetMinWidth(self) -> int"""
54f9ee45 8694 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
8695
8696 def GetMinHeight(*args, **kwargs):
a95a7133 8697 """GetMinHeight(self) -> int"""
54f9ee45 8698 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
8699
8700 def GetMaxWidth(*args, **kwargs):
a95a7133 8701 """GetMaxWidth(self) -> int"""
54f9ee45 8702 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
8703
8704 def GetMaxHeight(*args, **kwargs):
a95a7133 8705 """GetMaxHeight(self) -> int"""
54f9ee45 8706 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 8707
e811c8ce 8708 def SetVirtualSize(*args, **kwargs):
0df68c9f 8709 """
a95a7133 8710 SetVirtualSize(self, Size size)
e811c8ce 8711
15afbcd0
RD
8712 Set the the virtual size of a window in pixels. For most windows this
8713 is just the client area of the window, but for some like scrolled
8714 windows it is more or less independent of the screen window size.
0df68c9f 8715 """
54f9ee45 8716 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
8717
8718 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 8719 """
a95a7133 8720 SetVirtualSizeWH(self, int w, int h)
e811c8ce 8721
15afbcd0
RD
8722 Set the the virtual size of a window in pixels. For most windows this
8723 is just the client area of the window, but for some like scrolled
8724 windows it is more or less independent of the screen window size.
0df68c9f 8725 """
54f9ee45 8726 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
8727
8728 def GetVirtualSize(*args, **kwargs):
0df68c9f 8729 """
a95a7133 8730 GetVirtualSize(self) -> Size
e811c8ce 8731
15afbcd0
RD
8732 Get the the virtual size of the window in pixels. For most windows
8733 this is just the client area of the window, but for some like scrolled
8734 windows it is more or less independent of the screen window size.
0df68c9f 8735 """
54f9ee45 8736 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
8737
8738 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
8739 """
8740 GetVirtualSizeTuple() -> (width, height)
e811c8ce 8741
15afbcd0
RD
8742 Get the the virtual size of the window in pixels. For most windows
8743 this is just the client area of the window, but for some like scrolled
8744 windows it is more or less independent of the screen window size.
0df68c9f 8745 """
54f9ee45 8746 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce
RD
8747
8748 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 8749 """
a95a7133 8750 GetBestVirtualSize(self) -> Size
15afbcd0
RD
8751
8752 Return the largest of ClientSize and BestSize (as determined by a
8753 sizer, interior children, or other means)
8754 """
54f9ee45 8755 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
8756
8757 def Show(*args, **kwargs):
15afbcd0 8758 """
a95a7133 8759 Show(self, bool show=True) -> bool
15afbcd0
RD
8760
8761 Shows or hides the window. You may need to call Raise for a top level
8762 window if you want to bring it to top, although this is not needed if
8763 Show is called immediately after the frame creation. Returns True if
8764 the window has been shown or hidden or False if nothing was done
8765 because it already was in the requested state.
8766 """
54f9ee45 8767 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
8768
8769 def Hide(*args, **kwargs):
15afbcd0 8770 """
a95a7133 8771 Hide(self) -> bool
15afbcd0
RD
8772
8773 Equivalent to calling Show(False).
8774 """
54f9ee45 8775 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
8776
8777 def Enable(*args, **kwargs):
15afbcd0 8778 """
a95a7133 8779 Enable(self, bool enable=True) -> bool
15afbcd0
RD
8780
8781 Enable or disable the window for user input. Note that when a parent
8782 window is disabled, all of its children are disabled as well and they
8783 are reenabled again when the parent is. Returns true if the window
8784 has been enabled or disabled, false if nothing was done, i.e. if the
8785 window had already been in the specified state.
8786 """
54f9ee45 8787 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
8788
8789 def Disable(*args, **kwargs):
15afbcd0 8790 """
a95a7133 8791 Disable(self) -> bool
15afbcd0
RD
8792
8793 Disables the window, same as Enable(false).
8794 """
54f9ee45 8795 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
8796
8797 def IsShown(*args, **kwargs):
15afbcd0 8798 """
a95a7133 8799 IsShown(self) -> bool
15afbcd0
RD
8800
8801 Returns true if the window is shown, false if it has been hidden.
8802 """
54f9ee45 8803 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
8804
8805 def IsEnabled(*args, **kwargs):
15afbcd0 8806 """
a95a7133 8807 IsEnabled(self) -> bool
15afbcd0
RD
8808
8809 Returns true if the window is enabled for input, false otherwise.
8810 """
54f9ee45 8811 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce
RD
8812
8813 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 8814 """
a95a7133 8815 SetWindowStyleFlag(self, long style)
15afbcd0 8816
41e2b43e
RD
8817 Sets the style of the window. Please note that some styles cannot be
8818 changed after the window creation and that Refresh() might need to be
8819 called after changing the others for the change to take place
8820 immediately.
15afbcd0 8821 """
54f9ee45 8822 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
8823
8824 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 8825 """
a95a7133 8826 GetWindowStyleFlag(self) -> long
e811c8ce 8827
15afbcd0
RD
8828 Gets the window style that was passed to the constructor or Create
8829 method.
8830 """
54f9ee45 8831 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 8832
15afbcd0 8833 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 8834 def HasFlag(*args, **kwargs):
15afbcd0 8835 """
a95a7133 8836 HasFlag(self, int flag) -> bool
15afbcd0
RD
8837
8838 Test if the given style is set for this window.
8839 """
54f9ee45 8840 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
8841
8842 def IsRetained(*args, **kwargs):
15afbcd0 8843 """
a95a7133 8844 IsRetained(self) -> bool
15afbcd0
RD
8845
8846 Returns true if the window is retained, false otherwise. Retained
8847 windows are only available on X platforms.
8848 """
54f9ee45 8849 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce
RD
8850
8851 def SetExtraStyle(*args, **kwargs):
15afbcd0 8852 """
a95a7133 8853 SetExtraStyle(self, long exStyle)
15afbcd0
RD
8854
8855 Sets the extra style bits for the window. Extra styles are the less
8856 often used style bits which can't be set with the constructor or with
8857 SetWindowStyleFlag()
8858 """
54f9ee45 8859 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
8860
8861 def GetExtraStyle(*args, **kwargs):
15afbcd0 8862 """
a95a7133 8863 GetExtraStyle(self) -> long
15afbcd0
RD
8864
8865 Returns the extra style bits for the window.
8866 """
54f9ee45 8867 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
8868
8869 def MakeModal(*args, **kwargs):
15afbcd0 8870 """
a95a7133 8871 MakeModal(self, bool modal=True)
15afbcd0
RD
8872
8873 Disables all other windows in the application so that the user can
8874 only interact with this window. Passing False will reverse this
8875 effect.
8876 """
54f9ee45 8877 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
8878
8879 def SetThemeEnabled(*args, **kwargs):
15afbcd0 8880 """
a95a7133 8881 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
8882
8883 This function tells a window if it should use the system's "theme"
8884 code to draw the windows' background instead if its own background
8885 drawing code. This will only have an effect on platforms that support
8886 the notion of themes in user defined windows. One such platform is
8887 GTK+ where windows can have (very colourful) backgrounds defined by a
8888 user's selected theme.
8889
8890 Dialogs, notebook pages and the status bar have this flag set to true
8891 by default so that the default look and feel is simulated best.
8892 """
54f9ee45 8893 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8894
8895 def GetThemeEnabled(*args, **kwargs):
15afbcd0 8896 """
a95a7133 8897 GetThemeEnabled(self) -> bool
e811c8ce 8898
15afbcd0
RD
8899 Return the themeEnabled flag.
8900 """
54f9ee45 8901 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8902
8903 def SetFocus(*args, **kwargs):
15afbcd0 8904 """
a95a7133 8905 SetFocus(self)
15afbcd0
RD
8906
8907 Set's the focus to this window, allowing it to receive keyboard input.
8908 """
54f9ee45 8909 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
8910
8911 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 8912 """
a95a7133 8913 SetFocusFromKbd(self)
15afbcd0
RD
8914
8915 Set focus to this window as the result of a keyboard action. Normally
8916 only called internally.
8917 """
54f9ee45 8918 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
8919
8920 def FindFocus(*args, **kwargs):
15afbcd0 8921 """
66c033b4 8922 FindFocus() -> Window
15afbcd0
RD
8923
8924 Returns the window or control that currently has the keyboard focus,
8925 or None.
8926 """
54f9ee45 8927 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
8928
8929 FindFocus = staticmethod(FindFocus)
8930 def AcceptsFocus(*args, **kwargs):
15afbcd0 8931 """
a95a7133 8932 AcceptsFocus(self) -> bool
15afbcd0
RD
8933
8934 Can this window have focus?
8935 """
54f9ee45 8936 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce
RD
8937
8938 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 8939 """
a95a7133 8940 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
8941
8942 Can this window be given focus by keyboard navigation? if not, the
8943 only way to give it focus (provided it accepts it at all) is to click
8944 it.
8945 """
54f9ee45 8946 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce
RD
8947
8948 def GetDefaultItem(*args, **kwargs):
15afbcd0 8949 """
a95a7133 8950 GetDefaultItem(self) -> Window
15afbcd0
RD
8951
8952 Get the default child of this parent, i.e. the one which is activated
8953 by pressing <Enter> such as the OK button on a wx.Dialog.
8954 """
54f9ee45 8955 return _core_.Window_GetDefaultItem(*args, **kwargs)
e811c8ce
RD
8956
8957 def SetDefaultItem(*args, **kwargs):
15afbcd0 8958 """
a95a7133 8959 SetDefaultItem(self, Window child) -> Window
15afbcd0
RD
8960
8961 Set this child as default, return the old default.
8962 """
54f9ee45 8963 return _core_.Window_SetDefaultItem(*args, **kwargs)
e811c8ce
RD
8964
8965 def SetTmpDefaultItem(*args, **kwargs):
15afbcd0 8966 """
a95a7133 8967 SetTmpDefaultItem(self, Window win)
15afbcd0
RD
8968
8969 Set this child as temporary default
8970 """
54f9ee45 8971 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
e811c8ce 8972
908b74cd
RD
8973 def Navigate(*args, **kwargs):
8974 """
8975 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8976
fd2dc343
RD
8977 Does keyboard navigation from this window to another, by sending a
8978 `wx.NavigationKeyEvent`.
908b74cd
RD
8979 """
8980 return _core_.Window_Navigate(*args, **kwargs)
8981
7f98d120
RD
8982 def MoveAfterInTabOrder(*args, **kwargs):
8983 """
8984 MoveAfterInTabOrder(self, Window win)
8985
8986 Moves this window in the tab navigation order after the specified
8987 sibling window. This means that when the user presses the TAB key on
8988 that other window, the focus switches to this window.
8989
8990 The default tab order is the same as creation order. This function
8991 and `MoveBeforeInTabOrder` allow to change it after creating all the
8992 windows.
8993
8994 """
8995 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8996
8997 def MoveBeforeInTabOrder(*args, **kwargs):
8998 """
8999 MoveBeforeInTabOrder(self, Window win)
9000
9001 Same as `MoveAfterInTabOrder` except that it inserts this window just
9002 before win instead of putting it right after it.
9003 """
9004 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
9005
e811c8ce 9006 def GetChildren(*args, **kwargs):
15afbcd0 9007 """
a95a7133 9008 GetChildren(self) -> PyObject
15afbcd0
RD
9009
9010 Returns a list of the window's children. NOTE: Currently this is a
9011 copy of the child window list maintained by the window, so the return
9012 value of this function is only valid as long as the window's children
9013 do not change.
9014 """
54f9ee45 9015 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
9016
9017 def GetParent(*args, **kwargs):
15afbcd0 9018 """
a95a7133 9019 GetParent(self) -> Window
15afbcd0
RD
9020
9021 Returns the parent window of this window, or None if there isn't one.
9022 """
54f9ee45 9023 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
9024
9025 def GetGrandParent(*args, **kwargs):
15afbcd0 9026 """
a95a7133 9027 GetGrandParent(self) -> Window
15afbcd0 9028
41e2b43e
RD
9029 Returns the parent of the parent of this window, or None if there
9030 isn't one.
15afbcd0 9031 """
54f9ee45 9032 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce
RD
9033
9034 def IsTopLevel(*args, **kwargs):
15afbcd0 9035 """
a95a7133 9036 IsTopLevel(self) -> bool
15afbcd0
RD
9037
9038 Returns true if the given window is a top-level one. Currently all
9039 frames and dialogs are always considered to be top-level windows (even
9040 if they have a parent window).
9041 """
54f9ee45 9042 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
9043
9044 def Reparent(*args, **kwargs):
15afbcd0 9045 """
a95a7133 9046 Reparent(self, Window newParent) -> bool
15afbcd0
RD
9047
9048 Reparents the window, i.e the window will be removed from its current
9049 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9050 re-inserted into another. Available on Windows and GTK. Returns True
9051 if the parent was changed, False otherwise (error or newParent ==
9052 oldParent)
9053 """
54f9ee45 9054 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
9055
9056 def AddChild(*args, **kwargs):
15afbcd0 9057 """
a95a7133 9058 AddChild(self, Window child)
15afbcd0
RD
9059
9060 Adds a child window. This is called automatically by window creation
9061 functions so should not be required by the application programmer.
9062 """
54f9ee45 9063 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
9064
9065 def RemoveChild(*args, **kwargs):
15afbcd0 9066 """
a95a7133 9067 RemoveChild(self, Window child)
15afbcd0
RD
9068
9069 Removes a child window. This is called automatically by window
9070 deletion functions so should not be required by the application
9071 programmer.
9072 """
54f9ee45 9073 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce
RD
9074
9075 def FindWindowById(*args, **kwargs):
15afbcd0 9076 """
a95a7133 9077 FindWindowById(self, long winid) -> Window
15afbcd0
RD
9078
9079 Find a chld of this window by window ID
9080 """
54f9ee45 9081 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
9082
9083 def FindWindowByName(*args, **kwargs):
15afbcd0 9084 """
a95a7133 9085 FindWindowByName(self, String name) -> Window
15afbcd0
RD
9086
9087 Find a child of this window by name
9088 """
54f9ee45 9089 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
9090
9091 def GetEventHandler(*args, **kwargs):
15afbcd0 9092 """
a95a7133 9093 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
9094
9095 Returns the event handler for this window. By default, the window is
9096 its own event handler.
9097 """
54f9ee45 9098 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
9099
9100 def SetEventHandler(*args, **kwargs):
15afbcd0 9101 """
a95a7133 9102 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
9103
9104 Sets the event handler for this window. An event handler is an object
9105 that is capable of processing the events sent to a window. By default,
9106 the window is its own event handler, but an application may wish to
9107 substitute another, for example to allow central implementation of
9108 event-handling for a variety of different window classes.
9109
41e2b43e 9110 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0
RD
9111 up a chain of event handlers, where an event not handled by one event
9112 handler is handed to the next one in the chain.
9113 """
54f9ee45 9114 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
9115
9116 def PushEventHandler(*args, **kwargs):
15afbcd0 9117 """
a95a7133 9118 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
9119
9120 Pushes this event handler onto the event handler stack for the window.
9121 An event handler is an object that is capable of processing the events
9122 sent to a window. By default, the window is its own event handler, but
9123 an application may wish to substitute another, for example to allow
9124 central implementation of event-handling for a variety of different
9125 window classes.
9126
9127 wx.Window.PushEventHandler allows an application to set up a chain of
9128 event handlers, where an event not handled by one event handler is
41e2b43e 9129 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
15afbcd0
RD
9130 remove the event handler.
9131 """
54f9ee45 9132 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
9133
9134 def PopEventHandler(*args, **kwargs):
15afbcd0 9135 """
a95a7133 9136 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
9137
9138 Removes and returns the top-most event handler on the event handler
9139 stack. If deleteHandler is True then the wx.EvtHandler object will be
9140 destroyed after it is popped.
9141 """
54f9ee45 9142 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
9143
9144 def RemoveEventHandler(*args, **kwargs):
15afbcd0 9145 """
a95a7133 9146 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 9147
41e2b43e
RD
9148 Find the given handler in the event handler chain and remove (but not
9149 delete) it from the event handler chain, return True if it was found
9150 and False otherwise (this also results in an assert failure so this
9151 function should only be called when the handler is supposed to be
9152 there.)
15afbcd0 9153 """
54f9ee45 9154 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
9155
9156 def SetValidator(*args, **kwargs):
15afbcd0 9157 """
a95a7133 9158 SetValidator(self, Validator validator)
15afbcd0
RD
9159
9160 Deletes the current validator (if any) and sets the window validator,
9161 having called wx.Validator.Clone to create a new validator of this
9162 type.
9163 """
54f9ee45 9164 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
9165
9166 def GetValidator(*args, **kwargs):
15afbcd0 9167 """
a95a7133 9168 GetValidator(self) -> Validator
15afbcd0
RD
9169
9170 Returns a pointer to the current validator for the window, or None if
9171 there is none.
9172 """
54f9ee45 9173 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 9174
74a57fcd
RD
9175 def Validate(*args, **kwargs):
9176 """
a95a7133 9177 Validate(self) -> bool
74a57fcd
RD
9178
9179 Validates the current values of the child controls using their
41e2b43e
RD
9180 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9181 style flag set, the method will also call Validate() of all child
9182 windows. Returns false if any of the validations failed.
74a57fcd 9183 """
54f9ee45 9184 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
9185
9186 def TransferDataToWindow(*args, **kwargs):
9187 """
a95a7133 9188 TransferDataToWindow(self) -> bool
74a57fcd 9189
41e2b43e
RD
9190 Transfers values to child controls from data areas specified by their
9191 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9192 style flag set, the method will also call TransferDataToWindow() of
9193 all child windows.
74a57fcd 9194 """
54f9ee45 9195 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
9196
9197 def TransferDataFromWindow(*args, **kwargs):
9198 """
a95a7133 9199 TransferDataFromWindow(self) -> bool
74a57fcd 9200
41e2b43e
RD
9201 Transfers values from child controls to data areas specified by their
9202 validators. Returns false if a transfer failed. If the window has
9203 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9204 also call TransferDataFromWindow() of all child windows.
74a57fcd 9205 """
54f9ee45 9206 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
9207
9208 def InitDialog(*args, **kwargs):
9209 """
a95a7133 9210 InitDialog(self)
74a57fcd 9211
41e2b43e
RD
9212 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9213 to the dialog via validators.
74a57fcd 9214 """
54f9ee45 9215 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 9216
e811c8ce 9217 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 9218 """
a95a7133 9219 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
9220
9221 Sets the accelerator table for this window.
9222 """
54f9ee45 9223 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
9224
9225 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 9226 """
a95a7133 9227 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
9228
9229 Gets the accelerator table for this window.
9230 """
54f9ee45 9231 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
9232
9233 def RegisterHotKey(*args, **kwargs):
15afbcd0 9234 """
a95a7133 9235 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
9236
9237 Registers a system wide hotkey. Every time the user presses the hotkey
9238 registered here, this window will receive a hotkey event. It will
9239 receive the event even if the application is in the background and
9240 does not have the input focus because the user is working with some
9241 other application. To bind an event handler function to this hotkey
9242 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9243 hotkey was registered successfully.
9244 """
54f9ee45 9245 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
9246
9247 def UnregisterHotKey(*args, **kwargs):
15afbcd0 9248 """
a95a7133 9249 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
9250
9251 Unregisters a system wide hotkey.
9252 """
54f9ee45 9253 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
9254
9255 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 9256 """
a95a7133 9257 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
9258
9259 Converts a point or size from dialog units to pixels. Dialog units
9260 are used for maintaining a dialog's proportions even if the font
9261 changes. For the x dimension, the dialog units are multiplied by the
9262 average character width and then divided by 4. For the y dimension,
9263 the dialog units are multiplied by the average character height and
9264 then divided by 8.
9265 """
54f9ee45 9266 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
9267
9268 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 9269 """
a95a7133 9270 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
9271
9272 Converts a point or size from dialog units to pixels. Dialog units
9273 are used for maintaining a dialog's proportions even if the font
9274 changes. For the x dimension, the dialog units are multiplied by the
9275 average character width and then divided by 4. For the y dimension,
9276 the dialog units are multiplied by the average character height and
9277 then divided by 8.
9278 """
54f9ee45 9279 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
9280
9281 def DLG_PNT(*args, **kwargs):
15afbcd0 9282 """
a95a7133 9283 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
9284
9285 Converts a point or size from dialog units to pixels. Dialog units
9286 are used for maintaining a dialog's proportions even if the font
9287 changes. For the x dimension, the dialog units are multiplied by the
9288 average character width and then divided by 4. For the y dimension,
9289 the dialog units are multiplied by the average character height and
9290 then divided by 8.
9291 """
54f9ee45 9292 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
9293
9294 def DLG_SZE(*args, **kwargs):
15afbcd0 9295 """
a95a7133 9296 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
9297
9298 Converts a point or size from dialog units to pixels. Dialog units
9299 are used for maintaining a dialog's proportions even if the font
9300 changes. For the x dimension, the dialog units are multiplied by the
9301 average character width and then divided by 4. For the y dimension,
9302 the dialog units are multiplied by the average character height and
9303 then divided by 8.
9304 """
54f9ee45 9305 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
9306
9307 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 9308 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 9309 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
9310
9311 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 9312 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 9313 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
9314
9315 def WarpPointer(*args, **kwargs):
15afbcd0 9316 """
a95a7133 9317 WarpPointer(self, int x, int y)
15afbcd0
RD
9318
9319 Moves the pointer to the given position on the window.
9320
9321 NOTE: This function is not supported under Mac because Apple Human
9322 Interface Guidelines forbid moving the mouse cursor programmatically.
9323 """
54f9ee45 9324 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
9325
9326 def CaptureMouse(*args, **kwargs):
15afbcd0 9327 """
a95a7133 9328 CaptureMouse(self)
15afbcd0
RD
9329
9330 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9331 release the capture.
9332
9333 Note that wxWindows maintains the stack of windows having captured the
9334 mouse and when the mouse is released the capture returns to the window
9335 which had had captured it previously and it is only really released if
9336 there were no previous window. In particular, this means that you must
9337 release the mouse as many times as you capture it.
9338 """
54f9ee45 9339 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
9340
9341 def ReleaseMouse(*args, **kwargs):
15afbcd0 9342 """
a95a7133 9343 ReleaseMouse(self)
15afbcd0
RD
9344
9345 Releases mouse input captured with wx.Window.CaptureMouse.
9346 """
54f9ee45 9347 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
9348
9349 def GetCapture(*args, **kwargs):
15afbcd0 9350 """
66c033b4 9351 GetCapture() -> Window
15afbcd0
RD
9352
9353 Returns the window which currently captures the mouse or None
9354 """
54f9ee45 9355 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
9356
9357 GetCapture = staticmethod(GetCapture)
9358 def HasCapture(*args, **kwargs):
15afbcd0 9359 """
a95a7133 9360 HasCapture(self) -> bool
15afbcd0
RD
9361
9362 Returns true if this window has the current mouse capture.
9363 """
54f9ee45 9364 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
9365
9366 def Refresh(*args, **kwargs):
15afbcd0 9367 """
a95a7133 9368 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
9369
9370 Mark the specified rectangle (or the whole window) as "dirty" so it
9371 will be repainted. Causes an EVT_PAINT event to be generated and sent
9372 to the window.
9373 """
54f9ee45 9374 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
9375
9376 def RefreshRect(*args, **kwargs):
15afbcd0 9377 """
fef4c27a 9378 RefreshRect(self, Rect rect, bool eraseBackground=True)
15afbcd0
RD
9379
9380 Redraws the contents of the given rectangle: the area inside it will
9381 be repainted. This is the same as Refresh but has a nicer syntax.
9382 """
54f9ee45 9383 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
9384
9385 def Update(*args, **kwargs):
15afbcd0 9386 """
a95a7133 9387 Update(self)
15afbcd0
RD
9388
9389 Calling this method immediately repaints the invalidated area of the
9390 window instead of waiting for the EVT_PAINT event to happen, (normally
9391 this would usually only happen when the flow of control returns to the
9392 event loop.) Notice that this function doesn't refresh the window and
9393 does nothing if the window has been already repainted. Use Refresh
9394 first if you want to immediately redraw the window (or some portion of
9395 it) unconditionally.
9396 """
54f9ee45 9397 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
9398
9399 def ClearBackground(*args, **kwargs):
15afbcd0 9400 """
a95a7133 9401 ClearBackground(self)
15afbcd0
RD
9402
9403 Clears the window by filling it with the current background
9404 colour. Does not cause an erase background event to be generated.
9405 """
54f9ee45 9406 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
9407
9408 def Freeze(*args, **kwargs):
15afbcd0 9409 """
a95a7133 9410 Freeze(self)
15afbcd0 9411
41e2b43e
RD
9412 Freezes the window or, in other words, prevents any updates from
9413 taking place on screen, the window is not redrawn at all. Thaw must be
9414 called to reenable window redrawing. Calls to Freeze/Thaw may be
9415 nested, with the actual Thaw being delayed until all the nesting has
9416 been undone.
15afbcd0
RD
9417
9418 This method is useful for visual appearance optimization (for example,
9419 it is a good idea to use it before inserting large amount of text into
9420 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9421 for all controls so it is mostly just a hint to wxWindows and not a
9422 mandatory directive.
9423 """
54f9ee45 9424 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce
RD
9425
9426 def Thaw(*args, **kwargs):
15afbcd0 9427 """
a95a7133 9428 Thaw(self)
15afbcd0 9429
4276dc52 9430 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
9431 Freeze/Thaw may be nested, so Thaw must be called the same number of
9432 times that Freeze was before the window will be updated.
15afbcd0 9433 """
54f9ee45 9434 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
9435
9436 def PrepareDC(*args, **kwargs):
15afbcd0 9437 """
a95a7133 9438 PrepareDC(self, DC dc)
15afbcd0
RD
9439
9440 Call this function to prepare the device context for drawing a
9441 scrolled image. It sets the device origin according to the current
9442 scroll position.
9443 """
54f9ee45 9444 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce
RD
9445
9446 def GetUpdateRegion(*args, **kwargs):
15afbcd0 9447 """
a95a7133 9448 GetUpdateRegion(self) -> Region
15afbcd0
RD
9449
9450 Returns the region specifying which parts of the window have been
9451 damaged. Should only be called within an EVT_PAINT handler.
9452 """
54f9ee45 9453 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
9454
9455 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 9456 """
a95a7133 9457 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
9458
9459 Get the update rectangle region bounding box in client coords.
9460 """
54f9ee45 9461 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
9462
9463 def IsExposed(*args, **kwargs):
15afbcd0 9464 """
a95a7133 9465 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
9466
9467 Returns true if the given point or rectangle area has been exposed
9468 since the last repaint. Call this in an paint event handler to
9469 optimize redrawing by only redrawing those areas, which have been
9470 exposed.
9471 """
54f9ee45 9472 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
9473
9474 def IsExposedPoint(*args, **kwargs):
15afbcd0 9475 """
a95a7133 9476 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
9477
9478 Returns true if the given point or rectangle area has been exposed
9479 since the last repaint. Call this in an paint event handler to
9480 optimize redrawing by only redrawing those areas, which have been
9481 exposed.
9482 """
54f9ee45 9483 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 9484
4276dc52 9485 def IsExposedRect(*args, **kwargs):
15afbcd0 9486 """
a95a7133 9487 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
9488
9489 Returns true if the given point or rectangle area has been exposed
9490 since the last repaint. Call this in an paint event handler to
9491 optimize redrawing by only redrawing those areas, which have been
9492 exposed.
9493 """
54f9ee45 9494 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 9495
74a57fcd
RD
9496 def GetDefaultAttributes(*args, **kwargs):
9497 """
a95a7133 9498 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 9499
41e2b43e
RD
9500 Get the default attributes for an instance of this class. This is
9501 useful if you want to use the same font or colour in your own control
9502 as in a standard control -- which is a much better idea than hard
9503 coding specific colours or fonts which might look completely out of
db3e571a 9504 place on the user's system, especially if it uses themes.
74a57fcd 9505 """
54f9ee45 9506 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9507
9508 def GetClassDefaultAttributes(*args, **kwargs):
9509 """
66c033b4 9510 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 9511
41e2b43e
RD
9512 Get the default attributes for this class. This is useful if you want
9513 to use the same font or colour in your own control as in a standard
9514 control -- which is a much better idea than hard coding specific
db3e571a
RD
9515 colours or fonts which might look completely out of place on the
9516 user's system, especially if it uses themes.
74a57fcd
RD
9517
9518 The variant parameter is only relevant under Mac currently and is
41e2b43e 9519 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
9520 the returned font. See `wx.Window.SetWindowVariant` for more about
9521 this.
74a57fcd 9522 """
54f9ee45 9523 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9524
9525 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 9526 def SetBackgroundColour(*args, **kwargs):
15afbcd0 9527 """
a95a7133 9528 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
9529
9530 Sets the background colour of the window. Returns True if the colour
9531 was changed. The background colour is usually painted by the default
9532 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9533 automatically under GTK. Using `wx.NullColour` will reset the window
9534 to the default background colour.
15afbcd0 9535
db3e571a 9536 Note that setting the background colour may not cause an immediate
f8167d6e 9537 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
9538 calling this function.
9539
f8167d6e
RD
9540 Using this function will disable attempts to use themes for this
9541 window, if the system supports them. Use with care since usually the
9542 themes represent the appearance chosen by the user to be used for all
9543 applications on the system.
15afbcd0 9544 """
54f9ee45 9545 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 9546
412d302d
RD
9547 def SetOwnBackgroundColour(*args, **kwargs):
9548 """SetOwnBackgroundColour(self, Colour colour)"""
9549 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 9550
e811c8ce 9551 def SetForegroundColour(*args, **kwargs):
15afbcd0 9552 """
a95a7133 9553 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
9554
9555 Sets the foreground colour of the window. Returns True is the colour
9556 was changed. The interpretation of foreground colour is dependent on
9557 the window class; it may be the text colour or other colour, or it may
9558 not be used at all.
9559 """
54f9ee45 9560 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 9561
fa47d7a7
VS
9562 def SetOwnForegroundColour(*args, **kwargs):
9563 """SetOwnForegroundColour(self, Colour colour)"""
9564 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 9565
e811c8ce 9566 def GetBackgroundColour(*args, **kwargs):
15afbcd0 9567 """
a95a7133 9568 GetBackgroundColour(self) -> Colour
15afbcd0
RD
9569
9570 Returns the background colour of the window.
9571 """
54f9ee45 9572 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
9573
9574 def GetForegroundColour(*args, **kwargs):
15afbcd0 9575 """
a95a7133 9576 GetForegroundColour(self) -> Colour
15afbcd0
RD
9577
9578 Returns the foreground colour of the window. The interpretation of
9579 foreground colour is dependent on the window class; it may be the text
9580 colour or other colour, or it may not be used at all.
9581 """
54f9ee45 9582 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 9583
562ecc31
RD
9584 def InheritsBackgroundColour(*args, **kwargs):
9585 """InheritsBackgroundColour(self) -> bool"""
9586 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9587
9588 def UseBgCol(*args, **kwargs):
9589 """UseBgCol(self) -> bool"""
9590 return _core_.Window_UseBgCol(*args, **kwargs)
9591
7bc1e663
RD
9592 def SetBackgroundStyle(*args, **kwargs):
9593 """
9594 SetBackgroundStyle(self, int style) -> bool
9595
9596 Returns the background style of the window. The background style
9597 indicates how the background of the window is drawn.
9598
9599 ====================== ========================================
9600 wx.BG_STYLE_SYSTEM The background colour or pattern should
9601 be determined by the system
9602 wx.BG_STYLE_COLOUR The background should be a solid colour
9603 wx.BG_STYLE_CUSTOM The background will be implemented by the
9604 application.
9605 ====================== ========================================
9606
9607 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9608 a custom background, such as a tiled bitmap. Currently the style has
9609 no effect on other platforms.
9610
9611 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9612 """
9613 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9614
9615 def GetBackgroundStyle(*args, **kwargs):
9616 """
9617 GetBackgroundStyle(self) -> int
9618
9619 Returns the background style of the window.
9620
9621 :see: `SetBackgroundStyle`
9622 """
9623 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9624
51b83b37
RD
9625 def HasTransparentBackground(*args, **kwargs):
9626 """
9627 HasTransparentBackground(self) -> bool
9628
9629 Returns True if this window's background is transparent (as, for
9630 example, for `wx.StaticText`) and should show the parent window's
9631 background.
9632
9633 This method is mostly used internally by the library itself and you
9634 normally shouldn't have to call it. You may, however, have to override
9635 it in your custom control classes to ensure that background is painted
9636 correctly.
9637 """
9638 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9639
e811c8ce 9640 def SetCursor(*args, **kwargs):
15afbcd0 9641 """
a95a7133 9642 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
9643
9644 Sets the window's cursor. Notice that the window cursor also sets it
9645 for the children of the window implicitly.
9646
9647 The cursor may be wx.NullCursor in which case the window cursor will
9648 be reset back to default.
9649 """
54f9ee45 9650 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
9651
9652 def GetCursor(*args, **kwargs):
15afbcd0 9653 """
a95a7133 9654 GetCursor(self) -> Cursor
15afbcd0
RD
9655
9656 Return the cursor associated with this window.
9657 """
54f9ee45 9658 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
9659
9660 def SetFont(*args, **kwargs):
15afbcd0 9661 """
a95a7133 9662 SetFont(self, Font font) -> bool
15afbcd0
RD
9663
9664 Sets the font for this window.
9665 """
54f9ee45 9666 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 9667
fa47d7a7
VS
9668 def SetOwnFont(*args, **kwargs):
9669 """SetOwnFont(self, Font font)"""
9670 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 9671
e811c8ce 9672 def GetFont(*args, **kwargs):
15afbcd0 9673 """
a95a7133 9674 GetFont(self) -> Font
15afbcd0 9675
4276dc52 9676 Returns the default font used for this window.
15afbcd0 9677 """
54f9ee45 9678 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
9679
9680 def SetCaret(*args, **kwargs):
15afbcd0 9681 """
a95a7133 9682 SetCaret(self, Caret caret)
15afbcd0
RD
9683
9684 Sets the caret associated with the window.
9685 """
54f9ee45 9686 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
9687
9688 def GetCaret(*args, **kwargs):
15afbcd0 9689 """
a95a7133 9690 GetCaret(self) -> Caret
15afbcd0
RD
9691
9692 Returns the caret associated with the window.
9693 """
54f9ee45 9694 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
9695
9696 def GetCharHeight(*args, **kwargs):
15afbcd0 9697 """
a95a7133 9698 GetCharHeight(self) -> int
15afbcd0
RD
9699
9700 Get the (average) character size for the current font.
9701 """
54f9ee45 9702 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
9703
9704 def GetCharWidth(*args, **kwargs):
15afbcd0 9705 """
a95a7133 9706 GetCharWidth(self) -> int
15afbcd0
RD
9707
9708 Get the (average) character size for the current font.
9709 """
54f9ee45 9710 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
9711
9712 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9713 """
9714 GetTextExtent(String string) -> (width, height)
9715
9716 Get the width and height of the text using the current font.
9717 """
54f9ee45 9718 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
9719
9720 def GetFullTextExtent(*args, **kwargs):
0df68c9f 9721 """
196addbf 9722 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 9723 (width, height, descent, externalLeading)
e811c8ce 9724
15afbcd0
RD
9725 Get the width, height, decent and leading of the text using the
9726 current or specified font.
0df68c9f 9727 """
54f9ee45 9728 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
9729
9730 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
9731 """
9732 ClientToScreenXY(int x, int y) -> (x,y)
9733
9734 Converts to screen coordinates from coordinates relative to this window.
9735 """
54f9ee45 9736 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
9737
9738 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
9739 """
9740 ScreenToClientXY(int x, int y) -> (x,y)
9741
9742 Converts from screen to client window coordinates.
9743 """
54f9ee45 9744 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
9745
9746 def ClientToScreen(*args, **kwargs):
15afbcd0 9747 """
a95a7133 9748 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
9749
9750 Converts to screen coordinates from coordinates relative to this window.
9751 """
54f9ee45 9752 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
9753
9754 def ScreenToClient(*args, **kwargs):
15afbcd0 9755 """
a95a7133 9756 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
9757
9758 Converts from screen to client window coordinates.
9759 """
54f9ee45 9760 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
9761
9762 def HitTestXY(*args, **kwargs):
15afbcd0 9763 """
a95a7133 9764 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
9765
9766 Test where the given (in client coords) point lies
9767 """
54f9ee45 9768 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
9769
9770 def HitTest(*args, **kwargs):
15afbcd0 9771 """
a95a7133 9772 HitTest(self, Point pt) -> int
15afbcd0
RD
9773
9774 Test where the given (in client coords) point lies
9775 """
54f9ee45 9776 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 9777
15afbcd0
RD
9778 def GetBorder(*args):
9779 """
a95a7133
RD
9780 GetBorder(self, long flags) -> int
9781 GetBorder(self) -> int
e811c8ce 9782
15afbcd0
RD
9783 Get border for the flags of this window
9784 """
54f9ee45 9785 return _core_.Window_GetBorder(*args)
e811c8ce
RD
9786
9787 def UpdateWindowUI(*args, **kwargs):
15afbcd0 9788 """
a95a7133 9789 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
9790
9791 This function sends EVT_UPDATE_UI events to the window. The particular
9792 implementation depends on the window; for example a wx.ToolBar will
9793 send an update UI event for each toolbar button, and a wx.Frame will
9794 send an update UI event for each menubar menu item. You can call this
9795 function from your application to ensure that your UI is up-to-date at
9796 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9797 concerned). This may be necessary if you have called
5ba5649b 9798 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
15afbcd0
RD
9799 limit the overhead that wxWindows incurs by sending update UI events
9800 in idle time.
15afbcd0 9801 """
54f9ee45 9802 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
9803
9804 def PopupMenuXY(*args, **kwargs):
15afbcd0 9805 """
b0503257 9806 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 9807
b0503257
RD
9808 Pops up the given menu at the specified coordinates, relative to this window,
9809 and returns control when the user has dismissed the menu. If a menu item is
9810 selected, the corresponding menu event is generated and will be processed as
9811 usual. If the default position is given then the current position of the
9812 mouse cursor will be used.
15afbcd0 9813 """
54f9ee45 9814 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 9815
15afbcd0
RD
9816 def PopupMenu(*args, **kwargs):
9817 """
b0503257 9818 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 9819
b0503257
RD
9820 Pops up the given menu at the specified coordinates, relative to this window,
9821 and returns control when the user has dismissed the menu. If a menu item is
9822 selected, the corresponding menu event is generated and will be processed as
9823 usual. If the default position is given then the current position of the
9824 mouse cursor will be used.
15afbcd0 9825 """
54f9ee45 9826 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0
RD
9827
9828 def GetHandle(*args, **kwargs):
9829 """
a95a7133 9830 GetHandle(self) -> long
15afbcd0
RD
9831
9832 Returns the platform-specific handle (as a long integer) of the
9833 physical window. Currently on wxMac it returns the handle of the
9834 toplevel parent of the window.
9835 """
54f9ee45 9836 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 9837
7e63a440
RD
9838 def AssociateHandle(*args, **kwargs):
9839 """
9840 AssociateHandle(self, long handle)
9841
9842 Associate the window with a new native handle
9843 """
9844 return _core_.Window_AssociateHandle(*args, **kwargs)
9845
9846 def DissociateHandle(*args, **kwargs):
9847 """
9848 DissociateHandle(self)
9849
9850 Dissociate the current native handle from the window
9851 """
9852 return _core_.Window_DissociateHandle(*args, **kwargs)
9853
15afbcd0
RD
9854 def HasScrollbar(*args, **kwargs):
9855 """
a95a7133 9856 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
9857
9858 Does the window have the scrollbar for this orientation?
9859 """
54f9ee45 9860 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
9861
9862 def SetScrollbar(*args, **kwargs):
9863 """
41e2b43e 9864 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
9865 bool refresh=True)
9866
9867 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 9868 """
54f9ee45 9869 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
9870
9871 def SetScrollPos(*args, **kwargs):
15afbcd0 9872 """
a95a7133 9873 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
9874
9875 Sets the position of one of the built-in scrollbars.
9876 """
54f9ee45 9877 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
9878
9879 def GetScrollPos(*args, **kwargs):
15afbcd0 9880 """
a95a7133 9881 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
9882
9883 Returns the built-in scrollbar position.
9884 """
54f9ee45 9885 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
9886
9887 def GetScrollThumb(*args, **kwargs):
15afbcd0 9888 """
a95a7133 9889 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
9890
9891 Returns the built-in scrollbar thumb size.
9892 """
54f9ee45 9893 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
9894
9895 def GetScrollRange(*args, **kwargs):
15afbcd0 9896 """
a95a7133 9897 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
9898
9899 Returns the built-in scrollbar range.
9900 """
54f9ee45 9901 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
9902
9903 def ScrollWindow(*args, **kwargs):
15afbcd0 9904 """
a95a7133 9905 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
9906
9907 Physically scrolls the pixels in the window and move child windows
9908 accordingly. Use this function to optimise your scrolling
9909 implementations, to minimise the area that must be redrawn. Note that
9910 it is rarely required to call this function from a user program.
15afbcd0 9911 """
54f9ee45 9912 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
9913
9914 def ScrollLines(*args, **kwargs):
15afbcd0 9915 """
a95a7133 9916 ScrollLines(self, int lines) -> bool
15afbcd0
RD
9917
9918 If the platform and window class supports it, scrolls the window by
9919 the given number of lines down, if lines is positive, or up if lines
9920 is negative. Returns True if the window was scrolled, False if it was
9921 already on top/bottom and nothing was done.
9922 """
54f9ee45 9923 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
9924
9925 def ScrollPages(*args, **kwargs):
15afbcd0 9926 """
a95a7133 9927 ScrollPages(self, int pages) -> bool
15afbcd0 9928
41e2b43e 9929 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
9930 the given number of pages down, if pages is positive, or up if pages
9931 is negative. Returns True if the window was scrolled, False if it was
9932 already on top/bottom and nothing was done.
9933 """
54f9ee45 9934 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
9935
9936 def LineUp(*args, **kwargs):
15afbcd0 9937 """
a95a7133 9938 LineUp(self) -> bool
15afbcd0
RD
9939
9940 This is just a wrapper for ScrollLines(-1).
9941 """
54f9ee45 9942 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
9943
9944 def LineDown(*args, **kwargs):
15afbcd0 9945 """
a95a7133 9946 LineDown(self) -> bool
15afbcd0
RD
9947
9948 This is just a wrapper for ScrollLines(1).
9949 """
54f9ee45 9950 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
9951
9952 def PageUp(*args, **kwargs):
15afbcd0 9953 """
a95a7133 9954 PageUp(self) -> bool
15afbcd0
RD
9955
9956 This is just a wrapper for ScrollPages(-1).
9957 """
54f9ee45 9958 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
9959
9960 def PageDown(*args, **kwargs):
15afbcd0 9961 """
a95a7133 9962 PageDown(self) -> bool
15afbcd0
RD
9963
9964 This is just a wrapper for ScrollPages(1).
9965 """
54f9ee45 9966 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
9967
9968 def SetHelpText(*args, **kwargs):
15afbcd0 9969 """
a95a7133 9970 SetHelpText(self, String text)
15afbcd0
RD
9971
9972 Sets the help text to be used as context-sensitive help for this
9973 window. Note that the text is actually stored by the current
9974 wxHelpProvider implementation, and not in the window object itself.
9975 """
54f9ee45 9976 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
9977
9978 def SetHelpTextForId(*args, **kwargs):
15afbcd0 9979 """
a95a7133 9980 SetHelpTextForId(self, String text)
15afbcd0
RD
9981
9982 Associate this help text with all windows with the same id as this
9983 one.
9984 """
54f9ee45 9985 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce
RD
9986
9987 def GetHelpText(*args, **kwargs):
15afbcd0 9988 """
a95a7133 9989 GetHelpText(self) -> String
15afbcd0
RD
9990
9991 Gets the help text to be used as context-sensitive help for this
9992 window. Note that the text is actually stored by the current
9993 wxHelpProvider implementation, and not in the window object itself.
9994 """
54f9ee45 9995 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
9996
9997 def SetToolTipString(*args, **kwargs):
15afbcd0 9998 """
a95a7133 9999 SetToolTipString(self, String tip)
15afbcd0
RD
10000
10001 Attach a tooltip to the window.
10002 """
54f9ee45 10003 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
10004
10005 def SetToolTip(*args, **kwargs):
15afbcd0 10006 """
a95a7133 10007 SetToolTip(self, ToolTip tip)
15afbcd0
RD
10008
10009 Attach a tooltip to the window.
10010 """
54f9ee45 10011 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
10012
10013 def GetToolTip(*args, **kwargs):
15afbcd0 10014 """
a95a7133 10015 GetToolTip(self) -> ToolTip
15afbcd0
RD
10016
10017 get the associated tooltip or None if none
10018 """
54f9ee45 10019 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
10020
10021 def SetDropTarget(*args, **kwargs):
15afbcd0 10022 """
a95a7133 10023 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
10024
10025 Associates a drop target with this window. If the window already has
10026 a drop target, it is deleted.
10027 """
54f9ee45 10028 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
10029
10030 def GetDropTarget(*args, **kwargs):
15afbcd0 10031 """
a95a7133 10032 GetDropTarget(self) -> DropTarget
15afbcd0
RD
10033
10034 Returns the associated drop target, which may be None.
10035 """
54f9ee45 10036 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce 10037
5ba5649b
RD
10038 def DragAcceptFiles(*args, **kwargs):
10039 """
10040 DragAcceptFiles(self, bool accept)
10041
10042 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10043 Only functional on Windows.
10044 """
10045 return _core_.Window_DragAcceptFiles(*args, **kwargs)
10046
e811c8ce 10047 def SetConstraints(*args, **kwargs):
15afbcd0 10048 """
a95a7133 10049 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
10050
10051 Sets the window to have the given layout constraints. If an existing
10052 layout constraints object is already owned by the window, it will be
10053 deleted. Pass None to disassociate and delete the window's current
10054 constraints.
10055
10056 You must call SetAutoLayout to tell a window to use the constraints
10057 automatically in its default EVT_SIZE handler; otherwise, you must
10058 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10059 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10060 effect.
10061 """
54f9ee45 10062 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
10063
10064 def GetConstraints(*args, **kwargs):
15afbcd0 10065 """
a95a7133 10066 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
10067
10068 Returns a pointer to the window's layout constraints, or None if there
10069 are none.
10070 """
54f9ee45 10071 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
10072
10073 def SetAutoLayout(*args, **kwargs):
15afbcd0 10074 """
a95a7133 10075 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
10076
10077 Determines whether the Layout function will be called automatically
b1fcee84
RD
10078 when the window is resized. lease note that this only happens for the
10079 windows usually used to contain children, namely `wx.Panel` and
10080 `wx.TopLevelWindow` (and the classes deriving from them).
10081
10082 This method is called implicitly by `SetSizer` but if you use
10083 `SetConstraints` you should call it manually or otherwise the window
10084 layout won't be correctly updated when its size changes.
15afbcd0 10085 """
54f9ee45 10086 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
10087
10088 def GetAutoLayout(*args, **kwargs):
15afbcd0 10089 """
a95a7133 10090 GetAutoLayout(self) -> bool
15afbcd0
RD
10091
10092 Returns the current autoLayout setting
10093 """
54f9ee45 10094 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
10095
10096 def Layout(*args, **kwargs):
15afbcd0 10097 """
a95a7133 10098 Layout(self) -> bool
15afbcd0
RD
10099
10100 Invokes the constraint-based layout algorithm or the sizer-based
10101 algorithm for this window. See SetAutoLayout: when auto layout is on,
10102 this function gets called automatically by the default EVT_SIZE
10103 handler when the window is resized.
10104 """
54f9ee45 10105 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
10106
10107 def SetSizer(*args, **kwargs):
15afbcd0 10108 """
a95a7133 10109 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
10110
10111 Sets the window to have the given layout sizer. The window will then
10112 own the object, and will take care of its deletion. If an existing
10113 layout sizer object is already owned by the window, it will be deleted
10114 if the deleteOld parameter is true. Note that this function will also
10115 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 10116 non-None, and False otherwise.
15afbcd0 10117 """
54f9ee45 10118 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
10119
10120 def SetSizerAndFit(*args, **kwargs):
15afbcd0 10121 """
a95a7133 10122 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
10123
10124 The same as SetSizer, except it also sets the size hints for the
10125 window based on the sizer's minimum size.
10126 """
54f9ee45 10127 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
10128
10129 def GetSizer(*args, **kwargs):
15afbcd0 10130 """
a95a7133 10131 GetSizer(self) -> Sizer
15afbcd0
RD
10132
10133 Return the sizer associated with the window by a previous call to
10134 SetSizer or None if there isn't one.
10135 """
54f9ee45 10136 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
10137
10138 def SetContainingSizer(*args, **kwargs):
15afbcd0 10139 """
a95a7133 10140 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
10141
10142 This normally does not need to be called by application code. It is
10143 called internally when a window is added to a sizer, and is used so
10144 the window can remove itself from the sizer when it is destroyed.
10145 """
54f9ee45 10146 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
10147
10148 def GetContainingSizer(*args, **kwargs):
15afbcd0 10149 """
a95a7133 10150 GetContainingSizer(self) -> Sizer
15afbcd0
RD
10151
10152 Return the sizer that this window is a member of, if any, otherwise None.
10153 """
54f9ee45 10154 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 10155
a95a7133
RD
10156 def InheritAttributes(*args, **kwargs):
10157 """
10158 InheritAttributes(self)
10159
41e2b43e
RD
10160 This function is (or should be, in case of custom controls) called
10161 during window creation to intelligently set up the window visual
10162 attributes, that is the font and the foreground and background
10163 colours.
10164
10165 By 'intelligently' the following is meant: by default, all windows use
10166 their own default attributes. However if some of the parent's
10167 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10168 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
10169 explicitly set for this window itself, then this window takes the same
10170 value as used by the parent. In addition, if the window overrides
10171 ShouldInheritColours to return false, the colours will not be changed
10172 no matter what and only the font might.
10173
34621cc5 10174 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 10175 different usage scenarios. The most common one is when all default
41e2b43e
RD
10176 attributes are used and in this case, nothing should be inherited as
10177 in modern GUIs different controls use different fonts (and colours)
10178 than their siblings so they can't inherit the same value from the
10179 parent. However it was also deemed desirable to allow to simply change
10180 the attributes of all children at once by just changing the font or
10181 colour of their common parent, hence in this case we do inherit the
10182 parents attributes.
10183
a95a7133 10184 """
54f9ee45 10185 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
10186
10187 def ShouldInheritColours(*args, **kwargs):
10188 """
10189 ShouldInheritColours(self) -> bool
10190
10191 Return true from here to allow the colours of this window to be
41e2b43e
RD
10192 changed by InheritAttributes, returning false forbids inheriting them
10193 from the parent window.
a95a7133 10194
41e2b43e
RD
10195 The base class version returns false, but this method is overridden in
10196 wxControl where it returns true.
a95a7133 10197 """
54f9ee45 10198 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 10199
e811c8ce 10200 def PostCreate(self, pre):
15afbcd0
RD
10201 """
10202 Phase 3 of the 2-phase create <wink!>
10203 Call this method after precreating the window with the 2-phase create method.
10204 """
e811c8ce
RD
10205 self.this = pre.this
10206 self.thisown = pre.thisown
10207 pre.thisown = 0
10208 if hasattr(self, '_setOORInfo'):
10209 self._setOORInfo(self)
10210 if hasattr(self, '_setCallbackInfo'):
10211 self._setCallbackInfo(self, self.__class__)
10212
7e08d4ef
RD
10213 def SendSizeEvent(self):
10214 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
10215
e811c8ce
RD
10216
10217class WindowPtr(Window):
10218 def __init__(self, this):
10219 self.this = this
10220 if not hasattr(self,"thisown"): self.thisown = 0
10221 self.__class__ = Window
54f9ee45 10222_core_.Window_swigregister(WindowPtr)
e811c8ce
RD
10223
10224def PreWindow(*args, **kwargs):
15afbcd0
RD
10225 """
10226 PreWindow() -> Window
10227
10228 Precreate a Window for 2-phase creation.
10229 """
54f9ee45 10230 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
10231 val.thisown = 1
10232 return val
10233
10234def Window_NewControlId(*args, **kwargs):
15afbcd0
RD
10235 """
10236 Window_NewControlId() -> int
10237
10238 Generate a control id for the controls which were not given one.
10239 """
54f9ee45 10240 return _core_.Window_NewControlId(*args, **kwargs)
e811c8ce
RD
10241
10242def Window_NextControlId(*args, **kwargs):
15afbcd0
RD
10243 """
10244 Window_NextControlId(int winid) -> int
10245
10246 Get the id of the control following the one with the given
41e2b43e 10247 autogenerated) id
15afbcd0 10248 """
54f9ee45 10249 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
10250
10251def Window_PrevControlId(*args, **kwargs):
15afbcd0
RD
10252 """
10253 Window_PrevControlId(int winid) -> int
10254
10255 Get the id of the control preceding the one with the given
41e2b43e 10256 autogenerated) id
15afbcd0 10257 """
54f9ee45 10258 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce
RD
10259
10260def Window_FindFocus(*args, **kwargs):
15afbcd0
RD
10261 """
10262 Window_FindFocus() -> Window
10263
10264 Returns the window or control that currently has the keyboard focus,
10265 or None.
10266 """
54f9ee45 10267 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
10268
10269def Window_GetCapture(*args, **kwargs):
15afbcd0
RD
10270 """
10271 Window_GetCapture() -> Window
10272
10273 Returns the window which currently captures the mouse or None
10274 """
54f9ee45 10275 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce 10276
74a57fcd
RD
10277def Window_GetClassDefaultAttributes(*args, **kwargs):
10278 """
10279 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10280
41e2b43e
RD
10281 Get the default attributes for this class. This is useful if you want
10282 to use the same font or colour in your own control as in a standard
10283 control -- which is a much better idea than hard coding specific
db3e571a
RD
10284 colours or fonts which might look completely out of place on the
10285 user's system, especially if it uses themes.
74a57fcd
RD
10286
10287 The variant parameter is only relevant under Mac currently and is
41e2b43e 10288 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
10289 the returned font. See `wx.Window.SetWindowVariant` for more about
10290 this.
74a57fcd 10291 """
54f9ee45 10292 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 10293
e811c8ce 10294def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
10295 """
10296 Convenience function for converting a Point or (x,y) in
10297 dialog units to pixel units.
10298 """
e811c8ce
RD
10299 if y is None:
10300 return win.ConvertDialogPointToPixels(point_or_x)
10301 else:
fd3f2efe 10302 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
10303
10304def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
10305 """
10306 Convenience function for converting a Size or (w,h) in
10307 dialog units to pixel units.
10308 """
e811c8ce
RD
10309 if height is None:
10310 return win.ConvertDialogSizeToPixels(size_width)
10311 else:
fd3f2efe 10312 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
10313
10314
10315def FindWindowById(*args, **kwargs):
15afbcd0
RD
10316 """
10317 FindWindowById(long id, Window parent=None) -> Window
10318
10319 Find the first window in the application with the given id. If parent
10320 is None, the search will start from all top-level frames and dialog
10321 boxes; if non-None, the search will be limited to the given window
10322 hierarchy. The search is recursive in both cases.
10323 """
54f9ee45 10324 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
10325
10326def FindWindowByName(*args, **kwargs):
15afbcd0
RD
10327 """
10328 FindWindowByName(String name, Window parent=None) -> Window
10329
10330 Find a window by its name (as given in a window constructor or Create
10331 function call). If parent is None, the search will start from all
10332 top-level frames and dialog boxes; if non-None, the search will be
10333 limited to the given window hierarchy. The search is recursive in both
10334 cases.
10335
10336 If no window with such name is found, wx.FindWindowByLabel is called.
10337 """
54f9ee45 10338 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
10339
10340def FindWindowByLabel(*args, **kwargs):
15afbcd0
RD
10341 """
10342 FindWindowByLabel(String label, Window parent=None) -> Window
10343
10344 Find a window by its label. Depending on the type of window, the label
10345 may be a window title or panel item label. If parent is None, the
10346 search will start from all top-level frames and dialog boxes; if
10347 non-None, the search will be limited to the given window
10348 hierarchy. The search is recursive in both cases.
10349 """
54f9ee45 10350 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
10351
10352def Window_FromHWND(*args, **kwargs):
4276dc52 10353 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
54f9ee45 10354 return _core_.Window_FromHWND(*args, **kwargs)
b6b0383e
RD
10355
10356def GetTopLevelWindows(*args, **kwargs):
10357 """
10358 GetTopLevelWindows() -> PyObject
10359
10360 Returns a list of the the application's top-level windows, (frames,
10361 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10362 by wxWidgets, and so it is only valid as long as no top-level windows
10363 are closed or new top-level windows are created.
10364
10365 """
10366 return _core_.GetTopLevelWindows(*args, **kwargs)
e811c8ce
RD
10367#---------------------------------------------------------------------------
10368
10369class Validator(EvtHandler):
093d3ff1 10370 """Proxy of C++ Validator class"""
e811c8ce
RD
10371 def __repr__(self):
10372 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10373 def __init__(self, *args, **kwargs):
a95a7133 10374 """__init__(self) -> Validator"""
54f9ee45 10375 newobj = _core_.new_Validator(*args, **kwargs)
d14a1e28
RD
10376 self.this = newobj.this
10377 self.thisown = 1
10378 del newobj.thisown
10379 self._setOORInfo(self)
e811c8ce
RD
10380
10381 def Clone(*args, **kwargs):
a95a7133 10382 """Clone(self) -> Validator"""
54f9ee45 10383 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
10384
10385 def Validate(*args, **kwargs):
a95a7133 10386 """Validate(self, Window parent) -> bool"""
54f9ee45 10387 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
10388
10389 def TransferToWindow(*args, **kwargs):
a95a7133 10390 """TransferToWindow(self) -> bool"""
54f9ee45 10391 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
10392
10393 def TransferFromWindow(*args, **kwargs):
a95a7133 10394 """TransferFromWindow(self) -> bool"""
54f9ee45 10395 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
10396
10397 def GetWindow(*args, **kwargs):
a95a7133 10398 """GetWindow(self) -> Window"""
54f9ee45 10399 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
10400
10401 def SetWindow(*args, **kwargs):
a95a7133 10402 """SetWindow(self, Window window)"""
54f9ee45 10403 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
10404
10405 def IsSilent(*args, **kwargs):
66c033b4 10406 """IsSilent() -> bool"""
54f9ee45 10407 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
10408
10409 IsSilent = staticmethod(IsSilent)
10410 def SetBellOnError(*args, **kwargs):
66c033b4 10411 """SetBellOnError(int doIt=True)"""
54f9ee45 10412 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10413
10414 SetBellOnError = staticmethod(SetBellOnError)
10415
10416class ValidatorPtr(Validator):
10417 def __init__(self, this):
10418 self.this = this
10419 if not hasattr(self,"thisown"): self.thisown = 0
10420 self.__class__ = Validator
54f9ee45 10421_core_.Validator_swigregister(ValidatorPtr)
e811c8ce
RD
10422
10423def Validator_IsSilent(*args, **kwargs):
10424 """Validator_IsSilent() -> bool"""
54f9ee45 10425 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
10426
10427def Validator_SetBellOnError(*args, **kwargs):
10428 """Validator_SetBellOnError(int doIt=True)"""
54f9ee45 10429 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10430
10431class PyValidator(Validator):
093d3ff1 10432 """Proxy of C++ PyValidator class"""
e811c8ce
RD
10433 def __repr__(self):
10434 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10435 def __init__(self, *args, **kwargs):
a95a7133 10436 """__init__(self) -> PyValidator"""
54f9ee45 10437 newobj = _core_.new_PyValidator(*args, **kwargs)
e811c8ce
RD
10438 self.this = newobj.this
10439 self.thisown = 1
10440 del newobj.thisown
10441
10442 self._setCallbackInfo(self, PyValidator, 1)
10443 self._setOORInfo(self)
10444
10445 def _setCallbackInfo(*args, **kwargs):
a95a7133 10446 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
54f9ee45 10447 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
10448
10449
10450class PyValidatorPtr(PyValidator):
10451 def __init__(self, this):
10452 self.this = this
10453 if not hasattr(self,"thisown"): self.thisown = 0
10454 self.__class__ = PyValidator
54f9ee45 10455_core_.PyValidator_swigregister(PyValidatorPtr)
e811c8ce
RD
10456
10457#---------------------------------------------------------------------------
10458
10459class Menu(EvtHandler):
093d3ff1 10460 """Proxy of C++ Menu class"""
d14a1e28
RD
10461 def __repr__(self):
10462 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 10463 def __init__(self, *args, **kwargs):
a95a7133 10464 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
54f9ee45 10465 newobj = _core_.new_Menu(*args, **kwargs)
e811c8ce
RD
10466 self.this = newobj.this
10467 self.thisown = 1
10468 del newobj.thisown
10469 self._setOORInfo(self)
10470
10471 def Append(*args, **kwargs):
a95a7133 10472 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 10473 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
10474
10475 def AppendSeparator(*args, **kwargs):
a95a7133 10476 """AppendSeparator(self) -> MenuItem"""
54f9ee45 10477 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
10478
10479 def AppendCheckItem(*args, **kwargs):
a95a7133 10480 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10481 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
10482
10483 def AppendRadioItem(*args, **kwargs):
a95a7133 10484 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10485 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
10486
10487 def AppendMenu(*args, **kwargs):
a95a7133 10488 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10489 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce
RD
10490
10491 def AppendItem(*args, **kwargs):
a95a7133 10492 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10493 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce
RD
10494
10495 def Break(*args, **kwargs):
a95a7133 10496 """Break(self)"""
54f9ee45 10497 return _core_.Menu_Break(*args, **kwargs)
e811c8ce
RD
10498
10499 def InsertItem(*args, **kwargs):
a95a7133 10500 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 10501 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce
RD
10502
10503 def Insert(*args, **kwargs):
0df68c9f 10504 """
a95a7133 10505 Insert(self, size_t pos, int id, String text, String help=EmptyString,
a41e16b6 10506 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 10507 """
54f9ee45 10508 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
10509
10510 def InsertSeparator(*args, **kwargs):
a95a7133 10511 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 10512 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
10513
10514 def InsertCheckItem(*args, **kwargs):
a95a7133 10515 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10516 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
10517
10518 def InsertRadioItem(*args, **kwargs):
a95a7133 10519 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10520 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
10521
10522 def InsertMenu(*args, **kwargs):
a95a7133 10523 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10524 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce
RD
10525
10526 def PrependItem(*args, **kwargs):
a95a7133 10527 """PrependItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10528 return _core_.Menu_PrependItem(*args, **kwargs)
e811c8ce
RD
10529
10530 def Prepend(*args, **kwargs):
a95a7133 10531 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 10532 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
10533
10534 def PrependSeparator(*args, **kwargs):
a95a7133 10535 """PrependSeparator(self) -> MenuItem"""
54f9ee45 10536 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
10537
10538 def PrependCheckItem(*args, **kwargs):
a95a7133 10539 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10540 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
10541
10542 def PrependRadioItem(*args, **kwargs):
a95a7133 10543 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10544 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
10545
10546 def PrependMenu(*args, **kwargs):
a95a7133 10547 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10548 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
10549
10550 def Remove(*args, **kwargs):
a95a7133 10551 """Remove(self, int id) -> MenuItem"""
54f9ee45 10552 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce
RD
10553
10554 def RemoveItem(*args, **kwargs):
a95a7133 10555 """RemoveItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10556 return _core_.Menu_RemoveItem(*args, **kwargs)
e811c8ce
RD
10557
10558 def Delete(*args, **kwargs):
a95a7133 10559 """Delete(self, int id) -> bool"""
54f9ee45 10560 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
10561
10562 def DeleteItem(*args, **kwargs):
a95a7133 10563 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 10564 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
10565
10566 def Destroy(*args, **kwargs):
0df68c9f 10567 """
a95a7133 10568 Destroy(self)
e811c8ce 10569
0df68c9f
RD
10570 Deletes the C++ object this Python object is a proxy for.
10571 """
7e08d4ef
RD
10572 val = _core_.Menu_Destroy(*args, **kwargs)
10573 args[0].thisown = 0
10574 return val
e811c8ce
RD
10575
10576 def DestroyId(*args, **kwargs):
0df68c9f 10577 """
a95a7133 10578 DestroyId(self, int id) -> bool
e811c8ce 10579
0df68c9f
RD
10580 Deletes the C++ object this Python object is a proxy for.
10581 """
7e08d4ef
RD
10582 val = _core_.Menu_DestroyId(*args, **kwargs)
10583 args[0].thisown = 0
10584 return val
e811c8ce
RD
10585
10586 def DestroyItem(*args, **kwargs):
0df68c9f 10587 """
a95a7133 10588 DestroyItem(self, MenuItem item) -> bool
e811c8ce 10589
0df68c9f
RD
10590 Deletes the C++ object this Python object is a proxy for.
10591 """
7e08d4ef
RD
10592 val = _core_.Menu_DestroyItem(*args, **kwargs)
10593 args[0].thisown = 0
10594 return val
e811c8ce
RD
10595
10596 def GetMenuItemCount(*args, **kwargs):
a95a7133 10597 """GetMenuItemCount(self) -> size_t"""
54f9ee45 10598 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
10599
10600 def GetMenuItems(*args, **kwargs):
a95a7133 10601 """GetMenuItems(self) -> PyObject"""
54f9ee45 10602 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
10603
10604 def FindItem(*args, **kwargs):
a95a7133 10605 """FindItem(self, String item) -> int"""
54f9ee45 10606 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
10607
10608 def FindItemById(*args, **kwargs):
a95a7133 10609 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10610 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
10611
10612 def FindItemByPosition(*args, **kwargs):
a95a7133 10613 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 10614 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
10615
10616 def Enable(*args, **kwargs):
a95a7133 10617 """Enable(self, int id, bool enable)"""
54f9ee45 10618 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
10619
10620 def IsEnabled(*args, **kwargs):
a95a7133 10621 """IsEnabled(self, int id) -> bool"""
54f9ee45 10622 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
10623
10624 def Check(*args, **kwargs):
a95a7133 10625 """Check(self, int id, bool check)"""
54f9ee45 10626 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
10627
10628 def IsChecked(*args, **kwargs):
a95a7133 10629 """IsChecked(self, int id) -> bool"""
54f9ee45 10630 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
10631
10632 def SetLabel(*args, **kwargs):
a95a7133 10633 """SetLabel(self, int id, String label)"""
54f9ee45 10634 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
10635
10636 def GetLabel(*args, **kwargs):
a95a7133 10637 """GetLabel(self, int id) -> String"""
54f9ee45 10638 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
10639
10640 def SetHelpString(*args, **kwargs):
a95a7133 10641 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10642 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
10643
10644 def GetHelpString(*args, **kwargs):
a95a7133 10645 """GetHelpString(self, int id) -> String"""
54f9ee45 10646 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
10647
10648 def SetTitle(*args, **kwargs):
a95a7133 10649 """SetTitle(self, String title)"""
54f9ee45 10650 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
10651
10652 def GetTitle(*args, **kwargs):
a95a7133 10653 """GetTitle(self) -> String"""
54f9ee45 10654 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
10655
10656 def SetEventHandler(*args, **kwargs):
a95a7133 10657 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 10658 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
10659
10660 def GetEventHandler(*args, **kwargs):
a95a7133 10661 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 10662 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
10663
10664 def SetInvokingWindow(*args, **kwargs):
a95a7133 10665 """SetInvokingWindow(self, Window win)"""
54f9ee45 10666 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10667
10668 def GetInvokingWindow(*args, **kwargs):
a95a7133 10669 """GetInvokingWindow(self) -> Window"""
54f9ee45 10670 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10671
10672 def GetStyle(*args, **kwargs):
a95a7133 10673 """GetStyle(self) -> long"""
54f9ee45 10674 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
10675
10676 def UpdateUI(*args, **kwargs):
a95a7133 10677 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 10678 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
10679
10680 def GetMenuBar(*args, **kwargs):
a95a7133 10681 """GetMenuBar(self) -> MenuBar"""
54f9ee45 10682 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
10683
10684 def Attach(*args, **kwargs):
a95a7133 10685 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 10686 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
10687
10688 def Detach(*args, **kwargs):
a95a7133 10689 """Detach(self)"""
54f9ee45 10690 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
10691
10692 def IsAttached(*args, **kwargs):
a95a7133 10693 """IsAttached(self) -> bool"""
54f9ee45 10694 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
10695
10696 def SetParent(*args, **kwargs):
a95a7133 10697 """SetParent(self, Menu parent)"""
54f9ee45 10698 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
10699
10700 def GetParent(*args, **kwargs):
a95a7133 10701 """GetParent(self) -> Menu"""
54f9ee45 10702 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 10703
d14a1e28
RD
10704
10705class MenuPtr(Menu):
10706 def __init__(self, this):
10707 self.this = this
10708 if not hasattr(self,"thisown"): self.thisown = 0
10709 self.__class__ = Menu
54f9ee45 10710_core_.Menu_swigregister(MenuPtr)
d14a1e28
RD
10711DefaultValidator = cvar.DefaultValidator
10712
10713#---------------------------------------------------------------------------
10714
10715class MenuBar(Window):
093d3ff1 10716 """Proxy of C++ MenuBar class"""
e811c8ce
RD
10717 def __repr__(self):
10718 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10719 def __init__(self, *args, **kwargs):
a95a7133 10720 """__init__(self, long style=0) -> MenuBar"""
54f9ee45 10721 newobj = _core_.new_MenuBar(*args, **kwargs)
d14a1e28
RD
10722 self.this = newobj.this
10723 self.thisown = 1
10724 del newobj.thisown
10725 self._setOORInfo(self)
e811c8ce
RD
10726
10727 def Append(*args, **kwargs):
a95a7133 10728 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 10729 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
10730
10731 def Insert(*args, **kwargs):
a95a7133 10732 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 10733 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
10734
10735 def GetMenuCount(*args, **kwargs):
a95a7133 10736 """GetMenuCount(self) -> size_t"""
54f9ee45 10737 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
10738
10739 def GetMenu(*args, **kwargs):
a95a7133 10740 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 10741 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
10742
10743 def Replace(*args, **kwargs):
a95a7133 10744 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 10745 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
10746
10747 def Remove(*args, **kwargs):
a95a7133 10748 """Remove(self, size_t pos) -> Menu"""
54f9ee45 10749 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
10750
10751 def EnableTop(*args, **kwargs):
a95a7133 10752 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 10753 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
10754
10755 def IsEnabledTop(*args, **kwargs):
a95a7133 10756 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 10757 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
10758
10759 def SetLabelTop(*args, **kwargs):
a95a7133 10760 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 10761 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
10762
10763 def GetLabelTop(*args, **kwargs):
a95a7133 10764 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 10765 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
10766
10767 def FindMenuItem(*args, **kwargs):
a95a7133 10768 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 10769 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
10770
10771 def FindItemById(*args, **kwargs):
a95a7133 10772 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10773 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
10774
10775 def FindMenu(*args, **kwargs):
a95a7133 10776 """FindMenu(self, String title) -> int"""
54f9ee45 10777 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
10778
10779 def Enable(*args, **kwargs):
a95a7133 10780 """Enable(self, int id, bool enable)"""
54f9ee45 10781 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
10782
10783 def Check(*args, **kwargs):
a95a7133 10784 """Check(self, int id, bool check)"""
54f9ee45 10785 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
10786
10787 def IsChecked(*args, **kwargs):
a95a7133 10788 """IsChecked(self, int id) -> bool"""
54f9ee45 10789 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
10790
10791 def IsEnabled(*args, **kwargs):
a95a7133 10792 """IsEnabled(self, int id) -> bool"""
54f9ee45 10793 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
10794
10795 def SetLabel(*args, **kwargs):
a95a7133 10796 """SetLabel(self, int id, String label)"""
54f9ee45 10797 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
10798
10799 def GetLabel(*args, **kwargs):
a95a7133 10800 """GetLabel(self, int id) -> String"""
54f9ee45 10801 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
10802
10803 def SetHelpString(*args, **kwargs):
a95a7133 10804 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10805 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
10806
10807 def GetHelpString(*args, **kwargs):
a95a7133 10808 """GetHelpString(self, int id) -> String"""
54f9ee45 10809 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
10810
10811 def GetFrame(*args, **kwargs):
a95a7133 10812 """GetFrame(self) -> wxFrame"""
54f9ee45 10813 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
10814
10815 def IsAttached(*args, **kwargs):
a95a7133 10816 """IsAttached(self) -> bool"""
54f9ee45 10817 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
10818
10819 def Attach(*args, **kwargs):
a95a7133 10820 """Attach(self, wxFrame frame)"""
54f9ee45 10821 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
10822
10823 def Detach(*args, **kwargs):
a95a7133 10824 """Detach(self)"""
54f9ee45 10825 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 10826
4f433fef
RD
10827 def SetAutoWindowMenu(*args, **kwargs):
10828 """SetAutoWindowMenu(bool enable)"""
10829 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10830
10831 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10832 def GetAutoWindowMenu(*args, **kwargs):
10833 """GetAutoWindowMenu() -> bool"""
10834 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10835
10836 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
d14a1e28
RD
10837
10838class MenuBarPtr(MenuBar):
10839 def __init__(self, this):
10840 self.this = this
10841 if not hasattr(self,"thisown"): self.thisown = 0
10842 self.__class__ = MenuBar
54f9ee45 10843_core_.MenuBar_swigregister(MenuBarPtr)
d14a1e28 10844
4f433fef
RD
10845def MenuBar_SetAutoWindowMenu(*args, **kwargs):
10846 """MenuBar_SetAutoWindowMenu(bool enable)"""
10847 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10848
10849def MenuBar_GetAutoWindowMenu(*args, **kwargs):
10850 """MenuBar_GetAutoWindowMenu() -> bool"""
10851 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10852
d14a1e28
RD
10853#---------------------------------------------------------------------------
10854
10855class MenuItem(Object):
093d3ff1 10856 """Proxy of C++ MenuItem class"""
e811c8ce
RD
10857 def __repr__(self):
10858 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10859 def __init__(self, *args, **kwargs):
0df68c9f 10860 """
a95a7133 10861 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
196addbf
RD
10862 String help=EmptyString, int kind=ITEM_NORMAL,
10863 Menu subMenu=None) -> MenuItem
0df68c9f 10864 """
54f9ee45 10865 newobj = _core_.new_MenuItem(*args, **kwargs)
d14a1e28
RD
10866 self.this = newobj.this
10867 self.thisown = 1
10868 del newobj.thisown
e811c8ce 10869 def GetMenu(*args, **kwargs):
a95a7133 10870 """GetMenu(self) -> Menu"""
54f9ee45 10871 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
10872
10873 def SetMenu(*args, **kwargs):
a95a7133 10874 """SetMenu(self, Menu menu)"""
54f9ee45 10875 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
10876
10877 def SetId(*args, **kwargs):
a95a7133 10878 """SetId(self, int id)"""
54f9ee45 10879 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
10880
10881 def GetId(*args, **kwargs):
a95a7133 10882 """GetId(self) -> int"""
54f9ee45 10883 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
10884
10885 def IsSeparator(*args, **kwargs):
a95a7133 10886 """IsSeparator(self) -> bool"""
54f9ee45 10887 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
10888
10889 def SetText(*args, **kwargs):
a95a7133 10890 """SetText(self, String str)"""
54f9ee45 10891 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
10892
10893 def GetLabel(*args, **kwargs):
a95a7133 10894 """GetLabel(self) -> String"""
54f9ee45 10895 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
10896
10897 def GetText(*args, **kwargs):
a95a7133 10898 """GetText(self) -> String"""
54f9ee45 10899 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
10900
10901 def GetLabelFromText(*args, **kwargs):
66c033b4 10902 """GetLabelFromText(String text) -> String"""
54f9ee45 10903 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
10904
10905 GetLabelFromText = staticmethod(GetLabelFromText)
10906 def GetKind(*args, **kwargs):
a95a7133 10907 """GetKind(self) -> int"""
54f9ee45 10908 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 10909
a95a7133
RD
10910 def SetKind(*args, **kwargs):
10911 """SetKind(self, int kind)"""
54f9ee45 10912 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 10913
e811c8ce 10914 def SetCheckable(*args, **kwargs):
a95a7133 10915 """SetCheckable(self, bool checkable)"""
54f9ee45 10916 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
10917
10918 def IsCheckable(*args, **kwargs):
a95a7133 10919 """IsCheckable(self) -> bool"""
54f9ee45 10920 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
10921
10922 def IsSubMenu(*args, **kwargs):
a95a7133 10923 """IsSubMenu(self) -> bool"""
54f9ee45 10924 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
10925
10926 def SetSubMenu(*args, **kwargs):
a95a7133 10927 """SetSubMenu(self, Menu menu)"""
54f9ee45 10928 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
10929
10930 def GetSubMenu(*args, **kwargs):
a95a7133 10931 """GetSubMenu(self) -> Menu"""
54f9ee45 10932 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
10933
10934 def Enable(*args, **kwargs):
a95a7133 10935 """Enable(self, bool enable=True)"""
54f9ee45 10936 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
10937
10938 def IsEnabled(*args, **kwargs):
a95a7133 10939 """IsEnabled(self) -> bool"""
54f9ee45 10940 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
10941
10942 def Check(*args, **kwargs):
a95a7133 10943 """Check(self, bool check=True)"""
54f9ee45 10944 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
10945
10946 def IsChecked(*args, **kwargs):
a95a7133 10947 """IsChecked(self) -> bool"""
54f9ee45 10948 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
10949
10950 def Toggle(*args, **kwargs):
a95a7133 10951 """Toggle(self)"""
54f9ee45 10952 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
10953
10954 def SetHelp(*args, **kwargs):
a95a7133 10955 """SetHelp(self, String str)"""
54f9ee45 10956 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
10957
10958 def GetHelp(*args, **kwargs):
a95a7133 10959 """GetHelp(self) -> String"""
54f9ee45 10960 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
10961
10962 def GetAccel(*args, **kwargs):
a95a7133 10963 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 10964 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
10965
10966 def SetAccel(*args, **kwargs):
a95a7133 10967 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 10968 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce 10969
091f5bed
RD
10970 def SetBitmap(*args, **kwargs):
10971 """SetBitmap(self, Bitmap bitmap)"""
10972 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10973
10974 def GetBitmap(*args, **kwargs):
10975 """GetBitmap(self) -> Bitmap"""
10976 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10977
c1280d1e
RD
10978 def SetFont(*args, **kwargs):
10979 """SetFont(self, Font font)"""
10980 return _core_.MenuItem_SetFont(*args, **kwargs)
10981
10982 def GetFont(*args, **kwargs):
10983 """GetFont(self) -> Font"""
10984 return _core_.MenuItem_GetFont(*args, **kwargs)
10985
10986 def SetTextColour(*args, **kwargs):
10987 """SetTextColour(self, Colour colText)"""
10988 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10989
10990 def GetTextColour(*args, **kwargs):
10991 """GetTextColour(self) -> Colour"""
10992 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10993
10994 def SetBackgroundColour(*args, **kwargs):
10995 """SetBackgroundColour(self, Colour colBack)"""
10996 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10997
10998 def GetBackgroundColour(*args, **kwargs):
10999 """GetBackgroundColour(self) -> Colour"""
11000 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
11001
11002 def SetBitmaps(*args, **kwargs):
11003 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11004 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
11005
11006 def SetDisabledBitmap(*args, **kwargs):
11007 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11008 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
11009
11010 def GetDisabledBitmap(*args, **kwargs):
11011 """GetDisabledBitmap(self) -> Bitmap"""
11012 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
11013
11014 def SetMarginWidth(*args, **kwargs):
11015 """SetMarginWidth(self, int nWidth)"""
11016 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
11017
11018 def GetMarginWidth(*args, **kwargs):
11019 """GetMarginWidth(self) -> int"""
11020 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
11021
e811c8ce 11022 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 11023 """GetDefaultMarginWidth() -> int"""
54f9ee45 11024 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
11025
11026 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
11027 def IsOwnerDrawn(*args, **kwargs):
11028 """IsOwnerDrawn(self) -> bool"""
11029 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
11030
11031 def SetOwnerDrawn(*args, **kwargs):
11032 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
11033 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
11034
11035 def ResetOwnerDrawn(*args, **kwargs):
11036 """ResetOwnerDrawn(self)"""
11037 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
11038
d14a1e28
RD
11039
11040class MenuItemPtr(MenuItem):
11041 def __init__(self, this):
11042 self.this = this
11043 if not hasattr(self,"thisown"): self.thisown = 0
11044 self.__class__ = MenuItem
54f9ee45 11045_core_.MenuItem_swigregister(MenuItemPtr)
d14a1e28 11046
e811c8ce 11047def MenuItem_GetLabelFromText(*args, **kwargs):
196addbf 11048 """MenuItem_GetLabelFromText(String text) -> String"""
54f9ee45 11049 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 11050
e811c8ce
RD
11051def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
11052 """MenuItem_GetDefaultMarginWidth() -> int"""
54f9ee45 11053 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d14a1e28
RD
11054
11055#---------------------------------------------------------------------------
11056
11057class Control(Window):
15afbcd0
RD
11058 """
11059 This is the base class for a control or 'widget'.
11060
41e2b43e
RD
11061 A control is generally a small window which processes user input
11062 and/or displays one or more item of data.
15afbcd0 11063 """
e811c8ce
RD
11064 def __repr__(self):
11065 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 11066 def __init__(self, *args, **kwargs):
0df68c9f 11067 """
248ed943
RD
11068 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11069 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 11070 String name=ControlNameStr) -> Control
15afbcd0 11071
41e2b43e
RD
11072 Create a Control. Normally you should only call this from a subclass'
11073 __init__ as a plain old wx.Control is not very useful.
0df68c9f 11074 """
54f9ee45 11075 newobj = _core_.new_Control(*args, **kwargs)
d14a1e28
RD
11076 self.this = newobj.this
11077 self.thisown = 1
11078 del newobj.thisown
11079 self._setOORInfo(self)
e811c8ce
RD
11080
11081 def Create(*args, **kwargs):
0df68c9f 11082 """
248ed943
RD
11083 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11084 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 11085 String name=ControlNameStr) -> bool
15afbcd0
RD
11086
11087 Do the 2nd phase and create the GUI control.
0df68c9f 11088 """
54f9ee45 11089 return _core_.Control_Create(*args, **kwargs)
e811c8ce
RD
11090
11091 def Command(*args, **kwargs):
15afbcd0 11092 """
a95a7133 11093 Command(self, CommandEvent event)
15afbcd0 11094
41e2b43e
RD
11095 Simulates the effect of the user issuing a command to the item.
11096
11097 :see: `wx.CommandEvent`
11098
15afbcd0 11099 """
54f9ee45 11100 return _core_.Control_Command(*args, **kwargs)
e811c8ce
RD
11101
11102 def GetLabel(*args, **kwargs):
15afbcd0 11103 """
a95a7133 11104 GetLabel(self) -> String
15afbcd0
RD
11105
11106 Return a control's text.
11107 """
54f9ee45 11108 return _core_.Control_GetLabel(*args, **kwargs)
e811c8ce
RD
11109
11110 def SetLabel(*args, **kwargs):
15afbcd0 11111 """
a95a7133 11112 SetLabel(self, String label)
15afbcd0
RD
11113
11114 Sets the item's text.
11115 """
54f9ee45 11116 return _core_.Control_SetLabel(*args, **kwargs)
e811c8ce 11117
74a57fcd 11118 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
11119 """
11120 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11121
11122 Get the default attributes for this class. This is useful if you want
11123 to use the same font or colour in your own control as in a standard
11124 control -- which is a much better idea than hard coding specific
11125 colours or fonts which might look completely out of place on the
11126 user's system, especially if it uses themes.
11127
11128 The variant parameter is only relevant under Mac currently and is
11129 ignore under other platforms. Under Mac, it will change the size of
11130 the returned font. See `wx.Window.SetWindowVariant` for more about
11131 this.
11132 """
54f9ee45 11133 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
11134
11135 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
d14a1e28
RD
11136
11137class ControlPtr(Control):
11138 def __init__(self, this):
11139 self.this = this
11140 if not hasattr(self,"thisown"): self.thisown = 0
11141 self.__class__ = Control
54f9ee45 11142_core_.Control_swigregister(ControlPtr)
b2dc1044 11143ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
11144
11145def PreControl(*args, **kwargs):
15afbcd0
RD
11146 """
11147 PreControl() -> Control
11148
11149 Precreate a Control control for 2-phase creation
11150 """
54f9ee45 11151 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
11152 val.thisown = 1
11153 return val
11154
74a57fcd 11155def Control_GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
11156 """
11157 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11158
11159 Get the default attributes for this class. This is useful if you want
11160 to use the same font or colour in your own control as in a standard
11161 control -- which is a much better idea than hard coding specific
11162 colours or fonts which might look completely out of place on the
11163 user's system, especially if it uses themes.
11164
11165 The variant parameter is only relevant under Mac currently and is
11166 ignore under other platforms. Under Mac, it will change the size of
11167 the returned font. See `wx.Window.SetWindowVariant` for more about
11168 this.
11169 """
54f9ee45 11170 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 11171
d14a1e28
RD
11172#---------------------------------------------------------------------------
11173
11174class ItemContainer(object):
15afbcd0 11175 """
53aa7709
RD
11176 The wx.ItemContainer class defines an interface which is implemented
11177 by all controls which have string subitems, each of which may be
11178 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11179 as `wx.ComboBox` which implements an extended interface deriving from
41e2b43e 11180 this one.
15afbcd0 11181
41e2b43e
RD
11182 It defines the methods for accessing the control's items and although
11183 each of the derived classes implements them differently, they still
11184 all conform to the same interface.
15afbcd0 11185
41e2b43e
RD
11186 The items in a wx.ItemContainer have (non empty) string labels and,
11187 optionally, client data associated with them.
15afbcd0
RD
11188
11189 """
d14a1e28
RD
11190 def __init__(self): raise RuntimeError, "No constructor defined"
11191 def __repr__(self):
11192 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 11193 def Append(*args, **kwargs):
15afbcd0 11194 """
a95a7133 11195 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 11196
41e2b43e
RD
11197 Adds the item to the control, associating the given data with the item
11198 if not None. The return value is the index of the newly added item
11199 which may be different from the last one if the control is sorted (e.g.
11200 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 11201 """
54f9ee45 11202 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
11203
11204 def AppendItems(*args, **kwargs):
15afbcd0 11205 """
f5b96ee1 11206 AppendItems(self, List strings)
15afbcd0 11207
41e2b43e
RD
11208 Apend several items at once to the control. Notice that calling this
11209 method may be much faster than appending the items one by one if you
11210 need to add a lot of items.
15afbcd0 11211 """
54f9ee45 11212 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
11213
11214 def Insert(*args, **kwargs):
15afbcd0 11215 """
a95a7133 11216 Insert(self, String item, int pos, PyObject clientData=None) -> int
15afbcd0 11217
41e2b43e 11218 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
11219 optionally associating some data object with the item.
11220 """
54f9ee45 11221 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
11222
11223 def Clear(*args, **kwargs):
15afbcd0 11224 """
a95a7133 11225 Clear(self)
15afbcd0
RD
11226
11227 Removes all items from the control.
11228 """
54f9ee45 11229 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
11230
11231 def Delete(*args, **kwargs):
15afbcd0 11232 """
a95a7133 11233 Delete(self, int n)
15afbcd0 11234
41e2b43e
RD
11235 Deletes the item at the zero-based index 'n' from the control. Note
11236 that it is an error (signalled by a `wx.PyAssertionError` exception if
11237 enabled) to remove an item with the index negative or greater or equal
11238 than the number of items in the control.
15afbcd0 11239 """
54f9ee45 11240 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce 11241
53aa7709
RD
11242 def GetClientData(*args, **kwargs):
11243 """
11244 GetClientData(self, int n) -> PyObject
11245
11246 Returns the client data associated with the given item, (if any.)
11247 """
11248 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11249
11250 def SetClientData(*args, **kwargs):
11251 """
11252 SetClientData(self, int n, PyObject clientData)
11253
11254 Associate the given client data with the item at position n.
11255 """
11256 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11257
e811c8ce 11258 def GetCount(*args, **kwargs):
15afbcd0 11259 """
a95a7133 11260 GetCount(self) -> int
15afbcd0
RD
11261
11262 Returns the number of items in the control.
11263 """
54f9ee45 11264 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
11265
11266 def IsEmpty(*args, **kwargs):
15afbcd0 11267 """
a95a7133 11268 IsEmpty(self) -> bool
15afbcd0
RD
11269
11270 Returns True if the control is empty or False if it has some items.
11271 """
54f9ee45 11272 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
11273
11274 def GetString(*args, **kwargs):
15afbcd0 11275 """
a95a7133 11276 GetString(self, int n) -> String
15afbcd0
RD
11277
11278 Returns the label of the item with the given index.
11279 """
54f9ee45 11280 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
11281
11282 def GetStrings(*args, **kwargs):
a95a7133 11283 """GetStrings(self) -> wxArrayString"""
54f9ee45 11284 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
11285
11286 def SetString(*args, **kwargs):
15afbcd0 11287 """
a95a7133 11288 SetString(self, int n, String s)
15afbcd0
RD
11289
11290 Sets the label for the given item.
11291 """
54f9ee45 11292 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
11293
11294 def FindString(*args, **kwargs):
15afbcd0 11295 """
a95a7133 11296 FindString(self, String s) -> int
15afbcd0
RD
11297
11298 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
11299 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11300 found.
15afbcd0 11301 """
54f9ee45 11302 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce 11303
53aa7709 11304 def SetSelection(*args, **kwargs):
15afbcd0 11305 """
53aa7709 11306 SetSelection(self, int n)
15afbcd0
RD
11307
11308 Sets the item at index 'n' to be the selected item.
11309 """
53aa7709 11310 return _core_.ItemContainer_SetSelection(*args, **kwargs)
e811c8ce
RD
11311
11312 def GetSelection(*args, **kwargs):
15afbcd0 11313 """
a95a7133 11314 GetSelection(self) -> int
15afbcd0 11315
41e2b43e
RD
11316 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11317 is selected.
15afbcd0 11318 """
54f9ee45 11319 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce 11320
53aa7709
RD
11321 def SetStringSelection(*args, **kwargs):
11322 """SetStringSelection(self, String s) -> bool"""
11323 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11324
e811c8ce 11325 def GetStringSelection(*args, **kwargs):
15afbcd0 11326 """
a95a7133 11327 GetStringSelection(self) -> String
15afbcd0 11328
41e2b43e
RD
11329 Returns the label of the selected item or an empty string if no item
11330 is selected.
15afbcd0 11331 """
54f9ee45 11332 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce 11333
53aa7709 11334 def Select(*args, **kwargs):
15afbcd0 11335 """
53aa7709 11336 Select(self, int n)
15afbcd0 11337
53aa7709
RD
11338 This is the same as `SetSelection` and exists only because it is
11339 slightly more natural for controls which support multiple selection.
15afbcd0 11340 """
53aa7709 11341 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 11342
d14a1e28
RD
11343
11344class ItemContainerPtr(ItemContainer):
11345 def __init__(self, this):
11346 self.this = this
11347 if not hasattr(self,"thisown"): self.thisown = 0
11348 self.__class__ = ItemContainer
54f9ee45 11349_core_.ItemContainer_swigregister(ItemContainerPtr)
d14a1e28
RD
11350
11351#---------------------------------------------------------------------------
11352
11353class ControlWithItems(Control,ItemContainer):
15afbcd0 11354 """
41e2b43e
RD
11355 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11356 wx.Control class, and is used for the base class of various controls
11357 that have items.
15afbcd0 11358 """
d14a1e28
RD
11359 def __init__(self): raise RuntimeError, "No constructor defined"
11360 def __repr__(self):
11361 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
11362
11363class ControlWithItemsPtr(ControlWithItems):
11364 def __init__(self, this):
11365 self.this = this
11366 if not hasattr(self,"thisown"): self.thisown = 0
11367 self.__class__ = ControlWithItems
54f9ee45 11368_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
d14a1e28
RD
11369
11370#---------------------------------------------------------------------------
11371
11372class SizerItem(Object):
248ed943
RD
11373 """
11374 The wx.SizerItem class is used to track the position, size and other
11375 attributes of each item managed by a `wx.Sizer`. In normal usage user
11376 code should never need to deal directly with a wx.SizerItem, but
11377 custom classes derived from `wx.PySizer` will probably need to use the
11378 collection of wx.SizerItems held by wx.Sizer when calculating layout.
11379
11380 :see: `wx.Sizer`, `wx.GBSizerItem`
11381 """
e811c8ce
RD
11382 def __repr__(self):
11383 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 11384 def __init__(self, *args, **kwargs):
248ed943
RD
11385 """
11386 __init__(self) -> SizerItem
11387
11388 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11389 size will need to be set before this item can be used in a Sizer.
11390
11391 You will probably never need to create a wx.SizerItem directly as they
11392 are created automatically when the sizer's Add, Insert or Prepend
11393 methods are called.
11394
11395 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11396 """
54f9ee45 11397 newobj = _core_.new_SizerItem(*args, **kwargs)
d14a1e28
RD
11398 self.this = newobj.this
11399 self.thisown = 1
11400 del newobj.thisown
7e08d4ef
RD
11401 def __del__(self, destroy=_core_.delete_SizerItem):
11402 """__del__(self)"""
11403 try:
11404 if self.thisown: destroy(self)
11405 except: pass
11406
e811c8ce 11407 def DeleteWindows(*args, **kwargs):
248ed943
RD
11408 """
11409 DeleteWindows(self)
11410
11411 Destroy the window or the windows in a subsizer, depending on the type
11412 of item.
11413 """
54f9ee45 11414 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
11415
11416 def DetachSizer(*args, **kwargs):
248ed943
RD
11417 """
11418 DetachSizer(self)
11419
11420 Enable deleting the SizerItem without destroying the contained sizer.
11421 """
54f9ee45 11422 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
11423
11424 def GetSize(*args, **kwargs):
248ed943
RD
11425 """
11426 GetSize(self) -> Size
11427
11428 Get the current size of the item, as set in the last Layout.
11429 """
54f9ee45 11430 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
11431
11432 def CalcMin(*args, **kwargs):
248ed943
RD
11433 """
11434 CalcMin(self) -> Size
11435
11436 Calculates the minimum desired size for the item, including any space
11437 needed by borders.
11438 """
54f9ee45 11439 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
11440
11441 def SetDimension(*args, **kwargs):
248ed943
RD
11442 """
11443 SetDimension(self, Point pos, Size size)
11444
11445 Set the position and size of the space allocated for this item by the
11446 sizer, and adjust the position and size of the item (window or
11447 subsizer) to be within that space taking alignment and borders into
11448 account.
11449 """
54f9ee45 11450 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
11451
11452 def GetMinSize(*args, **kwargs):
248ed943
RD
11453 """
11454 GetMinSize(self) -> Size
11455
11456 Get the minimum size needed for the item.
11457 """
54f9ee45 11458 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 11459
dfbb5885
RD
11460 def GetMinSizeWithBorder(*args, **kwargs):
11461 """
11462 GetMinSizeWithBorder(self) -> Size
11463
11464 Get the minimum size needed for the item with space for the borders
11465 added, if needed.
11466 """
11467 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11468
e811c8ce 11469 def SetInitSize(*args, **kwargs):
a95a7133 11470 """SetInitSize(self, int x, int y)"""
54f9ee45 11471 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
11472
11473 def SetRatioWH(*args, **kwargs):
248ed943
RD
11474 """
11475 SetRatioWH(self, int width, int height)
11476
11477 Set the ratio item attribute.
11478 """
54f9ee45 11479 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
11480
11481 def SetRatioSize(*args, **kwargs):
248ed943
RD
11482 """
11483 SetRatioSize(self, Size size)
11484
11485 Set the ratio item attribute.
11486 """
54f9ee45 11487 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
11488
11489 def SetRatio(*args, **kwargs):
248ed943
RD
11490 """
11491 SetRatio(self, float ratio)
11492
11493 Set the ratio item attribute.
11494 """
54f9ee45 11495 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
11496
11497 def GetRatio(*args, **kwargs):
248ed943
RD
11498 """
11499 GetRatio(self) -> float
11500
11501 Set the ratio item attribute.
11502 """
54f9ee45 11503 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 11504
d3b6e4ff
RD
11505 def GetRect(*args, **kwargs):
11506 """
11507 GetRect(self) -> Rect
11508
11509 Returns the rectangle that the sizer item should occupy
11510 """
11511 return _core_.SizerItem_GetRect(*args, **kwargs)
11512
e811c8ce 11513 def IsWindow(*args, **kwargs):
248ed943
RD
11514 """
11515 IsWindow(self) -> bool
11516
11517 Is this sizer item a window?
11518 """
54f9ee45 11519 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
11520
11521 def IsSizer(*args, **kwargs):
248ed943
RD
11522 """
11523 IsSizer(self) -> bool
11524
11525 Is this sizer item a subsizer?
11526 """
54f9ee45 11527 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
11528
11529 def IsSpacer(*args, **kwargs):
248ed943
RD
11530 """
11531 IsSpacer(self) -> bool
11532
11533 Is this sizer item a spacer?
11534 """
54f9ee45 11535 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
11536
11537 def SetProportion(*args, **kwargs):
248ed943
RD
11538 """
11539 SetProportion(self, int proportion)
11540
11541 Set the proportion value for this item.
11542 """
54f9ee45 11543 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
11544
11545 def GetProportion(*args, **kwargs):
248ed943
RD
11546 """
11547 GetProportion(self) -> int
11548
11549 Get the proportion value for this item.
11550 """
54f9ee45 11551 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 11552
248ed943
RD
11553 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11554 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 11555 def SetFlag(*args, **kwargs):
248ed943
RD
11556 """
11557 SetFlag(self, int flag)
11558
11559 Set the flag value for this item.
11560 """
54f9ee45 11561 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
11562
11563 def GetFlag(*args, **kwargs):
248ed943
RD
11564 """
11565 GetFlag(self) -> int
11566
11567 Get the flag value for this item.
11568 """
54f9ee45 11569 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
11570
11571 def SetBorder(*args, **kwargs):
248ed943
RD
11572 """
11573 SetBorder(self, int border)
11574
11575 Set the border value for this item.
11576 """
54f9ee45 11577 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
11578
11579 def GetBorder(*args, **kwargs):
248ed943
RD
11580 """
11581 GetBorder(self) -> int
11582
11583 Get the border value for this item.
11584 """
54f9ee45 11585 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
11586
11587 def GetWindow(*args, **kwargs):
248ed943
RD
11588 """
11589 GetWindow(self) -> Window
11590
11591 Get the window (if any) that is managed by this sizer item.
11592 """
54f9ee45 11593 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce
RD
11594
11595 def SetWindow(*args, **kwargs):
248ed943
RD
11596 """
11597 SetWindow(self, Window window)
11598
11599 Set the window to be managed by this sizer item.
11600 """
54f9ee45 11601 return _core_.SizerItem_SetWindow(*args, **kwargs)
e811c8ce
RD
11602
11603 def GetSizer(*args, **kwargs):
248ed943
RD
11604 """
11605 GetSizer(self) -> Sizer
11606
11607 Get the subsizer (if any) that is managed by this sizer item.
11608 """
54f9ee45 11609 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce
RD
11610
11611 def SetSizer(*args, **kwargs):
248ed943
RD
11612 """
11613 SetSizer(self, Sizer sizer)
11614
11615 Set the subsizer to be managed by this sizer item.
11616 """
54f9ee45 11617 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce
RD
11618
11619 def GetSpacer(*args, **kwargs):
248ed943
RD
11620 """
11621 GetSpacer(self) -> Size
11622
11623 Get the size of the spacer managed by this sizer item.
11624 """
54f9ee45 11625 return _core_.SizerItem_GetSpacer(*args, **kwargs)
e811c8ce
RD
11626
11627 def SetSpacer(*args, **kwargs):
248ed943
RD
11628 """
11629 SetSpacer(self, Size size)
11630
11631 Set the size of the spacer to be managed by this sizer item.
11632 """
54f9ee45 11633 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce
RD
11634
11635 def Show(*args, **kwargs):
248ed943
RD
11636 """
11637 Show(self, bool show)
11638
11639 Set the show item attribute, which sizers use to determine if the item
11640 is to be made part of the layout or not. If the item is tracking a
11641 window then it is shown or hidden as needed.
11642 """
54f9ee45 11643 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
11644
11645 def IsShown(*args, **kwargs):
248ed943
RD
11646 """
11647 IsShown(self) -> bool
11648
11649 Is the item to be shown in the layout?
11650 """
54f9ee45 11651 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
11652
11653 def GetPosition(*args, **kwargs):
248ed943
RD
11654 """
11655 GetPosition(self) -> Point
11656
11657 Returns the current position of the item, as set in the last Layout.
11658 """
54f9ee45 11659 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
11660
11661 def GetUserData(*args, **kwargs):
248ed943
RD
11662 """
11663 GetUserData(self) -> PyObject
11664
11665 Returns the userData associated with this sizer item, or None if there
11666 isn't any.
11667 """
54f9ee45 11668 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 11669
091f5bed
RD
11670 def SetUserData(*args, **kwargs):
11671 """
11672 SetUserData(self, PyObject userData)
11673
11674 Associate a Python object with this sizer item.
11675 """
11676 return _core_.SizerItem_SetUserData(*args, **kwargs)
11677
d14a1e28
RD
11678
11679class SizerItemPtr(SizerItem):
11680 def __init__(self, this):
11681 self.this = this
11682 if not hasattr(self,"thisown"): self.thisown = 0
11683 self.__class__ = SizerItem
54f9ee45 11684_core_.SizerItem_swigregister(SizerItemPtr)
d14a1e28 11685
248ed943 11686def SizerItemWindow(*args, **kwargs):
0df68c9f 11687 """
248ed943
RD
11688 SizerItemWindow(Window window, int proportion, int flag, int border,
11689 PyObject userData=None) -> SizerItem
11690
11691 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 11692 """
248ed943 11693 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
11694 val.thisown = 1
11695 return val
11696
248ed943 11697def SizerItemSpacer(*args, **kwargs):
0df68c9f 11698 """
248ed943
RD
11699 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11700 PyObject userData=None) -> SizerItem
11701
11702 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 11703 """
248ed943 11704 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
11705 val.thisown = 1
11706 return val
11707
11708def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
11709 """
11710 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
11711 PyObject userData=None) -> SizerItem
11712
11713 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 11714 """
54f9ee45 11715 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
11716 val.thisown = 1
11717 return val
11718
11719class Sizer(Object):
248ed943
RD
11720 """
11721 wx.Sizer is the abstract base class used for laying out subwindows in
11722 a window. You cannot use wx.Sizer directly; instead, you will have to
11723 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11724 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11725 and `wx.GridBagSizer`.
11726
11727 The concept implemented by sizers in wxWidgets is closely related to
11728 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11729 toolkit or the Qt toolkit. It is based upon the idea of the individual
11730 subwindows reporting their minimal required size and their ability to
11731 get stretched if the size of the parent window has changed. This will
11732 most often mean that the programmer does not set the original size of
11733 a dialog in the beginning, rather the dialog will assigned a sizer and
11734 this sizer will be queried about the recommended size. The sizer in
11735 turn will query its children, which can be normal windows or contorls,
11736 empty space or other sizers, so that a hierarchy of sizers can be
11737 constructed. Note that wxSizer does not derive from wxWindow and thus
11738 do not interfere with tab ordering and requires very little resources
11739 compared to a real window on screen.
11740
11741 What makes sizers so well fitted for use in wxWidgets is the fact that
11742 every control reports its own minimal size and the algorithm can
11743 handle differences in font sizes or different window (dialog item)
11744 sizes on different platforms without problems. If for example the
11745 standard font as well as the overall design of Mac widgets requires
11746 more space than on Windows, then the initial size of a dialog using a
11747 sizer will automatically be bigger on Mac than on Windows.
11748 """
e811c8ce
RD
11749 def __init__(self): raise RuntimeError, "No constructor defined"
11750 def __repr__(self):
11751 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7e08d4ef
RD
11752 def __del__(self, destroy=_core_.delete_Sizer):
11753 """__del__(self)"""
11754 try:
11755 if self.thisown: destroy(self)
11756 except: pass
11757
e811c8ce 11758 def _setOORInfo(*args, **kwargs):
a95a7133 11759 """_setOORInfo(self, PyObject _self)"""
54f9ee45 11760 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
11761
11762 def Add(*args, **kwargs):
0df68c9f 11763 """
248ed943 11764 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11765 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11766
11767 Appends a child item to the sizer.
0df68c9f 11768 """
54f9ee45 11769 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce
RD
11770
11771 def Insert(*args, **kwargs):
0df68c9f 11772 """
248ed943 11773 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11774 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11775
11776 Inserts a new item into the list of items managed by this sizer before
11777 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 11778 """
54f9ee45 11779 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce
RD
11780
11781 def Prepend(*args, **kwargs):
0df68c9f 11782 """
248ed943 11783 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11784 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11785
11786 Adds a new item to the begining of the list of sizer items managed by
11787 this sizer. See `Add` for a description of the parameters.
0df68c9f 11788 """
54f9ee45 11789 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce
RD
11790
11791 def Remove(*args, **kwargs):
248ed943
RD
11792 """
11793 Remove(self, item) -> bool
11794
11795 Removes an item from the sizer and destroys it. This method does not
11796 cause any layout or resizing to take place, call `Layout` to update
11797 the layout on screen after removing a child from the sizer. The
11798 *item* parameter can be either a window, a sizer, or the zero-based
11799 index of an item to remove. Returns True if the child item was found
11800 and removed.
11801 """
54f9ee45 11802 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 11803
1c0f361b 11804 def Detach(*args, **kwargs):
248ed943
RD
11805 """
11806 Detach(self, item) -> bool
11807
11808 Detaches an item from the sizer without destroying it. This method
11809 does not cause any layout or resizing to take place, call `Layout` to
11810 do so. The *item* parameter can be either a window, a sizer, or the
11811 zero-based index of the item to be detached. Returns True if the child item
11812 was found and detached.
11813 """
1c0f361b
RD
11814 return _core_.Sizer_Detach(*args, **kwargs)
11815
d3b6e4ff
RD
11816 def GetItem(*args, **kwargs):
11817 """
11818 GetItem(self, item) -> wx.SizerItem
11819
11820 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11821 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11822 the item to be found.
d3b6e4ff
RD
11823 """
11824 return _core_.Sizer_GetItem(*args, **kwargs)
11825
e811c8ce 11826 def _SetItemMinSize(*args, **kwargs):
a95a7133 11827 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 11828 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 11829
248ed943
RD
11830 def SetItemMinSize(self, item, *args):
11831 """
11832 SetItemMinSize(self, item, Size size)
11833
11834 Sets the minimum size that will be allocated for an item in the sizer.
11835 The *item* parameter can be either a window, a sizer, or the
11836 zero-based index of the item. If a window or sizer is given then it
11837 will be searched for recursivly in subsizers if neccessary.
11838 """
11839 if len(args) == 2:
11840 # for backward compatibility accept separate width,height args too
11841 return self._SetItemMinSize(item, args)
11842 else:
11843 return self._SetItemMinSize(item, args[0])
11844
e811c8ce 11845 def AddItem(*args, **kwargs):
248ed943
RD
11846 """
11847 AddItem(self, SizerItem item)
11848
11849 Adds a `wx.SizerItem` to the sizer.
11850 """
54f9ee45 11851 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
11852
11853 def InsertItem(*args, **kwargs):
248ed943
RD
11854 """
11855 InsertItem(self, int index, SizerItem item)
11856
11857 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11858 """
54f9ee45 11859 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
11860
11861 def PrependItem(*args, **kwargs):
248ed943
RD
11862 """
11863 PrependItem(self, SizerItem item)
11864
11865 Prepends a `wx.SizerItem` to the sizer.
11866 """
54f9ee45 11867 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 11868
248ed943 11869 def AddMany(self, items):
66c033b4
RD
11870 """
11871 AddMany is a convenience method for adding several items
11872 to a sizer at one time. Simply pass it a list of tuples,
11873 where each tuple consists of the parameters that you
11874 would normally pass to the `Add` method.
11875 """
248ed943
RD
11876 for item in items:
11877 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11878 item = (item, )
11879 self.Add(*item)
d14a1e28 11880
74e96f3d 11881 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11882 def AddWindow(self, *args, **kw):
11883 """Compatibility alias for `Add`."""
11884 return self.Add(*args, **kw)
11885 def AddSizer(self, *args, **kw):
11886 """Compatibility alias for `Add`."""
11887 return self.Add(*args, **kw)
11888 def AddSpacer(self, *args, **kw):
11889 """Compatibility alias for `Add`."""
11890 return self.Add(*args, **kw)
11891
11892 def PrependWindow(self, *args, **kw):
11893 """Compatibility alias for `Prepend`."""
11894 return self.Prepend(*args, **kw)
11895 def PrependSizer(self, *args, **kw):
11896 """Compatibility alias for `Prepend`."""
11897 return self.Prepend(*args, **kw)
11898 def PrependSpacer(self, *args, **kw):
11899 """Compatibility alias for `Prepend`."""
11900 return self.Prepend(*args, **kw)
11901
11902 def InsertWindow(self, *args, **kw):
11903 """Compatibility alias for `Insert`."""
11904 return self.Insert(*args, **kw)
11905 def InsertSizer(self, *args, **kw):
11906 """Compatibility alias for `Insert`."""
11907 return self.Insert(*args, **kw)
11908 def InsertSpacer(self, *args, **kw):
11909 """Compatibility alias for `Insert`."""
11910 return self.Insert(*args, **kw)
11911
11912 def RemoveWindow(self, *args, **kw):
11913 """Compatibility alias for `Remove`."""
11914 return self.Remove(*args, **kw)
11915 def RemoveSizer(self, *args, **kw):
11916 """Compatibility alias for `Remove`."""
11917 return self.Remove(*args, **kw)
11918 def RemovePos(self, *args, **kw):
11919 """Compatibility alias for `Remove`."""
11920 return self.Remove(*args, **kw)
d14a1e28
RD
11921
11922
e811c8ce 11923 def SetDimension(*args, **kwargs):
248ed943
RD
11924 """
11925 SetDimension(self, int x, int y, int width, int height)
11926
11927 Call this to force the sizer to take the given dimension and thus
11928 force the items owned by the sizer to resize themselves according to
11929 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11930 methods.
11931 """
54f9ee45 11932 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
11933
11934 def SetMinSize(*args, **kwargs):
248ed943
RD
11935 """
11936 SetMinSize(self, Size size)
11937
11938 Call this to give the sizer a minimal size. Normally, the sizer will
11939 calculate its minimal size based purely on how much space its children
11940 need. After calling this method `GetMinSize` will return either the
11941 minimal size as requested by its children or the minimal size set
11942 here, depending on which is bigger.
11943 """
54f9ee45 11944 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
11945
11946 def GetSize(*args, **kwargs):
248ed943
RD
11947 """
11948 GetSize(self) -> Size
11949
11950 Returns the current size of the space managed by the sizer.
11951 """
54f9ee45 11952 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
11953
11954 def GetPosition(*args, **kwargs):
248ed943
RD
11955 """
11956 GetPosition(self) -> Point
11957
11958 Returns the current position of the sizer's managed space.
11959 """
54f9ee45 11960 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
11961
11962 def GetMinSize(*args, **kwargs):
248ed943
RD
11963 """
11964 GetMinSize(self) -> Size
11965
11966 Returns the minimal size of the sizer. This is either the combined
11967 minimal size of all the children and their borders or the minimal size
11968 set by SetMinSize, depending on which is bigger.
11969 """
54f9ee45 11970 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 11971
d14a1e28 11972 def GetSizeTuple(self):
1c0f361b 11973 return self.GetSize().Get()
d14a1e28 11974 def GetPositionTuple(self):
1c0f361b 11975 return self.GetPosition().Get()
d14a1e28 11976 def GetMinSizeTuple(self):
1c0f361b 11977 return self.GetMinSize().Get()
d14a1e28 11978
e811c8ce 11979 def RecalcSizes(*args, **kwargs):
248ed943
RD
11980 """
11981 RecalcSizes(self)
11982
11983 Using the sizes calculated by `CalcMin` reposition and resize all the
11984 items managed by this sizer. You should not need to call this directly as
11985 it is called by `Layout`.
11986 """
54f9ee45 11987 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
11988
11989 def CalcMin(*args, **kwargs):
248ed943
RD
11990 """
11991 CalcMin(self) -> Size
11992
11993 This method is where the sizer will do the actual calculation of its
11994 children's minimal sizes. You should not need to call this directly as
11995 it is called by `Layout`.
11996 """
54f9ee45 11997 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
11998
11999 def Layout(*args, **kwargs):
248ed943
RD
12000 """
12001 Layout(self)
12002
12003 This method will force the recalculation and layout of the items
12004 controlled by the sizer using the current space allocated to the
12005 sizer. Normally this is called automatically from the owning window's
12006 EVT_SIZE handler, but it is also useful to call it from user code when
12007 one of the items in a sizer change size, or items are added or
12008 removed.
12009 """
54f9ee45 12010 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
12011
12012 def Fit(*args, **kwargs):
248ed943
RD
12013 """
12014 Fit(self, Window window) -> Size
12015
12016 Tell the sizer to resize the *window* to match the sizer's minimal
12017 size. This is commonly done in the constructor of the window itself in
12018 order to set its initial size to match the needs of the children as
12019 determined by the sizer. Returns the new size.
12020
12021 For a top level window this is the total window size, not the client size.
12022 """
54f9ee45 12023 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
12024
12025 def FitInside(*args, **kwargs):
248ed943
RD
12026 """
12027 FitInside(self, Window window)
12028
12029 Tell the sizer to resize the *virtual size* of the *window* to match the
12030 sizer's minimal size. This will not alter the on screen size of the
12031 window, but may cause the addition/removal/alteration of scrollbars
12032 required to view the virtual area in windows which manage it.
12033
12034 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12035
12036 """
54f9ee45 12037 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
12038
12039 def SetSizeHints(*args, **kwargs):
248ed943
RD
12040 """
12041 SetSizeHints(self, Window window)
12042
12043 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12044 match the sizer's minimal size. This is commonly done in the
12045 constructor of the window itself if the window is resizable (as are
12046 many dialogs under Unix and frames on probably all platforms) in order
12047 to prevent the window from being sized smaller than the minimal size
12048 required by the sizer.
12049 """
54f9ee45 12050 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
12051
12052 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
12053 """
12054 SetVirtualSizeHints(self, Window window)
12055
12056 Tell the sizer to set the minimal size of the window virtual area to
12057 match the sizer's minimal size. For windows with managed scrollbars
12058 this will set them appropriately.
12059
12060 :see: `wx.ScrolledWindow.SetScrollbars`
12061
12062 """
54f9ee45 12063 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
12064
12065 def Clear(*args, **kwargs):
248ed943
RD
12066 """
12067 Clear(self, bool deleteWindows=False)
12068
12069 Clear all items from the sizer, optionally destroying the window items
12070 as well.
12071 """
54f9ee45 12072 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
12073
12074 def DeleteWindows(*args, **kwargs):
248ed943
RD
12075 """
12076 DeleteWindows(self)
12077
12078 Destroy all windows managed by the sizer.
12079 """
54f9ee45 12080 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
12081
12082 def GetChildren(*args, **kwargs):
248ed943 12083 """
51b83b37 12084 GetChildren(self) -> list
248ed943
RD
12085
12086 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12087 """
54f9ee45 12088 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
12089
12090 def Show(*args, **kwargs):
248ed943 12091 """
ae8162c8 12092 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 12093
248ed943
RD
12094 Shows or hides an item managed by the sizer. To make a sizer item
12095 disappear or reappear, use Show followed by `Layout`. The *item*
12096 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
12097 the item. Use the recursive parameter to show or hide an item in a
12098 subsizer. Returns True if the item was found.
248ed943
RD
12099 """
12100 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
12101
12102 def IsShown(*args, **kwargs):
248ed943
RD
12103 """
12104 IsShown(self, item)
12105
b1fcee84 12106 Determines if the item is currently shown. To make a sizer
248ed943
RD
12107 item disappear or reappear, use Show followed by `Layout`. The *item*
12108 parameter can be either a window, a sizer, or the zero-based index of
12109 the item.
12110 """
54f9ee45 12111 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 12112
7e63a440 12113 def Hide(self, item, recursive=False):
248ed943 12114 """
27fb7603 12115 A convenience method for `Show` (item, False, recursive).
248ed943 12116 """
06759a38 12117 return self.Show(item, False, recursive)
248ed943 12118
e811c8ce 12119 def ShowItems(*args, **kwargs):
248ed943
RD
12120 """
12121 ShowItems(self, bool show)
12122
84f85550 12123 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 12124 """
54f9ee45 12125 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 12126
d14a1e28
RD
12127
12128class SizerPtr(Sizer):
12129 def __init__(self, this):
12130 self.this = this
12131 if not hasattr(self,"thisown"): self.thisown = 0
12132 self.__class__ = Sizer
54f9ee45 12133_core_.Sizer_swigregister(SizerPtr)
d14a1e28
RD
12134
12135class PySizer(Sizer):
248ed943
RD
12136 """
12137 wx.PySizer is a special version of `wx.Sizer` that has been
12138 instrumented to allow the C++ virtual methods to be overloaded in
12139 Python derived classes. You would derive from this class if you are
12140 wanting to implement a custom sizer in Python code. Simply implement
12141 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12142 For example::
12143
12144 class MySizer(wx.PySizer):
12145 def __init__(self):
12146 wx.PySizer.__init__(self)
12147
12148 def CalcMin(self):
12149 for item in self.GetChildren():
12150 # calculate the total minimum width and height needed
12151 # by all items in the sizer according to this sizer's
12152 # layout algorithm.
12153 ...
12154 return wx.Size(width, height)
12155
12156 def RecalcSizes(self):
12157 # find the space allotted to this sizer
12158 pos = self.GetPosition()
12159 size = self.GetSize()
12160 for item in self.GetChildren():
12161 # Recalculate (if necessary) the position and size of
12162 # each item and then call item.SetDimension to do the
12163 # actual positioning and sizing of the items within the
12164 # space alloted to this sizer.
12165 ...
12166 item.SetDimension(itemPos, itemSize)
12167
12168
12169 When `Layout` is called it first calls `CalcMin` followed by
12170 `RecalcSizes` so you can optimize a bit by saving the results of
e505d15e 12171 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
12172
12173 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12174
12175
12176 """
e811c8ce
RD
12177 def __repr__(self):
12178 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12179 def __init__(self, *args, **kwargs):
248ed943
RD
12180 """
12181 __init__(self) -> PySizer
12182
12183 Creates a wx.PySizer. Must be called from the __init__ in the derived
12184 class.
12185 """
54f9ee45 12186 newobj = _core_.new_PySizer(*args, **kwargs)
d14a1e28
RD
12187 self.this = newobj.this
12188 self.thisown = 1
12189 del newobj.thisown
12190 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
e811c8ce
RD
12191
12192 def _setCallbackInfo(*args, **kwargs):
a95a7133 12193 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 12194 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 12195
d14a1e28
RD
12196
12197class PySizerPtr(PySizer):
12198 def __init__(self, this):
12199 self.this = this
12200 if not hasattr(self,"thisown"): self.thisown = 0
12201 self.__class__ = PySizer
54f9ee45 12202_core_.PySizer_swigregister(PySizerPtr)
d14a1e28
RD
12203
12204#---------------------------------------------------------------------------
12205
12206class BoxSizer(Sizer):
248ed943
RD
12207 """
12208 The basic idea behind a box sizer is that windows will most often be
12209 laid out in rather simple basic geometry, typically in a row or a
12210 column or nested hierarchies of either. A wx.BoxSizer will lay out
12211 its items in a simple row or column, depending on the orientation
12212 parameter passed to the constructor.
12213 """
e811c8ce
RD
12214 def __repr__(self):
12215 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12216 def __init__(self, *args, **kwargs):
248ed943
RD
12217 """
12218 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12219
12220 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12221 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12222 sizer.
12223 """
54f9ee45 12224 newobj = _core_.new_BoxSizer(*args, **kwargs)
d14a1e28
RD
12225 self.this = newobj.this
12226 self.thisown = 1
12227 del newobj.thisown
12228 self._setOORInfo(self)
e811c8ce
RD
12229
12230 def GetOrientation(*args, **kwargs):
248ed943
RD
12231 """
12232 GetOrientation(self) -> int
12233
12234 Returns the current orientation of the sizer.
12235 """
54f9ee45 12236 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
12237
12238 def SetOrientation(*args, **kwargs):
248ed943
RD
12239 """
12240 SetOrientation(self, int orient)
e811c8ce 12241
248ed943
RD
12242 Resets the orientation of the sizer.
12243 """
12244 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 12245
d14a1e28
RD
12246
12247class BoxSizerPtr(BoxSizer):
12248 def __init__(self, this):
12249 self.this = this
12250 if not hasattr(self,"thisown"): self.thisown = 0
12251 self.__class__ = BoxSizer
54f9ee45 12252_core_.BoxSizer_swigregister(BoxSizerPtr)
d14a1e28
RD
12253
12254#---------------------------------------------------------------------------
12255
12256class StaticBoxSizer(BoxSizer):
248ed943
RD
12257 """
12258 wx.StaticBoxSizer derives from and functions identically to the
12259 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12260 manages. Note that this static box must be created separately and
12261 passed to the sizer constructor.
12262 """
e811c8ce
RD
12263 def __repr__(self):
12264 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12265 def __init__(self, *args, **kwargs):
248ed943
RD
12266 """
12267 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12268
12269 Constructor. It takes an associated static box and the orientation
12270 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12271 ``wx.HORIZONTAL``.
12272 """
54f9ee45 12273 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
d14a1e28
RD
12274 self.this = newobj.this
12275 self.thisown = 1
12276 del newobj.thisown
12277 self._setOORInfo(self)
e811c8ce
RD
12278
12279 def GetStaticBox(*args, **kwargs):
248ed943
RD
12280 """
12281 GetStaticBox(self) -> StaticBox
e811c8ce 12282
248ed943
RD
12283 Returns the static box associated with this sizer.
12284 """
12285 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 12286
d14a1e28
RD
12287
12288class StaticBoxSizerPtr(StaticBoxSizer):
12289 def __init__(self, this):
12290 self.this = this
12291 if not hasattr(self,"thisown"): self.thisown = 0
12292 self.__class__ = StaticBoxSizer
54f9ee45 12293_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
d14a1e28
RD
12294
12295#---------------------------------------------------------------------------
12296
12297class GridSizer(Sizer):
248ed943
RD
12298 """
12299 A grid sizer is a sizer which lays out its children in a
12300 two-dimensional table with all cells having the same size. In other
12301 words, the width of each cell within the grid is the width of the
12302 widest item added to the sizer and the height of each grid cell is the
12303 height of the tallest item. An optional vertical and/or horizontal
12304 gap between items can also be specified (in pixels.)
12305
12306 Items are placed in the cells of the grid in the order they are added,
12307 in row-major order. In other words, the first row is filled first,
12308 then the second, and so on until all items have been added. (If
12309 neccessary, additional rows will be added as items are added.) If you
12310 need to have greater control over the cells that items are placed in
12311 then use the `wx.GridBagSizer`.
12312
12313 """
e811c8ce
RD
12314 def __repr__(self):
12315 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12316 def __init__(self, *args, **kwargs):
248ed943
RD
12317 """
12318 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12319
12320 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12321 of columns and rows in the sizer - if either of the parameters is
12322 zero, it will be calculated to from the total number of children in
12323 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12324 define extra space between all children.
12325 """
54f9ee45 12326 newobj = _core_.new_GridSizer(*args, **kwargs)
d14a1e28
RD
12327 self.this = newobj.this
12328 self.thisown = 1
12329 del newobj.thisown
12330 self._setOORInfo(self)
e811c8ce 12331
e811c8ce 12332 def SetCols(*args, **kwargs):
248ed943
RD
12333 """
12334 SetCols(self, int cols)
12335
12336 Sets the number of columns in the sizer.
12337 """
54f9ee45 12338 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
12339
12340 def SetRows(*args, **kwargs):
248ed943
RD
12341 """
12342 SetRows(self, int rows)
12343
12344 Sets the number of rows in the sizer.
12345 """
54f9ee45 12346 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
12347
12348 def SetVGap(*args, **kwargs):
248ed943
RD
12349 """
12350 SetVGap(self, int gap)
12351
12352 Sets the vertical gap (in pixels) between the cells in the sizer.
12353 """
54f9ee45 12354 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
12355
12356 def SetHGap(*args, **kwargs):
248ed943
RD
12357 """
12358 SetHGap(self, int gap)
12359
12360 Sets the horizontal gap (in pixels) between cells in the sizer
12361 """
54f9ee45 12362 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
12363
12364 def GetCols(*args, **kwargs):
248ed943
RD
12365 """
12366 GetCols(self) -> int
12367
12368 Returns the number of columns in the sizer.
12369 """
54f9ee45 12370 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
12371
12372 def GetRows(*args, **kwargs):
248ed943
RD
12373 """
12374 GetRows(self) -> int
12375
12376 Returns the number of rows in the sizer.
12377 """
54f9ee45 12378 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
12379
12380 def GetVGap(*args, **kwargs):
248ed943
RD
12381 """
12382 GetVGap(self) -> int
12383
12384 Returns the vertical gap (in pixels) between the cells in the sizer.
12385 """
54f9ee45 12386 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
12387
12388 def GetHGap(*args, **kwargs):
248ed943
RD
12389 """
12390 GetHGap(self) -> int
12391
12392 Returns the horizontal gap (in pixels) between cells in the sizer.
12393 """
54f9ee45 12394 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 12395
d14a1e28
RD
12396
12397class GridSizerPtr(GridSizer):
12398 def __init__(self, this):
12399 self.this = this
12400 if not hasattr(self,"thisown"): self.thisown = 0
12401 self.__class__ = GridSizer
54f9ee45 12402_core_.GridSizer_swigregister(GridSizerPtr)
d14a1e28
RD
12403
12404#---------------------------------------------------------------------------
12405
54f9ee45
RD
12406FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12407FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12408FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 12409class FlexGridSizer(GridSizer):
248ed943
RD
12410 """
12411 A flex grid sizer is a sizer which lays out its children in a
12412 two-dimensional table with all table cells in one row having the same
12413 height and all cells in one column having the same width, but all
12414 rows or all columns are not necessarily the same height or width as in
12415 the `wx.GridSizer`.
12416
12417 wx.FlexGridSizer can also size items equally in one direction but
12418 unequally ("flexibly") in the other. If the sizer is only flexible
12419 in one direction (this can be changed using `SetFlexibleDirection`), it
12420 needs to be decided how the sizer should grow in the other ("non
12421 flexible") direction in order to fill the available space. The
12422 `SetNonFlexibleGrowMode` method serves this purpose.
12423
12424
12425 """
e811c8ce
RD
12426 def __repr__(self):
12427 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12428 def __init__(self, *args, **kwargs):
248ed943
RD
12429 """
12430 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12431
12432 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12433 number of columns and rows in the sizer - if either of the parameters
12434 is zero, it will be calculated to from the total number of children in
12435 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12436 define extra space between all children.
12437 """
54f9ee45 12438 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
d14a1e28
RD
12439 self.this = newobj.this
12440 self.thisown = 1
12441 del newobj.thisown
12442 self._setOORInfo(self)
e811c8ce 12443
248ed943
RD
12444 def AddGrowableRow(*args, **kwargs):
12445 """
12446 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 12447
248ed943
RD
12448 Specifies that row *idx* (starting from zero) should be grown if there
12449 is extra space available to the sizer.
e811c8ce 12450
248ed943
RD
12451 The *proportion* parameter has the same meaning as the stretch factor
12452 for the box sizers except that if all proportions are 0, then all
12453 columns are resized equally (instead of not being resized at all).
12454 """
54f9ee45 12455 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
12456
12457 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
12458 """
12459 RemoveGrowableRow(self, size_t idx)
12460
12461 Specifies that row *idx* is no longer growable.
12462 """
54f9ee45 12463 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
12464
12465 def AddGrowableCol(*args, **kwargs):
248ed943
RD
12466 """
12467 AddGrowableCol(self, size_t idx, int proportion=0)
12468
12469 Specifies that column *idx* (starting from zero) should be grown if
12470 there is extra space available to the sizer.
12471
12472 The *proportion* parameter has the same meaning as the stretch factor
12473 for the box sizers except that if all proportions are 0, then all
12474 columns are resized equally (instead of not being resized at all).
12475 """
54f9ee45 12476 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
12477
12478 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
12479 """
12480 RemoveGrowableCol(self, size_t idx)
12481
12482 Specifies that column *idx* is no longer growable.
12483 """
54f9ee45 12484 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
12485
12486 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
12487 """
12488 SetFlexibleDirection(self, int direction)
12489
12490 Specifies whether the sizer should flexibly resize its columns, rows,
12491 or both. Argument *direction* can be one of the following values. Any
12492 other value is ignored.
12493
12494 ============== =======================================
12495 wx.VERTICAL Rows are flexibly sized.
12496 wx.HORIZONTAL Columns are flexibly sized.
12497 wx.BOTH Both rows and columns are flexibly sized
12498 (this is the default value).
12499 ============== =======================================
12500
12501 Note that this method does not trigger relayout.
12502
12503 """
54f9ee45 12504 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
12505
12506 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
12507 """
12508 GetFlexibleDirection(self) -> int
12509
12510 Returns a value that specifies whether the sizer
12511 flexibly resizes its columns, rows, or both (default).
12512
12513 :see: `SetFlexibleDirection`
12514 """
54f9ee45 12515 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
12516
12517 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12518 """
12519 SetNonFlexibleGrowMode(self, int mode)
12520
12521 Specifies how the sizer should grow in the non-flexible direction if
12522 there is one (so `SetFlexibleDirection` must have been called
12523 previously). Argument *mode* can be one of the following values:
12524
12525 ========================== =================================================
12526 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12527 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12528 `AddGrowableCol` and `AddGrowableRow`. In this
12529 case equal sizing applies to minimum sizes of
12530 columns or rows (this is the default value).
12531 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12532 the non flexible direction, whether they are
12533 growable or not in the flexbile direction.
12534 ========================== =================================================
12535
12536 Note that this method does not trigger relayout.
12537
12538
12539 """
54f9ee45 12540 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
12541
12542 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12543 """
12544 GetNonFlexibleGrowMode(self) -> int
12545
12546 Returns the value that specifies how the sizer grows in the
12547 non-flexible direction if there is one.
12548
12549 :see: `SetNonFlexibleGrowMode`
12550 """
54f9ee45 12551 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
12552
12553 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
12554 """
12555 GetRowHeights(self) -> list
12556
12557 Returns a list of integers representing the heights of each of the
12558 rows in the sizer.
12559 """
54f9ee45 12560 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
12561
12562 def GetColWidths(*args, **kwargs):
fd2dc343
RD
12563 """
12564 GetColWidths(self) -> list
12565
12566 Returns a list of integers representing the widths of each of the
12567 columns in the sizer.
12568 """
54f9ee45 12569 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 12570
d14a1e28
RD
12571
12572class FlexGridSizerPtr(FlexGridSizer):
12573 def __init__(self, this):
12574 self.this = this
12575 if not hasattr(self,"thisown"): self.thisown = 0
12576 self.__class__ = FlexGridSizer
54f9ee45 12577_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
d14a1e28 12578
e505d15e
RD
12579class StdDialogButtonSizer(BoxSizer):
12580 """
12581 A special sizer that knows how to order and position standard buttons
12582 in order to conform to the current platform's standards. You simply
12583 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12584 buttons using the standard ID's. Then call `Realize` and the sizer
e505d15e
RD
12585 will take care of the rest.
12586
12587 """
12588 def __repr__(self):
12589 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
12590 def __init__(self, *args, **kwargs):
12591 """__init__(self) -> StdDialogButtonSizer"""
12592 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
12593 self.this = newobj.this
12594 self.thisown = 1
12595 del newobj.thisown
12596 def AddButton(*args, **kwargs):
12597 """
12598 AddButton(self, wxButton button)
12599
12600 Use this to add the buttons to this sizer. Do not use the `Add`
12601 method in the base class.
12602 """
12603 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12604
53aa7709 12605 def Realize(*args, **kwargs):
e505d15e 12606 """
53aa7709 12607 Realize(self)
e505d15e
RD
12608
12609 This funciton needs to be called after all the buttons have been added
12610 to the sizer. It will reorder them and position them in a platform
12611 specifc manner.
12612 """
53aa7709 12613 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12614
12615 def SetAffirmativeButton(*args, **kwargs):
12616 """SetAffirmativeButton(self, wxButton button)"""
12617 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12618
12619 def SetNegativeButton(*args, **kwargs):
12620 """SetNegativeButton(self, wxButton button)"""
12621 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12622
12623 def SetCancelButton(*args, **kwargs):
12624 """SetCancelButton(self, wxButton button)"""
12625 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
e505d15e
RD
12626
12627 def GetAffirmativeButton(*args, **kwargs):
12628 """GetAffirmativeButton(self) -> wxButton"""
12629 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12630
12631 def GetApplyButton(*args, **kwargs):
12632 """GetApplyButton(self) -> wxButton"""
12633 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12634
12635 def GetNegativeButton(*args, **kwargs):
12636 """GetNegativeButton(self) -> wxButton"""
12637 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12638
12639 def GetCancelButton(*args, **kwargs):
12640 """GetCancelButton(self) -> wxButton"""
12641 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12642
12643 def GetHelpButton(*args, **kwargs):
12644 """GetHelpButton(self) -> wxButton"""
12645 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12646
12647
12648class StdDialogButtonSizerPtr(StdDialogButtonSizer):
12649 def __init__(self, this):
12650 self.this = this
12651 if not hasattr(self,"thisown"): self.thisown = 0
12652 self.__class__ = StdDialogButtonSizer
12653_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
12654
d14a1e28
RD
12655#---------------------------------------------------------------------------
12656
12657class GBPosition(object):
248ed943
RD
12658 """
12659 This class represents the position of an item in a virtual grid of
12660 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12661 typemaps that will automatically convert from a 2-element sequence of
12662 integers to a wx.GBPosition, so you can use the more pythonic
12663 representation of the position nearly transparently in Python code.
12664 """
e811c8ce
RD
12665 def __repr__(self):
12666 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12667 def __init__(self, *args, **kwargs):
248ed943
RD
12668 """
12669 __init__(self, int row=0, int col=0) -> GBPosition
12670
12671 This class represents the position of an item in a virtual grid of
12672 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12673 typemaps that will automatically convert from a 2-element sequence of
12674 integers to a wx.GBPosition, so you can use the more pythonic
12675 representation of the position nearly transparently in Python code.
12676 """
54f9ee45 12677 newobj = _core_.new_GBPosition(*args, **kwargs)
d14a1e28
RD
12678 self.this = newobj.this
12679 self.thisown = 1
12680 del newobj.thisown
7e08d4ef
RD
12681 def __del__(self, destroy=_core_.delete_GBPosition):
12682 """__del__(self)"""
12683 try:
12684 if self.thisown: destroy(self)
12685 except: pass
12686
e811c8ce 12687 def GetRow(*args, **kwargs):
a95a7133 12688 """GetRow(self) -> int"""
54f9ee45 12689 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
12690
12691 def GetCol(*args, **kwargs):
a95a7133 12692 """GetCol(self) -> int"""
54f9ee45 12693 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
12694
12695 def SetRow(*args, **kwargs):
a95a7133 12696 """SetRow(self, int row)"""
54f9ee45 12697 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
12698
12699 def SetCol(*args, **kwargs):
a95a7133 12700 """SetCol(self, int col)"""
54f9ee45 12701 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
12702
12703 def __eq__(*args, **kwargs):
a95a7133 12704 """__eq__(self, GBPosition other) -> bool"""
54f9ee45 12705 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
12706
12707 def __ne__(*args, **kwargs):
a95a7133 12708 """__ne__(self, GBPosition other) -> bool"""
54f9ee45 12709 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
12710
12711 def Set(*args, **kwargs):
a95a7133 12712 """Set(self, int row=0, int col=0)"""
54f9ee45 12713 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
12714
12715 def Get(*args, **kwargs):
a95a7133 12716 """Get(self) -> PyObject"""
54f9ee45 12717 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 12718
41e2b43e 12719 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
12720 def __str__(self): return str(self.Get())
12721 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12722 def __len__(self): return len(self.Get())
12723 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
12724 def __setitem__(self, index, val):
12725 if index == 0: self.SetRow(val)
12726 elif index == 1: self.SetCol(val)
12727 else: raise IndexError
e811c8ce 12728 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12729 __safe_for_unpickling__ = True
12730 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
12731
12732 row = property(GetRow, SetRow)
12733 col = property(GetCol, SetCol)
12734
12735
12736class GBPositionPtr(GBPosition):
12737 def __init__(self, this):
12738 self.this = this
12739 if not hasattr(self,"thisown"): self.thisown = 0
12740 self.__class__ = GBPosition
54f9ee45 12741_core_.GBPosition_swigregister(GBPositionPtr)
d14a1e28
RD
12742
12743class GBSpan(object):
248ed943
RD
12744 """
12745 This class is used to hold the row and column spanning attributes of
12746 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12747 automatically convert from a 2-element sequence of integers to a
12748 wx.GBSpan, so you can use the more pythonic representation of the span
12749 nearly transparently in Python code.
12750
12751 """
e811c8ce
RD
12752 def __repr__(self):
12753 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12754 def __init__(self, *args, **kwargs):
248ed943
RD
12755 """
12756 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12757
12758 Construct a new wxGBSpan, optionally setting the rowspan and
12759 colspan. The default is (1,1). (Meaning that the item occupies one
12760 cell in each direction.
12761 """
54f9ee45 12762 newobj = _core_.new_GBSpan(*args, **kwargs)
d14a1e28
RD
12763 self.this = newobj.this
12764 self.thisown = 1
12765 del newobj.thisown
7e08d4ef
RD
12766 def __del__(self, destroy=_core_.delete_GBSpan):
12767 """__del__(self)"""
12768 try:
12769 if self.thisown: destroy(self)
12770 except: pass
12771
e811c8ce 12772 def GetRowspan(*args, **kwargs):
a95a7133 12773 """GetRowspan(self) -> int"""
54f9ee45 12774 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
12775
12776 def GetColspan(*args, **kwargs):
a95a7133 12777 """GetColspan(self) -> int"""
54f9ee45 12778 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
12779
12780 def SetRowspan(*args, **kwargs):
a95a7133 12781 """SetRowspan(self, int rowspan)"""
54f9ee45 12782 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
12783
12784 def SetColspan(*args, **kwargs):
a95a7133 12785 """SetColspan(self, int colspan)"""
54f9ee45 12786 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
12787
12788 def __eq__(*args, **kwargs):
a95a7133 12789 """__eq__(self, GBSpan other) -> bool"""
54f9ee45 12790 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
12791
12792 def __ne__(*args, **kwargs):
a95a7133 12793 """__ne__(self, GBSpan other) -> bool"""
54f9ee45 12794 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
12795
12796 def Set(*args, **kwargs):
a95a7133 12797 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 12798 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
12799
12800 def Get(*args, **kwargs):
a95a7133 12801 """Get(self) -> PyObject"""
54f9ee45 12802 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 12803
41e2b43e 12804 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
12805 def __str__(self): return str(self.Get())
12806 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12807 def __len__(self): return len(self.Get())
12808 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
12809 def __setitem__(self, index, val):
12810 if index == 0: self.SetRowspan(val)
12811 elif index == 1: self.SetColspan(val)
12812 else: raise IndexError
e811c8ce 12813 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12814 __safe_for_unpickling__ = True
12815 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
12816
12817 rowspan = property(GetRowspan, SetRowspan)
12818 colspan = property(GetColspan, SetColspan)
12819
12820
12821class GBSpanPtr(GBSpan):
12822 def __init__(self, this):
12823 self.this = this
12824 if not hasattr(self,"thisown"): self.thisown = 0
12825 self.__class__ = GBSpan
54f9ee45 12826_core_.GBSpan_swigregister(GBSpanPtr)
d14a1e28
RD
12827
12828class GBSizerItem(SizerItem):
248ed943
RD
12829 """
12830 The wx.GBSizerItem class is used to track the additional data about
12831 items in a `wx.GridBagSizer` such as the item's position in the grid
12832 and how many rows or columns it spans.
12833
12834 """
e811c8ce
RD
12835 def __repr__(self):
12836 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12837 def __init__(self, *args, **kwargs):
248ed943
RD
12838 """
12839 __init__(self) -> GBSizerItem
12840
12841 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12842 size will need to be set, as well as a position and span before this
12843 item can be used in a Sizer.
12844
12845 You will probably never need to create a wx.GBSizerItem directly as they
12846 are created automatically when the sizer's Add method is called.
12847 """
54f9ee45 12848 newobj = _core_.new_GBSizerItem(*args, **kwargs)
d14a1e28
RD
12849 self.this = newobj.this
12850 self.thisown = 1
12851 del newobj.thisown
7e08d4ef
RD
12852 def __del__(self, destroy=_core_.delete_GBSizerItem):
12853 """__del__(self)"""
12854 try:
12855 if self.thisown: destroy(self)
12856 except: pass
12857
e811c8ce 12858 def GetPos(*args, **kwargs):
248ed943
RD
12859 """
12860 GetPos(self) -> GBPosition
12861
12862 Get the grid position of the item
12863 """
54f9ee45 12864 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
12865
12866 def GetPosTuple(self): return self.GetPos().Get()
12867 def GetSpan(*args, **kwargs):
248ed943
RD
12868 """
12869 GetSpan(self) -> GBSpan
12870
12871 Get the row and column spanning of the item
12872 """
54f9ee45 12873 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
12874
12875 def GetSpanTuple(self): return self.GetSpan().Get()
12876 def SetPos(*args, **kwargs):
248ed943
RD
12877 """
12878 SetPos(self, GBPosition pos) -> bool
12879
12880 If the item is already a member of a sizer then first ensure that
12881 there is no other item that would intersect with this one at the new
12882 position, then set the new position. Returns True if the change is
12883 successful and after the next Layout() the item will be moved.
12884 """
54f9ee45 12885 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
12886
12887 def SetSpan(*args, **kwargs):
248ed943
RD
12888 """
12889 SetSpan(self, GBSpan span) -> bool
12890
12891 If the item is already a member of a sizer then first ensure that
12892 there is no other item that would intersect with this one with its new
12893 spanning size, then set the new spanning. Returns True if the change
12894 is successful and after the next Layout() the item will be resized.
12895
12896 """
54f9ee45 12897 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 12898
248ed943 12899 def Intersects(*args, **kwargs):
0df68c9f 12900 """
a95a7133 12901 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12902
12903 Returns True if this item and the other item instersect.
0df68c9f 12904 """
248ed943
RD
12905 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12906
12907 def IntersectsPos(*args, **kwargs):
12908 """
12909 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12910
12911 Returns True if the given pos/span would intersect with this item.
12912 """
12913 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
12914
12915 def GetEndPos(*args, **kwargs):
248ed943
RD
12916 """
12917 GetEndPos(self) -> GBPosition
12918
12919 Get the row and column of the endpoint of this item.
12920 """
54f9ee45 12921 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
12922
12923 def GetGBSizer(*args, **kwargs):
248ed943
RD
12924 """
12925 GetGBSizer(self) -> GridBagSizer
12926
12927 Get the sizer this item is a member of.
12928 """
54f9ee45 12929 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
12930
12931 def SetGBSizer(*args, **kwargs):
248ed943
RD
12932 """
12933 SetGBSizer(self, GridBagSizer sizer)
12934
12935 Set the sizer this item is a member of.
12936 """
54f9ee45 12937 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 12938
d14a1e28
RD
12939
12940class GBSizerItemPtr(GBSizerItem):
12941 def __init__(self, this):
12942 self.this = this
12943 if not hasattr(self,"thisown"): self.thisown = 0
12944 self.__class__ = GBSizerItem
54f9ee45 12945_core_.GBSizerItem_swigregister(GBSizerItemPtr)
d14a1e28
RD
12946DefaultSpan = cvar.DefaultSpan
12947
12948def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
12949 """
12950 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12951 int border, PyObject userData=None) -> GBSizerItem
12952
12953 Construct a `wx.GBSizerItem` for a window.
0df68c9f 12954 """
54f9ee45 12955 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
12956 val.thisown = 1
12957 return val
12958
12959def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
12960 """
12961 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12962 int border, PyObject userData=None) -> GBSizerItem
12963
12964 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 12965 """
54f9ee45 12966 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
12967 val.thisown = 1
12968 return val
12969
12970def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
12971 """
12972 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12973 int flag, int border, PyObject userData=None) -> GBSizerItem
12974
12975 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 12976 """
54f9ee45 12977 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
12978 val.thisown = 1
12979 return val
12980
12981class GridBagSizer(FlexGridSizer):
248ed943
RD
12982 """
12983 A `wx.Sizer` that can lay out items in a virtual grid like a
12984 `wx.FlexGridSizer` but in this case explicit positioning of the items
12985 is allowed using `wx.GBPosition`, and items can optionally span more
12986 than one row and/or column using `wx.GBSpan`. The total size of the
12987 virtual grid is determined by the largest row and column that items are
12988 positioned at, adjusted for spanning.
12989
12990 """
e811c8ce
RD
12991 def __repr__(self):
12992 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 12993 def __init__(self, *args, **kwargs):
248ed943
RD
12994 """
12995 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12996
12997 Constructor, with optional parameters to specify the gap between the
12998 rows and columns.
12999 """
54f9ee45 13000 newobj = _core_.new_GridBagSizer(*args, **kwargs)
d14a1e28
RD
13001 self.this = newobj.this
13002 self.thisown = 1
13003 del newobj.thisown
1823fbb4
RD
13004 self._setOORInfo(self)
13005
e811c8ce 13006 def Add(*args, **kwargs):
0df68c9f 13007 """
248ed943 13008 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 13009 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
13010
13011 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13012 more than one row or column as specified with *span*. The remaining
13013 args behave similarly to `wx.Sizer.Add`.
13014
13015 Returns True if the item was successfully placed at the given cell
13016 position, False if something was already there.
13017
0df68c9f 13018 """
54f9ee45 13019 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
13020
13021 def AddItem(*args, **kwargs):
248ed943 13022 """
d3b6e4ff 13023 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
13024
13025 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13026 the item was successfully placed at its given cell position, False if
13027 something was already there.
13028 """
54f9ee45 13029 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 13030
84f85550
RD
13031 def GetCellSize(*args, **kwargs):
13032 """
13033 GetCellSize(self, int row, int col) -> Size
13034
13035 Get the size of the specified cell, including hgap and
13036 vgap. Only valid after a Layout.
13037 """
13038 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
13039
e811c8ce 13040 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
13041 """
13042 GetEmptyCellSize(self) -> Size
13043
13044 Get the size used for cells in the grid with no item.
13045 """
54f9ee45 13046 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
13047
13048 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
13049 """
13050 SetEmptyCellSize(self, Size sz)
13051
13052 Set the size used for cells in the grid with no item.
13053 """
54f9ee45 13054 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
13055
13056 def GetItemPosition(*args):
0df68c9f 13057 """
248ed943
RD
13058 GetItemPosition(self, item) -> GBPosition
13059
13060 Get the grid position of the specified *item* where *item* is either a
13061 window or subsizer that is a member of this sizer, or a zero-based
13062 index of an item.
0df68c9f 13063 """
54f9ee45 13064 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
13065
13066 def SetItemPosition(*args):
0df68c9f 13067 """
248ed943
RD
13068 SetItemPosition(self, item, GBPosition pos) -> bool
13069
13070 Set the grid position of the specified *item* where *item* is either a
13071 window or subsizer that is a member of this sizer, or a zero-based
13072 index of an item. Returns True on success. If the move is not
13073 allowed (because an item is already there) then False is returned.
13074
0df68c9f 13075 """
54f9ee45 13076 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
13077
13078 def GetItemSpan(*args):
0df68c9f 13079 """
248ed943
RD
13080 GetItemSpan(self, item) -> GBSpan
13081
13082 Get the row/col spanning of the specified *item* where *item* is
13083 either a window or subsizer that is a member of this sizer, or a
13084 zero-based index of an item.
0df68c9f 13085 """
54f9ee45 13086 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
13087
13088 def SetItemSpan(*args):
0df68c9f 13089 """
248ed943
RD
13090 SetItemSpan(self, item, GBSpan span) -> bool
13091
13092 Set the row/col spanning of the specified *item* where *item* is
13093 either a window or subsizer that is a member of this sizer, or a
13094 zero-based index of an item. Returns True on success. If the move is
13095 not allowed (because an item is already there) then False is returned.
0df68c9f 13096 """
54f9ee45 13097 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
13098
13099 def FindItem(*args):
0df68c9f 13100 """
248ed943
RD
13101 FindItem(self, item) -> GBSizerItem
13102
13103 Find the sizer item for the given window or subsizer, returns None if
13104 not found. (non-recursive)
0df68c9f 13105 """
54f9ee45 13106 return _core_.GridBagSizer_FindItem(*args)
e811c8ce
RD
13107
13108 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
13109 """
13110 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13111
13112 Return the sizer item for the given grid cell, or None if there is no
13113 item at that position. (non-recursive)
13114 """
54f9ee45 13115 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
13116
13117 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
13118 """
13119 FindItemAtPoint(self, Point pt) -> GBSizerItem
13120
13121 Return the sizer item located at the point given in *pt*, or None if
13122 there is no item at that point. The (x,y) coordinates in pt correspond
13123 to the client coordinates of the window using the sizer for
13124 layout. (non-recursive)
13125 """
54f9ee45 13126 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 13127
248ed943
RD
13128 def CheckForIntersection(*args, **kwargs):
13129 """
13130 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 13131
248ed943
RD
13132 Look at all items and see if any intersect (or would overlap) the
13133 given *item*. Returns True if so, False if there would be no overlap.
13134 If an *excludeItem* is given then it will not be checked for
13135 intersection, for example it may be the item we are checking the
13136 position of.
e811c8ce 13137
248ed943
RD
13138 """
13139 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 13140
248ed943 13141 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 13142 """
248ed943
RD
13143 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13144
13145 Look at all items and see if any intersect (or would overlap) the
13146 given position and span. Returns True if so, False if there would be
13147 no overlap. If an *excludeItem* is given then it will not be checked
13148 for intersection, for example it may be the item we are checking the
13149 position of.
0df68c9f 13150 """
248ed943 13151 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 13152
d14a1e28
RD
13153
13154class GridBagSizerPtr(GridBagSizer):
13155 def __init__(self, this):
13156 self.this = this
13157 if not hasattr(self,"thisown"): self.thisown = 0
13158 self.__class__ = GridBagSizer
54f9ee45 13159_core_.GridBagSizer_swigregister(GridBagSizerPtr)
d14a1e28
RD
13160
13161#---------------------------------------------------------------------------
13162
54f9ee45
RD
13163Left = _core_.Left
13164Top = _core_.Top
13165Right = _core_.Right
13166Bottom = _core_.Bottom
13167Width = _core_.Width
13168Height = _core_.Height
13169Centre = _core_.Centre
13170Center = _core_.Center
13171CentreX = _core_.CentreX
13172CentreY = _core_.CentreY
13173Unconstrained = _core_.Unconstrained
13174AsIs = _core_.AsIs
13175PercentOf = _core_.PercentOf
13176Above = _core_.Above
13177Below = _core_.Below
13178LeftOf = _core_.LeftOf
13179RightOf = _core_.RightOf
13180SameAs = _core_.SameAs
13181Absolute = _core_.Absolute
d14a1e28 13182class IndividualLayoutConstraint(Object):
15afbcd0 13183 """
41e2b43e
RD
13184 Objects of this class are stored in the `wx.LayoutConstraints` class as
13185 one of eight possible constraints that a window can be involved in.
13186 You will never need to create an instance of
13187 wx.IndividualLayoutConstraint, rather you should create a
13188 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 13189 that it contains.
15afbcd0 13190 """
d14a1e28
RD
13191 def __init__(self): raise RuntimeError, "No constructor defined"
13192 def __repr__(self):
13193 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 13194 def Set(*args, **kwargs):
41e2b43e
RD
13195 """
13196 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13197
13198 Sets the properties of the constraint. Normally called by one of the
13199 convenience functions such as Above, RightOf, SameAs.
13200 """
54f9ee45 13201 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
13202
13203 def LeftOf(*args, **kwargs):
15afbcd0 13204 """
a95a7133 13205 LeftOf(self, Window sibling, int marg=0)
15afbcd0 13206
41e2b43e
RD
13207 Constrains this edge to be to the left of the given window, with an
13208 optional margin. Implicitly, this is relative to the left edge of the
13209 other window.
15afbcd0 13210 """
54f9ee45 13211 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
13212
13213 def RightOf(*args, **kwargs):
15afbcd0 13214 """
a95a7133 13215 RightOf(self, Window sibling, int marg=0)
15afbcd0 13216
41e2b43e
RD
13217 Constrains this edge to be to the right of the given window, with an
13218 optional margin. Implicitly, this is relative to the right edge of the
13219 other window.
15afbcd0 13220 """
54f9ee45 13221 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
13222
13223 def Above(*args, **kwargs):
15afbcd0 13224 """
a95a7133 13225 Above(self, Window sibling, int marg=0)
15afbcd0 13226
41e2b43e
RD
13227 Constrains this edge to be above the given window, with an optional
13228 margin. Implicitly, this is relative to the top edge of the other
13229 window.
15afbcd0 13230 """
54f9ee45 13231 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
13232
13233 def Below(*args, **kwargs):
15afbcd0 13234 """
a95a7133 13235 Below(self, Window sibling, int marg=0)
15afbcd0 13236
41e2b43e
RD
13237 Constrains this edge to be below the given window, with an optional
13238 margin. Implicitly, this is relative to the bottom edge of the other
13239 window.
15afbcd0 13240 """
54f9ee45 13241 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
13242
13243 def SameAs(*args, **kwargs):
15afbcd0 13244 """
a95a7133 13245 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 13246
41e2b43e
RD
13247 Constrains this edge or dimension to be to the same as the edge of the
13248 given window, with an optional margin.
15afbcd0 13249 """
54f9ee45 13250 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
13251
13252 def PercentOf(*args, **kwargs):
15afbcd0 13253 """
a95a7133 13254 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 13255
41e2b43e
RD
13256 Constrains this edge or dimension to be to a percentage of the given
13257 window, with an optional margin.
15afbcd0 13258 """
54f9ee45 13259 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
13260
13261 def Absolute(*args, **kwargs):
15afbcd0 13262 """
a95a7133 13263 Absolute(self, int val)
15afbcd0 13264
41e2b43e 13265 Constrains this edge or dimension to be the given absolute value.
15afbcd0 13266 """
54f9ee45 13267 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
13268
13269 def Unconstrained(*args, **kwargs):
15afbcd0 13270 """
a95a7133 13271 Unconstrained(self)
15afbcd0 13272
41e2b43e
RD
13273 Sets this edge or dimension to be unconstrained, that is, dependent on
13274 other edges and dimensions from which this value can be deduced.
15afbcd0 13275 """
54f9ee45 13276 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
13277
13278 def AsIs(*args, **kwargs):
15afbcd0 13279 """
a95a7133 13280 AsIs(self)
15afbcd0 13281
41e2b43e
RD
13282 Sets this edge or constraint to be whatever the window's value is at
13283 the moment. If either of the width and height constraints are *as is*,
13284 the window will not be resized, but moved instead. This is important
13285 when considering panel items which are intended to have a default
13286 size, such as a button, which may take its size from the size of the
13287 button label.
15afbcd0 13288 """
54f9ee45 13289 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
13290
13291 def GetOtherWindow(*args, **kwargs):
a95a7133 13292 """GetOtherWindow(self) -> Window"""
54f9ee45 13293 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
13294
13295 def GetMyEdge(*args, **kwargs):
a95a7133 13296 """GetMyEdge(self) -> int"""
54f9ee45 13297 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
13298
13299 def SetEdge(*args, **kwargs):
a95a7133 13300 """SetEdge(self, int which)"""
54f9ee45 13301 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
13302
13303 def SetValue(*args, **kwargs):
a95a7133 13304 """SetValue(self, int v)"""
54f9ee45 13305 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
13306
13307 def GetMargin(*args, **kwargs):
a95a7133 13308 """GetMargin(self) -> int"""
54f9ee45 13309 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
13310
13311 def SetMargin(*args, **kwargs):
a95a7133 13312 """SetMargin(self, int m)"""
54f9ee45 13313 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
13314
13315 def GetValue(*args, **kwargs):
a95a7133 13316 """GetValue(self) -> int"""
54f9ee45 13317 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
13318
13319 def GetPercent(*args, **kwargs):
a95a7133 13320 """GetPercent(self) -> int"""
54f9ee45 13321 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
13322
13323 def GetOtherEdge(*args, **kwargs):
a95a7133 13324 """GetOtherEdge(self) -> int"""
54f9ee45 13325 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
13326
13327 def GetDone(*args, **kwargs):
a95a7133 13328 """GetDone(self) -> bool"""
54f9ee45 13329 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
13330
13331 def SetDone(*args, **kwargs):
a95a7133 13332 """SetDone(self, bool d)"""
54f9ee45 13333 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
13334
13335 def GetRelationship(*args, **kwargs):
a95a7133 13336 """GetRelationship(self) -> int"""
54f9ee45 13337 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
13338
13339 def SetRelationship(*args, **kwargs):
a95a7133 13340 """SetRelationship(self, int r)"""
54f9ee45 13341 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
13342
13343 def ResetIfWin(*args, **kwargs):
15afbcd0 13344 """
a95a7133 13345 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
13346
13347 Reset constraint if it mentions otherWin
13348 """
54f9ee45 13349 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
13350
13351 def SatisfyConstraint(*args, **kwargs):
15afbcd0 13352 """
a95a7133 13353 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
13354
13355 Try to satisfy constraint
13356 """
54f9ee45 13357 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
13358
13359 def GetEdge(*args, **kwargs):
15afbcd0 13360 """
a95a7133 13361 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
13362
13363 Get the value of this edge or dimension, or if this
13364 is not determinable, -1.
13365 """
54f9ee45 13366 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 13367
d14a1e28
RD
13368
13369class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
13370 def __init__(self, this):
13371 self.this = this
13372 if not hasattr(self,"thisown"): self.thisown = 0
13373 self.__class__ = IndividualLayoutConstraint
54f9ee45 13374_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
d14a1e28
RD
13375
13376class LayoutConstraints(Object):
15afbcd0 13377 """
41e2b43e
RD
13378 **Note:** constraints are now deprecated and you should use sizers
13379 instead.
15afbcd0 13380
41e2b43e
RD
13381 Objects of this class can be associated with a window to define its
13382 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
13383
13384 The class consists of the following eight constraints of class
13385 wx.IndividualLayoutConstraint, some or all of which should be accessed
13386 directly to set the appropriate constraints.
13387
13388 * left: represents the left hand edge of the window
13389 * right: represents the right hand edge of the window
13390 * top: represents the top edge of the window
13391 * bottom: represents the bottom edge of the window
13392 * width: represents the width of the window
13393 * height: represents the height of the window
13394 * centreX: represents the horizontal centre point of the window
13395 * centreY: represents the vertical centre point of the window
13396
41e2b43e
RD
13397 Most constraints are initially set to have the relationship
13398 wxUnconstrained, which means that their values should be calculated by
13399 looking at known constraints. The exceptions are width and height,
13400 which are set to wxAsIs to ensure that if the user does not specify a
13401 constraint, the existing width and height will be used, to be
13402 compatible with panel items which often have take a default size. If
13403 the constraint is ``wx.AsIs``, the dimension will not be changed.
13404
13405 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
13406
13407 """
e811c8ce
RD
13408 def __repr__(self):
13409 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
13410 left = property(_core_.LayoutConstraints_left_get)
13411 top = property(_core_.LayoutConstraints_top_get)
13412 right = property(_core_.LayoutConstraints_right_get)
13413 bottom = property(_core_.LayoutConstraints_bottom_get)
13414 width = property(_core_.LayoutConstraints_width_get)
13415 height = property(_core_.LayoutConstraints_height_get)
13416 centreX = property(_core_.LayoutConstraints_centreX_get)
13417 centreY = property(_core_.LayoutConstraints_centreY_get)
d14a1e28 13418 def __init__(self, *args, **kwargs):
a95a7133 13419 """__init__(self) -> LayoutConstraints"""
54f9ee45 13420 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
d14a1e28
RD
13421 self.this = newobj.this
13422 self.thisown = 1
13423 del newobj.thisown
e811c8ce 13424 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 13425 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 13426 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
13427
13428 def AreSatisfied(*args, **kwargs):
a95a7133 13429 """AreSatisfied(self) -> bool"""
54f9ee45 13430 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 13431
d14a1e28
RD
13432
13433class LayoutConstraintsPtr(LayoutConstraints):
13434 def __init__(self, this):
13435 self.this = this
13436 if not hasattr(self,"thisown"): self.thisown = 0
13437 self.__class__ = LayoutConstraints
54f9ee45 13438_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
d14a1e28
RD
13439
13440#----------------------------------------------------------------------------
13441
322913ce 13442# Use Python's bool constants if available, make some if not
d14a1e28
RD
13443try:
13444 True
13445except NameError:
322913ce
RD
13446 __builtins__.True = 1==1
13447 __builtins__.False = 1==0
4f89f6a3
RD
13448 def bool(value): return not not value
13449 __builtins__.bool = bool
d14a1e28 13450
d14a1e28
RD
13451
13452
13453# workarounds for bad wxRTTI names
13454__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13455__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13456__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13457
13458
13459#----------------------------------------------------------------------------
13460# Load version numbers from __version__... Ensure that major and minor
7bc1e663 13461# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
13462
13463from __version__ import *
13464__version__ = VERSION_STRING
13465
7bc1e663
RD
13466assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13467assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 13468if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 13469 import warnings
7bc1e663 13470 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28
RD
13471
13472#----------------------------------------------------------------------------
13473
70b7a5fe
RD
13474# Set wxPython's default string<-->unicode conversion encoding from
13475# the locale, but only if Python's default hasn't been changed. (We
13476# assume that if the user has customized it already then that is the
13477# encoding we need to use as well.)
13478#
13479# The encoding selected here is used when string or unicode objects
13480# need to be converted in order to pass them to wxWidgets. Please be
13481# aware that the default encoding within the same locale may be
13482# slightly different on different platforms. For example, please see
e505d15e
RD
13483# http://www.alanwood.net/demos/charsetdiffs.html for differences
13484# between the common latin/roman encodings.
396fb509
RD
13485
13486default = _sys.getdefaultencoding()
13487if default == 'ascii':
13488 import locale
13489 import codecs
13490 try:
13491 default = locale.getdefaultlocale()[1]
13492 codecs.lookup(default)
70b7a5fe 13493 except (ValueError, LookupError, TypeError):
396fb509
RD
13494 default = _sys.getdefaultencoding()
13495 del locale
13496 del codecs
5cbf236d
RD
13497if default:
13498 wx.SetDefaultPyEncoding(default)
13499del default
5cbf236d
RD
13500
13501#----------------------------------------------------------------------------
13502
d14a1e28
RD
13503class PyDeadObjectError(AttributeError):
13504 pass
13505
d14a1e28
RD
13506class _wxPyDeadObject(object):
13507 """
13508 Instances of wx objects that are OOR capable will have their __class__
13509 changed to this class when the C++ object is deleted. This should help
13510 prevent crashes due to referencing a bogus C++ pointer.
13511 """
13512 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13513 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13514
3a04f143 13515 def __repr__(self):
d14a1e28
RD
13516 if not hasattr(self, "_name"):
13517 self._name = "[unknown]"
13518 return self.reprStr % self._name
13519
3a04f143 13520 def __getattr__(self, *args):
d14a1e28
RD
13521 if not hasattr(self, "_name"):
13522 self._name = "[unknown]"
3a04f143
RD
13523 raise PyDeadObjectError(self.attrStr % self._name)
13524
13525 def __nonzero__(self):
13526 return 0
13527
13528
13529
13530class PyUnbornObjectError(AttributeError):
13531 pass
13532
13533class _wxPyUnbornObject(object):
13534 """
54f9ee45 13535 Some stock objects are created when the wx._core module is
3a04f143
RD
13536 imported, but their C++ instance is not created until the wx.App
13537 object is created and initialized. These object instances will
13538 temporarily have their __class__ changed to this class so an
13539 exception will be raised if they are used before the C++ instance
13540 is ready.
13541 """
13542
13543 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13544 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13545
13546 def __repr__(self):
13547 #if not hasattr(self, "_name"):
13548 # self._name = "[unknown]"
13549 return self.reprStr #% self._name
13550
13551 def __getattr__(self, *args):
13552 #if not hasattr(self, "_name"):
13553 # self._name = "[unknown]"
13554 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
13555
13556 def __nonzero__(self):
13557 return 0
13558
13559
13560#----------------------------------------------------------------------------
d14a1e28
RD
13561
13562def CallAfter(callable, *args, **kw):
13563 """
13564 Call the specified function after the current and pending event
13565 handlers have been completed. This is also good for making GUI
61863841
RD
13566 method calls from non-GUI threads. Any extra positional or
13567 keyword args are passed on to the callable when it is called.
13568
13569 :see: `wx.FutureCall`
d14a1e28
RD
13570 """
13571 app = wx.GetApp()
dfbb5885 13572 assert app is not None, 'No wx.App created yet'
d14a1e28 13573
148275d3
RD
13574 if not hasattr(app, "_CallAfterId"):
13575 app._CallAfterId = wx.NewEventType()
13576 app.Connect(-1, -1, app._CallAfterId,
13577 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 13578 evt = wx.PyEvent()
148275d3 13579 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
13580 evt.callable = callable
13581 evt.args = args
13582 evt.kw = kw
13583 wx.PostEvent(app, evt)
13584
d14a1e28
RD
13585#----------------------------------------------------------------------------
13586
13587
13588class FutureCall:
13589 """
8ac8dba0 13590 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
13591 object once after the given amount of milliseconds, passing any
13592 positional or keyword args. The return value of the callable is
61863841 13593 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
13594
13595 If you don't need to get the return value or restart the timer
13596 then there is no need to hold a reference to this object. It will
13597 hold a reference to itself while the timer is running (the timer
13598 has a reference to self.Notify) but the cycle will be broken when
13599 the timer completes, automatically cleaning up the wx.FutureCall
13600 object.
61863841
RD
13601
13602 :see: `wx.CallAfter`
d14a1e28
RD
13603 """
13604 def __init__(self, millis, callable, *args, **kwargs):
13605 self.millis = millis
13606 self.callable = callable
13607 self.SetArgs(*args, **kwargs)
13608 self.runCount = 0
4276dc52 13609 self.running = False
d14a1e28
RD
13610 self.hasRun = False
13611 self.result = None
13612 self.timer = None
13613 self.Start()
13614
13615 def __del__(self):
13616 self.Stop()
13617
13618
13619 def Start(self, millis=None, *args, **kwargs):
13620 """
13621 (Re)start the timer
13622 """
13623 self.hasRun = False
13624 if millis is not None:
13625 self.millis = millis
13626 if args or kwargs:
13627 self.SetArgs(*args, **kwargs)
13628 self.Stop()
13629 self.timer = wx.PyTimer(self.Notify)
13630 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 13631 self.running = True
d14a1e28
RD
13632 Restart = Start
13633
13634
13635 def Stop(self):
13636 """
13637 Stop and destroy the timer.
13638 """
13639 if self.timer is not None:
13640 self.timer.Stop()
13641 self.timer = None
13642
13643
13644 def GetInterval(self):
13645 if self.timer is not None:
13646 return self.timer.GetInterval()
13647 else:
13648 return 0
13649
13650
13651 def IsRunning(self):
13652 return self.timer is not None and self.timer.IsRunning()
13653
13654
13655 def SetArgs(self, *args, **kwargs):
13656 """
13657 (Re)set the args passed to the callable object. This is
13658 useful in conjunction with Restart if you want to schedule a
13659 new call to the same callable object but with different
13660 parameters.
13661 """
13662 self.args = args
13663 self.kwargs = kwargs
13664
13665
13666 def HasRun(self):
13667 return self.hasRun
13668
13669 def GetResult(self):
13670 return self.result
13671
13672 def Notify(self):
13673 """
13674 The timer has expired so call the callable.
13675 """
13676 if self.callable and getattr(self.callable, 'im_self', True):
13677 self.runCount += 1
4276dc52 13678 self.running = False
d14a1e28
RD
13679 self.result = self.callable(*self.args, **self.kwargs)
13680 self.hasRun = True
4276dc52
RD
13681 if not self.running:
13682 # if it wasn't restarted, then cleanup
13683 wx.CallAfter(self.Stop)
d14a1e28
RD
13684
13685
a95a7133
RD
13686
13687#----------------------------------------------------------------------------
13688# Control which items in this module should be documented by epydoc.
13689# We allow only classes and functions, which will help reduce the size
13690# of the docs by filtering out the zillions of constants, EVT objects,
13691# and etc that don't make much sense by themselves, but are instead
13692# documented (or will be) as part of the classes/functions/methods
13693# where they should be used.
13694
66c033b4
RD
13695class __DocFilter:
13696 """
13697 A filter for epydoc that only allows non-Ptr classes and
13698 fucntions, in order to reduce the clutter in the API docs.
13699 """
13700 def __init__(self, globals):
13701 self._globals = globals
13702
13703 def __call__(self, name):
13704 import types
13705 obj = self._globals.get(name, None)
13706 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13707 return False
13708 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
13709 return False
13710 return True
a95a7133 13711
d14a1e28
RD
13712#----------------------------------------------------------------------------
13713#----------------------------------------------------------------------------
13714
13715# Import other modules in this package that should show up in the
13716# "core" wx namespace
54f9ee45
RD
13717from _gdi import *
13718from _windows import *
13719from _controls import *
13720from _misc import *
d14a1e28 13721
3a04f143
RD
13722
13723# Fixup the stock objects since they can't be used yet. (They will be
13724# restored in wx.PyApp.OnInit.)
54f9ee45 13725_core_._wxPyFixStockObjects()
3a04f143 13726
d14a1e28
RD
13727#----------------------------------------------------------------------------
13728#----------------------------------------------------------------------------
13729
13730
32fe5131 13731