]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
reSWIGged
[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
209ID_HIGHEST = _core_.ID_HIGHEST
210OPEN = _core_.OPEN
211SAVE = _core_.SAVE
212HIDE_READONLY = _core_.HIDE_READONLY
213OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
214FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
215MULTIPLE = _core_.MULTIPLE
216CHANGE_DIR = _core_.CHANGE_DIR
217ACCEL_ALT = _core_.ACCEL_ALT
218ACCEL_CTRL = _core_.ACCEL_CTRL
219ACCEL_SHIFT = _core_.ACCEL_SHIFT
220ACCEL_NORMAL = _core_.ACCEL_NORMAL
221PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
222PD_APP_MODAL = _core_.PD_APP_MODAL
223PD_CAN_ABORT = _core_.PD_CAN_ABORT
224PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
225PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
226PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
227DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
228DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
229MENU_TEAROFF = _core_.MENU_TEAROFF
230MB_DOCKABLE = _core_.MB_DOCKABLE
231NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
232FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
233LI_HORIZONTAL = _core_.LI_HORIZONTAL
234LI_VERTICAL = _core_.LI_VERTICAL
235WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
236WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
237WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
238WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
239WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
240WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
241MM_TEXT = _core_.MM_TEXT
242MM_LOMETRIC = _core_.MM_LOMETRIC
243MM_HIMETRIC = _core_.MM_HIMETRIC
244MM_LOENGLISH = _core_.MM_LOENGLISH
245MM_HIENGLISH = _core_.MM_HIENGLISH
246MM_TWIPS = _core_.MM_TWIPS
247MM_ISOTROPIC = _core_.MM_ISOTROPIC
248MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
249MM_POINTS = _core_.MM_POINTS
250MM_METRIC = _core_.MM_METRIC
251CENTRE = _core_.CENTRE
252CENTER = _core_.CENTER
253HORIZONTAL = _core_.HORIZONTAL
254VERTICAL = _core_.VERTICAL
255BOTH = _core_.BOTH
256LEFT = _core_.LEFT
257RIGHT = _core_.RIGHT
258UP = _core_.UP
259DOWN = _core_.DOWN
260TOP = _core_.TOP
261BOTTOM = _core_.BOTTOM
262NORTH = _core_.NORTH
263SOUTH = _core_.SOUTH
264WEST = _core_.WEST
265EAST = _core_.EAST
266ALL = _core_.ALL
267ALIGN_NOT = _core_.ALIGN_NOT
268ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
269ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
270ALIGN_LEFT = _core_.ALIGN_LEFT
271ALIGN_TOP = _core_.ALIGN_TOP
272ALIGN_RIGHT = _core_.ALIGN_RIGHT
273ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
274ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
275ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
276ALIGN_CENTER = _core_.ALIGN_CENTER
277ALIGN_CENTRE = _core_.ALIGN_CENTRE
278ALIGN_MASK = _core_.ALIGN_MASK
279STRETCH_NOT = _core_.STRETCH_NOT
280SHRINK = _core_.SHRINK
281GROW = _core_.GROW
282EXPAND = _core_.EXPAND
283SHAPED = _core_.SHAPED
284FIXED_MINSIZE = _core_.FIXED_MINSIZE
285TILE = _core_.TILE
286ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
287BORDER_DEFAULT = _core_.BORDER_DEFAULT
288BORDER_NONE = _core_.BORDER_NONE
289BORDER_STATIC = _core_.BORDER_STATIC
290BORDER_SIMPLE = _core_.BORDER_SIMPLE
291BORDER_RAISED = _core_.BORDER_RAISED
292BORDER_SUNKEN = _core_.BORDER_SUNKEN
293BORDER_DOUBLE = _core_.BORDER_DOUBLE
294BORDER_MASK = _core_.BORDER_MASK
295DEFAULT = _core_.DEFAULT
296DECORATIVE = _core_.DECORATIVE
297ROMAN = _core_.ROMAN
298SCRIPT = _core_.SCRIPT
299SWISS = _core_.SWISS
300MODERN = _core_.MODERN
301TELETYPE = _core_.TELETYPE
302VARIABLE = _core_.VARIABLE
303FIXED = _core_.FIXED
304NORMAL = _core_.NORMAL
305LIGHT = _core_.LIGHT
306BOLD = _core_.BOLD
307ITALIC = _core_.ITALIC
308SLANT = _core_.SLANT
309SOLID = _core_.SOLID
310DOT = _core_.DOT
311LONG_DASH = _core_.LONG_DASH
312SHORT_DASH = _core_.SHORT_DASH
313DOT_DASH = _core_.DOT_DASH
314USER_DASH = _core_.USER_DASH
315TRANSPARENT = _core_.TRANSPARENT
316STIPPLE = _core_.STIPPLE
317BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
318CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
319FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
320CROSS_HATCH = _core_.CROSS_HATCH
321HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
322VERTICAL_HATCH = _core_.VERTICAL_HATCH
323JOIN_BEVEL = _core_.JOIN_BEVEL
324JOIN_MITER = _core_.JOIN_MITER
325JOIN_ROUND = _core_.JOIN_ROUND
326CAP_ROUND = _core_.CAP_ROUND
327CAP_PROJECTING = _core_.CAP_PROJECTING
328CAP_BUTT = _core_.CAP_BUTT
329CLEAR = _core_.CLEAR
330XOR = _core_.XOR
331INVERT = _core_.INVERT
332OR_REVERSE = _core_.OR_REVERSE
333AND_REVERSE = _core_.AND_REVERSE
334COPY = _core_.COPY
335AND = _core_.AND
336AND_INVERT = _core_.AND_INVERT
337NO_OP = _core_.NO_OP
338NOR = _core_.NOR
339EQUIV = _core_.EQUIV
340SRC_INVERT = _core_.SRC_INVERT
341OR_INVERT = _core_.OR_INVERT
342NAND = _core_.NAND
343OR = _core_.OR
344SET = _core_.SET
345WXK_BACK = _core_.WXK_BACK
346WXK_TAB = _core_.WXK_TAB
347WXK_RETURN = _core_.WXK_RETURN
348WXK_ESCAPE = _core_.WXK_ESCAPE
349WXK_SPACE = _core_.WXK_SPACE
350WXK_DELETE = _core_.WXK_DELETE
351WXK_START = _core_.WXK_START
352WXK_LBUTTON = _core_.WXK_LBUTTON
353WXK_RBUTTON = _core_.WXK_RBUTTON
354WXK_CANCEL = _core_.WXK_CANCEL
355WXK_MBUTTON = _core_.WXK_MBUTTON
356WXK_CLEAR = _core_.WXK_CLEAR
357WXK_SHIFT = _core_.WXK_SHIFT
358WXK_ALT = _core_.WXK_ALT
359WXK_CONTROL = _core_.WXK_CONTROL
360WXK_MENU = _core_.WXK_MENU
361WXK_PAUSE = _core_.WXK_PAUSE
362WXK_CAPITAL = _core_.WXK_CAPITAL
363WXK_PRIOR = _core_.WXK_PRIOR
364WXK_NEXT = _core_.WXK_NEXT
365WXK_END = _core_.WXK_END
366WXK_HOME = _core_.WXK_HOME
367WXK_LEFT = _core_.WXK_LEFT
368WXK_UP = _core_.WXK_UP
369WXK_RIGHT = _core_.WXK_RIGHT
370WXK_DOWN = _core_.WXK_DOWN
371WXK_SELECT = _core_.WXK_SELECT
372WXK_PRINT = _core_.WXK_PRINT
373WXK_EXECUTE = _core_.WXK_EXECUTE
374WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
375WXK_INSERT = _core_.WXK_INSERT
376WXK_HELP = _core_.WXK_HELP
377WXK_NUMPAD0 = _core_.WXK_NUMPAD0
378WXK_NUMPAD1 = _core_.WXK_NUMPAD1
379WXK_NUMPAD2 = _core_.WXK_NUMPAD2
380WXK_NUMPAD3 = _core_.WXK_NUMPAD3
381WXK_NUMPAD4 = _core_.WXK_NUMPAD4
382WXK_NUMPAD5 = _core_.WXK_NUMPAD5
383WXK_NUMPAD6 = _core_.WXK_NUMPAD6
384WXK_NUMPAD7 = _core_.WXK_NUMPAD7
385WXK_NUMPAD8 = _core_.WXK_NUMPAD8
386WXK_NUMPAD9 = _core_.WXK_NUMPAD9
387WXK_MULTIPLY = _core_.WXK_MULTIPLY
388WXK_ADD = _core_.WXK_ADD
389WXK_SEPARATOR = _core_.WXK_SEPARATOR
390WXK_SUBTRACT = _core_.WXK_SUBTRACT
391WXK_DECIMAL = _core_.WXK_DECIMAL
392WXK_DIVIDE = _core_.WXK_DIVIDE
393WXK_F1 = _core_.WXK_F1
394WXK_F2 = _core_.WXK_F2
395WXK_F3 = _core_.WXK_F3
396WXK_F4 = _core_.WXK_F4
397WXK_F5 = _core_.WXK_F5
398WXK_F6 = _core_.WXK_F6
399WXK_F7 = _core_.WXK_F7
400WXK_F8 = _core_.WXK_F8
401WXK_F9 = _core_.WXK_F9
402WXK_F10 = _core_.WXK_F10
403WXK_F11 = _core_.WXK_F11
404WXK_F12 = _core_.WXK_F12
405WXK_F13 = _core_.WXK_F13
406WXK_F14 = _core_.WXK_F14
407WXK_F15 = _core_.WXK_F15
408WXK_F16 = _core_.WXK_F16
409WXK_F17 = _core_.WXK_F17
410WXK_F18 = _core_.WXK_F18
411WXK_F19 = _core_.WXK_F19
412WXK_F20 = _core_.WXK_F20
413WXK_F21 = _core_.WXK_F21
414WXK_F22 = _core_.WXK_F22
415WXK_F23 = _core_.WXK_F23
416WXK_F24 = _core_.WXK_F24
417WXK_NUMLOCK = _core_.WXK_NUMLOCK
418WXK_SCROLL = _core_.WXK_SCROLL
419WXK_PAGEUP = _core_.WXK_PAGEUP
420WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
421WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
422WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
423WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
424WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
425WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
426WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
427WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
428WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
429WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
430WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
431WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
432WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
433WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
434WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
435WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
436WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
437WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
438WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
439WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
440WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
441WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
442WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
443WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
444WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
445WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
446WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
447WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
448WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
449WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
450WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
451PAPER_NONE = _core_.PAPER_NONE
452PAPER_LETTER = _core_.PAPER_LETTER
453PAPER_LEGAL = _core_.PAPER_LEGAL
454PAPER_A4 = _core_.PAPER_A4
455PAPER_CSHEET = _core_.PAPER_CSHEET
456PAPER_DSHEET = _core_.PAPER_DSHEET
457PAPER_ESHEET = _core_.PAPER_ESHEET
458PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
459PAPER_TABLOID = _core_.PAPER_TABLOID
460PAPER_LEDGER = _core_.PAPER_LEDGER
461PAPER_STATEMENT = _core_.PAPER_STATEMENT
462PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
463PAPER_A3 = _core_.PAPER_A3
464PAPER_A4SMALL = _core_.PAPER_A4SMALL
465PAPER_A5 = _core_.PAPER_A5
466PAPER_B4 = _core_.PAPER_B4
467PAPER_B5 = _core_.PAPER_B5
468PAPER_FOLIO = _core_.PAPER_FOLIO
469PAPER_QUARTO = _core_.PAPER_QUARTO
470PAPER_10X14 = _core_.PAPER_10X14
471PAPER_11X17 = _core_.PAPER_11X17
472PAPER_NOTE = _core_.PAPER_NOTE
473PAPER_ENV_9 = _core_.PAPER_ENV_9
474PAPER_ENV_10 = _core_.PAPER_ENV_10
475PAPER_ENV_11 = _core_.PAPER_ENV_11
476PAPER_ENV_12 = _core_.PAPER_ENV_12
477PAPER_ENV_14 = _core_.PAPER_ENV_14
478PAPER_ENV_DL = _core_.PAPER_ENV_DL
479PAPER_ENV_C5 = _core_.PAPER_ENV_C5
480PAPER_ENV_C3 = _core_.PAPER_ENV_C3
481PAPER_ENV_C4 = _core_.PAPER_ENV_C4
482PAPER_ENV_C6 = _core_.PAPER_ENV_C6
483PAPER_ENV_C65 = _core_.PAPER_ENV_C65
484PAPER_ENV_B4 = _core_.PAPER_ENV_B4
485PAPER_ENV_B5 = _core_.PAPER_ENV_B5
486PAPER_ENV_B6 = _core_.PAPER_ENV_B6
487PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
488PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
489PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
490PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
491PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
492PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
493PAPER_ISO_B4 = _core_.PAPER_ISO_B4
494PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
495PAPER_9X11 = _core_.PAPER_9X11
496PAPER_10X11 = _core_.PAPER_10X11
497PAPER_15X11 = _core_.PAPER_15X11
498PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
499PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
500PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
501PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
502PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
503PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
504PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
505PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
506PAPER_A_PLUS = _core_.PAPER_A_PLUS
507PAPER_B_PLUS = _core_.PAPER_B_PLUS
508PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
509PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
510PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
511PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
512PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
513PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
514PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
515PAPER_A2 = _core_.PAPER_A2
516PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
517PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
518DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
519DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
520DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
521ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
522ITEM_NORMAL = _core_.ITEM_NORMAL
523ITEM_CHECK = _core_.ITEM_CHECK
524ITEM_RADIO = _core_.ITEM_RADIO
525ITEM_MAX = _core_.ITEM_MAX
526HT_NOWHERE = _core_.HT_NOWHERE
527HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
528HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
529HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
530HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
531HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
532HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
533HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
534HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
535HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
536HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
537HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
538HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
539HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
540HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
541HT_MAX = _core_.HT_MAX
542MOD_NONE = _core_.MOD_NONE
543MOD_ALT = _core_.MOD_ALT
544MOD_CONTROL = _core_.MOD_CONTROL
545MOD_SHIFT = _core_.MOD_SHIFT
546MOD_WIN = _core_.MOD_WIN
547UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
548UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
549UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d14a1e28
RD
550#---------------------------------------------------------------------------
551
552class Object(object):
0df68c9f
RD
553 """
554 The base class for most wx objects, although in wxPython not
555 much functionality is needed nor exposed.
556 """
d14a1e28
RD
557 def __init__(self): raise RuntimeError, "No constructor defined"
558 def __repr__(self):
559 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 560 def GetClassName(*args, **kwargs):
0df68c9f 561 """
a95a7133 562 GetClassName(self) -> String
e811c8ce 563
a95a7133 564 Returns the class name of the C++ class using wxRTTI.
0df68c9f 565 """
54f9ee45 566 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
567
568 def Destroy(*args, **kwargs):
0df68c9f 569 """
a95a7133 570 Destroy(self)
e811c8ce 571
0df68c9f
RD
572 Deletes the C++ object this Python object is a proxy for.
573 """
54f9ee45 574 return _core_.Object_Destroy(*args, **kwargs)
e811c8ce 575
d14a1e28
RD
576
577class ObjectPtr(Object):
578 def __init__(self, this):
579 self.this = this
580 if not hasattr(self,"thisown"): self.thisown = 0
581 self.__class__ = Object
54f9ee45
RD
582_core_.Object_swigregister(ObjectPtr)
583_wxPySetDictionary = _core_._wxPySetDictionary
d14a1e28 584
54f9ee45 585_wxPyFixStockObjects = _core_._wxPyFixStockObjects
3a04f143 586
54f9ee45 587cvar = _core_.cvar
196addbf 588EmptyString = cvar.EmptyString
d14a1e28
RD
589
590#---------------------------------------------------------------------------
591
54f9ee45
RD
592BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
593BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
594BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
595BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
596BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
597BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
598BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
599BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
600BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
601BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
602BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
603BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
604BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
605BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
606BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
607BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
608BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
609BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
610BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
611BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
612CURSOR_NONE = _core_.CURSOR_NONE
613CURSOR_ARROW = _core_.CURSOR_ARROW
614CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
615CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
616CURSOR_CHAR = _core_.CURSOR_CHAR
617CURSOR_CROSS = _core_.CURSOR_CROSS
618CURSOR_HAND = _core_.CURSOR_HAND
619CURSOR_IBEAM = _core_.CURSOR_IBEAM
620CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
621CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
622CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
623CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
624CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
625CURSOR_PENCIL = _core_.CURSOR_PENCIL
626CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
627CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
628CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
629CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
630CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
631CURSOR_SIZENS = _core_.CURSOR_SIZENS
632CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
633CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
634CURSOR_SIZING = _core_.CURSOR_SIZING
635CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
636CURSOR_WAIT = _core_.CURSOR_WAIT
637CURSOR_WATCH = _core_.CURSOR_WATCH
638CURSOR_BLANK = _core_.CURSOR_BLANK
639CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
640CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
641CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
642CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
643#---------------------------------------------------------------------------
644
645class Size(object):
0df68c9f 646 """
41e2b43e
RD
647 wx.Size is a useful data structure used to represent the size of
648 something. It simply contians integer width and height proprtites.
649 In most places in wxPython where a wx.Size is expected a
650 (width,height) tuple can be used instead.
0df68c9f 651 """
e811c8ce
RD
652 def __repr__(self):
653 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
654 width = property(_core_.Size_width_get, _core_.Size_width_set)
655 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 656 x = width; y = height
d14a1e28 657 def __init__(self, *args, **kwargs):
0df68c9f 658 """
a95a7133 659 __init__(self, int w=0, int h=0) -> Size
e811c8ce 660
0df68c9f
RD
661 Creates a size object.
662 """
54f9ee45 663 newobj = _core_.new_Size(*args, **kwargs)
d14a1e28
RD
664 self.this = newobj.this
665 self.thisown = 1
666 del newobj.thisown
54f9ee45 667 def __del__(self, destroy=_core_.delete_Size):
a95a7133 668 """__del__(self)"""
d14a1e28
RD
669 try:
670 if self.thisown: destroy(self)
671 except: pass
e811c8ce
RD
672
673 def __eq__(*args, **kwargs):
0df68c9f 674 """
a95a7133 675 __eq__(self, Size sz) -> bool
e811c8ce 676
0df68c9f
RD
677 Test for equality of wx.Size objects.
678 """
54f9ee45 679 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
680
681 def __ne__(*args, **kwargs):
0df68c9f 682 """
a95a7133 683 __ne__(self, Size sz) -> bool
e811c8ce 684
0df68c9f
RD
685 Test for inequality.
686 """
54f9ee45 687 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
688
689 def __add__(*args, **kwargs):
0df68c9f 690 """
a95a7133 691 __add__(self, Size sz) -> Size
e811c8ce 692
0df68c9f
RD
693 Add sz's proprties to this and return the result.
694 """
54f9ee45 695 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
696
697 def __sub__(*args, **kwargs):
0df68c9f 698 """
a95a7133 699 __sub__(self, Size sz) -> Size
e811c8ce 700
0df68c9f
RD
701 Subtract sz's properties from this and return the result.
702 """
54f9ee45 703 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
704
705 def IncTo(*args, **kwargs):
0df68c9f 706 """
a95a7133 707 IncTo(self, Size sz)
e811c8ce 708
0df68c9f
RD
709 Increments this object so that both of its dimensions are not less
710 than the corresponding dimensions of the size.
711 """
54f9ee45 712 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
713
714 def DecTo(*args, **kwargs):
0df68c9f 715 """
a95a7133 716 DecTo(self, Size sz)
e811c8ce 717
0df68c9f
RD
718 Decrements this object so that both of its dimensions are not greater
719 than the corresponding dimensions of the size.
720 """
54f9ee45 721 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce
RD
722
723 def Set(*args, **kwargs):
0df68c9f 724 """
a95a7133 725 Set(self, int w, int h)
e811c8ce 726
0df68c9f
RD
727 Set both width and height.
728 """
54f9ee45 729 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
730
731 def SetWidth(*args, **kwargs):
a95a7133 732 """SetWidth(self, int w)"""
54f9ee45 733 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
734
735 def SetHeight(*args, **kwargs):
a95a7133 736 """SetHeight(self, int h)"""
54f9ee45 737 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
738
739 def GetWidth(*args, **kwargs):
a95a7133 740 """GetWidth(self) -> int"""
54f9ee45 741 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
742
743 def GetHeight(*args, **kwargs):
a95a7133 744 """GetHeight(self) -> int"""
54f9ee45 745 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 746
74a57fcd
RD
747 def IsFullySpecified(*args, **kwargs):
748 """
a95a7133 749 IsFullySpecified(self) -> bool
74a57fcd
RD
750
751 Returns True if both components of the size are non-default values.
752 """
54f9ee45 753 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
754
755 def SetDefaults(*args, **kwargs):
756 """
a95a7133 757 SetDefaults(self, Size size)
74a57fcd 758
41e2b43e
RD
759 Combine this size with the other one replacing the default components
760 of this object (i.e. equal to -1) with those of the other.
74a57fcd 761 """
54f9ee45 762 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 763
e811c8ce 764 def Get(*args, **kwargs):
0df68c9f
RD
765 """
766 Get() -> (width,height)
e811c8ce 767
0df68c9f
RD
768 Returns the width and height properties as a tuple.
769 """
54f9ee45 770 return _core_.Size_Get(*args, **kwargs)
e811c8ce 771
41e2b43e 772 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
773 def __str__(self): return str(self.Get())
774 def __repr__(self): return 'wx.Size'+str(self.Get())
775 def __len__(self): return len(self.Get())
776 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
777 def __setitem__(self, index, val):
778 if index == 0: self.width = val
779 elif index == 1: self.height = val
780 else: raise IndexError
e811c8ce 781 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
782 __safe_for_unpickling__ = True
783 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28
RD
784
785
786class SizePtr(Size):
787 def __init__(self, this):
788 self.this = this
789 if not hasattr(self,"thisown"): self.thisown = 0
790 self.__class__ = Size
54f9ee45 791_core_.Size_swigregister(SizePtr)
d14a1e28
RD
792
793#---------------------------------------------------------------------------
794
795class RealPoint(object):
0df68c9f 796 """
41e2b43e
RD
797 A data structure for representing a point or position with floating
798 point x and y properties. In wxPython most places that expect a
799 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 800 """
e811c8ce
RD
801 def __repr__(self):
802 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
803 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
804 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
d14a1e28 805 def __init__(self, *args, **kwargs):
0df68c9f 806 """
a95a7133 807 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 808
0df68c9f
RD
809 Create a wx.RealPoint object
810 """
54f9ee45 811 newobj = _core_.new_RealPoint(*args, **kwargs)
d14a1e28
RD
812 self.this = newobj.this
813 self.thisown = 1
814 del newobj.thisown
54f9ee45 815 def __del__(self, destroy=_core_.delete_RealPoint):
a95a7133 816 """__del__(self)"""
d14a1e28
RD
817 try:
818 if self.thisown: destroy(self)
819 except: pass
e811c8ce
RD
820
821 def __eq__(*args, **kwargs):
0df68c9f 822 """
a95a7133 823 __eq__(self, RealPoint pt) -> bool
e811c8ce 824
0df68c9f
RD
825 Test for equality of wx.RealPoint objects.
826 """
54f9ee45 827 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
828
829 def __ne__(*args, **kwargs):
0df68c9f 830 """
a95a7133 831 __ne__(self, RealPoint pt) -> bool
e811c8ce 832
0df68c9f
RD
833 Test for inequality of wx.RealPoint objects.
834 """
54f9ee45 835 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
836
837 def __add__(*args, **kwargs):
0df68c9f 838 """
a95a7133 839 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 840
0df68c9f
RD
841 Add pt's proprties to this and return the result.
842 """
54f9ee45 843 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
844
845 def __sub__(*args, **kwargs):
0df68c9f 846 """
a95a7133 847 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 848
0df68c9f
RD
849 Subtract pt's proprties from this and return the result
850 """
54f9ee45 851 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
852
853 def Set(*args, **kwargs):
0df68c9f 854 """
a95a7133 855 Set(self, double x, double y)
e811c8ce 856
0df68c9f
RD
857 Set both the x and y properties
858 """
54f9ee45 859 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
860
861 def Get(*args, **kwargs):
0df68c9f
RD
862 """
863 Get() -> (x,y)
e811c8ce 864
0df68c9f
RD
865 Return the x and y properties as a tuple.
866 """
54f9ee45 867 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 868
41e2b43e 869 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
870 def __str__(self): return str(self.Get())
871 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
872 def __len__(self): return len(self.Get())
873 def __getitem__(self, index): return self.Get()[index]
d14a1e28 874 def __setitem__(self, index, val):
e811c8ce
RD
875 if index == 0: self.x = val
876 elif index == 1: self.y = val
d14a1e28 877 else: raise IndexError
e811c8ce 878 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
879 __safe_for_unpickling__ = True
880 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28
RD
881
882
883class RealPointPtr(RealPoint):
884 def __init__(self, this):
885 self.this = this
886 if not hasattr(self,"thisown"): self.thisown = 0
887 self.__class__ = RealPoint
54f9ee45 888_core_.RealPoint_swigregister(RealPointPtr)
d14a1e28
RD
889
890#---------------------------------------------------------------------------
891
892class Point(object):
0df68c9f 893 """
41e2b43e
RD
894 A data structure for representing a point or position with integer x
895 and y properties. Most places in wxPython that expect a wx.Point can
896 also accept a (x,y) tuple.
0df68c9f 897 """
e811c8ce
RD
898 def __repr__(self):
899 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
900 x = property(_core_.Point_x_get, _core_.Point_x_set)
901 y = property(_core_.Point_y_get, _core_.Point_y_set)
d14a1e28 902 def __init__(self, *args, **kwargs):
0df68c9f 903 """
a95a7133 904 __init__(self, int x=0, int y=0) -> Point
e811c8ce 905
0df68c9f
RD
906 Create a wx.Point object
907 """
54f9ee45 908 newobj = _core_.new_Point(*args, **kwargs)
d14a1e28
RD
909 self.this = newobj.this
910 self.thisown = 1
911 del newobj.thisown
54f9ee45 912 def __del__(self, destroy=_core_.delete_Point):
a95a7133 913 """__del__(self)"""
d14a1e28
RD
914 try:
915 if self.thisown: destroy(self)
916 except: pass
e811c8ce
RD
917
918 def __eq__(*args, **kwargs):
0df68c9f 919 """
a95a7133 920 __eq__(self, Point pt) -> bool
e811c8ce 921
0df68c9f
RD
922 Test for equality of wx.Point objects.
923 """
54f9ee45 924 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
925
926 def __ne__(*args, **kwargs):
0df68c9f 927 """
a95a7133 928 __ne__(self, Point pt) -> bool
e811c8ce 929
0df68c9f
RD
930 Test for inequality of wx.Point objects.
931 """
54f9ee45 932 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
933
934 def __add__(*args, **kwargs):
0df68c9f 935 """
a95a7133 936 __add__(self, Point pt) -> Point
e811c8ce 937
0df68c9f
RD
938 Add pt's proprties to this and return the result.
939 """
54f9ee45 940 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
941
942 def __sub__(*args, **kwargs):
0df68c9f 943 """
a95a7133 944 __sub__(self, Point pt) -> Point
e811c8ce 945
0df68c9f
RD
946 Subtract pt's proprties from this and return the result
947 """
54f9ee45 948 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
949
950 def __iadd__(*args, **kwargs):
0df68c9f 951 """
a95a7133 952 __iadd__(self, Point pt) -> Point
e811c8ce 953
0df68c9f
RD
954 Add pt to this object.
955 """
54f9ee45 956 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
957
958 def __isub__(*args, **kwargs):
0df68c9f 959 """
a95a7133 960 __isub__(self, Point pt) -> Point
e811c8ce 961
0df68c9f
RD
962 Subtract pt from this object.
963 """
54f9ee45 964 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
965
966 def Set(*args, **kwargs):
0df68c9f 967 """
a95a7133 968 Set(self, long x, long y)
e811c8ce 969
0df68c9f
RD
970 Set both the x and y properties
971 """
54f9ee45 972 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
973
974 def Get(*args, **kwargs):
0df68c9f
RD
975 """
976 Get() -> (x,y)
e811c8ce 977
0df68c9f
RD
978 Return the x and y properties as a tuple.
979 """
54f9ee45 980 return _core_.Point_Get(*args, **kwargs)
e811c8ce 981
41e2b43e 982 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
983 def __str__(self): return str(self.Get())
984 def __repr__(self): return 'wx.Point'+str(self.Get())
985 def __len__(self): return len(self.Get())
986 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
987 def __setitem__(self, index, val):
988 if index == 0: self.x = val
989 elif index == 1: self.y = val
990 else: raise IndexError
e811c8ce 991 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
992 __safe_for_unpickling__ = True
993 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28
RD
994
995
996class PointPtr(Point):
997 def __init__(self, this):
998 self.this = this
999 if not hasattr(self,"thisown"): self.thisown = 0
1000 self.__class__ = Point
54f9ee45 1001_core_.Point_swigregister(PointPtr)
d14a1e28
RD
1002
1003#---------------------------------------------------------------------------
1004
1005class Rect(object):
0df68c9f 1006 """
41e2b43e
RD
1007 A class for representing and manipulating rectangles. It has x, y,
1008 width and height properties. In wxPython most palces that expect a
1009 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1010 """
e811c8ce
RD
1011 def __repr__(self):
1012 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1013 def __init__(self, *args, **kwargs):
0df68c9f 1014 """
a95a7133 1015 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1016
0df68c9f
RD
1017 Create a new Rect object.
1018 """
54f9ee45 1019 newobj = _core_.new_Rect(*args, **kwargs)
d14a1e28
RD
1020 self.this = newobj.this
1021 self.thisown = 1
1022 del newobj.thisown
54f9ee45 1023 def __del__(self, destroy=_core_.delete_Rect):
a95a7133 1024 """__del__(self)"""
d14a1e28
RD
1025 try:
1026 if self.thisown: destroy(self)
1027 except: pass
e811c8ce
RD
1028
1029 def GetX(*args, **kwargs):
a95a7133 1030 """GetX(self) -> int"""
54f9ee45 1031 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1032
1033 def SetX(*args, **kwargs):
a95a7133 1034 """SetX(self, int x)"""
54f9ee45 1035 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1036
1037 def GetY(*args, **kwargs):
a95a7133 1038 """GetY(self) -> int"""
54f9ee45 1039 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1040
1041 def SetY(*args, **kwargs):
a95a7133 1042 """SetY(self, int y)"""
54f9ee45 1043 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1044
1045 def GetWidth(*args, **kwargs):
a95a7133 1046 """GetWidth(self) -> int"""
54f9ee45 1047 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1048
1049 def SetWidth(*args, **kwargs):
a95a7133 1050 """SetWidth(self, int w)"""
54f9ee45 1051 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1052
1053 def GetHeight(*args, **kwargs):
a95a7133 1054 """GetHeight(self) -> int"""
54f9ee45 1055 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1056
1057 def SetHeight(*args, **kwargs):
a95a7133 1058 """SetHeight(self, int h)"""
54f9ee45 1059 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1060
1061 def GetPosition(*args, **kwargs):
a95a7133 1062 """GetPosition(self) -> Point"""
54f9ee45 1063 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1064
1065 def SetPosition(*args, **kwargs):
a95a7133 1066 """SetPosition(self, Point p)"""
54f9ee45 1067 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1068
1069 def GetSize(*args, **kwargs):
a95a7133 1070 """GetSize(self) -> Size"""
54f9ee45 1071 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1072
1073 def SetSize(*args, **kwargs):
a95a7133 1074 """SetSize(self, Size s)"""
54f9ee45 1075 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1076
c9c7117a 1077 def GetTopLeft(*args, **kwargs):
a95a7133 1078 """GetTopLeft(self) -> Point"""
54f9ee45 1079 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1080
1081 def SetTopLeft(*args, **kwargs):
a95a7133 1082 """SetTopLeft(self, Point p)"""
54f9ee45 1083 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1084
1085 def GetBottomRight(*args, **kwargs):
a95a7133 1086 """GetBottomRight(self) -> Point"""
54f9ee45 1087 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1088
1089 def SetBottomRight(*args, **kwargs):
a95a7133 1090 """SetBottomRight(self, Point p)"""
54f9ee45 1091 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1092
e811c8ce 1093 def GetLeft(*args, **kwargs):
a95a7133 1094 """GetLeft(self) -> int"""
54f9ee45 1095 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1096
1097 def GetTop(*args, **kwargs):
a95a7133 1098 """GetTop(self) -> int"""
54f9ee45 1099 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1100
1101 def GetBottom(*args, **kwargs):
a95a7133 1102 """GetBottom(self) -> int"""
54f9ee45 1103 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1104
1105 def GetRight(*args, **kwargs):
a95a7133 1106 """GetRight(self) -> int"""
54f9ee45 1107 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1108
1109 def SetLeft(*args, **kwargs):
a95a7133 1110 """SetLeft(self, int left)"""
54f9ee45 1111 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1112
1113 def SetRight(*args, **kwargs):
a95a7133 1114 """SetRight(self, int right)"""
54f9ee45 1115 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1116
1117 def SetTop(*args, **kwargs):
a95a7133 1118 """SetTop(self, int top)"""
54f9ee45 1119 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1120
1121 def SetBottom(*args, **kwargs):
a95a7133 1122 """SetBottom(self, int bottom)"""
54f9ee45 1123 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1124
1125 position = property(GetPosition, SetPosition)
1126 size = property(GetSize, SetSize)
1127 left = property(GetLeft, SetLeft)
1128 right = property(GetRight, SetRight)
1129 top = property(GetTop, SetTop)
1130 bottom = property(GetBottom, SetBottom)
1131
1132 def Inflate(*args, **kwargs):
0df68c9f 1133 """
a95a7133 1134 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1135
41e2b43e
RD
1136 Increase the rectangle size by dx in x direction and dy in y
1137 direction. Both or one of) parameters may be negative to decrease the
1138 rectangle size.
0df68c9f 1139 """
54f9ee45 1140 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1141
1142 def Deflate(*args, **kwargs):
0df68c9f 1143 """
a95a7133 1144 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1145
41e2b43e
RD
1146 Decrease the rectangle size by dx in x direction and dy in y
1147 direction. Both or one of) parameters may be negative to increase the
1148 rectngle size. This method is the opposite of Inflate.
0df68c9f 1149 """
54f9ee45 1150 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1151
1152 def OffsetXY(*args, **kwargs):
0df68c9f 1153 """
a95a7133 1154 OffsetXY(self, int dx, int dy)
e811c8ce 1155
41e2b43e
RD
1156 Moves the rectangle by the specified offset. If dx is positive, the
1157 rectangle is moved to the right, if dy is positive, it is moved to the
1158 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1159 """
54f9ee45 1160 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1161
1162 def Offset(*args, **kwargs):
0df68c9f 1163 """
a95a7133 1164 Offset(self, Point pt)
e811c8ce 1165
0df68c9f
RD
1166 Same as OffsetXY but uses dx,dy from Point
1167 """
54f9ee45 1168 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1169
1170 def Intersect(*args, **kwargs):
0df68c9f 1171 """
a95a7133 1172 Intersect(self, Rect rect) -> Rect
e811c8ce 1173
0df68c9f
RD
1174 Return the intersectsion of this rectangle and rect.
1175 """
54f9ee45 1176 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce
RD
1177
1178 def __add__(*args, **kwargs):
0df68c9f 1179 """
a95a7133 1180 __add__(self, Rect rect) -> Rect
e811c8ce 1181
0df68c9f
RD
1182 Add the properties of rect to this rectangle and return the result.
1183 """
54f9ee45 1184 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1185
1186 def __iadd__(*args, **kwargs):
0df68c9f 1187 """
a95a7133 1188 __iadd__(self, Rect rect) -> Rect
e811c8ce 1189
0df68c9f
RD
1190 Add the properties of rect to this rectangle, updating this rectangle.
1191 """
54f9ee45 1192 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1193
1194 def __eq__(*args, **kwargs):
0df68c9f 1195 """
a95a7133 1196 __eq__(self, Rect rect) -> bool
e811c8ce 1197
0df68c9f
RD
1198 Test for equality.
1199 """
54f9ee45 1200 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1201
1202 def __ne__(*args, **kwargs):
0df68c9f 1203 """
a95a7133 1204 __ne__(self, Rect rect) -> bool
e811c8ce 1205
0df68c9f
RD
1206 Test for inequality.
1207 """
54f9ee45 1208 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce
RD
1209
1210 def InsideXY(*args, **kwargs):
0df68c9f 1211 """
a95a7133 1212 InsideXY(self, int x, int y) -> bool
e811c8ce 1213
0df68c9f
RD
1214 Return True if the point is (not strcitly) inside the rect.
1215 """
54f9ee45 1216 return _core_.Rect_InsideXY(*args, **kwargs)
e811c8ce
RD
1217
1218 def Inside(*args, **kwargs):
0df68c9f 1219 """
a95a7133 1220 Inside(self, Point pt) -> bool
e811c8ce 1221
0df68c9f
RD
1222 Return True if the point is (not strcitly) inside the rect.
1223 """
54f9ee45 1224 return _core_.Rect_Inside(*args, **kwargs)
e811c8ce
RD
1225
1226 def Intersects(*args, **kwargs):
0df68c9f 1227 """
a95a7133 1228 Intersects(self, Rect rect) -> bool
e811c8ce 1229
0df68c9f
RD
1230 Returns True if the rectangles have a non empty intersection.
1231 """
54f9ee45 1232 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1233
54f9ee45
RD
1234 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1235 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1236 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1237 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1238 def Set(*args, **kwargs):
0df68c9f 1239 """
a95a7133 1240 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1241
0df68c9f
RD
1242 Set all rectangle properties.
1243 """
54f9ee45 1244 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1245
1246 def Get(*args, **kwargs):
0df68c9f
RD
1247 """
1248 Get() -> (x,y,width,height)
e811c8ce 1249
0df68c9f
RD
1250 Return the rectangle properties as a tuple.
1251 """
54f9ee45 1252 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1253
41e2b43e 1254 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1255 def __str__(self): return str(self.Get())
1256 def __repr__(self): return 'wx.Rect'+str(self.Get())
1257 def __len__(self): return len(self.Get())
1258 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1259 def __setitem__(self, index, val):
1260 if index == 0: self.x = val
1261 elif index == 1: self.y = val
1262 elif index == 2: self.width = val
1263 elif index == 3: self.height = val
1264 else: raise IndexError
e811c8ce 1265 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1266 __safe_for_unpickling__ = True
1267 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28
RD
1268
1269
1270class RectPtr(Rect):
1271 def __init__(self, this):
1272 self.this = this
1273 if not hasattr(self,"thisown"): self.thisown = 0
1274 self.__class__ = Rect
54f9ee45 1275_core_.Rect_swigregister(RectPtr)
d14a1e28
RD
1276
1277def RectPP(*args, **kwargs):
0df68c9f
RD
1278 """
1279 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1280
0df68c9f
RD
1281 Create a new Rect object from Points representing two corners.
1282 """
54f9ee45 1283 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1284 val.thisown = 1
1285 return val
1286
1287def RectPS(*args, **kwargs):
0df68c9f
RD
1288 """
1289 RectPS(Point pos, Size size) -> Rect
e811c8ce 1290
0df68c9f
RD
1291 Create a new Rect from a position and size.
1292 """
54f9ee45 1293 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1294 val.thisown = 1
1295 return val
1296
1297
e811c8ce 1298def IntersectRect(*args, **kwargs):
0df68c9f
RD
1299 """
1300 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1301
0df68c9f
RD
1302 Calculate and return the intersection of r1 and r2.
1303 """
54f9ee45 1304 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1305#---------------------------------------------------------------------------
1306
1307class Point2D(object):
41e2b43e
RD
1308 """
1309 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1310 with floating point values.
1311 """
e811c8ce
RD
1312 def __repr__(self):
1313 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1314 def __init__(self, *args, **kwargs):
0df68c9f 1315 """
a95a7133 1316 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1317
0df68c9f
RD
1318 Create a w.Point2D object.
1319 """
54f9ee45 1320 newobj = _core_.new_Point2D(*args, **kwargs)
d14a1e28
RD
1321 self.this = newobj.this
1322 self.thisown = 1
1323 del newobj.thisown
e811c8ce 1324 def GetFloor(*args, **kwargs):
fd2dc343
RD
1325 """
1326 GetFloor() -> (x,y)
1327
1328 Convert to integer
1329 """
54f9ee45 1330 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1331
1332 def GetRounded(*args, **kwargs):
fd2dc343
RD
1333 """
1334 GetRounded() -> (x,y)
1335
1336 Convert to integer
1337 """
54f9ee45 1338 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1339
1340 def GetVectorLength(*args, **kwargs):
a95a7133 1341 """GetVectorLength(self) -> double"""
54f9ee45 1342 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1343
1344 def GetVectorAngle(*args, **kwargs):
a95a7133 1345 """GetVectorAngle(self) -> double"""
54f9ee45 1346 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1347
1348 def SetVectorLength(*args, **kwargs):
a95a7133 1349 """SetVectorLength(self, double length)"""
54f9ee45 1350 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1351
1352 def SetVectorAngle(*args, **kwargs):
a95a7133 1353 """SetVectorAngle(self, double degrees)"""
54f9ee45 1354 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1355
d14a1e28
RD
1356 def SetPolarCoordinates(self, angle, length):
1357 self.SetVectorLength(length)
1358 self.SetVectorAngle(angle)
1359 def Normalize(self):
1360 self.SetVectorLength(1.0)
1361
e811c8ce 1362 def GetDistance(*args, **kwargs):
a95a7133 1363 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1364 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1365
1366 def GetDistanceSquare(*args, **kwargs):
a95a7133 1367 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1368 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1369
1370 def GetDotProduct(*args, **kwargs):
a95a7133 1371 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1372 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1373
1374 def GetCrossProduct(*args, **kwargs):
a95a7133 1375 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1376 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1377
1378 def __neg__(*args, **kwargs):
0df68c9f 1379 """
a95a7133 1380 __neg__(self) -> Point2D
e811c8ce 1381
0df68c9f
RD
1382 the reflection of this point
1383 """
54f9ee45 1384 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1385
1386 def __iadd__(*args, **kwargs):
a95a7133 1387 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1388 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1389
1390 def __isub__(*args, **kwargs):
a95a7133 1391 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1392 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1393
1394 def __imul__(*args, **kwargs):
a95a7133 1395 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1396 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1397
1398 def __idiv__(*args, **kwargs):
a95a7133 1399 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1400 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1401
1402 def __eq__(*args, **kwargs):
0df68c9f 1403 """
a95a7133 1404 __eq__(self, Point2D pt) -> bool
e811c8ce 1405
0df68c9f
RD
1406 Test for equality
1407 """
54f9ee45 1408 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1409
1410 def __ne__(*args, **kwargs):
0df68c9f 1411 """
a95a7133 1412 __ne__(self, Point2D pt) -> bool
e811c8ce 1413
0df68c9f
RD
1414 Test for inequality
1415 """
54f9ee45 1416 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1417
54f9ee45
RD
1418 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1419 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1420 def Set(*args, **kwargs):
a95a7133 1421 """Set(self, double x=0, double y=0)"""
54f9ee45 1422 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1423
1424 def Get(*args, **kwargs):
0df68c9f
RD
1425 """
1426 Get() -> (x,y)
e811c8ce 1427
0df68c9f
RD
1428 Return x and y properties as a tuple.
1429 """
54f9ee45 1430 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1431
41e2b43e 1432 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1433 def __str__(self): return str(self.Get())
1434 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1435 def __len__(self): return len(self.Get())
1436 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1437 def __setitem__(self, index, val):
e811c8ce
RD
1438 if index == 0: self.x = val
1439 elif index == 1: self.y = val
d14a1e28 1440 else: raise IndexError
e811c8ce 1441 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1442 __safe_for_unpickling__ = True
1443 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28
RD
1444
1445
1446class Point2DPtr(Point2D):
1447 def __init__(self, this):
1448 self.this = this
1449 if not hasattr(self,"thisown"): self.thisown = 0
1450 self.__class__ = Point2D
54f9ee45 1451_core_.Point2D_swigregister(Point2DPtr)
d14a1e28
RD
1452
1453def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1454 """
1455 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1456
0df68c9f
RD
1457 Create a w.Point2D object.
1458 """
54f9ee45 1459 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1460 val.thisown = 1
1461 return val
1462
1463def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1464 """
1465 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1466
0df68c9f
RD
1467 Create a w.Point2D object.
1468 """
54f9ee45 1469 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1470 val.thisown = 1
1471 return val
1472
1473#---------------------------------------------------------------------------
1474
54f9ee45
RD
1475FromStart = _core_.FromStart
1476FromCurrent = _core_.FromCurrent
1477FromEnd = _core_.FromEnd
d14a1e28 1478class InputStream(object):
e811c8ce
RD
1479 def __repr__(self):
1480 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1481 def __init__(self, *args, **kwargs):
a95a7133 1482 """__init__(self, PyObject p) -> InputStream"""
54f9ee45 1483 newobj = _core_.new_InputStream(*args, **kwargs)
d14a1e28
RD
1484 self.this = newobj.this
1485 self.thisown = 1
1486 del newobj.thisown
e811c8ce 1487 def close(*args, **kwargs):
a95a7133 1488 """close(self)"""
54f9ee45 1489 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1490
1491 def flush(*args, **kwargs):
a95a7133 1492 """flush(self)"""
54f9ee45 1493 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1494
1495 def eof(*args, **kwargs):
a95a7133 1496 """eof(self) -> bool"""
54f9ee45 1497 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1498
1499 def read(*args, **kwargs):
a95a7133 1500 """read(self, int size=-1) -> PyObject"""
54f9ee45 1501 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1502
1503 def readline(*args, **kwargs):
a95a7133 1504 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1505 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1506
1507 def readlines(*args, **kwargs):
a95a7133 1508 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1509 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1510
1511 def seek(*args, **kwargs):
a95a7133 1512 """seek(self, int offset, int whence=0)"""
54f9ee45 1513 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1514
1515 def tell(*args, **kwargs):
a95a7133 1516 """tell(self) -> int"""
54f9ee45 1517 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1518
1519 def Peek(*args, **kwargs):
a95a7133 1520 """Peek(self) -> char"""
54f9ee45 1521 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1522
1523 def GetC(*args, **kwargs):
a95a7133 1524 """GetC(self) -> char"""
54f9ee45 1525 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1526
1527 def LastRead(*args, **kwargs):
a95a7133 1528 """LastRead(self) -> size_t"""
54f9ee45 1529 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1530
1531 def CanRead(*args, **kwargs):
a95a7133 1532 """CanRead(self) -> bool"""
54f9ee45 1533 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1534
1535 def Eof(*args, **kwargs):
a95a7133 1536 """Eof(self) -> bool"""
54f9ee45 1537 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1538
1539 def Ungetch(*args, **kwargs):
a95a7133 1540 """Ungetch(self, char c) -> bool"""
54f9ee45 1541 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1542
1543 def SeekI(*args, **kwargs):
a95a7133 1544 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1545 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1546
1547 def TellI(*args, **kwargs):
a95a7133 1548 """TellI(self) -> long"""
54f9ee45 1549 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1550
d14a1e28
RD
1551
1552class InputStreamPtr(InputStream):
1553 def __init__(self, this):
1554 self.this = this
1555 if not hasattr(self,"thisown"): self.thisown = 0
1556 self.__class__ = InputStream
54f9ee45 1557_core_.InputStream_swigregister(InputStreamPtr)
d14a1e28
RD
1558DefaultPosition = cvar.DefaultPosition
1559DefaultSize = cvar.DefaultSize
1560
1561class OutputStream(object):
d14a1e28
RD
1562 def __init__(self): raise RuntimeError, "No constructor defined"
1563 def __repr__(self):
1564 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 1565 def write(*args, **kwargs):
a95a7133 1566 """write(self, PyObject obj)"""
54f9ee45 1567 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 1568
d14a1e28
RD
1569
1570class OutputStreamPtr(OutputStream):
1571 def __init__(self, this):
1572 self.this = this
1573 if not hasattr(self,"thisown"): self.thisown = 0
1574 self.__class__ = OutputStream
54f9ee45 1575_core_.OutputStream_swigregister(OutputStreamPtr)
d14a1e28
RD
1576
1577#---------------------------------------------------------------------------
1578
1579class FSFile(Object):
e811c8ce
RD
1580 def __repr__(self):
1581 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1582 def __init__(self, *args, **kwargs):
0df68c9f 1583 """
a95a7133 1584 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 1585 DateTime modif) -> FSFile
0df68c9f 1586 """
54f9ee45 1587 newobj = _core_.new_FSFile(*args, **kwargs)
d14a1e28
RD
1588 self.this = newobj.this
1589 self.thisown = 1
1590 del newobj.thisown
54f9ee45 1591 def __del__(self, destroy=_core_.delete_FSFile):
a95a7133 1592 """__del__(self)"""
d14a1e28
RD
1593 try:
1594 if self.thisown: destroy(self)
1595 except: pass
e811c8ce
RD
1596
1597 def GetStream(*args, **kwargs):
a95a7133 1598 """GetStream(self) -> InputStream"""
54f9ee45 1599 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce
RD
1600
1601 def GetMimeType(*args, **kwargs):
a95a7133 1602 """GetMimeType(self) -> String"""
54f9ee45 1603 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
1604
1605 def GetLocation(*args, **kwargs):
a95a7133 1606 """GetLocation(self) -> String"""
54f9ee45 1607 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
1608
1609 def GetAnchor(*args, **kwargs):
a95a7133 1610 """GetAnchor(self) -> String"""
54f9ee45 1611 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
1612
1613 def GetModificationTime(*args, **kwargs):
a95a7133 1614 """GetModificationTime(self) -> DateTime"""
54f9ee45 1615 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 1616
d14a1e28
RD
1617
1618class FSFilePtr(FSFile):
1619 def __init__(self, this):
1620 self.this = this
1621 if not hasattr(self,"thisown"): self.thisown = 0
1622 self.__class__ = FSFile
54f9ee45 1623_core_.FSFile_swigregister(FSFilePtr)
d14a1e28
RD
1624
1625class CPPFileSystemHandler(object):
1626 def __init__(self): raise RuntimeError, "No constructor defined"
1627 def __repr__(self):
1628 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1629
1630class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1631 def __init__(self, this):
1632 self.this = this
1633 if not hasattr(self,"thisown"): self.thisown = 0
1634 self.__class__ = CPPFileSystemHandler
54f9ee45 1635_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
d14a1e28
RD
1636
1637class FileSystemHandler(CPPFileSystemHandler):
e811c8ce
RD
1638 def __repr__(self):
1639 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1640 def __init__(self, *args, **kwargs):
a95a7133 1641 """__init__(self) -> FileSystemHandler"""
54f9ee45 1642 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
d14a1e28
RD
1643 self.this = newobj.this
1644 self.thisown = 1
1645 del newobj.thisown
1646 self._setCallbackInfo(self, FileSystemHandler)
e811c8ce
RD
1647
1648 def _setCallbackInfo(*args, **kwargs):
a95a7133 1649 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 1650 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
1651
1652 def CanOpen(*args, **kwargs):
a95a7133 1653 """CanOpen(self, String location) -> bool"""
54f9ee45 1654 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1655
1656 def OpenFile(*args, **kwargs):
a95a7133 1657 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1658 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1659
1660 def FindFirst(*args, **kwargs):
a95a7133 1661 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1662 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1663
1664 def FindNext(*args, **kwargs):
a95a7133 1665 """FindNext(self) -> String"""
54f9ee45 1666 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
1667
1668 def GetProtocol(*args, **kwargs):
a95a7133 1669 """GetProtocol(self, String location) -> String"""
54f9ee45 1670 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
1671
1672 def GetLeftLocation(*args, **kwargs):
a95a7133 1673 """GetLeftLocation(self, String location) -> String"""
54f9ee45 1674 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
1675
1676 def GetAnchor(*args, **kwargs):
a95a7133 1677 """GetAnchor(self, String location) -> String"""
54f9ee45 1678 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
1679
1680 def GetRightLocation(*args, **kwargs):
a95a7133 1681 """GetRightLocation(self, String location) -> String"""
54f9ee45 1682 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
1683
1684 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 1685 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 1686 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 1687
d14a1e28
RD
1688
1689class FileSystemHandlerPtr(FileSystemHandler):
1690 def __init__(self, this):
1691 self.this = this
1692 if not hasattr(self,"thisown"): self.thisown = 0
1693 self.__class__ = FileSystemHandler
54f9ee45 1694_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
d14a1e28
RD
1695
1696class FileSystem(Object):
e811c8ce
RD
1697 def __repr__(self):
1698 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1699 def __init__(self, *args, **kwargs):
a95a7133 1700 """__init__(self) -> FileSystem"""
54f9ee45 1701 newobj = _core_.new_FileSystem(*args, **kwargs)
d14a1e28
RD
1702 self.this = newobj.this
1703 self.thisown = 1
1704 del newobj.thisown
54f9ee45 1705 def __del__(self, destroy=_core_.delete_FileSystem):
a95a7133 1706 """__del__(self)"""
d14a1e28
RD
1707 try:
1708 if self.thisown: destroy(self)
1709 except: pass
e811c8ce
RD
1710
1711 def ChangePathTo(*args, **kwargs):
a95a7133 1712 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 1713 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
1714
1715 def GetPath(*args, **kwargs):
a95a7133 1716 """GetPath(self) -> String"""
54f9ee45 1717 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
1718
1719 def OpenFile(*args, **kwargs):
a95a7133 1720 """OpenFile(self, String location) -> FSFile"""
54f9ee45 1721 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
1722
1723 def FindFirst(*args, **kwargs):
a95a7133 1724 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1725 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
1726
1727 def FindNext(*args, **kwargs):
a95a7133 1728 """FindNext(self) -> String"""
54f9ee45 1729 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
1730
1731 def AddHandler(*args, **kwargs):
66c033b4 1732 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1733 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
1734
1735 AddHandler = staticmethod(AddHandler)
1736 def CleanUpHandlers(*args, **kwargs):
66c033b4 1737 """CleanUpHandlers()"""
54f9ee45 1738 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
1739
1740 CleanUpHandlers = staticmethod(CleanUpHandlers)
1741 def FileNameToURL(*args, **kwargs):
66c033b4 1742 """FileNameToURL(String filename) -> String"""
54f9ee45 1743 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
1744
1745 FileNameToURL = staticmethod(FileNameToURL)
d14a1e28
RD
1746
1747class FileSystemPtr(FileSystem):
1748 def __init__(self, this):
1749 self.this = this
1750 if not hasattr(self,"thisown"): self.thisown = 0
1751 self.__class__ = FileSystem
54f9ee45 1752_core_.FileSystem_swigregister(FileSystemPtr)
d14a1e28 1753
e811c8ce
RD
1754def FileSystem_AddHandler(*args, **kwargs):
1755 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1756 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 1757
e811c8ce
RD
1758def FileSystem_CleanUpHandlers(*args, **kwargs):
1759 """FileSystem_CleanUpHandlers()"""
54f9ee45 1760 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d14a1e28 1761
e811c8ce 1762def FileSystem_FileNameToURL(*args, **kwargs):
196addbf 1763 """FileSystem_FileNameToURL(String filename) -> String"""
54f9ee45 1764 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28
RD
1765
1766
e811c8ce 1767def FileSystem_URLToFileName(*args, **kwargs):
196addbf 1768 """FileSystem_URLToFileName(String url) -> String"""
54f9ee45 1769 return _core_.FileSystem_URLToFileName(*args, **kwargs)
d14a1e28 1770class InternetFSHandler(CPPFileSystemHandler):
e811c8ce
RD
1771 def __repr__(self):
1772 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1773 def __init__(self, *args, **kwargs):
a95a7133 1774 """__init__(self) -> InternetFSHandler"""
54f9ee45 1775 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
d14a1e28
RD
1776 self.this = newobj.this
1777 self.thisown = 1
1778 del newobj.thisown
e811c8ce 1779 def CanOpen(*args, **kwargs):
a95a7133 1780 """CanOpen(self, String location) -> bool"""
54f9ee45 1781 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1782
1783 def OpenFile(*args, **kwargs):
a95a7133 1784 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1785 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 1786
d14a1e28
RD
1787
1788class InternetFSHandlerPtr(InternetFSHandler):
1789 def __init__(self, this):
1790 self.this = this
1791 if not hasattr(self,"thisown"): self.thisown = 0
1792 self.__class__ = InternetFSHandler
54f9ee45 1793_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
d14a1e28
RD
1794
1795class ZipFSHandler(CPPFileSystemHandler):
e811c8ce
RD
1796 def __repr__(self):
1797 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1798 def __init__(self, *args, **kwargs):
a95a7133 1799 """__init__(self) -> ZipFSHandler"""
54f9ee45 1800 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
d14a1e28
RD
1801 self.this = newobj.this
1802 self.thisown = 1
1803 del newobj.thisown
e811c8ce 1804 def CanOpen(*args, **kwargs):
a95a7133 1805 """CanOpen(self, String location) -> bool"""
54f9ee45 1806 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1807
1808 def OpenFile(*args, **kwargs):
a95a7133 1809 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1810 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1811
1812 def FindFirst(*args, **kwargs):
a95a7133 1813 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1814 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1815
1816 def FindNext(*args, **kwargs):
a95a7133 1817 """FindNext(self) -> String"""
54f9ee45 1818 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 1819
d14a1e28
RD
1820
1821class ZipFSHandlerPtr(ZipFSHandler):
1822 def __init__(self, this):
1823 self.this = this
1824 if not hasattr(self,"thisown"): self.thisown = 0
1825 self.__class__ = ZipFSHandler
54f9ee45 1826_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
d14a1e28
RD
1827
1828
e811c8ce 1829def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
196addbf 1830 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
54f9ee45 1831 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 1832
e811c8ce 1833def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
196addbf 1834 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
54f9ee45 1835 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 1836
e811c8ce 1837def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
196addbf 1838 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
54f9ee45 1839 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
d14a1e28
RD
1840def MemoryFSHandler_AddFile(filename, a, b=''):
1841 if isinstance(a, wx.Image):
1842 __wxMemoryFSHandler_AddFile_wxImage(filename, a, b)
1843 elif isinstance(a, wx.Bitmap):
1844 __wxMemoryFSHandler_AddFile_wxBitmap(filename, a, b)
1845 elif type(a) == str:
1846 __wxMemoryFSHandler_AddFile_Data(filename, a)
1847 else: raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1848
1849class MemoryFSHandler(CPPFileSystemHandler):
e811c8ce
RD
1850 def __repr__(self):
1851 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1852 def __init__(self, *args, **kwargs):
a95a7133 1853 """__init__(self) -> MemoryFSHandler"""
54f9ee45 1854 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
d14a1e28
RD
1855 self.this = newobj.this
1856 self.thisown = 1
1857 del newobj.thisown
e811c8ce 1858 def RemoveFile(*args, **kwargs):
66c033b4 1859 """RemoveFile(String filename)"""
54f9ee45 1860 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
1861
1862 RemoveFile = staticmethod(RemoveFile)
d14a1e28 1863 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 1864 def CanOpen(*args, **kwargs):
a95a7133 1865 """CanOpen(self, String location) -> bool"""
54f9ee45 1866 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1867
1868 def OpenFile(*args, **kwargs):
a95a7133 1869 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1870 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1871
1872 def FindFirst(*args, **kwargs):
a95a7133 1873 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1874 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1875
1876 def FindNext(*args, **kwargs):
a95a7133 1877 """FindNext(self) -> String"""
54f9ee45 1878 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 1879
d14a1e28
RD
1880
1881class MemoryFSHandlerPtr(MemoryFSHandler):
1882 def __init__(self, this):
1883 self.this = this
1884 if not hasattr(self,"thisown"): self.thisown = 0
1885 self.__class__ = MemoryFSHandler
54f9ee45 1886_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
d14a1e28 1887
e811c8ce 1888def MemoryFSHandler_RemoveFile(*args, **kwargs):
196addbf 1889 """MemoryFSHandler_RemoveFile(String filename)"""
54f9ee45 1890 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28
RD
1891
1892#---------------------------------------------------------------------------
1893
1894class ImageHandler(Object):
d14a1e28
RD
1895 def __init__(self): raise RuntimeError, "No constructor defined"
1896 def __repr__(self):
1897 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 1898 def GetName(*args, **kwargs):
a95a7133 1899 """GetName(self) -> String"""
54f9ee45 1900 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
1901
1902 def GetExtension(*args, **kwargs):
a95a7133 1903 """GetExtension(self) -> String"""
54f9ee45 1904 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
1905
1906 def GetType(*args, **kwargs):
a95a7133 1907 """GetType(self) -> long"""
54f9ee45 1908 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
1909
1910 def GetMimeType(*args, **kwargs):
a95a7133 1911 """GetMimeType(self) -> String"""
54f9ee45 1912 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
1913
1914 def CanRead(*args, **kwargs):
a95a7133 1915 """CanRead(self, String name) -> bool"""
54f9ee45 1916 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce
RD
1917
1918 def SetName(*args, **kwargs):
a95a7133 1919 """SetName(self, String name)"""
54f9ee45 1920 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
1921
1922 def SetExtension(*args, **kwargs):
a95a7133 1923 """SetExtension(self, String extension)"""
54f9ee45 1924 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
1925
1926 def SetType(*args, **kwargs):
a95a7133 1927 """SetType(self, long type)"""
54f9ee45 1928 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
1929
1930 def SetMimeType(*args, **kwargs):
a95a7133 1931 """SetMimeType(self, String mimetype)"""
54f9ee45 1932 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 1933
d14a1e28
RD
1934
1935class ImageHandlerPtr(ImageHandler):
1936 def __init__(self, this):
1937 self.this = this
1938 if not hasattr(self,"thisown"): self.thisown = 0
1939 self.__class__ = ImageHandler
54f9ee45 1940_core_.ImageHandler_swigregister(ImageHandlerPtr)
d14a1e28
RD
1941
1942class ImageHistogram(object):
e811c8ce
RD
1943 def __repr__(self):
1944 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1945 def __init__(self, *args, **kwargs):
a95a7133 1946 """__init__(self) -> ImageHistogram"""
54f9ee45 1947 newobj = _core_.new_ImageHistogram(*args, **kwargs)
d14a1e28
RD
1948 self.this = newobj.this
1949 self.thisown = 1
1950 del newobj.thisown
e811c8ce 1951 def MakeKey(*args, **kwargs):
0df68c9f 1952 """
66c033b4 1953 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
e811c8ce 1954
0df68c9f
RD
1955 Get the key in the histogram for the given RGB values
1956 """
54f9ee45 1957 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
1958
1959 MakeKey = staticmethod(MakeKey)
1960 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
1961 """
1962 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
1963
1964 Find first colour that is not used in the image and has higher RGB
1965 values than startR, startG, startB. Returns a tuple consisting of a
1966 success flag and rgb values.
1967 """
54f9ee45 1968 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 1969
d14a1e28
RD
1970
1971class ImageHistogramPtr(ImageHistogram):
1972 def __init__(self, this):
1973 self.this = this
1974 if not hasattr(self,"thisown"): self.thisown = 0
1975 self.__class__ = ImageHistogram
54f9ee45 1976_core_.ImageHistogram_swigregister(ImageHistogramPtr)
d14a1e28 1977
e811c8ce 1978def ImageHistogram_MakeKey(*args, **kwargs):
0df68c9f
RD
1979 """
1980 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
e811c8ce 1981
0df68c9f
RD
1982 Get the key in the histogram for the given RGB values
1983 """
54f9ee45 1984 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28
RD
1985
1986class Image(Object):
e811c8ce
RD
1987 def __repr__(self):
1988 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 1989 def __init__(self, *args, **kwargs):
a95a7133 1990 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
54f9ee45 1991 newobj = _core_.new_Image(*args, **kwargs)
d14a1e28
RD
1992 self.this = newobj.this
1993 self.thisown = 1
1994 del newobj.thisown
54f9ee45 1995 def __del__(self, destroy=_core_.delete_Image):
a95a7133 1996 """__del__(self)"""
d14a1e28
RD
1997 try:
1998 if self.thisown: destroy(self)
1999 except: pass
e811c8ce
RD
2000
2001 def Create(*args, **kwargs):
a95a7133 2002 """Create(self, int width, int height)"""
54f9ee45 2003 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2004
2005 def Destroy(*args, **kwargs):
0df68c9f 2006 """
a95a7133 2007 Destroy(self)
e811c8ce 2008
0df68c9f
RD
2009 Deletes the C++ object this Python object is a proxy for.
2010 """
54f9ee45 2011 return _core_.Image_Destroy(*args, **kwargs)
e811c8ce
RD
2012
2013 def Scale(*args, **kwargs):
a95a7133 2014 """Scale(self, int width, int height) -> Image"""
54f9ee45 2015 return _core_.Image_Scale(*args, **kwargs)
e811c8ce
RD
2016
2017 def ShrinkBy(*args, **kwargs):
a95a7133 2018 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
54f9ee45 2019 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2020
2021 def Rescale(*args, **kwargs):
a95a7133 2022 """Rescale(self, int width, int height) -> Image"""
54f9ee45 2023 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce
RD
2024
2025 def SetRGB(*args, **kwargs):
a95a7133 2026 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
54f9ee45 2027 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce
RD
2028
2029 def GetRed(*args, **kwargs):
a95a7133 2030 """GetRed(self, int x, int y) -> unsigned char"""
54f9ee45 2031 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2032
2033 def GetGreen(*args, **kwargs):
a95a7133 2034 """GetGreen(self, int x, int y) -> unsigned char"""
54f9ee45 2035 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2036
2037 def GetBlue(*args, **kwargs):
a95a7133 2038 """GetBlue(self, int x, int y) -> unsigned char"""
54f9ee45 2039 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2040
2041 def SetAlpha(*args, **kwargs):
a95a7133 2042 """SetAlpha(self, int x, int y, unsigned char alpha)"""
54f9ee45 2043 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2044
2045 def GetAlpha(*args, **kwargs):
a95a7133 2046 """GetAlpha(self, int x, int y) -> unsigned char"""
54f9ee45 2047 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2048
2049 def HasAlpha(*args, **kwargs):
a95a7133 2050 """HasAlpha(self) -> bool"""
54f9ee45 2051 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce
RD
2052
2053 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2054 """
2055 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2056
2057 Find first colour that is not used in the image and has higher RGB
2058 values than startR, startG, startB. Returns a tuple consisting of a
2059 success flag and rgb values.
2060 """
54f9ee45 2061 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce
RD
2062
2063 def SetMaskFromImage(*args, **kwargs):
a95a7133 2064 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
54f9ee45 2065 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2066
2067 def CanRead(*args, **kwargs):
66c033b4 2068 """CanRead(String name) -> bool"""
54f9ee45 2069 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2070
2071 CanRead = staticmethod(CanRead)
2072 def GetImageCount(*args, **kwargs):
66c033b4 2073 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
54f9ee45 2074 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2075
2076 GetImageCount = staticmethod(GetImageCount)
2077 def LoadFile(*args, **kwargs):
a95a7133 2078 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
54f9ee45 2079 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2080
2081 def LoadMimeFile(*args, **kwargs):
a95a7133 2082 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
54f9ee45 2083 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2084
2085 def SaveFile(*args, **kwargs):
a95a7133 2086 """SaveFile(self, String name, int type) -> bool"""
54f9ee45 2087 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2088
2089 def SaveMimeFile(*args, **kwargs):
a95a7133 2090 """SaveMimeFile(self, String name, String mimetype) -> bool"""
54f9ee45 2091 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2092
2093 def CanReadStream(*args, **kwargs):
66c033b4 2094 """CanReadStream(InputStream stream) -> bool"""
54f9ee45 2095 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2096
2097 CanReadStream = staticmethod(CanReadStream)
2098 def LoadStream(*args, **kwargs):
a95a7133 2099 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
54f9ee45 2100 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2101
2102 def LoadMimeStream(*args, **kwargs):
a95a7133 2103 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
54f9ee45 2104 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce
RD
2105
2106 def Ok(*args, **kwargs):
a95a7133 2107 """Ok(self) -> bool"""
54f9ee45 2108 return _core_.Image_Ok(*args, **kwargs)
e811c8ce
RD
2109
2110 def GetWidth(*args, **kwargs):
a95a7133 2111 """GetWidth(self) -> int"""
54f9ee45 2112 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2113
2114 def GetHeight(*args, **kwargs):
a95a7133 2115 """GetHeight(self) -> int"""
54f9ee45 2116 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2117
b2df227b 2118 def GetSize(*args, **kwargs):
a95a7133 2119 """GetSize(self) -> Size"""
54f9ee45 2120 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2121
e811c8ce 2122 def GetSubImage(*args, **kwargs):
a95a7133 2123 """GetSubImage(self, Rect rect) -> Image"""
54f9ee45 2124 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce
RD
2125
2126 def Copy(*args, **kwargs):
a95a7133 2127 """Copy(self) -> Image"""
54f9ee45 2128 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2129
2130 def Paste(*args, **kwargs):
a95a7133 2131 """Paste(self, Image image, int x, int y)"""
54f9ee45 2132 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2133
2134 def GetData(*args, **kwargs):
a95a7133 2135 """GetData(self) -> PyObject"""
54f9ee45 2136 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2137
2138 def SetData(*args, **kwargs):
a95a7133 2139 """SetData(self, PyObject data)"""
54f9ee45 2140 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
2141
2142 def GetDataBuffer(*args, **kwargs):
a95a7133 2143 """GetDataBuffer(self) -> PyObject"""
54f9ee45 2144 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
2145
2146 def SetDataBuffer(*args, **kwargs):
a95a7133 2147 """SetDataBuffer(self, PyObject data)"""
54f9ee45 2148 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
2149
2150 def GetAlphaData(*args, **kwargs):
a95a7133 2151 """GetAlphaData(self) -> PyObject"""
54f9ee45 2152 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
2153
2154 def SetAlphaData(*args, **kwargs):
a95a7133 2155 """SetAlphaData(self, PyObject data)"""
54f9ee45 2156 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
2157
2158 def GetAlphaBuffer(*args, **kwargs):
a95a7133 2159 """GetAlphaBuffer(self) -> PyObject"""
54f9ee45 2160 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2161
2162 def SetAlphaBuffer(*args, **kwargs):
a95a7133 2163 """SetAlphaBuffer(self, PyObject data)"""
54f9ee45 2164 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2165
2166 def SetMaskColour(*args, **kwargs):
a95a7133 2167 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
54f9ee45 2168 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce
RD
2169
2170 def GetMaskRed(*args, **kwargs):
a95a7133 2171 """GetMaskRed(self) -> unsigned char"""
54f9ee45 2172 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
2173
2174 def GetMaskGreen(*args, **kwargs):
a95a7133 2175 """GetMaskGreen(self) -> unsigned char"""
54f9ee45 2176 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
2177
2178 def GetMaskBlue(*args, **kwargs):
a95a7133 2179 """GetMaskBlue(self) -> unsigned char"""
54f9ee45 2180 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
2181
2182 def SetMask(*args, **kwargs):
a95a7133 2183 """SetMask(self, bool mask=True)"""
54f9ee45 2184 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
2185
2186 def HasMask(*args, **kwargs):
a95a7133 2187 """HasMask(self) -> bool"""
54f9ee45 2188 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
2189
2190 def Rotate(*args, **kwargs):
0df68c9f 2191 """
a95a7133 2192 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f
RD
2193 Point offset_after_rotation=None) -> Image
2194 """
54f9ee45 2195 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
2196
2197 def Rotate90(*args, **kwargs):
a95a7133 2198 """Rotate90(self, bool clockwise=True) -> Image"""
54f9ee45 2199 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
2200
2201 def Mirror(*args, **kwargs):
a95a7133 2202 """Mirror(self, bool horizontally=True) -> Image"""
54f9ee45 2203 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
2204
2205 def Replace(*args, **kwargs):
0df68c9f 2206 """
a95a7133 2207 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
0df68c9f
RD
2208 unsigned char r2, unsigned char g2, unsigned char b2)
2209 """
54f9ee45 2210 return _core_.Image_Replace(*args, **kwargs)
e811c8ce
RD
2211
2212 def ConvertToMono(*args, **kwargs):
a95a7133 2213 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
54f9ee45 2214 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
2215
2216 def SetOption(*args, **kwargs):
a95a7133 2217 """SetOption(self, String name, String value)"""
54f9ee45 2218 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
2219
2220 def SetOptionInt(*args, **kwargs):
a95a7133 2221 """SetOptionInt(self, String name, int value)"""
54f9ee45 2222 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
2223
2224 def GetOption(*args, **kwargs):
a95a7133 2225 """GetOption(self, String name) -> String"""
54f9ee45 2226 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
2227
2228 def GetOptionInt(*args, **kwargs):
a95a7133 2229 """GetOptionInt(self, String name) -> int"""
54f9ee45 2230 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
2231
2232 def HasOption(*args, **kwargs):
a95a7133 2233 """HasOption(self, String name) -> bool"""
54f9ee45 2234 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
2235
2236 def CountColours(*args, **kwargs):
a95a7133 2237 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 2238 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
2239
2240 def ComputeHistogram(*args, **kwargs):
a95a7133 2241 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 2242 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
2243
2244 def AddHandler(*args, **kwargs):
66c033b4 2245 """AddHandler(ImageHandler handler)"""
54f9ee45 2246 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
2247
2248 AddHandler = staticmethod(AddHandler)
2249 def InsertHandler(*args, **kwargs):
66c033b4 2250 """InsertHandler(ImageHandler handler)"""
54f9ee45 2251 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
2252
2253 InsertHandler = staticmethod(InsertHandler)
2254 def RemoveHandler(*args, **kwargs):
66c033b4 2255 """RemoveHandler(String name) -> bool"""
54f9ee45 2256 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
2257
2258 RemoveHandler = staticmethod(RemoveHandler)
2259 def GetImageExtWildcard(*args, **kwargs):
66c033b4 2260 """GetImageExtWildcard() -> String"""
54f9ee45 2261 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
2262
2263 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2264 def ConvertToBitmap(*args, **kwargs):
a95a7133 2265 """ConvertToBitmap(self) -> Bitmap"""
54f9ee45 2266 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
2267
2268 def ConvertToMonoBitmap(*args, **kwargs):
a95a7133 2269 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
54f9ee45 2270 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce
RD
2271
2272 def __nonzero__(self): return self.Ok()
d14a1e28
RD
2273
2274class ImagePtr(Image):
2275 def __init__(self, this):
2276 self.this = this
2277 if not hasattr(self,"thisown"): self.thisown = 0
2278 self.__class__ = Image
54f9ee45 2279_core_.Image_swigregister(ImagePtr)
d14a1e28
RD
2280
2281def ImageFromMime(*args, **kwargs):
196addbf 2282 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
54f9ee45 2283 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
2284 val.thisown = 1
2285 return val
2286
2287def ImageFromStream(*args, **kwargs):
196addbf 2288 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
54f9ee45 2289 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
2290 val.thisown = 1
2291 return val
2292
2293def ImageFromStreamMime(*args, **kwargs):
196addbf 2294 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
54f9ee45 2295 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
2296 val.thisown = 1
2297 return val
2298
66c033b4
RD
2299def EmptyImage(*args, **kwargs):
2300 """EmptyImage(int width=0, int height=0, bool clear=True) -> Image"""
2301 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
2302 val.thisown = 1
2303 return val
2304
2305def ImageFromBitmap(*args, **kwargs):
196addbf 2306 """ImageFromBitmap(Bitmap bitmap) -> Image"""
54f9ee45 2307 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
2308 val.thisown = 1
2309 return val
2310
2311def ImageFromData(*args, **kwargs):
e811c8ce 2312 """ImageFromData(int width, int height, unsigned char data) -> Image"""
54f9ee45 2313 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
2314 val.thisown = 1
2315 return val
2316
e811c8ce 2317def Image_CanRead(*args, **kwargs):
196addbf 2318 """Image_CanRead(String name) -> bool"""
54f9ee45 2319 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 2320
e811c8ce 2321def Image_GetImageCount(*args, **kwargs):
196addbf 2322 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
54f9ee45 2323 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 2324
e811c8ce 2325def Image_CanReadStream(*args, **kwargs):
196addbf 2326 """Image_CanReadStream(InputStream stream) -> bool"""
54f9ee45 2327 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 2328
e811c8ce
RD
2329def Image_AddHandler(*args, **kwargs):
2330 """Image_AddHandler(ImageHandler handler)"""
54f9ee45 2331 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 2332
e811c8ce
RD
2333def Image_InsertHandler(*args, **kwargs):
2334 """Image_InsertHandler(ImageHandler handler)"""
54f9ee45 2335 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 2336
e811c8ce 2337def Image_RemoveHandler(*args, **kwargs):
196addbf 2338 """Image_RemoveHandler(String name) -> bool"""
54f9ee45 2339 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 2340
e811c8ce 2341def Image_GetImageExtWildcard(*args, **kwargs):
196addbf 2342 """Image_GetImageExtWildcard() -> String"""
54f9ee45 2343 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d14a1e28 2344
5e4ca4a8
RD
2345def InitAllImageHandlers():
2346 """
2347 The former functionality of InitAllImageHanders is now done internal to
2348 the _core_ extension module and so this function has become a simple NOP.
2349 """
2350 pass
d14a1e28 2351
54f9ee45
RD
2352IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2353IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2354BMP_24BPP = _core_.BMP_24BPP
2355BMP_8BPP = _core_.BMP_8BPP
2356BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2357BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2358BMP_8BPP_RED = _core_.BMP_8BPP_RED
2359BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2360BMP_4BPP = _core_.BMP_4BPP
2361BMP_1BPP = _core_.BMP_1BPP
2362BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 2363class BMPHandler(ImageHandler):
e811c8ce
RD
2364 def __repr__(self):
2365 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2366 def __init__(self, *args, **kwargs):
a95a7133 2367 """__init__(self) -> BMPHandler"""
54f9ee45 2368 newobj = _core_.new_BMPHandler(*args, **kwargs)
d14a1e28
RD
2369 self.this = newobj.this
2370 self.thisown = 1
2371 del newobj.thisown
d14a1e28
RD
2372
2373class BMPHandlerPtr(BMPHandler):
2374 def __init__(self, this):
2375 self.this = this
2376 if not hasattr(self,"thisown"): self.thisown = 0
2377 self.__class__ = BMPHandler
54f9ee45 2378_core_.BMPHandler_swigregister(BMPHandlerPtr)
d14a1e28
RD
2379NullImage = cvar.NullImage
2380IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2381IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2382IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2383IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
2384IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
2385
2386class ICOHandler(BMPHandler):
e811c8ce
RD
2387 def __repr__(self):
2388 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2389 def __init__(self, *args, **kwargs):
a95a7133 2390 """__init__(self) -> ICOHandler"""
54f9ee45 2391 newobj = _core_.new_ICOHandler(*args, **kwargs)
d14a1e28
RD
2392 self.this = newobj.this
2393 self.thisown = 1
2394 del newobj.thisown
d14a1e28
RD
2395
2396class ICOHandlerPtr(ICOHandler):
2397 def __init__(self, this):
2398 self.this = this
2399 if not hasattr(self,"thisown"): self.thisown = 0
2400 self.__class__ = ICOHandler
54f9ee45 2401_core_.ICOHandler_swigregister(ICOHandlerPtr)
d14a1e28
RD
2402
2403class CURHandler(ICOHandler):
e811c8ce
RD
2404 def __repr__(self):
2405 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2406 def __init__(self, *args, **kwargs):
a95a7133 2407 """__init__(self) -> CURHandler"""
54f9ee45 2408 newobj = _core_.new_CURHandler(*args, **kwargs)
d14a1e28
RD
2409 self.this = newobj.this
2410 self.thisown = 1
2411 del newobj.thisown
d14a1e28
RD
2412
2413class CURHandlerPtr(CURHandler):
2414 def __init__(self, this):
2415 self.this = this
2416 if not hasattr(self,"thisown"): self.thisown = 0
2417 self.__class__ = CURHandler
54f9ee45 2418_core_.CURHandler_swigregister(CURHandlerPtr)
d14a1e28
RD
2419
2420class ANIHandler(CURHandler):
e811c8ce
RD
2421 def __repr__(self):
2422 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2423 def __init__(self, *args, **kwargs):
a95a7133 2424 """__init__(self) -> ANIHandler"""
54f9ee45 2425 newobj = _core_.new_ANIHandler(*args, **kwargs)
d14a1e28
RD
2426 self.this = newobj.this
2427 self.thisown = 1
2428 del newobj.thisown
d14a1e28
RD
2429
2430class ANIHandlerPtr(ANIHandler):
2431 def __init__(self, this):
2432 self.this = this
2433 if not hasattr(self,"thisown"): self.thisown = 0
2434 self.__class__ = ANIHandler
54f9ee45 2435_core_.ANIHandler_swigregister(ANIHandlerPtr)
d14a1e28
RD
2436
2437class PNGHandler(ImageHandler):
e811c8ce
RD
2438 def __repr__(self):
2439 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2440 def __init__(self, *args, **kwargs):
a95a7133 2441 """__init__(self) -> PNGHandler"""
54f9ee45 2442 newobj = _core_.new_PNGHandler(*args, **kwargs)
d14a1e28
RD
2443 self.this = newobj.this
2444 self.thisown = 1
2445 del newobj.thisown
d14a1e28
RD
2446
2447class PNGHandlerPtr(PNGHandler):
2448 def __init__(self, this):
2449 self.this = this
2450 if not hasattr(self,"thisown"): self.thisown = 0
2451 self.__class__ = PNGHandler
54f9ee45 2452_core_.PNGHandler_swigregister(PNGHandlerPtr)
d14a1e28
RD
2453
2454class GIFHandler(ImageHandler):
e811c8ce
RD
2455 def __repr__(self):
2456 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2457 def __init__(self, *args, **kwargs):
a95a7133 2458 """__init__(self) -> GIFHandler"""
54f9ee45 2459 newobj = _core_.new_GIFHandler(*args, **kwargs)
d14a1e28
RD
2460 self.this = newobj.this
2461 self.thisown = 1
2462 del newobj.thisown
d14a1e28
RD
2463
2464class GIFHandlerPtr(GIFHandler):
2465 def __init__(self, this):
2466 self.this = this
2467 if not hasattr(self,"thisown"): self.thisown = 0
2468 self.__class__ = GIFHandler
54f9ee45 2469_core_.GIFHandler_swigregister(GIFHandlerPtr)
d14a1e28
RD
2470
2471class PCXHandler(ImageHandler):
e811c8ce
RD
2472 def __repr__(self):
2473 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2474 def __init__(self, *args, **kwargs):
a95a7133 2475 """__init__(self) -> PCXHandler"""
54f9ee45 2476 newobj = _core_.new_PCXHandler(*args, **kwargs)
d14a1e28
RD
2477 self.this = newobj.this
2478 self.thisown = 1
2479 del newobj.thisown
d14a1e28
RD
2480
2481class PCXHandlerPtr(PCXHandler):
2482 def __init__(self, this):
2483 self.this = this
2484 if not hasattr(self,"thisown"): self.thisown = 0
2485 self.__class__ = PCXHandler
54f9ee45 2486_core_.PCXHandler_swigregister(PCXHandlerPtr)
d14a1e28
RD
2487
2488class JPEGHandler(ImageHandler):
e811c8ce
RD
2489 def __repr__(self):
2490 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2491 def __init__(self, *args, **kwargs):
a95a7133 2492 """__init__(self) -> JPEGHandler"""
54f9ee45 2493 newobj = _core_.new_JPEGHandler(*args, **kwargs)
d14a1e28
RD
2494 self.this = newobj.this
2495 self.thisown = 1
2496 del newobj.thisown
d14a1e28
RD
2497
2498class JPEGHandlerPtr(JPEGHandler):
2499 def __init__(self, this):
2500 self.this = this
2501 if not hasattr(self,"thisown"): self.thisown = 0
2502 self.__class__ = JPEGHandler
54f9ee45 2503_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
d14a1e28
RD
2504
2505class PNMHandler(ImageHandler):
e811c8ce
RD
2506 def __repr__(self):
2507 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2508 def __init__(self, *args, **kwargs):
a95a7133 2509 """__init__(self) -> PNMHandler"""
54f9ee45 2510 newobj = _core_.new_PNMHandler(*args, **kwargs)
d14a1e28
RD
2511 self.this = newobj.this
2512 self.thisown = 1
2513 del newobj.thisown
d14a1e28
RD
2514
2515class PNMHandlerPtr(PNMHandler):
2516 def __init__(self, this):
2517 self.this = this
2518 if not hasattr(self,"thisown"): self.thisown = 0
2519 self.__class__ = PNMHandler
54f9ee45 2520_core_.PNMHandler_swigregister(PNMHandlerPtr)
d14a1e28
RD
2521
2522class XPMHandler(ImageHandler):
e811c8ce
RD
2523 def __repr__(self):
2524 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2525 def __init__(self, *args, **kwargs):
a95a7133 2526 """__init__(self) -> XPMHandler"""
54f9ee45 2527 newobj = _core_.new_XPMHandler(*args, **kwargs)
d14a1e28
RD
2528 self.this = newobj.this
2529 self.thisown = 1
2530 del newobj.thisown
d14a1e28
RD
2531
2532class XPMHandlerPtr(XPMHandler):
2533 def __init__(self, this):
2534 self.this = this
2535 if not hasattr(self,"thisown"): self.thisown = 0
2536 self.__class__ = XPMHandler
54f9ee45 2537_core_.XPMHandler_swigregister(XPMHandlerPtr)
d14a1e28
RD
2538
2539class TIFFHandler(ImageHandler):
e811c8ce
RD
2540 def __repr__(self):
2541 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2542 def __init__(self, *args, **kwargs):
a95a7133 2543 """__init__(self) -> TIFFHandler"""
54f9ee45 2544 newobj = _core_.new_TIFFHandler(*args, **kwargs)
d14a1e28
RD
2545 self.this = newobj.this
2546 self.thisown = 1
2547 del newobj.thisown
d14a1e28
RD
2548
2549class TIFFHandlerPtr(TIFFHandler):
2550 def __init__(self, this):
2551 self.this = this
2552 if not hasattr(self,"thisown"): self.thisown = 0
2553 self.__class__ = TIFFHandler
54f9ee45 2554_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
d14a1e28
RD
2555
2556#---------------------------------------------------------------------------
2557
2558class EvtHandler(Object):
e811c8ce
RD
2559 def __repr__(self):
2560 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 2561 def __init__(self, *args, **kwargs):
a95a7133 2562 """__init__(self) -> EvtHandler"""
54f9ee45 2563 newobj = _core_.new_EvtHandler(*args, **kwargs)
d14a1e28
RD
2564 self.this = newobj.this
2565 self.thisown = 1
2566 del newobj.thisown
e811c8ce 2567 def GetNextHandler(*args, **kwargs):
a95a7133 2568 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 2569 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
2570
2571 def GetPreviousHandler(*args, **kwargs):
a95a7133 2572 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 2573 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
2574
2575 def SetNextHandler(*args, **kwargs):
a95a7133 2576 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 2577 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
2578
2579 def SetPreviousHandler(*args, **kwargs):
a95a7133 2580 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 2581 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
2582
2583 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 2584 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 2585 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
2586
2587 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 2588 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 2589 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
2590
2591 def ProcessEvent(*args, **kwargs):
a95a7133 2592 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 2593 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
2594
2595 def AddPendingEvent(*args, **kwargs):
a95a7133 2596 """AddPendingEvent(self, Event event)"""
54f9ee45 2597 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
2598
2599 def ProcessPendingEvents(*args, **kwargs):
a95a7133 2600 """ProcessPendingEvents(self)"""
54f9ee45 2601 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
2602
2603 def Connect(*args, **kwargs):
a95a7133 2604 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 2605 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
2606
2607 def Disconnect(*args, **kwargs):
a95a7133 2608 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 2609 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
2610
2611 def _setOORInfo(*args, **kwargs):
a95a7133 2612 """_setOORInfo(self, PyObject _self)"""
54f9ee45 2613 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
e811c8ce 2614
d14a1e28
RD
2615 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2616 """
2617 Bind an event to an event handler.
2618
db3e571a
RD
2619 :param event: One of the EVT_* objects that specifies the
2620 type of event to bind,
d14a1e28 2621
db3e571a
RD
2622 :param handler: A callable object to be invoked when the
2623 event is delivered to self. Pass None to
2624 disconnect an event handler.
d14a1e28 2625
db3e571a
RD
2626 :param source: Sometimes the event originates from a
2627 different window than self, but you still
2628 want to catch it in self. (For example, a
2629 button event delivered to a frame.) By
2630 passing the source of the event, the event
2631 handling system is able to differentiate
2632 between the same event type from different
2633 controls.
d14a1e28 2634
db3e571a
RD
2635 :param id: Used to spcify the event source by ID instead
2636 of instance.
2637
2638 :param id2: Used when it is desirable to bind a handler
2639 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
2640 """
2641 if source is not None:
2642 id = source.GetId()
2643 event.Bind(self, id, id2, handler)
2644
66c033b4
RD
2645 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2646 """
2647 Disconencts the event handler binding for event from self.
2648 Returns True if successful.
2649 """
2650 if source is not None:
2651 id = source.GetId()
2652 return event.Unbind(self, id, id2)
d14a1e28 2653
d14a1e28
RD
2654
2655class EvtHandlerPtr(EvtHandler):
2656 def __init__(self, this):
2657 self.this = this
2658 if not hasattr(self,"thisown"): self.thisown = 0
2659 self.__class__ = EvtHandler
54f9ee45 2660_core_.EvtHandler_swigregister(EvtHandlerPtr)
d14a1e28
RD
2661
2662#---------------------------------------------------------------------------
2663
2664class PyEventBinder(object):
2665 """
2666 Instances of this class are used to bind specific events to event
2667 handlers.
2668 """
2669 def __init__(self, evtType, expectedIDs=0):
2670 if expectedIDs not in [0, 1, 2]:
2671 raise ValueError, "Invalid number of expectedIDs"
2672 self.expectedIDs = expectedIDs
2673
2674 if type(evtType) == list or type(evtType) == tuple:
2675 self.evtType = evtType
2676 else:
2677 self.evtType = [evtType]
2678
2679
2680 def Bind(self, target, id1, id2, function):
2681 """Bind this set of event types to target."""
2682 for et in self.evtType:
2683 target.Connect(id1, id2, et, function)
2684
66c033b4
RD
2685
2686 def Unbind(self, target, id1, id2):
2687 """Remove an event binding."""
2688 success = 0
2689 for et in self.evtType:
2690 success += target.Disconnect(id1, id2, et)
2691 return success != 0
2692
d14a1e28
RD
2693
2694 def __call__(self, *args):
2695 """
2696 For backwards compatibility with the old EVT_* functions.
2697 Should be called with either (window, func), (window, ID,
2698 func) or (window, ID1, ID2, func) parameters depending on the
2699 type of the event.
2700 """
2701 assert len(args) == 2 + self.expectedIDs
2702 id1 = wx.ID_ANY
2703 id2 = wx.ID_ANY
2704 target = args[0]
2705 if self.expectedIDs == 0:
2706 func = args[1]
2707 elif self.expectedIDs == 1:
2708 id1 = args[1]
2709 func = args[2]
2710 elif self.expectedIDs == 2:
2711 id1 = args[1]
2712 id2 = args[2]
2713 func = args[3]
2714 else:
2715 raise ValueError, "Unexpected number of IDs"
2716
2717 self.Bind(target, id1, id2, func)
2718
2719
2720# These two are square pegs that don't fit the PyEventBinder hole...
2721def EVT_COMMAND(win, id, cmd, func):
2722 win.Connect(id, -1, cmd, func)
2723def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
2724 win.Connect(id1, id2, cmd, func)
2725
2726
2727#---------------------------------------------------------------------------
2728
2729#---------------------------------------------------------------------------
2730
54f9ee45
RD
2731EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
2732EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 2733
e811c8ce
RD
2734def NewEventType(*args, **kwargs):
2735 """NewEventType() -> wxEventType"""
54f9ee45
RD
2736 return _core_.NewEventType(*args, **kwargs)
2737wxEVT_NULL = _core_.wxEVT_NULL
2738wxEVT_FIRST = _core_.wxEVT_FIRST
2739wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
2740wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
2741wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
2742wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
2743wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
2744wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
2745wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
2746wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
2747wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
2748wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
2749wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
2750wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
2751wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
2752wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
2753wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
2754wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
2755wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
2756wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
2757wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
2758wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
2759wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
2760wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
2761wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
2762wxEVT_MOTION = _core_.wxEVT_MOTION
2763wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
2764wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
2765wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
2766wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
2767wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
2768wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
2769wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
2770wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
2771wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
2772wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
2773wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
2774wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
2775wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
2776wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
2777wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
2778wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
2779wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
2780wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
2781wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
2782wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
2783wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
2784wxEVT_CHAR = _core_.wxEVT_CHAR
2785wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
2786wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
2787wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
2788wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
2789wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
2790wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
2791wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
2792wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
2793wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
2794wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
2795wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
2796wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
2797wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
2798wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
2799wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
2800wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
2801wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
2802wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
2803wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
2804wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
2805wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
2806wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
2807wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
2808wxEVT_SIZE = _core_.wxEVT_SIZE
2809wxEVT_MOVE = _core_.wxEVT_MOVE
2810wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
2811wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
2812wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
2813wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
2814wxEVT_POWER = _core_.wxEVT_POWER
2815wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
2816wxEVT_CREATE = _core_.wxEVT_CREATE
2817wxEVT_DESTROY = _core_.wxEVT_DESTROY
2818wxEVT_SHOW = _core_.wxEVT_SHOW
2819wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
2820wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
2821wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
2822wxEVT_PAINT = _core_.wxEVT_PAINT
2823wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
2824wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
2825wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
2826wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
2827wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
2828wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
2829wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
2830wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
2831wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
2832wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
2833wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
2834wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
2835wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
2836wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
2837wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
2838wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
2839wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
2840wxEVT_IDLE = _core_.wxEVT_IDLE
2841wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
2842wxEVT_SIZING = _core_.wxEVT_SIZING
2843wxEVT_MOVING = _core_.wxEVT_MOVING
2844wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
2845wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
2846wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
2847wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
2848wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
2849wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
2850wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
2851#
2852# Create some event binders
2853EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
2854EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
2855EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
2856EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
2857EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
2858EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
2859EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
2860EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
2861EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
2862EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
2863EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
2864EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
2865EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
2866EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
2867EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
2868EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
2869EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
2870EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
2871EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
2872EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
2873EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
2874EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
2875EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
2876EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
2877EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
2878EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
2879EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
2880EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
2881EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
2882EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
2883EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
2884EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
2885EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
2886EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
2887EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
2888EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
2889EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
2890EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
2891EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
2892EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
2893
2894EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
2895EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
2896EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
2897EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
2898EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
2899EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
2900EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
2901EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
2902EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
2903EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
2904EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
2905EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
2906EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
2907
2908EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
2909 wxEVT_LEFT_UP,
2910 wxEVT_MIDDLE_DOWN,
2911 wxEVT_MIDDLE_UP,
2912 wxEVT_RIGHT_DOWN,
2913 wxEVT_RIGHT_UP,
2914 wxEVT_MOTION,
2915 wxEVT_LEFT_DCLICK,
2916 wxEVT_MIDDLE_DCLICK,
2917 wxEVT_RIGHT_DCLICK,
2918 wxEVT_ENTER_WINDOW,
2919 wxEVT_LEAVE_WINDOW,
2920 wxEVT_MOUSEWHEEL
2921 ])
2922
2923
2924# Scrolling from wxWindow (sent to wxScrolledWindow)
2925EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
2926 wxEVT_SCROLLWIN_BOTTOM,
2927 wxEVT_SCROLLWIN_LINEUP,
2928 wxEVT_SCROLLWIN_LINEDOWN,
2929 wxEVT_SCROLLWIN_PAGEUP,
2930 wxEVT_SCROLLWIN_PAGEDOWN,
2931 wxEVT_SCROLLWIN_THUMBTRACK,
2932 wxEVT_SCROLLWIN_THUMBRELEASE,
2933 ])
2934
2935EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
2936EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
2937EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
2938EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
2939EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
2940EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
2941EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
2942EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
2943
2944# Scrolling from wxSlider and wxScrollBar
2945EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
2946 wxEVT_SCROLL_BOTTOM,
2947 wxEVT_SCROLL_LINEUP,
2948 wxEVT_SCROLL_LINEDOWN,
2949 wxEVT_SCROLL_PAGEUP,
2950 wxEVT_SCROLL_PAGEDOWN,
2951 wxEVT_SCROLL_THUMBTRACK,
2952 wxEVT_SCROLL_THUMBRELEASE,
2953 wxEVT_SCROLL_ENDSCROLL,
2954 ])
2955
2956EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
2957EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
2958EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
2959EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
2960EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
2961EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
2962EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
2963EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
2964EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
2965
2966# Scrolling from wxSlider and wxScrollBar, with an id
2967EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
2968 wxEVT_SCROLL_BOTTOM,
2969 wxEVT_SCROLL_LINEUP,
2970 wxEVT_SCROLL_LINEDOWN,
2971 wxEVT_SCROLL_PAGEUP,
2972 wxEVT_SCROLL_PAGEDOWN,
2973 wxEVT_SCROLL_THUMBTRACK,
2974 wxEVT_SCROLL_THUMBRELEASE,
2975 wxEVT_SCROLL_ENDSCROLL,
2976 ], 1)
2977
2978EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
2979EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
2980EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
2981EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
2982EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
2983EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
2984EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
2985EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
2986EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
2987
d14a1e28
RD
2988EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
2989EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
2990EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
2991EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
2992EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
2993EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
2994EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
2995EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
2996EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
2997EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
2998
2999EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3000EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3001EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3002EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3003EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3004EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3005EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3006EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3007EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3008
3009
3010EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3011EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3012EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3013EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3014EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3015EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3016EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3017
3018EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3019
3020EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3021EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3022
3023EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3024
3025
3026
3027#---------------------------------------------------------------------------
3028
3029class Event(Object):
e811c8ce
RD
3030 def __init__(self): raise RuntimeError, "No constructor defined"
3031 def __repr__(self):
3032 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45 3033 def __del__(self, destroy=_core_.delete_Event):
a95a7133 3034 """__del__(self)"""
d14a1e28
RD
3035 try:
3036 if self.thisown: destroy(self)
3037 except: pass
e811c8ce
RD
3038
3039 def SetEventType(*args, **kwargs):
a95a7133 3040 """SetEventType(self, wxEventType typ)"""
54f9ee45 3041 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
3042
3043 def GetEventType(*args, **kwargs):
a95a7133 3044 """GetEventType(self) -> wxEventType"""
54f9ee45 3045 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
3046
3047 def GetEventObject(*args, **kwargs):
a95a7133 3048 """GetEventObject(self) -> Object"""
54f9ee45 3049 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
3050
3051 def SetEventObject(*args, **kwargs):
a95a7133 3052 """SetEventObject(self, Object obj)"""
54f9ee45 3053 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
3054
3055 def GetTimestamp(*args, **kwargs):
a95a7133 3056 """GetTimestamp(self) -> long"""
54f9ee45 3057 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
3058
3059 def SetTimestamp(*args, **kwargs):
a95a7133 3060 """SetTimestamp(self, long ts=0)"""
54f9ee45 3061 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
3062
3063 def GetId(*args, **kwargs):
a95a7133 3064 """GetId(self) -> int"""
54f9ee45 3065 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
3066
3067 def SetId(*args, **kwargs):
a95a7133 3068 """SetId(self, int Id)"""
54f9ee45 3069 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
3070
3071 def IsCommandEvent(*args, **kwargs):
a95a7133 3072 """IsCommandEvent(self) -> bool"""
54f9ee45 3073 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
3074
3075 def Skip(*args, **kwargs):
a95a7133 3076 """Skip(self, bool skip=True)"""
54f9ee45 3077 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
3078
3079 def GetSkipped(*args, **kwargs):
a95a7133 3080 """GetSkipped(self) -> bool"""
54f9ee45 3081 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
3082
3083 def ShouldPropagate(*args, **kwargs):
a95a7133 3084 """ShouldPropagate(self) -> bool"""
54f9ee45 3085 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
3086
3087 def StopPropagation(*args, **kwargs):
a95a7133 3088 """StopPropagation(self) -> int"""
54f9ee45 3089 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
3090
3091 def ResumePropagation(*args, **kwargs):
a95a7133 3092 """ResumePropagation(self, int propagationLevel)"""
54f9ee45 3093 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
3094
3095 def Clone(*args, **kwargs):
a95a7133 3096 """Clone(self) -> Event"""
54f9ee45 3097 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 3098
d14a1e28
RD
3099
3100class EventPtr(Event):
3101 def __init__(self, this):
3102 self.this = this
3103 if not hasattr(self,"thisown"): self.thisown = 0
3104 self.__class__ = Event
54f9ee45 3105_core_.Event_swigregister(EventPtr)
d14a1e28
RD
3106
3107#---------------------------------------------------------------------------
3108
3109class PropagationDisabler(object):
e811c8ce
RD
3110 def __repr__(self):
3111 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3112 def __init__(self, *args, **kwargs):
a95a7133 3113 """__init__(self, Event event) -> PropagationDisabler"""
54f9ee45 3114 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
d14a1e28
RD
3115 self.this = newobj.this
3116 self.thisown = 1
3117 del newobj.thisown
54f9ee45 3118 def __del__(self, destroy=_core_.delete_PropagationDisabler):
a95a7133 3119 """__del__(self)"""
d14a1e28
RD
3120 try:
3121 if self.thisown: destroy(self)
3122 except: pass
e811c8ce 3123
d14a1e28
RD
3124
3125class PropagationDisablerPtr(PropagationDisabler):
3126 def __init__(self, this):
3127 self.this = this
3128 if not hasattr(self,"thisown"): self.thisown = 0
3129 self.__class__ = PropagationDisabler
54f9ee45 3130_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
d14a1e28
RD
3131
3132class PropagateOnce(object):
e811c8ce
RD
3133 def __repr__(self):
3134 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3135 def __init__(self, *args, **kwargs):
a95a7133 3136 """__init__(self, Event event) -> PropagateOnce"""
54f9ee45 3137 newobj = _core_.new_PropagateOnce(*args, **kwargs)
d14a1e28
RD
3138 self.this = newobj.this
3139 self.thisown = 1
3140 del newobj.thisown
54f9ee45 3141 def __del__(self, destroy=_core_.delete_PropagateOnce):
a95a7133 3142 """__del__(self)"""
d14a1e28
RD
3143 try:
3144 if self.thisown: destroy(self)
3145 except: pass
e811c8ce 3146
d14a1e28
RD
3147
3148class PropagateOncePtr(PropagateOnce):
3149 def __init__(self, this):
3150 self.this = this
3151 if not hasattr(self,"thisown"): self.thisown = 0
3152 self.__class__ = PropagateOnce
54f9ee45 3153_core_.PropagateOnce_swigregister(PropagateOncePtr)
d14a1e28
RD
3154
3155#---------------------------------------------------------------------------
3156
3157class CommandEvent(Event):
e811c8ce
RD
3158 def __repr__(self):
3159 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3160 def __init__(self, *args, **kwargs):
a95a7133 3161 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
54f9ee45 3162 newobj = _core_.new_CommandEvent(*args, **kwargs)
d14a1e28
RD
3163 self.this = newobj.this
3164 self.thisown = 1
3165 del newobj.thisown
e811c8ce 3166 def GetSelection(*args, **kwargs):
a95a7133 3167 """GetSelection(self) -> int"""
54f9ee45 3168 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
3169
3170 def SetString(*args, **kwargs):
a95a7133 3171 """SetString(self, String s)"""
54f9ee45 3172 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
3173
3174 def GetString(*args, **kwargs):
a95a7133 3175 """GetString(self) -> String"""
54f9ee45 3176 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
3177
3178 def IsChecked(*args, **kwargs):
a95a7133 3179 """IsChecked(self) -> bool"""
54f9ee45 3180 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 3181
242b7b46 3182 Checked = IsChecked
e811c8ce 3183 def IsSelection(*args, **kwargs):
a95a7133 3184 """IsSelection(self) -> bool"""
54f9ee45 3185 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
3186
3187 def SetExtraLong(*args, **kwargs):
a95a7133 3188 """SetExtraLong(self, long extraLong)"""
54f9ee45 3189 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
3190
3191 def GetExtraLong(*args, **kwargs):
a95a7133 3192 """GetExtraLong(self) -> long"""
54f9ee45 3193 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
3194
3195 def SetInt(*args, **kwargs):
a95a7133 3196 """SetInt(self, int i)"""
54f9ee45 3197 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
3198
3199 def GetInt(*args, **kwargs):
a95a7133 3200 """GetInt(self) -> long"""
54f9ee45 3201 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce
RD
3202
3203 def Clone(*args, **kwargs):
a95a7133 3204 """Clone(self) -> Event"""
54f9ee45 3205 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 3206
d14a1e28
RD
3207
3208class CommandEventPtr(CommandEvent):
3209 def __init__(self, this):
3210 self.this = this
3211 if not hasattr(self,"thisown"): self.thisown = 0
3212 self.__class__ = CommandEvent
54f9ee45 3213_core_.CommandEvent_swigregister(CommandEventPtr)
d14a1e28
RD
3214
3215#---------------------------------------------------------------------------
3216
3217class NotifyEvent(CommandEvent):
e811c8ce
RD
3218 def __repr__(self):
3219 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3220 def __init__(self, *args, **kwargs):
a95a7133 3221 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
54f9ee45 3222 newobj = _core_.new_NotifyEvent(*args, **kwargs)
d14a1e28
RD
3223 self.this = newobj.this
3224 self.thisown = 1
3225 del newobj.thisown
e811c8ce 3226 def Veto(*args, **kwargs):
a95a7133 3227 """Veto(self)"""
54f9ee45 3228 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
3229
3230 def Allow(*args, **kwargs):
a95a7133 3231 """Allow(self)"""
54f9ee45 3232 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
3233
3234 def IsAllowed(*args, **kwargs):
a95a7133 3235 """IsAllowed(self) -> bool"""
54f9ee45 3236 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 3237
d14a1e28
RD
3238
3239class NotifyEventPtr(NotifyEvent):
3240 def __init__(self, this):
3241 self.this = this
3242 if not hasattr(self,"thisown"): self.thisown = 0
3243 self.__class__ = NotifyEvent
54f9ee45 3244_core_.NotifyEvent_swigregister(NotifyEventPtr)
d14a1e28
RD
3245
3246#---------------------------------------------------------------------------
3247
3248class ScrollEvent(CommandEvent):
e811c8ce
RD
3249 def __repr__(self):
3250 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3251 def __init__(self, *args, **kwargs):
0df68c9f 3252 """
a95a7133 3253 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
3254 int orient=0) -> ScrollEvent
3255 """
54f9ee45 3256 newobj = _core_.new_ScrollEvent(*args, **kwargs)
d14a1e28
RD
3257 self.this = newobj.this
3258 self.thisown = 1
3259 del newobj.thisown
e811c8ce 3260 def GetOrientation(*args, **kwargs):
a95a7133 3261 """GetOrientation(self) -> int"""
54f9ee45 3262 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
3263
3264 def GetPosition(*args, **kwargs):
a95a7133 3265 """GetPosition(self) -> int"""
54f9ee45 3266 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3267
3268 def SetOrientation(*args, **kwargs):
a95a7133 3269 """SetOrientation(self, int orient)"""
54f9ee45 3270 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
3271
3272 def SetPosition(*args, **kwargs):
a95a7133 3273 """SetPosition(self, int pos)"""
54f9ee45 3274 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 3275
d14a1e28
RD
3276
3277class ScrollEventPtr(ScrollEvent):
3278 def __init__(self, this):
3279 self.this = this
3280 if not hasattr(self,"thisown"): self.thisown = 0
3281 self.__class__ = ScrollEvent
54f9ee45 3282_core_.ScrollEvent_swigregister(ScrollEventPtr)
d14a1e28
RD
3283
3284#---------------------------------------------------------------------------
3285
3286class ScrollWinEvent(Event):
e811c8ce
RD
3287 def __repr__(self):
3288 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3289 def __init__(self, *args, **kwargs):
a95a7133 3290 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
54f9ee45 3291 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
d14a1e28
RD
3292 self.this = newobj.this
3293 self.thisown = 1
3294 del newobj.thisown
e811c8ce 3295 def GetOrientation(*args, **kwargs):
a95a7133 3296 """GetOrientation(self) -> int"""
54f9ee45 3297 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
3298
3299 def GetPosition(*args, **kwargs):
a95a7133 3300 """GetPosition(self) -> int"""
54f9ee45 3301 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3302
3303 def SetOrientation(*args, **kwargs):
a95a7133 3304 """SetOrientation(self, int orient)"""
54f9ee45 3305 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
3306
3307 def SetPosition(*args, **kwargs):
a95a7133 3308 """SetPosition(self, int pos)"""
54f9ee45 3309 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 3310
d14a1e28
RD
3311
3312class ScrollWinEventPtr(ScrollWinEvent):
3313 def __init__(self, this):
3314 self.this = this
3315 if not hasattr(self,"thisown"): self.thisown = 0
3316 self.__class__ = ScrollWinEvent
54f9ee45 3317_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
d14a1e28
RD
3318
3319#---------------------------------------------------------------------------
3320
54f9ee45
RD
3321MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3322MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3323MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3324MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3325MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 3326class MouseEvent(Event):
e811c8ce
RD
3327 def __repr__(self):
3328 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3329 def __init__(self, *args, **kwargs):
a95a7133 3330 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
54f9ee45 3331 newobj = _core_.new_MouseEvent(*args, **kwargs)
d14a1e28
RD
3332 self.this = newobj.this
3333 self.thisown = 1
3334 del newobj.thisown
e811c8ce 3335 def IsButton(*args, **kwargs):
a95a7133 3336 """IsButton(self) -> bool"""
54f9ee45 3337 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
3338
3339 def ButtonDown(*args, **kwargs):
a95a7133 3340 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
54f9ee45 3341 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
3342
3343 def ButtonDClick(*args, **kwargs):
a95a7133 3344 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
54f9ee45 3345 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
3346
3347 def ButtonUp(*args, **kwargs):
a95a7133 3348 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
54f9ee45 3349 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
3350
3351 def Button(*args, **kwargs):
a95a7133 3352 """Button(self, int but) -> bool"""
54f9ee45 3353 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
3354
3355 def ButtonIsDown(*args, **kwargs):
a95a7133 3356 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 3357 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
3358
3359 def GetButton(*args, **kwargs):
a95a7133 3360 """GetButton(self) -> int"""
54f9ee45 3361 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
3362
3363 def ControlDown(*args, **kwargs):
a95a7133 3364 """ControlDown(self) -> bool"""
54f9ee45 3365 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
3366
3367 def MetaDown(*args, **kwargs):
a95a7133 3368 """MetaDown(self) -> bool"""
54f9ee45 3369 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
3370
3371 def AltDown(*args, **kwargs):
a95a7133 3372 """AltDown(self) -> bool"""
54f9ee45 3373 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
3374
3375 def ShiftDown(*args, **kwargs):
a95a7133 3376 """ShiftDown(self) -> bool"""
54f9ee45 3377 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce
RD
3378
3379 def LeftDown(*args, **kwargs):
a95a7133 3380 """LeftDown(self) -> bool"""
54f9ee45 3381 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
3382
3383 def MiddleDown(*args, **kwargs):
a95a7133 3384 """MiddleDown(self) -> bool"""
54f9ee45 3385 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
3386
3387 def RightDown(*args, **kwargs):
a95a7133 3388 """RightDown(self) -> bool"""
54f9ee45 3389 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
3390
3391 def LeftUp(*args, **kwargs):
a95a7133 3392 """LeftUp(self) -> bool"""
54f9ee45 3393 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
3394
3395 def MiddleUp(*args, **kwargs):
a95a7133 3396 """MiddleUp(self) -> bool"""
54f9ee45 3397 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
3398
3399 def RightUp(*args, **kwargs):
a95a7133 3400 """RightUp(self) -> bool"""
54f9ee45 3401 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
3402
3403 def LeftDClick(*args, **kwargs):
a95a7133 3404 """LeftDClick(self) -> bool"""
54f9ee45 3405 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
3406
3407 def MiddleDClick(*args, **kwargs):
a95a7133 3408 """MiddleDClick(self) -> bool"""
54f9ee45 3409 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
3410
3411 def RightDClick(*args, **kwargs):
a95a7133 3412 """RightDClick(self) -> bool"""
54f9ee45 3413 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
3414
3415 def LeftIsDown(*args, **kwargs):
a95a7133 3416 """LeftIsDown(self) -> bool"""
54f9ee45 3417 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
3418
3419 def MiddleIsDown(*args, **kwargs):
a95a7133 3420 """MiddleIsDown(self) -> bool"""
54f9ee45 3421 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
3422
3423 def RightIsDown(*args, **kwargs):
a95a7133 3424 """RightIsDown(self) -> bool"""
54f9ee45 3425 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
3426
3427 def Dragging(*args, **kwargs):
a95a7133 3428 """Dragging(self) -> bool"""
54f9ee45 3429 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
3430
3431 def Moving(*args, **kwargs):
a95a7133 3432 """Moving(self) -> bool"""
54f9ee45 3433 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
3434
3435 def Entering(*args, **kwargs):
a95a7133 3436 """Entering(self) -> bool"""
54f9ee45 3437 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
3438
3439 def Leaving(*args, **kwargs):
a95a7133 3440 """Leaving(self) -> bool"""
54f9ee45 3441 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
3442
3443 def GetPosition(*args, **kwargs):
0df68c9f 3444 """
a95a7133 3445 GetPosition(self) -> Point
e811c8ce 3446
41e2b43e
RD
3447 Returns the position of the mouse in window coordinates when the event
3448 happened.
0df68c9f 3449 """
54f9ee45 3450 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3451
3452 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
3453 """
3454 GetPositionTuple() -> (x,y)
e811c8ce 3455
41e2b43e
RD
3456 Returns the position of the mouse in window coordinates when the event
3457 happened.
0df68c9f 3458 """
54f9ee45 3459 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
3460
3461 def GetLogicalPosition(*args, **kwargs):
a95a7133 3462 """GetLogicalPosition(self, DC dc) -> Point"""
54f9ee45 3463 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
3464
3465 def GetX(*args, **kwargs):
a95a7133 3466 """GetX(self) -> int"""
54f9ee45 3467 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
3468
3469 def GetY(*args, **kwargs):
a95a7133 3470 """GetY(self) -> int"""
54f9ee45 3471 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
3472
3473 def GetWheelRotation(*args, **kwargs):
a95a7133 3474 """GetWheelRotation(self) -> int"""
54f9ee45 3475 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
3476
3477 def GetWheelDelta(*args, **kwargs):
a95a7133 3478 """GetWheelDelta(self) -> int"""
54f9ee45 3479 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce
RD
3480
3481 def GetLinesPerAction(*args, **kwargs):
a95a7133 3482 """GetLinesPerAction(self) -> int"""
54f9ee45 3483 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
3484
3485 def IsPageScroll(*args, **kwargs):
a95a7133 3486 """IsPageScroll(self) -> bool"""
54f9ee45
RD
3487 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3488
3489 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3490 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3491 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3492 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3493 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3494 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3495 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3496 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3497 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3498 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3499 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3500 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
d14a1e28
RD
3501
3502class MouseEventPtr(MouseEvent):
3503 def __init__(self, this):
3504 self.this = this
3505 if not hasattr(self,"thisown"): self.thisown = 0
3506 self.__class__ = MouseEvent
54f9ee45 3507_core_.MouseEvent_swigregister(MouseEventPtr)
d14a1e28
RD
3508
3509#---------------------------------------------------------------------------
3510
3511class SetCursorEvent(Event):
e811c8ce
RD
3512 def __repr__(self):
3513 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3514 def __init__(self, *args, **kwargs):
a95a7133 3515 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
54f9ee45 3516 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
d14a1e28
RD
3517 self.this = newobj.this
3518 self.thisown = 1
3519 del newobj.thisown
e811c8ce 3520 def GetX(*args, **kwargs):
a95a7133 3521 """GetX(self) -> int"""
54f9ee45 3522 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
3523
3524 def GetY(*args, **kwargs):
a95a7133 3525 """GetY(self) -> int"""
54f9ee45 3526 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
3527
3528 def SetCursor(*args, **kwargs):
a95a7133 3529 """SetCursor(self, Cursor cursor)"""
54f9ee45 3530 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
3531
3532 def GetCursor(*args, **kwargs):
a95a7133 3533 """GetCursor(self) -> Cursor"""
54f9ee45 3534 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
3535
3536 def HasCursor(*args, **kwargs):
a95a7133 3537 """HasCursor(self) -> bool"""
54f9ee45 3538 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 3539
d14a1e28
RD
3540
3541class SetCursorEventPtr(SetCursorEvent):
3542 def __init__(self, this):
3543 self.this = this
3544 if not hasattr(self,"thisown"): self.thisown = 0
3545 self.__class__ = SetCursorEvent
54f9ee45 3546_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
d14a1e28
RD
3547
3548#---------------------------------------------------------------------------
3549
3550class KeyEvent(Event):
e811c8ce
RD
3551 def __repr__(self):
3552 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3553 def __init__(self, *args, **kwargs):
a95a7133 3554 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
54f9ee45 3555 newobj = _core_.new_KeyEvent(*args, **kwargs)
d14a1e28
RD
3556 self.this = newobj.this
3557 self.thisown = 1
3558 del newobj.thisown
e811c8ce 3559 def ControlDown(*args, **kwargs):
a95a7133 3560 """ControlDown(self) -> bool"""
54f9ee45 3561 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
3562
3563 def MetaDown(*args, **kwargs):
a95a7133 3564 """MetaDown(self) -> bool"""
54f9ee45 3565 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
3566
3567 def AltDown(*args, **kwargs):
a95a7133 3568 """AltDown(self) -> bool"""
54f9ee45 3569 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
3570
3571 def ShiftDown(*args, **kwargs):
a95a7133 3572 """ShiftDown(self) -> bool"""
54f9ee45 3573 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce
RD
3574
3575 def HasModifiers(*args, **kwargs):
a95a7133 3576 """HasModifiers(self) -> bool"""
54f9ee45 3577 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
3578
3579 def GetKeyCode(*args, **kwargs):
a95a7133 3580 """GetKeyCode(self) -> int"""
54f9ee45 3581 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 3582
d14a1e28 3583 KeyCode = GetKeyCode
19272049
RD
3584 def GetUnicodeKey(*args, **kwargs):
3585 """GetUnicodeKey(self) -> int"""
3586 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 3587
19272049 3588 GetUniChar = GetUnicodeKey
e811c8ce 3589 def GetRawKeyCode(*args, **kwargs):
a95a7133 3590 """GetRawKeyCode(self) -> unsigned int"""
54f9ee45 3591 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
3592
3593 def GetRawKeyFlags(*args, **kwargs):
a95a7133 3594 """GetRawKeyFlags(self) -> unsigned int"""
54f9ee45 3595 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
3596
3597 def GetPosition(*args, **kwargs):
0df68c9f 3598 """
a95a7133 3599 GetPosition(self) -> Point
e811c8ce 3600
0df68c9f
RD
3601 Find the position of the event.
3602 """
54f9ee45 3603 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3604
3605 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
3606 """
3607 GetPositionTuple() -> (x,y)
e811c8ce 3608
0df68c9f
RD
3609 Find the position of the event.
3610 """
54f9ee45 3611 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
3612
3613 def GetX(*args, **kwargs):
a95a7133 3614 """GetX(self) -> int"""
54f9ee45 3615 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
3616
3617 def GetY(*args, **kwargs):
a95a7133 3618 """GetY(self) -> int"""
54f9ee45
RD
3619 return _core_.KeyEvent_GetY(*args, **kwargs)
3620
3621 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
3622 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
3623 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
3624 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
3625 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
3626 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
3627 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
3628 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
3629 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
3630 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
d14a1e28
RD
3631
3632class KeyEventPtr(KeyEvent):
3633 def __init__(self, this):
3634 self.this = this
3635 if not hasattr(self,"thisown"): self.thisown = 0
3636 self.__class__ = KeyEvent
54f9ee45 3637_core_.KeyEvent_swigregister(KeyEventPtr)
d14a1e28
RD
3638
3639#---------------------------------------------------------------------------
3640
3641class SizeEvent(Event):
e811c8ce
RD
3642 def __repr__(self):
3643 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3644 def __init__(self, *args, **kwargs):
a95a7133 3645 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
54f9ee45 3646 newobj = _core_.new_SizeEvent(*args, **kwargs)
d14a1e28
RD
3647 self.this = newobj.this
3648 self.thisown = 1
3649 del newobj.thisown
e811c8ce 3650 def GetSize(*args, **kwargs):
a95a7133 3651 """GetSize(self) -> Size"""
54f9ee45 3652 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
3653
3654 def GetRect(*args, **kwargs):
a95a7133 3655 """GetRect(self) -> Rect"""
54f9ee45 3656 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
3657
3658 def SetRect(*args, **kwargs):
a95a7133 3659 """SetRect(self, Rect rect)"""
54f9ee45 3660 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
3661
3662 def SetSize(*args, **kwargs):
a95a7133 3663 """SetSize(self, Size size)"""
54f9ee45 3664 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 3665
54f9ee45
RD
3666 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
3667 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
d14a1e28
RD
3668
3669class SizeEventPtr(SizeEvent):
3670 def __init__(self, this):
3671 self.this = this
3672 if not hasattr(self,"thisown"): self.thisown = 0
3673 self.__class__ = SizeEvent
54f9ee45 3674_core_.SizeEvent_swigregister(SizeEventPtr)
d14a1e28
RD
3675
3676#---------------------------------------------------------------------------
3677
3678class MoveEvent(Event):
e811c8ce
RD
3679 def __repr__(self):
3680 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3681 def __init__(self, *args, **kwargs):
a95a7133 3682 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
54f9ee45 3683 newobj = _core_.new_MoveEvent(*args, **kwargs)
d14a1e28
RD
3684 self.this = newobj.this
3685 self.thisown = 1
3686 del newobj.thisown
e811c8ce 3687 def GetPosition(*args, **kwargs):
a95a7133 3688 """GetPosition(self) -> Point"""
54f9ee45 3689 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
3690
3691 def GetRect(*args, **kwargs):
a95a7133 3692 """GetRect(self) -> Rect"""
54f9ee45 3693 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
3694
3695 def SetRect(*args, **kwargs):
a95a7133 3696 """SetRect(self, Rect rect)"""
54f9ee45 3697 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
3698
3699 def SetPosition(*args, **kwargs):
a95a7133 3700 """SetPosition(self, Point pos)"""
54f9ee45 3701 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 3702
54f9ee45
RD
3703 m_pos = property(_core_.MoveEvent_m_pos_get, _core_.MoveEvent_m_pos_set)
3704 m_rect = property(_core_.MoveEvent_m_rect_get, _core_.MoveEvent_m_rect_set)
d14a1e28
RD
3705
3706class MoveEventPtr(MoveEvent):
3707 def __init__(self, this):
3708 self.this = this
3709 if not hasattr(self,"thisown"): self.thisown = 0
3710 self.__class__ = MoveEvent
54f9ee45 3711_core_.MoveEvent_swigregister(MoveEventPtr)
d14a1e28
RD
3712
3713#---------------------------------------------------------------------------
3714
3715class PaintEvent(Event):
e811c8ce
RD
3716 def __repr__(self):
3717 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3718 def __init__(self, *args, **kwargs):
a95a7133 3719 """__init__(self, int Id=0) -> PaintEvent"""
54f9ee45 3720 newobj = _core_.new_PaintEvent(*args, **kwargs)
d14a1e28
RD
3721 self.this = newobj.this
3722 self.thisown = 1
3723 del newobj.thisown
d14a1e28
RD
3724
3725class PaintEventPtr(PaintEvent):
3726 def __init__(self, this):
3727 self.this = this
3728 if not hasattr(self,"thisown"): self.thisown = 0
3729 self.__class__ = PaintEvent
54f9ee45 3730_core_.PaintEvent_swigregister(PaintEventPtr)
d14a1e28
RD
3731
3732class NcPaintEvent(Event):
e811c8ce
RD
3733 def __repr__(self):
3734 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3735 def __init__(self, *args, **kwargs):
a95a7133 3736 """__init__(self, int winid=0) -> NcPaintEvent"""
54f9ee45 3737 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
d14a1e28
RD
3738 self.this = newobj.this
3739 self.thisown = 1
3740 del newobj.thisown
d14a1e28
RD
3741
3742class NcPaintEventPtr(NcPaintEvent):
3743 def __init__(self, this):
3744 self.this = this
3745 if not hasattr(self,"thisown"): self.thisown = 0
3746 self.__class__ = NcPaintEvent
54f9ee45 3747_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
d14a1e28
RD
3748
3749#---------------------------------------------------------------------------
3750
3751class EraseEvent(Event):
e811c8ce
RD
3752 def __repr__(self):
3753 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3754 def __init__(self, *args, **kwargs):
a95a7133 3755 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
54f9ee45 3756 newobj = _core_.new_EraseEvent(*args, **kwargs)
d14a1e28
RD
3757 self.this = newobj.this
3758 self.thisown = 1
3759 del newobj.thisown
e811c8ce 3760 def GetDC(*args, **kwargs):
a95a7133 3761 """GetDC(self) -> DC"""
54f9ee45 3762 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 3763
d14a1e28
RD
3764
3765class EraseEventPtr(EraseEvent):
3766 def __init__(self, this):
3767 self.this = this
3768 if not hasattr(self,"thisown"): self.thisown = 0
3769 self.__class__ = EraseEvent
54f9ee45 3770_core_.EraseEvent_swigregister(EraseEventPtr)
d14a1e28
RD
3771
3772#---------------------------------------------------------------------------
3773
3774class FocusEvent(Event):
e811c8ce
RD
3775 def __repr__(self):
3776 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3777 def __init__(self, *args, **kwargs):
a95a7133 3778 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
54f9ee45 3779 newobj = _core_.new_FocusEvent(*args, **kwargs)
d14a1e28
RD
3780 self.this = newobj.this
3781 self.thisown = 1
3782 del newobj.thisown
e811c8ce 3783 def GetWindow(*args, **kwargs):
a95a7133 3784 """GetWindow(self) -> Window"""
54f9ee45 3785 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
3786
3787 def SetWindow(*args, **kwargs):
a95a7133 3788 """SetWindow(self, Window win)"""
54f9ee45 3789 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 3790
d14a1e28
RD
3791
3792class FocusEventPtr(FocusEvent):
3793 def __init__(self, this):
3794 self.this = this
3795 if not hasattr(self,"thisown"): self.thisown = 0
3796 self.__class__ = FocusEvent
54f9ee45 3797_core_.FocusEvent_swigregister(FocusEventPtr)
d14a1e28
RD
3798
3799#---------------------------------------------------------------------------
3800
3801class ChildFocusEvent(CommandEvent):
e811c8ce
RD
3802 def __repr__(self):
3803 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3804 def __init__(self, *args, **kwargs):
a95a7133 3805 """__init__(self, Window win=None) -> ChildFocusEvent"""
54f9ee45 3806 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
d14a1e28
RD
3807 self.this = newobj.this
3808 self.thisown = 1
3809 del newobj.thisown
e811c8ce 3810 def GetWindow(*args, **kwargs):
a95a7133 3811 """GetWindow(self) -> Window"""
54f9ee45 3812 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 3813
d14a1e28
RD
3814
3815class ChildFocusEventPtr(ChildFocusEvent):
3816 def __init__(self, this):
3817 self.this = this
3818 if not hasattr(self,"thisown"): self.thisown = 0
3819 self.__class__ = ChildFocusEvent
54f9ee45 3820_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
d14a1e28
RD
3821
3822#---------------------------------------------------------------------------
3823
3824class ActivateEvent(Event):
e811c8ce
RD
3825 def __repr__(self):
3826 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3827 def __init__(self, *args, **kwargs):
a95a7133 3828 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
54f9ee45 3829 newobj = _core_.new_ActivateEvent(*args, **kwargs)
d14a1e28
RD
3830 self.this = newobj.this
3831 self.thisown = 1
3832 del newobj.thisown
e811c8ce 3833 def GetActive(*args, **kwargs):
a95a7133 3834 """GetActive(self) -> bool"""
54f9ee45 3835 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 3836
d14a1e28
RD
3837
3838class ActivateEventPtr(ActivateEvent):
3839 def __init__(self, this):
3840 self.this = this
3841 if not hasattr(self,"thisown"): self.thisown = 0
3842 self.__class__ = ActivateEvent
54f9ee45 3843_core_.ActivateEvent_swigregister(ActivateEventPtr)
d14a1e28
RD
3844
3845#---------------------------------------------------------------------------
3846
3847class InitDialogEvent(Event):
e811c8ce
RD
3848 def __repr__(self):
3849 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3850 def __init__(self, *args, **kwargs):
a95a7133 3851 """__init__(self, int Id=0) -> InitDialogEvent"""
54f9ee45 3852 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
d14a1e28
RD
3853 self.this = newobj.this
3854 self.thisown = 1
3855 del newobj.thisown
d14a1e28
RD
3856
3857class InitDialogEventPtr(InitDialogEvent):
3858 def __init__(self, this):
3859 self.this = this
3860 if not hasattr(self,"thisown"): self.thisown = 0
3861 self.__class__ = InitDialogEvent
54f9ee45 3862_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
d14a1e28
RD
3863
3864#---------------------------------------------------------------------------
3865
3866class MenuEvent(Event):
e811c8ce
RD
3867 def __repr__(self):
3868 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3869 def __init__(self, *args, **kwargs):
a95a7133 3870 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
54f9ee45 3871 newobj = _core_.new_MenuEvent(*args, **kwargs)
d14a1e28
RD
3872 self.this = newobj.this
3873 self.thisown = 1
3874 del newobj.thisown
e811c8ce 3875 def GetMenuId(*args, **kwargs):
a95a7133 3876 """GetMenuId(self) -> int"""
54f9ee45 3877 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
3878
3879 def IsPopup(*args, **kwargs):
a95a7133 3880 """IsPopup(self) -> bool"""
54f9ee45 3881 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
3882
3883 def GetMenu(*args, **kwargs):
a95a7133 3884 """GetMenu(self) -> Menu"""
54f9ee45 3885 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 3886
d14a1e28
RD
3887
3888class MenuEventPtr(MenuEvent):
3889 def __init__(self, this):
3890 self.this = this
3891 if not hasattr(self,"thisown"): self.thisown = 0
3892 self.__class__ = MenuEvent
54f9ee45 3893_core_.MenuEvent_swigregister(MenuEventPtr)
d14a1e28
RD
3894
3895#---------------------------------------------------------------------------
3896
3897class CloseEvent(Event):
e811c8ce
RD
3898 def __repr__(self):
3899 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3900 def __init__(self, *args, **kwargs):
a95a7133 3901 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
54f9ee45 3902 newobj = _core_.new_CloseEvent(*args, **kwargs)
d14a1e28
RD
3903 self.this = newobj.this
3904 self.thisown = 1
3905 del newobj.thisown
e811c8ce 3906 def SetLoggingOff(*args, **kwargs):
a95a7133 3907 """SetLoggingOff(self, bool logOff)"""
54f9ee45 3908 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
3909
3910 def GetLoggingOff(*args, **kwargs):
a95a7133 3911 """GetLoggingOff(self) -> bool"""
54f9ee45 3912 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
3913
3914 def Veto(*args, **kwargs):
a95a7133 3915 """Veto(self, bool veto=True)"""
54f9ee45 3916 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce
RD
3917
3918 def SetCanVeto(*args, **kwargs):
a95a7133 3919 """SetCanVeto(self, bool canVeto)"""
54f9ee45 3920 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
3921
3922 def CanVeto(*args, **kwargs):
a95a7133 3923 """CanVeto(self) -> bool"""
54f9ee45 3924 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce
RD
3925
3926 def GetVeto(*args, **kwargs):
a95a7133 3927 """GetVeto(self) -> bool"""
54f9ee45 3928 return _core_.CloseEvent_GetVeto(*args, **kwargs)
e811c8ce 3929
d14a1e28
RD
3930
3931class CloseEventPtr(CloseEvent):
3932 def __init__(self, this):
3933 self.this = this
3934 if not hasattr(self,"thisown"): self.thisown = 0
3935 self.__class__ = CloseEvent
54f9ee45 3936_core_.CloseEvent_swigregister(CloseEventPtr)
d14a1e28
RD
3937
3938#---------------------------------------------------------------------------
3939
3940class ShowEvent(Event):
e811c8ce
RD
3941 def __repr__(self):
3942 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3943 def __init__(self, *args, **kwargs):
a95a7133 3944 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
54f9ee45 3945 newobj = _core_.new_ShowEvent(*args, **kwargs)
d14a1e28
RD
3946 self.this = newobj.this
3947 self.thisown = 1
3948 del newobj.thisown
e811c8ce 3949 def SetShow(*args, **kwargs):
a95a7133 3950 """SetShow(self, bool show)"""
54f9ee45 3951 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
3952
3953 def GetShow(*args, **kwargs):
a95a7133 3954 """GetShow(self) -> bool"""
54f9ee45 3955 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 3956
d14a1e28
RD
3957
3958class ShowEventPtr(ShowEvent):
3959 def __init__(self, this):
3960 self.this = this
3961 if not hasattr(self,"thisown"): self.thisown = 0
3962 self.__class__ = ShowEvent
54f9ee45 3963_core_.ShowEvent_swigregister(ShowEventPtr)
d14a1e28
RD
3964
3965#---------------------------------------------------------------------------
3966
3967class IconizeEvent(Event):
e811c8ce
RD
3968 def __repr__(self):
3969 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3970 def __init__(self, *args, **kwargs):
a95a7133 3971 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
54f9ee45 3972 newobj = _core_.new_IconizeEvent(*args, **kwargs)
d14a1e28
RD
3973 self.this = newobj.this
3974 self.thisown = 1
3975 del newobj.thisown
e811c8ce 3976 def Iconized(*args, **kwargs):
a95a7133 3977 """Iconized(self) -> bool"""
54f9ee45 3978 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 3979
d14a1e28
RD
3980
3981class IconizeEventPtr(IconizeEvent):
3982 def __init__(self, this):
3983 self.this = this
3984 if not hasattr(self,"thisown"): self.thisown = 0
3985 self.__class__ = IconizeEvent
54f9ee45 3986_core_.IconizeEvent_swigregister(IconizeEventPtr)
d14a1e28
RD
3987
3988#---------------------------------------------------------------------------
3989
3990class MaximizeEvent(Event):
e811c8ce
RD
3991 def __repr__(self):
3992 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 3993 def __init__(self, *args, **kwargs):
a95a7133 3994 """__init__(self, int id=0) -> MaximizeEvent"""
54f9ee45 3995 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
d14a1e28
RD
3996 self.this = newobj.this
3997 self.thisown = 1
3998 del newobj.thisown
d14a1e28
RD
3999
4000class MaximizeEventPtr(MaximizeEvent):
4001 def __init__(self, this):
4002 self.this = this
4003 if not hasattr(self,"thisown"): self.thisown = 0
4004 self.__class__ = MaximizeEvent
54f9ee45 4005_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
d14a1e28
RD
4006
4007#---------------------------------------------------------------------------
4008
4009class DropFilesEvent(Event):
d14a1e28
RD
4010 def __init__(self): raise RuntimeError, "No constructor defined"
4011 def __repr__(self):
4012 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 4013 def GetPosition(*args, **kwargs):
a95a7133 4014 """GetPosition(self) -> Point"""
54f9ee45 4015 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4016
4017 def GetNumberOfFiles(*args, **kwargs):
a95a7133 4018 """GetNumberOfFiles(self) -> int"""
54f9ee45 4019 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
4020
4021 def GetFiles(*args, **kwargs):
a95a7133 4022 """GetFiles(self) -> PyObject"""
54f9ee45 4023 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 4024
d14a1e28
RD
4025
4026class DropFilesEventPtr(DropFilesEvent):
4027 def __init__(self, this):
4028 self.this = this
4029 if not hasattr(self,"thisown"): self.thisown = 0
4030 self.__class__ = DropFilesEvent
54f9ee45 4031_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
d14a1e28
RD
4032
4033#---------------------------------------------------------------------------
4034
54f9ee45
RD
4035UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4036UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 4037class UpdateUIEvent(CommandEvent):
e811c8ce
RD
4038 def __repr__(self):
4039 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4040 def __init__(self, *args, **kwargs):
a95a7133 4041 """__init__(self, int commandId=0) -> UpdateUIEvent"""
54f9ee45 4042 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
d14a1e28
RD
4043 self.this = newobj.this
4044 self.thisown = 1
4045 del newobj.thisown
e811c8ce 4046 def GetChecked(*args, **kwargs):
a95a7133 4047 """GetChecked(self) -> bool"""
54f9ee45 4048 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
4049
4050 def GetEnabled(*args, **kwargs):
a95a7133 4051 """GetEnabled(self) -> bool"""
54f9ee45 4052 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce
RD
4053
4054 def GetText(*args, **kwargs):
a95a7133 4055 """GetText(self) -> String"""
54f9ee45 4056 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
4057
4058 def GetSetText(*args, **kwargs):
a95a7133 4059 """GetSetText(self) -> bool"""
54f9ee45 4060 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
4061
4062 def GetSetChecked(*args, **kwargs):
a95a7133 4063 """GetSetChecked(self) -> bool"""
54f9ee45 4064 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
4065
4066 def GetSetEnabled(*args, **kwargs):
a95a7133 4067 """GetSetEnabled(self) -> bool"""
54f9ee45 4068 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce
RD
4069
4070 def Check(*args, **kwargs):
a95a7133 4071 """Check(self, bool check)"""
54f9ee45 4072 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
4073
4074 def Enable(*args, **kwargs):
a95a7133 4075 """Enable(self, bool enable)"""
54f9ee45 4076 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce
RD
4077
4078 def SetText(*args, **kwargs):
a95a7133 4079 """SetText(self, String text)"""
54f9ee45 4080 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
4081
4082 def SetUpdateInterval(*args, **kwargs):
66c033b4 4083 """SetUpdateInterval(long updateInterval)"""
54f9ee45 4084 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
4085
4086 SetUpdateInterval = staticmethod(SetUpdateInterval)
4087 def GetUpdateInterval(*args, **kwargs):
66c033b4 4088 """GetUpdateInterval() -> long"""
54f9ee45 4089 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
4090
4091 GetUpdateInterval = staticmethod(GetUpdateInterval)
4092 def CanUpdate(*args, **kwargs):
66c033b4 4093 """CanUpdate(Window win) -> bool"""
54f9ee45 4094 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
4095
4096 CanUpdate = staticmethod(CanUpdate)
4097 def ResetUpdateTime(*args, **kwargs):
66c033b4 4098 """ResetUpdateTime()"""
54f9ee45 4099 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
4100
4101 ResetUpdateTime = staticmethod(ResetUpdateTime)
4102 def SetMode(*args, **kwargs):
66c033b4 4103 """SetMode(int mode)"""
54f9ee45 4104 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
4105
4106 SetMode = staticmethod(SetMode)
4107 def GetMode(*args, **kwargs):
66c033b4 4108 """GetMode() -> int"""
54f9ee45 4109 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
4110
4111 GetMode = staticmethod(GetMode)
d14a1e28
RD
4112
4113class UpdateUIEventPtr(UpdateUIEvent):
4114 def __init__(self, this):
4115 self.this = this
4116 if not hasattr(self,"thisown"): self.thisown = 0
4117 self.__class__ = UpdateUIEvent
54f9ee45 4118_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
d14a1e28 4119
e811c8ce
RD
4120def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4121 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
54f9ee45 4122 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 4123
e811c8ce
RD
4124def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4125 """UpdateUIEvent_GetUpdateInterval() -> long"""
54f9ee45 4126 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d14a1e28 4127
e811c8ce
RD
4128def UpdateUIEvent_CanUpdate(*args, **kwargs):
4129 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
54f9ee45 4130 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 4131
e811c8ce
RD
4132def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4133 """UpdateUIEvent_ResetUpdateTime()"""
54f9ee45 4134 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d14a1e28 4135
e811c8ce 4136def UpdateUIEvent_SetMode(*args, **kwargs):
196addbf 4137 """UpdateUIEvent_SetMode(int mode)"""
54f9ee45 4138 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 4139
e811c8ce 4140def UpdateUIEvent_GetMode(*args, **kwargs):
196addbf 4141 """UpdateUIEvent_GetMode() -> int"""
54f9ee45 4142 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d14a1e28
RD
4143
4144#---------------------------------------------------------------------------
4145
4146class SysColourChangedEvent(Event):
e811c8ce
RD
4147 def __repr__(self):
4148 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4149 def __init__(self, *args, **kwargs):
a95a7133 4150 """__init__(self) -> SysColourChangedEvent"""
54f9ee45 4151 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
d14a1e28
RD
4152 self.this = newobj.this
4153 self.thisown = 1
4154 del newobj.thisown
d14a1e28
RD
4155
4156class SysColourChangedEventPtr(SysColourChangedEvent):
4157 def __init__(self, this):
4158 self.this = this
4159 if not hasattr(self,"thisown"): self.thisown = 0
4160 self.__class__ = SysColourChangedEvent
54f9ee45 4161_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
d14a1e28
RD
4162
4163#---------------------------------------------------------------------------
4164
4165class MouseCaptureChangedEvent(Event):
e811c8ce
RD
4166 def __repr__(self):
4167 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4168 def __init__(self, *args, **kwargs):
a95a7133 4169 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
54f9ee45 4170 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
d14a1e28
RD
4171 self.this = newobj.this
4172 self.thisown = 1
4173 del newobj.thisown
e811c8ce 4174 def GetCapturedWindow(*args, **kwargs):
a95a7133 4175 """GetCapturedWindow(self) -> Window"""
54f9ee45 4176 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 4177
d14a1e28
RD
4178
4179class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
4180 def __init__(self, this):
4181 self.this = this
4182 if not hasattr(self,"thisown"): self.thisown = 0
4183 self.__class__ = MouseCaptureChangedEvent
54f9ee45 4184_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
d14a1e28
RD
4185
4186#---------------------------------------------------------------------------
4187
4188class DisplayChangedEvent(Event):
e811c8ce
RD
4189 def __repr__(self):
4190 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4191 def __init__(self, *args, **kwargs):
a95a7133 4192 """__init__(self) -> DisplayChangedEvent"""
54f9ee45 4193 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
d14a1e28
RD
4194 self.this = newobj.this
4195 self.thisown = 1
4196 del newobj.thisown
d14a1e28
RD
4197
4198class DisplayChangedEventPtr(DisplayChangedEvent):
4199 def __init__(self, this):
4200 self.this = this
4201 if not hasattr(self,"thisown"): self.thisown = 0
4202 self.__class__ = DisplayChangedEvent
54f9ee45 4203_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
d14a1e28
RD
4204
4205#---------------------------------------------------------------------------
4206
4207class PaletteChangedEvent(Event):
e811c8ce
RD
4208 def __repr__(self):
4209 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4210 def __init__(self, *args, **kwargs):
a95a7133 4211 """__init__(self, int id=0) -> PaletteChangedEvent"""
54f9ee45 4212 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
d14a1e28
RD
4213 self.this = newobj.this
4214 self.thisown = 1
4215 del newobj.thisown
e811c8ce 4216 def SetChangedWindow(*args, **kwargs):
a95a7133 4217 """SetChangedWindow(self, Window win)"""
54f9ee45 4218 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
4219
4220 def GetChangedWindow(*args, **kwargs):
a95a7133 4221 """GetChangedWindow(self) -> Window"""
54f9ee45 4222 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 4223
d14a1e28
RD
4224
4225class PaletteChangedEventPtr(PaletteChangedEvent):
4226 def __init__(self, this):
4227 self.this = this
4228 if not hasattr(self,"thisown"): self.thisown = 0
4229 self.__class__ = PaletteChangedEvent
54f9ee45 4230_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
d14a1e28
RD
4231
4232#---------------------------------------------------------------------------
4233
4234class QueryNewPaletteEvent(Event):
e811c8ce
RD
4235 def __repr__(self):
4236 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4237 def __init__(self, *args, **kwargs):
a95a7133 4238 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
54f9ee45 4239 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
d14a1e28
RD
4240 self.this = newobj.this
4241 self.thisown = 1
4242 del newobj.thisown
e811c8ce 4243 def SetPaletteRealized(*args, **kwargs):
a95a7133 4244 """SetPaletteRealized(self, bool realized)"""
54f9ee45 4245 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
4246
4247 def GetPaletteRealized(*args, **kwargs):
a95a7133 4248 """GetPaletteRealized(self) -> bool"""
54f9ee45 4249 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 4250
d14a1e28
RD
4251
4252class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
4253 def __init__(self, this):
4254 self.this = this
4255 if not hasattr(self,"thisown"): self.thisown = 0
4256 self.__class__ = QueryNewPaletteEvent
54f9ee45 4257_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
d14a1e28
RD
4258
4259#---------------------------------------------------------------------------
4260
4261class NavigationKeyEvent(Event):
e811c8ce
RD
4262 def __repr__(self):
4263 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4264 def __init__(self, *args, **kwargs):
a95a7133 4265 """__init__(self) -> NavigationKeyEvent"""
54f9ee45 4266 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
d14a1e28
RD
4267 self.this = newobj.this
4268 self.thisown = 1
4269 del newobj.thisown
e811c8ce 4270 def GetDirection(*args, **kwargs):
a95a7133 4271 """GetDirection(self) -> bool"""
54f9ee45 4272 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
4273
4274 def SetDirection(*args, **kwargs):
908b74cd 4275 """SetDirection(self, bool forward)"""
54f9ee45 4276 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
4277
4278 def IsWindowChange(*args, **kwargs):
a95a7133 4279 """IsWindowChange(self) -> bool"""
54f9ee45 4280 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
4281
4282 def SetWindowChange(*args, **kwargs):
908b74cd 4283 """SetWindowChange(self, bool ischange)"""
54f9ee45 4284 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 4285
908b74cd
RD
4286 def SetFlags(*args, **kwargs):
4287 """SetFlags(self, long flags)"""
4288 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
4289
e811c8ce 4290 def GetCurrentFocus(*args, **kwargs):
a95a7133 4291 """GetCurrentFocus(self) -> Window"""
54f9ee45 4292 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
4293
4294 def SetCurrentFocus(*args, **kwargs):
a95a7133 4295 """SetCurrentFocus(self, Window win)"""
54f9ee45 4296 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 4297
908b74cd
RD
4298 IsForward = _core_.NavigationKeyEvent_IsForward
4299 WinChange = _core_.NavigationKeyEvent_WinChange
d14a1e28
RD
4300
4301class NavigationKeyEventPtr(NavigationKeyEvent):
4302 def __init__(self, this):
4303 self.this = this
4304 if not hasattr(self,"thisown"): self.thisown = 0
4305 self.__class__ = NavigationKeyEvent
54f9ee45 4306_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
d14a1e28
RD
4307
4308#---------------------------------------------------------------------------
4309
4310class WindowCreateEvent(CommandEvent):
e811c8ce
RD
4311 def __repr__(self):
4312 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4313 def __init__(self, *args, **kwargs):
a95a7133 4314 """__init__(self, Window win=None) -> WindowCreateEvent"""
54f9ee45 4315 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
d14a1e28
RD
4316 self.this = newobj.this
4317 self.thisown = 1
4318 del newobj.thisown
e811c8ce 4319 def GetWindow(*args, **kwargs):
a95a7133 4320 """GetWindow(self) -> Window"""
54f9ee45 4321 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 4322
d14a1e28
RD
4323
4324class WindowCreateEventPtr(WindowCreateEvent):
4325 def __init__(self, this):
4326 self.this = this
4327 if not hasattr(self,"thisown"): self.thisown = 0
4328 self.__class__ = WindowCreateEvent
54f9ee45 4329_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
d14a1e28
RD
4330
4331class WindowDestroyEvent(CommandEvent):
e811c8ce
RD
4332 def __repr__(self):
4333 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4334 def __init__(self, *args, **kwargs):
a95a7133 4335 """__init__(self, Window win=None) -> WindowDestroyEvent"""
54f9ee45 4336 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
d14a1e28
RD
4337 self.this = newobj.this
4338 self.thisown = 1
4339 del newobj.thisown
e811c8ce 4340 def GetWindow(*args, **kwargs):
a95a7133 4341 """GetWindow(self) -> Window"""
54f9ee45 4342 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 4343
d14a1e28
RD
4344
4345class WindowDestroyEventPtr(WindowDestroyEvent):
4346 def __init__(self, this):
4347 self.this = this
4348 if not hasattr(self,"thisown"): self.thisown = 0
4349 self.__class__ = WindowDestroyEvent
54f9ee45 4350_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
d14a1e28
RD
4351
4352#---------------------------------------------------------------------------
4353
4354class ContextMenuEvent(CommandEvent):
e811c8ce
RD
4355 def __repr__(self):
4356 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4357 def __init__(self, *args, **kwargs):
a95a7133 4358 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
54f9ee45 4359 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
d14a1e28
RD
4360 self.this = newobj.this
4361 self.thisown = 1
4362 del newobj.thisown
e811c8ce 4363 def GetPosition(*args, **kwargs):
a95a7133 4364 """GetPosition(self) -> Point"""
54f9ee45 4365 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4366
4367 def SetPosition(*args, **kwargs):
a95a7133 4368 """SetPosition(self, Point pos)"""
54f9ee45 4369 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 4370
d14a1e28
RD
4371
4372class ContextMenuEventPtr(ContextMenuEvent):
4373 def __init__(self, this):
4374 self.this = this
4375 if not hasattr(self,"thisown"): self.thisown = 0
4376 self.__class__ = ContextMenuEvent
54f9ee45 4377_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
d14a1e28
RD
4378
4379#---------------------------------------------------------------------------
4380
54f9ee45
RD
4381IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4382IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 4383class IdleEvent(Event):
e811c8ce
RD
4384 def __repr__(self):
4385 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4386 def __init__(self, *args, **kwargs):
a95a7133 4387 """__init__(self) -> IdleEvent"""
54f9ee45 4388 newobj = _core_.new_IdleEvent(*args, **kwargs)
d14a1e28
RD
4389 self.this = newobj.this
4390 self.thisown = 1
4391 del newobj.thisown
e811c8ce 4392 def RequestMore(*args, **kwargs):
a95a7133 4393 """RequestMore(self, bool needMore=True)"""
54f9ee45 4394 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
4395
4396 def MoreRequested(*args, **kwargs):
a95a7133 4397 """MoreRequested(self) -> bool"""
54f9ee45 4398 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
4399
4400 def SetMode(*args, **kwargs):
66c033b4 4401 """SetMode(int mode)"""
54f9ee45 4402 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
4403
4404 SetMode = staticmethod(SetMode)
4405 def GetMode(*args, **kwargs):
66c033b4 4406 """GetMode() -> int"""
54f9ee45 4407 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
4408
4409 GetMode = staticmethod(GetMode)
4410 def CanSend(*args, **kwargs):
66c033b4 4411 """CanSend(Window win) -> bool"""
54f9ee45 4412 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
4413
4414 CanSend = staticmethod(CanSend)
d14a1e28
RD
4415
4416class IdleEventPtr(IdleEvent):
4417 def __init__(self, this):
4418 self.this = this
4419 if not hasattr(self,"thisown"): self.thisown = 0
4420 self.__class__ = IdleEvent
54f9ee45 4421_core_.IdleEvent_swigregister(IdleEventPtr)
d14a1e28 4422
e811c8ce 4423def IdleEvent_SetMode(*args, **kwargs):
196addbf 4424 """IdleEvent_SetMode(int mode)"""
54f9ee45 4425 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 4426
e811c8ce 4427def IdleEvent_GetMode(*args, **kwargs):
196addbf 4428 """IdleEvent_GetMode() -> int"""
54f9ee45 4429 return _core_.IdleEvent_GetMode(*args, **kwargs)
d14a1e28 4430
e811c8ce
RD
4431def IdleEvent_CanSend(*args, **kwargs):
4432 """IdleEvent_CanSend(Window win) -> bool"""
54f9ee45 4433 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
4434
4435#---------------------------------------------------------------------------
4436
4437class PyEvent(Event):
e811c8ce
RD
4438 def __repr__(self):
4439 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4440 def __init__(self, *args, **kwargs):
a95a7133 4441 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
54f9ee45 4442 newobj = _core_.new_PyEvent(*args, **kwargs)
d14a1e28
RD
4443 self.this = newobj.this
4444 self.thisown = 1
4445 del newobj.thisown
4446 self.SetSelf(self)
e811c8ce 4447
54f9ee45 4448 def __del__(self, destroy=_core_.delete_PyEvent):
a95a7133 4449 """__del__(self)"""
d14a1e28
RD
4450 try:
4451 if self.thisown: destroy(self)
4452 except: pass
e811c8ce
RD
4453
4454 def SetSelf(*args, **kwargs):
a95a7133 4455 """SetSelf(self, PyObject self)"""
54f9ee45 4456 return _core_.PyEvent_SetSelf(*args, **kwargs)
e811c8ce
RD
4457
4458 def GetSelf(*args, **kwargs):
a95a7133 4459 """GetSelf(self) -> PyObject"""
54f9ee45 4460 return _core_.PyEvent_GetSelf(*args, **kwargs)
e811c8ce 4461
d14a1e28
RD
4462
4463class PyEventPtr(PyEvent):
4464 def __init__(self, this):
4465 self.this = this
4466 if not hasattr(self,"thisown"): self.thisown = 0
4467 self.__class__ = PyEvent
54f9ee45 4468_core_.PyEvent_swigregister(PyEventPtr)
d14a1e28
RD
4469
4470class PyCommandEvent(CommandEvent):
e811c8ce
RD
4471 def __repr__(self):
4472 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4473 def __init__(self, *args, **kwargs):
a95a7133 4474 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
54f9ee45 4475 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
d14a1e28
RD
4476 self.this = newobj.this
4477 self.thisown = 1
4478 del newobj.thisown
4479 self.SetSelf(self)
e811c8ce 4480
54f9ee45 4481 def __del__(self, destroy=_core_.delete_PyCommandEvent):
a95a7133 4482 """__del__(self)"""
d14a1e28
RD
4483 try:
4484 if self.thisown: destroy(self)
4485 except: pass
e811c8ce
RD
4486
4487 def SetSelf(*args, **kwargs):
a95a7133 4488 """SetSelf(self, PyObject self)"""
54f9ee45 4489 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
e811c8ce
RD
4490
4491 def GetSelf(*args, **kwargs):
a95a7133 4492 """GetSelf(self) -> PyObject"""
54f9ee45 4493 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
e811c8ce 4494
d14a1e28
RD
4495
4496class PyCommandEventPtr(PyCommandEvent):
4497 def __init__(self, this):
4498 self.this = this
4499 if not hasattr(self,"thisown"): self.thisown = 0
4500 self.__class__ = PyCommandEvent
54f9ee45 4501_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
d14a1e28
RD
4502
4503#---------------------------------------------------------------------------
4504
54f9ee45
RD
4505PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4506PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4507PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4508PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4509PRINT_WINDOWS = _core_.PRINT_WINDOWS
4510PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 4511class PyApp(EvtHandler):
66c033b4
RD
4512 """
4513 The ``wx.PyApp`` class is an *implementation detail*, please use the
4514 `wx.App` class (or some other derived class) instead.
4515 """
e811c8ce
RD
4516 def __repr__(self):
4517 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 4518 def __init__(self, *args, **kwargs):
98e665d3 4519 """
a95a7133 4520 __init__(self) -> PyApp
98e665d3
RD
4521
4522 Create a new application object, starting the bootstrap process.
4523 """
54f9ee45 4524 newobj = _core_.new_PyApp(*args, **kwargs)
d14a1e28
RD
4525 self.this = newobj.this
4526 self.thisown = 1
4527 del newobj.thisown
4528 self._setCallbackInfo(self, PyApp)
4529 self._setOORInfo(self)
e811c8ce 4530
54f9ee45 4531 def __del__(self, destroy=_core_.delete_PyApp):
a95a7133 4532 """__del__(self)"""
d14a1e28
RD
4533 try:
4534 if self.thisown: destroy(self)
4535 except: pass
e811c8ce
RD
4536
4537 def _setCallbackInfo(*args, **kwargs):
a95a7133 4538 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 4539 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
4540
4541 def GetAppName(*args, **kwargs):
0df68c9f 4542 """
a95a7133 4543 GetAppName(self) -> String
6c3b4aae 4544
0df68c9f
RD
4545 Get the application name.
4546 """
54f9ee45 4547 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
4548
4549 def SetAppName(*args, **kwargs):
0df68c9f 4550 """
a95a7133 4551 SetAppName(self, String name)
6c3b4aae 4552
66c033b4
RD
4553 Set the application name. This value may be used automatically by
4554 `wx.Config` and such.
0df68c9f 4555 """
54f9ee45 4556 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
4557
4558 def GetClassName(*args, **kwargs):
0df68c9f 4559 """
a95a7133 4560 GetClassName(self) -> String
e811c8ce 4561
0df68c9f
RD
4562 Get the application's class name.
4563 """
54f9ee45 4564 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
4565
4566 def SetClassName(*args, **kwargs):
0df68c9f 4567 """
a95a7133 4568 SetClassName(self, String name)
6c3b4aae 4569
66c033b4
RD
4570 Set the application's class name. This value may be used for
4571 X-resources if applicable for the platform
0df68c9f 4572 """
54f9ee45 4573 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
4574
4575 def GetVendorName(*args, **kwargs):
0df68c9f 4576 """
a95a7133 4577 GetVendorName(self) -> String
6c3b4aae 4578
0df68c9f
RD
4579 Get the application's vendor name.
4580 """
54f9ee45 4581 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
4582
4583 def SetVendorName(*args, **kwargs):
0df68c9f 4584 """
a95a7133 4585 SetVendorName(self, String name)
6c3b4aae 4586
66c033b4
RD
4587 Set the application's vendor name. This value may be used
4588 automatically by `wx.Config` and such.
0df68c9f 4589 """
54f9ee45 4590 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
4591
4592 def GetTraits(*args, **kwargs):
0df68c9f 4593 """
a95a7133 4594 GetTraits(self) -> wxAppTraits
6c3b4aae 4595
66c033b4
RD
4596 Return (and create if necessary) the app traits object to which we
4597 delegate for everything which either should be configurable by the
4598 user (then he can change the default behaviour simply by overriding
4599 CreateTraits() and returning his own traits object) or which is
4600 GUI/console dependent as then wx.AppTraits allows us to abstract the
4601 differences behind the common facade.
4602
4603 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 4604 """
54f9ee45 4605 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
4606
4607 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 4608 """
a95a7133 4609 ProcessPendingEvents(self)
6c3b4aae 4610
66c033b4
RD
4611 Process all events in the Pending Events list -- it is necessary to
4612 call this function to process posted events. This normally happens
4613 during each event loop iteration.
0df68c9f 4614 """
54f9ee45 4615 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
4616
4617 def Yield(*args, **kwargs):
0df68c9f 4618 """
a95a7133 4619 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 4620
66c033b4
RD
4621 Process all currently pending events right now, instead of waiting
4622 until return to the event loop. It is an error to call ``Yield``
4623 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 4624
66c033b4 4625 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
4626 reentrancies (i.e. when called from an event handler it may
4627 result in calling the same event handler again), use with
4628 extreme care or, better, don't use at all!
0df68c9f 4629
66c033b4 4630 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 4631
0df68c9f 4632 """
54f9ee45 4633 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
4634
4635 def WakeUpIdle(*args, **kwargs):
0df68c9f 4636 """
a95a7133 4637 WakeUpIdle(self)
6c3b4aae 4638
66c033b4
RD
4639 Make sure that idle events are sent again.
4640 :see: `wx.WakeUpIdle`
0df68c9f 4641 """
54f9ee45 4642 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce
RD
4643
4644 def MainLoop(*args, **kwargs):
0df68c9f 4645 """
a95a7133 4646 MainLoop(self) -> int
6c3b4aae 4647
66c033b4
RD
4648 Execute the main GUI loop, the function doesn't normally return until
4649 all top level windows have been closed and destroyed.
0df68c9f 4650 """
54f9ee45 4651 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
4652
4653 def Exit(*args, **kwargs):
0df68c9f 4654 """
a95a7133 4655 Exit(self)
6c3b4aae 4656
0df68c9f 4657 Exit the main loop thus terminating the application.
66c033b4 4658 :see: `wx.Exit`
0df68c9f 4659 """
54f9ee45 4660 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce
RD
4661
4662 def ExitMainLoop(*args, **kwargs):
0df68c9f 4663 """
a95a7133 4664 ExitMainLoop(self)
6c3b4aae 4665
66c033b4
RD
4666 Exit the main GUI loop during the next iteration of the main
4667 loop, (i.e. it does not stop the program immediately!)
0df68c9f 4668 """
54f9ee45 4669 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
4670
4671 def Pending(*args, **kwargs):
0df68c9f 4672 """
a95a7133 4673 Pending(self) -> bool
6c3b4aae 4674
0df68c9f
RD
4675 Returns True if there are unprocessed events in the event queue.
4676 """
54f9ee45 4677 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
4678
4679 def Dispatch(*args, **kwargs):
0df68c9f 4680 """
a95a7133 4681 Dispatch(self) -> bool
6c3b4aae 4682
0df68c9f
RD
4683 Process the first event in the event queue (blocks until an event
4684 appears if there are none currently)
4685 """
54f9ee45 4686 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
4687
4688 def ProcessIdle(*args, **kwargs):
0df68c9f 4689 """
a95a7133 4690 ProcessIdle(self) -> bool
6c3b4aae 4691
66c033b4
RD
4692 Called from the MainLoop when the application becomes idle (there are
4693 no pending events) and sends a `wx.IdleEvent` to all interested
4694 parties. Returns True if more idle events are needed, False if not.
0df68c9f 4695 """
54f9ee45 4696 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
4697
4698 def SendIdleEvents(*args, **kwargs):
0df68c9f 4699 """
a95a7133 4700 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 4701
66c033b4
RD
4702 Send idle event to window and all subwindows. Returns True if more
4703 idle time is requested.
0df68c9f 4704 """
54f9ee45 4705 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
4706
4707 def IsActive(*args, **kwargs):
0df68c9f 4708 """
a95a7133 4709 IsActive(self) -> bool
6c3b4aae 4710
0df68c9f
RD
4711 Return True if our app has focus.
4712 """
54f9ee45 4713 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
4714
4715 def SetTopWindow(*args, **kwargs):
0df68c9f 4716 """
a95a7133 4717 SetTopWindow(self, Window win)
6c3b4aae 4718
66c033b4 4719 Set the *main* top level window
0df68c9f 4720 """
54f9ee45 4721 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
4722
4723 def GetTopWindow(*args, **kwargs):
0df68c9f 4724 """
a95a7133 4725 GetTopWindow(self) -> Window
6c3b4aae 4726
66c033b4
RD
4727 Return the *main* top level window (if it hadn't been set previously
4728 with SetTopWindow(), will return just some top level window and, if
4729 there not any, will return None)
0df68c9f 4730 """
54f9ee45 4731 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
4732
4733 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 4734 """
a95a7133 4735 SetExitOnFrameDelete(self, bool flag)
0df68c9f 4736
66c033b4
RD
4737 Control the exit behaviour: by default, the program will exit the main
4738 loop (and so, usually, terminate) when the last top-level program
4739 window is deleted. Beware that if you disable this behaviour (with
4740 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
4741 explicitly from somewhere.
0df68c9f 4742 """
54f9ee45 4743 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
4744
4745 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 4746 """
a95a7133 4747 GetExitOnFrameDelete(self) -> bool
6c3b4aae 4748
0df68c9f
RD
4749 Get the current exit behaviour setting.
4750 """
54f9ee45 4751 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
4752
4753 def SetUseBestVisual(*args, **kwargs):
0df68c9f 4754 """
a95a7133 4755 SetUseBestVisual(self, bool flag)
6c3b4aae 4756
66c033b4
RD
4757 Set whether the app should try to use the best available visual on
4758 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 4759 """
54f9ee45 4760 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
4761
4762 def GetUseBestVisual(*args, **kwargs):
0df68c9f 4763 """
a95a7133 4764 GetUseBestVisual(self) -> bool
6c3b4aae 4765
0df68c9f
RD
4766 Get current UseBestVisual setting.
4767 """
54f9ee45 4768 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
4769
4770 def SetPrintMode(*args, **kwargs):
a95a7133 4771 """SetPrintMode(self, int mode)"""
54f9ee45 4772 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
4773
4774 def GetPrintMode(*args, **kwargs):
a95a7133 4775 """GetPrintMode(self) -> int"""
54f9ee45 4776 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 4777
e811c8ce 4778 def SetAssertMode(*args, **kwargs):
0df68c9f 4779 """
a95a7133 4780 SetAssertMode(self, int mode)
6c3b4aae 4781
41e2b43e 4782 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 4783 """
54f9ee45 4784 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 4785
6c3b4aae 4786 def GetAssertMode(*args, **kwargs):
0df68c9f 4787 """
a95a7133 4788 GetAssertMode(self) -> int
6c3b4aae 4789
0df68c9f
RD
4790 Get the current OnAssert behaviour setting.
4791 """
54f9ee45 4792 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 4793
e811c8ce 4794 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 4795 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 4796 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
4797
4798 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
4799 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 4800 """GetMacAboutMenuItemId() -> long"""
54f9ee45 4801 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
4802
4803 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
4804 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 4805 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 4806 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
4807
4808 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
4809 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 4810 """GetMacExitMenuItemId() -> long"""
54f9ee45 4811 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
4812
4813 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
4814 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 4815 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 4816 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
4817
4818 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
4819 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 4820 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 4821 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
4822
4823 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
4824 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 4825 """SetMacAboutMenuItemId(long val)"""
54f9ee45 4826 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
4827
4828 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
4829 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 4830 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 4831 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
4832
4833 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
4834 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 4835 """SetMacExitMenuItemId(long val)"""
54f9ee45 4836 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
4837
4838 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
4839 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 4840 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 4841 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
4842
4843 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
4844 def _BootstrapApp(*args, **kwargs):
0df68c9f 4845 """
a95a7133 4846 _BootstrapApp(self)
6c3b4aae 4847
0df68c9f
RD
4848 For internal use only
4849 """
54f9ee45 4850 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
4851
4852 def GetComCtl32Version(*args, **kwargs):
0df68c9f 4853 """
66c033b4 4854 GetComCtl32Version() -> int
6c3b4aae 4855
66c033b4
RD
4856 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
4857 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 4858 """
54f9ee45 4859 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
4860
4861 GetComCtl32Version = staticmethod(GetComCtl32Version)
d14a1e28
RD
4862
4863class PyAppPtr(PyApp):
4864 def __init__(self, this):
4865 self.this = this
4866 if not hasattr(self,"thisown"): self.thisown = 0
4867 self.__class__ = PyApp
54f9ee45 4868_core_.PyApp_swigregister(PyAppPtr)
d14a1e28 4869
e811c8ce
RD
4870def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
4871 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 4872 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 4873
e811c8ce
RD
4874def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
4875 """PyApp_GetMacAboutMenuItemId() -> long"""
54f9ee45 4876 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 4877
e811c8ce
RD
4878def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
4879 """PyApp_GetMacPreferencesMenuItemId() -> long"""
54f9ee45 4880 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 4881
e811c8ce
RD
4882def PyApp_GetMacExitMenuItemId(*args, **kwargs):
4883 """PyApp_GetMacExitMenuItemId() -> long"""
54f9ee45 4884 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d14a1e28 4885
e811c8ce 4886def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
196addbf 4887 """PyApp_GetMacHelpMenuTitleName() -> String"""
54f9ee45 4888 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 4889
e811c8ce
RD
4890def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
4891 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 4892 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 4893
e811c8ce
RD
4894def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
4895 """PyApp_SetMacAboutMenuItemId(long val)"""
54f9ee45 4896 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 4897
e811c8ce
RD
4898def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
4899 """PyApp_SetMacPreferencesMenuItemId(long val)"""
54f9ee45 4900 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 4901
e811c8ce
RD
4902def PyApp_SetMacExitMenuItemId(*args, **kwargs):
4903 """PyApp_SetMacExitMenuItemId(long val)"""
54f9ee45 4904 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 4905
e811c8ce 4906def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
196addbf 4907 """PyApp_SetMacHelpMenuTitleName(String val)"""
54f9ee45 4908 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 4909
e811c8ce 4910def PyApp_GetComCtl32Version(*args, **kwargs):
0df68c9f
RD
4911 """
4912 PyApp_GetComCtl32Version() -> int
6c3b4aae 4913
66c033b4
RD
4914 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
4915 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 4916 """
54f9ee45 4917 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d14a1e28
RD
4918
4919#---------------------------------------------------------------------------
4920
4921
e811c8ce 4922def Exit(*args, **kwargs):
0df68c9f
RD
4923 """
4924 Exit()
6c3b4aae 4925
0df68c9f
RD
4926 Force an exit of the application. Convenience for wx.GetApp().Exit()
4927 """
54f9ee45 4928 return _core_.Exit(*args, **kwargs)
d14a1e28 4929
e811c8ce 4930def Yield(*args, **kwargs):
0df68c9f
RD
4931 """
4932 Yield() -> bool
6c3b4aae 4933
0df68c9f
RD
4934 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
4935 """
54f9ee45 4936 return _core_.Yield(*args, **kwargs)
d14a1e28 4937
e811c8ce 4938def YieldIfNeeded(*args, **kwargs):
0df68c9f
RD
4939 """
4940 YieldIfNeeded() -> bool
6c3b4aae 4941
0df68c9f
RD
4942 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
4943 """
54f9ee45 4944 return _core_.YieldIfNeeded(*args, **kwargs)
d14a1e28 4945
e811c8ce 4946def SafeYield(*args, **kwargs):
0df68c9f
RD
4947 """
4948 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 4949
66c033b4
RD
4950 This function is similar to `wx.Yield`, except that it disables the
4951 user input to all program windows before calling `wx.Yield` and
4952 re-enables it again afterwards. If ``win`` is not None, this window
4953 will remain enabled, allowing the implementation of some limited user
4954 interaction.
6c3b4aae 4955
66c033b4 4956 :Returns: the result of the call to `wx.Yield`.
0df68c9f 4957 """
54f9ee45 4958 return _core_.SafeYield(*args, **kwargs)
d14a1e28 4959
e811c8ce 4960def WakeUpIdle(*args, **kwargs):
0df68c9f
RD
4961 """
4962 WakeUpIdle()
6c3b4aae 4963
66c033b4
RD
4964 Cause the message queue to become empty again, so idle events will be
4965 sent.
0df68c9f 4966 """
54f9ee45 4967 return _core_.WakeUpIdle(*args, **kwargs)
d14a1e28 4968
e811c8ce 4969def PostEvent(*args, **kwargs):
0df68c9f
RD
4970 """
4971 PostEvent(EvtHandler dest, Event event)
6c3b4aae 4972
66c033b4
RD
4973 Send an event to a window or other wx.EvtHandler to be processed
4974 later.
0df68c9f 4975 """
54f9ee45 4976 return _core_.PostEvent(*args, **kwargs)
d14a1e28 4977
e811c8ce 4978def App_CleanUp(*args, **kwargs):
0df68c9f
RD
4979 """
4980 App_CleanUp()
6c3b4aae 4981
41e2b43e 4982 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 4983 Python shuts down.
0df68c9f 4984 """
54f9ee45 4985 return _core_.App_CleanUp(*args, **kwargs)
d14a1e28 4986
e811c8ce 4987def GetApp(*args, **kwargs):
0df68c9f
RD
4988 """
4989 GetApp() -> PyApp
6c3b4aae 4990
196addbf 4991 Return a reference to the current wx.App object.
0df68c9f 4992 """
54f9ee45 4993 return _core_.GetApp(*args, **kwargs)
d14a1e28
RD
4994#----------------------------------------------------------------------
4995
4996class PyOnDemandOutputWindow:
6c3b4aae
RD
4997 """
4998 A class that can be used for redirecting Python's stdout and
4999 stderr streams. It will do nothing until something is wrriten to
5000 the stream at which point it will create a Frame with a text area
5001 and write the text there.
5002 """
d14a1e28
RD
5003 def __init__(self, title = "wxPython: stdout/stderr"):
5004 self.frame = None
5005 self.title = title
5006 self.parent = None
5007
5008 def SetParent(self, parent):
6c3b4aae 5009 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
5010 self.parent = parent
5011
6c3b4aae
RD
5012
5013 def CreateOutputWindow(self, st):
5014 self.frame = wx.Frame(self.parent, -1, self.title,
5015 style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
196addbf
RD
5016 self.text = wx.TextCtrl(self.frame, -1, "",
5017 style = wx.TE_MULTILINE | wx.TE_READONLY)
d1e20054 5018 self.text.AppendText(st)
6c3b4aae
RD
5019 self.frame.SetSize((450, 300))
5020 self.frame.Show(True)
5021 EVT_CLOSE(self.frame, self.OnCloseWindow)
5022
d14a1e28 5023
7409c0c6
RD
5024 def OnCloseWindow(self, event):
5025 if self.frame is not None:
5026 self.frame.Destroy()
5027 self.frame = None
5028 self.text = None
5029
5030
d14a1e28 5031 # These methods provide the file-like output behaviour.
6c3b4aae
RD
5032 def write(self, text):
5033 """
5034 Create the output window if needed and write the string to it.
5035 If not called in the context of the gui thread then uses
5036 CallAfter to do the work there.
5037 """
5038 if self.frame is None:
5039 if not wx.Thread_IsMain():
5040 wx.CallAfter(self.CreateOutputWindow, text)
5041 else:
5042 self.CreateOutputWindow(text)
5043 else:
5044 if not wx.Thread_IsMain():
5045 wx.CallAfter(self.text.AppendText, text)
5046 else:
5047 self.text.AppendText(text)
5048
d14a1e28
RD
5049
5050 def close(self):
6c3b4aae
RD
5051 if self.frame is not None:
5052 wx.CallAfter(self.frame.Close)
5053
d14a1e28 5054
19272049
RD
5055 def flush(self):
5056 pass
5057
5058
d14a1e28
RD
5059
5060#----------------------------------------------------------------------
d14a1e28
RD
5061
5062_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5063
5064class App(wx.PyApp):
6c3b4aae 5065 """
66c033b4
RD
5066 The ``wx.App`` class represents the application and is used to:
5067
5068 * bootstrap the wxPython system and initialize the underlying
5069 gui toolkit
5070 * set and get application-wide properties
5071 * implement the windowing system main message or event loop,
5072 and to dispatch events to window instances
5073 * etc.
5074
5075 Every application must have a ``wx.App`` instance, and all
5076 creation of UI objects should be delayed until after the
03e37cd5
RD
5077 ``wx.App`` object has been created in order to ensure that the gui
5078 platform and wxWidgets have been fully initialized.
66c033b4
RD
5079
5080 Normally you would derive from this class and implement an
5081 ``OnInit`` method that creates a frame and then calls
5082 ``self.SetTopWindow(frame)``.
5083
03e37cd5 5084 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 5085 directly.
6c3b4aae 5086 """
66c033b4 5087
d14a1e28
RD
5088 outputWindowClass = PyOnDemandOutputWindow
5089
03e37cd5
RD
5090 def __init__(self, redirect=_defRedirect, filename=None,
5091 useBestVisual=False, clearSigInt=True):
66c033b4
RD
5092 """
5093 Construct a ``wx.App`` object.
5094
03e37cd5
RD
5095 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5096 redirected? Defaults to True on Windows and Mac, False
5097 otherwise. If `filename` is None then output will be
5098 redirected to a window that pops up as needed. (You can
5099 control what kind of window is created for the output by
5100 resetting the class variable ``outputWindowClass`` to a
5101 class of your choosing.)
66c033b4 5102
03e37cd5
RD
5103 :param filename: The name of a file to redirect output to, if
5104 redirect is True.
66c033b4
RD
5105
5106 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
5107 available visual provided by the system (only relevant on
5108 systems that have more than one visual.) This parameter
5109 must be used instead of calling `SetUseBestVisual` later
5110 on because it must be set before the underlying GUI
5111 toolkit is initialized.
5112
5113 :param clearSigInt: Should SIGINT be cleared? This allows the
5114 app to terminate upon a Ctrl-C in the console like other
5115 GUI apps will.
66c033b4
RD
5116
5117 :note: You should override OnInit to do applicaition
5118 initialization to ensure that the system, toolkit and
5119 wxWidgets are fully initialized.
5120 """
d14a1e28
RD
5121 wx.PyApp.__init__(self)
5122
5123 if wx.Platform == "__WXMAC__":
5124 try:
5125 import MacOS
5126 if not MacOS.WMAvailable():
5127 print """\
5128This program needs access to the screen. Please run with 'pythonw',
5129not 'python', and only when you are logged in on the main display of
5130your Mac."""
5131 _sys.exit(1)
36cadbf7
RD
5132 except SystemExit:
5133 raise
d14a1e28
RD
5134 except:
5135 pass
5136
5137 # This has to be done before OnInit
5138 self.SetUseBestVisual(useBestVisual)
5139
5140 # Set the default handler for SIGINT. This fixes a problem
5141 # where if Ctrl-C is pressed in the console that started this
5142 # app then it will not appear to do anything, (not even send
5143 # KeyboardInterrupt???) but will later segfault on exit. By
5144 # setting the default handler then the app will exit, as
5145 # expected (depending on platform.)
03e37cd5
RD
5146 if clearSigInt:
5147 try:
5148 import signal
5149 signal.signal(signal.SIGINT, signal.SIG_DFL)
5150 except:
5151 pass
d14a1e28
RD
5152
5153 # Save and redirect the stdio to a window?
5154 self.stdioWin = None
5155 self.saveStdio = (_sys.stdout, _sys.stderr)
5156 if redirect:
5157 self.RedirectStdio(filename)
5158
5159 # This finishes the initialization of wxWindows and then calls
5160 # the OnInit that should be present in the derived class
5161 self._BootstrapApp()
5162
5163
5164 def __del__(self):
5165 try:
5166 self.RestoreStdio() # Just in case the MainLoop was overridden
5167 except:
5168 pass
5169
5170
5171 def SetTopWindow(self, frame):
1e0c8722 5172 """Set the \"main\" top level window"""
d14a1e28
RD
5173 if self.stdioWin:
5174 self.stdioWin.SetParent(frame)
5175 wx.PyApp.SetTopWindow(self, frame)
5176
5177
5178 def MainLoop(self):
1e0c8722 5179 """Execute the main GUI event loop"""
d14a1e28
RD
5180 wx.PyApp.MainLoop(self)
5181 self.RestoreStdio()
5182
5183
7409c0c6 5184 def RedirectStdio(self, filename=None):
1e0c8722 5185 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
5186 if filename:
5187 _sys.stdout = _sys.stderr = open(filename, 'a')
5188 else:
5189 self.stdioWin = self.outputWindowClass()
5190 _sys.stdout = _sys.stderr = self.stdioWin
5191
5192
5193 def RestoreStdio(self):
5194 _sys.stdout, _sys.stderr = self.saveStdio
5195
5196
5197
66c033b4 5198# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
5199App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5200App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5201App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5202App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5203App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5204App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5205App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5206App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5207App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5208App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5209App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
5210
5211#----------------------------------------------------------------------------
5212
5213class PySimpleApp(wx.App):
6c3b4aae
RD
5214 """
5215 A simple application class. You can just create one of these and
5216 then then make your top level windows later, and not have to worry
66c033b4
RD
5217 about OnInit. For example::
5218
5219 app = wx.PySimpleApp()
5220 frame = wx.Frame(None, title='Hello World')
5221 frame.Show()
5222 app.MainLoop()
5223
5224 :see: `wx.App`
5225 """
6c3b4aae 5226
03e37cd5
RD
5227 def __init__(self, redirect=False, filename=None,
5228 useBestVisual=False, clearSigInt=True):
66c033b4
RD
5229 """
5230 :see: `wx.App.__init__`
5231 """
03e37cd5 5232 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 5233
d14a1e28 5234 def OnInit(self):
d14a1e28
RD
5235 return True
5236
5237
66c033b4 5238
6c3b4aae 5239# Is anybody using this one?
d14a1e28
RD
5240class PyWidgetTester(wx.App):
5241 def __init__(self, size = (250, 100)):
5242 self.size = size
5243 wx.App.__init__(self, 0)
5244
5245 def OnInit(self):
196addbf 5246 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
5247 self.SetTopWindow(self.frame)
5248 return True
5249
66c033b4
RD
5250 def SetWidget(self, widgetClass, *args, **kwargs):
5251 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
5252 self.frame.Show(True)
5253
5254#----------------------------------------------------------------------------
5255# DO NOT hold any other references to this object. This is how we
66c033b4 5256# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 5257# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 5258# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
5259
5260class __wxPyCleanup:
5261 def __init__(self):
54f9ee45 5262 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
5263 def __del__(self):
5264 self.cleanup()
5265
5266_sys.__wxPythonCleanup = __wxPyCleanup()
5267
5268## # another possible solution, but it gets called too early...
66c033b4
RD
5269## import atexit
5270## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
5271
5272
5273#----------------------------------------------------------------------------
5274
5275#---------------------------------------------------------------------------
5276
1e0c8722 5277class AcceleratorEntry(object):
66c033b4
RD
5278 """
5279 A class used to define items in an `wx.AcceleratorTable`. wxPython
5280 programs can choose to use wx.AcceleratorEntry objects, but using a
5281 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 5282 as well. See `__init__` for of the tuple values.
66c033b4
RD
5283
5284 :see: `wx.AcceleratorTable`
5285 """
1e0c8722
RD
5286 def __repr__(self):
5287 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5288 def __init__(self, *args, **kwargs):
66c033b4
RD
5289 """
5290 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
5291
5292 Construct a wx.AcceleratorEntry.
66c033b4 5293 """
54f9ee45 5294 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
1e0c8722
RD
5295 self.this = newobj.this
5296 self.thisown = 1
5297 del newobj.thisown
54f9ee45 5298 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
a95a7133 5299 """__del__(self)"""
1e0c8722
RD
5300 try:
5301 if self.thisown: destroy(self)
5302 except: pass
5303
5304 def Set(*args, **kwargs):
66c033b4
RD
5305 """
5306 Set(self, int flags, int keyCode, int cmd)
1e0c8722 5307
66c033b4
RD
5308 (Re)set the attributes of a wx.AcceleratorEntry.
5309 :see `__init__`
5310 """
5311 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722
RD
5312
5313 def GetFlags(*args, **kwargs):
66c033b4
RD
5314 """
5315 GetFlags(self) -> int
5316
5317 Get the AcceleratorEntry's flags.
5318 """
54f9ee45 5319 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
5320
5321 def GetKeyCode(*args, **kwargs):
66c033b4
RD
5322 """
5323 GetKeyCode(self) -> int
5324
5325 Get the AcceleratorEntry's keycode.
5326 """
54f9ee45 5327 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
5328
5329 def GetCommand(*args, **kwargs):
66c033b4
RD
5330 """
5331 GetCommand(self) -> int
5332
5333 Get the AcceleratorEntry's command ID.
5334 """
54f9ee45 5335 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722
RD
5336
5337
5338class AcceleratorEntryPtr(AcceleratorEntry):
5339 def __init__(self, this):
5340 self.this = this
5341 if not hasattr(self,"thisown"): self.thisown = 0
5342 self.__class__ = AcceleratorEntry
54f9ee45 5343_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
1e0c8722
RD
5344
5345class AcceleratorTable(Object):
66c033b4
RD
5346 """
5347 An accelerator table allows the application to specify a table of
5348 keyboard shortcuts for menus or other commands. On Windows, menu or
5349 button commands are supported; on GTK, only menu commands are
5350 supported.
66c033b4 5351 """
1e0c8722
RD
5352 def __repr__(self):
5353 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5354 def __init__(self, *args, **kwargs):
0df68c9f
RD
5355 """
5356 __init__(entries) -> AcceleratorTable
1e0c8722 5357
66c033b4
RD
5358 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5359 items or or of 3-tuples (flags, keyCode, cmdID)
5360
5361 :see: `wx.AcceleratorEntry`
0df68c9f 5362 """
54f9ee45 5363 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
1e0c8722
RD
5364 self.this = newobj.this
5365 self.thisown = 1
5366 del newobj.thisown
54f9ee45 5367 def __del__(self, destroy=_core_.delete_AcceleratorTable):
a95a7133 5368 """__del__(self)"""
1e0c8722
RD
5369 try:
5370 if self.thisown: destroy(self)
5371 except: pass
5372
5373 def Ok(*args, **kwargs):
a95a7133 5374 """Ok(self) -> bool"""
54f9ee45 5375 return _core_.AcceleratorTable_Ok(*args, **kwargs)
1e0c8722
RD
5376
5377
5378class AcceleratorTablePtr(AcceleratorTable):
5379 def __init__(self, this):
5380 self.this = this
5381 if not hasattr(self,"thisown"): self.thisown = 0
5382 self.__class__ = AcceleratorTable
54f9ee45 5383_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
1e0c8722
RD
5384
5385
5386def GetAccelFromString(*args, **kwargs):
196addbf 5387 """GetAccelFromString(String label) -> AcceleratorEntry"""
54f9ee45 5388 return _core_.GetAccelFromString(*args, **kwargs)
1e0c8722
RD
5389#---------------------------------------------------------------------------
5390
74a57fcd
RD
5391class VisualAttributes(object):
5392 """struct containing all the visual attributes of a control"""
5393 def __repr__(self):
5394 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5395 def __init__(self, *args, **kwargs):
5396 """
a95a7133 5397 __init__(self) -> VisualAttributes
74a57fcd
RD
5398
5399 struct containing all the visual attributes of a control
5400 """
54f9ee45 5401 newobj = _core_.new_VisualAttributes(*args, **kwargs)
74a57fcd
RD
5402 self.this = newobj.this
5403 self.thisown = 1
5404 del newobj.thisown
54f9ee45 5405 def __del__(self, destroy=_core_.delete_VisualAttributes):
a95a7133 5406 """__del__(self)"""
74a57fcd
RD
5407 try:
5408 if self.thisown: destroy(self)
5409 except: pass
5410
54f9ee45
RD
5411 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
5412 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
5413 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
74a57fcd
RD
5414
5415class VisualAttributesPtr(VisualAttributes):
5416 def __init__(self, this):
5417 self.this = this
5418 if not hasattr(self,"thisown"): self.thisown = 0
5419 self.__class__ = VisualAttributes
54f9ee45 5420_core_.VisualAttributes_swigregister(VisualAttributesPtr)
74a57fcd
RD
5421NullAcceleratorTable = cvar.NullAcceleratorTable
5422PanelNameStr = cvar.PanelNameStr
5423
54f9ee45
RD
5424WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
5425WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
5426WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
5427WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
5428WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 5429class Window(EvtHandler):
15afbcd0
RD
5430 """
5431 wx.Window is the base class for all windows and represents any visible
5432 object on the screen. All controls, top level windows and so on are
5433 wx.Windows. Sizers and device contexts are not however, as they don't
5434 appear on screen themselves.
5435
5436 """
e811c8ce
RD
5437 def __repr__(self):
5438 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 5439 def __init__(self, *args, **kwargs):
0df68c9f 5440 """
a95a7133 5441 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 5442 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
5443
5444 Construct and show a generic Window.
0df68c9f 5445 """
54f9ee45 5446 newobj = _core_.new_Window(*args, **kwargs)
d14a1e28
RD
5447 self.this = newobj.this
5448 self.thisown = 1
5449 del newobj.thisown
5450 self._setOORInfo(self)
d14a1e28 5451
e811c8ce 5452 def Create(*args, **kwargs):
0df68c9f 5453 """
a95a7133 5454 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 5455 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
5456
5457 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 5458 """
54f9ee45 5459 return _core_.Window_Create(*args, **kwargs)
d14a1e28 5460
e811c8ce 5461 def Close(*args, **kwargs):
15afbcd0 5462 """
a95a7133 5463 Close(self, bool force=False) -> bool
15afbcd0
RD
5464
5465 This function simply generates a EVT_CLOSE event whose handler usually
5466 tries to close the window. It doesn't close the window itself,
5467 however. If force is False (the default) then the window's close
5468 handler will be allowed to veto the destruction of the window.
15afbcd0 5469 """
54f9ee45 5470 return _core_.Window_Close(*args, **kwargs)
d14a1e28 5471
e811c8ce 5472 def Destroy(*args, **kwargs):
0df68c9f 5473 """
a95a7133 5474 Destroy(self) -> bool
d14a1e28 5475
15afbcd0
RD
5476 Destroys the window safely. Frames and dialogs are not destroyed
5477 immediately when this function is called -- they are added to a list
5478 of windows to be deleted on idle time, when all the window's events
5479 have been processed. This prevents problems with events being sent to
5480 non-existent windows.
5481
5482 Returns True if the window has either been successfully deleted, or it
5483 has been added to the list of windows pending real deletion.
0df68c9f 5484 """
54f9ee45 5485 return _core_.Window_Destroy(*args, **kwargs)
d14a1e28 5486
e811c8ce 5487 def DestroyChildren(*args, **kwargs):
15afbcd0 5488 """
a95a7133 5489 DestroyChildren(self) -> bool
15afbcd0 5490
41e2b43e
RD
5491 Destroys all children of a window. Called automatically by the
5492 destructor.
15afbcd0 5493 """
54f9ee45 5494 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 5495
e811c8ce 5496 def IsBeingDeleted(*args, **kwargs):
15afbcd0 5497 """
a95a7133 5498 IsBeingDeleted(self) -> bool
15afbcd0
RD
5499
5500 Is the window in the process of being deleted?
5501 """
54f9ee45 5502 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 5503
e811c8ce 5504 def SetTitle(*args, **kwargs):
15afbcd0 5505 """
a95a7133 5506 SetTitle(self, String title)
15afbcd0
RD
5507
5508 Sets the window's title. Applicable only to frames and dialogs.
5509 """
54f9ee45 5510 return _core_.Window_SetTitle(*args, **kwargs)
d14a1e28 5511
e811c8ce 5512 def GetTitle(*args, **kwargs):
15afbcd0 5513 """
a95a7133 5514 GetTitle(self) -> String
15afbcd0
RD
5515
5516 Gets the window's title. Applicable only to frames and dialogs.
5517 """
54f9ee45 5518 return _core_.Window_GetTitle(*args, **kwargs)
d14a1e28 5519
e811c8ce 5520 def SetLabel(*args, **kwargs):
15afbcd0 5521 """
a95a7133 5522 SetLabel(self, String label)
15afbcd0
RD
5523
5524 Set the text which the window shows in its label if applicable.
5525 """
54f9ee45 5526 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 5527
e811c8ce 5528 def GetLabel(*args, **kwargs):
15afbcd0 5529 """
a95a7133 5530 GetLabel(self) -> String
15afbcd0 5531
41e2b43e
RD
5532 Generic way of getting a label from any window, for identification
5533 purposes. The interpretation of this function differs from class to
5534 class. For frames and dialogs, the value returned is the title. For
5535 buttons or static text controls, it is the button text. This function
5536 can be useful for meta-programs such as testing tools or special-needs
5537 access programs)which need to identify windows by name.
15afbcd0 5538 """
54f9ee45 5539 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 5540
e811c8ce 5541 def SetName(*args, **kwargs):
15afbcd0 5542 """
a95a7133 5543 SetName(self, String name)
15afbcd0 5544
41e2b43e
RD
5545 Sets the window's name. The window name is used for ressource setting
5546 in X, it is not the same as the window title/label
15afbcd0 5547 """
54f9ee45 5548 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 5549
e811c8ce 5550 def GetName(*args, **kwargs):
15afbcd0 5551 """
a95a7133 5552 GetName(self) -> String
15afbcd0 5553
41e2b43e
RD
5554 Returns the windows name. This name is not guaranteed to be unique;
5555 it is up to the programmer to supply an appropriate name in the window
5556 constructor or via wx.Window.SetName.
15afbcd0 5557 """
54f9ee45 5558 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 5559
4276dc52
RD
5560 def SetWindowVariant(*args, **kwargs):
5561 """
a95a7133 5562 SetWindowVariant(self, int variant)
4276dc52 5563
41e2b43e
RD
5564 Sets the variant of the window/font size to use for this window, if
5565 the platform supports variants, for example, wxMac.
4276dc52 5566 """
54f9ee45 5567 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
5568
5569 def GetWindowVariant(*args, **kwargs):
a95a7133 5570 """GetWindowVariant(self) -> int"""
54f9ee45 5571 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 5572
e811c8ce 5573 def SetId(*args, **kwargs):
15afbcd0 5574 """
a95a7133 5575 SetId(self, int winid)
15afbcd0
RD
5576
5577 Sets the identifier of the window. Each window has an integer
5578 identifier. If the application has not provided one, an identifier
5579 will be generated. Normally, the identifier should be provided on
5580 creation and should not be modified subsequently.
5581 """
54f9ee45 5582 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 5583
e811c8ce 5584 def GetId(*args, **kwargs):
15afbcd0 5585 """
a95a7133 5586 GetId(self) -> int
15afbcd0
RD
5587
5588 Returns the identifier of the window. Each window has an integer
5589 identifier. If the application has not provided one (or the default Id
5590 -1 is used) then an unique identifier with a negative value will be
5591 generated.
5592 """
54f9ee45 5593 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 5594
e811c8ce 5595 def NewControlId(*args, **kwargs):
15afbcd0 5596 """
66c033b4 5597 NewControlId() -> int
15afbcd0
RD
5598
5599 Generate a control id for the controls which were not given one.
5600 """
54f9ee45 5601 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 5602
e811c8ce
RD
5603 NewControlId = staticmethod(NewControlId)
5604 def NextControlId(*args, **kwargs):
15afbcd0 5605 """
66c033b4 5606 NextControlId(int winid) -> int
15afbcd0
RD
5607
5608 Get the id of the control following the one with the given
41e2b43e 5609 autogenerated) id
15afbcd0 5610 """
54f9ee45 5611 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 5612
e811c8ce
RD
5613 NextControlId = staticmethod(NextControlId)
5614 def PrevControlId(*args, **kwargs):
15afbcd0 5615 """
66c033b4 5616 PrevControlId(int winid) -> int
15afbcd0
RD
5617
5618 Get the id of the control preceding the one with the given
41e2b43e 5619 autogenerated) id
15afbcd0 5620 """
54f9ee45 5621 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 5622
e811c8ce
RD
5623 PrevControlId = staticmethod(PrevControlId)
5624 def SetSize(*args, **kwargs):
15afbcd0 5625 """
a95a7133 5626 SetSize(self, Size size)
15afbcd0
RD
5627
5628 Sets the size of the window in pixels.
5629 """
54f9ee45 5630 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 5631
e811c8ce 5632 def SetDimensions(*args, **kwargs):
15afbcd0 5633 """
a95a7133 5634 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
5635
5636 Sets the position and size of the window in pixels. The sizeFlags
5637 parameter indicates the interpretation of the other params if they are
5638 -1. wx.SIZE_AUTO*: a -1 indicates that a class-specific default
5639 shoudl be used. wx.SIZE_USE_EXISTING: existing dimensions should be
5640 used if -1 values are supplied. wxSIZE_ALLOW_MINUS_ONE: allow
5641 dimensions of -1 and less to be interpreted as real dimensions, not
5642 default values.
5643 """
54f9ee45 5644 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 5645
e811c8ce 5646 def SetRect(*args, **kwargs):
15afbcd0 5647 """
a95a7133 5648 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
5649
5650 Sets the position and size of the window in pixels using a wx.Rect.
5651 """
54f9ee45 5652 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 5653
e811c8ce 5654 def SetSizeWH(*args, **kwargs):
15afbcd0 5655 """
a95a7133 5656 SetSizeWH(self, int width, int height)
15afbcd0
RD
5657
5658 Sets the size of the window in pixels.
5659 """
54f9ee45 5660 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 5661
e811c8ce 5662 def Move(*args, **kwargs):
15afbcd0 5663 """
a95a7133 5664 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
5665
5666 Moves the window to the given position.
5667 """
54f9ee45 5668 return _core_.Window_Move(*args, **kwargs)
d14a1e28 5669
e811c8ce
RD
5670 SetPosition = Move
5671 def MoveXY(*args, **kwargs):
15afbcd0 5672 """
a95a7133 5673 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
5674
5675 Moves the window to the given position.
5676 """
54f9ee45 5677 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 5678
f8167d6e
RD
5679 def SetBestFittingSize(*args, **kwargs):
5680 """
5681 SetBestFittingSize(self, Size size=DefaultSize)
5682
5683 A 'Smart' SetSize that will fill in default size components with the
5684 window's *best size* values. Also set's the minsize for use with sizers.
5685 """
5686 return _core_.Window_SetBestFittingSize(*args, **kwargs)
5687
e811c8ce 5688 def Raise(*args, **kwargs):
15afbcd0 5689 """
a95a7133 5690 Raise(self)
15afbcd0
RD
5691
5692 Raises the window to the top of the window hierarchy if it is a
5693 managed window (dialog or frame).
5694 """
54f9ee45 5695 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
5696
5697 def Lower(*args, **kwargs):
15afbcd0 5698 """
a95a7133 5699 Lower(self)
15afbcd0
RD
5700
5701 Lowers the window to the bottom of the window hierarchy if it is a
5702 managed window (dialog or frame).
5703 """
54f9ee45 5704 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
5705
5706 def SetClientSize(*args, **kwargs):
15afbcd0 5707 """
a95a7133 5708 SetClientSize(self, Size size)
15afbcd0
RD
5709
5710 This sets the size of the window client area in pixels. Using this
5711 function to size a window tends to be more device-independent than
5712 wx.Window.SetSize, since the application need not worry about what
5713 dimensions the border or title bar have when trying to fit the window
5714 around panel items, for example.
5715 """
54f9ee45 5716 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
5717
5718 def SetClientSizeWH(*args, **kwargs):
15afbcd0 5719 """
a95a7133 5720 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
5721
5722 This sets the size of the window client area in pixels. Using this
5723 function to size a window tends to be more device-independent than
5724 wx.Window.SetSize, since the application need not worry about what
5725 dimensions the border or title bar have when trying to fit the window
5726 around panel items, for example.
5727 """
54f9ee45 5728 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
5729
5730 def SetClientRect(*args, **kwargs):
15afbcd0 5731 """
a95a7133 5732 SetClientRect(self, Rect rect)
15afbcd0
RD
5733
5734 This sets the size of the window client area in pixels. Using this
5735 function to size a window tends to be more device-independent than
5736 wx.Window.SetSize, since the application need not worry about what
5737 dimensions the border or title bar have when trying to fit the window
5738 around panel items, for example.
5739 """
54f9ee45 5740 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
5741
5742 def GetPosition(*args, **kwargs):
0df68c9f 5743 """
a95a7133 5744 GetPosition(self) -> Point
e811c8ce 5745
0df68c9f
RD
5746 Get the window's position.
5747 """
54f9ee45 5748 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
5749
5750 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
5751 """
5752 GetPositionTuple() -> (x,y)
e811c8ce 5753
0df68c9f
RD
5754 Get the window's position.
5755 """
54f9ee45 5756 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
5757
5758 def GetSize(*args, **kwargs):
0df68c9f 5759 """
a95a7133 5760 GetSize(self) -> Size
e811c8ce 5761
0df68c9f
RD
5762 Get the window size.
5763 """
54f9ee45 5764 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
5765
5766 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
5767 """
5768 GetSizeTuple() -> (width, height)
e811c8ce 5769
0df68c9f
RD
5770 Get the window size.
5771 """
54f9ee45 5772 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
5773
5774 def GetRect(*args, **kwargs):
15afbcd0 5775 """
a95a7133 5776 GetRect(self) -> Rect
15afbcd0
RD
5777
5778 Returns the size and position of the window as a wx.Rect object.
5779 """
54f9ee45 5780 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
5781
5782 def GetClientSize(*args, **kwargs):
0df68c9f 5783 """
a95a7133 5784 GetClientSize(self) -> Size
e811c8ce 5785
15afbcd0
RD
5786 This gets the size of the window's 'client area' in pixels. The client
5787 area is the area which may be drawn on by the programmer, excluding
5788 title bar, border, scrollbars, etc.
0df68c9f 5789 """
54f9ee45 5790 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
5791
5792 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
5793 """
5794 GetClientSizeTuple() -> (width, height)
e811c8ce 5795
15afbcd0
RD
5796 This gets the size of the window's 'client area' in pixels. The client
5797 area is the area which may be drawn on by the programmer, excluding
5798 title bar, border, scrollbars, etc.
0df68c9f 5799 """
54f9ee45 5800 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
5801
5802 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 5803 """
a95a7133 5804 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
5805
5806 Get the origin of the client area of the window relative to the
5807 window's top left corner (the client area may be shifted because of
5808 the borders, scrollbars, other decorations...)
5809 """
54f9ee45 5810 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
5811
5812 def GetClientRect(*args, **kwargs):
15afbcd0 5813 """
a95a7133 5814 GetClientRect(self) -> Rect
15afbcd0 5815
61863841 5816 Get the client area position and size as a `wx.Rect` object.
15afbcd0 5817 """
54f9ee45 5818 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
5819
5820 def GetBestSize(*args, **kwargs):
0df68c9f 5821 """
a95a7133 5822 GetBestSize(self) -> Size
e811c8ce 5823
248ed943 5824 This function returns the best acceptable minimal size for the
41e2b43e
RD
5825 window, if applicable. For example, for a static text control, it will
5826 be the minimal size such that the control label is not truncated. For
5827 windows containing subwindows (suzh aswx.Panel), the size returned by
5828 this function will be the same as the size the window would have had
5829 after calling Fit.
0df68c9f 5830 """
54f9ee45 5831 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
5832
5833 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
5834 """
5835 GetBestSizeTuple() -> (width, height)
e811c8ce 5836
248ed943 5837 This function returns the best acceptable minimal size for the
41e2b43e
RD
5838 window, if applicable. For example, for a static text control, it will
5839 be the minimal size such that the control label is not truncated. For
5840 windows containing subwindows (suzh aswx.Panel), the size returned by
5841 this function will be the same as the size the window would have had
5842 after calling Fit.
0df68c9f 5843 """
54f9ee45 5844 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 5845
dfbb5885
RD
5846 def InvalidateBestSize(*args, **kwargs):
5847 """
5848 InvalidateBestSize(self)
5849
5850 Reset the cached best size value so it will be recalculated the next
5851 time it is needed.
5852 """
5853 return _core_.Window_InvalidateBestSize(*args, **kwargs)
5854
5855 def GetBestFittingSize(*args, **kwargs):
5856 """
5857 GetBestFittingSize(self) -> Size
5858
5859 This function will merge the window's best size into the window's
5860 minimum size, giving priority to the min size components, and returns
5861 the results.
5862
5863 """
5864 return _core_.Window_GetBestFittingSize(*args, **kwargs)
5865
e811c8ce 5866 def GetAdjustedBestSize(*args, **kwargs):
15afbcd0 5867 """
a95a7133 5868 GetAdjustedBestSize(self) -> Size
15afbcd0
RD
5869
5870 This method is similar to GetBestSize, except in one
5871 thing. GetBestSize should return the minimum untruncated size of the
5872 window, while this method will return the largest of BestSize and any
5873 user specified minimum size. ie. it is the minimum size the window
5874 should currently be drawn at, not the minimal size it can possibly
5875 tolerate.
5876 """
54f9ee45 5877 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
e811c8ce
RD
5878
5879 def Center(*args, **kwargs):
15afbcd0 5880 """
a95a7133 5881 Center(self, int direction=BOTH)
15afbcd0
RD
5882
5883 Centers the window. The parameter specifies the direction for
5884 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
5885 also include wx.CENTER_ON_SCREEN flag if you want to center the window
5886 on the entire screen and not on its parent window. If it is a
5887 top-level window and has no parent then it will always be centered
5888 relative to the screen.
5889 """
54f9ee45 5890 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
5891
5892 Centre = Center
5893 def CenterOnScreen(*args, **kwargs):
15afbcd0 5894 """
a95a7133 5895 CenterOnScreen(self, int dir=BOTH)
15afbcd0
RD
5896
5897 Center on screen (only works for top level windows)
5898 """
54f9ee45 5899 return _core_.Window_CenterOnScreen(*args, **kwargs)
e811c8ce
RD
5900
5901 CentreOnScreen = CenterOnScreen
5902 def CenterOnParent(*args, **kwargs):
15afbcd0 5903 """
a95a7133 5904 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
5905
5906 Center with respect to the the parent window
5907 """
54f9ee45 5908 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
5909
5910 CentreOnParent = CenterOnParent
5911 def Fit(*args, **kwargs):
15afbcd0 5912 """
a95a7133 5913 Fit(self)
15afbcd0
RD
5914
5915 Sizes the window so that it fits around its subwindows. This function
5916 won't do anything if there are no subwindows and will only really work
5917 correctly if sizers are used for the subwindows layout. Also, if the
5918 window has exactly one subwindow it is better (faster and the result
5919 is more precise as Fit adds some margin to account for fuzziness of
5920 its calculations) to call window.SetClientSize(child.GetSize())
5921 instead of calling Fit.
5922 """
54f9ee45 5923 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
5924
5925 def FitInside(*args, **kwargs):
15afbcd0 5926 """
a95a7133 5927 FitInside(self)
15afbcd0
RD
5928
5929 Similar to Fit, but sizes the interior (virtual) size of a
5930 window. Mainly useful with scrolled windows to reset scrollbars after
5931 sizing changes that do not trigger a size event, and/or scrolled
5932 windows without an interior sizer. This function similarly won't do
5933 anything if there are no subwindows.
5934 """
54f9ee45 5935 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 5936
74a57fcd 5937 def SetSizeHints(*args):
0df68c9f 5938 """
908b74cd 5939 SetSizeHints(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
a95a7133 5940 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 5941 int incH=-1)
15afbcd0
RD
5942
5943 Allows specification of minimum and maximum window sizes, and window
5944 size increments. If a pair of values is not set (or set to -1), the
5945 default values will be used. If this function is called, the user
908b74cd
RD
5946 will not be able to size the window outside the given bounds (if it is
5947 a top-level window.) Sizers will also inspect the minimum window size
5948 and will use that value if set when calculating layout.
5949
5950 The resizing increments are only significant under Motif or Xt.
0df68c9f 5951 """
54f9ee45 5952 return _core_.Window_SetSizeHints(*args)
e811c8ce 5953
74a57fcd 5954 def SetVirtualSizeHints(*args):
15afbcd0 5955 """
a95a7133 5956 SetVirtualSizeHints(self, Size minSize, Size maxSize=DefaultSize)
908b74cd 5957 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
5958
5959 Allows specification of minimum and maximum virtual window sizes. If a
5960 pair of values is not set (or set to -1), the default values will be
5961 used. If this function is called, the user will not be able to size
5962 the virtual area of the window outside the given bounds.
5963 """
54f9ee45 5964 return _core_.Window_SetVirtualSizeHints(*args)
e811c8ce 5965
908b74cd
RD
5966 def GetMaxSize(*args, **kwargs):
5967 """GetMaxSize(self) -> Size"""
5968 return _core_.Window_GetMaxSize(*args, **kwargs)
5969
5970 def GetMinSize(*args, **kwargs):
5971 """GetMinSize(self) -> Size"""
5972 return _core_.Window_GetMinSize(*args, **kwargs)
5973
5974 def SetMinSize(*args, **kwargs):
5975 """
5976 SetMinSize(self, Size minSize)
5977
5978 A more convenient method than `SetSizeHints` for setting just the
5979 min size.
5980 """
5981 return _core_.Window_SetMinSize(*args, **kwargs)
5982
5983 def SetMaxSize(*args, **kwargs):
5984 """
5985 SetMaxSize(self, Size maxSize)
5986
5987 A more convenient method than `SetSizeHints` for setting just the
5988 max size.
5989 """
5990 return _core_.Window_SetMaxSize(*args, **kwargs)
5991
e811c8ce 5992 def GetMinWidth(*args, **kwargs):
a95a7133 5993 """GetMinWidth(self) -> int"""
54f9ee45 5994 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
5995
5996 def GetMinHeight(*args, **kwargs):
a95a7133 5997 """GetMinHeight(self) -> int"""
54f9ee45 5998 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
5999
6000 def GetMaxWidth(*args, **kwargs):
a95a7133 6001 """GetMaxWidth(self) -> int"""
54f9ee45 6002 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
6003
6004 def GetMaxHeight(*args, **kwargs):
a95a7133 6005 """GetMaxHeight(self) -> int"""
54f9ee45 6006 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 6007
e811c8ce 6008 def SetVirtualSize(*args, **kwargs):
0df68c9f 6009 """
a95a7133 6010 SetVirtualSize(self, Size size)
e811c8ce 6011
15afbcd0
RD
6012 Set the the virtual size of a window in pixels. For most windows this
6013 is just the client area of the window, but for some like scrolled
6014 windows it is more or less independent of the screen window size.
0df68c9f 6015 """
54f9ee45 6016 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
6017
6018 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 6019 """
a95a7133 6020 SetVirtualSizeWH(self, int w, int h)
e811c8ce 6021
15afbcd0
RD
6022 Set the the virtual size of a window in pixels. For most windows this
6023 is just the client area of the window, but for some like scrolled
6024 windows it is more or less independent of the screen window size.
0df68c9f 6025 """
54f9ee45 6026 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
6027
6028 def GetVirtualSize(*args, **kwargs):
0df68c9f 6029 """
a95a7133 6030 GetVirtualSize(self) -> Size
e811c8ce 6031
15afbcd0
RD
6032 Get the the virtual size of the window in pixels. For most windows
6033 this is just the client area of the window, but for some like scrolled
6034 windows it is more or less independent of the screen window size.
0df68c9f 6035 """
54f9ee45 6036 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
6037
6038 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
6039 """
6040 GetVirtualSizeTuple() -> (width, height)
e811c8ce 6041
15afbcd0
RD
6042 Get the the virtual size of the window in pixels. For most windows
6043 this is just the client area of the window, but for some like scrolled
6044 windows it is more or less independent of the screen window size.
0df68c9f 6045 """
54f9ee45 6046 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce
RD
6047
6048 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 6049 """
a95a7133 6050 GetBestVirtualSize(self) -> Size
15afbcd0
RD
6051
6052 Return the largest of ClientSize and BestSize (as determined by a
6053 sizer, interior children, or other means)
6054 """
54f9ee45 6055 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
6056
6057 def Show(*args, **kwargs):
15afbcd0 6058 """
a95a7133 6059 Show(self, bool show=True) -> bool
15afbcd0
RD
6060
6061 Shows or hides the window. You may need to call Raise for a top level
6062 window if you want to bring it to top, although this is not needed if
6063 Show is called immediately after the frame creation. Returns True if
6064 the window has been shown or hidden or False if nothing was done
6065 because it already was in the requested state.
6066 """
54f9ee45 6067 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
6068
6069 def Hide(*args, **kwargs):
15afbcd0 6070 """
a95a7133 6071 Hide(self) -> bool
15afbcd0
RD
6072
6073 Equivalent to calling Show(False).
6074 """
54f9ee45 6075 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
6076
6077 def Enable(*args, **kwargs):
15afbcd0 6078 """
a95a7133 6079 Enable(self, bool enable=True) -> bool
15afbcd0
RD
6080
6081 Enable or disable the window for user input. Note that when a parent
6082 window is disabled, all of its children are disabled as well and they
6083 are reenabled again when the parent is. Returns true if the window
6084 has been enabled or disabled, false if nothing was done, i.e. if the
6085 window had already been in the specified state.
6086 """
54f9ee45 6087 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
6088
6089 def Disable(*args, **kwargs):
15afbcd0 6090 """
a95a7133 6091 Disable(self) -> bool
15afbcd0
RD
6092
6093 Disables the window, same as Enable(false).
6094 """
54f9ee45 6095 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
6096
6097 def IsShown(*args, **kwargs):
15afbcd0 6098 """
a95a7133 6099 IsShown(self) -> bool
15afbcd0
RD
6100
6101 Returns true if the window is shown, false if it has been hidden.
6102 """
54f9ee45 6103 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
6104
6105 def IsEnabled(*args, **kwargs):
15afbcd0 6106 """
a95a7133 6107 IsEnabled(self) -> bool
15afbcd0
RD
6108
6109 Returns true if the window is enabled for input, false otherwise.
6110 """
54f9ee45 6111 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce
RD
6112
6113 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 6114 """
a95a7133 6115 SetWindowStyleFlag(self, long style)
15afbcd0 6116
41e2b43e
RD
6117 Sets the style of the window. Please note that some styles cannot be
6118 changed after the window creation and that Refresh() might need to be
6119 called after changing the others for the change to take place
6120 immediately.
15afbcd0 6121 """
54f9ee45 6122 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
6123
6124 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 6125 """
a95a7133 6126 GetWindowStyleFlag(self) -> long
e811c8ce 6127
15afbcd0
RD
6128 Gets the window style that was passed to the constructor or Create
6129 method.
6130 """
54f9ee45 6131 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 6132
15afbcd0 6133 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 6134 def HasFlag(*args, **kwargs):
15afbcd0 6135 """
a95a7133 6136 HasFlag(self, int flag) -> bool
15afbcd0
RD
6137
6138 Test if the given style is set for this window.
6139 """
54f9ee45 6140 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
6141
6142 def IsRetained(*args, **kwargs):
15afbcd0 6143 """
a95a7133 6144 IsRetained(self) -> bool
15afbcd0
RD
6145
6146 Returns true if the window is retained, false otherwise. Retained
6147 windows are only available on X platforms.
6148 """
54f9ee45 6149 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce
RD
6150
6151 def SetExtraStyle(*args, **kwargs):
15afbcd0 6152 """
a95a7133 6153 SetExtraStyle(self, long exStyle)
15afbcd0
RD
6154
6155 Sets the extra style bits for the window. Extra styles are the less
6156 often used style bits which can't be set with the constructor or with
6157 SetWindowStyleFlag()
6158 """
54f9ee45 6159 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
6160
6161 def GetExtraStyle(*args, **kwargs):
15afbcd0 6162 """
a95a7133 6163 GetExtraStyle(self) -> long
15afbcd0
RD
6164
6165 Returns the extra style bits for the window.
6166 """
54f9ee45 6167 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
6168
6169 def MakeModal(*args, **kwargs):
15afbcd0 6170 """
a95a7133 6171 MakeModal(self, bool modal=True)
15afbcd0
RD
6172
6173 Disables all other windows in the application so that the user can
6174 only interact with this window. Passing False will reverse this
6175 effect.
6176 """
54f9ee45 6177 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
6178
6179 def SetThemeEnabled(*args, **kwargs):
15afbcd0 6180 """
a95a7133 6181 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
6182
6183 This function tells a window if it should use the system's "theme"
6184 code to draw the windows' background instead if its own background
6185 drawing code. This will only have an effect on platforms that support
6186 the notion of themes in user defined windows. One such platform is
6187 GTK+ where windows can have (very colourful) backgrounds defined by a
6188 user's selected theme.
6189
6190 Dialogs, notebook pages and the status bar have this flag set to true
6191 by default so that the default look and feel is simulated best.
6192 """
54f9ee45 6193 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
6194
6195 def GetThemeEnabled(*args, **kwargs):
15afbcd0 6196 """
a95a7133 6197 GetThemeEnabled(self) -> bool
e811c8ce 6198
15afbcd0
RD
6199 Return the themeEnabled flag.
6200 """
54f9ee45 6201 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
6202
6203 def SetFocus(*args, **kwargs):
15afbcd0 6204 """
a95a7133 6205 SetFocus(self)
15afbcd0
RD
6206
6207 Set's the focus to this window, allowing it to receive keyboard input.
6208 """
54f9ee45 6209 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
6210
6211 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 6212 """
a95a7133 6213 SetFocusFromKbd(self)
15afbcd0
RD
6214
6215 Set focus to this window as the result of a keyboard action. Normally
6216 only called internally.
6217 """
54f9ee45 6218 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
6219
6220 def FindFocus(*args, **kwargs):
15afbcd0 6221 """
66c033b4 6222 FindFocus() -> Window
15afbcd0
RD
6223
6224 Returns the window or control that currently has the keyboard focus,
6225 or None.
6226 """
54f9ee45 6227 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
6228
6229 FindFocus = staticmethod(FindFocus)
6230 def AcceptsFocus(*args, **kwargs):
15afbcd0 6231 """
a95a7133 6232 AcceptsFocus(self) -> bool
15afbcd0
RD
6233
6234 Can this window have focus?
6235 """
54f9ee45 6236 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce
RD
6237
6238 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 6239 """
a95a7133 6240 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
6241
6242 Can this window be given focus by keyboard navigation? if not, the
6243 only way to give it focus (provided it accepts it at all) is to click
6244 it.
6245 """
54f9ee45 6246 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce
RD
6247
6248 def GetDefaultItem(*args, **kwargs):
15afbcd0 6249 """
a95a7133 6250 GetDefaultItem(self) -> Window
15afbcd0
RD
6251
6252 Get the default child of this parent, i.e. the one which is activated
6253 by pressing <Enter> such as the OK button on a wx.Dialog.
6254 """
54f9ee45 6255 return _core_.Window_GetDefaultItem(*args, **kwargs)
e811c8ce
RD
6256
6257 def SetDefaultItem(*args, **kwargs):
15afbcd0 6258 """
a95a7133 6259 SetDefaultItem(self, Window child) -> Window
15afbcd0
RD
6260
6261 Set this child as default, return the old default.
6262 """
54f9ee45 6263 return _core_.Window_SetDefaultItem(*args, **kwargs)
e811c8ce
RD
6264
6265 def SetTmpDefaultItem(*args, **kwargs):
15afbcd0 6266 """
a95a7133 6267 SetTmpDefaultItem(self, Window win)
15afbcd0
RD
6268
6269 Set this child as temporary default
6270 """
54f9ee45 6271 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
e811c8ce 6272
908b74cd
RD
6273 def Navigate(*args, **kwargs):
6274 """
6275 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6276
fd2dc343
RD
6277 Does keyboard navigation from this window to another, by sending a
6278 `wx.NavigationKeyEvent`.
908b74cd
RD
6279 """
6280 return _core_.Window_Navigate(*args, **kwargs)
6281
e811c8ce 6282 def GetChildren(*args, **kwargs):
15afbcd0 6283 """
a95a7133 6284 GetChildren(self) -> PyObject
15afbcd0
RD
6285
6286 Returns a list of the window's children. NOTE: Currently this is a
6287 copy of the child window list maintained by the window, so the return
6288 value of this function is only valid as long as the window's children
6289 do not change.
6290 """
54f9ee45 6291 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
6292
6293 def GetParent(*args, **kwargs):
15afbcd0 6294 """
a95a7133 6295 GetParent(self) -> Window
15afbcd0
RD
6296
6297 Returns the parent window of this window, or None if there isn't one.
6298 """
54f9ee45 6299 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
6300
6301 def GetGrandParent(*args, **kwargs):
15afbcd0 6302 """
a95a7133 6303 GetGrandParent(self) -> Window
15afbcd0 6304
41e2b43e
RD
6305 Returns the parent of the parent of this window, or None if there
6306 isn't one.
15afbcd0 6307 """
54f9ee45 6308 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce
RD
6309
6310 def IsTopLevel(*args, **kwargs):
15afbcd0 6311 """
a95a7133 6312 IsTopLevel(self) -> bool
15afbcd0
RD
6313
6314 Returns true if the given window is a top-level one. Currently all
6315 frames and dialogs are always considered to be top-level windows (even
6316 if they have a parent window).
6317 """
54f9ee45 6318 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
6319
6320 def Reparent(*args, **kwargs):
15afbcd0 6321 """
a95a7133 6322 Reparent(self, Window newParent) -> bool
15afbcd0
RD
6323
6324 Reparents the window, i.e the window will be removed from its current
6325 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6326 re-inserted into another. Available on Windows and GTK. Returns True
6327 if the parent was changed, False otherwise (error or newParent ==
6328 oldParent)
6329 """
54f9ee45 6330 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
6331
6332 def AddChild(*args, **kwargs):
15afbcd0 6333 """
a95a7133 6334 AddChild(self, Window child)
15afbcd0
RD
6335
6336 Adds a child window. This is called automatically by window creation
6337 functions so should not be required by the application programmer.
6338 """
54f9ee45 6339 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
6340
6341 def RemoveChild(*args, **kwargs):
15afbcd0 6342 """
a95a7133 6343 RemoveChild(self, Window child)
15afbcd0
RD
6344
6345 Removes a child window. This is called automatically by window
6346 deletion functions so should not be required by the application
6347 programmer.
6348 """
54f9ee45 6349 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce
RD
6350
6351 def FindWindowById(*args, **kwargs):
15afbcd0 6352 """
a95a7133 6353 FindWindowById(self, long winid) -> Window
15afbcd0
RD
6354
6355 Find a chld of this window by window ID
6356 """
54f9ee45 6357 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
6358
6359 def FindWindowByName(*args, **kwargs):
15afbcd0 6360 """
a95a7133 6361 FindWindowByName(self, String name) -> Window
15afbcd0
RD
6362
6363 Find a child of this window by name
6364 """
54f9ee45 6365 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
6366
6367 def GetEventHandler(*args, **kwargs):
15afbcd0 6368 """
a95a7133 6369 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
6370
6371 Returns the event handler for this window. By default, the window is
6372 its own event handler.
6373 """
54f9ee45 6374 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
6375
6376 def SetEventHandler(*args, **kwargs):
15afbcd0 6377 """
a95a7133 6378 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
6379
6380 Sets the event handler for this window. An event handler is an object
6381 that is capable of processing the events sent to a window. By default,
6382 the window is its own event handler, but an application may wish to
6383 substitute another, for example to allow central implementation of
6384 event-handling for a variety of different window classes.
6385
41e2b43e 6386 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0
RD
6387 up a chain of event handlers, where an event not handled by one event
6388 handler is handed to the next one in the chain.
6389 """
54f9ee45 6390 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
6391
6392 def PushEventHandler(*args, **kwargs):
15afbcd0 6393 """
a95a7133 6394 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
6395
6396 Pushes this event handler onto the event handler stack for the window.
6397 An event handler is an object that is capable of processing the events
6398 sent to a window. By default, the window is its own event handler, but
6399 an application may wish to substitute another, for example to allow
6400 central implementation of event-handling for a variety of different
6401 window classes.
6402
6403 wx.Window.PushEventHandler allows an application to set up a chain of
6404 event handlers, where an event not handled by one event handler is
41e2b43e 6405 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
15afbcd0
RD
6406 remove the event handler.
6407 """
54f9ee45 6408 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
6409
6410 def PopEventHandler(*args, **kwargs):
15afbcd0 6411 """
a95a7133 6412 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
6413
6414 Removes and returns the top-most event handler on the event handler
6415 stack. If deleteHandler is True then the wx.EvtHandler object will be
6416 destroyed after it is popped.
6417 """
54f9ee45 6418 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
6419
6420 def RemoveEventHandler(*args, **kwargs):
15afbcd0 6421 """
a95a7133 6422 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 6423
41e2b43e
RD
6424 Find the given handler in the event handler chain and remove (but not
6425 delete) it from the event handler chain, return True if it was found
6426 and False otherwise (this also results in an assert failure so this
6427 function should only be called when the handler is supposed to be
6428 there.)
15afbcd0 6429 """
54f9ee45 6430 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
6431
6432 def SetValidator(*args, **kwargs):
15afbcd0 6433 """
a95a7133 6434 SetValidator(self, Validator validator)
15afbcd0
RD
6435
6436 Deletes the current validator (if any) and sets the window validator,
6437 having called wx.Validator.Clone to create a new validator of this
6438 type.
6439 """
54f9ee45 6440 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
6441
6442 def GetValidator(*args, **kwargs):
15afbcd0 6443 """
a95a7133 6444 GetValidator(self) -> Validator
15afbcd0
RD
6445
6446 Returns a pointer to the current validator for the window, or None if
6447 there is none.
6448 """
54f9ee45 6449 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 6450
74a57fcd
RD
6451 def Validate(*args, **kwargs):
6452 """
a95a7133 6453 Validate(self) -> bool
74a57fcd
RD
6454
6455 Validates the current values of the child controls using their
41e2b43e
RD
6456 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6457 style flag set, the method will also call Validate() of all child
6458 windows. Returns false if any of the validations failed.
74a57fcd 6459 """
54f9ee45 6460 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
6461
6462 def TransferDataToWindow(*args, **kwargs):
6463 """
a95a7133 6464 TransferDataToWindow(self) -> bool
74a57fcd 6465
41e2b43e
RD
6466 Transfers values to child controls from data areas specified by their
6467 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6468 style flag set, the method will also call TransferDataToWindow() of
6469 all child windows.
74a57fcd 6470 """
54f9ee45 6471 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
6472
6473 def TransferDataFromWindow(*args, **kwargs):
6474 """
a95a7133 6475 TransferDataFromWindow(self) -> bool
74a57fcd 6476
41e2b43e
RD
6477 Transfers values from child controls to data areas specified by their
6478 validators. Returns false if a transfer failed. If the window has
6479 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
6480 also call TransferDataFromWindow() of all child windows.
74a57fcd 6481 """
54f9ee45 6482 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
6483
6484 def InitDialog(*args, **kwargs):
6485 """
a95a7133 6486 InitDialog(self)
74a57fcd 6487
41e2b43e
RD
6488 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
6489 to the dialog via validators.
74a57fcd 6490 """
54f9ee45 6491 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 6492
e811c8ce 6493 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 6494 """
a95a7133 6495 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
6496
6497 Sets the accelerator table for this window.
6498 """
54f9ee45 6499 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
6500
6501 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 6502 """
a95a7133 6503 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
6504
6505 Gets the accelerator table for this window.
6506 """
54f9ee45 6507 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
6508
6509 def RegisterHotKey(*args, **kwargs):
15afbcd0 6510 """
a95a7133 6511 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
6512
6513 Registers a system wide hotkey. Every time the user presses the hotkey
6514 registered here, this window will receive a hotkey event. It will
6515 receive the event even if the application is in the background and
6516 does not have the input focus because the user is working with some
6517 other application. To bind an event handler function to this hotkey
6518 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
6519 hotkey was registered successfully.
6520 """
54f9ee45 6521 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
6522
6523 def UnregisterHotKey(*args, **kwargs):
15afbcd0 6524 """
a95a7133 6525 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
6526
6527 Unregisters a system wide hotkey.
6528 """
54f9ee45 6529 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
6530
6531 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 6532 """
a95a7133 6533 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
6534
6535 Converts a point or size from dialog units to pixels. Dialog units
6536 are used for maintaining a dialog's proportions even if the font
6537 changes. For the x dimension, the dialog units are multiplied by the
6538 average character width and then divided by 4. For the y dimension,
6539 the dialog units are multiplied by the average character height and
6540 then divided by 8.
6541 """
54f9ee45 6542 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
6543
6544 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 6545 """
a95a7133 6546 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
6547
6548 Converts a point or size from dialog units to pixels. Dialog units
6549 are used for maintaining a dialog's proportions even if the font
6550 changes. For the x dimension, the dialog units are multiplied by the
6551 average character width and then divided by 4. For the y dimension,
6552 the dialog units are multiplied by the average character height and
6553 then divided by 8.
6554 """
54f9ee45 6555 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
6556
6557 def DLG_PNT(*args, **kwargs):
15afbcd0 6558 """
a95a7133 6559 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
6560
6561 Converts a point or size from dialog units to pixels. Dialog units
6562 are used for maintaining a dialog's proportions even if the font
6563 changes. For the x dimension, the dialog units are multiplied by the
6564 average character width and then divided by 4. For the y dimension,
6565 the dialog units are multiplied by the average character height and
6566 then divided by 8.
6567 """
54f9ee45 6568 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
6569
6570 def DLG_SZE(*args, **kwargs):
15afbcd0 6571 """
a95a7133 6572 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
6573
6574 Converts a point or size from dialog units to pixels. Dialog units
6575 are used for maintaining a dialog's proportions even if the font
6576 changes. For the x dimension, the dialog units are multiplied by the
6577 average character width and then divided by 4. For the y dimension,
6578 the dialog units are multiplied by the average character height and
6579 then divided by 8.
6580 """
54f9ee45 6581 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
6582
6583 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 6584 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 6585 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
6586
6587 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 6588 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 6589 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
6590
6591 def WarpPointer(*args, **kwargs):
15afbcd0 6592 """
a95a7133 6593 WarpPointer(self, int x, int y)
15afbcd0
RD
6594
6595 Moves the pointer to the given position on the window.
6596
6597 NOTE: This function is not supported under Mac because Apple Human
6598 Interface Guidelines forbid moving the mouse cursor programmatically.
6599 """
54f9ee45 6600 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
6601
6602 def CaptureMouse(*args, **kwargs):
15afbcd0 6603 """
a95a7133 6604 CaptureMouse(self)
15afbcd0
RD
6605
6606 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
6607 release the capture.
6608
6609 Note that wxWindows maintains the stack of windows having captured the
6610 mouse and when the mouse is released the capture returns to the window
6611 which had had captured it previously and it is only really released if
6612 there were no previous window. In particular, this means that you must
6613 release the mouse as many times as you capture it.
6614 """
54f9ee45 6615 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
6616
6617 def ReleaseMouse(*args, **kwargs):
15afbcd0 6618 """
a95a7133 6619 ReleaseMouse(self)
15afbcd0
RD
6620
6621 Releases mouse input captured with wx.Window.CaptureMouse.
6622 """
54f9ee45 6623 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
6624
6625 def GetCapture(*args, **kwargs):
15afbcd0 6626 """
66c033b4 6627 GetCapture() -> Window
15afbcd0
RD
6628
6629 Returns the window which currently captures the mouse or None
6630 """
54f9ee45 6631 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
6632
6633 GetCapture = staticmethod(GetCapture)
6634 def HasCapture(*args, **kwargs):
15afbcd0 6635 """
a95a7133 6636 HasCapture(self) -> bool
15afbcd0
RD
6637
6638 Returns true if this window has the current mouse capture.
6639 """
54f9ee45 6640 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
6641
6642 def Refresh(*args, **kwargs):
15afbcd0 6643 """
a95a7133 6644 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
6645
6646 Mark the specified rectangle (or the whole window) as "dirty" so it
6647 will be repainted. Causes an EVT_PAINT event to be generated and sent
6648 to the window.
6649 """
54f9ee45 6650 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
6651
6652 def RefreshRect(*args, **kwargs):
15afbcd0 6653 """
a95a7133 6654 RefreshRect(self, Rect rect)
15afbcd0
RD
6655
6656 Redraws the contents of the given rectangle: the area inside it will
6657 be repainted. This is the same as Refresh but has a nicer syntax.
6658 """
54f9ee45 6659 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
6660
6661 def Update(*args, **kwargs):
15afbcd0 6662 """
a95a7133 6663 Update(self)
15afbcd0
RD
6664
6665 Calling this method immediately repaints the invalidated area of the
6666 window instead of waiting for the EVT_PAINT event to happen, (normally
6667 this would usually only happen when the flow of control returns to the
6668 event loop.) Notice that this function doesn't refresh the window and
6669 does nothing if the window has been already repainted. Use Refresh
6670 first if you want to immediately redraw the window (or some portion of
6671 it) unconditionally.
6672 """
54f9ee45 6673 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
6674
6675 def ClearBackground(*args, **kwargs):
15afbcd0 6676 """
a95a7133 6677 ClearBackground(self)
15afbcd0
RD
6678
6679 Clears the window by filling it with the current background
6680 colour. Does not cause an erase background event to be generated.
6681 """
54f9ee45 6682 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
6683
6684 def Freeze(*args, **kwargs):
15afbcd0 6685 """
a95a7133 6686 Freeze(self)
15afbcd0 6687
41e2b43e
RD
6688 Freezes the window or, in other words, prevents any updates from
6689 taking place on screen, the window is not redrawn at all. Thaw must be
6690 called to reenable window redrawing. Calls to Freeze/Thaw may be
6691 nested, with the actual Thaw being delayed until all the nesting has
6692 been undone.
15afbcd0
RD
6693
6694 This method is useful for visual appearance optimization (for example,
6695 it is a good idea to use it before inserting large amount of text into
6696 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
6697 for all controls so it is mostly just a hint to wxWindows and not a
6698 mandatory directive.
6699 """
54f9ee45 6700 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce
RD
6701
6702 def Thaw(*args, **kwargs):
15afbcd0 6703 """
a95a7133 6704 Thaw(self)
15afbcd0 6705
4276dc52 6706 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
6707 Freeze/Thaw may be nested, so Thaw must be called the same number of
6708 times that Freeze was before the window will be updated.
15afbcd0 6709 """
54f9ee45 6710 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
6711
6712 def PrepareDC(*args, **kwargs):
15afbcd0 6713 """
a95a7133 6714 PrepareDC(self, DC dc)
15afbcd0
RD
6715
6716 Call this function to prepare the device context for drawing a
6717 scrolled image. It sets the device origin according to the current
6718 scroll position.
6719 """
54f9ee45 6720 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce
RD
6721
6722 def GetUpdateRegion(*args, **kwargs):
15afbcd0 6723 """
a95a7133 6724 GetUpdateRegion(self) -> Region
15afbcd0
RD
6725
6726 Returns the region specifying which parts of the window have been
6727 damaged. Should only be called within an EVT_PAINT handler.
6728 """
54f9ee45 6729 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
6730
6731 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 6732 """
a95a7133 6733 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
6734
6735 Get the update rectangle region bounding box in client coords.
6736 """
54f9ee45 6737 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
6738
6739 def IsExposed(*args, **kwargs):
15afbcd0 6740 """
a95a7133 6741 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
6742
6743 Returns true if the given point or rectangle area has been exposed
6744 since the last repaint. Call this in an paint event handler to
6745 optimize redrawing by only redrawing those areas, which have been
6746 exposed.
6747 """
54f9ee45 6748 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
6749
6750 def IsExposedPoint(*args, **kwargs):
15afbcd0 6751 """
a95a7133 6752 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
6753
6754 Returns true if the given point or rectangle area has been exposed
6755 since the last repaint. Call this in an paint event handler to
6756 optimize redrawing by only redrawing those areas, which have been
6757 exposed.
6758 """
54f9ee45 6759 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 6760
4276dc52 6761 def IsExposedRect(*args, **kwargs):
15afbcd0 6762 """
a95a7133 6763 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
6764
6765 Returns true if the given point or rectangle area has been exposed
6766 since the last repaint. Call this in an paint event handler to
6767 optimize redrawing by only redrawing those areas, which have been
6768 exposed.
6769 """
54f9ee45 6770 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 6771
74a57fcd
RD
6772 def GetDefaultAttributes(*args, **kwargs):
6773 """
a95a7133 6774 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 6775
41e2b43e
RD
6776 Get the default attributes for an instance of this class. This is
6777 useful if you want to use the same font or colour in your own control
6778 as in a standard control -- which is a much better idea than hard
6779 coding specific colours or fonts which might look completely out of
db3e571a 6780 place on the user's system, especially if it uses themes.
74a57fcd 6781 """
54f9ee45 6782 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
6783
6784 def GetClassDefaultAttributes(*args, **kwargs):
6785 """
66c033b4 6786 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 6787
41e2b43e
RD
6788 Get the default attributes for this class. This is useful if you want
6789 to use the same font or colour in your own control as in a standard
6790 control -- which is a much better idea than hard coding specific
db3e571a
RD
6791 colours or fonts which might look completely out of place on the
6792 user's system, especially if it uses themes.
74a57fcd
RD
6793
6794 The variant parameter is only relevant under Mac currently and is
41e2b43e 6795 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
6796 the returned font. See `wx.Window.SetWindowVariant` for more about
6797 this.
74a57fcd 6798 """
54f9ee45 6799 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
6800
6801 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 6802 def SetBackgroundColour(*args, **kwargs):
15afbcd0 6803 """
a95a7133 6804 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
6805
6806 Sets the background colour of the window. Returns True if the colour
6807 was changed. The background colour is usually painted by the default
6808 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
6809 automatically under GTK. Using `wx.NullColour` will reset the window
6810 to the default background colour.
15afbcd0 6811
db3e571a 6812 Note that setting the background colour may not cause an immediate
f8167d6e 6813 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
6814 calling this function.
6815
f8167d6e
RD
6816 Using this function will disable attempts to use themes for this
6817 window, if the system supports them. Use with care since usually the
6818 themes represent the appearance chosen by the user to be used for all
6819 applications on the system.
15afbcd0 6820 """
54f9ee45 6821 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 6822
b2df227b 6823 def SetDefaultBackgroundColour(*args, **kwargs):
a95a7133 6824 """SetDefaultBackgroundColour(self, Colour colour)"""
54f9ee45 6825 return _core_.Window_SetDefaultBackgroundColour(*args, **kwargs)
b2df227b 6826
e811c8ce 6827 def SetForegroundColour(*args, **kwargs):
15afbcd0 6828 """
a95a7133 6829 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
6830
6831 Sets the foreground colour of the window. Returns True is the colour
6832 was changed. The interpretation of foreground colour is dependent on
6833 the window class; it may be the text colour or other colour, or it may
6834 not be used at all.
6835 """
54f9ee45 6836 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 6837
b2df227b 6838 def SetDefaultForegroundColour(*args, **kwargs):
a95a7133 6839 """SetDefaultForegroundColour(self, Colour colour)"""
54f9ee45 6840 return _core_.Window_SetDefaultForegroundColour(*args, **kwargs)
b2df227b 6841
e811c8ce 6842 def GetBackgroundColour(*args, **kwargs):
15afbcd0 6843 """
a95a7133 6844 GetBackgroundColour(self) -> Colour
15afbcd0
RD
6845
6846 Returns the background colour of the window.
6847 """
54f9ee45 6848 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
6849
6850 def GetForegroundColour(*args, **kwargs):
15afbcd0 6851 """
a95a7133 6852 GetForegroundColour(self) -> Colour
15afbcd0
RD
6853
6854 Returns the foreground colour of the window. The interpretation of
6855 foreground colour is dependent on the window class; it may be the text
6856 colour or other colour, or it may not be used at all.
6857 """
54f9ee45 6858 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce
RD
6859
6860 def SetCursor(*args, **kwargs):
15afbcd0 6861 """
a95a7133 6862 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
6863
6864 Sets the window's cursor. Notice that the window cursor also sets it
6865 for the children of the window implicitly.
6866
6867 The cursor may be wx.NullCursor in which case the window cursor will
6868 be reset back to default.
6869 """
54f9ee45 6870 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
6871
6872 def GetCursor(*args, **kwargs):
15afbcd0 6873 """
a95a7133 6874 GetCursor(self) -> Cursor
15afbcd0
RD
6875
6876 Return the cursor associated with this window.
6877 """
54f9ee45 6878 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
6879
6880 def SetFont(*args, **kwargs):
15afbcd0 6881 """
a95a7133 6882 SetFont(self, Font font) -> bool
15afbcd0
RD
6883
6884 Sets the font for this window.
6885 """
54f9ee45 6886 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 6887
b2df227b 6888 def SetDefaultFont(*args, **kwargs):
a95a7133 6889 """SetDefaultFont(self, Font font)"""
54f9ee45 6890 return _core_.Window_SetDefaultFont(*args, **kwargs)
b2df227b 6891
e811c8ce 6892 def GetFont(*args, **kwargs):
15afbcd0 6893 """
a95a7133 6894 GetFont(self) -> Font
15afbcd0 6895
4276dc52 6896 Returns the default font used for this window.
15afbcd0 6897 """
54f9ee45 6898 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
6899
6900 def SetCaret(*args, **kwargs):
15afbcd0 6901 """
a95a7133 6902 SetCaret(self, Caret caret)
15afbcd0
RD
6903
6904 Sets the caret associated with the window.
6905 """
54f9ee45 6906 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
6907
6908 def GetCaret(*args, **kwargs):
15afbcd0 6909 """
a95a7133 6910 GetCaret(self) -> Caret
15afbcd0
RD
6911
6912 Returns the caret associated with the window.
6913 """
54f9ee45 6914 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
6915
6916 def GetCharHeight(*args, **kwargs):
15afbcd0 6917 """
a95a7133 6918 GetCharHeight(self) -> int
15afbcd0
RD
6919
6920 Get the (average) character size for the current font.
6921 """
54f9ee45 6922 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
6923
6924 def GetCharWidth(*args, **kwargs):
15afbcd0 6925 """
a95a7133 6926 GetCharWidth(self) -> int
15afbcd0
RD
6927
6928 Get the (average) character size for the current font.
6929 """
54f9ee45 6930 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
6931
6932 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
6933 """
6934 GetTextExtent(String string) -> (width, height)
6935
6936 Get the width and height of the text using the current font.
6937 """
54f9ee45 6938 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
6939
6940 def GetFullTextExtent(*args, **kwargs):
0df68c9f 6941 """
196addbf 6942 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 6943 (width, height, descent, externalLeading)
e811c8ce 6944
15afbcd0
RD
6945 Get the width, height, decent and leading of the text using the
6946 current or specified font.
0df68c9f 6947 """
54f9ee45 6948 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
6949
6950 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
6951 """
6952 ClientToScreenXY(int x, int y) -> (x,y)
6953
6954 Converts to screen coordinates from coordinates relative to this window.
6955 """
54f9ee45 6956 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
6957
6958 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
6959 """
6960 ScreenToClientXY(int x, int y) -> (x,y)
6961
6962 Converts from screen to client window coordinates.
6963 """
54f9ee45 6964 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
6965
6966 def ClientToScreen(*args, **kwargs):
15afbcd0 6967 """
a95a7133 6968 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
6969
6970 Converts to screen coordinates from coordinates relative to this window.
6971 """
54f9ee45 6972 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
6973
6974 def ScreenToClient(*args, **kwargs):
15afbcd0 6975 """
a95a7133 6976 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
6977
6978 Converts from screen to client window coordinates.
6979 """
54f9ee45 6980 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
6981
6982 def HitTestXY(*args, **kwargs):
15afbcd0 6983 """
a95a7133 6984 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
6985
6986 Test where the given (in client coords) point lies
6987 """
54f9ee45 6988 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
6989
6990 def HitTest(*args, **kwargs):
15afbcd0 6991 """
a95a7133 6992 HitTest(self, Point pt) -> int
15afbcd0
RD
6993
6994 Test where the given (in client coords) point lies
6995 """
54f9ee45 6996 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 6997
15afbcd0
RD
6998 def GetBorder(*args):
6999 """
a95a7133
RD
7000 GetBorder(self, long flags) -> int
7001 GetBorder(self) -> int
e811c8ce 7002
15afbcd0
RD
7003 Get border for the flags of this window
7004 """
54f9ee45 7005 return _core_.Window_GetBorder(*args)
e811c8ce
RD
7006
7007 def UpdateWindowUI(*args, **kwargs):
15afbcd0 7008 """
a95a7133 7009 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
7010
7011 This function sends EVT_UPDATE_UI events to the window. The particular
7012 implementation depends on the window; for example a wx.ToolBar will
7013 send an update UI event for each toolbar button, and a wx.Frame will
7014 send an update UI event for each menubar menu item. You can call this
7015 function from your application to ensure that your UI is up-to-date at
7016 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7017 concerned). This may be necessary if you have called
7018 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7019 limit the overhead that wxWindows incurs by sending update UI events
7020 in idle time.
15afbcd0 7021 """
54f9ee45 7022 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
7023
7024 def PopupMenuXY(*args, **kwargs):
15afbcd0 7025 """
b0503257 7026 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 7027
b0503257
RD
7028 Pops up the given menu at the specified coordinates, relative to this window,
7029 and returns control when the user has dismissed the menu. If a menu item is
7030 selected, the corresponding menu event is generated and will be processed as
7031 usual. If the default position is given then the current position of the
7032 mouse cursor will be used.
15afbcd0 7033 """
54f9ee45 7034 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 7035
15afbcd0
RD
7036 def PopupMenu(*args, **kwargs):
7037 """
b0503257 7038 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 7039
b0503257
RD
7040 Pops up the given menu at the specified coordinates, relative to this window,
7041 and returns control when the user has dismissed the menu. If a menu item is
7042 selected, the corresponding menu event is generated and will be processed as
7043 usual. If the default position is given then the current position of the
7044 mouse cursor will be used.
15afbcd0 7045 """
54f9ee45 7046 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0
RD
7047
7048 def GetHandle(*args, **kwargs):
7049 """
a95a7133 7050 GetHandle(self) -> long
15afbcd0
RD
7051
7052 Returns the platform-specific handle (as a long integer) of the
7053 physical window. Currently on wxMac it returns the handle of the
7054 toplevel parent of the window.
7055 """
54f9ee45 7056 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0
RD
7057
7058 def HasScrollbar(*args, **kwargs):
7059 """
a95a7133 7060 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
7061
7062 Does the window have the scrollbar for this orientation?
7063 """
54f9ee45 7064 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
7065
7066 def SetScrollbar(*args, **kwargs):
7067 """
41e2b43e 7068 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
7069 bool refresh=True)
7070
7071 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 7072 """
54f9ee45 7073 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
7074
7075 def SetScrollPos(*args, **kwargs):
15afbcd0 7076 """
a95a7133 7077 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
7078
7079 Sets the position of one of the built-in scrollbars.
7080 """
54f9ee45 7081 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
7082
7083 def GetScrollPos(*args, **kwargs):
15afbcd0 7084 """
a95a7133 7085 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
7086
7087 Returns the built-in scrollbar position.
7088 """
54f9ee45 7089 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
7090
7091 def GetScrollThumb(*args, **kwargs):
15afbcd0 7092 """
a95a7133 7093 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
7094
7095 Returns the built-in scrollbar thumb size.
7096 """
54f9ee45 7097 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
7098
7099 def GetScrollRange(*args, **kwargs):
15afbcd0 7100 """
a95a7133 7101 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
7102
7103 Returns the built-in scrollbar range.
7104 """
54f9ee45 7105 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
7106
7107 def ScrollWindow(*args, **kwargs):
15afbcd0 7108 """
a95a7133 7109 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
7110
7111 Physically scrolls the pixels in the window and move child windows
7112 accordingly. Use this function to optimise your scrolling
7113 implementations, to minimise the area that must be redrawn. Note that
7114 it is rarely required to call this function from a user program.
15afbcd0 7115 """
54f9ee45 7116 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
7117
7118 def ScrollLines(*args, **kwargs):
15afbcd0 7119 """
a95a7133 7120 ScrollLines(self, int lines) -> bool
15afbcd0
RD
7121
7122 If the platform and window class supports it, scrolls the window by
7123 the given number of lines down, if lines is positive, or up if lines
7124 is negative. Returns True if the window was scrolled, False if it was
7125 already on top/bottom and nothing was done.
7126 """
54f9ee45 7127 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
7128
7129 def ScrollPages(*args, **kwargs):
15afbcd0 7130 """
a95a7133 7131 ScrollPages(self, int pages) -> bool
15afbcd0 7132
41e2b43e 7133 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
7134 the given number of pages down, if pages is positive, or up if pages
7135 is negative. Returns True if the window was scrolled, False if it was
7136 already on top/bottom and nothing was done.
7137 """
54f9ee45 7138 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
7139
7140 def LineUp(*args, **kwargs):
15afbcd0 7141 """
a95a7133 7142 LineUp(self) -> bool
15afbcd0
RD
7143
7144 This is just a wrapper for ScrollLines(-1).
7145 """
54f9ee45 7146 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
7147
7148 def LineDown(*args, **kwargs):
15afbcd0 7149 """
a95a7133 7150 LineDown(self) -> bool
15afbcd0
RD
7151
7152 This is just a wrapper for ScrollLines(1).
7153 """
54f9ee45 7154 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
7155
7156 def PageUp(*args, **kwargs):
15afbcd0 7157 """
a95a7133 7158 PageUp(self) -> bool
15afbcd0
RD
7159
7160 This is just a wrapper for ScrollPages(-1).
7161 """
54f9ee45 7162 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
7163
7164 def PageDown(*args, **kwargs):
15afbcd0 7165 """
a95a7133 7166 PageDown(self) -> bool
15afbcd0
RD
7167
7168 This is just a wrapper for ScrollPages(1).
7169 """
54f9ee45 7170 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
7171
7172 def SetHelpText(*args, **kwargs):
15afbcd0 7173 """
a95a7133 7174 SetHelpText(self, String text)
15afbcd0
RD
7175
7176 Sets the help text to be used as context-sensitive help for this
7177 window. Note that the text is actually stored by the current
7178 wxHelpProvider implementation, and not in the window object itself.
7179 """
54f9ee45 7180 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
7181
7182 def SetHelpTextForId(*args, **kwargs):
15afbcd0 7183 """
a95a7133 7184 SetHelpTextForId(self, String text)
15afbcd0
RD
7185
7186 Associate this help text with all windows with the same id as this
7187 one.
7188 """
54f9ee45 7189 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce
RD
7190
7191 def GetHelpText(*args, **kwargs):
15afbcd0 7192 """
a95a7133 7193 GetHelpText(self) -> String
15afbcd0
RD
7194
7195 Gets the help text to be used as context-sensitive help for this
7196 window. Note that the text is actually stored by the current
7197 wxHelpProvider implementation, and not in the window object itself.
7198 """
54f9ee45 7199 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
7200
7201 def SetToolTipString(*args, **kwargs):
15afbcd0 7202 """
a95a7133 7203 SetToolTipString(self, String tip)
15afbcd0
RD
7204
7205 Attach a tooltip to the window.
7206 """
54f9ee45 7207 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
7208
7209 def SetToolTip(*args, **kwargs):
15afbcd0 7210 """
a95a7133 7211 SetToolTip(self, ToolTip tip)
15afbcd0
RD
7212
7213 Attach a tooltip to the window.
7214 """
54f9ee45 7215 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
7216
7217 def GetToolTip(*args, **kwargs):
15afbcd0 7218 """
a95a7133 7219 GetToolTip(self) -> ToolTip
15afbcd0
RD
7220
7221 get the associated tooltip or None if none
7222 """
54f9ee45 7223 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
7224
7225 def SetDropTarget(*args, **kwargs):
15afbcd0 7226 """
a95a7133 7227 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
7228
7229 Associates a drop target with this window. If the window already has
7230 a drop target, it is deleted.
7231 """
54f9ee45 7232 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
7233
7234 def GetDropTarget(*args, **kwargs):
15afbcd0 7235 """
a95a7133 7236 GetDropTarget(self) -> DropTarget
15afbcd0
RD
7237
7238 Returns the associated drop target, which may be None.
7239 """
54f9ee45 7240 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce
RD
7241
7242 def SetConstraints(*args, **kwargs):
15afbcd0 7243 """
a95a7133 7244 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
7245
7246 Sets the window to have the given layout constraints. If an existing
7247 layout constraints object is already owned by the window, it will be
7248 deleted. Pass None to disassociate and delete the window's current
7249 constraints.
7250
7251 You must call SetAutoLayout to tell a window to use the constraints
7252 automatically in its default EVT_SIZE handler; otherwise, you must
7253 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7254 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7255 effect.
7256 """
54f9ee45 7257 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
7258
7259 def GetConstraints(*args, **kwargs):
15afbcd0 7260 """
a95a7133 7261 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
7262
7263 Returns a pointer to the window's layout constraints, or None if there
7264 are none.
7265 """
54f9ee45 7266 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
7267
7268 def SetAutoLayout(*args, **kwargs):
15afbcd0 7269 """
a95a7133 7270 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
7271
7272 Determines whether the Layout function will be called automatically
7273 when the window is resized. It is called implicitly by SetSizer but
7274 if you use SetConstraints you should call it manually or otherwise the
7275 window layout won't be correctly updated when its size changes.
7276 """
54f9ee45 7277 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
7278
7279 def GetAutoLayout(*args, **kwargs):
15afbcd0 7280 """
a95a7133 7281 GetAutoLayout(self) -> bool
15afbcd0
RD
7282
7283 Returns the current autoLayout setting
7284 """
54f9ee45 7285 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
7286
7287 def Layout(*args, **kwargs):
15afbcd0 7288 """
a95a7133 7289 Layout(self) -> bool
15afbcd0
RD
7290
7291 Invokes the constraint-based layout algorithm or the sizer-based
7292 algorithm for this window. See SetAutoLayout: when auto layout is on,
7293 this function gets called automatically by the default EVT_SIZE
7294 handler when the window is resized.
7295 """
54f9ee45 7296 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
7297
7298 def SetSizer(*args, **kwargs):
15afbcd0 7299 """
a95a7133 7300 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
7301
7302 Sets the window to have the given layout sizer. The window will then
7303 own the object, and will take care of its deletion. If an existing
7304 layout sizer object is already owned by the window, it will be deleted
7305 if the deleteOld parameter is true. Note that this function will also
7306 call SetAutoLayout implicitly with a True parameter if the sizer is
7307 non-NoneL and False otherwise.
7308 """
54f9ee45 7309 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
7310
7311 def SetSizerAndFit(*args, **kwargs):
15afbcd0 7312 """
a95a7133 7313 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
7314
7315 The same as SetSizer, except it also sets the size hints for the
7316 window based on the sizer's minimum size.
7317 """
54f9ee45 7318 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
7319
7320 def GetSizer(*args, **kwargs):
15afbcd0 7321 """
a95a7133 7322 GetSizer(self) -> Sizer
15afbcd0
RD
7323
7324 Return the sizer associated with the window by a previous call to
7325 SetSizer or None if there isn't one.
7326 """
54f9ee45 7327 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
7328
7329 def SetContainingSizer(*args, **kwargs):
15afbcd0 7330 """
a95a7133 7331 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
7332
7333 This normally does not need to be called by application code. It is
7334 called internally when a window is added to a sizer, and is used so
7335 the window can remove itself from the sizer when it is destroyed.
7336 """
54f9ee45 7337 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
7338
7339 def GetContainingSizer(*args, **kwargs):
15afbcd0 7340 """
a95a7133 7341 GetContainingSizer(self) -> Sizer
15afbcd0
RD
7342
7343 Return the sizer that this window is a member of, if any, otherwise None.
7344 """
54f9ee45 7345 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 7346
a95a7133
RD
7347 def InheritAttributes(*args, **kwargs):
7348 """
7349 InheritAttributes(self)
7350
41e2b43e
RD
7351 This function is (or should be, in case of custom controls) called
7352 during window creation to intelligently set up the window visual
7353 attributes, that is the font and the foreground and background
7354 colours.
7355
7356 By 'intelligently' the following is meant: by default, all windows use
7357 their own default attributes. However if some of the parent's
7358 attributes are explicitly changed (that is, using SetFont and not
7359 SetDefaultFont) and if the corresponding attribute hadn't been
7360 explicitly set for this window itself, then this window takes the same
7361 value as used by the parent. In addition, if the window overrides
7362 ShouldInheritColours to return false, the colours will not be changed
7363 no matter what and only the font might.
7364
7365 This rather complicated logic is necessary in order to accomodate the
7366 different usage scenarius. The most common one is when all default
7367 attributes are used and in this case, nothing should be inherited as
7368 in modern GUIs different controls use different fonts (and colours)
7369 than their siblings so they can't inherit the same value from the
7370 parent. However it was also deemed desirable to allow to simply change
7371 the attributes of all children at once by just changing the font or
7372 colour of their common parent, hence in this case we do inherit the
7373 parents attributes.
7374
a95a7133 7375 """
54f9ee45 7376 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
7377
7378 def ShouldInheritColours(*args, **kwargs):
7379 """
7380 ShouldInheritColours(self) -> bool
7381
7382 Return true from here to allow the colours of this window to be
41e2b43e
RD
7383 changed by InheritAttributes, returning false forbids inheriting them
7384 from the parent window.
a95a7133 7385
41e2b43e
RD
7386 The base class version returns false, but this method is overridden in
7387 wxControl where it returns true.
a95a7133 7388 """
54f9ee45 7389 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 7390
e811c8ce 7391 def PostCreate(self, pre):
15afbcd0
RD
7392 """
7393 Phase 3 of the 2-phase create <wink!>
7394 Call this method after precreating the window with the 2-phase create method.
7395 """
e811c8ce
RD
7396 self.this = pre.this
7397 self.thisown = pre.thisown
7398 pre.thisown = 0
7399 if hasattr(self, '_setOORInfo'):
7400 self._setOORInfo(self)
7401 if hasattr(self, '_setCallbackInfo'):
7402 self._setCallbackInfo(self, self.__class__)
7403
7404
7405class WindowPtr(Window):
7406 def __init__(self, this):
7407 self.this = this
7408 if not hasattr(self,"thisown"): self.thisown = 0
7409 self.__class__ = Window
54f9ee45 7410_core_.Window_swigregister(WindowPtr)
e811c8ce
RD
7411
7412def PreWindow(*args, **kwargs):
15afbcd0
RD
7413 """
7414 PreWindow() -> Window
7415
7416 Precreate a Window for 2-phase creation.
7417 """
54f9ee45 7418 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
7419 val.thisown = 1
7420 return val
7421
7422def Window_NewControlId(*args, **kwargs):
15afbcd0
RD
7423 """
7424 Window_NewControlId() -> int
7425
7426 Generate a control id for the controls which were not given one.
7427 """
54f9ee45 7428 return _core_.Window_NewControlId(*args, **kwargs)
e811c8ce
RD
7429
7430def Window_NextControlId(*args, **kwargs):
15afbcd0
RD
7431 """
7432 Window_NextControlId(int winid) -> int
7433
7434 Get the id of the control following the one with the given
41e2b43e 7435 autogenerated) id
15afbcd0 7436 """
54f9ee45 7437 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
7438
7439def Window_PrevControlId(*args, **kwargs):
15afbcd0
RD
7440 """
7441 Window_PrevControlId(int winid) -> int
7442
7443 Get the id of the control preceding the one with the given
41e2b43e 7444 autogenerated) id
15afbcd0 7445 """
54f9ee45 7446 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce
RD
7447
7448def Window_FindFocus(*args, **kwargs):
15afbcd0
RD
7449 """
7450 Window_FindFocus() -> Window
7451
7452 Returns the window or control that currently has the keyboard focus,
7453 or None.
7454 """
54f9ee45 7455 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
7456
7457def Window_GetCapture(*args, **kwargs):
15afbcd0
RD
7458 """
7459 Window_GetCapture() -> Window
7460
7461 Returns the window which currently captures the mouse or None
7462 """
54f9ee45 7463 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce 7464
74a57fcd
RD
7465def Window_GetClassDefaultAttributes(*args, **kwargs):
7466 """
7467 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7468
41e2b43e
RD
7469 Get the default attributes for this class. This is useful if you want
7470 to use the same font or colour in your own control as in a standard
7471 control -- which is a much better idea than hard coding specific
db3e571a
RD
7472 colours or fonts which might look completely out of place on the
7473 user's system, especially if it uses themes.
74a57fcd
RD
7474
7475 The variant parameter is only relevant under Mac currently and is
41e2b43e 7476 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
7477 the returned font. See `wx.Window.SetWindowVariant` for more about
7478 this.
74a57fcd 7479 """
54f9ee45 7480 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 7481
e811c8ce 7482def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
7483 """
7484 Convenience function for converting a Point or (x,y) in
7485 dialog units to pixel units.
7486 """
e811c8ce
RD
7487 if y is None:
7488 return win.ConvertDialogPointToPixels(point_or_x)
7489 else:
fd3f2efe 7490 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
7491
7492def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
7493 """
7494 Convenience function for converting a Size or (w,h) in
7495 dialog units to pixel units.
7496 """
e811c8ce
RD
7497 if height is None:
7498 return win.ConvertDialogSizeToPixels(size_width)
7499 else:
fd3f2efe 7500 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
7501
7502
7503def FindWindowById(*args, **kwargs):
15afbcd0
RD
7504 """
7505 FindWindowById(long id, Window parent=None) -> Window
7506
7507 Find the first window in the application with the given id. If parent
7508 is None, the search will start from all top-level frames and dialog
7509 boxes; if non-None, the search will be limited to the given window
7510 hierarchy. The search is recursive in both cases.
7511 """
54f9ee45 7512 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
7513
7514def FindWindowByName(*args, **kwargs):
15afbcd0
RD
7515 """
7516 FindWindowByName(String name, Window parent=None) -> Window
7517
7518 Find a window by its name (as given in a window constructor or Create
7519 function call). If parent is None, the search will start from all
7520 top-level frames and dialog boxes; if non-None, the search will be
7521 limited to the given window hierarchy. The search is recursive in both
7522 cases.
7523
7524 If no window with such name is found, wx.FindWindowByLabel is called.
7525 """
54f9ee45 7526 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
7527
7528def FindWindowByLabel(*args, **kwargs):
15afbcd0
RD
7529 """
7530 FindWindowByLabel(String label, Window parent=None) -> Window
7531
7532 Find a window by its label. Depending on the type of window, the label
7533 may be a window title or panel item label. If parent is None, the
7534 search will start from all top-level frames and dialog boxes; if
7535 non-None, the search will be limited to the given window
7536 hierarchy. The search is recursive in both cases.
7537 """
54f9ee45 7538 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
7539
7540def Window_FromHWND(*args, **kwargs):
4276dc52 7541 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
54f9ee45 7542 return _core_.Window_FromHWND(*args, **kwargs)
e811c8ce
RD
7543#---------------------------------------------------------------------------
7544
7545class Validator(EvtHandler):
e811c8ce
RD
7546 def __repr__(self):
7547 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7548 def __init__(self, *args, **kwargs):
a95a7133 7549 """__init__(self) -> Validator"""
54f9ee45 7550 newobj = _core_.new_Validator(*args, **kwargs)
d14a1e28
RD
7551 self.this = newobj.this
7552 self.thisown = 1
7553 del newobj.thisown
7554 self._setOORInfo(self)
e811c8ce
RD
7555
7556 def Clone(*args, **kwargs):
a95a7133 7557 """Clone(self) -> Validator"""
54f9ee45 7558 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
7559
7560 def Validate(*args, **kwargs):
a95a7133 7561 """Validate(self, Window parent) -> bool"""
54f9ee45 7562 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
7563
7564 def TransferToWindow(*args, **kwargs):
a95a7133 7565 """TransferToWindow(self) -> bool"""
54f9ee45 7566 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
7567
7568 def TransferFromWindow(*args, **kwargs):
a95a7133 7569 """TransferFromWindow(self) -> bool"""
54f9ee45 7570 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
7571
7572 def GetWindow(*args, **kwargs):
a95a7133 7573 """GetWindow(self) -> Window"""
54f9ee45 7574 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
7575
7576 def SetWindow(*args, **kwargs):
a95a7133 7577 """SetWindow(self, Window window)"""
54f9ee45 7578 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
7579
7580 def IsSilent(*args, **kwargs):
66c033b4 7581 """IsSilent() -> bool"""
54f9ee45 7582 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
7583
7584 IsSilent = staticmethod(IsSilent)
7585 def SetBellOnError(*args, **kwargs):
66c033b4 7586 """SetBellOnError(int doIt=True)"""
54f9ee45 7587 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
7588
7589 SetBellOnError = staticmethod(SetBellOnError)
7590
7591class ValidatorPtr(Validator):
7592 def __init__(self, this):
7593 self.this = this
7594 if not hasattr(self,"thisown"): self.thisown = 0
7595 self.__class__ = Validator
54f9ee45 7596_core_.Validator_swigregister(ValidatorPtr)
e811c8ce
RD
7597
7598def Validator_IsSilent(*args, **kwargs):
7599 """Validator_IsSilent() -> bool"""
54f9ee45 7600 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
7601
7602def Validator_SetBellOnError(*args, **kwargs):
7603 """Validator_SetBellOnError(int doIt=True)"""
54f9ee45 7604 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
7605
7606class PyValidator(Validator):
e811c8ce
RD
7607 def __repr__(self):
7608 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7609 def __init__(self, *args, **kwargs):
a95a7133 7610 """__init__(self) -> PyValidator"""
54f9ee45 7611 newobj = _core_.new_PyValidator(*args, **kwargs)
e811c8ce
RD
7612 self.this = newobj.this
7613 self.thisown = 1
7614 del newobj.thisown
7615
7616 self._setCallbackInfo(self, PyValidator, 1)
7617 self._setOORInfo(self)
7618
7619 def _setCallbackInfo(*args, **kwargs):
a95a7133 7620 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
54f9ee45 7621 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
7622
7623
7624class PyValidatorPtr(PyValidator):
7625 def __init__(self, this):
7626 self.this = this
7627 if not hasattr(self,"thisown"): self.thisown = 0
7628 self.__class__ = PyValidator
54f9ee45 7629_core_.PyValidator_swigregister(PyValidatorPtr)
e811c8ce
RD
7630
7631#---------------------------------------------------------------------------
7632
7633class Menu(EvtHandler):
d14a1e28
RD
7634 def __repr__(self):
7635 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 7636 def __init__(self, *args, **kwargs):
a95a7133 7637 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
54f9ee45 7638 newobj = _core_.new_Menu(*args, **kwargs)
e811c8ce
RD
7639 self.this = newobj.this
7640 self.thisown = 1
7641 del newobj.thisown
7642 self._setOORInfo(self)
7643
7644 def Append(*args, **kwargs):
a95a7133 7645 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 7646 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
7647
7648 def AppendSeparator(*args, **kwargs):
a95a7133 7649 """AppendSeparator(self) -> MenuItem"""
54f9ee45 7650 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
7651
7652 def AppendCheckItem(*args, **kwargs):
a95a7133 7653 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 7654 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
7655
7656 def AppendRadioItem(*args, **kwargs):
a95a7133 7657 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 7658 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
7659
7660 def AppendMenu(*args, **kwargs):
a95a7133 7661 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 7662 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce
RD
7663
7664 def AppendItem(*args, **kwargs):
a95a7133 7665 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 7666 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce
RD
7667
7668 def Break(*args, **kwargs):
a95a7133 7669 """Break(self)"""
54f9ee45 7670 return _core_.Menu_Break(*args, **kwargs)
e811c8ce
RD
7671
7672 def InsertItem(*args, **kwargs):
a95a7133 7673 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 7674 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce
RD
7675
7676 def Insert(*args, **kwargs):
0df68c9f 7677 """
a95a7133 7678 Insert(self, size_t pos, int id, String text, String help=EmptyString,
a41e16b6 7679 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 7680 """
54f9ee45 7681 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
7682
7683 def InsertSeparator(*args, **kwargs):
a95a7133 7684 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 7685 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
7686
7687 def InsertCheckItem(*args, **kwargs):
a95a7133 7688 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 7689 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
7690
7691 def InsertRadioItem(*args, **kwargs):
a95a7133 7692 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 7693 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
7694
7695 def InsertMenu(*args, **kwargs):
a95a7133 7696 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 7697 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce
RD
7698
7699 def PrependItem(*args, **kwargs):
a95a7133 7700 """PrependItem(self, MenuItem item) -> MenuItem"""
54f9ee45 7701 return _core_.Menu_PrependItem(*args, **kwargs)
e811c8ce
RD
7702
7703 def Prepend(*args, **kwargs):
a95a7133 7704 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 7705 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
7706
7707 def PrependSeparator(*args, **kwargs):
a95a7133 7708 """PrependSeparator(self) -> MenuItem"""
54f9ee45 7709 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
7710
7711 def PrependCheckItem(*args, **kwargs):
a95a7133 7712 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 7713 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
7714
7715 def PrependRadioItem(*args, **kwargs):
a95a7133 7716 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 7717 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
7718
7719 def PrependMenu(*args, **kwargs):
a95a7133 7720 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 7721 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
7722
7723 def Remove(*args, **kwargs):
a95a7133 7724 """Remove(self, int id) -> MenuItem"""
54f9ee45 7725 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce
RD
7726
7727 def RemoveItem(*args, **kwargs):
a95a7133 7728 """RemoveItem(self, MenuItem item) -> MenuItem"""
54f9ee45 7729 return _core_.Menu_RemoveItem(*args, **kwargs)
e811c8ce
RD
7730
7731 def Delete(*args, **kwargs):
a95a7133 7732 """Delete(self, int id) -> bool"""
54f9ee45 7733 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
7734
7735 def DeleteItem(*args, **kwargs):
a95a7133 7736 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 7737 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
7738
7739 def Destroy(*args, **kwargs):
0df68c9f 7740 """
a95a7133 7741 Destroy(self)
e811c8ce 7742
0df68c9f
RD
7743 Deletes the C++ object this Python object is a proxy for.
7744 """
54f9ee45 7745 return _core_.Menu_Destroy(*args, **kwargs)
e811c8ce
RD
7746
7747 def DestroyId(*args, **kwargs):
0df68c9f 7748 """
a95a7133 7749 DestroyId(self, int id) -> bool
e811c8ce 7750
0df68c9f
RD
7751 Deletes the C++ object this Python object is a proxy for.
7752 """
54f9ee45 7753 return _core_.Menu_DestroyId(*args, **kwargs)
e811c8ce
RD
7754
7755 def DestroyItem(*args, **kwargs):
0df68c9f 7756 """
a95a7133 7757 DestroyItem(self, MenuItem item) -> bool
e811c8ce 7758
0df68c9f
RD
7759 Deletes the C++ object this Python object is a proxy for.
7760 """
54f9ee45 7761 return _core_.Menu_DestroyItem(*args, **kwargs)
e811c8ce
RD
7762
7763 def GetMenuItemCount(*args, **kwargs):
a95a7133 7764 """GetMenuItemCount(self) -> size_t"""
54f9ee45 7765 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
7766
7767 def GetMenuItems(*args, **kwargs):
a95a7133 7768 """GetMenuItems(self) -> PyObject"""
54f9ee45 7769 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
7770
7771 def FindItem(*args, **kwargs):
a95a7133 7772 """FindItem(self, String item) -> int"""
54f9ee45 7773 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
7774
7775 def FindItemById(*args, **kwargs):
a95a7133 7776 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 7777 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
7778
7779 def FindItemByPosition(*args, **kwargs):
a95a7133 7780 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 7781 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
7782
7783 def Enable(*args, **kwargs):
a95a7133 7784 """Enable(self, int id, bool enable)"""
54f9ee45 7785 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
7786
7787 def IsEnabled(*args, **kwargs):
a95a7133 7788 """IsEnabled(self, int id) -> bool"""
54f9ee45 7789 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
7790
7791 def Check(*args, **kwargs):
a95a7133 7792 """Check(self, int id, bool check)"""
54f9ee45 7793 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
7794
7795 def IsChecked(*args, **kwargs):
a95a7133 7796 """IsChecked(self, int id) -> bool"""
54f9ee45 7797 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
7798
7799 def SetLabel(*args, **kwargs):
a95a7133 7800 """SetLabel(self, int id, String label)"""
54f9ee45 7801 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
7802
7803 def GetLabel(*args, **kwargs):
a95a7133 7804 """GetLabel(self, int id) -> String"""
54f9ee45 7805 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
7806
7807 def SetHelpString(*args, **kwargs):
a95a7133 7808 """SetHelpString(self, int id, String helpString)"""
54f9ee45 7809 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
7810
7811 def GetHelpString(*args, **kwargs):
a95a7133 7812 """GetHelpString(self, int id) -> String"""
54f9ee45 7813 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
7814
7815 def SetTitle(*args, **kwargs):
a95a7133 7816 """SetTitle(self, String title)"""
54f9ee45 7817 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
7818
7819 def GetTitle(*args, **kwargs):
a95a7133 7820 """GetTitle(self) -> String"""
54f9ee45 7821 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
7822
7823 def SetEventHandler(*args, **kwargs):
a95a7133 7824 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 7825 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
7826
7827 def GetEventHandler(*args, **kwargs):
a95a7133 7828 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 7829 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
7830
7831 def SetInvokingWindow(*args, **kwargs):
a95a7133 7832 """SetInvokingWindow(self, Window win)"""
54f9ee45 7833 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
7834
7835 def GetInvokingWindow(*args, **kwargs):
a95a7133 7836 """GetInvokingWindow(self) -> Window"""
54f9ee45 7837 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
7838
7839 def GetStyle(*args, **kwargs):
a95a7133 7840 """GetStyle(self) -> long"""
54f9ee45 7841 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
7842
7843 def UpdateUI(*args, **kwargs):
a95a7133 7844 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 7845 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
7846
7847 def GetMenuBar(*args, **kwargs):
a95a7133 7848 """GetMenuBar(self) -> MenuBar"""
54f9ee45 7849 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
7850
7851 def Attach(*args, **kwargs):
a95a7133 7852 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 7853 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
7854
7855 def Detach(*args, **kwargs):
a95a7133 7856 """Detach(self)"""
54f9ee45 7857 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
7858
7859 def IsAttached(*args, **kwargs):
a95a7133 7860 """IsAttached(self) -> bool"""
54f9ee45 7861 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
7862
7863 def SetParent(*args, **kwargs):
a95a7133 7864 """SetParent(self, Menu parent)"""
54f9ee45 7865 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
7866
7867 def GetParent(*args, **kwargs):
a95a7133 7868 """GetParent(self) -> Menu"""
54f9ee45 7869 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 7870
d14a1e28
RD
7871
7872class MenuPtr(Menu):
7873 def __init__(self, this):
7874 self.this = this
7875 if not hasattr(self,"thisown"): self.thisown = 0
7876 self.__class__ = Menu
54f9ee45 7877_core_.Menu_swigregister(MenuPtr)
d14a1e28
RD
7878DefaultValidator = cvar.DefaultValidator
7879
7880#---------------------------------------------------------------------------
7881
7882class MenuBar(Window):
e811c8ce
RD
7883 def __repr__(self):
7884 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 7885 def __init__(self, *args, **kwargs):
a95a7133 7886 """__init__(self, long style=0) -> MenuBar"""
54f9ee45 7887 newobj = _core_.new_MenuBar(*args, **kwargs)
d14a1e28
RD
7888 self.this = newobj.this
7889 self.thisown = 1
7890 del newobj.thisown
7891 self._setOORInfo(self)
e811c8ce
RD
7892
7893 def Append(*args, **kwargs):
a95a7133 7894 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 7895 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
7896
7897 def Insert(*args, **kwargs):
a95a7133 7898 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 7899 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
7900
7901 def GetMenuCount(*args, **kwargs):
a95a7133 7902 """GetMenuCount(self) -> size_t"""
54f9ee45 7903 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
7904
7905 def GetMenu(*args, **kwargs):
a95a7133 7906 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 7907 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
7908
7909 def Replace(*args, **kwargs):
a95a7133 7910 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 7911 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
7912
7913 def Remove(*args, **kwargs):
a95a7133 7914 """Remove(self, size_t pos) -> Menu"""
54f9ee45 7915 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
7916
7917 def EnableTop(*args, **kwargs):
a95a7133 7918 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 7919 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
7920
7921 def IsEnabledTop(*args, **kwargs):
a95a7133 7922 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 7923 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
7924
7925 def SetLabelTop(*args, **kwargs):
a95a7133 7926 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 7927 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
7928
7929 def GetLabelTop(*args, **kwargs):
a95a7133 7930 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 7931 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
7932
7933 def FindMenuItem(*args, **kwargs):
a95a7133 7934 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 7935 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
7936
7937 def FindItemById(*args, **kwargs):
a95a7133 7938 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 7939 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
7940
7941 def FindMenu(*args, **kwargs):
a95a7133 7942 """FindMenu(self, String title) -> int"""
54f9ee45 7943 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
7944
7945 def Enable(*args, **kwargs):
a95a7133 7946 """Enable(self, int id, bool enable)"""
54f9ee45 7947 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
7948
7949 def Check(*args, **kwargs):
a95a7133 7950 """Check(self, int id, bool check)"""
54f9ee45 7951 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
7952
7953 def IsChecked(*args, **kwargs):
a95a7133 7954 """IsChecked(self, int id) -> bool"""
54f9ee45 7955 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
7956
7957 def IsEnabled(*args, **kwargs):
a95a7133 7958 """IsEnabled(self, int id) -> bool"""
54f9ee45 7959 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
7960
7961 def SetLabel(*args, **kwargs):
a95a7133 7962 """SetLabel(self, int id, String label)"""
54f9ee45 7963 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
7964
7965 def GetLabel(*args, **kwargs):
a95a7133 7966 """GetLabel(self, int id) -> String"""
54f9ee45 7967 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
7968
7969 def SetHelpString(*args, **kwargs):
a95a7133 7970 """SetHelpString(self, int id, String helpString)"""
54f9ee45 7971 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
7972
7973 def GetHelpString(*args, **kwargs):
a95a7133 7974 """GetHelpString(self, int id) -> String"""
54f9ee45 7975 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
7976
7977 def GetFrame(*args, **kwargs):
a95a7133 7978 """GetFrame(self) -> wxFrame"""
54f9ee45 7979 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
7980
7981 def IsAttached(*args, **kwargs):
a95a7133 7982 """IsAttached(self) -> bool"""
54f9ee45 7983 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
7984
7985 def Attach(*args, **kwargs):
a95a7133 7986 """Attach(self, wxFrame frame)"""
54f9ee45 7987 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
7988
7989 def Detach(*args, **kwargs):
a95a7133 7990 """Detach(self)"""
54f9ee45 7991 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 7992
d14a1e28
RD
7993
7994class MenuBarPtr(MenuBar):
7995 def __init__(self, this):
7996 self.this = this
7997 if not hasattr(self,"thisown"): self.thisown = 0
7998 self.__class__ = MenuBar
54f9ee45 7999_core_.MenuBar_swigregister(MenuBarPtr)
d14a1e28
RD
8000
8001#---------------------------------------------------------------------------
8002
8003class MenuItem(Object):
e811c8ce
RD
8004 def __repr__(self):
8005 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8006 def __init__(self, *args, **kwargs):
0df68c9f 8007 """
a95a7133 8008 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
196addbf
RD
8009 String help=EmptyString, int kind=ITEM_NORMAL,
8010 Menu subMenu=None) -> MenuItem
0df68c9f 8011 """
54f9ee45 8012 newobj = _core_.new_MenuItem(*args, **kwargs)
d14a1e28
RD
8013 self.this = newobj.this
8014 self.thisown = 1
8015 del newobj.thisown
e811c8ce 8016 def GetMenu(*args, **kwargs):
a95a7133 8017 """GetMenu(self) -> Menu"""
54f9ee45 8018 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
8019
8020 def SetMenu(*args, **kwargs):
a95a7133 8021 """SetMenu(self, Menu menu)"""
54f9ee45 8022 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
8023
8024 def SetId(*args, **kwargs):
a95a7133 8025 """SetId(self, int id)"""
54f9ee45 8026 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
8027
8028 def GetId(*args, **kwargs):
a95a7133 8029 """GetId(self) -> int"""
54f9ee45 8030 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
8031
8032 def IsSeparator(*args, **kwargs):
a95a7133 8033 """IsSeparator(self) -> bool"""
54f9ee45 8034 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
8035
8036 def SetText(*args, **kwargs):
a95a7133 8037 """SetText(self, String str)"""
54f9ee45 8038 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
8039
8040 def GetLabel(*args, **kwargs):
a95a7133 8041 """GetLabel(self) -> String"""
54f9ee45 8042 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
8043
8044 def GetText(*args, **kwargs):
a95a7133 8045 """GetText(self) -> String"""
54f9ee45 8046 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
8047
8048 def GetLabelFromText(*args, **kwargs):
66c033b4 8049 """GetLabelFromText(String text) -> String"""
54f9ee45 8050 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
8051
8052 GetLabelFromText = staticmethod(GetLabelFromText)
8053 def GetKind(*args, **kwargs):
a95a7133 8054 """GetKind(self) -> int"""
54f9ee45 8055 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 8056
a95a7133
RD
8057 def SetKind(*args, **kwargs):
8058 """SetKind(self, int kind)"""
54f9ee45 8059 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 8060
e811c8ce 8061 def SetCheckable(*args, **kwargs):
a95a7133 8062 """SetCheckable(self, bool checkable)"""
54f9ee45 8063 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
8064
8065 def IsCheckable(*args, **kwargs):
a95a7133 8066 """IsCheckable(self) -> bool"""
54f9ee45 8067 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
8068
8069 def IsSubMenu(*args, **kwargs):
a95a7133 8070 """IsSubMenu(self) -> bool"""
54f9ee45 8071 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
8072
8073 def SetSubMenu(*args, **kwargs):
a95a7133 8074 """SetSubMenu(self, Menu menu)"""
54f9ee45 8075 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
8076
8077 def GetSubMenu(*args, **kwargs):
a95a7133 8078 """GetSubMenu(self) -> Menu"""
54f9ee45 8079 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
8080
8081 def Enable(*args, **kwargs):
a95a7133 8082 """Enable(self, bool enable=True)"""
54f9ee45 8083 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
8084
8085 def IsEnabled(*args, **kwargs):
a95a7133 8086 """IsEnabled(self) -> bool"""
54f9ee45 8087 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
8088
8089 def Check(*args, **kwargs):
a95a7133 8090 """Check(self, bool check=True)"""
54f9ee45 8091 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
8092
8093 def IsChecked(*args, **kwargs):
a95a7133 8094 """IsChecked(self) -> bool"""
54f9ee45 8095 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
8096
8097 def Toggle(*args, **kwargs):
a95a7133 8098 """Toggle(self)"""
54f9ee45 8099 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
8100
8101 def SetHelp(*args, **kwargs):
a95a7133 8102 """SetHelp(self, String str)"""
54f9ee45 8103 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
8104
8105 def GetHelp(*args, **kwargs):
a95a7133 8106 """GetHelp(self) -> String"""
54f9ee45 8107 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
8108
8109 def GetAccel(*args, **kwargs):
a95a7133 8110 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 8111 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
8112
8113 def SetAccel(*args, **kwargs):
a95a7133 8114 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 8115 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce
RD
8116
8117 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 8118 """GetDefaultMarginWidth() -> int"""
54f9ee45 8119 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
8120
8121 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
8122 def SetBitmap(*args, **kwargs):
a95a7133 8123 """SetBitmap(self, Bitmap bitmap)"""
54f9ee45 8124 return _core_.MenuItem_SetBitmap(*args, **kwargs)
e811c8ce
RD
8125
8126 def GetBitmap(*args, **kwargs):
a95a7133 8127 """GetBitmap(self) -> Bitmap"""
54f9ee45 8128 return _core_.MenuItem_GetBitmap(*args, **kwargs)
e811c8ce 8129
d14a1e28
RD
8130
8131class MenuItemPtr(MenuItem):
8132 def __init__(self, this):
8133 self.this = this
8134 if not hasattr(self,"thisown"): self.thisown = 0
8135 self.__class__ = MenuItem
54f9ee45 8136_core_.MenuItem_swigregister(MenuItemPtr)
d14a1e28 8137
e811c8ce 8138def MenuItem_GetLabelFromText(*args, **kwargs):
196addbf 8139 """MenuItem_GetLabelFromText(String text) -> String"""
54f9ee45 8140 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 8141
e811c8ce
RD
8142def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8143 """MenuItem_GetDefaultMarginWidth() -> int"""
54f9ee45 8144 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d14a1e28
RD
8145
8146#---------------------------------------------------------------------------
8147
8148class Control(Window):
15afbcd0
RD
8149 """
8150 This is the base class for a control or 'widget'.
8151
41e2b43e
RD
8152 A control is generally a small window which processes user input
8153 and/or displays one or more item of data.
15afbcd0 8154 """
e811c8ce
RD
8155 def __repr__(self):
8156 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8157 def __init__(self, *args, **kwargs):
0df68c9f 8158 """
248ed943
RD
8159 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8160 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 8161 String name=ControlNameStr) -> Control
15afbcd0 8162
41e2b43e
RD
8163 Create a Control. Normally you should only call this from a subclass'
8164 __init__ as a plain old wx.Control is not very useful.
0df68c9f 8165 """
54f9ee45 8166 newobj = _core_.new_Control(*args, **kwargs)
d14a1e28
RD
8167 self.this = newobj.this
8168 self.thisown = 1
8169 del newobj.thisown
8170 self._setOORInfo(self)
e811c8ce
RD
8171
8172 def Create(*args, **kwargs):
0df68c9f 8173 """
248ed943
RD
8174 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8175 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 8176 String name=ControlNameStr) -> bool
15afbcd0
RD
8177
8178 Do the 2nd phase and create the GUI control.
0df68c9f 8179 """
54f9ee45 8180 return _core_.Control_Create(*args, **kwargs)
e811c8ce
RD
8181
8182 def Command(*args, **kwargs):
15afbcd0 8183 """
a95a7133 8184 Command(self, CommandEvent event)
15afbcd0 8185
41e2b43e
RD
8186 Simulates the effect of the user issuing a command to the item.
8187
8188 :see: `wx.CommandEvent`
8189
15afbcd0 8190 """
54f9ee45 8191 return _core_.Control_Command(*args, **kwargs)
e811c8ce
RD
8192
8193 def GetLabel(*args, **kwargs):
15afbcd0 8194 """
a95a7133 8195 GetLabel(self) -> String
15afbcd0
RD
8196
8197 Return a control's text.
8198 """
54f9ee45 8199 return _core_.Control_GetLabel(*args, **kwargs)
e811c8ce
RD
8200
8201 def SetLabel(*args, **kwargs):
15afbcd0 8202 """
a95a7133 8203 SetLabel(self, String label)
15afbcd0
RD
8204
8205 Sets the item's text.
8206 """
54f9ee45 8207 return _core_.Control_SetLabel(*args, **kwargs)
e811c8ce 8208
74a57fcd 8209 def GetClassDefaultAttributes(*args, **kwargs):
dfbb5885 8210 """GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes"""
54f9ee45 8211 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
8212
8213 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
d14a1e28
RD
8214
8215class ControlPtr(Control):
8216 def __init__(self, this):
8217 self.this = this
8218 if not hasattr(self,"thisown"): self.thisown = 0
8219 self.__class__ = Control
54f9ee45 8220_core_.Control_swigregister(ControlPtr)
b2dc1044 8221ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
8222
8223def PreControl(*args, **kwargs):
15afbcd0
RD
8224 """
8225 PreControl() -> Control
8226
8227 Precreate a Control control for 2-phase creation
8228 """
54f9ee45 8229 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
8230 val.thisown = 1
8231 return val
8232
74a57fcd 8233def Control_GetClassDefaultAttributes(*args, **kwargs):
dfbb5885 8234 """Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes"""
54f9ee45 8235 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 8236
d14a1e28
RD
8237#---------------------------------------------------------------------------
8238
8239class ItemContainer(object):
15afbcd0
RD
8240 """
8241 wx.ItemContainer defines an interface which is implemented by all
41e2b43e
RD
8242 controls which have string subitems, each of which may be selected,
8243 such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well as
8244 `wx.ComboBox` which implements an extended interface deriving from
8245 this one.
15afbcd0 8246
41e2b43e
RD
8247 It defines the methods for accessing the control's items and although
8248 each of the derived classes implements them differently, they still
8249 all conform to the same interface.
15afbcd0 8250
41e2b43e
RD
8251 The items in a wx.ItemContainer have (non empty) string labels and,
8252 optionally, client data associated with them.
15afbcd0
RD
8253
8254 """
d14a1e28
RD
8255 def __init__(self): raise RuntimeError, "No constructor defined"
8256 def __repr__(self):
8257 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 8258 def Append(*args, **kwargs):
15afbcd0 8259 """
a95a7133 8260 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 8261
41e2b43e
RD
8262 Adds the item to the control, associating the given data with the item
8263 if not None. The return value is the index of the newly added item
8264 which may be different from the last one if the control is sorted (e.g.
8265 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 8266 """
54f9ee45 8267 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
8268
8269 def AppendItems(*args, **kwargs):
15afbcd0 8270 """
a95a7133 8271 AppendItems(self, wxArrayString strings)
15afbcd0 8272
41e2b43e
RD
8273 Apend several items at once to the control. Notice that calling this
8274 method may be much faster than appending the items one by one if you
8275 need to add a lot of items.
15afbcd0 8276 """
54f9ee45 8277 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
8278
8279 def Insert(*args, **kwargs):
15afbcd0 8280 """
a95a7133 8281 Insert(self, String item, int pos, PyObject clientData=None) -> int
15afbcd0 8282
41e2b43e 8283 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
8284 optionally associating some data object with the item.
8285 """
54f9ee45 8286 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
8287
8288 def Clear(*args, **kwargs):
15afbcd0 8289 """
a95a7133 8290 Clear(self)
15afbcd0
RD
8291
8292 Removes all items from the control.
8293 """
54f9ee45 8294 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
8295
8296 def Delete(*args, **kwargs):
15afbcd0 8297 """
a95a7133 8298 Delete(self, int n)
15afbcd0 8299
41e2b43e
RD
8300 Deletes the item at the zero-based index 'n' from the control. Note
8301 that it is an error (signalled by a `wx.PyAssertionError` exception if
8302 enabled) to remove an item with the index negative or greater or equal
8303 than the number of items in the control.
15afbcd0 8304 """
54f9ee45 8305 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce
RD
8306
8307 def GetCount(*args, **kwargs):
15afbcd0 8308 """
a95a7133 8309 GetCount(self) -> int
15afbcd0
RD
8310
8311 Returns the number of items in the control.
8312 """
54f9ee45 8313 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
8314
8315 def IsEmpty(*args, **kwargs):
15afbcd0 8316 """
a95a7133 8317 IsEmpty(self) -> bool
15afbcd0
RD
8318
8319 Returns True if the control is empty or False if it has some items.
8320 """
54f9ee45 8321 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
8322
8323 def GetString(*args, **kwargs):
15afbcd0 8324 """
a95a7133 8325 GetString(self, int n) -> String
15afbcd0
RD
8326
8327 Returns the label of the item with the given index.
8328 """
54f9ee45 8329 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
8330
8331 def GetStrings(*args, **kwargs):
a95a7133 8332 """GetStrings(self) -> wxArrayString"""
54f9ee45 8333 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
8334
8335 def SetString(*args, **kwargs):
15afbcd0 8336 """
a95a7133 8337 SetString(self, int n, String s)
15afbcd0
RD
8338
8339 Sets the label for the given item.
8340 """
54f9ee45 8341 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
8342
8343 def FindString(*args, **kwargs):
15afbcd0 8344 """
a95a7133 8345 FindString(self, String s) -> int
15afbcd0
RD
8346
8347 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
8348 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
8349 found.
15afbcd0 8350 """
54f9ee45 8351 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce
RD
8352
8353 def Select(*args, **kwargs):
15afbcd0 8354 """
a95a7133 8355 Select(self, int n)
15afbcd0
RD
8356
8357 Sets the item at index 'n' to be the selected item.
8358 """
54f9ee45 8359 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 8360
15afbcd0 8361 SetSelection = Select
e811c8ce 8362 def GetSelection(*args, **kwargs):
15afbcd0 8363 """
a95a7133 8364 GetSelection(self) -> int
15afbcd0 8365
41e2b43e
RD
8366 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
8367 is selected.
15afbcd0 8368 """
54f9ee45 8369 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce
RD
8370
8371 def GetStringSelection(*args, **kwargs):
15afbcd0 8372 """
a95a7133 8373 GetStringSelection(self) -> String
15afbcd0 8374
41e2b43e
RD
8375 Returns the label of the selected item or an empty string if no item
8376 is selected.
15afbcd0 8377 """
54f9ee45 8378 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce
RD
8379
8380 def GetClientData(*args, **kwargs):
15afbcd0 8381 """
a95a7133 8382 GetClientData(self, int n) -> PyObject
15afbcd0
RD
8383
8384 Returns the client data associated with the given item, (if any.)
8385 """
54f9ee45 8386 return _core_.ItemContainer_GetClientData(*args, **kwargs)
e811c8ce
RD
8387
8388 def SetClientData(*args, **kwargs):
15afbcd0 8389 """
a95a7133 8390 SetClientData(self, int n, PyObject clientData)
15afbcd0
RD
8391
8392 Associate the given client data with the item at position n.
8393 """
54f9ee45 8394 return _core_.ItemContainer_SetClientData(*args, **kwargs)
e811c8ce 8395
d14a1e28
RD
8396
8397class ItemContainerPtr(ItemContainer):
8398 def __init__(self, this):
8399 self.this = this
8400 if not hasattr(self,"thisown"): self.thisown = 0
8401 self.__class__ = ItemContainer
54f9ee45 8402_core_.ItemContainer_swigregister(ItemContainerPtr)
d14a1e28
RD
8403
8404#---------------------------------------------------------------------------
8405
8406class ControlWithItems(Control,ItemContainer):
15afbcd0 8407 """
41e2b43e
RD
8408 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
8409 wx.Control class, and is used for the base class of various controls
8410 that have items.
15afbcd0 8411 """
d14a1e28
RD
8412 def __init__(self): raise RuntimeError, "No constructor defined"
8413 def __repr__(self):
8414 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8415
8416class ControlWithItemsPtr(ControlWithItems):
8417 def __init__(self, this):
8418 self.this = this
8419 if not hasattr(self,"thisown"): self.thisown = 0
8420 self.__class__ = ControlWithItems
54f9ee45 8421_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
d14a1e28
RD
8422
8423#---------------------------------------------------------------------------
8424
8425class SizerItem(Object):
248ed943
RD
8426 """
8427 The wx.SizerItem class is used to track the position, size and other
8428 attributes of each item managed by a `wx.Sizer`. In normal usage user
8429 code should never need to deal directly with a wx.SizerItem, but
8430 custom classes derived from `wx.PySizer` will probably need to use the
8431 collection of wx.SizerItems held by wx.Sizer when calculating layout.
8432
8433 :see: `wx.Sizer`, `wx.GBSizerItem`
8434 """
e811c8ce
RD
8435 def __repr__(self):
8436 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 8437 def __init__(self, *args, **kwargs):
248ed943
RD
8438 """
8439 __init__(self) -> SizerItem
8440
8441 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
8442 size will need to be set before this item can be used in a Sizer.
8443
8444 You will probably never need to create a wx.SizerItem directly as they
8445 are created automatically when the sizer's Add, Insert or Prepend
8446 methods are called.
8447
8448 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
8449 """
54f9ee45 8450 newobj = _core_.new_SizerItem(*args, **kwargs)
d14a1e28
RD
8451 self.this = newobj.this
8452 self.thisown = 1
8453 del newobj.thisown
e811c8ce 8454 def DeleteWindows(*args, **kwargs):
248ed943
RD
8455 """
8456 DeleteWindows(self)
8457
8458 Destroy the window or the windows in a subsizer, depending on the type
8459 of item.
8460 """
54f9ee45 8461 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
8462
8463 def DetachSizer(*args, **kwargs):
248ed943
RD
8464 """
8465 DetachSizer(self)
8466
8467 Enable deleting the SizerItem without destroying the contained sizer.
8468 """
54f9ee45 8469 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
8470
8471 def GetSize(*args, **kwargs):
248ed943
RD
8472 """
8473 GetSize(self) -> Size
8474
8475 Get the current size of the item, as set in the last Layout.
8476 """
54f9ee45 8477 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
8478
8479 def CalcMin(*args, **kwargs):
248ed943
RD
8480 """
8481 CalcMin(self) -> Size
8482
8483 Calculates the minimum desired size for the item, including any space
8484 needed by borders.
8485 """
54f9ee45 8486 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
8487
8488 def SetDimension(*args, **kwargs):
248ed943
RD
8489 """
8490 SetDimension(self, Point pos, Size size)
8491
8492 Set the position and size of the space allocated for this item by the
8493 sizer, and adjust the position and size of the item (window or
8494 subsizer) to be within that space taking alignment and borders into
8495 account.
8496 """
54f9ee45 8497 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
8498
8499 def GetMinSize(*args, **kwargs):
248ed943
RD
8500 """
8501 GetMinSize(self) -> Size
8502
8503 Get the minimum size needed for the item.
8504 """
54f9ee45 8505 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 8506
dfbb5885
RD
8507 def GetMinSizeWithBorder(*args, **kwargs):
8508 """
8509 GetMinSizeWithBorder(self) -> Size
8510
8511 Get the minimum size needed for the item with space for the borders
8512 added, if needed.
8513 """
8514 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
8515
e811c8ce 8516 def SetInitSize(*args, **kwargs):
a95a7133 8517 """SetInitSize(self, int x, int y)"""
54f9ee45 8518 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
8519
8520 def SetRatioWH(*args, **kwargs):
248ed943
RD
8521 """
8522 SetRatioWH(self, int width, int height)
8523
8524 Set the ratio item attribute.
8525 """
54f9ee45 8526 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
8527
8528 def SetRatioSize(*args, **kwargs):
248ed943
RD
8529 """
8530 SetRatioSize(self, Size size)
8531
8532 Set the ratio item attribute.
8533 """
54f9ee45 8534 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
8535
8536 def SetRatio(*args, **kwargs):
248ed943
RD
8537 """
8538 SetRatio(self, float ratio)
8539
8540 Set the ratio item attribute.
8541 """
54f9ee45 8542 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
8543
8544 def GetRatio(*args, **kwargs):
248ed943
RD
8545 """
8546 GetRatio(self) -> float
8547
8548 Set the ratio item attribute.
8549 """
54f9ee45 8550 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce
RD
8551
8552 def IsWindow(*args, **kwargs):
248ed943
RD
8553 """
8554 IsWindow(self) -> bool
8555
8556 Is this sizer item a window?
8557 """
54f9ee45 8558 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
8559
8560 def IsSizer(*args, **kwargs):
248ed943
RD
8561 """
8562 IsSizer(self) -> bool
8563
8564 Is this sizer item a subsizer?
8565 """
54f9ee45 8566 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
8567
8568 def IsSpacer(*args, **kwargs):
248ed943
RD
8569 """
8570 IsSpacer(self) -> bool
8571
8572 Is this sizer item a spacer?
8573 """
54f9ee45 8574 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
8575
8576 def SetProportion(*args, **kwargs):
248ed943
RD
8577 """
8578 SetProportion(self, int proportion)
8579
8580 Set the proportion value for this item.
8581 """
54f9ee45 8582 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
8583
8584 def GetProportion(*args, **kwargs):
248ed943
RD
8585 """
8586 GetProportion(self) -> int
8587
8588 Get the proportion value for this item.
8589 """
54f9ee45 8590 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 8591
248ed943
RD
8592 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
8593 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 8594 def SetFlag(*args, **kwargs):
248ed943
RD
8595 """
8596 SetFlag(self, int flag)
8597
8598 Set the flag value for this item.
8599 """
54f9ee45 8600 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
8601
8602 def GetFlag(*args, **kwargs):
248ed943
RD
8603 """
8604 GetFlag(self) -> int
8605
8606 Get the flag value for this item.
8607 """
54f9ee45 8608 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
8609
8610 def SetBorder(*args, **kwargs):
248ed943
RD
8611 """
8612 SetBorder(self, int border)
8613
8614 Set the border value for this item.
8615 """
54f9ee45 8616 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
8617
8618 def GetBorder(*args, **kwargs):
248ed943
RD
8619 """
8620 GetBorder(self) -> int
8621
8622 Get the border value for this item.
8623 """
54f9ee45 8624 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
8625
8626 def GetWindow(*args, **kwargs):
248ed943
RD
8627 """
8628 GetWindow(self) -> Window
8629
8630 Get the window (if any) that is managed by this sizer item.
8631 """
54f9ee45 8632 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce
RD
8633
8634 def SetWindow(*args, **kwargs):
248ed943
RD
8635 """
8636 SetWindow(self, Window window)
8637
8638 Set the window to be managed by this sizer item.
8639 """
54f9ee45 8640 return _core_.SizerItem_SetWindow(*args, **kwargs)
e811c8ce
RD
8641
8642 def GetSizer(*args, **kwargs):
248ed943
RD
8643 """
8644 GetSizer(self) -> Sizer
8645
8646 Get the subsizer (if any) that is managed by this sizer item.
8647 """
54f9ee45 8648 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce
RD
8649
8650 def SetSizer(*args, **kwargs):
248ed943
RD
8651 """
8652 SetSizer(self, Sizer sizer)
8653
8654 Set the subsizer to be managed by this sizer item.
8655 """
54f9ee45 8656 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce
RD
8657
8658 def GetSpacer(*args, **kwargs):
248ed943
RD
8659 """
8660 GetSpacer(self) -> Size
8661
8662 Get the size of the spacer managed by this sizer item.
8663 """
54f9ee45 8664 return _core_.SizerItem_GetSpacer(*args, **kwargs)
e811c8ce
RD
8665
8666 def SetSpacer(*args, **kwargs):
248ed943
RD
8667 """
8668 SetSpacer(self, Size size)
8669
8670 Set the size of the spacer to be managed by this sizer item.
8671 """
54f9ee45 8672 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce
RD
8673
8674 def Show(*args, **kwargs):
248ed943
RD
8675 """
8676 Show(self, bool show)
8677
8678 Set the show item attribute, which sizers use to determine if the item
8679 is to be made part of the layout or not. If the item is tracking a
8680 window then it is shown or hidden as needed.
8681 """
54f9ee45 8682 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
8683
8684 def IsShown(*args, **kwargs):
248ed943
RD
8685 """
8686 IsShown(self) -> bool
8687
8688 Is the item to be shown in the layout?
8689 """
54f9ee45 8690 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
8691
8692 def GetPosition(*args, **kwargs):
248ed943
RD
8693 """
8694 GetPosition(self) -> Point
8695
8696 Returns the current position of the item, as set in the last Layout.
8697 """
54f9ee45 8698 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
8699
8700 def GetUserData(*args, **kwargs):
248ed943
RD
8701 """
8702 GetUserData(self) -> PyObject
8703
8704 Returns the userData associated with this sizer item, or None if there
8705 isn't any.
8706 """
54f9ee45 8707 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 8708
d14a1e28
RD
8709
8710class SizerItemPtr(SizerItem):
8711 def __init__(self, this):
8712 self.this = this
8713 if not hasattr(self,"thisown"): self.thisown = 0
8714 self.__class__ = SizerItem
54f9ee45 8715_core_.SizerItem_swigregister(SizerItemPtr)
d14a1e28 8716
248ed943 8717def SizerItemWindow(*args, **kwargs):
0df68c9f 8718 """
248ed943
RD
8719 SizerItemWindow(Window window, int proportion, int flag, int border,
8720 PyObject userData=None) -> SizerItem
8721
8722 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 8723 """
248ed943 8724 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
8725 val.thisown = 1
8726 return val
8727
248ed943 8728def SizerItemSpacer(*args, **kwargs):
0df68c9f 8729 """
248ed943
RD
8730 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
8731 PyObject userData=None) -> SizerItem
8732
8733 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 8734 """
248ed943 8735 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
8736 val.thisown = 1
8737 return val
8738
8739def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
8740 """
8741 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
8742 PyObject userData=None) -> SizerItem
8743
8744 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 8745 """
54f9ee45 8746 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
8747 val.thisown = 1
8748 return val
8749
8750class Sizer(Object):
248ed943
RD
8751 """
8752 wx.Sizer is the abstract base class used for laying out subwindows in
8753 a window. You cannot use wx.Sizer directly; instead, you will have to
8754 use one of the sizer classes derived from it such as `wx.BoxSizer`,
8755 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
8756 and `wx.GridBagSizer`.
8757
8758 The concept implemented by sizers in wxWidgets is closely related to
8759 layout tools in other GUI toolkits, such as Java's AWT, the GTK
8760 toolkit or the Qt toolkit. It is based upon the idea of the individual
8761 subwindows reporting their minimal required size and their ability to
8762 get stretched if the size of the parent window has changed. This will
8763 most often mean that the programmer does not set the original size of
8764 a dialog in the beginning, rather the dialog will assigned a sizer and
8765 this sizer will be queried about the recommended size. The sizer in
8766 turn will query its children, which can be normal windows or contorls,
8767 empty space or other sizers, so that a hierarchy of sizers can be
8768 constructed. Note that wxSizer does not derive from wxWindow and thus
8769 do not interfere with tab ordering and requires very little resources
8770 compared to a real window on screen.
8771
8772 What makes sizers so well fitted for use in wxWidgets is the fact that
8773 every control reports its own minimal size and the algorithm can
8774 handle differences in font sizes or different window (dialog item)
8775 sizes on different platforms without problems. If for example the
8776 standard font as well as the overall design of Mac widgets requires
8777 more space than on Windows, then the initial size of a dialog using a
8778 sizer will automatically be bigger on Mac than on Windows.
8779 """
e811c8ce
RD
8780 def __init__(self): raise RuntimeError, "No constructor defined"
8781 def __repr__(self):
8782 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8783 def _setOORInfo(*args, **kwargs):
a95a7133 8784 """_setOORInfo(self, PyObject _self)"""
54f9ee45 8785 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
8786
8787 def Add(*args, **kwargs):
0df68c9f 8788 """
248ed943 8789 Add(self, item, int proportion=0, int flag=0, int border=0,
0df68c9f 8790 PyObject userData=None)
248ed943
RD
8791
8792 Appends a child item to the sizer.
0df68c9f 8793 """
54f9ee45 8794 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce
RD
8795
8796 def Insert(*args, **kwargs):
0df68c9f 8797 """
248ed943
RD
8798 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
8799 PyObject userData=None)
8800
8801 Inserts a new item into the list of items managed by this sizer before
8802 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 8803 """
54f9ee45 8804 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce
RD
8805
8806 def Prepend(*args, **kwargs):
0df68c9f 8807 """
248ed943 8808 Prepend(self, item, int proportion=0, int flag=0, int border=0,
0df68c9f 8809 PyObject userData=None)
248ed943
RD
8810
8811 Adds a new item to the begining of the list of sizer items managed by
8812 this sizer. See `Add` for a description of the parameters.
0df68c9f 8813 """
54f9ee45 8814 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce
RD
8815
8816 def Remove(*args, **kwargs):
248ed943
RD
8817 """
8818 Remove(self, item) -> bool
8819
8820 Removes an item from the sizer and destroys it. This method does not
8821 cause any layout or resizing to take place, call `Layout` to update
8822 the layout on screen after removing a child from the sizer. The
8823 *item* parameter can be either a window, a sizer, or the zero-based
8824 index of an item to remove. Returns True if the child item was found
8825 and removed.
8826 """
54f9ee45 8827 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 8828
1c0f361b 8829 def Detach(*args, **kwargs):
248ed943
RD
8830 """
8831 Detach(self, item) -> bool
8832
8833 Detaches an item from the sizer without destroying it. This method
8834 does not cause any layout or resizing to take place, call `Layout` to
8835 do so. The *item* parameter can be either a window, a sizer, or the
8836 zero-based index of the item to be detached. Returns True if the child item
8837 was found and detached.
8838 """
1c0f361b
RD
8839 return _core_.Sizer_Detach(*args, **kwargs)
8840
e811c8ce 8841 def _SetItemMinSize(*args, **kwargs):
a95a7133 8842 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 8843 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 8844
248ed943
RD
8845 def SetItemMinSize(self, item, *args):
8846 """
8847 SetItemMinSize(self, item, Size size)
8848
8849 Sets the minimum size that will be allocated for an item in the sizer.
8850 The *item* parameter can be either a window, a sizer, or the
8851 zero-based index of the item. If a window or sizer is given then it
8852 will be searched for recursivly in subsizers if neccessary.
8853 """
8854 if len(args) == 2:
8855 # for backward compatibility accept separate width,height args too
8856 return self._SetItemMinSize(item, args)
8857 else:
8858 return self._SetItemMinSize(item, args[0])
8859
e811c8ce 8860 def AddItem(*args, **kwargs):
248ed943
RD
8861 """
8862 AddItem(self, SizerItem item)
8863
8864 Adds a `wx.SizerItem` to the sizer.
8865 """
54f9ee45 8866 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
8867
8868 def InsertItem(*args, **kwargs):
248ed943
RD
8869 """
8870 InsertItem(self, int index, SizerItem item)
8871
8872 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
8873 """
54f9ee45 8874 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
8875
8876 def PrependItem(*args, **kwargs):
248ed943
RD
8877 """
8878 PrependItem(self, SizerItem item)
8879
8880 Prepends a `wx.SizerItem` to the sizer.
8881 """
54f9ee45 8882 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 8883
248ed943 8884 def AddMany(self, items):
66c033b4
RD
8885 """
8886 AddMany is a convenience method for adding several items
8887 to a sizer at one time. Simply pass it a list of tuples,
8888 where each tuple consists of the parameters that you
8889 would normally pass to the `Add` method.
8890 """
248ed943
RD
8891 for item in items:
8892 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
8893 item = (item, )
8894 self.Add(*item)
d14a1e28 8895
74e96f3d 8896 # for backwards compatibility only, please do not use in new code
66c033b4
RD
8897 AddWindow = wx._deprecated(Add, "AddWindow is deprecated, use `Add` instead.")
8898 AddSizer = wx._deprecated(Add, "AddSizer is deprecated, use `Add` instead.")
8899 AddSpacer = wx._deprecated(Add, "AddSpacer is deprecated, use `Add` instead.")
8900 PrependWindow = wx._deprecated(Prepend, "PrependWindow is deprecated, use `Prepend` instead.")
8901 PrependSizer = wx._deprecated(Prepend, "PrependSizer is deprecated, use `Prepend` instead.")
8902 PrependSpacer = wx._deprecated(Prepend, "PrependSpacer is deprecated, use `Prepend` instead.")
8903 InsertWindow = wx._deprecated(Insert, "InsertWindow is deprecated, use `Insert` instead.")
8904 InsertSizer = wx._deprecated(Insert, "InsertSizer is deprecated, use `Insert` instead.")
8905 InsertSpacer = wx._deprecated(Insert, "InsertSpacer is deprecated, use `Insert` instead.")
8906 RemoveWindow = wx._deprecated(Remove, "RemoveWindow is deprecated, use `Remove` instead.")
8907 RemoveSizer = wx._deprecated(Remove, "RemoveSizer is deprecated, use `Remove` instead.")
8908 RemovePos = wx._deprecated(Remove, "RemovePos is deprecated, use `Remove` instead.")
d14a1e28
RD
8909
8910
e811c8ce 8911 def SetDimension(*args, **kwargs):
248ed943
RD
8912 """
8913 SetDimension(self, int x, int y, int width, int height)
8914
8915 Call this to force the sizer to take the given dimension and thus
8916 force the items owned by the sizer to resize themselves according to
8917 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
8918 methods.
8919 """
54f9ee45 8920 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
8921
8922 def SetMinSize(*args, **kwargs):
248ed943
RD
8923 """
8924 SetMinSize(self, Size size)
8925
8926 Call this to give the sizer a minimal size. Normally, the sizer will
8927 calculate its minimal size based purely on how much space its children
8928 need. After calling this method `GetMinSize` will return either the
8929 minimal size as requested by its children or the minimal size set
8930 here, depending on which is bigger.
8931 """
54f9ee45 8932 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
8933
8934 def GetSize(*args, **kwargs):
248ed943
RD
8935 """
8936 GetSize(self) -> Size
8937
8938 Returns the current size of the space managed by the sizer.
8939 """
54f9ee45 8940 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
8941
8942 def GetPosition(*args, **kwargs):
248ed943
RD
8943 """
8944 GetPosition(self) -> Point
8945
8946 Returns the current position of the sizer's managed space.
8947 """
54f9ee45 8948 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
8949
8950 def GetMinSize(*args, **kwargs):
248ed943
RD
8951 """
8952 GetMinSize(self) -> Size
8953
8954 Returns the minimal size of the sizer. This is either the combined
8955 minimal size of all the children and their borders or the minimal size
8956 set by SetMinSize, depending on which is bigger.
8957 """
54f9ee45 8958 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 8959
d14a1e28 8960 def GetSizeTuple(self):
1c0f361b 8961 return self.GetSize().Get()
d14a1e28 8962 def GetPositionTuple(self):
1c0f361b 8963 return self.GetPosition().Get()
d14a1e28 8964 def GetMinSizeTuple(self):
1c0f361b 8965 return self.GetMinSize().Get()
d14a1e28 8966
e811c8ce 8967 def RecalcSizes(*args, **kwargs):
248ed943
RD
8968 """
8969 RecalcSizes(self)
8970
8971 Using the sizes calculated by `CalcMin` reposition and resize all the
8972 items managed by this sizer. You should not need to call this directly as
8973 it is called by `Layout`.
8974 """
54f9ee45 8975 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
8976
8977 def CalcMin(*args, **kwargs):
248ed943
RD
8978 """
8979 CalcMin(self) -> Size
8980
8981 This method is where the sizer will do the actual calculation of its
8982 children's minimal sizes. You should not need to call this directly as
8983 it is called by `Layout`.
8984 """
54f9ee45 8985 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
8986
8987 def Layout(*args, **kwargs):
248ed943
RD
8988 """
8989 Layout(self)
8990
8991 This method will force the recalculation and layout of the items
8992 controlled by the sizer using the current space allocated to the
8993 sizer. Normally this is called automatically from the owning window's
8994 EVT_SIZE handler, but it is also useful to call it from user code when
8995 one of the items in a sizer change size, or items are added or
8996 removed.
8997 """
54f9ee45 8998 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
8999
9000 def Fit(*args, **kwargs):
248ed943
RD
9001 """
9002 Fit(self, Window window) -> Size
9003
9004 Tell the sizer to resize the *window* to match the sizer's minimal
9005 size. This is commonly done in the constructor of the window itself in
9006 order to set its initial size to match the needs of the children as
9007 determined by the sizer. Returns the new size.
9008
9009 For a top level window this is the total window size, not the client size.
9010 """
54f9ee45 9011 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
9012
9013 def FitInside(*args, **kwargs):
248ed943
RD
9014 """
9015 FitInside(self, Window window)
9016
9017 Tell the sizer to resize the *virtual size* of the *window* to match the
9018 sizer's minimal size. This will not alter the on screen size of the
9019 window, but may cause the addition/removal/alteration of scrollbars
9020 required to view the virtual area in windows which manage it.
9021
9022 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9023
9024 """
54f9ee45 9025 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
9026
9027 def SetSizeHints(*args, **kwargs):
248ed943
RD
9028 """
9029 SetSizeHints(self, Window window)
9030
9031 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9032 match the sizer's minimal size. This is commonly done in the
9033 constructor of the window itself if the window is resizable (as are
9034 many dialogs under Unix and frames on probably all platforms) in order
9035 to prevent the window from being sized smaller than the minimal size
9036 required by the sizer.
9037 """
54f9ee45 9038 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
9039
9040 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
9041 """
9042 SetVirtualSizeHints(self, Window window)
9043
9044 Tell the sizer to set the minimal size of the window virtual area to
9045 match the sizer's minimal size. For windows with managed scrollbars
9046 this will set them appropriately.
9047
9048 :see: `wx.ScrolledWindow.SetScrollbars`
9049
9050 """
54f9ee45 9051 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
9052
9053 def Clear(*args, **kwargs):
248ed943
RD
9054 """
9055 Clear(self, bool deleteWindows=False)
9056
9057 Clear all items from the sizer, optionally destroying the window items
9058 as well.
9059 """
54f9ee45 9060 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
9061
9062 def DeleteWindows(*args, **kwargs):
248ed943
RD
9063 """
9064 DeleteWindows(self)
9065
9066 Destroy all windows managed by the sizer.
9067 """
54f9ee45 9068 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
9069
9070 def GetChildren(*args, **kwargs):
248ed943
RD
9071 """
9072 GetChildren(sefl) -> list
9073
9074 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9075 """
54f9ee45 9076 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
9077
9078 def Show(*args, **kwargs):
248ed943
RD
9079 """
9080 Show(self, item, bool show=True)
e811c8ce 9081
248ed943
RD
9082 Shows or hides an item managed by the sizer. To make a sizer item
9083 disappear or reappear, use Show followed by `Layout`. The *item*
9084 parameter can be either a window, a sizer, or the zero-based index of
9085 the item.
9086 """
9087 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
9088
9089 def IsShown(*args, **kwargs):
248ed943
RD
9090 """
9091 IsShown(self, item)
9092
9093 Determines if the item is currently shown. sizer. To make a sizer
9094 item disappear or reappear, use Show followed by `Layout`. The *item*
9095 parameter can be either a window, a sizer, or the zero-based index of
9096 the item.
9097 """
54f9ee45 9098 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 9099
248ed943
RD
9100 def Hide(self, item):
9101 """
9102 A convenience method for Show(item, False).
9103 """
9104 self.Show(item, False)
9105
e811c8ce 9106 def ShowItems(*args, **kwargs):
248ed943
RD
9107 """
9108 ShowItems(self, bool show)
9109
9110 Recursively call `wx.Window.Show` on all sizer items.
9111 """
54f9ee45 9112 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 9113
d14a1e28
RD
9114
9115class SizerPtr(Sizer):
9116 def __init__(self, this):
9117 self.this = this
9118 if not hasattr(self,"thisown"): self.thisown = 0
9119 self.__class__ = Sizer
54f9ee45 9120_core_.Sizer_swigregister(SizerPtr)
d14a1e28
RD
9121
9122class PySizer(Sizer):
248ed943
RD
9123 """
9124 wx.PySizer is a special version of `wx.Sizer` that has been
9125 instrumented to allow the C++ virtual methods to be overloaded in
9126 Python derived classes. You would derive from this class if you are
9127 wanting to implement a custom sizer in Python code. Simply implement
9128 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
9129 For example::
9130
9131 class MySizer(wx.PySizer):
9132 def __init__(self):
9133 wx.PySizer.__init__(self)
9134
9135 def CalcMin(self):
9136 for item in self.GetChildren():
9137 # calculate the total minimum width and height needed
9138 # by all items in the sizer according to this sizer's
9139 # layout algorithm.
9140 ...
9141 return wx.Size(width, height)
9142
9143 def RecalcSizes(self):
9144 # find the space allotted to this sizer
9145 pos = self.GetPosition()
9146 size = self.GetSize()
9147 for item in self.GetChildren():
9148 # Recalculate (if necessary) the position and size of
9149 # each item and then call item.SetDimension to do the
9150 # actual positioning and sizing of the items within the
9151 # space alloted to this sizer.
9152 ...
9153 item.SetDimension(itemPos, itemSize)
9154
9155
9156 When `Layout` is called it first calls `CalcMin` followed by
9157 `RecalcSizes` so you can optimize a bit by saving the results of
9158 `CalcMin` and resuing them in `RecalcSizes`.
9159
9160 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
9161
9162
9163 """
e811c8ce
RD
9164 def __repr__(self):
9165 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9166 def __init__(self, *args, **kwargs):
248ed943
RD
9167 """
9168 __init__(self) -> PySizer
9169
9170 Creates a wx.PySizer. Must be called from the __init__ in the derived
9171 class.
9172 """
54f9ee45 9173 newobj = _core_.new_PySizer(*args, **kwargs)
d14a1e28
RD
9174 self.this = newobj.this
9175 self.thisown = 1
9176 del newobj.thisown
9177 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
e811c8ce
RD
9178
9179 def _setCallbackInfo(*args, **kwargs):
a95a7133 9180 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 9181 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 9182
d14a1e28
RD
9183
9184class PySizerPtr(PySizer):
9185 def __init__(self, this):
9186 self.this = this
9187 if not hasattr(self,"thisown"): self.thisown = 0
9188 self.__class__ = PySizer
54f9ee45 9189_core_.PySizer_swigregister(PySizerPtr)
d14a1e28
RD
9190
9191#---------------------------------------------------------------------------
9192
9193class BoxSizer(Sizer):
248ed943
RD
9194 """
9195 The basic idea behind a box sizer is that windows will most often be
9196 laid out in rather simple basic geometry, typically in a row or a
9197 column or nested hierarchies of either. A wx.BoxSizer will lay out
9198 its items in a simple row or column, depending on the orientation
9199 parameter passed to the constructor.
9200 """
e811c8ce
RD
9201 def __repr__(self):
9202 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9203 def __init__(self, *args, **kwargs):
248ed943
RD
9204 """
9205 __init__(self, int orient=HORIZONTAL) -> BoxSizer
9206
9207 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
9208 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
9209 sizer.
9210 """
54f9ee45 9211 newobj = _core_.new_BoxSizer(*args, **kwargs)
d14a1e28
RD
9212 self.this = newobj.this
9213 self.thisown = 1
9214 del newobj.thisown
9215 self._setOORInfo(self)
e811c8ce
RD
9216
9217 def GetOrientation(*args, **kwargs):
248ed943
RD
9218 """
9219 GetOrientation(self) -> int
9220
9221 Returns the current orientation of the sizer.
9222 """
54f9ee45 9223 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
9224
9225 def SetOrientation(*args, **kwargs):
248ed943
RD
9226 """
9227 SetOrientation(self, int orient)
e811c8ce 9228
248ed943
RD
9229 Resets the orientation of the sizer.
9230 """
9231 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 9232
d14a1e28
RD
9233
9234class BoxSizerPtr(BoxSizer):
9235 def __init__(self, this):
9236 self.this = this
9237 if not hasattr(self,"thisown"): self.thisown = 0
9238 self.__class__ = BoxSizer
54f9ee45 9239_core_.BoxSizer_swigregister(BoxSizerPtr)
d14a1e28
RD
9240
9241#---------------------------------------------------------------------------
9242
9243class StaticBoxSizer(BoxSizer):
248ed943
RD
9244 """
9245 wx.StaticBoxSizer derives from and functions identically to the
9246 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
9247 manages. Note that this static box must be created separately and
9248 passed to the sizer constructor.
9249 """
e811c8ce
RD
9250 def __repr__(self):
9251 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9252 def __init__(self, *args, **kwargs):
248ed943
RD
9253 """
9254 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
9255
9256 Constructor. It takes an associated static box and the orientation
9257 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
9258 ``wx.HORIZONTAL``.
9259 """
54f9ee45 9260 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
d14a1e28
RD
9261 self.this = newobj.this
9262 self.thisown = 1
9263 del newobj.thisown
9264 self._setOORInfo(self)
e811c8ce
RD
9265
9266 def GetStaticBox(*args, **kwargs):
248ed943
RD
9267 """
9268 GetStaticBox(self) -> StaticBox
e811c8ce 9269
248ed943
RD
9270 Returns the static box associated with this sizer.
9271 """
9272 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 9273
d14a1e28
RD
9274
9275class StaticBoxSizerPtr(StaticBoxSizer):
9276 def __init__(self, this):
9277 self.this = this
9278 if not hasattr(self,"thisown"): self.thisown = 0
9279 self.__class__ = StaticBoxSizer
54f9ee45 9280_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
d14a1e28
RD
9281
9282#---------------------------------------------------------------------------
9283
9284class GridSizer(Sizer):
248ed943
RD
9285 """
9286 A grid sizer is a sizer which lays out its children in a
9287 two-dimensional table with all cells having the same size. In other
9288 words, the width of each cell within the grid is the width of the
9289 widest item added to the sizer and the height of each grid cell is the
9290 height of the tallest item. An optional vertical and/or horizontal
9291 gap between items can also be specified (in pixels.)
9292
9293 Items are placed in the cells of the grid in the order they are added,
9294 in row-major order. In other words, the first row is filled first,
9295 then the second, and so on until all items have been added. (If
9296 neccessary, additional rows will be added as items are added.) If you
9297 need to have greater control over the cells that items are placed in
9298 then use the `wx.GridBagSizer`.
9299
9300 """
e811c8ce
RD
9301 def __repr__(self):
9302 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9303 def __init__(self, *args, **kwargs):
248ed943
RD
9304 """
9305 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
9306
9307 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
9308 of columns and rows in the sizer - if either of the parameters is
9309 zero, it will be calculated to from the total number of children in
9310 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9311 define extra space between all children.
9312 """
54f9ee45 9313 newobj = _core_.new_GridSizer(*args, **kwargs)
d14a1e28
RD
9314 self.this = newobj.this
9315 self.thisown = 1
9316 del newobj.thisown
9317 self._setOORInfo(self)
e811c8ce 9318
e811c8ce 9319 def SetCols(*args, **kwargs):
248ed943
RD
9320 """
9321 SetCols(self, int cols)
9322
9323 Sets the number of columns in the sizer.
9324 """
54f9ee45 9325 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
9326
9327 def SetRows(*args, **kwargs):
248ed943
RD
9328 """
9329 SetRows(self, int rows)
9330
9331 Sets the number of rows in the sizer.
9332 """
54f9ee45 9333 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
9334
9335 def SetVGap(*args, **kwargs):
248ed943
RD
9336 """
9337 SetVGap(self, int gap)
9338
9339 Sets the vertical gap (in pixels) between the cells in the sizer.
9340 """
54f9ee45 9341 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
9342
9343 def SetHGap(*args, **kwargs):
248ed943
RD
9344 """
9345 SetHGap(self, int gap)
9346
9347 Sets the horizontal gap (in pixels) between cells in the sizer
9348 """
54f9ee45 9349 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
9350
9351 def GetCols(*args, **kwargs):
248ed943
RD
9352 """
9353 GetCols(self) -> int
9354
9355 Returns the number of columns in the sizer.
9356 """
54f9ee45 9357 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
9358
9359 def GetRows(*args, **kwargs):
248ed943
RD
9360 """
9361 GetRows(self) -> int
9362
9363 Returns the number of rows in the sizer.
9364 """
54f9ee45 9365 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
9366
9367 def GetVGap(*args, **kwargs):
248ed943
RD
9368 """
9369 GetVGap(self) -> int
9370
9371 Returns the vertical gap (in pixels) between the cells in the sizer.
9372 """
54f9ee45 9373 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
9374
9375 def GetHGap(*args, **kwargs):
248ed943
RD
9376 """
9377 GetHGap(self) -> int
9378
9379 Returns the horizontal gap (in pixels) between cells in the sizer.
9380 """
54f9ee45 9381 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 9382
d14a1e28
RD
9383
9384class GridSizerPtr(GridSizer):
9385 def __init__(self, this):
9386 self.this = this
9387 if not hasattr(self,"thisown"): self.thisown = 0
9388 self.__class__ = GridSizer
54f9ee45 9389_core_.GridSizer_swigregister(GridSizerPtr)
d14a1e28
RD
9390
9391#---------------------------------------------------------------------------
9392
54f9ee45
RD
9393FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
9394FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
9395FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 9396class FlexGridSizer(GridSizer):
248ed943
RD
9397 """
9398 A flex grid sizer is a sizer which lays out its children in a
9399 two-dimensional table with all table cells in one row having the same
9400 height and all cells in one column having the same width, but all
9401 rows or all columns are not necessarily the same height or width as in
9402 the `wx.GridSizer`.
9403
9404 wx.FlexGridSizer can also size items equally in one direction but
9405 unequally ("flexibly") in the other. If the sizer is only flexible
9406 in one direction (this can be changed using `SetFlexibleDirection`), it
9407 needs to be decided how the sizer should grow in the other ("non
9408 flexible") direction in order to fill the available space. The
9409 `SetNonFlexibleGrowMode` method serves this purpose.
9410
9411
9412 """
e811c8ce
RD
9413 def __repr__(self):
9414 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9415 def __init__(self, *args, **kwargs):
248ed943
RD
9416 """
9417 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
9418
9419 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
9420 number of columns and rows in the sizer - if either of the parameters
9421 is zero, it will be calculated to from the total number of children in
9422 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9423 define extra space between all children.
9424 """
54f9ee45 9425 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
d14a1e28
RD
9426 self.this = newobj.this
9427 self.thisown = 1
9428 del newobj.thisown
9429 self._setOORInfo(self)
e811c8ce 9430
248ed943
RD
9431 def AddGrowableRow(*args, **kwargs):
9432 """
9433 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 9434
248ed943
RD
9435 Specifies that row *idx* (starting from zero) should be grown if there
9436 is extra space available to the sizer.
e811c8ce 9437
248ed943
RD
9438 The *proportion* parameter has the same meaning as the stretch factor
9439 for the box sizers except that if all proportions are 0, then all
9440 columns are resized equally (instead of not being resized at all).
9441 """
54f9ee45 9442 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
9443
9444 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
9445 """
9446 RemoveGrowableRow(self, size_t idx)
9447
9448 Specifies that row *idx* is no longer growable.
9449 """
54f9ee45 9450 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
9451
9452 def AddGrowableCol(*args, **kwargs):
248ed943
RD
9453 """
9454 AddGrowableCol(self, size_t idx, int proportion=0)
9455
9456 Specifies that column *idx* (starting from zero) should be grown if
9457 there is extra space available to the sizer.
9458
9459 The *proportion* parameter has the same meaning as the stretch factor
9460 for the box sizers except that if all proportions are 0, then all
9461 columns are resized equally (instead of not being resized at all).
9462 """
54f9ee45 9463 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
9464
9465 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
9466 """
9467 RemoveGrowableCol(self, size_t idx)
9468
9469 Specifies that column *idx* is no longer growable.
9470 """
54f9ee45 9471 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
9472
9473 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
9474 """
9475 SetFlexibleDirection(self, int direction)
9476
9477 Specifies whether the sizer should flexibly resize its columns, rows,
9478 or both. Argument *direction* can be one of the following values. Any
9479 other value is ignored.
9480
9481 ============== =======================================
9482 wx.VERTICAL Rows are flexibly sized.
9483 wx.HORIZONTAL Columns are flexibly sized.
9484 wx.BOTH Both rows and columns are flexibly sized
9485 (this is the default value).
9486 ============== =======================================
9487
9488 Note that this method does not trigger relayout.
9489
9490 """
54f9ee45 9491 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
9492
9493 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
9494 """
9495 GetFlexibleDirection(self) -> int
9496
9497 Returns a value that specifies whether the sizer
9498 flexibly resizes its columns, rows, or both (default).
9499
9500 :see: `SetFlexibleDirection`
9501 """
54f9ee45 9502 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
9503
9504 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
9505 """
9506 SetNonFlexibleGrowMode(self, int mode)
9507
9508 Specifies how the sizer should grow in the non-flexible direction if
9509 there is one (so `SetFlexibleDirection` must have been called
9510 previously). Argument *mode* can be one of the following values:
9511
9512 ========================== =================================================
9513 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
9514 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
9515 `AddGrowableCol` and `AddGrowableRow`. In this
9516 case equal sizing applies to minimum sizes of
9517 columns or rows (this is the default value).
9518 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
9519 the non flexible direction, whether they are
9520 growable or not in the flexbile direction.
9521 ========================== =================================================
9522
9523 Note that this method does not trigger relayout.
9524
9525
9526 """
54f9ee45 9527 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
9528
9529 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
9530 """
9531 GetNonFlexibleGrowMode(self) -> int
9532
9533 Returns the value that specifies how the sizer grows in the
9534 non-flexible direction if there is one.
9535
9536 :see: `SetNonFlexibleGrowMode`
9537 """
54f9ee45 9538 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
9539
9540 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
9541 """
9542 GetRowHeights(self) -> list
9543
9544 Returns a list of integers representing the heights of each of the
9545 rows in the sizer.
9546 """
54f9ee45 9547 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
9548
9549 def GetColWidths(*args, **kwargs):
fd2dc343
RD
9550 """
9551 GetColWidths(self) -> list
9552
9553 Returns a list of integers representing the widths of each of the
9554 columns in the sizer.
9555 """
54f9ee45 9556 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 9557
d14a1e28
RD
9558
9559class FlexGridSizerPtr(FlexGridSizer):
9560 def __init__(self, this):
9561 self.this = this
9562 if not hasattr(self,"thisown"): self.thisown = 0
9563 self.__class__ = FlexGridSizer
54f9ee45 9564_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
d14a1e28
RD
9565
9566#---------------------------------------------------------------------------
9567
9568class GBPosition(object):
248ed943
RD
9569 """
9570 This class represents the position of an item in a virtual grid of
9571 rows and columns managed by a `wx.GridBagSizer`. wxPython has
9572 typemaps that will automatically convert from a 2-element sequence of
9573 integers to a wx.GBPosition, so you can use the more pythonic
9574 representation of the position nearly transparently in Python code.
9575 """
e811c8ce
RD
9576 def __repr__(self):
9577 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9578 def __init__(self, *args, **kwargs):
248ed943
RD
9579 """
9580 __init__(self, int row=0, int col=0) -> GBPosition
9581
9582 This class represents the position of an item in a virtual grid of
9583 rows and columns managed by a `wx.GridBagSizer`. wxPython has
9584 typemaps that will automatically convert from a 2-element sequence of
9585 integers to a wx.GBPosition, so you can use the more pythonic
9586 representation of the position nearly transparently in Python code.
9587 """
54f9ee45 9588 newobj = _core_.new_GBPosition(*args, **kwargs)
d14a1e28
RD
9589 self.this = newobj.this
9590 self.thisown = 1
9591 del newobj.thisown
e811c8ce 9592 def GetRow(*args, **kwargs):
a95a7133 9593 """GetRow(self) -> int"""
54f9ee45 9594 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
9595
9596 def GetCol(*args, **kwargs):
a95a7133 9597 """GetCol(self) -> int"""
54f9ee45 9598 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
9599
9600 def SetRow(*args, **kwargs):
a95a7133 9601 """SetRow(self, int row)"""
54f9ee45 9602 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
9603
9604 def SetCol(*args, **kwargs):
a95a7133 9605 """SetCol(self, int col)"""
54f9ee45 9606 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
9607
9608 def __eq__(*args, **kwargs):
a95a7133 9609 """__eq__(self, GBPosition other) -> bool"""
54f9ee45 9610 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
9611
9612 def __ne__(*args, **kwargs):
a95a7133 9613 """__ne__(self, GBPosition other) -> bool"""
54f9ee45 9614 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
9615
9616 def Set(*args, **kwargs):
a95a7133 9617 """Set(self, int row=0, int col=0)"""
54f9ee45 9618 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
9619
9620 def Get(*args, **kwargs):
a95a7133 9621 """Get(self) -> PyObject"""
54f9ee45 9622 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 9623
41e2b43e 9624 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
9625 def __str__(self): return str(self.Get())
9626 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
9627 def __len__(self): return len(self.Get())
9628 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
9629 def __setitem__(self, index, val):
9630 if index == 0: self.SetRow(val)
9631 elif index == 1: self.SetCol(val)
9632 else: raise IndexError
e811c8ce 9633 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
9634 __safe_for_unpickling__ = True
9635 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
9636
9637 row = property(GetRow, SetRow)
9638 col = property(GetCol, SetCol)
9639
9640
9641class GBPositionPtr(GBPosition):
9642 def __init__(self, this):
9643 self.this = this
9644 if not hasattr(self,"thisown"): self.thisown = 0
9645 self.__class__ = GBPosition
54f9ee45 9646_core_.GBPosition_swigregister(GBPositionPtr)
d14a1e28
RD
9647
9648class GBSpan(object):
248ed943
RD
9649 """
9650 This class is used to hold the row and column spanning attributes of
9651 items in a `wx.GridBagSizer`. wxPython has typemaps that will
9652 automatically convert from a 2-element sequence of integers to a
9653 wx.GBSpan, so you can use the more pythonic representation of the span
9654 nearly transparently in Python code.
9655
9656 """
e811c8ce
RD
9657 def __repr__(self):
9658 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9659 def __init__(self, *args, **kwargs):
248ed943
RD
9660 """
9661 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
9662
9663 Construct a new wxGBSpan, optionally setting the rowspan and
9664 colspan. The default is (1,1). (Meaning that the item occupies one
9665 cell in each direction.
9666 """
54f9ee45 9667 newobj = _core_.new_GBSpan(*args, **kwargs)
d14a1e28
RD
9668 self.this = newobj.this
9669 self.thisown = 1
9670 del newobj.thisown
e811c8ce 9671 def GetRowspan(*args, **kwargs):
a95a7133 9672 """GetRowspan(self) -> int"""
54f9ee45 9673 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
9674
9675 def GetColspan(*args, **kwargs):
a95a7133 9676 """GetColspan(self) -> int"""
54f9ee45 9677 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
9678
9679 def SetRowspan(*args, **kwargs):
a95a7133 9680 """SetRowspan(self, int rowspan)"""
54f9ee45 9681 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
9682
9683 def SetColspan(*args, **kwargs):
a95a7133 9684 """SetColspan(self, int colspan)"""
54f9ee45 9685 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
9686
9687 def __eq__(*args, **kwargs):
a95a7133 9688 """__eq__(self, GBSpan other) -> bool"""
54f9ee45 9689 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
9690
9691 def __ne__(*args, **kwargs):
a95a7133 9692 """__ne__(self, GBSpan other) -> bool"""
54f9ee45 9693 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
9694
9695 def Set(*args, **kwargs):
a95a7133 9696 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 9697 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
9698
9699 def Get(*args, **kwargs):
a95a7133 9700 """Get(self) -> PyObject"""
54f9ee45 9701 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 9702
41e2b43e 9703 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
9704 def __str__(self): return str(self.Get())
9705 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
9706 def __len__(self): return len(self.Get())
9707 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
9708 def __setitem__(self, index, val):
9709 if index == 0: self.SetRowspan(val)
9710 elif index == 1: self.SetColspan(val)
9711 else: raise IndexError
e811c8ce 9712 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
9713 __safe_for_unpickling__ = True
9714 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
9715
9716 rowspan = property(GetRowspan, SetRowspan)
9717 colspan = property(GetColspan, SetColspan)
9718
9719
9720class GBSpanPtr(GBSpan):
9721 def __init__(self, this):
9722 self.this = this
9723 if not hasattr(self,"thisown"): self.thisown = 0
9724 self.__class__ = GBSpan
54f9ee45 9725_core_.GBSpan_swigregister(GBSpanPtr)
d14a1e28
RD
9726
9727class GBSizerItem(SizerItem):
248ed943
RD
9728 """
9729 The wx.GBSizerItem class is used to track the additional data about
9730 items in a `wx.GridBagSizer` such as the item's position in the grid
9731 and how many rows or columns it spans.
9732
9733 """
e811c8ce
RD
9734 def __repr__(self):
9735 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9736 def __init__(self, *args, **kwargs):
248ed943
RD
9737 """
9738 __init__(self) -> GBSizerItem
9739
9740 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
9741 size will need to be set, as well as a position and span before this
9742 item can be used in a Sizer.
9743
9744 You will probably never need to create a wx.GBSizerItem directly as they
9745 are created automatically when the sizer's Add method is called.
9746 """
54f9ee45 9747 newobj = _core_.new_GBSizerItem(*args, **kwargs)
d14a1e28
RD
9748 self.this = newobj.this
9749 self.thisown = 1
9750 del newobj.thisown
e811c8ce 9751 def GetPos(*args, **kwargs):
248ed943
RD
9752 """
9753 GetPos(self) -> GBPosition
9754
9755 Get the grid position of the item
9756 """
54f9ee45 9757 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
9758
9759 def GetPosTuple(self): return self.GetPos().Get()
9760 def GetSpan(*args, **kwargs):
248ed943
RD
9761 """
9762 GetSpan(self) -> GBSpan
9763
9764 Get the row and column spanning of the item
9765 """
54f9ee45 9766 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
9767
9768 def GetSpanTuple(self): return self.GetSpan().Get()
9769 def SetPos(*args, **kwargs):
248ed943
RD
9770 """
9771 SetPos(self, GBPosition pos) -> bool
9772
9773 If the item is already a member of a sizer then first ensure that
9774 there is no other item that would intersect with this one at the new
9775 position, then set the new position. Returns True if the change is
9776 successful and after the next Layout() the item will be moved.
9777 """
54f9ee45 9778 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
9779
9780 def SetSpan(*args, **kwargs):
248ed943
RD
9781 """
9782 SetSpan(self, GBSpan span) -> bool
9783
9784 If the item is already a member of a sizer then first ensure that
9785 there is no other item that would intersect with this one with its new
9786 spanning size, then set the new spanning. Returns True if the change
9787 is successful and after the next Layout() the item will be resized.
9788
9789 """
54f9ee45 9790 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 9791
248ed943 9792 def Intersects(*args, **kwargs):
0df68c9f 9793 """
a95a7133 9794 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
9795
9796 Returns True if this item and the other item instersect.
0df68c9f 9797 """
248ed943
RD
9798 return _core_.GBSizerItem_Intersects(*args, **kwargs)
9799
9800 def IntersectsPos(*args, **kwargs):
9801 """
9802 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
9803
9804 Returns True if the given pos/span would intersect with this item.
9805 """
9806 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
9807
9808 def GetEndPos(*args, **kwargs):
248ed943
RD
9809 """
9810 GetEndPos(self) -> GBPosition
9811
9812 Get the row and column of the endpoint of this item.
9813 """
54f9ee45 9814 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
9815
9816 def GetGBSizer(*args, **kwargs):
248ed943
RD
9817 """
9818 GetGBSizer(self) -> GridBagSizer
9819
9820 Get the sizer this item is a member of.
9821 """
54f9ee45 9822 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
9823
9824 def SetGBSizer(*args, **kwargs):
248ed943
RD
9825 """
9826 SetGBSizer(self, GridBagSizer sizer)
9827
9828 Set the sizer this item is a member of.
9829 """
54f9ee45 9830 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 9831
d14a1e28
RD
9832
9833class GBSizerItemPtr(GBSizerItem):
9834 def __init__(self, this):
9835 self.this = this
9836 if not hasattr(self,"thisown"): self.thisown = 0
9837 self.__class__ = GBSizerItem
54f9ee45 9838_core_.GBSizerItem_swigregister(GBSizerItemPtr)
d14a1e28
RD
9839DefaultSpan = cvar.DefaultSpan
9840
9841def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
9842 """
9843 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
9844 int border, PyObject userData=None) -> GBSizerItem
9845
9846 Construct a `wx.GBSizerItem` for a window.
0df68c9f 9847 """
54f9ee45 9848 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
9849 val.thisown = 1
9850 return val
9851
9852def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
9853 """
9854 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
9855 int border, PyObject userData=None) -> GBSizerItem
9856
9857 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 9858 """
54f9ee45 9859 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
9860 val.thisown = 1
9861 return val
9862
9863def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
9864 """
9865 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
9866 int flag, int border, PyObject userData=None) -> GBSizerItem
9867
9868 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 9869 """
54f9ee45 9870 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
9871 val.thisown = 1
9872 return val
9873
9874class GridBagSizer(FlexGridSizer):
248ed943
RD
9875 """
9876 A `wx.Sizer` that can lay out items in a virtual grid like a
9877 `wx.FlexGridSizer` but in this case explicit positioning of the items
9878 is allowed using `wx.GBPosition`, and items can optionally span more
9879 than one row and/or column using `wx.GBSpan`. The total size of the
9880 virtual grid is determined by the largest row and column that items are
9881 positioned at, adjusted for spanning.
9882
9883 """
e811c8ce
RD
9884 def __repr__(self):
9885 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
d14a1e28 9886 def __init__(self, *args, **kwargs):
248ed943
RD
9887 """
9888 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
9889
9890 Constructor, with optional parameters to specify the gap between the
9891 rows and columns.
9892 """
54f9ee45 9893 newobj = _core_.new_GridBagSizer(*args, **kwargs)
d14a1e28
RD
9894 self.this = newobj.this
9895 self.thisown = 1
9896 del newobj.thisown
e811c8ce 9897 def Add(*args, **kwargs):
0df68c9f 9898 """
248ed943
RD
9899 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
9900 int border=0, userData=None)
9901
9902 Adds an item to the sizer at the grid cell *pos*, optionally spanning
9903 more than one row or column as specified with *span*. The remaining
9904 args behave similarly to `wx.Sizer.Add`.
9905
9906 Returns True if the item was successfully placed at the given cell
9907 position, False if something was already there.
9908
0df68c9f 9909 """
54f9ee45 9910 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
9911
9912 def AddItem(*args, **kwargs):
248ed943
RD
9913 """
9914 Add(self, GBSizerItem item) -> bool
9915
9916 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
9917 the item was successfully placed at its given cell position, False if
9918 something was already there.
9919 """
54f9ee45 9920 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce
RD
9921
9922 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
9923 """
9924 GetEmptyCellSize(self) -> Size
9925
9926 Get the size used for cells in the grid with no item.
9927 """
54f9ee45 9928 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
9929
9930 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
9931 """
9932 SetEmptyCellSize(self, Size sz)
9933
9934 Set the size used for cells in the grid with no item.
9935 """
54f9ee45 9936 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
9937
9938 def GetItemPosition(*args):
0df68c9f 9939 """
248ed943
RD
9940 GetItemPosition(self, item) -> GBPosition
9941
9942 Get the grid position of the specified *item* where *item* is either a
9943 window or subsizer that is a member of this sizer, or a zero-based
9944 index of an item.
0df68c9f 9945 """
54f9ee45 9946 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
9947
9948 def SetItemPosition(*args):
0df68c9f 9949 """
248ed943
RD
9950 SetItemPosition(self, item, GBPosition pos) -> bool
9951
9952 Set the grid position of the specified *item* where *item* is either a
9953 window or subsizer that is a member of this sizer, or a zero-based
9954 index of an item. Returns True on success. If the move is not
9955 allowed (because an item is already there) then False is returned.
9956
0df68c9f 9957 """
54f9ee45 9958 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
9959
9960 def GetItemSpan(*args):
0df68c9f 9961 """
248ed943
RD
9962 GetItemSpan(self, item) -> GBSpan
9963
9964 Get the row/col spanning of the specified *item* where *item* is
9965 either a window or subsizer that is a member of this sizer, or a
9966 zero-based index of an item.
0df68c9f 9967 """
54f9ee45 9968 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
9969
9970 def SetItemSpan(*args):
0df68c9f 9971 """
248ed943
RD
9972 SetItemSpan(self, item, GBSpan span) -> bool
9973
9974 Set the row/col spanning of the specified *item* where *item* is
9975 either a window or subsizer that is a member of this sizer, or a
9976 zero-based index of an item. Returns True on success. If the move is
9977 not allowed (because an item is already there) then False is returned.
0df68c9f 9978 """
54f9ee45 9979 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
9980
9981 def FindItem(*args):
0df68c9f 9982 """
248ed943
RD
9983 FindItem(self, item) -> GBSizerItem
9984
9985 Find the sizer item for the given window or subsizer, returns None if
9986 not found. (non-recursive)
0df68c9f 9987 """
54f9ee45 9988 return _core_.GridBagSizer_FindItem(*args)
e811c8ce
RD
9989
9990 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
9991 """
9992 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
9993
9994 Return the sizer item for the given grid cell, or None if there is no
9995 item at that position. (non-recursive)
9996 """
54f9ee45 9997 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
9998
9999 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
10000 """
10001 FindItemAtPoint(self, Point pt) -> GBSizerItem
10002
10003 Return the sizer item located at the point given in *pt*, or None if
10004 there is no item at that point. The (x,y) coordinates in pt correspond
10005 to the client coordinates of the window using the sizer for
10006 layout. (non-recursive)
10007 """
54f9ee45 10008 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 10009
248ed943
RD
10010 def CheckForIntersection(*args, **kwargs):
10011 """
10012 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 10013
248ed943
RD
10014 Look at all items and see if any intersect (or would overlap) the
10015 given *item*. Returns True if so, False if there would be no overlap.
10016 If an *excludeItem* is given then it will not be checked for
10017 intersection, for example it may be the item we are checking the
10018 position of.
e811c8ce 10019
248ed943
RD
10020 """
10021 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 10022
248ed943 10023 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 10024 """
248ed943
RD
10025 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
10026
10027 Look at all items and see if any intersect (or would overlap) the
10028 given position and span. Returns True if so, False if there would be
10029 no overlap. If an *excludeItem* is given then it will not be checked
10030 for intersection, for example it may be the item we are checking the
10031 position of.
0df68c9f 10032 """
248ed943 10033 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 10034
d14a1e28
RD
10035
10036class GridBagSizerPtr(GridBagSizer):
10037 def __init__(self, this):
10038 self.this = this
10039 if not hasattr(self,"thisown"): self.thisown = 0
10040 self.__class__ = GridBagSizer
54f9ee45 10041_core_.GridBagSizer_swigregister(GridBagSizerPtr)
d14a1e28
RD
10042
10043#---------------------------------------------------------------------------
10044
54f9ee45
RD
10045Left = _core_.Left
10046Top = _core_.Top
10047Right = _core_.Right
10048Bottom = _core_.Bottom
10049Width = _core_.Width
10050Height = _core_.Height
10051Centre = _core_.Centre
10052Center = _core_.Center
10053CentreX = _core_.CentreX
10054CentreY = _core_.CentreY
10055Unconstrained = _core_.Unconstrained
10056AsIs = _core_.AsIs
10057PercentOf = _core_.PercentOf
10058Above = _core_.Above
10059Below = _core_.Below
10060LeftOf = _core_.LeftOf
10061RightOf = _core_.RightOf
10062SameAs = _core_.SameAs
10063Absolute = _core_.Absolute
d14a1e28 10064class IndividualLayoutConstraint(Object):
15afbcd0 10065 """
41e2b43e
RD
10066 Objects of this class are stored in the `wx.LayoutConstraints` class as
10067 one of eight possible constraints that a window can be involved in.
10068 You will never need to create an instance of
10069 wx.IndividualLayoutConstraint, rather you should create a
10070 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 10071 that it contains.
15afbcd0 10072 """
d14a1e28
RD
10073 def __init__(self): raise RuntimeError, "No constructor defined"
10074 def __repr__(self):
10075 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
e811c8ce 10076 def Set(*args, **kwargs):
41e2b43e
RD
10077 """
10078 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
10079
10080 Sets the properties of the constraint. Normally called by one of the
10081 convenience functions such as Above, RightOf, SameAs.
10082 """
54f9ee45 10083 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
10084
10085 def LeftOf(*args, **kwargs):
15afbcd0 10086 """
a95a7133 10087 LeftOf(self, Window sibling, int marg=0)
15afbcd0 10088
41e2b43e
RD
10089 Constrains this edge to be to the left of the given window, with an
10090 optional margin. Implicitly, this is relative to the left edge of the
10091 other window.
15afbcd0 10092 """
54f9ee45 10093 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
10094
10095 def RightOf(*args, **kwargs):
15afbcd0 10096 """
a95a7133 10097 RightOf(self, Window sibling, int marg=0)
15afbcd0 10098
41e2b43e
RD
10099 Constrains this edge to be to the right of the given window, with an
10100 optional margin. Implicitly, this is relative to the right edge of the
10101 other window.
15afbcd0 10102 """
54f9ee45 10103 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
10104
10105 def Above(*args, **kwargs):
15afbcd0 10106 """
a95a7133 10107 Above(self, Window sibling, int marg=0)
15afbcd0 10108
41e2b43e
RD
10109 Constrains this edge to be above the given window, with an optional
10110 margin. Implicitly, this is relative to the top edge of the other
10111 window.
15afbcd0 10112 """
54f9ee45 10113 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
10114
10115 def Below(*args, **kwargs):
15afbcd0 10116 """
a95a7133 10117 Below(self, Window sibling, int marg=0)
15afbcd0 10118
41e2b43e
RD
10119 Constrains this edge to be below the given window, with an optional
10120 margin. Implicitly, this is relative to the bottom edge of the other
10121 window.
15afbcd0 10122 """
54f9ee45 10123 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
10124
10125 def SameAs(*args, **kwargs):
15afbcd0 10126 """
a95a7133 10127 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 10128
41e2b43e
RD
10129 Constrains this edge or dimension to be to the same as the edge of the
10130 given window, with an optional margin.
15afbcd0 10131 """
54f9ee45 10132 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
10133
10134 def PercentOf(*args, **kwargs):
15afbcd0 10135 """
a95a7133 10136 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 10137
41e2b43e
RD
10138 Constrains this edge or dimension to be to a percentage of the given
10139 window, with an optional margin.
15afbcd0 10140 """
54f9ee45 10141 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
10142
10143 def Absolute(*args, **kwargs):
15afbcd0 10144 """
a95a7133 10145 Absolute(self, int val)
15afbcd0 10146
41e2b43e 10147 Constrains this edge or dimension to be the given absolute value.
15afbcd0 10148 """
54f9ee45 10149 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
10150
10151 def Unconstrained(*args, **kwargs):
15afbcd0 10152 """
a95a7133 10153 Unconstrained(self)
15afbcd0 10154
41e2b43e
RD
10155 Sets this edge or dimension to be unconstrained, that is, dependent on
10156 other edges and dimensions from which this value can be deduced.
15afbcd0 10157 """
54f9ee45 10158 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
10159
10160 def AsIs(*args, **kwargs):
15afbcd0 10161 """
a95a7133 10162 AsIs(self)
15afbcd0 10163
41e2b43e
RD
10164 Sets this edge or constraint to be whatever the window's value is at
10165 the moment. If either of the width and height constraints are *as is*,
10166 the window will not be resized, but moved instead. This is important
10167 when considering panel items which are intended to have a default
10168 size, such as a button, which may take its size from the size of the
10169 button label.
15afbcd0 10170 """
54f9ee45 10171 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
10172
10173 def GetOtherWindow(*args, **kwargs):
a95a7133 10174 """GetOtherWindow(self) -> Window"""
54f9ee45 10175 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
10176
10177 def GetMyEdge(*args, **kwargs):
a95a7133 10178 """GetMyEdge(self) -> int"""
54f9ee45 10179 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
10180
10181 def SetEdge(*args, **kwargs):
a95a7133 10182 """SetEdge(self, int which)"""
54f9ee45 10183 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
10184
10185 def SetValue(*args, **kwargs):
a95a7133 10186 """SetValue(self, int v)"""
54f9ee45 10187 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
10188
10189 def GetMargin(*args, **kwargs):
a95a7133 10190 """GetMargin(self) -> int"""
54f9ee45 10191 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
10192
10193 def SetMargin(*args, **kwargs):
a95a7133 10194 """SetMargin(self, int m)"""
54f9ee45 10195 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
10196
10197 def GetValue(*args, **kwargs):
a95a7133 10198 """GetValue(self) -> int"""
54f9ee45 10199 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
10200
10201 def GetPercent(*args, **kwargs):
a95a7133 10202 """GetPercent(self) -> int"""
54f9ee45 10203 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
10204
10205 def GetOtherEdge(*args, **kwargs):
a95a7133 10206 """GetOtherEdge(self) -> int"""
54f9ee45 10207 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
10208
10209 def GetDone(*args, **kwargs):
a95a7133 10210 """GetDone(self) -> bool"""
54f9ee45 10211 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
10212
10213 def SetDone(*args, **kwargs):
a95a7133 10214 """SetDone(self, bool d)"""
54f9ee45 10215 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
10216
10217 def GetRelationship(*args, **kwargs):
a95a7133 10218 """GetRelationship(self) -> int"""
54f9ee45 10219 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
10220
10221 def SetRelationship(*args, **kwargs):
a95a7133 10222 """SetRelationship(self, int r)"""
54f9ee45 10223 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
10224
10225 def ResetIfWin(*args, **kwargs):
15afbcd0 10226 """
a95a7133 10227 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
10228
10229 Reset constraint if it mentions otherWin
10230 """
54f9ee45 10231 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
10232
10233 def SatisfyConstraint(*args, **kwargs):
15afbcd0 10234 """
a95a7133 10235 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
10236
10237 Try to satisfy constraint
10238 """
54f9ee45 10239 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
10240
10241 def GetEdge(*args, **kwargs):
15afbcd0 10242 """
a95a7133 10243 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
10244
10245 Get the value of this edge or dimension, or if this
10246 is not determinable, -1.
10247 """
54f9ee45 10248 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 10249
d14a1e28
RD
10250
10251class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
10252 def __init__(self, this):
10253 self.this = this
10254 if not hasattr(self,"thisown"): self.thisown = 0
10255 self.__class__ = IndividualLayoutConstraint
54f9ee45 10256_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
d14a1e28
RD
10257
10258class LayoutConstraints(Object):
15afbcd0 10259 """
41e2b43e
RD
10260 **Note:** constraints are now deprecated and you should use sizers
10261 instead.
15afbcd0 10262
41e2b43e
RD
10263 Objects of this class can be associated with a window to define its
10264 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
10265
10266 The class consists of the following eight constraints of class
10267 wx.IndividualLayoutConstraint, some or all of which should be accessed
10268 directly to set the appropriate constraints.
10269
10270 * left: represents the left hand edge of the window
10271 * right: represents the right hand edge of the window
10272 * top: represents the top edge of the window
10273 * bottom: represents the bottom edge of the window
10274 * width: represents the width of the window
10275 * height: represents the height of the window
10276 * centreX: represents the horizontal centre point of the window
10277 * centreY: represents the vertical centre point of the window
10278
41e2b43e
RD
10279 Most constraints are initially set to have the relationship
10280 wxUnconstrained, which means that their values should be calculated by
10281 looking at known constraints. The exceptions are width and height,
10282 which are set to wxAsIs to ensure that if the user does not specify a
10283 constraint, the existing width and height will be used, to be
10284 compatible with panel items which often have take a default size. If
10285 the constraint is ``wx.AsIs``, the dimension will not be changed.
10286
10287 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
10288
10289 """
e811c8ce
RD
10290 def __repr__(self):
10291 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
54f9ee45
RD
10292 left = property(_core_.LayoutConstraints_left_get)
10293 top = property(_core_.LayoutConstraints_top_get)
10294 right = property(_core_.LayoutConstraints_right_get)
10295 bottom = property(_core_.LayoutConstraints_bottom_get)
10296 width = property(_core_.LayoutConstraints_width_get)
10297 height = property(_core_.LayoutConstraints_height_get)
10298 centreX = property(_core_.LayoutConstraints_centreX_get)
10299 centreY = property(_core_.LayoutConstraints_centreY_get)
d14a1e28 10300 def __init__(self, *args, **kwargs):
a95a7133 10301 """__init__(self) -> LayoutConstraints"""
54f9ee45 10302 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
d14a1e28
RD
10303 self.this = newobj.this
10304 self.thisown = 1
10305 del newobj.thisown
e811c8ce 10306 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 10307 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 10308 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
10309
10310 def AreSatisfied(*args, **kwargs):
a95a7133 10311 """AreSatisfied(self) -> bool"""
54f9ee45 10312 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 10313
d14a1e28
RD
10314
10315class LayoutConstraintsPtr(LayoutConstraints):
10316 def __init__(self, this):
10317 self.this = this
10318 if not hasattr(self,"thisown"): self.thisown = 0
10319 self.__class__ = LayoutConstraints
54f9ee45 10320_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
d14a1e28
RD
10321
10322#----------------------------------------------------------------------------
10323
322913ce 10324# Use Python's bool constants if available, make some if not
d14a1e28
RD
10325try:
10326 True
10327except NameError:
322913ce
RD
10328 __builtins__.True = 1==1
10329 __builtins__.False = 1==0
4f89f6a3
RD
10330 def bool(value): return not not value
10331 __builtins__.bool = bool
d14a1e28 10332
d14a1e28
RD
10333
10334
10335# workarounds for bad wxRTTI names
10336__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
10337__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
10338__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
10339
10340
10341#----------------------------------------------------------------------------
10342# Load version numbers from __version__... Ensure that major and minor
10343# versions are the same for both wxPython and wxWindows.
10344
10345from __version__ import *
10346__version__ = VERSION_STRING
10347
54f9ee45
RD
10348assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWindows version mismatch"
10349assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWindows version mismatch"
10350if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28
RD
10351 import warnings
10352 warnings.warn("wxPython/wxWindows release number mismatch")
10353
10354#----------------------------------------------------------------------------
10355
10356class PyDeadObjectError(AttributeError):
10357 pass
10358
d14a1e28
RD
10359class _wxPyDeadObject(object):
10360 """
10361 Instances of wx objects that are OOR capable will have their __class__
10362 changed to this class when the C++ object is deleted. This should help
10363 prevent crashes due to referencing a bogus C++ pointer.
10364 """
10365 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
10366 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
10367
3a04f143 10368 def __repr__(self):
d14a1e28
RD
10369 if not hasattr(self, "_name"):
10370 self._name = "[unknown]"
10371 return self.reprStr % self._name
10372
3a04f143 10373 def __getattr__(self, *args):
d14a1e28
RD
10374 if not hasattr(self, "_name"):
10375 self._name = "[unknown]"
3a04f143
RD
10376 raise PyDeadObjectError(self.attrStr % self._name)
10377
10378 def __nonzero__(self):
10379 return 0
10380
10381
10382
10383class PyUnbornObjectError(AttributeError):
10384 pass
10385
10386class _wxPyUnbornObject(object):
10387 """
54f9ee45 10388 Some stock objects are created when the wx._core module is
3a04f143
RD
10389 imported, but their C++ instance is not created until the wx.App
10390 object is created and initialized. These object instances will
10391 temporarily have their __class__ changed to this class so an
10392 exception will be raised if they are used before the C++ instance
10393 is ready.
10394 """
10395
10396 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
10397 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
10398
10399 def __repr__(self):
10400 #if not hasattr(self, "_name"):
10401 # self._name = "[unknown]"
10402 return self.reprStr #% self._name
10403
10404 def __getattr__(self, *args):
10405 #if not hasattr(self, "_name"):
10406 # self._name = "[unknown]"
10407 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
10408
10409 def __nonzero__(self):
10410 return 0
10411
10412
10413#----------------------------------------------------------------------------
10414_wxPyCallAfterId = None
10415
10416def CallAfter(callable, *args, **kw):
10417 """
10418 Call the specified function after the current and pending event
10419 handlers have been completed. This is also good for making GUI
61863841
RD
10420 method calls from non-GUI threads. Any extra positional or
10421 keyword args are passed on to the callable when it is called.
10422
10423 :see: `wx.FutureCall`
d14a1e28
RD
10424 """
10425 app = wx.GetApp()
dfbb5885 10426 assert app is not None, 'No wx.App created yet'
d14a1e28
RD
10427
10428 global _wxPyCallAfterId
10429 if _wxPyCallAfterId is None:
10430 _wxPyCallAfterId = wx.NewEventType()
10431 app.Connect(-1, -1, _wxPyCallAfterId,
10432 lambda event: event.callable(*event.args, **event.kw) )
10433 evt = wx.PyEvent()
10434 evt.SetEventType(_wxPyCallAfterId)
10435 evt.callable = callable
10436 evt.args = args
10437 evt.kw = kw
10438 wx.PostEvent(app, evt)
10439
10440
10441#----------------------------------------------------------------------------
10442
10443
10444class FutureCall:
10445 """
4276dc52 10446 A convenience class for wx.Timer, that calls the given callable
d14a1e28
RD
10447 object once after the given amount of milliseconds, passing any
10448 positional or keyword args. The return value of the callable is
61863841 10449 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
10450
10451 If you don't need to get the return value or restart the timer
10452 then there is no need to hold a reference to this object. It will
10453 hold a reference to itself while the timer is running (the timer
10454 has a reference to self.Notify) but the cycle will be broken when
10455 the timer completes, automatically cleaning up the wx.FutureCall
10456 object.
61863841
RD
10457
10458 :see: `wx.CallAfter`
d14a1e28
RD
10459 """
10460 def __init__(self, millis, callable, *args, **kwargs):
10461 self.millis = millis
10462 self.callable = callable
10463 self.SetArgs(*args, **kwargs)
10464 self.runCount = 0
4276dc52 10465 self.running = False
d14a1e28
RD
10466 self.hasRun = False
10467 self.result = None
10468 self.timer = None
10469 self.Start()
10470
10471 def __del__(self):
10472 self.Stop()
10473
10474
10475 def Start(self, millis=None, *args, **kwargs):
10476 """
10477 (Re)start the timer
10478 """
10479 self.hasRun = False
10480 if millis is not None:
10481 self.millis = millis
10482 if args or kwargs:
10483 self.SetArgs(*args, **kwargs)
10484 self.Stop()
10485 self.timer = wx.PyTimer(self.Notify)
10486 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 10487 self.running = True
d14a1e28
RD
10488 Restart = Start
10489
10490
10491 def Stop(self):
10492 """
10493 Stop and destroy the timer.
10494 """
10495 if self.timer is not None:
10496 self.timer.Stop()
10497 self.timer = None
10498
10499
10500 def GetInterval(self):
10501 if self.timer is not None:
10502 return self.timer.GetInterval()
10503 else:
10504 return 0
10505
10506
10507 def IsRunning(self):
10508 return self.timer is not None and self.timer.IsRunning()
10509
10510
10511 def SetArgs(self, *args, **kwargs):
10512 """
10513 (Re)set the args passed to the callable object. This is
10514 useful in conjunction with Restart if you want to schedule a
10515 new call to the same callable object but with different
10516 parameters.
10517 """
10518 self.args = args
10519 self.kwargs = kwargs
10520
10521
10522 def HasRun(self):
10523 return self.hasRun
10524
10525 def GetResult(self):
10526 return self.result
10527
10528 def Notify(self):
10529 """
10530 The timer has expired so call the callable.
10531 """
10532 if self.callable and getattr(self.callable, 'im_self', True):
10533 self.runCount += 1
4276dc52 10534 self.running = False
d14a1e28
RD
10535 self.result = self.callable(*self.args, **self.kwargs)
10536 self.hasRun = True
4276dc52
RD
10537 if not self.running:
10538 # if it wasn't restarted, then cleanup
10539 wx.CallAfter(self.Stop)
d14a1e28
RD
10540
10541
a95a7133
RD
10542
10543#----------------------------------------------------------------------------
10544# Control which items in this module should be documented by epydoc.
10545# We allow only classes and functions, which will help reduce the size
10546# of the docs by filtering out the zillions of constants, EVT objects,
10547# and etc that don't make much sense by themselves, but are instead
10548# documented (or will be) as part of the classes/functions/methods
10549# where they should be used.
10550
66c033b4
RD
10551class __DocFilter:
10552 """
10553 A filter for epydoc that only allows non-Ptr classes and
10554 fucntions, in order to reduce the clutter in the API docs.
10555 """
10556 def __init__(self, globals):
10557 self._globals = globals
10558
10559 def __call__(self, name):
10560 import types
10561 obj = self._globals.get(name, None)
10562 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
10563 return False
10564 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
10565 return False
10566 return True
a95a7133 10567
d14a1e28
RD
10568#----------------------------------------------------------------------------
10569#----------------------------------------------------------------------------
10570
10571# Import other modules in this package that should show up in the
10572# "core" wx namespace
54f9ee45
RD
10573from _gdi import *
10574from _windows import *
10575from _controls import *
10576from _misc import *
d14a1e28 10577
3a04f143
RD
10578
10579# Fixup the stock objects since they can't be used yet. (They will be
10580# restored in wx.PyApp.OnInit.)
54f9ee45 10581_core_._wxPyFixStockObjects()
3a04f143 10582
d14a1e28
RD
10583#----------------------------------------------------------------------------
10584#----------------------------------------------------------------------------
10585
10586