]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
Fixed event binding in NotebookPage
[wxWidgets.git] / wxPython / src / mac / _core.py
CommitLineData
d55e5bfc
RD
1# This file was created automatically by SWIG.
2# Don't modify this file, modify the SWIG interface instead.
3
4import _core_
5
36ed4f51
RD
6def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
7 if (name == "this"):
8 if isinstance(value, class_type):
9 self.__dict__[name] = value.this
10 if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
11 del value.thisown
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
15 if (not static) or hasattr(self,name) or (name == "thisown"):
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
24 method = class_type.__swig_getmethods__.get(name,None)
25 if method: return method(self)
26 raise AttributeError,name
27
28import types
29try:
30 _object = types.ObjectType
31 _newclass = 1
32except AttributeError:
33 class _object : pass
34 _newclass = 0
35del types
36
37
38def _swig_setattr_nondynamic_method(set):
39 def set_attr(self,name,value):
40 if hasattr(self,name) or (name in ("this", "thisown")):
41 set(self,name,value)
42 else:
43 raise AttributeError("You cannot add attributes to %s" % self)
44 return set_attr
45
46
d55e5bfc
RD
47#// Give a reference to the dictionary of this module to the C++ extension
48#// code.
49_core_._wxPySetDictionary(vars())
50
51#// A little trick to make 'wx' be a reference to this module so wx.Names can
52#// be used here.
53import sys as _sys
54wx = _sys.modules[__name__]
55
d6c14a4c
RD
56
57#----------------------------------------------------------------------------
58
59def _deprecated(callable, msg=None):
60 """
61 Create a wrapper function that will raise a DeprecationWarning
62 before calling the callable.
63 """
64 if msg is None:
65 msg = "%s is deprecated" % callable
66 def deprecatedWrapper(*args, **kwargs):
67 import warnings
68 warnings.warn(msg, DeprecationWarning, stacklevel=2)
69 return callable(*args, **kwargs)
70 deprecatedWrapper.__doc__ = msg
71 return deprecatedWrapper
72
73
74#----------------------------------------------------------------------------
75
d55e5bfc
RD
76NOT_FOUND = _core_.NOT_FOUND
77VSCROLL = _core_.VSCROLL
78HSCROLL = _core_.HSCROLL
79CAPTION = _core_.CAPTION
80DOUBLE_BORDER = _core_.DOUBLE_BORDER
81SUNKEN_BORDER = _core_.SUNKEN_BORDER
82RAISED_BORDER = _core_.RAISED_BORDER
83BORDER = _core_.BORDER
84SIMPLE_BORDER = _core_.SIMPLE_BORDER
85STATIC_BORDER = _core_.STATIC_BORDER
86TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
87NO_BORDER = _core_.NO_BORDER
88TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
89WANTS_CHARS = _core_.WANTS_CHARS
90POPUP_WINDOW = _core_.POPUP_WINDOW
91CENTER_FRAME = _core_.CENTER_FRAME
92CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
93CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
94ED_CLIENT_MARGIN = _core_.ED_CLIENT_MARGIN
95ED_BUTTONS_BOTTOM = _core_.ED_BUTTONS_BOTTOM
96ED_BUTTONS_RIGHT = _core_.ED_BUTTONS_RIGHT
97ED_STATIC_LINE = _core_.ED_STATIC_LINE
98EXT_DIALOG_STYLE = _core_.EXT_DIALOG_STYLE
99CLIP_CHILDREN = _core_.CLIP_CHILDREN
100CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
101ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
102RETAINED = _core_.RETAINED
103BACKINGSTORE = _core_.BACKINGSTORE
104COLOURED = _core_.COLOURED
105FIXED_LENGTH = _core_.FIXED_LENGTH
106LB_NEEDED_SB = _core_.LB_NEEDED_SB
107LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
108LB_SORT = _core_.LB_SORT
109LB_SINGLE = _core_.LB_SINGLE
110LB_MULTIPLE = _core_.LB_MULTIPLE
111LB_EXTENDED = _core_.LB_EXTENDED
112LB_OWNERDRAW = _core_.LB_OWNERDRAW
113LB_HSCROLL = _core_.LB_HSCROLL
114PROCESS_ENTER = _core_.PROCESS_ENTER
115PASSWORD = _core_.PASSWORD
116CB_SIMPLE = _core_.CB_SIMPLE
117CB_DROPDOWN = _core_.CB_DROPDOWN
118CB_SORT = _core_.CB_SORT
119CB_READONLY = _core_.CB_READONLY
120RA_HORIZONTAL = _core_.RA_HORIZONTAL
121RA_VERTICAL = _core_.RA_VERTICAL
122RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
123RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
124RB_GROUP = _core_.RB_GROUP
125RB_SINGLE = _core_.RB_SINGLE
126SL_HORIZONTAL = _core_.SL_HORIZONTAL
127SL_VERTICAL = _core_.SL_VERTICAL
128SL_AUTOTICKS = _core_.SL_AUTOTICKS
129SL_LABELS = _core_.SL_LABELS
130SL_LEFT = _core_.SL_LEFT
131SL_TOP = _core_.SL_TOP
132SL_RIGHT = _core_.SL_RIGHT
133SL_BOTTOM = _core_.SL_BOTTOM
134SL_BOTH = _core_.SL_BOTH
135SL_SELRANGE = _core_.SL_SELRANGE
136SB_HORIZONTAL = _core_.SB_HORIZONTAL
137SB_VERTICAL = _core_.SB_VERTICAL
138ST_SIZEGRIP = _core_.ST_SIZEGRIP
139ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
140FLOOD_SURFACE = _core_.FLOOD_SURFACE
141FLOOD_BORDER = _core_.FLOOD_BORDER
142ODDEVEN_RULE = _core_.ODDEVEN_RULE
143WINDING_RULE = _core_.WINDING_RULE
144TOOL_TOP = _core_.TOOL_TOP
145TOOL_BOTTOM = _core_.TOOL_BOTTOM
146TOOL_LEFT = _core_.TOOL_LEFT
147TOOL_RIGHT = _core_.TOOL_RIGHT
148OK = _core_.OK
149YES_NO = _core_.YES_NO
150CANCEL = _core_.CANCEL
151YES = _core_.YES
152NO = _core_.NO
153NO_DEFAULT = _core_.NO_DEFAULT
154YES_DEFAULT = _core_.YES_DEFAULT
155ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
156ICON_HAND = _core_.ICON_HAND
157ICON_QUESTION = _core_.ICON_QUESTION
158ICON_INFORMATION = _core_.ICON_INFORMATION
159ICON_STOP = _core_.ICON_STOP
160ICON_ASTERISK = _core_.ICON_ASTERISK
161ICON_MASK = _core_.ICON_MASK
162ICON_WARNING = _core_.ICON_WARNING
163ICON_ERROR = _core_.ICON_ERROR
164FORWARD = _core_.FORWARD
165BACKWARD = _core_.BACKWARD
166RESET = _core_.RESET
167HELP = _core_.HELP
168MORE = _core_.MORE
169SETUP = _core_.SETUP
170SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
171SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
172SIZE_AUTO = _core_.SIZE_AUTO
173SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
174SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
175PORTRAIT = _core_.PORTRAIT
176LANDSCAPE = _core_.LANDSCAPE
177PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
178PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
179PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
180PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
181ID_ANY = _core_.ID_ANY
182ID_SEPARATOR = _core_.ID_SEPARATOR
183ID_LOWEST = _core_.ID_LOWEST
184ID_OPEN = _core_.ID_OPEN
185ID_CLOSE = _core_.ID_CLOSE
186ID_NEW = _core_.ID_NEW
187ID_SAVE = _core_.ID_SAVE
188ID_SAVEAS = _core_.ID_SAVEAS
189ID_REVERT = _core_.ID_REVERT
190ID_EXIT = _core_.ID_EXIT
191ID_UNDO = _core_.ID_UNDO
192ID_REDO = _core_.ID_REDO
193ID_HELP = _core_.ID_HELP
194ID_PRINT = _core_.ID_PRINT
195ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
196ID_PREVIEW = _core_.ID_PREVIEW
197ID_ABOUT = _core_.ID_ABOUT
198ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
199ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
200ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
201ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
202ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
203ID_PREFERENCES = _core_.ID_PREFERENCES
204ID_CUT = _core_.ID_CUT
205ID_COPY = _core_.ID_COPY
206ID_PASTE = _core_.ID_PASTE
207ID_CLEAR = _core_.ID_CLEAR
208ID_FIND = _core_.ID_FIND
209ID_DUPLICATE = _core_.ID_DUPLICATE
210ID_SELECTALL = _core_.ID_SELECTALL
211ID_DELETE = _core_.ID_DELETE
212ID_REPLACE = _core_.ID_REPLACE
213ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
214ID_PROPERTIES = _core_.ID_PROPERTIES
215ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
216ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
217ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
218ID_VIEW_LIST = _core_.ID_VIEW_LIST
219ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
220ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
221ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
222ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
223ID_FILE1 = _core_.ID_FILE1
224ID_FILE2 = _core_.ID_FILE2
225ID_FILE3 = _core_.ID_FILE3
226ID_FILE4 = _core_.ID_FILE4
227ID_FILE5 = _core_.ID_FILE5
228ID_FILE6 = _core_.ID_FILE6
229ID_FILE7 = _core_.ID_FILE7
230ID_FILE8 = _core_.ID_FILE8
231ID_FILE9 = _core_.ID_FILE9
232ID_OK = _core_.ID_OK
233ID_CANCEL = _core_.ID_CANCEL
234ID_APPLY = _core_.ID_APPLY
235ID_YES = _core_.ID_YES
236ID_NO = _core_.ID_NO
237ID_STATIC = _core_.ID_STATIC
238ID_FORWARD = _core_.ID_FORWARD
239ID_BACKWARD = _core_.ID_BACKWARD
240ID_DEFAULT = _core_.ID_DEFAULT
241ID_MORE = _core_.ID_MORE
242ID_SETUP = _core_.ID_SETUP
243ID_RESET = _core_.ID_RESET
244ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
245ID_YESTOALL = _core_.ID_YESTOALL
246ID_NOTOALL = _core_.ID_NOTOALL
247ID_ABORT = _core_.ID_ABORT
248ID_RETRY = _core_.ID_RETRY
249ID_IGNORE = _core_.ID_IGNORE
0f63ec68
RD
250ID_ADD = _core_.ID_ADD
251ID_REMOVE = _core_.ID_REMOVE
252ID_UP = _core_.ID_UP
253ID_DOWN = _core_.ID_DOWN
254ID_HOME = _core_.ID_HOME
255ID_REFRESH = _core_.ID_REFRESH
256ID_STOP = _core_.ID_STOP
257ID_INDEX = _core_.ID_INDEX
258ID_BOLD = _core_.ID_BOLD
259ID_ITALIC = _core_.ID_ITALIC
260ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
261ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
262ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
263ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
264ID_UNDERLINE = _core_.ID_UNDERLINE
265ID_INDENT = _core_.ID_INDENT
266ID_UNINDENT = _core_.ID_UNINDENT
267ID_ZOOM_100 = _core_.ID_ZOOM_100
268ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
269ID_ZOOM_IN = _core_.ID_ZOOM_IN
270ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
271ID_UNDELETE = _core_.ID_UNDELETE
272ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
d55e5bfc
RD
273ID_HIGHEST = _core_.ID_HIGHEST
274OPEN = _core_.OPEN
275SAVE = _core_.SAVE
276HIDE_READONLY = _core_.HIDE_READONLY
277OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
278FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
279MULTIPLE = _core_.MULTIPLE
280CHANGE_DIR = _core_.CHANGE_DIR
281ACCEL_ALT = _core_.ACCEL_ALT
282ACCEL_CTRL = _core_.ACCEL_CTRL
283ACCEL_SHIFT = _core_.ACCEL_SHIFT
284ACCEL_NORMAL = _core_.ACCEL_NORMAL
285PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
286PD_APP_MODAL = _core_.PD_APP_MODAL
287PD_CAN_ABORT = _core_.PD_CAN_ABORT
288PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
289PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
290PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
62d32a5f
RD
291PD_SMOOTH = _core_.PD_SMOOTH
292PD_CAN_SKIP = _core_.PD_CAN_SKIP
d55e5bfc
RD
293DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
294DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
295MENU_TEAROFF = _core_.MENU_TEAROFF
296MB_DOCKABLE = _core_.MB_DOCKABLE
297NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
298FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
299LI_HORIZONTAL = _core_.LI_HORIZONTAL
300LI_VERTICAL = _core_.LI_VERTICAL
301WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
302WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
303WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
304WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
305WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
306WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
307MM_TEXT = _core_.MM_TEXT
308MM_LOMETRIC = _core_.MM_LOMETRIC
309MM_HIMETRIC = _core_.MM_HIMETRIC
310MM_LOENGLISH = _core_.MM_LOENGLISH
311MM_HIENGLISH = _core_.MM_HIENGLISH
312MM_TWIPS = _core_.MM_TWIPS
313MM_ISOTROPIC = _core_.MM_ISOTROPIC
314MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
315MM_POINTS = _core_.MM_POINTS
316MM_METRIC = _core_.MM_METRIC
317CENTRE = _core_.CENTRE
318CENTER = _core_.CENTER
319HORIZONTAL = _core_.HORIZONTAL
320VERTICAL = _core_.VERTICAL
321BOTH = _core_.BOTH
322LEFT = _core_.LEFT
323RIGHT = _core_.RIGHT
324UP = _core_.UP
325DOWN = _core_.DOWN
326TOP = _core_.TOP
327BOTTOM = _core_.BOTTOM
328NORTH = _core_.NORTH
329SOUTH = _core_.SOUTH
330WEST = _core_.WEST
331EAST = _core_.EAST
332ALL = _core_.ALL
333ALIGN_NOT = _core_.ALIGN_NOT
334ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
335ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
336ALIGN_LEFT = _core_.ALIGN_LEFT
337ALIGN_TOP = _core_.ALIGN_TOP
338ALIGN_RIGHT = _core_.ALIGN_RIGHT
339ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
340ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
341ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
342ALIGN_CENTER = _core_.ALIGN_CENTER
343ALIGN_CENTRE = _core_.ALIGN_CENTRE
344ALIGN_MASK = _core_.ALIGN_MASK
345STRETCH_NOT = _core_.STRETCH_NOT
346SHRINK = _core_.SHRINK
347GROW = _core_.GROW
348EXPAND = _core_.EXPAND
349SHAPED = _core_.SHAPED
350FIXED_MINSIZE = _core_.FIXED_MINSIZE
351TILE = _core_.TILE
352ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
353BORDER_DEFAULT = _core_.BORDER_DEFAULT
354BORDER_NONE = _core_.BORDER_NONE
355BORDER_STATIC = _core_.BORDER_STATIC
356BORDER_SIMPLE = _core_.BORDER_SIMPLE
357BORDER_RAISED = _core_.BORDER_RAISED
358BORDER_SUNKEN = _core_.BORDER_SUNKEN
359BORDER_DOUBLE = _core_.BORDER_DOUBLE
360BORDER_MASK = _core_.BORDER_MASK
0f63ec68
RD
361BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
362BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
363BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
d55e5bfc
RD
364DEFAULT = _core_.DEFAULT
365DECORATIVE = _core_.DECORATIVE
366ROMAN = _core_.ROMAN
367SCRIPT = _core_.SCRIPT
368SWISS = _core_.SWISS
369MODERN = _core_.MODERN
370TELETYPE = _core_.TELETYPE
371VARIABLE = _core_.VARIABLE
372FIXED = _core_.FIXED
373NORMAL = _core_.NORMAL
374LIGHT = _core_.LIGHT
375BOLD = _core_.BOLD
376ITALIC = _core_.ITALIC
377SLANT = _core_.SLANT
378SOLID = _core_.SOLID
379DOT = _core_.DOT
380LONG_DASH = _core_.LONG_DASH
381SHORT_DASH = _core_.SHORT_DASH
382DOT_DASH = _core_.DOT_DASH
383USER_DASH = _core_.USER_DASH
384TRANSPARENT = _core_.TRANSPARENT
385STIPPLE = _core_.STIPPLE
386BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
387CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
388FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
389CROSS_HATCH = _core_.CROSS_HATCH
390HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
391VERTICAL_HATCH = _core_.VERTICAL_HATCH
392JOIN_BEVEL = _core_.JOIN_BEVEL
393JOIN_MITER = _core_.JOIN_MITER
394JOIN_ROUND = _core_.JOIN_ROUND
395CAP_ROUND = _core_.CAP_ROUND
396CAP_PROJECTING = _core_.CAP_PROJECTING
397CAP_BUTT = _core_.CAP_BUTT
398CLEAR = _core_.CLEAR
399XOR = _core_.XOR
400INVERT = _core_.INVERT
401OR_REVERSE = _core_.OR_REVERSE
402AND_REVERSE = _core_.AND_REVERSE
403COPY = _core_.COPY
404AND = _core_.AND
405AND_INVERT = _core_.AND_INVERT
406NO_OP = _core_.NO_OP
407NOR = _core_.NOR
408EQUIV = _core_.EQUIV
409SRC_INVERT = _core_.SRC_INVERT
410OR_INVERT = _core_.OR_INVERT
411NAND = _core_.NAND
412OR = _core_.OR
413SET = _core_.SET
414WXK_BACK = _core_.WXK_BACK
415WXK_TAB = _core_.WXK_TAB
416WXK_RETURN = _core_.WXK_RETURN
417WXK_ESCAPE = _core_.WXK_ESCAPE
418WXK_SPACE = _core_.WXK_SPACE
419WXK_DELETE = _core_.WXK_DELETE
420WXK_START = _core_.WXK_START
421WXK_LBUTTON = _core_.WXK_LBUTTON
422WXK_RBUTTON = _core_.WXK_RBUTTON
423WXK_CANCEL = _core_.WXK_CANCEL
424WXK_MBUTTON = _core_.WXK_MBUTTON
425WXK_CLEAR = _core_.WXK_CLEAR
426WXK_SHIFT = _core_.WXK_SHIFT
427WXK_ALT = _core_.WXK_ALT
428WXK_CONTROL = _core_.WXK_CONTROL
429WXK_MENU = _core_.WXK_MENU
430WXK_PAUSE = _core_.WXK_PAUSE
431WXK_CAPITAL = _core_.WXK_CAPITAL
432WXK_PRIOR = _core_.WXK_PRIOR
433WXK_NEXT = _core_.WXK_NEXT
434WXK_END = _core_.WXK_END
435WXK_HOME = _core_.WXK_HOME
436WXK_LEFT = _core_.WXK_LEFT
437WXK_UP = _core_.WXK_UP
438WXK_RIGHT = _core_.WXK_RIGHT
439WXK_DOWN = _core_.WXK_DOWN
440WXK_SELECT = _core_.WXK_SELECT
441WXK_PRINT = _core_.WXK_PRINT
442WXK_EXECUTE = _core_.WXK_EXECUTE
443WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
444WXK_INSERT = _core_.WXK_INSERT
445WXK_HELP = _core_.WXK_HELP
446WXK_NUMPAD0 = _core_.WXK_NUMPAD0
447WXK_NUMPAD1 = _core_.WXK_NUMPAD1
448WXK_NUMPAD2 = _core_.WXK_NUMPAD2
449WXK_NUMPAD3 = _core_.WXK_NUMPAD3
450WXK_NUMPAD4 = _core_.WXK_NUMPAD4
451WXK_NUMPAD5 = _core_.WXK_NUMPAD5
452WXK_NUMPAD6 = _core_.WXK_NUMPAD6
453WXK_NUMPAD7 = _core_.WXK_NUMPAD7
454WXK_NUMPAD8 = _core_.WXK_NUMPAD8
455WXK_NUMPAD9 = _core_.WXK_NUMPAD9
456WXK_MULTIPLY = _core_.WXK_MULTIPLY
457WXK_ADD = _core_.WXK_ADD
458WXK_SEPARATOR = _core_.WXK_SEPARATOR
459WXK_SUBTRACT = _core_.WXK_SUBTRACT
460WXK_DECIMAL = _core_.WXK_DECIMAL
461WXK_DIVIDE = _core_.WXK_DIVIDE
462WXK_F1 = _core_.WXK_F1
463WXK_F2 = _core_.WXK_F2
464WXK_F3 = _core_.WXK_F3
465WXK_F4 = _core_.WXK_F4
466WXK_F5 = _core_.WXK_F5
467WXK_F6 = _core_.WXK_F6
468WXK_F7 = _core_.WXK_F7
469WXK_F8 = _core_.WXK_F8
470WXK_F9 = _core_.WXK_F9
471WXK_F10 = _core_.WXK_F10
472WXK_F11 = _core_.WXK_F11
473WXK_F12 = _core_.WXK_F12
474WXK_F13 = _core_.WXK_F13
475WXK_F14 = _core_.WXK_F14
476WXK_F15 = _core_.WXK_F15
477WXK_F16 = _core_.WXK_F16
478WXK_F17 = _core_.WXK_F17
479WXK_F18 = _core_.WXK_F18
480WXK_F19 = _core_.WXK_F19
481WXK_F20 = _core_.WXK_F20
482WXK_F21 = _core_.WXK_F21
483WXK_F22 = _core_.WXK_F22
484WXK_F23 = _core_.WXK_F23
485WXK_F24 = _core_.WXK_F24
486WXK_NUMLOCK = _core_.WXK_NUMLOCK
487WXK_SCROLL = _core_.WXK_SCROLL
488WXK_PAGEUP = _core_.WXK_PAGEUP
489WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
490WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
491WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
492WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
493WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
494WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
495WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
496WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
497WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
498WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
499WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
500WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
501WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
502WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
503WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
504WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
505WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
506WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
507WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
508WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
509WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
510WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
511WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
512WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
513WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
514WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
515WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
516WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
517WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
518WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
519WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
520PAPER_NONE = _core_.PAPER_NONE
521PAPER_LETTER = _core_.PAPER_LETTER
522PAPER_LEGAL = _core_.PAPER_LEGAL
523PAPER_A4 = _core_.PAPER_A4
524PAPER_CSHEET = _core_.PAPER_CSHEET
525PAPER_DSHEET = _core_.PAPER_DSHEET
526PAPER_ESHEET = _core_.PAPER_ESHEET
527PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
528PAPER_TABLOID = _core_.PAPER_TABLOID
529PAPER_LEDGER = _core_.PAPER_LEDGER
530PAPER_STATEMENT = _core_.PAPER_STATEMENT
531PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
532PAPER_A3 = _core_.PAPER_A3
533PAPER_A4SMALL = _core_.PAPER_A4SMALL
534PAPER_A5 = _core_.PAPER_A5
535PAPER_B4 = _core_.PAPER_B4
536PAPER_B5 = _core_.PAPER_B5
537PAPER_FOLIO = _core_.PAPER_FOLIO
538PAPER_QUARTO = _core_.PAPER_QUARTO
539PAPER_10X14 = _core_.PAPER_10X14
540PAPER_11X17 = _core_.PAPER_11X17
541PAPER_NOTE = _core_.PAPER_NOTE
542PAPER_ENV_9 = _core_.PAPER_ENV_9
543PAPER_ENV_10 = _core_.PAPER_ENV_10
544PAPER_ENV_11 = _core_.PAPER_ENV_11
545PAPER_ENV_12 = _core_.PAPER_ENV_12
546PAPER_ENV_14 = _core_.PAPER_ENV_14
547PAPER_ENV_DL = _core_.PAPER_ENV_DL
548PAPER_ENV_C5 = _core_.PAPER_ENV_C5
549PAPER_ENV_C3 = _core_.PAPER_ENV_C3
550PAPER_ENV_C4 = _core_.PAPER_ENV_C4
551PAPER_ENV_C6 = _core_.PAPER_ENV_C6
552PAPER_ENV_C65 = _core_.PAPER_ENV_C65
553PAPER_ENV_B4 = _core_.PAPER_ENV_B4
554PAPER_ENV_B5 = _core_.PAPER_ENV_B5
555PAPER_ENV_B6 = _core_.PAPER_ENV_B6
556PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
557PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
558PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
559PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
560PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
561PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
562PAPER_ISO_B4 = _core_.PAPER_ISO_B4
563PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
564PAPER_9X11 = _core_.PAPER_9X11
565PAPER_10X11 = _core_.PAPER_10X11
566PAPER_15X11 = _core_.PAPER_15X11
567PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
568PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
569PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
570PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
571PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
572PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
573PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
574PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
575PAPER_A_PLUS = _core_.PAPER_A_PLUS
576PAPER_B_PLUS = _core_.PAPER_B_PLUS
577PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
578PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
579PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
580PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
581PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
582PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
583PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
584PAPER_A2 = _core_.PAPER_A2
585PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
586PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
587DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
588DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
589DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
590ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
591ITEM_NORMAL = _core_.ITEM_NORMAL
592ITEM_CHECK = _core_.ITEM_CHECK
593ITEM_RADIO = _core_.ITEM_RADIO
594ITEM_MAX = _core_.ITEM_MAX
595HT_NOWHERE = _core_.HT_NOWHERE
596HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
597HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
598HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
599HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
600HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
601HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
602HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
603HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
604HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
605HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
606HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
607HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
608HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
609HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
610HT_MAX = _core_.HT_MAX
611MOD_NONE = _core_.MOD_NONE
612MOD_ALT = _core_.MOD_ALT
613MOD_CONTROL = _core_.MOD_CONTROL
614MOD_SHIFT = _core_.MOD_SHIFT
615MOD_WIN = _core_.MOD_WIN
616UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
617UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
618UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
619#---------------------------------------------------------------------------
620
621class Object(object):
622 """
623 The base class for most wx objects, although in wxPython not
624 much functionality is needed nor exposed.
625 """
626 def __init__(self): raise RuntimeError, "No constructor defined"
627 def __repr__(self):
628 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
629 def GetClassName(*args, **kwargs):
630 """
631 GetClassName(self) -> String
632
633 Returns the class name of the C++ class using wxRTTI.
634 """
635 return _core_.Object_GetClassName(*args, **kwargs)
636
637 def Destroy(*args, **kwargs):
638 """
639 Destroy(self)
640
641 Deletes the C++ object this Python object is a proxy for.
642 """
643 return _core_.Object_Destroy(*args, **kwargs)
644
645
646class ObjectPtr(Object):
647 def __init__(self, this):
648 self.this = this
649 if not hasattr(self,"thisown"): self.thisown = 0
650 self.__class__ = Object
651_core_.Object_swigregister(ObjectPtr)
652_wxPySetDictionary = _core_._wxPySetDictionary
653
654_wxPyFixStockObjects = _core_._wxPyFixStockObjects
655
656cvar = _core_.cvar
657EmptyString = cvar.EmptyString
658
659#---------------------------------------------------------------------------
660
661BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
662BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
663BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
664BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
665BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
666BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
667BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
668BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
669BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
670BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
671BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
672BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
673BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
674BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
675BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
676BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
677BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
678BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
679BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
680BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
681CURSOR_NONE = _core_.CURSOR_NONE
682CURSOR_ARROW = _core_.CURSOR_ARROW
683CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
684CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
685CURSOR_CHAR = _core_.CURSOR_CHAR
686CURSOR_CROSS = _core_.CURSOR_CROSS
687CURSOR_HAND = _core_.CURSOR_HAND
688CURSOR_IBEAM = _core_.CURSOR_IBEAM
689CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
690CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
691CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
692CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
693CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
694CURSOR_PENCIL = _core_.CURSOR_PENCIL
695CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
696CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
697CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
698CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
699CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
700CURSOR_SIZENS = _core_.CURSOR_SIZENS
701CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
702CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
703CURSOR_SIZING = _core_.CURSOR_SIZING
704CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
705CURSOR_WAIT = _core_.CURSOR_WAIT
706CURSOR_WATCH = _core_.CURSOR_WATCH
707CURSOR_BLANK = _core_.CURSOR_BLANK
708CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
709CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
710CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
711CURSOR_MAX = _core_.CURSOR_MAX
712#---------------------------------------------------------------------------
713
714class Size(object):
715 """
15817c7e 716 wx.Size is a useful data structure used to represent the size of
36ed4f51
RD
717 something. It simply contians integer width and height
718 proprtites. In most places in wxPython where a wx.Size is
719 expected a (width, height) tuple can be used instead.
d55e5bfc
RD
720 """
721 def __repr__(self):
722 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
723 width = property(_core_.Size_width_get, _core_.Size_width_set)
724 height = property(_core_.Size_height_get, _core_.Size_height_set)
725 x = width; y = height
726 def __init__(self, *args, **kwargs):
727 """
728 __init__(self, int w=0, int h=0) -> Size
729
730 Creates a size object.
731 """
732 newobj = _core_.new_Size(*args, **kwargs)
733 self.this = newobj.this
734 self.thisown = 1
735 del newobj.thisown
736 def __del__(self, destroy=_core_.delete_Size):
737 """__del__(self)"""
738 try:
739 if self.thisown: destroy(self)
740 except: pass
741
742 def __eq__(*args, **kwargs):
743 """
744 __eq__(self, Size sz) -> bool
745
746 Test for equality of wx.Size objects.
747 """
748 return _core_.Size___eq__(*args, **kwargs)
749
750 def __ne__(*args, **kwargs):
751 """
752 __ne__(self, Size sz) -> bool
753
754 Test for inequality.
755 """
756 return _core_.Size___ne__(*args, **kwargs)
757
758 def __add__(*args, **kwargs):
759 """
760 __add__(self, Size sz) -> Size
761
762 Add sz's proprties to this and return the result.
763 """
764 return _core_.Size___add__(*args, **kwargs)
765
766 def __sub__(*args, **kwargs):
767 """
768 __sub__(self, Size sz) -> Size
769
770 Subtract sz's properties from this and return the result.
771 """
772 return _core_.Size___sub__(*args, **kwargs)
773
774 def IncTo(*args, **kwargs):
775 """
776 IncTo(self, Size sz)
777
778 Increments this object so that both of its dimensions are not less
779 than the corresponding dimensions of the size.
780 """
781 return _core_.Size_IncTo(*args, **kwargs)
782
783 def DecTo(*args, **kwargs):
784 """
785 DecTo(self, Size sz)
786
787 Decrements this object so that both of its dimensions are not greater
788 than the corresponding dimensions of the size.
789 """
790 return _core_.Size_DecTo(*args, **kwargs)
791
792 def Set(*args, **kwargs):
793 """
794 Set(self, int w, int h)
795
796 Set both width and height.
797 """
798 return _core_.Size_Set(*args, **kwargs)
799
800 def SetWidth(*args, **kwargs):
801 """SetWidth(self, int w)"""
802 return _core_.Size_SetWidth(*args, **kwargs)
803
804 def SetHeight(*args, **kwargs):
805 """SetHeight(self, int h)"""
806 return _core_.Size_SetHeight(*args, **kwargs)
807
808 def GetWidth(*args, **kwargs):
809 """GetWidth(self) -> int"""
810 return _core_.Size_GetWidth(*args, **kwargs)
811
812 def GetHeight(*args, **kwargs):
813 """GetHeight(self) -> int"""
814 return _core_.Size_GetHeight(*args, **kwargs)
815
816 def IsFullySpecified(*args, **kwargs):
817 """
818 IsFullySpecified(self) -> bool
819
820 Returns True if both components of the size are non-default values.
821 """
822 return _core_.Size_IsFullySpecified(*args, **kwargs)
823
824 def SetDefaults(*args, **kwargs):
825 """
826 SetDefaults(self, Size size)
827
15817c7e
RD
828 Combine this size with the other one replacing the default components
829 of this object (i.e. equal to -1) with those of the other.
d55e5bfc
RD
830 """
831 return _core_.Size_SetDefaults(*args, **kwargs)
832
833 def Get(*args, **kwargs):
834 """
835 Get() -> (width,height)
836
837 Returns the width and height properties as a tuple.
838 """
839 return _core_.Size_Get(*args, **kwargs)
840
15817c7e 841 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
842 def __str__(self): return str(self.Get())
843 def __repr__(self): return 'wx.Size'+str(self.Get())
844 def __len__(self): return len(self.Get())
845 def __getitem__(self, index): return self.Get()[index]
846 def __setitem__(self, index, val):
847 if index == 0: self.width = val
848 elif index == 1: self.height = val
849 else: raise IndexError
850 def __nonzero__(self): return self.Get() != (0,0)
851 __safe_for_unpickling__ = True
852 def __reduce__(self): return (wx.Size, self.Get())
853
854
855class SizePtr(Size):
856 def __init__(self, this):
857 self.this = this
858 if not hasattr(self,"thisown"): self.thisown = 0
859 self.__class__ = Size
860_core_.Size_swigregister(SizePtr)
861
862#---------------------------------------------------------------------------
863
864class RealPoint(object):
865 """
15817c7e
RD
866 A data structure for representing a point or position with floating
867 point x and y properties. In wxPython most places that expect a
868 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc
RD
869 """
870 def __repr__(self):
871 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
872 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
873 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
874 def __init__(self, *args, **kwargs):
875 """
876 __init__(self, double x=0.0, double y=0.0) -> RealPoint
877
878 Create a wx.RealPoint object
879 """
880 newobj = _core_.new_RealPoint(*args, **kwargs)
881 self.this = newobj.this
882 self.thisown = 1
883 del newobj.thisown
884 def __del__(self, destroy=_core_.delete_RealPoint):
885 """__del__(self)"""
886 try:
887 if self.thisown: destroy(self)
888 except: pass
889
890 def __eq__(*args, **kwargs):
891 """
892 __eq__(self, RealPoint pt) -> bool
893
894 Test for equality of wx.RealPoint objects.
895 """
896 return _core_.RealPoint___eq__(*args, **kwargs)
897
898 def __ne__(*args, **kwargs):
899 """
900 __ne__(self, RealPoint pt) -> bool
901
902 Test for inequality of wx.RealPoint objects.
903 """
904 return _core_.RealPoint___ne__(*args, **kwargs)
905
906 def __add__(*args, **kwargs):
907 """
908 __add__(self, RealPoint pt) -> RealPoint
909
910 Add pt's proprties to this and return the result.
911 """
912 return _core_.RealPoint___add__(*args, **kwargs)
913
914 def __sub__(*args, **kwargs):
915 """
916 __sub__(self, RealPoint pt) -> RealPoint
917
918 Subtract pt's proprties from this and return the result
919 """
920 return _core_.RealPoint___sub__(*args, **kwargs)
921
922 def Set(*args, **kwargs):
923 """
924 Set(self, double x, double y)
925
926 Set both the x and y properties
927 """
928 return _core_.RealPoint_Set(*args, **kwargs)
929
930 def Get(*args, **kwargs):
931 """
932 Get() -> (x,y)
933
934 Return the x and y properties as a tuple.
935 """
936 return _core_.RealPoint_Get(*args, **kwargs)
937
15817c7e 938 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
939 def __str__(self): return str(self.Get())
940 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
941 def __len__(self): return len(self.Get())
942 def __getitem__(self, index): return self.Get()[index]
943 def __setitem__(self, index, val):
944 if index == 0: self.x = val
945 elif index == 1: self.y = val
946 else: raise IndexError
947 def __nonzero__(self): return self.Get() != (0.0, 0.0)
948 __safe_for_unpickling__ = True
949 def __reduce__(self): return (wx.RealPoint, self.Get())
950
951
952class RealPointPtr(RealPoint):
953 def __init__(self, this):
954 self.this = this
955 if not hasattr(self,"thisown"): self.thisown = 0
956 self.__class__ = RealPoint
957_core_.RealPoint_swigregister(RealPointPtr)
958
959#---------------------------------------------------------------------------
960
961class Point(object):
962 """
15817c7e
RD
963 A data structure for representing a point or position with integer x
964 and y properties. Most places in wxPython that expect a wx.Point can
965 also accept a (x,y) tuple.
d55e5bfc
RD
966 """
967 def __repr__(self):
968 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
969 x = property(_core_.Point_x_get, _core_.Point_x_set)
970 y = property(_core_.Point_y_get, _core_.Point_y_set)
971 def __init__(self, *args, **kwargs):
972 """
973 __init__(self, int x=0, int y=0) -> Point
974
975 Create a wx.Point object
976 """
977 newobj = _core_.new_Point(*args, **kwargs)
978 self.this = newobj.this
979 self.thisown = 1
980 del newobj.thisown
981 def __del__(self, destroy=_core_.delete_Point):
982 """__del__(self)"""
983 try:
984 if self.thisown: destroy(self)
985 except: pass
986
987 def __eq__(*args, **kwargs):
988 """
989 __eq__(self, Point pt) -> bool
990
991 Test for equality of wx.Point objects.
992 """
993 return _core_.Point___eq__(*args, **kwargs)
994
995 def __ne__(*args, **kwargs):
996 """
997 __ne__(self, Point pt) -> bool
998
999 Test for inequality of wx.Point objects.
1000 """
1001 return _core_.Point___ne__(*args, **kwargs)
1002
1003 def __add__(*args, **kwargs):
1004 """
1005 __add__(self, Point pt) -> Point
1006
1007 Add pt's proprties to this and return the result.
1008 """
1009 return _core_.Point___add__(*args, **kwargs)
1010
1011 def __sub__(*args, **kwargs):
1012 """
1013 __sub__(self, Point pt) -> Point
1014
1015 Subtract pt's proprties from this and return the result
1016 """
1017 return _core_.Point___sub__(*args, **kwargs)
1018
1019 def __iadd__(*args, **kwargs):
1020 """
1021 __iadd__(self, Point pt) -> Point
1022
1023 Add pt to this object.
1024 """
1025 return _core_.Point___iadd__(*args, **kwargs)
1026
1027 def __isub__(*args, **kwargs):
1028 """
1029 __isub__(self, Point pt) -> Point
1030
1031 Subtract pt from this object.
1032 """
1033 return _core_.Point___isub__(*args, **kwargs)
1034
1035 def Set(*args, **kwargs):
1036 """
1037 Set(self, long x, long y)
1038
1039 Set both the x and y properties
1040 """
1041 return _core_.Point_Set(*args, **kwargs)
1042
1043 def Get(*args, **kwargs):
1044 """
1045 Get() -> (x,y)
1046
1047 Return the x and y properties as a tuple.
1048 """
1049 return _core_.Point_Get(*args, **kwargs)
1050
15817c7e 1051 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1052 def __str__(self): return str(self.Get())
1053 def __repr__(self): return 'wx.Point'+str(self.Get())
1054 def __len__(self): return len(self.Get())
1055 def __getitem__(self, index): return self.Get()[index]
1056 def __setitem__(self, index, val):
1057 if index == 0: self.x = val
1058 elif index == 1: self.y = val
1059 else: raise IndexError
1060 def __nonzero__(self): return self.Get() != (0,0)
1061 __safe_for_unpickling__ = True
1062 def __reduce__(self): return (wx.Point, self.Get())
1063
1064
1065class PointPtr(Point):
1066 def __init__(self, this):
1067 self.this = this
1068 if not hasattr(self,"thisown"): self.thisown = 0
1069 self.__class__ = Point
1070_core_.Point_swigregister(PointPtr)
1071
1072#---------------------------------------------------------------------------
1073
1074class Rect(object):
1075 """
15817c7e
RD
1076 A class for representing and manipulating rectangles. It has x, y,
1077 width and height properties. In wxPython most palces that expect a
1078 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc
RD
1079 """
1080 def __repr__(self):
1081 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1082 def __init__(self, *args, **kwargs):
1083 """
1084 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1085
1086 Create a new Rect object.
1087 """
1088 newobj = _core_.new_Rect(*args, **kwargs)
1089 self.this = newobj.this
1090 self.thisown = 1
1091 del newobj.thisown
1092 def __del__(self, destroy=_core_.delete_Rect):
1093 """__del__(self)"""
1094 try:
1095 if self.thisown: destroy(self)
1096 except: pass
1097
1098 def GetX(*args, **kwargs):
1099 """GetX(self) -> int"""
1100 return _core_.Rect_GetX(*args, **kwargs)
1101
1102 def SetX(*args, **kwargs):
1103 """SetX(self, int x)"""
1104 return _core_.Rect_SetX(*args, **kwargs)
1105
1106 def GetY(*args, **kwargs):
1107 """GetY(self) -> int"""
1108 return _core_.Rect_GetY(*args, **kwargs)
1109
1110 def SetY(*args, **kwargs):
1111 """SetY(self, int y)"""
1112 return _core_.Rect_SetY(*args, **kwargs)
1113
1114 def GetWidth(*args, **kwargs):
1115 """GetWidth(self) -> int"""
1116 return _core_.Rect_GetWidth(*args, **kwargs)
1117
1118 def SetWidth(*args, **kwargs):
1119 """SetWidth(self, int w)"""
1120 return _core_.Rect_SetWidth(*args, **kwargs)
1121
1122 def GetHeight(*args, **kwargs):
1123 """GetHeight(self) -> int"""
1124 return _core_.Rect_GetHeight(*args, **kwargs)
1125
1126 def SetHeight(*args, **kwargs):
1127 """SetHeight(self, int h)"""
1128 return _core_.Rect_SetHeight(*args, **kwargs)
1129
1130 def GetPosition(*args, **kwargs):
1131 """GetPosition(self) -> Point"""
1132 return _core_.Rect_GetPosition(*args, **kwargs)
1133
1134 def SetPosition(*args, **kwargs):
1135 """SetPosition(self, Point p)"""
1136 return _core_.Rect_SetPosition(*args, **kwargs)
1137
1138 def GetSize(*args, **kwargs):
1139 """GetSize(self) -> Size"""
1140 return _core_.Rect_GetSize(*args, **kwargs)
1141
1142 def SetSize(*args, **kwargs):
1143 """SetSize(self, Size s)"""
1144 return _core_.Rect_SetSize(*args, **kwargs)
1145
1146 def GetTopLeft(*args, **kwargs):
1147 """GetTopLeft(self) -> Point"""
1148 return _core_.Rect_GetTopLeft(*args, **kwargs)
1149
1150 def SetTopLeft(*args, **kwargs):
1151 """SetTopLeft(self, Point p)"""
1152 return _core_.Rect_SetTopLeft(*args, **kwargs)
1153
1154 def GetBottomRight(*args, **kwargs):
1155 """GetBottomRight(self) -> Point"""
1156 return _core_.Rect_GetBottomRight(*args, **kwargs)
1157
1158 def SetBottomRight(*args, **kwargs):
1159 """SetBottomRight(self, Point p)"""
1160 return _core_.Rect_SetBottomRight(*args, **kwargs)
1161
1162 def GetLeft(*args, **kwargs):
1163 """GetLeft(self) -> int"""
1164 return _core_.Rect_GetLeft(*args, **kwargs)
1165
1166 def GetTop(*args, **kwargs):
1167 """GetTop(self) -> int"""
1168 return _core_.Rect_GetTop(*args, **kwargs)
1169
1170 def GetBottom(*args, **kwargs):
1171 """GetBottom(self) -> int"""
1172 return _core_.Rect_GetBottom(*args, **kwargs)
1173
1174 def GetRight(*args, **kwargs):
1175 """GetRight(self) -> int"""
1176 return _core_.Rect_GetRight(*args, **kwargs)
1177
1178 def SetLeft(*args, **kwargs):
1179 """SetLeft(self, int left)"""
1180 return _core_.Rect_SetLeft(*args, **kwargs)
1181
1182 def SetRight(*args, **kwargs):
1183 """SetRight(self, int right)"""
1184 return _core_.Rect_SetRight(*args, **kwargs)
1185
1186 def SetTop(*args, **kwargs):
1187 """SetTop(self, int top)"""
1188 return _core_.Rect_SetTop(*args, **kwargs)
1189
1190 def SetBottom(*args, **kwargs):
1191 """SetBottom(self, int bottom)"""
1192 return _core_.Rect_SetBottom(*args, **kwargs)
1193
1194 position = property(GetPosition, SetPosition)
1195 size = property(GetSize, SetSize)
1196 left = property(GetLeft, SetLeft)
1197 right = property(GetRight, SetRight)
1198 top = property(GetTop, SetTop)
1199 bottom = property(GetBottom, SetBottom)
1200
1201 def Inflate(*args, **kwargs):
1202 """
1203 Inflate(self, int dx, int dy) -> Rect
1204
15817c7e 1205 Increase the rectangle size by dx in x direction and dy in y
5cbf236d 1206 direction. Both (or one of) parameters may be negative to decrease the
15817c7e 1207 rectangle size.
d55e5bfc
RD
1208 """
1209 return _core_.Rect_Inflate(*args, **kwargs)
1210
1211 def Deflate(*args, **kwargs):
1212 """
1213 Deflate(self, int dx, int dy) -> Rect
1214
15817c7e 1215 Decrease the rectangle size by dx in x direction and dy in y
5cbf236d 1216 direction. Both (or one of) parameters may be negative to increase the
15817c7e 1217 rectngle size. This method is the opposite of Inflate.
d55e5bfc
RD
1218 """
1219 return _core_.Rect_Deflate(*args, **kwargs)
1220
1221 def OffsetXY(*args, **kwargs):
1222 """
1223 OffsetXY(self, int dx, int dy)
1224
15817c7e
RD
1225 Moves the rectangle by the specified offset. If dx is positive, the
1226 rectangle is moved to the right, if dy is positive, it is moved to the
1227 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc
RD
1228 """
1229 return _core_.Rect_OffsetXY(*args, **kwargs)
1230
1231 def Offset(*args, **kwargs):
1232 """
1233 Offset(self, Point pt)
1234
1235 Same as OffsetXY but uses dx,dy from Point
1236 """
1237 return _core_.Rect_Offset(*args, **kwargs)
1238
1239 def Intersect(*args, **kwargs):
1240 """
1241 Intersect(self, Rect rect) -> Rect
1242
5cbf236d 1243 Returns the intersectsion of this rectangle and rect.
d55e5bfc
RD
1244 """
1245 return _core_.Rect_Intersect(*args, **kwargs)
1246
5cbf236d
RD
1247 def Union(*args, **kwargs):
1248 """
1249 Union(self, Rect rect) -> Rect
1250
1251 Returns the union of this rectangle and rect.
1252 """
1253 return _core_.Rect_Union(*args, **kwargs)
1254
d55e5bfc
RD
1255 def __add__(*args, **kwargs):
1256 """
1257 __add__(self, Rect rect) -> Rect
1258
1259 Add the properties of rect to this rectangle and return the result.
1260 """
1261 return _core_.Rect___add__(*args, **kwargs)
1262
1263 def __iadd__(*args, **kwargs):
1264 """
1265 __iadd__(self, Rect rect) -> Rect
1266
1267 Add the properties of rect to this rectangle, updating this rectangle.
1268 """
1269 return _core_.Rect___iadd__(*args, **kwargs)
1270
1271 def __eq__(*args, **kwargs):
1272 """
1273 __eq__(self, Rect rect) -> bool
1274
1275 Test for equality.
1276 """
1277 return _core_.Rect___eq__(*args, **kwargs)
1278
1279 def __ne__(*args, **kwargs):
1280 """
1281 __ne__(self, Rect rect) -> bool
1282
1283 Test for inequality.
1284 """
1285 return _core_.Rect___ne__(*args, **kwargs)
1286
1287 def InsideXY(*args, **kwargs):
1288 """
1289 InsideXY(self, int x, int y) -> bool
1290
1291 Return True if the point is (not strcitly) inside the rect.
1292 """
1293 return _core_.Rect_InsideXY(*args, **kwargs)
1294
1295 def Inside(*args, **kwargs):
1296 """
1297 Inside(self, Point pt) -> bool
1298
1299 Return True if the point is (not strcitly) inside the rect.
1300 """
1301 return _core_.Rect_Inside(*args, **kwargs)
1302
1303 def Intersects(*args, **kwargs):
1304 """
1305 Intersects(self, Rect rect) -> bool
1306
1307 Returns True if the rectangles have a non empty intersection.
1308 """
1309 return _core_.Rect_Intersects(*args, **kwargs)
1310
1311 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1312 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1313 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1314 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1315 def Set(*args, **kwargs):
1316 """
1317 Set(self, int x=0, int y=0, int width=0, int height=0)
1318
1319 Set all rectangle properties.
1320 """
1321 return _core_.Rect_Set(*args, **kwargs)
1322
1323 def Get(*args, **kwargs):
1324 """
1325 Get() -> (x,y,width,height)
1326
1327 Return the rectangle properties as a tuple.
1328 """
1329 return _core_.Rect_Get(*args, **kwargs)
1330
15817c7e 1331 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1332 def __str__(self): return str(self.Get())
1333 def __repr__(self): return 'wx.Rect'+str(self.Get())
1334 def __len__(self): return len(self.Get())
1335 def __getitem__(self, index): return self.Get()[index]
1336 def __setitem__(self, index, val):
1337 if index == 0: self.x = val
1338 elif index == 1: self.y = val
1339 elif index == 2: self.width = val
1340 elif index == 3: self.height = val
1341 else: raise IndexError
1342 def __nonzero__(self): return self.Get() != (0,0,0,0)
1343 __safe_for_unpickling__ = True
1344 def __reduce__(self): return (wx.Rect, self.Get())
1345
1346
1347class RectPtr(Rect):
1348 def __init__(self, this):
1349 self.this = this
1350 if not hasattr(self,"thisown"): self.thisown = 0
1351 self.__class__ = Rect
1352_core_.Rect_swigregister(RectPtr)
1353
1354def RectPP(*args, **kwargs):
1355 """
1356 RectPP(Point topLeft, Point bottomRight) -> Rect
1357
1358 Create a new Rect object from Points representing two corners.
1359 """
1360 val = _core_.new_RectPP(*args, **kwargs)
1361 val.thisown = 1
1362 return val
1363
1364def RectPS(*args, **kwargs):
1365 """
1366 RectPS(Point pos, Size size) -> Rect
1367
1368 Create a new Rect from a position and size.
1369 """
1370 val = _core_.new_RectPS(*args, **kwargs)
1371 val.thisown = 1
1372 return val
1373
070c48b4
RD
1374def RectS(*args, **kwargs):
1375 """
1376 RectS(Size size) -> Rect
1377
1378 Create a new Rect from a size only.
1379 """
1380 val = _core_.new_RectS(*args, **kwargs)
1381 val.thisown = 1
1382 return val
1383
d55e5bfc
RD
1384
1385def IntersectRect(*args, **kwargs):
1386 """
1387 IntersectRect(Rect r1, Rect r2) -> Rect
1388
1389 Calculate and return the intersection of r1 and r2.
1390 """
1391 return _core_.IntersectRect(*args, **kwargs)
1392#---------------------------------------------------------------------------
1393
1394class Point2D(object):
15817c7e
RD
1395 """
1396 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1397 with floating point values.
1398 """
d55e5bfc
RD
1399 def __repr__(self):
1400 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1401 def __init__(self, *args, **kwargs):
1402 """
1403 __init__(self, double x=0.0, double y=0.0) -> Point2D
1404
1405 Create a w.Point2D object.
1406 """
1407 newobj = _core_.new_Point2D(*args, **kwargs)
1408 self.this = newobj.this
1409 self.thisown = 1
1410 del newobj.thisown
1411 def GetFloor(*args, **kwargs):
fd2dc343
RD
1412 """
1413 GetFloor() -> (x,y)
1414
1415 Convert to integer
1416 """
d55e5bfc
RD
1417 return _core_.Point2D_GetFloor(*args, **kwargs)
1418
1419 def GetRounded(*args, **kwargs):
fd2dc343
RD
1420 """
1421 GetRounded() -> (x,y)
1422
1423 Convert to integer
1424 """
d55e5bfc
RD
1425 return _core_.Point2D_GetRounded(*args, **kwargs)
1426
1427 def GetVectorLength(*args, **kwargs):
1428 """GetVectorLength(self) -> double"""
1429 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1430
1431 def GetVectorAngle(*args, **kwargs):
1432 """GetVectorAngle(self) -> double"""
1433 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1434
1435 def SetVectorLength(*args, **kwargs):
1436 """SetVectorLength(self, double length)"""
1437 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1438
1439 def SetVectorAngle(*args, **kwargs):
1440 """SetVectorAngle(self, double degrees)"""
1441 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1442
1443 def SetPolarCoordinates(self, angle, length):
1444 self.SetVectorLength(length)
1445 self.SetVectorAngle(angle)
1446 def Normalize(self):
1447 self.SetVectorLength(1.0)
1448
1449 def GetDistance(*args, **kwargs):
1450 """GetDistance(self, Point2D pt) -> double"""
1451 return _core_.Point2D_GetDistance(*args, **kwargs)
1452
1453 def GetDistanceSquare(*args, **kwargs):
1454 """GetDistanceSquare(self, Point2D pt) -> double"""
1455 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1456
1457 def GetDotProduct(*args, **kwargs):
1458 """GetDotProduct(self, Point2D vec) -> double"""
1459 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1460
1461 def GetCrossProduct(*args, **kwargs):
1462 """GetCrossProduct(self, Point2D vec) -> double"""
1463 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1464
1465 def __neg__(*args, **kwargs):
1466 """
1467 __neg__(self) -> Point2D
1468
1469 the reflection of this point
1470 """
1471 return _core_.Point2D___neg__(*args, **kwargs)
1472
1473 def __iadd__(*args, **kwargs):
1474 """__iadd__(self, Point2D pt) -> Point2D"""
1475 return _core_.Point2D___iadd__(*args, **kwargs)
1476
1477 def __isub__(*args, **kwargs):
1478 """__isub__(self, Point2D pt) -> Point2D"""
1479 return _core_.Point2D___isub__(*args, **kwargs)
1480
1481 def __imul__(*args, **kwargs):
1482 """__imul__(self, Point2D pt) -> Point2D"""
1483 return _core_.Point2D___imul__(*args, **kwargs)
1484
1485 def __idiv__(*args, **kwargs):
1486 """__idiv__(self, Point2D pt) -> Point2D"""
1487 return _core_.Point2D___idiv__(*args, **kwargs)
1488
1489 def __eq__(*args, **kwargs):
1490 """
1491 __eq__(self, Point2D pt) -> bool
1492
1493 Test for equality
1494 """
1495 return _core_.Point2D___eq__(*args, **kwargs)
1496
1497 def __ne__(*args, **kwargs):
1498 """
1499 __ne__(self, Point2D pt) -> bool
1500
1501 Test for inequality
1502 """
1503 return _core_.Point2D___ne__(*args, **kwargs)
1504
1505 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1506 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1507 def Set(*args, **kwargs):
1508 """Set(self, double x=0, double y=0)"""
1509 return _core_.Point2D_Set(*args, **kwargs)
1510
1511 def Get(*args, **kwargs):
1512 """
1513 Get() -> (x,y)
1514
1515 Return x and y properties as a tuple.
1516 """
1517 return _core_.Point2D_Get(*args, **kwargs)
1518
15817c7e 1519 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1520 def __str__(self): return str(self.Get())
1521 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1522 def __len__(self): return len(self.Get())
1523 def __getitem__(self, index): return self.Get()[index]
1524 def __setitem__(self, index, val):
1525 if index == 0: self.x = val
1526 elif index == 1: self.y = val
1527 else: raise IndexError
1528 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1529 __safe_for_unpickling__ = True
1530 def __reduce__(self): return (wx.Point2D, self.Get())
1531
1532
1533class Point2DPtr(Point2D):
1534 def __init__(self, this):
1535 self.this = this
1536 if not hasattr(self,"thisown"): self.thisown = 0
1537 self.__class__ = Point2D
1538_core_.Point2D_swigregister(Point2DPtr)
1539
1540def Point2DCopy(*args, **kwargs):
1541 """
1542 Point2DCopy(Point2D pt) -> Point2D
1543
1544 Create a w.Point2D object.
1545 """
1546 val = _core_.new_Point2DCopy(*args, **kwargs)
1547 val.thisown = 1
1548 return val
1549
1550def Point2DFromPoint(*args, **kwargs):
1551 """
1552 Point2DFromPoint(Point pt) -> Point2D
1553
1554 Create a w.Point2D object.
1555 """
1556 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1557 val.thisown = 1
1558 return val
1559
1560#---------------------------------------------------------------------------
1561
1562FromStart = _core_.FromStart
1563FromCurrent = _core_.FromCurrent
1564FromEnd = _core_.FromEnd
1565class InputStream(object):
36ed4f51 1566 """Proxy of C++ InputStream class"""
d55e5bfc
RD
1567 def __repr__(self):
1568 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1569 def __init__(self, *args, **kwargs):
1570 """__init__(self, PyObject p) -> InputStream"""
1571 newobj = _core_.new_InputStream(*args, **kwargs)
1572 self.this = newobj.this
1573 self.thisown = 1
1574 del newobj.thisown
8fb0e70a
RD
1575 def __del__(self, destroy=_core_.delete_InputStream):
1576 """__del__(self)"""
1577 try:
1578 if self.thisown: destroy(self)
1579 except: pass
1580
d55e5bfc
RD
1581 def close(*args, **kwargs):
1582 """close(self)"""
1583 return _core_.InputStream_close(*args, **kwargs)
1584
1585 def flush(*args, **kwargs):
1586 """flush(self)"""
1587 return _core_.InputStream_flush(*args, **kwargs)
1588
1589 def eof(*args, **kwargs):
1590 """eof(self) -> bool"""
1591 return _core_.InputStream_eof(*args, **kwargs)
1592
1593 def read(*args, **kwargs):
1594 """read(self, int size=-1) -> PyObject"""
1595 return _core_.InputStream_read(*args, **kwargs)
1596
1597 def readline(*args, **kwargs):
1598 """readline(self, int size=-1) -> PyObject"""
1599 return _core_.InputStream_readline(*args, **kwargs)
1600
1601 def readlines(*args, **kwargs):
1602 """readlines(self, int sizehint=-1) -> PyObject"""
1603 return _core_.InputStream_readlines(*args, **kwargs)
1604
1605 def seek(*args, **kwargs):
1606 """seek(self, int offset, int whence=0)"""
1607 return _core_.InputStream_seek(*args, **kwargs)
1608
1609 def tell(*args, **kwargs):
1610 """tell(self) -> int"""
1611 return _core_.InputStream_tell(*args, **kwargs)
1612
1613 def Peek(*args, **kwargs):
1614 """Peek(self) -> char"""
1615 return _core_.InputStream_Peek(*args, **kwargs)
1616
1617 def GetC(*args, **kwargs):
1618 """GetC(self) -> char"""
1619 return _core_.InputStream_GetC(*args, **kwargs)
1620
1621 def LastRead(*args, **kwargs):
1622 """LastRead(self) -> size_t"""
1623 return _core_.InputStream_LastRead(*args, **kwargs)
1624
1625 def CanRead(*args, **kwargs):
1626 """CanRead(self) -> bool"""
1627 return _core_.InputStream_CanRead(*args, **kwargs)
1628
1629 def Eof(*args, **kwargs):
1630 """Eof(self) -> bool"""
1631 return _core_.InputStream_Eof(*args, **kwargs)
1632
1633 def Ungetch(*args, **kwargs):
1634 """Ungetch(self, char c) -> bool"""
1635 return _core_.InputStream_Ungetch(*args, **kwargs)
1636
1637 def SeekI(*args, **kwargs):
1638 """SeekI(self, long pos, int mode=FromStart) -> long"""
1639 return _core_.InputStream_SeekI(*args, **kwargs)
1640
1641 def TellI(*args, **kwargs):
1642 """TellI(self) -> long"""
1643 return _core_.InputStream_TellI(*args, **kwargs)
1644
1645
1646class InputStreamPtr(InputStream):
1647 def __init__(self, this):
1648 self.this = this
1649 if not hasattr(self,"thisown"): self.thisown = 0
1650 self.__class__ = InputStream
1651_core_.InputStream_swigregister(InputStreamPtr)
1652DefaultPosition = cvar.DefaultPosition
1653DefaultSize = cvar.DefaultSize
1654
1655class OutputStream(object):
36ed4f51 1656 """Proxy of C++ OutputStream class"""
d55e5bfc
RD
1657 def __init__(self): raise RuntimeError, "No constructor defined"
1658 def __repr__(self):
1659 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1660 def write(*args, **kwargs):
1661 """write(self, PyObject obj)"""
1662 return _core_.OutputStream_write(*args, **kwargs)
1663
1664
1665class OutputStreamPtr(OutputStream):
1666 def __init__(self, this):
1667 self.this = this
1668 if not hasattr(self,"thisown"): self.thisown = 0
1669 self.__class__ = OutputStream
1670_core_.OutputStream_swigregister(OutputStreamPtr)
1671
1672#---------------------------------------------------------------------------
1673
1674class FSFile(Object):
36ed4f51 1675 """Proxy of C++ FSFile class"""
d55e5bfc
RD
1676 def __repr__(self):
1677 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1678 def __init__(self, *args, **kwargs):
1679 """
1680 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1681 DateTime modif) -> FSFile
1682 """
1683 newobj = _core_.new_FSFile(*args, **kwargs)
1684 self.this = newobj.this
1685 self.thisown = 1
1686 del newobj.thisown
4cf4100f
RD
1687 self.thisown = 0 # It will normally be deleted by the user of the wxFileSystem
1688
d55e5bfc
RD
1689 def __del__(self, destroy=_core_.delete_FSFile):
1690 """__del__(self)"""
1691 try:
1692 if self.thisown: destroy(self)
1693 except: pass
1694
1695 def GetStream(*args, **kwargs):
1696 """GetStream(self) -> InputStream"""
1697 return _core_.FSFile_GetStream(*args, **kwargs)
1698
1699 def GetMimeType(*args, **kwargs):
1700 """GetMimeType(self) -> String"""
1701 return _core_.FSFile_GetMimeType(*args, **kwargs)
1702
1703 def GetLocation(*args, **kwargs):
1704 """GetLocation(self) -> String"""
1705 return _core_.FSFile_GetLocation(*args, **kwargs)
1706
1707 def GetAnchor(*args, **kwargs):
1708 """GetAnchor(self) -> String"""
1709 return _core_.FSFile_GetAnchor(*args, **kwargs)
1710
1711 def GetModificationTime(*args, **kwargs):
1712 """GetModificationTime(self) -> DateTime"""
1713 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1714
1715
1716class FSFilePtr(FSFile):
1717 def __init__(self, this):
1718 self.this = this
1719 if not hasattr(self,"thisown"): self.thisown = 0
1720 self.__class__ = FSFile
1721_core_.FSFile_swigregister(FSFilePtr)
1722
1723class CPPFileSystemHandler(object):
36ed4f51 1724 """Proxy of C++ CPPFileSystemHandler class"""
d55e5bfc
RD
1725 def __init__(self): raise RuntimeError, "No constructor defined"
1726 def __repr__(self):
1727 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1728
1729class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1730 def __init__(self, this):
1731 self.this = this
1732 if not hasattr(self,"thisown"): self.thisown = 0
1733 self.__class__ = CPPFileSystemHandler
1734_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
1735
1736class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1737 """Proxy of C++ FileSystemHandler class"""
d55e5bfc
RD
1738 def __repr__(self):
1739 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1740 def __init__(self, *args, **kwargs):
1741 """__init__(self) -> FileSystemHandler"""
1742 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
1743 self.this = newobj.this
1744 self.thisown = 1
1745 del newobj.thisown
1746 self._setCallbackInfo(self, FileSystemHandler)
1747
1748 def _setCallbackInfo(*args, **kwargs):
1749 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1750 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1751
1752 def CanOpen(*args, **kwargs):
1753 """CanOpen(self, String location) -> bool"""
1754 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1755
1756 def OpenFile(*args, **kwargs):
1757 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1758 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1759
1760 def FindFirst(*args, **kwargs):
1761 """FindFirst(self, String spec, int flags=0) -> String"""
1762 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1763
1764 def FindNext(*args, **kwargs):
1765 """FindNext(self) -> String"""
1766 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1767
1768 def GetProtocol(*args, **kwargs):
1769 """GetProtocol(self, String location) -> String"""
1770 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1771
1772 def GetLeftLocation(*args, **kwargs):
1773 """GetLeftLocation(self, String location) -> String"""
1774 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1775
1776 def GetAnchor(*args, **kwargs):
1777 """GetAnchor(self, String location) -> String"""
1778 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1779
1780 def GetRightLocation(*args, **kwargs):
1781 """GetRightLocation(self, String location) -> String"""
1782 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1783
1784 def GetMimeTypeFromExt(*args, **kwargs):
1785 """GetMimeTypeFromExt(self, String location) -> String"""
1786 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1787
1788
1789class FileSystemHandlerPtr(FileSystemHandler):
1790 def __init__(self, this):
1791 self.this = this
1792 if not hasattr(self,"thisown"): self.thisown = 0
1793 self.__class__ = FileSystemHandler
1794_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
1795
1796class FileSystem(Object):
36ed4f51 1797 """Proxy of C++ FileSystem class"""
d55e5bfc
RD
1798 def __repr__(self):
1799 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1800 def __init__(self, *args, **kwargs):
1801 """__init__(self) -> FileSystem"""
1802 newobj = _core_.new_FileSystem(*args, **kwargs)
1803 self.this = newobj.this
1804 self.thisown = 1
1805 del newobj.thisown
1806 def __del__(self, destroy=_core_.delete_FileSystem):
1807 """__del__(self)"""
1808 try:
1809 if self.thisown: destroy(self)
1810 except: pass
1811
1812 def ChangePathTo(*args, **kwargs):
1813 """ChangePathTo(self, String location, bool is_dir=False)"""
1814 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1815
1816 def GetPath(*args, **kwargs):
1817 """GetPath(self) -> String"""
1818 return _core_.FileSystem_GetPath(*args, **kwargs)
1819
1820 def OpenFile(*args, **kwargs):
1821 """OpenFile(self, String location) -> FSFile"""
1822 return _core_.FileSystem_OpenFile(*args, **kwargs)
1823
1824 def FindFirst(*args, **kwargs):
1825 """FindFirst(self, String spec, int flags=0) -> String"""
1826 return _core_.FileSystem_FindFirst(*args, **kwargs)
1827
1828 def FindNext(*args, **kwargs):
1829 """FindNext(self) -> String"""
1830 return _core_.FileSystem_FindNext(*args, **kwargs)
1831
1832 def AddHandler(*args, **kwargs):
d6c14a4c 1833 """AddHandler(CPPFileSystemHandler handler)"""
d55e5bfc
RD
1834 return _core_.FileSystem_AddHandler(*args, **kwargs)
1835
1836 AddHandler = staticmethod(AddHandler)
1837 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1838 """CleanUpHandlers()"""
d55e5bfc
RD
1839 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1840
1841 CleanUpHandlers = staticmethod(CleanUpHandlers)
1842 def FileNameToURL(*args, **kwargs):
d6c14a4c 1843 """FileNameToURL(String filename) -> String"""
d55e5bfc
RD
1844 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1845
1846 FileNameToURL = staticmethod(FileNameToURL)
b411df4a
RD
1847 def URLToFileName(*args, **kwargs):
1848 """URLToFileName(String url) -> String"""
1849 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1850
1851 URLToFileName = staticmethod(URLToFileName)
d55e5bfc
RD
1852
1853class FileSystemPtr(FileSystem):
1854 def __init__(self, this):
1855 self.this = this
1856 if not hasattr(self,"thisown"): self.thisown = 0
1857 self.__class__ = FileSystem
1858_core_.FileSystem_swigregister(FileSystemPtr)
1859
1860def FileSystem_AddHandler(*args, **kwargs):
1861 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1862 return _core_.FileSystem_AddHandler(*args, **kwargs)
1863
1864def FileSystem_CleanUpHandlers(*args, **kwargs):
1865 """FileSystem_CleanUpHandlers()"""
1866 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1867
1868def FileSystem_FileNameToURL(*args, **kwargs):
1869 """FileSystem_FileNameToURL(String filename) -> String"""
1870 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1871
d55e5bfc
RD
1872def FileSystem_URLToFileName(*args, **kwargs):
1873 """FileSystem_URLToFileName(String url) -> String"""
1874 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1875
d55e5bfc 1876class InternetFSHandler(CPPFileSystemHandler):
36ed4f51 1877 """Proxy of C++ InternetFSHandler class"""
d55e5bfc
RD
1878 def __repr__(self):
1879 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1880 def __init__(self, *args, **kwargs):
1881 """__init__(self) -> InternetFSHandler"""
1882 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
1883 self.this = newobj.this
1884 self.thisown = 1
1885 del newobj.thisown
1886 def CanOpen(*args, **kwargs):
1887 """CanOpen(self, String location) -> bool"""
1888 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1889
1890 def OpenFile(*args, **kwargs):
1891 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1892 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1893
1894
1895class InternetFSHandlerPtr(InternetFSHandler):
1896 def __init__(self, this):
1897 self.this = this
1898 if not hasattr(self,"thisown"): self.thisown = 0
1899 self.__class__ = InternetFSHandler
1900_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
1901
1902class ZipFSHandler(CPPFileSystemHandler):
36ed4f51 1903 """Proxy of C++ ZipFSHandler class"""
d55e5bfc
RD
1904 def __repr__(self):
1905 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1906 def __init__(self, *args, **kwargs):
1907 """__init__(self) -> ZipFSHandler"""
1908 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
1909 self.this = newobj.this
1910 self.thisown = 1
1911 del newobj.thisown
1912 def CanOpen(*args, **kwargs):
1913 """CanOpen(self, String location) -> bool"""
1914 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1915
1916 def OpenFile(*args, **kwargs):
1917 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1918 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1919
1920 def FindFirst(*args, **kwargs):
1921 """FindFirst(self, String spec, int flags=0) -> String"""
1922 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1923
1924 def FindNext(*args, **kwargs):
1925 """FindNext(self) -> String"""
1926 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1927
1928
1929class ZipFSHandlerPtr(ZipFSHandler):
1930 def __init__(self, this):
1931 self.this = this
1932 if not hasattr(self,"thisown"): self.thisown = 0
1933 self.__class__ = ZipFSHandler
1934_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
1935
1936
1937def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1938 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1939 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1940
1941def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1942 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1943 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1944
1945def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1946 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1947 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
1948def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1949 """
1950 Add 'file' to the memory filesystem. The dataItem parameter can
1951 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1952 arbitrary data. If a bitmap or image is used then the imgType
1953 parameter should specify what kind of image file it should be
1954 written as, wx.BITMAP_TYPE_PNG, etc.
1955 """
1956 if isinstance(dataItem, wx.Image):
1957 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1958 elif isinstance(dataItem, wx.Bitmap):
1959 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1960 elif type(dataItem) == str:
1961 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1962 else:
1963 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc
RD
1964
1965class MemoryFSHandler(CPPFileSystemHandler):
36ed4f51 1966 """Proxy of C++ MemoryFSHandler class"""
d55e5bfc
RD
1967 def __repr__(self):
1968 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1969 def __init__(self, *args, **kwargs):
1970 """__init__(self) -> MemoryFSHandler"""
1971 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
1972 self.this = newobj.this
1973 self.thisown = 1
1974 del newobj.thisown
1975 def RemoveFile(*args, **kwargs):
d6c14a4c 1976 """RemoveFile(String filename)"""
d55e5bfc
RD
1977 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1978
1979 RemoveFile = staticmethod(RemoveFile)
1980 AddFile = staticmethod(MemoryFSHandler_AddFile)
1981 def CanOpen(*args, **kwargs):
1982 """CanOpen(self, String location) -> bool"""
1983 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1984
1985 def OpenFile(*args, **kwargs):
1986 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1987 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1988
1989 def FindFirst(*args, **kwargs):
1990 """FindFirst(self, String spec, int flags=0) -> String"""
1991 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1992
1993 def FindNext(*args, **kwargs):
1994 """FindNext(self) -> String"""
1995 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1996
1997
1998class MemoryFSHandlerPtr(MemoryFSHandler):
1999 def __init__(self, this):
2000 self.this = this
2001 if not hasattr(self,"thisown"): self.thisown = 0
2002 self.__class__ = MemoryFSHandler
2003_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
2004
2005def MemoryFSHandler_RemoveFile(*args, **kwargs):
2006 """MemoryFSHandler_RemoveFile(String filename)"""
2007 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2008
2009#---------------------------------------------------------------------------
2010
2011class ImageHandler(Object):
36ed4f51 2012 """Proxy of C++ ImageHandler class"""
d55e5bfc
RD
2013 def __init__(self): raise RuntimeError, "No constructor defined"
2014 def __repr__(self):
2015 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2016 def GetName(*args, **kwargs):
2017 """GetName(self) -> String"""
2018 return _core_.ImageHandler_GetName(*args, **kwargs)
2019
2020 def GetExtension(*args, **kwargs):
2021 """GetExtension(self) -> String"""
2022 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2023
2024 def GetType(*args, **kwargs):
2025 """GetType(self) -> long"""
2026 return _core_.ImageHandler_GetType(*args, **kwargs)
2027
2028 def GetMimeType(*args, **kwargs):
2029 """GetMimeType(self) -> String"""
2030 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2031
2032 def CanRead(*args, **kwargs):
2033 """CanRead(self, String name) -> bool"""
2034 return _core_.ImageHandler_CanRead(*args, **kwargs)
2035
2036 def SetName(*args, **kwargs):
2037 """SetName(self, String name)"""
2038 return _core_.ImageHandler_SetName(*args, **kwargs)
2039
2040 def SetExtension(*args, **kwargs):
2041 """SetExtension(self, String extension)"""
2042 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2043
2044 def SetType(*args, **kwargs):
2045 """SetType(self, long type)"""
2046 return _core_.ImageHandler_SetType(*args, **kwargs)
2047
2048 def SetMimeType(*args, **kwargs):
2049 """SetMimeType(self, String mimetype)"""
2050 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2051
2052
2053class ImageHandlerPtr(ImageHandler):
2054 def __init__(self, this):
2055 self.this = this
2056 if not hasattr(self,"thisown"): self.thisown = 0
2057 self.__class__ = ImageHandler
2058_core_.ImageHandler_swigregister(ImageHandlerPtr)
2059
2060class ImageHistogram(object):
36ed4f51 2061 """Proxy of C++ ImageHistogram class"""
d55e5bfc
RD
2062 def __repr__(self):
2063 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2064 def __init__(self, *args, **kwargs):
2065 """__init__(self) -> ImageHistogram"""
2066 newobj = _core_.new_ImageHistogram(*args, **kwargs)
2067 self.this = newobj.this
2068 self.thisown = 1
2069 del newobj.thisown
2070 def MakeKey(*args, **kwargs):
2071 """
d6c14a4c 2072 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
d55e5bfc
RD
2073
2074 Get the key in the histogram for the given RGB values
2075 """
2076 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2077
2078 MakeKey = staticmethod(MakeKey)
2079 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2080 """
2081 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2082
2083 Find first colour that is not used in the image and has higher RGB
2084 values than startR, startG, startB. Returns a tuple consisting of a
2085 success flag and rgb values.
2086 """
d55e5bfc
RD
2087 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2088
2089
2090class ImageHistogramPtr(ImageHistogram):
2091 def __init__(self, this):
2092 self.this = this
2093 if not hasattr(self,"thisown"): self.thisown = 0
2094 self.__class__ = ImageHistogram
2095_core_.ImageHistogram_swigregister(ImageHistogramPtr)
2096
2097def ImageHistogram_MakeKey(*args, **kwargs):
2098 """
2099 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2100
2101 Get the key in the histogram for the given RGB values
2102 """
2103 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2104
2105class Image(Object):
36ed4f51 2106 """Proxy of C++ Image class"""
d55e5bfc
RD
2107 def __repr__(self):
2108 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2109 def __init__(self, *args, **kwargs):
2110 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2111 newobj = _core_.new_Image(*args, **kwargs)
2112 self.this = newobj.this
2113 self.thisown = 1
2114 del newobj.thisown
2115 def __del__(self, destroy=_core_.delete_Image):
2116 """__del__(self)"""
2117 try:
2118 if self.thisown: destroy(self)
2119 except: pass
2120
2121 def Create(*args, **kwargs):
2122 """Create(self, int width, int height)"""
2123 return _core_.Image_Create(*args, **kwargs)
2124
2125 def Destroy(*args, **kwargs):
2126 """
2127 Destroy(self)
2128
2129 Deletes the C++ object this Python object is a proxy for.
2130 """
2131 return _core_.Image_Destroy(*args, **kwargs)
2132
2133 def Scale(*args, **kwargs):
2134 """Scale(self, int width, int height) -> Image"""
2135 return _core_.Image_Scale(*args, **kwargs)
2136
2137 def ShrinkBy(*args, **kwargs):
2138 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
2139 return _core_.Image_ShrinkBy(*args, **kwargs)
2140
2141 def Rescale(*args, **kwargs):
2142 """Rescale(self, int width, int height) -> Image"""
2143 return _core_.Image_Rescale(*args, **kwargs)
2144
2145 def SetRGB(*args, **kwargs):
2146 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
2147 return _core_.Image_SetRGB(*args, **kwargs)
2148
2149 def GetRed(*args, **kwargs):
2150 """GetRed(self, int x, int y) -> unsigned char"""
2151 return _core_.Image_GetRed(*args, **kwargs)
2152
2153 def GetGreen(*args, **kwargs):
2154 """GetGreen(self, int x, int y) -> unsigned char"""
2155 return _core_.Image_GetGreen(*args, **kwargs)
2156
2157 def GetBlue(*args, **kwargs):
2158 """GetBlue(self, int x, int y) -> unsigned char"""
2159 return _core_.Image_GetBlue(*args, **kwargs)
2160
2161 def SetAlpha(*args, **kwargs):
2162 """SetAlpha(self, int x, int y, unsigned char alpha)"""
2163 return _core_.Image_SetAlpha(*args, **kwargs)
2164
2165 def GetAlpha(*args, **kwargs):
2166 """GetAlpha(self, int x, int y) -> unsigned char"""
2167 return _core_.Image_GetAlpha(*args, **kwargs)
2168
2169 def HasAlpha(*args, **kwargs):
2170 """HasAlpha(self) -> bool"""
2171 return _core_.Image_HasAlpha(*args, **kwargs)
2172
2173 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2174 """
2175 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2176
2177 Find first colour that is not used in the image and has higher RGB
2178 values than startR, startG, startB. Returns a tuple consisting of a
2179 success flag and rgb values.
2180 """
d55e5bfc
RD
2181 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2182
4cf4100f
RD
2183 def ConvertAlphaToMask(*args, **kwargs):
2184 """
2185 ConvertAlphaToMask(self, byte threshold=128) -> bool
2186
2187 If the image has alpha channel, this method converts it to mask. All pixels
2188 with alpha value less than ``threshold`` are replaced with mask colour and the
2189 alpha channel is removed. Mask colour is chosen automatically using
2190 `FindFirstUnusedColour`.
2191
2192 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2193 nothing.
2194 """
2195 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2196
8fb0e70a
RD
2197 def ConvertColourToAlpha(*args, **kwargs):
2198 """
2199 ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool
2200
2201 This method converts an image where the original alpha information is
2202 only available as a shades of a colour (actually shades of grey)
2203 typically when you draw anti-aliased text into a bitmap. The DC
2204 drawing routines draw grey values on the black background although
2205 they actually mean to draw white with differnt alpha values. This
2206 method reverses it, assuming a black (!) background and white text.
2207 The method will then fill up the whole image with the colour given.
2208 """
2209 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2210
d55e5bfc
RD
2211 def SetMaskFromImage(*args, **kwargs):
2212 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
2213 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2214
2215 def CanRead(*args, **kwargs):
d6c14a4c 2216 """CanRead(String name) -> bool"""
d55e5bfc
RD
2217 return _core_.Image_CanRead(*args, **kwargs)
2218
2219 CanRead = staticmethod(CanRead)
2220 def GetImageCount(*args, **kwargs):
d6c14a4c 2221 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
d55e5bfc
RD
2222 return _core_.Image_GetImageCount(*args, **kwargs)
2223
2224 GetImageCount = staticmethod(GetImageCount)
2225 def LoadFile(*args, **kwargs):
2226 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2227 return _core_.Image_LoadFile(*args, **kwargs)
2228
2229 def LoadMimeFile(*args, **kwargs):
2230 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
2231 return _core_.Image_LoadMimeFile(*args, **kwargs)
2232
2233 def SaveFile(*args, **kwargs):
2234 """SaveFile(self, String name, int type) -> bool"""
2235 return _core_.Image_SaveFile(*args, **kwargs)
2236
2237 def SaveMimeFile(*args, **kwargs):
2238 """SaveMimeFile(self, String name, String mimetype) -> bool"""
2239 return _core_.Image_SaveMimeFile(*args, **kwargs)
2240
2241 def CanReadStream(*args, **kwargs):
d6c14a4c 2242 """CanReadStream(InputStream stream) -> bool"""
d55e5bfc
RD
2243 return _core_.Image_CanReadStream(*args, **kwargs)
2244
2245 CanReadStream = staticmethod(CanReadStream)
2246 def LoadStream(*args, **kwargs):
2247 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2248 return _core_.Image_LoadStream(*args, **kwargs)
2249
2250 def LoadMimeStream(*args, **kwargs):
2251 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
2252 return _core_.Image_LoadMimeStream(*args, **kwargs)
2253
2254 def Ok(*args, **kwargs):
2255 """Ok(self) -> bool"""
2256 return _core_.Image_Ok(*args, **kwargs)
2257
2258 def GetWidth(*args, **kwargs):
2259 """GetWidth(self) -> int"""
2260 return _core_.Image_GetWidth(*args, **kwargs)
2261
2262 def GetHeight(*args, **kwargs):
2263 """GetHeight(self) -> int"""
2264 return _core_.Image_GetHeight(*args, **kwargs)
2265
2266 def GetSize(*args, **kwargs):
2267 """GetSize(self) -> Size"""
2268 return _core_.Image_GetSize(*args, **kwargs)
2269
2270 def GetSubImage(*args, **kwargs):
2271 """GetSubImage(self, Rect rect) -> Image"""
2272 return _core_.Image_GetSubImage(*args, **kwargs)
2273
2274 def Copy(*args, **kwargs):
2275 """Copy(self) -> Image"""
2276 return _core_.Image_Copy(*args, **kwargs)
2277
2278 def Paste(*args, **kwargs):
2279 """Paste(self, Image image, int x, int y)"""
2280 return _core_.Image_Paste(*args, **kwargs)
2281
2282 def GetData(*args, **kwargs):
2283 """GetData(self) -> PyObject"""
2284 return _core_.Image_GetData(*args, **kwargs)
2285
2286 def SetData(*args, **kwargs):
2287 """SetData(self, PyObject data)"""
2288 return _core_.Image_SetData(*args, **kwargs)
2289
2290 def GetDataBuffer(*args, **kwargs):
2291 """GetDataBuffer(self) -> PyObject"""
2292 return _core_.Image_GetDataBuffer(*args, **kwargs)
2293
2294 def SetDataBuffer(*args, **kwargs):
2295 """SetDataBuffer(self, PyObject data)"""
2296 return _core_.Image_SetDataBuffer(*args, **kwargs)
2297
2298 def GetAlphaData(*args, **kwargs):
2299 """GetAlphaData(self) -> PyObject"""
2300 return _core_.Image_GetAlphaData(*args, **kwargs)
2301
2302 def SetAlphaData(*args, **kwargs):
2303 """SetAlphaData(self, PyObject data)"""
2304 return _core_.Image_SetAlphaData(*args, **kwargs)
2305
2306 def GetAlphaBuffer(*args, **kwargs):
2307 """GetAlphaBuffer(self) -> PyObject"""
2308 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2309
2310 def SetAlphaBuffer(*args, **kwargs):
2311 """SetAlphaBuffer(self, PyObject data)"""
2312 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2313
2314 def SetMaskColour(*args, **kwargs):
2315 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
2316 return _core_.Image_SetMaskColour(*args, **kwargs)
2317
2318 def GetMaskRed(*args, **kwargs):
2319 """GetMaskRed(self) -> unsigned char"""
2320 return _core_.Image_GetMaskRed(*args, **kwargs)
2321
2322 def GetMaskGreen(*args, **kwargs):
2323 """GetMaskGreen(self) -> unsigned char"""
2324 return _core_.Image_GetMaskGreen(*args, **kwargs)
2325
2326 def GetMaskBlue(*args, **kwargs):
2327 """GetMaskBlue(self) -> unsigned char"""
2328 return _core_.Image_GetMaskBlue(*args, **kwargs)
2329
2330 def SetMask(*args, **kwargs):
2331 """SetMask(self, bool mask=True)"""
2332 return _core_.Image_SetMask(*args, **kwargs)
2333
2334 def HasMask(*args, **kwargs):
2335 """HasMask(self) -> bool"""
2336 return _core_.Image_HasMask(*args, **kwargs)
2337
2338 def Rotate(*args, **kwargs):
2339 """
2340 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2341 Point offset_after_rotation=None) -> Image
2342 """
2343 return _core_.Image_Rotate(*args, **kwargs)
2344
2345 def Rotate90(*args, **kwargs):
2346 """Rotate90(self, bool clockwise=True) -> Image"""
2347 return _core_.Image_Rotate90(*args, **kwargs)
2348
2349 def Mirror(*args, **kwargs):
2350 """Mirror(self, bool horizontally=True) -> Image"""
2351 return _core_.Image_Mirror(*args, **kwargs)
2352
2353 def Replace(*args, **kwargs):
2354 """
2355 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
2356 unsigned char r2, unsigned char g2, unsigned char b2)
2357 """
2358 return _core_.Image_Replace(*args, **kwargs)
2359
2360 def ConvertToMono(*args, **kwargs):
2361 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
2362 return _core_.Image_ConvertToMono(*args, **kwargs)
2363
2364 def SetOption(*args, **kwargs):
2365 """SetOption(self, String name, String value)"""
2366 return _core_.Image_SetOption(*args, **kwargs)
2367
2368 def SetOptionInt(*args, **kwargs):
2369 """SetOptionInt(self, String name, int value)"""
2370 return _core_.Image_SetOptionInt(*args, **kwargs)
2371
2372 def GetOption(*args, **kwargs):
2373 """GetOption(self, String name) -> String"""
2374 return _core_.Image_GetOption(*args, **kwargs)
2375
2376 def GetOptionInt(*args, **kwargs):
2377 """GetOptionInt(self, String name) -> int"""
2378 return _core_.Image_GetOptionInt(*args, **kwargs)
2379
2380 def HasOption(*args, **kwargs):
2381 """HasOption(self, String name) -> bool"""
2382 return _core_.Image_HasOption(*args, **kwargs)
2383
2384 def CountColours(*args, **kwargs):
2385 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2386 return _core_.Image_CountColours(*args, **kwargs)
2387
2388 def ComputeHistogram(*args, **kwargs):
2389 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2390 return _core_.Image_ComputeHistogram(*args, **kwargs)
2391
2392 def AddHandler(*args, **kwargs):
d6c14a4c 2393 """AddHandler(ImageHandler handler)"""
d55e5bfc
RD
2394 return _core_.Image_AddHandler(*args, **kwargs)
2395
2396 AddHandler = staticmethod(AddHandler)
2397 def InsertHandler(*args, **kwargs):
d6c14a4c 2398 """InsertHandler(ImageHandler handler)"""
d55e5bfc
RD
2399 return _core_.Image_InsertHandler(*args, **kwargs)
2400
2401 InsertHandler = staticmethod(InsertHandler)
2402 def RemoveHandler(*args, **kwargs):
d6c14a4c 2403 """RemoveHandler(String name) -> bool"""
d55e5bfc
RD
2404 return _core_.Image_RemoveHandler(*args, **kwargs)
2405
2406 RemoveHandler = staticmethod(RemoveHandler)
2407 def GetImageExtWildcard(*args, **kwargs):
d6c14a4c 2408 """GetImageExtWildcard() -> String"""
d55e5bfc
RD
2409 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2410
2411 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2412 def ConvertToBitmap(*args, **kwargs):
44bf767a 2413 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
d55e5bfc
RD
2414 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2415
2416 def ConvertToMonoBitmap(*args, **kwargs):
2417 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
2418 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2419
2420 def __nonzero__(self): return self.Ok()
2421
2422class ImagePtr(Image):
2423 def __init__(self, this):
2424 self.this = this
2425 if not hasattr(self,"thisown"): self.thisown = 0
2426 self.__class__ = Image
2427_core_.Image_swigregister(ImagePtr)
2428
2429def ImageFromMime(*args, **kwargs):
2430 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
2431 val = _core_.new_ImageFromMime(*args, **kwargs)
2432 val.thisown = 1
2433 return val
2434
2435def ImageFromStream(*args, **kwargs):
2436 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2437 val = _core_.new_ImageFromStream(*args, **kwargs)
2438 val.thisown = 1
2439 return val
2440
2441def ImageFromStreamMime(*args, **kwargs):
2442 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
2443 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2444 val.thisown = 1
2445 return val
2446
d6c14a4c
RD
2447def EmptyImage(*args, **kwargs):
2448 """EmptyImage(int width=0, int height=0, bool clear=True) -> Image"""
2449 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2450 val.thisown = 1
2451 return val
2452
2453def ImageFromBitmap(*args, **kwargs):
2454 """ImageFromBitmap(Bitmap bitmap) -> Image"""
2455 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2456 val.thisown = 1
2457 return val
2458
2459def ImageFromData(*args, **kwargs):
2460 """ImageFromData(int width, int height, unsigned char data) -> Image"""
2461 val = _core_.new_ImageFromData(*args, **kwargs)
2462 val.thisown = 1
2463 return val
2464
03e46024
RD
2465def ImageFromDataWithAlpha(*args, **kwargs):
2466 """ImageFromDataWithAlpha(int width, int height, unsigned char data, unsigned char alpha) -> Image"""
2467 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2468 val.thisown = 1
2469 return val
2470
d55e5bfc
RD
2471def Image_CanRead(*args, **kwargs):
2472 """Image_CanRead(String name) -> bool"""
2473 return _core_.Image_CanRead(*args, **kwargs)
2474
2475def Image_GetImageCount(*args, **kwargs):
2476 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2477 return _core_.Image_GetImageCount(*args, **kwargs)
2478
2479def Image_CanReadStream(*args, **kwargs):
2480 """Image_CanReadStream(InputStream stream) -> bool"""
2481 return _core_.Image_CanReadStream(*args, **kwargs)
2482
2483def Image_AddHandler(*args, **kwargs):
2484 """Image_AddHandler(ImageHandler handler)"""
2485 return _core_.Image_AddHandler(*args, **kwargs)
2486
2487def Image_InsertHandler(*args, **kwargs):
2488 """Image_InsertHandler(ImageHandler handler)"""
2489 return _core_.Image_InsertHandler(*args, **kwargs)
2490
2491def Image_RemoveHandler(*args, **kwargs):
2492 """Image_RemoveHandler(String name) -> bool"""
2493 return _core_.Image_RemoveHandler(*args, **kwargs)
2494
2495def Image_GetImageExtWildcard(*args, **kwargs):
2496 """Image_GetImageExtWildcard() -> String"""
2497 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2498
68e533f8
RD
2499def InitAllImageHandlers():
2500 """
2501 The former functionality of InitAllImageHanders is now done internal to
2502 the _core_ extension module and so this function has become a simple NOP.
2503 """
2504 pass
d55e5bfc 2505
d55e5bfc
RD
2506IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2507IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2508BMP_24BPP = _core_.BMP_24BPP
2509BMP_8BPP = _core_.BMP_8BPP
2510BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2511BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2512BMP_8BPP_RED = _core_.BMP_8BPP_RED
2513BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2514BMP_4BPP = _core_.BMP_4BPP
2515BMP_1BPP = _core_.BMP_1BPP
2516BMP_1BPP_BW = _core_.BMP_1BPP_BW
2517class BMPHandler(ImageHandler):
36ed4f51 2518 """Proxy of C++ BMPHandler class"""
d55e5bfc
RD
2519 def __repr__(self):
2520 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2521 def __init__(self, *args, **kwargs):
2522 """__init__(self) -> BMPHandler"""
2523 newobj = _core_.new_BMPHandler(*args, **kwargs)
2524 self.this = newobj.this
2525 self.thisown = 1
2526 del newobj.thisown
2527
2528class BMPHandlerPtr(BMPHandler):
2529 def __init__(self, this):
2530 self.this = this
2531 if not hasattr(self,"thisown"): self.thisown = 0
2532 self.__class__ = BMPHandler
2533_core_.BMPHandler_swigregister(BMPHandlerPtr)
2534NullImage = cvar.NullImage
2535IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2536IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2537IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2538IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
2539IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
2540
2541class ICOHandler(BMPHandler):
36ed4f51 2542 """Proxy of C++ ICOHandler class"""
d55e5bfc
RD
2543 def __repr__(self):
2544 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2545 def __init__(self, *args, **kwargs):
2546 """__init__(self) -> ICOHandler"""
2547 newobj = _core_.new_ICOHandler(*args, **kwargs)
2548 self.this = newobj.this
2549 self.thisown = 1
2550 del newobj.thisown
2551
2552class ICOHandlerPtr(ICOHandler):
2553 def __init__(self, this):
2554 self.this = this
2555 if not hasattr(self,"thisown"): self.thisown = 0
2556 self.__class__ = ICOHandler
2557_core_.ICOHandler_swigregister(ICOHandlerPtr)
2558
2559class CURHandler(ICOHandler):
36ed4f51 2560 """Proxy of C++ CURHandler class"""
d55e5bfc
RD
2561 def __repr__(self):
2562 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2563 def __init__(self, *args, **kwargs):
2564 """__init__(self) -> CURHandler"""
2565 newobj = _core_.new_CURHandler(*args, **kwargs)
2566 self.this = newobj.this
2567 self.thisown = 1
2568 del newobj.thisown
2569
2570class CURHandlerPtr(CURHandler):
2571 def __init__(self, this):
2572 self.this = this
2573 if not hasattr(self,"thisown"): self.thisown = 0
2574 self.__class__ = CURHandler
2575_core_.CURHandler_swigregister(CURHandlerPtr)
2576
2577class ANIHandler(CURHandler):
36ed4f51 2578 """Proxy of C++ ANIHandler class"""
d55e5bfc
RD
2579 def __repr__(self):
2580 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2581 def __init__(self, *args, **kwargs):
2582 """__init__(self) -> ANIHandler"""
2583 newobj = _core_.new_ANIHandler(*args, **kwargs)
2584 self.this = newobj.this
2585 self.thisown = 1
2586 del newobj.thisown
2587
2588class ANIHandlerPtr(ANIHandler):
2589 def __init__(self, this):
2590 self.this = this
2591 if not hasattr(self,"thisown"): self.thisown = 0
2592 self.__class__ = ANIHandler
2593_core_.ANIHandler_swigregister(ANIHandlerPtr)
2594
2595class PNGHandler(ImageHandler):
36ed4f51 2596 """Proxy of C++ PNGHandler class"""
d55e5bfc
RD
2597 def __repr__(self):
2598 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2599 def __init__(self, *args, **kwargs):
2600 """__init__(self) -> PNGHandler"""
2601 newobj = _core_.new_PNGHandler(*args, **kwargs)
2602 self.this = newobj.this
2603 self.thisown = 1
2604 del newobj.thisown
2605
2606class PNGHandlerPtr(PNGHandler):
2607 def __init__(self, this):
2608 self.this = this
2609 if not hasattr(self,"thisown"): self.thisown = 0
2610 self.__class__ = PNGHandler
2611_core_.PNGHandler_swigregister(PNGHandlerPtr)
2612
2613class GIFHandler(ImageHandler):
36ed4f51 2614 """Proxy of C++ GIFHandler class"""
d55e5bfc
RD
2615 def __repr__(self):
2616 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2617 def __init__(self, *args, **kwargs):
2618 """__init__(self) -> GIFHandler"""
2619 newobj = _core_.new_GIFHandler(*args, **kwargs)
2620 self.this = newobj.this
2621 self.thisown = 1
2622 del newobj.thisown
2623
2624class GIFHandlerPtr(GIFHandler):
2625 def __init__(self, this):
2626 self.this = this
2627 if not hasattr(self,"thisown"): self.thisown = 0
2628 self.__class__ = GIFHandler
2629_core_.GIFHandler_swigregister(GIFHandlerPtr)
2630
2631class PCXHandler(ImageHandler):
36ed4f51 2632 """Proxy of C++ PCXHandler class"""
d55e5bfc
RD
2633 def __repr__(self):
2634 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2635 def __init__(self, *args, **kwargs):
2636 """__init__(self) -> PCXHandler"""
2637 newobj = _core_.new_PCXHandler(*args, **kwargs)
2638 self.this = newobj.this
2639 self.thisown = 1
2640 del newobj.thisown
2641
2642class PCXHandlerPtr(PCXHandler):
2643 def __init__(self, this):
2644 self.this = this
2645 if not hasattr(self,"thisown"): self.thisown = 0
2646 self.__class__ = PCXHandler
2647_core_.PCXHandler_swigregister(PCXHandlerPtr)
2648
2649class JPEGHandler(ImageHandler):
36ed4f51 2650 """Proxy of C++ JPEGHandler class"""
d55e5bfc
RD
2651 def __repr__(self):
2652 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2653 def __init__(self, *args, **kwargs):
2654 """__init__(self) -> JPEGHandler"""
2655 newobj = _core_.new_JPEGHandler(*args, **kwargs)
2656 self.this = newobj.this
2657 self.thisown = 1
2658 del newobj.thisown
2659
2660class JPEGHandlerPtr(JPEGHandler):
2661 def __init__(self, this):
2662 self.this = this
2663 if not hasattr(self,"thisown"): self.thisown = 0
2664 self.__class__ = JPEGHandler
2665_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
2666
2667class PNMHandler(ImageHandler):
36ed4f51 2668 """Proxy of C++ PNMHandler class"""
d55e5bfc
RD
2669 def __repr__(self):
2670 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2671 def __init__(self, *args, **kwargs):
2672 """__init__(self) -> PNMHandler"""
2673 newobj = _core_.new_PNMHandler(*args, **kwargs)
2674 self.this = newobj.this
2675 self.thisown = 1
2676 del newobj.thisown
2677
2678class PNMHandlerPtr(PNMHandler):
2679 def __init__(self, this):
2680 self.this = this
2681 if not hasattr(self,"thisown"): self.thisown = 0
2682 self.__class__ = PNMHandler
2683_core_.PNMHandler_swigregister(PNMHandlerPtr)
2684
2685class XPMHandler(ImageHandler):
36ed4f51 2686 """Proxy of C++ XPMHandler class"""
d55e5bfc
RD
2687 def __repr__(self):
2688 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2689 def __init__(self, *args, **kwargs):
2690 """__init__(self) -> XPMHandler"""
2691 newobj = _core_.new_XPMHandler(*args, **kwargs)
2692 self.this = newobj.this
2693 self.thisown = 1
2694 del newobj.thisown
2695
2696class XPMHandlerPtr(XPMHandler):
2697 def __init__(self, this):
2698 self.this = this
2699 if not hasattr(self,"thisown"): self.thisown = 0
2700 self.__class__ = XPMHandler
2701_core_.XPMHandler_swigregister(XPMHandlerPtr)
2702
2703class TIFFHandler(ImageHandler):
36ed4f51 2704 """Proxy of C++ TIFFHandler class"""
d55e5bfc
RD
2705 def __repr__(self):
2706 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2707 def __init__(self, *args, **kwargs):
2708 """__init__(self) -> TIFFHandler"""
2709 newobj = _core_.new_TIFFHandler(*args, **kwargs)
2710 self.this = newobj.this
2711 self.thisown = 1
2712 del newobj.thisown
2713
2714class TIFFHandlerPtr(TIFFHandler):
2715 def __init__(self, this):
2716 self.this = this
2717 if not hasattr(self,"thisown"): self.thisown = 0
2718 self.__class__ = TIFFHandler
2719_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
2720
c0de73ae
RD
2721QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
2722QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
2723class Quantize(object):
2724 """Performs quantization, or colour reduction, on a wxImage."""
2725 def __init__(self): raise RuntimeError, "No constructor defined"
2726 def __repr__(self):
2727 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2728 def Quantize(*args, **kwargs):
2729 """
2730 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2731
2732 Reduce the colours in the source image and put the result into the
2733 destination image, setting the palette in the destination if
2734 needed. Both images may be the same, to overwrite the source image.
2735 """
2736 return _core_.Quantize_Quantize(*args, **kwargs)
2737
2738 Quantize = staticmethod(Quantize)
2739
2740class QuantizePtr(Quantize):
2741 def __init__(self, this):
2742 self.this = this
2743 if not hasattr(self,"thisown"): self.thisown = 0
2744 self.__class__ = Quantize
2745_core_.Quantize_swigregister(QuantizePtr)
2746
2747def Quantize_Quantize(*args, **kwargs):
2748 """
2749 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2750
2751 Reduce the colours in the source image and put the result into the
2752 destination image, setting the palette in the destination if
2753 needed. Both images may be the same, to overwrite the source image.
2754 """
2755 return _core_.Quantize_Quantize(*args, **kwargs)
2756
d55e5bfc
RD
2757#---------------------------------------------------------------------------
2758
2759class EvtHandler(Object):
36ed4f51 2760 """Proxy of C++ EvtHandler class"""
d55e5bfc
RD
2761 def __repr__(self):
2762 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2763 def __init__(self, *args, **kwargs):
2764 """__init__(self) -> EvtHandler"""
2765 newobj = _core_.new_EvtHandler(*args, **kwargs)
2766 self.this = newobj.this
2767 self.thisown = 1
2768 del newobj.thisown
2769 def GetNextHandler(*args, **kwargs):
2770 """GetNextHandler(self) -> EvtHandler"""
2771 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
2772
2773 def GetPreviousHandler(*args, **kwargs):
2774 """GetPreviousHandler(self) -> EvtHandler"""
2775 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
2776
2777 def SetNextHandler(*args, **kwargs):
2778 """SetNextHandler(self, EvtHandler handler)"""
2779 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
2780
2781 def SetPreviousHandler(*args, **kwargs):
2782 """SetPreviousHandler(self, EvtHandler handler)"""
2783 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
2784
2785 def GetEvtHandlerEnabled(*args, **kwargs):
2786 """GetEvtHandlerEnabled(self) -> bool"""
2787 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
2788
2789 def SetEvtHandlerEnabled(*args, **kwargs):
2790 """SetEvtHandlerEnabled(self, bool enabled)"""
2791 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
2792
2793 def ProcessEvent(*args, **kwargs):
2794 """ProcessEvent(self, Event event) -> bool"""
2795 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
2796
2797 def AddPendingEvent(*args, **kwargs):
2798 """AddPendingEvent(self, Event event)"""
2799 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
2800
2801 def ProcessPendingEvents(*args, **kwargs):
2802 """ProcessPendingEvents(self)"""
2803 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
2804
2805 def Connect(*args, **kwargs):
2806 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
2807 return _core_.EvtHandler_Connect(*args, **kwargs)
2808
2809 def Disconnect(*args, **kwargs):
2810 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
2811 return _core_.EvtHandler_Disconnect(*args, **kwargs)
2812
2813 def _setOORInfo(*args, **kwargs):
36ed4f51 2814 """_setOORInfo(self, PyObject _self, bool incref=True)"""
d55e5bfc
RD
2815 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
2816
2817 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2818 """
2819 Bind an event to an event handler.
2820
a5ee0656
RD
2821 :param event: One of the EVT_* objects that specifies the
2822 type of event to bind,
d55e5bfc 2823
a5ee0656
RD
2824 :param handler: A callable object to be invoked when the
2825 event is delivered to self. Pass None to
2826 disconnect an event handler.
d55e5bfc 2827
a5ee0656
RD
2828 :param source: Sometimes the event originates from a
2829 different window than self, but you still
2830 want to catch it in self. (For example, a
2831 button event delivered to a frame.) By
2832 passing the source of the event, the event
2833 handling system is able to differentiate
2834 between the same event type from different
2835 controls.
d55e5bfc 2836
a5ee0656
RD
2837 :param id: Used to spcify the event source by ID instead
2838 of instance.
2839
2840 :param id2: Used when it is desirable to bind a handler
2841 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
2842 """
2843 if source is not None:
2844 id = source.GetId()
2845 event.Bind(self, id, id2, handler)
2846
d6c14a4c
RD
2847 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2848 """
2849 Disconencts the event handler binding for event from self.
2850 Returns True if successful.
2851 """
2852 if source is not None:
2853 id = source.GetId()
2854 return event.Unbind(self, id, id2)
d55e5bfc
RD
2855
2856
2857class EvtHandlerPtr(EvtHandler):
2858 def __init__(self, this):
2859 self.this = this
2860 if not hasattr(self,"thisown"): self.thisown = 0
2861 self.__class__ = EvtHandler
2862_core_.EvtHandler_swigregister(EvtHandlerPtr)
2863
2864#---------------------------------------------------------------------------
2865
2866class PyEventBinder(object):
2867 """
2868 Instances of this class are used to bind specific events to event
2869 handlers.
2870 """
2871 def __init__(self, evtType, expectedIDs=0):
2872 if expectedIDs not in [0, 1, 2]:
2873 raise ValueError, "Invalid number of expectedIDs"
2874 self.expectedIDs = expectedIDs
2875
2876 if type(evtType) == list or type(evtType) == tuple:
2877 self.evtType = evtType
2878 else:
2879 self.evtType = [evtType]
2880
2881
2882 def Bind(self, target, id1, id2, function):
2883 """Bind this set of event types to target."""
2884 for et in self.evtType:
2885 target.Connect(id1, id2, et, function)
2886
d6c14a4c
RD
2887
2888 def Unbind(self, target, id1, id2):
2889 """Remove an event binding."""
2890 success = 0
2891 for et in self.evtType:
2892 success += target.Disconnect(id1, id2, et)
2893 return success != 0
2894
d55e5bfc
RD
2895
2896 def __call__(self, *args):
2897 """
2898 For backwards compatibility with the old EVT_* functions.
2899 Should be called with either (window, func), (window, ID,
2900 func) or (window, ID1, ID2, func) parameters depending on the
2901 type of the event.
2902 """
2903 assert len(args) == 2 + self.expectedIDs
2904 id1 = wx.ID_ANY
2905 id2 = wx.ID_ANY
2906 target = args[0]
2907 if self.expectedIDs == 0:
2908 func = args[1]
2909 elif self.expectedIDs == 1:
2910 id1 = args[1]
2911 func = args[2]
2912 elif self.expectedIDs == 2:
2913 id1 = args[1]
2914 id2 = args[2]
2915 func = args[3]
2916 else:
2917 raise ValueError, "Unexpected number of IDs"
2918
2919 self.Bind(target, id1, id2, func)
2920
2921
2922# These two are square pegs that don't fit the PyEventBinder hole...
2923def EVT_COMMAND(win, id, cmd, func):
2924 win.Connect(id, -1, cmd, func)
2925def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
2926 win.Connect(id1, id2, cmd, func)
2927
2928
2929#---------------------------------------------------------------------------
2930
2931#---------------------------------------------------------------------------
2932
2933EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
2934EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
2935
2936def NewEventType(*args, **kwargs):
2937 """NewEventType() -> wxEventType"""
2938 return _core_.NewEventType(*args, **kwargs)
2939wxEVT_NULL = _core_.wxEVT_NULL
2940wxEVT_FIRST = _core_.wxEVT_FIRST
2941wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
2942wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
2943wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
2944wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
2945wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
2946wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
2947wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
2948wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
2949wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
2950wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
2951wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
2952wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
2953wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
2954wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
2955wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
2956wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
2957wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
2958wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
2959wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
2960wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
2961wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
2962wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
2963wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
2964wxEVT_MOTION = _core_.wxEVT_MOTION
2965wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
2966wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
2967wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
2968wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
2969wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
2970wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
2971wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
2972wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
2973wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
2974wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
2975wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
2976wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
2977wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
2978wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
2979wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
2980wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
2981wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
2982wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
2983wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
2984wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
2985wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
2986wxEVT_CHAR = _core_.wxEVT_CHAR
2987wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
2988wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
2989wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
2990wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
2991wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
2992wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
2993wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
2994wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
2995wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
2996wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
2997wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
2998wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
2999wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3000wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
3001wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
3002wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3003wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3004wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3005wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3006wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3007wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3008wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3009wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3010wxEVT_SIZE = _core_.wxEVT_SIZE
3011wxEVT_MOVE = _core_.wxEVT_MOVE
3012wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3013wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3014wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3015wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3016wxEVT_POWER = _core_.wxEVT_POWER
3017wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3018wxEVT_CREATE = _core_.wxEVT_CREATE
3019wxEVT_DESTROY = _core_.wxEVT_DESTROY
3020wxEVT_SHOW = _core_.wxEVT_SHOW
3021wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3022wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3023wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3024wxEVT_PAINT = _core_.wxEVT_PAINT
3025wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3026wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3027wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3028wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3029wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3030wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3031wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3032wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3033wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3034wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3035wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3036wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3037wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3038wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3039wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3040wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3041wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3042wxEVT_IDLE = _core_.wxEVT_IDLE
3043wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3044wxEVT_SIZING = _core_.wxEVT_SIZING
3045wxEVT_MOVING = _core_.wxEVT_MOVING
3046wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3047wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3048wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3049wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3050wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3051wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3052wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3053#
3054# Create some event binders
3055EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3056EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3057EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3058EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3059EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3060EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3061EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3062EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3063EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3064EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3065EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3066EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3067EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3068EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3069EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3070EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3071EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3072EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3073EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3074EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3075EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3076EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3077EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3078EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3079EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3080EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3081EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3082EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3083EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3084EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3085EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3086EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3087EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3088EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3089EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3090EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3091EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3092EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3093EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3094EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3095
3096EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3097EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3098EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3099EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3100EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3101EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3102EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3103EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3104EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3105EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3106EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3107EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3108EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3109
3110EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3111 wxEVT_LEFT_UP,
3112 wxEVT_MIDDLE_DOWN,
3113 wxEVT_MIDDLE_UP,
3114 wxEVT_RIGHT_DOWN,
3115 wxEVT_RIGHT_UP,
3116 wxEVT_MOTION,
3117 wxEVT_LEFT_DCLICK,
3118 wxEVT_MIDDLE_DCLICK,
3119 wxEVT_RIGHT_DCLICK,
3120 wxEVT_ENTER_WINDOW,
3121 wxEVT_LEAVE_WINDOW,
3122 wxEVT_MOUSEWHEEL
3123 ])
3124
3125
3126# Scrolling from wxWindow (sent to wxScrolledWindow)
3127EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3128 wxEVT_SCROLLWIN_BOTTOM,
3129 wxEVT_SCROLLWIN_LINEUP,
3130 wxEVT_SCROLLWIN_LINEDOWN,
3131 wxEVT_SCROLLWIN_PAGEUP,
3132 wxEVT_SCROLLWIN_PAGEDOWN,
3133 wxEVT_SCROLLWIN_THUMBTRACK,
3134 wxEVT_SCROLLWIN_THUMBRELEASE,
3135 ])
3136
3137EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3138EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3139EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3140EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3141EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3142EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3143EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3144EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3145
3146# Scrolling from wxSlider and wxScrollBar
3147EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3148 wxEVT_SCROLL_BOTTOM,
3149 wxEVT_SCROLL_LINEUP,
3150 wxEVT_SCROLL_LINEDOWN,
3151 wxEVT_SCROLL_PAGEUP,
3152 wxEVT_SCROLL_PAGEDOWN,
3153 wxEVT_SCROLL_THUMBTRACK,
3154 wxEVT_SCROLL_THUMBRELEASE,
3155 wxEVT_SCROLL_ENDSCROLL,
3156 ])
3157
3158EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3159EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3160EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3161EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3162EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3163EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3164EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3165EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3166EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3167
3168# Scrolling from wxSlider and wxScrollBar, with an id
3169EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3170 wxEVT_SCROLL_BOTTOM,
3171 wxEVT_SCROLL_LINEUP,
3172 wxEVT_SCROLL_LINEDOWN,
3173 wxEVT_SCROLL_PAGEUP,
3174 wxEVT_SCROLL_PAGEDOWN,
3175 wxEVT_SCROLL_THUMBTRACK,
3176 wxEVT_SCROLL_THUMBRELEASE,
3177 wxEVT_SCROLL_ENDSCROLL,
3178 ], 1)
3179
3180EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3181EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3182EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3183EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3184EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3185EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3186EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3187EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3188EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3189
3190EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3191EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3192EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3193EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3194EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3195EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3196EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3197EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3198EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3199EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3200
3201EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3202EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3203EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3204EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3205EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3206EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3207EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3208EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3209EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3210
3211
3212EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3213EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3214EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3215EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3216EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3217EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3218EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3219
3220EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3221
3222EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3223EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3224
3225EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3226
3227
3228
3229#---------------------------------------------------------------------------
3230
3231class Event(Object):
36ed4f51 3232 """Proxy of C++ Event class"""
d55e5bfc
RD
3233 def __init__(self): raise RuntimeError, "No constructor defined"
3234 def __repr__(self):
3235 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3236 def __del__(self, destroy=_core_.delete_Event):
3237 """__del__(self)"""
3238 try:
3239 if self.thisown: destroy(self)
3240 except: pass
3241
3242 def SetEventType(*args, **kwargs):
3243 """SetEventType(self, wxEventType typ)"""
3244 return _core_.Event_SetEventType(*args, **kwargs)
3245
3246 def GetEventType(*args, **kwargs):
3247 """GetEventType(self) -> wxEventType"""
3248 return _core_.Event_GetEventType(*args, **kwargs)
3249
3250 def GetEventObject(*args, **kwargs):
3251 """GetEventObject(self) -> Object"""
3252 return _core_.Event_GetEventObject(*args, **kwargs)
3253
3254 def SetEventObject(*args, **kwargs):
3255 """SetEventObject(self, Object obj)"""
3256 return _core_.Event_SetEventObject(*args, **kwargs)
3257
3258 def GetTimestamp(*args, **kwargs):
3259 """GetTimestamp(self) -> long"""
3260 return _core_.Event_GetTimestamp(*args, **kwargs)
3261
3262 def SetTimestamp(*args, **kwargs):
3263 """SetTimestamp(self, long ts=0)"""
3264 return _core_.Event_SetTimestamp(*args, **kwargs)
3265
3266 def GetId(*args, **kwargs):
3267 """GetId(self) -> int"""
3268 return _core_.Event_GetId(*args, **kwargs)
3269
3270 def SetId(*args, **kwargs):
3271 """SetId(self, int Id)"""
3272 return _core_.Event_SetId(*args, **kwargs)
3273
3274 def IsCommandEvent(*args, **kwargs):
3275 """IsCommandEvent(self) -> bool"""
3276 return _core_.Event_IsCommandEvent(*args, **kwargs)
3277
3278 def Skip(*args, **kwargs):
51b83b37
RD
3279 """
3280 Skip(self, bool skip=True)
3281
3282 Called by an event handler, it controls whether additional event
3283 handlers bound to this event will be called after the current event
3284 handler returns. Skip(false) (the default setting) will prevent
3285 additional event handlers from being called and control will be
3286 returned to the sender of the event immediately after the current
3287 handler has finished. Skip(True) will cause the event processing
3288 system to continue searching for a handler function for this event.
3289
3290 """
d55e5bfc
RD
3291 return _core_.Event_Skip(*args, **kwargs)
3292
3293 def GetSkipped(*args, **kwargs):
3294 """GetSkipped(self) -> bool"""
3295 return _core_.Event_GetSkipped(*args, **kwargs)
3296
3297 def ShouldPropagate(*args, **kwargs):
3298 """ShouldPropagate(self) -> bool"""
3299 return _core_.Event_ShouldPropagate(*args, **kwargs)
3300
3301 def StopPropagation(*args, **kwargs):
3302 """StopPropagation(self) -> int"""
3303 return _core_.Event_StopPropagation(*args, **kwargs)
3304
3305 def ResumePropagation(*args, **kwargs):
3306 """ResumePropagation(self, int propagationLevel)"""
3307 return _core_.Event_ResumePropagation(*args, **kwargs)
3308
3309 def Clone(*args, **kwargs):
3310 """Clone(self) -> Event"""
3311 return _core_.Event_Clone(*args, **kwargs)
3312
3313
3314class EventPtr(Event):
3315 def __init__(self, this):
3316 self.this = this
3317 if not hasattr(self,"thisown"): self.thisown = 0
3318 self.__class__ = Event
3319_core_.Event_swigregister(EventPtr)
3320
3321#---------------------------------------------------------------------------
3322
3323class PropagationDisabler(object):
36ed4f51 3324 """Proxy of C++ PropagationDisabler class"""
d55e5bfc
RD
3325 def __repr__(self):
3326 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3327 def __init__(self, *args, **kwargs):
3328 """__init__(self, Event event) -> PropagationDisabler"""
3329 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
3330 self.this = newobj.this
3331 self.thisown = 1
3332 del newobj.thisown
3333 def __del__(self, destroy=_core_.delete_PropagationDisabler):
3334 """__del__(self)"""
3335 try:
3336 if self.thisown: destroy(self)
3337 except: pass
3338
3339
3340class PropagationDisablerPtr(PropagationDisabler):
3341 def __init__(self, this):
3342 self.this = this
3343 if not hasattr(self,"thisown"): self.thisown = 0
3344 self.__class__ = PropagationDisabler
3345_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
3346
3347class PropagateOnce(object):
36ed4f51 3348 """Proxy of C++ PropagateOnce class"""
d55e5bfc
RD
3349 def __repr__(self):
3350 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3351 def __init__(self, *args, **kwargs):
3352 """__init__(self, Event event) -> PropagateOnce"""
3353 newobj = _core_.new_PropagateOnce(*args, **kwargs)
3354 self.this = newobj.this
3355 self.thisown = 1
3356 del newobj.thisown
3357 def __del__(self, destroy=_core_.delete_PropagateOnce):
3358 """__del__(self)"""
3359 try:
3360 if self.thisown: destroy(self)
3361 except: pass
3362
3363
3364class PropagateOncePtr(PropagateOnce):
3365 def __init__(self, this):
3366 self.this = this
3367 if not hasattr(self,"thisown"): self.thisown = 0
3368 self.__class__ = PropagateOnce
3369_core_.PropagateOnce_swigregister(PropagateOncePtr)
3370
3371#---------------------------------------------------------------------------
3372
3373class CommandEvent(Event):
36ed4f51 3374 """Proxy of C++ CommandEvent class"""
d55e5bfc
RD
3375 def __repr__(self):
3376 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3377 def __init__(self, *args, **kwargs):
3378 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
3379 newobj = _core_.new_CommandEvent(*args, **kwargs)
3380 self.this = newobj.this
3381 self.thisown = 1
3382 del newobj.thisown
3383 def GetSelection(*args, **kwargs):
3384 """GetSelection(self) -> int"""
3385 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3386
3387 def SetString(*args, **kwargs):
3388 """SetString(self, String s)"""
3389 return _core_.CommandEvent_SetString(*args, **kwargs)
3390
3391 def GetString(*args, **kwargs):
3392 """GetString(self) -> String"""
3393 return _core_.CommandEvent_GetString(*args, **kwargs)
3394
3395 def IsChecked(*args, **kwargs):
3396 """IsChecked(self) -> bool"""
3397 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3398
3399 Checked = IsChecked
3400 def IsSelection(*args, **kwargs):
3401 """IsSelection(self) -> bool"""
3402 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3403
3404 def SetExtraLong(*args, **kwargs):
3405 """SetExtraLong(self, long extraLong)"""
3406 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3407
3408 def GetExtraLong(*args, **kwargs):
3409 """GetExtraLong(self) -> long"""
3410 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3411
3412 def SetInt(*args, **kwargs):
3413 """SetInt(self, int i)"""
3414 return _core_.CommandEvent_SetInt(*args, **kwargs)
3415
3416 def GetInt(*args, **kwargs):
3417 """GetInt(self) -> long"""
3418 return _core_.CommandEvent_GetInt(*args, **kwargs)
3419
3420 def Clone(*args, **kwargs):
3421 """Clone(self) -> Event"""
3422 return _core_.CommandEvent_Clone(*args, **kwargs)
3423
3424
3425class CommandEventPtr(CommandEvent):
3426 def __init__(self, this):
3427 self.this = this
3428 if not hasattr(self,"thisown"): self.thisown = 0
3429 self.__class__ = CommandEvent
3430_core_.CommandEvent_swigregister(CommandEventPtr)
3431
3432#---------------------------------------------------------------------------
3433
3434class NotifyEvent(CommandEvent):
36ed4f51 3435 """Proxy of C++ NotifyEvent class"""
d55e5bfc
RD
3436 def __repr__(self):
3437 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3438 def __init__(self, *args, **kwargs):
3439 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
3440 newobj = _core_.new_NotifyEvent(*args, **kwargs)
3441 self.this = newobj.this
3442 self.thisown = 1
3443 del newobj.thisown
3444 def Veto(*args, **kwargs):
3445 """Veto(self)"""
3446 return _core_.NotifyEvent_Veto(*args, **kwargs)
3447
3448 def Allow(*args, **kwargs):
3449 """Allow(self)"""
3450 return _core_.NotifyEvent_Allow(*args, **kwargs)
3451
3452 def IsAllowed(*args, **kwargs):
3453 """IsAllowed(self) -> bool"""
3454 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
3455
3456
3457class NotifyEventPtr(NotifyEvent):
3458 def __init__(self, this):
3459 self.this = this
3460 if not hasattr(self,"thisown"): self.thisown = 0
3461 self.__class__ = NotifyEvent
3462_core_.NotifyEvent_swigregister(NotifyEventPtr)
3463
3464#---------------------------------------------------------------------------
3465
3466class ScrollEvent(CommandEvent):
36ed4f51 3467 """Proxy of C++ ScrollEvent class"""
d55e5bfc
RD
3468 def __repr__(self):
3469 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3470 def __init__(self, *args, **kwargs):
3471 """
3472 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
3473 int orient=0) -> ScrollEvent
3474 """
3475 newobj = _core_.new_ScrollEvent(*args, **kwargs)
3476 self.this = newobj.this
3477 self.thisown = 1
3478 del newobj.thisown
3479 def GetOrientation(*args, **kwargs):
3480 """GetOrientation(self) -> int"""
3481 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
3482
3483 def GetPosition(*args, **kwargs):
3484 """GetPosition(self) -> int"""
3485 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
3486
3487 def SetOrientation(*args, **kwargs):
3488 """SetOrientation(self, int orient)"""
3489 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
3490
3491 def SetPosition(*args, **kwargs):
3492 """SetPosition(self, int pos)"""
3493 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
3494
3495
3496class ScrollEventPtr(ScrollEvent):
3497 def __init__(self, this):
3498 self.this = this
3499 if not hasattr(self,"thisown"): self.thisown = 0
3500 self.__class__ = ScrollEvent
3501_core_.ScrollEvent_swigregister(ScrollEventPtr)
3502
3503#---------------------------------------------------------------------------
3504
3505class ScrollWinEvent(Event):
36ed4f51 3506 """Proxy of C++ ScrollWinEvent class"""
d55e5bfc
RD
3507 def __repr__(self):
3508 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3509 def __init__(self, *args, **kwargs):
3510 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
3511 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
3512 self.this = newobj.this
3513 self.thisown = 1
3514 del newobj.thisown
3515 def GetOrientation(*args, **kwargs):
3516 """GetOrientation(self) -> int"""
3517 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
3518
3519 def GetPosition(*args, **kwargs):
3520 """GetPosition(self) -> int"""
3521 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
3522
3523 def SetOrientation(*args, **kwargs):
3524 """SetOrientation(self, int orient)"""
3525 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
3526
3527 def SetPosition(*args, **kwargs):
3528 """SetPosition(self, int pos)"""
3529 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
3530
3531
3532class ScrollWinEventPtr(ScrollWinEvent):
3533 def __init__(self, this):
3534 self.this = this
3535 if not hasattr(self,"thisown"): self.thisown = 0
3536 self.__class__ = ScrollWinEvent
3537_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
3538
3539#---------------------------------------------------------------------------
3540
3541MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3542MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3543MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3544MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3545MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
3546class MouseEvent(Event):
36ed4f51 3547 """Proxy of C++ MouseEvent class"""
d55e5bfc
RD
3548 def __repr__(self):
3549 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3550 def __init__(self, *args, **kwargs):
3551 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
3552 newobj = _core_.new_MouseEvent(*args, **kwargs)
3553 self.this = newobj.this
3554 self.thisown = 1
3555 del newobj.thisown
3556 def IsButton(*args, **kwargs):
3557 """IsButton(self) -> bool"""
3558 return _core_.MouseEvent_IsButton(*args, **kwargs)
3559
3560 def ButtonDown(*args, **kwargs):
3561 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
3562 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
3563
3564 def ButtonDClick(*args, **kwargs):
3565 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
3566 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
3567
3568 def ButtonUp(*args, **kwargs):
3569 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
3570 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
3571
3572 def Button(*args, **kwargs):
3573 """Button(self, int but) -> bool"""
3574 return _core_.MouseEvent_Button(*args, **kwargs)
3575
3576 def ButtonIsDown(*args, **kwargs):
3577 """ButtonIsDown(self, int but) -> bool"""
3578 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
3579
3580 def GetButton(*args, **kwargs):
3581 """GetButton(self) -> int"""
3582 return _core_.MouseEvent_GetButton(*args, **kwargs)
3583
3584 def ControlDown(*args, **kwargs):
3585 """ControlDown(self) -> bool"""
3586 return _core_.MouseEvent_ControlDown(*args, **kwargs)
3587
3588 def MetaDown(*args, **kwargs):
3589 """MetaDown(self) -> bool"""
3590 return _core_.MouseEvent_MetaDown(*args, **kwargs)
3591
3592 def AltDown(*args, **kwargs):
3593 """AltDown(self) -> bool"""
3594 return _core_.MouseEvent_AltDown(*args, **kwargs)
3595
3596 def ShiftDown(*args, **kwargs):
3597 """ShiftDown(self) -> bool"""
3598 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
3599
412d302d
RD
3600 def CmdDown(*args, **kwargs):
3601 """
3602 CmdDown(self) -> bool
3603
3604 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3605 platforms but the special "Apple" (a.k.a as "Command") key on
3606 Macs: it makes often sense to use it instead of, say, `ControlDown`
3607 because Cmd key is used for the same thing under Mac as Ctrl
3608 elsewhere. The Ctrl still exists, it's just not used for this
3609 purpose. So for non-Mac platforms this is the same as `ControlDown`
3610 and Macs this is the same as `MetaDown`.
3611 """
3612 return _core_.MouseEvent_CmdDown(*args, **kwargs)
3613
d55e5bfc
RD
3614 def LeftDown(*args, **kwargs):
3615 """LeftDown(self) -> bool"""
3616 return _core_.MouseEvent_LeftDown(*args, **kwargs)
3617
3618 def MiddleDown(*args, **kwargs):
3619 """MiddleDown(self) -> bool"""
3620 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
3621
3622 def RightDown(*args, **kwargs):
3623 """RightDown(self) -> bool"""
3624 return _core_.MouseEvent_RightDown(*args, **kwargs)
3625
3626 def LeftUp(*args, **kwargs):
3627 """LeftUp(self) -> bool"""
3628 return _core_.MouseEvent_LeftUp(*args, **kwargs)
3629
3630 def MiddleUp(*args, **kwargs):
3631 """MiddleUp(self) -> bool"""
3632 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
3633
3634 def RightUp(*args, **kwargs):
3635 """RightUp(self) -> bool"""
3636 return _core_.MouseEvent_RightUp(*args, **kwargs)
3637
3638 def LeftDClick(*args, **kwargs):
3639 """LeftDClick(self) -> bool"""
3640 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
3641
3642 def MiddleDClick(*args, **kwargs):
3643 """MiddleDClick(self) -> bool"""
3644 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
3645
3646 def RightDClick(*args, **kwargs):
3647 """RightDClick(self) -> bool"""
3648 return _core_.MouseEvent_RightDClick(*args, **kwargs)
3649
3650 def LeftIsDown(*args, **kwargs):
3651 """LeftIsDown(self) -> bool"""
3652 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
3653
3654 def MiddleIsDown(*args, **kwargs):
3655 """MiddleIsDown(self) -> bool"""
3656 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
3657
3658 def RightIsDown(*args, **kwargs):
3659 """RightIsDown(self) -> bool"""
3660 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
3661
3662 def Dragging(*args, **kwargs):
3663 """Dragging(self) -> bool"""
3664 return _core_.MouseEvent_Dragging(*args, **kwargs)
3665
3666 def Moving(*args, **kwargs):
3667 """Moving(self) -> bool"""
3668 return _core_.MouseEvent_Moving(*args, **kwargs)
3669
3670 def Entering(*args, **kwargs):
3671 """Entering(self) -> bool"""
3672 return _core_.MouseEvent_Entering(*args, **kwargs)
3673
3674 def Leaving(*args, **kwargs):
3675 """Leaving(self) -> bool"""
3676 return _core_.MouseEvent_Leaving(*args, **kwargs)
3677
3678 def GetPosition(*args, **kwargs):
3679 """
3680 GetPosition(self) -> Point
3681
15817c7e
RD
3682 Returns the position of the mouse in window coordinates when the event
3683 happened.
d55e5bfc
RD
3684 """
3685 return _core_.MouseEvent_GetPosition(*args, **kwargs)
3686
3687 def GetPositionTuple(*args, **kwargs):
3688 """
3689 GetPositionTuple() -> (x,y)
3690
15817c7e
RD
3691 Returns the position of the mouse in window coordinates when the event
3692 happened.
d55e5bfc
RD
3693 """
3694 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
3695
3696 def GetLogicalPosition(*args, **kwargs):
3697 """GetLogicalPosition(self, DC dc) -> Point"""
3698 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
3699
3700 def GetX(*args, **kwargs):
3701 """GetX(self) -> int"""
3702 return _core_.MouseEvent_GetX(*args, **kwargs)
3703
3704 def GetY(*args, **kwargs):
3705 """GetY(self) -> int"""
3706 return _core_.MouseEvent_GetY(*args, **kwargs)
3707
3708 def GetWheelRotation(*args, **kwargs):
3709 """GetWheelRotation(self) -> int"""
3710 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
3711
3712 def GetWheelDelta(*args, **kwargs):
3713 """GetWheelDelta(self) -> int"""
3714 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
3715
3716 def GetLinesPerAction(*args, **kwargs):
3717 """GetLinesPerAction(self) -> int"""
3718 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
3719
3720 def IsPageScroll(*args, **kwargs):
3721 """IsPageScroll(self) -> bool"""
3722 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3723
3724 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3725 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3726 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3727 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3728 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3729 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3730 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3731 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3732 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3733 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3734 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3735 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
3736
3737class MouseEventPtr(MouseEvent):
3738 def __init__(self, this):
3739 self.this = this
3740 if not hasattr(self,"thisown"): self.thisown = 0
3741 self.__class__ = MouseEvent
3742_core_.MouseEvent_swigregister(MouseEventPtr)
3743
3744#---------------------------------------------------------------------------
3745
3746class SetCursorEvent(Event):
36ed4f51 3747 """Proxy of C++ SetCursorEvent class"""
d55e5bfc
RD
3748 def __repr__(self):
3749 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3750 def __init__(self, *args, **kwargs):
3751 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
3752 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
3753 self.this = newobj.this
3754 self.thisown = 1
3755 del newobj.thisown
3756 def GetX(*args, **kwargs):
3757 """GetX(self) -> int"""
3758 return _core_.SetCursorEvent_GetX(*args, **kwargs)
3759
3760 def GetY(*args, **kwargs):
3761 """GetY(self) -> int"""
3762 return _core_.SetCursorEvent_GetY(*args, **kwargs)
3763
3764 def SetCursor(*args, **kwargs):
3765 """SetCursor(self, Cursor cursor)"""
3766 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
3767
3768 def GetCursor(*args, **kwargs):
3769 """GetCursor(self) -> Cursor"""
3770 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
3771
3772 def HasCursor(*args, **kwargs):
3773 """HasCursor(self) -> bool"""
3774 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
3775
3776
3777class SetCursorEventPtr(SetCursorEvent):
3778 def __init__(self, this):
3779 self.this = this
3780 if not hasattr(self,"thisown"): self.thisown = 0
3781 self.__class__ = SetCursorEvent
3782_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
3783
3784#---------------------------------------------------------------------------
3785
3786class KeyEvent(Event):
36ed4f51 3787 """Proxy of C++ KeyEvent class"""
d55e5bfc
RD
3788 def __repr__(self):
3789 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3790 def __init__(self, *args, **kwargs):
3791 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
3792 newobj = _core_.new_KeyEvent(*args, **kwargs)
3793 self.this = newobj.this
3794 self.thisown = 1
3795 del newobj.thisown
3796 def ControlDown(*args, **kwargs):
3797 """ControlDown(self) -> bool"""
3798 return _core_.KeyEvent_ControlDown(*args, **kwargs)
3799
3800 def MetaDown(*args, **kwargs):
3801 """MetaDown(self) -> bool"""
3802 return _core_.KeyEvent_MetaDown(*args, **kwargs)
3803
3804 def AltDown(*args, **kwargs):
3805 """AltDown(self) -> bool"""
3806 return _core_.KeyEvent_AltDown(*args, **kwargs)
3807
3808 def ShiftDown(*args, **kwargs):
3809 """ShiftDown(self) -> bool"""
3810 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
3811
412d302d
RD
3812 def CmdDown(*args, **kwargs):
3813 """
3814 CmdDown(self) -> bool
3815
3816 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3817 platforms but the special "Apple" (a.k.a as "Command") key on
3818 Macs: it makes often sense to use it instead of, say, `ControlDown`
3819 because Cmd key is used for the same thing under Mac as Ctrl
3820 elsewhere. The Ctrl still exists, it's just not used for this
3821 purpose. So for non-Mac platforms this is the same as `ControlDown`
3822 and Macs this is the same as `MetaDown`.
3823 """
3824 return _core_.KeyEvent_CmdDown(*args, **kwargs)
3825
d55e5bfc
RD
3826 def HasModifiers(*args, **kwargs):
3827 """HasModifiers(self) -> bool"""
3828 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
3829
3830 def GetKeyCode(*args, **kwargs):
3831 """GetKeyCode(self) -> int"""
3832 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
3833
3834 KeyCode = GetKeyCode
bb4524c4
RD
3835 def GetUnicodeKey(*args, **kwargs):
3836 """GetUnicodeKey(self) -> int"""
3837 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 3838
bb4524c4 3839 GetUniChar = GetUnicodeKey
d55e5bfc
RD
3840 def GetRawKeyCode(*args, **kwargs):
3841 """GetRawKeyCode(self) -> unsigned int"""
3842 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
3843
3844 def GetRawKeyFlags(*args, **kwargs):
3845 """GetRawKeyFlags(self) -> unsigned int"""
3846 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
3847
3848 def GetPosition(*args, **kwargs):
3849 """
3850 GetPosition(self) -> Point
3851
3852 Find the position of the event.
3853 """
3854 return _core_.KeyEvent_GetPosition(*args, **kwargs)
3855
3856 def GetPositionTuple(*args, **kwargs):
3857 """
3858 GetPositionTuple() -> (x,y)
3859
3860 Find the position of the event.
3861 """
3862 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
3863
3864 def GetX(*args, **kwargs):
3865 """GetX(self) -> int"""
3866 return _core_.KeyEvent_GetX(*args, **kwargs)
3867
3868 def GetY(*args, **kwargs):
3869 """GetY(self) -> int"""
3870 return _core_.KeyEvent_GetY(*args, **kwargs)
3871
3872 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
3873 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
3874 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
3875 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
3876 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
3877 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
3878 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
3879 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
3880 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
3881 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
3882
3883class KeyEventPtr(KeyEvent):
3884 def __init__(self, this):
3885 self.this = this
3886 if not hasattr(self,"thisown"): self.thisown = 0
3887 self.__class__ = KeyEvent
3888_core_.KeyEvent_swigregister(KeyEventPtr)
3889
3890#---------------------------------------------------------------------------
3891
3892class SizeEvent(Event):
36ed4f51 3893 """Proxy of C++ SizeEvent class"""
d55e5bfc
RD
3894 def __repr__(self):
3895 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3896 def __init__(self, *args, **kwargs):
3897 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
3898 newobj = _core_.new_SizeEvent(*args, **kwargs)
3899 self.this = newobj.this
3900 self.thisown = 1
3901 del newobj.thisown
3902 def GetSize(*args, **kwargs):
3903 """GetSize(self) -> Size"""
3904 return _core_.SizeEvent_GetSize(*args, **kwargs)
3905
3906 def GetRect(*args, **kwargs):
3907 """GetRect(self) -> Rect"""
3908 return _core_.SizeEvent_GetRect(*args, **kwargs)
3909
3910 def SetRect(*args, **kwargs):
3911 """SetRect(self, Rect rect)"""
3912 return _core_.SizeEvent_SetRect(*args, **kwargs)
3913
3914 def SetSize(*args, **kwargs):
3915 """SetSize(self, Size size)"""
3916 return _core_.SizeEvent_SetSize(*args, **kwargs)
3917
3918 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
3919 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
3920
3921class SizeEventPtr(SizeEvent):
3922 def __init__(self, this):
3923 self.this = this
3924 if not hasattr(self,"thisown"): self.thisown = 0
3925 self.__class__ = SizeEvent
3926_core_.SizeEvent_swigregister(SizeEventPtr)
3927
3928#---------------------------------------------------------------------------
3929
3930class MoveEvent(Event):
36ed4f51 3931 """Proxy of C++ MoveEvent class"""
d55e5bfc
RD
3932 def __repr__(self):
3933 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3934 def __init__(self, *args, **kwargs):
3935 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
3936 newobj = _core_.new_MoveEvent(*args, **kwargs)
3937 self.this = newobj.this
3938 self.thisown = 1
3939 del newobj.thisown
3940 def GetPosition(*args, **kwargs):
3941 """GetPosition(self) -> Point"""
3942 return _core_.MoveEvent_GetPosition(*args, **kwargs)
3943
3944 def GetRect(*args, **kwargs):
3945 """GetRect(self) -> Rect"""
3946 return _core_.MoveEvent_GetRect(*args, **kwargs)
3947
3948 def SetRect(*args, **kwargs):
3949 """SetRect(self, Rect rect)"""
3950 return _core_.MoveEvent_SetRect(*args, **kwargs)
3951
3952 def SetPosition(*args, **kwargs):
3953 """SetPosition(self, Point pos)"""
3954 return _core_.MoveEvent_SetPosition(*args, **kwargs)
3955
3956 m_pos = property(_core_.MoveEvent_m_pos_get, _core_.MoveEvent_m_pos_set)
3957 m_rect = property(_core_.MoveEvent_m_rect_get, _core_.MoveEvent_m_rect_set)
3958
3959class MoveEventPtr(MoveEvent):
3960 def __init__(self, this):
3961 self.this = this
3962 if not hasattr(self,"thisown"): self.thisown = 0
3963 self.__class__ = MoveEvent
3964_core_.MoveEvent_swigregister(MoveEventPtr)
3965
3966#---------------------------------------------------------------------------
3967
3968class PaintEvent(Event):
36ed4f51 3969 """Proxy of C++ PaintEvent class"""
d55e5bfc
RD
3970 def __repr__(self):
3971 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3972 def __init__(self, *args, **kwargs):
3973 """__init__(self, int Id=0) -> PaintEvent"""
3974 newobj = _core_.new_PaintEvent(*args, **kwargs)
3975 self.this = newobj.this
3976 self.thisown = 1
3977 del newobj.thisown
3978
3979class PaintEventPtr(PaintEvent):
3980 def __init__(self, this):
3981 self.this = this
3982 if not hasattr(self,"thisown"): self.thisown = 0
3983 self.__class__ = PaintEvent
3984_core_.PaintEvent_swigregister(PaintEventPtr)
3985
3986class NcPaintEvent(Event):
36ed4f51 3987 """Proxy of C++ NcPaintEvent class"""
d55e5bfc
RD
3988 def __repr__(self):
3989 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3990 def __init__(self, *args, **kwargs):
3991 """__init__(self, int winid=0) -> NcPaintEvent"""
3992 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
3993 self.this = newobj.this
3994 self.thisown = 1
3995 del newobj.thisown
3996
3997class NcPaintEventPtr(NcPaintEvent):
3998 def __init__(self, this):
3999 self.this = this
4000 if not hasattr(self,"thisown"): self.thisown = 0
4001 self.__class__ = NcPaintEvent
4002_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
4003
4004#---------------------------------------------------------------------------
4005
4006class EraseEvent(Event):
36ed4f51 4007 """Proxy of C++ EraseEvent class"""
d55e5bfc
RD
4008 def __repr__(self):
4009 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4010 def __init__(self, *args, **kwargs):
4011 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
4012 newobj = _core_.new_EraseEvent(*args, **kwargs)
4013 self.this = newobj.this
4014 self.thisown = 1
4015 del newobj.thisown
4016 def GetDC(*args, **kwargs):
4017 """GetDC(self) -> DC"""
4018 return _core_.EraseEvent_GetDC(*args, **kwargs)
4019
4020
4021class EraseEventPtr(EraseEvent):
4022 def __init__(self, this):
4023 self.this = this
4024 if not hasattr(self,"thisown"): self.thisown = 0
4025 self.__class__ = EraseEvent
4026_core_.EraseEvent_swigregister(EraseEventPtr)
4027
4028#---------------------------------------------------------------------------
4029
4030class FocusEvent(Event):
36ed4f51 4031 """Proxy of C++ FocusEvent class"""
d55e5bfc
RD
4032 def __repr__(self):
4033 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4034 def __init__(self, *args, **kwargs):
4035 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
4036 newobj = _core_.new_FocusEvent(*args, **kwargs)
4037 self.this = newobj.this
4038 self.thisown = 1
4039 del newobj.thisown
4040 def GetWindow(*args, **kwargs):
4041 """GetWindow(self) -> Window"""
4042 return _core_.FocusEvent_GetWindow(*args, **kwargs)
4043
4044 def SetWindow(*args, **kwargs):
4045 """SetWindow(self, Window win)"""
4046 return _core_.FocusEvent_SetWindow(*args, **kwargs)
4047
4048
4049class FocusEventPtr(FocusEvent):
4050 def __init__(self, this):
4051 self.this = this
4052 if not hasattr(self,"thisown"): self.thisown = 0
4053 self.__class__ = FocusEvent
4054_core_.FocusEvent_swigregister(FocusEventPtr)
4055
4056#---------------------------------------------------------------------------
4057
4058class ChildFocusEvent(CommandEvent):
36ed4f51 4059 """Proxy of C++ ChildFocusEvent class"""
d55e5bfc
RD
4060 def __repr__(self):
4061 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4062 def __init__(self, *args, **kwargs):
4063 """__init__(self, Window win=None) -> ChildFocusEvent"""
4064 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
4065 self.this = newobj.this
4066 self.thisown = 1
4067 del newobj.thisown
4068 def GetWindow(*args, **kwargs):
4069 """GetWindow(self) -> Window"""
4070 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
4071
4072
4073class ChildFocusEventPtr(ChildFocusEvent):
4074 def __init__(self, this):
4075 self.this = this
4076 if not hasattr(self,"thisown"): self.thisown = 0
4077 self.__class__ = ChildFocusEvent
4078_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
4079
4080#---------------------------------------------------------------------------
4081
4082class ActivateEvent(Event):
36ed4f51 4083 """Proxy of C++ ActivateEvent class"""
d55e5bfc
RD
4084 def __repr__(self):
4085 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4086 def __init__(self, *args, **kwargs):
4087 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
4088 newobj = _core_.new_ActivateEvent(*args, **kwargs)
4089 self.this = newobj.this
4090 self.thisown = 1
4091 del newobj.thisown
4092 def GetActive(*args, **kwargs):
4093 """GetActive(self) -> bool"""
4094 return _core_.ActivateEvent_GetActive(*args, **kwargs)
4095
4096
4097class ActivateEventPtr(ActivateEvent):
4098 def __init__(self, this):
4099 self.this = this
4100 if not hasattr(self,"thisown"): self.thisown = 0
4101 self.__class__ = ActivateEvent
4102_core_.ActivateEvent_swigregister(ActivateEventPtr)
4103
4104#---------------------------------------------------------------------------
4105
4106class InitDialogEvent(Event):
36ed4f51 4107 """Proxy of C++ InitDialogEvent class"""
d55e5bfc
RD
4108 def __repr__(self):
4109 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4110 def __init__(self, *args, **kwargs):
4111 """__init__(self, int Id=0) -> InitDialogEvent"""
4112 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
4113 self.this = newobj.this
4114 self.thisown = 1
4115 del newobj.thisown
4116
4117class InitDialogEventPtr(InitDialogEvent):
4118 def __init__(self, this):
4119 self.this = this
4120 if not hasattr(self,"thisown"): self.thisown = 0
4121 self.__class__ = InitDialogEvent
4122_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
4123
4124#---------------------------------------------------------------------------
4125
4126class MenuEvent(Event):
36ed4f51 4127 """Proxy of C++ MenuEvent class"""
d55e5bfc
RD
4128 def __repr__(self):
4129 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4130 def __init__(self, *args, **kwargs):
4131 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
4132 newobj = _core_.new_MenuEvent(*args, **kwargs)
4133 self.this = newobj.this
4134 self.thisown = 1
4135 del newobj.thisown
4136 def GetMenuId(*args, **kwargs):
4137 """GetMenuId(self) -> int"""
4138 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
4139
4140 def IsPopup(*args, **kwargs):
4141 """IsPopup(self) -> bool"""
4142 return _core_.MenuEvent_IsPopup(*args, **kwargs)
4143
4144 def GetMenu(*args, **kwargs):
4145 """GetMenu(self) -> Menu"""
4146 return _core_.MenuEvent_GetMenu(*args, **kwargs)
4147
4148
4149class MenuEventPtr(MenuEvent):
4150 def __init__(self, this):
4151 self.this = this
4152 if not hasattr(self,"thisown"): self.thisown = 0
4153 self.__class__ = MenuEvent
4154_core_.MenuEvent_swigregister(MenuEventPtr)
4155
4156#---------------------------------------------------------------------------
4157
4158class CloseEvent(Event):
36ed4f51 4159 """Proxy of C++ CloseEvent class"""
d55e5bfc
RD
4160 def __repr__(self):
4161 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4162 def __init__(self, *args, **kwargs):
4163 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
4164 newobj = _core_.new_CloseEvent(*args, **kwargs)
4165 self.this = newobj.this
4166 self.thisown = 1
4167 del newobj.thisown
4168 def SetLoggingOff(*args, **kwargs):
4169 """SetLoggingOff(self, bool logOff)"""
4170 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
4171
4172 def GetLoggingOff(*args, **kwargs):
4173 """GetLoggingOff(self) -> bool"""
4174 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
4175
4176 def Veto(*args, **kwargs):
4177 """Veto(self, bool veto=True)"""
4178 return _core_.CloseEvent_Veto(*args, **kwargs)
4179
4180 def SetCanVeto(*args, **kwargs):
4181 """SetCanVeto(self, bool canVeto)"""
4182 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
4183
4184 def CanVeto(*args, **kwargs):
4185 """CanVeto(self) -> bool"""
4186 return _core_.CloseEvent_CanVeto(*args, **kwargs)
4187
4188 def GetVeto(*args, **kwargs):
4189 """GetVeto(self) -> bool"""
4190 return _core_.CloseEvent_GetVeto(*args, **kwargs)
4191
4192
4193class CloseEventPtr(CloseEvent):
4194 def __init__(self, this):
4195 self.this = this
4196 if not hasattr(self,"thisown"): self.thisown = 0
4197 self.__class__ = CloseEvent
4198_core_.CloseEvent_swigregister(CloseEventPtr)
4199
4200#---------------------------------------------------------------------------
4201
4202class ShowEvent(Event):
36ed4f51 4203 """Proxy of C++ ShowEvent class"""
d55e5bfc
RD
4204 def __repr__(self):
4205 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4206 def __init__(self, *args, **kwargs):
4207 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
4208 newobj = _core_.new_ShowEvent(*args, **kwargs)
4209 self.this = newobj.this
4210 self.thisown = 1
4211 del newobj.thisown
4212 def SetShow(*args, **kwargs):
4213 """SetShow(self, bool show)"""
4214 return _core_.ShowEvent_SetShow(*args, **kwargs)
4215
4216 def GetShow(*args, **kwargs):
4217 """GetShow(self) -> bool"""
4218 return _core_.ShowEvent_GetShow(*args, **kwargs)
4219
4220
4221class ShowEventPtr(ShowEvent):
4222 def __init__(self, this):
4223 self.this = this
4224 if not hasattr(self,"thisown"): self.thisown = 0
4225 self.__class__ = ShowEvent
4226_core_.ShowEvent_swigregister(ShowEventPtr)
4227
4228#---------------------------------------------------------------------------
4229
4230class IconizeEvent(Event):
36ed4f51 4231 """Proxy of C++ IconizeEvent class"""
d55e5bfc
RD
4232 def __repr__(self):
4233 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4234 def __init__(self, *args, **kwargs):
4235 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
4236 newobj = _core_.new_IconizeEvent(*args, **kwargs)
4237 self.this = newobj.this
4238 self.thisown = 1
4239 del newobj.thisown
4240 def Iconized(*args, **kwargs):
4241 """Iconized(self) -> bool"""
4242 return _core_.IconizeEvent_Iconized(*args, **kwargs)
4243
4244
4245class IconizeEventPtr(IconizeEvent):
4246 def __init__(self, this):
4247 self.this = this
4248 if not hasattr(self,"thisown"): self.thisown = 0
4249 self.__class__ = IconizeEvent
4250_core_.IconizeEvent_swigregister(IconizeEventPtr)
4251
4252#---------------------------------------------------------------------------
4253
4254class MaximizeEvent(Event):
36ed4f51 4255 """Proxy of C++ MaximizeEvent class"""
d55e5bfc
RD
4256 def __repr__(self):
4257 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4258 def __init__(self, *args, **kwargs):
4259 """__init__(self, int id=0) -> MaximizeEvent"""
4260 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
4261 self.this = newobj.this
4262 self.thisown = 1
4263 del newobj.thisown
4264
4265class MaximizeEventPtr(MaximizeEvent):
4266 def __init__(self, this):
4267 self.this = this
4268 if not hasattr(self,"thisown"): self.thisown = 0
4269 self.__class__ = MaximizeEvent
4270_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
4271
4272#---------------------------------------------------------------------------
4273
4274class DropFilesEvent(Event):
36ed4f51 4275 """Proxy of C++ DropFilesEvent class"""
d55e5bfc
RD
4276 def __init__(self): raise RuntimeError, "No constructor defined"
4277 def __repr__(self):
4278 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4279 def GetPosition(*args, **kwargs):
4280 """GetPosition(self) -> Point"""
4281 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
4282
4283 def GetNumberOfFiles(*args, **kwargs):
4284 """GetNumberOfFiles(self) -> int"""
4285 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
4286
4287 def GetFiles(*args, **kwargs):
4288 """GetFiles(self) -> PyObject"""
4289 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
4290
4291
4292class DropFilesEventPtr(DropFilesEvent):
4293 def __init__(self, this):
4294 self.this = this
4295 if not hasattr(self,"thisown"): self.thisown = 0
4296 self.__class__ = DropFilesEvent
4297_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
4298
4299#---------------------------------------------------------------------------
4300
4301UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4302UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
4303class UpdateUIEvent(CommandEvent):
36ed4f51 4304 """Proxy of C++ UpdateUIEvent class"""
d55e5bfc
RD
4305 def __repr__(self):
4306 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4307 def __init__(self, *args, **kwargs):
4308 """__init__(self, int commandId=0) -> UpdateUIEvent"""
4309 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
4310 self.this = newobj.this
4311 self.thisown = 1
4312 del newobj.thisown
4313 def GetChecked(*args, **kwargs):
4314 """GetChecked(self) -> bool"""
4315 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
4316
4317 def GetEnabled(*args, **kwargs):
4318 """GetEnabled(self) -> bool"""
4319 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
4320
4321 def GetText(*args, **kwargs):
4322 """GetText(self) -> String"""
4323 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
4324
4325 def GetSetText(*args, **kwargs):
4326 """GetSetText(self) -> bool"""
4327 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
4328
4329 def GetSetChecked(*args, **kwargs):
4330 """GetSetChecked(self) -> bool"""
4331 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
4332
4333 def GetSetEnabled(*args, **kwargs):
4334 """GetSetEnabled(self) -> bool"""
4335 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
4336
4337 def Check(*args, **kwargs):
4338 """Check(self, bool check)"""
4339 return _core_.UpdateUIEvent_Check(*args, **kwargs)
4340
4341 def Enable(*args, **kwargs):
4342 """Enable(self, bool enable)"""
4343 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
4344
4345 def SetText(*args, **kwargs):
4346 """SetText(self, String text)"""
4347 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
4348
4349 def SetUpdateInterval(*args, **kwargs):
d6c14a4c 4350 """SetUpdateInterval(long updateInterval)"""
d55e5bfc
RD
4351 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4352
4353 SetUpdateInterval = staticmethod(SetUpdateInterval)
4354 def GetUpdateInterval(*args, **kwargs):
d6c14a4c 4355 """GetUpdateInterval() -> long"""
d55e5bfc
RD
4356 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4357
4358 GetUpdateInterval = staticmethod(GetUpdateInterval)
4359 def CanUpdate(*args, **kwargs):
d6c14a4c 4360 """CanUpdate(Window win) -> bool"""
d55e5bfc
RD
4361 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4362
4363 CanUpdate = staticmethod(CanUpdate)
4364 def ResetUpdateTime(*args, **kwargs):
d6c14a4c 4365 """ResetUpdateTime()"""
d55e5bfc
RD
4366 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4367
4368 ResetUpdateTime = staticmethod(ResetUpdateTime)
4369 def SetMode(*args, **kwargs):
d6c14a4c 4370 """SetMode(int mode)"""
d55e5bfc
RD
4371 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4372
4373 SetMode = staticmethod(SetMode)
4374 def GetMode(*args, **kwargs):
d6c14a4c 4375 """GetMode() -> int"""
d55e5bfc
RD
4376 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4377
4378 GetMode = staticmethod(GetMode)
4379
4380class UpdateUIEventPtr(UpdateUIEvent):
4381 def __init__(self, this):
4382 self.this = this
4383 if not hasattr(self,"thisown"): self.thisown = 0
4384 self.__class__ = UpdateUIEvent
4385_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
4386
4387def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4388 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
4389 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4390
4391def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4392 """UpdateUIEvent_GetUpdateInterval() -> long"""
4393 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4394
4395def UpdateUIEvent_CanUpdate(*args, **kwargs):
4396 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
4397 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4398
4399def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4400 """UpdateUIEvent_ResetUpdateTime()"""
4401 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4402
4403def UpdateUIEvent_SetMode(*args, **kwargs):
4404 """UpdateUIEvent_SetMode(int mode)"""
4405 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4406
4407def UpdateUIEvent_GetMode(*args, **kwargs):
4408 """UpdateUIEvent_GetMode() -> int"""
4409 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4410
4411#---------------------------------------------------------------------------
4412
4413class SysColourChangedEvent(Event):
36ed4f51 4414 """Proxy of C++ SysColourChangedEvent class"""
d55e5bfc
RD
4415 def __repr__(self):
4416 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4417 def __init__(self, *args, **kwargs):
4418 """__init__(self) -> SysColourChangedEvent"""
4419 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
4420 self.this = newobj.this
4421 self.thisown = 1
4422 del newobj.thisown
4423
4424class SysColourChangedEventPtr(SysColourChangedEvent):
4425 def __init__(self, this):
4426 self.this = this
4427 if not hasattr(self,"thisown"): self.thisown = 0
4428 self.__class__ = SysColourChangedEvent
4429_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
4430
4431#---------------------------------------------------------------------------
4432
4433class MouseCaptureChangedEvent(Event):
36ed4f51 4434 """Proxy of C++ MouseCaptureChangedEvent class"""
d55e5bfc
RD
4435 def __repr__(self):
4436 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4437 def __init__(self, *args, **kwargs):
4438 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
4439 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
4440 self.this = newobj.this
4441 self.thisown = 1
4442 del newobj.thisown
4443 def GetCapturedWindow(*args, **kwargs):
4444 """GetCapturedWindow(self) -> Window"""
4445 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
4446
4447
4448class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
4449 def __init__(self, this):
4450 self.this = this
4451 if not hasattr(self,"thisown"): self.thisown = 0
4452 self.__class__ = MouseCaptureChangedEvent
4453_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
4454
4455#---------------------------------------------------------------------------
4456
4457class DisplayChangedEvent(Event):
36ed4f51 4458 """Proxy of C++ DisplayChangedEvent class"""
d55e5bfc
RD
4459 def __repr__(self):
4460 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4461 def __init__(self, *args, **kwargs):
4462 """__init__(self) -> DisplayChangedEvent"""
4463 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
4464 self.this = newobj.this
4465 self.thisown = 1
4466 del newobj.thisown
4467
4468class DisplayChangedEventPtr(DisplayChangedEvent):
4469 def __init__(self, this):
4470 self.this = this
4471 if not hasattr(self,"thisown"): self.thisown = 0
4472 self.__class__ = DisplayChangedEvent
4473_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
4474
4475#---------------------------------------------------------------------------
4476
4477class PaletteChangedEvent(Event):
36ed4f51 4478 """Proxy of C++ PaletteChangedEvent class"""
d55e5bfc
RD
4479 def __repr__(self):
4480 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4481 def __init__(self, *args, **kwargs):
4482 """__init__(self, int id=0) -> PaletteChangedEvent"""
4483 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
4484 self.this = newobj.this
4485 self.thisown = 1
4486 del newobj.thisown
4487 def SetChangedWindow(*args, **kwargs):
4488 """SetChangedWindow(self, Window win)"""
4489 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
4490
4491 def GetChangedWindow(*args, **kwargs):
4492 """GetChangedWindow(self) -> Window"""
4493 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
4494
4495
4496class PaletteChangedEventPtr(PaletteChangedEvent):
4497 def __init__(self, this):
4498 self.this = this
4499 if not hasattr(self,"thisown"): self.thisown = 0
4500 self.__class__ = PaletteChangedEvent
4501_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
4502
4503#---------------------------------------------------------------------------
4504
4505class QueryNewPaletteEvent(Event):
36ed4f51 4506 """Proxy of C++ QueryNewPaletteEvent class"""
d55e5bfc
RD
4507 def __repr__(self):
4508 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4509 def __init__(self, *args, **kwargs):
4510 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
4511 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
4512 self.this = newobj.this
4513 self.thisown = 1
4514 del newobj.thisown
4515 def SetPaletteRealized(*args, **kwargs):
4516 """SetPaletteRealized(self, bool realized)"""
4517 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
4518
4519 def GetPaletteRealized(*args, **kwargs):
4520 """GetPaletteRealized(self) -> bool"""
4521 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
4522
4523
4524class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
4525 def __init__(self, this):
4526 self.this = this
4527 if not hasattr(self,"thisown"): self.thisown = 0
4528 self.__class__ = QueryNewPaletteEvent
4529_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
4530
4531#---------------------------------------------------------------------------
4532
4533class NavigationKeyEvent(Event):
36ed4f51 4534 """Proxy of C++ NavigationKeyEvent class"""
d55e5bfc
RD
4535 def __repr__(self):
4536 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4537 def __init__(self, *args, **kwargs):
4538 """__init__(self) -> NavigationKeyEvent"""
4539 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
4540 self.this = newobj.this
4541 self.thisown = 1
4542 del newobj.thisown
4543 def GetDirection(*args, **kwargs):
4544 """GetDirection(self) -> bool"""
4545 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
4546
4547 def SetDirection(*args, **kwargs):
908b74cd 4548 """SetDirection(self, bool forward)"""
d55e5bfc
RD
4549 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
4550
4551 def IsWindowChange(*args, **kwargs):
4552 """IsWindowChange(self) -> bool"""
4553 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
4554
4555 def SetWindowChange(*args, **kwargs):
908b74cd 4556 """SetWindowChange(self, bool ischange)"""
d55e5bfc
RD
4557 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
4558
908b74cd
RD
4559 def SetFlags(*args, **kwargs):
4560 """SetFlags(self, long flags)"""
4561 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
4562
d55e5bfc
RD
4563 def GetCurrentFocus(*args, **kwargs):
4564 """GetCurrentFocus(self) -> Window"""
4565 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
4566
4567 def SetCurrentFocus(*args, **kwargs):
4568 """SetCurrentFocus(self, Window win)"""
4569 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
4570
92379a03 4571 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
4572 IsForward = _core_.NavigationKeyEvent_IsForward
4573 WinChange = _core_.NavigationKeyEvent_WinChange
d55e5bfc
RD
4574
4575class NavigationKeyEventPtr(NavigationKeyEvent):
4576 def __init__(self, this):
4577 self.this = this
4578 if not hasattr(self,"thisown"): self.thisown = 0
4579 self.__class__ = NavigationKeyEvent
4580_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
4581
4582#---------------------------------------------------------------------------
4583
4584class WindowCreateEvent(CommandEvent):
36ed4f51 4585 """Proxy of C++ WindowCreateEvent class"""
d55e5bfc
RD
4586 def __repr__(self):
4587 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4588 def __init__(self, *args, **kwargs):
4589 """__init__(self, Window win=None) -> WindowCreateEvent"""
4590 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
4591 self.this = newobj.this
4592 self.thisown = 1
4593 del newobj.thisown
4594 def GetWindow(*args, **kwargs):
4595 """GetWindow(self) -> Window"""
4596 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
4597
4598
4599class WindowCreateEventPtr(WindowCreateEvent):
4600 def __init__(self, this):
4601 self.this = this
4602 if not hasattr(self,"thisown"): self.thisown = 0
4603 self.__class__ = WindowCreateEvent
4604_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
4605
4606class WindowDestroyEvent(CommandEvent):
36ed4f51 4607 """Proxy of C++ WindowDestroyEvent class"""
d55e5bfc
RD
4608 def __repr__(self):
4609 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4610 def __init__(self, *args, **kwargs):
4611 """__init__(self, Window win=None) -> WindowDestroyEvent"""
4612 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
4613 self.this = newobj.this
4614 self.thisown = 1
4615 del newobj.thisown
4616 def GetWindow(*args, **kwargs):
4617 """GetWindow(self) -> Window"""
4618 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
4619
4620
4621class WindowDestroyEventPtr(WindowDestroyEvent):
4622 def __init__(self, this):
4623 self.this = this
4624 if not hasattr(self,"thisown"): self.thisown = 0
4625 self.__class__ = WindowDestroyEvent
4626_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
4627
4628#---------------------------------------------------------------------------
4629
4630class ContextMenuEvent(CommandEvent):
36ed4f51 4631 """Proxy of C++ ContextMenuEvent class"""
d55e5bfc
RD
4632 def __repr__(self):
4633 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4634 def __init__(self, *args, **kwargs):
4635 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
4636 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
4637 self.this = newobj.this
4638 self.thisown = 1
4639 del newobj.thisown
4640 def GetPosition(*args, **kwargs):
4641 """GetPosition(self) -> Point"""
4642 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
4643
4644 def SetPosition(*args, **kwargs):
4645 """SetPosition(self, Point pos)"""
4646 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
4647
4648
4649class ContextMenuEventPtr(ContextMenuEvent):
4650 def __init__(self, this):
4651 self.this = this
4652 if not hasattr(self,"thisown"): self.thisown = 0
4653 self.__class__ = ContextMenuEvent
4654_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
4655
4656#---------------------------------------------------------------------------
4657
4658IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4659IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
4660class IdleEvent(Event):
36ed4f51 4661 """Proxy of C++ IdleEvent class"""
d55e5bfc
RD
4662 def __repr__(self):
4663 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4664 def __init__(self, *args, **kwargs):
4665 """__init__(self) -> IdleEvent"""
4666 newobj = _core_.new_IdleEvent(*args, **kwargs)
4667 self.this = newobj.this
4668 self.thisown = 1
4669 del newobj.thisown
4670 def RequestMore(*args, **kwargs):
4671 """RequestMore(self, bool needMore=True)"""
4672 return _core_.IdleEvent_RequestMore(*args, **kwargs)
4673
4674 def MoreRequested(*args, **kwargs):
4675 """MoreRequested(self) -> bool"""
4676 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
4677
4678 def SetMode(*args, **kwargs):
d6c14a4c 4679 """SetMode(int mode)"""
d55e5bfc
RD
4680 return _core_.IdleEvent_SetMode(*args, **kwargs)
4681
4682 SetMode = staticmethod(SetMode)
4683 def GetMode(*args, **kwargs):
d6c14a4c 4684 """GetMode() -> int"""
d55e5bfc
RD
4685 return _core_.IdleEvent_GetMode(*args, **kwargs)
4686
4687 GetMode = staticmethod(GetMode)
4688 def CanSend(*args, **kwargs):
d6c14a4c 4689 """CanSend(Window win) -> bool"""
d55e5bfc
RD
4690 return _core_.IdleEvent_CanSend(*args, **kwargs)
4691
4692 CanSend = staticmethod(CanSend)
4693
4694class IdleEventPtr(IdleEvent):
4695 def __init__(self, this):
4696 self.this = this
4697 if not hasattr(self,"thisown"): self.thisown = 0
4698 self.__class__ = IdleEvent
4699_core_.IdleEvent_swigregister(IdleEventPtr)
4700
4701def IdleEvent_SetMode(*args, **kwargs):
4702 """IdleEvent_SetMode(int mode)"""
4703 return _core_.IdleEvent_SetMode(*args, **kwargs)
4704
4705def IdleEvent_GetMode(*args, **kwargs):
4706 """IdleEvent_GetMode() -> int"""
4707 return _core_.IdleEvent_GetMode(*args, **kwargs)
4708
4709def IdleEvent_CanSend(*args, **kwargs):
4710 """IdleEvent_CanSend(Window win) -> bool"""
4711 return _core_.IdleEvent_CanSend(*args, **kwargs)
4712
4713#---------------------------------------------------------------------------
4714
4715class PyEvent(Event):
36ed4f51 4716 """Proxy of C++ PyEvent class"""
d55e5bfc
RD
4717 def __repr__(self):
4718 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4719 def __init__(self, *args, **kwargs):
4720 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
4721 newobj = _core_.new_PyEvent(*args, **kwargs)
4722 self.this = newobj.this
4723 self.thisown = 1
4724 del newobj.thisown
4725 self.SetSelf(self)
4726
4727 def __del__(self, destroy=_core_.delete_PyEvent):
4728 """__del__(self)"""
4729 try:
4730 if self.thisown: destroy(self)
4731 except: pass
4732
4733 def SetSelf(*args, **kwargs):
4734 """SetSelf(self, PyObject self)"""
4735 return _core_.PyEvent_SetSelf(*args, **kwargs)
4736
4737 def GetSelf(*args, **kwargs):
4738 """GetSelf(self) -> PyObject"""
4739 return _core_.PyEvent_GetSelf(*args, **kwargs)
4740
4741
4742class PyEventPtr(PyEvent):
4743 def __init__(self, this):
4744 self.this = this
4745 if not hasattr(self,"thisown"): self.thisown = 0
4746 self.__class__ = PyEvent
4747_core_.PyEvent_swigregister(PyEventPtr)
4748
4749class PyCommandEvent(CommandEvent):
36ed4f51 4750 """Proxy of C++ PyCommandEvent class"""
d55e5bfc
RD
4751 def __repr__(self):
4752 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4753 def __init__(self, *args, **kwargs):
4754 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
4755 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
4756 self.this = newobj.this
4757 self.thisown = 1
4758 del newobj.thisown
4759 self.SetSelf(self)
4760
4761 def __del__(self, destroy=_core_.delete_PyCommandEvent):
4762 """__del__(self)"""
4763 try:
4764 if self.thisown: destroy(self)
4765 except: pass
4766
4767 def SetSelf(*args, **kwargs):
4768 """SetSelf(self, PyObject self)"""
4769 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
4770
4771 def GetSelf(*args, **kwargs):
4772 """GetSelf(self) -> PyObject"""
4773 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
4774
4775
4776class PyCommandEventPtr(PyCommandEvent):
4777 def __init__(self, this):
4778 self.this = this
4779 if not hasattr(self,"thisown"): self.thisown = 0
4780 self.__class__ = PyCommandEvent
4781_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
4782
4783#---------------------------------------------------------------------------
4784
4785PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4786PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4787PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4788PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4789PRINT_WINDOWS = _core_.PRINT_WINDOWS
4790PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
4791class PyApp(EvtHandler):
d6c14a4c
RD
4792 """
4793 The ``wx.PyApp`` class is an *implementation detail*, please use the
4794 `wx.App` class (or some other derived class) instead.
4795 """
d55e5bfc
RD
4796 def __repr__(self):
4797 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4798 def __init__(self, *args, **kwargs):
4799 """
4800 __init__(self) -> PyApp
4801
4802 Create a new application object, starting the bootstrap process.
4803 """
4804 newobj = _core_.new_PyApp(*args, **kwargs)
4805 self.this = newobj.this
4806 self.thisown = 1
4807 del newobj.thisown
4808 self._setCallbackInfo(self, PyApp)
4809 self._setOORInfo(self)
4810
4811 def __del__(self, destroy=_core_.delete_PyApp):
4812 """__del__(self)"""
4813 try:
4814 if self.thisown: destroy(self)
4815 except: pass
4816
4817 def _setCallbackInfo(*args, **kwargs):
4818 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
4819 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
4820
4821 def GetAppName(*args, **kwargs):
4822 """
4823 GetAppName(self) -> String
4824
4825 Get the application name.
4826 """
4827 return _core_.PyApp_GetAppName(*args, **kwargs)
4828
4829 def SetAppName(*args, **kwargs):
4830 """
4831 SetAppName(self, String name)
4832
d6c14a4c
RD
4833 Set the application name. This value may be used automatically by
4834 `wx.Config` and such.
d55e5bfc
RD
4835 """
4836 return _core_.PyApp_SetAppName(*args, **kwargs)
4837
4838 def GetClassName(*args, **kwargs):
4839 """
4840 GetClassName(self) -> String
4841
4842 Get the application's class name.
4843 """
4844 return _core_.PyApp_GetClassName(*args, **kwargs)
4845
4846 def SetClassName(*args, **kwargs):
4847 """
4848 SetClassName(self, String name)
4849
d6c14a4c
RD
4850 Set the application's class name. This value may be used for
4851 X-resources if applicable for the platform
d55e5bfc
RD
4852 """
4853 return _core_.PyApp_SetClassName(*args, **kwargs)
4854
4855 def GetVendorName(*args, **kwargs):
4856 """
4857 GetVendorName(self) -> String
4858
4859 Get the application's vendor name.
4860 """
4861 return _core_.PyApp_GetVendorName(*args, **kwargs)
4862
4863 def SetVendorName(*args, **kwargs):
4864 """
4865 SetVendorName(self, String name)
4866
d6c14a4c
RD
4867 Set the application's vendor name. This value may be used
4868 automatically by `wx.Config` and such.
d55e5bfc
RD
4869 """
4870 return _core_.PyApp_SetVendorName(*args, **kwargs)
4871
4872 def GetTraits(*args, **kwargs):
4873 """
4874 GetTraits(self) -> wxAppTraits
4875
d6c14a4c
RD
4876 Return (and create if necessary) the app traits object to which we
4877 delegate for everything which either should be configurable by the
4878 user (then he can change the default behaviour simply by overriding
4879 CreateTraits() and returning his own traits object) or which is
4880 GUI/console dependent as then wx.AppTraits allows us to abstract the
4881 differences behind the common facade.
4882
4883 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc
RD
4884 """
4885 return _core_.PyApp_GetTraits(*args, **kwargs)
4886
4887 def ProcessPendingEvents(*args, **kwargs):
4888 """
4889 ProcessPendingEvents(self)
4890
d6c14a4c
RD
4891 Process all events in the Pending Events list -- it is necessary to
4892 call this function to process posted events. This normally happens
4893 during each event loop iteration.
d55e5bfc
RD
4894 """
4895 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
4896
4897 def Yield(*args, **kwargs):
4898 """
4899 Yield(self, bool onlyIfNeeded=False) -> bool
4900
d6c14a4c
RD
4901 Process all currently pending events right now, instead of waiting
4902 until return to the event loop. It is an error to call ``Yield``
4903 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 4904
d6c14a4c 4905 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
4906 reentrancies (i.e. when called from an event handler it may
4907 result in calling the same event handler again), use with
4908 extreme care or, better, don't use at all!
d55e5bfc 4909
d6c14a4c 4910 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 4911
d55e5bfc
RD
4912 """
4913 return _core_.PyApp_Yield(*args, **kwargs)
4914
4915 def WakeUpIdle(*args, **kwargs):
4916 """
4917 WakeUpIdle(self)
4918
d6c14a4c
RD
4919 Make sure that idle events are sent again.
4920 :see: `wx.WakeUpIdle`
d55e5bfc
RD
4921 """
4922 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
4923
84f85550
RD
4924 def IsMainLoopRunning(*args, **kwargs):
4925 """
4926 IsMainLoopRunning() -> bool
4927
4928 Returns True if we're running the main loop, i.e. if the events can
4929 currently be dispatched.
4930 """
4931 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
4932
4933 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
4934 def MainLoop(*args, **kwargs):
4935 """
4936 MainLoop(self) -> int
4937
d6c14a4c
RD
4938 Execute the main GUI loop, the function doesn't normally return until
4939 all top level windows have been closed and destroyed.
d55e5bfc
RD
4940 """
4941 return _core_.PyApp_MainLoop(*args, **kwargs)
4942
4943 def Exit(*args, **kwargs):
4944 """
4945 Exit(self)
4946
4947 Exit the main loop thus terminating the application.
d6c14a4c 4948 :see: `wx.Exit`
d55e5bfc
RD
4949 """
4950 return _core_.PyApp_Exit(*args, **kwargs)
4951
4952 def ExitMainLoop(*args, **kwargs):
4953 """
4954 ExitMainLoop(self)
4955
d6c14a4c
RD
4956 Exit the main GUI loop during the next iteration of the main
4957 loop, (i.e. it does not stop the program immediately!)
d55e5bfc
RD
4958 """
4959 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
4960
4961 def Pending(*args, **kwargs):
4962 """
4963 Pending(self) -> bool
4964
4965 Returns True if there are unprocessed events in the event queue.
4966 """
4967 return _core_.PyApp_Pending(*args, **kwargs)
4968
4969 def Dispatch(*args, **kwargs):
4970 """
4971 Dispatch(self) -> bool
4972
4973 Process the first event in the event queue (blocks until an event
4974 appears if there are none currently)
4975 """
4976 return _core_.PyApp_Dispatch(*args, **kwargs)
4977
4978 def ProcessIdle(*args, **kwargs):
4979 """
4980 ProcessIdle(self) -> bool
4981
d6c14a4c
RD
4982 Called from the MainLoop when the application becomes idle (there are
4983 no pending events) and sends a `wx.IdleEvent` to all interested
4984 parties. Returns True if more idle events are needed, False if not.
d55e5bfc
RD
4985 """
4986 return _core_.PyApp_ProcessIdle(*args, **kwargs)
4987
4988 def SendIdleEvents(*args, **kwargs):
4989 """
4990 SendIdleEvents(self, Window win, IdleEvent event) -> bool
4991
d6c14a4c
RD
4992 Send idle event to window and all subwindows. Returns True if more
4993 idle time is requested.
d55e5bfc
RD
4994 """
4995 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
4996
4997 def IsActive(*args, **kwargs):
4998 """
4999 IsActive(self) -> bool
5000
5001 Return True if our app has focus.
5002 """
5003 return _core_.PyApp_IsActive(*args, **kwargs)
5004
5005 def SetTopWindow(*args, **kwargs):
5006 """
5007 SetTopWindow(self, Window win)
5008
d6c14a4c 5009 Set the *main* top level window
d55e5bfc
RD
5010 """
5011 return _core_.PyApp_SetTopWindow(*args, **kwargs)
5012
5013 def GetTopWindow(*args, **kwargs):
5014 """
5015 GetTopWindow(self) -> Window
5016
d6c14a4c
RD
5017 Return the *main* top level window (if it hadn't been set previously
5018 with SetTopWindow(), will return just some top level window and, if
5019 there not any, will return None)
d55e5bfc
RD
5020 """
5021 return _core_.PyApp_GetTopWindow(*args, **kwargs)
5022
5023 def SetExitOnFrameDelete(*args, **kwargs):
5024 """
5025 SetExitOnFrameDelete(self, bool flag)
5026
d6c14a4c
RD
5027 Control the exit behaviour: by default, the program will exit the main
5028 loop (and so, usually, terminate) when the last top-level program
5029 window is deleted. Beware that if you disable this behaviour (with
5030 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
5031 explicitly from somewhere.
d55e5bfc
RD
5032 """
5033 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
5034
5035 def GetExitOnFrameDelete(*args, **kwargs):
5036 """
5037 GetExitOnFrameDelete(self) -> bool
5038
5039 Get the current exit behaviour setting.
5040 """
5041 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
5042
5043 def SetUseBestVisual(*args, **kwargs):
5044 """
5045 SetUseBestVisual(self, bool flag)
5046
d6c14a4c
RD
5047 Set whether the app should try to use the best available visual on
5048 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc
RD
5049 """
5050 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
5051
5052 def GetUseBestVisual(*args, **kwargs):
5053 """
5054 GetUseBestVisual(self) -> bool
5055
5056 Get current UseBestVisual setting.
5057 """
5058 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
5059
5060 def SetPrintMode(*args, **kwargs):
5061 """SetPrintMode(self, int mode)"""
5062 return _core_.PyApp_SetPrintMode(*args, **kwargs)
5063
5064 def GetPrintMode(*args, **kwargs):
5065 """GetPrintMode(self) -> int"""
5066 return _core_.PyApp_GetPrintMode(*args, **kwargs)
5067
5068 def SetAssertMode(*args, **kwargs):
5069 """
5070 SetAssertMode(self, int mode)
5071
15817c7e 5072 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc
RD
5073 """
5074 return _core_.PyApp_SetAssertMode(*args, **kwargs)
5075
5076 def GetAssertMode(*args, **kwargs):
5077 """
5078 GetAssertMode(self) -> int
5079
5080 Get the current OnAssert behaviour setting.
5081 """
5082 return _core_.PyApp_GetAssertMode(*args, **kwargs)
5083
5084 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 5085 """GetMacSupportPCMenuShortcuts() -> bool"""
d55e5bfc
RD
5086 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5087
5088 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
5089 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 5090 """GetMacAboutMenuItemId() -> long"""
d55e5bfc
RD
5091 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5092
5093 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
5094 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 5095 """GetMacPreferencesMenuItemId() -> long"""
d55e5bfc
RD
5096 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5097
5098 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
5099 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 5100 """GetMacExitMenuItemId() -> long"""
d55e5bfc
RD
5101 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5102
5103 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
5104 def GetMacHelpMenuTitleName(*args, **kwargs):
d6c14a4c 5105 """GetMacHelpMenuTitleName() -> String"""
d55e5bfc
RD
5106 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5107
5108 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
5109 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 5110 """SetMacSupportPCMenuShortcuts(bool val)"""
d55e5bfc
RD
5111 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5112
5113 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
5114 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 5115 """SetMacAboutMenuItemId(long val)"""
d55e5bfc
RD
5116 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5117
5118 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
5119 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 5120 """SetMacPreferencesMenuItemId(long val)"""
d55e5bfc
RD
5121 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5122
5123 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
5124 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 5125 """SetMacExitMenuItemId(long val)"""
d55e5bfc
RD
5126 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5127
5128 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
5129 def SetMacHelpMenuTitleName(*args, **kwargs):
d6c14a4c 5130 """SetMacHelpMenuTitleName(String val)"""
d55e5bfc
RD
5131 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5132
5133 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
5134 def _BootstrapApp(*args, **kwargs):
5135 """
5136 _BootstrapApp(self)
5137
5138 For internal use only
5139 """
5140 return _core_.PyApp__BootstrapApp(*args, **kwargs)
5141
5142 def GetComCtl32Version(*args, **kwargs):
5143 """
d6c14a4c 5144 GetComCtl32Version() -> int
d55e5bfc 5145
d6c14a4c
RD
5146 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5147 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
5148 """
5149 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5150
5151 GetComCtl32Version = staticmethod(GetComCtl32Version)
5152
5153class PyAppPtr(PyApp):
5154 def __init__(self, this):
5155 self.this = this
5156 if not hasattr(self,"thisown"): self.thisown = 0
5157 self.__class__ = PyApp
5158_core_.PyApp_swigregister(PyAppPtr)
5159
84f85550
RD
5160def PyApp_IsMainLoopRunning(*args, **kwargs):
5161 """
5162 PyApp_IsMainLoopRunning() -> bool
5163
5164 Returns True if we're running the main loop, i.e. if the events can
5165 currently be dispatched.
5166 """
5167 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5168
d55e5bfc
RD
5169def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
5170 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
5171 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5172
5173def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
5174 """PyApp_GetMacAboutMenuItemId() -> long"""
5175 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5176
5177def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
5178 """PyApp_GetMacPreferencesMenuItemId() -> long"""
5179 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5180
5181def PyApp_GetMacExitMenuItemId(*args, **kwargs):
5182 """PyApp_GetMacExitMenuItemId() -> long"""
5183 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5184
5185def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
5186 """PyApp_GetMacHelpMenuTitleName() -> String"""
5187 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5188
5189def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
5190 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
5191 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5192
5193def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
5194 """PyApp_SetMacAboutMenuItemId(long val)"""
5195 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5196
5197def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
5198 """PyApp_SetMacPreferencesMenuItemId(long val)"""
5199 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5200
5201def PyApp_SetMacExitMenuItemId(*args, **kwargs):
5202 """PyApp_SetMacExitMenuItemId(long val)"""
5203 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5204
5205def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
5206 """PyApp_SetMacHelpMenuTitleName(String val)"""
5207 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5208
5209def PyApp_GetComCtl32Version(*args, **kwargs):
5210 """
5211 PyApp_GetComCtl32Version() -> int
5212
d6c14a4c
RD
5213 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5214 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
5215 """
5216 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5217
5218#---------------------------------------------------------------------------
5219
5220
5221def Exit(*args, **kwargs):
5222 """
5223 Exit()
5224
5225 Force an exit of the application. Convenience for wx.GetApp().Exit()
5226 """
5227 return _core_.Exit(*args, **kwargs)
5228
5229def Yield(*args, **kwargs):
5230 """
5231 Yield() -> bool
5232
5233 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
5234 """
5235 return _core_.Yield(*args, **kwargs)
5236
5237def YieldIfNeeded(*args, **kwargs):
5238 """
5239 YieldIfNeeded() -> bool
5240
5241 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
5242 """
5243 return _core_.YieldIfNeeded(*args, **kwargs)
5244
5245def SafeYield(*args, **kwargs):
5246 """
5247 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
5248
d6c14a4c
RD
5249 This function is similar to `wx.Yield`, except that it disables the
5250 user input to all program windows before calling `wx.Yield` and
5251 re-enables it again afterwards. If ``win`` is not None, this window
5252 will remain enabled, allowing the implementation of some limited user
5253 interaction.
d55e5bfc 5254
d6c14a4c 5255 :Returns: the result of the call to `wx.Yield`.
d55e5bfc
RD
5256 """
5257 return _core_.SafeYield(*args, **kwargs)
5258
5259def WakeUpIdle(*args, **kwargs):
5260 """
5261 WakeUpIdle()
5262
d6c14a4c
RD
5263 Cause the message queue to become empty again, so idle events will be
5264 sent.
d55e5bfc
RD
5265 """
5266 return _core_.WakeUpIdle(*args, **kwargs)
5267
5268def PostEvent(*args, **kwargs):
5269 """
5270 PostEvent(EvtHandler dest, Event event)
5271
d6c14a4c
RD
5272 Send an event to a window or other wx.EvtHandler to be processed
5273 later.
d55e5bfc
RD
5274 """
5275 return _core_.PostEvent(*args, **kwargs)
5276
5277def App_CleanUp(*args, **kwargs):
5278 """
5279 App_CleanUp()
5280
15817c7e 5281 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 5282 Python shuts down.
d55e5bfc
RD
5283 """
5284 return _core_.App_CleanUp(*args, **kwargs)
5285
5286def GetApp(*args, **kwargs):
5287 """
5288 GetApp() -> PyApp
5289
5290 Return a reference to the current wx.App object.
5291 """
5292 return _core_.GetApp(*args, **kwargs)
5cbf236d
RD
5293
5294def SetDefaultPyEncoding(*args, **kwargs):
5295 """
5296 SetDefaultPyEncoding(string encoding)
5297
5298 Sets the encoding that wxPython will use when it needs to convert a
5299 Python string or unicode object to or from a wxString.
62d32a5f
RD
5300
5301 The default encoding is the value of ``locale.getdefaultlocale()[1]``
5302 but please be aware that the default encoding within the same locale
5303 may be slightly different on different platforms. For example, please
5304 see http://www.alanwood.net/demos/charsetdiffs.html for differences
5305 between the common latin/roman encodings.
5cbf236d
RD
5306 """
5307 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5308
5309def GetDefaultPyEncoding(*args, **kwargs):
5310 """
5311 GetDefaultPyEncoding() -> string
5312
5313 Gets the current encoding that wxPython will use when it needs to
5314 convert a Python string or unicode object to or from a wxString.
5315 """
5316 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d55e5bfc
RD
5317#----------------------------------------------------------------------
5318
5319class PyOnDemandOutputWindow:
5320 """
5321 A class that can be used for redirecting Python's stdout and
5322 stderr streams. It will do nothing until something is wrriten to
5323 the stream at which point it will create a Frame with a text area
5324 and write the text there.
5325 """
5326 def __init__(self, title = "wxPython: stdout/stderr"):
5327 self.frame = None
5328 self.title = title
412d302d
RD
5329 self.pos = wx.DefaultPosition
5330 self.size = (450, 300)
d55e5bfc
RD
5331 self.parent = None
5332
5333 def SetParent(self, parent):
5334 """Set the window to be used as the popup Frame's parent."""
5335 self.parent = parent
5336
5337
5338 def CreateOutputWindow(self, st):
412d302d
RD
5339 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
5340 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 5341 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 5342 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 5343 self.text.AppendText(st)
d55e5bfc
RD
5344 self.frame.Show(True)
5345 EVT_CLOSE(self.frame, self.OnCloseWindow)
5346
5347
5348 def OnCloseWindow(self, event):
5349 if self.frame is not None:
5350 self.frame.Destroy()
5351 self.frame = None
5352 self.text = None
5353
5354
5355 # These methods provide the file-like output behaviour.
5356 def write(self, text):
5357 """
5358 Create the output window if needed and write the string to it.
5359 If not called in the context of the gui thread then uses
5360 CallAfter to do the work there.
5361 """
5362 if self.frame is None:
5363 if not wx.Thread_IsMain():
5364 wx.CallAfter(self.CreateOutputWindow, text)
5365 else:
5366 self.CreateOutputWindow(text)
5367 else:
5368 if not wx.Thread_IsMain():
5369 wx.CallAfter(self.text.AppendText, text)
5370 else:
5371 self.text.AppendText(text)
5372
5373
5374 def close(self):
5375 if self.frame is not None:
5376 wx.CallAfter(self.frame.Close)
5377
5378
bb4524c4
RD
5379 def flush(self):
5380 pass
5381
5382
d55e5bfc
RD
5383
5384#----------------------------------------------------------------------
5385
5386_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5387
5388class App(wx.PyApp):
5389 """
d6c14a4c
RD
5390 The ``wx.App`` class represents the application and is used to:
5391
5392 * bootstrap the wxPython system and initialize the underlying
5393 gui toolkit
5394 * set and get application-wide properties
5395 * implement the windowing system main message or event loop,
5396 and to dispatch events to window instances
5397 * etc.
5398
5399 Every application must have a ``wx.App`` instance, and all
5400 creation of UI objects should be delayed until after the
5401 ``wx.App`` object has been created in order to ensure that the gui
5402 platform and wxWidgets have been fully initialized.
5403
5404 Normally you would derive from this class and implement an
5405 ``OnInit`` method that creates a frame and then calls
5406 ``self.SetTopWindow(frame)``.
5407
5408 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 5409 directly.
d55e5bfc 5410 """
d6c14a4c 5411
d55e5bfc
RD
5412 outputWindowClass = PyOnDemandOutputWindow
5413
d6c14a4c
RD
5414 def __init__(self, redirect=_defRedirect, filename=None,
5415 useBestVisual=False, clearSigInt=True):
5416 """
5417 Construct a ``wx.App`` object.
5418
5419 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5420 redirected? Defaults to True on Windows and Mac, False
5421 otherwise. If `filename` is None then output will be
5422 redirected to a window that pops up as needed. (You can
5423 control what kind of window is created for the output by
5424 resetting the class variable ``outputWindowClass`` to a
5425 class of your choosing.)
5426
5427 :param filename: The name of a file to redirect output to, if
5428 redirect is True.
5429
5430 :param useBestVisual: Should the app try to use the best
5431 available visual provided by the system (only relevant on
5432 systems that have more than one visual.) This parameter
5433 must be used instead of calling `SetUseBestVisual` later
5434 on because it must be set before the underlying GUI
5435 toolkit is initialized.
5436
5437 :param clearSigInt: Should SIGINT be cleared? This allows the
5438 app to terminate upon a Ctrl-C in the console like other
5439 GUI apps will.
5440
5441 :note: You should override OnInit to do applicaition
5442 initialization to ensure that the system, toolkit and
5443 wxWidgets are fully initialized.
5444 """
d55e5bfc
RD
5445 wx.PyApp.__init__(self)
5446
5447 if wx.Platform == "__WXMAC__":
5448 try:
5449 import MacOS
5450 if not MacOS.WMAvailable():
5451 print """\
5452This program needs access to the screen. Please run with 'pythonw',
5453not 'python', and only when you are logged in on the main display of
5454your Mac."""
5455 _sys.exit(1)
0346c964
RD
5456 except SystemExit:
5457 raise
d55e5bfc
RD
5458 except:
5459 pass
5460
5461 # This has to be done before OnInit
5462 self.SetUseBestVisual(useBestVisual)
5463
5464 # Set the default handler for SIGINT. This fixes a problem
5465 # where if Ctrl-C is pressed in the console that started this
5466 # app then it will not appear to do anything, (not even send
5467 # KeyboardInterrupt???) but will later segfault on exit. By
5468 # setting the default handler then the app will exit, as
5469 # expected (depending on platform.)
d6c14a4c
RD
5470 if clearSigInt:
5471 try:
5472 import signal
5473 signal.signal(signal.SIGINT, signal.SIG_DFL)
5474 except:
5475 pass
d55e5bfc
RD
5476
5477 # Save and redirect the stdio to a window?
5478 self.stdioWin = None
5479 self.saveStdio = (_sys.stdout, _sys.stderr)
5480 if redirect:
5481 self.RedirectStdio(filename)
5482
8fb0e70a
RD
5483 # Use Python's install prefix as the default
5484 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
5485
d55e5bfc
RD
5486 # This finishes the initialization of wxWindows and then calls
5487 # the OnInit that should be present in the derived class
5488 self._BootstrapApp()
5489
5490
5491 def __del__(self):
5492 try:
5493 self.RestoreStdio() # Just in case the MainLoop was overridden
5494 except:
5495 pass
5496
5497
5498 def SetTopWindow(self, frame):
5499 """Set the \"main\" top level window"""
5500 if self.stdioWin:
5501 self.stdioWin.SetParent(frame)
5502 wx.PyApp.SetTopWindow(self, frame)
5503
5504
5505 def MainLoop(self):
5506 """Execute the main GUI event loop"""
5507 wx.PyApp.MainLoop(self)
5508 self.RestoreStdio()
5509
5510
5511 def RedirectStdio(self, filename=None):
5512 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
5513 if filename:
5514 _sys.stdout = _sys.stderr = open(filename, 'a')
5515 else:
5516 self.stdioWin = self.outputWindowClass()
5517 _sys.stdout = _sys.stderr = self.stdioWin
5518
5519
5520 def RestoreStdio(self):
5521 _sys.stdout, _sys.stderr = self.saveStdio
5522
5523
412d302d
RD
5524 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
5525 """
5526 Set the title, position and/or size of the output window if
f5b96ee1
RD
5527 the stdio has been redirected. This should be called before
5528 any output would cause the output window to be created.
412d302d
RD
5529 """
5530 if self.stdioWin:
5531 if title is not None:
5532 self.stdioWin.title = title
5533 if pos is not None:
5534 self.stdioWin.pos = pos
5535 if size is not None:
5536 self.stdioWin.size = size
5537
5538
5539
d55e5bfc 5540
d6c14a4c 5541# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
5542App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5543App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5544App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5545App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5546App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5547App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5548App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5549App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5550App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5551App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5552App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
5553
5554#----------------------------------------------------------------------------
5555
5556class PySimpleApp(wx.App):
5557 """
5558 A simple application class. You can just create one of these and
5559 then then make your top level windows later, and not have to worry
d6c14a4c 5560 about OnInit. For example::
d55e5bfc 5561
d6c14a4c
RD
5562 app = wx.PySimpleApp()
5563 frame = wx.Frame(None, title='Hello World')
5564 frame.Show()
5565 app.MainLoop()
5566
5567 :see: `wx.App`
5568 """
5569
5570 def __init__(self, redirect=False, filename=None,
5571 useBestVisual=False, clearSigInt=True):
5572 """
5573 :see: `wx.App.__init__`
5574 """
5575 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
5576
5577 def OnInit(self):
d55e5bfc
RD
5578 return True
5579
5580
d6c14a4c 5581
d55e5bfc
RD
5582# Is anybody using this one?
5583class PyWidgetTester(wx.App):
5584 def __init__(self, size = (250, 100)):
5585 self.size = size
5586 wx.App.__init__(self, 0)
5587
5588 def OnInit(self):
5589 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
5590 self.SetTopWindow(self.frame)
5591 return True
5592
d6c14a4c
RD
5593 def SetWidget(self, widgetClass, *args, **kwargs):
5594 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
5595 self.frame.Show(True)
5596
5597#----------------------------------------------------------------------------
5598# DO NOT hold any other references to this object. This is how we
d6c14a4c 5599# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 5600# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 5601# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
5602
5603class __wxPyCleanup:
5604 def __init__(self):
5605 self.cleanup = _core_.App_CleanUp
5606 def __del__(self):
5607 self.cleanup()
5608
5609_sys.__wxPythonCleanup = __wxPyCleanup()
5610
5611## # another possible solution, but it gets called too early...
d6c14a4c
RD
5612## import atexit
5613## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
5614
5615
5616#----------------------------------------------------------------------------
5617
5618#---------------------------------------------------------------------------
5619
b411df4a 5620class EventLoop(object):
36ed4f51 5621 """Proxy of C++ EventLoop class"""
b411df4a
RD
5622 def __repr__(self):
5623 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5624 def __init__(self, *args, **kwargs):
5625 """__init__(self) -> EventLoop"""
5626 newobj = _core_.new_EventLoop(*args, **kwargs)
5627 self.this = newobj.this
5628 self.thisown = 1
5629 del newobj.thisown
5630 def __del__(self, destroy=_core_.delete_EventLoop):
5631 """__del__(self)"""
5632 try:
5633 if self.thisown: destroy(self)
5634 except: pass
5635
5636 def Run(*args, **kwargs):
5637 """Run(self) -> int"""
5638 return _core_.EventLoop_Run(*args, **kwargs)
5639
5640 def Exit(*args, **kwargs):
5641 """Exit(self, int rc=0)"""
5642 return _core_.EventLoop_Exit(*args, **kwargs)
5643
5644 def Pending(*args, **kwargs):
5645 """Pending(self) -> bool"""
5646 return _core_.EventLoop_Pending(*args, **kwargs)
5647
5648 def Dispatch(*args, **kwargs):
5649 """Dispatch(self) -> bool"""
5650 return _core_.EventLoop_Dispatch(*args, **kwargs)
5651
5652 def IsRunning(*args, **kwargs):
5653 """IsRunning(self) -> bool"""
5654 return _core_.EventLoop_IsRunning(*args, **kwargs)
5655
5656 def GetActive(*args, **kwargs):
5657 """GetActive() -> EventLoop"""
5658 return _core_.EventLoop_GetActive(*args, **kwargs)
5659
5660 GetActive = staticmethod(GetActive)
5661 def SetActive(*args, **kwargs):
5662 """SetActive(EventLoop loop)"""
5663 return _core_.EventLoop_SetActive(*args, **kwargs)
5664
5665 SetActive = staticmethod(SetActive)
5666
5667class EventLoopPtr(EventLoop):
5668 def __init__(self, this):
5669 self.this = this
5670 if not hasattr(self,"thisown"): self.thisown = 0
5671 self.__class__ = EventLoop
5672_core_.EventLoop_swigregister(EventLoopPtr)
5673
5674def EventLoop_GetActive(*args, **kwargs):
5675 """EventLoop_GetActive() -> EventLoop"""
5676 return _core_.EventLoop_GetActive(*args, **kwargs)
5677
5678def EventLoop_SetActive(*args, **kwargs):
5679 """EventLoop_SetActive(EventLoop loop)"""
5680 return _core_.EventLoop_SetActive(*args, **kwargs)
5681
5682#---------------------------------------------------------------------------
5683
d55e5bfc 5684class AcceleratorEntry(object):
d6c14a4c
RD
5685 """
5686 A class used to define items in an `wx.AcceleratorTable`. wxPython
5687 programs can choose to use wx.AcceleratorEntry objects, but using a
5688 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 5689 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
5690
5691 :see: `wx.AcceleratorTable`
5692 """
d55e5bfc
RD
5693 def __repr__(self):
5694 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5695 def __init__(self, *args, **kwargs):
d6c14a4c
RD
5696 """
5697 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
5698
5699 Construct a wx.AcceleratorEntry.
d6c14a4c 5700 """
d55e5bfc
RD
5701 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
5702 self.this = newobj.this
5703 self.thisown = 1
5704 del newobj.thisown
5705 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
5706 """__del__(self)"""
5707 try:
5708 if self.thisown: destroy(self)
5709 except: pass
5710
5711 def Set(*args, **kwargs):
d6c14a4c
RD
5712 """
5713 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 5714
d6c14a4c
RD
5715 (Re)set the attributes of a wx.AcceleratorEntry.
5716 :see `__init__`
5717 """
5718 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
5719
5720 def GetFlags(*args, **kwargs):
d6c14a4c
RD
5721 """
5722 GetFlags(self) -> int
5723
5724 Get the AcceleratorEntry's flags.
5725 """
d55e5bfc
RD
5726 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
5727
5728 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
5729 """
5730 GetKeyCode(self) -> int
5731
5732 Get the AcceleratorEntry's keycode.
5733 """
d55e5bfc
RD
5734 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
5735
5736 def GetCommand(*args, **kwargs):
d6c14a4c
RD
5737 """
5738 GetCommand(self) -> int
5739
5740 Get the AcceleratorEntry's command ID.
5741 """
d55e5bfc
RD
5742 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
5743
5744
5745class AcceleratorEntryPtr(AcceleratorEntry):
5746 def __init__(self, this):
5747 self.this = this
5748 if not hasattr(self,"thisown"): self.thisown = 0
5749 self.__class__ = AcceleratorEntry
5750_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
5751
5752class AcceleratorTable(Object):
d6c14a4c
RD
5753 """
5754 An accelerator table allows the application to specify a table of
5755 keyboard shortcuts for menus or other commands. On Windows, menu or
5756 button commands are supported; on GTK, only menu commands are
5757 supported.
d6c14a4c 5758 """
d55e5bfc
RD
5759 def __repr__(self):
5760 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5761 def __init__(self, *args, **kwargs):
5762 """
5763 __init__(entries) -> AcceleratorTable
5764
d6c14a4c
RD
5765 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5766 items or or of 3-tuples (flags, keyCode, cmdID)
5767
5768 :see: `wx.AcceleratorEntry`
d55e5bfc
RD
5769 """
5770 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
5771 self.this = newobj.this
5772 self.thisown = 1
5773 del newobj.thisown
5774 def __del__(self, destroy=_core_.delete_AcceleratorTable):
5775 """__del__(self)"""
5776 try:
5777 if self.thisown: destroy(self)
5778 except: pass
5779
5780 def Ok(*args, **kwargs):
5781 """Ok(self) -> bool"""
5782 return _core_.AcceleratorTable_Ok(*args, **kwargs)
5783
5784
5785class AcceleratorTablePtr(AcceleratorTable):
5786 def __init__(self, this):
5787 self.this = this
5788 if not hasattr(self,"thisown"): self.thisown = 0
5789 self.__class__ = AcceleratorTable
5790_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
5791
5792
5793def GetAccelFromString(*args, **kwargs):
5794 """GetAccelFromString(String label) -> AcceleratorEntry"""
5795 return _core_.GetAccelFromString(*args, **kwargs)
5796#---------------------------------------------------------------------------
5797
5798class VisualAttributes(object):
5799 """struct containing all the visual attributes of a control"""
5800 def __repr__(self):
5801 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5802 def __init__(self, *args, **kwargs):
5803 """
5804 __init__(self) -> VisualAttributes
5805
5806 struct containing all the visual attributes of a control
5807 """
5808 newobj = _core_.new_VisualAttributes(*args, **kwargs)
5809 self.this = newobj.this
5810 self.thisown = 1
5811 del newobj.thisown
5812 def __del__(self, destroy=_core_.delete_VisualAttributes):
5813 """__del__(self)"""
5814 try:
5815 if self.thisown: destroy(self)
5816 except: pass
5817
5818 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
5819 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
5820 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
5821
5822class VisualAttributesPtr(VisualAttributes):
5823 def __init__(self, this):
5824 self.this = this
5825 if not hasattr(self,"thisown"): self.thisown = 0
5826 self.__class__ = VisualAttributes
5827_core_.VisualAttributes_swigregister(VisualAttributesPtr)
5828NullAcceleratorTable = cvar.NullAcceleratorTable
5829PanelNameStr = cvar.PanelNameStr
5830
5831WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
5832WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
5833WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
5834WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
5835WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
5836class Window(EvtHandler):
5837 """
5838 wx.Window is the base class for all windows and represents any visible
5839 object on the screen. All controls, top level windows and so on are
5840 wx.Windows. Sizers and device contexts are not however, as they don't
5841 appear on screen themselves.
5842
5843 """
5844 def __repr__(self):
5845 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5846 def __init__(self, *args, **kwargs):
5847 """
5848 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
5849 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
5850
5851 Construct and show a generic Window.
5852 """
5853 newobj = _core_.new_Window(*args, **kwargs)
5854 self.this = newobj.this
5855 self.thisown = 1
5856 del newobj.thisown
5857 self._setOORInfo(self)
5858
5859 def Create(*args, **kwargs):
5860 """
5861 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
5862 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
5863
5864 Create the GUI part of the Window for 2-phase creation mode.
5865 """
5866 return _core_.Window_Create(*args, **kwargs)
5867
5868 def Close(*args, **kwargs):
5869 """
5870 Close(self, bool force=False) -> bool
5871
5872 This function simply generates a EVT_CLOSE event whose handler usually
5873 tries to close the window. It doesn't close the window itself,
5874 however. If force is False (the default) then the window's close
5875 handler will be allowed to veto the destruction of the window.
d55e5bfc
RD
5876 """
5877 return _core_.Window_Close(*args, **kwargs)
5878
5879 def Destroy(*args, **kwargs):
5880 """
5881 Destroy(self) -> bool
5882
5883 Destroys the window safely. Frames and dialogs are not destroyed
5884 immediately when this function is called -- they are added to a list
5885 of windows to be deleted on idle time, when all the window's events
5886 have been processed. This prevents problems with events being sent to
5887 non-existent windows.
5888
5889 Returns True if the window has either been successfully deleted, or it
5890 has been added to the list of windows pending real deletion.
5891 """
5892 return _core_.Window_Destroy(*args, **kwargs)
5893
5894 def DestroyChildren(*args, **kwargs):
5895 """
5896 DestroyChildren(self) -> bool
5897
15817c7e
RD
5898 Destroys all children of a window. Called automatically by the
5899 destructor.
d55e5bfc
RD
5900 """
5901 return _core_.Window_DestroyChildren(*args, **kwargs)
5902
5903 def IsBeingDeleted(*args, **kwargs):
5904 """
5905 IsBeingDeleted(self) -> bool
5906
5907 Is the window in the process of being deleted?
5908 """
5909 return _core_.Window_IsBeingDeleted(*args, **kwargs)
5910
5911 def SetTitle(*args, **kwargs):
5912 """
5913 SetTitle(self, String title)
5914
5915 Sets the window's title. Applicable only to frames and dialogs.
5916 """
5917 return _core_.Window_SetTitle(*args, **kwargs)
5918
5919 def GetTitle(*args, **kwargs):
5920 """
5921 GetTitle(self) -> String
5922
5923 Gets the window's title. Applicable only to frames and dialogs.
5924 """
5925 return _core_.Window_GetTitle(*args, **kwargs)
5926
5927 def SetLabel(*args, **kwargs):
5928 """
5929 SetLabel(self, String label)
5930
5931 Set the text which the window shows in its label if applicable.
5932 """
5933 return _core_.Window_SetLabel(*args, **kwargs)
5934
5935 def GetLabel(*args, **kwargs):
5936 """
5937 GetLabel(self) -> String
5938
15817c7e
RD
5939 Generic way of getting a label from any window, for identification
5940 purposes. The interpretation of this function differs from class to
5941 class. For frames and dialogs, the value returned is the title. For
5942 buttons or static text controls, it is the button text. This function
5943 can be useful for meta-programs such as testing tools or special-needs
5944 access programs)which need to identify windows by name.
d55e5bfc
RD
5945 """
5946 return _core_.Window_GetLabel(*args, **kwargs)
5947
5948 def SetName(*args, **kwargs):
5949 """
5950 SetName(self, String name)
5951
15817c7e
RD
5952 Sets the window's name. The window name is used for ressource setting
5953 in X, it is not the same as the window title/label
d55e5bfc
RD
5954 """
5955 return _core_.Window_SetName(*args, **kwargs)
5956
5957 def GetName(*args, **kwargs):
5958 """
5959 GetName(self) -> String
5960
15817c7e
RD
5961 Returns the windows name. This name is not guaranteed to be unique;
5962 it is up to the programmer to supply an appropriate name in the window
5963 constructor or via wx.Window.SetName.
d55e5bfc
RD
5964 """
5965 return _core_.Window_GetName(*args, **kwargs)
5966
5967 def SetWindowVariant(*args, **kwargs):
5968 """
5969 SetWindowVariant(self, int variant)
5970
15817c7e
RD
5971 Sets the variant of the window/font size to use for this window, if
5972 the platform supports variants, for example, wxMac.
d55e5bfc
RD
5973 """
5974 return _core_.Window_SetWindowVariant(*args, **kwargs)
5975
5976 def GetWindowVariant(*args, **kwargs):
5977 """GetWindowVariant(self) -> int"""
5978 return _core_.Window_GetWindowVariant(*args, **kwargs)
5979
5980 def SetId(*args, **kwargs):
5981 """
5982 SetId(self, int winid)
5983
5984 Sets the identifier of the window. Each window has an integer
5985 identifier. If the application has not provided one, an identifier
5986 will be generated. Normally, the identifier should be provided on
5987 creation and should not be modified subsequently.
5988 """
5989 return _core_.Window_SetId(*args, **kwargs)
5990
5991 def GetId(*args, **kwargs):
5992 """
5993 GetId(self) -> int
5994
5995 Returns the identifier of the window. Each window has an integer
5996 identifier. If the application has not provided one (or the default Id
5997 -1 is used) then an unique identifier with a negative value will be
5998 generated.
5999 """
6000 return _core_.Window_GetId(*args, **kwargs)
6001
6002 def NewControlId(*args, **kwargs):
6003 """
d6c14a4c 6004 NewControlId() -> int
d55e5bfc
RD
6005
6006 Generate a control id for the controls which were not given one.
6007 """
6008 return _core_.Window_NewControlId(*args, **kwargs)
6009
6010 NewControlId = staticmethod(NewControlId)
6011 def NextControlId(*args, **kwargs):
6012 """
d6c14a4c 6013 NextControlId(int winid) -> int
d55e5bfc
RD
6014
6015 Get the id of the control following the one with the given
15817c7e 6016 autogenerated) id
d55e5bfc
RD
6017 """
6018 return _core_.Window_NextControlId(*args, **kwargs)
6019
6020 NextControlId = staticmethod(NextControlId)
6021 def PrevControlId(*args, **kwargs):
6022 """
d6c14a4c 6023 PrevControlId(int winid) -> int
d55e5bfc
RD
6024
6025 Get the id of the control preceding the one with the given
15817c7e 6026 autogenerated) id
d55e5bfc
RD
6027 """
6028 return _core_.Window_PrevControlId(*args, **kwargs)
6029
6030 PrevControlId = staticmethod(PrevControlId)
6031 def SetSize(*args, **kwargs):
6032 """
6033 SetSize(self, Size size)
6034
6035 Sets the size of the window in pixels.
6036 """
6037 return _core_.Window_SetSize(*args, **kwargs)
6038
6039 def SetDimensions(*args, **kwargs):
6040 """
6041 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
6042
6043 Sets the position and size of the window in pixels. The sizeFlags
6044 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
6045 equal to -1.
6046
6047 ======================== ======================================
6048 wx.SIZE_AUTO A -1 indicates that a class-specific
6049 default should be used.
6050 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
6051 -1 values are supplied.
6052 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
6053 interpreted as real dimensions, not
6054 default values.
6055 ======================== ======================================
6056
d55e5bfc
RD
6057 """
6058 return _core_.Window_SetDimensions(*args, **kwargs)
6059
6060 def SetRect(*args, **kwargs):
6061 """
6062 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
6063
6064 Sets the position and size of the window in pixels using a wx.Rect.
6065 """
6066 return _core_.Window_SetRect(*args, **kwargs)
6067
6068 def SetSizeWH(*args, **kwargs):
6069 """
6070 SetSizeWH(self, int width, int height)
6071
6072 Sets the size of the window in pixels.
6073 """
6074 return _core_.Window_SetSizeWH(*args, **kwargs)
6075
6076 def Move(*args, **kwargs):
6077 """
6078 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
6079
6080 Moves the window to the given position.
6081 """
6082 return _core_.Window_Move(*args, **kwargs)
6083
6084 SetPosition = Move
6085 def MoveXY(*args, **kwargs):
6086 """
6087 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
6088
6089 Moves the window to the given position.
6090 """
6091 return _core_.Window_MoveXY(*args, **kwargs)
6092
f8167d6e
RD
6093 def SetBestFittingSize(*args, **kwargs):
6094 """
6095 SetBestFittingSize(self, Size size=DefaultSize)
6096
6097 A 'Smart' SetSize that will fill in default size components with the
6098 window's *best size* values. Also set's the minsize for use with sizers.
6099 """
6100 return _core_.Window_SetBestFittingSize(*args, **kwargs)
6101
d55e5bfc
RD
6102 def Raise(*args, **kwargs):
6103 """
6104 Raise(self)
6105
6106 Raises the window to the top of the window hierarchy if it is a
6107 managed window (dialog or frame).
6108 """
6109 return _core_.Window_Raise(*args, **kwargs)
6110
6111 def Lower(*args, **kwargs):
6112 """
6113 Lower(self)
6114
6115 Lowers the window to the bottom of the window hierarchy if it is a
6116 managed window (dialog or frame).
6117 """
6118 return _core_.Window_Lower(*args, **kwargs)
6119
6120 def SetClientSize(*args, **kwargs):
6121 """
6122 SetClientSize(self, Size size)
6123
6124 This sets the size of the window client area in pixels. Using this
6125 function to size a window tends to be more device-independent than
6126 wx.Window.SetSize, since the application need not worry about what
6127 dimensions the border or title bar have when trying to fit the window
6128 around panel items, for example.
6129 """
6130 return _core_.Window_SetClientSize(*args, **kwargs)
6131
6132 def SetClientSizeWH(*args, **kwargs):
6133 """
6134 SetClientSizeWH(self, int width, int height)
6135
6136 This sets the size of the window client area in pixels. Using this
6137 function to size a window tends to be more device-independent than
6138 wx.Window.SetSize, since the application need not worry about what
6139 dimensions the border or title bar have when trying to fit the window
6140 around panel items, for example.
6141 """
6142 return _core_.Window_SetClientSizeWH(*args, **kwargs)
6143
6144 def SetClientRect(*args, **kwargs):
6145 """
6146 SetClientRect(self, Rect rect)
6147
6148 This sets the size of the window client area in pixels. Using this
6149 function to size a window tends to be more device-independent than
6150 wx.Window.SetSize, since the application need not worry about what
6151 dimensions the border or title bar have when trying to fit the window
6152 around panel items, for example.
6153 """
6154 return _core_.Window_SetClientRect(*args, **kwargs)
6155
6156 def GetPosition(*args, **kwargs):
6157 """
6158 GetPosition(self) -> Point
6159
6160 Get the window's position.
6161 """
6162 return _core_.Window_GetPosition(*args, **kwargs)
6163
6164 def GetPositionTuple(*args, **kwargs):
6165 """
6166 GetPositionTuple() -> (x,y)
6167
6168 Get the window's position.
6169 """
6170 return _core_.Window_GetPositionTuple(*args, **kwargs)
6171
6172 def GetSize(*args, **kwargs):
6173 """
6174 GetSize(self) -> Size
6175
6176 Get the window size.
6177 """
6178 return _core_.Window_GetSize(*args, **kwargs)
6179
6180 def GetSizeTuple(*args, **kwargs):
6181 """
6182 GetSizeTuple() -> (width, height)
6183
6184 Get the window size.
6185 """
6186 return _core_.Window_GetSizeTuple(*args, **kwargs)
6187
6188 def GetRect(*args, **kwargs):
6189 """
6190 GetRect(self) -> Rect
6191
6192 Returns the size and position of the window as a wx.Rect object.
6193 """
6194 return _core_.Window_GetRect(*args, **kwargs)
6195
6196 def GetClientSize(*args, **kwargs):
6197 """
6198 GetClientSize(self) -> Size
6199
6200 This gets the size of the window's 'client area' in pixels. The client
6201 area is the area which may be drawn on by the programmer, excluding
6202 title bar, border, scrollbars, etc.
6203 """
6204 return _core_.Window_GetClientSize(*args, **kwargs)
6205
6206 def GetClientSizeTuple(*args, **kwargs):
6207 """
6208 GetClientSizeTuple() -> (width, height)
6209
6210 This gets the size of the window's 'client area' in pixels. The client
6211 area is the area which may be drawn on by the programmer, excluding
6212 title bar, border, scrollbars, etc.
6213 """
6214 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
6215
6216 def GetClientAreaOrigin(*args, **kwargs):
6217 """
6218 GetClientAreaOrigin(self) -> Point
6219
6220 Get the origin of the client area of the window relative to the
6221 window's top left corner (the client area may be shifted because of
6222 the borders, scrollbars, other decorations...)
6223 """
6224 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
6225
6226 def GetClientRect(*args, **kwargs):
6227 """
6228 GetClientRect(self) -> Rect
6229
0439c23b 6230 Get the client area position and size as a `wx.Rect` object.
d55e5bfc
RD
6231 """
6232 return _core_.Window_GetClientRect(*args, **kwargs)
6233
6234 def GetBestSize(*args, **kwargs):
6235 """
6236 GetBestSize(self) -> Size
6237
bfddbb17 6238 This function returns the best acceptable minimal size for the
15817c7e
RD
6239 window, if applicable. For example, for a static text control, it will
6240 be the minimal size such that the control label is not truncated. For
6241 windows containing subwindows (suzh aswx.Panel), the size returned by
6242 this function will be the same as the size the window would have had
6243 after calling Fit.
d55e5bfc
RD
6244 """
6245 return _core_.Window_GetBestSize(*args, **kwargs)
6246
6247 def GetBestSizeTuple(*args, **kwargs):
6248 """
6249 GetBestSizeTuple() -> (width, height)
6250
bfddbb17 6251 This function returns the best acceptable minimal size for the
15817c7e
RD
6252 window, if applicable. For example, for a static text control, it will
6253 be the minimal size such that the control label is not truncated. For
6254 windows containing subwindows (suzh aswx.Panel), the size returned by
6255 this function will be the same as the size the window would have had
6256 after calling Fit.
d55e5bfc
RD
6257 """
6258 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
6259
a001823c
RD
6260 def InvalidateBestSize(*args, **kwargs):
6261 """
6262 InvalidateBestSize(self)
6263
6264 Reset the cached best size value so it will be recalculated the next
6265 time it is needed.
6266 """
6267 return _core_.Window_InvalidateBestSize(*args, **kwargs)
6268
6269 def GetBestFittingSize(*args, **kwargs):
6270 """
6271 GetBestFittingSize(self) -> Size
6272
6273 This function will merge the window's best size into the window's
6274 minimum size, giving priority to the min size components, and returns
6275 the results.
6276
6277 """
6278 return _core_.Window_GetBestFittingSize(*args, **kwargs)
6279
d55e5bfc
RD
6280 def GetAdjustedBestSize(*args, **kwargs):
6281 """
6282 GetAdjustedBestSize(self) -> Size
6283
6284 This method is similar to GetBestSize, except in one
6285 thing. GetBestSize should return the minimum untruncated size of the
6286 window, while this method will return the largest of BestSize and any
6287 user specified minimum size. ie. it is the minimum size the window
6288 should currently be drawn at, not the minimal size it can possibly
6289 tolerate.
6290 """
6291 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
6292
6293 def Center(*args, **kwargs):
6294 """
6295 Center(self, int direction=BOTH)
6296
6297 Centers the window. The parameter specifies the direction for
6298 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
6299 also include wx.CENTER_ON_SCREEN flag if you want to center the window
6300 on the entire screen and not on its parent window. If it is a
6301 top-level window and has no parent then it will always be centered
6302 relative to the screen.
6303 """
6304 return _core_.Window_Center(*args, **kwargs)
6305
6306 Centre = Center
6307 def CenterOnScreen(*args, **kwargs):
6308 """
6309 CenterOnScreen(self, int dir=BOTH)
6310
6311 Center on screen (only works for top level windows)
6312 """
6313 return _core_.Window_CenterOnScreen(*args, **kwargs)
6314
6315 CentreOnScreen = CenterOnScreen
6316 def CenterOnParent(*args, **kwargs):
6317 """
6318 CenterOnParent(self, int dir=BOTH)
6319
6320 Center with respect to the the parent window
6321 """
6322 return _core_.Window_CenterOnParent(*args, **kwargs)
6323
6324 CentreOnParent = CenterOnParent
6325 def Fit(*args, **kwargs):
6326 """
6327 Fit(self)
6328
6329 Sizes the window so that it fits around its subwindows. This function
6330 won't do anything if there are no subwindows and will only really work
6331 correctly if sizers are used for the subwindows layout. Also, if the
6332 window has exactly one subwindow it is better (faster and the result
6333 is more precise as Fit adds some margin to account for fuzziness of
6334 its calculations) to call window.SetClientSize(child.GetSize())
6335 instead of calling Fit.
6336 """
6337 return _core_.Window_Fit(*args, **kwargs)
6338
6339 def FitInside(*args, **kwargs):
6340 """
6341 FitInside(self)
6342
6343 Similar to Fit, but sizes the interior (virtual) size of a
6344 window. Mainly useful with scrolled windows to reset scrollbars after
6345 sizing changes that do not trigger a size event, and/or scrolled
6346 windows without an interior sizer. This function similarly won't do
6347 anything if there are no subwindows.
6348 """
6349 return _core_.Window_FitInside(*args, **kwargs)
6350
03837c5c 6351 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
6352 """
6353 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
6354 int incH=-1)
d55e5bfc
RD
6355
6356 Allows specification of minimum and maximum window sizes, and window
6357 size increments. If a pair of values is not set (or set to -1), the
6358 default values will be used. If this function is called, the user
908b74cd
RD
6359 will not be able to size the window outside the given bounds (if it is
6360 a top-level window.) Sizers will also inspect the minimum window size
6361 and will use that value if set when calculating layout.
6362
6363 The resizing increments are only significant under Motif or Xt.
d55e5bfc 6364 """
03837c5c 6365 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 6366
03837c5c
RD
6367 def SetSizeHintsSz(*args, **kwargs):
6368 """
6369 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
6370
6371 Allows specification of minimum and maximum window sizes, and window
6372 size increments. If a pair of values is not set (or set to -1), the
6373 default values will be used. If this function is called, the user
6374 will not be able to size the window outside the given bounds (if it is
6375 a top-level window.) Sizers will also inspect the minimum window size
6376 and will use that value if set when calculating layout.
6377
6378 The resizing increments are only significant under Motif or Xt.
6379 """
6380 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
6381
6382 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 6383 """
908b74cd 6384 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
6385
6386 Allows specification of minimum and maximum virtual window sizes. If a
6387 pair of values is not set (or set to -1), the default values will be
6388 used. If this function is called, the user will not be able to size
6389 the virtual area of the window outside the given bounds.
6390 """
03837c5c
RD
6391 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
6392
6393 def SetVirtualSizeHintsSz(*args, **kwargs):
6394 """
6395 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
6396
6397 Allows specification of minimum and maximum virtual window sizes. If a
6398 pair of values is not set (or set to -1), the default values will be
6399 used. If this function is called, the user will not be able to size
6400 the virtual area of the window outside the given bounds.
6401 """
6402 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 6403
908b74cd
RD
6404 def GetMaxSize(*args, **kwargs):
6405 """GetMaxSize(self) -> Size"""
6406 return _core_.Window_GetMaxSize(*args, **kwargs)
6407
6408 def GetMinSize(*args, **kwargs):
6409 """GetMinSize(self) -> Size"""
6410 return _core_.Window_GetMinSize(*args, **kwargs)
6411
6412 def SetMinSize(*args, **kwargs):
6413 """
6414 SetMinSize(self, Size minSize)
6415
6416 A more convenient method than `SetSizeHints` for setting just the
6417 min size.
6418 """
6419 return _core_.Window_SetMinSize(*args, **kwargs)
6420
6421 def SetMaxSize(*args, **kwargs):
6422 """
6423 SetMaxSize(self, Size maxSize)
6424
6425 A more convenient method than `SetSizeHints` for setting just the
6426 max size.
6427 """
6428 return _core_.Window_SetMaxSize(*args, **kwargs)
6429
d55e5bfc
RD
6430 def GetMinWidth(*args, **kwargs):
6431 """GetMinWidth(self) -> int"""
6432 return _core_.Window_GetMinWidth(*args, **kwargs)
6433
6434 def GetMinHeight(*args, **kwargs):
6435 """GetMinHeight(self) -> int"""
6436 return _core_.Window_GetMinHeight(*args, **kwargs)
6437
6438 def GetMaxWidth(*args, **kwargs):
6439 """GetMaxWidth(self) -> int"""
6440 return _core_.Window_GetMaxWidth(*args, **kwargs)
6441
6442 def GetMaxHeight(*args, **kwargs):
6443 """GetMaxHeight(self) -> int"""
6444 return _core_.Window_GetMaxHeight(*args, **kwargs)
6445
d55e5bfc
RD
6446 def SetVirtualSize(*args, **kwargs):
6447 """
6448 SetVirtualSize(self, Size size)
6449
6450 Set the the virtual size of a window in pixels. For most windows this
6451 is just the client area of the window, but for some like scrolled
6452 windows it is more or less independent of the screen window size.
6453 """
6454 return _core_.Window_SetVirtualSize(*args, **kwargs)
6455
6456 def SetVirtualSizeWH(*args, **kwargs):
6457 """
6458 SetVirtualSizeWH(self, int w, int h)
6459
6460 Set the the virtual size of a window in pixels. For most windows this
6461 is just the client area of the window, but for some like scrolled
6462 windows it is more or less independent of the screen window size.
6463 """
6464 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
6465
6466 def GetVirtualSize(*args, **kwargs):
6467 """
6468 GetVirtualSize(self) -> Size
6469
6470 Get the the virtual size of the window in pixels. For most windows
6471 this is just the client area of the window, but for some like scrolled
6472 windows it is more or less independent of the screen window size.
6473 """
6474 return _core_.Window_GetVirtualSize(*args, **kwargs)
6475
6476 def GetVirtualSizeTuple(*args, **kwargs):
6477 """
6478 GetVirtualSizeTuple() -> (width, height)
6479
6480 Get the the virtual size of the window in pixels. For most windows
6481 this is just the client area of the window, but for some like scrolled
6482 windows it is more or less independent of the screen window size.
6483 """
6484 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
6485
6486 def GetBestVirtualSize(*args, **kwargs):
6487 """
6488 GetBestVirtualSize(self) -> Size
6489
6490 Return the largest of ClientSize and BestSize (as determined by a
6491 sizer, interior children, or other means)
6492 """
6493 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
6494
6495 def Show(*args, **kwargs):
6496 """
6497 Show(self, bool show=True) -> bool
6498
6499 Shows or hides the window. You may need to call Raise for a top level
6500 window if you want to bring it to top, although this is not needed if
6501 Show is called immediately after the frame creation. Returns True if
6502 the window has been shown or hidden or False if nothing was done
6503 because it already was in the requested state.
6504 """
6505 return _core_.Window_Show(*args, **kwargs)
6506
6507 def Hide(*args, **kwargs):
6508 """
6509 Hide(self) -> bool
6510
6511 Equivalent to calling Show(False).
6512 """
6513 return _core_.Window_Hide(*args, **kwargs)
6514
6515 def Enable(*args, **kwargs):
6516 """
6517 Enable(self, bool enable=True) -> bool
6518
6519 Enable or disable the window for user input. Note that when a parent
6520 window is disabled, all of its children are disabled as well and they
6521 are reenabled again when the parent is. Returns true if the window
6522 has been enabled or disabled, false if nothing was done, i.e. if the
6523 window had already been in the specified state.
6524 """
6525 return _core_.Window_Enable(*args, **kwargs)
6526
6527 def Disable(*args, **kwargs):
6528 """
6529 Disable(self) -> bool
6530
6531 Disables the window, same as Enable(false).
6532 """
6533 return _core_.Window_Disable(*args, **kwargs)
6534
6535 def IsShown(*args, **kwargs):
6536 """
6537 IsShown(self) -> bool
6538
6539 Returns true if the window is shown, false if it has been hidden.
6540 """
6541 return _core_.Window_IsShown(*args, **kwargs)
6542
6543 def IsEnabled(*args, **kwargs):
6544 """
6545 IsEnabled(self) -> bool
6546
6547 Returns true if the window is enabled for input, false otherwise.
6548 """
6549 return _core_.Window_IsEnabled(*args, **kwargs)
6550
6551 def SetWindowStyleFlag(*args, **kwargs):
6552 """
6553 SetWindowStyleFlag(self, long style)
6554
15817c7e
RD
6555 Sets the style of the window. Please note that some styles cannot be
6556 changed after the window creation and that Refresh() might need to be
6557 called after changing the others for the change to take place
6558 immediately.
d55e5bfc
RD
6559 """
6560 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
6561
6562 def GetWindowStyleFlag(*args, **kwargs):
6563 """
6564 GetWindowStyleFlag(self) -> long
6565
6566 Gets the window style that was passed to the constructor or Create
6567 method.
6568 """
6569 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
6570
6571 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
6572 def HasFlag(*args, **kwargs):
6573 """
6574 HasFlag(self, int flag) -> bool
6575
6576 Test if the given style is set for this window.
6577 """
6578 return _core_.Window_HasFlag(*args, **kwargs)
6579
6580 def IsRetained(*args, **kwargs):
6581 """
6582 IsRetained(self) -> bool
6583
6584 Returns true if the window is retained, false otherwise. Retained
6585 windows are only available on X platforms.
6586 """
6587 return _core_.Window_IsRetained(*args, **kwargs)
6588
6589 def SetExtraStyle(*args, **kwargs):
6590 """
6591 SetExtraStyle(self, long exStyle)
6592
6593 Sets the extra style bits for the window. Extra styles are the less
6594 often used style bits which can't be set with the constructor or with
6595 SetWindowStyleFlag()
6596 """
6597 return _core_.Window_SetExtraStyle(*args, **kwargs)
6598
6599 def GetExtraStyle(*args, **kwargs):
6600 """
6601 GetExtraStyle(self) -> long
6602
6603 Returns the extra style bits for the window.
6604 """
6605 return _core_.Window_GetExtraStyle(*args, **kwargs)
6606
6607 def MakeModal(*args, **kwargs):
6608 """
6609 MakeModal(self, bool modal=True)
6610
6611 Disables all other windows in the application so that the user can
6612 only interact with this window. Passing False will reverse this
6613 effect.
6614 """
6615 return _core_.Window_MakeModal(*args, **kwargs)
6616
6617 def SetThemeEnabled(*args, **kwargs):
6618 """
6619 SetThemeEnabled(self, bool enableTheme)
6620
6621 This function tells a window if it should use the system's "theme"
6622 code to draw the windows' background instead if its own background
6623 drawing code. This will only have an effect on platforms that support
6624 the notion of themes in user defined windows. One such platform is
6625 GTK+ where windows can have (very colourful) backgrounds defined by a
6626 user's selected theme.
6627
6628 Dialogs, notebook pages and the status bar have this flag set to true
6629 by default so that the default look and feel is simulated best.
6630 """
6631 return _core_.Window_SetThemeEnabled(*args, **kwargs)
6632
6633 def GetThemeEnabled(*args, **kwargs):
6634 """
6635 GetThemeEnabled(self) -> bool
6636
6637 Return the themeEnabled flag.
6638 """
6639 return _core_.Window_GetThemeEnabled(*args, **kwargs)
6640
6641 def SetFocus(*args, **kwargs):
6642 """
6643 SetFocus(self)
6644
6645 Set's the focus to this window, allowing it to receive keyboard input.
6646 """
6647 return _core_.Window_SetFocus(*args, **kwargs)
6648
6649 def SetFocusFromKbd(*args, **kwargs):
6650 """
6651 SetFocusFromKbd(self)
6652
6653 Set focus to this window as the result of a keyboard action. Normally
6654 only called internally.
6655 """
6656 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
6657
6658 def FindFocus(*args, **kwargs):
6659 """
d6c14a4c 6660 FindFocus() -> Window
d55e5bfc
RD
6661
6662 Returns the window or control that currently has the keyboard focus,
6663 or None.
6664 """
6665 return _core_.Window_FindFocus(*args, **kwargs)
6666
6667 FindFocus = staticmethod(FindFocus)
6668 def AcceptsFocus(*args, **kwargs):
6669 """
6670 AcceptsFocus(self) -> bool
6671
6672 Can this window have focus?
6673 """
6674 return _core_.Window_AcceptsFocus(*args, **kwargs)
6675
6676 def AcceptsFocusFromKeyboard(*args, **kwargs):
6677 """
6678 AcceptsFocusFromKeyboard(self) -> bool
6679
6680 Can this window be given focus by keyboard navigation? if not, the
6681 only way to give it focus (provided it accepts it at all) is to click
6682 it.
6683 """
6684 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
6685
6686 def GetDefaultItem(*args, **kwargs):
6687 """
6688 GetDefaultItem(self) -> Window
6689
6690 Get the default child of this parent, i.e. the one which is activated
6691 by pressing <Enter> such as the OK button on a wx.Dialog.
6692 """
6693 return _core_.Window_GetDefaultItem(*args, **kwargs)
6694
6695 def SetDefaultItem(*args, **kwargs):
6696 """
6697 SetDefaultItem(self, Window child) -> Window
6698
6699 Set this child as default, return the old default.
6700 """
6701 return _core_.Window_SetDefaultItem(*args, **kwargs)
6702
6703 def SetTmpDefaultItem(*args, **kwargs):
6704 """
6705 SetTmpDefaultItem(self, Window win)
6706
6707 Set this child as temporary default
6708 """
6709 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
6710
908b74cd
RD
6711 def Navigate(*args, **kwargs):
6712 """
6713 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6714
fd2dc343
RD
6715 Does keyboard navigation from this window to another, by sending a
6716 `wx.NavigationKeyEvent`.
908b74cd
RD
6717 """
6718 return _core_.Window_Navigate(*args, **kwargs)
6719
bf26d883
RD
6720 def MoveAfterInTabOrder(*args, **kwargs):
6721 """
6722 MoveAfterInTabOrder(self, Window win)
6723
6724 Moves this window in the tab navigation order after the specified
6725 sibling window. This means that when the user presses the TAB key on
6726 that other window, the focus switches to this window.
6727
6728 The default tab order is the same as creation order. This function
6729 and `MoveBeforeInTabOrder` allow to change it after creating all the
6730 windows.
6731
6732 """
6733 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
6734
6735 def MoveBeforeInTabOrder(*args, **kwargs):
6736 """
6737 MoveBeforeInTabOrder(self, Window win)
6738
6739 Same as `MoveAfterInTabOrder` except that it inserts this window just
6740 before win instead of putting it right after it.
6741 """
6742 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
6743
d55e5bfc
RD
6744 def GetChildren(*args, **kwargs):
6745 """
6746 GetChildren(self) -> PyObject
6747
6748 Returns a list of the window's children. NOTE: Currently this is a
6749 copy of the child window list maintained by the window, so the return
6750 value of this function is only valid as long as the window's children
6751 do not change.
6752 """
6753 return _core_.Window_GetChildren(*args, **kwargs)
6754
6755 def GetParent(*args, **kwargs):
6756 """
6757 GetParent(self) -> Window
6758
6759 Returns the parent window of this window, or None if there isn't one.
6760 """
6761 return _core_.Window_GetParent(*args, **kwargs)
6762
6763 def GetGrandParent(*args, **kwargs):
6764 """
6765 GetGrandParent(self) -> Window
6766
15817c7e
RD
6767 Returns the parent of the parent of this window, or None if there
6768 isn't one.
d55e5bfc
RD
6769 """
6770 return _core_.Window_GetGrandParent(*args, **kwargs)
6771
6772 def IsTopLevel(*args, **kwargs):
6773 """
6774 IsTopLevel(self) -> bool
6775
6776 Returns true if the given window is a top-level one. Currently all
6777 frames and dialogs are always considered to be top-level windows (even
6778 if they have a parent window).
6779 """
6780 return _core_.Window_IsTopLevel(*args, **kwargs)
6781
6782 def Reparent(*args, **kwargs):
6783 """
6784 Reparent(self, Window newParent) -> bool
6785
6786 Reparents the window, i.e the window will be removed from its current
6787 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6788 re-inserted into another. Available on Windows and GTK. Returns True
6789 if the parent was changed, False otherwise (error or newParent ==
6790 oldParent)
6791 """
6792 return _core_.Window_Reparent(*args, **kwargs)
6793
6794 def AddChild(*args, **kwargs):
6795 """
6796 AddChild(self, Window child)
6797
6798 Adds a child window. This is called automatically by window creation
6799 functions so should not be required by the application programmer.
6800 """
6801 return _core_.Window_AddChild(*args, **kwargs)
6802
6803 def RemoveChild(*args, **kwargs):
6804 """
6805 RemoveChild(self, Window child)
6806
6807 Removes a child window. This is called automatically by window
6808 deletion functions so should not be required by the application
6809 programmer.
6810 """
6811 return _core_.Window_RemoveChild(*args, **kwargs)
6812
6813 def FindWindowById(*args, **kwargs):
6814 """
6815 FindWindowById(self, long winid) -> Window
6816
6817 Find a chld of this window by window ID
6818 """
6819 return _core_.Window_FindWindowById(*args, **kwargs)
6820
6821 def FindWindowByName(*args, **kwargs):
6822 """
6823 FindWindowByName(self, String name) -> Window
6824
6825 Find a child of this window by name
6826 """
6827 return _core_.Window_FindWindowByName(*args, **kwargs)
6828
6829 def GetEventHandler(*args, **kwargs):
6830 """
6831 GetEventHandler(self) -> EvtHandler
6832
6833 Returns the event handler for this window. By default, the window is
6834 its own event handler.
6835 """
6836 return _core_.Window_GetEventHandler(*args, **kwargs)
6837
6838 def SetEventHandler(*args, **kwargs):
6839 """
6840 SetEventHandler(self, EvtHandler handler)
6841
6842 Sets the event handler for this window. An event handler is an object
6843 that is capable of processing the events sent to a window. By default,
6844 the window is its own event handler, but an application may wish to
6845 substitute another, for example to allow central implementation of
6846 event-handling for a variety of different window classes.
6847
15817c7e 6848 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
6849 up a chain of event handlers, where an event not handled by one event
6850 handler is handed to the next one in the chain.
6851 """
6852 return _core_.Window_SetEventHandler(*args, **kwargs)
6853
6854 def PushEventHandler(*args, **kwargs):
6855 """
6856 PushEventHandler(self, EvtHandler handler)
6857
6858 Pushes this event handler onto the event handler stack for the window.
6859 An event handler is an object that is capable of processing the events
6860 sent to a window. By default, the window is its own event handler, but
6861 an application may wish to substitute another, for example to allow
6862 central implementation of event-handling for a variety of different
6863 window classes.
6864
6865 wx.Window.PushEventHandler allows an application to set up a chain of
6866 event handlers, where an event not handled by one event handler is
15817c7e 6867 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
6868 remove the event handler.
6869 """
6870 return _core_.Window_PushEventHandler(*args, **kwargs)
6871
6872 def PopEventHandler(*args, **kwargs):
6873 """
6874 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
6875
6876 Removes and returns the top-most event handler on the event handler
6877 stack. If deleteHandler is True then the wx.EvtHandler object will be
6878 destroyed after it is popped.
6879 """
6880 return _core_.Window_PopEventHandler(*args, **kwargs)
6881
6882 def RemoveEventHandler(*args, **kwargs):
6883 """
6884 RemoveEventHandler(self, EvtHandler handler) -> bool
6885
15817c7e
RD
6886 Find the given handler in the event handler chain and remove (but not
6887 delete) it from the event handler chain, return True if it was found
6888 and False otherwise (this also results in an assert failure so this
6889 function should only be called when the handler is supposed to be
6890 there.)
d55e5bfc
RD
6891 """
6892 return _core_.Window_RemoveEventHandler(*args, **kwargs)
6893
6894 def SetValidator(*args, **kwargs):
6895 """
6896 SetValidator(self, Validator validator)
6897
6898 Deletes the current validator (if any) and sets the window validator,
6899 having called wx.Validator.Clone to create a new validator of this
6900 type.
6901 """
6902 return _core_.Window_SetValidator(*args, **kwargs)
6903
6904 def GetValidator(*args, **kwargs):
6905 """
6906 GetValidator(self) -> Validator
6907
6908 Returns a pointer to the current validator for the window, or None if
6909 there is none.
6910 """
6911 return _core_.Window_GetValidator(*args, **kwargs)
6912
6913 def Validate(*args, **kwargs):
6914 """
6915 Validate(self) -> bool
6916
6917 Validates the current values of the child controls using their
15817c7e
RD
6918 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6919 style flag set, the method will also call Validate() of all child
6920 windows. Returns false if any of the validations failed.
d55e5bfc
RD
6921 """
6922 return _core_.Window_Validate(*args, **kwargs)
6923
6924 def TransferDataToWindow(*args, **kwargs):
6925 """
6926 TransferDataToWindow(self) -> bool
6927
15817c7e
RD
6928 Transfers values to child controls from data areas specified by their
6929 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6930 style flag set, the method will also call TransferDataToWindow() of
6931 all child windows.
d55e5bfc
RD
6932 """
6933 return _core_.Window_TransferDataToWindow(*args, **kwargs)
6934
6935 def TransferDataFromWindow(*args, **kwargs):
6936 """
6937 TransferDataFromWindow(self) -> bool
6938
15817c7e
RD
6939 Transfers values from child controls to data areas specified by their
6940 validators. Returns false if a transfer failed. If the window has
6941 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
6942 also call TransferDataFromWindow() of all child windows.
d55e5bfc
RD
6943 """
6944 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
6945
6946 def InitDialog(*args, **kwargs):
6947 """
6948 InitDialog(self)
6949
15817c7e
RD
6950 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
6951 to the dialog via validators.
d55e5bfc
RD
6952 """
6953 return _core_.Window_InitDialog(*args, **kwargs)
6954
6955 def SetAcceleratorTable(*args, **kwargs):
6956 """
6957 SetAcceleratorTable(self, AcceleratorTable accel)
6958
6959 Sets the accelerator table for this window.
6960 """
6961 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
6962
6963 def GetAcceleratorTable(*args, **kwargs):
6964 """
6965 GetAcceleratorTable(self) -> AcceleratorTable
6966
6967 Gets the accelerator table for this window.
6968 """
6969 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
6970
6971 def RegisterHotKey(*args, **kwargs):
6972 """
6973 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
6974
6975 Registers a system wide hotkey. Every time the user presses the hotkey
6976 registered here, this window will receive a hotkey event. It will
6977 receive the event even if the application is in the background and
6978 does not have the input focus because the user is working with some
6979 other application. To bind an event handler function to this hotkey
6980 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
6981 hotkey was registered successfully.
6982 """
6983 return _core_.Window_RegisterHotKey(*args, **kwargs)
6984
6985 def UnregisterHotKey(*args, **kwargs):
6986 """
6987 UnregisterHotKey(self, int hotkeyId) -> bool
6988
6989 Unregisters a system wide hotkey.
6990 """
6991 return _core_.Window_UnregisterHotKey(*args, **kwargs)
6992
6993 def ConvertDialogPointToPixels(*args, **kwargs):
6994 """
6995 ConvertDialogPointToPixels(self, Point pt) -> Point
6996
6997 Converts a point or size from dialog units to pixels. Dialog units
6998 are used for maintaining a dialog's proportions even if the font
6999 changes. For the x dimension, the dialog units are multiplied by the
7000 average character width and then divided by 4. For the y dimension,
7001 the dialog units are multiplied by the average character height and
7002 then divided by 8.
7003 """
7004 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
7005
7006 def ConvertDialogSizeToPixels(*args, **kwargs):
7007 """
7008 ConvertDialogSizeToPixels(self, Size sz) -> Size
7009
7010 Converts a point or size from dialog units to pixels. Dialog units
7011 are used for maintaining a dialog's proportions even if the font
7012 changes. For the x dimension, the dialog units are multiplied by the
7013 average character width and then divided by 4. For the y dimension,
7014 the dialog units are multiplied by the average character height and
7015 then divided by 8.
7016 """
7017 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
7018
7019 def DLG_PNT(*args, **kwargs):
7020 """
7021 DLG_PNT(self, Point pt) -> Point
7022
7023 Converts a point or size from dialog units to pixels. Dialog units
7024 are used for maintaining a dialog's proportions even if the font
7025 changes. For the x dimension, the dialog units are multiplied by the
7026 average character width and then divided by 4. For the y dimension,
7027 the dialog units are multiplied by the average character height and
7028 then divided by 8.
7029 """
7030 return _core_.Window_DLG_PNT(*args, **kwargs)
7031
7032 def DLG_SZE(*args, **kwargs):
7033 """
7034 DLG_SZE(self, Size sz) -> Size
7035
7036 Converts a point or size from dialog units to pixels. Dialog units
7037 are used for maintaining a dialog's proportions even if the font
7038 changes. For the x dimension, the dialog units are multiplied by the
7039 average character width and then divided by 4. For the y dimension,
7040 the dialog units are multiplied by the average character height and
7041 then divided by 8.
7042 """
7043 return _core_.Window_DLG_SZE(*args, **kwargs)
7044
7045 def ConvertPixelPointToDialog(*args, **kwargs):
7046 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
7047 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
7048
7049 def ConvertPixelSizeToDialog(*args, **kwargs):
7050 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
7051 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
7052
7053 def WarpPointer(*args, **kwargs):
7054 """
7055 WarpPointer(self, int x, int y)
7056
7057 Moves the pointer to the given position on the window.
7058
7059 NOTE: This function is not supported under Mac because Apple Human
7060 Interface Guidelines forbid moving the mouse cursor programmatically.
7061 """
7062 return _core_.Window_WarpPointer(*args, **kwargs)
7063
7064 def CaptureMouse(*args, **kwargs):
7065 """
7066 CaptureMouse(self)
7067
7068 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
7069 release the capture.
7070
7071 Note that wxWindows maintains the stack of windows having captured the
7072 mouse and when the mouse is released the capture returns to the window
7073 which had had captured it previously and it is only really released if
7074 there were no previous window. In particular, this means that you must
7075 release the mouse as many times as you capture it.
7076 """
7077 return _core_.Window_CaptureMouse(*args, **kwargs)
7078
7079 def ReleaseMouse(*args, **kwargs):
7080 """
7081 ReleaseMouse(self)
7082
7083 Releases mouse input captured with wx.Window.CaptureMouse.
7084 """
7085 return _core_.Window_ReleaseMouse(*args, **kwargs)
7086
7087 def GetCapture(*args, **kwargs):
7088 """
d6c14a4c 7089 GetCapture() -> Window
d55e5bfc
RD
7090
7091 Returns the window which currently captures the mouse or None
7092 """
7093 return _core_.Window_GetCapture(*args, **kwargs)
7094
7095 GetCapture = staticmethod(GetCapture)
7096 def HasCapture(*args, **kwargs):
7097 """
7098 HasCapture(self) -> bool
7099
7100 Returns true if this window has the current mouse capture.
7101 """
7102 return _core_.Window_HasCapture(*args, **kwargs)
7103
7104 def Refresh(*args, **kwargs):
7105 """
7106 Refresh(self, bool eraseBackground=True, Rect rect=None)
7107
7108 Mark the specified rectangle (or the whole window) as "dirty" so it
7109 will be repainted. Causes an EVT_PAINT event to be generated and sent
7110 to the window.
7111 """
7112 return _core_.Window_Refresh(*args, **kwargs)
7113
7114 def RefreshRect(*args, **kwargs):
7115 """
7116 RefreshRect(self, Rect rect)
7117
7118 Redraws the contents of the given rectangle: the area inside it will
7119 be repainted. This is the same as Refresh but has a nicer syntax.
7120 """
7121 return _core_.Window_RefreshRect(*args, **kwargs)
7122
7123 def Update(*args, **kwargs):
7124 """
7125 Update(self)
7126
7127 Calling this method immediately repaints the invalidated area of the
7128 window instead of waiting for the EVT_PAINT event to happen, (normally
7129 this would usually only happen when the flow of control returns to the
7130 event loop.) Notice that this function doesn't refresh the window and
7131 does nothing if the window has been already repainted. Use Refresh
7132 first if you want to immediately redraw the window (or some portion of
7133 it) unconditionally.
7134 """
7135 return _core_.Window_Update(*args, **kwargs)
7136
7137 def ClearBackground(*args, **kwargs):
7138 """
7139 ClearBackground(self)
7140
7141 Clears the window by filling it with the current background
7142 colour. Does not cause an erase background event to be generated.
7143 """
7144 return _core_.Window_ClearBackground(*args, **kwargs)
7145
7146 def Freeze(*args, **kwargs):
7147 """
7148 Freeze(self)
7149
15817c7e
RD
7150 Freezes the window or, in other words, prevents any updates from
7151 taking place on screen, the window is not redrawn at all. Thaw must be
7152 called to reenable window redrawing. Calls to Freeze/Thaw may be
7153 nested, with the actual Thaw being delayed until all the nesting has
7154 been undone.
d55e5bfc
RD
7155
7156 This method is useful for visual appearance optimization (for example,
7157 it is a good idea to use it before inserting large amount of text into
7158 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
7159 for all controls so it is mostly just a hint to wxWindows and not a
7160 mandatory directive.
7161 """
7162 return _core_.Window_Freeze(*args, **kwargs)
7163
7164 def Thaw(*args, **kwargs):
7165 """
7166 Thaw(self)
7167
7168 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
7169 Freeze/Thaw may be nested, so Thaw must be called the same number of
7170 times that Freeze was before the window will be updated.
d55e5bfc
RD
7171 """
7172 return _core_.Window_Thaw(*args, **kwargs)
7173
7174 def PrepareDC(*args, **kwargs):
7175 """
7176 PrepareDC(self, DC dc)
7177
7178 Call this function to prepare the device context for drawing a
7179 scrolled image. It sets the device origin according to the current
7180 scroll position.
7181 """
7182 return _core_.Window_PrepareDC(*args, **kwargs)
7183
7184 def GetUpdateRegion(*args, **kwargs):
7185 """
7186 GetUpdateRegion(self) -> Region
7187
7188 Returns the region specifying which parts of the window have been
7189 damaged. Should only be called within an EVT_PAINT handler.
7190 """
7191 return _core_.Window_GetUpdateRegion(*args, **kwargs)
7192
7193 def GetUpdateClientRect(*args, **kwargs):
7194 """
7195 GetUpdateClientRect(self) -> Rect
7196
7197 Get the update rectangle region bounding box in client coords.
7198 """
7199 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
7200
7201 def IsExposed(*args, **kwargs):
7202 """
7203 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
7204
7205 Returns true if the given point or rectangle area has been exposed
7206 since the last repaint. Call this in an paint event handler to
7207 optimize redrawing by only redrawing those areas, which have been
7208 exposed.
7209 """
7210 return _core_.Window_IsExposed(*args, **kwargs)
7211
7212 def IsExposedPoint(*args, **kwargs):
7213 """
7214 IsExposedPoint(self, Point pt) -> bool
7215
7216 Returns true if the given point or rectangle area has been exposed
7217 since the last repaint. Call this in an paint event handler to
7218 optimize redrawing by only redrawing those areas, which have been
7219 exposed.
7220 """
7221 return _core_.Window_IsExposedPoint(*args, **kwargs)
7222
7223 def IsExposedRect(*args, **kwargs):
7224 """
7225 IsExposedRect(self, Rect rect) -> bool
7226
7227 Returns true if the given point or rectangle area has been exposed
7228 since the last repaint. Call this in an paint event handler to
7229 optimize redrawing by only redrawing those areas, which have been
7230 exposed.
7231 """
7232 return _core_.Window_IsExposedRect(*args, **kwargs)
7233
7234 def GetDefaultAttributes(*args, **kwargs):
7235 """
7236 GetDefaultAttributes(self) -> VisualAttributes
7237
15817c7e
RD
7238 Get the default attributes for an instance of this class. This is
7239 useful if you want to use the same font or colour in your own control
7240 as in a standard control -- which is a much better idea than hard
7241 coding specific colours or fonts which might look completely out of
a5ee0656 7242 place on the user's system, especially if it uses themes.
d55e5bfc
RD
7243 """
7244 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
7245
7246 def GetClassDefaultAttributes(*args, **kwargs):
7247 """
d6c14a4c 7248 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 7249
15817c7e
RD
7250 Get the default attributes for this class. This is useful if you want
7251 to use the same font or colour in your own control as in a standard
7252 control -- which is a much better idea than hard coding specific
a5ee0656
RD
7253 colours or fonts which might look completely out of place on the
7254 user's system, especially if it uses themes.
d55e5bfc
RD
7255
7256 The variant parameter is only relevant under Mac currently and is
15817c7e 7257 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
7258 the returned font. See `wx.Window.SetWindowVariant` for more about
7259 this.
d55e5bfc
RD
7260 """
7261 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
7262
7263 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
7264 def SetBackgroundColour(*args, **kwargs):
7265 """
7266 SetBackgroundColour(self, Colour colour) -> bool
7267
7268 Sets the background colour of the window. Returns True if the colour
7269 was changed. The background colour is usually painted by the default
7270 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
7271 automatically under GTK. Using `wx.NullColour` will reset the window
7272 to the default background colour.
d55e5bfc 7273
a5ee0656 7274 Note that setting the background colour may not cause an immediate
f8167d6e 7275 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
7276 calling this function.
7277
f8167d6e
RD
7278 Using this function will disable attempts to use themes for this
7279 window, if the system supports them. Use with care since usually the
7280 themes represent the appearance chosen by the user to be used for all
7281 applications on the system.
d55e5bfc
RD
7282 """
7283 return _core_.Window_SetBackgroundColour(*args, **kwargs)
7284
412d302d
RD
7285 def SetOwnBackgroundColour(*args, **kwargs):
7286 """SetOwnBackgroundColour(self, Colour colour)"""
7287 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
7288
7289 def SetForegroundColour(*args, **kwargs):
7290 """
7291 SetForegroundColour(self, Colour colour) -> bool
7292
7293 Sets the foreground colour of the window. Returns True is the colour
7294 was changed. The interpretation of foreground colour is dependent on
7295 the window class; it may be the text colour or other colour, or it may
7296 not be used at all.
7297 """
7298 return _core_.Window_SetForegroundColour(*args, **kwargs)
7299
fa47d7a7
VS
7300 def SetOwnForegroundColour(*args, **kwargs):
7301 """SetOwnForegroundColour(self, Colour colour)"""
7302 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
7303
7304 def GetBackgroundColour(*args, **kwargs):
7305 """
7306 GetBackgroundColour(self) -> Colour
7307
7308 Returns the background colour of the window.
7309 """
7310 return _core_.Window_GetBackgroundColour(*args, **kwargs)
7311
7312 def GetForegroundColour(*args, **kwargs):
7313 """
7314 GetForegroundColour(self) -> Colour
7315
7316 Returns the foreground colour of the window. The interpretation of
7317 foreground colour is dependent on the window class; it may be the text
7318 colour or other colour, or it may not be used at all.
7319 """
7320 return _core_.Window_GetForegroundColour(*args, **kwargs)
7321
0f63ec68
RD
7322 def SetBackgroundStyle(*args, **kwargs):
7323 """
7324 SetBackgroundStyle(self, int style) -> bool
7325
7326 Returns the background style of the window. The background style
7327 indicates how the background of the window is drawn.
7328
7329 ====================== ========================================
7330 wx.BG_STYLE_SYSTEM The background colour or pattern should
7331 be determined by the system
7332 wx.BG_STYLE_COLOUR The background should be a solid colour
7333 wx.BG_STYLE_CUSTOM The background will be implemented by the
7334 application.
7335 ====================== ========================================
7336
7337 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
7338 a custom background, such as a tiled bitmap. Currently the style has
7339 no effect on other platforms.
7340
7341 :see: `GetBackgroundStyle`, `SetBackgroundColour`
7342 """
7343 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
7344
7345 def GetBackgroundStyle(*args, **kwargs):
7346 """
7347 GetBackgroundStyle(self) -> int
7348
7349 Returns the background style of the window.
7350
7351 :see: `SetBackgroundStyle`
7352 """
7353 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
7354
51b83b37
RD
7355 def HasTransparentBackground(*args, **kwargs):
7356 """
7357 HasTransparentBackground(self) -> bool
7358
7359 Returns True if this window's background is transparent (as, for
7360 example, for `wx.StaticText`) and should show the parent window's
7361 background.
7362
7363 This method is mostly used internally by the library itself and you
7364 normally shouldn't have to call it. You may, however, have to override
7365 it in your custom control classes to ensure that background is painted
7366 correctly.
7367 """
7368 return _core_.Window_HasTransparentBackground(*args, **kwargs)
7369
d55e5bfc
RD
7370 def SetCursor(*args, **kwargs):
7371 """
7372 SetCursor(self, Cursor cursor) -> bool
7373
7374 Sets the window's cursor. Notice that the window cursor also sets it
7375 for the children of the window implicitly.
7376
7377 The cursor may be wx.NullCursor in which case the window cursor will
7378 be reset back to default.
7379 """
7380 return _core_.Window_SetCursor(*args, **kwargs)
7381
7382 def GetCursor(*args, **kwargs):
7383 """
7384 GetCursor(self) -> Cursor
7385
7386 Return the cursor associated with this window.
7387 """
7388 return _core_.Window_GetCursor(*args, **kwargs)
7389
7390 def SetFont(*args, **kwargs):
7391 """
7392 SetFont(self, Font font) -> bool
7393
7394 Sets the font for this window.
7395 """
7396 return _core_.Window_SetFont(*args, **kwargs)
7397
fa47d7a7
VS
7398 def SetOwnFont(*args, **kwargs):
7399 """SetOwnFont(self, Font font)"""
7400 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
7401
7402 def GetFont(*args, **kwargs):
7403 """
7404 GetFont(self) -> Font
7405
7406 Returns the default font used for this window.
7407 """
7408 return _core_.Window_GetFont(*args, **kwargs)
7409
7410 def SetCaret(*args, **kwargs):
7411 """
7412 SetCaret(self, Caret caret)
7413
7414 Sets the caret associated with the window.
7415 """
7416 return _core_.Window_SetCaret(*args, **kwargs)
7417
7418 def GetCaret(*args, **kwargs):
7419 """
7420 GetCaret(self) -> Caret
7421
7422 Returns the caret associated with the window.
7423 """
7424 return _core_.Window_GetCaret(*args, **kwargs)
7425
7426 def GetCharHeight(*args, **kwargs):
7427 """
7428 GetCharHeight(self) -> int
7429
7430 Get the (average) character size for the current font.
7431 """
7432 return _core_.Window_GetCharHeight(*args, **kwargs)
7433
7434 def GetCharWidth(*args, **kwargs):
7435 """
7436 GetCharWidth(self) -> int
7437
7438 Get the (average) character size for the current font.
7439 """
7440 return _core_.Window_GetCharWidth(*args, **kwargs)
7441
7442 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
7443 """
7444 GetTextExtent(String string) -> (width, height)
7445
7446 Get the width and height of the text using the current font.
7447 """
d55e5bfc
RD
7448 return _core_.Window_GetTextExtent(*args, **kwargs)
7449
7450 def GetFullTextExtent(*args, **kwargs):
7451 """
7452 GetFullTextExtent(String string, Font font=None) ->
7453 (width, height, descent, externalLeading)
7454
7455 Get the width, height, decent and leading of the text using the
7456 current or specified font.
7457 """
7458 return _core_.Window_GetFullTextExtent(*args, **kwargs)
7459
7460 def ClientToScreenXY(*args, **kwargs):
7461 """
7462 ClientToScreenXY(int x, int y) -> (x,y)
7463
7464 Converts to screen coordinates from coordinates relative to this window.
7465 """
7466 return _core_.Window_ClientToScreenXY(*args, **kwargs)
7467
7468 def ScreenToClientXY(*args, **kwargs):
7469 """
7470 ScreenToClientXY(int x, int y) -> (x,y)
7471
7472 Converts from screen to client window coordinates.
7473 """
7474 return _core_.Window_ScreenToClientXY(*args, **kwargs)
7475
7476 def ClientToScreen(*args, **kwargs):
7477 """
7478 ClientToScreen(self, Point pt) -> Point
7479
7480 Converts to screen coordinates from coordinates relative to this window.
7481 """
7482 return _core_.Window_ClientToScreen(*args, **kwargs)
7483
7484 def ScreenToClient(*args, **kwargs):
7485 """
7486 ScreenToClient(self, Point pt) -> Point
7487
7488 Converts from screen to client window coordinates.
7489 """
7490 return _core_.Window_ScreenToClient(*args, **kwargs)
7491
7492 def HitTestXY(*args, **kwargs):
7493 """
7494 HitTestXY(self, int x, int y) -> int
7495
7496 Test where the given (in client coords) point lies
7497 """
7498 return _core_.Window_HitTestXY(*args, **kwargs)
7499
7500 def HitTest(*args, **kwargs):
7501 """
7502 HitTest(self, Point pt) -> int
7503
7504 Test where the given (in client coords) point lies
7505 """
7506 return _core_.Window_HitTest(*args, **kwargs)
7507
7508 def GetBorder(*args):
7509 """
7510 GetBorder(self, long flags) -> int
7511 GetBorder(self) -> int
7512
7513 Get border for the flags of this window
7514 """
7515 return _core_.Window_GetBorder(*args)
7516
7517 def UpdateWindowUI(*args, **kwargs):
7518 """
7519 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
7520
7521 This function sends EVT_UPDATE_UI events to the window. The particular
7522 implementation depends on the window; for example a wx.ToolBar will
7523 send an update UI event for each toolbar button, and a wx.Frame will
7524 send an update UI event for each menubar menu item. You can call this
7525 function from your application to ensure that your UI is up-to-date at
7526 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7527 concerned). This may be necessary if you have called
7528 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7529 limit the overhead that wxWindows incurs by sending update UI events
7530 in idle time.
d55e5bfc
RD
7531 """
7532 return _core_.Window_UpdateWindowUI(*args, **kwargs)
7533
7534 def PopupMenuXY(*args, **kwargs):
7535 """
b0503257 7536 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 7537
b0503257
RD
7538 Pops up the given menu at the specified coordinates, relative to this window,
7539 and returns control when the user has dismissed the menu. If a menu item is
7540 selected, the corresponding menu event is generated and will be processed as
7541 usual. If the default position is given then the current position of the
7542 mouse cursor will be used.
d55e5bfc
RD
7543 """
7544 return _core_.Window_PopupMenuXY(*args, **kwargs)
7545
7546 def PopupMenu(*args, **kwargs):
7547 """
b0503257 7548 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 7549
b0503257
RD
7550 Pops up the given menu at the specified coordinates, relative to this window,
7551 and returns control when the user has dismissed the menu. If a menu item is
7552 selected, the corresponding menu event is generated and will be processed as
7553 usual. If the default position is given then the current position of the
7554 mouse cursor will be used.
d55e5bfc
RD
7555 """
7556 return _core_.Window_PopupMenu(*args, **kwargs)
7557
7558 def GetHandle(*args, **kwargs):
7559 """
7560 GetHandle(self) -> long
7561
7562 Returns the platform-specific handle (as a long integer) of the
7563 physical window. Currently on wxMac it returns the handle of the
7564 toplevel parent of the window.
7565 """
7566 return _core_.Window_GetHandle(*args, **kwargs)
7567
629e65c2
RD
7568 def AssociateHandle(*args, **kwargs):
7569 """
7570 AssociateHandle(self, long handle)
7571
7572 Associate the window with a new native handle
7573 """
7574 return _core_.Window_AssociateHandle(*args, **kwargs)
7575
7576 def DissociateHandle(*args, **kwargs):
7577 """
7578 DissociateHandle(self)
7579
7580 Dissociate the current native handle from the window
7581 """
7582 return _core_.Window_DissociateHandle(*args, **kwargs)
7583
d55e5bfc
RD
7584 def HasScrollbar(*args, **kwargs):
7585 """
7586 HasScrollbar(self, int orient) -> bool
7587
7588 Does the window have the scrollbar for this orientation?
7589 """
7590 return _core_.Window_HasScrollbar(*args, **kwargs)
7591
7592 def SetScrollbar(*args, **kwargs):
7593 """
15817c7e 7594 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
7595 bool refresh=True)
7596
7597 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc
RD
7598 """
7599 return _core_.Window_SetScrollbar(*args, **kwargs)
7600
7601 def SetScrollPos(*args, **kwargs):
7602 """
7603 SetScrollPos(self, int orientation, int pos, bool refresh=True)
7604
7605 Sets the position of one of the built-in scrollbars.
7606 """
7607 return _core_.Window_SetScrollPos(*args, **kwargs)
7608
7609 def GetScrollPos(*args, **kwargs):
7610 """
7611 GetScrollPos(self, int orientation) -> int
7612
7613 Returns the built-in scrollbar position.
7614 """
7615 return _core_.Window_GetScrollPos(*args, **kwargs)
7616
7617 def GetScrollThumb(*args, **kwargs):
7618 """
7619 GetScrollThumb(self, int orientation) -> int
7620
7621 Returns the built-in scrollbar thumb size.
7622 """
7623 return _core_.Window_GetScrollThumb(*args, **kwargs)
7624
7625 def GetScrollRange(*args, **kwargs):
7626 """
7627 GetScrollRange(self, int orientation) -> int
7628
7629 Returns the built-in scrollbar range.
7630 """
7631 return _core_.Window_GetScrollRange(*args, **kwargs)
7632
7633 def ScrollWindow(*args, **kwargs):
7634 """
7635 ScrollWindow(self, int dx, int dy, Rect rect=None)
7636
7637 Physically scrolls the pixels in the window and move child windows
7638 accordingly. Use this function to optimise your scrolling
7639 implementations, to minimise the area that must be redrawn. Note that
7640 it is rarely required to call this function from a user program.
d55e5bfc
RD
7641 """
7642 return _core_.Window_ScrollWindow(*args, **kwargs)
7643
7644 def ScrollLines(*args, **kwargs):
7645 """
7646 ScrollLines(self, int lines) -> bool
7647
7648 If the platform and window class supports it, scrolls the window by
7649 the given number of lines down, if lines is positive, or up if lines
7650 is negative. Returns True if the window was scrolled, False if it was
7651 already on top/bottom and nothing was done.
7652 """
7653 return _core_.Window_ScrollLines(*args, **kwargs)
7654
7655 def ScrollPages(*args, **kwargs):
7656 """
7657 ScrollPages(self, int pages) -> bool
7658
15817c7e 7659 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
7660 the given number of pages down, if pages is positive, or up if pages
7661 is negative. Returns True if the window was scrolled, False if it was
7662 already on top/bottom and nothing was done.
7663 """
7664 return _core_.Window_ScrollPages(*args, **kwargs)
7665
7666 def LineUp(*args, **kwargs):
7667 """
7668 LineUp(self) -> bool
7669
7670 This is just a wrapper for ScrollLines(-1).
7671 """
7672 return _core_.Window_LineUp(*args, **kwargs)
7673
7674 def LineDown(*args, **kwargs):
7675 """
7676 LineDown(self) -> bool
7677
7678 This is just a wrapper for ScrollLines(1).
7679 """
7680 return _core_.Window_LineDown(*args, **kwargs)
7681
7682 def PageUp(*args, **kwargs):
7683 """
7684 PageUp(self) -> bool
7685
7686 This is just a wrapper for ScrollPages(-1).
7687 """
7688 return _core_.Window_PageUp(*args, **kwargs)
7689
7690 def PageDown(*args, **kwargs):
7691 """
7692 PageDown(self) -> bool
7693
7694 This is just a wrapper for ScrollPages(1).
7695 """
7696 return _core_.Window_PageDown(*args, **kwargs)
7697
7698 def SetHelpText(*args, **kwargs):
7699 """
7700 SetHelpText(self, String text)
7701
7702 Sets the help text to be used as context-sensitive help for this
7703 window. Note that the text is actually stored by the current
7704 wxHelpProvider implementation, and not in the window object itself.
7705 """
7706 return _core_.Window_SetHelpText(*args, **kwargs)
7707
7708 def SetHelpTextForId(*args, **kwargs):
7709 """
7710 SetHelpTextForId(self, String text)
7711
7712 Associate this help text with all windows with the same id as this
7713 one.
7714 """
7715 return _core_.Window_SetHelpTextForId(*args, **kwargs)
7716
7717 def GetHelpText(*args, **kwargs):
7718 """
7719 GetHelpText(self) -> String
7720
7721 Gets the help text to be used as context-sensitive help for this
7722 window. Note that the text is actually stored by the current
7723 wxHelpProvider implementation, and not in the window object itself.
7724 """
7725 return _core_.Window_GetHelpText(*args, **kwargs)
7726
7727 def SetToolTipString(*args, **kwargs):
7728 """
7729 SetToolTipString(self, String tip)
7730
7731 Attach a tooltip to the window.
7732 """
7733 return _core_.Window_SetToolTipString(*args, **kwargs)
7734
7735 def SetToolTip(*args, **kwargs):
7736 """
7737 SetToolTip(self, ToolTip tip)
7738
7739 Attach a tooltip to the window.
7740 """
7741 return _core_.Window_SetToolTip(*args, **kwargs)
7742
7743 def GetToolTip(*args, **kwargs):
7744 """
7745 GetToolTip(self) -> ToolTip
7746
7747 get the associated tooltip or None if none
7748 """
7749 return _core_.Window_GetToolTip(*args, **kwargs)
7750
7751 def SetDropTarget(*args, **kwargs):
7752 """
7753 SetDropTarget(self, DropTarget dropTarget)
7754
7755 Associates a drop target with this window. If the window already has
7756 a drop target, it is deleted.
7757 """
7758 return _core_.Window_SetDropTarget(*args, **kwargs)
7759
7760 def GetDropTarget(*args, **kwargs):
7761 """
7762 GetDropTarget(self) -> DropTarget
7763
7764 Returns the associated drop target, which may be None.
7765 """
7766 return _core_.Window_GetDropTarget(*args, **kwargs)
7767
7768 def SetConstraints(*args, **kwargs):
7769 """
7770 SetConstraints(self, LayoutConstraints constraints)
7771
7772 Sets the window to have the given layout constraints. If an existing
7773 layout constraints object is already owned by the window, it will be
7774 deleted. Pass None to disassociate and delete the window's current
7775 constraints.
7776
7777 You must call SetAutoLayout to tell a window to use the constraints
7778 automatically in its default EVT_SIZE handler; otherwise, you must
7779 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7780 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7781 effect.
7782 """
7783 return _core_.Window_SetConstraints(*args, **kwargs)
7784
7785 def GetConstraints(*args, **kwargs):
7786 """
7787 GetConstraints(self) -> LayoutConstraints
7788
7789 Returns a pointer to the window's layout constraints, or None if there
7790 are none.
7791 """
7792 return _core_.Window_GetConstraints(*args, **kwargs)
7793
7794 def SetAutoLayout(*args, **kwargs):
7795 """
7796 SetAutoLayout(self, bool autoLayout)
7797
7798 Determines whether the Layout function will be called automatically
7799 when the window is resized. It is called implicitly by SetSizer but
7800 if you use SetConstraints you should call it manually or otherwise the
7801 window layout won't be correctly updated when its size changes.
7802 """
7803 return _core_.Window_SetAutoLayout(*args, **kwargs)
7804
7805 def GetAutoLayout(*args, **kwargs):
7806 """
7807 GetAutoLayout(self) -> bool
7808
7809 Returns the current autoLayout setting
7810 """
7811 return _core_.Window_GetAutoLayout(*args, **kwargs)
7812
7813 def Layout(*args, **kwargs):
7814 """
7815 Layout(self) -> bool
7816
7817 Invokes the constraint-based layout algorithm or the sizer-based
7818 algorithm for this window. See SetAutoLayout: when auto layout is on,
7819 this function gets called automatically by the default EVT_SIZE
7820 handler when the window is resized.
7821 """
7822 return _core_.Window_Layout(*args, **kwargs)
7823
7824 def SetSizer(*args, **kwargs):
7825 """
7826 SetSizer(self, Sizer sizer, bool deleteOld=True)
7827
7828 Sets the window to have the given layout sizer. The window will then
7829 own the object, and will take care of its deletion. If an existing
7830 layout sizer object is already owned by the window, it will be deleted
7831 if the deleteOld parameter is true. Note that this function will also
7832 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 7833 non-None, and False otherwise.
d55e5bfc
RD
7834 """
7835 return _core_.Window_SetSizer(*args, **kwargs)
7836
7837 def SetSizerAndFit(*args, **kwargs):
7838 """
7839 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
7840
7841 The same as SetSizer, except it also sets the size hints for the
7842 window based on the sizer's minimum size.
7843 """
7844 return _core_.Window_SetSizerAndFit(*args, **kwargs)
7845
7846 def GetSizer(*args, **kwargs):
7847 """
7848 GetSizer(self) -> Sizer
7849
7850 Return the sizer associated with the window by a previous call to
7851 SetSizer or None if there isn't one.
7852 """
7853 return _core_.Window_GetSizer(*args, **kwargs)
7854
7855 def SetContainingSizer(*args, **kwargs):
7856 """
7857 SetContainingSizer(self, Sizer sizer)
7858
7859 This normally does not need to be called by application code. It is
7860 called internally when a window is added to a sizer, and is used so
7861 the window can remove itself from the sizer when it is destroyed.
7862 """
7863 return _core_.Window_SetContainingSizer(*args, **kwargs)
7864
7865 def GetContainingSizer(*args, **kwargs):
7866 """
7867 GetContainingSizer(self) -> Sizer
7868
7869 Return the sizer that this window is a member of, if any, otherwise None.
7870 """
7871 return _core_.Window_GetContainingSizer(*args, **kwargs)
7872
7873 def InheritAttributes(*args, **kwargs):
7874 """
7875 InheritAttributes(self)
7876
15817c7e
RD
7877 This function is (or should be, in case of custom controls) called
7878 during window creation to intelligently set up the window visual
7879 attributes, that is the font and the foreground and background
7880 colours.
7881
7882 By 'intelligently' the following is meant: by default, all windows use
7883 their own default attributes. However if some of the parent's
7884 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 7885 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
7886 explicitly set for this window itself, then this window takes the same
7887 value as used by the parent. In addition, if the window overrides
7888 ShouldInheritColours to return false, the colours will not be changed
7889 no matter what and only the font might.
7890
a7bb0a9d
RD
7891 This rather complicated logic is necessary in order to accommodate the
7892 different usage scenarios. The most common one is when all default
15817c7e
RD
7893 attributes are used and in this case, nothing should be inherited as
7894 in modern GUIs different controls use different fonts (and colours)
7895 than their siblings so they can't inherit the same value from the
7896 parent. However it was also deemed desirable to allow to simply change
7897 the attributes of all children at once by just changing the font or
7898 colour of their common parent, hence in this case we do inherit the
7899 parents attributes.
7900
d55e5bfc
RD
7901 """
7902 return _core_.Window_InheritAttributes(*args, **kwargs)
7903
7904 def ShouldInheritColours(*args, **kwargs):
7905 """
7906 ShouldInheritColours(self) -> bool
7907
7908 Return true from here to allow the colours of this window to be
15817c7e
RD
7909 changed by InheritAttributes, returning false forbids inheriting them
7910 from the parent window.
d55e5bfc 7911
15817c7e
RD
7912 The base class version returns false, but this method is overridden in
7913 wxControl where it returns true.
d55e5bfc
RD
7914 """
7915 return _core_.Window_ShouldInheritColours(*args, **kwargs)
7916
7917 def PostCreate(self, pre):
7918 """
7919 Phase 3 of the 2-phase create <wink!>
7920 Call this method after precreating the window with the 2-phase create method.
7921 """
7922 self.this = pre.this
7923 self.thisown = pre.thisown
7924 pre.thisown = 0
7925 if hasattr(self, '_setOORInfo'):
7926 self._setOORInfo(self)
7927 if hasattr(self, '_setCallbackInfo'):
7928 self._setCallbackInfo(self, self.__class__)
7929
7930
7931class WindowPtr(Window):
7932 def __init__(self, this):
7933 self.this = this
7934 if not hasattr(self,"thisown"): self.thisown = 0
7935 self.__class__ = Window
7936_core_.Window_swigregister(WindowPtr)
7937
7938def PreWindow(*args, **kwargs):
7939 """
7940 PreWindow() -> Window
7941
7942 Precreate a Window for 2-phase creation.
7943 """
7944 val = _core_.new_PreWindow(*args, **kwargs)
7945 val.thisown = 1
7946 return val
7947
7948def Window_NewControlId(*args, **kwargs):
7949 """
7950 Window_NewControlId() -> int
7951
7952 Generate a control id for the controls which were not given one.
7953 """
7954 return _core_.Window_NewControlId(*args, **kwargs)
7955
7956def Window_NextControlId(*args, **kwargs):
7957 """
7958 Window_NextControlId(int winid) -> int
7959
7960 Get the id of the control following the one with the given
15817c7e 7961 autogenerated) id
d55e5bfc
RD
7962 """
7963 return _core_.Window_NextControlId(*args, **kwargs)
7964
7965def Window_PrevControlId(*args, **kwargs):
7966 """
7967 Window_PrevControlId(int winid) -> int
7968
7969 Get the id of the control preceding the one with the given
15817c7e 7970 autogenerated) id
d55e5bfc
RD
7971 """
7972 return _core_.Window_PrevControlId(*args, **kwargs)
7973
7974def Window_FindFocus(*args, **kwargs):
7975 """
7976 Window_FindFocus() -> Window
7977
7978 Returns the window or control that currently has the keyboard focus,
7979 or None.
7980 """
7981 return _core_.Window_FindFocus(*args, **kwargs)
7982
7983def Window_GetCapture(*args, **kwargs):
7984 """
7985 Window_GetCapture() -> Window
7986
7987 Returns the window which currently captures the mouse or None
7988 """
7989 return _core_.Window_GetCapture(*args, **kwargs)
7990
7991def Window_GetClassDefaultAttributes(*args, **kwargs):
7992 """
7993 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7994
15817c7e
RD
7995 Get the default attributes for this class. This is useful if you want
7996 to use the same font or colour in your own control as in a standard
7997 control -- which is a much better idea than hard coding specific
a5ee0656
RD
7998 colours or fonts which might look completely out of place on the
7999 user's system, especially if it uses themes.
d55e5bfc
RD
8000
8001 The variant parameter is only relevant under Mac currently and is
15817c7e 8002 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
8003 the returned font. See `wx.Window.SetWindowVariant` for more about
8004 this.
d55e5bfc
RD
8005 """
8006 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8007
8008def DLG_PNT(win, point_or_x, y=None):
8009 """
8010 Convenience function for converting a Point or (x,y) in
8011 dialog units to pixel units.
8012 """
8013 if y is None:
8014 return win.ConvertDialogPointToPixels(point_or_x)
8015 else:
8016 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
8017
8018def DLG_SZE(win, size_width, height=None):
8019 """
8020 Convenience function for converting a Size or (w,h) in
8021 dialog units to pixel units.
8022 """
8023 if height is None:
8024 return win.ConvertDialogSizeToPixels(size_width)
8025 else:
8026 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
8027
8028
8029def FindWindowById(*args, **kwargs):
8030 """
8031 FindWindowById(long id, Window parent=None) -> Window
8032
8033 Find the first window in the application with the given id. If parent
8034 is None, the search will start from all top-level frames and dialog
8035 boxes; if non-None, the search will be limited to the given window
8036 hierarchy. The search is recursive in both cases.
8037 """
8038 return _core_.FindWindowById(*args, **kwargs)
8039
8040def FindWindowByName(*args, **kwargs):
8041 """
8042 FindWindowByName(String name, Window parent=None) -> Window
8043
8044 Find a window by its name (as given in a window constructor or Create
8045 function call). If parent is None, the search will start from all
8046 top-level frames and dialog boxes; if non-None, the search will be
8047 limited to the given window hierarchy. The search is recursive in both
8048 cases.
8049
8050 If no window with such name is found, wx.FindWindowByLabel is called.
8051 """
8052 return _core_.FindWindowByName(*args, **kwargs)
8053
8054def FindWindowByLabel(*args, **kwargs):
8055 """
8056 FindWindowByLabel(String label, Window parent=None) -> Window
8057
8058 Find a window by its label. Depending on the type of window, the label
8059 may be a window title or panel item label. If parent is None, the
8060 search will start from all top-level frames and dialog boxes; if
8061 non-None, the search will be limited to the given window
8062 hierarchy. The search is recursive in both cases.
8063 """
8064 return _core_.FindWindowByLabel(*args, **kwargs)
8065
8066def Window_FromHWND(*args, **kwargs):
8067 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
8068 return _core_.Window_FromHWND(*args, **kwargs)
8069#---------------------------------------------------------------------------
8070
8071class Validator(EvtHandler):
36ed4f51 8072 """Proxy of C++ Validator class"""
d55e5bfc
RD
8073 def __repr__(self):
8074 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8075 def __init__(self, *args, **kwargs):
8076 """__init__(self) -> Validator"""
8077 newobj = _core_.new_Validator(*args, **kwargs)
8078 self.this = newobj.this
8079 self.thisown = 1
8080 del newobj.thisown
8081 self._setOORInfo(self)
8082
8083 def Clone(*args, **kwargs):
8084 """Clone(self) -> Validator"""
8085 return _core_.Validator_Clone(*args, **kwargs)
8086
8087 def Validate(*args, **kwargs):
8088 """Validate(self, Window parent) -> bool"""
8089 return _core_.Validator_Validate(*args, **kwargs)
8090
8091 def TransferToWindow(*args, **kwargs):
8092 """TransferToWindow(self) -> bool"""
8093 return _core_.Validator_TransferToWindow(*args, **kwargs)
8094
8095 def TransferFromWindow(*args, **kwargs):
8096 """TransferFromWindow(self) -> bool"""
8097 return _core_.Validator_TransferFromWindow(*args, **kwargs)
8098
8099 def GetWindow(*args, **kwargs):
8100 """GetWindow(self) -> Window"""
8101 return _core_.Validator_GetWindow(*args, **kwargs)
8102
8103 def SetWindow(*args, **kwargs):
8104 """SetWindow(self, Window window)"""
8105 return _core_.Validator_SetWindow(*args, **kwargs)
8106
8107 def IsSilent(*args, **kwargs):
d6c14a4c 8108 """IsSilent() -> bool"""
d55e5bfc
RD
8109 return _core_.Validator_IsSilent(*args, **kwargs)
8110
8111 IsSilent = staticmethod(IsSilent)
8112 def SetBellOnError(*args, **kwargs):
d6c14a4c 8113 """SetBellOnError(int doIt=True)"""
d55e5bfc
RD
8114 return _core_.Validator_SetBellOnError(*args, **kwargs)
8115
8116 SetBellOnError = staticmethod(SetBellOnError)
8117
8118class ValidatorPtr(Validator):
8119 def __init__(self, this):
8120 self.this = this
8121 if not hasattr(self,"thisown"): self.thisown = 0
8122 self.__class__ = Validator
8123_core_.Validator_swigregister(ValidatorPtr)
8124
8125def Validator_IsSilent(*args, **kwargs):
8126 """Validator_IsSilent() -> bool"""
8127 return _core_.Validator_IsSilent(*args, **kwargs)
8128
8129def Validator_SetBellOnError(*args, **kwargs):
8130 """Validator_SetBellOnError(int doIt=True)"""
8131 return _core_.Validator_SetBellOnError(*args, **kwargs)
8132
8133class PyValidator(Validator):
36ed4f51 8134 """Proxy of C++ PyValidator class"""
d55e5bfc
RD
8135 def __repr__(self):
8136 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8137 def __init__(self, *args, **kwargs):
8138 """__init__(self) -> PyValidator"""
8139 newobj = _core_.new_PyValidator(*args, **kwargs)
8140 self.this = newobj.this
8141 self.thisown = 1
8142 del newobj.thisown
8143
8144 self._setCallbackInfo(self, PyValidator, 1)
8145 self._setOORInfo(self)
8146
8147 def _setCallbackInfo(*args, **kwargs):
8148 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
8149 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
8150
8151
8152class PyValidatorPtr(PyValidator):
8153 def __init__(self, this):
8154 self.this = this
8155 if not hasattr(self,"thisown"): self.thisown = 0
8156 self.__class__ = PyValidator
8157_core_.PyValidator_swigregister(PyValidatorPtr)
8158
8159#---------------------------------------------------------------------------
8160
8161class Menu(EvtHandler):
36ed4f51 8162 """Proxy of C++ Menu class"""
d55e5bfc
RD
8163 def __repr__(self):
8164 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8165 def __init__(self, *args, **kwargs):
8166 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
8167 newobj = _core_.new_Menu(*args, **kwargs)
8168 self.this = newobj.this
8169 self.thisown = 1
8170 del newobj.thisown
8171 self._setOORInfo(self)
8172
8173 def Append(*args, **kwargs):
8174 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8175 return _core_.Menu_Append(*args, **kwargs)
8176
8177 def AppendSeparator(*args, **kwargs):
8178 """AppendSeparator(self) -> MenuItem"""
8179 return _core_.Menu_AppendSeparator(*args, **kwargs)
8180
8181 def AppendCheckItem(*args, **kwargs):
8182 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8183 return _core_.Menu_AppendCheckItem(*args, **kwargs)
8184
8185 def AppendRadioItem(*args, **kwargs):
8186 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8187 return _core_.Menu_AppendRadioItem(*args, **kwargs)
8188
8189 def AppendMenu(*args, **kwargs):
8190 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8191 return _core_.Menu_AppendMenu(*args, **kwargs)
8192
8193 def AppendItem(*args, **kwargs):
8194 """AppendItem(self, MenuItem item) -> MenuItem"""
8195 return _core_.Menu_AppendItem(*args, **kwargs)
8196
8197 def Break(*args, **kwargs):
8198 """Break(self)"""
8199 return _core_.Menu_Break(*args, **kwargs)
8200
8201 def InsertItem(*args, **kwargs):
8202 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
8203 return _core_.Menu_InsertItem(*args, **kwargs)
8204
8205 def Insert(*args, **kwargs):
8206 """
8207 Insert(self, size_t pos, int id, String text, String help=EmptyString,
8208 int kind=ITEM_NORMAL) -> MenuItem
8209 """
8210 return _core_.Menu_Insert(*args, **kwargs)
8211
8212 def InsertSeparator(*args, **kwargs):
8213 """InsertSeparator(self, size_t pos) -> MenuItem"""
8214 return _core_.Menu_InsertSeparator(*args, **kwargs)
8215
8216 def InsertCheckItem(*args, **kwargs):
8217 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8218 return _core_.Menu_InsertCheckItem(*args, **kwargs)
8219
8220 def InsertRadioItem(*args, **kwargs):
8221 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8222 return _core_.Menu_InsertRadioItem(*args, **kwargs)
8223
8224 def InsertMenu(*args, **kwargs):
8225 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8226 return _core_.Menu_InsertMenu(*args, **kwargs)
8227
8228 def PrependItem(*args, **kwargs):
8229 """PrependItem(self, MenuItem item) -> MenuItem"""
8230 return _core_.Menu_PrependItem(*args, **kwargs)
8231
8232 def Prepend(*args, **kwargs):
8233 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8234 return _core_.Menu_Prepend(*args, **kwargs)
8235
8236 def PrependSeparator(*args, **kwargs):
8237 """PrependSeparator(self) -> MenuItem"""
8238 return _core_.Menu_PrependSeparator(*args, **kwargs)
8239
8240 def PrependCheckItem(*args, **kwargs):
8241 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8242 return _core_.Menu_PrependCheckItem(*args, **kwargs)
8243
8244 def PrependRadioItem(*args, **kwargs):
8245 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8246 return _core_.Menu_PrependRadioItem(*args, **kwargs)
8247
8248 def PrependMenu(*args, **kwargs):
8249 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8250 return _core_.Menu_PrependMenu(*args, **kwargs)
8251
8252 def Remove(*args, **kwargs):
8253 """Remove(self, int id) -> MenuItem"""
8254 return _core_.Menu_Remove(*args, **kwargs)
8255
8256 def RemoveItem(*args, **kwargs):
8257 """RemoveItem(self, MenuItem item) -> MenuItem"""
8258 return _core_.Menu_RemoveItem(*args, **kwargs)
8259
8260 def Delete(*args, **kwargs):
8261 """Delete(self, int id) -> bool"""
8262 return _core_.Menu_Delete(*args, **kwargs)
8263
8264 def DeleteItem(*args, **kwargs):
8265 """DeleteItem(self, MenuItem item) -> bool"""
8266 return _core_.Menu_DeleteItem(*args, **kwargs)
8267
8268 def Destroy(*args, **kwargs):
8269 """
8270 Destroy(self)
8271
8272 Deletes the C++ object this Python object is a proxy for.
8273 """
8274 return _core_.Menu_Destroy(*args, **kwargs)
8275
8276 def DestroyId(*args, **kwargs):
8277 """
8278 DestroyId(self, int id) -> bool
8279
8280 Deletes the C++ object this Python object is a proxy for.
8281 """
8282 return _core_.Menu_DestroyId(*args, **kwargs)
8283
8284 def DestroyItem(*args, **kwargs):
8285 """
8286 DestroyItem(self, MenuItem item) -> bool
8287
8288 Deletes the C++ object this Python object is a proxy for.
8289 """
8290 return _core_.Menu_DestroyItem(*args, **kwargs)
8291
8292 def GetMenuItemCount(*args, **kwargs):
8293 """GetMenuItemCount(self) -> size_t"""
8294 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
8295
8296 def GetMenuItems(*args, **kwargs):
8297 """GetMenuItems(self) -> PyObject"""
8298 return _core_.Menu_GetMenuItems(*args, **kwargs)
8299
8300 def FindItem(*args, **kwargs):
8301 """FindItem(self, String item) -> int"""
8302 return _core_.Menu_FindItem(*args, **kwargs)
8303
8304 def FindItemById(*args, **kwargs):
8305 """FindItemById(self, int id) -> MenuItem"""
8306 return _core_.Menu_FindItemById(*args, **kwargs)
8307
8308 def FindItemByPosition(*args, **kwargs):
8309 """FindItemByPosition(self, size_t position) -> MenuItem"""
8310 return _core_.Menu_FindItemByPosition(*args, **kwargs)
8311
8312 def Enable(*args, **kwargs):
8313 """Enable(self, int id, bool enable)"""
8314 return _core_.Menu_Enable(*args, **kwargs)
8315
8316 def IsEnabled(*args, **kwargs):
8317 """IsEnabled(self, int id) -> bool"""
8318 return _core_.Menu_IsEnabled(*args, **kwargs)
8319
8320 def Check(*args, **kwargs):
8321 """Check(self, int id, bool check)"""
8322 return _core_.Menu_Check(*args, **kwargs)
8323
8324 def IsChecked(*args, **kwargs):
8325 """IsChecked(self, int id) -> bool"""
8326 return _core_.Menu_IsChecked(*args, **kwargs)
8327
8328 def SetLabel(*args, **kwargs):
8329 """SetLabel(self, int id, String label)"""
8330 return _core_.Menu_SetLabel(*args, **kwargs)
8331
8332 def GetLabel(*args, **kwargs):
8333 """GetLabel(self, int id) -> String"""
8334 return _core_.Menu_GetLabel(*args, **kwargs)
8335
8336 def SetHelpString(*args, **kwargs):
8337 """SetHelpString(self, int id, String helpString)"""
8338 return _core_.Menu_SetHelpString(*args, **kwargs)
8339
8340 def GetHelpString(*args, **kwargs):
8341 """GetHelpString(self, int id) -> String"""
8342 return _core_.Menu_GetHelpString(*args, **kwargs)
8343
8344 def SetTitle(*args, **kwargs):
8345 """SetTitle(self, String title)"""
8346 return _core_.Menu_SetTitle(*args, **kwargs)
8347
8348 def GetTitle(*args, **kwargs):
8349 """GetTitle(self) -> String"""
8350 return _core_.Menu_GetTitle(*args, **kwargs)
8351
8352 def SetEventHandler(*args, **kwargs):
8353 """SetEventHandler(self, EvtHandler handler)"""
8354 return _core_.Menu_SetEventHandler(*args, **kwargs)
8355
8356 def GetEventHandler(*args, **kwargs):
8357 """GetEventHandler(self) -> EvtHandler"""
8358 return _core_.Menu_GetEventHandler(*args, **kwargs)
8359
8360 def SetInvokingWindow(*args, **kwargs):
8361 """SetInvokingWindow(self, Window win)"""
8362 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
8363
8364 def GetInvokingWindow(*args, **kwargs):
8365 """GetInvokingWindow(self) -> Window"""
8366 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
8367
8368 def GetStyle(*args, **kwargs):
8369 """GetStyle(self) -> long"""
8370 return _core_.Menu_GetStyle(*args, **kwargs)
8371
8372 def UpdateUI(*args, **kwargs):
8373 """UpdateUI(self, EvtHandler source=None)"""
8374 return _core_.Menu_UpdateUI(*args, **kwargs)
8375
8376 def GetMenuBar(*args, **kwargs):
8377 """GetMenuBar(self) -> MenuBar"""
8378 return _core_.Menu_GetMenuBar(*args, **kwargs)
8379
8380 def Attach(*args, **kwargs):
8381 """Attach(self, wxMenuBarBase menubar)"""
8382 return _core_.Menu_Attach(*args, **kwargs)
8383
8384 def Detach(*args, **kwargs):
8385 """Detach(self)"""
8386 return _core_.Menu_Detach(*args, **kwargs)
8387
8388 def IsAttached(*args, **kwargs):
8389 """IsAttached(self) -> bool"""
8390 return _core_.Menu_IsAttached(*args, **kwargs)
8391
8392 def SetParent(*args, **kwargs):
8393 """SetParent(self, Menu parent)"""
8394 return _core_.Menu_SetParent(*args, **kwargs)
8395
8396 def GetParent(*args, **kwargs):
8397 """GetParent(self) -> Menu"""
8398 return _core_.Menu_GetParent(*args, **kwargs)
8399
8400
8401class MenuPtr(Menu):
8402 def __init__(self, this):
8403 self.this = this
8404 if not hasattr(self,"thisown"): self.thisown = 0
8405 self.__class__ = Menu
8406_core_.Menu_swigregister(MenuPtr)
8407DefaultValidator = cvar.DefaultValidator
8408
8409#---------------------------------------------------------------------------
8410
8411class MenuBar(Window):
36ed4f51 8412 """Proxy of C++ MenuBar class"""
d55e5bfc
RD
8413 def __repr__(self):
8414 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8415 def __init__(self, *args, **kwargs):
8416 """__init__(self, long style=0) -> MenuBar"""
8417 newobj = _core_.new_MenuBar(*args, **kwargs)
8418 self.this = newobj.this
8419 self.thisown = 1
8420 del newobj.thisown
8421 self._setOORInfo(self)
8422
8423 def Append(*args, **kwargs):
8424 """Append(self, Menu menu, String title) -> bool"""
8425 return _core_.MenuBar_Append(*args, **kwargs)
8426
8427 def Insert(*args, **kwargs):
8428 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
8429 return _core_.MenuBar_Insert(*args, **kwargs)
8430
8431 def GetMenuCount(*args, **kwargs):
8432 """GetMenuCount(self) -> size_t"""
8433 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
8434
8435 def GetMenu(*args, **kwargs):
8436 """GetMenu(self, size_t pos) -> Menu"""
8437 return _core_.MenuBar_GetMenu(*args, **kwargs)
8438
8439 def Replace(*args, **kwargs):
8440 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
8441 return _core_.MenuBar_Replace(*args, **kwargs)
8442
8443 def Remove(*args, **kwargs):
8444 """Remove(self, size_t pos) -> Menu"""
8445 return _core_.MenuBar_Remove(*args, **kwargs)
8446
8447 def EnableTop(*args, **kwargs):
8448 """EnableTop(self, size_t pos, bool enable)"""
8449 return _core_.MenuBar_EnableTop(*args, **kwargs)
8450
8451 def IsEnabledTop(*args, **kwargs):
8452 """IsEnabledTop(self, size_t pos) -> bool"""
8453 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
8454
8455 def SetLabelTop(*args, **kwargs):
8456 """SetLabelTop(self, size_t pos, String label)"""
8457 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
8458
8459 def GetLabelTop(*args, **kwargs):
8460 """GetLabelTop(self, size_t pos) -> String"""
8461 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
8462
8463 def FindMenuItem(*args, **kwargs):
8464 """FindMenuItem(self, String menu, String item) -> int"""
8465 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
8466
8467 def FindItemById(*args, **kwargs):
8468 """FindItemById(self, int id) -> MenuItem"""
8469 return _core_.MenuBar_FindItemById(*args, **kwargs)
8470
8471 def FindMenu(*args, **kwargs):
8472 """FindMenu(self, String title) -> int"""
8473 return _core_.MenuBar_FindMenu(*args, **kwargs)
8474
8475 def Enable(*args, **kwargs):
8476 """Enable(self, int id, bool enable)"""
8477 return _core_.MenuBar_Enable(*args, **kwargs)
8478
8479 def Check(*args, **kwargs):
8480 """Check(self, int id, bool check)"""
8481 return _core_.MenuBar_Check(*args, **kwargs)
8482
8483 def IsChecked(*args, **kwargs):
8484 """IsChecked(self, int id) -> bool"""
8485 return _core_.MenuBar_IsChecked(*args, **kwargs)
8486
8487 def IsEnabled(*args, **kwargs):
8488 """IsEnabled(self, int id) -> bool"""
8489 return _core_.MenuBar_IsEnabled(*args, **kwargs)
8490
8491 def SetLabel(*args, **kwargs):
8492 """SetLabel(self, int id, String label)"""
8493 return _core_.MenuBar_SetLabel(*args, **kwargs)
8494
8495 def GetLabel(*args, **kwargs):
8496 """GetLabel(self, int id) -> String"""
8497 return _core_.MenuBar_GetLabel(*args, **kwargs)
8498
8499 def SetHelpString(*args, **kwargs):
8500 """SetHelpString(self, int id, String helpString)"""
8501 return _core_.MenuBar_SetHelpString(*args, **kwargs)
8502
8503 def GetHelpString(*args, **kwargs):
8504 """GetHelpString(self, int id) -> String"""
8505 return _core_.MenuBar_GetHelpString(*args, **kwargs)
8506
8507 def GetFrame(*args, **kwargs):
8508 """GetFrame(self) -> wxFrame"""
8509 return _core_.MenuBar_GetFrame(*args, **kwargs)
8510
8511 def IsAttached(*args, **kwargs):
8512 """IsAttached(self) -> bool"""
8513 return _core_.MenuBar_IsAttached(*args, **kwargs)
8514
8515 def Attach(*args, **kwargs):
8516 """Attach(self, wxFrame frame)"""
8517 return _core_.MenuBar_Attach(*args, **kwargs)
8518
8519 def Detach(*args, **kwargs):
8520 """Detach(self)"""
8521 return _core_.MenuBar_Detach(*args, **kwargs)
8522
8523
8524class MenuBarPtr(MenuBar):
8525 def __init__(self, this):
8526 self.this = this
8527 if not hasattr(self,"thisown"): self.thisown = 0
8528 self.__class__ = MenuBar
8529_core_.MenuBar_swigregister(MenuBarPtr)
8530
8531#---------------------------------------------------------------------------
8532
8533class MenuItem(Object):
36ed4f51 8534 """Proxy of C++ MenuItem class"""
d55e5bfc
RD
8535 def __repr__(self):
8536 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8537 def __init__(self, *args, **kwargs):
8538 """
8539 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
8540 String help=EmptyString, int kind=ITEM_NORMAL,
8541 Menu subMenu=None) -> MenuItem
8542 """
8543 newobj = _core_.new_MenuItem(*args, **kwargs)
8544 self.this = newobj.this
8545 self.thisown = 1
8546 del newobj.thisown
8547 def GetMenu(*args, **kwargs):
8548 """GetMenu(self) -> Menu"""
8549 return _core_.MenuItem_GetMenu(*args, **kwargs)
8550
8551 def SetMenu(*args, **kwargs):
8552 """SetMenu(self, Menu menu)"""
8553 return _core_.MenuItem_SetMenu(*args, **kwargs)
8554
8555 def SetId(*args, **kwargs):
8556 """SetId(self, int id)"""
8557 return _core_.MenuItem_SetId(*args, **kwargs)
8558
8559 def GetId(*args, **kwargs):
8560 """GetId(self) -> int"""
8561 return _core_.MenuItem_GetId(*args, **kwargs)
8562
8563 def IsSeparator(*args, **kwargs):
8564 """IsSeparator(self) -> bool"""
8565 return _core_.MenuItem_IsSeparator(*args, **kwargs)
8566
8567 def SetText(*args, **kwargs):
8568 """SetText(self, String str)"""
8569 return _core_.MenuItem_SetText(*args, **kwargs)
8570
8571 def GetLabel(*args, **kwargs):
8572 """GetLabel(self) -> String"""
8573 return _core_.MenuItem_GetLabel(*args, **kwargs)
8574
8575 def GetText(*args, **kwargs):
8576 """GetText(self) -> String"""
8577 return _core_.MenuItem_GetText(*args, **kwargs)
8578
8579 def GetLabelFromText(*args, **kwargs):
d6c14a4c 8580 """GetLabelFromText(String text) -> String"""
d55e5bfc
RD
8581 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8582
8583 GetLabelFromText = staticmethod(GetLabelFromText)
8584 def GetKind(*args, **kwargs):
8585 """GetKind(self) -> int"""
8586 return _core_.MenuItem_GetKind(*args, **kwargs)
8587
8588 def SetKind(*args, **kwargs):
8589 """SetKind(self, int kind)"""
8590 return _core_.MenuItem_SetKind(*args, **kwargs)
8591
8592 def SetCheckable(*args, **kwargs):
8593 """SetCheckable(self, bool checkable)"""
8594 return _core_.MenuItem_SetCheckable(*args, **kwargs)
8595
8596 def IsCheckable(*args, **kwargs):
8597 """IsCheckable(self) -> bool"""
8598 return _core_.MenuItem_IsCheckable(*args, **kwargs)
8599
8600 def IsSubMenu(*args, **kwargs):
8601 """IsSubMenu(self) -> bool"""
8602 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
8603
8604 def SetSubMenu(*args, **kwargs):
8605 """SetSubMenu(self, Menu menu)"""
8606 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
8607
8608 def GetSubMenu(*args, **kwargs):
8609 """GetSubMenu(self) -> Menu"""
8610 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
8611
8612 def Enable(*args, **kwargs):
8613 """Enable(self, bool enable=True)"""
8614 return _core_.MenuItem_Enable(*args, **kwargs)
8615
8616 def IsEnabled(*args, **kwargs):
8617 """IsEnabled(self) -> bool"""
8618 return _core_.MenuItem_IsEnabled(*args, **kwargs)
8619
8620 def Check(*args, **kwargs):
8621 """Check(self, bool check=True)"""
8622 return _core_.MenuItem_Check(*args, **kwargs)
8623
8624 def IsChecked(*args, **kwargs):
8625 """IsChecked(self) -> bool"""
8626 return _core_.MenuItem_IsChecked(*args, **kwargs)
8627
8628 def Toggle(*args, **kwargs):
8629 """Toggle(self)"""
8630 return _core_.MenuItem_Toggle(*args, **kwargs)
8631
8632 def SetHelp(*args, **kwargs):
8633 """SetHelp(self, String str)"""
8634 return _core_.MenuItem_SetHelp(*args, **kwargs)
8635
8636 def GetHelp(*args, **kwargs):
8637 """GetHelp(self) -> String"""
8638 return _core_.MenuItem_GetHelp(*args, **kwargs)
8639
8640 def GetAccel(*args, **kwargs):
8641 """GetAccel(self) -> AcceleratorEntry"""
8642 return _core_.MenuItem_GetAccel(*args, **kwargs)
8643
8644 def SetAccel(*args, **kwargs):
8645 """SetAccel(self, AcceleratorEntry accel)"""
8646 return _core_.MenuItem_SetAccel(*args, **kwargs)
8647
8648 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 8649 """GetDefaultMarginWidth() -> int"""
d55e5bfc
RD
8650 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8651
8652 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
8653 def SetBitmap(*args, **kwargs):
8654 """SetBitmap(self, Bitmap bitmap)"""
8655 return _core_.MenuItem_SetBitmap(*args, **kwargs)
8656
8657 def GetBitmap(*args, **kwargs):
8658 """GetBitmap(self) -> Bitmap"""
8659 return _core_.MenuItem_GetBitmap(*args, **kwargs)
8660
8661
8662class MenuItemPtr(MenuItem):
8663 def __init__(self, this):
8664 self.this = this
8665 if not hasattr(self,"thisown"): self.thisown = 0
8666 self.__class__ = MenuItem
8667_core_.MenuItem_swigregister(MenuItemPtr)
8668
8669def MenuItem_GetLabelFromText(*args, **kwargs):
8670 """MenuItem_GetLabelFromText(String text) -> String"""
8671 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8672
8673def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8674 """MenuItem_GetDefaultMarginWidth() -> int"""
8675 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8676
8677#---------------------------------------------------------------------------
8678
8679class Control(Window):
8680 """
8681 This is the base class for a control or 'widget'.
8682
15817c7e
RD
8683 A control is generally a small window which processes user input
8684 and/or displays one or more item of data.
d55e5bfc
RD
8685 """
8686 def __repr__(self):
8687 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8688 def __init__(self, *args, **kwargs):
8689 """
bfddbb17
RD
8690 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8691 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
8692 String name=ControlNameStr) -> Control
8693
15817c7e
RD
8694 Create a Control. Normally you should only call this from a subclass'
8695 __init__ as a plain old wx.Control is not very useful.
d55e5bfc
RD
8696 """
8697 newobj = _core_.new_Control(*args, **kwargs)
8698 self.this = newobj.this
8699 self.thisown = 1
8700 del newobj.thisown
8701 self._setOORInfo(self)
8702
8703 def Create(*args, **kwargs):
8704 """
bfddbb17
RD
8705 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8706 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
8707 String name=ControlNameStr) -> bool
8708
8709 Do the 2nd phase and create the GUI control.
8710 """
8711 return _core_.Control_Create(*args, **kwargs)
8712
8713 def Command(*args, **kwargs):
8714 """
8715 Command(self, CommandEvent event)
8716
15817c7e
RD
8717 Simulates the effect of the user issuing a command to the item.
8718
8719 :see: `wx.CommandEvent`
8720
d55e5bfc
RD
8721 """
8722 return _core_.Control_Command(*args, **kwargs)
8723
8724 def GetLabel(*args, **kwargs):
8725 """
8726 GetLabel(self) -> String
8727
8728 Return a control's text.
8729 """
8730 return _core_.Control_GetLabel(*args, **kwargs)
8731
8732 def SetLabel(*args, **kwargs):
8733 """
8734 SetLabel(self, String label)
8735
8736 Sets the item's text.
8737 """
8738 return _core_.Control_SetLabel(*args, **kwargs)
8739
8740 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
8741 """
8742 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8743
8744 Get the default attributes for this class. This is useful if you want
8745 to use the same font or colour in your own control as in a standard
8746 control -- which is a much better idea than hard coding specific
8747 colours or fonts which might look completely out of place on the
8748 user's system, especially if it uses themes.
8749
8750 The variant parameter is only relevant under Mac currently and is
8751 ignore under other platforms. Under Mac, it will change the size of
8752 the returned font. See `wx.Window.SetWindowVariant` for more about
8753 this.
8754 """
d55e5bfc
RD
8755 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8756
8757 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8758
8759class ControlPtr(Control):
8760 def __init__(self, this):
8761 self.this = this
8762 if not hasattr(self,"thisown"): self.thisown = 0
8763 self.__class__ = Control
8764_core_.Control_swigregister(ControlPtr)
8765ControlNameStr = cvar.ControlNameStr
8766
8767def PreControl(*args, **kwargs):
8768 """
8769 PreControl() -> Control
8770
8771 Precreate a Control control for 2-phase creation
8772 """
8773 val = _core_.new_PreControl(*args, **kwargs)
8774 val.thisown = 1
8775 return val
8776
8777def Control_GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
8778 """
8779 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8780
8781 Get the default attributes for this class. This is useful if you want
8782 to use the same font or colour in your own control as in a standard
8783 control -- which is a much better idea than hard coding specific
8784 colours or fonts which might look completely out of place on the
8785 user's system, especially if it uses themes.
8786
8787 The variant parameter is only relevant under Mac currently and is
8788 ignore under other platforms. Under Mac, it will change the size of
8789 the returned font. See `wx.Window.SetWindowVariant` for more about
8790 this.
8791 """
d55e5bfc
RD
8792 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8793
8794#---------------------------------------------------------------------------
8795
8796class ItemContainer(object):
8797 """
8798 wx.ItemContainer defines an interface which is implemented by all
15817c7e
RD
8799 controls which have string subitems, each of which may be selected,
8800 such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well as
8801 `wx.ComboBox` which implements an extended interface deriving from
8802 this one.
d55e5bfc 8803
15817c7e
RD
8804 It defines the methods for accessing the control's items and although
8805 each of the derived classes implements them differently, they still
8806 all conform to the same interface.
d55e5bfc 8807
15817c7e
RD
8808 The items in a wx.ItemContainer have (non empty) string labels and,
8809 optionally, client data associated with them.
d55e5bfc
RD
8810
8811 """
8812 def __init__(self): raise RuntimeError, "No constructor defined"
8813 def __repr__(self):
8814 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8815 def Append(*args, **kwargs):
8816 """
8817 Append(self, String item, PyObject clientData=None) -> int
8818
15817c7e
RD
8819 Adds the item to the control, associating the given data with the item
8820 if not None. The return value is the index of the newly added item
8821 which may be different from the last one if the control is sorted (e.g.
8822 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc
RD
8823 """
8824 return _core_.ItemContainer_Append(*args, **kwargs)
8825
8826 def AppendItems(*args, **kwargs):
8827 """
f5b96ee1 8828 AppendItems(self, List strings)
d55e5bfc 8829
15817c7e
RD
8830 Apend several items at once to the control. Notice that calling this
8831 method may be much faster than appending the items one by one if you
8832 need to add a lot of items.
d55e5bfc
RD
8833 """
8834 return _core_.ItemContainer_AppendItems(*args, **kwargs)
8835
8836 def Insert(*args, **kwargs):
8837 """
8838 Insert(self, String item, int pos, PyObject clientData=None) -> int
8839
15817c7e 8840 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
8841 optionally associating some data object with the item.
8842 """
8843 return _core_.ItemContainer_Insert(*args, **kwargs)
8844
8845 def Clear(*args, **kwargs):
8846 """
8847 Clear(self)
8848
8849 Removes all items from the control.
8850 """
8851 return _core_.ItemContainer_Clear(*args, **kwargs)
8852
8853 def Delete(*args, **kwargs):
8854 """
8855 Delete(self, int n)
8856
15817c7e
RD
8857 Deletes the item at the zero-based index 'n' from the control. Note
8858 that it is an error (signalled by a `wx.PyAssertionError` exception if
8859 enabled) to remove an item with the index negative or greater or equal
8860 than the number of items in the control.
d55e5bfc
RD
8861 """
8862 return _core_.ItemContainer_Delete(*args, **kwargs)
8863
8864 def GetCount(*args, **kwargs):
8865 """
8866 GetCount(self) -> int
8867
8868 Returns the number of items in the control.
8869 """
8870 return _core_.ItemContainer_GetCount(*args, **kwargs)
8871
8872 def IsEmpty(*args, **kwargs):
8873 """
8874 IsEmpty(self) -> bool
8875
8876 Returns True if the control is empty or False if it has some items.
8877 """
8878 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
8879
8880 def GetString(*args, **kwargs):
8881 """
8882 GetString(self, int n) -> String
8883
8884 Returns the label of the item with the given index.
8885 """
8886 return _core_.ItemContainer_GetString(*args, **kwargs)
8887
8888 def GetStrings(*args, **kwargs):
8889 """GetStrings(self) -> wxArrayString"""
8890 return _core_.ItemContainer_GetStrings(*args, **kwargs)
8891
8892 def SetString(*args, **kwargs):
8893 """
8894 SetString(self, int n, String s)
8895
8896 Sets the label for the given item.
8897 """
8898 return _core_.ItemContainer_SetString(*args, **kwargs)
8899
8900 def FindString(*args, **kwargs):
8901 """
8902 FindString(self, String s) -> int
8903
8904 Finds an item whose label matches the given string. Returns the
15817c7e
RD
8905 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
8906 found.
d55e5bfc
RD
8907 """
8908 return _core_.ItemContainer_FindString(*args, **kwargs)
8909
8910 def Select(*args, **kwargs):
8911 """
8912 Select(self, int n)
8913
8914 Sets the item at index 'n' to be the selected item.
8915 """
8916 return _core_.ItemContainer_Select(*args, **kwargs)
8917
8918 SetSelection = Select
8919 def GetSelection(*args, **kwargs):
8920 """
8921 GetSelection(self) -> int
8922
15817c7e
RD
8923 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
8924 is selected.
d55e5bfc
RD
8925 """
8926 return _core_.ItemContainer_GetSelection(*args, **kwargs)
8927
8928 def GetStringSelection(*args, **kwargs):
8929 """
8930 GetStringSelection(self) -> String
8931
15817c7e
RD
8932 Returns the label of the selected item or an empty string if no item
8933 is selected.
d55e5bfc
RD
8934 """
8935 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
8936
8937 def GetClientData(*args, **kwargs):
8938 """
8939 GetClientData(self, int n) -> PyObject
8940
8941 Returns the client data associated with the given item, (if any.)
8942 """
8943 return _core_.ItemContainer_GetClientData(*args, **kwargs)
8944
8945 def SetClientData(*args, **kwargs):
8946 """
8947 SetClientData(self, int n, PyObject clientData)
8948
8949 Associate the given client data with the item at position n.
8950 """
8951 return _core_.ItemContainer_SetClientData(*args, **kwargs)
8952
8953
8954class ItemContainerPtr(ItemContainer):
8955 def __init__(self, this):
8956 self.this = this
8957 if not hasattr(self,"thisown"): self.thisown = 0
8958 self.__class__ = ItemContainer
8959_core_.ItemContainer_swigregister(ItemContainerPtr)
8960
8961#---------------------------------------------------------------------------
8962
8963class ControlWithItems(Control,ItemContainer):
8964 """
15817c7e
RD
8965 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
8966 wx.Control class, and is used for the base class of various controls
8967 that have items.
d55e5bfc
RD
8968 """
8969 def __init__(self): raise RuntimeError, "No constructor defined"
8970 def __repr__(self):
8971 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8972
8973class ControlWithItemsPtr(ControlWithItems):
8974 def __init__(self, this):
8975 self.this = this
8976 if not hasattr(self,"thisown"): self.thisown = 0
8977 self.__class__ = ControlWithItems
8978_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
8979
8980#---------------------------------------------------------------------------
8981
8982class SizerItem(Object):
bfddbb17
RD
8983 """
8984 The wx.SizerItem class is used to track the position, size and other
8985 attributes of each item managed by a `wx.Sizer`. In normal usage user
8986 code should never need to deal directly with a wx.SizerItem, but
8987 custom classes derived from `wx.PySizer` will probably need to use the
8988 collection of wx.SizerItems held by wx.Sizer when calculating layout.
8989
8990 :see: `wx.Sizer`, `wx.GBSizerItem`
8991 """
d55e5bfc
RD
8992 def __repr__(self):
8993 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8994 def __init__(self, *args, **kwargs):
bfddbb17
RD
8995 """
8996 __init__(self) -> SizerItem
8997
8998 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
8999 size will need to be set before this item can be used in a Sizer.
9000
9001 You will probably never need to create a wx.SizerItem directly as they
9002 are created automatically when the sizer's Add, Insert or Prepend
9003 methods are called.
9004
9005 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
9006 """
d55e5bfc
RD
9007 newobj = _core_.new_SizerItem(*args, **kwargs)
9008 self.this = newobj.this
9009 self.thisown = 1
9010 del newobj.thisown
9011 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
9012 """
9013 DeleteWindows(self)
9014
9015 Destroy the window or the windows in a subsizer, depending on the type
9016 of item.
9017 """
d55e5bfc
RD
9018 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
9019
9020 def DetachSizer(*args, **kwargs):
bfddbb17
RD
9021 """
9022 DetachSizer(self)
9023
9024 Enable deleting the SizerItem without destroying the contained sizer.
9025 """
d55e5bfc
RD
9026 return _core_.SizerItem_DetachSizer(*args, **kwargs)
9027
9028 def GetSize(*args, **kwargs):
bfddbb17
RD
9029 """
9030 GetSize(self) -> Size
9031
9032 Get the current size of the item, as set in the last Layout.
9033 """
d55e5bfc
RD
9034 return _core_.SizerItem_GetSize(*args, **kwargs)
9035
9036 def CalcMin(*args, **kwargs):
bfddbb17
RD
9037 """
9038 CalcMin(self) -> Size
9039
9040 Calculates the minimum desired size for the item, including any space
9041 needed by borders.
9042 """
d55e5bfc
RD
9043 return _core_.SizerItem_CalcMin(*args, **kwargs)
9044
9045 def SetDimension(*args, **kwargs):
bfddbb17
RD
9046 """
9047 SetDimension(self, Point pos, Size size)
9048
9049 Set the position and size of the space allocated for this item by the
9050 sizer, and adjust the position and size of the item (window or
9051 subsizer) to be within that space taking alignment and borders into
9052 account.
9053 """
d55e5bfc
RD
9054 return _core_.SizerItem_SetDimension(*args, **kwargs)
9055
9056 def GetMinSize(*args, **kwargs):
bfddbb17
RD
9057 """
9058 GetMinSize(self) -> Size
9059
9060 Get the minimum size needed for the item.
9061 """
d55e5bfc
RD
9062 return _core_.SizerItem_GetMinSize(*args, **kwargs)
9063
a001823c
RD
9064 def GetMinSizeWithBorder(*args, **kwargs):
9065 """
9066 GetMinSizeWithBorder(self) -> Size
9067
9068 Get the minimum size needed for the item with space for the borders
9069 added, if needed.
9070 """
9071 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
9072
d55e5bfc
RD
9073 def SetInitSize(*args, **kwargs):
9074 """SetInitSize(self, int x, int y)"""
9075 return _core_.SizerItem_SetInitSize(*args, **kwargs)
9076
9077 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
9078 """
9079 SetRatioWH(self, int width, int height)
9080
9081 Set the ratio item attribute.
9082 """
d55e5bfc
RD
9083 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
9084
9085 def SetRatioSize(*args, **kwargs):
bfddbb17
RD
9086 """
9087 SetRatioSize(self, Size size)
9088
9089 Set the ratio item attribute.
9090 """
d55e5bfc
RD
9091 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
9092
9093 def SetRatio(*args, **kwargs):
bfddbb17
RD
9094 """
9095 SetRatio(self, float ratio)
9096
9097 Set the ratio item attribute.
9098 """
d55e5bfc
RD
9099 return _core_.SizerItem_SetRatio(*args, **kwargs)
9100
9101 def GetRatio(*args, **kwargs):
bfddbb17
RD
9102 """
9103 GetRatio(self) -> float
9104
9105 Set the ratio item attribute.
9106 """
d55e5bfc
RD
9107 return _core_.SizerItem_GetRatio(*args, **kwargs)
9108
070c48b4
RD
9109 def GetRect(*args, **kwargs):
9110 """
9111 GetRect(self) -> Rect
9112
9113 Returns the rectangle that the sizer item should occupy
9114 """
9115 return _core_.SizerItem_GetRect(*args, **kwargs)
9116
d55e5bfc 9117 def IsWindow(*args, **kwargs):
bfddbb17
RD
9118 """
9119 IsWindow(self) -> bool
9120
9121 Is this sizer item a window?
9122 """
d55e5bfc
RD
9123 return _core_.SizerItem_IsWindow(*args, **kwargs)
9124
9125 def IsSizer(*args, **kwargs):
bfddbb17
RD
9126 """
9127 IsSizer(self) -> bool
9128
9129 Is this sizer item a subsizer?
9130 """
d55e5bfc
RD
9131 return _core_.SizerItem_IsSizer(*args, **kwargs)
9132
9133 def IsSpacer(*args, **kwargs):
bfddbb17
RD
9134 """
9135 IsSpacer(self) -> bool
9136
9137 Is this sizer item a spacer?
9138 """
d55e5bfc
RD
9139 return _core_.SizerItem_IsSpacer(*args, **kwargs)
9140
9141 def SetProportion(*args, **kwargs):
bfddbb17
RD
9142 """
9143 SetProportion(self, int proportion)
9144
9145 Set the proportion value for this item.
9146 """
d55e5bfc
RD
9147 return _core_.SizerItem_SetProportion(*args, **kwargs)
9148
9149 def GetProportion(*args, **kwargs):
bfddbb17
RD
9150 """
9151 GetProportion(self) -> int
9152
9153 Get the proportion value for this item.
9154 """
d55e5bfc
RD
9155 return _core_.SizerItem_GetProportion(*args, **kwargs)
9156
bfddbb17
RD
9157 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
9158 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 9159 def SetFlag(*args, **kwargs):
bfddbb17
RD
9160 """
9161 SetFlag(self, int flag)
9162
9163 Set the flag value for this item.
9164 """
d55e5bfc
RD
9165 return _core_.SizerItem_SetFlag(*args, **kwargs)
9166
9167 def GetFlag(*args, **kwargs):
bfddbb17
RD
9168 """
9169 GetFlag(self) -> int
9170
9171 Get the flag value for this item.
9172 """
d55e5bfc
RD
9173 return _core_.SizerItem_GetFlag(*args, **kwargs)
9174
9175 def SetBorder(*args, **kwargs):
bfddbb17
RD
9176 """
9177 SetBorder(self, int border)
9178
9179 Set the border value for this item.
9180 """
d55e5bfc
RD
9181 return _core_.SizerItem_SetBorder(*args, **kwargs)
9182
9183 def GetBorder(*args, **kwargs):
bfddbb17
RD
9184 """
9185 GetBorder(self) -> int
9186
9187 Get the border value for this item.
9188 """
d55e5bfc
RD
9189 return _core_.SizerItem_GetBorder(*args, **kwargs)
9190
9191 def GetWindow(*args, **kwargs):
bfddbb17
RD
9192 """
9193 GetWindow(self) -> Window
9194
9195 Get the window (if any) that is managed by this sizer item.
9196 """
d55e5bfc
RD
9197 return _core_.SizerItem_GetWindow(*args, **kwargs)
9198
9199 def SetWindow(*args, **kwargs):
bfddbb17
RD
9200 """
9201 SetWindow(self, Window window)
9202
9203 Set the window to be managed by this sizer item.
9204 """
d55e5bfc
RD
9205 return _core_.SizerItem_SetWindow(*args, **kwargs)
9206
9207 def GetSizer(*args, **kwargs):
bfddbb17
RD
9208 """
9209 GetSizer(self) -> Sizer
9210
9211 Get the subsizer (if any) that is managed by this sizer item.
9212 """
d55e5bfc
RD
9213 return _core_.SizerItem_GetSizer(*args, **kwargs)
9214
9215 def SetSizer(*args, **kwargs):
bfddbb17
RD
9216 """
9217 SetSizer(self, Sizer sizer)
9218
9219 Set the subsizer to be managed by this sizer item.
9220 """
d55e5bfc
RD
9221 return _core_.SizerItem_SetSizer(*args, **kwargs)
9222
9223 def GetSpacer(*args, **kwargs):
bfddbb17
RD
9224 """
9225 GetSpacer(self) -> Size
9226
9227 Get the size of the spacer managed by this sizer item.
9228 """
d55e5bfc
RD
9229 return _core_.SizerItem_GetSpacer(*args, **kwargs)
9230
9231 def SetSpacer(*args, **kwargs):
bfddbb17
RD
9232 """
9233 SetSpacer(self, Size size)
9234
9235 Set the size of the spacer to be managed by this sizer item.
9236 """
d55e5bfc
RD
9237 return _core_.SizerItem_SetSpacer(*args, **kwargs)
9238
9239 def Show(*args, **kwargs):
bfddbb17
RD
9240 """
9241 Show(self, bool show)
9242
9243 Set the show item attribute, which sizers use to determine if the item
9244 is to be made part of the layout or not. If the item is tracking a
9245 window then it is shown or hidden as needed.
9246 """
d55e5bfc
RD
9247 return _core_.SizerItem_Show(*args, **kwargs)
9248
9249 def IsShown(*args, **kwargs):
bfddbb17
RD
9250 """
9251 IsShown(self) -> bool
9252
9253 Is the item to be shown in the layout?
9254 """
d55e5bfc
RD
9255 return _core_.SizerItem_IsShown(*args, **kwargs)
9256
9257 def GetPosition(*args, **kwargs):
bfddbb17
RD
9258 """
9259 GetPosition(self) -> Point
9260
9261 Returns the current position of the item, as set in the last Layout.
9262 """
d55e5bfc
RD
9263 return _core_.SizerItem_GetPosition(*args, **kwargs)
9264
9265 def GetUserData(*args, **kwargs):
bfddbb17
RD
9266 """
9267 GetUserData(self) -> PyObject
9268
9269 Returns the userData associated with this sizer item, or None if there
9270 isn't any.
9271 """
d55e5bfc
RD
9272 return _core_.SizerItem_GetUserData(*args, **kwargs)
9273
9274
9275class SizerItemPtr(SizerItem):
9276 def __init__(self, this):
9277 self.this = this
9278 if not hasattr(self,"thisown"): self.thisown = 0
9279 self.__class__ = SizerItem
9280_core_.SizerItem_swigregister(SizerItemPtr)
9281
bfddbb17 9282def SizerItemWindow(*args, **kwargs):
d55e5bfc 9283 """
bfddbb17
RD
9284 SizerItemWindow(Window window, int proportion, int flag, int border,
9285 PyObject userData=None) -> SizerItem
9286
9287 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 9288 """
bfddbb17 9289 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
9290 val.thisown = 1
9291 return val
9292
bfddbb17 9293def SizerItemSpacer(*args, **kwargs):
d55e5bfc 9294 """
bfddbb17
RD
9295 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
9296 PyObject userData=None) -> SizerItem
9297
9298 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 9299 """
bfddbb17 9300 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
9301 val.thisown = 1
9302 return val
9303
9304def SizerItemSizer(*args, **kwargs):
9305 """
9306 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
bfddbb17
RD
9307 PyObject userData=None) -> SizerItem
9308
9309 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc
RD
9310 """
9311 val = _core_.new_SizerItemSizer(*args, **kwargs)
9312 val.thisown = 1
9313 return val
9314
9315class Sizer(Object):
bfddbb17
RD
9316 """
9317 wx.Sizer is the abstract base class used for laying out subwindows in
9318 a window. You cannot use wx.Sizer directly; instead, you will have to
9319 use one of the sizer classes derived from it such as `wx.BoxSizer`,
9320 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
9321 and `wx.GridBagSizer`.
9322
9323 The concept implemented by sizers in wxWidgets is closely related to
9324 layout tools in other GUI toolkits, such as Java's AWT, the GTK
9325 toolkit or the Qt toolkit. It is based upon the idea of the individual
9326 subwindows reporting their minimal required size and their ability to
9327 get stretched if the size of the parent window has changed. This will
9328 most often mean that the programmer does not set the original size of
9329 a dialog in the beginning, rather the dialog will assigned a sizer and
9330 this sizer will be queried about the recommended size. The sizer in
9331 turn will query its children, which can be normal windows or contorls,
9332 empty space or other sizers, so that a hierarchy of sizers can be
9333 constructed. Note that wxSizer does not derive from wxWindow and thus
9334 do not interfere with tab ordering and requires very little resources
9335 compared to a real window on screen.
9336
9337 What makes sizers so well fitted for use in wxWidgets is the fact that
9338 every control reports its own minimal size and the algorithm can
9339 handle differences in font sizes or different window (dialog item)
9340 sizes on different platforms without problems. If for example the
9341 standard font as well as the overall design of Mac widgets requires
9342 more space than on Windows, then the initial size of a dialog using a
9343 sizer will automatically be bigger on Mac than on Windows.
9344 """
d55e5bfc
RD
9345 def __init__(self): raise RuntimeError, "No constructor defined"
9346 def __repr__(self):
9347 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9348 def _setOORInfo(*args, **kwargs):
9349 """_setOORInfo(self, PyObject _self)"""
9350 return _core_.Sizer__setOORInfo(*args, **kwargs)
9351
9352 def Add(*args, **kwargs):
9353 """
bfddbb17 9354 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 9355 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
9356
9357 Appends a child item to the sizer.
d55e5bfc
RD
9358 """
9359 return _core_.Sizer_Add(*args, **kwargs)
9360
9361 def Insert(*args, **kwargs):
9362 """
bfddbb17 9363 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 9364 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
9365
9366 Inserts a new item into the list of items managed by this sizer before
9367 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc
RD
9368 """
9369 return _core_.Sizer_Insert(*args, **kwargs)
9370
9371 def Prepend(*args, **kwargs):
9372 """
bfddbb17 9373 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 9374 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
9375
9376 Adds a new item to the begining of the list of sizer items managed by
9377 this sizer. See `Add` for a description of the parameters.
d55e5bfc
RD
9378 """
9379 return _core_.Sizer_Prepend(*args, **kwargs)
9380
9381 def Remove(*args, **kwargs):
bfddbb17
RD
9382 """
9383 Remove(self, item) -> bool
9384
9385 Removes an item from the sizer and destroys it. This method does not
9386 cause any layout or resizing to take place, call `Layout` to update
9387 the layout on screen after removing a child from the sizer. The
9388 *item* parameter can be either a window, a sizer, or the zero-based
9389 index of an item to remove. Returns True if the child item was found
9390 and removed.
9391 """
d55e5bfc
RD
9392 return _core_.Sizer_Remove(*args, **kwargs)
9393
1a6bba1e 9394 def Detach(*args, **kwargs):
bfddbb17
RD
9395 """
9396 Detach(self, item) -> bool
9397
9398 Detaches an item from the sizer without destroying it. This method
9399 does not cause any layout or resizing to take place, call `Layout` to
9400 do so. The *item* parameter can be either a window, a sizer, or the
9401 zero-based index of the item to be detached. Returns True if the child item
9402 was found and detached.
9403 """
1a6bba1e
RD
9404 return _core_.Sizer_Detach(*args, **kwargs)
9405
070c48b4
RD
9406 def GetItem(*args, **kwargs):
9407 """
9408 GetItem(self, item) -> wx.SizerItem
9409
9410 Returns the `wx.SizerItem` which holds the *item* given. The *item*
9411 parameter can be either a window, a sizer, or the zero-based index of
9412 the item to be detached.
9413 """
9414 return _core_.Sizer_GetItem(*args, **kwargs)
9415
d55e5bfc
RD
9416 def _SetItemMinSize(*args, **kwargs):
9417 """_SetItemMinSize(self, PyObject item, Size size)"""
9418 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
9419
bfddbb17
RD
9420 def SetItemMinSize(self, item, *args):
9421 """
9422 SetItemMinSize(self, item, Size size)
9423
9424 Sets the minimum size that will be allocated for an item in the sizer.
9425 The *item* parameter can be either a window, a sizer, or the
9426 zero-based index of the item. If a window or sizer is given then it
9427 will be searched for recursivly in subsizers if neccessary.
9428 """
9429 if len(args) == 2:
9430 # for backward compatibility accept separate width,height args too
9431 return self._SetItemMinSize(item, args)
9432 else:
9433 return self._SetItemMinSize(item, args[0])
9434
d55e5bfc 9435 def AddItem(*args, **kwargs):
bfddbb17
RD
9436 """
9437 AddItem(self, SizerItem item)
9438
9439 Adds a `wx.SizerItem` to the sizer.
9440 """
d55e5bfc
RD
9441 return _core_.Sizer_AddItem(*args, **kwargs)
9442
9443 def InsertItem(*args, **kwargs):
bfddbb17
RD
9444 """
9445 InsertItem(self, int index, SizerItem item)
9446
9447 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
9448 """
d55e5bfc
RD
9449 return _core_.Sizer_InsertItem(*args, **kwargs)
9450
9451 def PrependItem(*args, **kwargs):
bfddbb17
RD
9452 """
9453 PrependItem(self, SizerItem item)
9454
9455 Prepends a `wx.SizerItem` to the sizer.
9456 """
d55e5bfc
RD
9457 return _core_.Sizer_PrependItem(*args, **kwargs)
9458
bfddbb17 9459 def AddMany(self, items):
d6c14a4c
RD
9460 """
9461 AddMany is a convenience method for adding several items
9462 to a sizer at one time. Simply pass it a list of tuples,
9463 where each tuple consists of the parameters that you
9464 would normally pass to the `Add` method.
9465 """
bfddbb17
RD
9466 for item in items:
9467 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
9468 item = (item, )
9469 self.Add(*item)
d55e5bfc
RD
9470
9471 # for backwards compatibility only, please do not use in new code
d6c14a4c
RD
9472 AddWindow = wx._deprecated(Add, "AddWindow is deprecated, use `Add` instead.")
9473 AddSizer = wx._deprecated(Add, "AddSizer is deprecated, use `Add` instead.")
9474 AddSpacer = wx._deprecated(Add, "AddSpacer is deprecated, use `Add` instead.")
9475 PrependWindow = wx._deprecated(Prepend, "PrependWindow is deprecated, use `Prepend` instead.")
9476 PrependSizer = wx._deprecated(Prepend, "PrependSizer is deprecated, use `Prepend` instead.")
9477 PrependSpacer = wx._deprecated(Prepend, "PrependSpacer is deprecated, use `Prepend` instead.")
9478 InsertWindow = wx._deprecated(Insert, "InsertWindow is deprecated, use `Insert` instead.")
9479 InsertSizer = wx._deprecated(Insert, "InsertSizer is deprecated, use `Insert` instead.")
9480 InsertSpacer = wx._deprecated(Insert, "InsertSpacer is deprecated, use `Insert` instead.")
9481 RemoveWindow = wx._deprecated(Remove, "RemoveWindow is deprecated, use `Remove` instead.")
9482 RemoveSizer = wx._deprecated(Remove, "RemoveSizer is deprecated, use `Remove` instead.")
9483 RemovePos = wx._deprecated(Remove, "RemovePos is deprecated, use `Remove` instead.")
d55e5bfc
RD
9484
9485
d55e5bfc 9486 def SetDimension(*args, **kwargs):
bfddbb17
RD
9487 """
9488 SetDimension(self, int x, int y, int width, int height)
9489
9490 Call this to force the sizer to take the given dimension and thus
9491 force the items owned by the sizer to resize themselves according to
9492 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
9493 methods.
9494 """
d55e5bfc
RD
9495 return _core_.Sizer_SetDimension(*args, **kwargs)
9496
9497 def SetMinSize(*args, **kwargs):
bfddbb17
RD
9498 """
9499 SetMinSize(self, Size size)
9500
9501 Call this to give the sizer a minimal size. Normally, the sizer will
9502 calculate its minimal size based purely on how much space its children
9503 need. After calling this method `GetMinSize` will return either the
9504 minimal size as requested by its children or the minimal size set
9505 here, depending on which is bigger.
9506 """
d55e5bfc
RD
9507 return _core_.Sizer_SetMinSize(*args, **kwargs)
9508
9509 def GetSize(*args, **kwargs):
bfddbb17
RD
9510 """
9511 GetSize(self) -> Size
9512
9513 Returns the current size of the space managed by the sizer.
9514 """
d55e5bfc
RD
9515 return _core_.Sizer_GetSize(*args, **kwargs)
9516
9517 def GetPosition(*args, **kwargs):
bfddbb17
RD
9518 """
9519 GetPosition(self) -> Point
9520
9521 Returns the current position of the sizer's managed space.
9522 """
d55e5bfc
RD
9523 return _core_.Sizer_GetPosition(*args, **kwargs)
9524
9525 def GetMinSize(*args, **kwargs):
bfddbb17
RD
9526 """
9527 GetMinSize(self) -> Size
9528
9529 Returns the minimal size of the sizer. This is either the combined
9530 minimal size of all the children and their borders or the minimal size
9531 set by SetMinSize, depending on which is bigger.
9532 """
d55e5bfc
RD
9533 return _core_.Sizer_GetMinSize(*args, **kwargs)
9534
9535 def GetSizeTuple(self):
1a6bba1e 9536 return self.GetSize().Get()
d55e5bfc 9537 def GetPositionTuple(self):
1a6bba1e 9538 return self.GetPosition().Get()
d55e5bfc 9539 def GetMinSizeTuple(self):
1a6bba1e 9540 return self.GetMinSize().Get()
d55e5bfc
RD
9541
9542 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
9543 """
9544 RecalcSizes(self)
9545
9546 Using the sizes calculated by `CalcMin` reposition and resize all the
9547 items managed by this sizer. You should not need to call this directly as
9548 it is called by `Layout`.
9549 """
d55e5bfc
RD
9550 return _core_.Sizer_RecalcSizes(*args, **kwargs)
9551
9552 def CalcMin(*args, **kwargs):
bfddbb17
RD
9553 """
9554 CalcMin(self) -> Size
9555
9556 This method is where the sizer will do the actual calculation of its
9557 children's minimal sizes. You should not need to call this directly as
9558 it is called by `Layout`.
9559 """
d55e5bfc
RD
9560 return _core_.Sizer_CalcMin(*args, **kwargs)
9561
9562 def Layout(*args, **kwargs):
bfddbb17
RD
9563 """
9564 Layout(self)
9565
9566 This method will force the recalculation and layout of the items
9567 controlled by the sizer using the current space allocated to the
9568 sizer. Normally this is called automatically from the owning window's
9569 EVT_SIZE handler, but it is also useful to call it from user code when
9570 one of the items in a sizer change size, or items are added or
9571 removed.
9572 """
d55e5bfc
RD
9573 return _core_.Sizer_Layout(*args, **kwargs)
9574
9575 def Fit(*args, **kwargs):
bfddbb17
RD
9576 """
9577 Fit(self, Window window) -> Size
9578
9579 Tell the sizer to resize the *window* to match the sizer's minimal
9580 size. This is commonly done in the constructor of the window itself in
9581 order to set its initial size to match the needs of the children as
9582 determined by the sizer. Returns the new size.
9583
9584 For a top level window this is the total window size, not the client size.
9585 """
d55e5bfc
RD
9586 return _core_.Sizer_Fit(*args, **kwargs)
9587
9588 def FitInside(*args, **kwargs):
bfddbb17
RD
9589 """
9590 FitInside(self, Window window)
9591
9592 Tell the sizer to resize the *virtual size* of the *window* to match the
9593 sizer's minimal size. This will not alter the on screen size of the
9594 window, but may cause the addition/removal/alteration of scrollbars
9595 required to view the virtual area in windows which manage it.
9596
9597 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9598
9599 """
d55e5bfc
RD
9600 return _core_.Sizer_FitInside(*args, **kwargs)
9601
9602 def SetSizeHints(*args, **kwargs):
bfddbb17
RD
9603 """
9604 SetSizeHints(self, Window window)
9605
9606 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9607 match the sizer's minimal size. This is commonly done in the
9608 constructor of the window itself if the window is resizable (as are
9609 many dialogs under Unix and frames on probably all platforms) in order
9610 to prevent the window from being sized smaller than the minimal size
9611 required by the sizer.
9612 """
d55e5bfc
RD
9613 return _core_.Sizer_SetSizeHints(*args, **kwargs)
9614
9615 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17
RD
9616 """
9617 SetVirtualSizeHints(self, Window window)
9618
9619 Tell the sizer to set the minimal size of the window virtual area to
9620 match the sizer's minimal size. For windows with managed scrollbars
9621 this will set them appropriately.
9622
9623 :see: `wx.ScrolledWindow.SetScrollbars`
9624
9625 """
d55e5bfc
RD
9626 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
9627
9628 def Clear(*args, **kwargs):
bfddbb17
RD
9629 """
9630 Clear(self, bool deleteWindows=False)
9631
9632 Clear all items from the sizer, optionally destroying the window items
9633 as well.
9634 """
d55e5bfc
RD
9635 return _core_.Sizer_Clear(*args, **kwargs)
9636
9637 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
9638 """
9639 DeleteWindows(self)
9640
9641 Destroy all windows managed by the sizer.
9642 """
d55e5bfc
RD
9643 return _core_.Sizer_DeleteWindows(*args, **kwargs)
9644
9645 def GetChildren(*args, **kwargs):
bfddbb17 9646 """
51b83b37 9647 GetChildren(self) -> list
bfddbb17
RD
9648
9649 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9650 """
d55e5bfc
RD
9651 return _core_.Sizer_GetChildren(*args, **kwargs)
9652
9653 def Show(*args, **kwargs):
bfddbb17 9654 """
b411df4a 9655 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 9656
bfddbb17
RD
9657 Shows or hides an item managed by the sizer. To make a sizer item
9658 disappear or reappear, use Show followed by `Layout`. The *item*
9659 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
9660 the item. Use the recursive parameter to show or hide an item in a
9661 subsizer. Returns True if the item was found.
bfddbb17
RD
9662 """
9663 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
9664
9665 def IsShown(*args, **kwargs):
bfddbb17
RD
9666 """
9667 IsShown(self, item)
9668
9669 Determines if the item is currently shown. sizer. To make a sizer
9670 item disappear or reappear, use Show followed by `Layout`. The *item*
9671 parameter can be either a window, a sizer, or the zero-based index of
9672 the item.
9673 """
d55e5bfc
RD
9674 return _core_.Sizer_IsShown(*args, **kwargs)
9675
629e65c2 9676 def Hide(self, item, recursive=False):
bfddbb17 9677 """
629e65c2 9678 A convenience method for Show(item, False, recursive).
bfddbb17 9679 """
06759a38 9680 return self.Show(item, False, recursive)
bfddbb17 9681
d55e5bfc 9682 def ShowItems(*args, **kwargs):
bfddbb17
RD
9683 """
9684 ShowItems(self, bool show)
9685
84f85550 9686 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 9687 """
d55e5bfc
RD
9688 return _core_.Sizer_ShowItems(*args, **kwargs)
9689
9690
9691class SizerPtr(Sizer):
9692 def __init__(self, this):
9693 self.this = this
9694 if not hasattr(self,"thisown"): self.thisown = 0
9695 self.__class__ = Sizer
9696_core_.Sizer_swigregister(SizerPtr)
9697
9698class PySizer(Sizer):
bfddbb17
RD
9699 """
9700 wx.PySizer is a special version of `wx.Sizer` that has been
9701 instrumented to allow the C++ virtual methods to be overloaded in
9702 Python derived classes. You would derive from this class if you are
9703 wanting to implement a custom sizer in Python code. Simply implement
9704 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
9705 For example::
9706
9707 class MySizer(wx.PySizer):
9708 def __init__(self):
9709 wx.PySizer.__init__(self)
9710
9711 def CalcMin(self):
9712 for item in self.GetChildren():
9713 # calculate the total minimum width and height needed
9714 # by all items in the sizer according to this sizer's
9715 # layout algorithm.
9716 ...
9717 return wx.Size(width, height)
9718
9719 def RecalcSizes(self):
9720 # find the space allotted to this sizer
9721 pos = self.GetPosition()
9722 size = self.GetSize()
9723 for item in self.GetChildren():
9724 # Recalculate (if necessary) the position and size of
9725 # each item and then call item.SetDimension to do the
9726 # actual positioning and sizing of the items within the
9727 # space alloted to this sizer.
9728 ...
9729 item.SetDimension(itemPos, itemSize)
9730
9731
9732 When `Layout` is called it first calls `CalcMin` followed by
9733 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 9734 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
9735
9736 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
9737
9738
9739 """
d55e5bfc
RD
9740 def __repr__(self):
9741 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9742 def __init__(self, *args, **kwargs):
bfddbb17
RD
9743 """
9744 __init__(self) -> PySizer
9745
9746 Creates a wx.PySizer. Must be called from the __init__ in the derived
9747 class.
9748 """
d55e5bfc
RD
9749 newobj = _core_.new_PySizer(*args, **kwargs)
9750 self.this = newobj.this
9751 self.thisown = 1
9752 del newobj.thisown
9753 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
9754
9755 def _setCallbackInfo(*args, **kwargs):
9756 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
9757 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
9758
9759
9760class PySizerPtr(PySizer):
9761 def __init__(self, this):
9762 self.this = this
9763 if not hasattr(self,"thisown"): self.thisown = 0
9764 self.__class__ = PySizer
9765_core_.PySizer_swigregister(PySizerPtr)
9766
9767#---------------------------------------------------------------------------
9768
9769class BoxSizer(Sizer):
bfddbb17
RD
9770 """
9771 The basic idea behind a box sizer is that windows will most often be
9772 laid out in rather simple basic geometry, typically in a row or a
9773 column or nested hierarchies of either. A wx.BoxSizer will lay out
9774 its items in a simple row or column, depending on the orientation
9775 parameter passed to the constructor.
9776 """
d55e5bfc
RD
9777 def __repr__(self):
9778 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9779 def __init__(self, *args, **kwargs):
bfddbb17
RD
9780 """
9781 __init__(self, int orient=HORIZONTAL) -> BoxSizer
9782
9783 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
9784 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
9785 sizer.
9786 """
d55e5bfc
RD
9787 newobj = _core_.new_BoxSizer(*args, **kwargs)
9788 self.this = newobj.this
9789 self.thisown = 1
9790 del newobj.thisown
9791 self._setOORInfo(self)
9792
9793 def GetOrientation(*args, **kwargs):
bfddbb17
RD
9794 """
9795 GetOrientation(self) -> int
9796
9797 Returns the current orientation of the sizer.
9798 """
d55e5bfc
RD
9799 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
9800
9801 def SetOrientation(*args, **kwargs):
bfddbb17
RD
9802 """
9803 SetOrientation(self, int orient)
d55e5bfc 9804
bfddbb17
RD
9805 Resets the orientation of the sizer.
9806 """
9807 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc
RD
9808
9809
9810class BoxSizerPtr(BoxSizer):
9811 def __init__(self, this):
9812 self.this = this
9813 if not hasattr(self,"thisown"): self.thisown = 0
9814 self.__class__ = BoxSizer
9815_core_.BoxSizer_swigregister(BoxSizerPtr)
9816
9817#---------------------------------------------------------------------------
9818
9819class StaticBoxSizer(BoxSizer):
bfddbb17
RD
9820 """
9821 wx.StaticBoxSizer derives from and functions identically to the
9822 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
9823 manages. Note that this static box must be created separately and
9824 passed to the sizer constructor.
9825 """
d55e5bfc
RD
9826 def __repr__(self):
9827 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9828 def __init__(self, *args, **kwargs):
bfddbb17
RD
9829 """
9830 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
9831
9832 Constructor. It takes an associated static box and the orientation
9833 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
9834 ``wx.HORIZONTAL``.
9835 """
d55e5bfc
RD
9836 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
9837 self.this = newobj.this
9838 self.thisown = 1
9839 del newobj.thisown
9840 self._setOORInfo(self)
9841
9842 def GetStaticBox(*args, **kwargs):
bfddbb17
RD
9843 """
9844 GetStaticBox(self) -> StaticBox
d55e5bfc 9845
bfddbb17
RD
9846 Returns the static box associated with this sizer.
9847 """
9848 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc
RD
9849
9850
9851class StaticBoxSizerPtr(StaticBoxSizer):
9852 def __init__(self, this):
9853 self.this = this
9854 if not hasattr(self,"thisown"): self.thisown = 0
9855 self.__class__ = StaticBoxSizer
9856_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
9857
9858#---------------------------------------------------------------------------
9859
9860class GridSizer(Sizer):
bfddbb17
RD
9861 """
9862 A grid sizer is a sizer which lays out its children in a
9863 two-dimensional table with all cells having the same size. In other
9864 words, the width of each cell within the grid is the width of the
9865 widest item added to the sizer and the height of each grid cell is the
9866 height of the tallest item. An optional vertical and/or horizontal
9867 gap between items can also be specified (in pixels.)
9868
9869 Items are placed in the cells of the grid in the order they are added,
9870 in row-major order. In other words, the first row is filled first,
9871 then the second, and so on until all items have been added. (If
9872 neccessary, additional rows will be added as items are added.) If you
9873 need to have greater control over the cells that items are placed in
9874 then use the `wx.GridBagSizer`.
9875
9876 """
d55e5bfc
RD
9877 def __repr__(self):
9878 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9879 def __init__(self, *args, **kwargs):
bfddbb17
RD
9880 """
9881 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
9882
9883 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
9884 of columns and rows in the sizer - if either of the parameters is
9885 zero, it will be calculated to from the total number of children in
9886 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9887 define extra space between all children.
9888 """
d55e5bfc
RD
9889 newobj = _core_.new_GridSizer(*args, **kwargs)
9890 self.this = newobj.this
9891 self.thisown = 1
9892 del newobj.thisown
9893 self._setOORInfo(self)
9894
d55e5bfc 9895 def SetCols(*args, **kwargs):
bfddbb17
RD
9896 """
9897 SetCols(self, int cols)
9898
9899 Sets the number of columns in the sizer.
9900 """
d55e5bfc
RD
9901 return _core_.GridSizer_SetCols(*args, **kwargs)
9902
9903 def SetRows(*args, **kwargs):
bfddbb17
RD
9904 """
9905 SetRows(self, int rows)
9906
9907 Sets the number of rows in the sizer.
9908 """
d55e5bfc
RD
9909 return _core_.GridSizer_SetRows(*args, **kwargs)
9910
9911 def SetVGap(*args, **kwargs):
bfddbb17
RD
9912 """
9913 SetVGap(self, int gap)
9914
9915 Sets the vertical gap (in pixels) between the cells in the sizer.
9916 """
d55e5bfc
RD
9917 return _core_.GridSizer_SetVGap(*args, **kwargs)
9918
9919 def SetHGap(*args, **kwargs):
bfddbb17
RD
9920 """
9921 SetHGap(self, int gap)
9922
9923 Sets the horizontal gap (in pixels) between cells in the sizer
9924 """
d55e5bfc
RD
9925 return _core_.GridSizer_SetHGap(*args, **kwargs)
9926
9927 def GetCols(*args, **kwargs):
bfddbb17
RD
9928 """
9929 GetCols(self) -> int
9930
9931 Returns the number of columns in the sizer.
9932 """
d55e5bfc
RD
9933 return _core_.GridSizer_GetCols(*args, **kwargs)
9934
9935 def GetRows(*args, **kwargs):
bfddbb17
RD
9936 """
9937 GetRows(self) -> int
9938
9939 Returns the number of rows in the sizer.
9940 """
d55e5bfc
RD
9941 return _core_.GridSizer_GetRows(*args, **kwargs)
9942
9943 def GetVGap(*args, **kwargs):
bfddbb17
RD
9944 """
9945 GetVGap(self) -> int
9946
9947 Returns the vertical gap (in pixels) between the cells in the sizer.
9948 """
d55e5bfc
RD
9949 return _core_.GridSizer_GetVGap(*args, **kwargs)
9950
9951 def GetHGap(*args, **kwargs):
bfddbb17
RD
9952 """
9953 GetHGap(self) -> int
9954
9955 Returns the horizontal gap (in pixels) between cells in the sizer.
9956 """
d55e5bfc
RD
9957 return _core_.GridSizer_GetHGap(*args, **kwargs)
9958
9959
9960class GridSizerPtr(GridSizer):
9961 def __init__(self, this):
9962 self.this = this
9963 if not hasattr(self,"thisown"): self.thisown = 0
9964 self.__class__ = GridSizer
9965_core_.GridSizer_swigregister(GridSizerPtr)
9966
9967#---------------------------------------------------------------------------
9968
9969FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
9970FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
9971FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
9972class FlexGridSizer(GridSizer):
bfddbb17
RD
9973 """
9974 A flex grid sizer is a sizer which lays out its children in a
9975 two-dimensional table with all table cells in one row having the same
9976 height and all cells in one column having the same width, but all
9977 rows or all columns are not necessarily the same height or width as in
9978 the `wx.GridSizer`.
9979
9980 wx.FlexGridSizer can also size items equally in one direction but
9981 unequally ("flexibly") in the other. If the sizer is only flexible
9982 in one direction (this can be changed using `SetFlexibleDirection`), it
9983 needs to be decided how the sizer should grow in the other ("non
9984 flexible") direction in order to fill the available space. The
9985 `SetNonFlexibleGrowMode` method serves this purpose.
9986
9987
9988 """
d55e5bfc
RD
9989 def __repr__(self):
9990 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9991 def __init__(self, *args, **kwargs):
bfddbb17
RD
9992 """
9993 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
9994
9995 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
9996 number of columns and rows in the sizer - if either of the parameters
9997 is zero, it will be calculated to from the total number of children in
9998 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9999 define extra space between all children.
10000 """
d55e5bfc
RD
10001 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
10002 self.this = newobj.this
10003 self.thisown = 1
10004 del newobj.thisown
10005 self._setOORInfo(self)
10006
bfddbb17
RD
10007 def AddGrowableRow(*args, **kwargs):
10008 """
10009 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 10010
bfddbb17
RD
10011 Specifies that row *idx* (starting from zero) should be grown if there
10012 is extra space available to the sizer.
d55e5bfc 10013
bfddbb17
RD
10014 The *proportion* parameter has the same meaning as the stretch factor
10015 for the box sizers except that if all proportions are 0, then all
10016 columns are resized equally (instead of not being resized at all).
10017 """
d55e5bfc
RD
10018 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
10019
10020 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
10021 """
10022 RemoveGrowableRow(self, size_t idx)
10023
10024 Specifies that row *idx* is no longer growable.
10025 """
d55e5bfc
RD
10026 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
10027
10028 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
10029 """
10030 AddGrowableCol(self, size_t idx, int proportion=0)
10031
10032 Specifies that column *idx* (starting from zero) should be grown if
10033 there is extra space available to the sizer.
10034
10035 The *proportion* parameter has the same meaning as the stretch factor
10036 for the box sizers except that if all proportions are 0, then all
10037 columns are resized equally (instead of not being resized at all).
10038 """
d55e5bfc
RD
10039 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
10040
10041 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
10042 """
10043 RemoveGrowableCol(self, size_t idx)
10044
10045 Specifies that column *idx* is no longer growable.
10046 """
d55e5bfc
RD
10047 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
10048
10049 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
10050 """
10051 SetFlexibleDirection(self, int direction)
10052
10053 Specifies whether the sizer should flexibly resize its columns, rows,
10054 or both. Argument *direction* can be one of the following values. Any
10055 other value is ignored.
10056
10057 ============== =======================================
10058 wx.VERTICAL Rows are flexibly sized.
10059 wx.HORIZONTAL Columns are flexibly sized.
10060 wx.BOTH Both rows and columns are flexibly sized
10061 (this is the default value).
10062 ============== =======================================
10063
10064 Note that this method does not trigger relayout.
10065
10066 """
d55e5bfc
RD
10067 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
10068
10069 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
10070 """
10071 GetFlexibleDirection(self) -> int
10072
10073 Returns a value that specifies whether the sizer
10074 flexibly resizes its columns, rows, or both (default).
10075
10076 :see: `SetFlexibleDirection`
10077 """
d55e5bfc
RD
10078 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
10079
10080 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
10081 """
10082 SetNonFlexibleGrowMode(self, int mode)
10083
10084 Specifies how the sizer should grow in the non-flexible direction if
10085 there is one (so `SetFlexibleDirection` must have been called
10086 previously). Argument *mode* can be one of the following values:
10087
10088 ========================== =================================================
10089 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
10090 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
10091 `AddGrowableCol` and `AddGrowableRow`. In this
10092 case equal sizing applies to minimum sizes of
10093 columns or rows (this is the default value).
10094 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
10095 the non flexible direction, whether they are
10096 growable or not in the flexbile direction.
10097 ========================== =================================================
10098
10099 Note that this method does not trigger relayout.
10100
10101
10102 """
d55e5bfc
RD
10103 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
10104
10105 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
10106 """
10107 GetNonFlexibleGrowMode(self) -> int
10108
10109 Returns the value that specifies how the sizer grows in the
10110 non-flexible direction if there is one.
10111
10112 :see: `SetNonFlexibleGrowMode`
10113 """
d55e5bfc
RD
10114 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
10115
10116 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
10117 """
10118 GetRowHeights(self) -> list
10119
10120 Returns a list of integers representing the heights of each of the
10121 rows in the sizer.
10122 """
d55e5bfc
RD
10123 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
10124
10125 def GetColWidths(*args, **kwargs):
fd2dc343
RD
10126 """
10127 GetColWidths(self) -> list
10128
10129 Returns a list of integers representing the widths of each of the
10130 columns in the sizer.
10131 """
d55e5bfc
RD
10132 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
10133
10134
10135class FlexGridSizerPtr(FlexGridSizer):
10136 def __init__(self, this):
10137 self.this = this
10138 if not hasattr(self,"thisown"): self.thisown = 0
10139 self.__class__ = FlexGridSizer
10140_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
10141
62d32a5f
RD
10142class StdDialogButtonSizer(BoxSizer):
10143 """
10144 A special sizer that knows how to order and position standard buttons
10145 in order to conform to the current platform's standards. You simply
10146 need to add each `wx.Button` to the sizer, and be sure to create the
10147 buttons using the standard ID's. Then call `Finalize` and the sizer
10148 will take care of the rest.
10149
10150 """
10151 def __repr__(self):
10152 return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10153 def __init__(self, *args, **kwargs):
10154 """__init__(self) -> StdDialogButtonSizer"""
10155 newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs)
10156 self.this = newobj.this
10157 self.thisown = 1
10158 del newobj.thisown
10159 def AddButton(*args, **kwargs):
10160 """
10161 AddButton(self, wxButton button)
10162
10163 Use this to add the buttons to this sizer. Do not use the `Add`
10164 method in the base class.
10165 """
10166 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
10167
10168 def Finalise(*args, **kwargs):
10169 """
10170 Finalise(self)
10171
10172 This funciton needs to be called after all the buttons have been added
10173 to the sizer. It will reorder them and position them in a platform
10174 specifc manner.
10175 """
10176 return _core_.StdDialogButtonSizer_Finalise(*args, **kwargs)
51b83b37
RD
10177
10178 def SetAffirmativeButton(*args, **kwargs):
10179 """SetAffirmativeButton(self, wxButton button)"""
10180 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
10181
10182 def SetNegativeButton(*args, **kwargs):
10183 """SetNegativeButton(self, wxButton button)"""
10184 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
10185
10186 def SetCancelButton(*args, **kwargs):
10187 """SetCancelButton(self, wxButton button)"""
10188 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
10189
10190 def GetAffirmativeButton(*args, **kwargs):
10191 """GetAffirmativeButton(self) -> wxButton"""
10192 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
10193
10194 def GetApplyButton(*args, **kwargs):
10195 """GetApplyButton(self) -> wxButton"""
10196 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
10197
10198 def GetNegativeButton(*args, **kwargs):
10199 """GetNegativeButton(self) -> wxButton"""
10200 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
10201
10202 def GetCancelButton(*args, **kwargs):
10203 """GetCancelButton(self) -> wxButton"""
10204 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
10205
10206 def GetHelpButton(*args, **kwargs):
10207 """GetHelpButton(self) -> wxButton"""
10208 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
10209
10210
10211class StdDialogButtonSizerPtr(StdDialogButtonSizer):
10212 def __init__(self, this):
10213 self.this = this
10214 if not hasattr(self,"thisown"): self.thisown = 0
10215 self.__class__ = StdDialogButtonSizer
10216_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr)
10217
d55e5bfc
RD
10218#---------------------------------------------------------------------------
10219
10220class GBPosition(object):
bfddbb17
RD
10221 """
10222 This class represents the position of an item in a virtual grid of
10223 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10224 typemaps that will automatically convert from a 2-element sequence of
10225 integers to a wx.GBPosition, so you can use the more pythonic
10226 representation of the position nearly transparently in Python code.
10227 """
d55e5bfc
RD
10228 def __repr__(self):
10229 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10230 def __init__(self, *args, **kwargs):
bfddbb17
RD
10231 """
10232 __init__(self, int row=0, int col=0) -> GBPosition
10233
10234 This class represents the position of an item in a virtual grid of
10235 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10236 typemaps that will automatically convert from a 2-element sequence of
10237 integers to a wx.GBPosition, so you can use the more pythonic
10238 representation of the position nearly transparently in Python code.
10239 """
d55e5bfc
RD
10240 newobj = _core_.new_GBPosition(*args, **kwargs)
10241 self.this = newobj.this
10242 self.thisown = 1
10243 del newobj.thisown
10244 def GetRow(*args, **kwargs):
10245 """GetRow(self) -> int"""
10246 return _core_.GBPosition_GetRow(*args, **kwargs)
10247
10248 def GetCol(*args, **kwargs):
10249 """GetCol(self) -> int"""
10250 return _core_.GBPosition_GetCol(*args, **kwargs)
10251
10252 def SetRow(*args, **kwargs):
10253 """SetRow(self, int row)"""
10254 return _core_.GBPosition_SetRow(*args, **kwargs)
10255
10256 def SetCol(*args, **kwargs):
10257 """SetCol(self, int col)"""
10258 return _core_.GBPosition_SetCol(*args, **kwargs)
10259
10260 def __eq__(*args, **kwargs):
10261 """__eq__(self, GBPosition other) -> bool"""
10262 return _core_.GBPosition___eq__(*args, **kwargs)
10263
10264 def __ne__(*args, **kwargs):
10265 """__ne__(self, GBPosition other) -> bool"""
10266 return _core_.GBPosition___ne__(*args, **kwargs)
10267
10268 def Set(*args, **kwargs):
10269 """Set(self, int row=0, int col=0)"""
10270 return _core_.GBPosition_Set(*args, **kwargs)
10271
10272 def Get(*args, **kwargs):
10273 """Get(self) -> PyObject"""
10274 return _core_.GBPosition_Get(*args, **kwargs)
10275
15817c7e 10276 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
10277 def __str__(self): return str(self.Get())
10278 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
10279 def __len__(self): return len(self.Get())
10280 def __getitem__(self, index): return self.Get()[index]
10281 def __setitem__(self, index, val):
10282 if index == 0: self.SetRow(val)
10283 elif index == 1: self.SetCol(val)
10284 else: raise IndexError
10285 def __nonzero__(self): return self.Get() != (0,0)
10286 __safe_for_unpickling__ = True
10287 def __reduce__(self): return (wx.GBPosition, self.Get())
10288
10289 row = property(GetRow, SetRow)
10290 col = property(GetCol, SetCol)
10291
10292
10293class GBPositionPtr(GBPosition):
10294 def __init__(self, this):
10295 self.this = this
10296 if not hasattr(self,"thisown"): self.thisown = 0
10297 self.__class__ = GBPosition
10298_core_.GBPosition_swigregister(GBPositionPtr)
10299
10300class GBSpan(object):
bfddbb17
RD
10301 """
10302 This class is used to hold the row and column spanning attributes of
10303 items in a `wx.GridBagSizer`. wxPython has typemaps that will
10304 automatically convert from a 2-element sequence of integers to a
10305 wx.GBSpan, so you can use the more pythonic representation of the span
10306 nearly transparently in Python code.
10307
10308 """
d55e5bfc
RD
10309 def __repr__(self):
10310 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10311 def __init__(self, *args, **kwargs):
bfddbb17
RD
10312 """
10313 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
10314
10315 Construct a new wxGBSpan, optionally setting the rowspan and
10316 colspan. The default is (1,1). (Meaning that the item occupies one
10317 cell in each direction.
10318 """
d55e5bfc
RD
10319 newobj = _core_.new_GBSpan(*args, **kwargs)
10320 self.this = newobj.this
10321 self.thisown = 1
10322 del newobj.thisown
10323 def GetRowspan(*args, **kwargs):
10324 """GetRowspan(self) -> int"""
10325 return _core_.GBSpan_GetRowspan(*args, **kwargs)
10326
10327 def GetColspan(*args, **kwargs):
10328 """GetColspan(self) -> int"""
10329 return _core_.GBSpan_GetColspan(*args, **kwargs)
10330
10331 def SetRowspan(*args, **kwargs):
10332 """SetRowspan(self, int rowspan)"""
10333 return _core_.GBSpan_SetRowspan(*args, **kwargs)
10334
10335 def SetColspan(*args, **kwargs):
10336 """SetColspan(self, int colspan)"""
10337 return _core_.GBSpan_SetColspan(*args, **kwargs)
10338
10339 def __eq__(*args, **kwargs):
10340 """__eq__(self, GBSpan other) -> bool"""
10341 return _core_.GBSpan___eq__(*args, **kwargs)
10342
10343 def __ne__(*args, **kwargs):
10344 """__ne__(self, GBSpan other) -> bool"""
10345 return _core_.GBSpan___ne__(*args, **kwargs)
10346
10347 def Set(*args, **kwargs):
10348 """Set(self, int rowspan=1, int colspan=1)"""
10349 return _core_.GBSpan_Set(*args, **kwargs)
10350
10351 def Get(*args, **kwargs):
10352 """Get(self) -> PyObject"""
10353 return _core_.GBSpan_Get(*args, **kwargs)
10354
15817c7e 10355 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
10356 def __str__(self): return str(self.Get())
10357 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
10358 def __len__(self): return len(self.Get())
10359 def __getitem__(self, index): return self.Get()[index]
10360 def __setitem__(self, index, val):
10361 if index == 0: self.SetRowspan(val)
10362 elif index == 1: self.SetColspan(val)
10363 else: raise IndexError
10364 def __nonzero__(self): return self.Get() != (0,0)
10365 __safe_for_unpickling__ = True
10366 def __reduce__(self): return (wx.GBSpan, self.Get())
10367
10368 rowspan = property(GetRowspan, SetRowspan)
10369 colspan = property(GetColspan, SetColspan)
10370
10371
10372class GBSpanPtr(GBSpan):
10373 def __init__(self, this):
10374 self.this = this
10375 if not hasattr(self,"thisown"): self.thisown = 0
10376 self.__class__ = GBSpan
10377_core_.GBSpan_swigregister(GBSpanPtr)
10378
10379class GBSizerItem(SizerItem):
bfddbb17
RD
10380 """
10381 The wx.GBSizerItem class is used to track the additional data about
10382 items in a `wx.GridBagSizer` such as the item's position in the grid
10383 and how many rows or columns it spans.
10384
10385 """
d55e5bfc
RD
10386 def __repr__(self):
10387 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10388 def __init__(self, *args, **kwargs):
bfddbb17
RD
10389 """
10390 __init__(self) -> GBSizerItem
10391
10392 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
10393 size will need to be set, as well as a position and span before this
10394 item can be used in a Sizer.
10395
10396 You will probably never need to create a wx.GBSizerItem directly as they
10397 are created automatically when the sizer's Add method is called.
10398 """
d55e5bfc
RD
10399 newobj = _core_.new_GBSizerItem(*args, **kwargs)
10400 self.this = newobj.this
10401 self.thisown = 1
10402 del newobj.thisown
10403 def GetPos(*args, **kwargs):
bfddbb17
RD
10404 """
10405 GetPos(self) -> GBPosition
10406
10407 Get the grid position of the item
10408 """
d55e5bfc
RD
10409 return _core_.GBSizerItem_GetPos(*args, **kwargs)
10410
10411 def GetPosTuple(self): return self.GetPos().Get()
10412 def GetSpan(*args, **kwargs):
bfddbb17
RD
10413 """
10414 GetSpan(self) -> GBSpan
10415
10416 Get the row and column spanning of the item
10417 """
d55e5bfc
RD
10418 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
10419
10420 def GetSpanTuple(self): return self.GetSpan().Get()
10421 def SetPos(*args, **kwargs):
bfddbb17
RD
10422 """
10423 SetPos(self, GBPosition pos) -> bool
10424
10425 If the item is already a member of a sizer then first ensure that
10426 there is no other item that would intersect with this one at the new
10427 position, then set the new position. Returns True if the change is
10428 successful and after the next Layout() the item will be moved.
10429 """
d55e5bfc
RD
10430 return _core_.GBSizerItem_SetPos(*args, **kwargs)
10431
10432 def SetSpan(*args, **kwargs):
bfddbb17
RD
10433 """
10434 SetSpan(self, GBSpan span) -> bool
10435
10436 If the item is already a member of a sizer then first ensure that
10437 there is no other item that would intersect with this one with its new
10438 spanning size, then set the new spanning. Returns True if the change
10439 is successful and after the next Layout() the item will be resized.
10440
10441 """
d55e5bfc
RD
10442 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
10443
bfddbb17 10444 def Intersects(*args, **kwargs):
d55e5bfc
RD
10445 """
10446 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
10447
10448 Returns True if this item and the other item instersect.
d55e5bfc 10449 """
bfddbb17
RD
10450 return _core_.GBSizerItem_Intersects(*args, **kwargs)
10451
10452 def IntersectsPos(*args, **kwargs):
10453 """
10454 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
10455
10456 Returns True if the given pos/span would intersect with this item.
10457 """
10458 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
10459
10460 def GetEndPos(*args, **kwargs):
bfddbb17
RD
10461 """
10462 GetEndPos(self) -> GBPosition
10463
10464 Get the row and column of the endpoint of this item.
10465 """
d55e5bfc
RD
10466 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
10467
10468 def GetGBSizer(*args, **kwargs):
bfddbb17
RD
10469 """
10470 GetGBSizer(self) -> GridBagSizer
10471
10472 Get the sizer this item is a member of.
10473 """
d55e5bfc
RD
10474 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
10475
10476 def SetGBSizer(*args, **kwargs):
bfddbb17
RD
10477 """
10478 SetGBSizer(self, GridBagSizer sizer)
10479
10480 Set the sizer this item is a member of.
10481 """
d55e5bfc
RD
10482 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
10483
10484
10485class GBSizerItemPtr(GBSizerItem):
10486 def __init__(self, this):
10487 self.this = this
10488 if not hasattr(self,"thisown"): self.thisown = 0
10489 self.__class__ = GBSizerItem
10490_core_.GBSizerItem_swigregister(GBSizerItemPtr)
10491DefaultSpan = cvar.DefaultSpan
10492
10493def GBSizerItemWindow(*args, **kwargs):
10494 """
10495 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
bfddbb17
RD
10496 int border, PyObject userData=None) -> GBSizerItem
10497
10498 Construct a `wx.GBSizerItem` for a window.
d55e5bfc
RD
10499 """
10500 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
10501 val.thisown = 1
10502 return val
10503
10504def GBSizerItemSizer(*args, **kwargs):
10505 """
10506 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
bfddbb17
RD
10507 int border, PyObject userData=None) -> GBSizerItem
10508
10509 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc
RD
10510 """
10511 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
10512 val.thisown = 1
10513 return val
10514
10515def GBSizerItemSpacer(*args, **kwargs):
10516 """
10517 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
bfddbb17
RD
10518 int flag, int border, PyObject userData=None) -> GBSizerItem
10519
10520 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc
RD
10521 """
10522 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
10523 val.thisown = 1
10524 return val
10525
10526class GridBagSizer(FlexGridSizer):
bfddbb17
RD
10527 """
10528 A `wx.Sizer` that can lay out items in a virtual grid like a
10529 `wx.FlexGridSizer` but in this case explicit positioning of the items
10530 is allowed using `wx.GBPosition`, and items can optionally span more
10531 than one row and/or column using `wx.GBSpan`. The total size of the
10532 virtual grid is determined by the largest row and column that items are
10533 positioned at, adjusted for spanning.
10534
10535 """
d55e5bfc
RD
10536 def __repr__(self):
10537 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10538 def __init__(self, *args, **kwargs):
bfddbb17
RD
10539 """
10540 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
10541
10542 Constructor, with optional parameters to specify the gap between the
10543 rows and columns.
10544 """
d55e5bfc
RD
10545 newobj = _core_.new_GridBagSizer(*args, **kwargs)
10546 self.this = newobj.this
10547 self.thisown = 1
10548 del newobj.thisown
03e46024
RD
10549 self._setOORInfo(self)
10550
d55e5bfc
RD
10551 def Add(*args, **kwargs):
10552 """
bfddbb17 10553 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 10554 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
10555
10556 Adds an item to the sizer at the grid cell *pos*, optionally spanning
10557 more than one row or column as specified with *span*. The remaining
10558 args behave similarly to `wx.Sizer.Add`.
10559
10560 Returns True if the item was successfully placed at the given cell
10561 position, False if something was already there.
10562
d55e5bfc
RD
10563 """
10564 return _core_.GridBagSizer_Add(*args, **kwargs)
10565
10566 def AddItem(*args, **kwargs):
bfddbb17 10567 """
070c48b4 10568 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
10569
10570 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
10571 the item was successfully placed at its given cell position, False if
10572 something was already there.
10573 """
d55e5bfc
RD
10574 return _core_.GridBagSizer_AddItem(*args, **kwargs)
10575
84f85550
RD
10576 def GetCellSize(*args, **kwargs):
10577 """
10578 GetCellSize(self, int row, int col) -> Size
10579
10580 Get the size of the specified cell, including hgap and
10581 vgap. Only valid after a Layout.
10582 """
10583 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
10584
d55e5bfc 10585 def GetEmptyCellSize(*args, **kwargs):
bfddbb17
RD
10586 """
10587 GetEmptyCellSize(self) -> Size
10588
10589 Get the size used for cells in the grid with no item.
10590 """
d55e5bfc
RD
10591 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
10592
10593 def SetEmptyCellSize(*args, **kwargs):
bfddbb17
RD
10594 """
10595 SetEmptyCellSize(self, Size sz)
10596
10597 Set the size used for cells in the grid with no item.
10598 """
d55e5bfc
RD
10599 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
10600
10601 def GetItemPosition(*args):
10602 """
bfddbb17
RD
10603 GetItemPosition(self, item) -> GBPosition
10604
10605 Get the grid position of the specified *item* where *item* is either a
10606 window or subsizer that is a member of this sizer, or a zero-based
10607 index of an item.
d55e5bfc
RD
10608 """
10609 return _core_.GridBagSizer_GetItemPosition(*args)
10610
10611 def SetItemPosition(*args):
10612 """
bfddbb17
RD
10613 SetItemPosition(self, item, GBPosition pos) -> bool
10614
10615 Set the grid position of the specified *item* where *item* is either a
10616 window or subsizer that is a member of this sizer, or a zero-based
10617 index of an item. Returns True on success. If the move is not
10618 allowed (because an item is already there) then False is returned.
10619
d55e5bfc
RD
10620 """
10621 return _core_.GridBagSizer_SetItemPosition(*args)
10622
10623 def GetItemSpan(*args):
10624 """
bfddbb17
RD
10625 GetItemSpan(self, item) -> GBSpan
10626
10627 Get the row/col spanning of the specified *item* where *item* is
10628 either a window or subsizer that is a member of this sizer, or a
10629 zero-based index of an item.
d55e5bfc
RD
10630 """
10631 return _core_.GridBagSizer_GetItemSpan(*args)
10632
10633 def SetItemSpan(*args):
10634 """
bfddbb17
RD
10635 SetItemSpan(self, item, GBSpan span) -> bool
10636
10637 Set the row/col spanning of the specified *item* where *item* is
10638 either a window or subsizer that is a member of this sizer, or a
10639 zero-based index of an item. Returns True on success. If the move is
10640 not allowed (because an item is already there) then False is returned.
d55e5bfc
RD
10641 """
10642 return _core_.GridBagSizer_SetItemSpan(*args)
10643
10644 def FindItem(*args):
10645 """
bfddbb17
RD
10646 FindItem(self, item) -> GBSizerItem
10647
10648 Find the sizer item for the given window or subsizer, returns None if
10649 not found. (non-recursive)
d55e5bfc
RD
10650 """
10651 return _core_.GridBagSizer_FindItem(*args)
10652
10653 def FindItemAtPosition(*args, **kwargs):
bfddbb17
RD
10654 """
10655 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
10656
10657 Return the sizer item for the given grid cell, or None if there is no
10658 item at that position. (non-recursive)
10659 """
d55e5bfc
RD
10660 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
10661
10662 def FindItemAtPoint(*args, **kwargs):
bfddbb17
RD
10663 """
10664 FindItemAtPoint(self, Point pt) -> GBSizerItem
10665
10666 Return the sizer item located at the point given in *pt*, or None if
10667 there is no item at that point. The (x,y) coordinates in pt correspond
10668 to the client coordinates of the window using the sizer for
10669 layout. (non-recursive)
10670 """
d55e5bfc
RD
10671 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
10672
bfddbb17
RD
10673 def CheckForIntersection(*args, **kwargs):
10674 """
10675 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 10676
bfddbb17
RD
10677 Look at all items and see if any intersect (or would overlap) the
10678 given *item*. Returns True if so, False if there would be no overlap.
10679 If an *excludeItem* is given then it will not be checked for
10680 intersection, for example it may be the item we are checking the
10681 position of.
d55e5bfc 10682
bfddbb17
RD
10683 """
10684 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 10685
bfddbb17 10686 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 10687 """
bfddbb17
RD
10688 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
10689
10690 Look at all items and see if any intersect (or would overlap) the
10691 given position and span. Returns True if so, False if there would be
10692 no overlap. If an *excludeItem* is given then it will not be checked
10693 for intersection, for example it may be the item we are checking the
10694 position of.
d55e5bfc 10695 """
bfddbb17 10696 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc
RD
10697
10698
10699class GridBagSizerPtr(GridBagSizer):
10700 def __init__(self, this):
10701 self.this = this
10702 if not hasattr(self,"thisown"): self.thisown = 0
10703 self.__class__ = GridBagSizer
10704_core_.GridBagSizer_swigregister(GridBagSizerPtr)
10705
10706#---------------------------------------------------------------------------
10707
10708Left = _core_.Left
10709Top = _core_.Top
10710Right = _core_.Right
10711Bottom = _core_.Bottom
10712Width = _core_.Width
10713Height = _core_.Height
10714Centre = _core_.Centre
10715Center = _core_.Center
10716CentreX = _core_.CentreX
10717CentreY = _core_.CentreY
10718Unconstrained = _core_.Unconstrained
10719AsIs = _core_.AsIs
10720PercentOf = _core_.PercentOf
10721Above = _core_.Above
10722Below = _core_.Below
10723LeftOf = _core_.LeftOf
10724RightOf = _core_.RightOf
10725SameAs = _core_.SameAs
10726Absolute = _core_.Absolute
10727class IndividualLayoutConstraint(Object):
10728 """
15817c7e
RD
10729 Objects of this class are stored in the `wx.LayoutConstraints` class as
10730 one of eight possible constraints that a window can be involved in.
10731 You will never need to create an instance of
10732 wx.IndividualLayoutConstraint, rather you should create a
10733 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 10734 that it contains.
d55e5bfc
RD
10735 """
10736 def __init__(self): raise RuntimeError, "No constructor defined"
10737 def __repr__(self):
10738 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10739 def Set(*args, **kwargs):
15817c7e
RD
10740 """
10741 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
10742
10743 Sets the properties of the constraint. Normally called by one of the
10744 convenience functions such as Above, RightOf, SameAs.
10745 """
d55e5bfc
RD
10746 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
10747
10748 def LeftOf(*args, **kwargs):
10749 """
10750 LeftOf(self, Window sibling, int marg=0)
10751
15817c7e
RD
10752 Constrains this edge to be to the left of the given window, with an
10753 optional margin. Implicitly, this is relative to the left edge of the
10754 other window.
d55e5bfc
RD
10755 """
10756 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
10757
10758 def RightOf(*args, **kwargs):
10759 """
10760 RightOf(self, Window sibling, int marg=0)
10761
15817c7e
RD
10762 Constrains this edge to be to the right of the given window, with an
10763 optional margin. Implicitly, this is relative to the right edge of the
10764 other window.
d55e5bfc
RD
10765 """
10766 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
10767
10768 def Above(*args, **kwargs):
10769 """
10770 Above(self, Window sibling, int marg=0)
10771
15817c7e
RD
10772 Constrains this edge to be above the given window, with an optional
10773 margin. Implicitly, this is relative to the top edge of the other
10774 window.
d55e5bfc
RD
10775 """
10776 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
10777
10778 def Below(*args, **kwargs):
10779 """
10780 Below(self, Window sibling, int marg=0)
10781
15817c7e
RD
10782 Constrains this edge to be below the given window, with an optional
10783 margin. Implicitly, this is relative to the bottom edge of the other
10784 window.
d55e5bfc
RD
10785 """
10786 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
10787
10788 def SameAs(*args, **kwargs):
10789 """
10790 SameAs(self, Window otherW, int edge, int marg=0)
10791
15817c7e
RD
10792 Constrains this edge or dimension to be to the same as the edge of the
10793 given window, with an optional margin.
d55e5bfc
RD
10794 """
10795 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
10796
10797 def PercentOf(*args, **kwargs):
10798 """
10799 PercentOf(self, Window otherW, int wh, int per)
10800
15817c7e
RD
10801 Constrains this edge or dimension to be to a percentage of the given
10802 window, with an optional margin.
d55e5bfc
RD
10803 """
10804 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
10805
10806 def Absolute(*args, **kwargs):
10807 """
10808 Absolute(self, int val)
10809
15817c7e 10810 Constrains this edge or dimension to be the given absolute value.
d55e5bfc
RD
10811 """
10812 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
10813
10814 def Unconstrained(*args, **kwargs):
10815 """
10816 Unconstrained(self)
10817
15817c7e
RD
10818 Sets this edge or dimension to be unconstrained, that is, dependent on
10819 other edges and dimensions from which this value can be deduced.
d55e5bfc
RD
10820 """
10821 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
10822
10823 def AsIs(*args, **kwargs):
10824 """
10825 AsIs(self)
10826
15817c7e
RD
10827 Sets this edge or constraint to be whatever the window's value is at
10828 the moment. If either of the width and height constraints are *as is*,
10829 the window will not be resized, but moved instead. This is important
10830 when considering panel items which are intended to have a default
10831 size, such as a button, which may take its size from the size of the
10832 button label.
d55e5bfc
RD
10833 """
10834 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
10835
10836 def GetOtherWindow(*args, **kwargs):
10837 """GetOtherWindow(self) -> Window"""
10838 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
10839
10840 def GetMyEdge(*args, **kwargs):
10841 """GetMyEdge(self) -> int"""
10842 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
10843
10844 def SetEdge(*args, **kwargs):
10845 """SetEdge(self, int which)"""
10846 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
10847
10848 def SetValue(*args, **kwargs):
10849 """SetValue(self, int v)"""
10850 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
10851
10852 def GetMargin(*args, **kwargs):
10853 """GetMargin(self) -> int"""
10854 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
10855
10856 def SetMargin(*args, **kwargs):
10857 """SetMargin(self, int m)"""
10858 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
10859
10860 def GetValue(*args, **kwargs):
10861 """GetValue(self) -> int"""
10862 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
10863
10864 def GetPercent(*args, **kwargs):
10865 """GetPercent(self) -> int"""
10866 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
10867
10868 def GetOtherEdge(*args, **kwargs):
10869 """GetOtherEdge(self) -> int"""
10870 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
10871
10872 def GetDone(*args, **kwargs):
10873 """GetDone(self) -> bool"""
10874 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
10875
10876 def SetDone(*args, **kwargs):
10877 """SetDone(self, bool d)"""
10878 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
10879
10880 def GetRelationship(*args, **kwargs):
10881 """GetRelationship(self) -> int"""
10882 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
10883
10884 def SetRelationship(*args, **kwargs):
10885 """SetRelationship(self, int r)"""
10886 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
10887
10888 def ResetIfWin(*args, **kwargs):
10889 """
10890 ResetIfWin(self, Window otherW) -> bool
10891
10892 Reset constraint if it mentions otherWin
10893 """
10894 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
10895
10896 def SatisfyConstraint(*args, **kwargs):
10897 """
10898 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
10899
10900 Try to satisfy constraint
10901 """
10902 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
10903
10904 def GetEdge(*args, **kwargs):
10905 """
10906 GetEdge(self, int which, Window thisWin, Window other) -> int
10907
10908 Get the value of this edge or dimension, or if this
10909 is not determinable, -1.
10910 """
10911 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
10912
10913
10914class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
10915 def __init__(self, this):
10916 self.this = this
10917 if not hasattr(self,"thisown"): self.thisown = 0
10918 self.__class__ = IndividualLayoutConstraint
10919_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
10920
10921class LayoutConstraints(Object):
10922 """
15817c7e
RD
10923 **Note:** constraints are now deprecated and you should use sizers
10924 instead.
d55e5bfc 10925
15817c7e
RD
10926 Objects of this class can be associated with a window to define its
10927 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
10928
10929 The class consists of the following eight constraints of class
10930 wx.IndividualLayoutConstraint, some or all of which should be accessed
10931 directly to set the appropriate constraints.
10932
10933 * left: represents the left hand edge of the window
10934 * right: represents the right hand edge of the window
10935 * top: represents the top edge of the window
10936 * bottom: represents the bottom edge of the window
10937 * width: represents the width of the window
10938 * height: represents the height of the window
10939 * centreX: represents the horizontal centre point of the window
10940 * centreY: represents the vertical centre point of the window
10941
15817c7e
RD
10942 Most constraints are initially set to have the relationship
10943 wxUnconstrained, which means that their values should be calculated by
10944 looking at known constraints. The exceptions are width and height,
10945 which are set to wxAsIs to ensure that if the user does not specify a
10946 constraint, the existing width and height will be used, to be
10947 compatible with panel items which often have take a default size. If
10948 the constraint is ``wx.AsIs``, the dimension will not be changed.
10949
10950 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
10951
10952 """
10953 def __repr__(self):
10954 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10955 left = property(_core_.LayoutConstraints_left_get)
10956 top = property(_core_.LayoutConstraints_top_get)
10957 right = property(_core_.LayoutConstraints_right_get)
10958 bottom = property(_core_.LayoutConstraints_bottom_get)
10959 width = property(_core_.LayoutConstraints_width_get)
10960 height = property(_core_.LayoutConstraints_height_get)
10961 centreX = property(_core_.LayoutConstraints_centreX_get)
10962 centreY = property(_core_.LayoutConstraints_centreY_get)
10963 def __init__(self, *args, **kwargs):
10964 """__init__(self) -> LayoutConstraints"""
10965 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
10966 self.this = newobj.this
10967 self.thisown = 1
10968 del newobj.thisown
10969 def SatisfyConstraints(*args, **kwargs):
10970 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
10971 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
10972
10973 def AreSatisfied(*args, **kwargs):
10974 """AreSatisfied(self) -> bool"""
10975 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
10976
10977
10978class LayoutConstraintsPtr(LayoutConstraints):
10979 def __init__(self, this):
10980 self.this = this
10981 if not hasattr(self,"thisown"): self.thisown = 0
10982 self.__class__ = LayoutConstraints
10983_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
10984
10985#----------------------------------------------------------------------------
10986
10987# Use Python's bool constants if available, make some if not
10988try:
10989 True
10990except NameError:
10991 __builtins__.True = 1==1
10992 __builtins__.False = 1==0
10993 def bool(value): return not not value
10994 __builtins__.bool = bool
10995
10996
10997
10998# workarounds for bad wxRTTI names
10999__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
11000__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
11001__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
11002
11003
11004#----------------------------------------------------------------------------
11005# Load version numbers from __version__... Ensure that major and minor
0f63ec68 11006# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
11007
11008from __version__ import *
11009__version__ = VERSION_STRING
11010
0f63ec68
RD
11011assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
11012assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
11013if RELEASE_VERSION != _core_.RELEASE_VERSION:
11014 import warnings
0f63ec68 11015 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
11016
11017#----------------------------------------------------------------------------
11018
62d32a5f
RD
11019# Set the default string<-->unicode conversion encoding from the
11020# locale. This encoding is used when string or unicode objects need
11021# to be converted in order to pass them to wxWidgets. Please be aware
11022# that the default encoding within the same locale may be slightly
11023# different on different platforms. For example, please see
11024# http://www.alanwood.net/demos/charsetdiffs.html for differences
11025# between the common latin/roman encodings.
5cbf236d
RD
11026import locale
11027default = locale.getdefaultlocale()[1]
11028if default:
11029 wx.SetDefaultPyEncoding(default)
11030del default
11031del locale
11032
11033#----------------------------------------------------------------------------
11034
d55e5bfc
RD
11035class PyDeadObjectError(AttributeError):
11036 pass
11037
11038class _wxPyDeadObject(object):
11039 """
11040 Instances of wx objects that are OOR capable will have their __class__
11041 changed to this class when the C++ object is deleted. This should help
11042 prevent crashes due to referencing a bogus C++ pointer.
11043 """
11044 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
11045 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
11046
11047 def __repr__(self):
11048 if not hasattr(self, "_name"):
11049 self._name = "[unknown]"
11050 return self.reprStr % self._name
11051
11052 def __getattr__(self, *args):
11053 if not hasattr(self, "_name"):
11054 self._name = "[unknown]"
11055 raise PyDeadObjectError(self.attrStr % self._name)
11056
11057 def __nonzero__(self):
11058 return 0
11059
11060
11061
11062class PyUnbornObjectError(AttributeError):
11063 pass
11064
11065class _wxPyUnbornObject(object):
11066 """
11067 Some stock objects are created when the wx._core module is
11068 imported, but their C++ instance is not created until the wx.App
11069 object is created and initialized. These object instances will
11070 temporarily have their __class__ changed to this class so an
11071 exception will be raised if they are used before the C++ instance
11072 is ready.
11073 """
11074
11075 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
11076 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
11077
11078 def __repr__(self):
11079 #if not hasattr(self, "_name"):
11080 # self._name = "[unknown]"
11081 return self.reprStr #% self._name
11082
11083 def __getattr__(self, *args):
11084 #if not hasattr(self, "_name"):
11085 # self._name = "[unknown]"
11086 raise PyUnbornObjectError(self.attrStr) # % self._name )
11087
11088 def __nonzero__(self):
11089 return 0
11090
11091
11092#----------------------------------------------------------------------------
d55e5bfc
RD
11093
11094def CallAfter(callable, *args, **kw):
11095 """
11096 Call the specified function after the current and pending event
11097 handlers have been completed. This is also good for making GUI
0439c23b
RD
11098 method calls from non-GUI threads. Any extra positional or
11099 keyword args are passed on to the callable when it is called.
11100
11101 :see: `wx.FutureCall`
d55e5bfc
RD
11102 """
11103 app = wx.GetApp()
a001823c 11104 assert app is not None, 'No wx.App created yet'
d55e5bfc 11105
891bb194
RD
11106 if not hasattr(app, "_CallAfterId"):
11107 app._CallAfterId = wx.NewEventType()
11108 app.Connect(-1, -1, app._CallAfterId,
11109 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 11110 evt = wx.PyEvent()
891bb194 11111 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
11112 evt.callable = callable
11113 evt.args = args
11114 evt.kw = kw
11115 wx.PostEvent(app, evt)
11116
d55e5bfc
RD
11117#----------------------------------------------------------------------------
11118
11119
11120class FutureCall:
11121 """
6e0de3df 11122 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
11123 object once after the given amount of milliseconds, passing any
11124 positional or keyword args. The return value of the callable is
0439c23b 11125 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
11126
11127 If you don't need to get the return value or restart the timer
11128 then there is no need to hold a reference to this object. It will
11129 hold a reference to itself while the timer is running (the timer
11130 has a reference to self.Notify) but the cycle will be broken when
11131 the timer completes, automatically cleaning up the wx.FutureCall
11132 object.
0439c23b
RD
11133
11134 :see: `wx.CallAfter`
d55e5bfc
RD
11135 """
11136 def __init__(self, millis, callable, *args, **kwargs):
11137 self.millis = millis
11138 self.callable = callable
11139 self.SetArgs(*args, **kwargs)
11140 self.runCount = 0
11141 self.running = False
11142 self.hasRun = False
11143 self.result = None
11144 self.timer = None
11145 self.Start()
11146
11147 def __del__(self):
11148 self.Stop()
11149
11150
11151 def Start(self, millis=None, *args, **kwargs):
11152 """
11153 (Re)start the timer
11154 """
11155 self.hasRun = False
11156 if millis is not None:
11157 self.millis = millis
11158 if args or kwargs:
11159 self.SetArgs(*args, **kwargs)
11160 self.Stop()
11161 self.timer = wx.PyTimer(self.Notify)
11162 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
11163 self.running = True
11164 Restart = Start
11165
11166
11167 def Stop(self):
11168 """
11169 Stop and destroy the timer.
11170 """
11171 if self.timer is not None:
11172 self.timer.Stop()
11173 self.timer = None
11174
11175
11176 def GetInterval(self):
11177 if self.timer is not None:
11178 return self.timer.GetInterval()
11179 else:
11180 return 0
11181
11182
11183 def IsRunning(self):
11184 return self.timer is not None and self.timer.IsRunning()
11185
11186
11187 def SetArgs(self, *args, **kwargs):
11188 """
11189 (Re)set the args passed to the callable object. This is
11190 useful in conjunction with Restart if you want to schedule a
11191 new call to the same callable object but with different
11192 parameters.
11193 """
11194 self.args = args
11195 self.kwargs = kwargs
11196
11197
11198 def HasRun(self):
11199 return self.hasRun
11200
11201 def GetResult(self):
11202 return self.result
11203
11204 def Notify(self):
11205 """
11206 The timer has expired so call the callable.
11207 """
11208 if self.callable and getattr(self.callable, 'im_self', True):
11209 self.runCount += 1
11210 self.running = False
11211 self.result = self.callable(*self.args, **self.kwargs)
11212 self.hasRun = True
11213 if not self.running:
11214 # if it wasn't restarted, then cleanup
11215 wx.CallAfter(self.Stop)
11216
11217
11218
11219#----------------------------------------------------------------------------
11220# Control which items in this module should be documented by epydoc.
11221# We allow only classes and functions, which will help reduce the size
11222# of the docs by filtering out the zillions of constants, EVT objects,
11223# and etc that don't make much sense by themselves, but are instead
11224# documented (or will be) as part of the classes/functions/methods
11225# where they should be used.
11226
d6c14a4c
RD
11227class __DocFilter:
11228 """
11229 A filter for epydoc that only allows non-Ptr classes and
11230 fucntions, in order to reduce the clutter in the API docs.
11231 """
11232 def __init__(self, globals):
11233 self._globals = globals
11234
11235 def __call__(self, name):
11236 import types
11237 obj = self._globals.get(name, None)
11238 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
11239 return False
11240 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
11241 return False
11242 return True
d55e5bfc
RD
11243
11244#----------------------------------------------------------------------------
11245#----------------------------------------------------------------------------
11246
11247# Import other modules in this package that should show up in the
11248# "core" wx namespace
11249from _gdi import *
11250from _windows import *
11251from _controls import *
11252from _misc import *
11253
11254
11255# Fixup the stock objects since they can't be used yet. (They will be
11256# restored in wx.PyApp.OnInit.)
11257_core_._wxPyFixStockObjects()
11258
11259#----------------------------------------------------------------------------
11260#----------------------------------------------------------------------------
11261
11262