]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
Add flags parameter to wx.Process.Kill and wx.Kill
[wxWidgets.git] / wxPython / src / gtk / _core.py
CommitLineData
d14a1e28
RD
1# This file was created automatically by SWIG.
2# Don't modify this file, modify the SWIG interface instead.
3
54f9ee45 4import _core_
d14a1e28
RD
5
6#// Give a reference to the dictionary of this module to the C++ extension
7#// code.
54f9ee45 8_core_._wxPySetDictionary(vars())
d14a1e28
RD
9
10#// A little trick to make 'wx' be a reference to this module so wx.Names can
11#// be used here.
12import sys as _sys
13wx = _sys.modules[__name__]
14
66c033b4
RD
15
16#----------------------------------------------------------------------------
17
18def _deprecated(callable, msg=None):
19 """
20 Create a wrapper function that will raise a DeprecationWarning
21 before calling the callable.
22 """
23 if msg is None:
24 msg = "%s is deprecated" % callable
25 def deprecatedWrapper(*args, **kwargs):
26 import warnings
27 warnings.warn(msg, DeprecationWarning, stacklevel=2)
28 return callable(*args, **kwargs)
29 deprecatedWrapper.__doc__ = msg
30 return deprecatedWrapper
31
32
33#----------------------------------------------------------------------------
34
54f9ee45
RD
35NOT_FOUND = _core_.NOT_FOUND
36VSCROLL = _core_.VSCROLL
37HSCROLL = _core_.HSCROLL
38CAPTION = _core_.CAPTION
39DOUBLE_BORDER = _core_.DOUBLE_BORDER
40SUNKEN_BORDER = _core_.SUNKEN_BORDER
41RAISED_BORDER = _core_.RAISED_BORDER
42BORDER = _core_.BORDER
43SIMPLE_BORDER = _core_.SIMPLE_BORDER
44STATIC_BORDER = _core_.STATIC_BORDER
45TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
46NO_BORDER = _core_.NO_BORDER
47TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
48WANTS_CHARS = _core_.WANTS_CHARS
49POPUP_WINDOW = _core_.POPUP_WINDOW
50CENTER_FRAME = _core_.CENTER_FRAME
51CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
52CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
53ED_CLIENT_MARGIN = _core_.ED_CLIENT_MARGIN
54ED_BUTTONS_BOTTOM = _core_.ED_BUTTONS_BOTTOM
55ED_BUTTONS_RIGHT = _core_.ED_BUTTONS_RIGHT
56ED_STATIC_LINE = _core_.ED_STATIC_LINE
57EXT_DIALOG_STYLE = _core_.EXT_DIALOG_STYLE
58CLIP_CHILDREN = _core_.CLIP_CHILDREN
59CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
60ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
61RETAINED = _core_.RETAINED
62BACKINGSTORE = _core_.BACKINGSTORE
63COLOURED = _core_.COLOURED
64FIXED_LENGTH = _core_.FIXED_LENGTH
65LB_NEEDED_SB = _core_.LB_NEEDED_SB
66LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
67LB_SORT = _core_.LB_SORT
68LB_SINGLE = _core_.LB_SINGLE
69LB_MULTIPLE = _core_.LB_MULTIPLE
70LB_EXTENDED = _core_.LB_EXTENDED
71LB_OWNERDRAW = _core_.LB_OWNERDRAW
72LB_HSCROLL = _core_.LB_HSCROLL
73PROCESS_ENTER = _core_.PROCESS_ENTER
74PASSWORD = _core_.PASSWORD
75CB_SIMPLE = _core_.CB_SIMPLE
76CB_DROPDOWN = _core_.CB_DROPDOWN
77CB_SORT = _core_.CB_SORT
78CB_READONLY = _core_.CB_READONLY
79RA_HORIZONTAL = _core_.RA_HORIZONTAL
80RA_VERTICAL = _core_.RA_VERTICAL
81RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
82RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
83RB_GROUP = _core_.RB_GROUP
84RB_SINGLE = _core_.RB_SINGLE
85SL_HORIZONTAL = _core_.SL_HORIZONTAL
86SL_VERTICAL = _core_.SL_VERTICAL
87SL_AUTOTICKS = _core_.SL_AUTOTICKS
88SL_LABELS = _core_.SL_LABELS
89SL_LEFT = _core_.SL_LEFT
90SL_TOP = _core_.SL_TOP
91SL_RIGHT = _core_.SL_RIGHT
92SL_BOTTOM = _core_.SL_BOTTOM
93SL_BOTH = _core_.SL_BOTH
94SL_SELRANGE = _core_.SL_SELRANGE
95SB_HORIZONTAL = _core_.SB_HORIZONTAL
96SB_VERTICAL = _core_.SB_VERTICAL
97ST_SIZEGRIP = _core_.ST_SIZEGRIP
98ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
99FLOOD_SURFACE = _core_.FLOOD_SURFACE
100FLOOD_BORDER = _core_.FLOOD_BORDER
101ODDEVEN_RULE = _core_.ODDEVEN_RULE
102WINDING_RULE = _core_.WINDING_RULE
103TOOL_TOP = _core_.TOOL_TOP
104TOOL_BOTTOM = _core_.TOOL_BOTTOM
105TOOL_LEFT = _core_.TOOL_LEFT
106TOOL_RIGHT = _core_.TOOL_RIGHT
107OK = _core_.OK
108YES_NO = _core_.YES_NO
109CANCEL = _core_.CANCEL
110YES = _core_.YES
111NO = _core_.NO
112NO_DEFAULT = _core_.NO_DEFAULT
113YES_DEFAULT = _core_.YES_DEFAULT
114ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
115ICON_HAND = _core_.ICON_HAND
116ICON_QUESTION = _core_.ICON_QUESTION
117ICON_INFORMATION = _core_.ICON_INFORMATION
118ICON_STOP = _core_.ICON_STOP
119ICON_ASTERISK = _core_.ICON_ASTERISK
120ICON_MASK = _core_.ICON_MASK
121ICON_WARNING = _core_.ICON_WARNING
122ICON_ERROR = _core_.ICON_ERROR
123FORWARD = _core_.FORWARD
124BACKWARD = _core_.BACKWARD
125RESET = _core_.RESET
126HELP = _core_.HELP
127MORE = _core_.MORE
128SETUP = _core_.SETUP
129SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
130SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
131SIZE_AUTO = _core_.SIZE_AUTO
132SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
133SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
134PORTRAIT = _core_.PORTRAIT
135LANDSCAPE = _core_.LANDSCAPE
136PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
137PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
138PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
139PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
140ID_ANY = _core_.ID_ANY
141ID_SEPARATOR = _core_.ID_SEPARATOR
142ID_LOWEST = _core_.ID_LOWEST
143ID_OPEN = _core_.ID_OPEN
144ID_CLOSE = _core_.ID_CLOSE
145ID_NEW = _core_.ID_NEW
146ID_SAVE = _core_.ID_SAVE
147ID_SAVEAS = _core_.ID_SAVEAS
148ID_REVERT = _core_.ID_REVERT
149ID_EXIT = _core_.ID_EXIT
150ID_UNDO = _core_.ID_UNDO
151ID_REDO = _core_.ID_REDO
152ID_HELP = _core_.ID_HELP
153ID_PRINT = _core_.ID_PRINT
154ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
155ID_PREVIEW = _core_.ID_PREVIEW
156ID_ABOUT = _core_.ID_ABOUT
157ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
158ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
159ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
160ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
161ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
162ID_PREFERENCES = _core_.ID_PREFERENCES
163ID_CUT = _core_.ID_CUT
164ID_COPY = _core_.ID_COPY
165ID_PASTE = _core_.ID_PASTE
166ID_CLEAR = _core_.ID_CLEAR
167ID_FIND = _core_.ID_FIND
168ID_DUPLICATE = _core_.ID_DUPLICATE
169ID_SELECTALL = _core_.ID_SELECTALL
170ID_DELETE = _core_.ID_DELETE
171ID_REPLACE = _core_.ID_REPLACE
172ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
173ID_PROPERTIES = _core_.ID_PROPERTIES
174ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
175ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
176ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
177ID_VIEW_LIST = _core_.ID_VIEW_LIST
178ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
179ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
180ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
181ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
182ID_FILE1 = _core_.ID_FILE1
183ID_FILE2 = _core_.ID_FILE2
184ID_FILE3 = _core_.ID_FILE3
185ID_FILE4 = _core_.ID_FILE4
186ID_FILE5 = _core_.ID_FILE5
187ID_FILE6 = _core_.ID_FILE6
188ID_FILE7 = _core_.ID_FILE7
189ID_FILE8 = _core_.ID_FILE8
190ID_FILE9 = _core_.ID_FILE9
191ID_OK = _core_.ID_OK
192ID_CANCEL = _core_.ID_CANCEL
193ID_APPLY = _core_.ID_APPLY
194ID_YES = _core_.ID_YES
195ID_NO = _core_.ID_NO
196ID_STATIC = _core_.ID_STATIC
197ID_FORWARD = _core_.ID_FORWARD
198ID_BACKWARD = _core_.ID_BACKWARD
199ID_DEFAULT = _core_.ID_DEFAULT
200ID_MORE = _core_.ID_MORE
201ID_SETUP = _core_.ID_SETUP
202ID_RESET = _core_.ID_RESET
203ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
204ID_YESTOALL = _core_.ID_YESTOALL
205ID_NOTOALL = _core_.ID_NOTOALL
206ID_ABORT = _core_.ID_ABORT
207ID_RETRY = _core_.ID_RETRY
208ID_IGNORE = _core_.ID_IGNORE
7bc1e663
RD
209ID_ADD = _core_.ID_ADD
210ID_REMOVE = _core_.ID_REMOVE
211ID_UP = _core_.ID_UP
212ID_DOWN = _core_.ID_DOWN
213ID_HOME = _core_.ID_HOME
214ID_REFRESH = _core_.ID_REFRESH
215ID_STOP = _core_.ID_STOP
216ID_INDEX = _core_.ID_INDEX
217ID_BOLD = _core_.ID_BOLD
218ID_ITALIC = _core_.ID_ITALIC
219ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
220ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
221ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
222ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
223ID_UNDERLINE = _core_.ID_UNDERLINE
224ID_INDENT = _core_.ID_INDENT
225ID_UNINDENT = _core_.ID_UNINDENT
226ID_ZOOM_100 = _core_.ID_ZOOM_100
227ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
228ID_ZOOM_IN = _core_.ID_ZOOM_IN
229ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
230ID_UNDELETE = _core_.ID_UNDELETE
231ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
54f9ee45
RD
232ID_HIGHEST = _core_.ID_HIGHEST
233OPEN = _core_.OPEN
234SAVE = _core_.SAVE
235HIDE_READONLY = _core_.HIDE_READONLY
236OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
237FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
238MULTIPLE = _core_.MULTIPLE
239CHANGE_DIR = _core_.CHANGE_DIR
240ACCEL_ALT = _core_.ACCEL_ALT
241ACCEL_CTRL = _core_.ACCEL_CTRL
242ACCEL_SHIFT = _core_.ACCEL_SHIFT
243ACCEL_NORMAL = _core_.ACCEL_NORMAL
244PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
245PD_APP_MODAL = _core_.PD_APP_MODAL
246PD_CAN_ABORT = _core_.PD_CAN_ABORT
247PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
248PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
249PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
250DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
251DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
252MENU_TEAROFF = _core_.MENU_TEAROFF
253MB_DOCKABLE = _core_.MB_DOCKABLE
254NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
255FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
256LI_HORIZONTAL = _core_.LI_HORIZONTAL
257LI_VERTICAL = _core_.LI_VERTICAL
258WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
259WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
260WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
261WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
262WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
263WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
264MM_TEXT = _core_.MM_TEXT
265MM_LOMETRIC = _core_.MM_LOMETRIC
266MM_HIMETRIC = _core_.MM_HIMETRIC
267MM_LOENGLISH = _core_.MM_LOENGLISH
268MM_HIENGLISH = _core_.MM_HIENGLISH
269MM_TWIPS = _core_.MM_TWIPS
270MM_ISOTROPIC = _core_.MM_ISOTROPIC
271MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
272MM_POINTS = _core_.MM_POINTS
273MM_METRIC = _core_.MM_METRIC
274CENTRE = _core_.CENTRE
275CENTER = _core_.CENTER
276HORIZONTAL = _core_.HORIZONTAL
277VERTICAL = _core_.VERTICAL
278BOTH = _core_.BOTH
279LEFT = _core_.LEFT
280RIGHT = _core_.RIGHT
281UP = _core_.UP
282DOWN = _core_.DOWN
283TOP = _core_.TOP
284BOTTOM = _core_.BOTTOM
285NORTH = _core_.NORTH
286SOUTH = _core_.SOUTH
287WEST = _core_.WEST
288EAST = _core_.EAST
289ALL = _core_.ALL
290ALIGN_NOT = _core_.ALIGN_NOT
291ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
292ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
293ALIGN_LEFT = _core_.ALIGN_LEFT
294ALIGN_TOP = _core_.ALIGN_TOP
295ALIGN_RIGHT = _core_.ALIGN_RIGHT
296ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
297ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
298ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
299ALIGN_CENTER = _core_.ALIGN_CENTER
300ALIGN_CENTRE = _core_.ALIGN_CENTRE
301ALIGN_MASK = _core_.ALIGN_MASK
302STRETCH_NOT = _core_.STRETCH_NOT
303SHRINK = _core_.SHRINK
304GROW = _core_.GROW
305EXPAND = _core_.EXPAND
306SHAPED = _core_.SHAPED
307FIXED_MINSIZE = _core_.FIXED_MINSIZE
308TILE = _core_.TILE
309ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
310BORDER_DEFAULT = _core_.BORDER_DEFAULT
311BORDER_NONE = _core_.BORDER_NONE
312BORDER_STATIC = _core_.BORDER_STATIC
313BORDER_SIMPLE = _core_.BORDER_SIMPLE
314BORDER_RAISED = _core_.BORDER_RAISED
315BORDER_SUNKEN = _core_.BORDER_SUNKEN
316BORDER_DOUBLE = _core_.BORDER_DOUBLE
317BORDER_MASK = _core_.BORDER_MASK
7bc1e663
RD
318BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
319BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
320BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
54f9ee45
RD
321DEFAULT = _core_.DEFAULT
322DECORATIVE = _core_.DECORATIVE
323ROMAN = _core_.ROMAN
324SCRIPT = _core_.SCRIPT
325SWISS = _core_.SWISS
326MODERN = _core_.MODERN
327TELETYPE = _core_.TELETYPE
328VARIABLE = _core_.VARIABLE
329FIXED = _core_.FIXED
330NORMAL = _core_.NORMAL
331LIGHT = _core_.LIGHT
332BOLD = _core_.BOLD
333ITALIC = _core_.ITALIC
334SLANT = _core_.SLANT
335SOLID = _core_.SOLID
336DOT = _core_.DOT
337LONG_DASH = _core_.LONG_DASH
338SHORT_DASH = _core_.SHORT_DASH
339DOT_DASH = _core_.DOT_DASH
340USER_DASH = _core_.USER_DASH
341TRANSPARENT = _core_.TRANSPARENT
342STIPPLE = _core_.STIPPLE
343BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
344CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
345FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
346CROSS_HATCH = _core_.CROSS_HATCH
347HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
348VERTICAL_HATCH = _core_.VERTICAL_HATCH
349JOIN_BEVEL = _core_.JOIN_BEVEL
350JOIN_MITER = _core_.JOIN_MITER
351JOIN_ROUND = _core_.JOIN_ROUND
352CAP_ROUND = _core_.CAP_ROUND
353CAP_PROJECTING = _core_.CAP_PROJECTING
354CAP_BUTT = _core_.CAP_BUTT
355CLEAR = _core_.CLEAR
356XOR = _core_.XOR
357INVERT = _core_.INVERT
358OR_REVERSE = _core_.OR_REVERSE
359AND_REVERSE = _core_.AND_REVERSE
360COPY = _core_.COPY
361AND = _core_.AND
362AND_INVERT = _core_.AND_INVERT
363NO_OP = _core_.NO_OP
364NOR = _core_.NOR
365EQUIV = _core_.EQUIV
366SRC_INVERT = _core_.SRC_INVERT
367OR_INVERT = _core_.OR_INVERT
368NAND = _core_.NAND
369OR = _core_.OR
370SET = _core_.SET
371WXK_BACK = _core_.WXK_BACK
372WXK_TAB = _core_.WXK_TAB
373WXK_RETURN = _core_.WXK_RETURN
374WXK_ESCAPE = _core_.WXK_ESCAPE
375WXK_SPACE = _core_.WXK_SPACE
376WXK_DELETE = _core_.WXK_DELETE
377WXK_START = _core_.WXK_START
378WXK_LBUTTON = _core_.WXK_LBUTTON
379WXK_RBUTTON = _core_.WXK_RBUTTON
380WXK_CANCEL = _core_.WXK_CANCEL
381WXK_MBUTTON = _core_.WXK_MBUTTON
382WXK_CLEAR = _core_.WXK_CLEAR
383WXK_SHIFT = _core_.WXK_SHIFT
384WXK_ALT = _core_.WXK_ALT
385WXK_CONTROL = _core_.WXK_CONTROL
386WXK_MENU = _core_.WXK_MENU
387WXK_PAUSE = _core_.WXK_PAUSE
388WXK_CAPITAL = _core_.WXK_CAPITAL
389WXK_PRIOR = _core_.WXK_PRIOR
390WXK_NEXT = _core_.WXK_NEXT
391WXK_END = _core_.WXK_END
392WXK_HOME = _core_.WXK_HOME
393WXK_LEFT = _core_.WXK_LEFT
394WXK_UP = _core_.WXK_UP
395WXK_RIGHT = _core_.WXK_RIGHT
396WXK_DOWN = _core_.WXK_DOWN
397WXK_SELECT = _core_.WXK_SELECT
398WXK_PRINT = _core_.WXK_PRINT
399WXK_EXECUTE = _core_.WXK_EXECUTE
400WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
401WXK_INSERT = _core_.WXK_INSERT
402WXK_HELP = _core_.WXK_HELP
403WXK_NUMPAD0 = _core_.WXK_NUMPAD0
404WXK_NUMPAD1 = _core_.WXK_NUMPAD1
405WXK_NUMPAD2 = _core_.WXK_NUMPAD2
406WXK_NUMPAD3 = _core_.WXK_NUMPAD3
407WXK_NUMPAD4 = _core_.WXK_NUMPAD4
408WXK_NUMPAD5 = _core_.WXK_NUMPAD5
409WXK_NUMPAD6 = _core_.WXK_NUMPAD6
410WXK_NUMPAD7 = _core_.WXK_NUMPAD7
411WXK_NUMPAD8 = _core_.WXK_NUMPAD8
412WXK_NUMPAD9 = _core_.WXK_NUMPAD9
413WXK_MULTIPLY = _core_.WXK_MULTIPLY
414WXK_ADD = _core_.WXK_ADD
415WXK_SEPARATOR = _core_.WXK_SEPARATOR
416WXK_SUBTRACT = _core_.WXK_SUBTRACT
417WXK_DECIMAL = _core_.WXK_DECIMAL
418WXK_DIVIDE = _core_.WXK_DIVIDE
419WXK_F1 = _core_.WXK_F1
420WXK_F2 = _core_.WXK_F2
421WXK_F3 = _core_.WXK_F3
422WXK_F4 = _core_.WXK_F4
423WXK_F5 = _core_.WXK_F5
424WXK_F6 = _core_.WXK_F6
425WXK_F7 = _core_.WXK_F7
426WXK_F8 = _core_.WXK_F8
427WXK_F9 = _core_.WXK_F9
428WXK_F10 = _core_.WXK_F10
429WXK_F11 = _core_.WXK_F11
430WXK_F12 = _core_.WXK_F12
431WXK_F13 = _core_.WXK_F13
432WXK_F14 = _core_.WXK_F14
433WXK_F15 = _core_.WXK_F15
434WXK_F16 = _core_.WXK_F16
435WXK_F17 = _core_.WXK_F17
436WXK_F18 = _core_.WXK_F18
437WXK_F19 = _core_.WXK_F19
438WXK_F20 = _core_.WXK_F20
439WXK_F21 = _core_.WXK_F21
440WXK_F22 = _core_.WXK_F22
441WXK_F23 = _core_.WXK_F23
442WXK_F24 = _core_.WXK_F24
443WXK_NUMLOCK = _core_.WXK_NUMLOCK
444WXK_SCROLL = _core_.WXK_SCROLL
445WXK_PAGEUP = _core_.WXK_PAGEUP
446WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
447WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
448WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
449WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
450WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
451WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
452WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
453WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
454WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
455WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
456WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
457WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
458WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
459WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
460WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
461WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
462WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
463WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
464WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
465WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
466WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
467WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
468WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
469WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
470WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
471WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
472WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
473WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
474WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
475WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
476WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
477PAPER_NONE = _core_.PAPER_NONE
478PAPER_LETTER = _core_.PAPER_LETTER
479PAPER_LEGAL = _core_.PAPER_LEGAL
480PAPER_A4 = _core_.PAPER_A4
481PAPER_CSHEET = _core_.PAPER_CSHEET
482PAPER_DSHEET = _core_.PAPER_DSHEET
483PAPER_ESHEET = _core_.PAPER_ESHEET
484PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
485PAPER_TABLOID = _core_.PAPER_TABLOID
486PAPER_LEDGER = _core_.PAPER_LEDGER
487PAPER_STATEMENT = _core_.PAPER_STATEMENT
488PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
489PAPER_A3 = _core_.PAPER_A3
490PAPER_A4SMALL = _core_.PAPER_A4SMALL
491PAPER_A5 = _core_.PAPER_A5
492PAPER_B4 = _core_.PAPER_B4
493PAPER_B5 = _core_.PAPER_B5
494PAPER_FOLIO = _core_.PAPER_FOLIO
495PAPER_QUARTO = _core_.PAPER_QUARTO
496PAPER_10X14 = _core_.PAPER_10X14
497PAPER_11X17 = _core_.PAPER_11X17
498PAPER_NOTE = _core_.PAPER_NOTE
499PAPER_ENV_9 = _core_.PAPER_ENV_9
500PAPER_ENV_10 = _core_.PAPER_ENV_10
501PAPER_ENV_11 = _core_.PAPER_ENV_11
502PAPER_ENV_12 = _core_.PAPER_ENV_12
503PAPER_ENV_14 = _core_.PAPER_ENV_14
504PAPER_ENV_DL = _core_.PAPER_ENV_DL
505PAPER_ENV_C5 = _core_.PAPER_ENV_C5
506PAPER_ENV_C3 = _core_.PAPER_ENV_C3
507PAPER_ENV_C4 = _core_.PAPER_ENV_C4
508PAPER_ENV_C6 = _core_.PAPER_ENV_C6
509PAPER_ENV_C65 = _core_.PAPER_ENV_C65
510PAPER_ENV_B4 = _core_.PAPER_ENV_B4
511PAPER_ENV_B5 = _core_.PAPER_ENV_B5
512PAPER_ENV_B6 = _core_.PAPER_ENV_B6
513PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
514PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
515PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
516PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
517PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
518PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
519PAPER_ISO_B4 = _core_.PAPER_ISO_B4
520PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
521PAPER_9X11 = _core_.PAPER_9X11
522PAPER_10X11 = _core_.PAPER_10X11
523PAPER_15X11 = _core_.PAPER_15X11
524PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
525PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
526PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
527PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
528PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
529PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
530PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
531PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
532PAPER_A_PLUS = _core_.PAPER_A_PLUS
533PAPER_B_PLUS = _core_.PAPER_B_PLUS
534PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
535PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
536PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
537PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
538PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
539PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
540PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
541PAPER_A2 = _core_.PAPER_A2
542PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
543PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
544DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
545DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
546DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
547ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
548ITEM_NORMAL = _core_.ITEM_NORMAL
549ITEM_CHECK = _core_.ITEM_CHECK
550ITEM_RADIO = _core_.ITEM_RADIO
551ITEM_MAX = _core_.ITEM_MAX
552HT_NOWHERE = _core_.HT_NOWHERE
553HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
554HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
555HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
556HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
557HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
558HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
559HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
560HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
561HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
562HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
563HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
564HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
565HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
566HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
567HT_MAX = _core_.HT_MAX
568MOD_NONE = _core_.MOD_NONE
569MOD_ALT = _core_.MOD_ALT
570MOD_CONTROL = _core_.MOD_CONTROL
571MOD_SHIFT = _core_.MOD_SHIFT
572MOD_WIN = _core_.MOD_WIN
573UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
574UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
575UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d14a1e28
RD
576#---------------------------------------------------------------------------
577
578class Object(object):
0df68c9f
RD
579 """
580 The base class for most wx objects, although in wxPython not
581 much functionality is needed nor exposed.
582 """
d14a1e28
RD
583 def __init__(self): raise RuntimeError, "No constructor defined"
584 def __repr__(self):
585 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 586 def GetClassName(*args, **kwargs):
0df68c9f 587 """
a95a7133 588 GetClassName(self) -> String
e811c8ce 589
a95a7133 590 Returns the class name of the C++ class using wxRTTI.
0df68c9f 591 """
54f9ee45 592 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
593
594 def Destroy(*args, **kwargs):
0df68c9f 595 """
a95a7133 596 Destroy(self)
e811c8ce 597
0df68c9f
RD
598 Deletes the C++ object this Python object is a proxy for.
599 """
54f9ee45 600 return _core_.Object_Destroy(*args, **kwargs)
e811c8ce 601
d14a1e28
RD
602
603class ObjectPtr(Object):
604 def __init__(self, this):
605 self.this = this
606 if not hasattr(self,"thisown"): self.thisown = 0
607 self.__class__ = Object
54f9ee45
RD
608_core_.Object_swigregister(ObjectPtr)
609_wxPySetDictionary = _core_._wxPySetDictionary
d14a1e28 610
54f9ee45 611_wxPyFixStockObjects = _core_._wxPyFixStockObjects
3a04f143 612
54f9ee45 613cvar = _core_.cvar
196addbf 614EmptyString = cvar.EmptyString
d14a1e28
RD
615
616#---------------------------------------------------------------------------
617
54f9ee45
RD
618BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
619BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
620BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
621BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
622BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
623BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
624BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
625BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
626BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
627BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
628BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
629BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
630BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
631BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
632BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
633BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
634BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
635BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
636BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
637BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
638CURSOR_NONE = _core_.CURSOR_NONE
639CURSOR_ARROW = _core_.CURSOR_ARROW
640CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
641CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
642CURSOR_CHAR = _core_.CURSOR_CHAR
643CURSOR_CROSS = _core_.CURSOR_CROSS
644CURSOR_HAND = _core_.CURSOR_HAND
645CURSOR_IBEAM = _core_.CURSOR_IBEAM
646CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
647CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
648CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
649CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
650CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
651CURSOR_PENCIL = _core_.CURSOR_PENCIL
652CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
653CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
654CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
655CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
656CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
657CURSOR_SIZENS = _core_.CURSOR_SIZENS
658CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
659CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
660CURSOR_SIZING = _core_.CURSOR_SIZING
661CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
662CURSOR_WAIT = _core_.CURSOR_WAIT
663CURSOR_WATCH = _core_.CURSOR_WATCH
664CURSOR_BLANK = _core_.CURSOR_BLANK
665CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
666CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
667CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
668CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
669#---------------------------------------------------------------------------
670
671class Size(object):
0df68c9f 672 """
41e2b43e
RD
673 wx.Size is a useful data structure used to represent the size of
674 something. It simply contians integer width and height proprtites.
675 In most places in wxPython where a wx.Size is expected a
676 (width,height) tuple can be used instead.
0df68c9f 677 """
e811c8ce
RD
678 def __repr__(self):
679 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
680 width = property(_core_.Size_width_get, _core_.Size_width_set)
681 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 682 x = width; y = height
d14a1e28 683 def __init__(self, *args, **kwargs):
0df68c9f 684 """
a95a7133 685 __init__(self, int w=0, int h=0) -> Size
e811c8ce 686
0df68c9f
RD
687 Creates a size object.
688 """
54f9ee45 689 newobj = _core_.new_Size(*args, **kwargs)
d14a1e28
RD
690 self.this = newobj.this
691 self.thisown = 1
692 del newobj.thisown
54f9ee45 693 def __del__(self, destroy=_core_.delete_Size):
a95a7133 694 """__del__(self)"""
d14a1e28
RD
695 try:
696 if self.thisown: destroy(self)
697 except: pass
e811c8ce
RD
698
699 def __eq__(*args, **kwargs):
0df68c9f 700 """
a95a7133 701 __eq__(self, Size sz) -> bool
e811c8ce 702
0df68c9f
RD
703 Test for equality of wx.Size objects.
704 """
54f9ee45 705 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
706
707 def __ne__(*args, **kwargs):
0df68c9f 708 """
a95a7133 709 __ne__(self, Size sz) -> bool
e811c8ce 710
0df68c9f
RD
711 Test for inequality.
712 """
54f9ee45 713 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
714
715 def __add__(*args, **kwargs):
0df68c9f 716 """
a95a7133 717 __add__(self, Size sz) -> Size
e811c8ce 718
0df68c9f
RD
719 Add sz's proprties to this and return the result.
720 """
54f9ee45 721 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
722
723 def __sub__(*args, **kwargs):
0df68c9f 724 """
a95a7133 725 __sub__(self, Size sz) -> Size
e811c8ce 726
0df68c9f
RD
727 Subtract sz's properties from this and return the result.
728 """
54f9ee45 729 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
730
731 def IncTo(*args, **kwargs):
0df68c9f 732 """
a95a7133 733 IncTo(self, Size sz)
e811c8ce 734
0df68c9f
RD
735 Increments this object so that both of its dimensions are not less
736 than the corresponding dimensions of the size.
737 """
54f9ee45 738 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
739
740 def DecTo(*args, **kwargs):
0df68c9f 741 """
a95a7133 742 DecTo(self, Size sz)
e811c8ce 743
0df68c9f
RD
744 Decrements this object so that both of its dimensions are not greater
745 than the corresponding dimensions of the size.
746 """
54f9ee45 747 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce
RD
748
749 def Set(*args, **kwargs):
0df68c9f 750 """
a95a7133 751 Set(self, int w, int h)
e811c8ce 752
0df68c9f
RD
753 Set both width and height.
754 """
54f9ee45 755 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
756
757 def SetWidth(*args, **kwargs):
a95a7133 758 """SetWidth(self, int w)"""
54f9ee45 759 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
760
761 def SetHeight(*args, **kwargs):
a95a7133 762 """SetHeight(self, int h)"""
54f9ee45 763 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
764
765 def GetWidth(*args, **kwargs):
a95a7133 766 """GetWidth(self) -> int"""
54f9ee45 767 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
768
769 def GetHeight(*args, **kwargs):
a95a7133 770 """GetHeight(self) -> int"""
54f9ee45 771 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 772
74a57fcd
RD
773 def IsFullySpecified(*args, **kwargs):
774 """
a95a7133 775 IsFullySpecified(self) -> bool
74a57fcd
RD
776
777 Returns True if both components of the size are non-default values.
778 """
54f9ee45 779 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
780
781 def SetDefaults(*args, **kwargs):
782 """
a95a7133 783 SetDefaults(self, Size size)
74a57fcd 784
41e2b43e
RD
785 Combine this size with the other one replacing the default components
786 of this object (i.e. equal to -1) with those of the other.
74a57fcd 787 """
54f9ee45 788 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 789
e811c8ce 790 def Get(*args, **kwargs):
0df68c9f
RD
791 """
792 Get() -> (width,height)
e811c8ce 793
0df68c9f
RD
794 Returns the width and height properties as a tuple.
795 """
54f9ee45 796 return _core_.Size_Get(*args, **kwargs)
e811c8ce 797
41e2b43e 798 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
799 def __str__(self): return str(self.Get())
800 def __repr__(self): return 'wx.Size'+str(self.Get())
801 def __len__(self): return len(self.Get())
802 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
803 def __setitem__(self, index, val):
804 if index == 0: self.width = val
805 elif index == 1: self.height = val
806 else: raise IndexError
e811c8ce 807 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
808 __safe_for_unpickling__ = True
809 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28
RD
810
811
812class SizePtr(Size):
813 def __init__(self, this):
814 self.this = this
815 if not hasattr(self,"thisown"): self.thisown = 0
816 self.__class__ = Size
54f9ee45 817_core_.Size_swigregister(SizePtr)
d14a1e28
RD
818
819#---------------------------------------------------------------------------
820
821class RealPoint(object):
0df68c9f 822 """
41e2b43e
RD
823 A data structure for representing a point or position with floating
824 point x and y properties. In wxPython most places that expect a
825 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 826 """
e811c8ce
RD
827 def __repr__(self):
828 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
829 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
830 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
d14a1e28 831 def __init__(self, *args, **kwargs):
0df68c9f 832 """
a95a7133 833 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 834
0df68c9f
RD
835 Create a wx.RealPoint object
836 """
54f9ee45 837 newobj = _core_.new_RealPoint(*args, **kwargs)
d14a1e28
RD
838 self.this = newobj.this
839 self.thisown = 1
840 del newobj.thisown
54f9ee45 841 def __del__(self, destroy=_core_.delete_RealPoint):
a95a7133 842 """__del__(self)"""
d14a1e28
RD
843 try:
844 if self.thisown: destroy(self)
845 except: pass
e811c8ce
RD
846
847 def __eq__(*args, **kwargs):
0df68c9f 848 """
a95a7133 849 __eq__(self, RealPoint pt) -> bool
e811c8ce 850
0df68c9f
RD
851 Test for equality of wx.RealPoint objects.
852 """
54f9ee45 853 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
854
855 def __ne__(*args, **kwargs):
0df68c9f 856 """
a95a7133 857 __ne__(self, RealPoint pt) -> bool
e811c8ce 858
0df68c9f
RD
859 Test for inequality of wx.RealPoint objects.
860 """
54f9ee45 861 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
862
863 def __add__(*args, **kwargs):
0df68c9f 864 """
a95a7133 865 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 866
0df68c9f
RD
867 Add pt's proprties to this and return the result.
868 """
54f9ee45 869 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
870
871 def __sub__(*args, **kwargs):
0df68c9f 872 """
a95a7133 873 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 874
0df68c9f
RD
875 Subtract pt's proprties from this and return the result
876 """
54f9ee45 877 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
878
879 def Set(*args, **kwargs):
0df68c9f 880 """
a95a7133 881 Set(self, double x, double y)
e811c8ce 882
0df68c9f
RD
883 Set both the x and y properties
884 """
54f9ee45 885 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
886
887 def Get(*args, **kwargs):
0df68c9f
RD
888 """
889 Get() -> (x,y)
e811c8ce 890
0df68c9f
RD
891 Return the x and y properties as a tuple.
892 """
54f9ee45 893 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 894
41e2b43e 895 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
896 def __str__(self): return str(self.Get())
897 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
898 def __len__(self): return len(self.Get())
899 def __getitem__(self, index): return self.Get()[index]
d14a1e28 900 def __setitem__(self, index, val):
e811c8ce
RD
901 if index == 0: self.x = val
902 elif index == 1: self.y = val
d14a1e28 903 else: raise IndexError
e811c8ce 904 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
905 __safe_for_unpickling__ = True
906 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28
RD
907
908
909class RealPointPtr(RealPoint):
910 def __init__(self, this):
911 self.this = this
912 if not hasattr(self,"thisown"): self.thisown = 0
913 self.__class__ = RealPoint
54f9ee45 914_core_.RealPoint_swigregister(RealPointPtr)
d14a1e28
RD
915
916#---------------------------------------------------------------------------
917
918class Point(object):
0df68c9f 919 """
41e2b43e
RD
920 A data structure for representing a point or position with integer x
921 and y properties. Most places in wxPython that expect a wx.Point can
922 also accept a (x,y) tuple.
0df68c9f 923 """
e811c8ce
RD
924 def __repr__(self):
925 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
926 x = property(_core_.Point_x_get, _core_.Point_x_set)
927 y = property(_core_.Point_y_get, _core_.Point_y_set)
d14a1e28 928 def __init__(self, *args, **kwargs):
0df68c9f 929 """
a95a7133 930 __init__(self, int x=0, int y=0) -> Point
e811c8ce 931
0df68c9f
RD
932 Create a wx.Point object
933 """
54f9ee45 934 newobj = _core_.new_Point(*args, **kwargs)
d14a1e28
RD
935 self.this = newobj.this
936 self.thisown = 1
937 del newobj.thisown
54f9ee45 938 def __del__(self, destroy=_core_.delete_Point):
a95a7133 939 """__del__(self)"""
d14a1e28
RD
940 try:
941 if self.thisown: destroy(self)
942 except: pass
e811c8ce
RD
943
944 def __eq__(*args, **kwargs):
0df68c9f 945 """
a95a7133 946 __eq__(self, Point pt) -> bool
e811c8ce 947
0df68c9f
RD
948 Test for equality of wx.Point objects.
949 """
54f9ee45 950 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
951
952 def __ne__(*args, **kwargs):
0df68c9f 953 """
a95a7133 954 __ne__(self, Point pt) -> bool
e811c8ce 955
0df68c9f
RD
956 Test for inequality of wx.Point objects.
957 """
54f9ee45 958 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
959
960 def __add__(*args, **kwargs):
0df68c9f 961 """
a95a7133 962 __add__(self, Point pt) -> Point
e811c8ce 963
0df68c9f
RD
964 Add pt's proprties to this and return the result.
965 """
54f9ee45 966 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
967
968 def __sub__(*args, **kwargs):
0df68c9f 969 """
a95a7133 970 __sub__(self, Point pt) -> Point
e811c8ce 971
0df68c9f
RD
972 Subtract pt's proprties from this and return the result
973 """
54f9ee45 974 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
975
976 def __iadd__(*args, **kwargs):
0df68c9f 977 """
a95a7133 978 __iadd__(self, Point pt) -> Point
e811c8ce 979
0df68c9f
RD
980 Add pt to this object.
981 """
54f9ee45 982 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
983
984 def __isub__(*args, **kwargs):
0df68c9f 985 """
a95a7133 986 __isub__(self, Point pt) -> Point
e811c8ce 987
0df68c9f
RD
988 Subtract pt from this object.
989 """
54f9ee45 990 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
991
992 def Set(*args, **kwargs):
0df68c9f 993 """
a95a7133 994 Set(self, long x, long y)
e811c8ce 995
0df68c9f
RD
996 Set both the x and y properties
997 """
54f9ee45 998 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
999
1000 def Get(*args, **kwargs):
0df68c9f
RD
1001 """
1002 Get() -> (x,y)
e811c8ce 1003
0df68c9f
RD
1004 Return the x and y properties as a tuple.
1005 """
54f9ee45 1006 return _core_.Point_Get(*args, **kwargs)
e811c8ce 1007
41e2b43e 1008 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1009 def __str__(self): return str(self.Get())
1010 def __repr__(self): return 'wx.Point'+str(self.Get())
1011 def __len__(self): return len(self.Get())
1012 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1013 def __setitem__(self, index, val):
1014 if index == 0: self.x = val
1015 elif index == 1: self.y = val
1016 else: raise IndexError
e811c8ce 1017 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
1018 __safe_for_unpickling__ = True
1019 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28
RD
1020
1021
1022class PointPtr(Point):
1023 def __init__(self, this):
1024 self.this = this
1025 if not hasattr(self,"thisown"): self.thisown = 0
1026 self.__class__ = Point
54f9ee45 1027_core_.Point_swigregister(PointPtr)
d14a1e28
RD
1028
1029#---------------------------------------------------------------------------
1030
1031class Rect(object):
0df68c9f 1032 """
41e2b43e
RD
1033 A class for representing and manipulating rectangles. It has x, y,
1034 width and height properties. In wxPython most palces that expect a
1035 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1036 """
e811c8ce
RD
1037 def __repr__(self):
1038 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1039 def __init__(self, *args, **kwargs):
0df68c9f 1040 """
a95a7133 1041 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1042
0df68c9f
RD
1043 Create a new Rect object.
1044 """
54f9ee45 1045 newobj = _core_.new_Rect(*args, **kwargs)
d14a1e28
RD
1046 self.this = newobj.this
1047 self.thisown = 1
1048 del newobj.thisown
54f9ee45 1049 def __del__(self, destroy=_core_.delete_Rect):
a95a7133 1050 """__del__(self)"""
d14a1e28
RD
1051 try:
1052 if self.thisown: destroy(self)
1053 except: pass
e811c8ce
RD
1054
1055 def GetX(*args, **kwargs):
a95a7133 1056 """GetX(self) -> int"""
54f9ee45 1057 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1058
1059 def SetX(*args, **kwargs):
a95a7133 1060 """SetX(self, int x)"""
54f9ee45 1061 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1062
1063 def GetY(*args, **kwargs):
a95a7133 1064 """GetY(self) -> int"""
54f9ee45 1065 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1066
1067 def SetY(*args, **kwargs):
a95a7133 1068 """SetY(self, int y)"""
54f9ee45 1069 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1070
1071 def GetWidth(*args, **kwargs):
a95a7133 1072 """GetWidth(self) -> int"""
54f9ee45 1073 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1074
1075 def SetWidth(*args, **kwargs):
a95a7133 1076 """SetWidth(self, int w)"""
54f9ee45 1077 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1078
1079 def GetHeight(*args, **kwargs):
a95a7133 1080 """GetHeight(self) -> int"""
54f9ee45 1081 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1082
1083 def SetHeight(*args, **kwargs):
a95a7133 1084 """SetHeight(self, int h)"""
54f9ee45 1085 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1086
1087 def GetPosition(*args, **kwargs):
a95a7133 1088 """GetPosition(self) -> Point"""
54f9ee45 1089 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1090
1091 def SetPosition(*args, **kwargs):
a95a7133 1092 """SetPosition(self, Point p)"""
54f9ee45 1093 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1094
1095 def GetSize(*args, **kwargs):
a95a7133 1096 """GetSize(self) -> Size"""
54f9ee45 1097 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1098
1099 def SetSize(*args, **kwargs):
a95a7133 1100 """SetSize(self, Size s)"""
54f9ee45 1101 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1102
c9c7117a 1103 def GetTopLeft(*args, **kwargs):
a95a7133 1104 """GetTopLeft(self) -> Point"""
54f9ee45 1105 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1106
1107 def SetTopLeft(*args, **kwargs):
a95a7133 1108 """SetTopLeft(self, Point p)"""
54f9ee45 1109 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1110
1111 def GetBottomRight(*args, **kwargs):
a95a7133 1112 """GetBottomRight(self) -> Point"""
54f9ee45 1113 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1114
1115 def SetBottomRight(*args, **kwargs):
a95a7133 1116 """SetBottomRight(self, Point p)"""
54f9ee45 1117 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1118
e811c8ce 1119 def GetLeft(*args, **kwargs):
a95a7133 1120 """GetLeft(self) -> int"""
54f9ee45 1121 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1122
1123 def GetTop(*args, **kwargs):
a95a7133 1124 """GetTop(self) -> int"""
54f9ee45 1125 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1126
1127 def GetBottom(*args, **kwargs):
a95a7133 1128 """GetBottom(self) -> int"""
54f9ee45 1129 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1130
1131 def GetRight(*args, **kwargs):
a95a7133 1132 """GetRight(self) -> int"""
54f9ee45 1133 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1134
1135 def SetLeft(*args, **kwargs):
a95a7133 1136 """SetLeft(self, int left)"""
54f9ee45 1137 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1138
1139 def SetRight(*args, **kwargs):
a95a7133 1140 """SetRight(self, int right)"""
54f9ee45 1141 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1142
1143 def SetTop(*args, **kwargs):
a95a7133 1144 """SetTop(self, int top)"""
54f9ee45 1145 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1146
1147 def SetBottom(*args, **kwargs):
a95a7133 1148 """SetBottom(self, int bottom)"""
54f9ee45 1149 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1150
1151 position = property(GetPosition, SetPosition)
1152 size = property(GetSize, SetSize)
1153 left = property(GetLeft, SetLeft)
1154 right = property(GetRight, SetRight)
1155 top = property(GetTop, SetTop)
1156 bottom = property(GetBottom, SetBottom)
1157
1158 def Inflate(*args, **kwargs):
0df68c9f 1159 """
a95a7133 1160 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1161
41e2b43e
RD
1162 Increase the rectangle size by dx in x direction and dy in y
1163 direction. Both or one of) parameters may be negative to decrease the
1164 rectangle size.
0df68c9f 1165 """
54f9ee45 1166 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1167
1168 def Deflate(*args, **kwargs):
0df68c9f 1169 """
a95a7133 1170 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1171
41e2b43e
RD
1172 Decrease the rectangle size by dx in x direction and dy in y
1173 direction. Both or one of) parameters may be negative to increase the
1174 rectngle size. This method is the opposite of Inflate.
0df68c9f 1175 """
54f9ee45 1176 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1177
1178 def OffsetXY(*args, **kwargs):
0df68c9f 1179 """
a95a7133 1180 OffsetXY(self, int dx, int dy)
e811c8ce 1181
41e2b43e
RD
1182 Moves the rectangle by the specified offset. If dx is positive, the
1183 rectangle is moved to the right, if dy is positive, it is moved to the
1184 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1185 """
54f9ee45 1186 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1187
1188 def Offset(*args, **kwargs):
0df68c9f 1189 """
a95a7133 1190 Offset(self, Point pt)
e811c8ce 1191
0df68c9f
RD
1192 Same as OffsetXY but uses dx,dy from Point
1193 """
54f9ee45 1194 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1195
1196 def Intersect(*args, **kwargs):
0df68c9f 1197 """
a95a7133 1198 Intersect(self, Rect rect) -> Rect
e811c8ce 1199
0df68c9f
RD
1200 Return the intersectsion of this rectangle and rect.
1201 """
54f9ee45 1202 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce
RD
1203
1204 def __add__(*args, **kwargs):
0df68c9f 1205 """
a95a7133 1206 __add__(self, Rect rect) -> Rect
e811c8ce 1207
0df68c9f
RD
1208 Add the properties of rect to this rectangle and return the result.
1209 """
54f9ee45 1210 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1211
1212 def __iadd__(*args, **kwargs):
0df68c9f 1213 """
a95a7133 1214 __iadd__(self, Rect rect) -> Rect
e811c8ce 1215
0df68c9f
RD
1216 Add the properties of rect to this rectangle, updating this rectangle.
1217 """
54f9ee45 1218 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1219
1220 def __eq__(*args, **kwargs):
0df68c9f 1221 """
a95a7133 1222 __eq__(self, Rect rect) -> bool
e811c8ce 1223
0df68c9f
RD
1224 Test for equality.
1225 """
54f9ee45 1226 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1227
1228 def __ne__(*args, **kwargs):
0df68c9f 1229 """
a95a7133 1230 __ne__(self, Rect rect) -> bool
e811c8ce 1231
0df68c9f
RD
1232 Test for inequality.
1233 """
54f9ee45 1234 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce
RD
1235
1236 def InsideXY(*args, **kwargs):
0df68c9f 1237 """
a95a7133 1238 InsideXY(self, int x, int y) -> bool
e811c8ce 1239
0df68c9f
RD
1240 Return True if the point is (not strcitly) inside the rect.
1241 """
54f9ee45 1242 return _core_.Rect_InsideXY(*args, **kwargs)
e811c8ce
RD
1243
1244 def Inside(*args, **kwargs):
0df68c9f 1245 """
a95a7133 1246 Inside(self, Point pt) -> bool
e811c8ce 1247
0df68c9f
RD
1248 Return True if the point is (not strcitly) inside the rect.
1249 """
54f9ee45 1250 return _core_.Rect_Inside(*args, **kwargs)
e811c8ce
RD
1251
1252 def Intersects(*args, **kwargs):
0df68c9f 1253 """
a95a7133 1254 Intersects(self, Rect rect) -> bool
e811c8ce 1255
0df68c9f
RD
1256 Returns True if the rectangles have a non empty intersection.
1257 """
54f9ee45 1258 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1259
54f9ee45
RD
1260 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1261 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1262 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1263 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1264 def Set(*args, **kwargs):
0df68c9f 1265 """
a95a7133 1266 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1267
0df68c9f
RD
1268 Set all rectangle properties.
1269 """
54f9ee45 1270 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1271
1272 def Get(*args, **kwargs):
0df68c9f
RD
1273 """
1274 Get() -> (x,y,width,height)
e811c8ce 1275
0df68c9f
RD
1276 Return the rectangle properties as a tuple.
1277 """
54f9ee45 1278 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1279
41e2b43e 1280 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1281 def __str__(self): return str(self.Get())
1282 def __repr__(self): return 'wx.Rect'+str(self.Get())
1283 def __len__(self): return len(self.Get())
1284 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1285 def __setitem__(self, index, val):
1286 if index == 0: self.x = val
1287 elif index == 1: self.y = val
1288 elif index == 2: self.width = val
1289 elif index == 3: self.height = val
1290 else: raise IndexError
e811c8ce 1291 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1292 __safe_for_unpickling__ = True
1293 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28
RD
1294
1295
1296class RectPtr(Rect):
1297 def __init__(self, this):
1298 self.this = this
1299 if not hasattr(self,"thisown"): self.thisown = 0
1300 self.__class__ = Rect
54f9ee45 1301_core_.Rect_swigregister(RectPtr)
d14a1e28
RD
1302
1303def RectPP(*args, **kwargs):
0df68c9f
RD
1304 """
1305 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1306
0df68c9f
RD
1307 Create a new Rect object from Points representing two corners.
1308 """
54f9ee45 1309 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1310 val.thisown = 1
1311 return val
1312
1313def RectPS(*args, **kwargs):
0df68c9f
RD
1314 """
1315 RectPS(Point pos, Size size) -> Rect
e811c8ce 1316
0df68c9f
RD
1317 Create a new Rect from a position and size.
1318 """
54f9ee45 1319 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1320 val.thisown = 1
1321 return val
1322
d3b6e4ff
RD
1323def RectS(*args, **kwargs):
1324 """
1325 RectS(Size size) -> Rect
1326
1327 Create a new Rect from a size only.
1328 """
1329 val = _core_.new_RectS(*args, **kwargs)
1330 val.thisown = 1
1331 return val
1332
d14a1e28 1333
e811c8ce 1334def IntersectRect(*args, **kwargs):
0df68c9f
RD
1335 """
1336 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1337
0df68c9f
RD
1338 Calculate and return the intersection of r1 and r2.
1339 """
54f9ee45 1340 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1341#---------------------------------------------------------------------------
1342
1343class Point2D(object):
41e2b43e
RD
1344 """
1345 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1346 with floating point values.
1347 """
e811c8ce
RD
1348 def __repr__(self):
1349 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1350 def __init__(self, *args, **kwargs):
0df68c9f 1351 """
a95a7133 1352 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1353
0df68c9f
RD
1354 Create a w.Point2D object.
1355 """
54f9ee45 1356 newobj = _core_.new_Point2D(*args, **kwargs)
d14a1e28
RD
1357 self.this = newobj.this
1358 self.thisown = 1
1359 del newobj.thisown
e811c8ce 1360 def GetFloor(*args, **kwargs):
fd2dc343
RD
1361 """
1362 GetFloor() -> (x,y)
1363
1364 Convert to integer
1365 """
54f9ee45 1366 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1367
1368 def GetRounded(*args, **kwargs):
fd2dc343
RD
1369 """
1370 GetRounded() -> (x,y)
1371
1372 Convert to integer
1373 """
54f9ee45 1374 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1375
1376 def GetVectorLength(*args, **kwargs):
a95a7133 1377 """GetVectorLength(self) -> double"""
54f9ee45 1378 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1379
1380 def GetVectorAngle(*args, **kwargs):
a95a7133 1381 """GetVectorAngle(self) -> double"""
54f9ee45 1382 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1383
1384 def SetVectorLength(*args, **kwargs):
a95a7133 1385 """SetVectorLength(self, double length)"""
54f9ee45 1386 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1387
1388 def SetVectorAngle(*args, **kwargs):
a95a7133 1389 """SetVectorAngle(self, double degrees)"""
54f9ee45 1390 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1391
d14a1e28
RD
1392 def SetPolarCoordinates(self, angle, length):
1393 self.SetVectorLength(length)
1394 self.SetVectorAngle(angle)
1395 def Normalize(self):
1396 self.SetVectorLength(1.0)
1397
e811c8ce 1398 def GetDistance(*args, **kwargs):
a95a7133 1399 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1400 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1401
1402 def GetDistanceSquare(*args, **kwargs):
a95a7133 1403 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1404 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1405
1406 def GetDotProduct(*args, **kwargs):
a95a7133 1407 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1408 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1409
1410 def GetCrossProduct(*args, **kwargs):
a95a7133 1411 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1412 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1413
1414 def __neg__(*args, **kwargs):
0df68c9f 1415 """
a95a7133 1416 __neg__(self) -> Point2D
e811c8ce 1417
0df68c9f
RD
1418 the reflection of this point
1419 """
54f9ee45 1420 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1421
1422 def __iadd__(*args, **kwargs):
a95a7133 1423 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1424 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1425
1426 def __isub__(*args, **kwargs):
a95a7133 1427 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1428 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1429
1430 def __imul__(*args, **kwargs):
a95a7133 1431 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1432 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1433
1434 def __idiv__(*args, **kwargs):
a95a7133 1435 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1436 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1437
1438 def __eq__(*args, **kwargs):
0df68c9f 1439 """
a95a7133 1440 __eq__(self, Point2D pt) -> bool
e811c8ce 1441
0df68c9f
RD
1442 Test for equality
1443 """
54f9ee45 1444 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1445
1446 def __ne__(*args, **kwargs):
0df68c9f 1447 """
a95a7133 1448 __ne__(self, Point2D pt) -> bool
e811c8ce 1449
0df68c9f
RD
1450 Test for inequality
1451 """
54f9ee45 1452 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1453
54f9ee45
RD
1454 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1455 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1456 def Set(*args, **kwargs):
a95a7133 1457 """Set(self, double x=0, double y=0)"""
54f9ee45 1458 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1459
1460 def Get(*args, **kwargs):
0df68c9f
RD
1461 """
1462 Get() -> (x,y)
e811c8ce 1463
0df68c9f
RD
1464 Return x and y properties as a tuple.
1465 """
54f9ee45 1466 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1467
41e2b43e 1468 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1469 def __str__(self): return str(self.Get())
1470 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1471 def __len__(self): return len(self.Get())
1472 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1473 def __setitem__(self, index, val):
e811c8ce
RD
1474 if index == 0: self.x = val
1475 elif index == 1: self.y = val
d14a1e28 1476 else: raise IndexError
e811c8ce 1477 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1478 __safe_for_unpickling__ = True
1479 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28
RD
1480
1481
1482class Point2DPtr(Point2D):
1483 def __init__(self, this):
1484 self.this = this
1485 if not hasattr(self,"thisown"): self.thisown = 0
1486 self.__class__ = Point2D
54f9ee45 1487_core_.Point2D_swigregister(Point2DPtr)
d14a1e28
RD
1488
1489def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1490 """
1491 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1492
0df68c9f
RD
1493 Create a w.Point2D object.
1494 """
54f9ee45 1495 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1496 val.thisown = 1
1497 return val
1498
1499def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1500 """
1501 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1502
0df68c9f
RD
1503 Create a w.Point2D object.
1504 """
54f9ee45 1505 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1506 val.thisown = 1
1507 return val
1508
1509#---------------------------------------------------------------------------
1510
54f9ee45
RD
1511FromStart = _core_.FromStart
1512FromCurrent = _core_.FromCurrent
1513FromEnd = _core_.FromEnd
d14a1e28 1514class InputStream(object):
e811c8ce
RD
1515 def __repr__(self):
1516 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1517 def __init__(self, *args, **kwargs):
a95a7133 1518 """__init__(self, PyObject p) -> InputStream"""
54f9ee45 1519 newobj = _core_.new_InputStream(*args, **kwargs)
d14a1e28
RD
1520 self.this = newobj.this
1521 self.thisown = 1
1522 del newobj.thisown
8fb0e70a
RD
1523 def __del__(self, destroy=_core_.delete_InputStream):
1524 """__del__(self)"""
1525 try:
1526 if self.thisown: destroy(self)
1527 except: pass
1528
e811c8ce 1529 def close(*args, **kwargs):
a95a7133 1530 """close(self)"""
54f9ee45 1531 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1532
1533 def flush(*args, **kwargs):
a95a7133 1534 """flush(self)"""
54f9ee45 1535 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1536
1537 def eof(*args, **kwargs):
a95a7133 1538 """eof(self) -> bool"""
54f9ee45 1539 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1540
1541 def read(*args, **kwargs):
a95a7133 1542 """read(self, int size=-1) -> PyObject"""
54f9ee45 1543 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1544
1545 def readline(*args, **kwargs):
a95a7133 1546 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1547 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1548
1549 def readlines(*args, **kwargs):
a95a7133 1550 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1551 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1552
1553 def seek(*args, **kwargs):
a95a7133 1554 """seek(self, int offset, int whence=0)"""
54f9ee45 1555 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1556
1557 def tell(*args, **kwargs):
a95a7133 1558 """tell(self) -> int"""
54f9ee45 1559 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1560
1561 def Peek(*args, **kwargs):
a95a7133 1562 """Peek(self) -> char"""
54f9ee45 1563 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1564
1565 def GetC(*args, **kwargs):
a95a7133 1566 """GetC(self) -> char"""
54f9ee45 1567 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1568
1569 def LastRead(*args, **kwargs):
a95a7133 1570 """LastRead(self) -> size_t"""
54f9ee45 1571 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1572
1573 def CanRead(*args, **kwargs):
a95a7133 1574 """CanRead(self) -> bool"""
54f9ee45 1575 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1576
1577 def Eof(*args, **kwargs):
a95a7133 1578 """Eof(self) -> bool"""
54f9ee45 1579 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1580
1581 def Ungetch(*args, **kwargs):
a95a7133 1582 """Ungetch(self, char c) -> bool"""
54f9ee45 1583 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1584
1585 def SeekI(*args, **kwargs):
a95a7133 1586 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1587 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1588
1589 def TellI(*args, **kwargs):
a95a7133 1590 """TellI(self) -> long"""
54f9ee45 1591 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1592
d14a1e28
RD
1593
1594class InputStreamPtr(InputStream):
1595 def __init__(self, this):
1596 self.this = this
1597 if not hasattr(self,"thisown"): self.thisown = 0
1598 self.__class__ = InputStream
54f9ee45 1599_core_.InputStream_swigregister(InputStreamPtr)
d14a1e28
RD
1600DefaultPosition = cvar.DefaultPosition
1601DefaultSize = cvar.DefaultSize
1602
1603class OutputStream(object):
d14a1e28
RD
1604 def __init__(self): raise RuntimeError, "No constructor defined"
1605 def __repr__(self):
1606 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 1607 def write(*args, **kwargs):
a95a7133 1608 """write(self, PyObject obj)"""
54f9ee45 1609 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 1610
d14a1e28
RD
1611
1612class OutputStreamPtr(OutputStream):
1613 def __init__(self, this):
1614 self.this = this
1615 if not hasattr(self,"thisown"): self.thisown = 0
1616 self.__class__ = OutputStream
54f9ee45 1617_core_.OutputStream_swigregister(OutputStreamPtr)
d14a1e28
RD
1618
1619#---------------------------------------------------------------------------
1620
1621class FSFile(Object):
e811c8ce
RD
1622 def __repr__(self):
1623 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1624 def __init__(self, *args, **kwargs):
0df68c9f 1625 """
a95a7133 1626 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 1627 DateTime modif) -> FSFile
0df68c9f 1628 """
54f9ee45 1629 newobj = _core_.new_FSFile(*args, **kwargs)
d14a1e28
RD
1630 self.this = newobj.this
1631 self.thisown = 1
1632 del newobj.thisown
4cf4100f
RD
1633 self.thisown = 0 # It will normally be deleted by the user of the wxFileSystem
1634
54f9ee45 1635 def __del__(self, destroy=_core_.delete_FSFile):
a95a7133 1636 """__del__(self)"""
d14a1e28
RD
1637 try:
1638 if self.thisown: destroy(self)
1639 except: pass
e811c8ce
RD
1640
1641 def GetStream(*args, **kwargs):
a95a7133 1642 """GetStream(self) -> InputStream"""
54f9ee45 1643 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce
RD
1644
1645 def GetMimeType(*args, **kwargs):
a95a7133 1646 """GetMimeType(self) -> String"""
54f9ee45 1647 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
1648
1649 def GetLocation(*args, **kwargs):
a95a7133 1650 """GetLocation(self) -> String"""
54f9ee45 1651 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
1652
1653 def GetAnchor(*args, **kwargs):
a95a7133 1654 """GetAnchor(self) -> String"""
54f9ee45 1655 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
1656
1657 def GetModificationTime(*args, **kwargs):
a95a7133 1658 """GetModificationTime(self) -> DateTime"""
54f9ee45 1659 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 1660
d14a1e28
RD
1661
1662class FSFilePtr(FSFile):
1663 def __init__(self, this):
1664 self.this = this
1665 if not hasattr(self,"thisown"): self.thisown = 0
1666 self.__class__ = FSFile
54f9ee45 1667_core_.FSFile_swigregister(FSFilePtr)
d14a1e28
RD
1668
1669class CPPFileSystemHandler(object):
1670 def __init__(self): raise RuntimeError, "No constructor defined"
1671 def __repr__(self):
1672 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1673
1674class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1675 def __init__(self, this):
1676 self.this = this
1677 if not hasattr(self,"thisown"): self.thisown = 0
1678 self.__class__ = CPPFileSystemHandler
54f9ee45 1679_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
d14a1e28
RD
1680
1681class FileSystemHandler(CPPFileSystemHandler):
e811c8ce
RD
1682 def __repr__(self):
1683 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1684 def __init__(self, *args, **kwargs):
a95a7133 1685 """__init__(self) -> FileSystemHandler"""
54f9ee45 1686 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
d14a1e28
RD
1687 self.this = newobj.this
1688 self.thisown = 1
1689 del newobj.thisown
1690 self._setCallbackInfo(self, FileSystemHandler)
e811c8ce
RD
1691
1692 def _setCallbackInfo(*args, **kwargs):
a95a7133 1693 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 1694 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
1695
1696 def CanOpen(*args, **kwargs):
a95a7133 1697 """CanOpen(self, String location) -> bool"""
54f9ee45 1698 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1699
1700 def OpenFile(*args, **kwargs):
a95a7133 1701 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1702 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1703
1704 def FindFirst(*args, **kwargs):
a95a7133 1705 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1706 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1707
1708 def FindNext(*args, **kwargs):
a95a7133 1709 """FindNext(self) -> String"""
54f9ee45 1710 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
1711
1712 def GetProtocol(*args, **kwargs):
a95a7133 1713 """GetProtocol(self, String location) -> String"""
54f9ee45 1714 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
1715
1716 def GetLeftLocation(*args, **kwargs):
a95a7133 1717 """GetLeftLocation(self, String location) -> String"""
54f9ee45 1718 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
1719
1720 def GetAnchor(*args, **kwargs):
a95a7133 1721 """GetAnchor(self, String location) -> String"""
54f9ee45 1722 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
1723
1724 def GetRightLocation(*args, **kwargs):
a95a7133 1725 """GetRightLocation(self, String location) -> String"""
54f9ee45 1726 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
1727
1728 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 1729 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 1730 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 1731
d14a1e28
RD
1732
1733class FileSystemHandlerPtr(FileSystemHandler):
1734 def __init__(self, this):
1735 self.this = this
1736 if not hasattr(self,"thisown"): self.thisown = 0
1737 self.__class__ = FileSystemHandler
54f9ee45 1738_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
d14a1e28
RD
1739
1740class FileSystem(Object):
e811c8ce
RD
1741 def __repr__(self):
1742 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1743 def __init__(self, *args, **kwargs):
a95a7133 1744 """__init__(self) -> FileSystem"""
54f9ee45 1745 newobj = _core_.new_FileSystem(*args, **kwargs)
d14a1e28
RD
1746 self.this = newobj.this
1747 self.thisown = 1
1748 del newobj.thisown
54f9ee45 1749 def __del__(self, destroy=_core_.delete_FileSystem):
a95a7133 1750 """__del__(self)"""
d14a1e28
RD
1751 try:
1752 if self.thisown: destroy(self)
1753 except: pass
e811c8ce
RD
1754
1755 def ChangePathTo(*args, **kwargs):
a95a7133 1756 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 1757 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
1758
1759 def GetPath(*args, **kwargs):
a95a7133 1760 """GetPath(self) -> String"""
54f9ee45 1761 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
1762
1763 def OpenFile(*args, **kwargs):
a95a7133 1764 """OpenFile(self, String location) -> FSFile"""
54f9ee45 1765 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
1766
1767 def FindFirst(*args, **kwargs):
a95a7133 1768 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1769 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
1770
1771 def FindNext(*args, **kwargs):
a95a7133 1772 """FindNext(self) -> String"""
54f9ee45 1773 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
1774
1775 def AddHandler(*args, **kwargs):
66c033b4 1776 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1777 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
1778
1779 AddHandler = staticmethod(AddHandler)
1780 def CleanUpHandlers(*args, **kwargs):
66c033b4 1781 """CleanUpHandlers()"""
54f9ee45 1782 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
1783
1784 CleanUpHandlers = staticmethod(CleanUpHandlers)
1785 def FileNameToURL(*args, **kwargs):
66c033b4 1786 """FileNameToURL(String filename) -> String"""
54f9ee45 1787 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
1788
1789 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
1790 def URLToFileName(*args, **kwargs):
1791 """URLToFileName(String url) -> String"""
1792 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1793
1794 URLToFileName = staticmethod(URLToFileName)
d14a1e28
RD
1795
1796class FileSystemPtr(FileSystem):
1797 def __init__(self, this):
1798 self.this = this
1799 if not hasattr(self,"thisown"): self.thisown = 0
1800 self.__class__ = FileSystem
54f9ee45 1801_core_.FileSystem_swigregister(FileSystemPtr)
d14a1e28 1802
e811c8ce
RD
1803def FileSystem_AddHandler(*args, **kwargs):
1804 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1805 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 1806
e811c8ce
RD
1807def FileSystem_CleanUpHandlers(*args, **kwargs):
1808 """FileSystem_CleanUpHandlers()"""
54f9ee45 1809 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d14a1e28 1810
e811c8ce 1811def FileSystem_FileNameToURL(*args, **kwargs):
196addbf 1812 """FileSystem_FileNameToURL(String filename) -> String"""
54f9ee45 1813 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 1814
e811c8ce 1815def FileSystem_URLToFileName(*args, **kwargs):
196addbf 1816 """FileSystem_URLToFileName(String url) -> String"""
54f9ee45 1817 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 1818
d14a1e28 1819class InternetFSHandler(CPPFileSystemHandler):
e811c8ce
RD
1820 def __repr__(self):
1821 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1822 def __init__(self, *args, **kwargs):
a95a7133 1823 """__init__(self) -> InternetFSHandler"""
54f9ee45 1824 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
d14a1e28
RD
1825 self.this = newobj.this
1826 self.thisown = 1
1827 del newobj.thisown
e811c8ce 1828 def CanOpen(*args, **kwargs):
a95a7133 1829 """CanOpen(self, String location) -> bool"""
54f9ee45 1830 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1831
1832 def OpenFile(*args, **kwargs):
a95a7133 1833 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1834 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 1835
d14a1e28
RD
1836
1837class InternetFSHandlerPtr(InternetFSHandler):
1838 def __init__(self, this):
1839 self.this = this
1840 if not hasattr(self,"thisown"): self.thisown = 0
1841 self.__class__ = InternetFSHandler
54f9ee45 1842_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
d14a1e28
RD
1843
1844class ZipFSHandler(CPPFileSystemHandler):
e811c8ce
RD
1845 def __repr__(self):
1846 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1847 def __init__(self, *args, **kwargs):
a95a7133 1848 """__init__(self) -> ZipFSHandler"""
54f9ee45 1849 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
d14a1e28
RD
1850 self.this = newobj.this
1851 self.thisown = 1
1852 del newobj.thisown
e811c8ce 1853 def CanOpen(*args, **kwargs):
a95a7133 1854 """CanOpen(self, String location) -> bool"""
54f9ee45 1855 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1856
1857 def OpenFile(*args, **kwargs):
a95a7133 1858 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1859 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1860
1861 def FindFirst(*args, **kwargs):
a95a7133 1862 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1863 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1864
1865 def FindNext(*args, **kwargs):
a95a7133 1866 """FindNext(self) -> String"""
54f9ee45 1867 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 1868
d14a1e28
RD
1869
1870class ZipFSHandlerPtr(ZipFSHandler):
1871 def __init__(self, this):
1872 self.this = this
1873 if not hasattr(self,"thisown"): self.thisown = 0
1874 self.__class__ = ZipFSHandler
54f9ee45 1875_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
d14a1e28
RD
1876
1877
e811c8ce 1878def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
196addbf 1879 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
54f9ee45 1880 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 1881
e811c8ce 1882def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
196addbf 1883 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
54f9ee45 1884 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 1885
e811c8ce 1886def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
196addbf 1887 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
54f9ee45 1888 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
1889def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1890 """
1891 Add 'file' to the memory filesystem. The dataItem parameter can
1892 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1893 arbitrary data. If a bitmap or image is used then the imgType
1894 parameter should specify what kind of image file it should be
1895 written as, wx.BITMAP_TYPE_PNG, etc.
1896 """
1897 if isinstance(dataItem, wx.Image):
1898 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1899 elif isinstance(dataItem, wx.Bitmap):
1900 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1901 elif type(dataItem) == str:
1902 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1903 else:
1904 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
1905
1906class MemoryFSHandler(CPPFileSystemHandler):
e811c8ce
RD
1907 def __repr__(self):
1908 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1909 def __init__(self, *args, **kwargs):
a95a7133 1910 """__init__(self) -> MemoryFSHandler"""
54f9ee45 1911 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
d14a1e28
RD
1912 self.this = newobj.this
1913 self.thisown = 1
1914 del newobj.thisown
e811c8ce 1915 def RemoveFile(*args, **kwargs):
66c033b4 1916 """RemoveFile(String filename)"""
54f9ee45 1917 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
1918
1919 RemoveFile = staticmethod(RemoveFile)
d14a1e28 1920 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 1921 def CanOpen(*args, **kwargs):
a95a7133 1922 """CanOpen(self, String location) -> bool"""
54f9ee45 1923 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1924
1925 def OpenFile(*args, **kwargs):
a95a7133 1926 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1927 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1928
1929 def FindFirst(*args, **kwargs):
a95a7133 1930 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1931 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1932
1933 def FindNext(*args, **kwargs):
a95a7133 1934 """FindNext(self) -> String"""
54f9ee45 1935 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 1936
d14a1e28
RD
1937
1938class MemoryFSHandlerPtr(MemoryFSHandler):
1939 def __init__(self, this):
1940 self.this = this
1941 if not hasattr(self,"thisown"): self.thisown = 0
1942 self.__class__ = MemoryFSHandler
54f9ee45 1943_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
d14a1e28 1944
e811c8ce 1945def MemoryFSHandler_RemoveFile(*args, **kwargs):
196addbf 1946 """MemoryFSHandler_RemoveFile(String filename)"""
54f9ee45 1947 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28
RD
1948
1949#---------------------------------------------------------------------------
1950
1951class ImageHandler(Object):
d14a1e28
RD
1952 def __init__(self): raise RuntimeError, "No constructor defined"
1953 def __repr__(self):
1954 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 1955 def GetName(*args, **kwargs):
a95a7133 1956 """GetName(self) -> String"""
54f9ee45 1957 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
1958
1959 def GetExtension(*args, **kwargs):
a95a7133 1960 """GetExtension(self) -> String"""
54f9ee45 1961 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
1962
1963 def GetType(*args, **kwargs):
a95a7133 1964 """GetType(self) -> long"""
54f9ee45 1965 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
1966
1967 def GetMimeType(*args, **kwargs):
a95a7133 1968 """GetMimeType(self) -> String"""
54f9ee45 1969 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
1970
1971 def CanRead(*args, **kwargs):
a95a7133 1972 """CanRead(self, String name) -> bool"""
54f9ee45 1973 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce
RD
1974
1975 def SetName(*args, **kwargs):
a95a7133 1976 """SetName(self, String name)"""
54f9ee45 1977 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
1978
1979 def SetExtension(*args, **kwargs):
a95a7133 1980 """SetExtension(self, String extension)"""
54f9ee45 1981 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
1982
1983 def SetType(*args, **kwargs):
a95a7133 1984 """SetType(self, long type)"""
54f9ee45 1985 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
1986
1987 def SetMimeType(*args, **kwargs):
a95a7133 1988 """SetMimeType(self, String mimetype)"""
54f9ee45 1989 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 1990
d14a1e28
RD
1991
1992class ImageHandlerPtr(ImageHandler):
1993 def __init__(self, this):
1994 self.this = this
1995 if not hasattr(self,"thisown"): self.thisown = 0
1996 self.__class__ = ImageHandler
54f9ee45 1997_core_.ImageHandler_swigregister(ImageHandlerPtr)
d14a1e28
RD
1998
1999class ImageHistogram(object):
e811c8ce
RD
2000 def __repr__(self):
2001 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2002 def __init__(self, *args, **kwargs):
a95a7133 2003 """__init__(self) -> ImageHistogram"""
54f9ee45 2004 newobj = _core_.new_ImageHistogram(*args, **kwargs)
d14a1e28
RD
2005 self.this = newobj.this
2006 self.thisown = 1
2007 del newobj.thisown
e811c8ce 2008 def MakeKey(*args, **kwargs):
0df68c9f 2009 """
66c033b4 2010 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
e811c8ce 2011
0df68c9f
RD
2012 Get the key in the histogram for the given RGB values
2013 """
54f9ee45 2014 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2015
2016 MakeKey = staticmethod(MakeKey)
2017 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2018 """
2019 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2020
2021 Find first colour that is not used in the image and has higher RGB
2022 values than startR, startG, startB. Returns a tuple consisting of a
2023 success flag and rgb values.
2024 """
54f9ee45 2025 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2026
d14a1e28
RD
2027
2028class ImageHistogramPtr(ImageHistogram):
2029 def __init__(self, this):
2030 self.this = this
2031 if not hasattr(self,"thisown"): self.thisown = 0
2032 self.__class__ = ImageHistogram
54f9ee45 2033_core_.ImageHistogram_swigregister(ImageHistogramPtr)
d14a1e28 2034
e811c8ce 2035def ImageHistogram_MakeKey(*args, **kwargs):
0df68c9f
RD
2036 """
2037 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
e811c8ce 2038
0df68c9f
RD
2039 Get the key in the histogram for the given RGB values
2040 """
54f9ee45 2041 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28
RD
2042
2043class Image(Object):
e811c8ce
RD
2044 def __repr__(self):
2045 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2046 def __init__(self, *args, **kwargs):
a95a7133 2047 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
54f9ee45 2048 newobj = _core_.new_Image(*args, **kwargs)
d14a1e28
RD
2049 self.this = newobj.this
2050 self.thisown = 1
2051 del newobj.thisown
54f9ee45 2052 def __del__(self, destroy=_core_.delete_Image):
a95a7133 2053 """__del__(self)"""
d14a1e28
RD
2054 try:
2055 if self.thisown: destroy(self)
2056 except: pass
e811c8ce
RD
2057
2058 def Create(*args, **kwargs):
a95a7133 2059 """Create(self, int width, int height)"""
54f9ee45 2060 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2061
2062 def Destroy(*args, **kwargs):
0df68c9f 2063 """
a95a7133 2064 Destroy(self)
e811c8ce 2065
0df68c9f
RD
2066 Deletes the C++ object this Python object is a proxy for.
2067 """
54f9ee45 2068 return _core_.Image_Destroy(*args, **kwargs)
e811c8ce
RD
2069
2070 def Scale(*args, **kwargs):
a95a7133 2071 """Scale(self, int width, int height) -> Image"""
54f9ee45 2072 return _core_.Image_Scale(*args, **kwargs)
e811c8ce
RD
2073
2074 def ShrinkBy(*args, **kwargs):
a95a7133 2075 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
54f9ee45 2076 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2077
2078 def Rescale(*args, **kwargs):
a95a7133 2079 """Rescale(self, int width, int height) -> Image"""
54f9ee45 2080 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce
RD
2081
2082 def SetRGB(*args, **kwargs):
a95a7133 2083 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
54f9ee45 2084 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce
RD
2085
2086 def GetRed(*args, **kwargs):
a95a7133 2087 """GetRed(self, int x, int y) -> unsigned char"""
54f9ee45 2088 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2089
2090 def GetGreen(*args, **kwargs):
a95a7133 2091 """GetGreen(self, int x, int y) -> unsigned char"""
54f9ee45 2092 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2093
2094 def GetBlue(*args, **kwargs):
a95a7133 2095 """GetBlue(self, int x, int y) -> unsigned char"""
54f9ee45 2096 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2097
2098 def SetAlpha(*args, **kwargs):
a95a7133 2099 """SetAlpha(self, int x, int y, unsigned char alpha)"""
54f9ee45 2100 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2101
2102 def GetAlpha(*args, **kwargs):
a95a7133 2103 """GetAlpha(self, int x, int y) -> unsigned char"""
54f9ee45 2104 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2105
2106 def HasAlpha(*args, **kwargs):
a95a7133 2107 """HasAlpha(self) -> bool"""
54f9ee45 2108 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce
RD
2109
2110 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2111 """
2112 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2113
2114 Find first colour that is not used in the image and has higher RGB
2115 values than startR, startG, startB. Returns a tuple consisting of a
2116 success flag and rgb values.
2117 """
54f9ee45 2118 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2119
4cf4100f
RD
2120 def ConvertAlphaToMask(*args, **kwargs):
2121 """
2122 ConvertAlphaToMask(self, byte threshold=128) -> bool
2123
2124 If the image has alpha channel, this method converts it to mask. All pixels
2125 with alpha value less than ``threshold`` are replaced with mask colour and the
2126 alpha channel is removed. Mask colour is chosen automatically using
2127 `FindFirstUnusedColour`.
2128
2129 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2130 nothing.
2131 """
2132 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2133
8fb0e70a
RD
2134 def ConvertColourToAlpha(*args, **kwargs):
2135 """
2136 ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool
2137
2138 This method converts an image where the original alpha information is
2139 only available as a shades of a colour (actually shades of grey)
2140 typically when you draw anti-aliased text into a bitmap. The DC
2141 drawing routines draw grey values on the black background although
2142 they actually mean to draw white with differnt alpha values. This
2143 method reverses it, assuming a black (!) background and white text.
2144 The method will then fill up the whole image with the colour given.
2145 """
2146 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2147
e811c8ce 2148 def SetMaskFromImage(*args, **kwargs):
a95a7133 2149 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
54f9ee45 2150 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2151
2152 def CanRead(*args, **kwargs):
66c033b4 2153 """CanRead(String name) -> bool"""
54f9ee45 2154 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2155
2156 CanRead = staticmethod(CanRead)
2157 def GetImageCount(*args, **kwargs):
66c033b4 2158 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
54f9ee45 2159 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2160
2161 GetImageCount = staticmethod(GetImageCount)
2162 def LoadFile(*args, **kwargs):
a95a7133 2163 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
54f9ee45 2164 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2165
2166 def LoadMimeFile(*args, **kwargs):
a95a7133 2167 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
54f9ee45 2168 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2169
2170 def SaveFile(*args, **kwargs):
a95a7133 2171 """SaveFile(self, String name, int type) -> bool"""
54f9ee45 2172 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2173
2174 def SaveMimeFile(*args, **kwargs):
a95a7133 2175 """SaveMimeFile(self, String name, String mimetype) -> bool"""
54f9ee45 2176 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2177
2178 def CanReadStream(*args, **kwargs):
66c033b4 2179 """CanReadStream(InputStream stream) -> bool"""
54f9ee45 2180 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2181
2182 CanReadStream = staticmethod(CanReadStream)
2183 def LoadStream(*args, **kwargs):
a95a7133 2184 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
54f9ee45 2185 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2186
2187 def LoadMimeStream(*args, **kwargs):
a95a7133 2188 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
54f9ee45 2189 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce
RD
2190
2191 def Ok(*args, **kwargs):
a95a7133 2192 """Ok(self) -> bool"""
54f9ee45 2193 return _core_.Image_Ok(*args, **kwargs)
e811c8ce
RD
2194
2195 def GetWidth(*args, **kwargs):
a95a7133 2196 """GetWidth(self) -> int"""
54f9ee45 2197 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2198
2199 def GetHeight(*args, **kwargs):
a95a7133 2200 """GetHeight(self) -> int"""
54f9ee45 2201 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2202
b2df227b 2203 def GetSize(*args, **kwargs):
a95a7133 2204 """GetSize(self) -> Size"""
54f9ee45 2205 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2206
e811c8ce 2207 def GetSubImage(*args, **kwargs):
a95a7133 2208 """GetSubImage(self, Rect rect) -> Image"""
54f9ee45 2209 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce
RD
2210
2211 def Copy(*args, **kwargs):
a95a7133 2212 """Copy(self) -> Image"""
54f9ee45 2213 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2214
2215 def Paste(*args, **kwargs):
a95a7133 2216 """Paste(self, Image image, int x, int y)"""
54f9ee45 2217 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2218
2219 def GetData(*args, **kwargs):
a95a7133 2220 """GetData(self) -> PyObject"""
54f9ee45 2221 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2222
2223 def SetData(*args, **kwargs):
a95a7133 2224 """SetData(self, PyObject data)"""
54f9ee45 2225 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
2226
2227 def GetDataBuffer(*args, **kwargs):
a95a7133 2228 """GetDataBuffer(self) -> PyObject"""
54f9ee45 2229 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
2230
2231 def SetDataBuffer(*args, **kwargs):
a95a7133 2232 """SetDataBuffer(self, PyObject data)"""
54f9ee45 2233 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
2234
2235 def GetAlphaData(*args, **kwargs):
a95a7133 2236 """GetAlphaData(self) -> PyObject"""
54f9ee45 2237 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
2238
2239 def SetAlphaData(*args, **kwargs):
a95a7133 2240 """SetAlphaData(self, PyObject data)"""
54f9ee45 2241 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
2242
2243 def GetAlphaBuffer(*args, **kwargs):
a95a7133 2244 """GetAlphaBuffer(self) -> PyObject"""
54f9ee45 2245 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2246
2247 def SetAlphaBuffer(*args, **kwargs):
a95a7133 2248 """SetAlphaBuffer(self, PyObject data)"""
54f9ee45 2249 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2250
2251 def SetMaskColour(*args, **kwargs):
a95a7133 2252 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
54f9ee45 2253 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce
RD
2254
2255 def GetMaskRed(*args, **kwargs):
a95a7133 2256 """GetMaskRed(self) -> unsigned char"""
54f9ee45 2257 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
2258
2259 def GetMaskGreen(*args, **kwargs):
a95a7133 2260 """GetMaskGreen(self) -> unsigned char"""
54f9ee45 2261 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
2262
2263 def GetMaskBlue(*args, **kwargs):
a95a7133 2264 """GetMaskBlue(self) -> unsigned char"""
54f9ee45 2265 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
2266
2267 def SetMask(*args, **kwargs):
a95a7133 2268 """SetMask(self, bool mask=True)"""
54f9ee45 2269 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
2270
2271 def HasMask(*args, **kwargs):
a95a7133 2272 """HasMask(self) -> bool"""
54f9ee45 2273 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
2274
2275 def Rotate(*args, **kwargs):
0df68c9f 2276 """
a95a7133 2277 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f
RD
2278 Point offset_after_rotation=None) -> Image
2279 """
54f9ee45 2280 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
2281
2282 def Rotate90(*args, **kwargs):
a95a7133 2283 """Rotate90(self, bool clockwise=True) -> Image"""
54f9ee45 2284 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
2285
2286 def Mirror(*args, **kwargs):
a95a7133 2287 """Mirror(self, bool horizontally=True) -> Image"""
54f9ee45 2288 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
2289
2290 def Replace(*args, **kwargs):
0df68c9f 2291 """
a95a7133 2292 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
0df68c9f
RD
2293 unsigned char r2, unsigned char g2, unsigned char b2)
2294 """
54f9ee45 2295 return _core_.Image_Replace(*args, **kwargs)
e811c8ce
RD
2296
2297 def ConvertToMono(*args, **kwargs):
a95a7133 2298 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
54f9ee45 2299 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
2300
2301 def SetOption(*args, **kwargs):
a95a7133 2302 """SetOption(self, String name, String value)"""
54f9ee45 2303 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
2304
2305 def SetOptionInt(*args, **kwargs):
a95a7133 2306 """SetOptionInt(self, String name, int value)"""
54f9ee45 2307 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
2308
2309 def GetOption(*args, **kwargs):
a95a7133 2310 """GetOption(self, String name) -> String"""
54f9ee45 2311 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
2312
2313 def GetOptionInt(*args, **kwargs):
a95a7133 2314 """GetOptionInt(self, String name) -> int"""
54f9ee45 2315 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
2316
2317 def HasOption(*args, **kwargs):
a95a7133 2318 """HasOption(self, String name) -> bool"""
54f9ee45 2319 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
2320
2321 def CountColours(*args, **kwargs):
a95a7133 2322 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 2323 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
2324
2325 def ComputeHistogram(*args, **kwargs):
a95a7133 2326 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 2327 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
2328
2329 def AddHandler(*args, **kwargs):
66c033b4 2330 """AddHandler(ImageHandler handler)"""
54f9ee45 2331 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
2332
2333 AddHandler = staticmethod(AddHandler)
2334 def InsertHandler(*args, **kwargs):
66c033b4 2335 """InsertHandler(ImageHandler handler)"""
54f9ee45 2336 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
2337
2338 InsertHandler = staticmethod(InsertHandler)
2339 def RemoveHandler(*args, **kwargs):
66c033b4 2340 """RemoveHandler(String name) -> bool"""
54f9ee45 2341 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
2342
2343 RemoveHandler = staticmethod(RemoveHandler)
2344 def GetImageExtWildcard(*args, **kwargs):
66c033b4 2345 """GetImageExtWildcard() -> String"""
54f9ee45 2346 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
2347
2348 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2349 def ConvertToBitmap(*args, **kwargs):
1fbf26be 2350 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 2351 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
2352
2353 def ConvertToMonoBitmap(*args, **kwargs):
a95a7133 2354 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
54f9ee45 2355 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce
RD
2356
2357 def __nonzero__(self): return self.Ok()
d14a1e28
RD
2358
2359class ImagePtr(Image):
2360 def __init__(self, this):
2361 self.this = this
2362 if not hasattr(self,"thisown"): self.thisown = 0
2363 self.__class__ = Image
54f9ee45 2364_core_.Image_swigregister(ImagePtr)
d14a1e28
RD
2365
2366def ImageFromMime(*args, **kwargs):
196addbf 2367 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
54f9ee45 2368 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
2369 val.thisown = 1
2370 return val
2371
2372def ImageFromStream(*args, **kwargs):
196addbf 2373 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
54f9ee45 2374 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
2375 val.thisown = 1
2376 return val
2377
2378def ImageFromStreamMime(*args, **kwargs):
196addbf 2379 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
54f9ee45 2380 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
2381 val.thisown = 1
2382 return val
2383
66c033b4
RD
2384def EmptyImage(*args, **kwargs):
2385 """EmptyImage(int width=0, int height=0, bool clear=True) -> Image"""
2386 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
2387 val.thisown = 1
2388 return val
2389
2390def ImageFromBitmap(*args, **kwargs):
196addbf 2391 """ImageFromBitmap(Bitmap bitmap) -> Image"""
54f9ee45 2392 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
2393 val.thisown = 1
2394 return val
2395
2396def ImageFromData(*args, **kwargs):
e811c8ce 2397 """ImageFromData(int width, int height, unsigned char data) -> Image"""
54f9ee45 2398 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
2399 val.thisown = 1
2400 return val
2401
e811c8ce 2402def Image_CanRead(*args, **kwargs):
196addbf 2403 """Image_CanRead(String name) -> bool"""
54f9ee45 2404 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 2405
e811c8ce 2406def Image_GetImageCount(*args, **kwargs):
196addbf 2407 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
54f9ee45 2408 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 2409
e811c8ce 2410def Image_CanReadStream(*args, **kwargs):
196addbf 2411 """Image_CanReadStream(InputStream stream) -> bool"""
54f9ee45 2412 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 2413
e811c8ce
RD
2414def Image_AddHandler(*args, **kwargs):
2415 """Image_AddHandler(ImageHandler handler)"""
54f9ee45 2416 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 2417
e811c8ce
RD
2418def Image_InsertHandler(*args, **kwargs):
2419 """Image_InsertHandler(ImageHandler handler)"""
54f9ee45 2420 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 2421
e811c8ce 2422def Image_RemoveHandler(*args, **kwargs):
196addbf 2423 """Image_RemoveHandler(String name) -> bool"""
54f9ee45 2424 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 2425
e811c8ce 2426def Image_GetImageExtWildcard(*args, **kwargs):
196addbf 2427 """Image_GetImageExtWildcard() -> String"""
54f9ee45 2428 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d14a1e28 2429
5e4ca4a8
RD
2430def InitAllImageHandlers():
2431 """
2432 The former functionality of InitAllImageHanders is now done internal to
2433 the _core_ extension module and so this function has become a simple NOP.
2434 """
2435 pass
d14a1e28 2436
54f9ee45
RD
2437IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2438IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2439BMP_24BPP = _core_.BMP_24BPP
2440BMP_8BPP = _core_.BMP_8BPP
2441BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2442BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2443BMP_8BPP_RED = _core_.BMP_8BPP_RED
2444BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2445BMP_4BPP = _core_.BMP_4BPP
2446BMP_1BPP = _core_.BMP_1BPP
2447BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 2448class BMPHandler(ImageHandler):
e811c8ce
RD
2449 def __repr__(self):
2450 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2451 def __init__(self, *args, **kwargs):
a95a7133 2452 """__init__(self) -> BMPHandler"""
54f9ee45 2453 newobj = _core_.new_BMPHandler(*args, **kwargs)
d14a1e28
RD
2454 self.this = newobj.this
2455 self.thisown = 1
2456 del newobj.thisown
d14a1e28
RD
2457
2458class BMPHandlerPtr(BMPHandler):
2459 def __init__(self, this):
2460 self.this = this
2461 if not hasattr(self,"thisown"): self.thisown = 0
2462 self.__class__ = BMPHandler
54f9ee45 2463_core_.BMPHandler_swigregister(BMPHandlerPtr)
d14a1e28
RD
2464NullImage = cvar.NullImage
2465IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2466IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2467IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2468IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
2469IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
2470
2471class ICOHandler(BMPHandler):
e811c8ce
RD
2472 def __repr__(self):
2473 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2474 def __init__(self, *args, **kwargs):
a95a7133 2475 """__init__(self) -> ICOHandler"""
54f9ee45 2476 newobj = _core_.new_ICOHandler(*args, **kwargs)
d14a1e28
RD
2477 self.this = newobj.this
2478 self.thisown = 1
2479 del newobj.thisown
d14a1e28
RD
2480
2481class ICOHandlerPtr(ICOHandler):
2482 def __init__(self, this):
2483 self.this = this
2484 if not hasattr(self,"thisown"): self.thisown = 0
2485 self.__class__ = ICOHandler
54f9ee45 2486_core_.ICOHandler_swigregister(ICOHandlerPtr)
d14a1e28
RD
2487
2488class CURHandler(ICOHandler):
e811c8ce
RD
2489 def __repr__(self):
2490 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2491 def __init__(self, *args, **kwargs):
a95a7133 2492 """__init__(self) -> CURHandler"""
54f9ee45 2493 newobj = _core_.new_CURHandler(*args, **kwargs)
d14a1e28
RD
2494 self.this = newobj.this
2495 self.thisown = 1
2496 del newobj.thisown
d14a1e28
RD
2497
2498class CURHandlerPtr(CURHandler):
2499 def __init__(self, this):
2500 self.this = this
2501 if not hasattr(self,"thisown"): self.thisown = 0
2502 self.__class__ = CURHandler
54f9ee45 2503_core_.CURHandler_swigregister(CURHandlerPtr)
d14a1e28
RD
2504
2505class ANIHandler(CURHandler):
e811c8ce
RD
2506 def __repr__(self):
2507 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2508 def __init__(self, *args, **kwargs):
a95a7133 2509 """__init__(self) -> ANIHandler"""
54f9ee45 2510 newobj = _core_.new_ANIHandler(*args, **kwargs)
d14a1e28
RD
2511 self.this = newobj.this
2512 self.thisown = 1
2513 del newobj.thisown
d14a1e28
RD
2514
2515class ANIHandlerPtr(ANIHandler):
2516 def __init__(self, this):
2517 self.this = this
2518 if not hasattr(self,"thisown"): self.thisown = 0
2519 self.__class__ = ANIHandler
54f9ee45 2520_core_.ANIHandler_swigregister(ANIHandlerPtr)
d14a1e28
RD
2521
2522class PNGHandler(ImageHandler):
e811c8ce
RD
2523 def __repr__(self):
2524 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2525 def __init__(self, *args, **kwargs):
a95a7133 2526 """__init__(self) -> PNGHandler"""
54f9ee45 2527 newobj = _core_.new_PNGHandler(*args, **kwargs)
d14a1e28
RD
2528 self.this = newobj.this
2529 self.thisown = 1
2530 del newobj.thisown
d14a1e28
RD
2531
2532class PNGHandlerPtr(PNGHandler):
2533 def __init__(self, this):
2534 self.this = this
2535 if not hasattr(self,"thisown"): self.thisown = 0
2536 self.__class__ = PNGHandler
54f9ee45 2537_core_.PNGHandler_swigregister(PNGHandlerPtr)
d14a1e28
RD
2538
2539class GIFHandler(ImageHandler):
e811c8ce
RD
2540 def __repr__(self):
2541 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2542 def __init__(self, *args, **kwargs):
a95a7133 2543 """__init__(self) -> GIFHandler"""
54f9ee45 2544 newobj = _core_.new_GIFHandler(*args, **kwargs)
d14a1e28
RD
2545 self.this = newobj.this
2546 self.thisown = 1
2547 del newobj.thisown
d14a1e28
RD
2548
2549class GIFHandlerPtr(GIFHandler):
2550 def __init__(self, this):
2551 self.this = this
2552 if not hasattr(self,"thisown"): self.thisown = 0
2553 self.__class__ = GIFHandler
54f9ee45 2554_core_.GIFHandler_swigregister(GIFHandlerPtr)
d14a1e28
RD
2555
2556class PCXHandler(ImageHandler):
e811c8ce
RD
2557 def __repr__(self):
2558 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2559 def __init__(self, *args, **kwargs):
a95a7133 2560 """__init__(self) -> PCXHandler"""
54f9ee45 2561 newobj = _core_.new_PCXHandler(*args, **kwargs)
d14a1e28
RD
2562 self.this = newobj.this
2563 self.thisown = 1
2564 del newobj.thisown
d14a1e28
RD
2565
2566class PCXHandlerPtr(PCXHandler):
2567 def __init__(self, this):
2568 self.this = this
2569 if not hasattr(self,"thisown"): self.thisown = 0
2570 self.__class__ = PCXHandler
54f9ee45 2571_core_.PCXHandler_swigregister(PCXHandlerPtr)
d14a1e28
RD
2572
2573class JPEGHandler(ImageHandler):
e811c8ce
RD
2574 def __repr__(self):
2575 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2576 def __init__(self, *args, **kwargs):
a95a7133 2577 """__init__(self) -> JPEGHandler"""
54f9ee45 2578 newobj = _core_.new_JPEGHandler(*args, **kwargs)
d14a1e28
RD
2579 self.this = newobj.this
2580 self.thisown = 1
2581 del newobj.thisown
d14a1e28
RD
2582
2583class JPEGHandlerPtr(JPEGHandler):
2584 def __init__(self, this):
2585 self.this = this
2586 if not hasattr(self,"thisown"): self.thisown = 0
2587 self.__class__ = JPEGHandler
54f9ee45 2588_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
d14a1e28
RD
2589
2590class PNMHandler(ImageHandler):
e811c8ce
RD
2591 def __repr__(self):
2592 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2593 def __init__(self, *args, **kwargs):
a95a7133 2594 """__init__(self) -> PNMHandler"""
54f9ee45 2595 newobj = _core_.new_PNMHandler(*args, **kwargs)
d14a1e28
RD
2596 self.this = newobj.this
2597 self.thisown = 1
2598 del newobj.thisown
d14a1e28
RD
2599
2600class PNMHandlerPtr(PNMHandler):
2601 def __init__(self, this):
2602 self.this = this
2603 if not hasattr(self,"thisown"): self.thisown = 0
2604 self.__class__ = PNMHandler
54f9ee45 2605_core_.PNMHandler_swigregister(PNMHandlerPtr)
d14a1e28
RD
2606
2607class XPMHandler(ImageHandler):
e811c8ce
RD
2608 def __repr__(self):
2609 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2610 def __init__(self, *args, **kwargs):
a95a7133 2611 """__init__(self) -> XPMHandler"""
54f9ee45 2612 newobj = _core_.new_XPMHandler(*args, **kwargs)
d14a1e28
RD
2613 self.this = newobj.this
2614 self.thisown = 1
2615 del newobj.thisown
d14a1e28
RD
2616
2617class XPMHandlerPtr(XPMHandler):
2618 def __init__(self, this):
2619 self.this = this
2620 if not hasattr(self,"thisown"): self.thisown = 0
2621 self.__class__ = XPMHandler
54f9ee45 2622_core_.XPMHandler_swigregister(XPMHandlerPtr)
d14a1e28
RD
2623
2624class TIFFHandler(ImageHandler):
e811c8ce
RD
2625 def __repr__(self):
2626 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2627 def __init__(self, *args, **kwargs):
a95a7133 2628 """__init__(self) -> TIFFHandler"""
54f9ee45 2629 newobj = _core_.new_TIFFHandler(*args, **kwargs)
d14a1e28
RD
2630 self.this = newobj.this
2631 self.thisown = 1
2632 del newobj.thisown
d14a1e28
RD
2633
2634class TIFFHandlerPtr(TIFFHandler):
2635 def __init__(self, this):
2636 self.this = this
2637 if not hasattr(self,"thisown"): self.thisown = 0
2638 self.__class__ = TIFFHandler
54f9ee45 2639_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
d14a1e28 2640
c0de73ae
RD
2641QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
2642QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
2643class Quantize(object):
2644 """Performs quantization, or colour reduction, on a wxImage."""
2645 def __init__(self): raise RuntimeError, "No constructor defined"
2646 def __repr__(self):
2647 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2648 def Quantize(*args, **kwargs):
2649 """
2650 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2651
2652 Reduce the colours in the source image and put the result into the
2653 destination image, setting the palette in the destination if
2654 needed. Both images may be the same, to overwrite the source image.
2655 """
2656 return _core_.Quantize_Quantize(*args, **kwargs)
2657
2658 Quantize = staticmethod(Quantize)
2659
2660class QuantizePtr(Quantize):
2661 def __init__(self, this):
2662 self.this = this
2663 if not hasattr(self,"thisown"): self.thisown = 0
2664 self.__class__ = Quantize
2665_core_.Quantize_swigregister(QuantizePtr)
2666
2667def Quantize_Quantize(*args, **kwargs):
2668 """
2669 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2670
2671 Reduce the colours in the source image and put the result into the
2672 destination image, setting the palette in the destination if
2673 needed. Both images may be the same, to overwrite the source image.
2674 """
2675 return _core_.Quantize_Quantize(*args, **kwargs)
2676
d14a1e28
RD
2677#---------------------------------------------------------------------------
2678
2679class EvtHandler(Object):
e811c8ce
RD
2680 def __repr__(self):
2681 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2682 def __init__(self, *args, **kwargs):
a95a7133 2683 """__init__(self) -> EvtHandler"""
54f9ee45 2684 newobj = _core_.new_EvtHandler(*args, **kwargs)
d14a1e28
RD
2685 self.this = newobj.this
2686 self.thisown = 1
2687 del newobj.thisown
e811c8ce 2688 def GetNextHandler(*args, **kwargs):
a95a7133 2689 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 2690 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
2691
2692 def GetPreviousHandler(*args, **kwargs):
a95a7133 2693 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 2694 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
2695
2696 def SetNextHandler(*args, **kwargs):
a95a7133 2697 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 2698 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
2699
2700 def SetPreviousHandler(*args, **kwargs):
a95a7133 2701 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 2702 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
2703
2704 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 2705 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 2706 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
2707
2708 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 2709 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 2710 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
2711
2712 def ProcessEvent(*args, **kwargs):
a95a7133 2713 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 2714 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
2715
2716 def AddPendingEvent(*args, **kwargs):
a95a7133 2717 """AddPendingEvent(self, Event event)"""
54f9ee45 2718 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
2719
2720 def ProcessPendingEvents(*args, **kwargs):
a95a7133 2721 """ProcessPendingEvents(self)"""
54f9ee45 2722 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
2723
2724 def Connect(*args, **kwargs):
a95a7133 2725 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 2726 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
2727
2728 def Disconnect(*args, **kwargs):
a95a7133 2729 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 2730 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
2731
2732 def _setOORInfo(*args, **kwargs):
a95a7133 2733 """_setOORInfo(self, PyObject _self)"""
54f9ee45 2734 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
e811c8ce 2735
d14a1e28
RD
2736 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2737 """
2738 Bind an event to an event handler.
2739
db3e571a
RD
2740 :param event: One of the EVT_* objects that specifies the
2741 type of event to bind,
d14a1e28 2742
db3e571a
RD
2743 :param handler: A callable object to be invoked when the
2744 event is delivered to self. Pass None to
2745 disconnect an event handler.
d14a1e28 2746
db3e571a
RD
2747 :param source: Sometimes the event originates from a
2748 different window than self, but you still
2749 want to catch it in self. (For example, a
2750 button event delivered to a frame.) By
2751 passing the source of the event, the event
2752 handling system is able to differentiate
2753 between the same event type from different
2754 controls.
d14a1e28 2755
db3e571a
RD
2756 :param id: Used to spcify the event source by ID instead
2757 of instance.
2758
2759 :param id2: Used when it is desirable to bind a handler
2760 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
2761 """
2762 if source is not None:
2763 id = source.GetId()
2764 event.Bind(self, id, id2, handler)
2765
66c033b4
RD
2766 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2767 """
2768 Disconencts the event handler binding for event from self.
2769 Returns True if successful.
2770 """
2771 if source is not None:
2772 id = source.GetId()
2773 return event.Unbind(self, id, id2)
d14a1e28 2774
d14a1e28
RD
2775
2776class EvtHandlerPtr(EvtHandler):
2777 def __init__(self, this):
2778 self.this = this
2779 if not hasattr(self,"thisown"): self.thisown = 0
2780 self.__class__ = EvtHandler
54f9ee45 2781_core_.EvtHandler_swigregister(EvtHandlerPtr)
d14a1e28
RD
2782
2783#---------------------------------------------------------------------------
2784
2785class PyEventBinder(object):
2786 """
2787 Instances of this class are used to bind specific events to event
2788 handlers.
2789 """
2790 def __init__(self, evtType, expectedIDs=0):
2791 if expectedIDs not in [0, 1, 2]:
2792 raise ValueError, "Invalid number of expectedIDs"
2793 self.expectedIDs = expectedIDs
2794
2795 if type(evtType) == list or type(evtType) == tuple:
2796 self.evtType = evtType
2797 else:
2798 self.evtType = [evtType]
2799
2800
2801 def Bind(self, target, id1, id2, function):
2802 """Bind this set of event types to target."""
2803 for et in self.evtType:
2804 target.Connect(id1, id2, et, function)
2805
66c033b4
RD
2806
2807 def Unbind(self, target, id1, id2):
2808 """Remove an event binding."""
2809 success = 0
2810 for et in self.evtType:
2811 success += target.Disconnect(id1, id2, et)
2812 return success != 0
2813
d14a1e28
RD
2814
2815 def __call__(self, *args):
2816 """
2817 For backwards compatibility with the old EVT_* functions.
2818 Should be called with either (window, func), (window, ID,
2819 func) or (window, ID1, ID2, func) parameters depending on the
2820 type of the event.
2821 """
2822 assert len(args) == 2 + self.expectedIDs
2823 id1 = wx.ID_ANY
2824 id2 = wx.ID_ANY
2825 target = args[0]
2826 if self.expectedIDs == 0:
2827 func = args[1]
2828 elif self.expectedIDs == 1:
2829 id1 = args[1]
2830 func = args[2]
2831 elif self.expectedIDs == 2:
2832 id1 = args[1]
2833 id2 = args[2]
2834 func = args[3]
2835 else:
2836 raise ValueError, "Unexpected number of IDs"
2837
2838 self.Bind(target, id1, id2, func)
2839
2840
2841# These two are square pegs that don't fit the PyEventBinder hole...
2842def EVT_COMMAND(win, id, cmd, func):
2843 win.Connect(id, -1, cmd, func)
2844def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
2845 win.Connect(id1, id2, cmd, func)
2846
2847
2848#---------------------------------------------------------------------------
2849
2850#---------------------------------------------------------------------------
2851
54f9ee45
RD
2852EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
2853EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 2854
e811c8ce
RD
2855def NewEventType(*args, **kwargs):
2856 """NewEventType() -> wxEventType"""
54f9ee45
RD
2857 return _core_.NewEventType(*args, **kwargs)
2858wxEVT_NULL = _core_.wxEVT_NULL
2859wxEVT_FIRST = _core_.wxEVT_FIRST
2860wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
2861wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
2862wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
2863wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
2864wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
2865wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
2866wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
2867wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
2868wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
2869wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
2870wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
2871wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
2872wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
2873wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
2874wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
2875wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
2876wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
2877wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
2878wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
2879wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
2880wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
2881wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
2882wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
2883wxEVT_MOTION = _core_.wxEVT_MOTION
2884wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
2885wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
2886wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
2887wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
2888wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
2889wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
2890wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
2891wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
2892wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
2893wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
2894wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
2895wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
2896wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
2897wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
2898wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
2899wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
2900wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
2901wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
2902wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
2903wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
2904wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
2905wxEVT_CHAR = _core_.wxEVT_CHAR
2906wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
2907wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
2908wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
2909wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
2910wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
2911wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
2912wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
2913wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
2914wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
2915wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
2916wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
2917wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
2918wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
2919wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
2920wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
2921wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
2922wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
2923wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
2924wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
2925wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
2926wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
2927wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
2928wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
2929wxEVT_SIZE = _core_.wxEVT_SIZE
2930wxEVT_MOVE = _core_.wxEVT_MOVE
2931wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
2932wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
2933wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
2934wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
2935wxEVT_POWER = _core_.wxEVT_POWER
2936wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
2937wxEVT_CREATE = _core_.wxEVT_CREATE
2938wxEVT_DESTROY = _core_.wxEVT_DESTROY
2939wxEVT_SHOW = _core_.wxEVT_SHOW
2940wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
2941wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
2942wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
2943wxEVT_PAINT = _core_.wxEVT_PAINT
2944wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
2945wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
2946wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
2947wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
2948wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
2949wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
2950wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
2951wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
2952wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
2953wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
2954wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
2955wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
2956wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
2957wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
2958wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
2959wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
2960wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
2961wxEVT_IDLE = _core_.wxEVT_IDLE
2962wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
2963wxEVT_SIZING = _core_.wxEVT_SIZING
2964wxEVT_MOVING = _core_.wxEVT_MOVING
2965wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
2966wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
2967wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
2968wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
2969wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
2970wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
2971wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
2972#
2973# Create some event binders
2974EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
2975EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
2976EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
2977EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
2978EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
2979EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
2980EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
2981EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
2982EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
2983EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
2984EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
2985EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
2986EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
2987EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
2988EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
2989EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
2990EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
2991EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
2992EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
2993EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
2994EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
2995EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
2996EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
2997EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
2998EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
2999EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3000EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3001EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3002EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3003EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3004EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3005EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3006EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3007EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3008EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3009EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3010EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3011EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3012EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3013EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3014
3015EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3016EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3017EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3018EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3019EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3020EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3021EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3022EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3023EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3024EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3025EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3026EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3027EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3028
3029EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3030 wxEVT_LEFT_UP,
3031 wxEVT_MIDDLE_DOWN,
3032 wxEVT_MIDDLE_UP,
3033 wxEVT_RIGHT_DOWN,
3034 wxEVT_RIGHT_UP,
3035 wxEVT_MOTION,
3036 wxEVT_LEFT_DCLICK,
3037 wxEVT_MIDDLE_DCLICK,
3038 wxEVT_RIGHT_DCLICK,
3039 wxEVT_ENTER_WINDOW,
3040 wxEVT_LEAVE_WINDOW,
3041 wxEVT_MOUSEWHEEL
3042 ])
3043
3044
3045# Scrolling from wxWindow (sent to wxScrolledWindow)
3046EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3047 wxEVT_SCROLLWIN_BOTTOM,
3048 wxEVT_SCROLLWIN_LINEUP,
3049 wxEVT_SCROLLWIN_LINEDOWN,
3050 wxEVT_SCROLLWIN_PAGEUP,
3051 wxEVT_SCROLLWIN_PAGEDOWN,
3052 wxEVT_SCROLLWIN_THUMBTRACK,
3053 wxEVT_SCROLLWIN_THUMBRELEASE,
3054 ])
3055
3056EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3057EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3058EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3059EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3060EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3061EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3062EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3063EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3064
3065# Scrolling from wxSlider and wxScrollBar
3066EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3067 wxEVT_SCROLL_BOTTOM,
3068 wxEVT_SCROLL_LINEUP,
3069 wxEVT_SCROLL_LINEDOWN,
3070 wxEVT_SCROLL_PAGEUP,
3071 wxEVT_SCROLL_PAGEDOWN,
3072 wxEVT_SCROLL_THUMBTRACK,
3073 wxEVT_SCROLL_THUMBRELEASE,
3074 wxEVT_SCROLL_ENDSCROLL,
3075 ])
3076
3077EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3078EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3079EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3080EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3081EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3082EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3083EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3084EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3085EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3086
3087# Scrolling from wxSlider and wxScrollBar, with an id
3088EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3089 wxEVT_SCROLL_BOTTOM,
3090 wxEVT_SCROLL_LINEUP,
3091 wxEVT_SCROLL_LINEDOWN,
3092 wxEVT_SCROLL_PAGEUP,
3093 wxEVT_SCROLL_PAGEDOWN,
3094 wxEVT_SCROLL_THUMBTRACK,
3095 wxEVT_SCROLL_THUMBRELEASE,
3096 wxEVT_SCROLL_ENDSCROLL,
3097 ], 1)
3098
3099EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3100EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3101EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3102EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3103EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3104EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3105EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3106EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3107EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3108
d14a1e28
RD
3109EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3110EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3111EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3112EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3113EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3114EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3115EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3116EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3117EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3118EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3119
3120EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3121EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3122EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3123EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3124EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3125EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3126EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3127EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3128EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3129
3130
3131EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3132EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3133EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3134EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3135EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3136EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3137EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3138
3139EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3140
3141EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3142EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3143
3144EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3145
3146
3147
3148#---------------------------------------------------------------------------
3149
3150class Event(Object):
e811c8ce
RD
3151 def __init__(self): raise RuntimeError, "No constructor defined"
3152 def __repr__(self):
3153 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45 3154 def __del__(self, destroy=_core_.delete_Event):
a95a7133 3155 """__del__(self)"""
d14a1e28
RD
3156 try:
3157 if self.thisown: destroy(self)
3158 except: pass
e811c8ce
RD
3159
3160 def SetEventType(*args, **kwargs):
a95a7133 3161 """SetEventType(self, wxEventType typ)"""
54f9ee45 3162 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
3163
3164 def GetEventType(*args, **kwargs):
a95a7133 3165 """GetEventType(self) -> wxEventType"""
54f9ee45 3166 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
3167
3168 def GetEventObject(*args, **kwargs):
a95a7133 3169 """GetEventObject(self) -> Object"""
54f9ee45 3170 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
3171
3172 def SetEventObject(*args, **kwargs):
a95a7133 3173 """SetEventObject(self, Object obj)"""
54f9ee45 3174 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
3175
3176 def GetTimestamp(*args, **kwargs):
a95a7133 3177 """GetTimestamp(self) -> long"""
54f9ee45 3178 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
3179
3180 def SetTimestamp(*args, **kwargs):
a95a7133 3181 """SetTimestamp(self, long ts=0)"""
54f9ee45 3182 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
3183
3184 def GetId(*args, **kwargs):
a95a7133 3185 """GetId(self) -> int"""
54f9ee45 3186 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
3187
3188 def SetId(*args, **kwargs):
a95a7133 3189 """SetId(self, int Id)"""
54f9ee45 3190 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
3191
3192 def IsCommandEvent(*args, **kwargs):
a95a7133 3193 """IsCommandEvent(self) -> bool"""
54f9ee45 3194 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
3195
3196 def Skip(*args, **kwargs):
a95a7133 3197 """Skip(self, bool skip=True)"""
54f9ee45 3198 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
3199
3200 def GetSkipped(*args, **kwargs):
a95a7133 3201 """GetSkipped(self) -> bool"""
54f9ee45 3202 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
3203
3204 def ShouldPropagate(*args, **kwargs):
a95a7133 3205 """ShouldPropagate(self) -> bool"""
54f9ee45 3206 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
3207
3208 def StopPropagation(*args, **kwargs):
a95a7133 3209 """StopPropagation(self) -> int"""
54f9ee45 3210 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
3211
3212 def ResumePropagation(*args, **kwargs):
a95a7133 3213 """ResumePropagation(self, int propagationLevel)"""
54f9ee45 3214 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
3215
3216 def Clone(*args, **kwargs):
a95a7133 3217 """Clone(self) -> Event"""
54f9ee45 3218 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 3219
d14a1e28
RD
3220
3221class EventPtr(Event):
3222 def __init__(self, this):
3223 self.this = this
3224 if not hasattr(self,"thisown"): self.thisown = 0
3225 self.__class__ = Event
54f9ee45 3226_core_.Event_swigregister(EventPtr)
d14a1e28
RD
3227
3228#---------------------------------------------------------------------------
3229
3230class PropagationDisabler(object):
e811c8ce
RD
3231 def __repr__(self):
3232 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3233 def __init__(self, *args, **kwargs):
a95a7133 3234 """__init__(self, Event event) -> PropagationDisabler"""
54f9ee45 3235 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
d14a1e28
RD
3236 self.this = newobj.this
3237 self.thisown = 1
3238 del newobj.thisown
54f9ee45 3239 def __del__(self, destroy=_core_.delete_PropagationDisabler):
a95a7133 3240 """__del__(self)"""
d14a1e28
RD
3241 try:
3242 if self.thisown: destroy(self)
3243 except: pass
e811c8ce 3244
d14a1e28
RD
3245
3246class PropagationDisablerPtr(PropagationDisabler):
3247 def __init__(self, this):
3248 self.this = this
3249 if not hasattr(self,"thisown"): self.thisown = 0
3250 self.__class__ = PropagationDisabler
54f9ee45 3251_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
d14a1e28
RD
3252
3253class PropagateOnce(object):
e811c8ce
RD
3254 def __repr__(self):
3255 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3256 def __init__(self, *args, **kwargs):
a95a7133 3257 """__init__(self, Event event) -> PropagateOnce"""
54f9ee45 3258 newobj = _core_.new_PropagateOnce(*args, **kwargs)
d14a1e28
RD
3259 self.this = newobj.this
3260 self.thisown = 1
3261 del newobj.thisown
54f9ee45 3262 def __del__(self, destroy=_core_.delete_PropagateOnce):
a95a7133 3263 """__del__(self)"""
d14a1e28
RD
3264 try:
3265 if self.thisown: destroy(self)
3266 except: pass
e811c8ce 3267
d14a1e28
RD
3268
3269class PropagateOncePtr(PropagateOnce):
3270 def __init__(self, this):
3271 self.this = this
3272 if not hasattr(self,"thisown"): self.thisown = 0
3273 self.__class__ = PropagateOnce
54f9ee45 3274_core_.PropagateOnce_swigregister(PropagateOncePtr)
d14a1e28
RD
3275
3276#---------------------------------------------------------------------------
3277
3278class CommandEvent(Event):
e811c8ce
RD
3279 def __repr__(self):
3280 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3281 def __init__(self, *args, **kwargs):
a95a7133 3282 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
54f9ee45 3283 newobj = _core_.new_CommandEvent(*args, **kwargs)
d14a1e28
RD
3284 self.this = newobj.this
3285 self.thisown = 1
3286 del newobj.thisown
e811c8ce 3287 def GetSelection(*args, **kwargs):
a95a7133 3288 """GetSelection(self) -> int"""
54f9ee45 3289 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
3290
3291 def SetString(*args, **kwargs):
a95a7133 3292 """SetString(self, String s)"""
54f9ee45 3293 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
3294
3295 def GetString(*args, **kwargs):
a95a7133 3296 """GetString(self) -> String"""
54f9ee45 3297 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
3298
3299 def IsChecked(*args, **kwargs):
a95a7133 3300 """IsChecked(self) -> bool"""
54f9ee45 3301 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 3302
242b7b46 3303 Checked = IsChecked
e811c8ce 3304 def IsSelection(*args, **kwargs):
a95a7133 3305 """IsSelection(self) -> bool"""
54f9ee45 3306 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
3307
3308 def SetExtraLong(*args, **kwargs):
a95a7133 3309 """SetExtraLong(self, long extraLong)"""
54f9ee45 3310 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
3311
3312 def GetExtraLong(*args, **kwargs):
a95a7133 3313 """GetExtraLong(self) -> long"""
54f9ee45 3314 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
3315
3316 def SetInt(*args, **kwargs):
a95a7133 3317 """SetInt(self, int i)"""
54f9ee45 3318 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
3319
3320 def GetInt(*args, **kwargs):
a95a7133 3321 """GetInt(self) -> long"""
54f9ee45 3322 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce
RD
3323
3324 def Clone(*args, **kwargs):
a95a7133 3325 """Clone(self) -> Event"""
54f9ee45 3326 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 3327
d14a1e28
RD
3328
3329class CommandEventPtr(CommandEvent):
3330 def __init__(self, this):
3331 self.this = this
3332 if not hasattr(self,"thisown"): self.thisown = 0
3333 self.__class__ = CommandEvent
54f9ee45 3334_core_.CommandEvent_swigregister(CommandEventPtr)
d14a1e28
RD
3335
3336#---------------------------------------------------------------------------
3337
3338class NotifyEvent(CommandEvent):
e811c8ce
RD
3339 def __repr__(self):
3340 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3341 def __init__(self, *args, **kwargs):
a95a7133 3342 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
54f9ee45 3343 newobj = _core_.new_NotifyEvent(*args, **kwargs)
d14a1e28
RD
3344 self.this = newobj.this
3345 self.thisown = 1
3346 del newobj.thisown
e811c8ce 3347 def Veto(*args, **kwargs):
a95a7133 3348 """Veto(self)"""
54f9ee45 3349 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
3350
3351 def Allow(*args, **kwargs):
a95a7133 3352 """Allow(self)"""
54f9ee45 3353 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
3354
3355 def IsAllowed(*args, **kwargs):
a95a7133 3356 """IsAllowed(self) -> bool"""
54f9ee45 3357 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 3358
d14a1e28
RD
3359
3360class NotifyEventPtr(NotifyEvent):
3361 def __init__(self, this):
3362 self.this = this
3363 if not hasattr(self,"thisown"): self.thisown = 0
3364 self.__class__ = NotifyEvent
54f9ee45 3365_core_.NotifyEvent_swigregister(NotifyEventPtr)
d14a1e28
RD
3366
3367#---------------------------------------------------------------------------
3368
3369class ScrollEvent(CommandEvent):
e811c8ce
RD
3370 def __repr__(self):
3371 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3372 def __init__(self, *args, **kwargs):
0df68c9f 3373 """
a95a7133 3374 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
3375 int orient=0) -> ScrollEvent
3376 """
54f9ee45 3377 newobj = _core_.new_ScrollEvent(*args, **kwargs)
d14a1e28
RD
3378 self.this = newobj.this
3379 self.thisown = 1
3380 del newobj.thisown
e811c8ce 3381 def GetOrientation(*args, **kwargs):
a95a7133 3382 """GetOrientation(self) -> int"""
54f9ee45 3383 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
3384
3385 def GetPosition(*args, **kwargs):
a95a7133 3386 """GetPosition(self) -> int"""
54f9ee45 3387 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3388
3389 def SetOrientation(*args, **kwargs):
a95a7133 3390 """SetOrientation(self, int orient)"""
54f9ee45 3391 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
3392
3393 def SetPosition(*args, **kwargs):
a95a7133 3394 """SetPosition(self, int pos)"""
54f9ee45 3395 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 3396
d14a1e28
RD
3397
3398class ScrollEventPtr(ScrollEvent):
3399 def __init__(self, this):
3400 self.this = this
3401 if not hasattr(self,"thisown"): self.thisown = 0
3402 self.__class__ = ScrollEvent
54f9ee45 3403_core_.ScrollEvent_swigregister(ScrollEventPtr)
d14a1e28
RD
3404
3405#---------------------------------------------------------------------------
3406
3407class ScrollWinEvent(Event):
e811c8ce
RD
3408 def __repr__(self):
3409 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3410 def __init__(self, *args, **kwargs):
a95a7133 3411 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
54f9ee45 3412 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
d14a1e28
RD
3413 self.this = newobj.this
3414 self.thisown = 1
3415 del newobj.thisown
e811c8ce 3416 def GetOrientation(*args, **kwargs):
a95a7133 3417 """GetOrientation(self) -> int"""
54f9ee45 3418 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
3419
3420 def GetPosition(*args, **kwargs):
a95a7133 3421 """GetPosition(self) -> int"""
54f9ee45 3422 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3423
3424 def SetOrientation(*args, **kwargs):
a95a7133 3425 """SetOrientation(self, int orient)"""
54f9ee45 3426 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
3427
3428 def SetPosition(*args, **kwargs):
a95a7133 3429 """SetPosition(self, int pos)"""
54f9ee45 3430 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 3431
d14a1e28
RD
3432
3433class ScrollWinEventPtr(ScrollWinEvent):
3434 def __init__(self, this):
3435 self.this = this
3436 if not hasattr(self,"thisown"): self.thisown = 0
3437 self.__class__ = ScrollWinEvent
54f9ee45 3438_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
d14a1e28
RD
3439
3440#---------------------------------------------------------------------------
3441
54f9ee45
RD
3442MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3443MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3444MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3445MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3446MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 3447class MouseEvent(Event):
e811c8ce
RD
3448 def __repr__(self):
3449 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3450 def __init__(self, *args, **kwargs):
a95a7133 3451 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
54f9ee45 3452 newobj = _core_.new_MouseEvent(*args, **kwargs)
d14a1e28
RD
3453 self.this = newobj.this
3454 self.thisown = 1
3455 del newobj.thisown
e811c8ce 3456 def IsButton(*args, **kwargs):
a95a7133 3457 """IsButton(self) -> bool"""
54f9ee45 3458 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
3459
3460 def ButtonDown(*args, **kwargs):
a95a7133 3461 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
54f9ee45 3462 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
3463
3464 def ButtonDClick(*args, **kwargs):
a95a7133 3465 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
54f9ee45 3466 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
3467
3468 def ButtonUp(*args, **kwargs):
a95a7133 3469 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
54f9ee45 3470 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
3471
3472 def Button(*args, **kwargs):
a95a7133 3473 """Button(self, int but) -> bool"""
54f9ee45 3474 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
3475
3476 def ButtonIsDown(*args, **kwargs):
a95a7133 3477 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 3478 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
3479
3480 def GetButton(*args, **kwargs):
a95a7133 3481 """GetButton(self) -> int"""
54f9ee45 3482 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
3483
3484 def ControlDown(*args, **kwargs):
a95a7133 3485 """ControlDown(self) -> bool"""
54f9ee45 3486 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
3487
3488 def MetaDown(*args, **kwargs):
a95a7133 3489 """MetaDown(self) -> bool"""
54f9ee45 3490 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
3491
3492 def AltDown(*args, **kwargs):
a95a7133 3493 """AltDown(self) -> bool"""
54f9ee45 3494 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
3495
3496 def ShiftDown(*args, **kwargs):
a95a7133 3497 """ShiftDown(self) -> bool"""
54f9ee45 3498 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 3499
412d302d
RD
3500 def CmdDown(*args, **kwargs):
3501 """
3502 CmdDown(self) -> bool
3503
3504 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3505 platforms but the special "Apple" (a.k.a as "Command") key on
3506 Macs: it makes often sense to use it instead of, say, `ControlDown`
3507 because Cmd key is used for the same thing under Mac as Ctrl
3508 elsewhere. The Ctrl still exists, it's just not used for this
3509 purpose. So for non-Mac platforms this is the same as `ControlDown`
3510 and Macs this is the same as `MetaDown`.
3511 """
3512 return _core_.MouseEvent_CmdDown(*args, **kwargs)
3513
e811c8ce 3514 def LeftDown(*args, **kwargs):
a95a7133 3515 """LeftDown(self) -> bool"""
54f9ee45 3516 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
3517
3518 def MiddleDown(*args, **kwargs):
a95a7133 3519 """MiddleDown(self) -> bool"""
54f9ee45 3520 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
3521
3522 def RightDown(*args, **kwargs):
a95a7133 3523 """RightDown(self) -> bool"""
54f9ee45 3524 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
3525
3526 def LeftUp(*args, **kwargs):
a95a7133 3527 """LeftUp(self) -> bool"""
54f9ee45 3528 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
3529
3530 def MiddleUp(*args, **kwargs):
a95a7133 3531 """MiddleUp(self) -> bool"""
54f9ee45 3532 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
3533
3534 def RightUp(*args, **kwargs):
a95a7133 3535 """RightUp(self) -> bool"""
54f9ee45 3536 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
3537
3538 def LeftDClick(*args, **kwargs):
a95a7133 3539 """LeftDClick(self) -> bool"""
54f9ee45 3540 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
3541
3542 def MiddleDClick(*args, **kwargs):
a95a7133 3543 """MiddleDClick(self) -> bool"""
54f9ee45 3544 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
3545
3546 def RightDClick(*args, **kwargs):
a95a7133 3547 """RightDClick(self) -> bool"""
54f9ee45 3548 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
3549
3550 def LeftIsDown(*args, **kwargs):
a95a7133 3551 """LeftIsDown(self) -> bool"""
54f9ee45 3552 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
3553
3554 def MiddleIsDown(*args, **kwargs):
a95a7133 3555 """MiddleIsDown(self) -> bool"""
54f9ee45 3556 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
3557
3558 def RightIsDown(*args, **kwargs):
a95a7133 3559 """RightIsDown(self) -> bool"""
54f9ee45 3560 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
3561
3562 def Dragging(*args, **kwargs):
a95a7133 3563 """Dragging(self) -> bool"""
54f9ee45 3564 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
3565
3566 def Moving(*args, **kwargs):
a95a7133 3567 """Moving(self) -> bool"""
54f9ee45 3568 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
3569
3570 def Entering(*args, **kwargs):
a95a7133 3571 """Entering(self) -> bool"""
54f9ee45 3572 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
3573
3574 def Leaving(*args, **kwargs):
a95a7133 3575 """Leaving(self) -> bool"""
54f9ee45 3576 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
3577
3578 def GetPosition(*args, **kwargs):
0df68c9f 3579 """
a95a7133 3580 GetPosition(self) -> Point
e811c8ce 3581
41e2b43e
RD
3582 Returns the position of the mouse in window coordinates when the event
3583 happened.
0df68c9f 3584 """
54f9ee45 3585 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3586
3587 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
3588 """
3589 GetPositionTuple() -> (x,y)
e811c8ce 3590
41e2b43e
RD
3591 Returns the position of the mouse in window coordinates when the event
3592 happened.
0df68c9f 3593 """
54f9ee45 3594 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
3595
3596 def GetLogicalPosition(*args, **kwargs):
a95a7133 3597 """GetLogicalPosition(self, DC dc) -> Point"""
54f9ee45 3598 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
3599
3600 def GetX(*args, **kwargs):
a95a7133 3601 """GetX(self) -> int"""
54f9ee45 3602 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
3603
3604 def GetY(*args, **kwargs):
a95a7133 3605 """GetY(self) -> int"""
54f9ee45 3606 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
3607
3608 def GetWheelRotation(*args, **kwargs):
a95a7133 3609 """GetWheelRotation(self) -> int"""
54f9ee45 3610 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
3611
3612 def GetWheelDelta(*args, **kwargs):
a95a7133 3613 """GetWheelDelta(self) -> int"""
54f9ee45 3614 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce
RD
3615
3616 def GetLinesPerAction(*args, **kwargs):
a95a7133 3617 """GetLinesPerAction(self) -> int"""
54f9ee45 3618 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
3619
3620 def IsPageScroll(*args, **kwargs):
a95a7133 3621 """IsPageScroll(self) -> bool"""
54f9ee45
RD
3622 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3623
3624 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3625 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3626 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3627 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3628 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3629 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3630 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3631 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3632 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3633 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3634 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3635 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
d14a1e28
RD
3636
3637class MouseEventPtr(MouseEvent):
3638 def __init__(self, this):
3639 self.this = this
3640 if not hasattr(self,"thisown"): self.thisown = 0
3641 self.__class__ = MouseEvent
54f9ee45 3642_core_.MouseEvent_swigregister(MouseEventPtr)
d14a1e28
RD
3643
3644#---------------------------------------------------------------------------
3645
3646class SetCursorEvent(Event):
e811c8ce
RD
3647 def __repr__(self):
3648 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3649 def __init__(self, *args, **kwargs):
a95a7133 3650 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
54f9ee45 3651 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
d14a1e28
RD
3652 self.this = newobj.this
3653 self.thisown = 1
3654 del newobj.thisown
e811c8ce 3655 def GetX(*args, **kwargs):
a95a7133 3656 """GetX(self) -> int"""
54f9ee45 3657 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
3658
3659 def GetY(*args, **kwargs):
a95a7133 3660 """GetY(self) -> int"""
54f9ee45 3661 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
3662
3663 def SetCursor(*args, **kwargs):
a95a7133 3664 """SetCursor(self, Cursor cursor)"""
54f9ee45 3665 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
3666
3667 def GetCursor(*args, **kwargs):
a95a7133 3668 """GetCursor(self) -> Cursor"""
54f9ee45 3669 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
3670
3671 def HasCursor(*args, **kwargs):
a95a7133 3672 """HasCursor(self) -> bool"""
54f9ee45 3673 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 3674
d14a1e28
RD
3675
3676class SetCursorEventPtr(SetCursorEvent):
3677 def __init__(self, this):
3678 self.this = this
3679 if not hasattr(self,"thisown"): self.thisown = 0
3680 self.__class__ = SetCursorEvent
54f9ee45 3681_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
d14a1e28
RD
3682
3683#---------------------------------------------------------------------------
3684
3685class KeyEvent(Event):
e811c8ce
RD
3686 def __repr__(self):
3687 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3688 def __init__(self, *args, **kwargs):
a95a7133 3689 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
54f9ee45 3690 newobj = _core_.new_KeyEvent(*args, **kwargs)
d14a1e28
RD
3691 self.this = newobj.this
3692 self.thisown = 1
3693 del newobj.thisown
e811c8ce 3694 def ControlDown(*args, **kwargs):
a95a7133 3695 """ControlDown(self) -> bool"""
54f9ee45 3696 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
3697
3698 def MetaDown(*args, **kwargs):
a95a7133 3699 """MetaDown(self) -> bool"""
54f9ee45 3700 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
3701
3702 def AltDown(*args, **kwargs):
a95a7133 3703 """AltDown(self) -> bool"""
54f9ee45 3704 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
3705
3706 def ShiftDown(*args, **kwargs):
a95a7133 3707 """ShiftDown(self) -> bool"""
54f9ee45 3708 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 3709
412d302d
RD
3710 def CmdDown(*args, **kwargs):
3711 """
3712 CmdDown(self) -> bool
3713
3714 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3715 platforms but the special "Apple" (a.k.a as "Command") key on
3716 Macs: it makes often sense to use it instead of, say, `ControlDown`
3717 because Cmd key is used for the same thing under Mac as Ctrl
3718 elsewhere. The Ctrl still exists, it's just not used for this
3719 purpose. So for non-Mac platforms this is the same as `ControlDown`
3720 and Macs this is the same as `MetaDown`.
3721 """
3722 return _core_.KeyEvent_CmdDown(*args, **kwargs)
3723
e811c8ce 3724 def HasModifiers(*args, **kwargs):
a95a7133 3725 """HasModifiers(self) -> bool"""
54f9ee45 3726 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
3727
3728 def GetKeyCode(*args, **kwargs):
a95a7133 3729 """GetKeyCode(self) -> int"""
54f9ee45 3730 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 3731
d14a1e28 3732 KeyCode = GetKeyCode
19272049
RD
3733 def GetUnicodeKey(*args, **kwargs):
3734 """GetUnicodeKey(self) -> int"""
3735 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 3736
19272049 3737 GetUniChar = GetUnicodeKey
e811c8ce 3738 def GetRawKeyCode(*args, **kwargs):
a95a7133 3739 """GetRawKeyCode(self) -> unsigned int"""
54f9ee45 3740 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
3741
3742 def GetRawKeyFlags(*args, **kwargs):
a95a7133 3743 """GetRawKeyFlags(self) -> unsigned int"""
54f9ee45 3744 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
3745
3746 def GetPosition(*args, **kwargs):
0df68c9f 3747 """
a95a7133 3748 GetPosition(self) -> Point
e811c8ce 3749
0df68c9f
RD
3750 Find the position of the event.
3751 """
54f9ee45 3752 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3753
3754 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
3755 """
3756 GetPositionTuple() -> (x,y)
e811c8ce 3757
0df68c9f
RD
3758 Find the position of the event.
3759 """
54f9ee45 3760 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
3761
3762 def GetX(*args, **kwargs):
a95a7133 3763 """GetX(self) -> int"""
54f9ee45 3764 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
3765
3766 def GetY(*args, **kwargs):
a95a7133 3767 """GetY(self) -> int"""
54f9ee45
RD
3768 return _core_.KeyEvent_GetY(*args, **kwargs)
3769
3770 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
3771 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
3772 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
3773 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
3774 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
3775 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
3776 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
3777 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
3778 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
3779 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
d14a1e28
RD
3780
3781class KeyEventPtr(KeyEvent):
3782 def __init__(self, this):
3783 self.this = this
3784 if not hasattr(self,"thisown"): self.thisown = 0
3785 self.__class__ = KeyEvent
54f9ee45 3786_core_.KeyEvent_swigregister(KeyEventPtr)
d14a1e28
RD
3787
3788#---------------------------------------------------------------------------
3789
3790class SizeEvent(Event):
e811c8ce
RD
3791 def __repr__(self):
3792 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3793 def __init__(self, *args, **kwargs):
a95a7133 3794 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
54f9ee45 3795 newobj = _core_.new_SizeEvent(*args, **kwargs)
d14a1e28
RD
3796 self.this = newobj.this
3797 self.thisown = 1
3798 del newobj.thisown
e811c8ce 3799 def GetSize(*args, **kwargs):
a95a7133 3800 """GetSize(self) -> Size"""
54f9ee45 3801 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
3802
3803 def GetRect(*args, **kwargs):
a95a7133 3804 """GetRect(self) -> Rect"""
54f9ee45 3805 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
3806
3807 def SetRect(*args, **kwargs):
a95a7133 3808 """SetRect(self, Rect rect)"""
54f9ee45 3809 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
3810
3811 def SetSize(*args, **kwargs):
a95a7133 3812 """SetSize(self, Size size)"""
54f9ee45 3813 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 3814
54f9ee45
RD
3815 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
3816 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
d14a1e28
RD
3817
3818class SizeEventPtr(SizeEvent):
3819 def __init__(self, this):
3820 self.this = this
3821 if not hasattr(self,"thisown"): self.thisown = 0
3822 self.__class__ = SizeEvent
54f9ee45 3823_core_.SizeEvent_swigregister(SizeEventPtr)
d14a1e28
RD
3824
3825#---------------------------------------------------------------------------
3826
3827class MoveEvent(Event):
e811c8ce
RD
3828 def __repr__(self):
3829 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3830 def __init__(self, *args, **kwargs):
a95a7133 3831 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
54f9ee45 3832 newobj = _core_.new_MoveEvent(*args, **kwargs)
d14a1e28
RD
3833 self.this = newobj.this
3834 self.thisown = 1
3835 del newobj.thisown
e811c8ce 3836 def GetPosition(*args, **kwargs):
a95a7133 3837 """GetPosition(self) -> Point"""
54f9ee45 3838 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3839
3840 def GetRect(*args, **kwargs):
a95a7133 3841 """GetRect(self) -> Rect"""
54f9ee45 3842 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
3843
3844 def SetRect(*args, **kwargs):
a95a7133 3845 """SetRect(self, Rect rect)"""
54f9ee45 3846 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
3847
3848 def SetPosition(*args, **kwargs):
a95a7133 3849 """SetPosition(self, Point pos)"""
54f9ee45 3850 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 3851
54f9ee45
RD
3852 m_pos = property(_core_.MoveEvent_m_pos_get, _core_.MoveEvent_m_pos_set)
3853 m_rect = property(_core_.MoveEvent_m_rect_get, _core_.MoveEvent_m_rect_set)
d14a1e28
RD
3854
3855class MoveEventPtr(MoveEvent):
3856 def __init__(self, this):
3857 self.this = this
3858 if not hasattr(self,"thisown"): self.thisown = 0
3859 self.__class__ = MoveEvent
54f9ee45 3860_core_.MoveEvent_swigregister(MoveEventPtr)
d14a1e28
RD
3861
3862#---------------------------------------------------------------------------
3863
3864class PaintEvent(Event):
e811c8ce
RD
3865 def __repr__(self):
3866 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3867 def __init__(self, *args, **kwargs):
a95a7133 3868 """__init__(self, int Id=0) -> PaintEvent"""
54f9ee45 3869 newobj = _core_.new_PaintEvent(*args, **kwargs)
d14a1e28
RD
3870 self.this = newobj.this
3871 self.thisown = 1
3872 del newobj.thisown
d14a1e28
RD
3873
3874class PaintEventPtr(PaintEvent):
3875 def __init__(self, this):
3876 self.this = this
3877 if not hasattr(self,"thisown"): self.thisown = 0
3878 self.__class__ = PaintEvent
54f9ee45 3879_core_.PaintEvent_swigregister(PaintEventPtr)
d14a1e28
RD
3880
3881class NcPaintEvent(Event):
e811c8ce
RD
3882 def __repr__(self):
3883 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3884 def __init__(self, *args, **kwargs):
a95a7133 3885 """__init__(self, int winid=0) -> NcPaintEvent"""
54f9ee45 3886 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
d14a1e28
RD
3887 self.this = newobj.this
3888 self.thisown = 1
3889 del newobj.thisown
d14a1e28
RD
3890
3891class NcPaintEventPtr(NcPaintEvent):
3892 def __init__(self, this):
3893 self.this = this
3894 if not hasattr(self,"thisown"): self.thisown = 0
3895 self.__class__ = NcPaintEvent
54f9ee45 3896_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
d14a1e28
RD
3897
3898#---------------------------------------------------------------------------
3899
3900class EraseEvent(Event):
e811c8ce
RD
3901 def __repr__(self):
3902 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3903 def __init__(self, *args, **kwargs):
a95a7133 3904 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
54f9ee45 3905 newobj = _core_.new_EraseEvent(*args, **kwargs)
d14a1e28
RD
3906 self.this = newobj.this
3907 self.thisown = 1
3908 del newobj.thisown
e811c8ce 3909 def GetDC(*args, **kwargs):
a95a7133 3910 """GetDC(self) -> DC"""
54f9ee45 3911 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 3912
d14a1e28
RD
3913
3914class EraseEventPtr(EraseEvent):
3915 def __init__(self, this):
3916 self.this = this
3917 if not hasattr(self,"thisown"): self.thisown = 0
3918 self.__class__ = EraseEvent
54f9ee45 3919_core_.EraseEvent_swigregister(EraseEventPtr)
d14a1e28
RD
3920
3921#---------------------------------------------------------------------------
3922
3923class FocusEvent(Event):
e811c8ce
RD
3924 def __repr__(self):
3925 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3926 def __init__(self, *args, **kwargs):
a95a7133 3927 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
54f9ee45 3928 newobj = _core_.new_FocusEvent(*args, **kwargs)
d14a1e28
RD
3929 self.this = newobj.this
3930 self.thisown = 1
3931 del newobj.thisown
e811c8ce 3932 def GetWindow(*args, **kwargs):
a95a7133 3933 """GetWindow(self) -> Window"""
54f9ee45 3934 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
3935
3936 def SetWindow(*args, **kwargs):
a95a7133 3937 """SetWindow(self, Window win)"""
54f9ee45 3938 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 3939
d14a1e28
RD
3940
3941class FocusEventPtr(FocusEvent):
3942 def __init__(self, this):
3943 self.this = this
3944 if not hasattr(self,"thisown"): self.thisown = 0
3945 self.__class__ = FocusEvent
54f9ee45 3946_core_.FocusEvent_swigregister(FocusEventPtr)
d14a1e28
RD
3947
3948#---------------------------------------------------------------------------
3949
3950class ChildFocusEvent(CommandEvent):
e811c8ce
RD
3951 def __repr__(self):
3952 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3953 def __init__(self, *args, **kwargs):
a95a7133 3954 """__init__(self, Window win=None) -> ChildFocusEvent"""
54f9ee45 3955 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
d14a1e28
RD
3956 self.this = newobj.this
3957 self.thisown = 1
3958 del newobj.thisown
e811c8ce 3959 def GetWindow(*args, **kwargs):
a95a7133 3960 """GetWindow(self) -> Window"""
54f9ee45 3961 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 3962
d14a1e28
RD
3963
3964class ChildFocusEventPtr(ChildFocusEvent):
3965 def __init__(self, this):
3966 self.this = this
3967 if not hasattr(self,"thisown"): self.thisown = 0
3968 self.__class__ = ChildFocusEvent
54f9ee45 3969_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
d14a1e28
RD
3970
3971#---------------------------------------------------------------------------
3972
3973class ActivateEvent(Event):
e811c8ce
RD
3974 def __repr__(self):
3975 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3976 def __init__(self, *args, **kwargs):
a95a7133 3977 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
54f9ee45 3978 newobj = _core_.new_ActivateEvent(*args, **kwargs)
d14a1e28
RD
3979 self.this = newobj.this
3980 self.thisown = 1
3981 del newobj.thisown
e811c8ce 3982 def GetActive(*args, **kwargs):
a95a7133 3983 """GetActive(self) -> bool"""
54f9ee45 3984 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 3985
d14a1e28
RD
3986
3987class ActivateEventPtr(ActivateEvent):
3988 def __init__(self, this):
3989 self.this = this
3990 if not hasattr(self,"thisown"): self.thisown = 0
3991 self.__class__ = ActivateEvent
54f9ee45 3992_core_.ActivateEvent_swigregister(ActivateEventPtr)
d14a1e28
RD
3993
3994#---------------------------------------------------------------------------
3995
3996class InitDialogEvent(Event):
e811c8ce
RD
3997 def __repr__(self):
3998 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3999 def __init__(self, *args, **kwargs):
a95a7133 4000 """__init__(self, int Id=0) -> InitDialogEvent"""
54f9ee45 4001 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
d14a1e28
RD
4002 self.this = newobj.this
4003 self.thisown = 1
4004 del newobj.thisown
d14a1e28
RD
4005
4006class InitDialogEventPtr(InitDialogEvent):
4007 def __init__(self, this):
4008 self.this = this
4009 if not hasattr(self,"thisown"): self.thisown = 0
4010 self.__class__ = InitDialogEvent
54f9ee45 4011_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
d14a1e28
RD
4012
4013#---------------------------------------------------------------------------
4014
4015class MenuEvent(Event):
e811c8ce
RD
4016 def __repr__(self):
4017 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4018 def __init__(self, *args, **kwargs):
a95a7133 4019 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
54f9ee45 4020 newobj = _core_.new_MenuEvent(*args, **kwargs)
d14a1e28
RD
4021 self.this = newobj.this
4022 self.thisown = 1
4023 del newobj.thisown
e811c8ce 4024 def GetMenuId(*args, **kwargs):
a95a7133 4025 """GetMenuId(self) -> int"""
54f9ee45 4026 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
4027
4028 def IsPopup(*args, **kwargs):
a95a7133 4029 """IsPopup(self) -> bool"""
54f9ee45 4030 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
4031
4032 def GetMenu(*args, **kwargs):
a95a7133 4033 """GetMenu(self) -> Menu"""
54f9ee45 4034 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 4035
d14a1e28
RD
4036
4037class MenuEventPtr(MenuEvent):
4038 def __init__(self, this):
4039 self.this = this
4040 if not hasattr(self,"thisown"): self.thisown = 0
4041 self.__class__ = MenuEvent
54f9ee45 4042_core_.MenuEvent_swigregister(MenuEventPtr)
d14a1e28
RD
4043
4044#---------------------------------------------------------------------------
4045
4046class CloseEvent(Event):
e811c8ce
RD
4047 def __repr__(self):
4048 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4049 def __init__(self, *args, **kwargs):
a95a7133 4050 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
54f9ee45 4051 newobj = _core_.new_CloseEvent(*args, **kwargs)
d14a1e28
RD
4052 self.this = newobj.this
4053 self.thisown = 1
4054 del newobj.thisown
e811c8ce 4055 def SetLoggingOff(*args, **kwargs):
a95a7133 4056 """SetLoggingOff(self, bool logOff)"""
54f9ee45 4057 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
4058
4059 def GetLoggingOff(*args, **kwargs):
a95a7133 4060 """GetLoggingOff(self) -> bool"""
54f9ee45 4061 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
4062
4063 def Veto(*args, **kwargs):
a95a7133 4064 """Veto(self, bool veto=True)"""
54f9ee45 4065 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce
RD
4066
4067 def SetCanVeto(*args, **kwargs):
a95a7133 4068 """SetCanVeto(self, bool canVeto)"""
54f9ee45 4069 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
4070
4071 def CanVeto(*args, **kwargs):
a95a7133 4072 """CanVeto(self) -> bool"""
54f9ee45 4073 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce
RD
4074
4075 def GetVeto(*args, **kwargs):
a95a7133 4076 """GetVeto(self) -> bool"""
54f9ee45 4077 return _core_.CloseEvent_GetVeto(*args, **kwargs)
e811c8ce 4078
d14a1e28
RD
4079
4080class CloseEventPtr(CloseEvent):
4081 def __init__(self, this):
4082 self.this = this
4083 if not hasattr(self,"thisown"): self.thisown = 0
4084 self.__class__ = CloseEvent
54f9ee45 4085_core_.CloseEvent_swigregister(CloseEventPtr)
d14a1e28
RD
4086
4087#---------------------------------------------------------------------------
4088
4089class ShowEvent(Event):
e811c8ce
RD
4090 def __repr__(self):
4091 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4092 def __init__(self, *args, **kwargs):
a95a7133 4093 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
54f9ee45 4094 newobj = _core_.new_ShowEvent(*args, **kwargs)
d14a1e28
RD
4095 self.this = newobj.this
4096 self.thisown = 1
4097 del newobj.thisown
e811c8ce 4098 def SetShow(*args, **kwargs):
a95a7133 4099 """SetShow(self, bool show)"""
54f9ee45 4100 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
4101
4102 def GetShow(*args, **kwargs):
a95a7133 4103 """GetShow(self) -> bool"""
54f9ee45 4104 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 4105
d14a1e28
RD
4106
4107class ShowEventPtr(ShowEvent):
4108 def __init__(self, this):
4109 self.this = this
4110 if not hasattr(self,"thisown"): self.thisown = 0
4111 self.__class__ = ShowEvent
54f9ee45 4112_core_.ShowEvent_swigregister(ShowEventPtr)
d14a1e28
RD
4113
4114#---------------------------------------------------------------------------
4115
4116class IconizeEvent(Event):
e811c8ce
RD
4117 def __repr__(self):
4118 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4119 def __init__(self, *args, **kwargs):
a95a7133 4120 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
54f9ee45 4121 newobj = _core_.new_IconizeEvent(*args, **kwargs)
d14a1e28
RD
4122 self.this = newobj.this
4123 self.thisown = 1
4124 del newobj.thisown
e811c8ce 4125 def Iconized(*args, **kwargs):
a95a7133 4126 """Iconized(self) -> bool"""
54f9ee45 4127 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 4128
d14a1e28
RD
4129
4130class IconizeEventPtr(IconizeEvent):
4131 def __init__(self, this):
4132 self.this = this
4133 if not hasattr(self,"thisown"): self.thisown = 0
4134 self.__class__ = IconizeEvent
54f9ee45 4135_core_.IconizeEvent_swigregister(IconizeEventPtr)
d14a1e28
RD
4136
4137#---------------------------------------------------------------------------
4138
4139class MaximizeEvent(Event):
e811c8ce
RD
4140 def __repr__(self):
4141 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4142 def __init__(self, *args, **kwargs):
a95a7133 4143 """__init__(self, int id=0) -> MaximizeEvent"""
54f9ee45 4144 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
d14a1e28
RD
4145 self.this = newobj.this
4146 self.thisown = 1
4147 del newobj.thisown
d14a1e28
RD
4148
4149class MaximizeEventPtr(MaximizeEvent):
4150 def __init__(self, this):
4151 self.this = this
4152 if not hasattr(self,"thisown"): self.thisown = 0
4153 self.__class__ = MaximizeEvent
54f9ee45 4154_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
d14a1e28
RD
4155
4156#---------------------------------------------------------------------------
4157
4158class DropFilesEvent(Event):
d14a1e28
RD
4159 def __init__(self): raise RuntimeError, "No constructor defined"
4160 def __repr__(self):
4161 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 4162 def GetPosition(*args, **kwargs):
a95a7133 4163 """GetPosition(self) -> Point"""
54f9ee45 4164 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4165
4166 def GetNumberOfFiles(*args, **kwargs):
a95a7133 4167 """GetNumberOfFiles(self) -> int"""
54f9ee45 4168 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
4169
4170 def GetFiles(*args, **kwargs):
a95a7133 4171 """GetFiles(self) -> PyObject"""
54f9ee45 4172 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 4173
d14a1e28
RD
4174
4175class DropFilesEventPtr(DropFilesEvent):
4176 def __init__(self, this):
4177 self.this = this
4178 if not hasattr(self,"thisown"): self.thisown = 0
4179 self.__class__ = DropFilesEvent
54f9ee45 4180_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
d14a1e28
RD
4181
4182#---------------------------------------------------------------------------
4183
54f9ee45
RD
4184UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4185UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 4186class UpdateUIEvent(CommandEvent):
e811c8ce
RD
4187 def __repr__(self):
4188 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4189 def __init__(self, *args, **kwargs):
a95a7133 4190 """__init__(self, int commandId=0) -> UpdateUIEvent"""
54f9ee45 4191 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
d14a1e28
RD
4192 self.this = newobj.this
4193 self.thisown = 1
4194 del newobj.thisown
e811c8ce 4195 def GetChecked(*args, **kwargs):
a95a7133 4196 """GetChecked(self) -> bool"""
54f9ee45 4197 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
4198
4199 def GetEnabled(*args, **kwargs):
a95a7133 4200 """GetEnabled(self) -> bool"""
54f9ee45 4201 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce
RD
4202
4203 def GetText(*args, **kwargs):
a95a7133 4204 """GetText(self) -> String"""
54f9ee45 4205 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
4206
4207 def GetSetText(*args, **kwargs):
a95a7133 4208 """GetSetText(self) -> bool"""
54f9ee45 4209 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
4210
4211 def GetSetChecked(*args, **kwargs):
a95a7133 4212 """GetSetChecked(self) -> bool"""
54f9ee45 4213 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
4214
4215 def GetSetEnabled(*args, **kwargs):
a95a7133 4216 """GetSetEnabled(self) -> bool"""
54f9ee45 4217 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce
RD
4218
4219 def Check(*args, **kwargs):
a95a7133 4220 """Check(self, bool check)"""
54f9ee45 4221 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
4222
4223 def Enable(*args, **kwargs):
a95a7133 4224 """Enable(self, bool enable)"""
54f9ee45 4225 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce
RD
4226
4227 def SetText(*args, **kwargs):
a95a7133 4228 """SetText(self, String text)"""
54f9ee45 4229 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
4230
4231 def SetUpdateInterval(*args, **kwargs):
66c033b4 4232 """SetUpdateInterval(long updateInterval)"""
54f9ee45 4233 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
4234
4235 SetUpdateInterval = staticmethod(SetUpdateInterval)
4236 def GetUpdateInterval(*args, **kwargs):
66c033b4 4237 """GetUpdateInterval() -> long"""
54f9ee45 4238 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
4239
4240 GetUpdateInterval = staticmethod(GetUpdateInterval)
4241 def CanUpdate(*args, **kwargs):
66c033b4 4242 """CanUpdate(Window win) -> bool"""
54f9ee45 4243 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
4244
4245 CanUpdate = staticmethod(CanUpdate)
4246 def ResetUpdateTime(*args, **kwargs):
66c033b4 4247 """ResetUpdateTime()"""
54f9ee45 4248 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
4249
4250 ResetUpdateTime = staticmethod(ResetUpdateTime)
4251 def SetMode(*args, **kwargs):
66c033b4 4252 """SetMode(int mode)"""
54f9ee45 4253 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
4254
4255 SetMode = staticmethod(SetMode)
4256 def GetMode(*args, **kwargs):
66c033b4 4257 """GetMode() -> int"""
54f9ee45 4258 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
4259
4260 GetMode = staticmethod(GetMode)
d14a1e28
RD
4261
4262class UpdateUIEventPtr(UpdateUIEvent):
4263 def __init__(self, this):
4264 self.this = this
4265 if not hasattr(self,"thisown"): self.thisown = 0
4266 self.__class__ = UpdateUIEvent
54f9ee45 4267_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
d14a1e28 4268
e811c8ce
RD
4269def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4270 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
54f9ee45 4271 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 4272
e811c8ce
RD
4273def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4274 """UpdateUIEvent_GetUpdateInterval() -> long"""
54f9ee45 4275 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d14a1e28 4276
e811c8ce
RD
4277def UpdateUIEvent_CanUpdate(*args, **kwargs):
4278 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
54f9ee45 4279 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 4280
e811c8ce
RD
4281def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4282 """UpdateUIEvent_ResetUpdateTime()"""
54f9ee45 4283 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d14a1e28 4284
e811c8ce 4285def UpdateUIEvent_SetMode(*args, **kwargs):
196addbf 4286 """UpdateUIEvent_SetMode(int mode)"""
54f9ee45 4287 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 4288
e811c8ce 4289def UpdateUIEvent_GetMode(*args, **kwargs):
196addbf 4290 """UpdateUIEvent_GetMode() -> int"""
54f9ee45 4291 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d14a1e28
RD
4292
4293#---------------------------------------------------------------------------
4294
4295class SysColourChangedEvent(Event):
e811c8ce
RD
4296 def __repr__(self):
4297 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4298 def __init__(self, *args, **kwargs):
a95a7133 4299 """__init__(self) -> SysColourChangedEvent"""
54f9ee45 4300 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
d14a1e28
RD
4301 self.this = newobj.this
4302 self.thisown = 1
4303 del newobj.thisown
d14a1e28
RD
4304
4305class SysColourChangedEventPtr(SysColourChangedEvent):
4306 def __init__(self, this):
4307 self.this = this
4308 if not hasattr(self,"thisown"): self.thisown = 0
4309 self.__class__ = SysColourChangedEvent
54f9ee45 4310_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
d14a1e28
RD
4311
4312#---------------------------------------------------------------------------
4313
4314class MouseCaptureChangedEvent(Event):
e811c8ce
RD
4315 def __repr__(self):
4316 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4317 def __init__(self, *args, **kwargs):
a95a7133 4318 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
54f9ee45 4319 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
d14a1e28
RD
4320 self.this = newobj.this
4321 self.thisown = 1
4322 del newobj.thisown
e811c8ce 4323 def GetCapturedWindow(*args, **kwargs):
a95a7133 4324 """GetCapturedWindow(self) -> Window"""
54f9ee45 4325 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 4326
d14a1e28
RD
4327
4328class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
4329 def __init__(self, this):
4330 self.this = this
4331 if not hasattr(self,"thisown"): self.thisown = 0
4332 self.__class__ = MouseCaptureChangedEvent
54f9ee45 4333_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
d14a1e28
RD
4334
4335#---------------------------------------------------------------------------
4336
4337class DisplayChangedEvent(Event):
e811c8ce
RD
4338 def __repr__(self):
4339 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4340 def __init__(self, *args, **kwargs):
a95a7133 4341 """__init__(self) -> DisplayChangedEvent"""
54f9ee45 4342 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
d14a1e28
RD
4343 self.this = newobj.this
4344 self.thisown = 1
4345 del newobj.thisown
d14a1e28
RD
4346
4347class DisplayChangedEventPtr(DisplayChangedEvent):
4348 def __init__(self, this):
4349 self.this = this
4350 if not hasattr(self,"thisown"): self.thisown = 0
4351 self.__class__ = DisplayChangedEvent
54f9ee45 4352_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
d14a1e28
RD
4353
4354#---------------------------------------------------------------------------
4355
4356class PaletteChangedEvent(Event):
e811c8ce
RD
4357 def __repr__(self):
4358 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4359 def __init__(self, *args, **kwargs):
a95a7133 4360 """__init__(self, int id=0) -> PaletteChangedEvent"""
54f9ee45 4361 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
d14a1e28
RD
4362 self.this = newobj.this
4363 self.thisown = 1
4364 del newobj.thisown
e811c8ce 4365 def SetChangedWindow(*args, **kwargs):
a95a7133 4366 """SetChangedWindow(self, Window win)"""
54f9ee45 4367 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
4368
4369 def GetChangedWindow(*args, **kwargs):
a95a7133 4370 """GetChangedWindow(self) -> Window"""
54f9ee45 4371 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 4372
d14a1e28
RD
4373
4374class PaletteChangedEventPtr(PaletteChangedEvent):
4375 def __init__(self, this):
4376 self.this = this
4377 if not hasattr(self,"thisown"): self.thisown = 0
4378 self.__class__ = PaletteChangedEvent
54f9ee45 4379_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
d14a1e28
RD
4380
4381#---------------------------------------------------------------------------
4382
4383class QueryNewPaletteEvent(Event):
e811c8ce
RD
4384 def __repr__(self):
4385 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4386 def __init__(self, *args, **kwargs):
a95a7133 4387 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
54f9ee45 4388 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
d14a1e28
RD
4389 self.this = newobj.this
4390 self.thisown = 1
4391 del newobj.thisown
e811c8ce 4392 def SetPaletteRealized(*args, **kwargs):
a95a7133 4393 """SetPaletteRealized(self, bool realized)"""
54f9ee45 4394 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
4395
4396 def GetPaletteRealized(*args, **kwargs):
a95a7133 4397 """GetPaletteRealized(self) -> bool"""
54f9ee45 4398 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 4399
d14a1e28
RD
4400
4401class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
4402 def __init__(self, this):
4403 self.this = this
4404 if not hasattr(self,"thisown"): self.thisown = 0
4405 self.__class__ = QueryNewPaletteEvent
54f9ee45 4406_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
d14a1e28
RD
4407
4408#---------------------------------------------------------------------------
4409
4410class NavigationKeyEvent(Event):
e811c8ce
RD
4411 def __repr__(self):
4412 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4413 def __init__(self, *args, **kwargs):
a95a7133 4414 """__init__(self) -> NavigationKeyEvent"""
54f9ee45 4415 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
d14a1e28
RD
4416 self.this = newobj.this
4417 self.thisown = 1
4418 del newobj.thisown
e811c8ce 4419 def GetDirection(*args, **kwargs):
a95a7133 4420 """GetDirection(self) -> bool"""
54f9ee45 4421 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
4422
4423 def SetDirection(*args, **kwargs):
908b74cd 4424 """SetDirection(self, bool forward)"""
54f9ee45 4425 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
4426
4427 def IsWindowChange(*args, **kwargs):
a95a7133 4428 """IsWindowChange(self) -> bool"""
54f9ee45 4429 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
4430
4431 def SetWindowChange(*args, **kwargs):
908b74cd 4432 """SetWindowChange(self, bool ischange)"""
54f9ee45 4433 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 4434
908b74cd
RD
4435 def SetFlags(*args, **kwargs):
4436 """SetFlags(self, long flags)"""
4437 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
4438
e811c8ce 4439 def GetCurrentFocus(*args, **kwargs):
a95a7133 4440 """GetCurrentFocus(self) -> Window"""
54f9ee45 4441 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
4442
4443 def SetCurrentFocus(*args, **kwargs):
a95a7133 4444 """SetCurrentFocus(self, Window win)"""
54f9ee45 4445 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 4446
b0f7404b 4447 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
4448 IsForward = _core_.NavigationKeyEvent_IsForward
4449 WinChange = _core_.NavigationKeyEvent_WinChange
d14a1e28
RD
4450
4451class NavigationKeyEventPtr(NavigationKeyEvent):
4452 def __init__(self, this):
4453 self.this = this
4454 if not hasattr(self,"thisown"): self.thisown = 0
4455 self.__class__ = NavigationKeyEvent
54f9ee45 4456_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
d14a1e28
RD
4457
4458#---------------------------------------------------------------------------
4459
4460class WindowCreateEvent(CommandEvent):
e811c8ce
RD
4461 def __repr__(self):
4462 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4463 def __init__(self, *args, **kwargs):
a95a7133 4464 """__init__(self, Window win=None) -> WindowCreateEvent"""
54f9ee45 4465 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
d14a1e28
RD
4466 self.this = newobj.this
4467 self.thisown = 1
4468 del newobj.thisown
e811c8ce 4469 def GetWindow(*args, **kwargs):
a95a7133 4470 """GetWindow(self) -> Window"""
54f9ee45 4471 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 4472
d14a1e28
RD
4473
4474class WindowCreateEventPtr(WindowCreateEvent):
4475 def __init__(self, this):
4476 self.this = this
4477 if not hasattr(self,"thisown"): self.thisown = 0
4478 self.__class__ = WindowCreateEvent
54f9ee45 4479_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
d14a1e28
RD
4480
4481class WindowDestroyEvent(CommandEvent):
e811c8ce
RD
4482 def __repr__(self):
4483 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4484 def __init__(self, *args, **kwargs):
a95a7133 4485 """__init__(self, Window win=None) -> WindowDestroyEvent"""
54f9ee45 4486 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
d14a1e28
RD
4487 self.this = newobj.this
4488 self.thisown = 1
4489 del newobj.thisown
e811c8ce 4490 def GetWindow(*args, **kwargs):
a95a7133 4491 """GetWindow(self) -> Window"""
54f9ee45 4492 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 4493
d14a1e28
RD
4494
4495class WindowDestroyEventPtr(WindowDestroyEvent):
4496 def __init__(self, this):
4497 self.this = this
4498 if not hasattr(self,"thisown"): self.thisown = 0
4499 self.__class__ = WindowDestroyEvent
54f9ee45 4500_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
d14a1e28
RD
4501
4502#---------------------------------------------------------------------------
4503
4504class ContextMenuEvent(CommandEvent):
e811c8ce
RD
4505 def __repr__(self):
4506 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4507 def __init__(self, *args, **kwargs):
a95a7133 4508 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
54f9ee45 4509 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
d14a1e28
RD
4510 self.this = newobj.this
4511 self.thisown = 1
4512 del newobj.thisown
e811c8ce 4513 def GetPosition(*args, **kwargs):
a95a7133 4514 """GetPosition(self) -> Point"""
54f9ee45 4515 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4516
4517 def SetPosition(*args, **kwargs):
a95a7133 4518 """SetPosition(self, Point pos)"""
54f9ee45 4519 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 4520
d14a1e28
RD
4521
4522class ContextMenuEventPtr(ContextMenuEvent):
4523 def __init__(self, this):
4524 self.this = this
4525 if not hasattr(self,"thisown"): self.thisown = 0
4526 self.__class__ = ContextMenuEvent
54f9ee45 4527_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
d14a1e28
RD
4528
4529#---------------------------------------------------------------------------
4530
54f9ee45
RD
4531IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4532IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 4533class IdleEvent(Event):
e811c8ce
RD
4534 def __repr__(self):
4535 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4536 def __init__(self, *args, **kwargs):
a95a7133 4537 """__init__(self) -> IdleEvent"""
54f9ee45 4538 newobj = _core_.new_IdleEvent(*args, **kwargs)
d14a1e28
RD
4539 self.this = newobj.this
4540 self.thisown = 1
4541 del newobj.thisown
e811c8ce 4542 def RequestMore(*args, **kwargs):
a95a7133 4543 """RequestMore(self, bool needMore=True)"""
54f9ee45 4544 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
4545
4546 def MoreRequested(*args, **kwargs):
a95a7133 4547 """MoreRequested(self) -> bool"""
54f9ee45 4548 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
4549
4550 def SetMode(*args, **kwargs):
66c033b4 4551 """SetMode(int mode)"""
54f9ee45 4552 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
4553
4554 SetMode = staticmethod(SetMode)
4555 def GetMode(*args, **kwargs):
66c033b4 4556 """GetMode() -> int"""
54f9ee45 4557 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
4558
4559 GetMode = staticmethod(GetMode)
4560 def CanSend(*args, **kwargs):
66c033b4 4561 """CanSend(Window win) -> bool"""
54f9ee45 4562 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
4563
4564 CanSend = staticmethod(CanSend)
d14a1e28
RD
4565
4566class IdleEventPtr(IdleEvent):
4567 def __init__(self, this):
4568 self.this = this
4569 if not hasattr(self,"thisown"): self.thisown = 0
4570 self.__class__ = IdleEvent
54f9ee45 4571_core_.IdleEvent_swigregister(IdleEventPtr)
d14a1e28 4572
e811c8ce 4573def IdleEvent_SetMode(*args, **kwargs):
196addbf 4574 """IdleEvent_SetMode(int mode)"""
54f9ee45 4575 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 4576
e811c8ce 4577def IdleEvent_GetMode(*args, **kwargs):
196addbf 4578 """IdleEvent_GetMode() -> int"""
54f9ee45 4579 return _core_.IdleEvent_GetMode(*args, **kwargs)
d14a1e28 4580
e811c8ce
RD
4581def IdleEvent_CanSend(*args, **kwargs):
4582 """IdleEvent_CanSend(Window win) -> bool"""
54f9ee45 4583 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
4584
4585#---------------------------------------------------------------------------
4586
4587class PyEvent(Event):
e811c8ce
RD
4588 def __repr__(self):
4589 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4590 def __init__(self, *args, **kwargs):
a95a7133 4591 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
54f9ee45 4592 newobj = _core_.new_PyEvent(*args, **kwargs)
d14a1e28
RD
4593 self.this = newobj.this
4594 self.thisown = 1
4595 del newobj.thisown
4596 self.SetSelf(self)
e811c8ce 4597
54f9ee45 4598 def __del__(self, destroy=_core_.delete_PyEvent):
a95a7133 4599 """__del__(self)"""
d14a1e28
RD
4600 try:
4601 if self.thisown: destroy(self)
4602 except: pass
e811c8ce
RD
4603
4604 def SetSelf(*args, **kwargs):
a95a7133 4605 """SetSelf(self, PyObject self)"""
54f9ee45 4606 return _core_.PyEvent_SetSelf(*args, **kwargs)
e811c8ce
RD
4607
4608 def GetSelf(*args, **kwargs):
a95a7133 4609 """GetSelf(self) -> PyObject"""
54f9ee45 4610 return _core_.PyEvent_GetSelf(*args, **kwargs)
e811c8ce 4611
d14a1e28
RD
4612
4613class PyEventPtr(PyEvent):
4614 def __init__(self, this):
4615 self.this = this
4616 if not hasattr(self,"thisown"): self.thisown = 0
4617 self.__class__ = PyEvent
54f9ee45 4618_core_.PyEvent_swigregister(PyEventPtr)
d14a1e28
RD
4619
4620class PyCommandEvent(CommandEvent):
e811c8ce
RD
4621 def __repr__(self):
4622 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4623 def __init__(self, *args, **kwargs):
a95a7133 4624 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
54f9ee45 4625 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
d14a1e28
RD
4626 self.this = newobj.this
4627 self.thisown = 1
4628 del newobj.thisown
4629 self.SetSelf(self)
e811c8ce 4630
54f9ee45 4631 def __del__(self, destroy=_core_.delete_PyCommandEvent):
a95a7133 4632 """__del__(self)"""
d14a1e28
RD
4633 try:
4634 if self.thisown: destroy(self)
4635 except: pass
e811c8ce
RD
4636
4637 def SetSelf(*args, **kwargs):
a95a7133 4638 """SetSelf(self, PyObject self)"""
54f9ee45 4639 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
e811c8ce
RD
4640
4641 def GetSelf(*args, **kwargs):
a95a7133 4642 """GetSelf(self) -> PyObject"""
54f9ee45 4643 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
e811c8ce 4644
d14a1e28
RD
4645
4646class PyCommandEventPtr(PyCommandEvent):
4647 def __init__(self, this):
4648 self.this = this
4649 if not hasattr(self,"thisown"): self.thisown = 0
4650 self.__class__ = PyCommandEvent
54f9ee45 4651_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
d14a1e28
RD
4652
4653#---------------------------------------------------------------------------
4654
54f9ee45
RD
4655PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4656PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4657PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4658PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4659PRINT_WINDOWS = _core_.PRINT_WINDOWS
4660PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 4661class PyApp(EvtHandler):
66c033b4
RD
4662 """
4663 The ``wx.PyApp`` class is an *implementation detail*, please use the
4664 `wx.App` class (or some other derived class) instead.
4665 """
e811c8ce
RD
4666 def __repr__(self):
4667 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4668 def __init__(self, *args, **kwargs):
98e665d3 4669 """
a95a7133 4670 __init__(self) -> PyApp
98e665d3
RD
4671
4672 Create a new application object, starting the bootstrap process.
4673 """
54f9ee45 4674 newobj = _core_.new_PyApp(*args, **kwargs)
d14a1e28
RD
4675 self.this = newobj.this
4676 self.thisown = 1
4677 del newobj.thisown
4678 self._setCallbackInfo(self, PyApp)
4679 self._setOORInfo(self)
e811c8ce 4680
54f9ee45 4681 def __del__(self, destroy=_core_.delete_PyApp):
a95a7133 4682 """__del__(self)"""
d14a1e28
RD
4683 try:
4684 if self.thisown: destroy(self)
4685 except: pass
e811c8ce
RD
4686
4687 def _setCallbackInfo(*args, **kwargs):
a95a7133 4688 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 4689 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
4690
4691 def GetAppName(*args, **kwargs):
0df68c9f 4692 """
a95a7133 4693 GetAppName(self) -> String
6c3b4aae 4694
0df68c9f
RD
4695 Get the application name.
4696 """
54f9ee45 4697 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
4698
4699 def SetAppName(*args, **kwargs):
0df68c9f 4700 """
a95a7133 4701 SetAppName(self, String name)
6c3b4aae 4702
66c033b4
RD
4703 Set the application name. This value may be used automatically by
4704 `wx.Config` and such.
0df68c9f 4705 """
54f9ee45 4706 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
4707
4708 def GetClassName(*args, **kwargs):
0df68c9f 4709 """
a95a7133 4710 GetClassName(self) -> String
e811c8ce 4711
0df68c9f
RD
4712 Get the application's class name.
4713 """
54f9ee45 4714 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
4715
4716 def SetClassName(*args, **kwargs):
0df68c9f 4717 """
a95a7133 4718 SetClassName(self, String name)
6c3b4aae 4719
66c033b4
RD
4720 Set the application's class name. This value may be used for
4721 X-resources if applicable for the platform
0df68c9f 4722 """
54f9ee45 4723 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
4724
4725 def GetVendorName(*args, **kwargs):
0df68c9f 4726 """
a95a7133 4727 GetVendorName(self) -> String
6c3b4aae 4728
0df68c9f
RD
4729 Get the application's vendor name.
4730 """
54f9ee45 4731 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
4732
4733 def SetVendorName(*args, **kwargs):
0df68c9f 4734 """
a95a7133 4735 SetVendorName(self, String name)
6c3b4aae 4736
66c033b4
RD
4737 Set the application's vendor name. This value may be used
4738 automatically by `wx.Config` and such.
0df68c9f 4739 """
54f9ee45 4740 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
4741
4742 def GetTraits(*args, **kwargs):
0df68c9f 4743 """
a95a7133 4744 GetTraits(self) -> wxAppTraits
6c3b4aae 4745
66c033b4
RD
4746 Return (and create if necessary) the app traits object to which we
4747 delegate for everything which either should be configurable by the
4748 user (then he can change the default behaviour simply by overriding
4749 CreateTraits() and returning his own traits object) or which is
4750 GUI/console dependent as then wx.AppTraits allows us to abstract the
4751 differences behind the common facade.
4752
4753 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 4754 """
54f9ee45 4755 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
4756
4757 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 4758 """
a95a7133 4759 ProcessPendingEvents(self)
6c3b4aae 4760
66c033b4
RD
4761 Process all events in the Pending Events list -- it is necessary to
4762 call this function to process posted events. This normally happens
4763 during each event loop iteration.
0df68c9f 4764 """
54f9ee45 4765 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
4766
4767 def Yield(*args, **kwargs):
0df68c9f 4768 """
a95a7133 4769 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 4770
66c033b4
RD
4771 Process all currently pending events right now, instead of waiting
4772 until return to the event loop. It is an error to call ``Yield``
4773 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 4774
66c033b4 4775 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
4776 reentrancies (i.e. when called from an event handler it may
4777 result in calling the same event handler again), use with
4778 extreme care or, better, don't use at all!
0df68c9f 4779
66c033b4 4780 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 4781
0df68c9f 4782 """
54f9ee45 4783 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
4784
4785 def WakeUpIdle(*args, **kwargs):
0df68c9f 4786 """
a95a7133 4787 WakeUpIdle(self)
6c3b4aae 4788
66c033b4
RD
4789 Make sure that idle events are sent again.
4790 :see: `wx.WakeUpIdle`
0df68c9f 4791 """
54f9ee45 4792 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 4793
1fc3b23a
RD
4794 def IsMainLoopRunning(*args, **kwargs):
4795 """
4796 IsMainLoopRunning() -> bool
4797
4798 Returns True if we're running the main loop, i.e. if the events can
4799 currently be dispatched.
4800 """
4801 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
4802
4803 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 4804 def MainLoop(*args, **kwargs):
0df68c9f 4805 """
a95a7133 4806 MainLoop(self) -> int
6c3b4aae 4807
66c033b4
RD
4808 Execute the main GUI loop, the function doesn't normally return until
4809 all top level windows have been closed and destroyed.
0df68c9f 4810 """
54f9ee45 4811 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
4812
4813 def Exit(*args, **kwargs):
0df68c9f 4814 """
a95a7133 4815 Exit(self)
6c3b4aae 4816
0df68c9f 4817 Exit the main loop thus terminating the application.
66c033b4 4818 :see: `wx.Exit`
0df68c9f 4819 """
54f9ee45 4820 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce
RD
4821
4822 def ExitMainLoop(*args, **kwargs):
0df68c9f 4823 """
a95a7133 4824 ExitMainLoop(self)
6c3b4aae 4825
66c033b4
RD
4826 Exit the main GUI loop during the next iteration of the main
4827 loop, (i.e. it does not stop the program immediately!)
0df68c9f 4828 """
54f9ee45 4829 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
4830
4831 def Pending(*args, **kwargs):
0df68c9f 4832 """
a95a7133 4833 Pending(self) -> bool
6c3b4aae 4834
0df68c9f
RD
4835 Returns True if there are unprocessed events in the event queue.
4836 """
54f9ee45 4837 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
4838
4839 def Dispatch(*args, **kwargs):
0df68c9f 4840 """
a95a7133 4841 Dispatch(self) -> bool
6c3b4aae 4842
0df68c9f
RD
4843 Process the first event in the event queue (blocks until an event
4844 appears if there are none currently)
4845 """
54f9ee45 4846 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
4847
4848 def ProcessIdle(*args, **kwargs):
0df68c9f 4849 """
a95a7133 4850 ProcessIdle(self) -> bool
6c3b4aae 4851
66c033b4
RD
4852 Called from the MainLoop when the application becomes idle (there are
4853 no pending events) and sends a `wx.IdleEvent` to all interested
4854 parties. Returns True if more idle events are needed, False if not.
0df68c9f 4855 """
54f9ee45 4856 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
4857
4858 def SendIdleEvents(*args, **kwargs):
0df68c9f 4859 """
a95a7133 4860 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 4861
66c033b4
RD
4862 Send idle event to window and all subwindows. Returns True if more
4863 idle time is requested.
0df68c9f 4864 """
54f9ee45 4865 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
4866
4867 def IsActive(*args, **kwargs):
0df68c9f 4868 """
a95a7133 4869 IsActive(self) -> bool
6c3b4aae 4870
0df68c9f
RD
4871 Return True if our app has focus.
4872 """
54f9ee45 4873 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
4874
4875 def SetTopWindow(*args, **kwargs):
0df68c9f 4876 """
a95a7133 4877 SetTopWindow(self, Window win)
6c3b4aae 4878
66c033b4 4879 Set the *main* top level window
0df68c9f 4880 """
54f9ee45 4881 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
4882
4883 def GetTopWindow(*args, **kwargs):
0df68c9f 4884 """
a95a7133 4885 GetTopWindow(self) -> Window
6c3b4aae 4886
66c033b4
RD
4887 Return the *main* top level window (if it hadn't been set previously
4888 with SetTopWindow(), will return just some top level window and, if
4889 there not any, will return None)
0df68c9f 4890 """
54f9ee45 4891 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
4892
4893 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 4894 """
a95a7133 4895 SetExitOnFrameDelete(self, bool flag)
0df68c9f 4896
66c033b4
RD
4897 Control the exit behaviour: by default, the program will exit the main
4898 loop (and so, usually, terminate) when the last top-level program
4899 window is deleted. Beware that if you disable this behaviour (with
4900 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
4901 explicitly from somewhere.
0df68c9f 4902 """
54f9ee45 4903 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
4904
4905 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 4906 """
a95a7133 4907 GetExitOnFrameDelete(self) -> bool
6c3b4aae 4908
0df68c9f
RD
4909 Get the current exit behaviour setting.
4910 """
54f9ee45 4911 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
4912
4913 def SetUseBestVisual(*args, **kwargs):
0df68c9f 4914 """
a95a7133 4915 SetUseBestVisual(self, bool flag)
6c3b4aae 4916
66c033b4
RD
4917 Set whether the app should try to use the best available visual on
4918 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 4919 """
54f9ee45 4920 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
4921
4922 def GetUseBestVisual(*args, **kwargs):
0df68c9f 4923 """
a95a7133 4924 GetUseBestVisual(self) -> bool
6c3b4aae 4925
0df68c9f
RD
4926 Get current UseBestVisual setting.
4927 """
54f9ee45 4928 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
4929
4930 def SetPrintMode(*args, **kwargs):
a95a7133 4931 """SetPrintMode(self, int mode)"""
54f9ee45 4932 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
4933
4934 def GetPrintMode(*args, **kwargs):
a95a7133 4935 """GetPrintMode(self) -> int"""
54f9ee45 4936 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 4937
e811c8ce 4938 def SetAssertMode(*args, **kwargs):
0df68c9f 4939 """
a95a7133 4940 SetAssertMode(self, int mode)
6c3b4aae 4941
41e2b43e 4942 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 4943 """
54f9ee45 4944 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 4945
6c3b4aae 4946 def GetAssertMode(*args, **kwargs):
0df68c9f 4947 """
a95a7133 4948 GetAssertMode(self) -> int
6c3b4aae 4949
0df68c9f
RD
4950 Get the current OnAssert behaviour setting.
4951 """
54f9ee45 4952 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 4953
e811c8ce 4954 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 4955 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 4956 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
4957
4958 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
4959 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 4960 """GetMacAboutMenuItemId() -> long"""
54f9ee45 4961 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
4962
4963 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
4964 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 4965 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 4966 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
4967
4968 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
4969 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 4970 """GetMacExitMenuItemId() -> long"""
54f9ee45 4971 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
4972
4973 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
4974 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 4975 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 4976 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
4977
4978 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
4979 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 4980 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 4981 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
4982
4983 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
4984 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 4985 """SetMacAboutMenuItemId(long val)"""
54f9ee45 4986 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
4987
4988 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
4989 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 4990 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 4991 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
4992
4993 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
4994 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 4995 """SetMacExitMenuItemId(long val)"""
54f9ee45 4996 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
4997
4998 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
4999 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 5000 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 5001 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
5002
5003 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
5004 def _BootstrapApp(*args, **kwargs):
0df68c9f 5005 """
a95a7133 5006 _BootstrapApp(self)
6c3b4aae 5007
0df68c9f
RD
5008 For internal use only
5009 """
54f9ee45 5010 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
5011
5012 def GetComCtl32Version(*args, **kwargs):
0df68c9f 5013 """
66c033b4 5014 GetComCtl32Version() -> int
6c3b4aae 5015
66c033b4
RD
5016 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5017 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 5018 """
54f9ee45 5019 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
5020
5021 GetComCtl32Version = staticmethod(GetComCtl32Version)
d14a1e28
RD
5022
5023class PyAppPtr(PyApp):
5024 def __init__(self, this):
5025 self.this = this
5026 if not hasattr(self,"thisown"): self.thisown = 0
5027 self.__class__ = PyApp
54f9ee45 5028_core_.PyApp_swigregister(PyAppPtr)
d14a1e28 5029
1fc3b23a
RD
5030def PyApp_IsMainLoopRunning(*args, **kwargs):
5031 """
5032 PyApp_IsMainLoopRunning() -> bool
5033
5034 Returns True if we're running the main loop, i.e. if the events can
5035 currently be dispatched.
5036 """
5037 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5038
e811c8ce
RD
5039def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
5040 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 5041 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 5042
e811c8ce
RD
5043def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
5044 """PyApp_GetMacAboutMenuItemId() -> long"""
54f9ee45 5045 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 5046
e811c8ce
RD
5047def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
5048 """PyApp_GetMacPreferencesMenuItemId() -> long"""
54f9ee45 5049 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 5050
e811c8ce
RD
5051def PyApp_GetMacExitMenuItemId(*args, **kwargs):
5052 """PyApp_GetMacExitMenuItemId() -> long"""
54f9ee45 5053 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d14a1e28 5054
e811c8ce 5055def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
196addbf 5056 """PyApp_GetMacHelpMenuTitleName() -> String"""
54f9ee45 5057 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 5058
e811c8ce
RD
5059def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
5060 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 5061 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 5062
e811c8ce
RD
5063def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
5064 """PyApp_SetMacAboutMenuItemId(long val)"""
54f9ee45 5065 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 5066
e811c8ce
RD
5067def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
5068 """PyApp_SetMacPreferencesMenuItemId(long val)"""
54f9ee45 5069 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 5070
e811c8ce
RD
5071def PyApp_SetMacExitMenuItemId(*args, **kwargs):
5072 """PyApp_SetMacExitMenuItemId(long val)"""
54f9ee45 5073 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 5074
e811c8ce 5075def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
196addbf 5076 """PyApp_SetMacHelpMenuTitleName(String val)"""
54f9ee45 5077 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 5078
e811c8ce 5079def PyApp_GetComCtl32Version(*args, **kwargs):
0df68c9f
RD
5080 """
5081 PyApp_GetComCtl32Version() -> int
6c3b4aae 5082
66c033b4
RD
5083 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5084 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 5085 """
54f9ee45 5086 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d14a1e28
RD
5087
5088#---------------------------------------------------------------------------
5089
5090
e811c8ce 5091def Exit(*args, **kwargs):
0df68c9f
RD
5092 """
5093 Exit()
6c3b4aae 5094
0df68c9f
RD
5095 Force an exit of the application. Convenience for wx.GetApp().Exit()
5096 """
54f9ee45 5097 return _core_.Exit(*args, **kwargs)
d14a1e28 5098
e811c8ce 5099def Yield(*args, **kwargs):
0df68c9f
RD
5100 """
5101 Yield() -> bool
6c3b4aae 5102
0df68c9f
RD
5103 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
5104 """
54f9ee45 5105 return _core_.Yield(*args, **kwargs)
d14a1e28 5106
e811c8ce 5107def YieldIfNeeded(*args, **kwargs):
0df68c9f
RD
5108 """
5109 YieldIfNeeded() -> bool
6c3b4aae 5110
0df68c9f
RD
5111 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
5112 """
54f9ee45 5113 return _core_.YieldIfNeeded(*args, **kwargs)
d14a1e28 5114
e811c8ce 5115def SafeYield(*args, **kwargs):
0df68c9f
RD
5116 """
5117 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 5118
66c033b4
RD
5119 This function is similar to `wx.Yield`, except that it disables the
5120 user input to all program windows before calling `wx.Yield` and
5121 re-enables it again afterwards. If ``win`` is not None, this window
5122 will remain enabled, allowing the implementation of some limited user
5123 interaction.
6c3b4aae 5124
66c033b4 5125 :Returns: the result of the call to `wx.Yield`.
0df68c9f 5126 """
54f9ee45 5127 return _core_.SafeYield(*args, **kwargs)
d14a1e28 5128
e811c8ce 5129def WakeUpIdle(*args, **kwargs):
0df68c9f
RD
5130 """
5131 WakeUpIdle()
6c3b4aae 5132
66c033b4
RD
5133 Cause the message queue to become empty again, so idle events will be
5134 sent.
0df68c9f 5135 """
54f9ee45 5136 return _core_.WakeUpIdle(*args, **kwargs)
d14a1e28 5137
e811c8ce 5138def PostEvent(*args, **kwargs):
0df68c9f
RD
5139 """
5140 PostEvent(EvtHandler dest, Event event)
6c3b4aae 5141
66c033b4
RD
5142 Send an event to a window or other wx.EvtHandler to be processed
5143 later.
0df68c9f 5144 """
54f9ee45 5145 return _core_.PostEvent(*args, **kwargs)
d14a1e28 5146
e811c8ce 5147def App_CleanUp(*args, **kwargs):
0df68c9f
RD
5148 """
5149 App_CleanUp()
6c3b4aae 5150
41e2b43e 5151 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 5152 Python shuts down.
0df68c9f 5153 """
54f9ee45 5154 return _core_.App_CleanUp(*args, **kwargs)
d14a1e28 5155
e811c8ce 5156def GetApp(*args, **kwargs):
0df68c9f
RD
5157 """
5158 GetApp() -> PyApp
6c3b4aae 5159
196addbf 5160 Return a reference to the current wx.App object.
0df68c9f 5161 """
54f9ee45 5162 return _core_.GetApp(*args, **kwargs)
d14a1e28
RD
5163#----------------------------------------------------------------------
5164
5165class PyOnDemandOutputWindow:
6c3b4aae
RD
5166 """
5167 A class that can be used for redirecting Python's stdout and
5168 stderr streams. It will do nothing until something is wrriten to
5169 the stream at which point it will create a Frame with a text area
5170 and write the text there.
5171 """
d14a1e28
RD
5172 def __init__(self, title = "wxPython: stdout/stderr"):
5173 self.frame = None
5174 self.title = title
412d302d
RD
5175 self.pos = wx.DefaultPosition
5176 self.size = (450, 300)
d14a1e28
RD
5177 self.parent = None
5178
5179 def SetParent(self, parent):
6c3b4aae 5180 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
5181 self.parent = parent
5182
6c3b4aae
RD
5183
5184 def CreateOutputWindow(self, st):
412d302d
RD
5185 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
5186 style=wx.DEFAULT_FRAME_STYLE)
196addbf 5187 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 5188 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 5189 self.text.AppendText(st)
6c3b4aae
RD
5190 self.frame.Show(True)
5191 EVT_CLOSE(self.frame, self.OnCloseWindow)
5192
d14a1e28 5193
7409c0c6
RD
5194 def OnCloseWindow(self, event):
5195 if self.frame is not None:
5196 self.frame.Destroy()
5197 self.frame = None
5198 self.text = None
5199
5200
d14a1e28 5201 # These methods provide the file-like output behaviour.
6c3b4aae
RD
5202 def write(self, text):
5203 """
5204 Create the output window if needed and write the string to it.
5205 If not called in the context of the gui thread then uses
5206 CallAfter to do the work there.
5207 """
5208 if self.frame is None:
5209 if not wx.Thread_IsMain():
5210 wx.CallAfter(self.CreateOutputWindow, text)
5211 else:
5212 self.CreateOutputWindow(text)
5213 else:
5214 if not wx.Thread_IsMain():
5215 wx.CallAfter(self.text.AppendText, text)
5216 else:
5217 self.text.AppendText(text)
5218
d14a1e28
RD
5219
5220 def close(self):
6c3b4aae
RD
5221 if self.frame is not None:
5222 wx.CallAfter(self.frame.Close)
5223
d14a1e28 5224
19272049
RD
5225 def flush(self):
5226 pass
5227
5228
d14a1e28
RD
5229
5230#----------------------------------------------------------------------
d14a1e28
RD
5231
5232_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5233
5234class App(wx.PyApp):
6c3b4aae 5235 """
66c033b4
RD
5236 The ``wx.App`` class represents the application and is used to:
5237
5238 * bootstrap the wxPython system and initialize the underlying
5239 gui toolkit
5240 * set and get application-wide properties
5241 * implement the windowing system main message or event loop,
5242 and to dispatch events to window instances
5243 * etc.
5244
5245 Every application must have a ``wx.App`` instance, and all
5246 creation of UI objects should be delayed until after the
03e37cd5
RD
5247 ``wx.App`` object has been created in order to ensure that the gui
5248 platform and wxWidgets have been fully initialized.
66c033b4
RD
5249
5250 Normally you would derive from this class and implement an
5251 ``OnInit`` method that creates a frame and then calls
5252 ``self.SetTopWindow(frame)``.
5253
03e37cd5 5254 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 5255 directly.
6c3b4aae 5256 """
66c033b4 5257
d14a1e28
RD
5258 outputWindowClass = PyOnDemandOutputWindow
5259
03e37cd5
RD
5260 def __init__(self, redirect=_defRedirect, filename=None,
5261 useBestVisual=False, clearSigInt=True):
66c033b4
RD
5262 """
5263 Construct a ``wx.App`` object.
5264
03e37cd5
RD
5265 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5266 redirected? Defaults to True on Windows and Mac, False
5267 otherwise. If `filename` is None then output will be
5268 redirected to a window that pops up as needed. (You can
5269 control what kind of window is created for the output by
5270 resetting the class variable ``outputWindowClass`` to a
5271 class of your choosing.)
66c033b4 5272
03e37cd5
RD
5273 :param filename: The name of a file to redirect output to, if
5274 redirect is True.
66c033b4
RD
5275
5276 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
5277 available visual provided by the system (only relevant on
5278 systems that have more than one visual.) This parameter
5279 must be used instead of calling `SetUseBestVisual` later
5280 on because it must be set before the underlying GUI
5281 toolkit is initialized.
5282
5283 :param clearSigInt: Should SIGINT be cleared? This allows the
5284 app to terminate upon a Ctrl-C in the console like other
5285 GUI apps will.
66c033b4
RD
5286
5287 :note: You should override OnInit to do applicaition
5288 initialization to ensure that the system, toolkit and
5289 wxWidgets are fully initialized.
5290 """
d14a1e28
RD
5291 wx.PyApp.__init__(self)
5292
5293 if wx.Platform == "__WXMAC__":
5294 try:
5295 import MacOS
5296 if not MacOS.WMAvailable():
5297 print """\
5298This program needs access to the screen. Please run with 'pythonw',
5299not 'python', and only when you are logged in on the main display of
5300your Mac."""
5301 _sys.exit(1)
36cadbf7
RD
5302 except SystemExit:
5303 raise
d14a1e28
RD
5304 except:
5305 pass
5306
5307 # This has to be done before OnInit
5308 self.SetUseBestVisual(useBestVisual)
5309
5310 # Set the default handler for SIGINT. This fixes a problem
5311 # where if Ctrl-C is pressed in the console that started this
5312 # app then it will not appear to do anything, (not even send
5313 # KeyboardInterrupt???) but will later segfault on exit. By
5314 # setting the default handler then the app will exit, as
5315 # expected (depending on platform.)
03e37cd5
RD
5316 if clearSigInt:
5317 try:
5318 import signal
5319 signal.signal(signal.SIGINT, signal.SIG_DFL)
5320 except:
5321 pass
d14a1e28
RD
5322
5323 # Save and redirect the stdio to a window?
5324 self.stdioWin = None
5325 self.saveStdio = (_sys.stdout, _sys.stderr)
5326 if redirect:
5327 self.RedirectStdio(filename)
5328
8fb0e70a
RD
5329 # Use Python's install prefix as the default
5330 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
5331
d14a1e28
RD
5332 # This finishes the initialization of wxWindows and then calls
5333 # the OnInit that should be present in the derived class
5334 self._BootstrapApp()
5335
5336
5337 def __del__(self):
5338 try:
5339 self.RestoreStdio() # Just in case the MainLoop was overridden
5340 except:
5341 pass
5342
5343
5344 def SetTopWindow(self, frame):
1e0c8722 5345 """Set the \"main\" top level window"""
d14a1e28
RD
5346 if self.stdioWin:
5347 self.stdioWin.SetParent(frame)
5348 wx.PyApp.SetTopWindow(self, frame)
5349
5350
5351 def MainLoop(self):
1e0c8722 5352 """Execute the main GUI event loop"""
d14a1e28
RD
5353 wx.PyApp.MainLoop(self)
5354 self.RestoreStdio()
5355
5356
7409c0c6 5357 def RedirectStdio(self, filename=None):
1e0c8722 5358 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
5359 if filename:
5360 _sys.stdout = _sys.stderr = open(filename, 'a')
5361 else:
5362 self.stdioWin = self.outputWindowClass()
5363 _sys.stdout = _sys.stderr = self.stdioWin
5364
5365
5366 def RestoreStdio(self):
5367 _sys.stdout, _sys.stderr = self.saveStdio
5368
5369
412d302d
RD
5370 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
5371 """
5372 Set the title, position and/or size of the output window if
f5b96ee1
RD
5373 the stdio has been redirected. This should be called before
5374 any output would cause the output window to be created.
412d302d
RD
5375 """
5376 if self.stdioWin:
5377 if title is not None:
5378 self.stdioWin.title = title
5379 if pos is not None:
5380 self.stdioWin.pos = pos
5381 if size is not None:
5382 self.stdioWin.size = size
5383
5384
5385
d14a1e28 5386
66c033b4 5387# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
5388App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5389App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5390App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5391App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5392App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5393App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5394App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5395App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5396App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5397App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5398App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
5399
5400#----------------------------------------------------------------------------
5401
5402class PySimpleApp(wx.App):
6c3b4aae
RD
5403 """
5404 A simple application class. You can just create one of these and
5405 then then make your top level windows later, and not have to worry
66c033b4
RD
5406 about OnInit. For example::
5407
5408 app = wx.PySimpleApp()
5409 frame = wx.Frame(None, title='Hello World')
5410 frame.Show()
5411 app.MainLoop()
5412
5413 :see: `wx.App`
5414 """
6c3b4aae 5415
03e37cd5
RD
5416 def __init__(self, redirect=False, filename=None,
5417 useBestVisual=False, clearSigInt=True):
66c033b4
RD
5418 """
5419 :see: `wx.App.__init__`
5420 """
03e37cd5 5421 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 5422
d14a1e28 5423 def OnInit(self):
d14a1e28
RD
5424 return True
5425
5426
66c033b4 5427
6c3b4aae 5428# Is anybody using this one?
d14a1e28
RD
5429class PyWidgetTester(wx.App):
5430 def __init__(self, size = (250, 100)):
5431 self.size = size
5432 wx.App.__init__(self, 0)
5433
5434 def OnInit(self):
196addbf 5435 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
5436 self.SetTopWindow(self.frame)
5437 return True
5438
66c033b4
RD
5439 def SetWidget(self, widgetClass, *args, **kwargs):
5440 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
5441 self.frame.Show(True)
5442
5443#----------------------------------------------------------------------------
5444# DO NOT hold any other references to this object. This is how we
66c033b4 5445# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 5446# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 5447# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
5448
5449class __wxPyCleanup:
5450 def __init__(self):
54f9ee45 5451 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
5452 def __del__(self):
5453 self.cleanup()
5454
5455_sys.__wxPythonCleanup = __wxPyCleanup()
5456
5457## # another possible solution, but it gets called too early...
66c033b4
RD
5458## import atexit
5459## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
5460
5461
5462#----------------------------------------------------------------------------
5463
5464#---------------------------------------------------------------------------
2ef75293
RD
5465
5466class EventLoop(object):
5467 def __repr__(self):
5468 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5469 def __init__(self, *args, **kwargs):
5470 """__init__(self) -> EventLoop"""
5471 newobj = _core_.new_EventLoop(*args, **kwargs)
5472 self.this = newobj.this
5473 self.thisown = 1
5474 del newobj.thisown
5475 def __del__(self, destroy=_core_.delete_EventLoop):
5476 """__del__(self)"""
5477 try:
5478 if self.thisown: destroy(self)
5479 except: pass
5480
5481 def Run(*args, **kwargs):
5482 """Run(self) -> int"""
5483 return _core_.EventLoop_Run(*args, **kwargs)
5484
5485 def Exit(*args, **kwargs):
5486 """Exit(self, int rc=0)"""
5487 return _core_.EventLoop_Exit(*args, **kwargs)
5488
5489 def Pending(*args, **kwargs):
5490 """Pending(self) -> bool"""
5491 return _core_.EventLoop_Pending(*args, **kwargs)
5492
5493 def Dispatch(*args, **kwargs):
5494 """Dispatch(self) -> bool"""
5495 return _core_.EventLoop_Dispatch(*args, **kwargs)
5496
5497 def IsRunning(*args, **kwargs):
5498 """IsRunning(self) -> bool"""
5499 return _core_.EventLoop_IsRunning(*args, **kwargs)
5500
5501 def GetActive(*args, **kwargs):
5502 """GetActive() -> EventLoop"""
5503 return _core_.EventLoop_GetActive(*args, **kwargs)
5504
5505 GetActive = staticmethod(GetActive)
5506 def SetActive(*args, **kwargs):
5507 """SetActive(EventLoop loop)"""
5508 return _core_.EventLoop_SetActive(*args, **kwargs)
5509
5510 SetActive = staticmethod(SetActive)
5511
5512class EventLoopPtr(EventLoop):
5513 def __init__(self, this):
5514 self.this = this
5515 if not hasattr(self,"thisown"): self.thisown = 0
5516 self.__class__ = EventLoop
5517_core_.EventLoop_swigregister(EventLoopPtr)
5518
5519def EventLoop_GetActive(*args, **kwargs):
5520 """EventLoop_GetActive() -> EventLoop"""
5521 return _core_.EventLoop_GetActive(*args, **kwargs)
5522
5523def EventLoop_SetActive(*args, **kwargs):
5524 """EventLoop_SetActive(EventLoop loop)"""
5525 return _core_.EventLoop_SetActive(*args, **kwargs)
5526
5527#---------------------------------------------------------------------------
d14a1e28 5528
1e0c8722 5529class AcceleratorEntry(object):
66c033b4
RD
5530 """
5531 A class used to define items in an `wx.AcceleratorTable`. wxPython
5532 programs can choose to use wx.AcceleratorEntry objects, but using a
5533 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 5534 as well. See `__init__` for of the tuple values.
66c033b4
RD
5535
5536 :see: `wx.AcceleratorTable`
5537 """
1e0c8722
RD
5538 def __repr__(self):
5539 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5540 def __init__(self, *args, **kwargs):
66c033b4
RD
5541 """
5542 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
5543
5544 Construct a wx.AcceleratorEntry.
66c033b4 5545 """
54f9ee45 5546 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
1e0c8722
RD
5547 self.this = newobj.this
5548 self.thisown = 1
5549 del newobj.thisown
54f9ee45 5550 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
a95a7133 5551 """__del__(self)"""
1e0c8722
RD
5552 try:
5553 if self.thisown: destroy(self)
5554 except: pass
5555
5556 def Set(*args, **kwargs):
66c033b4
RD
5557 """
5558 Set(self, int flags, int keyCode, int cmd)
1e0c8722 5559
66c033b4
RD
5560 (Re)set the attributes of a wx.AcceleratorEntry.
5561 :see `__init__`
5562 """
5563 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722
RD
5564
5565 def GetFlags(*args, **kwargs):
66c033b4
RD
5566 """
5567 GetFlags(self) -> int
5568
5569 Get the AcceleratorEntry's flags.
5570 """
54f9ee45 5571 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
5572
5573 def GetKeyCode(*args, **kwargs):
66c033b4
RD
5574 """
5575 GetKeyCode(self) -> int
5576
5577 Get the AcceleratorEntry's keycode.
5578 """
54f9ee45 5579 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
5580
5581 def GetCommand(*args, **kwargs):
66c033b4
RD
5582 """
5583 GetCommand(self) -> int
5584
5585 Get the AcceleratorEntry's command ID.
5586 """
54f9ee45 5587 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722
RD
5588
5589
5590class AcceleratorEntryPtr(AcceleratorEntry):
5591 def __init__(self, this):
5592 self.this = this
5593 if not hasattr(self,"thisown"): self.thisown = 0
5594 self.__class__ = AcceleratorEntry
54f9ee45 5595_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
1e0c8722
RD
5596
5597class AcceleratorTable(Object):
66c033b4
RD
5598 """
5599 An accelerator table allows the application to specify a table of
5600 keyboard shortcuts for menus or other commands. On Windows, menu or
5601 button commands are supported; on GTK, only menu commands are
5602 supported.
66c033b4 5603 """
1e0c8722
RD
5604 def __repr__(self):
5605 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5606 def __init__(self, *args, **kwargs):
0df68c9f
RD
5607 """
5608 __init__(entries) -> AcceleratorTable
1e0c8722 5609
66c033b4
RD
5610 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5611 items or or of 3-tuples (flags, keyCode, cmdID)
5612
5613 :see: `wx.AcceleratorEntry`
0df68c9f 5614 """
54f9ee45 5615 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
1e0c8722
RD
5616 self.this = newobj.this
5617 self.thisown = 1
5618 del newobj.thisown
54f9ee45 5619 def __del__(self, destroy=_core_.delete_AcceleratorTable):
a95a7133 5620 """__del__(self)"""
1e0c8722
RD
5621 try:
5622 if self.thisown: destroy(self)
5623 except: pass
5624
5625 def Ok(*args, **kwargs):
a95a7133 5626 """Ok(self) -> bool"""
54f9ee45 5627 return _core_.AcceleratorTable_Ok(*args, **kwargs)
1e0c8722
RD
5628
5629
5630class AcceleratorTablePtr(AcceleratorTable):
5631 def __init__(self, this):
5632 self.this = this
5633 if not hasattr(self,"thisown"): self.thisown = 0
5634 self.__class__ = AcceleratorTable
54f9ee45 5635_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
1e0c8722
RD
5636
5637
5638def GetAccelFromString(*args, **kwargs):
196addbf 5639 """GetAccelFromString(String label) -> AcceleratorEntry"""
54f9ee45 5640 return _core_.GetAccelFromString(*args, **kwargs)
1e0c8722
RD
5641#---------------------------------------------------------------------------
5642
74a57fcd
RD
5643class VisualAttributes(object):
5644 """struct containing all the visual attributes of a control"""
5645 def __repr__(self):
5646 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5647 def __init__(self, *args, **kwargs):
5648 """
a95a7133 5649 __init__(self) -> VisualAttributes
74a57fcd
RD
5650
5651 struct containing all the visual attributes of a control
5652 """
54f9ee45 5653 newobj = _core_.new_VisualAttributes(*args, **kwargs)
74a57fcd
RD
5654 self.this = newobj.this
5655 self.thisown = 1
5656 del newobj.thisown
54f9ee45 5657 def __del__(self, destroy=_core_.delete_VisualAttributes):
a95a7133 5658 """__del__(self)"""
74a57fcd
RD
5659 try:
5660 if self.thisown: destroy(self)
5661 except: pass
5662
54f9ee45
RD
5663 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
5664 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
5665 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
74a57fcd
RD
5666
5667class VisualAttributesPtr(VisualAttributes):
5668 def __init__(self, this):
5669 self.this = this
5670 if not hasattr(self,"thisown"): self.thisown = 0
5671 self.__class__ = VisualAttributes
54f9ee45 5672_core_.VisualAttributes_swigregister(VisualAttributesPtr)
74a57fcd
RD
5673NullAcceleratorTable = cvar.NullAcceleratorTable
5674PanelNameStr = cvar.PanelNameStr
5675
54f9ee45
RD
5676WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
5677WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
5678WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
5679WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
5680WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 5681class Window(EvtHandler):
15afbcd0
RD
5682 """
5683 wx.Window is the base class for all windows and represents any visible
5684 object on the screen. All controls, top level windows and so on are
5685 wx.Windows. Sizers and device contexts are not however, as they don't
5686 appear on screen themselves.
5687
5688 """
e811c8ce
RD
5689 def __repr__(self):
5690 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5691 def __init__(self, *args, **kwargs):
0df68c9f 5692 """
a95a7133 5693 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 5694 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
5695
5696 Construct and show a generic Window.
0df68c9f 5697 """
54f9ee45 5698 newobj = _core_.new_Window(*args, **kwargs)
d14a1e28
RD
5699 self.this = newobj.this
5700 self.thisown = 1
5701 del newobj.thisown
5702 self._setOORInfo(self)
d14a1e28 5703
e811c8ce 5704 def Create(*args, **kwargs):
0df68c9f 5705 """
a95a7133 5706 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 5707 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
5708
5709 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 5710 """
54f9ee45 5711 return _core_.Window_Create(*args, **kwargs)
d14a1e28 5712
e811c8ce 5713 def Close(*args, **kwargs):
15afbcd0 5714 """
a95a7133 5715 Close(self, bool force=False) -> bool
15afbcd0
RD
5716
5717 This function simply generates a EVT_CLOSE event whose handler usually
5718 tries to close the window. It doesn't close the window itself,
5719 however. If force is False (the default) then the window's close
5720 handler will be allowed to veto the destruction of the window.
15afbcd0 5721 """
54f9ee45 5722 return _core_.Window_Close(*args, **kwargs)
d14a1e28 5723
e811c8ce 5724 def Destroy(*args, **kwargs):
0df68c9f 5725 """
a95a7133 5726 Destroy(self) -> bool
d14a1e28 5727
15afbcd0
RD
5728 Destroys the window safely. Frames and dialogs are not destroyed
5729 immediately when this function is called -- they are added to a list
5730 of windows to be deleted on idle time, when all the window's events
5731 have been processed. This prevents problems with events being sent to
5732 non-existent windows.
5733
5734 Returns True if the window has either been successfully deleted, or it
5735 has been added to the list of windows pending real deletion.
0df68c9f 5736 """
54f9ee45 5737 return _core_.Window_Destroy(*args, **kwargs)
d14a1e28 5738
e811c8ce 5739 def DestroyChildren(*args, **kwargs):
15afbcd0 5740 """
a95a7133 5741 DestroyChildren(self) -> bool
15afbcd0 5742
41e2b43e
RD
5743 Destroys all children of a window. Called automatically by the
5744 destructor.
15afbcd0 5745 """
54f9ee45 5746 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 5747
e811c8ce 5748 def IsBeingDeleted(*args, **kwargs):
15afbcd0 5749 """
a95a7133 5750 IsBeingDeleted(self) -> bool
15afbcd0
RD
5751
5752 Is the window in the process of being deleted?
5753 """
54f9ee45 5754 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 5755
e811c8ce 5756 def SetTitle(*args, **kwargs):
15afbcd0 5757 """
a95a7133 5758 SetTitle(self, String title)
15afbcd0
RD
5759
5760 Sets the window's title. Applicable only to frames and dialogs.
5761 """
54f9ee45 5762 return _core_.Window_SetTitle(*args, **kwargs)
d14a1e28 5763
e811c8ce 5764 def GetTitle(*args, **kwargs):
15afbcd0 5765 """
a95a7133 5766 GetTitle(self) -> String
15afbcd0
RD
5767
5768 Gets the window's title. Applicable only to frames and dialogs.
5769 """
54f9ee45 5770 return _core_.Window_GetTitle(*args, **kwargs)
d14a1e28 5771
e811c8ce 5772 def SetLabel(*args, **kwargs):
15afbcd0 5773 """
a95a7133 5774 SetLabel(self, String label)
15afbcd0
RD
5775
5776 Set the text which the window shows in its label if applicable.
5777 """
54f9ee45 5778 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 5779
e811c8ce 5780 def GetLabel(*args, **kwargs):
15afbcd0 5781 """
a95a7133 5782 GetLabel(self) -> String
15afbcd0 5783
41e2b43e
RD
5784 Generic way of getting a label from any window, for identification
5785 purposes. The interpretation of this function differs from class to
5786 class. For frames and dialogs, the value returned is the title. For
5787 buttons or static text controls, it is the button text. This function
5788 can be useful for meta-programs such as testing tools or special-needs
5789 access programs)which need to identify windows by name.
15afbcd0 5790 """
54f9ee45 5791 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 5792
e811c8ce 5793 def SetName(*args, **kwargs):
15afbcd0 5794 """
a95a7133 5795 SetName(self, String name)
15afbcd0 5796
41e2b43e
RD
5797 Sets the window's name. The window name is used for ressource setting
5798 in X, it is not the same as the window title/label
15afbcd0 5799 """
54f9ee45 5800 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 5801
e811c8ce 5802 def GetName(*args, **kwargs):
15afbcd0 5803 """
a95a7133 5804 GetName(self) -> String
15afbcd0 5805
41e2b43e
RD
5806 Returns the windows name. This name is not guaranteed to be unique;
5807 it is up to the programmer to supply an appropriate name in the window
5808 constructor or via wx.Window.SetName.
15afbcd0 5809 """
54f9ee45 5810 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 5811
4276dc52
RD
5812 def SetWindowVariant(*args, **kwargs):
5813 """
a95a7133 5814 SetWindowVariant(self, int variant)
4276dc52 5815
41e2b43e
RD
5816 Sets the variant of the window/font size to use for this window, if
5817 the platform supports variants, for example, wxMac.
4276dc52 5818 """
54f9ee45 5819 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
5820
5821 def GetWindowVariant(*args, **kwargs):
a95a7133 5822 """GetWindowVariant(self) -> int"""
54f9ee45 5823 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 5824
e811c8ce 5825 def SetId(*args, **kwargs):
15afbcd0 5826 """
a95a7133 5827 SetId(self, int winid)
15afbcd0
RD
5828
5829 Sets the identifier of the window. Each window has an integer
5830 identifier. If the application has not provided one, an identifier
5831 will be generated. Normally, the identifier should be provided on
5832 creation and should not be modified subsequently.
5833 """
54f9ee45 5834 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 5835
e811c8ce 5836 def GetId(*args, **kwargs):
15afbcd0 5837 """
a95a7133 5838 GetId(self) -> int
15afbcd0
RD
5839
5840 Returns the identifier of the window. Each window has an integer
5841 identifier. If the application has not provided one (or the default Id
5842 -1 is used) then an unique identifier with a negative value will be
5843 generated.
5844 """
54f9ee45 5845 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 5846
e811c8ce 5847 def NewControlId(*args, **kwargs):
15afbcd0 5848 """
66c033b4 5849 NewControlId() -> int
15afbcd0
RD
5850
5851 Generate a control id for the controls which were not given one.
5852 """
54f9ee45 5853 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 5854
e811c8ce
RD
5855 NewControlId = staticmethod(NewControlId)
5856 def NextControlId(*args, **kwargs):
15afbcd0 5857 """
66c033b4 5858 NextControlId(int winid) -> int
15afbcd0
RD
5859
5860 Get the id of the control following the one with the given
41e2b43e 5861 autogenerated) id
15afbcd0 5862 """
54f9ee45 5863 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 5864
e811c8ce
RD
5865 NextControlId = staticmethod(NextControlId)
5866 def PrevControlId(*args, **kwargs):
15afbcd0 5867 """
66c033b4 5868 PrevControlId(int winid) -> int
15afbcd0
RD
5869
5870 Get the id of the control preceding the one with the given
41e2b43e 5871 autogenerated) id
15afbcd0 5872 """
54f9ee45 5873 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 5874
e811c8ce
RD
5875 PrevControlId = staticmethod(PrevControlId)
5876 def SetSize(*args, **kwargs):
15afbcd0 5877 """
a95a7133 5878 SetSize(self, Size size)
15afbcd0
RD
5879
5880 Sets the size of the window in pixels.
5881 """
54f9ee45 5882 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 5883
e811c8ce 5884 def SetDimensions(*args, **kwargs):
15afbcd0 5885 """
a95a7133 5886 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
5887
5888 Sets the position and size of the window in pixels. The sizeFlags
5889 parameter indicates the interpretation of the other params if they are
5890 -1. wx.SIZE_AUTO*: a -1 indicates that a class-specific default
5891 shoudl be used. wx.SIZE_USE_EXISTING: existing dimensions should be
5892 used if -1 values are supplied. wxSIZE_ALLOW_MINUS_ONE: allow
5893 dimensions of -1 and less to be interpreted as real dimensions, not
5894 default values.
5895 """
54f9ee45 5896 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 5897
e811c8ce 5898 def SetRect(*args, **kwargs):
15afbcd0 5899 """
a95a7133 5900 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
5901
5902 Sets the position and size of the window in pixels using a wx.Rect.
5903 """
54f9ee45 5904 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 5905
e811c8ce 5906 def SetSizeWH(*args, **kwargs):
15afbcd0 5907 """
a95a7133 5908 SetSizeWH(self, int width, int height)
15afbcd0
RD
5909
5910 Sets the size of the window in pixels.
5911 """
54f9ee45 5912 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 5913
e811c8ce 5914 def Move(*args, **kwargs):
15afbcd0 5915 """
a95a7133 5916 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
5917
5918 Moves the window to the given position.
5919 """
54f9ee45 5920 return _core_.Window_Move(*args, **kwargs)
d14a1e28 5921
e811c8ce
RD
5922 SetPosition = Move
5923 def MoveXY(*args, **kwargs):
15afbcd0 5924 """
a95a7133 5925 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
5926
5927 Moves the window to the given position.
5928 """
54f9ee45 5929 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 5930
f8167d6e
RD
5931 def SetBestFittingSize(*args, **kwargs):
5932 """
5933 SetBestFittingSize(self, Size size=DefaultSize)
5934
5935 A 'Smart' SetSize that will fill in default size components with the
5936 window's *best size* values. Also set's the minsize for use with sizers.
5937 """
5938 return _core_.Window_SetBestFittingSize(*args, **kwargs)
5939
e811c8ce 5940 def Raise(*args, **kwargs):
15afbcd0 5941 """
a95a7133 5942 Raise(self)
15afbcd0
RD
5943
5944 Raises the window to the top of the window hierarchy if it is a
5945 managed window (dialog or frame).
5946 """
54f9ee45 5947 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
5948
5949 def Lower(*args, **kwargs):
15afbcd0 5950 """
a95a7133 5951 Lower(self)
15afbcd0
RD
5952
5953 Lowers the window to the bottom of the window hierarchy if it is a
5954 managed window (dialog or frame).
5955 """
54f9ee45 5956 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
5957
5958 def SetClientSize(*args, **kwargs):
15afbcd0 5959 """
a95a7133 5960 SetClientSize(self, Size size)
15afbcd0
RD
5961
5962 This sets the size of the window client area in pixels. Using this
5963 function to size a window tends to be more device-independent than
5964 wx.Window.SetSize, since the application need not worry about what
5965 dimensions the border or title bar have when trying to fit the window
5966 around panel items, for example.
5967 """
54f9ee45 5968 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
5969
5970 def SetClientSizeWH(*args, **kwargs):
15afbcd0 5971 """
a95a7133 5972 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
5973
5974 This sets the size of the window client area in pixels. Using this
5975 function to size a window tends to be more device-independent than
5976 wx.Window.SetSize, since the application need not worry about what
5977 dimensions the border or title bar have when trying to fit the window
5978 around panel items, for example.
5979 """
54f9ee45 5980 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
5981
5982 def SetClientRect(*args, **kwargs):
15afbcd0 5983 """
a95a7133 5984 SetClientRect(self, Rect rect)
15afbcd0
RD
5985
5986 This sets the size of the window client area in pixels. Using this
5987 function to size a window tends to be more device-independent than
5988 wx.Window.SetSize, since the application need not worry about what
5989 dimensions the border or title bar have when trying to fit the window
5990 around panel items, for example.
5991 """
54f9ee45 5992 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
5993
5994 def GetPosition(*args, **kwargs):
0df68c9f 5995 """
a95a7133 5996 GetPosition(self) -> Point
e811c8ce 5997
0df68c9f
RD
5998 Get the window's position.
5999 """
54f9ee45 6000 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
6001
6002 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
6003 """
6004 GetPositionTuple() -> (x,y)
e811c8ce 6005
0df68c9f
RD
6006 Get the window's position.
6007 """
54f9ee45 6008 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
6009
6010 def GetSize(*args, **kwargs):
0df68c9f 6011 """
a95a7133 6012 GetSize(self) -> Size
e811c8ce 6013
0df68c9f
RD
6014 Get the window size.
6015 """
54f9ee45 6016 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
6017
6018 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
6019 """
6020 GetSizeTuple() -> (width, height)
e811c8ce 6021
0df68c9f
RD
6022 Get the window size.
6023 """
54f9ee45 6024 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
6025
6026 def GetRect(*args, **kwargs):
15afbcd0 6027 """
a95a7133 6028 GetRect(self) -> Rect
15afbcd0
RD
6029
6030 Returns the size and position of the window as a wx.Rect object.
6031 """
54f9ee45 6032 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
6033
6034 def GetClientSize(*args, **kwargs):
0df68c9f 6035 """
a95a7133 6036 GetClientSize(self) -> Size
e811c8ce 6037
15afbcd0
RD
6038 This gets the size of the window's 'client area' in pixels. The client
6039 area is the area which may be drawn on by the programmer, excluding
6040 title bar, border, scrollbars, etc.
0df68c9f 6041 """
54f9ee45 6042 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
6043
6044 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
6045 """
6046 GetClientSizeTuple() -> (width, height)
e811c8ce 6047
15afbcd0
RD
6048 This gets the size of the window's 'client area' in pixels. The client
6049 area is the area which may be drawn on by the programmer, excluding
6050 title bar, border, scrollbars, etc.
0df68c9f 6051 """
54f9ee45 6052 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
6053
6054 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 6055 """
a95a7133 6056 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
6057
6058 Get the origin of the client area of the window relative to the
6059 window's top left corner (the client area may be shifted because of
6060 the borders, scrollbars, other decorations...)
6061 """
54f9ee45 6062 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
6063
6064 def GetClientRect(*args, **kwargs):
15afbcd0 6065 """
a95a7133 6066 GetClientRect(self) -> Rect
15afbcd0 6067
61863841 6068 Get the client area position and size as a `wx.Rect` object.
15afbcd0 6069 """
54f9ee45 6070 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
6071
6072 def GetBestSize(*args, **kwargs):
0df68c9f 6073 """
a95a7133 6074 GetBestSize(self) -> Size
e811c8ce 6075
248ed943 6076 This function returns the best acceptable minimal size for the
41e2b43e
RD
6077 window, if applicable. For example, for a static text control, it will
6078 be the minimal size such that the control label is not truncated. For
6079 windows containing subwindows (suzh aswx.Panel), the size returned by
6080 this function will be the same as the size the window would have had
6081 after calling Fit.
0df68c9f 6082 """
54f9ee45 6083 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
6084
6085 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
6086 """
6087 GetBestSizeTuple() -> (width, height)
e811c8ce 6088
248ed943 6089 This function returns the best acceptable minimal size for the
41e2b43e
RD
6090 window, if applicable. For example, for a static text control, it will
6091 be the minimal size such that the control label is not truncated. For
6092 windows containing subwindows (suzh aswx.Panel), the size returned by
6093 this function will be the same as the size the window would have had
6094 after calling Fit.
0df68c9f 6095 """
54f9ee45 6096 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 6097
dfbb5885
RD
6098 def InvalidateBestSize(*args, **kwargs):
6099 """
6100 InvalidateBestSize(self)
6101
6102 Reset the cached best size value so it will be recalculated the next
6103 time it is needed.
6104 """
6105 return _core_.Window_InvalidateBestSize(*args, **kwargs)
6106
6107 def GetBestFittingSize(*args, **kwargs):
6108 """
6109 GetBestFittingSize(self) -> Size
6110
6111 This function will merge the window's best size into the window's
6112 minimum size, giving priority to the min size components, and returns
6113 the results.
6114
6115 """
6116 return _core_.Window_GetBestFittingSize(*args, **kwargs)
6117
e811c8ce 6118 def GetAdjustedBestSize(*args, **kwargs):
15afbcd0 6119 """
a95a7133 6120 GetAdjustedBestSize(self) -> Size
15afbcd0
RD
6121
6122 This method is similar to GetBestSize, except in one
6123 thing. GetBestSize should return the minimum untruncated size of the
6124 window, while this method will return the largest of BestSize and any
6125 user specified minimum size. ie. it is the minimum size the window
6126 should currently be drawn at, not the minimal size it can possibly
6127 tolerate.
6128 """
54f9ee45 6129 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
e811c8ce
RD
6130
6131 def Center(*args, **kwargs):
15afbcd0 6132 """
a95a7133 6133 Center(self, int direction=BOTH)
15afbcd0
RD
6134
6135 Centers the window. The parameter specifies the direction for
6136 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
6137 also include wx.CENTER_ON_SCREEN flag if you want to center the window
6138 on the entire screen and not on its parent window. If it is a
6139 top-level window and has no parent then it will always be centered
6140 relative to the screen.
6141 """
54f9ee45 6142 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
6143
6144 Centre = Center
6145 def CenterOnScreen(*args, **kwargs):
15afbcd0 6146 """
a95a7133 6147 CenterOnScreen(self, int dir=BOTH)
15afbcd0
RD
6148
6149 Center on screen (only works for top level windows)
6150 """
54f9ee45 6151 return _core_.Window_CenterOnScreen(*args, **kwargs)
e811c8ce
RD
6152
6153 CentreOnScreen = CenterOnScreen
6154 def CenterOnParent(*args, **kwargs):
15afbcd0 6155 """
a95a7133 6156 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
6157
6158 Center with respect to the the parent window
6159 """
54f9ee45 6160 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
6161
6162 CentreOnParent = CenterOnParent
6163 def Fit(*args, **kwargs):
15afbcd0 6164 """
a95a7133 6165 Fit(self)
15afbcd0
RD
6166
6167 Sizes the window so that it fits around its subwindows. This function
6168 won't do anything if there are no subwindows and will only really work
6169 correctly if sizers are used for the subwindows layout. Also, if the
6170 window has exactly one subwindow it is better (faster and the result
6171 is more precise as Fit adds some margin to account for fuzziness of
6172 its calculations) to call window.SetClientSize(child.GetSize())
6173 instead of calling Fit.
6174 """
54f9ee45 6175 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
6176
6177 def FitInside(*args, **kwargs):
15afbcd0 6178 """
a95a7133 6179 FitInside(self)
15afbcd0
RD
6180
6181 Similar to Fit, but sizes the interior (virtual) size of a
6182 window. Mainly useful with scrolled windows to reset scrollbars after
6183 sizing changes that do not trigger a size event, and/or scrolled
6184 windows without an interior sizer. This function similarly won't do
6185 anything if there are no subwindows.
6186 """
54f9ee45 6187 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 6188
f16ab95d 6189 def SetSizeHints(*args, **kwargs):
0df68c9f 6190 """
a95a7133 6191 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 6192 int incH=-1)
15afbcd0
RD
6193
6194 Allows specification of minimum and maximum window sizes, and window
6195 size increments. If a pair of values is not set (or set to -1), the
6196 default values will be used. If this function is called, the user
908b74cd
RD
6197 will not be able to size the window outside the given bounds (if it is
6198 a top-level window.) Sizers will also inspect the minimum window size
6199 and will use that value if set when calculating layout.
6200
6201 The resizing increments are only significant under Motif or Xt.
0df68c9f 6202 """
f16ab95d 6203 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 6204
f16ab95d
RD
6205 def SetSizeHintsSz(*args, **kwargs):
6206 """
6207 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
6208
6209 Allows specification of minimum and maximum window sizes, and window
6210 size increments. If a pair of values is not set (or set to -1), the
6211 default values will be used. If this function is called, the user
6212 will not be able to size the window outside the given bounds (if it is
6213 a top-level window.) Sizers will also inspect the minimum window size
6214 and will use that value if set when calculating layout.
6215
6216 The resizing increments are only significant under Motif or Xt.
6217 """
6218 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
6219
6220 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 6221 """
908b74cd 6222 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
6223
6224 Allows specification of minimum and maximum virtual window sizes. If a
6225 pair of values is not set (or set to -1), the default values will be
6226 used. If this function is called, the user will not be able to size
6227 the virtual area of the window outside the given bounds.
6228 """
f16ab95d
RD
6229 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
6230
6231 def SetVirtualSizeHintsSz(*args, **kwargs):
6232 """
6233 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
6234
6235 Allows specification of minimum and maximum virtual window sizes. If a
6236 pair of values is not set (or set to -1), the default values will be
6237 used. If this function is called, the user will not be able to size
6238 the virtual area of the window outside the given bounds.
6239 """
6240 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 6241
908b74cd
RD
6242 def GetMaxSize(*args, **kwargs):
6243 """GetMaxSize(self) -> Size"""
6244 return _core_.Window_GetMaxSize(*args, **kwargs)
6245
6246 def GetMinSize(*args, **kwargs):
6247 """GetMinSize(self) -> Size"""
6248 return _core_.Window_GetMinSize(*args, **kwargs)
6249
6250 def SetMinSize(*args, **kwargs):
6251 """
6252 SetMinSize(self, Size minSize)
6253
6254 A more convenient method than `SetSizeHints` for setting just the
6255 min size.
6256 """
6257 return _core_.Window_SetMinSize(*args, **kwargs)
6258
6259 def SetMaxSize(*args, **kwargs):
6260 """
6261 SetMaxSize(self, Size maxSize)
6262
6263 A more convenient method than `SetSizeHints` for setting just the
6264 max size.
6265 """
6266 return _core_.Window_SetMaxSize(*args, **kwargs)
6267
e811c8ce 6268 def GetMinWidth(*args, **kwargs):
a95a7133 6269 """GetMinWidth(self) -> int"""
54f9ee45 6270 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
6271
6272 def GetMinHeight(*args, **kwargs):
a95a7133 6273 """GetMinHeight(self) -> int"""
54f9ee45 6274 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
6275
6276 def GetMaxWidth(*args, **kwargs):
a95a7133 6277 """GetMaxWidth(self) -> int"""
54f9ee45 6278 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
6279
6280 def GetMaxHeight(*args, **kwargs):
a95a7133 6281 """GetMaxHeight(self) -> int"""
54f9ee45 6282 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 6283
e811c8ce 6284 def SetVirtualSize(*args, **kwargs):
0df68c9f 6285 """
a95a7133 6286 SetVirtualSize(self, Size size)
e811c8ce 6287
15afbcd0
RD
6288 Set the the virtual size of a window in pixels. For most windows this
6289 is just the client area of the window, but for some like scrolled
6290 windows it is more or less independent of the screen window size.
0df68c9f 6291 """
54f9ee45 6292 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
6293
6294 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 6295 """
a95a7133 6296 SetVirtualSizeWH(self, int w, int h)
e811c8ce 6297
15afbcd0
RD
6298 Set the the virtual size of a window in pixels. For most windows this
6299 is just the client area of the window, but for some like scrolled
6300 windows it is more or less independent of the screen window size.
0df68c9f 6301 """
54f9ee45 6302 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
6303
6304 def GetVirtualSize(*args, **kwargs):
0df68c9f 6305 """
a95a7133 6306 GetVirtualSize(self) -> Size
e811c8ce 6307
15afbcd0
RD
6308 Get the the virtual size of the window in pixels. For most windows
6309 this is just the client area of the window, but for some like scrolled
6310 windows it is more or less independent of the screen window size.
0df68c9f 6311 """
54f9ee45 6312 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
6313
6314 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
6315 """
6316 GetVirtualSizeTuple() -> (width, height)
e811c8ce 6317
15afbcd0
RD
6318 Get the the virtual size of the window in pixels. For most windows
6319 this is just the client area of the window, but for some like scrolled
6320 windows it is more or less independent of the screen window size.
0df68c9f 6321 """
54f9ee45 6322 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce
RD
6323
6324 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 6325 """
a95a7133 6326 GetBestVirtualSize(self) -> Size
15afbcd0
RD
6327
6328 Return the largest of ClientSize and BestSize (as determined by a
6329 sizer, interior children, or other means)
6330 """
54f9ee45 6331 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
6332
6333 def Show(*args, **kwargs):
15afbcd0 6334 """
a95a7133 6335 Show(self, bool show=True) -> bool
15afbcd0
RD
6336
6337 Shows or hides the window. You may need to call Raise for a top level
6338 window if you want to bring it to top, although this is not needed if
6339 Show is called immediately after the frame creation. Returns True if
6340 the window has been shown or hidden or False if nothing was done
6341 because it already was in the requested state.
6342 """
54f9ee45 6343 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
6344
6345 def Hide(*args, **kwargs):
15afbcd0 6346 """
a95a7133 6347 Hide(self) -> bool
15afbcd0
RD
6348
6349 Equivalent to calling Show(False).
6350 """
54f9ee45 6351 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
6352
6353 def Enable(*args, **kwargs):
15afbcd0 6354 """
a95a7133 6355 Enable(self, bool enable=True) -> bool
15afbcd0
RD
6356
6357 Enable or disable the window for user input. Note that when a parent
6358 window is disabled, all of its children are disabled as well and they
6359 are reenabled again when the parent is. Returns true if the window
6360 has been enabled or disabled, false if nothing was done, i.e. if the
6361 window had already been in the specified state.
6362 """
54f9ee45 6363 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
6364
6365 def Disable(*args, **kwargs):
15afbcd0 6366 """
a95a7133 6367 Disable(self) -> bool
15afbcd0
RD
6368
6369 Disables the window, same as Enable(false).
6370 """
54f9ee45 6371 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
6372
6373 def IsShown(*args, **kwargs):
15afbcd0 6374 """
a95a7133 6375 IsShown(self) -> bool
15afbcd0
RD
6376
6377 Returns true if the window is shown, false if it has been hidden.
6378 """
54f9ee45 6379 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
6380
6381 def IsEnabled(*args, **kwargs):
15afbcd0 6382 """
a95a7133 6383 IsEnabled(self) -> bool
15afbcd0
RD
6384
6385 Returns true if the window is enabled for input, false otherwise.
6386 """
54f9ee45 6387 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce
RD
6388
6389 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 6390 """
a95a7133 6391 SetWindowStyleFlag(self, long style)
15afbcd0 6392
41e2b43e
RD
6393 Sets the style of the window. Please note that some styles cannot be
6394 changed after the window creation and that Refresh() might need to be
6395 called after changing the others for the change to take place
6396 immediately.
15afbcd0 6397 """
54f9ee45 6398 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
6399
6400 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 6401 """
a95a7133 6402 GetWindowStyleFlag(self) -> long
e811c8ce 6403
15afbcd0
RD
6404 Gets the window style that was passed to the constructor or Create
6405 method.
6406 """
54f9ee45 6407 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 6408
15afbcd0 6409 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 6410 def HasFlag(*args, **kwargs):
15afbcd0 6411 """
a95a7133 6412 HasFlag(self, int flag) -> bool
15afbcd0
RD
6413
6414 Test if the given style is set for this window.
6415 """
54f9ee45 6416 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
6417
6418 def IsRetained(*args, **kwargs):
15afbcd0 6419 """
a95a7133 6420 IsRetained(self) -> bool
15afbcd0
RD
6421
6422 Returns true if the window is retained, false otherwise. Retained
6423 windows are only available on X platforms.
6424 """
54f9ee45 6425 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce
RD
6426
6427 def SetExtraStyle(*args, **kwargs):
15afbcd0 6428 """
a95a7133 6429 SetExtraStyle(self, long exStyle)
15afbcd0
RD
6430
6431 Sets the extra style bits for the window. Extra styles are the less
6432 often used style bits which can't be set with the constructor or with
6433 SetWindowStyleFlag()
6434 """
54f9ee45 6435 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
6436
6437 def GetExtraStyle(*args, **kwargs):
15afbcd0 6438 """
a95a7133 6439 GetExtraStyle(self) -> long
15afbcd0
RD
6440
6441 Returns the extra style bits for the window.
6442 """
54f9ee45 6443 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
6444
6445 def MakeModal(*args, **kwargs):
15afbcd0 6446 """
a95a7133 6447 MakeModal(self, bool modal=True)
15afbcd0
RD
6448
6449 Disables all other windows in the application so that the user can
6450 only interact with this window. Passing False will reverse this
6451 effect.
6452 """
54f9ee45 6453 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
6454
6455 def SetThemeEnabled(*args, **kwargs):
15afbcd0 6456 """
a95a7133 6457 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
6458
6459 This function tells a window if it should use the system's "theme"
6460 code to draw the windows' background instead if its own background
6461 drawing code. This will only have an effect on platforms that support
6462 the notion of themes in user defined windows. One such platform is
6463 GTK+ where windows can have (very colourful) backgrounds defined by a
6464 user's selected theme.
6465
6466 Dialogs, notebook pages and the status bar have this flag set to true
6467 by default so that the default look and feel is simulated best.
6468 """
54f9ee45 6469 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
6470
6471 def GetThemeEnabled(*args, **kwargs):
15afbcd0 6472 """
a95a7133 6473 GetThemeEnabled(self) -> bool
e811c8ce 6474
15afbcd0
RD
6475 Return the themeEnabled flag.
6476 """
54f9ee45 6477 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
6478
6479 def SetFocus(*args, **kwargs):
15afbcd0 6480 """
a95a7133 6481 SetFocus(self)
15afbcd0
RD
6482
6483 Set's the focus to this window, allowing it to receive keyboard input.
6484 """
54f9ee45 6485 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
6486
6487 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 6488 """
a95a7133 6489 SetFocusFromKbd(self)
15afbcd0
RD
6490
6491 Set focus to this window as the result of a keyboard action. Normally
6492 only called internally.
6493 """
54f9ee45 6494 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
6495
6496 def FindFocus(*args, **kwargs):
15afbcd0 6497 """
66c033b4 6498 FindFocus() -> Window
15afbcd0
RD
6499
6500 Returns the window or control that currently has the keyboard focus,
6501 or None.
6502 """
54f9ee45 6503 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
6504
6505 FindFocus = staticmethod(FindFocus)
6506 def AcceptsFocus(*args, **kwargs):
15afbcd0 6507 """
a95a7133 6508 AcceptsFocus(self) -> bool
15afbcd0
RD
6509
6510 Can this window have focus?
6511 """
54f9ee45 6512 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce
RD
6513
6514 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 6515 """
a95a7133 6516 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
6517
6518 Can this window be given focus by keyboard navigation? if not, the
6519 only way to give it focus (provided it accepts it at all) is to click
6520 it.
6521 """
54f9ee45 6522 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce
RD
6523
6524 def GetDefaultItem(*args, **kwargs):
15afbcd0 6525 """
a95a7133 6526 GetDefaultItem(self) -> Window
15afbcd0
RD
6527
6528 Get the default child of this parent, i.e. the one which is activated
6529 by pressing <Enter> such as the OK button on a wx.Dialog.
6530 """
54f9ee45 6531 return _core_.Window_GetDefaultItem(*args, **kwargs)
e811c8ce
RD
6532
6533 def SetDefaultItem(*args, **kwargs):
15afbcd0 6534 """
a95a7133 6535 SetDefaultItem(self, Window child) -> Window
15afbcd0
RD
6536
6537 Set this child as default, return the old default.
6538 """
54f9ee45 6539 return _core_.Window_SetDefaultItem(*args, **kwargs)
e811c8ce
RD
6540
6541 def SetTmpDefaultItem(*args, **kwargs):
15afbcd0 6542 """
a95a7133 6543 SetTmpDefaultItem(self, Window win)
15afbcd0
RD
6544
6545 Set this child as temporary default
6546 """
54f9ee45 6547 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
e811c8ce 6548
908b74cd
RD
6549 def Navigate(*args, **kwargs):
6550 """
6551 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6552
fd2dc343
RD
6553 Does keyboard navigation from this window to another, by sending a
6554 `wx.NavigationKeyEvent`.
908b74cd
RD
6555 """
6556 return _core_.Window_Navigate(*args, **kwargs)
6557
7f98d120
RD
6558 def MoveAfterInTabOrder(*args, **kwargs):
6559 """
6560 MoveAfterInTabOrder(self, Window win)
6561
6562 Moves this window in the tab navigation order after the specified
6563 sibling window. This means that when the user presses the TAB key on
6564 that other window, the focus switches to this window.
6565
6566 The default tab order is the same as creation order. This function
6567 and `MoveBeforeInTabOrder` allow to change it after creating all the
6568 windows.
6569
6570 """
6571 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
6572
6573 def MoveBeforeInTabOrder(*args, **kwargs):
6574 """
6575 MoveBeforeInTabOrder(self, Window win)
6576
6577 Same as `MoveAfterInTabOrder` except that it inserts this window just
6578 before win instead of putting it right after it.
6579 """
6580 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
6581
e811c8ce 6582 def GetChildren(*args, **kwargs):
15afbcd0 6583 """
a95a7133 6584 GetChildren(self) -> PyObject
15afbcd0
RD
6585
6586 Returns a list of the window's children. NOTE: Currently this is a
6587 copy of the child window list maintained by the window, so the return
6588 value of this function is only valid as long as the window's children
6589 do not change.
6590 """
54f9ee45 6591 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
6592
6593 def GetParent(*args, **kwargs):
15afbcd0 6594 """
a95a7133 6595 GetParent(self) -> Window
15afbcd0
RD
6596
6597 Returns the parent window of this window, or None if there isn't one.
6598 """
54f9ee45 6599 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
6600
6601 def GetGrandParent(*args, **kwargs):
15afbcd0 6602 """
a95a7133 6603 GetGrandParent(self) -> Window
15afbcd0 6604
41e2b43e
RD
6605 Returns the parent of the parent of this window, or None if there
6606 isn't one.
15afbcd0 6607 """
54f9ee45 6608 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce
RD
6609
6610 def IsTopLevel(*args, **kwargs):
15afbcd0 6611 """
a95a7133 6612 IsTopLevel(self) -> bool
15afbcd0
RD
6613
6614 Returns true if the given window is a top-level one. Currently all
6615 frames and dialogs are always considered to be top-level windows (even
6616 if they have a parent window).
6617 """
54f9ee45 6618 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
6619
6620 def Reparent(*args, **kwargs):
15afbcd0 6621 """
a95a7133 6622 Reparent(self, Window newParent) -> bool
15afbcd0
RD
6623
6624 Reparents the window, i.e the window will be removed from its current
6625 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6626 re-inserted into another. Available on Windows and GTK. Returns True
6627 if the parent was changed, False otherwise (error or newParent ==
6628 oldParent)
6629 """
54f9ee45 6630 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
6631
6632 def AddChild(*args, **kwargs):
15afbcd0 6633 """
a95a7133 6634 AddChild(self, Window child)
15afbcd0
RD
6635
6636 Adds a child window. This is called automatically by window creation
6637 functions so should not be required by the application programmer.
6638 """
54f9ee45 6639 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
6640
6641 def RemoveChild(*args, **kwargs):
15afbcd0 6642 """
a95a7133 6643 RemoveChild(self, Window child)
15afbcd0
RD
6644
6645 Removes a child window. This is called automatically by window
6646 deletion functions so should not be required by the application
6647 programmer.
6648 """
54f9ee45 6649 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce
RD
6650
6651 def FindWindowById(*args, **kwargs):
15afbcd0 6652 """
a95a7133 6653 FindWindowById(self, long winid) -> Window
15afbcd0
RD
6654
6655 Find a chld of this window by window ID
6656 """
54f9ee45 6657 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
6658
6659 def FindWindowByName(*args, **kwargs):
15afbcd0 6660 """
a95a7133 6661 FindWindowByName(self, String name) -> Window
15afbcd0
RD
6662
6663 Find a child of this window by name
6664 """
54f9ee45 6665 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
6666
6667 def GetEventHandler(*args, **kwargs):
15afbcd0 6668 """
a95a7133 6669 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
6670
6671 Returns the event handler for this window. By default, the window is
6672 its own event handler.
6673 """
54f9ee45 6674 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
6675
6676 def SetEventHandler(*args, **kwargs):
15afbcd0 6677 """
a95a7133 6678 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
6679
6680 Sets the event handler for this window. An event handler is an object
6681 that is capable of processing the events sent to a window. By default,
6682 the window is its own event handler, but an application may wish to
6683 substitute another, for example to allow central implementation of
6684 event-handling for a variety of different window classes.
6685
41e2b43e 6686 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0
RD
6687 up a chain of event handlers, where an event not handled by one event
6688 handler is handed to the next one in the chain.
6689 """
54f9ee45 6690 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
6691
6692 def PushEventHandler(*args, **kwargs):
15afbcd0 6693 """
a95a7133 6694 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
6695
6696 Pushes this event handler onto the event handler stack for the window.
6697 An event handler is an object that is capable of processing the events
6698 sent to a window. By default, the window is its own event handler, but
6699 an application may wish to substitute another, for example to allow
6700 central implementation of event-handling for a variety of different
6701 window classes.
6702
6703 wx.Window.PushEventHandler allows an application to set up a chain of
6704 event handlers, where an event not handled by one event handler is
41e2b43e 6705 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
15afbcd0
RD
6706 remove the event handler.
6707 """
54f9ee45 6708 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
6709
6710 def PopEventHandler(*args, **kwargs):
15afbcd0 6711 """
a95a7133 6712 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
6713
6714 Removes and returns the top-most event handler on the event handler
6715 stack. If deleteHandler is True then the wx.EvtHandler object will be
6716 destroyed after it is popped.
6717 """
54f9ee45 6718 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
6719
6720 def RemoveEventHandler(*args, **kwargs):
15afbcd0 6721 """
a95a7133 6722 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 6723
41e2b43e
RD
6724 Find the given handler in the event handler chain and remove (but not
6725 delete) it from the event handler chain, return True if it was found
6726 and False otherwise (this also results in an assert failure so this
6727 function should only be called when the handler is supposed to be
6728 there.)
15afbcd0 6729 """
54f9ee45 6730 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
6731
6732 def SetValidator(*args, **kwargs):
15afbcd0 6733 """
a95a7133 6734 SetValidator(self, Validator validator)
15afbcd0
RD
6735
6736 Deletes the current validator (if any) and sets the window validator,
6737 having called wx.Validator.Clone to create a new validator of this
6738 type.
6739 """
54f9ee45 6740 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
6741
6742 def GetValidator(*args, **kwargs):
15afbcd0 6743 """
a95a7133 6744 GetValidator(self) -> Validator
15afbcd0
RD
6745
6746 Returns a pointer to the current validator for the window, or None if
6747 there is none.
6748 """
54f9ee45 6749 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 6750
74a57fcd
RD
6751 def Validate(*args, **kwargs):
6752 """
a95a7133 6753 Validate(self) -> bool
74a57fcd
RD
6754
6755 Validates the current values of the child controls using their
41e2b43e
RD
6756 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6757 style flag set, the method will also call Validate() of all child
6758 windows. Returns false if any of the validations failed.
74a57fcd 6759 """
54f9ee45 6760 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
6761
6762 def TransferDataToWindow(*args, **kwargs):
6763 """
a95a7133 6764 TransferDataToWindow(self) -> bool
74a57fcd 6765
41e2b43e
RD
6766 Transfers values to child controls from data areas specified by their
6767 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6768 style flag set, the method will also call TransferDataToWindow() of
6769 all child windows.
74a57fcd 6770 """
54f9ee45 6771 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
6772
6773 def TransferDataFromWindow(*args, **kwargs):
6774 """
a95a7133 6775 TransferDataFromWindow(self) -> bool
74a57fcd 6776
41e2b43e
RD
6777 Transfers values from child controls to data areas specified by their
6778 validators. Returns false if a transfer failed. If the window has
6779 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
6780 also call TransferDataFromWindow() of all child windows.
74a57fcd 6781 """
54f9ee45 6782 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
6783
6784 def InitDialog(*args, **kwargs):
6785 """
a95a7133 6786 InitDialog(self)
74a57fcd 6787
41e2b43e
RD
6788 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
6789 to the dialog via validators.
74a57fcd 6790 """
54f9ee45 6791 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 6792
e811c8ce 6793 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 6794 """
a95a7133 6795 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
6796
6797 Sets the accelerator table for this window.
6798 """
54f9ee45 6799 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
6800
6801 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 6802 """
a95a7133 6803 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
6804
6805 Gets the accelerator table for this window.
6806 """
54f9ee45 6807 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
6808
6809 def RegisterHotKey(*args, **kwargs):
15afbcd0 6810 """
a95a7133 6811 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
6812
6813 Registers a system wide hotkey. Every time the user presses the hotkey
6814 registered here, this window will receive a hotkey event. It will
6815 receive the event even if the application is in the background and
6816 does not have the input focus because the user is working with some
6817 other application. To bind an event handler function to this hotkey
6818 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
6819 hotkey was registered successfully.
6820 """
54f9ee45 6821 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
6822
6823 def UnregisterHotKey(*args, **kwargs):
15afbcd0 6824 """
a95a7133 6825 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
6826
6827 Unregisters a system wide hotkey.
6828 """
54f9ee45 6829 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
6830
6831 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 6832 """
a95a7133 6833 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
6834
6835 Converts a point or size from dialog units to pixels. Dialog units
6836 are used for maintaining a dialog's proportions even if the font
6837 changes. For the x dimension, the dialog units are multiplied by the
6838 average character width and then divided by 4. For the y dimension,
6839 the dialog units are multiplied by the average character height and
6840 then divided by 8.
6841 """
54f9ee45 6842 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
6843
6844 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 6845 """
a95a7133 6846 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
6847
6848 Converts a point or size from dialog units to pixels. Dialog units
6849 are used for maintaining a dialog's proportions even if the font
6850 changes. For the x dimension, the dialog units are multiplied by the
6851 average character width and then divided by 4. For the y dimension,
6852 the dialog units are multiplied by the average character height and
6853 then divided by 8.
6854 """
54f9ee45 6855 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
6856
6857 def DLG_PNT(*args, **kwargs):
15afbcd0 6858 """
a95a7133 6859 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
6860
6861 Converts a point or size from dialog units to pixels. Dialog units
6862 are used for maintaining a dialog's proportions even if the font
6863 changes. For the x dimension, the dialog units are multiplied by the
6864 average character width and then divided by 4. For the y dimension,
6865 the dialog units are multiplied by the average character height and
6866 then divided by 8.
6867 """
54f9ee45 6868 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
6869
6870 def DLG_SZE(*args, **kwargs):
15afbcd0 6871 """
a95a7133 6872 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
6873
6874 Converts a point or size from dialog units to pixels. Dialog units
6875 are used for maintaining a dialog's proportions even if the font
6876 changes. For the x dimension, the dialog units are multiplied by the
6877 average character width and then divided by 4. For the y dimension,
6878 the dialog units are multiplied by the average character height and
6879 then divided by 8.
6880 """
54f9ee45 6881 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
6882
6883 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 6884 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 6885 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
6886
6887 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 6888 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 6889 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
6890
6891 def WarpPointer(*args, **kwargs):
15afbcd0 6892 """
a95a7133 6893 WarpPointer(self, int x, int y)
15afbcd0
RD
6894
6895 Moves the pointer to the given position on the window.
6896
6897 NOTE: This function is not supported under Mac because Apple Human
6898 Interface Guidelines forbid moving the mouse cursor programmatically.
6899 """
54f9ee45 6900 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
6901
6902 def CaptureMouse(*args, **kwargs):
15afbcd0 6903 """
a95a7133 6904 CaptureMouse(self)
15afbcd0
RD
6905
6906 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
6907 release the capture.
6908
6909 Note that wxWindows maintains the stack of windows having captured the
6910 mouse and when the mouse is released the capture returns to the window
6911 which had had captured it previously and it is only really released if
6912 there were no previous window. In particular, this means that you must
6913 release the mouse as many times as you capture it.
6914 """
54f9ee45 6915 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
6916
6917 def ReleaseMouse(*args, **kwargs):
15afbcd0 6918 """
a95a7133 6919 ReleaseMouse(self)
15afbcd0
RD
6920
6921 Releases mouse input captured with wx.Window.CaptureMouse.
6922 """
54f9ee45 6923 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
6924
6925 def GetCapture(*args, **kwargs):
15afbcd0 6926 """
66c033b4 6927 GetCapture() -> Window
15afbcd0
RD
6928
6929 Returns the window which currently captures the mouse or None
6930 """
54f9ee45 6931 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
6932
6933 GetCapture = staticmethod(GetCapture)
6934 def HasCapture(*args, **kwargs):
15afbcd0 6935 """
a95a7133 6936 HasCapture(self) -> bool
15afbcd0
RD
6937
6938 Returns true if this window has the current mouse capture.
6939 """
54f9ee45 6940 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
6941
6942 def Refresh(*args, **kwargs):
15afbcd0 6943 """
a95a7133 6944 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
6945
6946 Mark the specified rectangle (or the whole window) as "dirty" so it
6947 will be repainted. Causes an EVT_PAINT event to be generated and sent
6948 to the window.
6949 """
54f9ee45 6950 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
6951
6952 def RefreshRect(*args, **kwargs):
15afbcd0 6953 """
a95a7133 6954 RefreshRect(self, Rect rect)
15afbcd0
RD
6955
6956 Redraws the contents of the given rectangle: the area inside it will
6957 be repainted. This is the same as Refresh but has a nicer syntax.
6958 """
54f9ee45 6959 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
6960
6961 def Update(*args, **kwargs):
15afbcd0 6962 """
a95a7133 6963 Update(self)
15afbcd0
RD
6964
6965 Calling this method immediately repaints the invalidated area of the
6966 window instead of waiting for the EVT_PAINT event to happen, (normally
6967 this would usually only happen when the flow of control returns to the
6968 event loop.) Notice that this function doesn't refresh the window and
6969 does nothing if the window has been already repainted. Use Refresh
6970 first if you want to immediately redraw the window (or some portion of
6971 it) unconditionally.
6972 """
54f9ee45 6973 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
6974
6975 def ClearBackground(*args, **kwargs):
15afbcd0 6976 """
a95a7133 6977 ClearBackground(self)
15afbcd0
RD
6978
6979 Clears the window by filling it with the current background
6980 colour. Does not cause an erase background event to be generated.
6981 """
54f9ee45 6982 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
6983
6984 def Freeze(*args, **kwargs):
15afbcd0 6985 """
a95a7133 6986 Freeze(self)
15afbcd0 6987
41e2b43e
RD
6988 Freezes the window or, in other words, prevents any updates from
6989 taking place on screen, the window is not redrawn at all. Thaw must be
6990 called to reenable window redrawing. Calls to Freeze/Thaw may be
6991 nested, with the actual Thaw being delayed until all the nesting has
6992 been undone.
15afbcd0
RD
6993
6994 This method is useful for visual appearance optimization (for example,
6995 it is a good idea to use it before inserting large amount of text into
6996 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
6997 for all controls so it is mostly just a hint to wxWindows and not a
6998 mandatory directive.
6999 """
54f9ee45 7000 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce
RD
7001
7002 def Thaw(*args, **kwargs):
15afbcd0 7003 """
a95a7133 7004 Thaw(self)
15afbcd0 7005
4276dc52 7006 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
7007 Freeze/Thaw may be nested, so Thaw must be called the same number of
7008 times that Freeze was before the window will be updated.
15afbcd0 7009 """
54f9ee45 7010 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
7011
7012 def PrepareDC(*args, **kwargs):
15afbcd0 7013 """
a95a7133 7014 PrepareDC(self, DC dc)
15afbcd0
RD
7015
7016 Call this function to prepare the device context for drawing a
7017 scrolled image. It sets the device origin according to the current
7018 scroll position.
7019 """
54f9ee45 7020 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce
RD
7021
7022 def GetUpdateRegion(*args, **kwargs):
15afbcd0 7023 """
a95a7133 7024 GetUpdateRegion(self) -> Region
15afbcd0
RD
7025
7026 Returns the region specifying which parts of the window have been
7027 damaged. Should only be called within an EVT_PAINT handler.
7028 """
54f9ee45 7029 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
7030
7031 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 7032 """
a95a7133 7033 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
7034
7035 Get the update rectangle region bounding box in client coords.
7036 """
54f9ee45 7037 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
7038
7039 def IsExposed(*args, **kwargs):
15afbcd0 7040 """
a95a7133 7041 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
7042
7043 Returns true if the given point or rectangle area has been exposed
7044 since the last repaint. Call this in an paint event handler to
7045 optimize redrawing by only redrawing those areas, which have been
7046 exposed.
7047 """
54f9ee45 7048 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
7049
7050 def IsExposedPoint(*args, **kwargs):
15afbcd0 7051 """
a95a7133 7052 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
7053
7054 Returns true if the given point or rectangle area has been exposed
7055 since the last repaint. Call this in an paint event handler to
7056 optimize redrawing by only redrawing those areas, which have been
7057 exposed.
7058 """
54f9ee45 7059 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 7060
4276dc52 7061 def IsExposedRect(*args, **kwargs):
15afbcd0 7062 """
a95a7133 7063 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
7064
7065 Returns true if the given point or rectangle area has been exposed
7066 since the last repaint. Call this in an paint event handler to
7067 optimize redrawing by only redrawing those areas, which have been
7068 exposed.
7069 """
54f9ee45 7070 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 7071
74a57fcd
RD
7072 def GetDefaultAttributes(*args, **kwargs):
7073 """
a95a7133 7074 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 7075
41e2b43e
RD
7076 Get the default attributes for an instance of this class. This is
7077 useful if you want to use the same font or colour in your own control
7078 as in a standard control -- which is a much better idea than hard
7079 coding specific colours or fonts which might look completely out of
db3e571a 7080 place on the user's system, especially if it uses themes.
74a57fcd 7081 """
54f9ee45 7082 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
7083
7084 def GetClassDefaultAttributes(*args, **kwargs):
7085 """
66c033b4 7086 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 7087
41e2b43e
RD
7088 Get the default attributes for this class. This is useful if you want
7089 to use the same font or colour in your own control as in a standard
7090 control -- which is a much better idea than hard coding specific
db3e571a
RD
7091 colours or fonts which might look completely out of place on the
7092 user's system, especially if it uses themes.
74a57fcd
RD
7093
7094 The variant parameter is only relevant under Mac currently and is
41e2b43e 7095 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
7096 the returned font. See `wx.Window.SetWindowVariant` for more about
7097 this.
74a57fcd 7098 """
54f9ee45 7099 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
7100
7101 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 7102 def SetBackgroundColour(*args, **kwargs):
15afbcd0 7103 """
a95a7133 7104 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
7105
7106 Sets the background colour of the window. Returns True if the colour
7107 was changed. The background colour is usually painted by the default
7108 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
7109 automatically under GTK. Using `wx.NullColour` will reset the window
7110 to the default background colour.
15afbcd0 7111
db3e571a 7112 Note that setting the background colour may not cause an immediate
f8167d6e 7113 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
7114 calling this function.
7115
f8167d6e
RD
7116 Using this function will disable attempts to use themes for this
7117 window, if the system supports them. Use with care since usually the
7118 themes represent the appearance chosen by the user to be used for all
7119 applications on the system.
15afbcd0 7120 """
54f9ee45 7121 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 7122
412d302d
RD
7123 def SetOwnBackgroundColour(*args, **kwargs):
7124 """SetOwnBackgroundColour(self, Colour colour)"""
7125 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 7126
e811c8ce 7127 def SetForegroundColour(*args, **kwargs):
15afbcd0 7128 """
a95a7133 7129 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
7130
7131 Sets the foreground colour of the window. Returns True is the colour
7132 was changed. The interpretation of foreground colour is dependent on
7133 the window class; it may be the text colour or other colour, or it may
7134 not be used at all.
7135 """
54f9ee45 7136 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 7137
fa47d7a7
VS
7138 def SetOwnForegroundColour(*args, **kwargs):
7139 """SetOwnForegroundColour(self, Colour colour)"""
7140 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 7141
e811c8ce 7142 def GetBackgroundColour(*args, **kwargs):
15afbcd0 7143 """
a95a7133 7144 GetBackgroundColour(self) -> Colour
15afbcd0
RD
7145
7146 Returns the background colour of the window.
7147 """
54f9ee45 7148 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
7149
7150 def GetForegroundColour(*args, **kwargs):
15afbcd0 7151 """
a95a7133 7152 GetForegroundColour(self) -> Colour
15afbcd0
RD
7153
7154 Returns the foreground colour of the window. The interpretation of
7155 foreground colour is dependent on the window class; it may be the text
7156 colour or other colour, or it may not be used at all.
7157 """
54f9ee45 7158 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 7159
7bc1e663
RD
7160 def SetBackgroundStyle(*args, **kwargs):
7161 """
7162 SetBackgroundStyle(self, int style) -> bool
7163
7164 Returns the background style of the window. The background style
7165 indicates how the background of the window is drawn.
7166
7167 ====================== ========================================
7168 wx.BG_STYLE_SYSTEM The background colour or pattern should
7169 be determined by the system
7170 wx.BG_STYLE_COLOUR The background should be a solid colour
7171 wx.BG_STYLE_CUSTOM The background will be implemented by the
7172 application.
7173 ====================== ========================================
7174
7175 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
7176 a custom background, such as a tiled bitmap. Currently the style has
7177 no effect on other platforms.
7178
7179 :see: `GetBackgroundStyle`, `SetBackgroundColour`
7180 """
7181 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
7182
7183 def GetBackgroundStyle(*args, **kwargs):
7184 """
7185 GetBackgroundStyle(self) -> int
7186
7187 Returns the background style of the window.
7188
7189 :see: `SetBackgroundStyle`
7190 """
7191 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
7192
e811c8ce 7193 def SetCursor(*args, **kwargs):
15afbcd0 7194 """
a95a7133 7195 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
7196
7197 Sets the window's cursor. Notice that the window cursor also sets it
7198 for the children of the window implicitly.
7199
7200 The cursor may be wx.NullCursor in which case the window cursor will
7201 be reset back to default.
7202 """
54f9ee45 7203 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
7204
7205 def GetCursor(*args, **kwargs):
15afbcd0 7206 """
a95a7133 7207 GetCursor(self) -> Cursor
15afbcd0
RD
7208
7209 Return the cursor associated with this window.
7210 """
54f9ee45 7211 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
7212
7213 def SetFont(*args, **kwargs):
15afbcd0 7214 """
a95a7133 7215 SetFont(self, Font font) -> bool
15afbcd0
RD
7216
7217 Sets the font for this window.
7218 """
54f9ee45 7219 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 7220
fa47d7a7
VS
7221 def SetOwnFont(*args, **kwargs):
7222 """SetOwnFont(self, Font font)"""
7223 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 7224
e811c8ce 7225 def GetFont(*args, **kwargs):
15afbcd0 7226 """
a95a7133 7227 GetFont(self) -> Font
15afbcd0 7228
4276dc52 7229 Returns the default font used for this window.
15afbcd0 7230 """
54f9ee45 7231 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
7232
7233 def SetCaret(*args, **kwargs):
15afbcd0 7234 """
a95a7133 7235 SetCaret(self, Caret caret)
15afbcd0
RD
7236
7237 Sets the caret associated with the window.
7238 """
54f9ee45 7239 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
7240
7241 def GetCaret(*args, **kwargs):
15afbcd0 7242 """
a95a7133 7243 GetCaret(self) -> Caret
15afbcd0
RD
7244
7245 Returns the caret associated with the window.
7246 """
54f9ee45 7247 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
7248
7249 def GetCharHeight(*args, **kwargs):
15afbcd0 7250 """
a95a7133 7251 GetCharHeight(self) -> int
15afbcd0
RD
7252
7253 Get the (average) character size for the current font.
7254 """
54f9ee45 7255 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
7256
7257 def GetCharWidth(*args, **kwargs):
15afbcd0 7258 """
a95a7133 7259 GetCharWidth(self) -> int
15afbcd0
RD
7260
7261 Get the (average) character size for the current font.
7262 """
54f9ee45 7263 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
7264
7265 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
7266 """
7267 GetTextExtent(String string) -> (width, height)
7268
7269 Get the width and height of the text using the current font.
7270 """
54f9ee45 7271 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
7272
7273 def GetFullTextExtent(*args, **kwargs):
0df68c9f 7274 """
196addbf 7275 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 7276 (width, height, descent, externalLeading)
e811c8ce 7277
15afbcd0
RD
7278 Get the width, height, decent and leading of the text using the
7279 current or specified font.
0df68c9f 7280 """
54f9ee45 7281 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
7282
7283 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
7284 """
7285 ClientToScreenXY(int x, int y) -> (x,y)
7286
7287 Converts to screen coordinates from coordinates relative to this window.
7288 """
54f9ee45 7289 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
7290
7291 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
7292 """
7293 ScreenToClientXY(int x, int y) -> (x,y)
7294
7295 Converts from screen to client window coordinates.
7296 """
54f9ee45 7297 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
7298
7299 def ClientToScreen(*args, **kwargs):
15afbcd0 7300 """
a95a7133 7301 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
7302
7303 Converts to screen coordinates from coordinates relative to this window.
7304 """
54f9ee45 7305 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
7306
7307 def ScreenToClient(*args, **kwargs):
15afbcd0 7308 """
a95a7133 7309 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
7310
7311 Converts from screen to client window coordinates.
7312 """
54f9ee45 7313 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
7314
7315 def HitTestXY(*args, **kwargs):
15afbcd0 7316 """
a95a7133 7317 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
7318
7319 Test where the given (in client coords) point lies
7320 """
54f9ee45 7321 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
7322
7323 def HitTest(*args, **kwargs):
15afbcd0 7324 """
a95a7133 7325 HitTest(self, Point pt) -> int
15afbcd0
RD
7326
7327 Test where the given (in client coords) point lies
7328 """
54f9ee45 7329 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 7330
15afbcd0
RD
7331 def GetBorder(*args):
7332 """
a95a7133
RD
7333 GetBorder(self, long flags) -> int
7334 GetBorder(self) -> int
e811c8ce 7335
15afbcd0
RD
7336 Get border for the flags of this window
7337 """
54f9ee45 7338 return _core_.Window_GetBorder(*args)
e811c8ce
RD
7339
7340 def UpdateWindowUI(*args, **kwargs):
15afbcd0 7341 """
a95a7133 7342 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
7343
7344 This function sends EVT_UPDATE_UI events to the window. The particular
7345 implementation depends on the window; for example a wx.ToolBar will
7346 send an update UI event for each toolbar button, and a wx.Frame will
7347 send an update UI event for each menubar menu item. You can call this
7348 function from your application to ensure that your UI is up-to-date at
7349 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7350 concerned). This may be necessary if you have called
7351 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7352 limit the overhead that wxWindows incurs by sending update UI events
7353 in idle time.
15afbcd0 7354 """
54f9ee45 7355 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
7356
7357 def PopupMenuXY(*args, **kwargs):
15afbcd0 7358 """
b0503257 7359 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 7360
b0503257
RD
7361 Pops up the given menu at the specified coordinates, relative to this window,
7362 and returns control when the user has dismissed the menu. If a menu item is
7363 selected, the corresponding menu event is generated and will be processed as
7364 usual. If the default position is given then the current position of the
7365 mouse cursor will be used.
15afbcd0 7366 """
54f9ee45 7367 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 7368
15afbcd0
RD
7369 def PopupMenu(*args, **kwargs):
7370 """
b0503257 7371 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 7372
b0503257
RD
7373 Pops up the given menu at the specified coordinates, relative to this window,
7374 and returns control when the user has dismissed the menu. If a menu item is
7375 selected, the corresponding menu event is generated and will be processed as
7376 usual. If the default position is given then the current position of the
7377 mouse cursor will be used.
15afbcd0 7378 """
54f9ee45 7379 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0
RD
7380
7381 def GetHandle(*args, **kwargs):
7382 """
a95a7133 7383 GetHandle(self) -> long
15afbcd0
RD
7384
7385 Returns the platform-specific handle (as a long integer) of the
7386 physical window. Currently on wxMac it returns the handle of the
7387 toplevel parent of the window.
7388 """
54f9ee45 7389 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 7390
7e63a440
RD
7391 def AssociateHandle(*args, **kwargs):
7392 """
7393 AssociateHandle(self, long handle)
7394
7395 Associate the window with a new native handle
7396 """
7397 return _core_.Window_AssociateHandle(*args, **kwargs)
7398
7399 def DissociateHandle(*args, **kwargs):
7400 """
7401 DissociateHandle(self)
7402
7403 Dissociate the current native handle from the window
7404 """
7405 return _core_.Window_DissociateHandle(*args, **kwargs)
7406
15afbcd0
RD
7407 def HasScrollbar(*args, **kwargs):
7408 """
a95a7133 7409 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
7410
7411 Does the window have the scrollbar for this orientation?
7412 """
54f9ee45 7413 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
7414
7415 def SetScrollbar(*args, **kwargs):
7416 """
41e2b43e 7417 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
7418 bool refresh=True)
7419
7420 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 7421 """
54f9ee45 7422 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
7423
7424 def SetScrollPos(*args, **kwargs):
15afbcd0 7425 """
a95a7133 7426 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
7427
7428 Sets the position of one of the built-in scrollbars.
7429 """
54f9ee45 7430 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
7431
7432 def GetScrollPos(*args, **kwargs):
15afbcd0 7433 """
a95a7133 7434 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
7435
7436 Returns the built-in scrollbar position.
7437 """
54f9ee45 7438 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
7439
7440 def GetScrollThumb(*args, **kwargs):
15afbcd0 7441 """
a95a7133 7442 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
7443
7444 Returns the built-in scrollbar thumb size.
7445 """
54f9ee45 7446 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
7447
7448 def GetScrollRange(*args, **kwargs):
15afbcd0 7449 """
a95a7133 7450 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
7451
7452 Returns the built-in scrollbar range.
7453 """
54f9ee45 7454 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
7455
7456 def ScrollWindow(*args, **kwargs):
15afbcd0 7457 """
a95a7133 7458 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
7459
7460 Physically scrolls the pixels in the window and move child windows
7461 accordingly. Use this function to optimise your scrolling
7462 implementations, to minimise the area that must be redrawn. Note that
7463 it is rarely required to call this function from a user program.
15afbcd0 7464 """
54f9ee45 7465 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
7466
7467 def ScrollLines(*args, **kwargs):
15afbcd0 7468 """
a95a7133 7469 ScrollLines(self, int lines) -> bool
15afbcd0
RD
7470
7471 If the platform and window class supports it, scrolls the window by
7472 the given number of lines down, if lines is positive, or up if lines
7473 is negative. Returns True if the window was scrolled, False if it was
7474 already on top/bottom and nothing was done.
7475 """
54f9ee45 7476 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
7477
7478 def ScrollPages(*args, **kwargs):
15afbcd0 7479 """
a95a7133 7480 ScrollPages(self, int pages) -> bool
15afbcd0 7481
41e2b43e 7482 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
7483 the given number of pages down, if pages is positive, or up if pages
7484 is negative. Returns True if the window was scrolled, False if it was
7485 already on top/bottom and nothing was done.
7486 """
54f9ee45 7487 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
7488
7489 def LineUp(*args, **kwargs):
15afbcd0 7490 """
a95a7133 7491 LineUp(self) -> bool
15afbcd0
RD
7492
7493 This is just a wrapper for ScrollLines(-1).
7494 """
54f9ee45 7495 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
7496
7497 def LineDown(*args, **kwargs):
15afbcd0 7498 """
a95a7133 7499 LineDown(self) -> bool
15afbcd0
RD
7500
7501 This is just a wrapper for ScrollLines(1).
7502 """
54f9ee45 7503 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
7504
7505 def PageUp(*args, **kwargs):
15afbcd0 7506 """
a95a7133 7507 PageUp(self) -> bool
15afbcd0
RD
7508
7509 This is just a wrapper for ScrollPages(-1).
7510 """
54f9ee45 7511 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
7512
7513 def PageDown(*args, **kwargs):
15afbcd0 7514 """
a95a7133 7515 PageDown(self) -> bool
15afbcd0
RD
7516
7517 This is just a wrapper for ScrollPages(1).
7518 """
54f9ee45 7519 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
7520
7521 def SetHelpText(*args, **kwargs):
15afbcd0 7522 """
a95a7133 7523 SetHelpText(self, String text)
15afbcd0
RD
7524
7525 Sets the help text to be used as context-sensitive help for this
7526 window. Note that the text is actually stored by the current
7527 wxHelpProvider implementation, and not in the window object itself.
7528 """
54f9ee45 7529 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
7530
7531 def SetHelpTextForId(*args, **kwargs):
15afbcd0 7532 """
a95a7133 7533 SetHelpTextForId(self, String text)
15afbcd0
RD
7534
7535 Associate this help text with all windows with the same id as this
7536 one.
7537 """
54f9ee45 7538 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce
RD
7539
7540 def GetHelpText(*args, **kwargs):
15afbcd0 7541 """
a95a7133 7542 GetHelpText(self) -> String
15afbcd0
RD
7543
7544 Gets the help text to be used as context-sensitive help for this
7545 window. Note that the text is actually stored by the current
7546 wxHelpProvider implementation, and not in the window object itself.
7547 """
54f9ee45 7548 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
7549
7550 def SetToolTipString(*args, **kwargs):
15afbcd0 7551 """
a95a7133 7552 SetToolTipString(self, String tip)
15afbcd0
RD
7553
7554 Attach a tooltip to the window.
7555 """
54f9ee45 7556 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
7557
7558 def SetToolTip(*args, **kwargs):
15afbcd0 7559 """
a95a7133 7560 SetToolTip(self, ToolTip tip)
15afbcd0
RD
7561
7562 Attach a tooltip to the window.
7563 """
54f9ee45 7564 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
7565
7566 def GetToolTip(*args, **kwargs):
15afbcd0 7567 """
a95a7133 7568 GetToolTip(self) -> ToolTip
15afbcd0
RD
7569
7570 get the associated tooltip or None if none
7571 """
54f9ee45 7572 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
7573
7574 def SetDropTarget(*args, **kwargs):
15afbcd0 7575 """
a95a7133 7576 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
7577
7578 Associates a drop target with this window. If the window already has
7579 a drop target, it is deleted.
7580 """
54f9ee45 7581 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
7582
7583 def GetDropTarget(*args, **kwargs):
15afbcd0 7584 """
a95a7133 7585 GetDropTarget(self) -> DropTarget
15afbcd0
RD
7586
7587 Returns the associated drop target, which may be None.
7588 """
54f9ee45 7589 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce
RD
7590
7591 def SetConstraints(*args, **kwargs):
15afbcd0 7592 """
a95a7133 7593 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
7594
7595 Sets the window to have the given layout constraints. If an existing
7596 layout constraints object is already owned by the window, it will be
7597 deleted. Pass None to disassociate and delete the window's current
7598 constraints.
7599
7600 You must call SetAutoLayout to tell a window to use the constraints
7601 automatically in its default EVT_SIZE handler; otherwise, you must
7602 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7603 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7604 effect.
7605 """
54f9ee45 7606 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
7607
7608 def GetConstraints(*args, **kwargs):
15afbcd0 7609 """
a95a7133 7610 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
7611
7612 Returns a pointer to the window's layout constraints, or None if there
7613 are none.
7614 """
54f9ee45 7615 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
7616
7617 def SetAutoLayout(*args, **kwargs):
15afbcd0 7618 """
a95a7133 7619 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
7620
7621 Determines whether the Layout function will be called automatically
7622 when the window is resized. It is called implicitly by SetSizer but
7623 if you use SetConstraints you should call it manually or otherwise the
7624 window layout won't be correctly updated when its size changes.
7625 """
54f9ee45 7626 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
7627
7628 def GetAutoLayout(*args, **kwargs):
15afbcd0 7629 """
a95a7133 7630 GetAutoLayout(self) -> bool
15afbcd0
RD
7631
7632 Returns the current autoLayout setting
7633 """
54f9ee45 7634 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
7635
7636 def Layout(*args, **kwargs):
15afbcd0 7637 """
a95a7133 7638 Layout(self) -> bool
15afbcd0
RD
7639
7640 Invokes the constraint-based layout algorithm or the sizer-based
7641 algorithm for this window. See SetAutoLayout: when auto layout is on,
7642 this function gets called automatically by the default EVT_SIZE
7643 handler when the window is resized.
7644 """
54f9ee45 7645 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
7646
7647 def SetSizer(*args, **kwargs):
15afbcd0 7648 """
a95a7133 7649 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
7650
7651 Sets the window to have the given layout sizer. The window will then
7652 own the object, and will take care of its deletion. If an existing
7653 layout sizer object is already owned by the window, it will be deleted
7654 if the deleteOld parameter is true. Note that this function will also
7655 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 7656 non-None, and False otherwise.
15afbcd0 7657 """
54f9ee45 7658 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
7659
7660 def SetSizerAndFit(*args, **kwargs):
15afbcd0 7661 """
a95a7133 7662 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
7663
7664 The same as SetSizer, except it also sets the size hints for the
7665 window based on the sizer's minimum size.
7666 """
54f9ee45 7667 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
7668
7669 def GetSizer(*args, **kwargs):
15afbcd0 7670 """
a95a7133 7671 GetSizer(self) -> Sizer
15afbcd0
RD
7672
7673 Return the sizer associated with the window by a previous call to
7674 SetSizer or None if there isn't one.
7675 """
54f9ee45 7676 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
7677
7678 def SetContainingSizer(*args, **kwargs):
15afbcd0 7679 """
a95a7133 7680 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
7681
7682 This normally does not need to be called by application code. It is
7683 called internally when a window is added to a sizer, and is used so
7684 the window can remove itself from the sizer when it is destroyed.
7685 """
54f9ee45 7686 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
7687
7688 def GetContainingSizer(*args, **kwargs):
15afbcd0 7689 """
a95a7133 7690 GetContainingSizer(self) -> Sizer
15afbcd0
RD
7691
7692 Return the sizer that this window is a member of, if any, otherwise None.
7693 """
54f9ee45 7694 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 7695
a95a7133
RD
7696 def InheritAttributes(*args, **kwargs):
7697 """
7698 InheritAttributes(self)
7699
41e2b43e
RD
7700 This function is (or should be, in case of custom controls) called
7701 during window creation to intelligently set up the window visual
7702 attributes, that is the font and the foreground and background
7703 colours.
7704
7705 By 'intelligently' the following is meant: by default, all windows use
7706 their own default attributes. However if some of the parent's
7707 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 7708 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
7709 explicitly set for this window itself, then this window takes the same
7710 value as used by the parent. In addition, if the window overrides
7711 ShouldInheritColours to return false, the colours will not be changed
7712 no matter what and only the font might.
7713
34621cc5 7714 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 7715 different usage scenarios. The most common one is when all default
41e2b43e
RD
7716 attributes are used and in this case, nothing should be inherited as
7717 in modern GUIs different controls use different fonts (and colours)
7718 than their siblings so they can't inherit the same value from the
7719 parent. However it was also deemed desirable to allow to simply change
7720 the attributes of all children at once by just changing the font or
7721 colour of their common parent, hence in this case we do inherit the
7722 parents attributes.
7723
a95a7133 7724 """
54f9ee45 7725 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
7726
7727 def ShouldInheritColours(*args, **kwargs):
7728 """
7729 ShouldInheritColours(self) -> bool
7730
7731 Return true from here to allow the colours of this window to be
41e2b43e
RD
7732 changed by InheritAttributes, returning false forbids inheriting them
7733 from the parent window.
a95a7133 7734
41e2b43e
RD
7735 The base class version returns false, but this method is overridden in
7736 wxControl where it returns true.
a95a7133 7737 """
54f9ee45 7738 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 7739
e811c8ce 7740 def PostCreate(self, pre):
15afbcd0
RD
7741 """
7742 Phase 3 of the 2-phase create <wink!>
7743 Call this method after precreating the window with the 2-phase create method.
7744 """
e811c8ce
RD
7745 self.this = pre.this
7746 self.thisown = pre.thisown
7747 pre.thisown = 0
7748 if hasattr(self, '_setOORInfo'):
7749 self._setOORInfo(self)
7750 if hasattr(self, '_setCallbackInfo'):
7751 self._setCallbackInfo(self, self.__class__)
7752
7753
7754class WindowPtr(Window):
7755 def __init__(self, this):
7756 self.this = this
7757 if not hasattr(self,"thisown"): self.thisown = 0
7758 self.__class__ = Window
54f9ee45 7759_core_.Window_swigregister(WindowPtr)
e811c8ce
RD
7760
7761def PreWindow(*args, **kwargs):
15afbcd0
RD
7762 """
7763 PreWindow() -> Window
7764
7765 Precreate a Window for 2-phase creation.
7766 """
54f9ee45 7767 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
7768 val.thisown = 1
7769 return val
7770
7771def Window_NewControlId(*args, **kwargs):
15afbcd0
RD
7772 """
7773 Window_NewControlId() -> int
7774
7775 Generate a control id for the controls which were not given one.
7776 """
54f9ee45 7777 return _core_.Window_NewControlId(*args, **kwargs)
e811c8ce
RD
7778
7779def Window_NextControlId(*args, **kwargs):
15afbcd0
RD
7780 """
7781 Window_NextControlId(int winid) -> int
7782
7783 Get the id of the control following the one with the given
41e2b43e 7784 autogenerated) id
15afbcd0 7785 """
54f9ee45 7786 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
7787
7788def Window_PrevControlId(*args, **kwargs):
15afbcd0
RD
7789 """
7790 Window_PrevControlId(int winid) -> int
7791
7792 Get the id of the control preceding the one with the given
41e2b43e 7793 autogenerated) id
15afbcd0 7794 """
54f9ee45 7795 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce
RD
7796
7797def Window_FindFocus(*args, **kwargs):
15afbcd0
RD
7798 """
7799 Window_FindFocus() -> Window
7800
7801 Returns the window or control that currently has the keyboard focus,
7802 or None.
7803 """
54f9ee45 7804 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
7805
7806def Window_GetCapture(*args, **kwargs):
15afbcd0
RD
7807 """
7808 Window_GetCapture() -> Window
7809
7810 Returns the window which currently captures the mouse or None
7811 """
54f9ee45 7812 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce 7813
74a57fcd
RD
7814def Window_GetClassDefaultAttributes(*args, **kwargs):
7815 """
7816 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7817
41e2b43e
RD
7818 Get the default attributes for this class. This is useful if you want
7819 to use the same font or colour in your own control as in a standard
7820 control -- which is a much better idea than hard coding specific
db3e571a
RD
7821 colours or fonts which might look completely out of place on the
7822 user's system, especially if it uses themes.
74a57fcd
RD
7823
7824 The variant parameter is only relevant under Mac currently and is
41e2b43e 7825 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
7826 the returned font. See `wx.Window.SetWindowVariant` for more about
7827 this.
74a57fcd 7828 """
54f9ee45 7829 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 7830
e811c8ce 7831def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
7832 """
7833 Convenience function for converting a Point or (x,y) in
7834 dialog units to pixel units.
7835 """
e811c8ce
RD
7836 if y is None:
7837 return win.ConvertDialogPointToPixels(point_or_x)
7838 else:
fd3f2efe 7839 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
7840
7841def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
7842 """
7843 Convenience function for converting a Size or (w,h) in
7844 dialog units to pixel units.
7845 """
e811c8ce
RD
7846 if height is None:
7847 return win.ConvertDialogSizeToPixels(size_width)
7848 else:
fd3f2efe 7849 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
7850
7851
7852def FindWindowById(*args, **kwargs):
15afbcd0
RD
7853 """
7854 FindWindowById(long id, Window parent=None) -> Window
7855
7856 Find the first window in the application with the given id. If parent
7857 is None, the search will start from all top-level frames and dialog
7858 boxes; if non-None, the search will be limited to the given window
7859 hierarchy. The search is recursive in both cases.
7860 """
54f9ee45 7861 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
7862
7863def FindWindowByName(*args, **kwargs):
15afbcd0
RD
7864 """
7865 FindWindowByName(String name, Window parent=None) -> Window
7866
7867 Find a window by its name (as given in a window constructor or Create
7868 function call). If parent is None, the search will start from all
7869 top-level frames and dialog boxes; if non-None, the search will be
7870 limited to the given window hierarchy. The search is recursive in both
7871 cases.
7872
7873 If no window with such name is found, wx.FindWindowByLabel is called.
7874 """
54f9ee45 7875 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
7876
7877def FindWindowByLabel(*args, **kwargs):
15afbcd0
RD
7878 """
7879 FindWindowByLabel(String label, Window parent=None) -> Window
7880
7881 Find a window by its label. Depending on the type of window, the label
7882 may be a window title or panel item label. If parent is None, the
7883 search will start from all top-level frames and dialog boxes; if
7884 non-None, the search will be limited to the given window
7885 hierarchy. The search is recursive in both cases.
7886 """
54f9ee45 7887 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
7888
7889def Window_FromHWND(*args, **kwargs):
4276dc52 7890 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
54f9ee45 7891 return _core_.Window_FromHWND(*args, **kwargs)
e811c8ce
RD
7892#---------------------------------------------------------------------------
7893
7894class Validator(EvtHandler):
e811c8ce
RD
7895 def __repr__(self):
7896 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7897 def __init__(self, *args, **kwargs):
a95a7133 7898 """__init__(self) -> Validator"""
54f9ee45 7899 newobj = _core_.new_Validator(*args, **kwargs)
d14a1e28
RD
7900 self.this = newobj.this
7901 self.thisown = 1
7902 del newobj.thisown
7903 self._setOORInfo(self)
e811c8ce
RD
7904
7905 def Clone(*args, **kwargs):
a95a7133 7906 """Clone(self) -> Validator"""
54f9ee45 7907 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
7908
7909 def Validate(*args, **kwargs):
a95a7133 7910 """Validate(self, Window parent) -> bool"""
54f9ee45 7911 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
7912
7913 def TransferToWindow(*args, **kwargs):
a95a7133 7914 """TransferToWindow(self) -> bool"""
54f9ee45 7915 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
7916
7917 def TransferFromWindow(*args, **kwargs):
a95a7133 7918 """TransferFromWindow(self) -> bool"""
54f9ee45 7919 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
7920
7921 def GetWindow(*args, **kwargs):
a95a7133 7922 """GetWindow(self) -> Window"""
54f9ee45 7923 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
7924
7925 def SetWindow(*args, **kwargs):
a95a7133 7926 """SetWindow(self, Window window)"""
54f9ee45 7927 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
7928
7929 def IsSilent(*args, **kwargs):
66c033b4 7930 """IsSilent() -> bool"""
54f9ee45 7931 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
7932
7933 IsSilent = staticmethod(IsSilent)
7934 def SetBellOnError(*args, **kwargs):
66c033b4 7935 """SetBellOnError(int doIt=True)"""
54f9ee45 7936 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
7937
7938 SetBellOnError = staticmethod(SetBellOnError)
7939
7940class ValidatorPtr(Validator):
7941 def __init__(self, this):
7942 self.this = this
7943 if not hasattr(self,"thisown"): self.thisown = 0
7944 self.__class__ = Validator
54f9ee45 7945_core_.Validator_swigregister(ValidatorPtr)
e811c8ce
RD
7946
7947def Validator_IsSilent(*args, **kwargs):
7948 """Validator_IsSilent() -> bool"""
54f9ee45 7949 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
7950
7951def Validator_SetBellOnError(*args, **kwargs):
7952 """Validator_SetBellOnError(int doIt=True)"""
54f9ee45 7953 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
7954
7955class PyValidator(Validator):
e811c8ce
RD
7956 def __repr__(self):
7957 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7958 def __init__(self, *args, **kwargs):
a95a7133 7959 """__init__(self) -> PyValidator"""
54f9ee45 7960 newobj = _core_.new_PyValidator(*args, **kwargs)
e811c8ce
RD
7961 self.this = newobj.this
7962 self.thisown = 1
7963 del newobj.thisown
7964
7965 self._setCallbackInfo(self, PyValidator, 1)
7966 self._setOORInfo(self)
7967
7968 def _setCallbackInfo(*args, **kwargs):
a95a7133 7969 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
54f9ee45 7970 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
7971
7972
7973class PyValidatorPtr(PyValidator):
7974 def __init__(self, this):
7975 self.this = this
7976 if not hasattr(self,"thisown"): self.thisown = 0
7977 self.__class__ = PyValidator
54f9ee45 7978_core_.PyValidator_swigregister(PyValidatorPtr)
e811c8ce
RD
7979
7980#---------------------------------------------------------------------------
7981
7982class Menu(EvtHandler):
d14a1e28
RD
7983 def __repr__(self):
7984 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 7985 def __init__(self, *args, **kwargs):
a95a7133 7986 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
54f9ee45 7987 newobj = _core_.new_Menu(*args, **kwargs)
e811c8ce
RD
7988 self.this = newobj.this
7989 self.thisown = 1
7990 del newobj.thisown
7991 self._setOORInfo(self)
7992
7993 def Append(*args, **kwargs):
a95a7133 7994 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 7995 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
7996
7997 def AppendSeparator(*args, **kwargs):
a95a7133 7998 """AppendSeparator(self) -> MenuItem"""
54f9ee45 7999 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
8000
8001 def AppendCheckItem(*args, **kwargs):
a95a7133 8002 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8003 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
8004
8005 def AppendRadioItem(*args, **kwargs):
a95a7133 8006 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8007 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
8008
8009 def AppendMenu(*args, **kwargs):
a95a7133 8010 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 8011 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce
RD
8012
8013 def AppendItem(*args, **kwargs):
a95a7133 8014 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 8015 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce
RD
8016
8017 def Break(*args, **kwargs):
a95a7133 8018 """Break(self)"""
54f9ee45 8019 return _core_.Menu_Break(*args, **kwargs)
e811c8ce
RD
8020
8021 def InsertItem(*args, **kwargs):
a95a7133 8022 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 8023 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce
RD
8024
8025 def Insert(*args, **kwargs):
0df68c9f 8026 """
a95a7133 8027 Insert(self, size_t pos, int id, String text, String help=EmptyString,
a41e16b6 8028 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 8029 """
54f9ee45 8030 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
8031
8032 def InsertSeparator(*args, **kwargs):
a95a7133 8033 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 8034 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
8035
8036 def InsertCheckItem(*args, **kwargs):
a95a7133 8037 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8038 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
8039
8040 def InsertRadioItem(*args, **kwargs):
a95a7133 8041 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8042 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
8043
8044 def InsertMenu(*args, **kwargs):
a95a7133 8045 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 8046 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce
RD
8047
8048 def PrependItem(*args, **kwargs):
a95a7133 8049 """PrependItem(self, MenuItem item) -> MenuItem"""
54f9ee45 8050 return _core_.Menu_PrependItem(*args, **kwargs)
e811c8ce
RD
8051
8052 def Prepend(*args, **kwargs):
a95a7133 8053 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 8054 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
8055
8056 def PrependSeparator(*args, **kwargs):
a95a7133 8057 """PrependSeparator(self) -> MenuItem"""
54f9ee45 8058 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
8059
8060 def PrependCheckItem(*args, **kwargs):
a95a7133 8061 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8062 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
8063
8064 def PrependRadioItem(*args, **kwargs):
a95a7133 8065 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8066 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
8067
8068 def PrependMenu(*args, **kwargs):
a95a7133 8069 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 8070 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
8071
8072 def Remove(*args, **kwargs):
a95a7133 8073 """Remove(self, int id) -> MenuItem"""
54f9ee45 8074 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce
RD
8075
8076 def RemoveItem(*args, **kwargs):
a95a7133 8077 """RemoveItem(self, MenuItem item) -> MenuItem"""
54f9ee45 8078 return _core_.Menu_RemoveItem(*args, **kwargs)
e811c8ce
RD
8079
8080 def Delete(*args, **kwargs):
a95a7133 8081 """Delete(self, int id) -> bool"""
54f9ee45 8082 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
8083
8084 def DeleteItem(*args, **kwargs):
a95a7133 8085 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 8086 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
8087
8088 def Destroy(*args, **kwargs):
0df68c9f 8089 """
a95a7133 8090 Destroy(self)
e811c8ce 8091
0df68c9f
RD
8092 Deletes the C++ object this Python object is a proxy for.
8093 """
54f9ee45 8094 return _core_.Menu_Destroy(*args, **kwargs)
e811c8ce
RD
8095
8096 def DestroyId(*args, **kwargs):
0df68c9f 8097 """
a95a7133 8098 DestroyId(self, int id) -> bool
e811c8ce 8099
0df68c9f
RD
8100 Deletes the C++ object this Python object is a proxy for.
8101 """
54f9ee45 8102 return _core_.Menu_DestroyId(*args, **kwargs)
e811c8ce
RD
8103
8104 def DestroyItem(*args, **kwargs):
0df68c9f 8105 """
a95a7133 8106 DestroyItem(self, MenuItem item) -> bool
e811c8ce 8107
0df68c9f
RD
8108 Deletes the C++ object this Python object is a proxy for.
8109 """
54f9ee45 8110 return _core_.Menu_DestroyItem(*args, **kwargs)
e811c8ce
RD
8111
8112 def GetMenuItemCount(*args, **kwargs):
a95a7133 8113 """GetMenuItemCount(self) -> size_t"""
54f9ee45 8114 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
8115
8116 def GetMenuItems(*args, **kwargs):
a95a7133 8117 """GetMenuItems(self) -> PyObject"""
54f9ee45 8118 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
8119
8120 def FindItem(*args, **kwargs):
a95a7133 8121 """FindItem(self, String item) -> int"""
54f9ee45 8122 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
8123
8124 def FindItemById(*args, **kwargs):
a95a7133 8125 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 8126 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
8127
8128 def FindItemByPosition(*args, **kwargs):
a95a7133 8129 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 8130 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
8131
8132 def Enable(*args, **kwargs):
a95a7133 8133 """Enable(self, int id, bool enable)"""
54f9ee45 8134 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
8135
8136 def IsEnabled(*args, **kwargs):
a95a7133 8137 """IsEnabled(self, int id) -> bool"""
54f9ee45 8138 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
8139
8140 def Check(*args, **kwargs):
a95a7133 8141 """Check(self, int id, bool check)"""
54f9ee45 8142 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
8143
8144 def IsChecked(*args, **kwargs):
a95a7133 8145 """IsChecked(self, int id) -> bool"""
54f9ee45 8146 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
8147
8148 def SetLabel(*args, **kwargs):
a95a7133 8149 """SetLabel(self, int id, String label)"""
54f9ee45 8150 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
8151
8152 def GetLabel(*args, **kwargs):
a95a7133 8153 """GetLabel(self, int id) -> String"""
54f9ee45 8154 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
8155
8156 def SetHelpString(*args, **kwargs):
a95a7133 8157 """SetHelpString(self, int id, String helpString)"""
54f9ee45 8158 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
8159
8160 def GetHelpString(*args, **kwargs):
a95a7133 8161 """GetHelpString(self, int id) -> String"""
54f9ee45 8162 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
8163
8164 def SetTitle(*args, **kwargs):
a95a7133 8165 """SetTitle(self, String title)"""
54f9ee45 8166 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
8167
8168 def GetTitle(*args, **kwargs):
a95a7133 8169 """GetTitle(self) -> String"""
54f9ee45 8170 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
8171
8172 def SetEventHandler(*args, **kwargs):
a95a7133 8173 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 8174 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
8175
8176 def GetEventHandler(*args, **kwargs):
a95a7133 8177 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 8178 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
8179
8180 def SetInvokingWindow(*args, **kwargs):
a95a7133 8181 """SetInvokingWindow(self, Window win)"""
54f9ee45 8182 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
8183
8184 def GetInvokingWindow(*args, **kwargs):
a95a7133 8185 """GetInvokingWindow(self) -> Window"""
54f9ee45 8186 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
8187
8188 def GetStyle(*args, **kwargs):
a95a7133 8189 """GetStyle(self) -> long"""
54f9ee45 8190 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
8191
8192 def UpdateUI(*args, **kwargs):
a95a7133 8193 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 8194 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
8195
8196 def GetMenuBar(*args, **kwargs):
a95a7133 8197 """GetMenuBar(self) -> MenuBar"""
54f9ee45 8198 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
8199
8200 def Attach(*args, **kwargs):
a95a7133 8201 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 8202 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
8203
8204 def Detach(*args, **kwargs):
a95a7133 8205 """Detach(self)"""
54f9ee45 8206 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
8207
8208 def IsAttached(*args, **kwargs):
a95a7133 8209 """IsAttached(self) -> bool"""
54f9ee45 8210 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
8211
8212 def SetParent(*args, **kwargs):
a95a7133 8213 """SetParent(self, Menu parent)"""
54f9ee45 8214 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
8215
8216 def GetParent(*args, **kwargs):
a95a7133 8217 """GetParent(self) -> Menu"""
54f9ee45 8218 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 8219
d14a1e28
RD
8220
8221class MenuPtr(Menu):
8222 def __init__(self, this):
8223 self.this = this
8224 if not hasattr(self,"thisown"): self.thisown = 0
8225 self.__class__ = Menu
54f9ee45 8226_core_.Menu_swigregister(MenuPtr)
d14a1e28
RD
8227DefaultValidator = cvar.DefaultValidator
8228
8229#---------------------------------------------------------------------------
8230
8231class MenuBar(Window):
e811c8ce
RD
8232 def __repr__(self):
8233 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8234 def __init__(self, *args, **kwargs):
a95a7133 8235 """__init__(self, long style=0) -> MenuBar"""
54f9ee45 8236 newobj = _core_.new_MenuBar(*args, **kwargs)
d14a1e28
RD
8237 self.this = newobj.this
8238 self.thisown = 1
8239 del newobj.thisown
8240 self._setOORInfo(self)
e811c8ce
RD
8241
8242 def Append(*args, **kwargs):
a95a7133 8243 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 8244 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
8245
8246 def Insert(*args, **kwargs):
a95a7133 8247 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 8248 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
8249
8250 def GetMenuCount(*args, **kwargs):
a95a7133 8251 """GetMenuCount(self) -> size_t"""
54f9ee45 8252 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
8253
8254 def GetMenu(*args, **kwargs):
a95a7133 8255 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 8256 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
8257
8258 def Replace(*args, **kwargs):
a95a7133 8259 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 8260 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
8261
8262 def Remove(*args, **kwargs):
a95a7133 8263 """Remove(self, size_t pos) -> Menu"""
54f9ee45 8264 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
8265
8266 def EnableTop(*args, **kwargs):
a95a7133 8267 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 8268 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
8269
8270 def IsEnabledTop(*args, **kwargs):
a95a7133 8271 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 8272 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
8273
8274 def SetLabelTop(*args, **kwargs):
a95a7133 8275 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 8276 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
8277
8278 def GetLabelTop(*args, **kwargs):
a95a7133 8279 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 8280 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
8281
8282 def FindMenuItem(*args, **kwargs):
a95a7133 8283 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 8284 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
8285
8286 def FindItemById(*args, **kwargs):
a95a7133 8287 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 8288 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
8289
8290 def FindMenu(*args, **kwargs):
a95a7133 8291 """FindMenu(self, String title) -> int"""
54f9ee45 8292 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
8293
8294 def Enable(*args, **kwargs):
a95a7133 8295 """Enable(self, int id, bool enable)"""
54f9ee45 8296 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
8297
8298 def Check(*args, **kwargs):
a95a7133 8299 """Check(self, int id, bool check)"""
54f9ee45 8300 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
8301
8302 def IsChecked(*args, **kwargs):
a95a7133 8303 """IsChecked(self, int id) -> bool"""
54f9ee45 8304 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
8305
8306 def IsEnabled(*args, **kwargs):
a95a7133 8307 """IsEnabled(self, int id) -> bool"""
54f9ee45 8308 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
8309
8310 def SetLabel(*args, **kwargs):
a95a7133 8311 """SetLabel(self, int id, String label)"""
54f9ee45 8312 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
8313
8314 def GetLabel(*args, **kwargs):
a95a7133 8315 """GetLabel(self, int id) -> String"""
54f9ee45 8316 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
8317
8318 def SetHelpString(*args, **kwargs):
a95a7133 8319 """SetHelpString(self, int id, String helpString)"""
54f9ee45 8320 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
8321
8322 def GetHelpString(*args, **kwargs):
a95a7133 8323 """GetHelpString(self, int id) -> String"""
54f9ee45 8324 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
8325
8326 def GetFrame(*args, **kwargs):
a95a7133 8327 """GetFrame(self) -> wxFrame"""
54f9ee45 8328 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
8329
8330 def IsAttached(*args, **kwargs):
a95a7133 8331 """IsAttached(self) -> bool"""
54f9ee45 8332 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
8333
8334 def Attach(*args, **kwargs):
a95a7133 8335 """Attach(self, wxFrame frame)"""
54f9ee45 8336 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
8337
8338 def Detach(*args, **kwargs):
a95a7133 8339 """Detach(self)"""
54f9ee45 8340 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 8341
d14a1e28
RD
8342
8343class MenuBarPtr(MenuBar):
8344 def __init__(self, this):
8345 self.this = this
8346 if not hasattr(self,"thisown"): self.thisown = 0
8347 self.__class__ = MenuBar
54f9ee45 8348_core_.MenuBar_swigregister(MenuBarPtr)
d14a1e28
RD
8349
8350#---------------------------------------------------------------------------
8351
8352class MenuItem(Object):
e811c8ce
RD
8353 def __repr__(self):
8354 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8355 def __init__(self, *args, **kwargs):
0df68c9f 8356 """
a95a7133 8357 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
196addbf
RD
8358 String help=EmptyString, int kind=ITEM_NORMAL,
8359 Menu subMenu=None) -> MenuItem
0df68c9f 8360 """
54f9ee45 8361 newobj = _core_.new_MenuItem(*args, **kwargs)
d14a1e28
RD
8362 self.this = newobj.this
8363 self.thisown = 1
8364 del newobj.thisown
e811c8ce 8365 def GetMenu(*args, **kwargs):
a95a7133 8366 """GetMenu(self) -> Menu"""
54f9ee45 8367 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
8368
8369 def SetMenu(*args, **kwargs):
a95a7133 8370 """SetMenu(self, Menu menu)"""
54f9ee45 8371 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
8372
8373 def SetId(*args, **kwargs):
a95a7133 8374 """SetId(self, int id)"""
54f9ee45 8375 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
8376
8377 def GetId(*args, **kwargs):
a95a7133 8378 """GetId(self) -> int"""
54f9ee45 8379 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
8380
8381 def IsSeparator(*args, **kwargs):
a95a7133 8382 """IsSeparator(self) -> bool"""
54f9ee45 8383 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
8384
8385 def SetText(*args, **kwargs):
a95a7133 8386 """SetText(self, String str)"""
54f9ee45 8387 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
8388
8389 def GetLabel(*args, **kwargs):
a95a7133 8390 """GetLabel(self) -> String"""
54f9ee45 8391 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
8392
8393 def GetText(*args, **kwargs):
a95a7133 8394 """GetText(self) -> String"""
54f9ee45 8395 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
8396
8397 def GetLabelFromText(*args, **kwargs):
66c033b4 8398 """GetLabelFromText(String text) -> String"""
54f9ee45 8399 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
8400
8401 GetLabelFromText = staticmethod(GetLabelFromText)
8402 def GetKind(*args, **kwargs):
a95a7133 8403 """GetKind(self) -> int"""
54f9ee45 8404 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 8405
a95a7133
RD
8406 def SetKind(*args, **kwargs):
8407 """SetKind(self, int kind)"""
54f9ee45 8408 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 8409
e811c8ce 8410 def SetCheckable(*args, **kwargs):
a95a7133 8411 """SetCheckable(self, bool checkable)"""
54f9ee45 8412 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
8413
8414 def IsCheckable(*args, **kwargs):
a95a7133 8415 """IsCheckable(self) -> bool"""
54f9ee45 8416 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
8417
8418 def IsSubMenu(*args, **kwargs):
a95a7133 8419 """IsSubMenu(self) -> bool"""
54f9ee45 8420 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
8421
8422 def SetSubMenu(*args, **kwargs):
a95a7133 8423 """SetSubMenu(self, Menu menu)"""
54f9ee45 8424 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
8425
8426 def GetSubMenu(*args, **kwargs):
a95a7133 8427 """GetSubMenu(self) -> Menu"""
54f9ee45 8428 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
8429
8430 def Enable(*args, **kwargs):
a95a7133 8431 """Enable(self, bool enable=True)"""
54f9ee45 8432 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
8433
8434 def IsEnabled(*args, **kwargs):
a95a7133 8435 """IsEnabled(self) -> bool"""
54f9ee45 8436 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
8437
8438 def Check(*args, **kwargs):
a95a7133 8439 """Check(self, bool check=True)"""
54f9ee45 8440 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
8441
8442 def IsChecked(*args, **kwargs):
a95a7133 8443 """IsChecked(self) -> bool"""
54f9ee45 8444 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
8445
8446 def Toggle(*args, **kwargs):
a95a7133 8447 """Toggle(self)"""
54f9ee45 8448 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
8449
8450 def SetHelp(*args, **kwargs):
a95a7133 8451 """SetHelp(self, String str)"""
54f9ee45 8452 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
8453
8454 def GetHelp(*args, **kwargs):
a95a7133 8455 """GetHelp(self) -> String"""
54f9ee45 8456 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
8457
8458 def GetAccel(*args, **kwargs):
a95a7133 8459 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 8460 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
8461
8462 def SetAccel(*args, **kwargs):
a95a7133 8463 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 8464 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce
RD
8465
8466 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 8467 """GetDefaultMarginWidth() -> int"""
54f9ee45 8468 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
8469
8470 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
8471 def SetBitmap(*args, **kwargs):
a95a7133 8472 """SetBitmap(self, Bitmap bitmap)"""
54f9ee45 8473 return _core_.MenuItem_SetBitmap(*args, **kwargs)
e811c8ce
RD
8474
8475 def GetBitmap(*args, **kwargs):
a95a7133 8476 """GetBitmap(self) -> Bitmap"""
54f9ee45 8477 return _core_.MenuItem_GetBitmap(*args, **kwargs)
e811c8ce 8478
d14a1e28
RD
8479
8480class MenuItemPtr(MenuItem):
8481 def __init__(self, this):
8482 self.this = this
8483 if not hasattr(self,"thisown"): self.thisown = 0
8484 self.__class__ = MenuItem
54f9ee45 8485_core_.MenuItem_swigregister(MenuItemPtr)
d14a1e28 8486
e811c8ce 8487def MenuItem_GetLabelFromText(*args, **kwargs):
196addbf 8488 """MenuItem_GetLabelFromText(String text) -> String"""
54f9ee45 8489 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 8490
e811c8ce
RD
8491def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8492 """MenuItem_GetDefaultMarginWidth() -> int"""
54f9ee45 8493 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d14a1e28
RD
8494
8495#---------------------------------------------------------------------------
8496
8497class Control(Window):
15afbcd0
RD
8498 """
8499 This is the base class for a control or 'widget'.
8500
41e2b43e
RD
8501 A control is generally a small window which processes user input
8502 and/or displays one or more item of data.
15afbcd0 8503 """
e811c8ce
RD
8504 def __repr__(self):
8505 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8506 def __init__(self, *args, **kwargs):
0df68c9f 8507 """
248ed943
RD
8508 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8509 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 8510 String name=ControlNameStr) -> Control
15afbcd0 8511
41e2b43e
RD
8512 Create a Control. Normally you should only call this from a subclass'
8513 __init__ as a plain old wx.Control is not very useful.
0df68c9f 8514 """
54f9ee45 8515 newobj = _core_.new_Control(*args, **kwargs)
d14a1e28
RD
8516 self.this = newobj.this
8517 self.thisown = 1
8518 del newobj.thisown
8519 self._setOORInfo(self)
e811c8ce
RD
8520
8521 def Create(*args, **kwargs):
0df68c9f 8522 """
248ed943
RD
8523 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8524 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 8525 String name=ControlNameStr) -> bool
15afbcd0
RD
8526
8527 Do the 2nd phase and create the GUI control.
0df68c9f 8528 """
54f9ee45 8529 return _core_.Control_Create(*args, **kwargs)
e811c8ce
RD
8530
8531 def Command(*args, **kwargs):
15afbcd0 8532 """
a95a7133 8533 Command(self, CommandEvent event)
15afbcd0 8534
41e2b43e
RD
8535 Simulates the effect of the user issuing a command to the item.
8536
8537 :see: `wx.CommandEvent`
8538
15afbcd0 8539 """
54f9ee45 8540 return _core_.Control_Command(*args, **kwargs)
e811c8ce
RD
8541
8542 def GetLabel(*args, **kwargs):
15afbcd0 8543 """
a95a7133 8544 GetLabel(self) -> String
15afbcd0
RD
8545
8546 Return a control's text.
8547 """
54f9ee45 8548 return _core_.Control_GetLabel(*args, **kwargs)
e811c8ce
RD
8549
8550 def SetLabel(*args, **kwargs):
15afbcd0 8551 """
a95a7133 8552 SetLabel(self, String label)
15afbcd0
RD
8553
8554 Sets the item's text.
8555 """
54f9ee45 8556 return _core_.Control_SetLabel(*args, **kwargs)
e811c8ce 8557
74a57fcd 8558 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
8559 """
8560 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8561
8562 Get the default attributes for this class. This is useful if you want
8563 to use the same font or colour in your own control as in a standard
8564 control -- which is a much better idea than hard coding specific
8565 colours or fonts which might look completely out of place on the
8566 user's system, especially if it uses themes.
8567
8568 The variant parameter is only relevant under Mac currently and is
8569 ignore under other platforms. Under Mac, it will change the size of
8570 the returned font. See `wx.Window.SetWindowVariant` for more about
8571 this.
8572 """
54f9ee45 8573 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
8574
8575 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
d14a1e28
RD
8576
8577class ControlPtr(Control):
8578 def __init__(self, this):
8579 self.this = this
8580 if not hasattr(self,"thisown"): self.thisown = 0
8581 self.__class__ = Control
54f9ee45 8582_core_.Control_swigregister(ControlPtr)
b2dc1044 8583ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
8584
8585def PreControl(*args, **kwargs):
15afbcd0
RD
8586 """
8587 PreControl() -> Control
8588
8589 Precreate a Control control for 2-phase creation
8590 """
54f9ee45 8591 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
8592 val.thisown = 1
8593 return val
8594
74a57fcd 8595def Control_GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
8596 """
8597 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8598
8599 Get the default attributes for this class. This is useful if you want
8600 to use the same font or colour in your own control as in a standard
8601 control -- which is a much better idea than hard coding specific
8602 colours or fonts which might look completely out of place on the
8603 user's system, especially if it uses themes.
8604
8605 The variant parameter is only relevant under Mac currently and is
8606 ignore under other platforms. Under Mac, it will change the size of
8607 the returned font. See `wx.Window.SetWindowVariant` for more about
8608 this.
8609 """
54f9ee45 8610 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 8611
d14a1e28
RD
8612#---------------------------------------------------------------------------
8613
8614class ItemContainer(object):
15afbcd0
RD
8615 """
8616 wx.ItemContainer defines an interface which is implemented by all
41e2b43e
RD
8617 controls which have string subitems, each of which may be selected,
8618 such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well as
8619 `wx.ComboBox` which implements an extended interface deriving from
8620 this one.
15afbcd0 8621
41e2b43e
RD
8622 It defines the methods for accessing the control's items and although
8623 each of the derived classes implements them differently, they still
8624 all conform to the same interface.
15afbcd0 8625
41e2b43e
RD
8626 The items in a wx.ItemContainer have (non empty) string labels and,
8627 optionally, client data associated with them.
15afbcd0
RD
8628
8629 """
d14a1e28
RD
8630 def __init__(self): raise RuntimeError, "No constructor defined"
8631 def __repr__(self):
8632 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 8633 def Append(*args, **kwargs):
15afbcd0 8634 """
a95a7133 8635 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 8636
41e2b43e
RD
8637 Adds the item to the control, associating the given data with the item
8638 if not None. The return value is the index of the newly added item
8639 which may be different from the last one if the control is sorted (e.g.
8640 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 8641 """
54f9ee45 8642 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
8643
8644 def AppendItems(*args, **kwargs):
15afbcd0 8645 """
f5b96ee1 8646 AppendItems(self, List strings)
15afbcd0 8647
41e2b43e
RD
8648 Apend several items at once to the control. Notice that calling this
8649 method may be much faster than appending the items one by one if you
8650 need to add a lot of items.
15afbcd0 8651 """
54f9ee45 8652 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
8653
8654 def Insert(*args, **kwargs):
15afbcd0 8655 """
a95a7133 8656 Insert(self, String item, int pos, PyObject clientData=None) -> int
15afbcd0 8657
41e2b43e 8658 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
8659 optionally associating some data object with the item.
8660 """
54f9ee45 8661 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
8662
8663 def Clear(*args, **kwargs):
15afbcd0 8664 """
a95a7133 8665 Clear(self)
15afbcd0
RD
8666
8667 Removes all items from the control.
8668 """
54f9ee45 8669 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
8670
8671 def Delete(*args, **kwargs):
15afbcd0 8672 """
a95a7133 8673 Delete(self, int n)
15afbcd0 8674
41e2b43e
RD
8675 Deletes the item at the zero-based index 'n' from the control. Note
8676 that it is an error (signalled by a `wx.PyAssertionError` exception if
8677 enabled) to remove an item with the index negative or greater or equal
8678 than the number of items in the control.
15afbcd0 8679 """
54f9ee45 8680 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce
RD
8681
8682 def GetCount(*args, **kwargs):
15afbcd0 8683 """
a95a7133 8684 GetCount(self) -> int
15afbcd0
RD
8685
8686 Returns the number of items in the control.
8687 """
54f9ee45 8688 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
8689
8690 def IsEmpty(*args, **kwargs):
15afbcd0 8691 """
a95a7133 8692 IsEmpty(self) -> bool
15afbcd0
RD
8693
8694 Returns True if the control is empty or False if it has some items.
8695 """
54f9ee45 8696 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
8697
8698 def GetString(*args, **kwargs):
15afbcd0 8699 """
a95a7133 8700 GetString(self, int n) -> String
15afbcd0
RD
8701
8702 Returns the label of the item with the given index.
8703 """
54f9ee45 8704 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
8705
8706 def GetStrings(*args, **kwargs):
a95a7133 8707 """GetStrings(self) -> wxArrayString"""
54f9ee45 8708 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
8709
8710 def SetString(*args, **kwargs):
15afbcd0 8711 """
a95a7133 8712 SetString(self, int n, String s)
15afbcd0
RD
8713
8714 Sets the label for the given item.
8715 """
54f9ee45 8716 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
8717
8718 def FindString(*args, **kwargs):
15afbcd0 8719 """
a95a7133 8720 FindString(self, String s) -> int
15afbcd0
RD
8721
8722 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
8723 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
8724 found.
15afbcd0 8725 """
54f9ee45 8726 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce
RD
8727
8728 def Select(*args, **kwargs):
15afbcd0 8729 """
a95a7133 8730 Select(self, int n)
15afbcd0
RD
8731
8732 Sets the item at index 'n' to be the selected item.
8733 """
54f9ee45 8734 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 8735
15afbcd0 8736 SetSelection = Select
e811c8ce 8737 def GetSelection(*args, **kwargs):
15afbcd0 8738 """
a95a7133 8739 GetSelection(self) -> int
15afbcd0 8740
41e2b43e
RD
8741 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
8742 is selected.
15afbcd0 8743 """
54f9ee45 8744 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce
RD
8745
8746 def GetStringSelection(*args, **kwargs):
15afbcd0 8747 """
a95a7133 8748 GetStringSelection(self) -> String
15afbcd0 8749
41e2b43e
RD
8750 Returns the label of the selected item or an empty string if no item
8751 is selected.
15afbcd0 8752 """
54f9ee45 8753 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce
RD
8754
8755 def GetClientData(*args, **kwargs):
15afbcd0 8756 """
a95a7133 8757 GetClientData(self, int n) -> PyObject
15afbcd0
RD
8758
8759 Returns the client data associated with the given item, (if any.)
8760 """
54f9ee45 8761 return _core_.ItemContainer_GetClientData(*args, **kwargs)
e811c8ce
RD
8762
8763 def SetClientData(*args, **kwargs):
15afbcd0 8764 """
a95a7133 8765 SetClientData(self, int n, PyObject clientData)
15afbcd0
RD
8766
8767 Associate the given client data with the item at position n.
8768 """
54f9ee45 8769 return _core_.ItemContainer_SetClientData(*args, **kwargs)
e811c8ce 8770
d14a1e28
RD
8771
8772class ItemContainerPtr(ItemContainer):
8773 def __init__(self, this):
8774 self.this = this
8775 if not hasattr(self,"thisown"): self.thisown = 0
8776 self.__class__ = ItemContainer
54f9ee45 8777_core_.ItemContainer_swigregister(ItemContainerPtr)
d14a1e28
RD
8778
8779#---------------------------------------------------------------------------
8780
8781class ControlWithItems(Control,ItemContainer):
15afbcd0 8782 """
41e2b43e
RD
8783 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
8784 wx.Control class, and is used for the base class of various controls
8785 that have items.
15afbcd0 8786 """
d14a1e28
RD
8787 def __init__(self): raise RuntimeError, "No constructor defined"
8788 def __repr__(self):
8789 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8790
8791class ControlWithItemsPtr(ControlWithItems):
8792 def __init__(self, this):
8793 self.this = this
8794 if not hasattr(self,"thisown"): self.thisown = 0
8795 self.__class__ = ControlWithItems
54f9ee45 8796_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
d14a1e28
RD
8797
8798#---------------------------------------------------------------------------
8799
8800class SizerItem(Object):
248ed943
RD
8801 """
8802 The wx.SizerItem class is used to track the position, size and other
8803 attributes of each item managed by a `wx.Sizer`. In normal usage user
8804 code should never need to deal directly with a wx.SizerItem, but
8805 custom classes derived from `wx.PySizer` will probably need to use the
8806 collection of wx.SizerItems held by wx.Sizer when calculating layout.
8807
8808 :see: `wx.Sizer`, `wx.GBSizerItem`
8809 """
e811c8ce
RD
8810 def __repr__(self):
8811 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8812 def __init__(self, *args, **kwargs):
248ed943
RD
8813 """
8814 __init__(self) -> SizerItem
8815
8816 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
8817 size will need to be set before this item can be used in a Sizer.
8818
8819 You will probably never need to create a wx.SizerItem directly as they
8820 are created automatically when the sizer's Add, Insert or Prepend
8821 methods are called.
8822
8823 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
8824 """
54f9ee45 8825 newobj = _core_.new_SizerItem(*args, **kwargs)
d14a1e28
RD
8826 self.this = newobj.this
8827 self.thisown = 1
8828 del newobj.thisown
e811c8ce 8829 def DeleteWindows(*args, **kwargs):
248ed943
RD
8830 """
8831 DeleteWindows(self)
8832
8833 Destroy the window or the windows in a subsizer, depending on the type
8834 of item.
8835 """
54f9ee45 8836 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
8837
8838 def DetachSizer(*args, **kwargs):
248ed943
RD
8839 """
8840 DetachSizer(self)
8841
8842 Enable deleting the SizerItem without destroying the contained sizer.
8843 """
54f9ee45 8844 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
8845
8846 def GetSize(*args, **kwargs):
248ed943
RD
8847 """
8848 GetSize(self) -> Size
8849
8850 Get the current size of the item, as set in the last Layout.
8851 """
54f9ee45 8852 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
8853
8854 def CalcMin(*args, **kwargs):
248ed943
RD
8855 """
8856 CalcMin(self) -> Size
8857
8858 Calculates the minimum desired size for the item, including any space
8859 needed by borders.
8860 """
54f9ee45 8861 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
8862
8863 def SetDimension(*args, **kwargs):
248ed943
RD
8864 """
8865 SetDimension(self, Point pos, Size size)
8866
8867 Set the position and size of the space allocated for this item by the
8868 sizer, and adjust the position and size of the item (window or
8869 subsizer) to be within that space taking alignment and borders into
8870 account.
8871 """
54f9ee45 8872 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
8873
8874 def GetMinSize(*args, **kwargs):
248ed943
RD
8875 """
8876 GetMinSize(self) -> Size
8877
8878 Get the minimum size needed for the item.
8879 """
54f9ee45 8880 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 8881
dfbb5885
RD
8882 def GetMinSizeWithBorder(*args, **kwargs):
8883 """
8884 GetMinSizeWithBorder(self) -> Size
8885
8886 Get the minimum size needed for the item with space for the borders
8887 added, if needed.
8888 """
8889 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
8890
e811c8ce 8891 def SetInitSize(*args, **kwargs):
a95a7133 8892 """SetInitSize(self, int x, int y)"""
54f9ee45 8893 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
8894
8895 def SetRatioWH(*args, **kwargs):
248ed943
RD
8896 """
8897 SetRatioWH(self, int width, int height)
8898
8899 Set the ratio item attribute.
8900 """
54f9ee45 8901 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
8902
8903 def SetRatioSize(*args, **kwargs):
248ed943
RD
8904 """
8905 SetRatioSize(self, Size size)
8906
8907 Set the ratio item attribute.
8908 """
54f9ee45 8909 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
8910
8911 def SetRatio(*args, **kwargs):
248ed943
RD
8912 """
8913 SetRatio(self, float ratio)
8914
8915 Set the ratio item attribute.
8916 """
54f9ee45 8917 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
8918
8919 def GetRatio(*args, **kwargs):
248ed943
RD
8920 """
8921 GetRatio(self) -> float
8922
8923 Set the ratio item attribute.
8924 """
54f9ee45 8925 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 8926
d3b6e4ff
RD
8927 def GetRect(*args, **kwargs):
8928 """
8929 GetRect(self) -> Rect
8930
8931 Returns the rectangle that the sizer item should occupy
8932 """
8933 return _core_.SizerItem_GetRect(*args, **kwargs)
8934
e811c8ce 8935 def IsWindow(*args, **kwargs):
248ed943
RD
8936 """
8937 IsWindow(self) -> bool
8938
8939 Is this sizer item a window?
8940 """
54f9ee45 8941 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
8942
8943 def IsSizer(*args, **kwargs):
248ed943
RD
8944 """
8945 IsSizer(self) -> bool
8946
8947 Is this sizer item a subsizer?
8948 """
54f9ee45 8949 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
8950
8951 def IsSpacer(*args, **kwargs):
248ed943
RD
8952 """
8953 IsSpacer(self) -> bool
8954
8955 Is this sizer item a spacer?
8956 """
54f9ee45 8957 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
8958
8959 def SetProportion(*args, **kwargs):
248ed943
RD
8960 """
8961 SetProportion(self, int proportion)
8962
8963 Set the proportion value for this item.
8964 """
54f9ee45 8965 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
8966
8967 def GetProportion(*args, **kwargs):
248ed943
RD
8968 """
8969 GetProportion(self) -> int
8970
8971 Get the proportion value for this item.
8972 """
54f9ee45 8973 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 8974
248ed943
RD
8975 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
8976 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 8977 def SetFlag(*args, **kwargs):
248ed943
RD
8978 """
8979 SetFlag(self, int flag)
8980
8981 Set the flag value for this item.
8982 """
54f9ee45 8983 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
8984
8985 def GetFlag(*args, **kwargs):
248ed943
RD
8986 """
8987 GetFlag(self) -> int
8988
8989 Get the flag value for this item.
8990 """
54f9ee45 8991 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
8992
8993 def SetBorder(*args, **kwargs):
248ed943
RD
8994 """
8995 SetBorder(self, int border)
8996
8997 Set the border value for this item.
8998 """
54f9ee45 8999 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
9000
9001 def GetBorder(*args, **kwargs):
248ed943
RD
9002 """
9003 GetBorder(self) -> int
9004
9005 Get the border value for this item.
9006 """
54f9ee45 9007 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
9008
9009 def GetWindow(*args, **kwargs):
248ed943
RD
9010 """
9011 GetWindow(self) -> Window
9012
9013 Get the window (if any) that is managed by this sizer item.
9014 """
54f9ee45 9015 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce
RD
9016
9017 def SetWindow(*args, **kwargs):
248ed943
RD
9018 """
9019 SetWindow(self, Window window)
9020
9021 Set the window to be managed by this sizer item.
9022 """
54f9ee45 9023 return _core_.SizerItem_SetWindow(*args, **kwargs)
e811c8ce
RD
9024
9025 def GetSizer(*args, **kwargs):
248ed943
RD
9026 """
9027 GetSizer(self) -> Sizer
9028
9029 Get the subsizer (if any) that is managed by this sizer item.
9030 """
54f9ee45 9031 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce
RD
9032
9033 def SetSizer(*args, **kwargs):
248ed943
RD
9034 """
9035 SetSizer(self, Sizer sizer)
9036
9037 Set the subsizer to be managed by this sizer item.
9038 """
54f9ee45 9039 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce
RD
9040
9041 def GetSpacer(*args, **kwargs):
248ed943
RD
9042 """
9043 GetSpacer(self) -> Size
9044
9045 Get the size of the spacer managed by this sizer item.
9046 """
54f9ee45 9047 return _core_.SizerItem_GetSpacer(*args, **kwargs)
e811c8ce
RD
9048
9049 def SetSpacer(*args, **kwargs):
248ed943
RD
9050 """
9051 SetSpacer(self, Size size)
9052
9053 Set the size of the spacer to be managed by this sizer item.
9054 """
54f9ee45 9055 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce
RD
9056
9057 def Show(*args, **kwargs):
248ed943
RD
9058 """
9059 Show(self, bool show)
9060
9061 Set the show item attribute, which sizers use to determine if the item
9062 is to be made part of the layout or not. If the item is tracking a
9063 window then it is shown or hidden as needed.
9064 """
54f9ee45 9065 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
9066
9067 def IsShown(*args, **kwargs):
248ed943
RD
9068 """
9069 IsShown(self) -> bool
9070
9071 Is the item to be shown in the layout?
9072 """
54f9ee45 9073 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
9074
9075 def GetPosition(*args, **kwargs):
248ed943
RD
9076 """
9077 GetPosition(self) -> Point
9078
9079 Returns the current position of the item, as set in the last Layout.
9080 """
54f9ee45 9081 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
9082
9083 def GetUserData(*args, **kwargs):
248ed943
RD
9084 """
9085 GetUserData(self) -> PyObject
9086
9087 Returns the userData associated with this sizer item, or None if there
9088 isn't any.
9089 """
54f9ee45 9090 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 9091
d14a1e28
RD
9092
9093class SizerItemPtr(SizerItem):
9094 def __init__(self, this):
9095 self.this = this
9096 if not hasattr(self,"thisown"): self.thisown = 0
9097 self.__class__ = SizerItem
54f9ee45 9098_core_.SizerItem_swigregister(SizerItemPtr)
d14a1e28 9099
248ed943 9100def SizerItemWindow(*args, **kwargs):
0df68c9f 9101 """
248ed943
RD
9102 SizerItemWindow(Window window, int proportion, int flag, int border,
9103 PyObject userData=None) -> SizerItem
9104
9105 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 9106 """
248ed943 9107 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
9108 val.thisown = 1
9109 return val
9110
248ed943 9111def SizerItemSpacer(*args, **kwargs):
0df68c9f 9112 """
248ed943
RD
9113 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
9114 PyObject userData=None) -> SizerItem
9115
9116 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 9117 """
248ed943 9118 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
9119 val.thisown = 1
9120 return val
9121
9122def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
9123 """
9124 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
9125 PyObject userData=None) -> SizerItem
9126
9127 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 9128 """
54f9ee45 9129 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
9130 val.thisown = 1
9131 return val
9132
9133class Sizer(Object):
248ed943
RD
9134 """
9135 wx.Sizer is the abstract base class used for laying out subwindows in
9136 a window. You cannot use wx.Sizer directly; instead, you will have to
9137 use one of the sizer classes derived from it such as `wx.BoxSizer`,
9138 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
9139 and `wx.GridBagSizer`.
9140
9141 The concept implemented by sizers in wxWidgets is closely related to
9142 layout tools in other GUI toolkits, such as Java's AWT, the GTK
9143 toolkit or the Qt toolkit. It is based upon the idea of the individual
9144 subwindows reporting their minimal required size and their ability to
9145 get stretched if the size of the parent window has changed. This will
9146 most often mean that the programmer does not set the original size of
9147 a dialog in the beginning, rather the dialog will assigned a sizer and
9148 this sizer will be queried about the recommended size. The sizer in
9149 turn will query its children, which can be normal windows or contorls,
9150 empty space or other sizers, so that a hierarchy of sizers can be
9151 constructed. Note that wxSizer does not derive from wxWindow and thus
9152 do not interfere with tab ordering and requires very little resources
9153 compared to a real window on screen.
9154
9155 What makes sizers so well fitted for use in wxWidgets is the fact that
9156 every control reports its own minimal size and the algorithm can
9157 handle differences in font sizes or different window (dialog item)
9158 sizes on different platforms without problems. If for example the
9159 standard font as well as the overall design of Mac widgets requires
9160 more space than on Windows, then the initial size of a dialog using a
9161 sizer will automatically be bigger on Mac than on Windows.
9162 """
e811c8ce
RD
9163 def __init__(self): raise RuntimeError, "No constructor defined"
9164 def __repr__(self):
9165 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9166 def _setOORInfo(*args, **kwargs):
a95a7133 9167 """_setOORInfo(self, PyObject _self)"""
54f9ee45 9168 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
9169
9170 def Add(*args, **kwargs):
0df68c9f 9171 """
248ed943 9172 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 9173 PyObject userData=None) -> wx.SizerItem
248ed943
RD
9174
9175 Appends a child item to the sizer.
0df68c9f 9176 """
54f9ee45 9177 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce
RD
9178
9179 def Insert(*args, **kwargs):
0df68c9f 9180 """
248ed943 9181 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 9182 PyObject userData=None) -> wx.SizerItem
248ed943
RD
9183
9184 Inserts a new item into the list of items managed by this sizer before
9185 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 9186 """
54f9ee45 9187 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce
RD
9188
9189 def Prepend(*args, **kwargs):
0df68c9f 9190 """
248ed943 9191 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 9192 PyObject userData=None) -> wx.SizerItem
248ed943
RD
9193
9194 Adds a new item to the begining of the list of sizer items managed by
9195 this sizer. See `Add` for a description of the parameters.
0df68c9f 9196 """
54f9ee45 9197 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce
RD
9198
9199 def Remove(*args, **kwargs):
248ed943
RD
9200 """
9201 Remove(self, item) -> bool
9202
9203 Removes an item from the sizer and destroys it. This method does not
9204 cause any layout or resizing to take place, call `Layout` to update
9205 the layout on screen after removing a child from the sizer. The
9206 *item* parameter can be either a window, a sizer, or the zero-based
9207 index of an item to remove. Returns True if the child item was found
9208 and removed.
9209 """
54f9ee45 9210 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 9211
1c0f361b 9212 def Detach(*args, **kwargs):
248ed943
RD
9213 """
9214 Detach(self, item) -> bool
9215
9216 Detaches an item from the sizer without destroying it. This method
9217 does not cause any layout or resizing to take place, call `Layout` to
9218 do so. The *item* parameter can be either a window, a sizer, or the
9219 zero-based index of the item to be detached. Returns True if the child item
9220 was found and detached.
9221 """
1c0f361b
RD
9222 return _core_.Sizer_Detach(*args, **kwargs)
9223
d3b6e4ff
RD
9224 def GetItem(*args, **kwargs):
9225 """
9226 GetItem(self, item) -> wx.SizerItem
9227
9228 Returns the `wx.SizerItem` which holds the *item* given. The *item*
9229 parameter can be either a window, a sizer, or the zero-based index of
9230 the item to be detached.
9231 """
9232 return _core_.Sizer_GetItem(*args, **kwargs)
9233
e811c8ce 9234 def _SetItemMinSize(*args, **kwargs):
a95a7133 9235 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 9236 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 9237
248ed943
RD
9238 def SetItemMinSize(self, item, *args):
9239 """
9240 SetItemMinSize(self, item, Size size)
9241
9242 Sets the minimum size that will be allocated for an item in the sizer.
9243 The *item* parameter can be either a window, a sizer, or the
9244 zero-based index of the item. If a window or sizer is given then it
9245 will be searched for recursivly in subsizers if neccessary.
9246 """
9247 if len(args) == 2:
9248 # for backward compatibility accept separate width,height args too
9249 return self._SetItemMinSize(item, args)
9250 else:
9251 return self._SetItemMinSize(item, args[0])
9252
e811c8ce 9253 def AddItem(*args, **kwargs):
248ed943
RD
9254 """
9255 AddItem(self, SizerItem item)
9256
9257 Adds a `wx.SizerItem` to the sizer.
9258 """
54f9ee45 9259 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
9260
9261 def InsertItem(*args, **kwargs):
248ed943
RD
9262 """
9263 InsertItem(self, int index, SizerItem item)
9264
9265 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
9266 """
54f9ee45 9267 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
9268
9269 def PrependItem(*args, **kwargs):
248ed943
RD
9270 """
9271 PrependItem(self, SizerItem item)
9272
9273 Prepends a `wx.SizerItem` to the sizer.
9274 """
54f9ee45 9275 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 9276
248ed943 9277 def AddMany(self, items):
66c033b4
RD
9278 """
9279 AddMany is a convenience method for adding several items
9280 to a sizer at one time. Simply pass it a list of tuples,
9281 where each tuple consists of the parameters that you
9282 would normally pass to the `Add` method.
9283 """
248ed943
RD
9284 for item in items:
9285 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
9286 item = (item, )
9287 self.Add(*item)
d14a1e28 9288
74e96f3d 9289 # for backwards compatibility only, please do not use in new code
66c033b4
RD
9290 AddWindow = wx._deprecated(Add, "AddWindow is deprecated, use `Add` instead.")
9291 AddSizer = wx._deprecated(Add, "AddSizer is deprecated, use `Add` instead.")
9292 AddSpacer = wx._deprecated(Add, "AddSpacer is deprecated, use `Add` instead.")
9293 PrependWindow = wx._deprecated(Prepend, "PrependWindow is deprecated, use `Prepend` instead.")
9294 PrependSizer = wx._deprecated(Prepend, "PrependSizer is deprecated, use `Prepend` instead.")
9295 PrependSpacer = wx._deprecated(Prepend, "PrependSpacer is deprecated, use `Prepend` instead.")
9296 InsertWindow = wx._deprecated(Insert, "InsertWindow is deprecated, use `Insert` instead.")
9297 InsertSizer = wx._deprecated(Insert, "InsertSizer is deprecated, use `Insert` instead.")
9298 InsertSpacer = wx._deprecated(Insert, "InsertSpacer is deprecated, use `Insert` instead.")
9299 RemoveWindow = wx._deprecated(Remove, "RemoveWindow is deprecated, use `Remove` instead.")
9300 RemoveSizer = wx._deprecated(Remove, "RemoveSizer is deprecated, use `Remove` instead.")
9301 RemovePos = wx._deprecated(Remove, "RemovePos is deprecated, use `Remove` instead.")
d14a1e28
RD
9302
9303
e811c8ce 9304 def SetDimension(*args, **kwargs):
248ed943
RD
9305 """
9306 SetDimension(self, int x, int y, int width, int height)
9307
9308 Call this to force the sizer to take the given dimension and thus
9309 force the items owned by the sizer to resize themselves according to
9310 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
9311 methods.
9312 """
54f9ee45 9313 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
9314
9315 def SetMinSize(*args, **kwargs):
248ed943
RD
9316 """
9317 SetMinSize(self, Size size)
9318
9319 Call this to give the sizer a minimal size. Normally, the sizer will
9320 calculate its minimal size based purely on how much space its children
9321 need. After calling this method `GetMinSize` will return either the
9322 minimal size as requested by its children or the minimal size set
9323 here, depending on which is bigger.
9324 """
54f9ee45 9325 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
9326
9327 def GetSize(*args, **kwargs):
248ed943
RD
9328 """
9329 GetSize(self) -> Size
9330
9331 Returns the current size of the space managed by the sizer.
9332 """
54f9ee45 9333 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
9334
9335 def GetPosition(*args, **kwargs):
248ed943
RD
9336 """
9337 GetPosition(self) -> Point
9338
9339 Returns the current position of the sizer's managed space.
9340 """
54f9ee45 9341 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
9342
9343 def GetMinSize(*args, **kwargs):
248ed943
RD
9344 """
9345 GetMinSize(self) -> Size
9346
9347 Returns the minimal size of the sizer. This is either the combined
9348 minimal size of all the children and their borders or the minimal size
9349 set by SetMinSize, depending on which is bigger.
9350 """
54f9ee45 9351 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 9352
d14a1e28 9353 def GetSizeTuple(self):
1c0f361b 9354 return self.GetSize().Get()
d14a1e28 9355 def GetPositionTuple(self):
1c0f361b 9356 return self.GetPosition().Get()
d14a1e28 9357 def GetMinSizeTuple(self):
1c0f361b 9358 return self.GetMinSize().Get()
d14a1e28 9359
e811c8ce 9360 def RecalcSizes(*args, **kwargs):
248ed943
RD
9361 """
9362 RecalcSizes(self)
9363
9364 Using the sizes calculated by `CalcMin` reposition and resize all the
9365 items managed by this sizer. You should not need to call this directly as
9366 it is called by `Layout`.
9367 """
54f9ee45 9368 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
9369
9370 def CalcMin(*args, **kwargs):
248ed943
RD
9371 """
9372 CalcMin(self) -> Size
9373
9374 This method is where the sizer will do the actual calculation of its
9375 children's minimal sizes. You should not need to call this directly as
9376 it is called by `Layout`.
9377 """
54f9ee45 9378 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
9379
9380 def Layout(*args, **kwargs):
248ed943
RD
9381 """
9382 Layout(self)
9383
9384 This method will force the recalculation and layout of the items
9385 controlled by the sizer using the current space allocated to the
9386 sizer. Normally this is called automatically from the owning window's
9387 EVT_SIZE handler, but it is also useful to call it from user code when
9388 one of the items in a sizer change size, or items are added or
9389 removed.
9390 """
54f9ee45 9391 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
9392
9393 def Fit(*args, **kwargs):
248ed943
RD
9394 """
9395 Fit(self, Window window) -> Size
9396
9397 Tell the sizer to resize the *window* to match the sizer's minimal
9398 size. This is commonly done in the constructor of the window itself in
9399 order to set its initial size to match the needs of the children as
9400 determined by the sizer. Returns the new size.
9401
9402 For a top level window this is the total window size, not the client size.
9403 """
54f9ee45 9404 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
9405
9406 def FitInside(*args, **kwargs):
248ed943
RD
9407 """
9408 FitInside(self, Window window)
9409
9410 Tell the sizer to resize the *virtual size* of the *window* to match the
9411 sizer's minimal size. This will not alter the on screen size of the
9412 window, but may cause the addition/removal/alteration of scrollbars
9413 required to view the virtual area in windows which manage it.
9414
9415 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9416
9417 """
54f9ee45 9418 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
9419
9420 def SetSizeHints(*args, **kwargs):
248ed943
RD
9421 """
9422 SetSizeHints(self, Window window)
9423
9424 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9425 match the sizer's minimal size. This is commonly done in the
9426 constructor of the window itself if the window is resizable (as are
9427 many dialogs under Unix and frames on probably all platforms) in order
9428 to prevent the window from being sized smaller than the minimal size
9429 required by the sizer.
9430 """
54f9ee45 9431 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
9432
9433 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
9434 """
9435 SetVirtualSizeHints(self, Window window)
9436
9437 Tell the sizer to set the minimal size of the window virtual area to
9438 match the sizer's minimal size. For windows with managed scrollbars
9439 this will set them appropriately.
9440
9441 :see: `wx.ScrolledWindow.SetScrollbars`
9442
9443 """
54f9ee45 9444 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
9445
9446 def Clear(*args, **kwargs):
248ed943
RD
9447 """
9448 Clear(self, bool deleteWindows=False)
9449
9450 Clear all items from the sizer, optionally destroying the window items
9451 as well.
9452 """
54f9ee45 9453 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
9454
9455 def DeleteWindows(*args, **kwargs):
248ed943
RD
9456 """
9457 DeleteWindows(self)
9458
9459 Destroy all windows managed by the sizer.
9460 """
54f9ee45 9461 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
9462
9463 def GetChildren(*args, **kwargs):
248ed943
RD
9464 """
9465 GetChildren(sefl) -> list
9466
9467 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9468 """
54f9ee45 9469 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
9470
9471 def Show(*args, **kwargs):
248ed943 9472 """
ae8162c8 9473 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 9474
248ed943
RD
9475 Shows or hides an item managed by the sizer. To make a sizer item
9476 disappear or reappear, use Show followed by `Layout`. The *item*
9477 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
9478 the item. Use the recursive parameter to show or hide an item in a
9479 subsizer. Returns True if the item was found.
248ed943
RD
9480 """
9481 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
9482
9483 def IsShown(*args, **kwargs):
248ed943
RD
9484 """
9485 IsShown(self, item)
9486
9487 Determines if the item is currently shown. sizer. To make a sizer
9488 item disappear or reappear, use Show followed by `Layout`. The *item*
9489 parameter can be either a window, a sizer, or the zero-based index of
9490 the item.
9491 """
54f9ee45 9492 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 9493
7e63a440 9494 def Hide(self, item, recursive=False):
248ed943 9495 """
7e63a440 9496 A convenience method for Show(item, False, recursive).
248ed943 9497 """
06759a38 9498 return self.Show(item, False, recursive)
248ed943 9499
e811c8ce 9500 def ShowItems(*args, **kwargs):
248ed943
RD
9501 """
9502 ShowItems(self, bool show)
9503
84f85550 9504 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 9505 """
54f9ee45 9506 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 9507
d14a1e28
RD
9508
9509class SizerPtr(Sizer):
9510 def __init__(self, this):
9511 self.this = this
9512 if not hasattr(self,"thisown"): self.thisown = 0
9513 self.__class__ = Sizer
54f9ee45 9514_core_.Sizer_swigregister(SizerPtr)
d14a1e28
RD
9515
9516class PySizer(Sizer):
248ed943
RD
9517 """
9518 wx.PySizer is a special version of `wx.Sizer` that has been
9519 instrumented to allow the C++ virtual methods to be overloaded in
9520 Python derived classes. You would derive from this class if you are
9521 wanting to implement a custom sizer in Python code. Simply implement
9522 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
9523 For example::
9524
9525 class MySizer(wx.PySizer):
9526 def __init__(self):
9527 wx.PySizer.__init__(self)
9528
9529 def CalcMin(self):
9530 for item in self.GetChildren():
9531 # calculate the total minimum width and height needed
9532 # by all items in the sizer according to this sizer's
9533 # layout algorithm.
9534 ...
9535 return wx.Size(width, height)
9536
9537 def RecalcSizes(self):
9538 # find the space allotted to this sizer
9539 pos = self.GetPosition()
9540 size = self.GetSize()
9541 for item in self.GetChildren():
9542 # Recalculate (if necessary) the position and size of
9543 # each item and then call item.SetDimension to do the
9544 # actual positioning and sizing of the items within the
9545 # space alloted to this sizer.
9546 ...
9547 item.SetDimension(itemPos, itemSize)
9548
9549
9550 When `Layout` is called it first calls `CalcMin` followed by
9551 `RecalcSizes` so you can optimize a bit by saving the results of
9552 `CalcMin` and resuing them in `RecalcSizes`.
9553
9554 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
9555
9556
9557 """
e811c8ce
RD
9558 def __repr__(self):
9559 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9560 def __init__(self, *args, **kwargs):
248ed943
RD
9561 """
9562 __init__(self) -> PySizer
9563
9564 Creates a wx.PySizer. Must be called from the __init__ in the derived
9565 class.
9566 """
54f9ee45 9567 newobj = _core_.new_PySizer(*args, **kwargs)
d14a1e28
RD
9568 self.this = newobj.this
9569 self.thisown = 1
9570 del newobj.thisown
9571 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
e811c8ce
RD
9572
9573 def _setCallbackInfo(*args, **kwargs):
a95a7133 9574 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 9575 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 9576
d14a1e28
RD
9577
9578class PySizerPtr(PySizer):
9579 def __init__(self, this):
9580 self.this = this
9581 if not hasattr(self,"thisown"): self.thisown = 0
9582 self.__class__ = PySizer
54f9ee45 9583_core_.PySizer_swigregister(PySizerPtr)
d14a1e28
RD
9584
9585#---------------------------------------------------------------------------
9586
9587class BoxSizer(Sizer):
248ed943
RD
9588 """
9589 The basic idea behind a box sizer is that windows will most often be
9590 laid out in rather simple basic geometry, typically in a row or a
9591 column or nested hierarchies of either. A wx.BoxSizer will lay out
9592 its items in a simple row or column, depending on the orientation
9593 parameter passed to the constructor.
9594 """
e811c8ce
RD
9595 def __repr__(self):
9596 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9597 def __init__(self, *args, **kwargs):
248ed943
RD
9598 """
9599 __init__(self, int orient=HORIZONTAL) -> BoxSizer
9600
9601 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
9602 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
9603 sizer.
9604 """
54f9ee45 9605 newobj = _core_.new_BoxSizer(*args, **kwargs)
d14a1e28
RD
9606 self.this = newobj.this
9607 self.thisown = 1
9608 del newobj.thisown
9609 self._setOORInfo(self)
e811c8ce
RD
9610
9611 def GetOrientation(*args, **kwargs):
248ed943
RD
9612 """
9613 GetOrientation(self) -> int
9614
9615 Returns the current orientation of the sizer.
9616 """
54f9ee45 9617 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
9618
9619 def SetOrientation(*args, **kwargs):
248ed943
RD
9620 """
9621 SetOrientation(self, int orient)
e811c8ce 9622
248ed943
RD
9623 Resets the orientation of the sizer.
9624 """
9625 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 9626
d14a1e28
RD
9627
9628class BoxSizerPtr(BoxSizer):
9629 def __init__(self, this):
9630 self.this = this
9631 if not hasattr(self,"thisown"): self.thisown = 0
9632 self.__class__ = BoxSizer
54f9ee45 9633_core_.BoxSizer_swigregister(BoxSizerPtr)
d14a1e28
RD
9634
9635#---------------------------------------------------------------------------
9636
9637class StaticBoxSizer(BoxSizer):
248ed943
RD
9638 """
9639 wx.StaticBoxSizer derives from and functions identically to the
9640 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
9641 manages. Note that this static box must be created separately and
9642 passed to the sizer constructor.
9643 """
e811c8ce
RD
9644 def __repr__(self):
9645 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9646 def __init__(self, *args, **kwargs):
248ed943
RD
9647 """
9648 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
9649
9650 Constructor. It takes an associated static box and the orientation
9651 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
9652 ``wx.HORIZONTAL``.
9653 """
54f9ee45 9654 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
d14a1e28
RD
9655 self.this = newobj.this
9656 self.thisown = 1
9657 del newobj.thisown
9658 self._setOORInfo(self)
e811c8ce
RD
9659
9660 def GetStaticBox(*args, **kwargs):
248ed943
RD
9661 """
9662 GetStaticBox(self) -> StaticBox
e811c8ce 9663
248ed943
RD
9664 Returns the static box associated with this sizer.
9665 """
9666 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 9667
d14a1e28
RD
9668
9669class StaticBoxSizerPtr(StaticBoxSizer):
9670 def __init__(self, this):
9671 self.this = this
9672 if not hasattr(self,"thisown"): self.thisown = 0
9673 self.__class__ = StaticBoxSizer
54f9ee45 9674_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
d14a1e28
RD
9675
9676#---------------------------------------------------------------------------
9677
9678class GridSizer(Sizer):
248ed943
RD
9679 """
9680 A grid sizer is a sizer which lays out its children in a
9681 two-dimensional table with all cells having the same size. In other
9682 words, the width of each cell within the grid is the width of the
9683 widest item added to the sizer and the height of each grid cell is the
9684 height of the tallest item. An optional vertical and/or horizontal
9685 gap between items can also be specified (in pixels.)
9686
9687 Items are placed in the cells of the grid in the order they are added,
9688 in row-major order. In other words, the first row is filled first,
9689 then the second, and so on until all items have been added. (If
9690 neccessary, additional rows will be added as items are added.) If you
9691 need to have greater control over the cells that items are placed in
9692 then use the `wx.GridBagSizer`.
9693
9694 """
e811c8ce
RD
9695 def __repr__(self):
9696 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9697 def __init__(self, *args, **kwargs):
248ed943
RD
9698 """
9699 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
9700
9701 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
9702 of columns and rows in the sizer - if either of the parameters is
9703 zero, it will be calculated to from the total number of children in
9704 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9705 define extra space between all children.
9706 """
54f9ee45 9707 newobj = _core_.new_GridSizer(*args, **kwargs)
d14a1e28
RD
9708 self.this = newobj.this
9709 self.thisown = 1
9710 del newobj.thisown
9711 self._setOORInfo(self)
e811c8ce 9712
e811c8ce 9713 def SetCols(*args, **kwargs):
248ed943
RD
9714 """
9715 SetCols(self, int cols)
9716
9717 Sets the number of columns in the sizer.
9718 """
54f9ee45 9719 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
9720
9721 def SetRows(*args, **kwargs):
248ed943
RD
9722 """
9723 SetRows(self, int rows)
9724
9725 Sets the number of rows in the sizer.
9726 """
54f9ee45 9727 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
9728
9729 def SetVGap(*args, **kwargs):
248ed943
RD
9730 """
9731 SetVGap(self, int gap)
9732
9733 Sets the vertical gap (in pixels) between the cells in the sizer.
9734 """
54f9ee45 9735 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
9736
9737 def SetHGap(*args, **kwargs):
248ed943
RD
9738 """
9739 SetHGap(self, int gap)
9740
9741 Sets the horizontal gap (in pixels) between cells in the sizer
9742 """
54f9ee45 9743 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
9744
9745 def GetCols(*args, **kwargs):
248ed943
RD
9746 """
9747 GetCols(self) -> int
9748
9749 Returns the number of columns in the sizer.
9750 """
54f9ee45 9751 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
9752
9753 def GetRows(*args, **kwargs):
248ed943
RD
9754 """
9755 GetRows(self) -> int
9756
9757 Returns the number of rows in the sizer.
9758 """
54f9ee45 9759 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
9760
9761 def GetVGap(*args, **kwargs):
248ed943
RD
9762 """
9763 GetVGap(self) -> int
9764
9765 Returns the vertical gap (in pixels) between the cells in the sizer.
9766 """
54f9ee45 9767 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
9768
9769 def GetHGap(*args, **kwargs):
248ed943
RD
9770 """
9771 GetHGap(self) -> int
9772
9773 Returns the horizontal gap (in pixels) between cells in the sizer.
9774 """
54f9ee45 9775 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 9776
d14a1e28
RD
9777
9778class GridSizerPtr(GridSizer):
9779 def __init__(self, this):
9780 self.this = this
9781 if not hasattr(self,"thisown"): self.thisown = 0
9782 self.__class__ = GridSizer
54f9ee45 9783_core_.GridSizer_swigregister(GridSizerPtr)
d14a1e28
RD
9784
9785#---------------------------------------------------------------------------
9786
54f9ee45
RD
9787FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
9788FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
9789FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 9790class FlexGridSizer(GridSizer):
248ed943
RD
9791 """
9792 A flex grid sizer is a sizer which lays out its children in a
9793 two-dimensional table with all table cells in one row having the same
9794 height and all cells in one column having the same width, but all
9795 rows or all columns are not necessarily the same height or width as in
9796 the `wx.GridSizer`.
9797
9798 wx.FlexGridSizer can also size items equally in one direction but
9799 unequally ("flexibly") in the other. If the sizer is only flexible
9800 in one direction (this can be changed using `SetFlexibleDirection`), it
9801 needs to be decided how the sizer should grow in the other ("non
9802 flexible") direction in order to fill the available space. The
9803 `SetNonFlexibleGrowMode` method serves this purpose.
9804
9805
9806 """
e811c8ce
RD
9807 def __repr__(self):
9808 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9809 def __init__(self, *args, **kwargs):
248ed943
RD
9810 """
9811 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
9812
9813 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
9814 number of columns and rows in the sizer - if either of the parameters
9815 is zero, it will be calculated to from the total number of children in
9816 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9817 define extra space between all children.
9818 """
54f9ee45 9819 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
d14a1e28
RD
9820 self.this = newobj.this
9821 self.thisown = 1
9822 del newobj.thisown
9823 self._setOORInfo(self)
e811c8ce 9824
248ed943
RD
9825 def AddGrowableRow(*args, **kwargs):
9826 """
9827 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 9828
248ed943
RD
9829 Specifies that row *idx* (starting from zero) should be grown if there
9830 is extra space available to the sizer.
e811c8ce 9831
248ed943
RD
9832 The *proportion* parameter has the same meaning as the stretch factor
9833 for the box sizers except that if all proportions are 0, then all
9834 columns are resized equally (instead of not being resized at all).
9835 """
54f9ee45 9836 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
9837
9838 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
9839 """
9840 RemoveGrowableRow(self, size_t idx)
9841
9842 Specifies that row *idx* is no longer growable.
9843 """
54f9ee45 9844 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
9845
9846 def AddGrowableCol(*args, **kwargs):
248ed943
RD
9847 """
9848 AddGrowableCol(self, size_t idx, int proportion=0)
9849
9850 Specifies that column *idx* (starting from zero) should be grown if
9851 there is extra space available to the sizer.
9852
9853 The *proportion* parameter has the same meaning as the stretch factor
9854 for the box sizers except that if all proportions are 0, then all
9855 columns are resized equally (instead of not being resized at all).
9856 """
54f9ee45 9857 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
9858
9859 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
9860 """
9861 RemoveGrowableCol(self, size_t idx)
9862
9863 Specifies that column *idx* is no longer growable.
9864 """
54f9ee45 9865 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
9866
9867 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
9868 """
9869 SetFlexibleDirection(self, int direction)
9870
9871 Specifies whether the sizer should flexibly resize its columns, rows,
9872 or both. Argument *direction* can be one of the following values. Any
9873 other value is ignored.
9874
9875 ============== =======================================
9876 wx.VERTICAL Rows are flexibly sized.
9877 wx.HORIZONTAL Columns are flexibly sized.
9878 wx.BOTH Both rows and columns are flexibly sized
9879 (this is the default value).
9880 ============== =======================================
9881
9882 Note that this method does not trigger relayout.
9883
9884 """
54f9ee45 9885 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
9886
9887 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
9888 """
9889 GetFlexibleDirection(self) -> int
9890
9891 Returns a value that specifies whether the sizer
9892 flexibly resizes its columns, rows, or both (default).
9893
9894 :see: `SetFlexibleDirection`
9895 """
54f9ee45 9896 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
9897
9898 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
9899 """
9900 SetNonFlexibleGrowMode(self, int mode)
9901
9902 Specifies how the sizer should grow in the non-flexible direction if
9903 there is one (so `SetFlexibleDirection` must have been called
9904 previously). Argument *mode* can be one of the following values:
9905
9906 ========================== =================================================
9907 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
9908 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
9909 `AddGrowableCol` and `AddGrowableRow`. In this
9910 case equal sizing applies to minimum sizes of
9911 columns or rows (this is the default value).
9912 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
9913 the non flexible direction, whether they are
9914 growable or not in the flexbile direction.
9915 ========================== =================================================
9916
9917 Note that this method does not trigger relayout.
9918
9919
9920 """
54f9ee45 9921 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
9922
9923 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
9924 """
9925 GetNonFlexibleGrowMode(self) -> int
9926
9927 Returns the value that specifies how the sizer grows in the
9928 non-flexible direction if there is one.
9929
9930 :see: `SetNonFlexibleGrowMode`
9931 """
54f9ee45 9932 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
9933
9934 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
9935 """
9936 GetRowHeights(self) -> list
9937
9938 Returns a list of integers representing the heights of each of the
9939 rows in the sizer.
9940 """
54f9ee45 9941 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
9942
9943 def GetColWidths(*args, **kwargs):
fd2dc343
RD
9944 """
9945 GetColWidths(self) -> list
9946
9947 Returns a list of integers representing the widths of each of the
9948 columns in the sizer.
9949 """
54f9ee45 9950 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 9951
d14a1e28
RD
9952
9953class FlexGridSizerPtr(FlexGridSizer):
9954 def __init__(self, this):
9955 self.this = this
9956 if not hasattr(self,"thisown"): self.thisown = 0
9957 self.__class__ = FlexGridSizer
54f9ee45 9958_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
d14a1e28
RD
9959
9960#---------------------------------------------------------------------------
9961
9962class GBPosition(object):
248ed943
RD
9963 """
9964 This class represents the position of an item in a virtual grid of
9965 rows and columns managed by a `wx.GridBagSizer`. wxPython has
9966 typemaps that will automatically convert from a 2-element sequence of
9967 integers to a wx.GBPosition, so you can use the more pythonic
9968 representation of the position nearly transparently in Python code.
9969 """
e811c8ce
RD
9970 def __repr__(self):
9971 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9972 def __init__(self, *args, **kwargs):
248ed943
RD
9973 """
9974 __init__(self, int row=0, int col=0) -> GBPosition
9975
9976 This class represents the position of an item in a virtual grid of
9977 rows and columns managed by a `wx.GridBagSizer`. wxPython has
9978 typemaps that will automatically convert from a 2-element sequence of
9979 integers to a wx.GBPosition, so you can use the more pythonic
9980 representation of the position nearly transparently in Python code.
9981 """
54f9ee45 9982 newobj = _core_.new_GBPosition(*args, **kwargs)
d14a1e28
RD
9983 self.this = newobj.this
9984 self.thisown = 1
9985 del newobj.thisown
e811c8ce 9986 def GetRow(*args, **kwargs):
a95a7133 9987 """GetRow(self) -> int"""
54f9ee45 9988 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
9989
9990 def GetCol(*args, **kwargs):
a95a7133 9991 """GetCol(self) -> int"""
54f9ee45 9992 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
9993
9994 def SetRow(*args, **kwargs):
a95a7133 9995 """SetRow(self, int row)"""
54f9ee45 9996 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
9997
9998 def SetCol(*args, **kwargs):
a95a7133 9999 """SetCol(self, int col)"""
54f9ee45 10000 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
10001
10002 def __eq__(*args, **kwargs):
a95a7133 10003 """__eq__(self, GBPosition other) -> bool"""
54f9ee45 10004 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
10005
10006 def __ne__(*args, **kwargs):
a95a7133 10007 """__ne__(self, GBPosition other) -> bool"""
54f9ee45 10008 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
10009
10010 def Set(*args, **kwargs):
a95a7133 10011 """Set(self, int row=0, int col=0)"""
54f9ee45 10012 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
10013
10014 def Get(*args, **kwargs):
a95a7133 10015 """Get(self) -> PyObject"""
54f9ee45 10016 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 10017
41e2b43e 10018 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
10019 def __str__(self): return str(self.Get())
10020 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
10021 def __len__(self): return len(self.Get())
10022 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
10023 def __setitem__(self, index, val):
10024 if index == 0: self.SetRow(val)
10025 elif index == 1: self.SetCol(val)
10026 else: raise IndexError
e811c8ce 10027 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
10028 __safe_for_unpickling__ = True
10029 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
10030
10031 row = property(GetRow, SetRow)
10032 col = property(GetCol, SetCol)
10033
10034
10035class GBPositionPtr(GBPosition):
10036 def __init__(self, this):
10037 self.this = this
10038 if not hasattr(self,"thisown"): self.thisown = 0
10039 self.__class__ = GBPosition
54f9ee45 10040_core_.GBPosition_swigregister(GBPositionPtr)
d14a1e28
RD
10041
10042class GBSpan(object):
248ed943
RD
10043 """
10044 This class is used to hold the row and column spanning attributes of
10045 items in a `wx.GridBagSizer`. wxPython has typemaps that will
10046 automatically convert from a 2-element sequence of integers to a
10047 wx.GBSpan, so you can use the more pythonic representation of the span
10048 nearly transparently in Python code.
10049
10050 """
e811c8ce
RD
10051 def __repr__(self):
10052 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10053 def __init__(self, *args, **kwargs):
248ed943
RD
10054 """
10055 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
10056
10057 Construct a new wxGBSpan, optionally setting the rowspan and
10058 colspan. The default is (1,1). (Meaning that the item occupies one
10059 cell in each direction.
10060 """
54f9ee45 10061 newobj = _core_.new_GBSpan(*args, **kwargs)
d14a1e28
RD
10062 self.this = newobj.this
10063 self.thisown = 1
10064 del newobj.thisown
e811c8ce 10065 def GetRowspan(*args, **kwargs):
a95a7133 10066 """GetRowspan(self) -> int"""
54f9ee45 10067 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
10068
10069 def GetColspan(*args, **kwargs):
a95a7133 10070 """GetColspan(self) -> int"""
54f9ee45 10071 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
10072
10073 def SetRowspan(*args, **kwargs):
a95a7133 10074 """SetRowspan(self, int rowspan)"""
54f9ee45 10075 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
10076
10077 def SetColspan(*args, **kwargs):
a95a7133 10078 """SetColspan(self, int colspan)"""
54f9ee45 10079 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
10080
10081 def __eq__(*args, **kwargs):
a95a7133 10082 """__eq__(self, GBSpan other) -> bool"""
54f9ee45 10083 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
10084
10085 def __ne__(*args, **kwargs):
a95a7133 10086 """__ne__(self, GBSpan other) -> bool"""
54f9ee45 10087 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
10088
10089 def Set(*args, **kwargs):
a95a7133 10090 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 10091 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
10092
10093 def Get(*args, **kwargs):
a95a7133 10094 """Get(self) -> PyObject"""
54f9ee45 10095 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 10096
41e2b43e 10097 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
10098 def __str__(self): return str(self.Get())
10099 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
10100 def __len__(self): return len(self.Get())
10101 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
10102 def __setitem__(self, index, val):
10103 if index == 0: self.SetRowspan(val)
10104 elif index == 1: self.SetColspan(val)
10105 else: raise IndexError
e811c8ce 10106 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
10107 __safe_for_unpickling__ = True
10108 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
10109
10110 rowspan = property(GetRowspan, SetRowspan)
10111 colspan = property(GetColspan, SetColspan)
10112
10113
10114class GBSpanPtr(GBSpan):
10115 def __init__(self, this):
10116 self.this = this
10117 if not hasattr(self,"thisown"): self.thisown = 0
10118 self.__class__ = GBSpan
54f9ee45 10119_core_.GBSpan_swigregister(GBSpanPtr)
d14a1e28
RD
10120
10121class GBSizerItem(SizerItem):
248ed943
RD
10122 """
10123 The wx.GBSizerItem class is used to track the additional data about
10124 items in a `wx.GridBagSizer` such as the item's position in the grid
10125 and how many rows or columns it spans.
10126
10127 """
e811c8ce
RD
10128 def __repr__(self):
10129 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10130 def __init__(self, *args, **kwargs):
248ed943
RD
10131 """
10132 __init__(self) -> GBSizerItem
10133
10134 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
10135 size will need to be set, as well as a position and span before this
10136 item can be used in a Sizer.
10137
10138 You will probably never need to create a wx.GBSizerItem directly as they
10139 are created automatically when the sizer's Add method is called.
10140 """
54f9ee45 10141 newobj = _core_.new_GBSizerItem(*args, **kwargs)
d14a1e28
RD
10142 self.this = newobj.this
10143 self.thisown = 1
10144 del newobj.thisown
e811c8ce 10145 def GetPos(*args, **kwargs):
248ed943
RD
10146 """
10147 GetPos(self) -> GBPosition
10148
10149 Get the grid position of the item
10150 """
54f9ee45 10151 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
10152
10153 def GetPosTuple(self): return self.GetPos().Get()
10154 def GetSpan(*args, **kwargs):
248ed943
RD
10155 """
10156 GetSpan(self) -> GBSpan
10157
10158 Get the row and column spanning of the item
10159 """
54f9ee45 10160 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
10161
10162 def GetSpanTuple(self): return self.GetSpan().Get()
10163 def SetPos(*args, **kwargs):
248ed943
RD
10164 """
10165 SetPos(self, GBPosition pos) -> bool
10166
10167 If the item is already a member of a sizer then first ensure that
10168 there is no other item that would intersect with this one at the new
10169 position, then set the new position. Returns True if the change is
10170 successful and after the next Layout() the item will be moved.
10171 """
54f9ee45 10172 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
10173
10174 def SetSpan(*args, **kwargs):
248ed943
RD
10175 """
10176 SetSpan(self, GBSpan span) -> bool
10177
10178 If the item is already a member of a sizer then first ensure that
10179 there is no other item that would intersect with this one with its new
10180 spanning size, then set the new spanning. Returns True if the change
10181 is successful and after the next Layout() the item will be resized.
10182
10183 """
54f9ee45 10184 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 10185
248ed943 10186 def Intersects(*args, **kwargs):
0df68c9f 10187 """
a95a7133 10188 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
10189
10190 Returns True if this item and the other item instersect.
0df68c9f 10191 """
248ed943
RD
10192 return _core_.GBSizerItem_Intersects(*args, **kwargs)
10193
10194 def IntersectsPos(*args, **kwargs):
10195 """
10196 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
10197
10198 Returns True if the given pos/span would intersect with this item.
10199 """
10200 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
10201
10202 def GetEndPos(*args, **kwargs):
248ed943
RD
10203 """
10204 GetEndPos(self) -> GBPosition
10205
10206 Get the row and column of the endpoint of this item.
10207 """
54f9ee45 10208 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
10209
10210 def GetGBSizer(*args, **kwargs):
248ed943
RD
10211 """
10212 GetGBSizer(self) -> GridBagSizer
10213
10214 Get the sizer this item is a member of.
10215 """
54f9ee45 10216 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
10217
10218 def SetGBSizer(*args, **kwargs):
248ed943
RD
10219 """
10220 SetGBSizer(self, GridBagSizer sizer)
10221
10222 Set the sizer this item is a member of.
10223 """
54f9ee45 10224 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 10225
d14a1e28
RD
10226
10227class GBSizerItemPtr(GBSizerItem):
10228 def __init__(self, this):
10229 self.this = this
10230 if not hasattr(self,"thisown"): self.thisown = 0
10231 self.__class__ = GBSizerItem
54f9ee45 10232_core_.GBSizerItem_swigregister(GBSizerItemPtr)
d14a1e28
RD
10233DefaultSpan = cvar.DefaultSpan
10234
10235def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
10236 """
10237 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
10238 int border, PyObject userData=None) -> GBSizerItem
10239
10240 Construct a `wx.GBSizerItem` for a window.
0df68c9f 10241 """
54f9ee45 10242 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
10243 val.thisown = 1
10244 return val
10245
10246def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
10247 """
10248 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
10249 int border, PyObject userData=None) -> GBSizerItem
10250
10251 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 10252 """
54f9ee45 10253 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
10254 val.thisown = 1
10255 return val
10256
10257def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
10258 """
10259 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
10260 int flag, int border, PyObject userData=None) -> GBSizerItem
10261
10262 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 10263 """
54f9ee45 10264 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
10265 val.thisown = 1
10266 return val
10267
10268class GridBagSizer(FlexGridSizer):
248ed943
RD
10269 """
10270 A `wx.Sizer` that can lay out items in a virtual grid like a
10271 `wx.FlexGridSizer` but in this case explicit positioning of the items
10272 is allowed using `wx.GBPosition`, and items can optionally span more
10273 than one row and/or column using `wx.GBSpan`. The total size of the
10274 virtual grid is determined by the largest row and column that items are
10275 positioned at, adjusted for spanning.
10276
10277 """
e811c8ce
RD
10278 def __repr__(self):
10279 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10280 def __init__(self, *args, **kwargs):
248ed943
RD
10281 """
10282 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
10283
10284 Constructor, with optional parameters to specify the gap between the
10285 rows and columns.
10286 """
54f9ee45 10287 newobj = _core_.new_GridBagSizer(*args, **kwargs)
d14a1e28
RD
10288 self.this = newobj.this
10289 self.thisown = 1
10290 del newobj.thisown
e811c8ce 10291 def Add(*args, **kwargs):
0df68c9f 10292 """
248ed943 10293 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 10294 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
10295
10296 Adds an item to the sizer at the grid cell *pos*, optionally spanning
10297 more than one row or column as specified with *span*. The remaining
10298 args behave similarly to `wx.Sizer.Add`.
10299
10300 Returns True if the item was successfully placed at the given cell
10301 position, False if something was already there.
10302
0df68c9f 10303 """
54f9ee45 10304 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
10305
10306 def AddItem(*args, **kwargs):
248ed943 10307 """
d3b6e4ff 10308 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
10309
10310 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
10311 the item was successfully placed at its given cell position, False if
10312 something was already there.
10313 """
54f9ee45 10314 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 10315
84f85550
RD
10316 def GetCellSize(*args, **kwargs):
10317 """
10318 GetCellSize(self, int row, int col) -> Size
10319
10320 Get the size of the specified cell, including hgap and
10321 vgap. Only valid after a Layout.
10322 """
10323 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
10324
e811c8ce 10325 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
10326 """
10327 GetEmptyCellSize(self) -> Size
10328
10329 Get the size used for cells in the grid with no item.
10330 """
54f9ee45 10331 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
10332
10333 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
10334 """
10335 SetEmptyCellSize(self, Size sz)
10336
10337 Set the size used for cells in the grid with no item.
10338 """
54f9ee45 10339 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
10340
10341 def GetItemPosition(*args):
0df68c9f 10342 """
248ed943
RD
10343 GetItemPosition(self, item) -> GBPosition
10344
10345 Get the grid position of the specified *item* where *item* is either a
10346 window or subsizer that is a member of this sizer, or a zero-based
10347 index of an item.
0df68c9f 10348 """
54f9ee45 10349 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
10350
10351 def SetItemPosition(*args):
0df68c9f 10352 """
248ed943
RD
10353 SetItemPosition(self, item, GBPosition pos) -> bool
10354
10355 Set the grid position of the specified *item* where *item* is either a
10356 window or subsizer that is a member of this sizer, or a zero-based
10357 index of an item. Returns True on success. If the move is not
10358 allowed (because an item is already there) then False is returned.
10359
0df68c9f 10360 """
54f9ee45 10361 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
10362
10363 def GetItemSpan(*args):
0df68c9f 10364 """
248ed943
RD
10365 GetItemSpan(self, item) -> GBSpan
10366
10367 Get the row/col spanning of the specified *item* where *item* is
10368 either a window or subsizer that is a member of this sizer, or a
10369 zero-based index of an item.
0df68c9f 10370 """
54f9ee45 10371 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
10372
10373 def SetItemSpan(*args):
0df68c9f 10374 """
248ed943
RD
10375 SetItemSpan(self, item, GBSpan span) -> bool
10376
10377 Set the row/col spanning of the specified *item* where *item* is
10378 either a window or subsizer that is a member of this sizer, or a
10379 zero-based index of an item. Returns True on success. If the move is
10380 not allowed (because an item is already there) then False is returned.
0df68c9f 10381 """
54f9ee45 10382 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
10383
10384 def FindItem(*args):
0df68c9f 10385 """
248ed943
RD
10386 FindItem(self, item) -> GBSizerItem
10387
10388 Find the sizer item for the given window or subsizer, returns None if
10389 not found. (non-recursive)
0df68c9f 10390 """
54f9ee45 10391 return _core_.GridBagSizer_FindItem(*args)
e811c8ce
RD
10392
10393 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
10394 """
10395 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
10396
10397 Return the sizer item for the given grid cell, or None if there is no
10398 item at that position. (non-recursive)
10399 """
54f9ee45 10400 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
10401
10402 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
10403 """
10404 FindItemAtPoint(self, Point pt) -> GBSizerItem
10405
10406 Return the sizer item located at the point given in *pt*, or None if
10407 there is no item at that point. The (x,y) coordinates in pt correspond
10408 to the client coordinates of the window using the sizer for
10409 layout. (non-recursive)
10410 """
54f9ee45 10411 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 10412
248ed943
RD
10413 def CheckForIntersection(*args, **kwargs):
10414 """
10415 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 10416
248ed943
RD
10417 Look at all items and see if any intersect (or would overlap) the
10418 given *item*. Returns True if so, False if there would be no overlap.
10419 If an *excludeItem* is given then it will not be checked for
10420 intersection, for example it may be the item we are checking the
10421 position of.
e811c8ce 10422
248ed943
RD
10423 """
10424 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 10425
248ed943 10426 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 10427 """
248ed943
RD
10428 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
10429
10430 Look at all items and see if any intersect (or would overlap) the
10431 given position and span. Returns True if so, False if there would be
10432 no overlap. If an *excludeItem* is given then it will not be checked
10433 for intersection, for example it may be the item we are checking the
10434 position of.
0df68c9f 10435 """
248ed943 10436 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 10437
d14a1e28
RD
10438
10439class GridBagSizerPtr(GridBagSizer):
10440 def __init__(self, this):
10441 self.this = this
10442 if not hasattr(self,"thisown"): self.thisown = 0
10443 self.__class__ = GridBagSizer
54f9ee45 10444_core_.GridBagSizer_swigregister(GridBagSizerPtr)
d14a1e28
RD
10445
10446#---------------------------------------------------------------------------
10447
54f9ee45
RD
10448Left = _core_.Left
10449Top = _core_.Top
10450Right = _core_.Right
10451Bottom = _core_.Bottom
10452Width = _core_.Width
10453Height = _core_.Height
10454Centre = _core_.Centre
10455Center = _core_.Center
10456CentreX = _core_.CentreX
10457CentreY = _core_.CentreY
10458Unconstrained = _core_.Unconstrained
10459AsIs = _core_.AsIs
10460PercentOf = _core_.PercentOf
10461Above = _core_.Above
10462Below = _core_.Below
10463LeftOf = _core_.LeftOf
10464RightOf = _core_.RightOf
10465SameAs = _core_.SameAs
10466Absolute = _core_.Absolute
d14a1e28 10467class IndividualLayoutConstraint(Object):
15afbcd0 10468 """
41e2b43e
RD
10469 Objects of this class are stored in the `wx.LayoutConstraints` class as
10470 one of eight possible constraints that a window can be involved in.
10471 You will never need to create an instance of
10472 wx.IndividualLayoutConstraint, rather you should create a
10473 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 10474 that it contains.
15afbcd0 10475 """
d14a1e28
RD
10476 def __init__(self): raise RuntimeError, "No constructor defined"
10477 def __repr__(self):
10478 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 10479 def Set(*args, **kwargs):
41e2b43e
RD
10480 """
10481 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
10482
10483 Sets the properties of the constraint. Normally called by one of the
10484 convenience functions such as Above, RightOf, SameAs.
10485 """
54f9ee45 10486 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
10487
10488 def LeftOf(*args, **kwargs):
15afbcd0 10489 """
a95a7133 10490 LeftOf(self, Window sibling, int marg=0)
15afbcd0 10491
41e2b43e
RD
10492 Constrains this edge to be to the left of the given window, with an
10493 optional margin. Implicitly, this is relative to the left edge of the
10494 other window.
15afbcd0 10495 """
54f9ee45 10496 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
10497
10498 def RightOf(*args, **kwargs):
15afbcd0 10499 """
a95a7133 10500 RightOf(self, Window sibling, int marg=0)
15afbcd0 10501
41e2b43e
RD
10502 Constrains this edge to be to the right of the given window, with an
10503 optional margin. Implicitly, this is relative to the right edge of the
10504 other window.
15afbcd0 10505 """
54f9ee45 10506 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
10507
10508 def Above(*args, **kwargs):
15afbcd0 10509 """
a95a7133 10510 Above(self, Window sibling, int marg=0)
15afbcd0 10511
41e2b43e
RD
10512 Constrains this edge to be above the given window, with an optional
10513 margin. Implicitly, this is relative to the top edge of the other
10514 window.
15afbcd0 10515 """
54f9ee45 10516 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
10517
10518 def Below(*args, **kwargs):
15afbcd0 10519 """
a95a7133 10520 Below(self, Window sibling, int marg=0)
15afbcd0 10521
41e2b43e
RD
10522 Constrains this edge to be below the given window, with an optional
10523 margin. Implicitly, this is relative to the bottom edge of the other
10524 window.
15afbcd0 10525 """
54f9ee45 10526 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
10527
10528 def SameAs(*args, **kwargs):
15afbcd0 10529 """
a95a7133 10530 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 10531
41e2b43e
RD
10532 Constrains this edge or dimension to be to the same as the edge of the
10533 given window, with an optional margin.
15afbcd0 10534 """
54f9ee45 10535 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
10536
10537 def PercentOf(*args, **kwargs):
15afbcd0 10538 """
a95a7133 10539 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 10540
41e2b43e
RD
10541 Constrains this edge or dimension to be to a percentage of the given
10542 window, with an optional margin.
15afbcd0 10543 """
54f9ee45 10544 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
10545
10546 def Absolute(*args, **kwargs):
15afbcd0 10547 """
a95a7133 10548 Absolute(self, int val)
15afbcd0 10549
41e2b43e 10550 Constrains this edge or dimension to be the given absolute value.
15afbcd0 10551 """
54f9ee45 10552 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
10553
10554 def Unconstrained(*args, **kwargs):
15afbcd0 10555 """
a95a7133 10556 Unconstrained(self)
15afbcd0 10557
41e2b43e
RD
10558 Sets this edge or dimension to be unconstrained, that is, dependent on
10559 other edges and dimensions from which this value can be deduced.
15afbcd0 10560 """
54f9ee45 10561 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
10562
10563 def AsIs(*args, **kwargs):
15afbcd0 10564 """
a95a7133 10565 AsIs(self)
15afbcd0 10566
41e2b43e
RD
10567 Sets this edge or constraint to be whatever the window's value is at
10568 the moment. If either of the width and height constraints are *as is*,
10569 the window will not be resized, but moved instead. This is important
10570 when considering panel items which are intended to have a default
10571 size, such as a button, which may take its size from the size of the
10572 button label.
15afbcd0 10573 """
54f9ee45 10574 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
10575
10576 def GetOtherWindow(*args, **kwargs):
a95a7133 10577 """GetOtherWindow(self) -> Window"""
54f9ee45 10578 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
10579
10580 def GetMyEdge(*args, **kwargs):
a95a7133 10581 """GetMyEdge(self) -> int"""
54f9ee45 10582 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
10583
10584 def SetEdge(*args, **kwargs):
a95a7133 10585 """SetEdge(self, int which)"""
54f9ee45 10586 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
10587
10588 def SetValue(*args, **kwargs):
a95a7133 10589 """SetValue(self, int v)"""
54f9ee45 10590 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
10591
10592 def GetMargin(*args, **kwargs):
a95a7133 10593 """GetMargin(self) -> int"""
54f9ee45 10594 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
10595
10596 def SetMargin(*args, **kwargs):
a95a7133 10597 """SetMargin(self, int m)"""
54f9ee45 10598 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
10599
10600 def GetValue(*args, **kwargs):
a95a7133 10601 """GetValue(self) -> int"""
54f9ee45 10602 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
10603
10604 def GetPercent(*args, **kwargs):
a95a7133 10605 """GetPercent(self) -> int"""
54f9ee45 10606 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
10607
10608 def GetOtherEdge(*args, **kwargs):
a95a7133 10609 """GetOtherEdge(self) -> int"""
54f9ee45 10610 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
10611
10612 def GetDone(*args, **kwargs):
a95a7133 10613 """GetDone(self) -> bool"""
54f9ee45 10614 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
10615
10616 def SetDone(*args, **kwargs):
a95a7133 10617 """SetDone(self, bool d)"""
54f9ee45 10618 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
10619
10620 def GetRelationship(*args, **kwargs):
a95a7133 10621 """GetRelationship(self) -> int"""
54f9ee45 10622 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
10623
10624 def SetRelationship(*args, **kwargs):
a95a7133 10625 """SetRelationship(self, int r)"""
54f9ee45 10626 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
10627
10628 def ResetIfWin(*args, **kwargs):
15afbcd0 10629 """
a95a7133 10630 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
10631
10632 Reset constraint if it mentions otherWin
10633 """
54f9ee45 10634 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
10635
10636 def SatisfyConstraint(*args, **kwargs):
15afbcd0 10637 """
a95a7133 10638 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
10639
10640 Try to satisfy constraint
10641 """
54f9ee45 10642 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
10643
10644 def GetEdge(*args, **kwargs):
15afbcd0 10645 """
a95a7133 10646 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
10647
10648 Get the value of this edge or dimension, or if this
10649 is not determinable, -1.
10650 """
54f9ee45 10651 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 10652
d14a1e28
RD
10653
10654class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
10655 def __init__(self, this):
10656 self.this = this
10657 if not hasattr(self,"thisown"): self.thisown = 0
10658 self.__class__ = IndividualLayoutConstraint
54f9ee45 10659_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
d14a1e28
RD
10660
10661class LayoutConstraints(Object):
15afbcd0 10662 """
41e2b43e
RD
10663 **Note:** constraints are now deprecated and you should use sizers
10664 instead.
15afbcd0 10665
41e2b43e
RD
10666 Objects of this class can be associated with a window to define its
10667 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
10668
10669 The class consists of the following eight constraints of class
10670 wx.IndividualLayoutConstraint, some or all of which should be accessed
10671 directly to set the appropriate constraints.
10672
10673 * left: represents the left hand edge of the window
10674 * right: represents the right hand edge of the window
10675 * top: represents the top edge of the window
10676 * bottom: represents the bottom edge of the window
10677 * width: represents the width of the window
10678 * height: represents the height of the window
10679 * centreX: represents the horizontal centre point of the window
10680 * centreY: represents the vertical centre point of the window
10681
41e2b43e
RD
10682 Most constraints are initially set to have the relationship
10683 wxUnconstrained, which means that their values should be calculated by
10684 looking at known constraints. The exceptions are width and height,
10685 which are set to wxAsIs to ensure that if the user does not specify a
10686 constraint, the existing width and height will be used, to be
10687 compatible with panel items which often have take a default size. If
10688 the constraint is ``wx.AsIs``, the dimension will not be changed.
10689
10690 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
10691
10692 """
e811c8ce
RD
10693 def __repr__(self):
10694 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
10695 left = property(_core_.LayoutConstraints_left_get)
10696 top = property(_core_.LayoutConstraints_top_get)
10697 right = property(_core_.LayoutConstraints_right_get)
10698 bottom = property(_core_.LayoutConstraints_bottom_get)
10699 width = property(_core_.LayoutConstraints_width_get)
10700 height = property(_core_.LayoutConstraints_height_get)
10701 centreX = property(_core_.LayoutConstraints_centreX_get)
10702 centreY = property(_core_.LayoutConstraints_centreY_get)
d14a1e28 10703 def __init__(self, *args, **kwargs):
a95a7133 10704 """__init__(self) -> LayoutConstraints"""
54f9ee45 10705 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
d14a1e28
RD
10706 self.this = newobj.this
10707 self.thisown = 1
10708 del newobj.thisown
e811c8ce 10709 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 10710 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 10711 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
10712
10713 def AreSatisfied(*args, **kwargs):
a95a7133 10714 """AreSatisfied(self) -> bool"""
54f9ee45 10715 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 10716
d14a1e28
RD
10717
10718class LayoutConstraintsPtr(LayoutConstraints):
10719 def __init__(self, this):
10720 self.this = this
10721 if not hasattr(self,"thisown"): self.thisown = 0
10722 self.__class__ = LayoutConstraints
54f9ee45 10723_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
d14a1e28
RD
10724
10725#----------------------------------------------------------------------------
10726
322913ce 10727# Use Python's bool constants if available, make some if not
d14a1e28
RD
10728try:
10729 True
10730except NameError:
322913ce
RD
10731 __builtins__.True = 1==1
10732 __builtins__.False = 1==0
4f89f6a3
RD
10733 def bool(value): return not not value
10734 __builtins__.bool = bool
d14a1e28 10735
d14a1e28
RD
10736
10737
10738# workarounds for bad wxRTTI names
10739__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
10740__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
10741__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
10742
10743
10744#----------------------------------------------------------------------------
10745# Load version numbers from __version__... Ensure that major and minor
7bc1e663 10746# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
10747
10748from __version__ import *
10749__version__ = VERSION_STRING
10750
7bc1e663
RD
10751assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
10752assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 10753if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 10754 import warnings
7bc1e663 10755 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28
RD
10756
10757#----------------------------------------------------------------------------
10758
10759class PyDeadObjectError(AttributeError):
10760 pass
10761
d14a1e28
RD
10762class _wxPyDeadObject(object):
10763 """
10764 Instances of wx objects that are OOR capable will have their __class__
10765 changed to this class when the C++ object is deleted. This should help
10766 prevent crashes due to referencing a bogus C++ pointer.
10767 """
10768 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
10769 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
10770
3a04f143 10771 def __repr__(self):
d14a1e28
RD
10772 if not hasattr(self, "_name"):
10773 self._name = "[unknown]"
10774 return self.reprStr % self._name
10775
3a04f143 10776 def __getattr__(self, *args):
d14a1e28
RD
10777 if not hasattr(self, "_name"):
10778 self._name = "[unknown]"
3a04f143
RD
10779 raise PyDeadObjectError(self.attrStr % self._name)
10780
10781 def __nonzero__(self):
10782 return 0
10783
10784
10785
10786class PyUnbornObjectError(AttributeError):
10787 pass
10788
10789class _wxPyUnbornObject(object):
10790 """
54f9ee45 10791 Some stock objects are created when the wx._core module is
3a04f143
RD
10792 imported, but their C++ instance is not created until the wx.App
10793 object is created and initialized. These object instances will
10794 temporarily have their __class__ changed to this class so an
10795 exception will be raised if they are used before the C++ instance
10796 is ready.
10797 """
10798
10799 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
10800 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
10801
10802 def __repr__(self):
10803 #if not hasattr(self, "_name"):
10804 # self._name = "[unknown]"
10805 return self.reprStr #% self._name
10806
10807 def __getattr__(self, *args):
10808 #if not hasattr(self, "_name"):
10809 # self._name = "[unknown]"
10810 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
10811
10812 def __nonzero__(self):
10813 return 0
10814
10815
10816#----------------------------------------------------------------------------
d14a1e28
RD
10817
10818def CallAfter(callable, *args, **kw):
10819 """
10820 Call the specified function after the current and pending event
10821 handlers have been completed. This is also good for making GUI
61863841
RD
10822 method calls from non-GUI threads. Any extra positional or
10823 keyword args are passed on to the callable when it is called.
10824
10825 :see: `wx.FutureCall`
d14a1e28
RD
10826 """
10827 app = wx.GetApp()
dfbb5885 10828 assert app is not None, 'No wx.App created yet'
d14a1e28 10829
148275d3
RD
10830 if not hasattr(app, "_CallAfterId"):
10831 app._CallAfterId = wx.NewEventType()
10832 app.Connect(-1, -1, app._CallAfterId,
10833 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 10834 evt = wx.PyEvent()
148275d3 10835 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
10836 evt.callable = callable
10837 evt.args = args
10838 evt.kw = kw
10839 wx.PostEvent(app, evt)
10840
d14a1e28
RD
10841#----------------------------------------------------------------------------
10842
10843
10844class FutureCall:
10845 """
8ac8dba0 10846 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
10847 object once after the given amount of milliseconds, passing any
10848 positional or keyword args. The return value of the callable is
61863841 10849 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
10850
10851 If you don't need to get the return value or restart the timer
10852 then there is no need to hold a reference to this object. It will
10853 hold a reference to itself while the timer is running (the timer
10854 has a reference to self.Notify) but the cycle will be broken when
10855 the timer completes, automatically cleaning up the wx.FutureCall
10856 object.
61863841
RD
10857
10858 :see: `wx.CallAfter`
d14a1e28
RD
10859 """
10860 def __init__(self, millis, callable, *args, **kwargs):
10861 self.millis = millis
10862 self.callable = callable
10863 self.SetArgs(*args, **kwargs)
10864 self.runCount = 0
4276dc52 10865 self.running = False
d14a1e28
RD
10866 self.hasRun = False
10867 self.result = None
10868 self.timer = None
10869 self.Start()
10870
10871 def __del__(self):
10872 self.Stop()
10873
10874
10875 def Start(self, millis=None, *args, **kwargs):
10876 """
10877 (Re)start the timer
10878 """
10879 self.hasRun = False
10880 if millis is not None:
10881 self.millis = millis
10882 if args or kwargs:
10883 self.SetArgs(*args, **kwargs)
10884 self.Stop()
10885 self.timer = wx.PyTimer(self.Notify)
10886 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 10887 self.running = True
d14a1e28
RD
10888 Restart = Start
10889
10890
10891 def Stop(self):
10892 """
10893 Stop and destroy the timer.
10894 """
10895 if self.timer is not None:
10896 self.timer.Stop()
10897 self.timer = None
10898
10899
10900 def GetInterval(self):
10901 if self.timer is not None:
10902 return self.timer.GetInterval()
10903 else:
10904 return 0
10905
10906
10907 def IsRunning(self):
10908 return self.timer is not None and self.timer.IsRunning()
10909
10910
10911 def SetArgs(self, *args, **kwargs):
10912 """
10913 (Re)set the args passed to the callable object. This is
10914 useful in conjunction with Restart if you want to schedule a
10915 new call to the same callable object but with different
10916 parameters.
10917 """
10918 self.args = args
10919 self.kwargs = kwargs
10920
10921
10922 def HasRun(self):
10923 return self.hasRun
10924
10925 def GetResult(self):
10926 return self.result
10927
10928 def Notify(self):
10929 """
10930 The timer has expired so call the callable.
10931 """
10932 if self.callable and getattr(self.callable, 'im_self', True):
10933 self.runCount += 1
4276dc52 10934 self.running = False
d14a1e28
RD
10935 self.result = self.callable(*self.args, **self.kwargs)
10936 self.hasRun = True
4276dc52
RD
10937 if not self.running:
10938 # if it wasn't restarted, then cleanup
10939 wx.CallAfter(self.Stop)
d14a1e28
RD
10940
10941
a95a7133
RD
10942
10943#----------------------------------------------------------------------------
10944# Control which items in this module should be documented by epydoc.
10945# We allow only classes and functions, which will help reduce the size
10946# of the docs by filtering out the zillions of constants, EVT objects,
10947# and etc that don't make much sense by themselves, but are instead
10948# documented (or will be) as part of the classes/functions/methods
10949# where they should be used.
10950
66c033b4
RD
10951class __DocFilter:
10952 """
10953 A filter for epydoc that only allows non-Ptr classes and
10954 fucntions, in order to reduce the clutter in the API docs.
10955 """
10956 def __init__(self, globals):
10957 self._globals = globals
10958
10959 def __call__(self, name):
10960 import types
10961 obj = self._globals.get(name, None)
10962 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
10963 return False
10964 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
10965 return False
10966 return True
a95a7133 10967
d14a1e28
RD
10968#----------------------------------------------------------------------------
10969#----------------------------------------------------------------------------
10970
10971# Import other modules in this package that should show up in the
10972# "core" wx namespace
54f9ee45
RD
10973from _gdi import *
10974from _windows import *
10975from _controls import *
10976from _misc import *
d14a1e28 10977
3a04f143
RD
10978
10979# Fixup the stock objects since they can't be used yet. (They will be
10980# restored in wx.PyApp.OnInit.)
54f9ee45 10981_core_._wxPyFixStockObjects()
3a04f143 10982
d14a1e28
RD
10983#----------------------------------------------------------------------------
10984#----------------------------------------------------------------------------
10985
10986