]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
A little cleanup
[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 1162 Increase the rectangle size by dx in x direction and dy in y
5cbf236d 1163 direction. Both (or one of) parameters may be negative to decrease the
41e2b43e 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 1172 Decrease the rectangle size by dx in x direction and dy in y
5cbf236d 1173 direction. Both (or one of) parameters may be negative to increase the
41e2b43e 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
5cbf236d 1200 Returns the intersectsion of this rectangle and rect.
0df68c9f 1201 """
54f9ee45 1202 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce 1203
5cbf236d
RD
1204 def Union(*args, **kwargs):
1205 """
1206 Union(self, Rect rect) -> Rect
1207
1208 Returns the union of this rectangle and rect.
1209 """
1210 return _core_.Rect_Union(*args, **kwargs)
1211
e811c8ce 1212 def __add__(*args, **kwargs):
0df68c9f 1213 """
a95a7133 1214 __add__(self, Rect rect) -> Rect
e811c8ce 1215
0df68c9f
RD
1216 Add the properties of rect to this rectangle and return the result.
1217 """
54f9ee45 1218 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1219
1220 def __iadd__(*args, **kwargs):
0df68c9f 1221 """
a95a7133 1222 __iadd__(self, Rect rect) -> Rect
e811c8ce 1223
0df68c9f
RD
1224 Add the properties of rect to this rectangle, updating this rectangle.
1225 """
54f9ee45 1226 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1227
1228 def __eq__(*args, **kwargs):
0df68c9f 1229 """
a95a7133 1230 __eq__(self, Rect rect) -> bool
e811c8ce 1231
0df68c9f
RD
1232 Test for equality.
1233 """
54f9ee45 1234 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1235
1236 def __ne__(*args, **kwargs):
0df68c9f 1237 """
a95a7133 1238 __ne__(self, Rect rect) -> bool
e811c8ce 1239
0df68c9f
RD
1240 Test for inequality.
1241 """
54f9ee45 1242 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce
RD
1243
1244 def InsideXY(*args, **kwargs):
0df68c9f 1245 """
a95a7133 1246 InsideXY(self, int x, int y) -> bool
e811c8ce 1247
0df68c9f
RD
1248 Return True if the point is (not strcitly) inside the rect.
1249 """
54f9ee45 1250 return _core_.Rect_InsideXY(*args, **kwargs)
e811c8ce
RD
1251
1252 def Inside(*args, **kwargs):
0df68c9f 1253 """
a95a7133 1254 Inside(self, Point pt) -> bool
e811c8ce 1255
0df68c9f
RD
1256 Return True if the point is (not strcitly) inside the rect.
1257 """
54f9ee45 1258 return _core_.Rect_Inside(*args, **kwargs)
e811c8ce
RD
1259
1260 def Intersects(*args, **kwargs):
0df68c9f 1261 """
a95a7133 1262 Intersects(self, Rect rect) -> bool
e811c8ce 1263
0df68c9f
RD
1264 Returns True if the rectangles have a non empty intersection.
1265 """
54f9ee45 1266 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1267
54f9ee45
RD
1268 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1269 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1270 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1271 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1272 def Set(*args, **kwargs):
0df68c9f 1273 """
a95a7133 1274 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1275
0df68c9f
RD
1276 Set all rectangle properties.
1277 """
54f9ee45 1278 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1279
1280 def Get(*args, **kwargs):
0df68c9f
RD
1281 """
1282 Get() -> (x,y,width,height)
e811c8ce 1283
0df68c9f
RD
1284 Return the rectangle properties as a tuple.
1285 """
54f9ee45 1286 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1287
41e2b43e 1288 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1289 def __str__(self): return str(self.Get())
1290 def __repr__(self): return 'wx.Rect'+str(self.Get())
1291 def __len__(self): return len(self.Get())
1292 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1293 def __setitem__(self, index, val):
1294 if index == 0: self.x = val
1295 elif index == 1: self.y = val
1296 elif index == 2: self.width = val
1297 elif index == 3: self.height = val
1298 else: raise IndexError
e811c8ce 1299 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1300 __safe_for_unpickling__ = True
1301 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28
RD
1302
1303
1304class RectPtr(Rect):
1305 def __init__(self, this):
1306 self.this = this
1307 if not hasattr(self,"thisown"): self.thisown = 0
1308 self.__class__ = Rect
54f9ee45 1309_core_.Rect_swigregister(RectPtr)
d14a1e28
RD
1310
1311def RectPP(*args, **kwargs):
0df68c9f
RD
1312 """
1313 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1314
0df68c9f
RD
1315 Create a new Rect object from Points representing two corners.
1316 """
54f9ee45 1317 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1318 val.thisown = 1
1319 return val
1320
1321def RectPS(*args, **kwargs):
0df68c9f
RD
1322 """
1323 RectPS(Point pos, Size size) -> Rect
e811c8ce 1324
0df68c9f
RD
1325 Create a new Rect from a position and size.
1326 """
54f9ee45 1327 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1328 val.thisown = 1
1329 return val
1330
d3b6e4ff
RD
1331def RectS(*args, **kwargs):
1332 """
1333 RectS(Size size) -> Rect
1334
1335 Create a new Rect from a size only.
1336 """
1337 val = _core_.new_RectS(*args, **kwargs)
1338 val.thisown = 1
1339 return val
1340
d14a1e28 1341
e811c8ce 1342def IntersectRect(*args, **kwargs):
0df68c9f
RD
1343 """
1344 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1345
0df68c9f
RD
1346 Calculate and return the intersection of r1 and r2.
1347 """
54f9ee45 1348 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1349#---------------------------------------------------------------------------
1350
1351class Point2D(object):
41e2b43e
RD
1352 """
1353 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1354 with floating point values.
1355 """
e811c8ce
RD
1356 def __repr__(self):
1357 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1358 def __init__(self, *args, **kwargs):
0df68c9f 1359 """
a95a7133 1360 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1361
0df68c9f
RD
1362 Create a w.Point2D object.
1363 """
54f9ee45 1364 newobj = _core_.new_Point2D(*args, **kwargs)
d14a1e28
RD
1365 self.this = newobj.this
1366 self.thisown = 1
1367 del newobj.thisown
e811c8ce 1368 def GetFloor(*args, **kwargs):
fd2dc343
RD
1369 """
1370 GetFloor() -> (x,y)
1371
1372 Convert to integer
1373 """
54f9ee45 1374 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1375
1376 def GetRounded(*args, **kwargs):
fd2dc343
RD
1377 """
1378 GetRounded() -> (x,y)
1379
1380 Convert to integer
1381 """
54f9ee45 1382 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1383
1384 def GetVectorLength(*args, **kwargs):
a95a7133 1385 """GetVectorLength(self) -> double"""
54f9ee45 1386 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1387
1388 def GetVectorAngle(*args, **kwargs):
a95a7133 1389 """GetVectorAngle(self) -> double"""
54f9ee45 1390 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1391
1392 def SetVectorLength(*args, **kwargs):
a95a7133 1393 """SetVectorLength(self, double length)"""
54f9ee45 1394 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1395
1396 def SetVectorAngle(*args, **kwargs):
a95a7133 1397 """SetVectorAngle(self, double degrees)"""
54f9ee45 1398 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1399
d14a1e28
RD
1400 def SetPolarCoordinates(self, angle, length):
1401 self.SetVectorLength(length)
1402 self.SetVectorAngle(angle)
1403 def Normalize(self):
1404 self.SetVectorLength(1.0)
1405
e811c8ce 1406 def GetDistance(*args, **kwargs):
a95a7133 1407 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1408 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1409
1410 def GetDistanceSquare(*args, **kwargs):
a95a7133 1411 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1412 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1413
1414 def GetDotProduct(*args, **kwargs):
a95a7133 1415 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1416 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1417
1418 def GetCrossProduct(*args, **kwargs):
a95a7133 1419 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1420 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1421
1422 def __neg__(*args, **kwargs):
0df68c9f 1423 """
a95a7133 1424 __neg__(self) -> Point2D
e811c8ce 1425
0df68c9f
RD
1426 the reflection of this point
1427 """
54f9ee45 1428 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1429
1430 def __iadd__(*args, **kwargs):
a95a7133 1431 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1432 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1433
1434 def __isub__(*args, **kwargs):
a95a7133 1435 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1436 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1437
1438 def __imul__(*args, **kwargs):
a95a7133 1439 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1440 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1441
1442 def __idiv__(*args, **kwargs):
a95a7133 1443 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1444 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1445
1446 def __eq__(*args, **kwargs):
0df68c9f 1447 """
a95a7133 1448 __eq__(self, Point2D pt) -> bool
e811c8ce 1449
0df68c9f
RD
1450 Test for equality
1451 """
54f9ee45 1452 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1453
1454 def __ne__(*args, **kwargs):
0df68c9f 1455 """
a95a7133 1456 __ne__(self, Point2D pt) -> bool
e811c8ce 1457
0df68c9f
RD
1458 Test for inequality
1459 """
54f9ee45 1460 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1461
54f9ee45
RD
1462 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1463 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1464 def Set(*args, **kwargs):
a95a7133 1465 """Set(self, double x=0, double y=0)"""
54f9ee45 1466 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1467
1468 def Get(*args, **kwargs):
0df68c9f
RD
1469 """
1470 Get() -> (x,y)
e811c8ce 1471
0df68c9f
RD
1472 Return x and y properties as a tuple.
1473 """
54f9ee45 1474 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1475
41e2b43e 1476 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1477 def __str__(self): return str(self.Get())
1478 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1479 def __len__(self): return len(self.Get())
1480 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1481 def __setitem__(self, index, val):
e811c8ce
RD
1482 if index == 0: self.x = val
1483 elif index == 1: self.y = val
d14a1e28 1484 else: raise IndexError
e811c8ce 1485 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1486 __safe_for_unpickling__ = True
1487 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28
RD
1488
1489
1490class Point2DPtr(Point2D):
1491 def __init__(self, this):
1492 self.this = this
1493 if not hasattr(self,"thisown"): self.thisown = 0
1494 self.__class__ = Point2D
54f9ee45 1495_core_.Point2D_swigregister(Point2DPtr)
d14a1e28
RD
1496
1497def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1498 """
1499 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1500
0df68c9f
RD
1501 Create a w.Point2D object.
1502 """
54f9ee45 1503 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1504 val.thisown = 1
1505 return val
1506
1507def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1508 """
1509 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1510
0df68c9f
RD
1511 Create a w.Point2D object.
1512 """
54f9ee45 1513 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1514 val.thisown = 1
1515 return val
1516
1517#---------------------------------------------------------------------------
1518
54f9ee45
RD
1519FromStart = _core_.FromStart
1520FromCurrent = _core_.FromCurrent
1521FromEnd = _core_.FromEnd
d14a1e28 1522class InputStream(object):
e811c8ce
RD
1523 def __repr__(self):
1524 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1525 def __init__(self, *args, **kwargs):
a95a7133 1526 """__init__(self, PyObject p) -> InputStream"""
54f9ee45 1527 newobj = _core_.new_InputStream(*args, **kwargs)
d14a1e28
RD
1528 self.this = newobj.this
1529 self.thisown = 1
1530 del newobj.thisown
8fb0e70a
RD
1531 def __del__(self, destroy=_core_.delete_InputStream):
1532 """__del__(self)"""
1533 try:
1534 if self.thisown: destroy(self)
1535 except: pass
1536
e811c8ce 1537 def close(*args, **kwargs):
a95a7133 1538 """close(self)"""
54f9ee45 1539 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1540
1541 def flush(*args, **kwargs):
a95a7133 1542 """flush(self)"""
54f9ee45 1543 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1544
1545 def eof(*args, **kwargs):
a95a7133 1546 """eof(self) -> bool"""
54f9ee45 1547 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1548
1549 def read(*args, **kwargs):
a95a7133 1550 """read(self, int size=-1) -> PyObject"""
54f9ee45 1551 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1552
1553 def readline(*args, **kwargs):
a95a7133 1554 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1555 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1556
1557 def readlines(*args, **kwargs):
a95a7133 1558 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1559 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1560
1561 def seek(*args, **kwargs):
a95a7133 1562 """seek(self, int offset, int whence=0)"""
54f9ee45 1563 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1564
1565 def tell(*args, **kwargs):
a95a7133 1566 """tell(self) -> int"""
54f9ee45 1567 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1568
1569 def Peek(*args, **kwargs):
a95a7133 1570 """Peek(self) -> char"""
54f9ee45 1571 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1572
1573 def GetC(*args, **kwargs):
a95a7133 1574 """GetC(self) -> char"""
54f9ee45 1575 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1576
1577 def LastRead(*args, **kwargs):
a95a7133 1578 """LastRead(self) -> size_t"""
54f9ee45 1579 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1580
1581 def CanRead(*args, **kwargs):
a95a7133 1582 """CanRead(self) -> bool"""
54f9ee45 1583 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1584
1585 def Eof(*args, **kwargs):
a95a7133 1586 """Eof(self) -> bool"""
54f9ee45 1587 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1588
1589 def Ungetch(*args, **kwargs):
a95a7133 1590 """Ungetch(self, char c) -> bool"""
54f9ee45 1591 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1592
1593 def SeekI(*args, **kwargs):
a95a7133 1594 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1595 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1596
1597 def TellI(*args, **kwargs):
a95a7133 1598 """TellI(self) -> long"""
54f9ee45 1599 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1600
d14a1e28
RD
1601
1602class InputStreamPtr(InputStream):
1603 def __init__(self, this):
1604 self.this = this
1605 if not hasattr(self,"thisown"): self.thisown = 0
1606 self.__class__ = InputStream
54f9ee45 1607_core_.InputStream_swigregister(InputStreamPtr)
d14a1e28
RD
1608DefaultPosition = cvar.DefaultPosition
1609DefaultSize = cvar.DefaultSize
1610
1611class OutputStream(object):
d14a1e28
RD
1612 def __init__(self): raise RuntimeError, "No constructor defined"
1613 def __repr__(self):
1614 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 1615 def write(*args, **kwargs):
a95a7133 1616 """write(self, PyObject obj)"""
54f9ee45 1617 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 1618
d14a1e28
RD
1619
1620class OutputStreamPtr(OutputStream):
1621 def __init__(self, this):
1622 self.this = this
1623 if not hasattr(self,"thisown"): self.thisown = 0
1624 self.__class__ = OutputStream
54f9ee45 1625_core_.OutputStream_swigregister(OutputStreamPtr)
d14a1e28
RD
1626
1627#---------------------------------------------------------------------------
1628
1629class FSFile(Object):
e811c8ce
RD
1630 def __repr__(self):
1631 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1632 def __init__(self, *args, **kwargs):
0df68c9f 1633 """
a95a7133 1634 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 1635 DateTime modif) -> FSFile
0df68c9f 1636 """
54f9ee45 1637 newobj = _core_.new_FSFile(*args, **kwargs)
d14a1e28
RD
1638 self.this = newobj.this
1639 self.thisown = 1
1640 del newobj.thisown
4cf4100f
RD
1641 self.thisown = 0 # It will normally be deleted by the user of the wxFileSystem
1642
54f9ee45 1643 def __del__(self, destroy=_core_.delete_FSFile):
a95a7133 1644 """__del__(self)"""
d14a1e28
RD
1645 try:
1646 if self.thisown: destroy(self)
1647 except: pass
e811c8ce
RD
1648
1649 def GetStream(*args, **kwargs):
a95a7133 1650 """GetStream(self) -> InputStream"""
54f9ee45 1651 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce
RD
1652
1653 def GetMimeType(*args, **kwargs):
a95a7133 1654 """GetMimeType(self) -> String"""
54f9ee45 1655 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
1656
1657 def GetLocation(*args, **kwargs):
a95a7133 1658 """GetLocation(self) -> String"""
54f9ee45 1659 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
1660
1661 def GetAnchor(*args, **kwargs):
a95a7133 1662 """GetAnchor(self) -> String"""
54f9ee45 1663 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
1664
1665 def GetModificationTime(*args, **kwargs):
a95a7133 1666 """GetModificationTime(self) -> DateTime"""
54f9ee45 1667 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 1668
d14a1e28
RD
1669
1670class FSFilePtr(FSFile):
1671 def __init__(self, this):
1672 self.this = this
1673 if not hasattr(self,"thisown"): self.thisown = 0
1674 self.__class__ = FSFile
54f9ee45 1675_core_.FSFile_swigregister(FSFilePtr)
d14a1e28
RD
1676
1677class CPPFileSystemHandler(object):
1678 def __init__(self): raise RuntimeError, "No constructor defined"
1679 def __repr__(self):
1680 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1681
1682class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1683 def __init__(self, this):
1684 self.this = this
1685 if not hasattr(self,"thisown"): self.thisown = 0
1686 self.__class__ = CPPFileSystemHandler
54f9ee45 1687_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
d14a1e28
RD
1688
1689class FileSystemHandler(CPPFileSystemHandler):
e811c8ce
RD
1690 def __repr__(self):
1691 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1692 def __init__(self, *args, **kwargs):
a95a7133 1693 """__init__(self) -> FileSystemHandler"""
54f9ee45 1694 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
d14a1e28
RD
1695 self.this = newobj.this
1696 self.thisown = 1
1697 del newobj.thisown
1698 self._setCallbackInfo(self, FileSystemHandler)
e811c8ce
RD
1699
1700 def _setCallbackInfo(*args, **kwargs):
a95a7133 1701 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 1702 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
1703
1704 def CanOpen(*args, **kwargs):
a95a7133 1705 """CanOpen(self, String location) -> bool"""
54f9ee45 1706 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1707
1708 def OpenFile(*args, **kwargs):
a95a7133 1709 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1710 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1711
1712 def FindFirst(*args, **kwargs):
a95a7133 1713 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1714 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1715
1716 def FindNext(*args, **kwargs):
a95a7133 1717 """FindNext(self) -> String"""
54f9ee45 1718 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
1719
1720 def GetProtocol(*args, **kwargs):
a95a7133 1721 """GetProtocol(self, String location) -> String"""
54f9ee45 1722 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
1723
1724 def GetLeftLocation(*args, **kwargs):
a95a7133 1725 """GetLeftLocation(self, String location) -> String"""
54f9ee45 1726 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
1727
1728 def GetAnchor(*args, **kwargs):
a95a7133 1729 """GetAnchor(self, String location) -> String"""
54f9ee45 1730 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
1731
1732 def GetRightLocation(*args, **kwargs):
a95a7133 1733 """GetRightLocation(self, String location) -> String"""
54f9ee45 1734 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
1735
1736 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 1737 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 1738 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 1739
d14a1e28
RD
1740
1741class FileSystemHandlerPtr(FileSystemHandler):
1742 def __init__(self, this):
1743 self.this = this
1744 if not hasattr(self,"thisown"): self.thisown = 0
1745 self.__class__ = FileSystemHandler
54f9ee45 1746_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
d14a1e28
RD
1747
1748class FileSystem(Object):
e811c8ce
RD
1749 def __repr__(self):
1750 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1751 def __init__(self, *args, **kwargs):
a95a7133 1752 """__init__(self) -> FileSystem"""
54f9ee45 1753 newobj = _core_.new_FileSystem(*args, **kwargs)
d14a1e28
RD
1754 self.this = newobj.this
1755 self.thisown = 1
1756 del newobj.thisown
54f9ee45 1757 def __del__(self, destroy=_core_.delete_FileSystem):
a95a7133 1758 """__del__(self)"""
d14a1e28
RD
1759 try:
1760 if self.thisown: destroy(self)
1761 except: pass
e811c8ce
RD
1762
1763 def ChangePathTo(*args, **kwargs):
a95a7133 1764 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 1765 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
1766
1767 def GetPath(*args, **kwargs):
a95a7133 1768 """GetPath(self) -> String"""
54f9ee45 1769 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
1770
1771 def OpenFile(*args, **kwargs):
a95a7133 1772 """OpenFile(self, String location) -> FSFile"""
54f9ee45 1773 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
1774
1775 def FindFirst(*args, **kwargs):
a95a7133 1776 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1777 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
1778
1779 def FindNext(*args, **kwargs):
a95a7133 1780 """FindNext(self) -> String"""
54f9ee45 1781 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
1782
1783 def AddHandler(*args, **kwargs):
66c033b4 1784 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1785 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
1786
1787 AddHandler = staticmethod(AddHandler)
1788 def CleanUpHandlers(*args, **kwargs):
66c033b4 1789 """CleanUpHandlers()"""
54f9ee45 1790 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
1791
1792 CleanUpHandlers = staticmethod(CleanUpHandlers)
1793 def FileNameToURL(*args, **kwargs):
66c033b4 1794 """FileNameToURL(String filename) -> String"""
54f9ee45 1795 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
1796
1797 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
1798 def URLToFileName(*args, **kwargs):
1799 """URLToFileName(String url) -> String"""
1800 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1801
1802 URLToFileName = staticmethod(URLToFileName)
d14a1e28
RD
1803
1804class FileSystemPtr(FileSystem):
1805 def __init__(self, this):
1806 self.this = this
1807 if not hasattr(self,"thisown"): self.thisown = 0
1808 self.__class__ = FileSystem
54f9ee45 1809_core_.FileSystem_swigregister(FileSystemPtr)
d14a1e28 1810
e811c8ce
RD
1811def FileSystem_AddHandler(*args, **kwargs):
1812 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1813 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 1814
e811c8ce
RD
1815def FileSystem_CleanUpHandlers(*args, **kwargs):
1816 """FileSystem_CleanUpHandlers()"""
54f9ee45 1817 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d14a1e28 1818
e811c8ce 1819def FileSystem_FileNameToURL(*args, **kwargs):
196addbf 1820 """FileSystem_FileNameToURL(String filename) -> String"""
54f9ee45 1821 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 1822
e811c8ce 1823def FileSystem_URLToFileName(*args, **kwargs):
196addbf 1824 """FileSystem_URLToFileName(String url) -> String"""
54f9ee45 1825 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 1826
d14a1e28 1827class InternetFSHandler(CPPFileSystemHandler):
e811c8ce
RD
1828 def __repr__(self):
1829 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1830 def __init__(self, *args, **kwargs):
a95a7133 1831 """__init__(self) -> InternetFSHandler"""
54f9ee45 1832 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
d14a1e28
RD
1833 self.this = newobj.this
1834 self.thisown = 1
1835 del newobj.thisown
e811c8ce 1836 def CanOpen(*args, **kwargs):
a95a7133 1837 """CanOpen(self, String location) -> bool"""
54f9ee45 1838 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1839
1840 def OpenFile(*args, **kwargs):
a95a7133 1841 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1842 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 1843
d14a1e28
RD
1844
1845class InternetFSHandlerPtr(InternetFSHandler):
1846 def __init__(self, this):
1847 self.this = this
1848 if not hasattr(self,"thisown"): self.thisown = 0
1849 self.__class__ = InternetFSHandler
54f9ee45 1850_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
d14a1e28
RD
1851
1852class ZipFSHandler(CPPFileSystemHandler):
e811c8ce
RD
1853 def __repr__(self):
1854 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1855 def __init__(self, *args, **kwargs):
a95a7133 1856 """__init__(self) -> ZipFSHandler"""
54f9ee45 1857 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
d14a1e28
RD
1858 self.this = newobj.this
1859 self.thisown = 1
1860 del newobj.thisown
e811c8ce 1861 def CanOpen(*args, **kwargs):
a95a7133 1862 """CanOpen(self, String location) -> bool"""
54f9ee45 1863 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1864
1865 def OpenFile(*args, **kwargs):
a95a7133 1866 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1867 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1868
1869 def FindFirst(*args, **kwargs):
a95a7133 1870 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1871 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1872
1873 def FindNext(*args, **kwargs):
a95a7133 1874 """FindNext(self) -> String"""
54f9ee45 1875 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 1876
d14a1e28
RD
1877
1878class ZipFSHandlerPtr(ZipFSHandler):
1879 def __init__(self, this):
1880 self.this = this
1881 if not hasattr(self,"thisown"): self.thisown = 0
1882 self.__class__ = ZipFSHandler
54f9ee45 1883_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
d14a1e28
RD
1884
1885
e811c8ce 1886def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
196addbf 1887 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
54f9ee45 1888 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 1889
e811c8ce 1890def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
196addbf 1891 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
54f9ee45 1892 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 1893
e811c8ce 1894def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
196addbf 1895 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
54f9ee45 1896 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
1897def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1898 """
1899 Add 'file' to the memory filesystem. The dataItem parameter can
1900 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1901 arbitrary data. If a bitmap or image is used then the imgType
1902 parameter should specify what kind of image file it should be
1903 written as, wx.BITMAP_TYPE_PNG, etc.
1904 """
1905 if isinstance(dataItem, wx.Image):
1906 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1907 elif isinstance(dataItem, wx.Bitmap):
1908 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1909 elif type(dataItem) == str:
1910 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1911 else:
1912 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
1913
1914class MemoryFSHandler(CPPFileSystemHandler):
e811c8ce
RD
1915 def __repr__(self):
1916 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1917 def __init__(self, *args, **kwargs):
a95a7133 1918 """__init__(self) -> MemoryFSHandler"""
54f9ee45 1919 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
d14a1e28
RD
1920 self.this = newobj.this
1921 self.thisown = 1
1922 del newobj.thisown
e811c8ce 1923 def RemoveFile(*args, **kwargs):
66c033b4 1924 """RemoveFile(String filename)"""
54f9ee45 1925 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
1926
1927 RemoveFile = staticmethod(RemoveFile)
d14a1e28 1928 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 1929 def CanOpen(*args, **kwargs):
a95a7133 1930 """CanOpen(self, String location) -> bool"""
54f9ee45 1931 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1932
1933 def OpenFile(*args, **kwargs):
a95a7133 1934 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1935 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1936
1937 def FindFirst(*args, **kwargs):
a95a7133 1938 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1939 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1940
1941 def FindNext(*args, **kwargs):
a95a7133 1942 """FindNext(self) -> String"""
54f9ee45 1943 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 1944
d14a1e28
RD
1945
1946class MemoryFSHandlerPtr(MemoryFSHandler):
1947 def __init__(self, this):
1948 self.this = this
1949 if not hasattr(self,"thisown"): self.thisown = 0
1950 self.__class__ = MemoryFSHandler
54f9ee45 1951_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
d14a1e28 1952
e811c8ce 1953def MemoryFSHandler_RemoveFile(*args, **kwargs):
196addbf 1954 """MemoryFSHandler_RemoveFile(String filename)"""
54f9ee45 1955 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28
RD
1956
1957#---------------------------------------------------------------------------
1958
1959class ImageHandler(Object):
d14a1e28
RD
1960 def __init__(self): raise RuntimeError, "No constructor defined"
1961 def __repr__(self):
1962 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 1963 def GetName(*args, **kwargs):
a95a7133 1964 """GetName(self) -> String"""
54f9ee45 1965 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
1966
1967 def GetExtension(*args, **kwargs):
a95a7133 1968 """GetExtension(self) -> String"""
54f9ee45 1969 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
1970
1971 def GetType(*args, **kwargs):
a95a7133 1972 """GetType(self) -> long"""
54f9ee45 1973 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
1974
1975 def GetMimeType(*args, **kwargs):
a95a7133 1976 """GetMimeType(self) -> String"""
54f9ee45 1977 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
1978
1979 def CanRead(*args, **kwargs):
a95a7133 1980 """CanRead(self, String name) -> bool"""
54f9ee45 1981 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce
RD
1982
1983 def SetName(*args, **kwargs):
a95a7133 1984 """SetName(self, String name)"""
54f9ee45 1985 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
1986
1987 def SetExtension(*args, **kwargs):
a95a7133 1988 """SetExtension(self, String extension)"""
54f9ee45 1989 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
1990
1991 def SetType(*args, **kwargs):
a95a7133 1992 """SetType(self, long type)"""
54f9ee45 1993 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
1994
1995 def SetMimeType(*args, **kwargs):
a95a7133 1996 """SetMimeType(self, String mimetype)"""
54f9ee45 1997 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 1998
d14a1e28
RD
1999
2000class ImageHandlerPtr(ImageHandler):
2001 def __init__(self, this):
2002 self.this = this
2003 if not hasattr(self,"thisown"): self.thisown = 0
2004 self.__class__ = ImageHandler
54f9ee45 2005_core_.ImageHandler_swigregister(ImageHandlerPtr)
d14a1e28
RD
2006
2007class ImageHistogram(object):
e811c8ce
RD
2008 def __repr__(self):
2009 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2010 def __init__(self, *args, **kwargs):
a95a7133 2011 """__init__(self) -> ImageHistogram"""
54f9ee45 2012 newobj = _core_.new_ImageHistogram(*args, **kwargs)
d14a1e28
RD
2013 self.this = newobj.this
2014 self.thisown = 1
2015 del newobj.thisown
e811c8ce 2016 def MakeKey(*args, **kwargs):
0df68c9f 2017 """
66c033b4 2018 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
e811c8ce 2019
0df68c9f
RD
2020 Get the key in the histogram for the given RGB values
2021 """
54f9ee45 2022 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2023
2024 MakeKey = staticmethod(MakeKey)
2025 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2026 """
2027 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2028
2029 Find first colour that is not used in the image and has higher RGB
2030 values than startR, startG, startB. Returns a tuple consisting of a
2031 success flag and rgb values.
2032 """
54f9ee45 2033 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2034
d14a1e28
RD
2035
2036class ImageHistogramPtr(ImageHistogram):
2037 def __init__(self, this):
2038 self.this = this
2039 if not hasattr(self,"thisown"): self.thisown = 0
2040 self.__class__ = ImageHistogram
54f9ee45 2041_core_.ImageHistogram_swigregister(ImageHistogramPtr)
d14a1e28 2042
e811c8ce 2043def ImageHistogram_MakeKey(*args, **kwargs):
0df68c9f
RD
2044 """
2045 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
e811c8ce 2046
0df68c9f
RD
2047 Get the key in the histogram for the given RGB values
2048 """
54f9ee45 2049 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28
RD
2050
2051class Image(Object):
e811c8ce
RD
2052 def __repr__(self):
2053 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2054 def __init__(self, *args, **kwargs):
a95a7133 2055 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
54f9ee45 2056 newobj = _core_.new_Image(*args, **kwargs)
d14a1e28
RD
2057 self.this = newobj.this
2058 self.thisown = 1
2059 del newobj.thisown
54f9ee45 2060 def __del__(self, destroy=_core_.delete_Image):
a95a7133 2061 """__del__(self)"""
d14a1e28
RD
2062 try:
2063 if self.thisown: destroy(self)
2064 except: pass
e811c8ce
RD
2065
2066 def Create(*args, **kwargs):
a95a7133 2067 """Create(self, int width, int height)"""
54f9ee45 2068 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2069
2070 def Destroy(*args, **kwargs):
0df68c9f 2071 """
a95a7133 2072 Destroy(self)
e811c8ce 2073
0df68c9f
RD
2074 Deletes the C++ object this Python object is a proxy for.
2075 """
54f9ee45 2076 return _core_.Image_Destroy(*args, **kwargs)
e811c8ce
RD
2077
2078 def Scale(*args, **kwargs):
a95a7133 2079 """Scale(self, int width, int height) -> Image"""
54f9ee45 2080 return _core_.Image_Scale(*args, **kwargs)
e811c8ce
RD
2081
2082 def ShrinkBy(*args, **kwargs):
a95a7133 2083 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
54f9ee45 2084 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2085
2086 def Rescale(*args, **kwargs):
a95a7133 2087 """Rescale(self, int width, int height) -> Image"""
54f9ee45 2088 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce
RD
2089
2090 def SetRGB(*args, **kwargs):
a95a7133 2091 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
54f9ee45 2092 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce
RD
2093
2094 def GetRed(*args, **kwargs):
a95a7133 2095 """GetRed(self, int x, int y) -> unsigned char"""
54f9ee45 2096 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2097
2098 def GetGreen(*args, **kwargs):
a95a7133 2099 """GetGreen(self, int x, int y) -> unsigned char"""
54f9ee45 2100 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2101
2102 def GetBlue(*args, **kwargs):
a95a7133 2103 """GetBlue(self, int x, int y) -> unsigned char"""
54f9ee45 2104 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2105
2106 def SetAlpha(*args, **kwargs):
a95a7133 2107 """SetAlpha(self, int x, int y, unsigned char alpha)"""
54f9ee45 2108 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2109
2110 def GetAlpha(*args, **kwargs):
a95a7133 2111 """GetAlpha(self, int x, int y) -> unsigned char"""
54f9ee45 2112 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2113
2114 def HasAlpha(*args, **kwargs):
a95a7133 2115 """HasAlpha(self) -> bool"""
54f9ee45 2116 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce
RD
2117
2118 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2119 """
2120 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2121
2122 Find first colour that is not used in the image and has higher RGB
2123 values than startR, startG, startB. Returns a tuple consisting of a
2124 success flag and rgb values.
2125 """
54f9ee45 2126 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2127
4cf4100f
RD
2128 def ConvertAlphaToMask(*args, **kwargs):
2129 """
2130 ConvertAlphaToMask(self, byte threshold=128) -> bool
2131
2132 If the image has alpha channel, this method converts it to mask. All pixels
2133 with alpha value less than ``threshold`` are replaced with mask colour and the
2134 alpha channel is removed. Mask colour is chosen automatically using
2135 `FindFirstUnusedColour`.
2136
2137 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2138 nothing.
2139 """
2140 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2141
8fb0e70a
RD
2142 def ConvertColourToAlpha(*args, **kwargs):
2143 """
2144 ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool
2145
2146 This method converts an image where the original alpha information is
2147 only available as a shades of a colour (actually shades of grey)
2148 typically when you draw anti-aliased text into a bitmap. The DC
2149 drawing routines draw grey values on the black background although
2150 they actually mean to draw white with differnt alpha values. This
2151 method reverses it, assuming a black (!) background and white text.
2152 The method will then fill up the whole image with the colour given.
2153 """
2154 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2155
e811c8ce 2156 def SetMaskFromImage(*args, **kwargs):
a95a7133 2157 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
54f9ee45 2158 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2159
2160 def CanRead(*args, **kwargs):
66c033b4 2161 """CanRead(String name) -> bool"""
54f9ee45 2162 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2163
2164 CanRead = staticmethod(CanRead)
2165 def GetImageCount(*args, **kwargs):
66c033b4 2166 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
54f9ee45 2167 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2168
2169 GetImageCount = staticmethod(GetImageCount)
2170 def LoadFile(*args, **kwargs):
a95a7133 2171 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
54f9ee45 2172 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2173
2174 def LoadMimeFile(*args, **kwargs):
a95a7133 2175 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
54f9ee45 2176 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2177
2178 def SaveFile(*args, **kwargs):
a95a7133 2179 """SaveFile(self, String name, int type) -> bool"""
54f9ee45 2180 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2181
2182 def SaveMimeFile(*args, **kwargs):
a95a7133 2183 """SaveMimeFile(self, String name, String mimetype) -> bool"""
54f9ee45 2184 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2185
2186 def CanReadStream(*args, **kwargs):
66c033b4 2187 """CanReadStream(InputStream stream) -> bool"""
54f9ee45 2188 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2189
2190 CanReadStream = staticmethod(CanReadStream)
2191 def LoadStream(*args, **kwargs):
a95a7133 2192 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
54f9ee45 2193 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2194
2195 def LoadMimeStream(*args, **kwargs):
a95a7133 2196 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
54f9ee45 2197 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce
RD
2198
2199 def Ok(*args, **kwargs):
a95a7133 2200 """Ok(self) -> bool"""
54f9ee45 2201 return _core_.Image_Ok(*args, **kwargs)
e811c8ce
RD
2202
2203 def GetWidth(*args, **kwargs):
a95a7133 2204 """GetWidth(self) -> int"""
54f9ee45 2205 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2206
2207 def GetHeight(*args, **kwargs):
a95a7133 2208 """GetHeight(self) -> int"""
54f9ee45 2209 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2210
b2df227b 2211 def GetSize(*args, **kwargs):
a95a7133 2212 """GetSize(self) -> Size"""
54f9ee45 2213 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2214
e811c8ce 2215 def GetSubImage(*args, **kwargs):
a95a7133 2216 """GetSubImage(self, Rect rect) -> Image"""
54f9ee45 2217 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce
RD
2218
2219 def Copy(*args, **kwargs):
a95a7133 2220 """Copy(self) -> Image"""
54f9ee45 2221 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2222
2223 def Paste(*args, **kwargs):
a95a7133 2224 """Paste(self, Image image, int x, int y)"""
54f9ee45 2225 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2226
2227 def GetData(*args, **kwargs):
a95a7133 2228 """GetData(self) -> PyObject"""
54f9ee45 2229 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2230
2231 def SetData(*args, **kwargs):
a95a7133 2232 """SetData(self, PyObject data)"""
54f9ee45 2233 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
2234
2235 def GetDataBuffer(*args, **kwargs):
a95a7133 2236 """GetDataBuffer(self) -> PyObject"""
54f9ee45 2237 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
2238
2239 def SetDataBuffer(*args, **kwargs):
a95a7133 2240 """SetDataBuffer(self, PyObject data)"""
54f9ee45 2241 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
2242
2243 def GetAlphaData(*args, **kwargs):
a95a7133 2244 """GetAlphaData(self) -> PyObject"""
54f9ee45 2245 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
2246
2247 def SetAlphaData(*args, **kwargs):
a95a7133 2248 """SetAlphaData(self, PyObject data)"""
54f9ee45 2249 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
2250
2251 def GetAlphaBuffer(*args, **kwargs):
a95a7133 2252 """GetAlphaBuffer(self) -> PyObject"""
54f9ee45 2253 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2254
2255 def SetAlphaBuffer(*args, **kwargs):
a95a7133 2256 """SetAlphaBuffer(self, PyObject data)"""
54f9ee45 2257 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2258
2259 def SetMaskColour(*args, **kwargs):
a95a7133 2260 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
54f9ee45 2261 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce
RD
2262
2263 def GetMaskRed(*args, **kwargs):
a95a7133 2264 """GetMaskRed(self) -> unsigned char"""
54f9ee45 2265 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
2266
2267 def GetMaskGreen(*args, **kwargs):
a95a7133 2268 """GetMaskGreen(self) -> unsigned char"""
54f9ee45 2269 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
2270
2271 def GetMaskBlue(*args, **kwargs):
a95a7133 2272 """GetMaskBlue(self) -> unsigned char"""
54f9ee45 2273 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
2274
2275 def SetMask(*args, **kwargs):
a95a7133 2276 """SetMask(self, bool mask=True)"""
54f9ee45 2277 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
2278
2279 def HasMask(*args, **kwargs):
a95a7133 2280 """HasMask(self) -> bool"""
54f9ee45 2281 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
2282
2283 def Rotate(*args, **kwargs):
0df68c9f 2284 """
a95a7133 2285 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f
RD
2286 Point offset_after_rotation=None) -> Image
2287 """
54f9ee45 2288 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
2289
2290 def Rotate90(*args, **kwargs):
a95a7133 2291 """Rotate90(self, bool clockwise=True) -> Image"""
54f9ee45 2292 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
2293
2294 def Mirror(*args, **kwargs):
a95a7133 2295 """Mirror(self, bool horizontally=True) -> Image"""
54f9ee45 2296 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
2297
2298 def Replace(*args, **kwargs):
0df68c9f 2299 """
a95a7133 2300 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
0df68c9f
RD
2301 unsigned char r2, unsigned char g2, unsigned char b2)
2302 """
54f9ee45 2303 return _core_.Image_Replace(*args, **kwargs)
e811c8ce
RD
2304
2305 def ConvertToMono(*args, **kwargs):
a95a7133 2306 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
54f9ee45 2307 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
2308
2309 def SetOption(*args, **kwargs):
a95a7133 2310 """SetOption(self, String name, String value)"""
54f9ee45 2311 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
2312
2313 def SetOptionInt(*args, **kwargs):
a95a7133 2314 """SetOptionInt(self, String name, int value)"""
54f9ee45 2315 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
2316
2317 def GetOption(*args, **kwargs):
a95a7133 2318 """GetOption(self, String name) -> String"""
54f9ee45 2319 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
2320
2321 def GetOptionInt(*args, **kwargs):
a95a7133 2322 """GetOptionInt(self, String name) -> int"""
54f9ee45 2323 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
2324
2325 def HasOption(*args, **kwargs):
a95a7133 2326 """HasOption(self, String name) -> bool"""
54f9ee45 2327 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
2328
2329 def CountColours(*args, **kwargs):
a95a7133 2330 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 2331 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
2332
2333 def ComputeHistogram(*args, **kwargs):
a95a7133 2334 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 2335 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
2336
2337 def AddHandler(*args, **kwargs):
66c033b4 2338 """AddHandler(ImageHandler handler)"""
54f9ee45 2339 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
2340
2341 AddHandler = staticmethod(AddHandler)
2342 def InsertHandler(*args, **kwargs):
66c033b4 2343 """InsertHandler(ImageHandler handler)"""
54f9ee45 2344 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
2345
2346 InsertHandler = staticmethod(InsertHandler)
2347 def RemoveHandler(*args, **kwargs):
66c033b4 2348 """RemoveHandler(String name) -> bool"""
54f9ee45 2349 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
2350
2351 RemoveHandler = staticmethod(RemoveHandler)
2352 def GetImageExtWildcard(*args, **kwargs):
66c033b4 2353 """GetImageExtWildcard() -> String"""
54f9ee45 2354 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
2355
2356 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2357 def ConvertToBitmap(*args, **kwargs):
1fbf26be 2358 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 2359 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
2360
2361 def ConvertToMonoBitmap(*args, **kwargs):
a95a7133 2362 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
54f9ee45 2363 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce
RD
2364
2365 def __nonzero__(self): return self.Ok()
d14a1e28
RD
2366
2367class ImagePtr(Image):
2368 def __init__(self, this):
2369 self.this = this
2370 if not hasattr(self,"thisown"): self.thisown = 0
2371 self.__class__ = Image
54f9ee45 2372_core_.Image_swigregister(ImagePtr)
d14a1e28
RD
2373
2374def ImageFromMime(*args, **kwargs):
196addbf 2375 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
54f9ee45 2376 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
2377 val.thisown = 1
2378 return val
2379
2380def ImageFromStream(*args, **kwargs):
196addbf 2381 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
54f9ee45 2382 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
2383 val.thisown = 1
2384 return val
2385
2386def ImageFromStreamMime(*args, **kwargs):
196addbf 2387 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
54f9ee45 2388 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
2389 val.thisown = 1
2390 return val
2391
66c033b4
RD
2392def EmptyImage(*args, **kwargs):
2393 """EmptyImage(int width=0, int height=0, bool clear=True) -> Image"""
2394 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
2395 val.thisown = 1
2396 return val
2397
2398def ImageFromBitmap(*args, **kwargs):
196addbf 2399 """ImageFromBitmap(Bitmap bitmap) -> Image"""
54f9ee45 2400 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
2401 val.thisown = 1
2402 return val
2403
2404def ImageFromData(*args, **kwargs):
e811c8ce 2405 """ImageFromData(int width, int height, unsigned char data) -> Image"""
54f9ee45 2406 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
2407 val.thisown = 1
2408 return val
2409
1823fbb4
RD
2410def ImageFromDataWithAlpha(*args, **kwargs):
2411 """ImageFromDataWithAlpha(int width, int height, unsigned char data, unsigned char alpha) -> Image"""
2412 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
2413 val.thisown = 1
2414 return val
2415
e811c8ce 2416def Image_CanRead(*args, **kwargs):
196addbf 2417 """Image_CanRead(String name) -> bool"""
54f9ee45 2418 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 2419
e811c8ce 2420def Image_GetImageCount(*args, **kwargs):
196addbf 2421 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
54f9ee45 2422 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 2423
e811c8ce 2424def Image_CanReadStream(*args, **kwargs):
196addbf 2425 """Image_CanReadStream(InputStream stream) -> bool"""
54f9ee45 2426 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 2427
e811c8ce
RD
2428def Image_AddHandler(*args, **kwargs):
2429 """Image_AddHandler(ImageHandler handler)"""
54f9ee45 2430 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 2431
e811c8ce
RD
2432def Image_InsertHandler(*args, **kwargs):
2433 """Image_InsertHandler(ImageHandler handler)"""
54f9ee45 2434 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 2435
e811c8ce 2436def Image_RemoveHandler(*args, **kwargs):
196addbf 2437 """Image_RemoveHandler(String name) -> bool"""
54f9ee45 2438 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 2439
e811c8ce 2440def Image_GetImageExtWildcard(*args, **kwargs):
196addbf 2441 """Image_GetImageExtWildcard() -> String"""
54f9ee45 2442 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d14a1e28 2443
5e4ca4a8
RD
2444def InitAllImageHandlers():
2445 """
2446 The former functionality of InitAllImageHanders is now done internal to
2447 the _core_ extension module and so this function has become a simple NOP.
2448 """
2449 pass
d14a1e28 2450
54f9ee45
RD
2451IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2452IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2453BMP_24BPP = _core_.BMP_24BPP
2454BMP_8BPP = _core_.BMP_8BPP
2455BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2456BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2457BMP_8BPP_RED = _core_.BMP_8BPP_RED
2458BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2459BMP_4BPP = _core_.BMP_4BPP
2460BMP_1BPP = _core_.BMP_1BPP
2461BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 2462class BMPHandler(ImageHandler):
e811c8ce
RD
2463 def __repr__(self):
2464 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2465 def __init__(self, *args, **kwargs):
a95a7133 2466 """__init__(self) -> BMPHandler"""
54f9ee45 2467 newobj = _core_.new_BMPHandler(*args, **kwargs)
d14a1e28
RD
2468 self.this = newobj.this
2469 self.thisown = 1
2470 del newobj.thisown
d14a1e28
RD
2471
2472class BMPHandlerPtr(BMPHandler):
2473 def __init__(self, this):
2474 self.this = this
2475 if not hasattr(self,"thisown"): self.thisown = 0
2476 self.__class__ = BMPHandler
54f9ee45 2477_core_.BMPHandler_swigregister(BMPHandlerPtr)
d14a1e28
RD
2478NullImage = cvar.NullImage
2479IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2480IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2481IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2482IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
2483IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
2484
2485class ICOHandler(BMPHandler):
e811c8ce
RD
2486 def __repr__(self):
2487 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2488 def __init__(self, *args, **kwargs):
a95a7133 2489 """__init__(self) -> ICOHandler"""
54f9ee45 2490 newobj = _core_.new_ICOHandler(*args, **kwargs)
d14a1e28
RD
2491 self.this = newobj.this
2492 self.thisown = 1
2493 del newobj.thisown
d14a1e28
RD
2494
2495class ICOHandlerPtr(ICOHandler):
2496 def __init__(self, this):
2497 self.this = this
2498 if not hasattr(self,"thisown"): self.thisown = 0
2499 self.__class__ = ICOHandler
54f9ee45 2500_core_.ICOHandler_swigregister(ICOHandlerPtr)
d14a1e28
RD
2501
2502class CURHandler(ICOHandler):
e811c8ce
RD
2503 def __repr__(self):
2504 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2505 def __init__(self, *args, **kwargs):
a95a7133 2506 """__init__(self) -> CURHandler"""
54f9ee45 2507 newobj = _core_.new_CURHandler(*args, **kwargs)
d14a1e28
RD
2508 self.this = newobj.this
2509 self.thisown = 1
2510 del newobj.thisown
d14a1e28
RD
2511
2512class CURHandlerPtr(CURHandler):
2513 def __init__(self, this):
2514 self.this = this
2515 if not hasattr(self,"thisown"): self.thisown = 0
2516 self.__class__ = CURHandler
54f9ee45 2517_core_.CURHandler_swigregister(CURHandlerPtr)
d14a1e28
RD
2518
2519class ANIHandler(CURHandler):
e811c8ce
RD
2520 def __repr__(self):
2521 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2522 def __init__(self, *args, **kwargs):
a95a7133 2523 """__init__(self) -> ANIHandler"""
54f9ee45 2524 newobj = _core_.new_ANIHandler(*args, **kwargs)
d14a1e28
RD
2525 self.this = newobj.this
2526 self.thisown = 1
2527 del newobj.thisown
d14a1e28
RD
2528
2529class ANIHandlerPtr(ANIHandler):
2530 def __init__(self, this):
2531 self.this = this
2532 if not hasattr(self,"thisown"): self.thisown = 0
2533 self.__class__ = ANIHandler
54f9ee45 2534_core_.ANIHandler_swigregister(ANIHandlerPtr)
d14a1e28
RD
2535
2536class PNGHandler(ImageHandler):
e811c8ce
RD
2537 def __repr__(self):
2538 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2539 def __init__(self, *args, **kwargs):
a95a7133 2540 """__init__(self) -> PNGHandler"""
54f9ee45 2541 newobj = _core_.new_PNGHandler(*args, **kwargs)
d14a1e28
RD
2542 self.this = newobj.this
2543 self.thisown = 1
2544 del newobj.thisown
d14a1e28
RD
2545
2546class PNGHandlerPtr(PNGHandler):
2547 def __init__(self, this):
2548 self.this = this
2549 if not hasattr(self,"thisown"): self.thisown = 0
2550 self.__class__ = PNGHandler
54f9ee45 2551_core_.PNGHandler_swigregister(PNGHandlerPtr)
d14a1e28
RD
2552
2553class GIFHandler(ImageHandler):
e811c8ce
RD
2554 def __repr__(self):
2555 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2556 def __init__(self, *args, **kwargs):
a95a7133 2557 """__init__(self) -> GIFHandler"""
54f9ee45 2558 newobj = _core_.new_GIFHandler(*args, **kwargs)
d14a1e28
RD
2559 self.this = newobj.this
2560 self.thisown = 1
2561 del newobj.thisown
d14a1e28
RD
2562
2563class GIFHandlerPtr(GIFHandler):
2564 def __init__(self, this):
2565 self.this = this
2566 if not hasattr(self,"thisown"): self.thisown = 0
2567 self.__class__ = GIFHandler
54f9ee45 2568_core_.GIFHandler_swigregister(GIFHandlerPtr)
d14a1e28
RD
2569
2570class PCXHandler(ImageHandler):
e811c8ce
RD
2571 def __repr__(self):
2572 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2573 def __init__(self, *args, **kwargs):
a95a7133 2574 """__init__(self) -> PCXHandler"""
54f9ee45 2575 newobj = _core_.new_PCXHandler(*args, **kwargs)
d14a1e28
RD
2576 self.this = newobj.this
2577 self.thisown = 1
2578 del newobj.thisown
d14a1e28
RD
2579
2580class PCXHandlerPtr(PCXHandler):
2581 def __init__(self, this):
2582 self.this = this
2583 if not hasattr(self,"thisown"): self.thisown = 0
2584 self.__class__ = PCXHandler
54f9ee45 2585_core_.PCXHandler_swigregister(PCXHandlerPtr)
d14a1e28
RD
2586
2587class JPEGHandler(ImageHandler):
e811c8ce
RD
2588 def __repr__(self):
2589 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2590 def __init__(self, *args, **kwargs):
a95a7133 2591 """__init__(self) -> JPEGHandler"""
54f9ee45 2592 newobj = _core_.new_JPEGHandler(*args, **kwargs)
d14a1e28
RD
2593 self.this = newobj.this
2594 self.thisown = 1
2595 del newobj.thisown
d14a1e28
RD
2596
2597class JPEGHandlerPtr(JPEGHandler):
2598 def __init__(self, this):
2599 self.this = this
2600 if not hasattr(self,"thisown"): self.thisown = 0
2601 self.__class__ = JPEGHandler
54f9ee45 2602_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
d14a1e28
RD
2603
2604class PNMHandler(ImageHandler):
e811c8ce
RD
2605 def __repr__(self):
2606 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2607 def __init__(self, *args, **kwargs):
a95a7133 2608 """__init__(self) -> PNMHandler"""
54f9ee45 2609 newobj = _core_.new_PNMHandler(*args, **kwargs)
d14a1e28
RD
2610 self.this = newobj.this
2611 self.thisown = 1
2612 del newobj.thisown
d14a1e28
RD
2613
2614class PNMHandlerPtr(PNMHandler):
2615 def __init__(self, this):
2616 self.this = this
2617 if not hasattr(self,"thisown"): self.thisown = 0
2618 self.__class__ = PNMHandler
54f9ee45 2619_core_.PNMHandler_swigregister(PNMHandlerPtr)
d14a1e28
RD
2620
2621class XPMHandler(ImageHandler):
e811c8ce
RD
2622 def __repr__(self):
2623 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2624 def __init__(self, *args, **kwargs):
a95a7133 2625 """__init__(self) -> XPMHandler"""
54f9ee45 2626 newobj = _core_.new_XPMHandler(*args, **kwargs)
d14a1e28
RD
2627 self.this = newobj.this
2628 self.thisown = 1
2629 del newobj.thisown
d14a1e28
RD
2630
2631class XPMHandlerPtr(XPMHandler):
2632 def __init__(self, this):
2633 self.this = this
2634 if not hasattr(self,"thisown"): self.thisown = 0
2635 self.__class__ = XPMHandler
54f9ee45 2636_core_.XPMHandler_swigregister(XPMHandlerPtr)
d14a1e28
RD
2637
2638class TIFFHandler(ImageHandler):
e811c8ce
RD
2639 def __repr__(self):
2640 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2641 def __init__(self, *args, **kwargs):
a95a7133 2642 """__init__(self) -> TIFFHandler"""
54f9ee45 2643 newobj = _core_.new_TIFFHandler(*args, **kwargs)
d14a1e28
RD
2644 self.this = newobj.this
2645 self.thisown = 1
2646 del newobj.thisown
d14a1e28
RD
2647
2648class TIFFHandlerPtr(TIFFHandler):
2649 def __init__(self, this):
2650 self.this = this
2651 if not hasattr(self,"thisown"): self.thisown = 0
2652 self.__class__ = TIFFHandler
54f9ee45 2653_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
d14a1e28 2654
c0de73ae
RD
2655QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
2656QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
2657class Quantize(object):
2658 """Performs quantization, or colour reduction, on a wxImage."""
2659 def __init__(self): raise RuntimeError, "No constructor defined"
2660 def __repr__(self):
2661 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2662 def Quantize(*args, **kwargs):
2663 """
2664 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2665
2666 Reduce the colours in the source image and put the result into the
2667 destination image, setting the palette in the destination if
2668 needed. Both images may be the same, to overwrite the source image.
2669 """
2670 return _core_.Quantize_Quantize(*args, **kwargs)
2671
2672 Quantize = staticmethod(Quantize)
2673
2674class QuantizePtr(Quantize):
2675 def __init__(self, this):
2676 self.this = this
2677 if not hasattr(self,"thisown"): self.thisown = 0
2678 self.__class__ = Quantize
2679_core_.Quantize_swigregister(QuantizePtr)
2680
2681def Quantize_Quantize(*args, **kwargs):
2682 """
2683 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2684
2685 Reduce the colours in the source image and put the result into the
2686 destination image, setting the palette in the destination if
2687 needed. Both images may be the same, to overwrite the source image.
2688 """
2689 return _core_.Quantize_Quantize(*args, **kwargs)
2690
d14a1e28
RD
2691#---------------------------------------------------------------------------
2692
2693class EvtHandler(Object):
e811c8ce
RD
2694 def __repr__(self):
2695 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2696 def __init__(self, *args, **kwargs):
a95a7133 2697 """__init__(self) -> EvtHandler"""
54f9ee45 2698 newobj = _core_.new_EvtHandler(*args, **kwargs)
d14a1e28
RD
2699 self.this = newobj.this
2700 self.thisown = 1
2701 del newobj.thisown
e811c8ce 2702 def GetNextHandler(*args, **kwargs):
a95a7133 2703 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 2704 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
2705
2706 def GetPreviousHandler(*args, **kwargs):
a95a7133 2707 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 2708 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
2709
2710 def SetNextHandler(*args, **kwargs):
a95a7133 2711 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 2712 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
2713
2714 def SetPreviousHandler(*args, **kwargs):
a95a7133 2715 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 2716 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
2717
2718 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 2719 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 2720 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
2721
2722 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 2723 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 2724 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
2725
2726 def ProcessEvent(*args, **kwargs):
a95a7133 2727 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 2728 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
2729
2730 def AddPendingEvent(*args, **kwargs):
a95a7133 2731 """AddPendingEvent(self, Event event)"""
54f9ee45 2732 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
2733
2734 def ProcessPendingEvents(*args, **kwargs):
a95a7133 2735 """ProcessPendingEvents(self)"""
54f9ee45 2736 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
2737
2738 def Connect(*args, **kwargs):
a95a7133 2739 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 2740 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
2741
2742 def Disconnect(*args, **kwargs):
a95a7133 2743 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 2744 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
2745
2746 def _setOORInfo(*args, **kwargs):
a95a7133 2747 """_setOORInfo(self, PyObject _self)"""
54f9ee45 2748 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
e811c8ce 2749
d14a1e28
RD
2750 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2751 """
2752 Bind an event to an event handler.
2753
db3e571a
RD
2754 :param event: One of the EVT_* objects that specifies the
2755 type of event to bind,
d14a1e28 2756
db3e571a
RD
2757 :param handler: A callable object to be invoked when the
2758 event is delivered to self. Pass None to
2759 disconnect an event handler.
d14a1e28 2760
db3e571a
RD
2761 :param source: Sometimes the event originates from a
2762 different window than self, but you still
2763 want to catch it in self. (For example, a
2764 button event delivered to a frame.) By
2765 passing the source of the event, the event
2766 handling system is able to differentiate
2767 between the same event type from different
2768 controls.
d14a1e28 2769
db3e571a
RD
2770 :param id: Used to spcify the event source by ID instead
2771 of instance.
2772
2773 :param id2: Used when it is desirable to bind a handler
2774 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
2775 """
2776 if source is not None:
2777 id = source.GetId()
2778 event.Bind(self, id, id2, handler)
2779
66c033b4
RD
2780 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2781 """
2782 Disconencts the event handler binding for event from self.
2783 Returns True if successful.
2784 """
2785 if source is not None:
2786 id = source.GetId()
2787 return event.Unbind(self, id, id2)
d14a1e28 2788
d14a1e28
RD
2789
2790class EvtHandlerPtr(EvtHandler):
2791 def __init__(self, this):
2792 self.this = this
2793 if not hasattr(self,"thisown"): self.thisown = 0
2794 self.__class__ = EvtHandler
54f9ee45 2795_core_.EvtHandler_swigregister(EvtHandlerPtr)
d14a1e28
RD
2796
2797#---------------------------------------------------------------------------
2798
2799class PyEventBinder(object):
2800 """
2801 Instances of this class are used to bind specific events to event
2802 handlers.
2803 """
2804 def __init__(self, evtType, expectedIDs=0):
2805 if expectedIDs not in [0, 1, 2]:
2806 raise ValueError, "Invalid number of expectedIDs"
2807 self.expectedIDs = expectedIDs
2808
2809 if type(evtType) == list or type(evtType) == tuple:
2810 self.evtType = evtType
2811 else:
2812 self.evtType = [evtType]
2813
2814
2815 def Bind(self, target, id1, id2, function):
2816 """Bind this set of event types to target."""
2817 for et in self.evtType:
2818 target.Connect(id1, id2, et, function)
2819
66c033b4
RD
2820
2821 def Unbind(self, target, id1, id2):
2822 """Remove an event binding."""
2823 success = 0
2824 for et in self.evtType:
2825 success += target.Disconnect(id1, id2, et)
2826 return success != 0
2827
d14a1e28
RD
2828
2829 def __call__(self, *args):
2830 """
2831 For backwards compatibility with the old EVT_* functions.
2832 Should be called with either (window, func), (window, ID,
2833 func) or (window, ID1, ID2, func) parameters depending on the
2834 type of the event.
2835 """
2836 assert len(args) == 2 + self.expectedIDs
2837 id1 = wx.ID_ANY
2838 id2 = wx.ID_ANY
2839 target = args[0]
2840 if self.expectedIDs == 0:
2841 func = args[1]
2842 elif self.expectedIDs == 1:
2843 id1 = args[1]
2844 func = args[2]
2845 elif self.expectedIDs == 2:
2846 id1 = args[1]
2847 id2 = args[2]
2848 func = args[3]
2849 else:
2850 raise ValueError, "Unexpected number of IDs"
2851
2852 self.Bind(target, id1, id2, func)
2853
2854
2855# These two are square pegs that don't fit the PyEventBinder hole...
2856def EVT_COMMAND(win, id, cmd, func):
2857 win.Connect(id, -1, cmd, func)
2858def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
2859 win.Connect(id1, id2, cmd, func)
2860
2861
2862#---------------------------------------------------------------------------
2863
2864#---------------------------------------------------------------------------
2865
54f9ee45
RD
2866EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
2867EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 2868
e811c8ce
RD
2869def NewEventType(*args, **kwargs):
2870 """NewEventType() -> wxEventType"""
54f9ee45
RD
2871 return _core_.NewEventType(*args, **kwargs)
2872wxEVT_NULL = _core_.wxEVT_NULL
2873wxEVT_FIRST = _core_.wxEVT_FIRST
2874wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
2875wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
2876wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
2877wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
2878wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
2879wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
2880wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
2881wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
2882wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
2883wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
2884wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
2885wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
2886wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
2887wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
2888wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
2889wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
2890wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
2891wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
2892wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
2893wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
2894wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
2895wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
2896wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
2897wxEVT_MOTION = _core_.wxEVT_MOTION
2898wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
2899wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
2900wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
2901wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
2902wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
2903wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
2904wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
2905wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
2906wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
2907wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
2908wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
2909wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
2910wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
2911wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
2912wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
2913wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
2914wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
2915wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
2916wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
2917wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
2918wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
2919wxEVT_CHAR = _core_.wxEVT_CHAR
2920wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
2921wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
2922wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
2923wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
2924wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
2925wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
2926wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
2927wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
2928wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
2929wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
2930wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
2931wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
2932wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
2933wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
2934wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
2935wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
2936wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
2937wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
2938wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
2939wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
2940wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
2941wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
2942wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
2943wxEVT_SIZE = _core_.wxEVT_SIZE
2944wxEVT_MOVE = _core_.wxEVT_MOVE
2945wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
2946wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
2947wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
2948wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
2949wxEVT_POWER = _core_.wxEVT_POWER
2950wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
2951wxEVT_CREATE = _core_.wxEVT_CREATE
2952wxEVT_DESTROY = _core_.wxEVT_DESTROY
2953wxEVT_SHOW = _core_.wxEVT_SHOW
2954wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
2955wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
2956wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
2957wxEVT_PAINT = _core_.wxEVT_PAINT
2958wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
2959wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
2960wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
2961wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
2962wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
2963wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
2964wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
2965wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
2966wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
2967wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
2968wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
2969wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
2970wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
2971wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
2972wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
2973wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
2974wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
2975wxEVT_IDLE = _core_.wxEVT_IDLE
2976wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
2977wxEVT_SIZING = _core_.wxEVT_SIZING
2978wxEVT_MOVING = _core_.wxEVT_MOVING
2979wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
2980wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
2981wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
2982wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
2983wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
2984wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
2985wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
2986#
2987# Create some event binders
2988EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
2989EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
2990EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
2991EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
2992EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
2993EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
2994EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
2995EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
2996EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
2997EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
2998EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
2999EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3000EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3001EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3002EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3003EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3004EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3005EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3006EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3007EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3008EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3009EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3010EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3011EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
3012EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3013EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3014EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3015EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3016EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3017EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3018EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3019EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3020EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3021EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3022EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3023EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3024EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3025EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3026EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3027EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3028
3029EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3030EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3031EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3032EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3033EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3034EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3035EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3036EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3037EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3038EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3039EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3040EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3041EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3042
3043EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3044 wxEVT_LEFT_UP,
3045 wxEVT_MIDDLE_DOWN,
3046 wxEVT_MIDDLE_UP,
3047 wxEVT_RIGHT_DOWN,
3048 wxEVT_RIGHT_UP,
3049 wxEVT_MOTION,
3050 wxEVT_LEFT_DCLICK,
3051 wxEVT_MIDDLE_DCLICK,
3052 wxEVT_RIGHT_DCLICK,
3053 wxEVT_ENTER_WINDOW,
3054 wxEVT_LEAVE_WINDOW,
3055 wxEVT_MOUSEWHEEL
3056 ])
3057
3058
3059# Scrolling from wxWindow (sent to wxScrolledWindow)
3060EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3061 wxEVT_SCROLLWIN_BOTTOM,
3062 wxEVT_SCROLLWIN_LINEUP,
3063 wxEVT_SCROLLWIN_LINEDOWN,
3064 wxEVT_SCROLLWIN_PAGEUP,
3065 wxEVT_SCROLLWIN_PAGEDOWN,
3066 wxEVT_SCROLLWIN_THUMBTRACK,
3067 wxEVT_SCROLLWIN_THUMBRELEASE,
3068 ])
3069
3070EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3071EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3072EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3073EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3074EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3075EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3076EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3077EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3078
3079# Scrolling from wxSlider and wxScrollBar
3080EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3081 wxEVT_SCROLL_BOTTOM,
3082 wxEVT_SCROLL_LINEUP,
3083 wxEVT_SCROLL_LINEDOWN,
3084 wxEVT_SCROLL_PAGEUP,
3085 wxEVT_SCROLL_PAGEDOWN,
3086 wxEVT_SCROLL_THUMBTRACK,
3087 wxEVT_SCROLL_THUMBRELEASE,
3088 wxEVT_SCROLL_ENDSCROLL,
3089 ])
3090
3091EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3092EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3093EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3094EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3095EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3096EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3097EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3098EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3099EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3100
3101# Scrolling from wxSlider and wxScrollBar, with an id
3102EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3103 wxEVT_SCROLL_BOTTOM,
3104 wxEVT_SCROLL_LINEUP,
3105 wxEVT_SCROLL_LINEDOWN,
3106 wxEVT_SCROLL_PAGEUP,
3107 wxEVT_SCROLL_PAGEDOWN,
3108 wxEVT_SCROLL_THUMBTRACK,
3109 wxEVT_SCROLL_THUMBRELEASE,
3110 wxEVT_SCROLL_ENDSCROLL,
3111 ], 1)
3112
3113EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3114EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3115EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3116EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3117EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3118EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3119EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3120EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3121EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3122
d14a1e28
RD
3123EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3124EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3125EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3126EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3127EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3128EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3129EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3130EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3131EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3132EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3133
3134EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3135EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3136EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3137EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3138EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3139EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3140EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3141EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3142EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3143
3144
3145EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3146EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3147EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3148EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3149EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3150EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3151EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3152
3153EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3154
3155EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3156EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3157
3158EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3159
3160
3161
3162#---------------------------------------------------------------------------
3163
3164class Event(Object):
e811c8ce
RD
3165 def __init__(self): raise RuntimeError, "No constructor defined"
3166 def __repr__(self):
3167 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45 3168 def __del__(self, destroy=_core_.delete_Event):
a95a7133 3169 """__del__(self)"""
d14a1e28
RD
3170 try:
3171 if self.thisown: destroy(self)
3172 except: pass
e811c8ce
RD
3173
3174 def SetEventType(*args, **kwargs):
a95a7133 3175 """SetEventType(self, wxEventType typ)"""
54f9ee45 3176 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
3177
3178 def GetEventType(*args, **kwargs):
a95a7133 3179 """GetEventType(self) -> wxEventType"""
54f9ee45 3180 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
3181
3182 def GetEventObject(*args, **kwargs):
a95a7133 3183 """GetEventObject(self) -> Object"""
54f9ee45 3184 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
3185
3186 def SetEventObject(*args, **kwargs):
a95a7133 3187 """SetEventObject(self, Object obj)"""
54f9ee45 3188 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
3189
3190 def GetTimestamp(*args, **kwargs):
a95a7133 3191 """GetTimestamp(self) -> long"""
54f9ee45 3192 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
3193
3194 def SetTimestamp(*args, **kwargs):
a95a7133 3195 """SetTimestamp(self, long ts=0)"""
54f9ee45 3196 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
3197
3198 def GetId(*args, **kwargs):
a95a7133 3199 """GetId(self) -> int"""
54f9ee45 3200 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
3201
3202 def SetId(*args, **kwargs):
a95a7133 3203 """SetId(self, int Id)"""
54f9ee45 3204 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
3205
3206 def IsCommandEvent(*args, **kwargs):
a95a7133 3207 """IsCommandEvent(self) -> bool"""
54f9ee45 3208 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
3209
3210 def Skip(*args, **kwargs):
a95a7133 3211 """Skip(self, bool skip=True)"""
54f9ee45 3212 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
3213
3214 def GetSkipped(*args, **kwargs):
a95a7133 3215 """GetSkipped(self) -> bool"""
54f9ee45 3216 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
3217
3218 def ShouldPropagate(*args, **kwargs):
a95a7133 3219 """ShouldPropagate(self) -> bool"""
54f9ee45 3220 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
3221
3222 def StopPropagation(*args, **kwargs):
a95a7133 3223 """StopPropagation(self) -> int"""
54f9ee45 3224 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
3225
3226 def ResumePropagation(*args, **kwargs):
a95a7133 3227 """ResumePropagation(self, int propagationLevel)"""
54f9ee45 3228 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
3229
3230 def Clone(*args, **kwargs):
a95a7133 3231 """Clone(self) -> Event"""
54f9ee45 3232 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 3233
d14a1e28
RD
3234
3235class EventPtr(Event):
3236 def __init__(self, this):
3237 self.this = this
3238 if not hasattr(self,"thisown"): self.thisown = 0
3239 self.__class__ = Event
54f9ee45 3240_core_.Event_swigregister(EventPtr)
d14a1e28
RD
3241
3242#---------------------------------------------------------------------------
3243
3244class PropagationDisabler(object):
e811c8ce
RD
3245 def __repr__(self):
3246 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3247 def __init__(self, *args, **kwargs):
a95a7133 3248 """__init__(self, Event event) -> PropagationDisabler"""
54f9ee45 3249 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
d14a1e28
RD
3250 self.this = newobj.this
3251 self.thisown = 1
3252 del newobj.thisown
54f9ee45 3253 def __del__(self, destroy=_core_.delete_PropagationDisabler):
a95a7133 3254 """__del__(self)"""
d14a1e28
RD
3255 try:
3256 if self.thisown: destroy(self)
3257 except: pass
e811c8ce 3258
d14a1e28
RD
3259
3260class PropagationDisablerPtr(PropagationDisabler):
3261 def __init__(self, this):
3262 self.this = this
3263 if not hasattr(self,"thisown"): self.thisown = 0
3264 self.__class__ = PropagationDisabler
54f9ee45 3265_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
d14a1e28
RD
3266
3267class PropagateOnce(object):
e811c8ce
RD
3268 def __repr__(self):
3269 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3270 def __init__(self, *args, **kwargs):
a95a7133 3271 """__init__(self, Event event) -> PropagateOnce"""
54f9ee45 3272 newobj = _core_.new_PropagateOnce(*args, **kwargs)
d14a1e28
RD
3273 self.this = newobj.this
3274 self.thisown = 1
3275 del newobj.thisown
54f9ee45 3276 def __del__(self, destroy=_core_.delete_PropagateOnce):
a95a7133 3277 """__del__(self)"""
d14a1e28
RD
3278 try:
3279 if self.thisown: destroy(self)
3280 except: pass
e811c8ce 3281
d14a1e28
RD
3282
3283class PropagateOncePtr(PropagateOnce):
3284 def __init__(self, this):
3285 self.this = this
3286 if not hasattr(self,"thisown"): self.thisown = 0
3287 self.__class__ = PropagateOnce
54f9ee45 3288_core_.PropagateOnce_swigregister(PropagateOncePtr)
d14a1e28
RD
3289
3290#---------------------------------------------------------------------------
3291
3292class CommandEvent(Event):
e811c8ce
RD
3293 def __repr__(self):
3294 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3295 def __init__(self, *args, **kwargs):
a95a7133 3296 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
54f9ee45 3297 newobj = _core_.new_CommandEvent(*args, **kwargs)
d14a1e28
RD
3298 self.this = newobj.this
3299 self.thisown = 1
3300 del newobj.thisown
e811c8ce 3301 def GetSelection(*args, **kwargs):
a95a7133 3302 """GetSelection(self) -> int"""
54f9ee45 3303 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
3304
3305 def SetString(*args, **kwargs):
a95a7133 3306 """SetString(self, String s)"""
54f9ee45 3307 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
3308
3309 def GetString(*args, **kwargs):
a95a7133 3310 """GetString(self) -> String"""
54f9ee45 3311 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
3312
3313 def IsChecked(*args, **kwargs):
a95a7133 3314 """IsChecked(self) -> bool"""
54f9ee45 3315 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 3316
242b7b46 3317 Checked = IsChecked
e811c8ce 3318 def IsSelection(*args, **kwargs):
a95a7133 3319 """IsSelection(self) -> bool"""
54f9ee45 3320 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
3321
3322 def SetExtraLong(*args, **kwargs):
a95a7133 3323 """SetExtraLong(self, long extraLong)"""
54f9ee45 3324 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
3325
3326 def GetExtraLong(*args, **kwargs):
a95a7133 3327 """GetExtraLong(self) -> long"""
54f9ee45 3328 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
3329
3330 def SetInt(*args, **kwargs):
a95a7133 3331 """SetInt(self, int i)"""
54f9ee45 3332 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
3333
3334 def GetInt(*args, **kwargs):
a95a7133 3335 """GetInt(self) -> long"""
54f9ee45 3336 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce
RD
3337
3338 def Clone(*args, **kwargs):
a95a7133 3339 """Clone(self) -> Event"""
54f9ee45 3340 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 3341
d14a1e28
RD
3342
3343class CommandEventPtr(CommandEvent):
3344 def __init__(self, this):
3345 self.this = this
3346 if not hasattr(self,"thisown"): self.thisown = 0
3347 self.__class__ = CommandEvent
54f9ee45 3348_core_.CommandEvent_swigregister(CommandEventPtr)
d14a1e28
RD
3349
3350#---------------------------------------------------------------------------
3351
3352class NotifyEvent(CommandEvent):
e811c8ce
RD
3353 def __repr__(self):
3354 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3355 def __init__(self, *args, **kwargs):
a95a7133 3356 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
54f9ee45 3357 newobj = _core_.new_NotifyEvent(*args, **kwargs)
d14a1e28
RD
3358 self.this = newobj.this
3359 self.thisown = 1
3360 del newobj.thisown
e811c8ce 3361 def Veto(*args, **kwargs):
a95a7133 3362 """Veto(self)"""
54f9ee45 3363 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
3364
3365 def Allow(*args, **kwargs):
a95a7133 3366 """Allow(self)"""
54f9ee45 3367 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
3368
3369 def IsAllowed(*args, **kwargs):
a95a7133 3370 """IsAllowed(self) -> bool"""
54f9ee45 3371 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 3372
d14a1e28
RD
3373
3374class NotifyEventPtr(NotifyEvent):
3375 def __init__(self, this):
3376 self.this = this
3377 if not hasattr(self,"thisown"): self.thisown = 0
3378 self.__class__ = NotifyEvent
54f9ee45 3379_core_.NotifyEvent_swigregister(NotifyEventPtr)
d14a1e28
RD
3380
3381#---------------------------------------------------------------------------
3382
3383class ScrollEvent(CommandEvent):
e811c8ce
RD
3384 def __repr__(self):
3385 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3386 def __init__(self, *args, **kwargs):
0df68c9f 3387 """
a95a7133 3388 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
3389 int orient=0) -> ScrollEvent
3390 """
54f9ee45 3391 newobj = _core_.new_ScrollEvent(*args, **kwargs)
d14a1e28
RD
3392 self.this = newobj.this
3393 self.thisown = 1
3394 del newobj.thisown
e811c8ce 3395 def GetOrientation(*args, **kwargs):
a95a7133 3396 """GetOrientation(self) -> int"""
54f9ee45 3397 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
3398
3399 def GetPosition(*args, **kwargs):
a95a7133 3400 """GetPosition(self) -> int"""
54f9ee45 3401 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3402
3403 def SetOrientation(*args, **kwargs):
a95a7133 3404 """SetOrientation(self, int orient)"""
54f9ee45 3405 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
3406
3407 def SetPosition(*args, **kwargs):
a95a7133 3408 """SetPosition(self, int pos)"""
54f9ee45 3409 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 3410
d14a1e28
RD
3411
3412class ScrollEventPtr(ScrollEvent):
3413 def __init__(self, this):
3414 self.this = this
3415 if not hasattr(self,"thisown"): self.thisown = 0
3416 self.__class__ = ScrollEvent
54f9ee45 3417_core_.ScrollEvent_swigregister(ScrollEventPtr)
d14a1e28
RD
3418
3419#---------------------------------------------------------------------------
3420
3421class ScrollWinEvent(Event):
e811c8ce
RD
3422 def __repr__(self):
3423 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3424 def __init__(self, *args, **kwargs):
a95a7133 3425 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
54f9ee45 3426 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
d14a1e28
RD
3427 self.this = newobj.this
3428 self.thisown = 1
3429 del newobj.thisown
e811c8ce 3430 def GetOrientation(*args, **kwargs):
a95a7133 3431 """GetOrientation(self) -> int"""
54f9ee45 3432 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
3433
3434 def GetPosition(*args, **kwargs):
a95a7133 3435 """GetPosition(self) -> int"""
54f9ee45 3436 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3437
3438 def SetOrientation(*args, **kwargs):
a95a7133 3439 """SetOrientation(self, int orient)"""
54f9ee45 3440 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
3441
3442 def SetPosition(*args, **kwargs):
a95a7133 3443 """SetPosition(self, int pos)"""
54f9ee45 3444 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 3445
d14a1e28
RD
3446
3447class ScrollWinEventPtr(ScrollWinEvent):
3448 def __init__(self, this):
3449 self.this = this
3450 if not hasattr(self,"thisown"): self.thisown = 0
3451 self.__class__ = ScrollWinEvent
54f9ee45 3452_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
d14a1e28
RD
3453
3454#---------------------------------------------------------------------------
3455
54f9ee45
RD
3456MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3457MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3458MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3459MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3460MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 3461class MouseEvent(Event):
e811c8ce
RD
3462 def __repr__(self):
3463 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3464 def __init__(self, *args, **kwargs):
a95a7133 3465 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
54f9ee45 3466 newobj = _core_.new_MouseEvent(*args, **kwargs)
d14a1e28
RD
3467 self.this = newobj.this
3468 self.thisown = 1
3469 del newobj.thisown
e811c8ce 3470 def IsButton(*args, **kwargs):
a95a7133 3471 """IsButton(self) -> bool"""
54f9ee45 3472 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
3473
3474 def ButtonDown(*args, **kwargs):
a95a7133 3475 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
54f9ee45 3476 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
3477
3478 def ButtonDClick(*args, **kwargs):
a95a7133 3479 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
54f9ee45 3480 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
3481
3482 def ButtonUp(*args, **kwargs):
a95a7133 3483 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
54f9ee45 3484 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
3485
3486 def Button(*args, **kwargs):
a95a7133 3487 """Button(self, int but) -> bool"""
54f9ee45 3488 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
3489
3490 def ButtonIsDown(*args, **kwargs):
a95a7133 3491 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 3492 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
3493
3494 def GetButton(*args, **kwargs):
a95a7133 3495 """GetButton(self) -> int"""
54f9ee45 3496 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
3497
3498 def ControlDown(*args, **kwargs):
a95a7133 3499 """ControlDown(self) -> bool"""
54f9ee45 3500 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
3501
3502 def MetaDown(*args, **kwargs):
a95a7133 3503 """MetaDown(self) -> bool"""
54f9ee45 3504 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
3505
3506 def AltDown(*args, **kwargs):
a95a7133 3507 """AltDown(self) -> bool"""
54f9ee45 3508 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
3509
3510 def ShiftDown(*args, **kwargs):
a95a7133 3511 """ShiftDown(self) -> bool"""
54f9ee45 3512 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 3513
412d302d
RD
3514 def CmdDown(*args, **kwargs):
3515 """
3516 CmdDown(self) -> bool
3517
3518 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3519 platforms but the special "Apple" (a.k.a as "Command") key on
3520 Macs: it makes often sense to use it instead of, say, `ControlDown`
3521 because Cmd key is used for the same thing under Mac as Ctrl
3522 elsewhere. The Ctrl still exists, it's just not used for this
3523 purpose. So for non-Mac platforms this is the same as `ControlDown`
3524 and Macs this is the same as `MetaDown`.
3525 """
3526 return _core_.MouseEvent_CmdDown(*args, **kwargs)
3527
e811c8ce 3528 def LeftDown(*args, **kwargs):
a95a7133 3529 """LeftDown(self) -> bool"""
54f9ee45 3530 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
3531
3532 def MiddleDown(*args, **kwargs):
a95a7133 3533 """MiddleDown(self) -> bool"""
54f9ee45 3534 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
3535
3536 def RightDown(*args, **kwargs):
a95a7133 3537 """RightDown(self) -> bool"""
54f9ee45 3538 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
3539
3540 def LeftUp(*args, **kwargs):
a95a7133 3541 """LeftUp(self) -> bool"""
54f9ee45 3542 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
3543
3544 def MiddleUp(*args, **kwargs):
a95a7133 3545 """MiddleUp(self) -> bool"""
54f9ee45 3546 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
3547
3548 def RightUp(*args, **kwargs):
a95a7133 3549 """RightUp(self) -> bool"""
54f9ee45 3550 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
3551
3552 def LeftDClick(*args, **kwargs):
a95a7133 3553 """LeftDClick(self) -> bool"""
54f9ee45 3554 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
3555
3556 def MiddleDClick(*args, **kwargs):
a95a7133 3557 """MiddleDClick(self) -> bool"""
54f9ee45 3558 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
3559
3560 def RightDClick(*args, **kwargs):
a95a7133 3561 """RightDClick(self) -> bool"""
54f9ee45 3562 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
3563
3564 def LeftIsDown(*args, **kwargs):
a95a7133 3565 """LeftIsDown(self) -> bool"""
54f9ee45 3566 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
3567
3568 def MiddleIsDown(*args, **kwargs):
a95a7133 3569 """MiddleIsDown(self) -> bool"""
54f9ee45 3570 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
3571
3572 def RightIsDown(*args, **kwargs):
a95a7133 3573 """RightIsDown(self) -> bool"""
54f9ee45 3574 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
3575
3576 def Dragging(*args, **kwargs):
a95a7133 3577 """Dragging(self) -> bool"""
54f9ee45 3578 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
3579
3580 def Moving(*args, **kwargs):
a95a7133 3581 """Moving(self) -> bool"""
54f9ee45 3582 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
3583
3584 def Entering(*args, **kwargs):
a95a7133 3585 """Entering(self) -> bool"""
54f9ee45 3586 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
3587
3588 def Leaving(*args, **kwargs):
a95a7133 3589 """Leaving(self) -> bool"""
54f9ee45 3590 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
3591
3592 def GetPosition(*args, **kwargs):
0df68c9f 3593 """
a95a7133 3594 GetPosition(self) -> Point
e811c8ce 3595
41e2b43e
RD
3596 Returns the position of the mouse in window coordinates when the event
3597 happened.
0df68c9f 3598 """
54f9ee45 3599 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3600
3601 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
3602 """
3603 GetPositionTuple() -> (x,y)
e811c8ce 3604
41e2b43e
RD
3605 Returns the position of the mouse in window coordinates when the event
3606 happened.
0df68c9f 3607 """
54f9ee45 3608 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
3609
3610 def GetLogicalPosition(*args, **kwargs):
a95a7133 3611 """GetLogicalPosition(self, DC dc) -> Point"""
54f9ee45 3612 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
3613
3614 def GetX(*args, **kwargs):
a95a7133 3615 """GetX(self) -> int"""
54f9ee45 3616 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
3617
3618 def GetY(*args, **kwargs):
a95a7133 3619 """GetY(self) -> int"""
54f9ee45 3620 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
3621
3622 def GetWheelRotation(*args, **kwargs):
a95a7133 3623 """GetWheelRotation(self) -> int"""
54f9ee45 3624 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
3625
3626 def GetWheelDelta(*args, **kwargs):
a95a7133 3627 """GetWheelDelta(self) -> int"""
54f9ee45 3628 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce
RD
3629
3630 def GetLinesPerAction(*args, **kwargs):
a95a7133 3631 """GetLinesPerAction(self) -> int"""
54f9ee45 3632 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
3633
3634 def IsPageScroll(*args, **kwargs):
a95a7133 3635 """IsPageScroll(self) -> bool"""
54f9ee45
RD
3636 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3637
3638 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3639 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3640 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3641 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3642 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3643 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3644 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3645 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3646 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3647 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3648 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3649 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
d14a1e28
RD
3650
3651class MouseEventPtr(MouseEvent):
3652 def __init__(self, this):
3653 self.this = this
3654 if not hasattr(self,"thisown"): self.thisown = 0
3655 self.__class__ = MouseEvent
54f9ee45 3656_core_.MouseEvent_swigregister(MouseEventPtr)
d14a1e28
RD
3657
3658#---------------------------------------------------------------------------
3659
3660class SetCursorEvent(Event):
e811c8ce
RD
3661 def __repr__(self):
3662 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3663 def __init__(self, *args, **kwargs):
a95a7133 3664 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
54f9ee45 3665 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
d14a1e28
RD
3666 self.this = newobj.this
3667 self.thisown = 1
3668 del newobj.thisown
e811c8ce 3669 def GetX(*args, **kwargs):
a95a7133 3670 """GetX(self) -> int"""
54f9ee45 3671 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
3672
3673 def GetY(*args, **kwargs):
a95a7133 3674 """GetY(self) -> int"""
54f9ee45 3675 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
3676
3677 def SetCursor(*args, **kwargs):
a95a7133 3678 """SetCursor(self, Cursor cursor)"""
54f9ee45 3679 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
3680
3681 def GetCursor(*args, **kwargs):
a95a7133 3682 """GetCursor(self) -> Cursor"""
54f9ee45 3683 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
3684
3685 def HasCursor(*args, **kwargs):
a95a7133 3686 """HasCursor(self) -> bool"""
54f9ee45 3687 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 3688
d14a1e28
RD
3689
3690class SetCursorEventPtr(SetCursorEvent):
3691 def __init__(self, this):
3692 self.this = this
3693 if not hasattr(self,"thisown"): self.thisown = 0
3694 self.__class__ = SetCursorEvent
54f9ee45 3695_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
d14a1e28
RD
3696
3697#---------------------------------------------------------------------------
3698
3699class KeyEvent(Event):
e811c8ce
RD
3700 def __repr__(self):
3701 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3702 def __init__(self, *args, **kwargs):
a95a7133 3703 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
54f9ee45 3704 newobj = _core_.new_KeyEvent(*args, **kwargs)
d14a1e28
RD
3705 self.this = newobj.this
3706 self.thisown = 1
3707 del newobj.thisown
e811c8ce 3708 def ControlDown(*args, **kwargs):
a95a7133 3709 """ControlDown(self) -> bool"""
54f9ee45 3710 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
3711
3712 def MetaDown(*args, **kwargs):
a95a7133 3713 """MetaDown(self) -> bool"""
54f9ee45 3714 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
3715
3716 def AltDown(*args, **kwargs):
a95a7133 3717 """AltDown(self) -> bool"""
54f9ee45 3718 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
3719
3720 def ShiftDown(*args, **kwargs):
a95a7133 3721 """ShiftDown(self) -> bool"""
54f9ee45 3722 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 3723
412d302d
RD
3724 def CmdDown(*args, **kwargs):
3725 """
3726 CmdDown(self) -> bool
3727
3728 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3729 platforms but the special "Apple" (a.k.a as "Command") key on
3730 Macs: it makes often sense to use it instead of, say, `ControlDown`
3731 because Cmd key is used for the same thing under Mac as Ctrl
3732 elsewhere. The Ctrl still exists, it's just not used for this
3733 purpose. So for non-Mac platforms this is the same as `ControlDown`
3734 and Macs this is the same as `MetaDown`.
3735 """
3736 return _core_.KeyEvent_CmdDown(*args, **kwargs)
3737
e811c8ce 3738 def HasModifiers(*args, **kwargs):
a95a7133 3739 """HasModifiers(self) -> bool"""
54f9ee45 3740 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
3741
3742 def GetKeyCode(*args, **kwargs):
a95a7133 3743 """GetKeyCode(self) -> int"""
54f9ee45 3744 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 3745
d14a1e28 3746 KeyCode = GetKeyCode
19272049
RD
3747 def GetUnicodeKey(*args, **kwargs):
3748 """GetUnicodeKey(self) -> int"""
3749 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 3750
19272049 3751 GetUniChar = GetUnicodeKey
e811c8ce 3752 def GetRawKeyCode(*args, **kwargs):
a95a7133 3753 """GetRawKeyCode(self) -> unsigned int"""
54f9ee45 3754 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
3755
3756 def GetRawKeyFlags(*args, **kwargs):
a95a7133 3757 """GetRawKeyFlags(self) -> unsigned int"""
54f9ee45 3758 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
3759
3760 def GetPosition(*args, **kwargs):
0df68c9f 3761 """
a95a7133 3762 GetPosition(self) -> Point
e811c8ce 3763
0df68c9f
RD
3764 Find the position of the event.
3765 """
54f9ee45 3766 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3767
3768 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
3769 """
3770 GetPositionTuple() -> (x,y)
e811c8ce 3771
0df68c9f
RD
3772 Find the position of the event.
3773 """
54f9ee45 3774 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
3775
3776 def GetX(*args, **kwargs):
a95a7133 3777 """GetX(self) -> int"""
54f9ee45 3778 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
3779
3780 def GetY(*args, **kwargs):
a95a7133 3781 """GetY(self) -> int"""
54f9ee45
RD
3782 return _core_.KeyEvent_GetY(*args, **kwargs)
3783
3784 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
3785 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
3786 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
3787 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
3788 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
3789 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
3790 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
3791 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
3792 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
3793 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
d14a1e28
RD
3794
3795class KeyEventPtr(KeyEvent):
3796 def __init__(self, this):
3797 self.this = this
3798 if not hasattr(self,"thisown"): self.thisown = 0
3799 self.__class__ = KeyEvent
54f9ee45 3800_core_.KeyEvent_swigregister(KeyEventPtr)
d14a1e28
RD
3801
3802#---------------------------------------------------------------------------
3803
3804class SizeEvent(Event):
e811c8ce
RD
3805 def __repr__(self):
3806 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3807 def __init__(self, *args, **kwargs):
a95a7133 3808 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
54f9ee45 3809 newobj = _core_.new_SizeEvent(*args, **kwargs)
d14a1e28
RD
3810 self.this = newobj.this
3811 self.thisown = 1
3812 del newobj.thisown
e811c8ce 3813 def GetSize(*args, **kwargs):
a95a7133 3814 """GetSize(self) -> Size"""
54f9ee45 3815 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
3816
3817 def GetRect(*args, **kwargs):
a95a7133 3818 """GetRect(self) -> Rect"""
54f9ee45 3819 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
3820
3821 def SetRect(*args, **kwargs):
a95a7133 3822 """SetRect(self, Rect rect)"""
54f9ee45 3823 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
3824
3825 def SetSize(*args, **kwargs):
a95a7133 3826 """SetSize(self, Size size)"""
54f9ee45 3827 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 3828
54f9ee45
RD
3829 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
3830 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
d14a1e28
RD
3831
3832class SizeEventPtr(SizeEvent):
3833 def __init__(self, this):
3834 self.this = this
3835 if not hasattr(self,"thisown"): self.thisown = 0
3836 self.__class__ = SizeEvent
54f9ee45 3837_core_.SizeEvent_swigregister(SizeEventPtr)
d14a1e28
RD
3838
3839#---------------------------------------------------------------------------
3840
3841class MoveEvent(Event):
e811c8ce
RD
3842 def __repr__(self):
3843 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3844 def __init__(self, *args, **kwargs):
a95a7133 3845 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
54f9ee45 3846 newobj = _core_.new_MoveEvent(*args, **kwargs)
d14a1e28
RD
3847 self.this = newobj.this
3848 self.thisown = 1
3849 del newobj.thisown
e811c8ce 3850 def GetPosition(*args, **kwargs):
a95a7133 3851 """GetPosition(self) -> Point"""
54f9ee45 3852 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3853
3854 def GetRect(*args, **kwargs):
a95a7133 3855 """GetRect(self) -> Rect"""
54f9ee45 3856 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
3857
3858 def SetRect(*args, **kwargs):
a95a7133 3859 """SetRect(self, Rect rect)"""
54f9ee45 3860 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
3861
3862 def SetPosition(*args, **kwargs):
a95a7133 3863 """SetPosition(self, Point pos)"""
54f9ee45 3864 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 3865
54f9ee45
RD
3866 m_pos = property(_core_.MoveEvent_m_pos_get, _core_.MoveEvent_m_pos_set)
3867 m_rect = property(_core_.MoveEvent_m_rect_get, _core_.MoveEvent_m_rect_set)
d14a1e28
RD
3868
3869class MoveEventPtr(MoveEvent):
3870 def __init__(self, this):
3871 self.this = this
3872 if not hasattr(self,"thisown"): self.thisown = 0
3873 self.__class__ = MoveEvent
54f9ee45 3874_core_.MoveEvent_swigregister(MoveEventPtr)
d14a1e28
RD
3875
3876#---------------------------------------------------------------------------
3877
3878class PaintEvent(Event):
e811c8ce
RD
3879 def __repr__(self):
3880 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3881 def __init__(self, *args, **kwargs):
a95a7133 3882 """__init__(self, int Id=0) -> PaintEvent"""
54f9ee45 3883 newobj = _core_.new_PaintEvent(*args, **kwargs)
d14a1e28
RD
3884 self.this = newobj.this
3885 self.thisown = 1
3886 del newobj.thisown
d14a1e28
RD
3887
3888class PaintEventPtr(PaintEvent):
3889 def __init__(self, this):
3890 self.this = this
3891 if not hasattr(self,"thisown"): self.thisown = 0
3892 self.__class__ = PaintEvent
54f9ee45 3893_core_.PaintEvent_swigregister(PaintEventPtr)
d14a1e28
RD
3894
3895class NcPaintEvent(Event):
e811c8ce
RD
3896 def __repr__(self):
3897 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3898 def __init__(self, *args, **kwargs):
a95a7133 3899 """__init__(self, int winid=0) -> NcPaintEvent"""
54f9ee45 3900 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
d14a1e28
RD
3901 self.this = newobj.this
3902 self.thisown = 1
3903 del newobj.thisown
d14a1e28
RD
3904
3905class NcPaintEventPtr(NcPaintEvent):
3906 def __init__(self, this):
3907 self.this = this
3908 if not hasattr(self,"thisown"): self.thisown = 0
3909 self.__class__ = NcPaintEvent
54f9ee45 3910_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
d14a1e28
RD
3911
3912#---------------------------------------------------------------------------
3913
3914class EraseEvent(Event):
e811c8ce
RD
3915 def __repr__(self):
3916 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3917 def __init__(self, *args, **kwargs):
a95a7133 3918 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
54f9ee45 3919 newobj = _core_.new_EraseEvent(*args, **kwargs)
d14a1e28
RD
3920 self.this = newobj.this
3921 self.thisown = 1
3922 del newobj.thisown
e811c8ce 3923 def GetDC(*args, **kwargs):
a95a7133 3924 """GetDC(self) -> DC"""
54f9ee45 3925 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 3926
d14a1e28
RD
3927
3928class EraseEventPtr(EraseEvent):
3929 def __init__(self, this):
3930 self.this = this
3931 if not hasattr(self,"thisown"): self.thisown = 0
3932 self.__class__ = EraseEvent
54f9ee45 3933_core_.EraseEvent_swigregister(EraseEventPtr)
d14a1e28
RD
3934
3935#---------------------------------------------------------------------------
3936
3937class FocusEvent(Event):
e811c8ce
RD
3938 def __repr__(self):
3939 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3940 def __init__(self, *args, **kwargs):
a95a7133 3941 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
54f9ee45 3942 newobj = _core_.new_FocusEvent(*args, **kwargs)
d14a1e28
RD
3943 self.this = newobj.this
3944 self.thisown = 1
3945 del newobj.thisown
e811c8ce 3946 def GetWindow(*args, **kwargs):
a95a7133 3947 """GetWindow(self) -> Window"""
54f9ee45 3948 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
3949
3950 def SetWindow(*args, **kwargs):
a95a7133 3951 """SetWindow(self, Window win)"""
54f9ee45 3952 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 3953
d14a1e28
RD
3954
3955class FocusEventPtr(FocusEvent):
3956 def __init__(self, this):
3957 self.this = this
3958 if not hasattr(self,"thisown"): self.thisown = 0
3959 self.__class__ = FocusEvent
54f9ee45 3960_core_.FocusEvent_swigregister(FocusEventPtr)
d14a1e28
RD
3961
3962#---------------------------------------------------------------------------
3963
3964class ChildFocusEvent(CommandEvent):
e811c8ce
RD
3965 def __repr__(self):
3966 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3967 def __init__(self, *args, **kwargs):
a95a7133 3968 """__init__(self, Window win=None) -> ChildFocusEvent"""
54f9ee45 3969 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
d14a1e28
RD
3970 self.this = newobj.this
3971 self.thisown = 1
3972 del newobj.thisown
e811c8ce 3973 def GetWindow(*args, **kwargs):
a95a7133 3974 """GetWindow(self) -> Window"""
54f9ee45 3975 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 3976
d14a1e28
RD
3977
3978class ChildFocusEventPtr(ChildFocusEvent):
3979 def __init__(self, this):
3980 self.this = this
3981 if not hasattr(self,"thisown"): self.thisown = 0
3982 self.__class__ = ChildFocusEvent
54f9ee45 3983_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
d14a1e28
RD
3984
3985#---------------------------------------------------------------------------
3986
3987class ActivateEvent(Event):
e811c8ce
RD
3988 def __repr__(self):
3989 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3990 def __init__(self, *args, **kwargs):
a95a7133 3991 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
54f9ee45 3992 newobj = _core_.new_ActivateEvent(*args, **kwargs)
d14a1e28
RD
3993 self.this = newobj.this
3994 self.thisown = 1
3995 del newobj.thisown
e811c8ce 3996 def GetActive(*args, **kwargs):
a95a7133 3997 """GetActive(self) -> bool"""
54f9ee45 3998 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 3999
d14a1e28
RD
4000
4001class ActivateEventPtr(ActivateEvent):
4002 def __init__(self, this):
4003 self.this = this
4004 if not hasattr(self,"thisown"): self.thisown = 0
4005 self.__class__ = ActivateEvent
54f9ee45 4006_core_.ActivateEvent_swigregister(ActivateEventPtr)
d14a1e28
RD
4007
4008#---------------------------------------------------------------------------
4009
4010class InitDialogEvent(Event):
e811c8ce
RD
4011 def __repr__(self):
4012 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4013 def __init__(self, *args, **kwargs):
a95a7133 4014 """__init__(self, int Id=0) -> InitDialogEvent"""
54f9ee45 4015 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
d14a1e28
RD
4016 self.this = newobj.this
4017 self.thisown = 1
4018 del newobj.thisown
d14a1e28
RD
4019
4020class InitDialogEventPtr(InitDialogEvent):
4021 def __init__(self, this):
4022 self.this = this
4023 if not hasattr(self,"thisown"): self.thisown = 0
4024 self.__class__ = InitDialogEvent
54f9ee45 4025_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
d14a1e28
RD
4026
4027#---------------------------------------------------------------------------
4028
4029class MenuEvent(Event):
e811c8ce
RD
4030 def __repr__(self):
4031 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4032 def __init__(self, *args, **kwargs):
a95a7133 4033 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
54f9ee45 4034 newobj = _core_.new_MenuEvent(*args, **kwargs)
d14a1e28
RD
4035 self.this = newobj.this
4036 self.thisown = 1
4037 del newobj.thisown
e811c8ce 4038 def GetMenuId(*args, **kwargs):
a95a7133 4039 """GetMenuId(self) -> int"""
54f9ee45 4040 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
4041
4042 def IsPopup(*args, **kwargs):
a95a7133 4043 """IsPopup(self) -> bool"""
54f9ee45 4044 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
4045
4046 def GetMenu(*args, **kwargs):
a95a7133 4047 """GetMenu(self) -> Menu"""
54f9ee45 4048 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 4049
d14a1e28
RD
4050
4051class MenuEventPtr(MenuEvent):
4052 def __init__(self, this):
4053 self.this = this
4054 if not hasattr(self,"thisown"): self.thisown = 0
4055 self.__class__ = MenuEvent
54f9ee45 4056_core_.MenuEvent_swigregister(MenuEventPtr)
d14a1e28
RD
4057
4058#---------------------------------------------------------------------------
4059
4060class CloseEvent(Event):
e811c8ce
RD
4061 def __repr__(self):
4062 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4063 def __init__(self, *args, **kwargs):
a95a7133 4064 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
54f9ee45 4065 newobj = _core_.new_CloseEvent(*args, **kwargs)
d14a1e28
RD
4066 self.this = newobj.this
4067 self.thisown = 1
4068 del newobj.thisown
e811c8ce 4069 def SetLoggingOff(*args, **kwargs):
a95a7133 4070 """SetLoggingOff(self, bool logOff)"""
54f9ee45 4071 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
4072
4073 def GetLoggingOff(*args, **kwargs):
a95a7133 4074 """GetLoggingOff(self) -> bool"""
54f9ee45 4075 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
4076
4077 def Veto(*args, **kwargs):
a95a7133 4078 """Veto(self, bool veto=True)"""
54f9ee45 4079 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce
RD
4080
4081 def SetCanVeto(*args, **kwargs):
a95a7133 4082 """SetCanVeto(self, bool canVeto)"""
54f9ee45 4083 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
4084
4085 def CanVeto(*args, **kwargs):
a95a7133 4086 """CanVeto(self) -> bool"""
54f9ee45 4087 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce
RD
4088
4089 def GetVeto(*args, **kwargs):
a95a7133 4090 """GetVeto(self) -> bool"""
54f9ee45 4091 return _core_.CloseEvent_GetVeto(*args, **kwargs)
e811c8ce 4092
d14a1e28
RD
4093
4094class CloseEventPtr(CloseEvent):
4095 def __init__(self, this):
4096 self.this = this
4097 if not hasattr(self,"thisown"): self.thisown = 0
4098 self.__class__ = CloseEvent
54f9ee45 4099_core_.CloseEvent_swigregister(CloseEventPtr)
d14a1e28
RD
4100
4101#---------------------------------------------------------------------------
4102
4103class ShowEvent(Event):
e811c8ce
RD
4104 def __repr__(self):
4105 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4106 def __init__(self, *args, **kwargs):
a95a7133 4107 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
54f9ee45 4108 newobj = _core_.new_ShowEvent(*args, **kwargs)
d14a1e28
RD
4109 self.this = newobj.this
4110 self.thisown = 1
4111 del newobj.thisown
e811c8ce 4112 def SetShow(*args, **kwargs):
a95a7133 4113 """SetShow(self, bool show)"""
54f9ee45 4114 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
4115
4116 def GetShow(*args, **kwargs):
a95a7133 4117 """GetShow(self) -> bool"""
54f9ee45 4118 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 4119
d14a1e28
RD
4120
4121class ShowEventPtr(ShowEvent):
4122 def __init__(self, this):
4123 self.this = this
4124 if not hasattr(self,"thisown"): self.thisown = 0
4125 self.__class__ = ShowEvent
54f9ee45 4126_core_.ShowEvent_swigregister(ShowEventPtr)
d14a1e28
RD
4127
4128#---------------------------------------------------------------------------
4129
4130class IconizeEvent(Event):
e811c8ce
RD
4131 def __repr__(self):
4132 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4133 def __init__(self, *args, **kwargs):
a95a7133 4134 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
54f9ee45 4135 newobj = _core_.new_IconizeEvent(*args, **kwargs)
d14a1e28
RD
4136 self.this = newobj.this
4137 self.thisown = 1
4138 del newobj.thisown
e811c8ce 4139 def Iconized(*args, **kwargs):
a95a7133 4140 """Iconized(self) -> bool"""
54f9ee45 4141 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 4142
d14a1e28
RD
4143
4144class IconizeEventPtr(IconizeEvent):
4145 def __init__(self, this):
4146 self.this = this
4147 if not hasattr(self,"thisown"): self.thisown = 0
4148 self.__class__ = IconizeEvent
54f9ee45 4149_core_.IconizeEvent_swigregister(IconizeEventPtr)
d14a1e28
RD
4150
4151#---------------------------------------------------------------------------
4152
4153class MaximizeEvent(Event):
e811c8ce
RD
4154 def __repr__(self):
4155 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4156 def __init__(self, *args, **kwargs):
a95a7133 4157 """__init__(self, int id=0) -> MaximizeEvent"""
54f9ee45 4158 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
d14a1e28
RD
4159 self.this = newobj.this
4160 self.thisown = 1
4161 del newobj.thisown
d14a1e28
RD
4162
4163class MaximizeEventPtr(MaximizeEvent):
4164 def __init__(self, this):
4165 self.this = this
4166 if not hasattr(self,"thisown"): self.thisown = 0
4167 self.__class__ = MaximizeEvent
54f9ee45 4168_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
d14a1e28
RD
4169
4170#---------------------------------------------------------------------------
4171
4172class DropFilesEvent(Event):
d14a1e28
RD
4173 def __init__(self): raise RuntimeError, "No constructor defined"
4174 def __repr__(self):
4175 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 4176 def GetPosition(*args, **kwargs):
a95a7133 4177 """GetPosition(self) -> Point"""
54f9ee45 4178 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4179
4180 def GetNumberOfFiles(*args, **kwargs):
a95a7133 4181 """GetNumberOfFiles(self) -> int"""
54f9ee45 4182 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
4183
4184 def GetFiles(*args, **kwargs):
a95a7133 4185 """GetFiles(self) -> PyObject"""
54f9ee45 4186 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 4187
d14a1e28
RD
4188
4189class DropFilesEventPtr(DropFilesEvent):
4190 def __init__(self, this):
4191 self.this = this
4192 if not hasattr(self,"thisown"): self.thisown = 0
4193 self.__class__ = DropFilesEvent
54f9ee45 4194_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
d14a1e28
RD
4195
4196#---------------------------------------------------------------------------
4197
54f9ee45
RD
4198UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4199UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 4200class UpdateUIEvent(CommandEvent):
e811c8ce
RD
4201 def __repr__(self):
4202 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4203 def __init__(self, *args, **kwargs):
a95a7133 4204 """__init__(self, int commandId=0) -> UpdateUIEvent"""
54f9ee45 4205 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
d14a1e28
RD
4206 self.this = newobj.this
4207 self.thisown = 1
4208 del newobj.thisown
e811c8ce 4209 def GetChecked(*args, **kwargs):
a95a7133 4210 """GetChecked(self) -> bool"""
54f9ee45 4211 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
4212
4213 def GetEnabled(*args, **kwargs):
a95a7133 4214 """GetEnabled(self) -> bool"""
54f9ee45 4215 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce
RD
4216
4217 def GetText(*args, **kwargs):
a95a7133 4218 """GetText(self) -> String"""
54f9ee45 4219 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
4220
4221 def GetSetText(*args, **kwargs):
a95a7133 4222 """GetSetText(self) -> bool"""
54f9ee45 4223 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
4224
4225 def GetSetChecked(*args, **kwargs):
a95a7133 4226 """GetSetChecked(self) -> bool"""
54f9ee45 4227 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
4228
4229 def GetSetEnabled(*args, **kwargs):
a95a7133 4230 """GetSetEnabled(self) -> bool"""
54f9ee45 4231 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce
RD
4232
4233 def Check(*args, **kwargs):
a95a7133 4234 """Check(self, bool check)"""
54f9ee45 4235 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
4236
4237 def Enable(*args, **kwargs):
a95a7133 4238 """Enable(self, bool enable)"""
54f9ee45 4239 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce
RD
4240
4241 def SetText(*args, **kwargs):
a95a7133 4242 """SetText(self, String text)"""
54f9ee45 4243 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
4244
4245 def SetUpdateInterval(*args, **kwargs):
66c033b4 4246 """SetUpdateInterval(long updateInterval)"""
54f9ee45 4247 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
4248
4249 SetUpdateInterval = staticmethod(SetUpdateInterval)
4250 def GetUpdateInterval(*args, **kwargs):
66c033b4 4251 """GetUpdateInterval() -> long"""
54f9ee45 4252 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
4253
4254 GetUpdateInterval = staticmethod(GetUpdateInterval)
4255 def CanUpdate(*args, **kwargs):
66c033b4 4256 """CanUpdate(Window win) -> bool"""
54f9ee45 4257 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
4258
4259 CanUpdate = staticmethod(CanUpdate)
4260 def ResetUpdateTime(*args, **kwargs):
66c033b4 4261 """ResetUpdateTime()"""
54f9ee45 4262 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
4263
4264 ResetUpdateTime = staticmethod(ResetUpdateTime)
4265 def SetMode(*args, **kwargs):
66c033b4 4266 """SetMode(int mode)"""
54f9ee45 4267 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
4268
4269 SetMode = staticmethod(SetMode)
4270 def GetMode(*args, **kwargs):
66c033b4 4271 """GetMode() -> int"""
54f9ee45 4272 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
4273
4274 GetMode = staticmethod(GetMode)
d14a1e28
RD
4275
4276class UpdateUIEventPtr(UpdateUIEvent):
4277 def __init__(self, this):
4278 self.this = this
4279 if not hasattr(self,"thisown"): self.thisown = 0
4280 self.__class__ = UpdateUIEvent
54f9ee45 4281_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
d14a1e28 4282
e811c8ce
RD
4283def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4284 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
54f9ee45 4285 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 4286
e811c8ce
RD
4287def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4288 """UpdateUIEvent_GetUpdateInterval() -> long"""
54f9ee45 4289 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d14a1e28 4290
e811c8ce
RD
4291def UpdateUIEvent_CanUpdate(*args, **kwargs):
4292 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
54f9ee45 4293 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 4294
e811c8ce
RD
4295def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4296 """UpdateUIEvent_ResetUpdateTime()"""
54f9ee45 4297 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d14a1e28 4298
e811c8ce 4299def UpdateUIEvent_SetMode(*args, **kwargs):
196addbf 4300 """UpdateUIEvent_SetMode(int mode)"""
54f9ee45 4301 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 4302
e811c8ce 4303def UpdateUIEvent_GetMode(*args, **kwargs):
196addbf 4304 """UpdateUIEvent_GetMode() -> int"""
54f9ee45 4305 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d14a1e28
RD
4306
4307#---------------------------------------------------------------------------
4308
4309class SysColourChangedEvent(Event):
e811c8ce
RD
4310 def __repr__(self):
4311 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4312 def __init__(self, *args, **kwargs):
a95a7133 4313 """__init__(self) -> SysColourChangedEvent"""
54f9ee45 4314 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
d14a1e28
RD
4315 self.this = newobj.this
4316 self.thisown = 1
4317 del newobj.thisown
d14a1e28
RD
4318
4319class SysColourChangedEventPtr(SysColourChangedEvent):
4320 def __init__(self, this):
4321 self.this = this
4322 if not hasattr(self,"thisown"): self.thisown = 0
4323 self.__class__ = SysColourChangedEvent
54f9ee45 4324_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
d14a1e28
RD
4325
4326#---------------------------------------------------------------------------
4327
4328class MouseCaptureChangedEvent(Event):
e811c8ce
RD
4329 def __repr__(self):
4330 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4331 def __init__(self, *args, **kwargs):
a95a7133 4332 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
54f9ee45 4333 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
d14a1e28
RD
4334 self.this = newobj.this
4335 self.thisown = 1
4336 del newobj.thisown
e811c8ce 4337 def GetCapturedWindow(*args, **kwargs):
a95a7133 4338 """GetCapturedWindow(self) -> Window"""
54f9ee45 4339 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 4340
d14a1e28
RD
4341
4342class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
4343 def __init__(self, this):
4344 self.this = this
4345 if not hasattr(self,"thisown"): self.thisown = 0
4346 self.__class__ = MouseCaptureChangedEvent
54f9ee45 4347_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
d14a1e28
RD
4348
4349#---------------------------------------------------------------------------
4350
4351class DisplayChangedEvent(Event):
e811c8ce
RD
4352 def __repr__(self):
4353 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4354 def __init__(self, *args, **kwargs):
a95a7133 4355 """__init__(self) -> DisplayChangedEvent"""
54f9ee45 4356 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
d14a1e28
RD
4357 self.this = newobj.this
4358 self.thisown = 1
4359 del newobj.thisown
d14a1e28
RD
4360
4361class DisplayChangedEventPtr(DisplayChangedEvent):
4362 def __init__(self, this):
4363 self.this = this
4364 if not hasattr(self,"thisown"): self.thisown = 0
4365 self.__class__ = DisplayChangedEvent
54f9ee45 4366_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
d14a1e28
RD
4367
4368#---------------------------------------------------------------------------
4369
4370class PaletteChangedEvent(Event):
e811c8ce
RD
4371 def __repr__(self):
4372 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4373 def __init__(self, *args, **kwargs):
a95a7133 4374 """__init__(self, int id=0) -> PaletteChangedEvent"""
54f9ee45 4375 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
d14a1e28
RD
4376 self.this = newobj.this
4377 self.thisown = 1
4378 del newobj.thisown
e811c8ce 4379 def SetChangedWindow(*args, **kwargs):
a95a7133 4380 """SetChangedWindow(self, Window win)"""
54f9ee45 4381 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
4382
4383 def GetChangedWindow(*args, **kwargs):
a95a7133 4384 """GetChangedWindow(self) -> Window"""
54f9ee45 4385 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 4386
d14a1e28
RD
4387
4388class PaletteChangedEventPtr(PaletteChangedEvent):
4389 def __init__(self, this):
4390 self.this = this
4391 if not hasattr(self,"thisown"): self.thisown = 0
4392 self.__class__ = PaletteChangedEvent
54f9ee45 4393_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
d14a1e28
RD
4394
4395#---------------------------------------------------------------------------
4396
4397class QueryNewPaletteEvent(Event):
e811c8ce
RD
4398 def __repr__(self):
4399 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4400 def __init__(self, *args, **kwargs):
a95a7133 4401 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
54f9ee45 4402 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
d14a1e28
RD
4403 self.this = newobj.this
4404 self.thisown = 1
4405 del newobj.thisown
e811c8ce 4406 def SetPaletteRealized(*args, **kwargs):
a95a7133 4407 """SetPaletteRealized(self, bool realized)"""
54f9ee45 4408 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
4409
4410 def GetPaletteRealized(*args, **kwargs):
a95a7133 4411 """GetPaletteRealized(self) -> bool"""
54f9ee45 4412 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 4413
d14a1e28
RD
4414
4415class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
4416 def __init__(self, this):
4417 self.this = this
4418 if not hasattr(self,"thisown"): self.thisown = 0
4419 self.__class__ = QueryNewPaletteEvent
54f9ee45 4420_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
d14a1e28
RD
4421
4422#---------------------------------------------------------------------------
4423
4424class NavigationKeyEvent(Event):
e811c8ce
RD
4425 def __repr__(self):
4426 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4427 def __init__(self, *args, **kwargs):
a95a7133 4428 """__init__(self) -> NavigationKeyEvent"""
54f9ee45 4429 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
d14a1e28
RD
4430 self.this = newobj.this
4431 self.thisown = 1
4432 del newobj.thisown
e811c8ce 4433 def GetDirection(*args, **kwargs):
a95a7133 4434 """GetDirection(self) -> bool"""
54f9ee45 4435 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
4436
4437 def SetDirection(*args, **kwargs):
908b74cd 4438 """SetDirection(self, bool forward)"""
54f9ee45 4439 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
4440
4441 def IsWindowChange(*args, **kwargs):
a95a7133 4442 """IsWindowChange(self) -> bool"""
54f9ee45 4443 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
4444
4445 def SetWindowChange(*args, **kwargs):
908b74cd 4446 """SetWindowChange(self, bool ischange)"""
54f9ee45 4447 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 4448
908b74cd
RD
4449 def SetFlags(*args, **kwargs):
4450 """SetFlags(self, long flags)"""
4451 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
4452
e811c8ce 4453 def GetCurrentFocus(*args, **kwargs):
a95a7133 4454 """GetCurrentFocus(self) -> Window"""
54f9ee45 4455 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
4456
4457 def SetCurrentFocus(*args, **kwargs):
a95a7133 4458 """SetCurrentFocus(self, Window win)"""
54f9ee45 4459 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 4460
b0f7404b 4461 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
4462 IsForward = _core_.NavigationKeyEvent_IsForward
4463 WinChange = _core_.NavigationKeyEvent_WinChange
d14a1e28
RD
4464
4465class NavigationKeyEventPtr(NavigationKeyEvent):
4466 def __init__(self, this):
4467 self.this = this
4468 if not hasattr(self,"thisown"): self.thisown = 0
4469 self.__class__ = NavigationKeyEvent
54f9ee45 4470_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
d14a1e28
RD
4471
4472#---------------------------------------------------------------------------
4473
4474class WindowCreateEvent(CommandEvent):
e811c8ce
RD
4475 def __repr__(self):
4476 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4477 def __init__(self, *args, **kwargs):
a95a7133 4478 """__init__(self, Window win=None) -> WindowCreateEvent"""
54f9ee45 4479 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
d14a1e28
RD
4480 self.this = newobj.this
4481 self.thisown = 1
4482 del newobj.thisown
e811c8ce 4483 def GetWindow(*args, **kwargs):
a95a7133 4484 """GetWindow(self) -> Window"""
54f9ee45 4485 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 4486
d14a1e28
RD
4487
4488class WindowCreateEventPtr(WindowCreateEvent):
4489 def __init__(self, this):
4490 self.this = this
4491 if not hasattr(self,"thisown"): self.thisown = 0
4492 self.__class__ = WindowCreateEvent
54f9ee45 4493_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
d14a1e28
RD
4494
4495class WindowDestroyEvent(CommandEvent):
e811c8ce
RD
4496 def __repr__(self):
4497 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4498 def __init__(self, *args, **kwargs):
a95a7133 4499 """__init__(self, Window win=None) -> WindowDestroyEvent"""
54f9ee45 4500 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
d14a1e28
RD
4501 self.this = newobj.this
4502 self.thisown = 1
4503 del newobj.thisown
e811c8ce 4504 def GetWindow(*args, **kwargs):
a95a7133 4505 """GetWindow(self) -> Window"""
54f9ee45 4506 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 4507
d14a1e28
RD
4508
4509class WindowDestroyEventPtr(WindowDestroyEvent):
4510 def __init__(self, this):
4511 self.this = this
4512 if not hasattr(self,"thisown"): self.thisown = 0
4513 self.__class__ = WindowDestroyEvent
54f9ee45 4514_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
d14a1e28
RD
4515
4516#---------------------------------------------------------------------------
4517
4518class ContextMenuEvent(CommandEvent):
e811c8ce
RD
4519 def __repr__(self):
4520 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4521 def __init__(self, *args, **kwargs):
a95a7133 4522 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
54f9ee45 4523 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
d14a1e28
RD
4524 self.this = newobj.this
4525 self.thisown = 1
4526 del newobj.thisown
e811c8ce 4527 def GetPosition(*args, **kwargs):
a95a7133 4528 """GetPosition(self) -> Point"""
54f9ee45 4529 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4530
4531 def SetPosition(*args, **kwargs):
a95a7133 4532 """SetPosition(self, Point pos)"""
54f9ee45 4533 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 4534
d14a1e28
RD
4535
4536class ContextMenuEventPtr(ContextMenuEvent):
4537 def __init__(self, this):
4538 self.this = this
4539 if not hasattr(self,"thisown"): self.thisown = 0
4540 self.__class__ = ContextMenuEvent
54f9ee45 4541_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
d14a1e28
RD
4542
4543#---------------------------------------------------------------------------
4544
54f9ee45
RD
4545IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4546IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 4547class IdleEvent(Event):
e811c8ce
RD
4548 def __repr__(self):
4549 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4550 def __init__(self, *args, **kwargs):
a95a7133 4551 """__init__(self) -> IdleEvent"""
54f9ee45 4552 newobj = _core_.new_IdleEvent(*args, **kwargs)
d14a1e28
RD
4553 self.this = newobj.this
4554 self.thisown = 1
4555 del newobj.thisown
e811c8ce 4556 def RequestMore(*args, **kwargs):
a95a7133 4557 """RequestMore(self, bool needMore=True)"""
54f9ee45 4558 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
4559
4560 def MoreRequested(*args, **kwargs):
a95a7133 4561 """MoreRequested(self) -> bool"""
54f9ee45 4562 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
4563
4564 def SetMode(*args, **kwargs):
66c033b4 4565 """SetMode(int mode)"""
54f9ee45 4566 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
4567
4568 SetMode = staticmethod(SetMode)
4569 def GetMode(*args, **kwargs):
66c033b4 4570 """GetMode() -> int"""
54f9ee45 4571 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
4572
4573 GetMode = staticmethod(GetMode)
4574 def CanSend(*args, **kwargs):
66c033b4 4575 """CanSend(Window win) -> bool"""
54f9ee45 4576 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
4577
4578 CanSend = staticmethod(CanSend)
d14a1e28
RD
4579
4580class IdleEventPtr(IdleEvent):
4581 def __init__(self, this):
4582 self.this = this
4583 if not hasattr(self,"thisown"): self.thisown = 0
4584 self.__class__ = IdleEvent
54f9ee45 4585_core_.IdleEvent_swigregister(IdleEventPtr)
d14a1e28 4586
e811c8ce 4587def IdleEvent_SetMode(*args, **kwargs):
196addbf 4588 """IdleEvent_SetMode(int mode)"""
54f9ee45 4589 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 4590
e811c8ce 4591def IdleEvent_GetMode(*args, **kwargs):
196addbf 4592 """IdleEvent_GetMode() -> int"""
54f9ee45 4593 return _core_.IdleEvent_GetMode(*args, **kwargs)
d14a1e28 4594
e811c8ce
RD
4595def IdleEvent_CanSend(*args, **kwargs):
4596 """IdleEvent_CanSend(Window win) -> bool"""
54f9ee45 4597 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
4598
4599#---------------------------------------------------------------------------
4600
4601class PyEvent(Event):
e811c8ce
RD
4602 def __repr__(self):
4603 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4604 def __init__(self, *args, **kwargs):
a95a7133 4605 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
54f9ee45 4606 newobj = _core_.new_PyEvent(*args, **kwargs)
d14a1e28
RD
4607 self.this = newobj.this
4608 self.thisown = 1
4609 del newobj.thisown
4610 self.SetSelf(self)
e811c8ce 4611
54f9ee45 4612 def __del__(self, destroy=_core_.delete_PyEvent):
a95a7133 4613 """__del__(self)"""
d14a1e28
RD
4614 try:
4615 if self.thisown: destroy(self)
4616 except: pass
e811c8ce
RD
4617
4618 def SetSelf(*args, **kwargs):
a95a7133 4619 """SetSelf(self, PyObject self)"""
54f9ee45 4620 return _core_.PyEvent_SetSelf(*args, **kwargs)
e811c8ce
RD
4621
4622 def GetSelf(*args, **kwargs):
a95a7133 4623 """GetSelf(self) -> PyObject"""
54f9ee45 4624 return _core_.PyEvent_GetSelf(*args, **kwargs)
e811c8ce 4625
d14a1e28
RD
4626
4627class PyEventPtr(PyEvent):
4628 def __init__(self, this):
4629 self.this = this
4630 if not hasattr(self,"thisown"): self.thisown = 0
4631 self.__class__ = PyEvent
54f9ee45 4632_core_.PyEvent_swigregister(PyEventPtr)
d14a1e28
RD
4633
4634class PyCommandEvent(CommandEvent):
e811c8ce
RD
4635 def __repr__(self):
4636 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4637 def __init__(self, *args, **kwargs):
a95a7133 4638 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
54f9ee45 4639 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
d14a1e28
RD
4640 self.this = newobj.this
4641 self.thisown = 1
4642 del newobj.thisown
4643 self.SetSelf(self)
e811c8ce 4644
54f9ee45 4645 def __del__(self, destroy=_core_.delete_PyCommandEvent):
a95a7133 4646 """__del__(self)"""
d14a1e28
RD
4647 try:
4648 if self.thisown: destroy(self)
4649 except: pass
e811c8ce
RD
4650
4651 def SetSelf(*args, **kwargs):
a95a7133 4652 """SetSelf(self, PyObject self)"""
54f9ee45 4653 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
e811c8ce
RD
4654
4655 def GetSelf(*args, **kwargs):
a95a7133 4656 """GetSelf(self) -> PyObject"""
54f9ee45 4657 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
e811c8ce 4658
d14a1e28
RD
4659
4660class PyCommandEventPtr(PyCommandEvent):
4661 def __init__(self, this):
4662 self.this = this
4663 if not hasattr(self,"thisown"): self.thisown = 0
4664 self.__class__ = PyCommandEvent
54f9ee45 4665_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
d14a1e28
RD
4666
4667#---------------------------------------------------------------------------
4668
54f9ee45
RD
4669PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4670PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4671PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4672PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4673PRINT_WINDOWS = _core_.PRINT_WINDOWS
4674PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 4675class PyApp(EvtHandler):
66c033b4
RD
4676 """
4677 The ``wx.PyApp`` class is an *implementation detail*, please use the
4678 `wx.App` class (or some other derived class) instead.
4679 """
e811c8ce
RD
4680 def __repr__(self):
4681 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4682 def __init__(self, *args, **kwargs):
98e665d3 4683 """
a95a7133 4684 __init__(self) -> PyApp
98e665d3
RD
4685
4686 Create a new application object, starting the bootstrap process.
4687 """
54f9ee45 4688 newobj = _core_.new_PyApp(*args, **kwargs)
d14a1e28
RD
4689 self.this = newobj.this
4690 self.thisown = 1
4691 del newobj.thisown
4692 self._setCallbackInfo(self, PyApp)
4693 self._setOORInfo(self)
e811c8ce 4694
54f9ee45 4695 def __del__(self, destroy=_core_.delete_PyApp):
a95a7133 4696 """__del__(self)"""
d14a1e28
RD
4697 try:
4698 if self.thisown: destroy(self)
4699 except: pass
e811c8ce
RD
4700
4701 def _setCallbackInfo(*args, **kwargs):
a95a7133 4702 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 4703 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
4704
4705 def GetAppName(*args, **kwargs):
0df68c9f 4706 """
a95a7133 4707 GetAppName(self) -> String
6c3b4aae 4708
0df68c9f
RD
4709 Get the application name.
4710 """
54f9ee45 4711 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
4712
4713 def SetAppName(*args, **kwargs):
0df68c9f 4714 """
a95a7133 4715 SetAppName(self, String name)
6c3b4aae 4716
66c033b4
RD
4717 Set the application name. This value may be used automatically by
4718 `wx.Config` and such.
0df68c9f 4719 """
54f9ee45 4720 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
4721
4722 def GetClassName(*args, **kwargs):
0df68c9f 4723 """
a95a7133 4724 GetClassName(self) -> String
e811c8ce 4725
0df68c9f
RD
4726 Get the application's class name.
4727 """
54f9ee45 4728 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
4729
4730 def SetClassName(*args, **kwargs):
0df68c9f 4731 """
a95a7133 4732 SetClassName(self, String name)
6c3b4aae 4733
66c033b4
RD
4734 Set the application's class name. This value may be used for
4735 X-resources if applicable for the platform
0df68c9f 4736 """
54f9ee45 4737 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
4738
4739 def GetVendorName(*args, **kwargs):
0df68c9f 4740 """
a95a7133 4741 GetVendorName(self) -> String
6c3b4aae 4742
0df68c9f
RD
4743 Get the application's vendor name.
4744 """
54f9ee45 4745 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
4746
4747 def SetVendorName(*args, **kwargs):
0df68c9f 4748 """
a95a7133 4749 SetVendorName(self, String name)
6c3b4aae 4750
66c033b4
RD
4751 Set the application's vendor name. This value may be used
4752 automatically by `wx.Config` and such.
0df68c9f 4753 """
54f9ee45 4754 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
4755
4756 def GetTraits(*args, **kwargs):
0df68c9f 4757 """
a95a7133 4758 GetTraits(self) -> wxAppTraits
6c3b4aae 4759
66c033b4
RD
4760 Return (and create if necessary) the app traits object to which we
4761 delegate for everything which either should be configurable by the
4762 user (then he can change the default behaviour simply by overriding
4763 CreateTraits() and returning his own traits object) or which is
4764 GUI/console dependent as then wx.AppTraits allows us to abstract the
4765 differences behind the common facade.
4766
4767 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 4768 """
54f9ee45 4769 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
4770
4771 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 4772 """
a95a7133 4773 ProcessPendingEvents(self)
6c3b4aae 4774
66c033b4
RD
4775 Process all events in the Pending Events list -- it is necessary to
4776 call this function to process posted events. This normally happens
4777 during each event loop iteration.
0df68c9f 4778 """
54f9ee45 4779 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
4780
4781 def Yield(*args, **kwargs):
0df68c9f 4782 """
a95a7133 4783 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 4784
66c033b4
RD
4785 Process all currently pending events right now, instead of waiting
4786 until return to the event loop. It is an error to call ``Yield``
4787 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 4788
66c033b4 4789 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
4790 reentrancies (i.e. when called from an event handler it may
4791 result in calling the same event handler again), use with
4792 extreme care or, better, don't use at all!
0df68c9f 4793
66c033b4 4794 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 4795
0df68c9f 4796 """
54f9ee45 4797 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
4798
4799 def WakeUpIdle(*args, **kwargs):
0df68c9f 4800 """
a95a7133 4801 WakeUpIdle(self)
6c3b4aae 4802
66c033b4
RD
4803 Make sure that idle events are sent again.
4804 :see: `wx.WakeUpIdle`
0df68c9f 4805 """
54f9ee45 4806 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 4807
1fc3b23a
RD
4808 def IsMainLoopRunning(*args, **kwargs):
4809 """
4810 IsMainLoopRunning() -> bool
4811
4812 Returns True if we're running the main loop, i.e. if the events can
4813 currently be dispatched.
4814 """
4815 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
4816
4817 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 4818 def MainLoop(*args, **kwargs):
0df68c9f 4819 """
a95a7133 4820 MainLoop(self) -> int
6c3b4aae 4821
66c033b4
RD
4822 Execute the main GUI loop, the function doesn't normally return until
4823 all top level windows have been closed and destroyed.
0df68c9f 4824 """
54f9ee45 4825 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
4826
4827 def Exit(*args, **kwargs):
0df68c9f 4828 """
a95a7133 4829 Exit(self)
6c3b4aae 4830
0df68c9f 4831 Exit the main loop thus terminating the application.
66c033b4 4832 :see: `wx.Exit`
0df68c9f 4833 """
54f9ee45 4834 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce
RD
4835
4836 def ExitMainLoop(*args, **kwargs):
0df68c9f 4837 """
a95a7133 4838 ExitMainLoop(self)
6c3b4aae 4839
66c033b4
RD
4840 Exit the main GUI loop during the next iteration of the main
4841 loop, (i.e. it does not stop the program immediately!)
0df68c9f 4842 """
54f9ee45 4843 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
4844
4845 def Pending(*args, **kwargs):
0df68c9f 4846 """
a95a7133 4847 Pending(self) -> bool
6c3b4aae 4848
0df68c9f
RD
4849 Returns True if there are unprocessed events in the event queue.
4850 """
54f9ee45 4851 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
4852
4853 def Dispatch(*args, **kwargs):
0df68c9f 4854 """
a95a7133 4855 Dispatch(self) -> bool
6c3b4aae 4856
0df68c9f
RD
4857 Process the first event in the event queue (blocks until an event
4858 appears if there are none currently)
4859 """
54f9ee45 4860 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
4861
4862 def ProcessIdle(*args, **kwargs):
0df68c9f 4863 """
a95a7133 4864 ProcessIdle(self) -> bool
6c3b4aae 4865
66c033b4
RD
4866 Called from the MainLoop when the application becomes idle (there are
4867 no pending events) and sends a `wx.IdleEvent` to all interested
4868 parties. Returns True if more idle events are needed, False if not.
0df68c9f 4869 """
54f9ee45 4870 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
4871
4872 def SendIdleEvents(*args, **kwargs):
0df68c9f 4873 """
a95a7133 4874 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 4875
66c033b4
RD
4876 Send idle event to window and all subwindows. Returns True if more
4877 idle time is requested.
0df68c9f 4878 """
54f9ee45 4879 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
4880
4881 def IsActive(*args, **kwargs):
0df68c9f 4882 """
a95a7133 4883 IsActive(self) -> bool
6c3b4aae 4884
0df68c9f
RD
4885 Return True if our app has focus.
4886 """
54f9ee45 4887 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
4888
4889 def SetTopWindow(*args, **kwargs):
0df68c9f 4890 """
a95a7133 4891 SetTopWindow(self, Window win)
6c3b4aae 4892
66c033b4 4893 Set the *main* top level window
0df68c9f 4894 """
54f9ee45 4895 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
4896
4897 def GetTopWindow(*args, **kwargs):
0df68c9f 4898 """
a95a7133 4899 GetTopWindow(self) -> Window
6c3b4aae 4900
66c033b4
RD
4901 Return the *main* top level window (if it hadn't been set previously
4902 with SetTopWindow(), will return just some top level window and, if
4903 there not any, will return None)
0df68c9f 4904 """
54f9ee45 4905 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
4906
4907 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 4908 """
a95a7133 4909 SetExitOnFrameDelete(self, bool flag)
0df68c9f 4910
66c033b4
RD
4911 Control the exit behaviour: by default, the program will exit the main
4912 loop (and so, usually, terminate) when the last top-level program
4913 window is deleted. Beware that if you disable this behaviour (with
4914 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
4915 explicitly from somewhere.
0df68c9f 4916 """
54f9ee45 4917 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
4918
4919 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 4920 """
a95a7133 4921 GetExitOnFrameDelete(self) -> bool
6c3b4aae 4922
0df68c9f
RD
4923 Get the current exit behaviour setting.
4924 """
54f9ee45 4925 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
4926
4927 def SetUseBestVisual(*args, **kwargs):
0df68c9f 4928 """
a95a7133 4929 SetUseBestVisual(self, bool flag)
6c3b4aae 4930
66c033b4
RD
4931 Set whether the app should try to use the best available visual on
4932 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 4933 """
54f9ee45 4934 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
4935
4936 def GetUseBestVisual(*args, **kwargs):
0df68c9f 4937 """
a95a7133 4938 GetUseBestVisual(self) -> bool
6c3b4aae 4939
0df68c9f
RD
4940 Get current UseBestVisual setting.
4941 """
54f9ee45 4942 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
4943
4944 def SetPrintMode(*args, **kwargs):
a95a7133 4945 """SetPrintMode(self, int mode)"""
54f9ee45 4946 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
4947
4948 def GetPrintMode(*args, **kwargs):
a95a7133 4949 """GetPrintMode(self) -> int"""
54f9ee45 4950 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 4951
e811c8ce 4952 def SetAssertMode(*args, **kwargs):
0df68c9f 4953 """
a95a7133 4954 SetAssertMode(self, int mode)
6c3b4aae 4955
41e2b43e 4956 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 4957 """
54f9ee45 4958 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 4959
6c3b4aae 4960 def GetAssertMode(*args, **kwargs):
0df68c9f 4961 """
a95a7133 4962 GetAssertMode(self) -> int
6c3b4aae 4963
0df68c9f
RD
4964 Get the current OnAssert behaviour setting.
4965 """
54f9ee45 4966 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 4967
e811c8ce 4968 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 4969 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 4970 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
4971
4972 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
4973 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 4974 """GetMacAboutMenuItemId() -> long"""
54f9ee45 4975 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
4976
4977 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
4978 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 4979 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 4980 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
4981
4982 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
4983 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 4984 """GetMacExitMenuItemId() -> long"""
54f9ee45 4985 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
4986
4987 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
4988 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 4989 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 4990 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
4991
4992 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
4993 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 4994 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 4995 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
4996
4997 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
4998 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 4999 """SetMacAboutMenuItemId(long val)"""
54f9ee45 5000 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
5001
5002 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
5003 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 5004 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 5005 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
5006
5007 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
5008 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 5009 """SetMacExitMenuItemId(long val)"""
54f9ee45 5010 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
5011
5012 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
5013 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 5014 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 5015 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
5016
5017 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
5018 def _BootstrapApp(*args, **kwargs):
0df68c9f 5019 """
a95a7133 5020 _BootstrapApp(self)
6c3b4aae 5021
0df68c9f
RD
5022 For internal use only
5023 """
54f9ee45 5024 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
5025
5026 def GetComCtl32Version(*args, **kwargs):
0df68c9f 5027 """
66c033b4 5028 GetComCtl32Version() -> int
6c3b4aae 5029
66c033b4
RD
5030 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5031 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 5032 """
54f9ee45 5033 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
5034
5035 GetComCtl32Version = staticmethod(GetComCtl32Version)
d14a1e28
RD
5036
5037class PyAppPtr(PyApp):
5038 def __init__(self, this):
5039 self.this = this
5040 if not hasattr(self,"thisown"): self.thisown = 0
5041 self.__class__ = PyApp
54f9ee45 5042_core_.PyApp_swigregister(PyAppPtr)
d14a1e28 5043
1fc3b23a
RD
5044def PyApp_IsMainLoopRunning(*args, **kwargs):
5045 """
5046 PyApp_IsMainLoopRunning() -> bool
5047
5048 Returns True if we're running the main loop, i.e. if the events can
5049 currently be dispatched.
5050 """
5051 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5052
e811c8ce
RD
5053def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
5054 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 5055 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 5056
e811c8ce
RD
5057def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
5058 """PyApp_GetMacAboutMenuItemId() -> long"""
54f9ee45 5059 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 5060
e811c8ce
RD
5061def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
5062 """PyApp_GetMacPreferencesMenuItemId() -> long"""
54f9ee45 5063 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 5064
e811c8ce
RD
5065def PyApp_GetMacExitMenuItemId(*args, **kwargs):
5066 """PyApp_GetMacExitMenuItemId() -> long"""
54f9ee45 5067 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d14a1e28 5068
e811c8ce 5069def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
196addbf 5070 """PyApp_GetMacHelpMenuTitleName() -> String"""
54f9ee45 5071 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 5072
e811c8ce
RD
5073def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
5074 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 5075 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 5076
e811c8ce
RD
5077def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
5078 """PyApp_SetMacAboutMenuItemId(long val)"""
54f9ee45 5079 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 5080
e811c8ce
RD
5081def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
5082 """PyApp_SetMacPreferencesMenuItemId(long val)"""
54f9ee45 5083 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 5084
e811c8ce
RD
5085def PyApp_SetMacExitMenuItemId(*args, **kwargs):
5086 """PyApp_SetMacExitMenuItemId(long val)"""
54f9ee45 5087 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 5088
e811c8ce 5089def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
196addbf 5090 """PyApp_SetMacHelpMenuTitleName(String val)"""
54f9ee45 5091 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 5092
e811c8ce 5093def PyApp_GetComCtl32Version(*args, **kwargs):
0df68c9f
RD
5094 """
5095 PyApp_GetComCtl32Version() -> int
6c3b4aae 5096
66c033b4
RD
5097 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5098 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 5099 """
54f9ee45 5100 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d14a1e28
RD
5101
5102#---------------------------------------------------------------------------
5103
5104
e811c8ce 5105def Exit(*args, **kwargs):
0df68c9f
RD
5106 """
5107 Exit()
6c3b4aae 5108
0df68c9f
RD
5109 Force an exit of the application. Convenience for wx.GetApp().Exit()
5110 """
54f9ee45 5111 return _core_.Exit(*args, **kwargs)
d14a1e28 5112
e811c8ce 5113def Yield(*args, **kwargs):
0df68c9f
RD
5114 """
5115 Yield() -> bool
6c3b4aae 5116
0df68c9f
RD
5117 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
5118 """
54f9ee45 5119 return _core_.Yield(*args, **kwargs)
d14a1e28 5120
e811c8ce 5121def YieldIfNeeded(*args, **kwargs):
0df68c9f
RD
5122 """
5123 YieldIfNeeded() -> bool
6c3b4aae 5124
0df68c9f
RD
5125 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
5126 """
54f9ee45 5127 return _core_.YieldIfNeeded(*args, **kwargs)
d14a1e28 5128
e811c8ce 5129def SafeYield(*args, **kwargs):
0df68c9f
RD
5130 """
5131 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 5132
66c033b4
RD
5133 This function is similar to `wx.Yield`, except that it disables the
5134 user input to all program windows before calling `wx.Yield` and
5135 re-enables it again afterwards. If ``win`` is not None, this window
5136 will remain enabled, allowing the implementation of some limited user
5137 interaction.
6c3b4aae 5138
66c033b4 5139 :Returns: the result of the call to `wx.Yield`.
0df68c9f 5140 """
54f9ee45 5141 return _core_.SafeYield(*args, **kwargs)
d14a1e28 5142
e811c8ce 5143def WakeUpIdle(*args, **kwargs):
0df68c9f
RD
5144 """
5145 WakeUpIdle()
6c3b4aae 5146
66c033b4
RD
5147 Cause the message queue to become empty again, so idle events will be
5148 sent.
0df68c9f 5149 """
54f9ee45 5150 return _core_.WakeUpIdle(*args, **kwargs)
d14a1e28 5151
e811c8ce 5152def PostEvent(*args, **kwargs):
0df68c9f
RD
5153 """
5154 PostEvent(EvtHandler dest, Event event)
6c3b4aae 5155
66c033b4
RD
5156 Send an event to a window or other wx.EvtHandler to be processed
5157 later.
0df68c9f 5158 """
54f9ee45 5159 return _core_.PostEvent(*args, **kwargs)
d14a1e28 5160
e811c8ce 5161def App_CleanUp(*args, **kwargs):
0df68c9f
RD
5162 """
5163 App_CleanUp()
6c3b4aae 5164
41e2b43e 5165 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 5166 Python shuts down.
0df68c9f 5167 """
54f9ee45 5168 return _core_.App_CleanUp(*args, **kwargs)
d14a1e28 5169
e811c8ce 5170def GetApp(*args, **kwargs):
0df68c9f
RD
5171 """
5172 GetApp() -> PyApp
6c3b4aae 5173
196addbf 5174 Return a reference to the current wx.App object.
0df68c9f 5175 """
54f9ee45 5176 return _core_.GetApp(*args, **kwargs)
5cbf236d
RD
5177
5178def SetDefaultPyEncoding(*args, **kwargs):
5179 """
5180 SetDefaultPyEncoding(string encoding)
5181
5182 Sets the encoding that wxPython will use when it needs to convert a
5183 Python string or unicode object to or from a wxString.
5184 """
5185 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5186
5187def GetDefaultPyEncoding(*args, **kwargs):
5188 """
5189 GetDefaultPyEncoding() -> string
5190
5191 Gets the current encoding that wxPython will use when it needs to
5192 convert a Python string or unicode object to or from a wxString.
5193 """
5194 return _core_.GetDefaultPyEncoding(*args, **kwargs)
d14a1e28
RD
5195#----------------------------------------------------------------------
5196
5197class PyOnDemandOutputWindow:
6c3b4aae
RD
5198 """
5199 A class that can be used for redirecting Python's stdout and
5200 stderr streams. It will do nothing until something is wrriten to
5201 the stream at which point it will create a Frame with a text area
5202 and write the text there.
5203 """
d14a1e28
RD
5204 def __init__(self, title = "wxPython: stdout/stderr"):
5205 self.frame = None
5206 self.title = title
412d302d
RD
5207 self.pos = wx.DefaultPosition
5208 self.size = (450, 300)
d14a1e28
RD
5209 self.parent = None
5210
5211 def SetParent(self, parent):
6c3b4aae 5212 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
5213 self.parent = parent
5214
6c3b4aae
RD
5215
5216 def CreateOutputWindow(self, st):
412d302d
RD
5217 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
5218 style=wx.DEFAULT_FRAME_STYLE)
196addbf 5219 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 5220 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 5221 self.text.AppendText(st)
6c3b4aae
RD
5222 self.frame.Show(True)
5223 EVT_CLOSE(self.frame, self.OnCloseWindow)
5224
d14a1e28 5225
7409c0c6
RD
5226 def OnCloseWindow(self, event):
5227 if self.frame is not None:
5228 self.frame.Destroy()
5229 self.frame = None
5230 self.text = None
5231
5232
d14a1e28 5233 # These methods provide the file-like output behaviour.
6c3b4aae
RD
5234 def write(self, text):
5235 """
5236 Create the output window if needed and write the string to it.
5237 If not called in the context of the gui thread then uses
5238 CallAfter to do the work there.
5239 """
5240 if self.frame is None:
5241 if not wx.Thread_IsMain():
5242 wx.CallAfter(self.CreateOutputWindow, text)
5243 else:
5244 self.CreateOutputWindow(text)
5245 else:
5246 if not wx.Thread_IsMain():
5247 wx.CallAfter(self.text.AppendText, text)
5248 else:
5249 self.text.AppendText(text)
5250
d14a1e28
RD
5251
5252 def close(self):
6c3b4aae
RD
5253 if self.frame is not None:
5254 wx.CallAfter(self.frame.Close)
5255
d14a1e28 5256
19272049
RD
5257 def flush(self):
5258 pass
5259
5260
d14a1e28
RD
5261
5262#----------------------------------------------------------------------
d14a1e28
RD
5263
5264_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5265
5266class App(wx.PyApp):
6c3b4aae 5267 """
66c033b4
RD
5268 The ``wx.App`` class represents the application and is used to:
5269
5270 * bootstrap the wxPython system and initialize the underlying
5271 gui toolkit
5272 * set and get application-wide properties
5273 * implement the windowing system main message or event loop,
5274 and to dispatch events to window instances
5275 * etc.
5276
5277 Every application must have a ``wx.App`` instance, and all
5278 creation of UI objects should be delayed until after the
03e37cd5
RD
5279 ``wx.App`` object has been created in order to ensure that the gui
5280 platform and wxWidgets have been fully initialized.
66c033b4
RD
5281
5282 Normally you would derive from this class and implement an
5283 ``OnInit`` method that creates a frame and then calls
5284 ``self.SetTopWindow(frame)``.
5285
03e37cd5 5286 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 5287 directly.
6c3b4aae 5288 """
66c033b4 5289
d14a1e28
RD
5290 outputWindowClass = PyOnDemandOutputWindow
5291
03e37cd5
RD
5292 def __init__(self, redirect=_defRedirect, filename=None,
5293 useBestVisual=False, clearSigInt=True):
66c033b4
RD
5294 """
5295 Construct a ``wx.App`` object.
5296
03e37cd5
RD
5297 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5298 redirected? Defaults to True on Windows and Mac, False
5299 otherwise. If `filename` is None then output will be
5300 redirected to a window that pops up as needed. (You can
5301 control what kind of window is created for the output by
5302 resetting the class variable ``outputWindowClass`` to a
5303 class of your choosing.)
66c033b4 5304
03e37cd5
RD
5305 :param filename: The name of a file to redirect output to, if
5306 redirect is True.
66c033b4
RD
5307
5308 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
5309 available visual provided by the system (only relevant on
5310 systems that have more than one visual.) This parameter
5311 must be used instead of calling `SetUseBestVisual` later
5312 on because it must be set before the underlying GUI
5313 toolkit is initialized.
5314
5315 :param clearSigInt: Should SIGINT be cleared? This allows the
5316 app to terminate upon a Ctrl-C in the console like other
5317 GUI apps will.
66c033b4
RD
5318
5319 :note: You should override OnInit to do applicaition
5320 initialization to ensure that the system, toolkit and
5321 wxWidgets are fully initialized.
5322 """
d14a1e28
RD
5323 wx.PyApp.__init__(self)
5324
5325 if wx.Platform == "__WXMAC__":
5326 try:
5327 import MacOS
5328 if not MacOS.WMAvailable():
5329 print """\
5330This program needs access to the screen. Please run with 'pythonw',
5331not 'python', and only when you are logged in on the main display of
5332your Mac."""
5333 _sys.exit(1)
36cadbf7
RD
5334 except SystemExit:
5335 raise
d14a1e28
RD
5336 except:
5337 pass
5338
5339 # This has to be done before OnInit
5340 self.SetUseBestVisual(useBestVisual)
5341
5342 # Set the default handler for SIGINT. This fixes a problem
5343 # where if Ctrl-C is pressed in the console that started this
5344 # app then it will not appear to do anything, (not even send
5345 # KeyboardInterrupt???) but will later segfault on exit. By
5346 # setting the default handler then the app will exit, as
5347 # expected (depending on platform.)
03e37cd5
RD
5348 if clearSigInt:
5349 try:
5350 import signal
5351 signal.signal(signal.SIGINT, signal.SIG_DFL)
5352 except:
5353 pass
d14a1e28
RD
5354
5355 # Save and redirect the stdio to a window?
5356 self.stdioWin = None
5357 self.saveStdio = (_sys.stdout, _sys.stderr)
5358 if redirect:
5359 self.RedirectStdio(filename)
5360
8fb0e70a
RD
5361 # Use Python's install prefix as the default
5362 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
5363
d14a1e28
RD
5364 # This finishes the initialization of wxWindows and then calls
5365 # the OnInit that should be present in the derived class
5366 self._BootstrapApp()
5367
5368
5369 def __del__(self):
5370 try:
5371 self.RestoreStdio() # Just in case the MainLoop was overridden
5372 except:
5373 pass
5374
5375
5376 def SetTopWindow(self, frame):
1e0c8722 5377 """Set the \"main\" top level window"""
d14a1e28
RD
5378 if self.stdioWin:
5379 self.stdioWin.SetParent(frame)
5380 wx.PyApp.SetTopWindow(self, frame)
5381
5382
5383 def MainLoop(self):
1e0c8722 5384 """Execute the main GUI event loop"""
d14a1e28
RD
5385 wx.PyApp.MainLoop(self)
5386 self.RestoreStdio()
5387
5388
7409c0c6 5389 def RedirectStdio(self, filename=None):
1e0c8722 5390 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
5391 if filename:
5392 _sys.stdout = _sys.stderr = open(filename, 'a')
5393 else:
5394 self.stdioWin = self.outputWindowClass()
5395 _sys.stdout = _sys.stderr = self.stdioWin
5396
5397
5398 def RestoreStdio(self):
5399 _sys.stdout, _sys.stderr = self.saveStdio
5400
5401
412d302d
RD
5402 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
5403 """
5404 Set the title, position and/or size of the output window if
f5b96ee1
RD
5405 the stdio has been redirected. This should be called before
5406 any output would cause the output window to be created.
412d302d
RD
5407 """
5408 if self.stdioWin:
5409 if title is not None:
5410 self.stdioWin.title = title
5411 if pos is not None:
5412 self.stdioWin.pos = pos
5413 if size is not None:
5414 self.stdioWin.size = size
5415
5416
5417
d14a1e28 5418
66c033b4 5419# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
5420App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5421App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5422App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5423App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5424App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5425App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5426App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5427App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5428App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5429App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5430App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
5431
5432#----------------------------------------------------------------------------
5433
5434class PySimpleApp(wx.App):
6c3b4aae
RD
5435 """
5436 A simple application class. You can just create one of these and
5437 then then make your top level windows later, and not have to worry
66c033b4
RD
5438 about OnInit. For example::
5439
5440 app = wx.PySimpleApp()
5441 frame = wx.Frame(None, title='Hello World')
5442 frame.Show()
5443 app.MainLoop()
5444
5445 :see: `wx.App`
5446 """
6c3b4aae 5447
03e37cd5
RD
5448 def __init__(self, redirect=False, filename=None,
5449 useBestVisual=False, clearSigInt=True):
66c033b4
RD
5450 """
5451 :see: `wx.App.__init__`
5452 """
03e37cd5 5453 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 5454
d14a1e28 5455 def OnInit(self):
d14a1e28
RD
5456 return True
5457
5458
66c033b4 5459
6c3b4aae 5460# Is anybody using this one?
d14a1e28
RD
5461class PyWidgetTester(wx.App):
5462 def __init__(self, size = (250, 100)):
5463 self.size = size
5464 wx.App.__init__(self, 0)
5465
5466 def OnInit(self):
196addbf 5467 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
5468 self.SetTopWindow(self.frame)
5469 return True
5470
66c033b4
RD
5471 def SetWidget(self, widgetClass, *args, **kwargs):
5472 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
5473 self.frame.Show(True)
5474
5475#----------------------------------------------------------------------------
5476# DO NOT hold any other references to this object. This is how we
66c033b4 5477# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 5478# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 5479# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
5480
5481class __wxPyCleanup:
5482 def __init__(self):
54f9ee45 5483 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
5484 def __del__(self):
5485 self.cleanup()
5486
5487_sys.__wxPythonCleanup = __wxPyCleanup()
5488
5489## # another possible solution, but it gets called too early...
66c033b4
RD
5490## import atexit
5491## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
5492
5493
5494#----------------------------------------------------------------------------
5495
5496#---------------------------------------------------------------------------
2ef75293
RD
5497
5498class EventLoop(object):
5499 def __repr__(self):
5500 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5501 def __init__(self, *args, **kwargs):
5502 """__init__(self) -> EventLoop"""
5503 newobj = _core_.new_EventLoop(*args, **kwargs)
5504 self.this = newobj.this
5505 self.thisown = 1
5506 del newobj.thisown
5507 def __del__(self, destroy=_core_.delete_EventLoop):
5508 """__del__(self)"""
5509 try:
5510 if self.thisown: destroy(self)
5511 except: pass
5512
5513 def Run(*args, **kwargs):
5514 """Run(self) -> int"""
5515 return _core_.EventLoop_Run(*args, **kwargs)
5516
5517 def Exit(*args, **kwargs):
5518 """Exit(self, int rc=0)"""
5519 return _core_.EventLoop_Exit(*args, **kwargs)
5520
5521 def Pending(*args, **kwargs):
5522 """Pending(self) -> bool"""
5523 return _core_.EventLoop_Pending(*args, **kwargs)
5524
5525 def Dispatch(*args, **kwargs):
5526 """Dispatch(self) -> bool"""
5527 return _core_.EventLoop_Dispatch(*args, **kwargs)
5528
5529 def IsRunning(*args, **kwargs):
5530 """IsRunning(self) -> bool"""
5531 return _core_.EventLoop_IsRunning(*args, **kwargs)
5532
5533 def GetActive(*args, **kwargs):
5534 """GetActive() -> EventLoop"""
5535 return _core_.EventLoop_GetActive(*args, **kwargs)
5536
5537 GetActive = staticmethod(GetActive)
5538 def SetActive(*args, **kwargs):
5539 """SetActive(EventLoop loop)"""
5540 return _core_.EventLoop_SetActive(*args, **kwargs)
5541
5542 SetActive = staticmethod(SetActive)
5543
5544class EventLoopPtr(EventLoop):
5545 def __init__(self, this):
5546 self.this = this
5547 if not hasattr(self,"thisown"): self.thisown = 0
5548 self.__class__ = EventLoop
5549_core_.EventLoop_swigregister(EventLoopPtr)
5550
5551def EventLoop_GetActive(*args, **kwargs):
5552 """EventLoop_GetActive() -> EventLoop"""
5553 return _core_.EventLoop_GetActive(*args, **kwargs)
5554
5555def EventLoop_SetActive(*args, **kwargs):
5556 """EventLoop_SetActive(EventLoop loop)"""
5557 return _core_.EventLoop_SetActive(*args, **kwargs)
5558
5559#---------------------------------------------------------------------------
d14a1e28 5560
1e0c8722 5561class AcceleratorEntry(object):
66c033b4
RD
5562 """
5563 A class used to define items in an `wx.AcceleratorTable`. wxPython
5564 programs can choose to use wx.AcceleratorEntry objects, but using a
5565 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 5566 as well. See `__init__` for of the tuple values.
66c033b4
RD
5567
5568 :see: `wx.AcceleratorTable`
5569 """
1e0c8722
RD
5570 def __repr__(self):
5571 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5572 def __init__(self, *args, **kwargs):
66c033b4
RD
5573 """
5574 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
5575
5576 Construct a wx.AcceleratorEntry.
66c033b4 5577 """
54f9ee45 5578 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
1e0c8722
RD
5579 self.this = newobj.this
5580 self.thisown = 1
5581 del newobj.thisown
54f9ee45 5582 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
a95a7133 5583 """__del__(self)"""
1e0c8722
RD
5584 try:
5585 if self.thisown: destroy(self)
5586 except: pass
5587
5588 def Set(*args, **kwargs):
66c033b4
RD
5589 """
5590 Set(self, int flags, int keyCode, int cmd)
1e0c8722 5591
66c033b4
RD
5592 (Re)set the attributes of a wx.AcceleratorEntry.
5593 :see `__init__`
5594 """
5595 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722
RD
5596
5597 def GetFlags(*args, **kwargs):
66c033b4
RD
5598 """
5599 GetFlags(self) -> int
5600
5601 Get the AcceleratorEntry's flags.
5602 """
54f9ee45 5603 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
5604
5605 def GetKeyCode(*args, **kwargs):
66c033b4
RD
5606 """
5607 GetKeyCode(self) -> int
5608
5609 Get the AcceleratorEntry's keycode.
5610 """
54f9ee45 5611 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
5612
5613 def GetCommand(*args, **kwargs):
66c033b4
RD
5614 """
5615 GetCommand(self) -> int
5616
5617 Get the AcceleratorEntry's command ID.
5618 """
54f9ee45 5619 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722
RD
5620
5621
5622class AcceleratorEntryPtr(AcceleratorEntry):
5623 def __init__(self, this):
5624 self.this = this
5625 if not hasattr(self,"thisown"): self.thisown = 0
5626 self.__class__ = AcceleratorEntry
54f9ee45 5627_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
1e0c8722
RD
5628
5629class AcceleratorTable(Object):
66c033b4
RD
5630 """
5631 An accelerator table allows the application to specify a table of
5632 keyboard shortcuts for menus or other commands. On Windows, menu or
5633 button commands are supported; on GTK, only menu commands are
5634 supported.
66c033b4 5635 """
1e0c8722
RD
5636 def __repr__(self):
5637 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5638 def __init__(self, *args, **kwargs):
0df68c9f
RD
5639 """
5640 __init__(entries) -> AcceleratorTable
1e0c8722 5641
66c033b4
RD
5642 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5643 items or or of 3-tuples (flags, keyCode, cmdID)
5644
5645 :see: `wx.AcceleratorEntry`
0df68c9f 5646 """
54f9ee45 5647 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
1e0c8722
RD
5648 self.this = newobj.this
5649 self.thisown = 1
5650 del newobj.thisown
54f9ee45 5651 def __del__(self, destroy=_core_.delete_AcceleratorTable):
a95a7133 5652 """__del__(self)"""
1e0c8722
RD
5653 try:
5654 if self.thisown: destroy(self)
5655 except: pass
5656
5657 def Ok(*args, **kwargs):
a95a7133 5658 """Ok(self) -> bool"""
54f9ee45 5659 return _core_.AcceleratorTable_Ok(*args, **kwargs)
1e0c8722
RD
5660
5661
5662class AcceleratorTablePtr(AcceleratorTable):
5663 def __init__(self, this):
5664 self.this = this
5665 if not hasattr(self,"thisown"): self.thisown = 0
5666 self.__class__ = AcceleratorTable
54f9ee45 5667_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
1e0c8722
RD
5668
5669
5670def GetAccelFromString(*args, **kwargs):
196addbf 5671 """GetAccelFromString(String label) -> AcceleratorEntry"""
54f9ee45 5672 return _core_.GetAccelFromString(*args, **kwargs)
1e0c8722
RD
5673#---------------------------------------------------------------------------
5674
74a57fcd
RD
5675class VisualAttributes(object):
5676 """struct containing all the visual attributes of a control"""
5677 def __repr__(self):
5678 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5679 def __init__(self, *args, **kwargs):
5680 """
a95a7133 5681 __init__(self) -> VisualAttributes
74a57fcd
RD
5682
5683 struct containing all the visual attributes of a control
5684 """
54f9ee45 5685 newobj = _core_.new_VisualAttributes(*args, **kwargs)
74a57fcd
RD
5686 self.this = newobj.this
5687 self.thisown = 1
5688 del newobj.thisown
54f9ee45 5689 def __del__(self, destroy=_core_.delete_VisualAttributes):
a95a7133 5690 """__del__(self)"""
74a57fcd
RD
5691 try:
5692 if self.thisown: destroy(self)
5693 except: pass
5694
54f9ee45
RD
5695 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
5696 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
5697 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
74a57fcd
RD
5698
5699class VisualAttributesPtr(VisualAttributes):
5700 def __init__(self, this):
5701 self.this = this
5702 if not hasattr(self,"thisown"): self.thisown = 0
5703 self.__class__ = VisualAttributes
54f9ee45 5704_core_.VisualAttributes_swigregister(VisualAttributesPtr)
74a57fcd
RD
5705NullAcceleratorTable = cvar.NullAcceleratorTable
5706PanelNameStr = cvar.PanelNameStr
5707
54f9ee45
RD
5708WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
5709WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
5710WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
5711WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
5712WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 5713class Window(EvtHandler):
15afbcd0
RD
5714 """
5715 wx.Window is the base class for all windows and represents any visible
5716 object on the screen. All controls, top level windows and so on are
5717 wx.Windows. Sizers and device contexts are not however, as they don't
5718 appear on screen themselves.
5719
5720 """
e811c8ce
RD
5721 def __repr__(self):
5722 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5723 def __init__(self, *args, **kwargs):
0df68c9f 5724 """
a95a7133 5725 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 5726 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
5727
5728 Construct and show a generic Window.
0df68c9f 5729 """
54f9ee45 5730 newobj = _core_.new_Window(*args, **kwargs)
d14a1e28
RD
5731 self.this = newobj.this
5732 self.thisown = 1
5733 del newobj.thisown
5734 self._setOORInfo(self)
d14a1e28 5735
e811c8ce 5736 def Create(*args, **kwargs):
0df68c9f 5737 """
a95a7133 5738 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 5739 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
5740
5741 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 5742 """
54f9ee45 5743 return _core_.Window_Create(*args, **kwargs)
d14a1e28 5744
e811c8ce 5745 def Close(*args, **kwargs):
15afbcd0 5746 """
a95a7133 5747 Close(self, bool force=False) -> bool
15afbcd0
RD
5748
5749 This function simply generates a EVT_CLOSE event whose handler usually
5750 tries to close the window. It doesn't close the window itself,
5751 however. If force is False (the default) then the window's close
5752 handler will be allowed to veto the destruction of the window.
15afbcd0 5753 """
54f9ee45 5754 return _core_.Window_Close(*args, **kwargs)
d14a1e28 5755
e811c8ce 5756 def Destroy(*args, **kwargs):
0df68c9f 5757 """
a95a7133 5758 Destroy(self) -> bool
d14a1e28 5759
15afbcd0
RD
5760 Destroys the window safely. Frames and dialogs are not destroyed
5761 immediately when this function is called -- they are added to a list
5762 of windows to be deleted on idle time, when all the window's events
5763 have been processed. This prevents problems with events being sent to
5764 non-existent windows.
5765
5766 Returns True if the window has either been successfully deleted, or it
5767 has been added to the list of windows pending real deletion.
0df68c9f 5768 """
54f9ee45 5769 return _core_.Window_Destroy(*args, **kwargs)
d14a1e28 5770
e811c8ce 5771 def DestroyChildren(*args, **kwargs):
15afbcd0 5772 """
a95a7133 5773 DestroyChildren(self) -> bool
15afbcd0 5774
41e2b43e
RD
5775 Destroys all children of a window. Called automatically by the
5776 destructor.
15afbcd0 5777 """
54f9ee45 5778 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 5779
e811c8ce 5780 def IsBeingDeleted(*args, **kwargs):
15afbcd0 5781 """
a95a7133 5782 IsBeingDeleted(self) -> bool
15afbcd0
RD
5783
5784 Is the window in the process of being deleted?
5785 """
54f9ee45 5786 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 5787
e811c8ce 5788 def SetTitle(*args, **kwargs):
15afbcd0 5789 """
a95a7133 5790 SetTitle(self, String title)
15afbcd0
RD
5791
5792 Sets the window's title. Applicable only to frames and dialogs.
5793 """
54f9ee45 5794 return _core_.Window_SetTitle(*args, **kwargs)
d14a1e28 5795
e811c8ce 5796 def GetTitle(*args, **kwargs):
15afbcd0 5797 """
a95a7133 5798 GetTitle(self) -> String
15afbcd0
RD
5799
5800 Gets the window's title. Applicable only to frames and dialogs.
5801 """
54f9ee45 5802 return _core_.Window_GetTitle(*args, **kwargs)
d14a1e28 5803
e811c8ce 5804 def SetLabel(*args, **kwargs):
15afbcd0 5805 """
a95a7133 5806 SetLabel(self, String label)
15afbcd0
RD
5807
5808 Set the text which the window shows in its label if applicable.
5809 """
54f9ee45 5810 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 5811
e811c8ce 5812 def GetLabel(*args, **kwargs):
15afbcd0 5813 """
a95a7133 5814 GetLabel(self) -> String
15afbcd0 5815
41e2b43e
RD
5816 Generic way of getting a label from any window, for identification
5817 purposes. The interpretation of this function differs from class to
5818 class. For frames and dialogs, the value returned is the title. For
5819 buttons or static text controls, it is the button text. This function
5820 can be useful for meta-programs such as testing tools or special-needs
5821 access programs)which need to identify windows by name.
15afbcd0 5822 """
54f9ee45 5823 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 5824
e811c8ce 5825 def SetName(*args, **kwargs):
15afbcd0 5826 """
a95a7133 5827 SetName(self, String name)
15afbcd0 5828
41e2b43e
RD
5829 Sets the window's name. The window name is used for ressource setting
5830 in X, it is not the same as the window title/label
15afbcd0 5831 """
54f9ee45 5832 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 5833
e811c8ce 5834 def GetName(*args, **kwargs):
15afbcd0 5835 """
a95a7133 5836 GetName(self) -> String
15afbcd0 5837
41e2b43e
RD
5838 Returns the windows name. This name is not guaranteed to be unique;
5839 it is up to the programmer to supply an appropriate name in the window
5840 constructor or via wx.Window.SetName.
15afbcd0 5841 """
54f9ee45 5842 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 5843
4276dc52
RD
5844 def SetWindowVariant(*args, **kwargs):
5845 """
a95a7133 5846 SetWindowVariant(self, int variant)
4276dc52 5847
41e2b43e
RD
5848 Sets the variant of the window/font size to use for this window, if
5849 the platform supports variants, for example, wxMac.
4276dc52 5850 """
54f9ee45 5851 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
5852
5853 def GetWindowVariant(*args, **kwargs):
a95a7133 5854 """GetWindowVariant(self) -> int"""
54f9ee45 5855 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 5856
e811c8ce 5857 def SetId(*args, **kwargs):
15afbcd0 5858 """
a95a7133 5859 SetId(self, int winid)
15afbcd0
RD
5860
5861 Sets the identifier of the window. Each window has an integer
5862 identifier. If the application has not provided one, an identifier
5863 will be generated. Normally, the identifier should be provided on
5864 creation and should not be modified subsequently.
5865 """
54f9ee45 5866 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 5867
e811c8ce 5868 def GetId(*args, **kwargs):
15afbcd0 5869 """
a95a7133 5870 GetId(self) -> int
15afbcd0
RD
5871
5872 Returns the identifier of the window. Each window has an integer
5873 identifier. If the application has not provided one (or the default Id
5874 -1 is used) then an unique identifier with a negative value will be
5875 generated.
5876 """
54f9ee45 5877 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 5878
e811c8ce 5879 def NewControlId(*args, **kwargs):
15afbcd0 5880 """
66c033b4 5881 NewControlId() -> int
15afbcd0
RD
5882
5883 Generate a control id for the controls which were not given one.
5884 """
54f9ee45 5885 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 5886
e811c8ce
RD
5887 NewControlId = staticmethod(NewControlId)
5888 def NextControlId(*args, **kwargs):
15afbcd0 5889 """
66c033b4 5890 NextControlId(int winid) -> int
15afbcd0
RD
5891
5892 Get the id of the control following the one with the given
41e2b43e 5893 autogenerated) id
15afbcd0 5894 """
54f9ee45 5895 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 5896
e811c8ce
RD
5897 NextControlId = staticmethod(NextControlId)
5898 def PrevControlId(*args, **kwargs):
15afbcd0 5899 """
66c033b4 5900 PrevControlId(int winid) -> int
15afbcd0
RD
5901
5902 Get the id of the control preceding the one with the given
41e2b43e 5903 autogenerated) id
15afbcd0 5904 """
54f9ee45 5905 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 5906
e811c8ce
RD
5907 PrevControlId = staticmethod(PrevControlId)
5908 def SetSize(*args, **kwargs):
15afbcd0 5909 """
a95a7133 5910 SetSize(self, Size size)
15afbcd0
RD
5911
5912 Sets the size of the window in pixels.
5913 """
54f9ee45 5914 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 5915
e811c8ce 5916 def SetDimensions(*args, **kwargs):
15afbcd0 5917 """
a95a7133 5918 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
5919
5920 Sets the position and size of the window in pixels. The sizeFlags
5921 parameter indicates the interpretation of the other params if they are
5922 -1. wx.SIZE_AUTO*: a -1 indicates that a class-specific default
5923 shoudl be used. wx.SIZE_USE_EXISTING: existing dimensions should be
5924 used if -1 values are supplied. wxSIZE_ALLOW_MINUS_ONE: allow
5925 dimensions of -1 and less to be interpreted as real dimensions, not
5926 default values.
5927 """
54f9ee45 5928 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 5929
e811c8ce 5930 def SetRect(*args, **kwargs):
15afbcd0 5931 """
a95a7133 5932 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
5933
5934 Sets the position and size of the window in pixels using a wx.Rect.
5935 """
54f9ee45 5936 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 5937
e811c8ce 5938 def SetSizeWH(*args, **kwargs):
15afbcd0 5939 """
a95a7133 5940 SetSizeWH(self, int width, int height)
15afbcd0
RD
5941
5942 Sets the size of the window in pixels.
5943 """
54f9ee45 5944 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 5945
e811c8ce 5946 def Move(*args, **kwargs):
15afbcd0 5947 """
a95a7133 5948 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
5949
5950 Moves the window to the given position.
5951 """
54f9ee45 5952 return _core_.Window_Move(*args, **kwargs)
d14a1e28 5953
e811c8ce
RD
5954 SetPosition = Move
5955 def MoveXY(*args, **kwargs):
15afbcd0 5956 """
a95a7133 5957 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
5958
5959 Moves the window to the given position.
5960 """
54f9ee45 5961 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 5962
f8167d6e
RD
5963 def SetBestFittingSize(*args, **kwargs):
5964 """
5965 SetBestFittingSize(self, Size size=DefaultSize)
5966
5967 A 'Smart' SetSize that will fill in default size components with the
5968 window's *best size* values. Also set's the minsize for use with sizers.
5969 """
5970 return _core_.Window_SetBestFittingSize(*args, **kwargs)
5971
e811c8ce 5972 def Raise(*args, **kwargs):
15afbcd0 5973 """
a95a7133 5974 Raise(self)
15afbcd0
RD
5975
5976 Raises the window to the top of the window hierarchy if it is a
5977 managed window (dialog or frame).
5978 """
54f9ee45 5979 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
5980
5981 def Lower(*args, **kwargs):
15afbcd0 5982 """
a95a7133 5983 Lower(self)
15afbcd0
RD
5984
5985 Lowers the window to the bottom of the window hierarchy if it is a
5986 managed window (dialog or frame).
5987 """
54f9ee45 5988 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
5989
5990 def SetClientSize(*args, **kwargs):
15afbcd0 5991 """
a95a7133 5992 SetClientSize(self, Size size)
15afbcd0
RD
5993
5994 This sets the size of the window client area in pixels. Using this
5995 function to size a window tends to be more device-independent than
5996 wx.Window.SetSize, since the application need not worry about what
5997 dimensions the border or title bar have when trying to fit the window
5998 around panel items, for example.
5999 """
54f9ee45 6000 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
6001
6002 def SetClientSizeWH(*args, **kwargs):
15afbcd0 6003 """
a95a7133 6004 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
6005
6006 This sets the size of the window client area in pixels. Using this
6007 function to size a window tends to be more device-independent than
6008 wx.Window.SetSize, since the application need not worry about what
6009 dimensions the border or title bar have when trying to fit the window
6010 around panel items, for example.
6011 """
54f9ee45 6012 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
6013
6014 def SetClientRect(*args, **kwargs):
15afbcd0 6015 """
a95a7133 6016 SetClientRect(self, Rect rect)
15afbcd0
RD
6017
6018 This sets the size of the window client area in pixels. Using this
6019 function to size a window tends to be more device-independent than
6020 wx.Window.SetSize, since the application need not worry about what
6021 dimensions the border or title bar have when trying to fit the window
6022 around panel items, for example.
6023 """
54f9ee45 6024 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
6025
6026 def GetPosition(*args, **kwargs):
0df68c9f 6027 """
a95a7133 6028 GetPosition(self) -> Point
e811c8ce 6029
0df68c9f
RD
6030 Get the window's position.
6031 """
54f9ee45 6032 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
6033
6034 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
6035 """
6036 GetPositionTuple() -> (x,y)
e811c8ce 6037
0df68c9f
RD
6038 Get the window's position.
6039 """
54f9ee45 6040 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
6041
6042 def GetSize(*args, **kwargs):
0df68c9f 6043 """
a95a7133 6044 GetSize(self) -> Size
e811c8ce 6045
0df68c9f
RD
6046 Get the window size.
6047 """
54f9ee45 6048 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
6049
6050 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
6051 """
6052 GetSizeTuple() -> (width, height)
e811c8ce 6053
0df68c9f
RD
6054 Get the window size.
6055 """
54f9ee45 6056 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
6057
6058 def GetRect(*args, **kwargs):
15afbcd0 6059 """
a95a7133 6060 GetRect(self) -> Rect
15afbcd0
RD
6061
6062 Returns the size and position of the window as a wx.Rect object.
6063 """
54f9ee45 6064 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
6065
6066 def GetClientSize(*args, **kwargs):
0df68c9f 6067 """
a95a7133 6068 GetClientSize(self) -> Size
e811c8ce 6069
15afbcd0
RD
6070 This gets the size of the window's 'client area' in pixels. The client
6071 area is the area which may be drawn on by the programmer, excluding
6072 title bar, border, scrollbars, etc.
0df68c9f 6073 """
54f9ee45 6074 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
6075
6076 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
6077 """
6078 GetClientSizeTuple() -> (width, height)
e811c8ce 6079
15afbcd0
RD
6080 This gets the size of the window's 'client area' in pixels. The client
6081 area is the area which may be drawn on by the programmer, excluding
6082 title bar, border, scrollbars, etc.
0df68c9f 6083 """
54f9ee45 6084 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
6085
6086 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 6087 """
a95a7133 6088 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
6089
6090 Get the origin of the client area of the window relative to the
6091 window's top left corner (the client area may be shifted because of
6092 the borders, scrollbars, other decorations...)
6093 """
54f9ee45 6094 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
6095
6096 def GetClientRect(*args, **kwargs):
15afbcd0 6097 """
a95a7133 6098 GetClientRect(self) -> Rect
15afbcd0 6099
61863841 6100 Get the client area position and size as a `wx.Rect` object.
15afbcd0 6101 """
54f9ee45 6102 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
6103
6104 def GetBestSize(*args, **kwargs):
0df68c9f 6105 """
a95a7133 6106 GetBestSize(self) -> Size
e811c8ce 6107
248ed943 6108 This function returns the best acceptable minimal size for the
41e2b43e
RD
6109 window, if applicable. For example, for a static text control, it will
6110 be the minimal size such that the control label is not truncated. For
6111 windows containing subwindows (suzh aswx.Panel), the size returned by
6112 this function will be the same as the size the window would have had
6113 after calling Fit.
0df68c9f 6114 """
54f9ee45 6115 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
6116
6117 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
6118 """
6119 GetBestSizeTuple() -> (width, height)
e811c8ce 6120
248ed943 6121 This function returns the best acceptable minimal size for the
41e2b43e
RD
6122 window, if applicable. For example, for a static text control, it will
6123 be the minimal size such that the control label is not truncated. For
6124 windows containing subwindows (suzh aswx.Panel), the size returned by
6125 this function will be the same as the size the window would have had
6126 after calling Fit.
0df68c9f 6127 """
54f9ee45 6128 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 6129
dfbb5885
RD
6130 def InvalidateBestSize(*args, **kwargs):
6131 """
6132 InvalidateBestSize(self)
6133
6134 Reset the cached best size value so it will be recalculated the next
6135 time it is needed.
6136 """
6137 return _core_.Window_InvalidateBestSize(*args, **kwargs)
6138
6139 def GetBestFittingSize(*args, **kwargs):
6140 """
6141 GetBestFittingSize(self) -> Size
6142
6143 This function will merge the window's best size into the window's
6144 minimum size, giving priority to the min size components, and returns
6145 the results.
6146
6147 """
6148 return _core_.Window_GetBestFittingSize(*args, **kwargs)
6149
e811c8ce 6150 def GetAdjustedBestSize(*args, **kwargs):
15afbcd0 6151 """
a95a7133 6152 GetAdjustedBestSize(self) -> Size
15afbcd0
RD
6153
6154 This method is similar to GetBestSize, except in one
6155 thing. GetBestSize should return the minimum untruncated size of the
6156 window, while this method will return the largest of BestSize and any
6157 user specified minimum size. ie. it is the minimum size the window
6158 should currently be drawn at, not the minimal size it can possibly
6159 tolerate.
6160 """
54f9ee45 6161 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
e811c8ce
RD
6162
6163 def Center(*args, **kwargs):
15afbcd0 6164 """
a95a7133 6165 Center(self, int direction=BOTH)
15afbcd0
RD
6166
6167 Centers the window. The parameter specifies the direction for
6168 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
6169 also include wx.CENTER_ON_SCREEN flag if you want to center the window
6170 on the entire screen and not on its parent window. If it is a
6171 top-level window and has no parent then it will always be centered
6172 relative to the screen.
6173 """
54f9ee45 6174 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
6175
6176 Centre = Center
6177 def CenterOnScreen(*args, **kwargs):
15afbcd0 6178 """
a95a7133 6179 CenterOnScreen(self, int dir=BOTH)
15afbcd0
RD
6180
6181 Center on screen (only works for top level windows)
6182 """
54f9ee45 6183 return _core_.Window_CenterOnScreen(*args, **kwargs)
e811c8ce
RD
6184
6185 CentreOnScreen = CenterOnScreen
6186 def CenterOnParent(*args, **kwargs):
15afbcd0 6187 """
a95a7133 6188 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
6189
6190 Center with respect to the the parent window
6191 """
54f9ee45 6192 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
6193
6194 CentreOnParent = CenterOnParent
6195 def Fit(*args, **kwargs):
15afbcd0 6196 """
a95a7133 6197 Fit(self)
15afbcd0
RD
6198
6199 Sizes the window so that it fits around its subwindows. This function
6200 won't do anything if there are no subwindows and will only really work
6201 correctly if sizers are used for the subwindows layout. Also, if the
6202 window has exactly one subwindow it is better (faster and the result
6203 is more precise as Fit adds some margin to account for fuzziness of
6204 its calculations) to call window.SetClientSize(child.GetSize())
6205 instead of calling Fit.
6206 """
54f9ee45 6207 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
6208
6209 def FitInside(*args, **kwargs):
15afbcd0 6210 """
a95a7133 6211 FitInside(self)
15afbcd0
RD
6212
6213 Similar to Fit, but sizes the interior (virtual) size of a
6214 window. Mainly useful with scrolled windows to reset scrollbars after
6215 sizing changes that do not trigger a size event, and/or scrolled
6216 windows without an interior sizer. This function similarly won't do
6217 anything if there are no subwindows.
6218 """
54f9ee45 6219 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 6220
f16ab95d 6221 def SetSizeHints(*args, **kwargs):
0df68c9f 6222 """
a95a7133 6223 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 6224 int incH=-1)
15afbcd0
RD
6225
6226 Allows specification of minimum and maximum window sizes, and window
6227 size increments. If a pair of values is not set (or set to -1), the
6228 default values will be used. If this function is called, the user
908b74cd
RD
6229 will not be able to size the window outside the given bounds (if it is
6230 a top-level window.) Sizers will also inspect the minimum window size
6231 and will use that value if set when calculating layout.
6232
6233 The resizing increments are only significant under Motif or Xt.
0df68c9f 6234 """
f16ab95d 6235 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 6236
f16ab95d
RD
6237 def SetSizeHintsSz(*args, **kwargs):
6238 """
6239 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
6240
6241 Allows specification of minimum and maximum window sizes, and window
6242 size increments. If a pair of values is not set (or set to -1), the
6243 default values will be used. If this function is called, the user
6244 will not be able to size the window outside the given bounds (if it is
6245 a top-level window.) Sizers will also inspect the minimum window size
6246 and will use that value if set when calculating layout.
6247
6248 The resizing increments are only significant under Motif or Xt.
6249 """
6250 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
6251
6252 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 6253 """
908b74cd 6254 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
6255
6256 Allows specification of minimum and maximum virtual window sizes. If a
6257 pair of values is not set (or set to -1), the default values will be
6258 used. If this function is called, the user will not be able to size
6259 the virtual area of the window outside the given bounds.
6260 """
f16ab95d
RD
6261 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
6262
6263 def SetVirtualSizeHintsSz(*args, **kwargs):
6264 """
6265 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
6266
6267 Allows specification of minimum and maximum virtual window sizes. If a
6268 pair of values is not set (or set to -1), the default values will be
6269 used. If this function is called, the user will not be able to size
6270 the virtual area of the window outside the given bounds.
6271 """
6272 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 6273
908b74cd
RD
6274 def GetMaxSize(*args, **kwargs):
6275 """GetMaxSize(self) -> Size"""
6276 return _core_.Window_GetMaxSize(*args, **kwargs)
6277
6278 def GetMinSize(*args, **kwargs):
6279 """GetMinSize(self) -> Size"""
6280 return _core_.Window_GetMinSize(*args, **kwargs)
6281
6282 def SetMinSize(*args, **kwargs):
6283 """
6284 SetMinSize(self, Size minSize)
6285
6286 A more convenient method than `SetSizeHints` for setting just the
6287 min size.
6288 """
6289 return _core_.Window_SetMinSize(*args, **kwargs)
6290
6291 def SetMaxSize(*args, **kwargs):
6292 """
6293 SetMaxSize(self, Size maxSize)
6294
6295 A more convenient method than `SetSizeHints` for setting just the
6296 max size.
6297 """
6298 return _core_.Window_SetMaxSize(*args, **kwargs)
6299
e811c8ce 6300 def GetMinWidth(*args, **kwargs):
a95a7133 6301 """GetMinWidth(self) -> int"""
54f9ee45 6302 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
6303
6304 def GetMinHeight(*args, **kwargs):
a95a7133 6305 """GetMinHeight(self) -> int"""
54f9ee45 6306 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
6307
6308 def GetMaxWidth(*args, **kwargs):
a95a7133 6309 """GetMaxWidth(self) -> int"""
54f9ee45 6310 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
6311
6312 def GetMaxHeight(*args, **kwargs):
a95a7133 6313 """GetMaxHeight(self) -> int"""
54f9ee45 6314 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 6315
e811c8ce 6316 def SetVirtualSize(*args, **kwargs):
0df68c9f 6317 """
a95a7133 6318 SetVirtualSize(self, Size size)
e811c8ce 6319
15afbcd0
RD
6320 Set the the virtual size of a window in pixels. For most windows this
6321 is just the client area of the window, but for some like scrolled
6322 windows it is more or less independent of the screen window size.
0df68c9f 6323 """
54f9ee45 6324 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
6325
6326 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 6327 """
a95a7133 6328 SetVirtualSizeWH(self, int w, int h)
e811c8ce 6329
15afbcd0
RD
6330 Set the the virtual size of a window in pixels. For most windows this
6331 is just the client area of the window, but for some like scrolled
6332 windows it is more or less independent of the screen window size.
0df68c9f 6333 """
54f9ee45 6334 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
6335
6336 def GetVirtualSize(*args, **kwargs):
0df68c9f 6337 """
a95a7133 6338 GetVirtualSize(self) -> Size
e811c8ce 6339
15afbcd0
RD
6340 Get the the virtual size of the window in pixels. For most windows
6341 this is just the client area of the window, but for some like scrolled
6342 windows it is more or less independent of the screen window size.
0df68c9f 6343 """
54f9ee45 6344 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
6345
6346 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
6347 """
6348 GetVirtualSizeTuple() -> (width, height)
e811c8ce 6349
15afbcd0
RD
6350 Get the the virtual size of the window in pixels. For most windows
6351 this is just the client area of the window, but for some like scrolled
6352 windows it is more or less independent of the screen window size.
0df68c9f 6353 """
54f9ee45 6354 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce
RD
6355
6356 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 6357 """
a95a7133 6358 GetBestVirtualSize(self) -> Size
15afbcd0
RD
6359
6360 Return the largest of ClientSize and BestSize (as determined by a
6361 sizer, interior children, or other means)
6362 """
54f9ee45 6363 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
6364
6365 def Show(*args, **kwargs):
15afbcd0 6366 """
a95a7133 6367 Show(self, bool show=True) -> bool
15afbcd0
RD
6368
6369 Shows or hides the window. You may need to call Raise for a top level
6370 window if you want to bring it to top, although this is not needed if
6371 Show is called immediately after the frame creation. Returns True if
6372 the window has been shown or hidden or False if nothing was done
6373 because it already was in the requested state.
6374 """
54f9ee45 6375 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
6376
6377 def Hide(*args, **kwargs):
15afbcd0 6378 """
a95a7133 6379 Hide(self) -> bool
15afbcd0
RD
6380
6381 Equivalent to calling Show(False).
6382 """
54f9ee45 6383 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
6384
6385 def Enable(*args, **kwargs):
15afbcd0 6386 """
a95a7133 6387 Enable(self, bool enable=True) -> bool
15afbcd0
RD
6388
6389 Enable or disable the window for user input. Note that when a parent
6390 window is disabled, all of its children are disabled as well and they
6391 are reenabled again when the parent is. Returns true if the window
6392 has been enabled or disabled, false if nothing was done, i.e. if the
6393 window had already been in the specified state.
6394 """
54f9ee45 6395 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
6396
6397 def Disable(*args, **kwargs):
15afbcd0 6398 """
a95a7133 6399 Disable(self) -> bool
15afbcd0
RD
6400
6401 Disables the window, same as Enable(false).
6402 """
54f9ee45 6403 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
6404
6405 def IsShown(*args, **kwargs):
15afbcd0 6406 """
a95a7133 6407 IsShown(self) -> bool
15afbcd0
RD
6408
6409 Returns true if the window is shown, false if it has been hidden.
6410 """
54f9ee45 6411 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
6412
6413 def IsEnabled(*args, **kwargs):
15afbcd0 6414 """
a95a7133 6415 IsEnabled(self) -> bool
15afbcd0
RD
6416
6417 Returns true if the window is enabled for input, false otherwise.
6418 """
54f9ee45 6419 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce
RD
6420
6421 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 6422 """
a95a7133 6423 SetWindowStyleFlag(self, long style)
15afbcd0 6424
41e2b43e
RD
6425 Sets the style of the window. Please note that some styles cannot be
6426 changed after the window creation and that Refresh() might need to be
6427 called after changing the others for the change to take place
6428 immediately.
15afbcd0 6429 """
54f9ee45 6430 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
6431
6432 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 6433 """
a95a7133 6434 GetWindowStyleFlag(self) -> long
e811c8ce 6435
15afbcd0
RD
6436 Gets the window style that was passed to the constructor or Create
6437 method.
6438 """
54f9ee45 6439 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 6440
15afbcd0 6441 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 6442 def HasFlag(*args, **kwargs):
15afbcd0 6443 """
a95a7133 6444 HasFlag(self, int flag) -> bool
15afbcd0
RD
6445
6446 Test if the given style is set for this window.
6447 """
54f9ee45 6448 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
6449
6450 def IsRetained(*args, **kwargs):
15afbcd0 6451 """
a95a7133 6452 IsRetained(self) -> bool
15afbcd0
RD
6453
6454 Returns true if the window is retained, false otherwise. Retained
6455 windows are only available on X platforms.
6456 """
54f9ee45 6457 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce
RD
6458
6459 def SetExtraStyle(*args, **kwargs):
15afbcd0 6460 """
a95a7133 6461 SetExtraStyle(self, long exStyle)
15afbcd0
RD
6462
6463 Sets the extra style bits for the window. Extra styles are the less
6464 often used style bits which can't be set with the constructor or with
6465 SetWindowStyleFlag()
6466 """
54f9ee45 6467 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
6468
6469 def GetExtraStyle(*args, **kwargs):
15afbcd0 6470 """
a95a7133 6471 GetExtraStyle(self) -> long
15afbcd0
RD
6472
6473 Returns the extra style bits for the window.
6474 """
54f9ee45 6475 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
6476
6477 def MakeModal(*args, **kwargs):
15afbcd0 6478 """
a95a7133 6479 MakeModal(self, bool modal=True)
15afbcd0
RD
6480
6481 Disables all other windows in the application so that the user can
6482 only interact with this window. Passing False will reverse this
6483 effect.
6484 """
54f9ee45 6485 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
6486
6487 def SetThemeEnabled(*args, **kwargs):
15afbcd0 6488 """
a95a7133 6489 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
6490
6491 This function tells a window if it should use the system's "theme"
6492 code to draw the windows' background instead if its own background
6493 drawing code. This will only have an effect on platforms that support
6494 the notion of themes in user defined windows. One such platform is
6495 GTK+ where windows can have (very colourful) backgrounds defined by a
6496 user's selected theme.
6497
6498 Dialogs, notebook pages and the status bar have this flag set to true
6499 by default so that the default look and feel is simulated best.
6500 """
54f9ee45 6501 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
6502
6503 def GetThemeEnabled(*args, **kwargs):
15afbcd0 6504 """
a95a7133 6505 GetThemeEnabled(self) -> bool
e811c8ce 6506
15afbcd0
RD
6507 Return the themeEnabled flag.
6508 """
54f9ee45 6509 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
6510
6511 def SetFocus(*args, **kwargs):
15afbcd0 6512 """
a95a7133 6513 SetFocus(self)
15afbcd0
RD
6514
6515 Set's the focus to this window, allowing it to receive keyboard input.
6516 """
54f9ee45 6517 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
6518
6519 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 6520 """
a95a7133 6521 SetFocusFromKbd(self)
15afbcd0
RD
6522
6523 Set focus to this window as the result of a keyboard action. Normally
6524 only called internally.
6525 """
54f9ee45 6526 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
6527
6528 def FindFocus(*args, **kwargs):
15afbcd0 6529 """
66c033b4 6530 FindFocus() -> Window
15afbcd0
RD
6531
6532 Returns the window or control that currently has the keyboard focus,
6533 or None.
6534 """
54f9ee45 6535 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
6536
6537 FindFocus = staticmethod(FindFocus)
6538 def AcceptsFocus(*args, **kwargs):
15afbcd0 6539 """
a95a7133 6540 AcceptsFocus(self) -> bool
15afbcd0
RD
6541
6542 Can this window have focus?
6543 """
54f9ee45 6544 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce
RD
6545
6546 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 6547 """
a95a7133 6548 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
6549
6550 Can this window be given focus by keyboard navigation? if not, the
6551 only way to give it focus (provided it accepts it at all) is to click
6552 it.
6553 """
54f9ee45 6554 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce
RD
6555
6556 def GetDefaultItem(*args, **kwargs):
15afbcd0 6557 """
a95a7133 6558 GetDefaultItem(self) -> Window
15afbcd0
RD
6559
6560 Get the default child of this parent, i.e. the one which is activated
6561 by pressing <Enter> such as the OK button on a wx.Dialog.
6562 """
54f9ee45 6563 return _core_.Window_GetDefaultItem(*args, **kwargs)
e811c8ce
RD
6564
6565 def SetDefaultItem(*args, **kwargs):
15afbcd0 6566 """
a95a7133 6567 SetDefaultItem(self, Window child) -> Window
15afbcd0
RD
6568
6569 Set this child as default, return the old default.
6570 """
54f9ee45 6571 return _core_.Window_SetDefaultItem(*args, **kwargs)
e811c8ce
RD
6572
6573 def SetTmpDefaultItem(*args, **kwargs):
15afbcd0 6574 """
a95a7133 6575 SetTmpDefaultItem(self, Window win)
15afbcd0
RD
6576
6577 Set this child as temporary default
6578 """
54f9ee45 6579 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
e811c8ce 6580
908b74cd
RD
6581 def Navigate(*args, **kwargs):
6582 """
6583 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6584
fd2dc343
RD
6585 Does keyboard navigation from this window to another, by sending a
6586 `wx.NavigationKeyEvent`.
908b74cd
RD
6587 """
6588 return _core_.Window_Navigate(*args, **kwargs)
6589
7f98d120
RD
6590 def MoveAfterInTabOrder(*args, **kwargs):
6591 """
6592 MoveAfterInTabOrder(self, Window win)
6593
6594 Moves this window in the tab navigation order after the specified
6595 sibling window. This means that when the user presses the TAB key on
6596 that other window, the focus switches to this window.
6597
6598 The default tab order is the same as creation order. This function
6599 and `MoveBeforeInTabOrder` allow to change it after creating all the
6600 windows.
6601
6602 """
6603 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
6604
6605 def MoveBeforeInTabOrder(*args, **kwargs):
6606 """
6607 MoveBeforeInTabOrder(self, Window win)
6608
6609 Same as `MoveAfterInTabOrder` except that it inserts this window just
6610 before win instead of putting it right after it.
6611 """
6612 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
6613
e811c8ce 6614 def GetChildren(*args, **kwargs):
15afbcd0 6615 """
a95a7133 6616 GetChildren(self) -> PyObject
15afbcd0
RD
6617
6618 Returns a list of the window's children. NOTE: Currently this is a
6619 copy of the child window list maintained by the window, so the return
6620 value of this function is only valid as long as the window's children
6621 do not change.
6622 """
54f9ee45 6623 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
6624
6625 def GetParent(*args, **kwargs):
15afbcd0 6626 """
a95a7133 6627 GetParent(self) -> Window
15afbcd0
RD
6628
6629 Returns the parent window of this window, or None if there isn't one.
6630 """
54f9ee45 6631 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
6632
6633 def GetGrandParent(*args, **kwargs):
15afbcd0 6634 """
a95a7133 6635 GetGrandParent(self) -> Window
15afbcd0 6636
41e2b43e
RD
6637 Returns the parent of the parent of this window, or None if there
6638 isn't one.
15afbcd0 6639 """
54f9ee45 6640 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce
RD
6641
6642 def IsTopLevel(*args, **kwargs):
15afbcd0 6643 """
a95a7133 6644 IsTopLevel(self) -> bool
15afbcd0
RD
6645
6646 Returns true if the given window is a top-level one. Currently all
6647 frames and dialogs are always considered to be top-level windows (even
6648 if they have a parent window).
6649 """
54f9ee45 6650 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
6651
6652 def Reparent(*args, **kwargs):
15afbcd0 6653 """
a95a7133 6654 Reparent(self, Window newParent) -> bool
15afbcd0
RD
6655
6656 Reparents the window, i.e the window will be removed from its current
6657 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6658 re-inserted into another. Available on Windows and GTK. Returns True
6659 if the parent was changed, False otherwise (error or newParent ==
6660 oldParent)
6661 """
54f9ee45 6662 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
6663
6664 def AddChild(*args, **kwargs):
15afbcd0 6665 """
a95a7133 6666 AddChild(self, Window child)
15afbcd0
RD
6667
6668 Adds a child window. This is called automatically by window creation
6669 functions so should not be required by the application programmer.
6670 """
54f9ee45 6671 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
6672
6673 def RemoveChild(*args, **kwargs):
15afbcd0 6674 """
a95a7133 6675 RemoveChild(self, Window child)
15afbcd0
RD
6676
6677 Removes a child window. This is called automatically by window
6678 deletion functions so should not be required by the application
6679 programmer.
6680 """
54f9ee45 6681 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce
RD
6682
6683 def FindWindowById(*args, **kwargs):
15afbcd0 6684 """
a95a7133 6685 FindWindowById(self, long winid) -> Window
15afbcd0
RD
6686
6687 Find a chld of this window by window ID
6688 """
54f9ee45 6689 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
6690
6691 def FindWindowByName(*args, **kwargs):
15afbcd0 6692 """
a95a7133 6693 FindWindowByName(self, String name) -> Window
15afbcd0
RD
6694
6695 Find a child of this window by name
6696 """
54f9ee45 6697 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
6698
6699 def GetEventHandler(*args, **kwargs):
15afbcd0 6700 """
a95a7133 6701 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
6702
6703 Returns the event handler for this window. By default, the window is
6704 its own event handler.
6705 """
54f9ee45 6706 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
6707
6708 def SetEventHandler(*args, **kwargs):
15afbcd0 6709 """
a95a7133 6710 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
6711
6712 Sets the event handler for this window. An event handler is an object
6713 that is capable of processing the events sent to a window. By default,
6714 the window is its own event handler, but an application may wish to
6715 substitute another, for example to allow central implementation of
6716 event-handling for a variety of different window classes.
6717
41e2b43e 6718 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0
RD
6719 up a chain of event handlers, where an event not handled by one event
6720 handler is handed to the next one in the chain.
6721 """
54f9ee45 6722 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
6723
6724 def PushEventHandler(*args, **kwargs):
15afbcd0 6725 """
a95a7133 6726 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
6727
6728 Pushes this event handler onto the event handler stack for the window.
6729 An event handler is an object that is capable of processing the events
6730 sent to a window. By default, the window is its own event handler, but
6731 an application may wish to substitute another, for example to allow
6732 central implementation of event-handling for a variety of different
6733 window classes.
6734
6735 wx.Window.PushEventHandler allows an application to set up a chain of
6736 event handlers, where an event not handled by one event handler is
41e2b43e 6737 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
15afbcd0
RD
6738 remove the event handler.
6739 """
54f9ee45 6740 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
6741
6742 def PopEventHandler(*args, **kwargs):
15afbcd0 6743 """
a95a7133 6744 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
6745
6746 Removes and returns the top-most event handler on the event handler
6747 stack. If deleteHandler is True then the wx.EvtHandler object will be
6748 destroyed after it is popped.
6749 """
54f9ee45 6750 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
6751
6752 def RemoveEventHandler(*args, **kwargs):
15afbcd0 6753 """
a95a7133 6754 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 6755
41e2b43e
RD
6756 Find the given handler in the event handler chain and remove (but not
6757 delete) it from the event handler chain, return True if it was found
6758 and False otherwise (this also results in an assert failure so this
6759 function should only be called when the handler is supposed to be
6760 there.)
15afbcd0 6761 """
54f9ee45 6762 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
6763
6764 def SetValidator(*args, **kwargs):
15afbcd0 6765 """
a95a7133 6766 SetValidator(self, Validator validator)
15afbcd0
RD
6767
6768 Deletes the current validator (if any) and sets the window validator,
6769 having called wx.Validator.Clone to create a new validator of this
6770 type.
6771 """
54f9ee45 6772 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
6773
6774 def GetValidator(*args, **kwargs):
15afbcd0 6775 """
a95a7133 6776 GetValidator(self) -> Validator
15afbcd0
RD
6777
6778 Returns a pointer to the current validator for the window, or None if
6779 there is none.
6780 """
54f9ee45 6781 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 6782
74a57fcd
RD
6783 def Validate(*args, **kwargs):
6784 """
a95a7133 6785 Validate(self) -> bool
74a57fcd
RD
6786
6787 Validates the current values of the child controls using their
41e2b43e
RD
6788 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6789 style flag set, the method will also call Validate() of all child
6790 windows. Returns false if any of the validations failed.
74a57fcd 6791 """
54f9ee45 6792 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
6793
6794 def TransferDataToWindow(*args, **kwargs):
6795 """
a95a7133 6796 TransferDataToWindow(self) -> bool
74a57fcd 6797
41e2b43e
RD
6798 Transfers values to child controls from data areas specified by their
6799 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6800 style flag set, the method will also call TransferDataToWindow() of
6801 all child windows.
74a57fcd 6802 """
54f9ee45 6803 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
6804
6805 def TransferDataFromWindow(*args, **kwargs):
6806 """
a95a7133 6807 TransferDataFromWindow(self) -> bool
74a57fcd 6808
41e2b43e
RD
6809 Transfers values from child controls to data areas specified by their
6810 validators. Returns false if a transfer failed. If the window has
6811 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
6812 also call TransferDataFromWindow() of all child windows.
74a57fcd 6813 """
54f9ee45 6814 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
6815
6816 def InitDialog(*args, **kwargs):
6817 """
a95a7133 6818 InitDialog(self)
74a57fcd 6819
41e2b43e
RD
6820 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
6821 to the dialog via validators.
74a57fcd 6822 """
54f9ee45 6823 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 6824
e811c8ce 6825 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 6826 """
a95a7133 6827 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
6828
6829 Sets the accelerator table for this window.
6830 """
54f9ee45 6831 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
6832
6833 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 6834 """
a95a7133 6835 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
6836
6837 Gets the accelerator table for this window.
6838 """
54f9ee45 6839 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
6840
6841 def RegisterHotKey(*args, **kwargs):
15afbcd0 6842 """
a95a7133 6843 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
6844
6845 Registers a system wide hotkey. Every time the user presses the hotkey
6846 registered here, this window will receive a hotkey event. It will
6847 receive the event even if the application is in the background and
6848 does not have the input focus because the user is working with some
6849 other application. To bind an event handler function to this hotkey
6850 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
6851 hotkey was registered successfully.
6852 """
54f9ee45 6853 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
6854
6855 def UnregisterHotKey(*args, **kwargs):
15afbcd0 6856 """
a95a7133 6857 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
6858
6859 Unregisters a system wide hotkey.
6860 """
54f9ee45 6861 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
6862
6863 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 6864 """
a95a7133 6865 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
6866
6867 Converts a point or size from dialog units to pixels. Dialog units
6868 are used for maintaining a dialog's proportions even if the font
6869 changes. For the x dimension, the dialog units are multiplied by the
6870 average character width and then divided by 4. For the y dimension,
6871 the dialog units are multiplied by the average character height and
6872 then divided by 8.
6873 """
54f9ee45 6874 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
6875
6876 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 6877 """
a95a7133 6878 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
6879
6880 Converts a point or size from dialog units to pixels. Dialog units
6881 are used for maintaining a dialog's proportions even if the font
6882 changes. For the x dimension, the dialog units are multiplied by the
6883 average character width and then divided by 4. For the y dimension,
6884 the dialog units are multiplied by the average character height and
6885 then divided by 8.
6886 """
54f9ee45 6887 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
6888
6889 def DLG_PNT(*args, **kwargs):
15afbcd0 6890 """
a95a7133 6891 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
6892
6893 Converts a point or size from dialog units to pixels. Dialog units
6894 are used for maintaining a dialog's proportions even if the font
6895 changes. For the x dimension, the dialog units are multiplied by the
6896 average character width and then divided by 4. For the y dimension,
6897 the dialog units are multiplied by the average character height and
6898 then divided by 8.
6899 """
54f9ee45 6900 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
6901
6902 def DLG_SZE(*args, **kwargs):
15afbcd0 6903 """
a95a7133 6904 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
6905
6906 Converts a point or size from dialog units to pixels. Dialog units
6907 are used for maintaining a dialog's proportions even if the font
6908 changes. For the x dimension, the dialog units are multiplied by the
6909 average character width and then divided by 4. For the y dimension,
6910 the dialog units are multiplied by the average character height and
6911 then divided by 8.
6912 """
54f9ee45 6913 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
6914
6915 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 6916 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 6917 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
6918
6919 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 6920 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 6921 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
6922
6923 def WarpPointer(*args, **kwargs):
15afbcd0 6924 """
a95a7133 6925 WarpPointer(self, int x, int y)
15afbcd0
RD
6926
6927 Moves the pointer to the given position on the window.
6928
6929 NOTE: This function is not supported under Mac because Apple Human
6930 Interface Guidelines forbid moving the mouse cursor programmatically.
6931 """
54f9ee45 6932 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
6933
6934 def CaptureMouse(*args, **kwargs):
15afbcd0 6935 """
a95a7133 6936 CaptureMouse(self)
15afbcd0
RD
6937
6938 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
6939 release the capture.
6940
6941 Note that wxWindows maintains the stack of windows having captured the
6942 mouse and when the mouse is released the capture returns to the window
6943 which had had captured it previously and it is only really released if
6944 there were no previous window. In particular, this means that you must
6945 release the mouse as many times as you capture it.
6946 """
54f9ee45 6947 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
6948
6949 def ReleaseMouse(*args, **kwargs):
15afbcd0 6950 """
a95a7133 6951 ReleaseMouse(self)
15afbcd0
RD
6952
6953 Releases mouse input captured with wx.Window.CaptureMouse.
6954 """
54f9ee45 6955 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
6956
6957 def GetCapture(*args, **kwargs):
15afbcd0 6958 """
66c033b4 6959 GetCapture() -> Window
15afbcd0
RD
6960
6961 Returns the window which currently captures the mouse or None
6962 """
54f9ee45 6963 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
6964
6965 GetCapture = staticmethod(GetCapture)
6966 def HasCapture(*args, **kwargs):
15afbcd0 6967 """
a95a7133 6968 HasCapture(self) -> bool
15afbcd0
RD
6969
6970 Returns true if this window has the current mouse capture.
6971 """
54f9ee45 6972 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
6973
6974 def Refresh(*args, **kwargs):
15afbcd0 6975 """
a95a7133 6976 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
6977
6978 Mark the specified rectangle (or the whole window) as "dirty" so it
6979 will be repainted. Causes an EVT_PAINT event to be generated and sent
6980 to the window.
6981 """
54f9ee45 6982 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
6983
6984 def RefreshRect(*args, **kwargs):
15afbcd0 6985 """
a95a7133 6986 RefreshRect(self, Rect rect)
15afbcd0
RD
6987
6988 Redraws the contents of the given rectangle: the area inside it will
6989 be repainted. This is the same as Refresh but has a nicer syntax.
6990 """
54f9ee45 6991 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
6992
6993 def Update(*args, **kwargs):
15afbcd0 6994 """
a95a7133 6995 Update(self)
15afbcd0
RD
6996
6997 Calling this method immediately repaints the invalidated area of the
6998 window instead of waiting for the EVT_PAINT event to happen, (normally
6999 this would usually only happen when the flow of control returns to the
7000 event loop.) Notice that this function doesn't refresh the window and
7001 does nothing if the window has been already repainted. Use Refresh
7002 first if you want to immediately redraw the window (or some portion of
7003 it) unconditionally.
7004 """
54f9ee45 7005 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
7006
7007 def ClearBackground(*args, **kwargs):
15afbcd0 7008 """
a95a7133 7009 ClearBackground(self)
15afbcd0
RD
7010
7011 Clears the window by filling it with the current background
7012 colour. Does not cause an erase background event to be generated.
7013 """
54f9ee45 7014 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
7015
7016 def Freeze(*args, **kwargs):
15afbcd0 7017 """
a95a7133 7018 Freeze(self)
15afbcd0 7019
41e2b43e
RD
7020 Freezes the window or, in other words, prevents any updates from
7021 taking place on screen, the window is not redrawn at all. Thaw must be
7022 called to reenable window redrawing. Calls to Freeze/Thaw may be
7023 nested, with the actual Thaw being delayed until all the nesting has
7024 been undone.
15afbcd0
RD
7025
7026 This method is useful for visual appearance optimization (for example,
7027 it is a good idea to use it before inserting large amount of text into
7028 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
7029 for all controls so it is mostly just a hint to wxWindows and not a
7030 mandatory directive.
7031 """
54f9ee45 7032 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce
RD
7033
7034 def Thaw(*args, **kwargs):
15afbcd0 7035 """
a95a7133 7036 Thaw(self)
15afbcd0 7037
4276dc52 7038 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
7039 Freeze/Thaw may be nested, so Thaw must be called the same number of
7040 times that Freeze was before the window will be updated.
15afbcd0 7041 """
54f9ee45 7042 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
7043
7044 def PrepareDC(*args, **kwargs):
15afbcd0 7045 """
a95a7133 7046 PrepareDC(self, DC dc)
15afbcd0
RD
7047
7048 Call this function to prepare the device context for drawing a
7049 scrolled image. It sets the device origin according to the current
7050 scroll position.
7051 """
54f9ee45 7052 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce
RD
7053
7054 def GetUpdateRegion(*args, **kwargs):
15afbcd0 7055 """
a95a7133 7056 GetUpdateRegion(self) -> Region
15afbcd0
RD
7057
7058 Returns the region specifying which parts of the window have been
7059 damaged. Should only be called within an EVT_PAINT handler.
7060 """
54f9ee45 7061 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
7062
7063 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 7064 """
a95a7133 7065 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
7066
7067 Get the update rectangle region bounding box in client coords.
7068 """
54f9ee45 7069 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
7070
7071 def IsExposed(*args, **kwargs):
15afbcd0 7072 """
a95a7133 7073 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
7074
7075 Returns true if the given point or rectangle area has been exposed
7076 since the last repaint. Call this in an paint event handler to
7077 optimize redrawing by only redrawing those areas, which have been
7078 exposed.
7079 """
54f9ee45 7080 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
7081
7082 def IsExposedPoint(*args, **kwargs):
15afbcd0 7083 """
a95a7133 7084 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
7085
7086 Returns true if the given point or rectangle area has been exposed
7087 since the last repaint. Call this in an paint event handler to
7088 optimize redrawing by only redrawing those areas, which have been
7089 exposed.
7090 """
54f9ee45 7091 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 7092
4276dc52 7093 def IsExposedRect(*args, **kwargs):
15afbcd0 7094 """
a95a7133 7095 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
7096
7097 Returns true if the given point or rectangle area has been exposed
7098 since the last repaint. Call this in an paint event handler to
7099 optimize redrawing by only redrawing those areas, which have been
7100 exposed.
7101 """
54f9ee45 7102 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 7103
74a57fcd
RD
7104 def GetDefaultAttributes(*args, **kwargs):
7105 """
a95a7133 7106 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 7107
41e2b43e
RD
7108 Get the default attributes for an instance of this class. This is
7109 useful if you want to use the same font or colour in your own control
7110 as in a standard control -- which is a much better idea than hard
7111 coding specific colours or fonts which might look completely out of
db3e571a 7112 place on the user's system, especially if it uses themes.
74a57fcd 7113 """
54f9ee45 7114 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
7115
7116 def GetClassDefaultAttributes(*args, **kwargs):
7117 """
66c033b4 7118 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 7119
41e2b43e
RD
7120 Get the default attributes for this class. This is useful if you want
7121 to use the same font or colour in your own control as in a standard
7122 control -- which is a much better idea than hard coding specific
db3e571a
RD
7123 colours or fonts which might look completely out of place on the
7124 user's system, especially if it uses themes.
74a57fcd
RD
7125
7126 The variant parameter is only relevant under Mac currently and is
41e2b43e 7127 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
7128 the returned font. See `wx.Window.SetWindowVariant` for more about
7129 this.
74a57fcd 7130 """
54f9ee45 7131 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
7132
7133 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 7134 def SetBackgroundColour(*args, **kwargs):
15afbcd0 7135 """
a95a7133 7136 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
7137
7138 Sets the background colour of the window. Returns True if the colour
7139 was changed. The background colour is usually painted by the default
7140 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
7141 automatically under GTK. Using `wx.NullColour` will reset the window
7142 to the default background colour.
15afbcd0 7143
db3e571a 7144 Note that setting the background colour may not cause an immediate
f8167d6e 7145 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
7146 calling this function.
7147
f8167d6e
RD
7148 Using this function will disable attempts to use themes for this
7149 window, if the system supports them. Use with care since usually the
7150 themes represent the appearance chosen by the user to be used for all
7151 applications on the system.
15afbcd0 7152 """
54f9ee45 7153 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 7154
412d302d
RD
7155 def SetOwnBackgroundColour(*args, **kwargs):
7156 """SetOwnBackgroundColour(self, Colour colour)"""
7157 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 7158
e811c8ce 7159 def SetForegroundColour(*args, **kwargs):
15afbcd0 7160 """
a95a7133 7161 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
7162
7163 Sets the foreground colour of the window. Returns True is the colour
7164 was changed. The interpretation of foreground colour is dependent on
7165 the window class; it may be the text colour or other colour, or it may
7166 not be used at all.
7167 """
54f9ee45 7168 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 7169
fa47d7a7
VS
7170 def SetOwnForegroundColour(*args, **kwargs):
7171 """SetOwnForegroundColour(self, Colour colour)"""
7172 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 7173
e811c8ce 7174 def GetBackgroundColour(*args, **kwargs):
15afbcd0 7175 """
a95a7133 7176 GetBackgroundColour(self) -> Colour
15afbcd0
RD
7177
7178 Returns the background colour of the window.
7179 """
54f9ee45 7180 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
7181
7182 def GetForegroundColour(*args, **kwargs):
15afbcd0 7183 """
a95a7133 7184 GetForegroundColour(self) -> Colour
15afbcd0
RD
7185
7186 Returns the foreground colour of the window. The interpretation of
7187 foreground colour is dependent on the window class; it may be the text
7188 colour or other colour, or it may not be used at all.
7189 """
54f9ee45 7190 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 7191
7bc1e663
RD
7192 def SetBackgroundStyle(*args, **kwargs):
7193 """
7194 SetBackgroundStyle(self, int style) -> bool
7195
7196 Returns the background style of the window. The background style
7197 indicates how the background of the window is drawn.
7198
7199 ====================== ========================================
7200 wx.BG_STYLE_SYSTEM The background colour or pattern should
7201 be determined by the system
7202 wx.BG_STYLE_COLOUR The background should be a solid colour
7203 wx.BG_STYLE_CUSTOM The background will be implemented by the
7204 application.
7205 ====================== ========================================
7206
7207 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
7208 a custom background, such as a tiled bitmap. Currently the style has
7209 no effect on other platforms.
7210
7211 :see: `GetBackgroundStyle`, `SetBackgroundColour`
7212 """
7213 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
7214
7215 def GetBackgroundStyle(*args, **kwargs):
7216 """
7217 GetBackgroundStyle(self) -> int
7218
7219 Returns the background style of the window.
7220
7221 :see: `SetBackgroundStyle`
7222 """
7223 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
7224
e811c8ce 7225 def SetCursor(*args, **kwargs):
15afbcd0 7226 """
a95a7133 7227 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
7228
7229 Sets the window's cursor. Notice that the window cursor also sets it
7230 for the children of the window implicitly.
7231
7232 The cursor may be wx.NullCursor in which case the window cursor will
7233 be reset back to default.
7234 """
54f9ee45 7235 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
7236
7237 def GetCursor(*args, **kwargs):
15afbcd0 7238 """
a95a7133 7239 GetCursor(self) -> Cursor
15afbcd0
RD
7240
7241 Return the cursor associated with this window.
7242 """
54f9ee45 7243 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
7244
7245 def SetFont(*args, **kwargs):
15afbcd0 7246 """
a95a7133 7247 SetFont(self, Font font) -> bool
15afbcd0
RD
7248
7249 Sets the font for this window.
7250 """
54f9ee45 7251 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 7252
fa47d7a7
VS
7253 def SetOwnFont(*args, **kwargs):
7254 """SetOwnFont(self, Font font)"""
7255 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 7256
e811c8ce 7257 def GetFont(*args, **kwargs):
15afbcd0 7258 """
a95a7133 7259 GetFont(self) -> Font
15afbcd0 7260
4276dc52 7261 Returns the default font used for this window.
15afbcd0 7262 """
54f9ee45 7263 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
7264
7265 def SetCaret(*args, **kwargs):
15afbcd0 7266 """
a95a7133 7267 SetCaret(self, Caret caret)
15afbcd0
RD
7268
7269 Sets the caret associated with the window.
7270 """
54f9ee45 7271 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
7272
7273 def GetCaret(*args, **kwargs):
15afbcd0 7274 """
a95a7133 7275 GetCaret(self) -> Caret
15afbcd0
RD
7276
7277 Returns the caret associated with the window.
7278 """
54f9ee45 7279 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
7280
7281 def GetCharHeight(*args, **kwargs):
15afbcd0 7282 """
a95a7133 7283 GetCharHeight(self) -> int
15afbcd0
RD
7284
7285 Get the (average) character size for the current font.
7286 """
54f9ee45 7287 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
7288
7289 def GetCharWidth(*args, **kwargs):
15afbcd0 7290 """
a95a7133 7291 GetCharWidth(self) -> int
15afbcd0
RD
7292
7293 Get the (average) character size for the current font.
7294 """
54f9ee45 7295 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
7296
7297 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
7298 """
7299 GetTextExtent(String string) -> (width, height)
7300
7301 Get the width and height of the text using the current font.
7302 """
54f9ee45 7303 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
7304
7305 def GetFullTextExtent(*args, **kwargs):
0df68c9f 7306 """
196addbf 7307 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 7308 (width, height, descent, externalLeading)
e811c8ce 7309
15afbcd0
RD
7310 Get the width, height, decent and leading of the text using the
7311 current or specified font.
0df68c9f 7312 """
54f9ee45 7313 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
7314
7315 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
7316 """
7317 ClientToScreenXY(int x, int y) -> (x,y)
7318
7319 Converts to screen coordinates from coordinates relative to this window.
7320 """
54f9ee45 7321 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
7322
7323 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
7324 """
7325 ScreenToClientXY(int x, int y) -> (x,y)
7326
7327 Converts from screen to client window coordinates.
7328 """
54f9ee45 7329 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
7330
7331 def ClientToScreen(*args, **kwargs):
15afbcd0 7332 """
a95a7133 7333 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
7334
7335 Converts to screen coordinates from coordinates relative to this window.
7336 """
54f9ee45 7337 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
7338
7339 def ScreenToClient(*args, **kwargs):
15afbcd0 7340 """
a95a7133 7341 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
7342
7343 Converts from screen to client window coordinates.
7344 """
54f9ee45 7345 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
7346
7347 def HitTestXY(*args, **kwargs):
15afbcd0 7348 """
a95a7133 7349 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
7350
7351 Test where the given (in client coords) point lies
7352 """
54f9ee45 7353 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
7354
7355 def HitTest(*args, **kwargs):
15afbcd0 7356 """
a95a7133 7357 HitTest(self, Point pt) -> int
15afbcd0
RD
7358
7359 Test where the given (in client coords) point lies
7360 """
54f9ee45 7361 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 7362
15afbcd0
RD
7363 def GetBorder(*args):
7364 """
a95a7133
RD
7365 GetBorder(self, long flags) -> int
7366 GetBorder(self) -> int
e811c8ce 7367
15afbcd0
RD
7368 Get border for the flags of this window
7369 """
54f9ee45 7370 return _core_.Window_GetBorder(*args)
e811c8ce
RD
7371
7372 def UpdateWindowUI(*args, **kwargs):
15afbcd0 7373 """
a95a7133 7374 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
7375
7376 This function sends EVT_UPDATE_UI events to the window. The particular
7377 implementation depends on the window; for example a wx.ToolBar will
7378 send an update UI event for each toolbar button, and a wx.Frame will
7379 send an update UI event for each menubar menu item. You can call this
7380 function from your application to ensure that your UI is up-to-date at
7381 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7382 concerned). This may be necessary if you have called
7383 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7384 limit the overhead that wxWindows incurs by sending update UI events
7385 in idle time.
15afbcd0 7386 """
54f9ee45 7387 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
7388
7389 def PopupMenuXY(*args, **kwargs):
15afbcd0 7390 """
b0503257 7391 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 7392
b0503257
RD
7393 Pops up the given menu at the specified coordinates, relative to this window,
7394 and returns control when the user has dismissed the menu. If a menu item is
7395 selected, the corresponding menu event is generated and will be processed as
7396 usual. If the default position is given then the current position of the
7397 mouse cursor will be used.
15afbcd0 7398 """
54f9ee45 7399 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 7400
15afbcd0
RD
7401 def PopupMenu(*args, **kwargs):
7402 """
b0503257 7403 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 7404
b0503257
RD
7405 Pops up the given menu at the specified coordinates, relative to this window,
7406 and returns control when the user has dismissed the menu. If a menu item is
7407 selected, the corresponding menu event is generated and will be processed as
7408 usual. If the default position is given then the current position of the
7409 mouse cursor will be used.
15afbcd0 7410 """
54f9ee45 7411 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0
RD
7412
7413 def GetHandle(*args, **kwargs):
7414 """
a95a7133 7415 GetHandle(self) -> long
15afbcd0
RD
7416
7417 Returns the platform-specific handle (as a long integer) of the
7418 physical window. Currently on wxMac it returns the handle of the
7419 toplevel parent of the window.
7420 """
54f9ee45 7421 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 7422
7e63a440
RD
7423 def AssociateHandle(*args, **kwargs):
7424 """
7425 AssociateHandle(self, long handle)
7426
7427 Associate the window with a new native handle
7428 """
7429 return _core_.Window_AssociateHandle(*args, **kwargs)
7430
7431 def DissociateHandle(*args, **kwargs):
7432 """
7433 DissociateHandle(self)
7434
7435 Dissociate the current native handle from the window
7436 """
7437 return _core_.Window_DissociateHandle(*args, **kwargs)
7438
15afbcd0
RD
7439 def HasScrollbar(*args, **kwargs):
7440 """
a95a7133 7441 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
7442
7443 Does the window have the scrollbar for this orientation?
7444 """
54f9ee45 7445 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
7446
7447 def SetScrollbar(*args, **kwargs):
7448 """
41e2b43e 7449 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
7450 bool refresh=True)
7451
7452 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 7453 """
54f9ee45 7454 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
7455
7456 def SetScrollPos(*args, **kwargs):
15afbcd0 7457 """
a95a7133 7458 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
7459
7460 Sets the position of one of the built-in scrollbars.
7461 """
54f9ee45 7462 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
7463
7464 def GetScrollPos(*args, **kwargs):
15afbcd0 7465 """
a95a7133 7466 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
7467
7468 Returns the built-in scrollbar position.
7469 """
54f9ee45 7470 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
7471
7472 def GetScrollThumb(*args, **kwargs):
15afbcd0 7473 """
a95a7133 7474 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
7475
7476 Returns the built-in scrollbar thumb size.
7477 """
54f9ee45 7478 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
7479
7480 def GetScrollRange(*args, **kwargs):
15afbcd0 7481 """
a95a7133 7482 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
7483
7484 Returns the built-in scrollbar range.
7485 """
54f9ee45 7486 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
7487
7488 def ScrollWindow(*args, **kwargs):
15afbcd0 7489 """
a95a7133 7490 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
7491
7492 Physically scrolls the pixels in the window and move child windows
7493 accordingly. Use this function to optimise your scrolling
7494 implementations, to minimise the area that must be redrawn. Note that
7495 it is rarely required to call this function from a user program.
15afbcd0 7496 """
54f9ee45 7497 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
7498
7499 def ScrollLines(*args, **kwargs):
15afbcd0 7500 """
a95a7133 7501 ScrollLines(self, int lines) -> bool
15afbcd0
RD
7502
7503 If the platform and window class supports it, scrolls the window by
7504 the given number of lines down, if lines is positive, or up if lines
7505 is negative. Returns True if the window was scrolled, False if it was
7506 already on top/bottom and nothing was done.
7507 """
54f9ee45 7508 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
7509
7510 def ScrollPages(*args, **kwargs):
15afbcd0 7511 """
a95a7133 7512 ScrollPages(self, int pages) -> bool
15afbcd0 7513
41e2b43e 7514 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
7515 the given number of pages down, if pages is positive, or up if pages
7516 is negative. Returns True if the window was scrolled, False if it was
7517 already on top/bottom and nothing was done.
7518 """
54f9ee45 7519 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
7520
7521 def LineUp(*args, **kwargs):
15afbcd0 7522 """
a95a7133 7523 LineUp(self) -> bool
15afbcd0
RD
7524
7525 This is just a wrapper for ScrollLines(-1).
7526 """
54f9ee45 7527 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
7528
7529 def LineDown(*args, **kwargs):
15afbcd0 7530 """
a95a7133 7531 LineDown(self) -> bool
15afbcd0
RD
7532
7533 This is just a wrapper for ScrollLines(1).
7534 """
54f9ee45 7535 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
7536
7537 def PageUp(*args, **kwargs):
15afbcd0 7538 """
a95a7133 7539 PageUp(self) -> bool
15afbcd0
RD
7540
7541 This is just a wrapper for ScrollPages(-1).
7542 """
54f9ee45 7543 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
7544
7545 def PageDown(*args, **kwargs):
15afbcd0 7546 """
a95a7133 7547 PageDown(self) -> bool
15afbcd0
RD
7548
7549 This is just a wrapper for ScrollPages(1).
7550 """
54f9ee45 7551 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
7552
7553 def SetHelpText(*args, **kwargs):
15afbcd0 7554 """
a95a7133 7555 SetHelpText(self, String text)
15afbcd0
RD
7556
7557 Sets the help text to be used as context-sensitive help for this
7558 window. Note that the text is actually stored by the current
7559 wxHelpProvider implementation, and not in the window object itself.
7560 """
54f9ee45 7561 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
7562
7563 def SetHelpTextForId(*args, **kwargs):
15afbcd0 7564 """
a95a7133 7565 SetHelpTextForId(self, String text)
15afbcd0
RD
7566
7567 Associate this help text with all windows with the same id as this
7568 one.
7569 """
54f9ee45 7570 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce
RD
7571
7572 def GetHelpText(*args, **kwargs):
15afbcd0 7573 """
a95a7133 7574 GetHelpText(self) -> String
15afbcd0
RD
7575
7576 Gets the help text to be used as context-sensitive help for this
7577 window. Note that the text is actually stored by the current
7578 wxHelpProvider implementation, and not in the window object itself.
7579 """
54f9ee45 7580 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
7581
7582 def SetToolTipString(*args, **kwargs):
15afbcd0 7583 """
a95a7133 7584 SetToolTipString(self, String tip)
15afbcd0
RD
7585
7586 Attach a tooltip to the window.
7587 """
54f9ee45 7588 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
7589
7590 def SetToolTip(*args, **kwargs):
15afbcd0 7591 """
a95a7133 7592 SetToolTip(self, ToolTip tip)
15afbcd0
RD
7593
7594 Attach a tooltip to the window.
7595 """
54f9ee45 7596 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
7597
7598 def GetToolTip(*args, **kwargs):
15afbcd0 7599 """
a95a7133 7600 GetToolTip(self) -> ToolTip
15afbcd0
RD
7601
7602 get the associated tooltip or None if none
7603 """
54f9ee45 7604 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
7605
7606 def SetDropTarget(*args, **kwargs):
15afbcd0 7607 """
a95a7133 7608 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
7609
7610 Associates a drop target with this window. If the window already has
7611 a drop target, it is deleted.
7612 """
54f9ee45 7613 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
7614
7615 def GetDropTarget(*args, **kwargs):
15afbcd0 7616 """
a95a7133 7617 GetDropTarget(self) -> DropTarget
15afbcd0
RD
7618
7619 Returns the associated drop target, which may be None.
7620 """
54f9ee45 7621 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce
RD
7622
7623 def SetConstraints(*args, **kwargs):
15afbcd0 7624 """
a95a7133 7625 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
7626
7627 Sets the window to have the given layout constraints. If an existing
7628 layout constraints object is already owned by the window, it will be
7629 deleted. Pass None to disassociate and delete the window's current
7630 constraints.
7631
7632 You must call SetAutoLayout to tell a window to use the constraints
7633 automatically in its default EVT_SIZE handler; otherwise, you must
7634 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7635 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7636 effect.
7637 """
54f9ee45 7638 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
7639
7640 def GetConstraints(*args, **kwargs):
15afbcd0 7641 """
a95a7133 7642 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
7643
7644 Returns a pointer to the window's layout constraints, or None if there
7645 are none.
7646 """
54f9ee45 7647 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
7648
7649 def SetAutoLayout(*args, **kwargs):
15afbcd0 7650 """
a95a7133 7651 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
7652
7653 Determines whether the Layout function will be called automatically
7654 when the window is resized. It is called implicitly by SetSizer but
7655 if you use SetConstraints you should call it manually or otherwise the
7656 window layout won't be correctly updated when its size changes.
7657 """
54f9ee45 7658 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
7659
7660 def GetAutoLayout(*args, **kwargs):
15afbcd0 7661 """
a95a7133 7662 GetAutoLayout(self) -> bool
15afbcd0
RD
7663
7664 Returns the current autoLayout setting
7665 """
54f9ee45 7666 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
7667
7668 def Layout(*args, **kwargs):
15afbcd0 7669 """
a95a7133 7670 Layout(self) -> bool
15afbcd0
RD
7671
7672 Invokes the constraint-based layout algorithm or the sizer-based
7673 algorithm for this window. See SetAutoLayout: when auto layout is on,
7674 this function gets called automatically by the default EVT_SIZE
7675 handler when the window is resized.
7676 """
54f9ee45 7677 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
7678
7679 def SetSizer(*args, **kwargs):
15afbcd0 7680 """
a95a7133 7681 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
7682
7683 Sets the window to have the given layout sizer. The window will then
7684 own the object, and will take care of its deletion. If an existing
7685 layout sizer object is already owned by the window, it will be deleted
7686 if the deleteOld parameter is true. Note that this function will also
7687 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 7688 non-None, and False otherwise.
15afbcd0 7689 """
54f9ee45 7690 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
7691
7692 def SetSizerAndFit(*args, **kwargs):
15afbcd0 7693 """
a95a7133 7694 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
7695
7696 The same as SetSizer, except it also sets the size hints for the
7697 window based on the sizer's minimum size.
7698 """
54f9ee45 7699 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
7700
7701 def GetSizer(*args, **kwargs):
15afbcd0 7702 """
a95a7133 7703 GetSizer(self) -> Sizer
15afbcd0
RD
7704
7705 Return the sizer associated with the window by a previous call to
7706 SetSizer or None if there isn't one.
7707 """
54f9ee45 7708 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
7709
7710 def SetContainingSizer(*args, **kwargs):
15afbcd0 7711 """
a95a7133 7712 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
7713
7714 This normally does not need to be called by application code. It is
7715 called internally when a window is added to a sizer, and is used so
7716 the window can remove itself from the sizer when it is destroyed.
7717 """
54f9ee45 7718 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
7719
7720 def GetContainingSizer(*args, **kwargs):
15afbcd0 7721 """
a95a7133 7722 GetContainingSizer(self) -> Sizer
15afbcd0
RD
7723
7724 Return the sizer that this window is a member of, if any, otherwise None.
7725 """
54f9ee45 7726 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 7727
a95a7133
RD
7728 def InheritAttributes(*args, **kwargs):
7729 """
7730 InheritAttributes(self)
7731
41e2b43e
RD
7732 This function is (or should be, in case of custom controls) called
7733 during window creation to intelligently set up the window visual
7734 attributes, that is the font and the foreground and background
7735 colours.
7736
7737 By 'intelligently' the following is meant: by default, all windows use
7738 their own default attributes. However if some of the parent's
7739 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 7740 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
7741 explicitly set for this window itself, then this window takes the same
7742 value as used by the parent. In addition, if the window overrides
7743 ShouldInheritColours to return false, the colours will not be changed
7744 no matter what and only the font might.
7745
34621cc5 7746 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 7747 different usage scenarios. The most common one is when all default
41e2b43e
RD
7748 attributes are used and in this case, nothing should be inherited as
7749 in modern GUIs different controls use different fonts (and colours)
7750 than their siblings so they can't inherit the same value from the
7751 parent. However it was also deemed desirable to allow to simply change
7752 the attributes of all children at once by just changing the font or
7753 colour of their common parent, hence in this case we do inherit the
7754 parents attributes.
7755
a95a7133 7756 """
54f9ee45 7757 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
7758
7759 def ShouldInheritColours(*args, **kwargs):
7760 """
7761 ShouldInheritColours(self) -> bool
7762
7763 Return true from here to allow the colours of this window to be
41e2b43e
RD
7764 changed by InheritAttributes, returning false forbids inheriting them
7765 from the parent window.
a95a7133 7766
41e2b43e
RD
7767 The base class version returns false, but this method is overridden in
7768 wxControl where it returns true.
a95a7133 7769 """
54f9ee45 7770 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 7771
e811c8ce 7772 def PostCreate(self, pre):
15afbcd0
RD
7773 """
7774 Phase 3 of the 2-phase create <wink!>
7775 Call this method after precreating the window with the 2-phase create method.
7776 """
e811c8ce
RD
7777 self.this = pre.this
7778 self.thisown = pre.thisown
7779 pre.thisown = 0
7780 if hasattr(self, '_setOORInfo'):
7781 self._setOORInfo(self)
7782 if hasattr(self, '_setCallbackInfo'):
7783 self._setCallbackInfo(self, self.__class__)
7784
7785
7786class WindowPtr(Window):
7787 def __init__(self, this):
7788 self.this = this
7789 if not hasattr(self,"thisown"): self.thisown = 0
7790 self.__class__ = Window
54f9ee45 7791_core_.Window_swigregister(WindowPtr)
e811c8ce
RD
7792
7793def PreWindow(*args, **kwargs):
15afbcd0
RD
7794 """
7795 PreWindow() -> Window
7796
7797 Precreate a Window for 2-phase creation.
7798 """
54f9ee45 7799 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
7800 val.thisown = 1
7801 return val
7802
7803def Window_NewControlId(*args, **kwargs):
15afbcd0
RD
7804 """
7805 Window_NewControlId() -> int
7806
7807 Generate a control id for the controls which were not given one.
7808 """
54f9ee45 7809 return _core_.Window_NewControlId(*args, **kwargs)
e811c8ce
RD
7810
7811def Window_NextControlId(*args, **kwargs):
15afbcd0
RD
7812 """
7813 Window_NextControlId(int winid) -> int
7814
7815 Get the id of the control following the one with the given
41e2b43e 7816 autogenerated) id
15afbcd0 7817 """
54f9ee45 7818 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
7819
7820def Window_PrevControlId(*args, **kwargs):
15afbcd0
RD
7821 """
7822 Window_PrevControlId(int winid) -> int
7823
7824 Get the id of the control preceding the one with the given
41e2b43e 7825 autogenerated) id
15afbcd0 7826 """
54f9ee45 7827 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce
RD
7828
7829def Window_FindFocus(*args, **kwargs):
15afbcd0
RD
7830 """
7831 Window_FindFocus() -> Window
7832
7833 Returns the window or control that currently has the keyboard focus,
7834 or None.
7835 """
54f9ee45 7836 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
7837
7838def Window_GetCapture(*args, **kwargs):
15afbcd0
RD
7839 """
7840 Window_GetCapture() -> Window
7841
7842 Returns the window which currently captures the mouse or None
7843 """
54f9ee45 7844 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce 7845
74a57fcd
RD
7846def Window_GetClassDefaultAttributes(*args, **kwargs):
7847 """
7848 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7849
41e2b43e
RD
7850 Get the default attributes for this class. This is useful if you want
7851 to use the same font or colour in your own control as in a standard
7852 control -- which is a much better idea than hard coding specific
db3e571a
RD
7853 colours or fonts which might look completely out of place on the
7854 user's system, especially if it uses themes.
74a57fcd
RD
7855
7856 The variant parameter is only relevant under Mac currently and is
41e2b43e 7857 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
7858 the returned font. See `wx.Window.SetWindowVariant` for more about
7859 this.
74a57fcd 7860 """
54f9ee45 7861 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 7862
e811c8ce 7863def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
7864 """
7865 Convenience function for converting a Point or (x,y) in
7866 dialog units to pixel units.
7867 """
e811c8ce
RD
7868 if y is None:
7869 return win.ConvertDialogPointToPixels(point_or_x)
7870 else:
fd3f2efe 7871 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
7872
7873def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
7874 """
7875 Convenience function for converting a Size or (w,h) in
7876 dialog units to pixel units.
7877 """
e811c8ce
RD
7878 if height is None:
7879 return win.ConvertDialogSizeToPixels(size_width)
7880 else:
fd3f2efe 7881 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
7882
7883
7884def FindWindowById(*args, **kwargs):
15afbcd0
RD
7885 """
7886 FindWindowById(long id, Window parent=None) -> Window
7887
7888 Find the first window in the application with the given id. If parent
7889 is None, the search will start from all top-level frames and dialog
7890 boxes; if non-None, the search will be limited to the given window
7891 hierarchy. The search is recursive in both cases.
7892 """
54f9ee45 7893 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
7894
7895def FindWindowByName(*args, **kwargs):
15afbcd0
RD
7896 """
7897 FindWindowByName(String name, Window parent=None) -> Window
7898
7899 Find a window by its name (as given in a window constructor or Create
7900 function call). If parent is None, the search will start from all
7901 top-level frames and dialog boxes; if non-None, the search will be
7902 limited to the given window hierarchy. The search is recursive in both
7903 cases.
7904
7905 If no window with such name is found, wx.FindWindowByLabel is called.
7906 """
54f9ee45 7907 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
7908
7909def FindWindowByLabel(*args, **kwargs):
15afbcd0
RD
7910 """
7911 FindWindowByLabel(String label, Window parent=None) -> Window
7912
7913 Find a window by its label. Depending on the type of window, the label
7914 may be a window title or panel item label. If parent is None, the
7915 search will start from all top-level frames and dialog boxes; if
7916 non-None, the search will be limited to the given window
7917 hierarchy. The search is recursive in both cases.
7918 """
54f9ee45 7919 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
7920
7921def Window_FromHWND(*args, **kwargs):
4276dc52 7922 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
54f9ee45 7923 return _core_.Window_FromHWND(*args, **kwargs)
e811c8ce
RD
7924#---------------------------------------------------------------------------
7925
7926class Validator(EvtHandler):
e811c8ce
RD
7927 def __repr__(self):
7928 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7929 def __init__(self, *args, **kwargs):
a95a7133 7930 """__init__(self) -> Validator"""
54f9ee45 7931 newobj = _core_.new_Validator(*args, **kwargs)
d14a1e28
RD
7932 self.this = newobj.this
7933 self.thisown = 1
7934 del newobj.thisown
7935 self._setOORInfo(self)
e811c8ce
RD
7936
7937 def Clone(*args, **kwargs):
a95a7133 7938 """Clone(self) -> Validator"""
54f9ee45 7939 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
7940
7941 def Validate(*args, **kwargs):
a95a7133 7942 """Validate(self, Window parent) -> bool"""
54f9ee45 7943 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
7944
7945 def TransferToWindow(*args, **kwargs):
a95a7133 7946 """TransferToWindow(self) -> bool"""
54f9ee45 7947 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
7948
7949 def TransferFromWindow(*args, **kwargs):
a95a7133 7950 """TransferFromWindow(self) -> bool"""
54f9ee45 7951 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
7952
7953 def GetWindow(*args, **kwargs):
a95a7133 7954 """GetWindow(self) -> Window"""
54f9ee45 7955 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
7956
7957 def SetWindow(*args, **kwargs):
a95a7133 7958 """SetWindow(self, Window window)"""
54f9ee45 7959 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
7960
7961 def IsSilent(*args, **kwargs):
66c033b4 7962 """IsSilent() -> bool"""
54f9ee45 7963 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
7964
7965 IsSilent = staticmethod(IsSilent)
7966 def SetBellOnError(*args, **kwargs):
66c033b4 7967 """SetBellOnError(int doIt=True)"""
54f9ee45 7968 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
7969
7970 SetBellOnError = staticmethod(SetBellOnError)
7971
7972class ValidatorPtr(Validator):
7973 def __init__(self, this):
7974 self.this = this
7975 if not hasattr(self,"thisown"): self.thisown = 0
7976 self.__class__ = Validator
54f9ee45 7977_core_.Validator_swigregister(ValidatorPtr)
e811c8ce
RD
7978
7979def Validator_IsSilent(*args, **kwargs):
7980 """Validator_IsSilent() -> bool"""
54f9ee45 7981 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
7982
7983def Validator_SetBellOnError(*args, **kwargs):
7984 """Validator_SetBellOnError(int doIt=True)"""
54f9ee45 7985 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
7986
7987class PyValidator(Validator):
e811c8ce
RD
7988 def __repr__(self):
7989 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7990 def __init__(self, *args, **kwargs):
a95a7133 7991 """__init__(self) -> PyValidator"""
54f9ee45 7992 newobj = _core_.new_PyValidator(*args, **kwargs)
e811c8ce
RD
7993 self.this = newobj.this
7994 self.thisown = 1
7995 del newobj.thisown
7996
7997 self._setCallbackInfo(self, PyValidator, 1)
7998 self._setOORInfo(self)
7999
8000 def _setCallbackInfo(*args, **kwargs):
a95a7133 8001 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
54f9ee45 8002 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
8003
8004
8005class PyValidatorPtr(PyValidator):
8006 def __init__(self, this):
8007 self.this = this
8008 if not hasattr(self,"thisown"): self.thisown = 0
8009 self.__class__ = PyValidator
54f9ee45 8010_core_.PyValidator_swigregister(PyValidatorPtr)
e811c8ce
RD
8011
8012#---------------------------------------------------------------------------
8013
8014class Menu(EvtHandler):
d14a1e28
RD
8015 def __repr__(self):
8016 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 8017 def __init__(self, *args, **kwargs):
a95a7133 8018 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
54f9ee45 8019 newobj = _core_.new_Menu(*args, **kwargs)
e811c8ce
RD
8020 self.this = newobj.this
8021 self.thisown = 1
8022 del newobj.thisown
8023 self._setOORInfo(self)
8024
8025 def Append(*args, **kwargs):
a95a7133 8026 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 8027 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
8028
8029 def AppendSeparator(*args, **kwargs):
a95a7133 8030 """AppendSeparator(self) -> MenuItem"""
54f9ee45 8031 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
8032
8033 def AppendCheckItem(*args, **kwargs):
a95a7133 8034 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8035 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
8036
8037 def AppendRadioItem(*args, **kwargs):
a95a7133 8038 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8039 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
8040
8041 def AppendMenu(*args, **kwargs):
a95a7133 8042 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 8043 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce
RD
8044
8045 def AppendItem(*args, **kwargs):
a95a7133 8046 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 8047 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce
RD
8048
8049 def Break(*args, **kwargs):
a95a7133 8050 """Break(self)"""
54f9ee45 8051 return _core_.Menu_Break(*args, **kwargs)
e811c8ce
RD
8052
8053 def InsertItem(*args, **kwargs):
a95a7133 8054 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 8055 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce
RD
8056
8057 def Insert(*args, **kwargs):
0df68c9f 8058 """
a95a7133 8059 Insert(self, size_t pos, int id, String text, String help=EmptyString,
a41e16b6 8060 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 8061 """
54f9ee45 8062 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
8063
8064 def InsertSeparator(*args, **kwargs):
a95a7133 8065 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 8066 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
8067
8068 def InsertCheckItem(*args, **kwargs):
a95a7133 8069 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8070 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
8071
8072 def InsertRadioItem(*args, **kwargs):
a95a7133 8073 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8074 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
8075
8076 def InsertMenu(*args, **kwargs):
a95a7133 8077 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 8078 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce
RD
8079
8080 def PrependItem(*args, **kwargs):
a95a7133 8081 """PrependItem(self, MenuItem item) -> MenuItem"""
54f9ee45 8082 return _core_.Menu_PrependItem(*args, **kwargs)
e811c8ce
RD
8083
8084 def Prepend(*args, **kwargs):
a95a7133 8085 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 8086 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
8087
8088 def PrependSeparator(*args, **kwargs):
a95a7133 8089 """PrependSeparator(self) -> MenuItem"""
54f9ee45 8090 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
8091
8092 def PrependCheckItem(*args, **kwargs):
a95a7133 8093 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8094 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
8095
8096 def PrependRadioItem(*args, **kwargs):
a95a7133 8097 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 8098 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
8099
8100 def PrependMenu(*args, **kwargs):
a95a7133 8101 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 8102 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
8103
8104 def Remove(*args, **kwargs):
a95a7133 8105 """Remove(self, int id) -> MenuItem"""
54f9ee45 8106 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce
RD
8107
8108 def RemoveItem(*args, **kwargs):
a95a7133 8109 """RemoveItem(self, MenuItem item) -> MenuItem"""
54f9ee45 8110 return _core_.Menu_RemoveItem(*args, **kwargs)
e811c8ce
RD
8111
8112 def Delete(*args, **kwargs):
a95a7133 8113 """Delete(self, int id) -> bool"""
54f9ee45 8114 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
8115
8116 def DeleteItem(*args, **kwargs):
a95a7133 8117 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 8118 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
8119
8120 def Destroy(*args, **kwargs):
0df68c9f 8121 """
a95a7133 8122 Destroy(self)
e811c8ce 8123
0df68c9f
RD
8124 Deletes the C++ object this Python object is a proxy for.
8125 """
54f9ee45 8126 return _core_.Menu_Destroy(*args, **kwargs)
e811c8ce
RD
8127
8128 def DestroyId(*args, **kwargs):
0df68c9f 8129 """
a95a7133 8130 DestroyId(self, int id) -> bool
e811c8ce 8131
0df68c9f
RD
8132 Deletes the C++ object this Python object is a proxy for.
8133 """
54f9ee45 8134 return _core_.Menu_DestroyId(*args, **kwargs)
e811c8ce
RD
8135
8136 def DestroyItem(*args, **kwargs):
0df68c9f 8137 """
a95a7133 8138 DestroyItem(self, MenuItem item) -> bool
e811c8ce 8139
0df68c9f
RD
8140 Deletes the C++ object this Python object is a proxy for.
8141 """
54f9ee45 8142 return _core_.Menu_DestroyItem(*args, **kwargs)
e811c8ce
RD
8143
8144 def GetMenuItemCount(*args, **kwargs):
a95a7133 8145 """GetMenuItemCount(self) -> size_t"""
54f9ee45 8146 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
8147
8148 def GetMenuItems(*args, **kwargs):
a95a7133 8149 """GetMenuItems(self) -> PyObject"""
54f9ee45 8150 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
8151
8152 def FindItem(*args, **kwargs):
a95a7133 8153 """FindItem(self, String item) -> int"""
54f9ee45 8154 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
8155
8156 def FindItemById(*args, **kwargs):
a95a7133 8157 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 8158 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
8159
8160 def FindItemByPosition(*args, **kwargs):
a95a7133 8161 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 8162 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
8163
8164 def Enable(*args, **kwargs):
a95a7133 8165 """Enable(self, int id, bool enable)"""
54f9ee45 8166 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
8167
8168 def IsEnabled(*args, **kwargs):
a95a7133 8169 """IsEnabled(self, int id) -> bool"""
54f9ee45 8170 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
8171
8172 def Check(*args, **kwargs):
a95a7133 8173 """Check(self, int id, bool check)"""
54f9ee45 8174 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
8175
8176 def IsChecked(*args, **kwargs):
a95a7133 8177 """IsChecked(self, int id) -> bool"""
54f9ee45 8178 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
8179
8180 def SetLabel(*args, **kwargs):
a95a7133 8181 """SetLabel(self, int id, String label)"""
54f9ee45 8182 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
8183
8184 def GetLabel(*args, **kwargs):
a95a7133 8185 """GetLabel(self, int id) -> String"""
54f9ee45 8186 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
8187
8188 def SetHelpString(*args, **kwargs):
a95a7133 8189 """SetHelpString(self, int id, String helpString)"""
54f9ee45 8190 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
8191
8192 def GetHelpString(*args, **kwargs):
a95a7133 8193 """GetHelpString(self, int id) -> String"""
54f9ee45 8194 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
8195
8196 def SetTitle(*args, **kwargs):
a95a7133 8197 """SetTitle(self, String title)"""
54f9ee45 8198 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
8199
8200 def GetTitle(*args, **kwargs):
a95a7133 8201 """GetTitle(self) -> String"""
54f9ee45 8202 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
8203
8204 def SetEventHandler(*args, **kwargs):
a95a7133 8205 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 8206 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
8207
8208 def GetEventHandler(*args, **kwargs):
a95a7133 8209 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 8210 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
8211
8212 def SetInvokingWindow(*args, **kwargs):
a95a7133 8213 """SetInvokingWindow(self, Window win)"""
54f9ee45 8214 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
8215
8216 def GetInvokingWindow(*args, **kwargs):
a95a7133 8217 """GetInvokingWindow(self) -> Window"""
54f9ee45 8218 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
8219
8220 def GetStyle(*args, **kwargs):
a95a7133 8221 """GetStyle(self) -> long"""
54f9ee45 8222 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
8223
8224 def UpdateUI(*args, **kwargs):
a95a7133 8225 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 8226 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
8227
8228 def GetMenuBar(*args, **kwargs):
a95a7133 8229 """GetMenuBar(self) -> MenuBar"""
54f9ee45 8230 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
8231
8232 def Attach(*args, **kwargs):
a95a7133 8233 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 8234 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
8235
8236 def Detach(*args, **kwargs):
a95a7133 8237 """Detach(self)"""
54f9ee45 8238 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
8239
8240 def IsAttached(*args, **kwargs):
a95a7133 8241 """IsAttached(self) -> bool"""
54f9ee45 8242 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
8243
8244 def SetParent(*args, **kwargs):
a95a7133 8245 """SetParent(self, Menu parent)"""
54f9ee45 8246 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
8247
8248 def GetParent(*args, **kwargs):
a95a7133 8249 """GetParent(self) -> Menu"""
54f9ee45 8250 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 8251
d14a1e28
RD
8252
8253class MenuPtr(Menu):
8254 def __init__(self, this):
8255 self.this = this
8256 if not hasattr(self,"thisown"): self.thisown = 0
8257 self.__class__ = Menu
54f9ee45 8258_core_.Menu_swigregister(MenuPtr)
d14a1e28
RD
8259DefaultValidator = cvar.DefaultValidator
8260
8261#---------------------------------------------------------------------------
8262
8263class MenuBar(Window):
e811c8ce
RD
8264 def __repr__(self):
8265 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8266 def __init__(self, *args, **kwargs):
a95a7133 8267 """__init__(self, long style=0) -> MenuBar"""
54f9ee45 8268 newobj = _core_.new_MenuBar(*args, **kwargs)
d14a1e28
RD
8269 self.this = newobj.this
8270 self.thisown = 1
8271 del newobj.thisown
8272 self._setOORInfo(self)
e811c8ce
RD
8273
8274 def Append(*args, **kwargs):
a95a7133 8275 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 8276 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
8277
8278 def Insert(*args, **kwargs):
a95a7133 8279 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 8280 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
8281
8282 def GetMenuCount(*args, **kwargs):
a95a7133 8283 """GetMenuCount(self) -> size_t"""
54f9ee45 8284 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
8285
8286 def GetMenu(*args, **kwargs):
a95a7133 8287 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 8288 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
8289
8290 def Replace(*args, **kwargs):
a95a7133 8291 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 8292 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
8293
8294 def Remove(*args, **kwargs):
a95a7133 8295 """Remove(self, size_t pos) -> Menu"""
54f9ee45 8296 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
8297
8298 def EnableTop(*args, **kwargs):
a95a7133 8299 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 8300 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
8301
8302 def IsEnabledTop(*args, **kwargs):
a95a7133 8303 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 8304 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
8305
8306 def SetLabelTop(*args, **kwargs):
a95a7133 8307 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 8308 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
8309
8310 def GetLabelTop(*args, **kwargs):
a95a7133 8311 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 8312 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
8313
8314 def FindMenuItem(*args, **kwargs):
a95a7133 8315 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 8316 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
8317
8318 def FindItemById(*args, **kwargs):
a95a7133 8319 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 8320 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
8321
8322 def FindMenu(*args, **kwargs):
a95a7133 8323 """FindMenu(self, String title) -> int"""
54f9ee45 8324 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
8325
8326 def Enable(*args, **kwargs):
a95a7133 8327 """Enable(self, int id, bool enable)"""
54f9ee45 8328 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
8329
8330 def Check(*args, **kwargs):
a95a7133 8331 """Check(self, int id, bool check)"""
54f9ee45 8332 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
8333
8334 def IsChecked(*args, **kwargs):
a95a7133 8335 """IsChecked(self, int id) -> bool"""
54f9ee45 8336 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
8337
8338 def IsEnabled(*args, **kwargs):
a95a7133 8339 """IsEnabled(self, int id) -> bool"""
54f9ee45 8340 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
8341
8342 def SetLabel(*args, **kwargs):
a95a7133 8343 """SetLabel(self, int id, String label)"""
54f9ee45 8344 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
8345
8346 def GetLabel(*args, **kwargs):
a95a7133 8347 """GetLabel(self, int id) -> String"""
54f9ee45 8348 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
8349
8350 def SetHelpString(*args, **kwargs):
a95a7133 8351 """SetHelpString(self, int id, String helpString)"""
54f9ee45 8352 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
8353
8354 def GetHelpString(*args, **kwargs):
a95a7133 8355 """GetHelpString(self, int id) -> String"""
54f9ee45 8356 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
8357
8358 def GetFrame(*args, **kwargs):
a95a7133 8359 """GetFrame(self) -> wxFrame"""
54f9ee45 8360 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
8361
8362 def IsAttached(*args, **kwargs):
a95a7133 8363 """IsAttached(self) -> bool"""
54f9ee45 8364 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
8365
8366 def Attach(*args, **kwargs):
a95a7133 8367 """Attach(self, wxFrame frame)"""
54f9ee45 8368 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
8369
8370 def Detach(*args, **kwargs):
a95a7133 8371 """Detach(self)"""
54f9ee45 8372 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 8373
d14a1e28
RD
8374
8375class MenuBarPtr(MenuBar):
8376 def __init__(self, this):
8377 self.this = this
8378 if not hasattr(self,"thisown"): self.thisown = 0
8379 self.__class__ = MenuBar
54f9ee45 8380_core_.MenuBar_swigregister(MenuBarPtr)
d14a1e28
RD
8381
8382#---------------------------------------------------------------------------
8383
8384class MenuItem(Object):
e811c8ce
RD
8385 def __repr__(self):
8386 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8387 def __init__(self, *args, **kwargs):
0df68c9f 8388 """
a95a7133 8389 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
196addbf
RD
8390 String help=EmptyString, int kind=ITEM_NORMAL,
8391 Menu subMenu=None) -> MenuItem
0df68c9f 8392 """
54f9ee45 8393 newobj = _core_.new_MenuItem(*args, **kwargs)
d14a1e28
RD
8394 self.this = newobj.this
8395 self.thisown = 1
8396 del newobj.thisown
e811c8ce 8397 def GetMenu(*args, **kwargs):
a95a7133 8398 """GetMenu(self) -> Menu"""
54f9ee45 8399 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
8400
8401 def SetMenu(*args, **kwargs):
a95a7133 8402 """SetMenu(self, Menu menu)"""
54f9ee45 8403 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
8404
8405 def SetId(*args, **kwargs):
a95a7133 8406 """SetId(self, int id)"""
54f9ee45 8407 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
8408
8409 def GetId(*args, **kwargs):
a95a7133 8410 """GetId(self) -> int"""
54f9ee45 8411 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
8412
8413 def IsSeparator(*args, **kwargs):
a95a7133 8414 """IsSeparator(self) -> bool"""
54f9ee45 8415 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
8416
8417 def SetText(*args, **kwargs):
a95a7133 8418 """SetText(self, String str)"""
54f9ee45 8419 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
8420
8421 def GetLabel(*args, **kwargs):
a95a7133 8422 """GetLabel(self) -> String"""
54f9ee45 8423 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
8424
8425 def GetText(*args, **kwargs):
a95a7133 8426 """GetText(self) -> String"""
54f9ee45 8427 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
8428
8429 def GetLabelFromText(*args, **kwargs):
66c033b4 8430 """GetLabelFromText(String text) -> String"""
54f9ee45 8431 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
8432
8433 GetLabelFromText = staticmethod(GetLabelFromText)
8434 def GetKind(*args, **kwargs):
a95a7133 8435 """GetKind(self) -> int"""
54f9ee45 8436 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 8437
a95a7133
RD
8438 def SetKind(*args, **kwargs):
8439 """SetKind(self, int kind)"""
54f9ee45 8440 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 8441
e811c8ce 8442 def SetCheckable(*args, **kwargs):
a95a7133 8443 """SetCheckable(self, bool checkable)"""
54f9ee45 8444 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
8445
8446 def IsCheckable(*args, **kwargs):
a95a7133 8447 """IsCheckable(self) -> bool"""
54f9ee45 8448 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
8449
8450 def IsSubMenu(*args, **kwargs):
a95a7133 8451 """IsSubMenu(self) -> bool"""
54f9ee45 8452 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
8453
8454 def SetSubMenu(*args, **kwargs):
a95a7133 8455 """SetSubMenu(self, Menu menu)"""
54f9ee45 8456 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
8457
8458 def GetSubMenu(*args, **kwargs):
a95a7133 8459 """GetSubMenu(self) -> Menu"""
54f9ee45 8460 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
8461
8462 def Enable(*args, **kwargs):
a95a7133 8463 """Enable(self, bool enable=True)"""
54f9ee45 8464 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
8465
8466 def IsEnabled(*args, **kwargs):
a95a7133 8467 """IsEnabled(self) -> bool"""
54f9ee45 8468 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
8469
8470 def Check(*args, **kwargs):
a95a7133 8471 """Check(self, bool check=True)"""
54f9ee45 8472 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
8473
8474 def IsChecked(*args, **kwargs):
a95a7133 8475 """IsChecked(self) -> bool"""
54f9ee45 8476 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
8477
8478 def Toggle(*args, **kwargs):
a95a7133 8479 """Toggle(self)"""
54f9ee45 8480 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
8481
8482 def SetHelp(*args, **kwargs):
a95a7133 8483 """SetHelp(self, String str)"""
54f9ee45 8484 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
8485
8486 def GetHelp(*args, **kwargs):
a95a7133 8487 """GetHelp(self) -> String"""
54f9ee45 8488 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
8489
8490 def GetAccel(*args, **kwargs):
a95a7133 8491 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 8492 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
8493
8494 def SetAccel(*args, **kwargs):
a95a7133 8495 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 8496 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce
RD
8497
8498 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 8499 """GetDefaultMarginWidth() -> int"""
54f9ee45 8500 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
8501
8502 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
8503 def SetBitmap(*args, **kwargs):
a95a7133 8504 """SetBitmap(self, Bitmap bitmap)"""
54f9ee45 8505 return _core_.MenuItem_SetBitmap(*args, **kwargs)
e811c8ce
RD
8506
8507 def GetBitmap(*args, **kwargs):
a95a7133 8508 """GetBitmap(self) -> Bitmap"""
54f9ee45 8509 return _core_.MenuItem_GetBitmap(*args, **kwargs)
e811c8ce 8510
d14a1e28
RD
8511
8512class MenuItemPtr(MenuItem):
8513 def __init__(self, this):
8514 self.this = this
8515 if not hasattr(self,"thisown"): self.thisown = 0
8516 self.__class__ = MenuItem
54f9ee45 8517_core_.MenuItem_swigregister(MenuItemPtr)
d14a1e28 8518
e811c8ce 8519def MenuItem_GetLabelFromText(*args, **kwargs):
196addbf 8520 """MenuItem_GetLabelFromText(String text) -> String"""
54f9ee45 8521 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 8522
e811c8ce
RD
8523def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8524 """MenuItem_GetDefaultMarginWidth() -> int"""
54f9ee45 8525 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d14a1e28
RD
8526
8527#---------------------------------------------------------------------------
8528
8529class Control(Window):
15afbcd0
RD
8530 """
8531 This is the base class for a control or 'widget'.
8532
41e2b43e
RD
8533 A control is generally a small window which processes user input
8534 and/or displays one or more item of data.
15afbcd0 8535 """
e811c8ce
RD
8536 def __repr__(self):
8537 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8538 def __init__(self, *args, **kwargs):
0df68c9f 8539 """
248ed943
RD
8540 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8541 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 8542 String name=ControlNameStr) -> Control
15afbcd0 8543
41e2b43e
RD
8544 Create a Control. Normally you should only call this from a subclass'
8545 __init__ as a plain old wx.Control is not very useful.
0df68c9f 8546 """
54f9ee45 8547 newobj = _core_.new_Control(*args, **kwargs)
d14a1e28
RD
8548 self.this = newobj.this
8549 self.thisown = 1
8550 del newobj.thisown
8551 self._setOORInfo(self)
e811c8ce
RD
8552
8553 def Create(*args, **kwargs):
0df68c9f 8554 """
248ed943
RD
8555 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8556 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 8557 String name=ControlNameStr) -> bool
15afbcd0
RD
8558
8559 Do the 2nd phase and create the GUI control.
0df68c9f 8560 """
54f9ee45 8561 return _core_.Control_Create(*args, **kwargs)
e811c8ce
RD
8562
8563 def Command(*args, **kwargs):
15afbcd0 8564 """
a95a7133 8565 Command(self, CommandEvent event)
15afbcd0 8566
41e2b43e
RD
8567 Simulates the effect of the user issuing a command to the item.
8568
8569 :see: `wx.CommandEvent`
8570
15afbcd0 8571 """
54f9ee45 8572 return _core_.Control_Command(*args, **kwargs)
e811c8ce
RD
8573
8574 def GetLabel(*args, **kwargs):
15afbcd0 8575 """
a95a7133 8576 GetLabel(self) -> String
15afbcd0
RD
8577
8578 Return a control's text.
8579 """
54f9ee45 8580 return _core_.Control_GetLabel(*args, **kwargs)
e811c8ce
RD
8581
8582 def SetLabel(*args, **kwargs):
15afbcd0 8583 """
a95a7133 8584 SetLabel(self, String label)
15afbcd0
RD
8585
8586 Sets the item's text.
8587 """
54f9ee45 8588 return _core_.Control_SetLabel(*args, **kwargs)
e811c8ce 8589
74a57fcd 8590 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
8591 """
8592 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8593
8594 Get the default attributes for this class. This is useful if you want
8595 to use the same font or colour in your own control as in a standard
8596 control -- which is a much better idea than hard coding specific
8597 colours or fonts which might look completely out of place on the
8598 user's system, especially if it uses themes.
8599
8600 The variant parameter is only relevant under Mac currently and is
8601 ignore under other platforms. Under Mac, it will change the size of
8602 the returned font. See `wx.Window.SetWindowVariant` for more about
8603 this.
8604 """
54f9ee45 8605 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
8606
8607 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
d14a1e28
RD
8608
8609class ControlPtr(Control):
8610 def __init__(self, this):
8611 self.this = this
8612 if not hasattr(self,"thisown"): self.thisown = 0
8613 self.__class__ = Control
54f9ee45 8614_core_.Control_swigregister(ControlPtr)
b2dc1044 8615ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
8616
8617def PreControl(*args, **kwargs):
15afbcd0
RD
8618 """
8619 PreControl() -> Control
8620
8621 Precreate a Control control for 2-phase creation
8622 """
54f9ee45 8623 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
8624 val.thisown = 1
8625 return val
8626
74a57fcd 8627def Control_GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
8628 """
8629 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8630
8631 Get the default attributes for this class. This is useful if you want
8632 to use the same font or colour in your own control as in a standard
8633 control -- which is a much better idea than hard coding specific
8634 colours or fonts which might look completely out of place on the
8635 user's system, especially if it uses themes.
8636
8637 The variant parameter is only relevant under Mac currently and is
8638 ignore under other platforms. Under Mac, it will change the size of
8639 the returned font. See `wx.Window.SetWindowVariant` for more about
8640 this.
8641 """
54f9ee45 8642 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 8643
d14a1e28
RD
8644#---------------------------------------------------------------------------
8645
8646class ItemContainer(object):
15afbcd0
RD
8647 """
8648 wx.ItemContainer defines an interface which is implemented by all
41e2b43e
RD
8649 controls which have string subitems, each of which may be selected,
8650 such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well as
8651 `wx.ComboBox` which implements an extended interface deriving from
8652 this one.
15afbcd0 8653
41e2b43e
RD
8654 It defines the methods for accessing the control's items and although
8655 each of the derived classes implements them differently, they still
8656 all conform to the same interface.
15afbcd0 8657
41e2b43e
RD
8658 The items in a wx.ItemContainer have (non empty) string labels and,
8659 optionally, client data associated with them.
15afbcd0
RD
8660
8661 """
d14a1e28
RD
8662 def __init__(self): raise RuntimeError, "No constructor defined"
8663 def __repr__(self):
8664 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 8665 def Append(*args, **kwargs):
15afbcd0 8666 """
a95a7133 8667 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 8668
41e2b43e
RD
8669 Adds the item to the control, associating the given data with the item
8670 if not None. The return value is the index of the newly added item
8671 which may be different from the last one if the control is sorted (e.g.
8672 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 8673 """
54f9ee45 8674 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
8675
8676 def AppendItems(*args, **kwargs):
15afbcd0 8677 """
f5b96ee1 8678 AppendItems(self, List strings)
15afbcd0 8679
41e2b43e
RD
8680 Apend several items at once to the control. Notice that calling this
8681 method may be much faster than appending the items one by one if you
8682 need to add a lot of items.
15afbcd0 8683 """
54f9ee45 8684 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
8685
8686 def Insert(*args, **kwargs):
15afbcd0 8687 """
a95a7133 8688 Insert(self, String item, int pos, PyObject clientData=None) -> int
15afbcd0 8689
41e2b43e 8690 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
8691 optionally associating some data object with the item.
8692 """
54f9ee45 8693 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
8694
8695 def Clear(*args, **kwargs):
15afbcd0 8696 """
a95a7133 8697 Clear(self)
15afbcd0
RD
8698
8699 Removes all items from the control.
8700 """
54f9ee45 8701 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
8702
8703 def Delete(*args, **kwargs):
15afbcd0 8704 """
a95a7133 8705 Delete(self, int n)
15afbcd0 8706
41e2b43e
RD
8707 Deletes the item at the zero-based index 'n' from the control. Note
8708 that it is an error (signalled by a `wx.PyAssertionError` exception if
8709 enabled) to remove an item with the index negative or greater or equal
8710 than the number of items in the control.
15afbcd0 8711 """
54f9ee45 8712 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce
RD
8713
8714 def GetCount(*args, **kwargs):
15afbcd0 8715 """
a95a7133 8716 GetCount(self) -> int
15afbcd0
RD
8717
8718 Returns the number of items in the control.
8719 """
54f9ee45 8720 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
8721
8722 def IsEmpty(*args, **kwargs):
15afbcd0 8723 """
a95a7133 8724 IsEmpty(self) -> bool
15afbcd0
RD
8725
8726 Returns True if the control is empty or False if it has some items.
8727 """
54f9ee45 8728 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
8729
8730 def GetString(*args, **kwargs):
15afbcd0 8731 """
a95a7133 8732 GetString(self, int n) -> String
15afbcd0
RD
8733
8734 Returns the label of the item with the given index.
8735 """
54f9ee45 8736 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
8737
8738 def GetStrings(*args, **kwargs):
a95a7133 8739 """GetStrings(self) -> wxArrayString"""
54f9ee45 8740 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
8741
8742 def SetString(*args, **kwargs):
15afbcd0 8743 """
a95a7133 8744 SetString(self, int n, String s)
15afbcd0
RD
8745
8746 Sets the label for the given item.
8747 """
54f9ee45 8748 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
8749
8750 def FindString(*args, **kwargs):
15afbcd0 8751 """
a95a7133 8752 FindString(self, String s) -> int
15afbcd0
RD
8753
8754 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
8755 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
8756 found.
15afbcd0 8757 """
54f9ee45 8758 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce
RD
8759
8760 def Select(*args, **kwargs):
15afbcd0 8761 """
a95a7133 8762 Select(self, int n)
15afbcd0
RD
8763
8764 Sets the item at index 'n' to be the selected item.
8765 """
54f9ee45 8766 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 8767
15afbcd0 8768 SetSelection = Select
e811c8ce 8769 def GetSelection(*args, **kwargs):
15afbcd0 8770 """
a95a7133 8771 GetSelection(self) -> int
15afbcd0 8772
41e2b43e
RD
8773 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
8774 is selected.
15afbcd0 8775 """
54f9ee45 8776 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce
RD
8777
8778 def GetStringSelection(*args, **kwargs):
15afbcd0 8779 """
a95a7133 8780 GetStringSelection(self) -> String
15afbcd0 8781
41e2b43e
RD
8782 Returns the label of the selected item or an empty string if no item
8783 is selected.
15afbcd0 8784 """
54f9ee45 8785 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce
RD
8786
8787 def GetClientData(*args, **kwargs):
15afbcd0 8788 """
a95a7133 8789 GetClientData(self, int n) -> PyObject
15afbcd0
RD
8790
8791 Returns the client data associated with the given item, (if any.)
8792 """
54f9ee45 8793 return _core_.ItemContainer_GetClientData(*args, **kwargs)
e811c8ce
RD
8794
8795 def SetClientData(*args, **kwargs):
15afbcd0 8796 """
a95a7133 8797 SetClientData(self, int n, PyObject clientData)
15afbcd0
RD
8798
8799 Associate the given client data with the item at position n.
8800 """
54f9ee45 8801 return _core_.ItemContainer_SetClientData(*args, **kwargs)
e811c8ce 8802
d14a1e28
RD
8803
8804class ItemContainerPtr(ItemContainer):
8805 def __init__(self, this):
8806 self.this = this
8807 if not hasattr(self,"thisown"): self.thisown = 0
8808 self.__class__ = ItemContainer
54f9ee45 8809_core_.ItemContainer_swigregister(ItemContainerPtr)
d14a1e28
RD
8810
8811#---------------------------------------------------------------------------
8812
8813class ControlWithItems(Control,ItemContainer):
15afbcd0 8814 """
41e2b43e
RD
8815 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
8816 wx.Control class, and is used for the base class of various controls
8817 that have items.
15afbcd0 8818 """
d14a1e28
RD
8819 def __init__(self): raise RuntimeError, "No constructor defined"
8820 def __repr__(self):
8821 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8822
8823class ControlWithItemsPtr(ControlWithItems):
8824 def __init__(self, this):
8825 self.this = this
8826 if not hasattr(self,"thisown"): self.thisown = 0
8827 self.__class__ = ControlWithItems
54f9ee45 8828_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
d14a1e28
RD
8829
8830#---------------------------------------------------------------------------
8831
8832class SizerItem(Object):
248ed943
RD
8833 """
8834 The wx.SizerItem class is used to track the position, size and other
8835 attributes of each item managed by a `wx.Sizer`. In normal usage user
8836 code should never need to deal directly with a wx.SizerItem, but
8837 custom classes derived from `wx.PySizer` will probably need to use the
8838 collection of wx.SizerItems held by wx.Sizer when calculating layout.
8839
8840 :see: `wx.Sizer`, `wx.GBSizerItem`
8841 """
e811c8ce
RD
8842 def __repr__(self):
8843 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8844 def __init__(self, *args, **kwargs):
248ed943
RD
8845 """
8846 __init__(self) -> SizerItem
8847
8848 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
8849 size will need to be set before this item can be used in a Sizer.
8850
8851 You will probably never need to create a wx.SizerItem directly as they
8852 are created automatically when the sizer's Add, Insert or Prepend
8853 methods are called.
8854
8855 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
8856 """
54f9ee45 8857 newobj = _core_.new_SizerItem(*args, **kwargs)
d14a1e28
RD
8858 self.this = newobj.this
8859 self.thisown = 1
8860 del newobj.thisown
e811c8ce 8861 def DeleteWindows(*args, **kwargs):
248ed943
RD
8862 """
8863 DeleteWindows(self)
8864
8865 Destroy the window or the windows in a subsizer, depending on the type
8866 of item.
8867 """
54f9ee45 8868 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
8869
8870 def DetachSizer(*args, **kwargs):
248ed943
RD
8871 """
8872 DetachSizer(self)
8873
8874 Enable deleting the SizerItem without destroying the contained sizer.
8875 """
54f9ee45 8876 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
8877
8878 def GetSize(*args, **kwargs):
248ed943
RD
8879 """
8880 GetSize(self) -> Size
8881
8882 Get the current size of the item, as set in the last Layout.
8883 """
54f9ee45 8884 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
8885
8886 def CalcMin(*args, **kwargs):
248ed943
RD
8887 """
8888 CalcMin(self) -> Size
8889
8890 Calculates the minimum desired size for the item, including any space
8891 needed by borders.
8892 """
54f9ee45 8893 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
8894
8895 def SetDimension(*args, **kwargs):
248ed943
RD
8896 """
8897 SetDimension(self, Point pos, Size size)
8898
8899 Set the position and size of the space allocated for this item by the
8900 sizer, and adjust the position and size of the item (window or
8901 subsizer) to be within that space taking alignment and borders into
8902 account.
8903 """
54f9ee45 8904 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
8905
8906 def GetMinSize(*args, **kwargs):
248ed943
RD
8907 """
8908 GetMinSize(self) -> Size
8909
8910 Get the minimum size needed for the item.
8911 """
54f9ee45 8912 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 8913
dfbb5885
RD
8914 def GetMinSizeWithBorder(*args, **kwargs):
8915 """
8916 GetMinSizeWithBorder(self) -> Size
8917
8918 Get the minimum size needed for the item with space for the borders
8919 added, if needed.
8920 """
8921 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
8922
e811c8ce 8923 def SetInitSize(*args, **kwargs):
a95a7133 8924 """SetInitSize(self, int x, int y)"""
54f9ee45 8925 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
8926
8927 def SetRatioWH(*args, **kwargs):
248ed943
RD
8928 """
8929 SetRatioWH(self, int width, int height)
8930
8931 Set the ratio item attribute.
8932 """
54f9ee45 8933 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
8934
8935 def SetRatioSize(*args, **kwargs):
248ed943
RD
8936 """
8937 SetRatioSize(self, Size size)
8938
8939 Set the ratio item attribute.
8940 """
54f9ee45 8941 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
8942
8943 def SetRatio(*args, **kwargs):
248ed943
RD
8944 """
8945 SetRatio(self, float ratio)
8946
8947 Set the ratio item attribute.
8948 """
54f9ee45 8949 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
8950
8951 def GetRatio(*args, **kwargs):
248ed943
RD
8952 """
8953 GetRatio(self) -> float
8954
8955 Set the ratio item attribute.
8956 """
54f9ee45 8957 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 8958
d3b6e4ff
RD
8959 def GetRect(*args, **kwargs):
8960 """
8961 GetRect(self) -> Rect
8962
8963 Returns the rectangle that the sizer item should occupy
8964 """
8965 return _core_.SizerItem_GetRect(*args, **kwargs)
8966
e811c8ce 8967 def IsWindow(*args, **kwargs):
248ed943
RD
8968 """
8969 IsWindow(self) -> bool
8970
8971 Is this sizer item a window?
8972 """
54f9ee45 8973 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
8974
8975 def IsSizer(*args, **kwargs):
248ed943
RD
8976 """
8977 IsSizer(self) -> bool
8978
8979 Is this sizer item a subsizer?
8980 """
54f9ee45 8981 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
8982
8983 def IsSpacer(*args, **kwargs):
248ed943
RD
8984 """
8985 IsSpacer(self) -> bool
8986
8987 Is this sizer item a spacer?
8988 """
54f9ee45 8989 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
8990
8991 def SetProportion(*args, **kwargs):
248ed943
RD
8992 """
8993 SetProportion(self, int proportion)
8994
8995 Set the proportion value for this item.
8996 """
54f9ee45 8997 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
8998
8999 def GetProportion(*args, **kwargs):
248ed943
RD
9000 """
9001 GetProportion(self) -> int
9002
9003 Get the proportion value for this item.
9004 """
54f9ee45 9005 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 9006
248ed943
RD
9007 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
9008 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 9009 def SetFlag(*args, **kwargs):
248ed943
RD
9010 """
9011 SetFlag(self, int flag)
9012
9013 Set the flag value for this item.
9014 """
54f9ee45 9015 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
9016
9017 def GetFlag(*args, **kwargs):
248ed943
RD
9018 """
9019 GetFlag(self) -> int
9020
9021 Get the flag value for this item.
9022 """
54f9ee45 9023 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
9024
9025 def SetBorder(*args, **kwargs):
248ed943
RD
9026 """
9027 SetBorder(self, int border)
9028
9029 Set the border value for this item.
9030 """
54f9ee45 9031 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
9032
9033 def GetBorder(*args, **kwargs):
248ed943
RD
9034 """
9035 GetBorder(self) -> int
9036
9037 Get the border value for this item.
9038 """
54f9ee45 9039 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
9040
9041 def GetWindow(*args, **kwargs):
248ed943
RD
9042 """
9043 GetWindow(self) -> Window
9044
9045 Get the window (if any) that is managed by this sizer item.
9046 """
54f9ee45 9047 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce
RD
9048
9049 def SetWindow(*args, **kwargs):
248ed943
RD
9050 """
9051 SetWindow(self, Window window)
9052
9053 Set the window to be managed by this sizer item.
9054 """
54f9ee45 9055 return _core_.SizerItem_SetWindow(*args, **kwargs)
e811c8ce
RD
9056
9057 def GetSizer(*args, **kwargs):
248ed943
RD
9058 """
9059 GetSizer(self) -> Sizer
9060
9061 Get the subsizer (if any) that is managed by this sizer item.
9062 """
54f9ee45 9063 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce
RD
9064
9065 def SetSizer(*args, **kwargs):
248ed943
RD
9066 """
9067 SetSizer(self, Sizer sizer)
9068
9069 Set the subsizer to be managed by this sizer item.
9070 """
54f9ee45 9071 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce
RD
9072
9073 def GetSpacer(*args, **kwargs):
248ed943
RD
9074 """
9075 GetSpacer(self) -> Size
9076
9077 Get the size of the spacer managed by this sizer item.
9078 """
54f9ee45 9079 return _core_.SizerItem_GetSpacer(*args, **kwargs)
e811c8ce
RD
9080
9081 def SetSpacer(*args, **kwargs):
248ed943
RD
9082 """
9083 SetSpacer(self, Size size)
9084
9085 Set the size of the spacer to be managed by this sizer item.
9086 """
54f9ee45 9087 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce
RD
9088
9089 def Show(*args, **kwargs):
248ed943
RD
9090 """
9091 Show(self, bool show)
9092
9093 Set the show item attribute, which sizers use to determine if the item
9094 is to be made part of the layout or not. If the item is tracking a
9095 window then it is shown or hidden as needed.
9096 """
54f9ee45 9097 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
9098
9099 def IsShown(*args, **kwargs):
248ed943
RD
9100 """
9101 IsShown(self) -> bool
9102
9103 Is the item to be shown in the layout?
9104 """
54f9ee45 9105 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
9106
9107 def GetPosition(*args, **kwargs):
248ed943
RD
9108 """
9109 GetPosition(self) -> Point
9110
9111 Returns the current position of the item, as set in the last Layout.
9112 """
54f9ee45 9113 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
9114
9115 def GetUserData(*args, **kwargs):
248ed943
RD
9116 """
9117 GetUserData(self) -> PyObject
9118
9119 Returns the userData associated with this sizer item, or None if there
9120 isn't any.
9121 """
54f9ee45 9122 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 9123
d14a1e28
RD
9124
9125class SizerItemPtr(SizerItem):
9126 def __init__(self, this):
9127 self.this = this
9128 if not hasattr(self,"thisown"): self.thisown = 0
9129 self.__class__ = SizerItem
54f9ee45 9130_core_.SizerItem_swigregister(SizerItemPtr)
d14a1e28 9131
248ed943 9132def SizerItemWindow(*args, **kwargs):
0df68c9f 9133 """
248ed943
RD
9134 SizerItemWindow(Window window, int proportion, int flag, int border,
9135 PyObject userData=None) -> SizerItem
9136
9137 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 9138 """
248ed943 9139 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
9140 val.thisown = 1
9141 return val
9142
248ed943 9143def SizerItemSpacer(*args, **kwargs):
0df68c9f 9144 """
248ed943
RD
9145 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
9146 PyObject userData=None) -> SizerItem
9147
9148 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 9149 """
248ed943 9150 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
9151 val.thisown = 1
9152 return val
9153
9154def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
9155 """
9156 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
9157 PyObject userData=None) -> SizerItem
9158
9159 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 9160 """
54f9ee45 9161 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
9162 val.thisown = 1
9163 return val
9164
9165class Sizer(Object):
248ed943
RD
9166 """
9167 wx.Sizer is the abstract base class used for laying out subwindows in
9168 a window. You cannot use wx.Sizer directly; instead, you will have to
9169 use one of the sizer classes derived from it such as `wx.BoxSizer`,
9170 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
9171 and `wx.GridBagSizer`.
9172
9173 The concept implemented by sizers in wxWidgets is closely related to
9174 layout tools in other GUI toolkits, such as Java's AWT, the GTK
9175 toolkit or the Qt toolkit. It is based upon the idea of the individual
9176 subwindows reporting their minimal required size and their ability to
9177 get stretched if the size of the parent window has changed. This will
9178 most often mean that the programmer does not set the original size of
9179 a dialog in the beginning, rather the dialog will assigned a sizer and
9180 this sizer will be queried about the recommended size. The sizer in
9181 turn will query its children, which can be normal windows or contorls,
9182 empty space or other sizers, so that a hierarchy of sizers can be
9183 constructed. Note that wxSizer does not derive from wxWindow and thus
9184 do not interfere with tab ordering and requires very little resources
9185 compared to a real window on screen.
9186
9187 What makes sizers so well fitted for use in wxWidgets is the fact that
9188 every control reports its own minimal size and the algorithm can
9189 handle differences in font sizes or different window (dialog item)
9190 sizes on different platforms without problems. If for example the
9191 standard font as well as the overall design of Mac widgets requires
9192 more space than on Windows, then the initial size of a dialog using a
9193 sizer will automatically be bigger on Mac than on Windows.
9194 """
e811c8ce
RD
9195 def __init__(self): raise RuntimeError, "No constructor defined"
9196 def __repr__(self):
9197 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9198 def _setOORInfo(*args, **kwargs):
a95a7133 9199 """_setOORInfo(self, PyObject _self)"""
54f9ee45 9200 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
9201
9202 def Add(*args, **kwargs):
0df68c9f 9203 """
248ed943 9204 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 9205 PyObject userData=None) -> wx.SizerItem
248ed943
RD
9206
9207 Appends a child item to the sizer.
0df68c9f 9208 """
54f9ee45 9209 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce
RD
9210
9211 def Insert(*args, **kwargs):
0df68c9f 9212 """
248ed943 9213 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 9214 PyObject userData=None) -> wx.SizerItem
248ed943
RD
9215
9216 Inserts a new item into the list of items managed by this sizer before
9217 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 9218 """
54f9ee45 9219 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce
RD
9220
9221 def Prepend(*args, **kwargs):
0df68c9f 9222 """
248ed943 9223 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 9224 PyObject userData=None) -> wx.SizerItem
248ed943
RD
9225
9226 Adds a new item to the begining of the list of sizer items managed by
9227 this sizer. See `Add` for a description of the parameters.
0df68c9f 9228 """
54f9ee45 9229 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce
RD
9230
9231 def Remove(*args, **kwargs):
248ed943
RD
9232 """
9233 Remove(self, item) -> bool
9234
9235 Removes an item from the sizer and destroys it. This method does not
9236 cause any layout or resizing to take place, call `Layout` to update
9237 the layout on screen after removing a child from the sizer. The
9238 *item* parameter can be either a window, a sizer, or the zero-based
9239 index of an item to remove. Returns True if the child item was found
9240 and removed.
9241 """
54f9ee45 9242 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 9243
1c0f361b 9244 def Detach(*args, **kwargs):
248ed943
RD
9245 """
9246 Detach(self, item) -> bool
9247
9248 Detaches an item from the sizer without destroying it. This method
9249 does not cause any layout or resizing to take place, call `Layout` to
9250 do so. The *item* parameter can be either a window, a sizer, or the
9251 zero-based index of the item to be detached. Returns True if the child item
9252 was found and detached.
9253 """
1c0f361b
RD
9254 return _core_.Sizer_Detach(*args, **kwargs)
9255
d3b6e4ff
RD
9256 def GetItem(*args, **kwargs):
9257 """
9258 GetItem(self, item) -> wx.SizerItem
9259
9260 Returns the `wx.SizerItem` which holds the *item* given. The *item*
9261 parameter can be either a window, a sizer, or the zero-based index of
9262 the item to be detached.
9263 """
9264 return _core_.Sizer_GetItem(*args, **kwargs)
9265
e811c8ce 9266 def _SetItemMinSize(*args, **kwargs):
a95a7133 9267 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 9268 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 9269
248ed943
RD
9270 def SetItemMinSize(self, item, *args):
9271 """
9272 SetItemMinSize(self, item, Size size)
9273
9274 Sets the minimum size that will be allocated for an item in the sizer.
9275 The *item* parameter can be either a window, a sizer, or the
9276 zero-based index of the item. If a window or sizer is given then it
9277 will be searched for recursivly in subsizers if neccessary.
9278 """
9279 if len(args) == 2:
9280 # for backward compatibility accept separate width,height args too
9281 return self._SetItemMinSize(item, args)
9282 else:
9283 return self._SetItemMinSize(item, args[0])
9284
e811c8ce 9285 def AddItem(*args, **kwargs):
248ed943
RD
9286 """
9287 AddItem(self, SizerItem item)
9288
9289 Adds a `wx.SizerItem` to the sizer.
9290 """
54f9ee45 9291 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
9292
9293 def InsertItem(*args, **kwargs):
248ed943
RD
9294 """
9295 InsertItem(self, int index, SizerItem item)
9296
9297 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
9298 """
54f9ee45 9299 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
9300
9301 def PrependItem(*args, **kwargs):
248ed943
RD
9302 """
9303 PrependItem(self, SizerItem item)
9304
9305 Prepends a `wx.SizerItem` to the sizer.
9306 """
54f9ee45 9307 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 9308
248ed943 9309 def AddMany(self, items):
66c033b4
RD
9310 """
9311 AddMany is a convenience method for adding several items
9312 to a sizer at one time. Simply pass it a list of tuples,
9313 where each tuple consists of the parameters that you
9314 would normally pass to the `Add` method.
9315 """
248ed943
RD
9316 for item in items:
9317 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
9318 item = (item, )
9319 self.Add(*item)
d14a1e28 9320
74e96f3d 9321 # for backwards compatibility only, please do not use in new code
66c033b4
RD
9322 AddWindow = wx._deprecated(Add, "AddWindow is deprecated, use `Add` instead.")
9323 AddSizer = wx._deprecated(Add, "AddSizer is deprecated, use `Add` instead.")
9324 AddSpacer = wx._deprecated(Add, "AddSpacer is deprecated, use `Add` instead.")
9325 PrependWindow = wx._deprecated(Prepend, "PrependWindow is deprecated, use `Prepend` instead.")
9326 PrependSizer = wx._deprecated(Prepend, "PrependSizer is deprecated, use `Prepend` instead.")
9327 PrependSpacer = wx._deprecated(Prepend, "PrependSpacer is deprecated, use `Prepend` instead.")
9328 InsertWindow = wx._deprecated(Insert, "InsertWindow is deprecated, use `Insert` instead.")
9329 InsertSizer = wx._deprecated(Insert, "InsertSizer is deprecated, use `Insert` instead.")
9330 InsertSpacer = wx._deprecated(Insert, "InsertSpacer is deprecated, use `Insert` instead.")
9331 RemoveWindow = wx._deprecated(Remove, "RemoveWindow is deprecated, use `Remove` instead.")
9332 RemoveSizer = wx._deprecated(Remove, "RemoveSizer is deprecated, use `Remove` instead.")
9333 RemovePos = wx._deprecated(Remove, "RemovePos is deprecated, use `Remove` instead.")
d14a1e28
RD
9334
9335
e811c8ce 9336 def SetDimension(*args, **kwargs):
248ed943
RD
9337 """
9338 SetDimension(self, int x, int y, int width, int height)
9339
9340 Call this to force the sizer to take the given dimension and thus
9341 force the items owned by the sizer to resize themselves according to
9342 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
9343 methods.
9344 """
54f9ee45 9345 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
9346
9347 def SetMinSize(*args, **kwargs):
248ed943
RD
9348 """
9349 SetMinSize(self, Size size)
9350
9351 Call this to give the sizer a minimal size. Normally, the sizer will
9352 calculate its minimal size based purely on how much space its children
9353 need. After calling this method `GetMinSize` will return either the
9354 minimal size as requested by its children or the minimal size set
9355 here, depending on which is bigger.
9356 """
54f9ee45 9357 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
9358
9359 def GetSize(*args, **kwargs):
248ed943
RD
9360 """
9361 GetSize(self) -> Size
9362
9363 Returns the current size of the space managed by the sizer.
9364 """
54f9ee45 9365 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
9366
9367 def GetPosition(*args, **kwargs):
248ed943
RD
9368 """
9369 GetPosition(self) -> Point
9370
9371 Returns the current position of the sizer's managed space.
9372 """
54f9ee45 9373 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
9374
9375 def GetMinSize(*args, **kwargs):
248ed943
RD
9376 """
9377 GetMinSize(self) -> Size
9378
9379 Returns the minimal size of the sizer. This is either the combined
9380 minimal size of all the children and their borders or the minimal size
9381 set by SetMinSize, depending on which is bigger.
9382 """
54f9ee45 9383 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 9384
d14a1e28 9385 def GetSizeTuple(self):
1c0f361b 9386 return self.GetSize().Get()
d14a1e28 9387 def GetPositionTuple(self):
1c0f361b 9388 return self.GetPosition().Get()
d14a1e28 9389 def GetMinSizeTuple(self):
1c0f361b 9390 return self.GetMinSize().Get()
d14a1e28 9391
e811c8ce 9392 def RecalcSizes(*args, **kwargs):
248ed943
RD
9393 """
9394 RecalcSizes(self)
9395
9396 Using the sizes calculated by `CalcMin` reposition and resize all the
9397 items managed by this sizer. You should not need to call this directly as
9398 it is called by `Layout`.
9399 """
54f9ee45 9400 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
9401
9402 def CalcMin(*args, **kwargs):
248ed943
RD
9403 """
9404 CalcMin(self) -> Size
9405
9406 This method is where the sizer will do the actual calculation of its
9407 children's minimal sizes. You should not need to call this directly as
9408 it is called by `Layout`.
9409 """
54f9ee45 9410 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
9411
9412 def Layout(*args, **kwargs):
248ed943
RD
9413 """
9414 Layout(self)
9415
9416 This method will force the recalculation and layout of the items
9417 controlled by the sizer using the current space allocated to the
9418 sizer. Normally this is called automatically from the owning window's
9419 EVT_SIZE handler, but it is also useful to call it from user code when
9420 one of the items in a sizer change size, or items are added or
9421 removed.
9422 """
54f9ee45 9423 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
9424
9425 def Fit(*args, **kwargs):
248ed943
RD
9426 """
9427 Fit(self, Window window) -> Size
9428
9429 Tell the sizer to resize the *window* to match the sizer's minimal
9430 size. This is commonly done in the constructor of the window itself in
9431 order to set its initial size to match the needs of the children as
9432 determined by the sizer. Returns the new size.
9433
9434 For a top level window this is the total window size, not the client size.
9435 """
54f9ee45 9436 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
9437
9438 def FitInside(*args, **kwargs):
248ed943
RD
9439 """
9440 FitInside(self, Window window)
9441
9442 Tell the sizer to resize the *virtual size* of the *window* to match the
9443 sizer's minimal size. This will not alter the on screen size of the
9444 window, but may cause the addition/removal/alteration of scrollbars
9445 required to view the virtual area in windows which manage it.
9446
9447 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9448
9449 """
54f9ee45 9450 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
9451
9452 def SetSizeHints(*args, **kwargs):
248ed943
RD
9453 """
9454 SetSizeHints(self, Window window)
9455
9456 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9457 match the sizer's minimal size. This is commonly done in the
9458 constructor of the window itself if the window is resizable (as are
9459 many dialogs under Unix and frames on probably all platforms) in order
9460 to prevent the window from being sized smaller than the minimal size
9461 required by the sizer.
9462 """
54f9ee45 9463 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
9464
9465 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
9466 """
9467 SetVirtualSizeHints(self, Window window)
9468
9469 Tell the sizer to set the minimal size of the window virtual area to
9470 match the sizer's minimal size. For windows with managed scrollbars
9471 this will set them appropriately.
9472
9473 :see: `wx.ScrolledWindow.SetScrollbars`
9474
9475 """
54f9ee45 9476 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
9477
9478 def Clear(*args, **kwargs):
248ed943
RD
9479 """
9480 Clear(self, bool deleteWindows=False)
9481
9482 Clear all items from the sizer, optionally destroying the window items
9483 as well.
9484 """
54f9ee45 9485 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
9486
9487 def DeleteWindows(*args, **kwargs):
248ed943
RD
9488 """
9489 DeleteWindows(self)
9490
9491 Destroy all windows managed by the sizer.
9492 """
54f9ee45 9493 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
9494
9495 def GetChildren(*args, **kwargs):
248ed943
RD
9496 """
9497 GetChildren(sefl) -> list
9498
9499 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9500 """
54f9ee45 9501 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
9502
9503 def Show(*args, **kwargs):
248ed943 9504 """
ae8162c8 9505 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 9506
248ed943
RD
9507 Shows or hides an item managed by the sizer. To make a sizer item
9508 disappear or reappear, use Show followed by `Layout`. The *item*
9509 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
9510 the item. Use the recursive parameter to show or hide an item in a
9511 subsizer. Returns True if the item was found.
248ed943
RD
9512 """
9513 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
9514
9515 def IsShown(*args, **kwargs):
248ed943
RD
9516 """
9517 IsShown(self, item)
9518
9519 Determines if the item is currently shown. sizer. To make a sizer
9520 item disappear or reappear, use Show followed by `Layout`. The *item*
9521 parameter can be either a window, a sizer, or the zero-based index of
9522 the item.
9523 """
54f9ee45 9524 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 9525
7e63a440 9526 def Hide(self, item, recursive=False):
248ed943 9527 """
7e63a440 9528 A convenience method for Show(item, False, recursive).
248ed943 9529 """
06759a38 9530 return self.Show(item, False, recursive)
248ed943 9531
e811c8ce 9532 def ShowItems(*args, **kwargs):
248ed943
RD
9533 """
9534 ShowItems(self, bool show)
9535
84f85550 9536 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 9537 """
54f9ee45 9538 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 9539
d14a1e28
RD
9540
9541class SizerPtr(Sizer):
9542 def __init__(self, this):
9543 self.this = this
9544 if not hasattr(self,"thisown"): self.thisown = 0
9545 self.__class__ = Sizer
54f9ee45 9546_core_.Sizer_swigregister(SizerPtr)
d14a1e28
RD
9547
9548class PySizer(Sizer):
248ed943
RD
9549 """
9550 wx.PySizer is a special version of `wx.Sizer` that has been
9551 instrumented to allow the C++ virtual methods to be overloaded in
9552 Python derived classes. You would derive from this class if you are
9553 wanting to implement a custom sizer in Python code. Simply implement
9554 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
9555 For example::
9556
9557 class MySizer(wx.PySizer):
9558 def __init__(self):
9559 wx.PySizer.__init__(self)
9560
9561 def CalcMin(self):
9562 for item in self.GetChildren():
9563 # calculate the total minimum width and height needed
9564 # by all items in the sizer according to this sizer's
9565 # layout algorithm.
9566 ...
9567 return wx.Size(width, height)
9568
9569 def RecalcSizes(self):
9570 # find the space allotted to this sizer
9571 pos = self.GetPosition()
9572 size = self.GetSize()
9573 for item in self.GetChildren():
9574 # Recalculate (if necessary) the position and size of
9575 # each item and then call item.SetDimension to do the
9576 # actual positioning and sizing of the items within the
9577 # space alloted to this sizer.
9578 ...
9579 item.SetDimension(itemPos, itemSize)
9580
9581
9582 When `Layout` is called it first calls `CalcMin` followed by
9583 `RecalcSizes` so you can optimize a bit by saving the results of
9584 `CalcMin` and resuing them in `RecalcSizes`.
9585
9586 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
9587
9588
9589 """
e811c8ce
RD
9590 def __repr__(self):
9591 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9592 def __init__(self, *args, **kwargs):
248ed943
RD
9593 """
9594 __init__(self) -> PySizer
9595
9596 Creates a wx.PySizer. Must be called from the __init__ in the derived
9597 class.
9598 """
54f9ee45 9599 newobj = _core_.new_PySizer(*args, **kwargs)
d14a1e28
RD
9600 self.this = newobj.this
9601 self.thisown = 1
9602 del newobj.thisown
9603 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
e811c8ce
RD
9604
9605 def _setCallbackInfo(*args, **kwargs):
a95a7133 9606 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 9607 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 9608
d14a1e28
RD
9609
9610class PySizerPtr(PySizer):
9611 def __init__(self, this):
9612 self.this = this
9613 if not hasattr(self,"thisown"): self.thisown = 0
9614 self.__class__ = PySizer
54f9ee45 9615_core_.PySizer_swigregister(PySizerPtr)
d14a1e28
RD
9616
9617#---------------------------------------------------------------------------
9618
9619class BoxSizer(Sizer):
248ed943
RD
9620 """
9621 The basic idea behind a box sizer is that windows will most often be
9622 laid out in rather simple basic geometry, typically in a row or a
9623 column or nested hierarchies of either. A wx.BoxSizer will lay out
9624 its items in a simple row or column, depending on the orientation
9625 parameter passed to the constructor.
9626 """
e811c8ce
RD
9627 def __repr__(self):
9628 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9629 def __init__(self, *args, **kwargs):
248ed943
RD
9630 """
9631 __init__(self, int orient=HORIZONTAL) -> BoxSizer
9632
9633 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
9634 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
9635 sizer.
9636 """
54f9ee45 9637 newobj = _core_.new_BoxSizer(*args, **kwargs)
d14a1e28
RD
9638 self.this = newobj.this
9639 self.thisown = 1
9640 del newobj.thisown
9641 self._setOORInfo(self)
e811c8ce
RD
9642
9643 def GetOrientation(*args, **kwargs):
248ed943
RD
9644 """
9645 GetOrientation(self) -> int
9646
9647 Returns the current orientation of the sizer.
9648 """
54f9ee45 9649 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
9650
9651 def SetOrientation(*args, **kwargs):
248ed943
RD
9652 """
9653 SetOrientation(self, int orient)
e811c8ce 9654
248ed943
RD
9655 Resets the orientation of the sizer.
9656 """
9657 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 9658
d14a1e28
RD
9659
9660class BoxSizerPtr(BoxSizer):
9661 def __init__(self, this):
9662 self.this = this
9663 if not hasattr(self,"thisown"): self.thisown = 0
9664 self.__class__ = BoxSizer
54f9ee45 9665_core_.BoxSizer_swigregister(BoxSizerPtr)
d14a1e28
RD
9666
9667#---------------------------------------------------------------------------
9668
9669class StaticBoxSizer(BoxSizer):
248ed943
RD
9670 """
9671 wx.StaticBoxSizer derives from and functions identically to the
9672 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
9673 manages. Note that this static box must be created separately and
9674 passed to the sizer constructor.
9675 """
e811c8ce
RD
9676 def __repr__(self):
9677 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9678 def __init__(self, *args, **kwargs):
248ed943
RD
9679 """
9680 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
9681
9682 Constructor. It takes an associated static box and the orientation
9683 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
9684 ``wx.HORIZONTAL``.
9685 """
54f9ee45 9686 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
d14a1e28
RD
9687 self.this = newobj.this
9688 self.thisown = 1
9689 del newobj.thisown
9690 self._setOORInfo(self)
e811c8ce
RD
9691
9692 def GetStaticBox(*args, **kwargs):
248ed943
RD
9693 """
9694 GetStaticBox(self) -> StaticBox
e811c8ce 9695
248ed943
RD
9696 Returns the static box associated with this sizer.
9697 """
9698 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 9699
d14a1e28
RD
9700
9701class StaticBoxSizerPtr(StaticBoxSizer):
9702 def __init__(self, this):
9703 self.this = this
9704 if not hasattr(self,"thisown"): self.thisown = 0
9705 self.__class__ = StaticBoxSizer
54f9ee45 9706_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
d14a1e28
RD
9707
9708#---------------------------------------------------------------------------
9709
9710class GridSizer(Sizer):
248ed943
RD
9711 """
9712 A grid sizer is a sizer which lays out its children in a
9713 two-dimensional table with all cells having the same size. In other
9714 words, the width of each cell within the grid is the width of the
9715 widest item added to the sizer and the height of each grid cell is the
9716 height of the tallest item. An optional vertical and/or horizontal
9717 gap between items can also be specified (in pixels.)
9718
9719 Items are placed in the cells of the grid in the order they are added,
9720 in row-major order. In other words, the first row is filled first,
9721 then the second, and so on until all items have been added. (If
9722 neccessary, additional rows will be added as items are added.) If you
9723 need to have greater control over the cells that items are placed in
9724 then use the `wx.GridBagSizer`.
9725
9726 """
e811c8ce
RD
9727 def __repr__(self):
9728 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9729 def __init__(self, *args, **kwargs):
248ed943
RD
9730 """
9731 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
9732
9733 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
9734 of columns and rows in the sizer - if either of the parameters is
9735 zero, it will be calculated to from the total number of children in
9736 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9737 define extra space between all children.
9738 """
54f9ee45 9739 newobj = _core_.new_GridSizer(*args, **kwargs)
d14a1e28
RD
9740 self.this = newobj.this
9741 self.thisown = 1
9742 del newobj.thisown
9743 self._setOORInfo(self)
e811c8ce 9744
e811c8ce 9745 def SetCols(*args, **kwargs):
248ed943
RD
9746 """
9747 SetCols(self, int cols)
9748
9749 Sets the number of columns in the sizer.
9750 """
54f9ee45 9751 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
9752
9753 def SetRows(*args, **kwargs):
248ed943
RD
9754 """
9755 SetRows(self, int rows)
9756
9757 Sets the number of rows in the sizer.
9758 """
54f9ee45 9759 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
9760
9761 def SetVGap(*args, **kwargs):
248ed943
RD
9762 """
9763 SetVGap(self, int gap)
9764
9765 Sets the vertical gap (in pixels) between the cells in the sizer.
9766 """
54f9ee45 9767 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
9768
9769 def SetHGap(*args, **kwargs):
248ed943
RD
9770 """
9771 SetHGap(self, int gap)
9772
9773 Sets the horizontal gap (in pixels) between cells in the sizer
9774 """
54f9ee45 9775 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
9776
9777 def GetCols(*args, **kwargs):
248ed943
RD
9778 """
9779 GetCols(self) -> int
9780
9781 Returns the number of columns in the sizer.
9782 """
54f9ee45 9783 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
9784
9785 def GetRows(*args, **kwargs):
248ed943
RD
9786 """
9787 GetRows(self) -> int
9788
9789 Returns the number of rows in the sizer.
9790 """
54f9ee45 9791 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
9792
9793 def GetVGap(*args, **kwargs):
248ed943
RD
9794 """
9795 GetVGap(self) -> int
9796
9797 Returns the vertical gap (in pixels) between the cells in the sizer.
9798 """
54f9ee45 9799 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
9800
9801 def GetHGap(*args, **kwargs):
248ed943
RD
9802 """
9803 GetHGap(self) -> int
9804
9805 Returns the horizontal gap (in pixels) between cells in the sizer.
9806 """
54f9ee45 9807 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 9808
d14a1e28
RD
9809
9810class GridSizerPtr(GridSizer):
9811 def __init__(self, this):
9812 self.this = this
9813 if not hasattr(self,"thisown"): self.thisown = 0
9814 self.__class__ = GridSizer
54f9ee45 9815_core_.GridSizer_swigregister(GridSizerPtr)
d14a1e28
RD
9816
9817#---------------------------------------------------------------------------
9818
54f9ee45
RD
9819FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
9820FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
9821FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 9822class FlexGridSizer(GridSizer):
248ed943
RD
9823 """
9824 A flex grid sizer is a sizer which lays out its children in a
9825 two-dimensional table with all table cells in one row having the same
9826 height and all cells in one column having the same width, but all
9827 rows or all columns are not necessarily the same height or width as in
9828 the `wx.GridSizer`.
9829
9830 wx.FlexGridSizer can also size items equally in one direction but
9831 unequally ("flexibly") in the other. If the sizer is only flexible
9832 in one direction (this can be changed using `SetFlexibleDirection`), it
9833 needs to be decided how the sizer should grow in the other ("non
9834 flexible") direction in order to fill the available space. The
9835 `SetNonFlexibleGrowMode` method serves this purpose.
9836
9837
9838 """
e811c8ce
RD
9839 def __repr__(self):
9840 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9841 def __init__(self, *args, **kwargs):
248ed943
RD
9842 """
9843 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
9844
9845 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
9846 number of columns and rows in the sizer - if either of the parameters
9847 is zero, it will be calculated to from the total number of children in
9848 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9849 define extra space between all children.
9850 """
54f9ee45 9851 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
d14a1e28
RD
9852 self.this = newobj.this
9853 self.thisown = 1
9854 del newobj.thisown
9855 self._setOORInfo(self)
e811c8ce 9856
248ed943
RD
9857 def AddGrowableRow(*args, **kwargs):
9858 """
9859 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 9860
248ed943
RD
9861 Specifies that row *idx* (starting from zero) should be grown if there
9862 is extra space available to the sizer.
e811c8ce 9863
248ed943
RD
9864 The *proportion* parameter has the same meaning as the stretch factor
9865 for the box sizers except that if all proportions are 0, then all
9866 columns are resized equally (instead of not being resized at all).
9867 """
54f9ee45 9868 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
9869
9870 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
9871 """
9872 RemoveGrowableRow(self, size_t idx)
9873
9874 Specifies that row *idx* is no longer growable.
9875 """
54f9ee45 9876 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
9877
9878 def AddGrowableCol(*args, **kwargs):
248ed943
RD
9879 """
9880 AddGrowableCol(self, size_t idx, int proportion=0)
9881
9882 Specifies that column *idx* (starting from zero) should be grown if
9883 there is extra space available to the sizer.
9884
9885 The *proportion* parameter has the same meaning as the stretch factor
9886 for the box sizers except that if all proportions are 0, then all
9887 columns are resized equally (instead of not being resized at all).
9888 """
54f9ee45 9889 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
9890
9891 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
9892 """
9893 RemoveGrowableCol(self, size_t idx)
9894
9895 Specifies that column *idx* is no longer growable.
9896 """
54f9ee45 9897 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
9898
9899 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
9900 """
9901 SetFlexibleDirection(self, int direction)
9902
9903 Specifies whether the sizer should flexibly resize its columns, rows,
9904 or both. Argument *direction* can be one of the following values. Any
9905 other value is ignored.
9906
9907 ============== =======================================
9908 wx.VERTICAL Rows are flexibly sized.
9909 wx.HORIZONTAL Columns are flexibly sized.
9910 wx.BOTH Both rows and columns are flexibly sized
9911 (this is the default value).
9912 ============== =======================================
9913
9914 Note that this method does not trigger relayout.
9915
9916 """
54f9ee45 9917 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
9918
9919 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
9920 """
9921 GetFlexibleDirection(self) -> int
9922
9923 Returns a value that specifies whether the sizer
9924 flexibly resizes its columns, rows, or both (default).
9925
9926 :see: `SetFlexibleDirection`
9927 """
54f9ee45 9928 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
9929
9930 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
9931 """
9932 SetNonFlexibleGrowMode(self, int mode)
9933
9934 Specifies how the sizer should grow in the non-flexible direction if
9935 there is one (so `SetFlexibleDirection` must have been called
9936 previously). Argument *mode* can be one of the following values:
9937
9938 ========================== =================================================
9939 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
9940 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
9941 `AddGrowableCol` and `AddGrowableRow`. In this
9942 case equal sizing applies to minimum sizes of
9943 columns or rows (this is the default value).
9944 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
9945 the non flexible direction, whether they are
9946 growable or not in the flexbile direction.
9947 ========================== =================================================
9948
9949 Note that this method does not trigger relayout.
9950
9951
9952 """
54f9ee45 9953 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
9954
9955 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
9956 """
9957 GetNonFlexibleGrowMode(self) -> int
9958
9959 Returns the value that specifies how the sizer grows in the
9960 non-flexible direction if there is one.
9961
9962 :see: `SetNonFlexibleGrowMode`
9963 """
54f9ee45 9964 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
9965
9966 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
9967 """
9968 GetRowHeights(self) -> list
9969
9970 Returns a list of integers representing the heights of each of the
9971 rows in the sizer.
9972 """
54f9ee45 9973 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
9974
9975 def GetColWidths(*args, **kwargs):
fd2dc343
RD
9976 """
9977 GetColWidths(self) -> list
9978
9979 Returns a list of integers representing the widths of each of the
9980 columns in the sizer.
9981 """
54f9ee45 9982 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 9983
d14a1e28
RD
9984
9985class FlexGridSizerPtr(FlexGridSizer):
9986 def __init__(self, this):
9987 self.this = this
9988 if not hasattr(self,"thisown"): self.thisown = 0
9989 self.__class__ = FlexGridSizer
54f9ee45 9990_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
d14a1e28
RD
9991
9992#---------------------------------------------------------------------------
9993
9994class GBPosition(object):
248ed943
RD
9995 """
9996 This class represents the position of an item in a virtual grid of
9997 rows and columns managed by a `wx.GridBagSizer`. wxPython has
9998 typemaps that will automatically convert from a 2-element sequence of
9999 integers to a wx.GBPosition, so you can use the more pythonic
10000 representation of the position nearly transparently in Python code.
10001 """
e811c8ce
RD
10002 def __repr__(self):
10003 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10004 def __init__(self, *args, **kwargs):
248ed943
RD
10005 """
10006 __init__(self, int row=0, int col=0) -> GBPosition
10007
10008 This class represents the position of an item in a virtual grid of
10009 rows and columns managed by a `wx.GridBagSizer`. wxPython has
10010 typemaps that will automatically convert from a 2-element sequence of
10011 integers to a wx.GBPosition, so you can use the more pythonic
10012 representation of the position nearly transparently in Python code.
10013 """
54f9ee45 10014 newobj = _core_.new_GBPosition(*args, **kwargs)
d14a1e28
RD
10015 self.this = newobj.this
10016 self.thisown = 1
10017 del newobj.thisown
e811c8ce 10018 def GetRow(*args, **kwargs):
a95a7133 10019 """GetRow(self) -> int"""
54f9ee45 10020 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
10021
10022 def GetCol(*args, **kwargs):
a95a7133 10023 """GetCol(self) -> int"""
54f9ee45 10024 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
10025
10026 def SetRow(*args, **kwargs):
a95a7133 10027 """SetRow(self, int row)"""
54f9ee45 10028 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
10029
10030 def SetCol(*args, **kwargs):
a95a7133 10031 """SetCol(self, int col)"""
54f9ee45 10032 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
10033
10034 def __eq__(*args, **kwargs):
a95a7133 10035 """__eq__(self, GBPosition other) -> bool"""
54f9ee45 10036 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
10037
10038 def __ne__(*args, **kwargs):
a95a7133 10039 """__ne__(self, GBPosition other) -> bool"""
54f9ee45 10040 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
10041
10042 def Set(*args, **kwargs):
a95a7133 10043 """Set(self, int row=0, int col=0)"""
54f9ee45 10044 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
10045
10046 def Get(*args, **kwargs):
a95a7133 10047 """Get(self) -> PyObject"""
54f9ee45 10048 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 10049
41e2b43e 10050 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
10051 def __str__(self): return str(self.Get())
10052 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
10053 def __len__(self): return len(self.Get())
10054 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
10055 def __setitem__(self, index, val):
10056 if index == 0: self.SetRow(val)
10057 elif index == 1: self.SetCol(val)
10058 else: raise IndexError
e811c8ce 10059 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
10060 __safe_for_unpickling__ = True
10061 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
10062
10063 row = property(GetRow, SetRow)
10064 col = property(GetCol, SetCol)
10065
10066
10067class GBPositionPtr(GBPosition):
10068 def __init__(self, this):
10069 self.this = this
10070 if not hasattr(self,"thisown"): self.thisown = 0
10071 self.__class__ = GBPosition
54f9ee45 10072_core_.GBPosition_swigregister(GBPositionPtr)
d14a1e28
RD
10073
10074class GBSpan(object):
248ed943
RD
10075 """
10076 This class is used to hold the row and column spanning attributes of
10077 items in a `wx.GridBagSizer`. wxPython has typemaps that will
10078 automatically convert from a 2-element sequence of integers to a
10079 wx.GBSpan, so you can use the more pythonic representation of the span
10080 nearly transparently in Python code.
10081
10082 """
e811c8ce
RD
10083 def __repr__(self):
10084 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10085 def __init__(self, *args, **kwargs):
248ed943
RD
10086 """
10087 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
10088
10089 Construct a new wxGBSpan, optionally setting the rowspan and
10090 colspan. The default is (1,1). (Meaning that the item occupies one
10091 cell in each direction.
10092 """
54f9ee45 10093 newobj = _core_.new_GBSpan(*args, **kwargs)
d14a1e28
RD
10094 self.this = newobj.this
10095 self.thisown = 1
10096 del newobj.thisown
e811c8ce 10097 def GetRowspan(*args, **kwargs):
a95a7133 10098 """GetRowspan(self) -> int"""
54f9ee45 10099 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
10100
10101 def GetColspan(*args, **kwargs):
a95a7133 10102 """GetColspan(self) -> int"""
54f9ee45 10103 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
10104
10105 def SetRowspan(*args, **kwargs):
a95a7133 10106 """SetRowspan(self, int rowspan)"""
54f9ee45 10107 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
10108
10109 def SetColspan(*args, **kwargs):
a95a7133 10110 """SetColspan(self, int colspan)"""
54f9ee45 10111 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
10112
10113 def __eq__(*args, **kwargs):
a95a7133 10114 """__eq__(self, GBSpan other) -> bool"""
54f9ee45 10115 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
10116
10117 def __ne__(*args, **kwargs):
a95a7133 10118 """__ne__(self, GBSpan other) -> bool"""
54f9ee45 10119 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
10120
10121 def Set(*args, **kwargs):
a95a7133 10122 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 10123 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
10124
10125 def Get(*args, **kwargs):
a95a7133 10126 """Get(self) -> PyObject"""
54f9ee45 10127 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 10128
41e2b43e 10129 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
10130 def __str__(self): return str(self.Get())
10131 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
10132 def __len__(self): return len(self.Get())
10133 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
10134 def __setitem__(self, index, val):
10135 if index == 0: self.SetRowspan(val)
10136 elif index == 1: self.SetColspan(val)
10137 else: raise IndexError
e811c8ce 10138 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
10139 __safe_for_unpickling__ = True
10140 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
10141
10142 rowspan = property(GetRowspan, SetRowspan)
10143 colspan = property(GetColspan, SetColspan)
10144
10145
10146class GBSpanPtr(GBSpan):
10147 def __init__(self, this):
10148 self.this = this
10149 if not hasattr(self,"thisown"): self.thisown = 0
10150 self.__class__ = GBSpan
54f9ee45 10151_core_.GBSpan_swigregister(GBSpanPtr)
d14a1e28
RD
10152
10153class GBSizerItem(SizerItem):
248ed943
RD
10154 """
10155 The wx.GBSizerItem class is used to track the additional data about
10156 items in a `wx.GridBagSizer` such as the item's position in the grid
10157 and how many rows or columns it spans.
10158
10159 """
e811c8ce
RD
10160 def __repr__(self):
10161 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10162 def __init__(self, *args, **kwargs):
248ed943
RD
10163 """
10164 __init__(self) -> GBSizerItem
10165
10166 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
10167 size will need to be set, as well as a position and span before this
10168 item can be used in a Sizer.
10169
10170 You will probably never need to create a wx.GBSizerItem directly as they
10171 are created automatically when the sizer's Add method is called.
10172 """
54f9ee45 10173 newobj = _core_.new_GBSizerItem(*args, **kwargs)
d14a1e28
RD
10174 self.this = newobj.this
10175 self.thisown = 1
10176 del newobj.thisown
e811c8ce 10177 def GetPos(*args, **kwargs):
248ed943
RD
10178 """
10179 GetPos(self) -> GBPosition
10180
10181 Get the grid position of the item
10182 """
54f9ee45 10183 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
10184
10185 def GetPosTuple(self): return self.GetPos().Get()
10186 def GetSpan(*args, **kwargs):
248ed943
RD
10187 """
10188 GetSpan(self) -> GBSpan
10189
10190 Get the row and column spanning of the item
10191 """
54f9ee45 10192 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
10193
10194 def GetSpanTuple(self): return self.GetSpan().Get()
10195 def SetPos(*args, **kwargs):
248ed943
RD
10196 """
10197 SetPos(self, GBPosition pos) -> bool
10198
10199 If the item is already a member of a sizer then first ensure that
10200 there is no other item that would intersect with this one at the new
10201 position, then set the new position. Returns True if the change is
10202 successful and after the next Layout() the item will be moved.
10203 """
54f9ee45 10204 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
10205
10206 def SetSpan(*args, **kwargs):
248ed943
RD
10207 """
10208 SetSpan(self, GBSpan span) -> bool
10209
10210 If the item is already a member of a sizer then first ensure that
10211 there is no other item that would intersect with this one with its new
10212 spanning size, then set the new spanning. Returns True if the change
10213 is successful and after the next Layout() the item will be resized.
10214
10215 """
54f9ee45 10216 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 10217
248ed943 10218 def Intersects(*args, **kwargs):
0df68c9f 10219 """
a95a7133 10220 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
10221
10222 Returns True if this item and the other item instersect.
0df68c9f 10223 """
248ed943
RD
10224 return _core_.GBSizerItem_Intersects(*args, **kwargs)
10225
10226 def IntersectsPos(*args, **kwargs):
10227 """
10228 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
10229
10230 Returns True if the given pos/span would intersect with this item.
10231 """
10232 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
10233
10234 def GetEndPos(*args, **kwargs):
248ed943
RD
10235 """
10236 GetEndPos(self) -> GBPosition
10237
10238 Get the row and column of the endpoint of this item.
10239 """
54f9ee45 10240 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
10241
10242 def GetGBSizer(*args, **kwargs):
248ed943
RD
10243 """
10244 GetGBSizer(self) -> GridBagSizer
10245
10246 Get the sizer this item is a member of.
10247 """
54f9ee45 10248 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
10249
10250 def SetGBSizer(*args, **kwargs):
248ed943
RD
10251 """
10252 SetGBSizer(self, GridBagSizer sizer)
10253
10254 Set the sizer this item is a member of.
10255 """
54f9ee45 10256 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 10257
d14a1e28
RD
10258
10259class GBSizerItemPtr(GBSizerItem):
10260 def __init__(self, this):
10261 self.this = this
10262 if not hasattr(self,"thisown"): self.thisown = 0
10263 self.__class__ = GBSizerItem
54f9ee45 10264_core_.GBSizerItem_swigregister(GBSizerItemPtr)
d14a1e28
RD
10265DefaultSpan = cvar.DefaultSpan
10266
10267def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
10268 """
10269 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
10270 int border, PyObject userData=None) -> GBSizerItem
10271
10272 Construct a `wx.GBSizerItem` for a window.
0df68c9f 10273 """
54f9ee45 10274 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
10275 val.thisown = 1
10276 return val
10277
10278def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
10279 """
10280 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
10281 int border, PyObject userData=None) -> GBSizerItem
10282
10283 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 10284 """
54f9ee45 10285 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
10286 val.thisown = 1
10287 return val
10288
10289def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
10290 """
10291 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
10292 int flag, int border, PyObject userData=None) -> GBSizerItem
10293
10294 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 10295 """
54f9ee45 10296 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
10297 val.thisown = 1
10298 return val
10299
10300class GridBagSizer(FlexGridSizer):
248ed943
RD
10301 """
10302 A `wx.Sizer` that can lay out items in a virtual grid like a
10303 `wx.FlexGridSizer` but in this case explicit positioning of the items
10304 is allowed using `wx.GBPosition`, and items can optionally span more
10305 than one row and/or column using `wx.GBSpan`. The total size of the
10306 virtual grid is determined by the largest row and column that items are
10307 positioned at, adjusted for spanning.
10308
10309 """
e811c8ce
RD
10310 def __repr__(self):
10311 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 10312 def __init__(self, *args, **kwargs):
248ed943
RD
10313 """
10314 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
10315
10316 Constructor, with optional parameters to specify the gap between the
10317 rows and columns.
10318 """
54f9ee45 10319 newobj = _core_.new_GridBagSizer(*args, **kwargs)
d14a1e28
RD
10320 self.this = newobj.this
10321 self.thisown = 1
10322 del newobj.thisown
1823fbb4
RD
10323 self._setOORInfo(self)
10324
e811c8ce 10325 def Add(*args, **kwargs):
0df68c9f 10326 """
248ed943 10327 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 10328 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
10329
10330 Adds an item to the sizer at the grid cell *pos*, optionally spanning
10331 more than one row or column as specified with *span*. The remaining
10332 args behave similarly to `wx.Sizer.Add`.
10333
10334 Returns True if the item was successfully placed at the given cell
10335 position, False if something was already there.
10336
0df68c9f 10337 """
54f9ee45 10338 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
10339
10340 def AddItem(*args, **kwargs):
248ed943 10341 """
d3b6e4ff 10342 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
10343
10344 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
10345 the item was successfully placed at its given cell position, False if
10346 something was already there.
10347 """
54f9ee45 10348 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 10349
84f85550
RD
10350 def GetCellSize(*args, **kwargs):
10351 """
10352 GetCellSize(self, int row, int col) -> Size
10353
10354 Get the size of the specified cell, including hgap and
10355 vgap. Only valid after a Layout.
10356 """
10357 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
10358
e811c8ce 10359 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
10360 """
10361 GetEmptyCellSize(self) -> Size
10362
10363 Get the size used for cells in the grid with no item.
10364 """
54f9ee45 10365 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
10366
10367 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
10368 """
10369 SetEmptyCellSize(self, Size sz)
10370
10371 Set the size used for cells in the grid with no item.
10372 """
54f9ee45 10373 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
10374
10375 def GetItemPosition(*args):
0df68c9f 10376 """
248ed943
RD
10377 GetItemPosition(self, item) -> GBPosition
10378
10379 Get the grid position of the specified *item* where *item* is either a
10380 window or subsizer that is a member of this sizer, or a zero-based
10381 index of an item.
0df68c9f 10382 """
54f9ee45 10383 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
10384
10385 def SetItemPosition(*args):
0df68c9f 10386 """
248ed943
RD
10387 SetItemPosition(self, item, GBPosition pos) -> bool
10388
10389 Set the grid position of the specified *item* where *item* is either a
10390 window or subsizer that is a member of this sizer, or a zero-based
10391 index of an item. Returns True on success. If the move is not
10392 allowed (because an item is already there) then False is returned.
10393
0df68c9f 10394 """
54f9ee45 10395 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
10396
10397 def GetItemSpan(*args):
0df68c9f 10398 """
248ed943
RD
10399 GetItemSpan(self, item) -> GBSpan
10400
10401 Get the row/col spanning of the specified *item* where *item* is
10402 either a window or subsizer that is a member of this sizer, or a
10403 zero-based index of an item.
0df68c9f 10404 """
54f9ee45 10405 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
10406
10407 def SetItemSpan(*args):
0df68c9f 10408 """
248ed943
RD
10409 SetItemSpan(self, item, GBSpan span) -> bool
10410
10411 Set the row/col spanning of the specified *item* where *item* is
10412 either a window or subsizer that is a member of this sizer, or a
10413 zero-based index of an item. Returns True on success. If the move is
10414 not allowed (because an item is already there) then False is returned.
0df68c9f 10415 """
54f9ee45 10416 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
10417
10418 def FindItem(*args):
0df68c9f 10419 """
248ed943
RD
10420 FindItem(self, item) -> GBSizerItem
10421
10422 Find the sizer item for the given window or subsizer, returns None if
10423 not found. (non-recursive)
0df68c9f 10424 """
54f9ee45 10425 return _core_.GridBagSizer_FindItem(*args)
e811c8ce
RD
10426
10427 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
10428 """
10429 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
10430
10431 Return the sizer item for the given grid cell, or None if there is no
10432 item at that position. (non-recursive)
10433 """
54f9ee45 10434 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
10435
10436 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
10437 """
10438 FindItemAtPoint(self, Point pt) -> GBSizerItem
10439
10440 Return the sizer item located at the point given in *pt*, or None if
10441 there is no item at that point. The (x,y) coordinates in pt correspond
10442 to the client coordinates of the window using the sizer for
10443 layout. (non-recursive)
10444 """
54f9ee45 10445 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 10446
248ed943
RD
10447 def CheckForIntersection(*args, **kwargs):
10448 """
10449 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 10450
248ed943
RD
10451 Look at all items and see if any intersect (or would overlap) the
10452 given *item*. Returns True if so, False if there would be no overlap.
10453 If an *excludeItem* is given then it will not be checked for
10454 intersection, for example it may be the item we are checking the
10455 position of.
e811c8ce 10456
248ed943
RD
10457 """
10458 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 10459
248ed943 10460 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 10461 """
248ed943
RD
10462 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
10463
10464 Look at all items and see if any intersect (or would overlap) the
10465 given position and span. Returns True if so, False if there would be
10466 no overlap. If an *excludeItem* is given then it will not be checked
10467 for intersection, for example it may be the item we are checking the
10468 position of.
0df68c9f 10469 """
248ed943 10470 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 10471
d14a1e28
RD
10472
10473class GridBagSizerPtr(GridBagSizer):
10474 def __init__(self, this):
10475 self.this = this
10476 if not hasattr(self,"thisown"): self.thisown = 0
10477 self.__class__ = GridBagSizer
54f9ee45 10478_core_.GridBagSizer_swigregister(GridBagSizerPtr)
d14a1e28
RD
10479
10480#---------------------------------------------------------------------------
10481
54f9ee45
RD
10482Left = _core_.Left
10483Top = _core_.Top
10484Right = _core_.Right
10485Bottom = _core_.Bottom
10486Width = _core_.Width
10487Height = _core_.Height
10488Centre = _core_.Centre
10489Center = _core_.Center
10490CentreX = _core_.CentreX
10491CentreY = _core_.CentreY
10492Unconstrained = _core_.Unconstrained
10493AsIs = _core_.AsIs
10494PercentOf = _core_.PercentOf
10495Above = _core_.Above
10496Below = _core_.Below
10497LeftOf = _core_.LeftOf
10498RightOf = _core_.RightOf
10499SameAs = _core_.SameAs
10500Absolute = _core_.Absolute
d14a1e28 10501class IndividualLayoutConstraint(Object):
15afbcd0 10502 """
41e2b43e
RD
10503 Objects of this class are stored in the `wx.LayoutConstraints` class as
10504 one of eight possible constraints that a window can be involved in.
10505 You will never need to create an instance of
10506 wx.IndividualLayoutConstraint, rather you should create a
10507 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 10508 that it contains.
15afbcd0 10509 """
d14a1e28
RD
10510 def __init__(self): raise RuntimeError, "No constructor defined"
10511 def __repr__(self):
10512 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 10513 def Set(*args, **kwargs):
41e2b43e
RD
10514 """
10515 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
10516
10517 Sets the properties of the constraint. Normally called by one of the
10518 convenience functions such as Above, RightOf, SameAs.
10519 """
54f9ee45 10520 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
10521
10522 def LeftOf(*args, **kwargs):
15afbcd0 10523 """
a95a7133 10524 LeftOf(self, Window sibling, int marg=0)
15afbcd0 10525
41e2b43e
RD
10526 Constrains this edge to be to the left of the given window, with an
10527 optional margin. Implicitly, this is relative to the left edge of the
10528 other window.
15afbcd0 10529 """
54f9ee45 10530 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
10531
10532 def RightOf(*args, **kwargs):
15afbcd0 10533 """
a95a7133 10534 RightOf(self, Window sibling, int marg=0)
15afbcd0 10535
41e2b43e
RD
10536 Constrains this edge to be to the right of the given window, with an
10537 optional margin. Implicitly, this is relative to the right edge of the
10538 other window.
15afbcd0 10539 """
54f9ee45 10540 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
10541
10542 def Above(*args, **kwargs):
15afbcd0 10543 """
a95a7133 10544 Above(self, Window sibling, int marg=0)
15afbcd0 10545
41e2b43e
RD
10546 Constrains this edge to be above the given window, with an optional
10547 margin. Implicitly, this is relative to the top edge of the other
10548 window.
15afbcd0 10549 """
54f9ee45 10550 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
10551
10552 def Below(*args, **kwargs):
15afbcd0 10553 """
a95a7133 10554 Below(self, Window sibling, int marg=0)
15afbcd0 10555
41e2b43e
RD
10556 Constrains this edge to be below the given window, with an optional
10557 margin. Implicitly, this is relative to the bottom edge of the other
10558 window.
15afbcd0 10559 """
54f9ee45 10560 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
10561
10562 def SameAs(*args, **kwargs):
15afbcd0 10563 """
a95a7133 10564 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 10565
41e2b43e
RD
10566 Constrains this edge or dimension to be to the same as the edge of the
10567 given window, with an optional margin.
15afbcd0 10568 """
54f9ee45 10569 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
10570
10571 def PercentOf(*args, **kwargs):
15afbcd0 10572 """
a95a7133 10573 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 10574
41e2b43e
RD
10575 Constrains this edge or dimension to be to a percentage of the given
10576 window, with an optional margin.
15afbcd0 10577 """
54f9ee45 10578 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
10579
10580 def Absolute(*args, **kwargs):
15afbcd0 10581 """
a95a7133 10582 Absolute(self, int val)
15afbcd0 10583
41e2b43e 10584 Constrains this edge or dimension to be the given absolute value.
15afbcd0 10585 """
54f9ee45 10586 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
10587
10588 def Unconstrained(*args, **kwargs):
15afbcd0 10589 """
a95a7133 10590 Unconstrained(self)
15afbcd0 10591
41e2b43e
RD
10592 Sets this edge or dimension to be unconstrained, that is, dependent on
10593 other edges and dimensions from which this value can be deduced.
15afbcd0 10594 """
54f9ee45 10595 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
10596
10597 def AsIs(*args, **kwargs):
15afbcd0 10598 """
a95a7133 10599 AsIs(self)
15afbcd0 10600
41e2b43e
RD
10601 Sets this edge or constraint to be whatever the window's value is at
10602 the moment. If either of the width and height constraints are *as is*,
10603 the window will not be resized, but moved instead. This is important
10604 when considering panel items which are intended to have a default
10605 size, such as a button, which may take its size from the size of the
10606 button label.
15afbcd0 10607 """
54f9ee45 10608 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
10609
10610 def GetOtherWindow(*args, **kwargs):
a95a7133 10611 """GetOtherWindow(self) -> Window"""
54f9ee45 10612 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
10613
10614 def GetMyEdge(*args, **kwargs):
a95a7133 10615 """GetMyEdge(self) -> int"""
54f9ee45 10616 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
10617
10618 def SetEdge(*args, **kwargs):
a95a7133 10619 """SetEdge(self, int which)"""
54f9ee45 10620 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
10621
10622 def SetValue(*args, **kwargs):
a95a7133 10623 """SetValue(self, int v)"""
54f9ee45 10624 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
10625
10626 def GetMargin(*args, **kwargs):
a95a7133 10627 """GetMargin(self) -> int"""
54f9ee45 10628 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
10629
10630 def SetMargin(*args, **kwargs):
a95a7133 10631 """SetMargin(self, int m)"""
54f9ee45 10632 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
10633
10634 def GetValue(*args, **kwargs):
a95a7133 10635 """GetValue(self) -> int"""
54f9ee45 10636 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
10637
10638 def GetPercent(*args, **kwargs):
a95a7133 10639 """GetPercent(self) -> int"""
54f9ee45 10640 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
10641
10642 def GetOtherEdge(*args, **kwargs):
a95a7133 10643 """GetOtherEdge(self) -> int"""
54f9ee45 10644 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
10645
10646 def GetDone(*args, **kwargs):
a95a7133 10647 """GetDone(self) -> bool"""
54f9ee45 10648 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
10649
10650 def SetDone(*args, **kwargs):
a95a7133 10651 """SetDone(self, bool d)"""
54f9ee45 10652 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
10653
10654 def GetRelationship(*args, **kwargs):
a95a7133 10655 """GetRelationship(self) -> int"""
54f9ee45 10656 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
10657
10658 def SetRelationship(*args, **kwargs):
a95a7133 10659 """SetRelationship(self, int r)"""
54f9ee45 10660 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
10661
10662 def ResetIfWin(*args, **kwargs):
15afbcd0 10663 """
a95a7133 10664 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
10665
10666 Reset constraint if it mentions otherWin
10667 """
54f9ee45 10668 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
10669
10670 def SatisfyConstraint(*args, **kwargs):
15afbcd0 10671 """
a95a7133 10672 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
10673
10674 Try to satisfy constraint
10675 """
54f9ee45 10676 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
10677
10678 def GetEdge(*args, **kwargs):
15afbcd0 10679 """
a95a7133 10680 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
10681
10682 Get the value of this edge or dimension, or if this
10683 is not determinable, -1.
10684 """
54f9ee45 10685 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 10686
d14a1e28
RD
10687
10688class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
10689 def __init__(self, this):
10690 self.this = this
10691 if not hasattr(self,"thisown"): self.thisown = 0
10692 self.__class__ = IndividualLayoutConstraint
54f9ee45 10693_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
d14a1e28
RD
10694
10695class LayoutConstraints(Object):
15afbcd0 10696 """
41e2b43e
RD
10697 **Note:** constraints are now deprecated and you should use sizers
10698 instead.
15afbcd0 10699
41e2b43e
RD
10700 Objects of this class can be associated with a window to define its
10701 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
10702
10703 The class consists of the following eight constraints of class
10704 wx.IndividualLayoutConstraint, some or all of which should be accessed
10705 directly to set the appropriate constraints.
10706
10707 * left: represents the left hand edge of the window
10708 * right: represents the right hand edge of the window
10709 * top: represents the top edge of the window
10710 * bottom: represents the bottom edge of the window
10711 * width: represents the width of the window
10712 * height: represents the height of the window
10713 * centreX: represents the horizontal centre point of the window
10714 * centreY: represents the vertical centre point of the window
10715
41e2b43e
RD
10716 Most constraints are initially set to have the relationship
10717 wxUnconstrained, which means that their values should be calculated by
10718 looking at known constraints. The exceptions are width and height,
10719 which are set to wxAsIs to ensure that if the user does not specify a
10720 constraint, the existing width and height will be used, to be
10721 compatible with panel items which often have take a default size. If
10722 the constraint is ``wx.AsIs``, the dimension will not be changed.
10723
10724 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
10725
10726 """
e811c8ce
RD
10727 def __repr__(self):
10728 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
10729 left = property(_core_.LayoutConstraints_left_get)
10730 top = property(_core_.LayoutConstraints_top_get)
10731 right = property(_core_.LayoutConstraints_right_get)
10732 bottom = property(_core_.LayoutConstraints_bottom_get)
10733 width = property(_core_.LayoutConstraints_width_get)
10734 height = property(_core_.LayoutConstraints_height_get)
10735 centreX = property(_core_.LayoutConstraints_centreX_get)
10736 centreY = property(_core_.LayoutConstraints_centreY_get)
d14a1e28 10737 def __init__(self, *args, **kwargs):
a95a7133 10738 """__init__(self) -> LayoutConstraints"""
54f9ee45 10739 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
d14a1e28
RD
10740 self.this = newobj.this
10741 self.thisown = 1
10742 del newobj.thisown
e811c8ce 10743 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 10744 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 10745 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
10746
10747 def AreSatisfied(*args, **kwargs):
a95a7133 10748 """AreSatisfied(self) -> bool"""
54f9ee45 10749 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 10750
d14a1e28
RD
10751
10752class LayoutConstraintsPtr(LayoutConstraints):
10753 def __init__(self, this):
10754 self.this = this
10755 if not hasattr(self,"thisown"): self.thisown = 0
10756 self.__class__ = LayoutConstraints
54f9ee45 10757_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
d14a1e28
RD
10758
10759#----------------------------------------------------------------------------
10760
322913ce 10761# Use Python's bool constants if available, make some if not
d14a1e28
RD
10762try:
10763 True
10764except NameError:
322913ce
RD
10765 __builtins__.True = 1==1
10766 __builtins__.False = 1==0
4f89f6a3
RD
10767 def bool(value): return not not value
10768 __builtins__.bool = bool
d14a1e28 10769
d14a1e28
RD
10770
10771
10772# workarounds for bad wxRTTI names
10773__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
10774__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
10775__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
10776
10777
10778#----------------------------------------------------------------------------
10779# Load version numbers from __version__... Ensure that major and minor
7bc1e663 10780# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
10781
10782from __version__ import *
10783__version__ = VERSION_STRING
10784
7bc1e663
RD
10785assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
10786assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 10787if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 10788 import warnings
7bc1e663 10789 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28
RD
10790
10791#----------------------------------------------------------------------------
10792
5cbf236d
RD
10793# Set the default string conversion encoding from the locale
10794import locale
10795default = locale.getdefaultlocale()[1]
10796if default:
10797 wx.SetDefaultPyEncoding(default)
10798del default
10799del locale
10800
10801#----------------------------------------------------------------------------
10802
d14a1e28
RD
10803class PyDeadObjectError(AttributeError):
10804 pass
10805
d14a1e28
RD
10806class _wxPyDeadObject(object):
10807 """
10808 Instances of wx objects that are OOR capable will have their __class__
10809 changed to this class when the C++ object is deleted. This should help
10810 prevent crashes due to referencing a bogus C++ pointer.
10811 """
10812 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
10813 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
10814
3a04f143 10815 def __repr__(self):
d14a1e28
RD
10816 if not hasattr(self, "_name"):
10817 self._name = "[unknown]"
10818 return self.reprStr % self._name
10819
3a04f143 10820 def __getattr__(self, *args):
d14a1e28
RD
10821 if not hasattr(self, "_name"):
10822 self._name = "[unknown]"
3a04f143
RD
10823 raise PyDeadObjectError(self.attrStr % self._name)
10824
10825 def __nonzero__(self):
10826 return 0
10827
10828
10829
10830class PyUnbornObjectError(AttributeError):
10831 pass
10832
10833class _wxPyUnbornObject(object):
10834 """
54f9ee45 10835 Some stock objects are created when the wx._core module is
3a04f143
RD
10836 imported, but their C++ instance is not created until the wx.App
10837 object is created and initialized. These object instances will
10838 temporarily have their __class__ changed to this class so an
10839 exception will be raised if they are used before the C++ instance
10840 is ready.
10841 """
10842
10843 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
10844 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
10845
10846 def __repr__(self):
10847 #if not hasattr(self, "_name"):
10848 # self._name = "[unknown]"
10849 return self.reprStr #% self._name
10850
10851 def __getattr__(self, *args):
10852 #if not hasattr(self, "_name"):
10853 # self._name = "[unknown]"
10854 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
10855
10856 def __nonzero__(self):
10857 return 0
10858
10859
10860#----------------------------------------------------------------------------
d14a1e28
RD
10861
10862def CallAfter(callable, *args, **kw):
10863 """
10864 Call the specified function after the current and pending event
10865 handlers have been completed. This is also good for making GUI
61863841
RD
10866 method calls from non-GUI threads. Any extra positional or
10867 keyword args are passed on to the callable when it is called.
10868
10869 :see: `wx.FutureCall`
d14a1e28
RD
10870 """
10871 app = wx.GetApp()
dfbb5885 10872 assert app is not None, 'No wx.App created yet'
d14a1e28 10873
148275d3
RD
10874 if not hasattr(app, "_CallAfterId"):
10875 app._CallAfterId = wx.NewEventType()
10876 app.Connect(-1, -1, app._CallAfterId,
10877 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 10878 evt = wx.PyEvent()
148275d3 10879 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
10880 evt.callable = callable
10881 evt.args = args
10882 evt.kw = kw
10883 wx.PostEvent(app, evt)
10884
d14a1e28
RD
10885#----------------------------------------------------------------------------
10886
10887
10888class FutureCall:
10889 """
8ac8dba0 10890 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
10891 object once after the given amount of milliseconds, passing any
10892 positional or keyword args. The return value of the callable is
61863841 10893 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
10894
10895 If you don't need to get the return value or restart the timer
10896 then there is no need to hold a reference to this object. It will
10897 hold a reference to itself while the timer is running (the timer
10898 has a reference to self.Notify) but the cycle will be broken when
10899 the timer completes, automatically cleaning up the wx.FutureCall
10900 object.
61863841
RD
10901
10902 :see: `wx.CallAfter`
d14a1e28
RD
10903 """
10904 def __init__(self, millis, callable, *args, **kwargs):
10905 self.millis = millis
10906 self.callable = callable
10907 self.SetArgs(*args, **kwargs)
10908 self.runCount = 0
4276dc52 10909 self.running = False
d14a1e28
RD
10910 self.hasRun = False
10911 self.result = None
10912 self.timer = None
10913 self.Start()
10914
10915 def __del__(self):
10916 self.Stop()
10917
10918
10919 def Start(self, millis=None, *args, **kwargs):
10920 """
10921 (Re)start the timer
10922 """
10923 self.hasRun = False
10924 if millis is not None:
10925 self.millis = millis
10926 if args or kwargs:
10927 self.SetArgs(*args, **kwargs)
10928 self.Stop()
10929 self.timer = wx.PyTimer(self.Notify)
10930 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 10931 self.running = True
d14a1e28
RD
10932 Restart = Start
10933
10934
10935 def Stop(self):
10936 """
10937 Stop and destroy the timer.
10938 """
10939 if self.timer is not None:
10940 self.timer.Stop()
10941 self.timer = None
10942
10943
10944 def GetInterval(self):
10945 if self.timer is not None:
10946 return self.timer.GetInterval()
10947 else:
10948 return 0
10949
10950
10951 def IsRunning(self):
10952 return self.timer is not None and self.timer.IsRunning()
10953
10954
10955 def SetArgs(self, *args, **kwargs):
10956 """
10957 (Re)set the args passed to the callable object. This is
10958 useful in conjunction with Restart if you want to schedule a
10959 new call to the same callable object but with different
10960 parameters.
10961 """
10962 self.args = args
10963 self.kwargs = kwargs
10964
10965
10966 def HasRun(self):
10967 return self.hasRun
10968
10969 def GetResult(self):
10970 return self.result
10971
10972 def Notify(self):
10973 """
10974 The timer has expired so call the callable.
10975 """
10976 if self.callable and getattr(self.callable, 'im_self', True):
10977 self.runCount += 1
4276dc52 10978 self.running = False
d14a1e28
RD
10979 self.result = self.callable(*self.args, **self.kwargs)
10980 self.hasRun = True
4276dc52
RD
10981 if not self.running:
10982 # if it wasn't restarted, then cleanup
10983 wx.CallAfter(self.Stop)
d14a1e28
RD
10984
10985
a95a7133
RD
10986
10987#----------------------------------------------------------------------------
10988# Control which items in this module should be documented by epydoc.
10989# We allow only classes and functions, which will help reduce the size
10990# of the docs by filtering out the zillions of constants, EVT objects,
10991# and etc that don't make much sense by themselves, but are instead
10992# documented (or will be) as part of the classes/functions/methods
10993# where they should be used.
10994
66c033b4
RD
10995class __DocFilter:
10996 """
10997 A filter for epydoc that only allows non-Ptr classes and
10998 fucntions, in order to reduce the clutter in the API docs.
10999 """
11000 def __init__(self, globals):
11001 self._globals = globals
11002
11003 def __call__(self, name):
11004 import types
11005 obj = self._globals.get(name, None)
11006 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
11007 return False
11008 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
11009 return False
11010 return True
a95a7133 11011
d14a1e28
RD
11012#----------------------------------------------------------------------------
11013#----------------------------------------------------------------------------
11014
11015# Import other modules in this package that should show up in the
11016# "core" wx namespace
54f9ee45
RD
11017from _gdi import *
11018from _windows import *
11019from _controls import *
11020from _misc import *
d14a1e28 11021
3a04f143
RD
11022
11023# Fixup the stock objects since they can't be used yet. (They will be
11024# restored in wx.PyApp.OnInit.)
54f9ee45 11025_core_._wxPyFixStockObjects()
3a04f143 11026
d14a1e28
RD
11027#----------------------------------------------------------------------------
11028#----------------------------------------------------------------------------
11029
11030