]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/msw/_core.py
Remove wrappers for some functions meant to be interal use only.
[wxWidgets.git] / wxPython / src / msw / _core.py
CommitLineData
d55e5bfc
RD
1# This file was created automatically by SWIG.
2# Don't modify this file, modify the SWIG interface instead.
3
4import _core_
5
6#// Give a reference to the dictionary of this module to the C++ extension
7#// code.
8_core_._wxPySetDictionary(vars())
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
c24da6d6
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
d55e5bfc
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
550#---------------------------------------------------------------------------
551
552class Object(object):
553 """
554 The base class for most wx objects, although in wxPython not
555 much functionality is needed nor exposed.
556 """
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,)
560 def GetClassName(*args, **kwargs):
561 """
562 GetClassName(self) -> String
563
564 Returns the class name of the C++ class using wxRTTI.
565 """
566 return _core_.Object_GetClassName(*args, **kwargs)
567
568 def Destroy(*args, **kwargs):
569 """
570 Destroy(self)
571
572 Deletes the C++ object this Python object is a proxy for.
573 """
574 return _core_.Object_Destroy(*args, **kwargs)
575
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
582_core_.Object_swigregister(ObjectPtr)
583_wxPySetDictionary = _core_._wxPySetDictionary
584
585_wxPyFixStockObjects = _core_._wxPyFixStockObjects
586
587cvar = _core_.cvar
588EmptyString = cvar.EmptyString
589
590#---------------------------------------------------------------------------
591
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
643#---------------------------------------------------------------------------
644
645class Size(object):
646 """
79fccf9d
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.
d55e5bfc
RD
651 """
652 def __repr__(self):
653 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
654 width = property(_core_.Size_width_get, _core_.Size_width_set)
655 height = property(_core_.Size_height_get, _core_.Size_height_set)
656 x = width; y = height
657 def __init__(self, *args, **kwargs):
658 """
659 __init__(self, int w=0, int h=0) -> Size
660
661 Creates a size object.
662 """
663 newobj = _core_.new_Size(*args, **kwargs)
664 self.this = newobj.this
665 self.thisown = 1
666 del newobj.thisown
667 def __del__(self, destroy=_core_.delete_Size):
668 """__del__(self)"""
669 try:
670 if self.thisown: destroy(self)
671 except: pass
672
673 def __eq__(*args, **kwargs):
674 """
675 __eq__(self, Size sz) -> bool
676
677 Test for equality of wx.Size objects.
678 """
679 return _core_.Size___eq__(*args, **kwargs)
680
681 def __ne__(*args, **kwargs):
682 """
683 __ne__(self, Size sz) -> bool
684
685 Test for inequality.
686 """
687 return _core_.Size___ne__(*args, **kwargs)
688
689 def __add__(*args, **kwargs):
690 """
691 __add__(self, Size sz) -> Size
692
693 Add sz's proprties to this and return the result.
694 """
695 return _core_.Size___add__(*args, **kwargs)
696
697 def __sub__(*args, **kwargs):
698 """
699 __sub__(self, Size sz) -> Size
700
701 Subtract sz's properties from this and return the result.
702 """
703 return _core_.Size___sub__(*args, **kwargs)
704
705 def IncTo(*args, **kwargs):
706 """
707 IncTo(self, Size sz)
708
709 Increments this object so that both of its dimensions are not less
710 than the corresponding dimensions of the size.
711 """
712 return _core_.Size_IncTo(*args, **kwargs)
713
714 def DecTo(*args, **kwargs):
715 """
716 DecTo(self, Size sz)
717
718 Decrements this object so that both of its dimensions are not greater
719 than the corresponding dimensions of the size.
720 """
721 return _core_.Size_DecTo(*args, **kwargs)
722
723 def Set(*args, **kwargs):
724 """
725 Set(self, int w, int h)
726
727 Set both width and height.
728 """
729 return _core_.Size_Set(*args, **kwargs)
730
731 def SetWidth(*args, **kwargs):
732 """SetWidth(self, int w)"""
733 return _core_.Size_SetWidth(*args, **kwargs)
734
735 def SetHeight(*args, **kwargs):
736 """SetHeight(self, int h)"""
737 return _core_.Size_SetHeight(*args, **kwargs)
738
739 def GetWidth(*args, **kwargs):
740 """GetWidth(self) -> int"""
741 return _core_.Size_GetWidth(*args, **kwargs)
742
743 def GetHeight(*args, **kwargs):
744 """GetHeight(self) -> int"""
745 return _core_.Size_GetHeight(*args, **kwargs)
746
747 def IsFullySpecified(*args, **kwargs):
748 """
749 IsFullySpecified(self) -> bool
750
751 Returns True if both components of the size are non-default values.
752 """
753 return _core_.Size_IsFullySpecified(*args, **kwargs)
754
755 def SetDefaults(*args, **kwargs):
756 """
757 SetDefaults(self, Size size)
758
79fccf9d
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.
d55e5bfc
RD
761 """
762 return _core_.Size_SetDefaults(*args, **kwargs)
763
764 def Get(*args, **kwargs):
765 """
766 Get() -> (width,height)
767
768 Returns the width and height properties as a tuple.
769 """
770 return _core_.Size_Get(*args, **kwargs)
771
79fccf9d 772 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
777 def __setitem__(self, index, val):
778 if index == 0: self.width = val
779 elif index == 1: self.height = val
780 else: raise IndexError
781 def __nonzero__(self): return self.Get() != (0,0)
782 __safe_for_unpickling__ = True
783 def __reduce__(self): return (wx.Size, self.Get())
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
791_core_.Size_swigregister(SizePtr)
792
793#---------------------------------------------------------------------------
794
795class RealPoint(object):
796 """
79fccf9d
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.
d55e5bfc
RD
800 """
801 def __repr__(self):
802 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
803 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
804 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
805 def __init__(self, *args, **kwargs):
806 """
807 __init__(self, double x=0.0, double y=0.0) -> RealPoint
808
809 Create a wx.RealPoint object
810 """
811 newobj = _core_.new_RealPoint(*args, **kwargs)
812 self.this = newobj.this
813 self.thisown = 1
814 del newobj.thisown
815 def __del__(self, destroy=_core_.delete_RealPoint):
816 """__del__(self)"""
817 try:
818 if self.thisown: destroy(self)
819 except: pass
820
821 def __eq__(*args, **kwargs):
822 """
823 __eq__(self, RealPoint pt) -> bool
824
825 Test for equality of wx.RealPoint objects.
826 """
827 return _core_.RealPoint___eq__(*args, **kwargs)
828
829 def __ne__(*args, **kwargs):
830 """
831 __ne__(self, RealPoint pt) -> bool
832
833 Test for inequality of wx.RealPoint objects.
834 """
835 return _core_.RealPoint___ne__(*args, **kwargs)
836
837 def __add__(*args, **kwargs):
838 """
839 __add__(self, RealPoint pt) -> RealPoint
840
841 Add pt's proprties to this and return the result.
842 """
843 return _core_.RealPoint___add__(*args, **kwargs)
844
845 def __sub__(*args, **kwargs):
846 """
847 __sub__(self, RealPoint pt) -> RealPoint
848
849 Subtract pt's proprties from this and return the result
850 """
851 return _core_.RealPoint___sub__(*args, **kwargs)
852
853 def Set(*args, **kwargs):
854 """
855 Set(self, double x, double y)
856
857 Set both the x and y properties
858 """
859 return _core_.RealPoint_Set(*args, **kwargs)
860
861 def Get(*args, **kwargs):
862 """
863 Get() -> (x,y)
864
865 Return the x and y properties as a tuple.
866 """
867 return _core_.RealPoint_Get(*args, **kwargs)
868
79fccf9d 869 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
874 def __setitem__(self, index, val):
875 if index == 0: self.x = val
876 elif index == 1: self.y = val
877 else: raise IndexError
878 def __nonzero__(self): return self.Get() != (0.0, 0.0)
879 __safe_for_unpickling__ = True
880 def __reduce__(self): return (wx.RealPoint, self.Get())
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
888_core_.RealPoint_swigregister(RealPointPtr)
889
890#---------------------------------------------------------------------------
891
892class Point(object):
893 """
79fccf9d
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.
d55e5bfc
RD
897 """
898 def __repr__(self):
899 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
900 x = property(_core_.Point_x_get, _core_.Point_x_set)
901 y = property(_core_.Point_y_get, _core_.Point_y_set)
902 def __init__(self, *args, **kwargs):
903 """
904 __init__(self, int x=0, int y=0) -> Point
905
906 Create a wx.Point object
907 """
908 newobj = _core_.new_Point(*args, **kwargs)
909 self.this = newobj.this
910 self.thisown = 1
911 del newobj.thisown
912 def __del__(self, destroy=_core_.delete_Point):
913 """__del__(self)"""
914 try:
915 if self.thisown: destroy(self)
916 except: pass
917
918 def __eq__(*args, **kwargs):
919 """
920 __eq__(self, Point pt) -> bool
921
922 Test for equality of wx.Point objects.
923 """
924 return _core_.Point___eq__(*args, **kwargs)
925
926 def __ne__(*args, **kwargs):
927 """
928 __ne__(self, Point pt) -> bool
929
930 Test for inequality of wx.Point objects.
931 """
932 return _core_.Point___ne__(*args, **kwargs)
933
934 def __add__(*args, **kwargs):
935 """
936 __add__(self, Point pt) -> Point
937
938 Add pt's proprties to this and return the result.
939 """
940 return _core_.Point___add__(*args, **kwargs)
941
942 def __sub__(*args, **kwargs):
943 """
944 __sub__(self, Point pt) -> Point
945
946 Subtract pt's proprties from this and return the result
947 """
948 return _core_.Point___sub__(*args, **kwargs)
949
950 def __iadd__(*args, **kwargs):
951 """
952 __iadd__(self, Point pt) -> Point
953
954 Add pt to this object.
955 """
956 return _core_.Point___iadd__(*args, **kwargs)
957
958 def __isub__(*args, **kwargs):
959 """
960 __isub__(self, Point pt) -> Point
961
962 Subtract pt from this object.
963 """
964 return _core_.Point___isub__(*args, **kwargs)
965
966 def Set(*args, **kwargs):
967 """
968 Set(self, long x, long y)
969
970 Set both the x and y properties
971 """
972 return _core_.Point_Set(*args, **kwargs)
973
974 def Get(*args, **kwargs):
975 """
976 Get() -> (x,y)
977
978 Return the x and y properties as a tuple.
979 """
980 return _core_.Point_Get(*args, **kwargs)
981
79fccf9d 982 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
987 def __setitem__(self, index, val):
988 if index == 0: self.x = val
989 elif index == 1: self.y = val
990 else: raise IndexError
991 def __nonzero__(self): return self.Get() != (0,0)
992 __safe_for_unpickling__ = True
993 def __reduce__(self): return (wx.Point, self.Get())
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
1001_core_.Point_swigregister(PointPtr)
1002
1003#---------------------------------------------------------------------------
1004
1005class Rect(object):
1006 """
79fccf9d
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.
d55e5bfc
RD
1010 """
1011 def __repr__(self):
1012 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1013 def __init__(self, *args, **kwargs):
1014 """
1015 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1016
1017 Create a new Rect object.
1018 """
1019 newobj = _core_.new_Rect(*args, **kwargs)
1020 self.this = newobj.this
1021 self.thisown = 1
1022 del newobj.thisown
1023 def __del__(self, destroy=_core_.delete_Rect):
1024 """__del__(self)"""
1025 try:
1026 if self.thisown: destroy(self)
1027 except: pass
1028
1029 def GetX(*args, **kwargs):
1030 """GetX(self) -> int"""
1031 return _core_.Rect_GetX(*args, **kwargs)
1032
1033 def SetX(*args, **kwargs):
1034 """SetX(self, int x)"""
1035 return _core_.Rect_SetX(*args, **kwargs)
1036
1037 def GetY(*args, **kwargs):
1038 """GetY(self) -> int"""
1039 return _core_.Rect_GetY(*args, **kwargs)
1040
1041 def SetY(*args, **kwargs):
1042 """SetY(self, int y)"""
1043 return _core_.Rect_SetY(*args, **kwargs)
1044
1045 def GetWidth(*args, **kwargs):
1046 """GetWidth(self) -> int"""
1047 return _core_.Rect_GetWidth(*args, **kwargs)
1048
1049 def SetWidth(*args, **kwargs):
1050 """SetWidth(self, int w)"""
1051 return _core_.Rect_SetWidth(*args, **kwargs)
1052
1053 def GetHeight(*args, **kwargs):
1054 """GetHeight(self) -> int"""
1055 return _core_.Rect_GetHeight(*args, **kwargs)
1056
1057 def SetHeight(*args, **kwargs):
1058 """SetHeight(self, int h)"""
1059 return _core_.Rect_SetHeight(*args, **kwargs)
1060
1061 def GetPosition(*args, **kwargs):
1062 """GetPosition(self) -> Point"""
1063 return _core_.Rect_GetPosition(*args, **kwargs)
1064
1065 def SetPosition(*args, **kwargs):
1066 """SetPosition(self, Point p)"""
1067 return _core_.Rect_SetPosition(*args, **kwargs)
1068
1069 def GetSize(*args, **kwargs):
1070 """GetSize(self) -> Size"""
1071 return _core_.Rect_GetSize(*args, **kwargs)
1072
1073 def SetSize(*args, **kwargs):
1074 """SetSize(self, Size s)"""
1075 return _core_.Rect_SetSize(*args, **kwargs)
1076
1077 def GetTopLeft(*args, **kwargs):
1078 """GetTopLeft(self) -> Point"""
1079 return _core_.Rect_GetTopLeft(*args, **kwargs)
1080
1081 def SetTopLeft(*args, **kwargs):
1082 """SetTopLeft(self, Point p)"""
1083 return _core_.Rect_SetTopLeft(*args, **kwargs)
1084
1085 def GetBottomRight(*args, **kwargs):
1086 """GetBottomRight(self) -> Point"""
1087 return _core_.Rect_GetBottomRight(*args, **kwargs)
1088
1089 def SetBottomRight(*args, **kwargs):
1090 """SetBottomRight(self, Point p)"""
1091 return _core_.Rect_SetBottomRight(*args, **kwargs)
1092
1093 def GetLeft(*args, **kwargs):
1094 """GetLeft(self) -> int"""
1095 return _core_.Rect_GetLeft(*args, **kwargs)
1096
1097 def GetTop(*args, **kwargs):
1098 """GetTop(self) -> int"""
1099 return _core_.Rect_GetTop(*args, **kwargs)
1100
1101 def GetBottom(*args, **kwargs):
1102 """GetBottom(self) -> int"""
1103 return _core_.Rect_GetBottom(*args, **kwargs)
1104
1105 def GetRight(*args, **kwargs):
1106 """GetRight(self) -> int"""
1107 return _core_.Rect_GetRight(*args, **kwargs)
1108
1109 def SetLeft(*args, **kwargs):
1110 """SetLeft(self, int left)"""
1111 return _core_.Rect_SetLeft(*args, **kwargs)
1112
1113 def SetRight(*args, **kwargs):
1114 """SetRight(self, int right)"""
1115 return _core_.Rect_SetRight(*args, **kwargs)
1116
1117 def SetTop(*args, **kwargs):
1118 """SetTop(self, int top)"""
1119 return _core_.Rect_SetTop(*args, **kwargs)
1120
1121 def SetBottom(*args, **kwargs):
1122 """SetBottom(self, int bottom)"""
1123 return _core_.Rect_SetBottom(*args, **kwargs)
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):
1133 """
1134 Inflate(self, int dx, int dy) -> Rect
1135
79fccf9d
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.
d55e5bfc
RD
1139 """
1140 return _core_.Rect_Inflate(*args, **kwargs)
1141
1142 def Deflate(*args, **kwargs):
1143 """
1144 Deflate(self, int dx, int dy) -> Rect
1145
79fccf9d
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.
d55e5bfc
RD
1149 """
1150 return _core_.Rect_Deflate(*args, **kwargs)
1151
1152 def OffsetXY(*args, **kwargs):
1153 """
1154 OffsetXY(self, int dx, int dy)
1155
79fccf9d
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.
d55e5bfc
RD
1159 """
1160 return _core_.Rect_OffsetXY(*args, **kwargs)
1161
1162 def Offset(*args, **kwargs):
1163 """
1164 Offset(self, Point pt)
1165
1166 Same as OffsetXY but uses dx,dy from Point
1167 """
1168 return _core_.Rect_Offset(*args, **kwargs)
1169
1170 def Intersect(*args, **kwargs):
1171 """
1172 Intersect(self, Rect rect) -> Rect
1173
1174 Return the intersectsion of this rectangle and rect.
1175 """
1176 return _core_.Rect_Intersect(*args, **kwargs)
1177
1178 def __add__(*args, **kwargs):
1179 """
1180 __add__(self, Rect rect) -> Rect
1181
1182 Add the properties of rect to this rectangle and return the result.
1183 """
1184 return _core_.Rect___add__(*args, **kwargs)
1185
1186 def __iadd__(*args, **kwargs):
1187 """
1188 __iadd__(self, Rect rect) -> Rect
1189
1190 Add the properties of rect to this rectangle, updating this rectangle.
1191 """
1192 return _core_.Rect___iadd__(*args, **kwargs)
1193
1194 def __eq__(*args, **kwargs):
1195 """
1196 __eq__(self, Rect rect) -> bool
1197
1198 Test for equality.
1199 """
1200 return _core_.Rect___eq__(*args, **kwargs)
1201
1202 def __ne__(*args, **kwargs):
1203 """
1204 __ne__(self, Rect rect) -> bool
1205
1206 Test for inequality.
1207 """
1208 return _core_.Rect___ne__(*args, **kwargs)
1209
1210 def InsideXY(*args, **kwargs):
1211 """
1212 InsideXY(self, int x, int y) -> bool
1213
1214 Return True if the point is (not strcitly) inside the rect.
1215 """
1216 return _core_.Rect_InsideXY(*args, **kwargs)
1217
1218 def Inside(*args, **kwargs):
1219 """
1220 Inside(self, Point pt) -> bool
1221
1222 Return True if the point is (not strcitly) inside the rect.
1223 """
1224 return _core_.Rect_Inside(*args, **kwargs)
1225
1226 def Intersects(*args, **kwargs):
1227 """
1228 Intersects(self, Rect rect) -> bool
1229
1230 Returns True if the rectangles have a non empty intersection.
1231 """
1232 return _core_.Rect_Intersects(*args, **kwargs)
1233
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)
1238 def Set(*args, **kwargs):
1239 """
1240 Set(self, int x=0, int y=0, int width=0, int height=0)
1241
1242 Set all rectangle properties.
1243 """
1244 return _core_.Rect_Set(*args, **kwargs)
1245
1246 def Get(*args, **kwargs):
1247 """
1248 Get() -> (x,y,width,height)
1249
1250 Return the rectangle properties as a tuple.
1251 """
1252 return _core_.Rect_Get(*args, **kwargs)
1253
79fccf9d 1254 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
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
1265 def __nonzero__(self): return self.Get() != (0,0,0,0)
1266 __safe_for_unpickling__ = True
1267 def __reduce__(self): return (wx.Rect, self.Get())
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
1275_core_.Rect_swigregister(RectPtr)
1276
1277def RectPP(*args, **kwargs):
1278 """
1279 RectPP(Point topLeft, Point bottomRight) -> Rect
1280
1281 Create a new Rect object from Points representing two corners.
1282 """
1283 val = _core_.new_RectPP(*args, **kwargs)
1284 val.thisown = 1
1285 return val
1286
1287def RectPS(*args, **kwargs):
1288 """
1289 RectPS(Point pos, Size size) -> Rect
1290
1291 Create a new Rect from a position and size.
1292 """
1293 val = _core_.new_RectPS(*args, **kwargs)
1294 val.thisown = 1
1295 return val
1296
1297
1298def IntersectRect(*args, **kwargs):
1299 """
1300 IntersectRect(Rect r1, Rect r2) -> Rect
1301
1302 Calculate and return the intersection of r1 and r2.
1303 """
1304 return _core_.IntersectRect(*args, **kwargs)
1305#---------------------------------------------------------------------------
1306
1307class Point2D(object):
79fccf9d
RD
1308 """
1309 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1310 with floating point values.
1311 """
d55e5bfc
RD
1312 def __repr__(self):
1313 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1314 def __init__(self, *args, **kwargs):
1315 """
1316 __init__(self, double x=0.0, double y=0.0) -> Point2D
1317
1318 Create a w.Point2D object.
1319 """
1320 newobj = _core_.new_Point2D(*args, **kwargs)
1321 self.this = newobj.this
1322 self.thisown = 1
1323 del newobj.thisown
1324 def GetFloor(*args, **kwargs):
a8eff060
RD
1325 """
1326 GetFloor() -> (x,y)
1327
1328 Convert to integer
1329 """
d55e5bfc
RD
1330 return _core_.Point2D_GetFloor(*args, **kwargs)
1331
1332 def GetRounded(*args, **kwargs):
a8eff060
RD
1333 """
1334 GetRounded() -> (x,y)
1335
1336 Convert to integer
1337 """
d55e5bfc
RD
1338 return _core_.Point2D_GetRounded(*args, **kwargs)
1339
1340 def GetVectorLength(*args, **kwargs):
1341 """GetVectorLength(self) -> double"""
1342 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1343
1344 def GetVectorAngle(*args, **kwargs):
1345 """GetVectorAngle(self) -> double"""
1346 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1347
1348 def SetVectorLength(*args, **kwargs):
1349 """SetVectorLength(self, double length)"""
1350 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1351
1352 def SetVectorAngle(*args, **kwargs):
1353 """SetVectorAngle(self, double degrees)"""
1354 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1355
1356 def SetPolarCoordinates(self, angle, length):
1357 self.SetVectorLength(length)
1358 self.SetVectorAngle(angle)
1359 def Normalize(self):
1360 self.SetVectorLength(1.0)
1361
1362 def GetDistance(*args, **kwargs):
1363 """GetDistance(self, Point2D pt) -> double"""
1364 return _core_.Point2D_GetDistance(*args, **kwargs)
1365
1366 def GetDistanceSquare(*args, **kwargs):
1367 """GetDistanceSquare(self, Point2D pt) -> double"""
1368 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1369
1370 def GetDotProduct(*args, **kwargs):
1371 """GetDotProduct(self, Point2D vec) -> double"""
1372 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1373
1374 def GetCrossProduct(*args, **kwargs):
1375 """GetCrossProduct(self, Point2D vec) -> double"""
1376 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1377
1378 def __neg__(*args, **kwargs):
1379 """
1380 __neg__(self) -> Point2D
1381
1382 the reflection of this point
1383 """
1384 return _core_.Point2D___neg__(*args, **kwargs)
1385
1386 def __iadd__(*args, **kwargs):
1387 """__iadd__(self, Point2D pt) -> Point2D"""
1388 return _core_.Point2D___iadd__(*args, **kwargs)
1389
1390 def __isub__(*args, **kwargs):
1391 """__isub__(self, Point2D pt) -> Point2D"""
1392 return _core_.Point2D___isub__(*args, **kwargs)
1393
1394 def __imul__(*args, **kwargs):
1395 """__imul__(self, Point2D pt) -> Point2D"""
1396 return _core_.Point2D___imul__(*args, **kwargs)
1397
1398 def __idiv__(*args, **kwargs):
1399 """__idiv__(self, Point2D pt) -> Point2D"""
1400 return _core_.Point2D___idiv__(*args, **kwargs)
1401
1402 def __eq__(*args, **kwargs):
1403 """
1404 __eq__(self, Point2D pt) -> bool
1405
1406 Test for equality
1407 """
1408 return _core_.Point2D___eq__(*args, **kwargs)
1409
1410 def __ne__(*args, **kwargs):
1411 """
1412 __ne__(self, Point2D pt) -> bool
1413
1414 Test for inequality
1415 """
1416 return _core_.Point2D___ne__(*args, **kwargs)
1417
1418 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1419 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1420 def Set(*args, **kwargs):
1421 """Set(self, double x=0, double y=0)"""
1422 return _core_.Point2D_Set(*args, **kwargs)
1423
1424 def Get(*args, **kwargs):
1425 """
1426 Get() -> (x,y)
1427
1428 Return x and y properties as a tuple.
1429 """
1430 return _core_.Point2D_Get(*args, **kwargs)
1431
79fccf9d 1432 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
1437 def __setitem__(self, index, val):
1438 if index == 0: self.x = val
1439 elif index == 1: self.y = val
1440 else: raise IndexError
1441 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1442 __safe_for_unpickling__ = True
1443 def __reduce__(self): return (wx.Point2D, self.Get())
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
1451_core_.Point2D_swigregister(Point2DPtr)
1452
1453def Point2DCopy(*args, **kwargs):
1454 """
1455 Point2DCopy(Point2D pt) -> Point2D
1456
1457 Create a w.Point2D object.
1458 """
1459 val = _core_.new_Point2DCopy(*args, **kwargs)
1460 val.thisown = 1
1461 return val
1462
1463def Point2DFromPoint(*args, **kwargs):
1464 """
1465 Point2DFromPoint(Point pt) -> Point2D
1466
1467 Create a w.Point2D object.
1468 """
1469 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1470 val.thisown = 1
1471 return val
1472
1473#---------------------------------------------------------------------------
1474
1475FromStart = _core_.FromStart
1476FromCurrent = _core_.FromCurrent
1477FromEnd = _core_.FromEnd
1478class InputStream(object):
1479 def __repr__(self):
1480 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1481 def __init__(self, *args, **kwargs):
1482 """__init__(self, PyObject p) -> InputStream"""
1483 newobj = _core_.new_InputStream(*args, **kwargs)
1484 self.this = newobj.this
1485 self.thisown = 1
1486 del newobj.thisown
1487 def close(*args, **kwargs):
1488 """close(self)"""
1489 return _core_.InputStream_close(*args, **kwargs)
1490
1491 def flush(*args, **kwargs):
1492 """flush(self)"""
1493 return _core_.InputStream_flush(*args, **kwargs)
1494
1495 def eof(*args, **kwargs):
1496 """eof(self) -> bool"""
1497 return _core_.InputStream_eof(*args, **kwargs)
1498
1499 def read(*args, **kwargs):
1500 """read(self, int size=-1) -> PyObject"""
1501 return _core_.InputStream_read(*args, **kwargs)
1502
1503 def readline(*args, **kwargs):
1504 """readline(self, int size=-1) -> PyObject"""
1505 return _core_.InputStream_readline(*args, **kwargs)
1506
1507 def readlines(*args, **kwargs):
1508 """readlines(self, int sizehint=-1) -> PyObject"""
1509 return _core_.InputStream_readlines(*args, **kwargs)
1510
1511 def seek(*args, **kwargs):
1512 """seek(self, int offset, int whence=0)"""
1513 return _core_.InputStream_seek(*args, **kwargs)
1514
1515 def tell(*args, **kwargs):
1516 """tell(self) -> int"""
1517 return _core_.InputStream_tell(*args, **kwargs)
1518
1519 def Peek(*args, **kwargs):
1520 """Peek(self) -> char"""
1521 return _core_.InputStream_Peek(*args, **kwargs)
1522
1523 def GetC(*args, **kwargs):
1524 """GetC(self) -> char"""
1525 return _core_.InputStream_GetC(*args, **kwargs)
1526
1527 def LastRead(*args, **kwargs):
1528 """LastRead(self) -> size_t"""
1529 return _core_.InputStream_LastRead(*args, **kwargs)
1530
1531 def CanRead(*args, **kwargs):
1532 """CanRead(self) -> bool"""
1533 return _core_.InputStream_CanRead(*args, **kwargs)
1534
1535 def Eof(*args, **kwargs):
1536 """Eof(self) -> bool"""
1537 return _core_.InputStream_Eof(*args, **kwargs)
1538
1539 def Ungetch(*args, **kwargs):
1540 """Ungetch(self, char c) -> bool"""
1541 return _core_.InputStream_Ungetch(*args, **kwargs)
1542
1543 def SeekI(*args, **kwargs):
1544 """SeekI(self, long pos, int mode=FromStart) -> long"""
1545 return _core_.InputStream_SeekI(*args, **kwargs)
1546
1547 def TellI(*args, **kwargs):
1548 """TellI(self) -> long"""
1549 return _core_.InputStream_TellI(*args, **kwargs)
1550
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
1557_core_.InputStream_swigregister(InputStreamPtr)
1558DefaultPosition = cvar.DefaultPosition
1559DefaultSize = cvar.DefaultSize
1560
1561class OutputStream(object):
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,)
1565 def write(*args, **kwargs):
1566 """write(self, PyObject obj)"""
1567 return _core_.OutputStream_write(*args, **kwargs)
1568
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
1575_core_.OutputStream_swigregister(OutputStreamPtr)
1576
1577#---------------------------------------------------------------------------
1578
1579class FSFile(Object):
1580 def __repr__(self):
1581 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1582 def __init__(self, *args, **kwargs):
1583 """
1584 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1585 DateTime modif) -> FSFile
1586 """
1587 newobj = _core_.new_FSFile(*args, **kwargs)
1588 self.this = newobj.this
1589 self.thisown = 1
1590 del newobj.thisown
4cf4100f
RD
1591 self.thisown = 0 # It will normally be deleted by the user of the wxFileSystem
1592
d55e5bfc
RD
1593 def __del__(self, destroy=_core_.delete_FSFile):
1594 """__del__(self)"""
1595 try:
1596 if self.thisown: destroy(self)
1597 except: pass
1598
1599 def GetStream(*args, **kwargs):
1600 """GetStream(self) -> InputStream"""
1601 return _core_.FSFile_GetStream(*args, **kwargs)
1602
1603 def GetMimeType(*args, **kwargs):
1604 """GetMimeType(self) -> String"""
1605 return _core_.FSFile_GetMimeType(*args, **kwargs)
1606
1607 def GetLocation(*args, **kwargs):
1608 """GetLocation(self) -> String"""
1609 return _core_.FSFile_GetLocation(*args, **kwargs)
1610
1611 def GetAnchor(*args, **kwargs):
1612 """GetAnchor(self) -> String"""
1613 return _core_.FSFile_GetAnchor(*args, **kwargs)
1614
1615 def GetModificationTime(*args, **kwargs):
1616 """GetModificationTime(self) -> DateTime"""
1617 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1618
1619
1620class FSFilePtr(FSFile):
1621 def __init__(self, this):
1622 self.this = this
1623 if not hasattr(self,"thisown"): self.thisown = 0
1624 self.__class__ = FSFile
1625_core_.FSFile_swigregister(FSFilePtr)
1626
1627class CPPFileSystemHandler(object):
1628 def __init__(self): raise RuntimeError, "No constructor defined"
1629 def __repr__(self):
1630 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1631
1632class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1633 def __init__(self, this):
1634 self.this = this
1635 if not hasattr(self,"thisown"): self.thisown = 0
1636 self.__class__ = CPPFileSystemHandler
1637_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
1638
1639class FileSystemHandler(CPPFileSystemHandler):
1640 def __repr__(self):
1641 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1642 def __init__(self, *args, **kwargs):
1643 """__init__(self) -> FileSystemHandler"""
1644 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
1645 self.this = newobj.this
1646 self.thisown = 1
1647 del newobj.thisown
1648 self._setCallbackInfo(self, FileSystemHandler)
1649
1650 def _setCallbackInfo(*args, **kwargs):
1651 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1652 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1653
1654 def CanOpen(*args, **kwargs):
1655 """CanOpen(self, String location) -> bool"""
1656 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1657
1658 def OpenFile(*args, **kwargs):
1659 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1660 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1661
1662 def FindFirst(*args, **kwargs):
1663 """FindFirst(self, String spec, int flags=0) -> String"""
1664 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1665
1666 def FindNext(*args, **kwargs):
1667 """FindNext(self) -> String"""
1668 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1669
1670 def GetProtocol(*args, **kwargs):
1671 """GetProtocol(self, String location) -> String"""
1672 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1673
1674 def GetLeftLocation(*args, **kwargs):
1675 """GetLeftLocation(self, String location) -> String"""
1676 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1677
1678 def GetAnchor(*args, **kwargs):
1679 """GetAnchor(self, String location) -> String"""
1680 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1681
1682 def GetRightLocation(*args, **kwargs):
1683 """GetRightLocation(self, String location) -> String"""
1684 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1685
1686 def GetMimeTypeFromExt(*args, **kwargs):
1687 """GetMimeTypeFromExt(self, String location) -> String"""
1688 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1689
1690
1691class FileSystemHandlerPtr(FileSystemHandler):
1692 def __init__(self, this):
1693 self.this = this
1694 if not hasattr(self,"thisown"): self.thisown = 0
1695 self.__class__ = FileSystemHandler
1696_core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
1697
1698class FileSystem(Object):
1699 def __repr__(self):
1700 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1701 def __init__(self, *args, **kwargs):
1702 """__init__(self) -> FileSystem"""
1703 newobj = _core_.new_FileSystem(*args, **kwargs)
1704 self.this = newobj.this
1705 self.thisown = 1
1706 del newobj.thisown
1707 def __del__(self, destroy=_core_.delete_FileSystem):
1708 """__del__(self)"""
1709 try:
1710 if self.thisown: destroy(self)
1711 except: pass
1712
1713 def ChangePathTo(*args, **kwargs):
1714 """ChangePathTo(self, String location, bool is_dir=False)"""
1715 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1716
1717 def GetPath(*args, **kwargs):
1718 """GetPath(self) -> String"""
1719 return _core_.FileSystem_GetPath(*args, **kwargs)
1720
1721 def OpenFile(*args, **kwargs):
1722 """OpenFile(self, String location) -> FSFile"""
1723 return _core_.FileSystem_OpenFile(*args, **kwargs)
1724
1725 def FindFirst(*args, **kwargs):
1726 """FindFirst(self, String spec, int flags=0) -> String"""
1727 return _core_.FileSystem_FindFirst(*args, **kwargs)
1728
1729 def FindNext(*args, **kwargs):
1730 """FindNext(self) -> String"""
1731 return _core_.FileSystem_FindNext(*args, **kwargs)
1732
1733 def AddHandler(*args, **kwargs):
c24da6d6 1734 """AddHandler(CPPFileSystemHandler handler)"""
d55e5bfc
RD
1735 return _core_.FileSystem_AddHandler(*args, **kwargs)
1736
1737 AddHandler = staticmethod(AddHandler)
1738 def CleanUpHandlers(*args, **kwargs):
c24da6d6 1739 """CleanUpHandlers()"""
d55e5bfc
RD
1740 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1741
1742 CleanUpHandlers = staticmethod(CleanUpHandlers)
1743 def FileNameToURL(*args, **kwargs):
c24da6d6 1744 """FileNameToURL(String filename) -> String"""
d55e5bfc
RD
1745 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1746
1747 FileNameToURL = staticmethod(FileNameToURL)
1748
1749class FileSystemPtr(FileSystem):
1750 def __init__(self, this):
1751 self.this = this
1752 if not hasattr(self,"thisown"): self.thisown = 0
1753 self.__class__ = FileSystem
1754_core_.FileSystem_swigregister(FileSystemPtr)
1755
1756def FileSystem_AddHandler(*args, **kwargs):
1757 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1758 return _core_.FileSystem_AddHandler(*args, **kwargs)
1759
1760def FileSystem_CleanUpHandlers(*args, **kwargs):
1761 """FileSystem_CleanUpHandlers()"""
1762 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1763
1764def FileSystem_FileNameToURL(*args, **kwargs):
1765 """FileSystem_FileNameToURL(String filename) -> String"""
1766 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1767
1768
1769def FileSystem_URLToFileName(*args, **kwargs):
1770 """FileSystem_URLToFileName(String url) -> String"""
1771 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1772class InternetFSHandler(CPPFileSystemHandler):
1773 def __repr__(self):
1774 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1775 def __init__(self, *args, **kwargs):
1776 """__init__(self) -> InternetFSHandler"""
1777 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
1778 self.this = newobj.this
1779 self.thisown = 1
1780 del newobj.thisown
1781 def CanOpen(*args, **kwargs):
1782 """CanOpen(self, String location) -> bool"""
1783 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1784
1785 def OpenFile(*args, **kwargs):
1786 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1787 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1788
1789
1790class InternetFSHandlerPtr(InternetFSHandler):
1791 def __init__(self, this):
1792 self.this = this
1793 if not hasattr(self,"thisown"): self.thisown = 0
1794 self.__class__ = InternetFSHandler
1795_core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
1796
1797class ZipFSHandler(CPPFileSystemHandler):
1798 def __repr__(self):
1799 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1800 def __init__(self, *args, **kwargs):
1801 """__init__(self) -> ZipFSHandler"""
1802 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
1803 self.this = newobj.this
1804 self.thisown = 1
1805 del newobj.thisown
1806 def CanOpen(*args, **kwargs):
1807 """CanOpen(self, String location) -> bool"""
1808 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1809
1810 def OpenFile(*args, **kwargs):
1811 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1812 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1813
1814 def FindFirst(*args, **kwargs):
1815 """FindFirst(self, String spec, int flags=0) -> String"""
1816 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1817
1818 def FindNext(*args, **kwargs):
1819 """FindNext(self) -> String"""
1820 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1821
1822
1823class ZipFSHandlerPtr(ZipFSHandler):
1824 def __init__(self, this):
1825 self.this = this
1826 if not hasattr(self,"thisown"): self.thisown = 0
1827 self.__class__ = ZipFSHandler
1828_core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
1829
1830
1831def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1832 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1833 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1834
1835def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1836 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1837 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1838
1839def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1840 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1841 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1842def MemoryFSHandler_AddFile(filename, a, b=''):
1843 if isinstance(a, wx.Image):
1844 __wxMemoryFSHandler_AddFile_wxImage(filename, a, b)
1845 elif isinstance(a, wx.Bitmap):
1846 __wxMemoryFSHandler_AddFile_wxBitmap(filename, a, b)
1847 elif type(a) == str:
1848 __wxMemoryFSHandler_AddFile_Data(filename, a)
1849 else: raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1850
1851class MemoryFSHandler(CPPFileSystemHandler):
1852 def __repr__(self):
1853 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1854 def __init__(self, *args, **kwargs):
1855 """__init__(self) -> MemoryFSHandler"""
1856 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
1857 self.this = newobj.this
1858 self.thisown = 1
1859 del newobj.thisown
1860 def RemoveFile(*args, **kwargs):
c24da6d6 1861 """RemoveFile(String filename)"""
d55e5bfc
RD
1862 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1863
1864 RemoveFile = staticmethod(RemoveFile)
1865 AddFile = staticmethod(MemoryFSHandler_AddFile)
1866 def CanOpen(*args, **kwargs):
1867 """CanOpen(self, String location) -> bool"""
1868 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1869
1870 def OpenFile(*args, **kwargs):
1871 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1872 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1873
1874 def FindFirst(*args, **kwargs):
1875 """FindFirst(self, String spec, int flags=0) -> String"""
1876 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1877
1878 def FindNext(*args, **kwargs):
1879 """FindNext(self) -> String"""
1880 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1881
1882
1883class MemoryFSHandlerPtr(MemoryFSHandler):
1884 def __init__(self, this):
1885 self.this = this
1886 if not hasattr(self,"thisown"): self.thisown = 0
1887 self.__class__ = MemoryFSHandler
1888_core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
1889
1890def MemoryFSHandler_RemoveFile(*args, **kwargs):
1891 """MemoryFSHandler_RemoveFile(String filename)"""
1892 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1893
1894#---------------------------------------------------------------------------
1895
1896class ImageHandler(Object):
1897 def __init__(self): raise RuntimeError, "No constructor defined"
1898 def __repr__(self):
1899 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1900 def GetName(*args, **kwargs):
1901 """GetName(self) -> String"""
1902 return _core_.ImageHandler_GetName(*args, **kwargs)
1903
1904 def GetExtension(*args, **kwargs):
1905 """GetExtension(self) -> String"""
1906 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1907
1908 def GetType(*args, **kwargs):
1909 """GetType(self) -> long"""
1910 return _core_.ImageHandler_GetType(*args, **kwargs)
1911
1912 def GetMimeType(*args, **kwargs):
1913 """GetMimeType(self) -> String"""
1914 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
1915
1916 def CanRead(*args, **kwargs):
1917 """CanRead(self, String name) -> bool"""
1918 return _core_.ImageHandler_CanRead(*args, **kwargs)
1919
1920 def SetName(*args, **kwargs):
1921 """SetName(self, String name)"""
1922 return _core_.ImageHandler_SetName(*args, **kwargs)
1923
1924 def SetExtension(*args, **kwargs):
1925 """SetExtension(self, String extension)"""
1926 return _core_.ImageHandler_SetExtension(*args, **kwargs)
1927
1928 def SetType(*args, **kwargs):
1929 """SetType(self, long type)"""
1930 return _core_.ImageHandler_SetType(*args, **kwargs)
1931
1932 def SetMimeType(*args, **kwargs):
1933 """SetMimeType(self, String mimetype)"""
1934 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
1935
1936
1937class ImageHandlerPtr(ImageHandler):
1938 def __init__(self, this):
1939 self.this = this
1940 if not hasattr(self,"thisown"): self.thisown = 0
1941 self.__class__ = ImageHandler
1942_core_.ImageHandler_swigregister(ImageHandlerPtr)
1943
1944class ImageHistogram(object):
1945 def __repr__(self):
1946 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1947 def __init__(self, *args, **kwargs):
1948 """__init__(self) -> ImageHistogram"""
1949 newobj = _core_.new_ImageHistogram(*args, **kwargs)
1950 self.this = newobj.this
1951 self.thisown = 1
1952 del newobj.thisown
1953 def MakeKey(*args, **kwargs):
1954 """
c24da6d6 1955 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
d55e5bfc
RD
1956
1957 Get the key in the histogram for the given RGB values
1958 """
1959 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
1960
1961 MakeKey = staticmethod(MakeKey)
1962 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
1963 """
1964 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
1965
1966 Find first colour that is not used in the image and has higher RGB
1967 values than startR, startG, startB. Returns a tuple consisting of a
1968 success flag and rgb values.
1969 """
d55e5bfc
RD
1970 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
1971
1972
1973class ImageHistogramPtr(ImageHistogram):
1974 def __init__(self, this):
1975 self.this = this
1976 if not hasattr(self,"thisown"): self.thisown = 0
1977 self.__class__ = ImageHistogram
1978_core_.ImageHistogram_swigregister(ImageHistogramPtr)
1979
1980def ImageHistogram_MakeKey(*args, **kwargs):
1981 """
1982 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
1983
1984 Get the key in the histogram for the given RGB values
1985 """
1986 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
1987
1988class Image(Object):
1989 def __repr__(self):
1990 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1991 def __init__(self, *args, **kwargs):
1992 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
1993 newobj = _core_.new_Image(*args, **kwargs)
1994 self.this = newobj.this
1995 self.thisown = 1
1996 del newobj.thisown
1997 def __del__(self, destroy=_core_.delete_Image):
1998 """__del__(self)"""
1999 try:
2000 if self.thisown: destroy(self)
2001 except: pass
2002
2003 def Create(*args, **kwargs):
2004 """Create(self, int width, int height)"""
2005 return _core_.Image_Create(*args, **kwargs)
2006
2007 def Destroy(*args, **kwargs):
2008 """
2009 Destroy(self)
2010
2011 Deletes the C++ object this Python object is a proxy for.
2012 """
2013 return _core_.Image_Destroy(*args, **kwargs)
2014
2015 def Scale(*args, **kwargs):
2016 """Scale(self, int width, int height) -> Image"""
2017 return _core_.Image_Scale(*args, **kwargs)
2018
2019 def ShrinkBy(*args, **kwargs):
2020 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
2021 return _core_.Image_ShrinkBy(*args, **kwargs)
2022
2023 def Rescale(*args, **kwargs):
2024 """Rescale(self, int width, int height) -> Image"""
2025 return _core_.Image_Rescale(*args, **kwargs)
2026
2027 def SetRGB(*args, **kwargs):
2028 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
2029 return _core_.Image_SetRGB(*args, **kwargs)
2030
2031 def GetRed(*args, **kwargs):
2032 """GetRed(self, int x, int y) -> unsigned char"""
2033 return _core_.Image_GetRed(*args, **kwargs)
2034
2035 def GetGreen(*args, **kwargs):
2036 """GetGreen(self, int x, int y) -> unsigned char"""
2037 return _core_.Image_GetGreen(*args, **kwargs)
2038
2039 def GetBlue(*args, **kwargs):
2040 """GetBlue(self, int x, int y) -> unsigned char"""
2041 return _core_.Image_GetBlue(*args, **kwargs)
2042
2043 def SetAlpha(*args, **kwargs):
2044 """SetAlpha(self, int x, int y, unsigned char alpha)"""
2045 return _core_.Image_SetAlpha(*args, **kwargs)
2046
2047 def GetAlpha(*args, **kwargs):
2048 """GetAlpha(self, int x, int y) -> unsigned char"""
2049 return _core_.Image_GetAlpha(*args, **kwargs)
2050
2051 def HasAlpha(*args, **kwargs):
2052 """HasAlpha(self) -> bool"""
2053 return _core_.Image_HasAlpha(*args, **kwargs)
2054
2055 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2056 """
2057 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2058
2059 Find first colour that is not used in the image and has higher RGB
2060 values than startR, startG, startB. Returns a tuple consisting of a
2061 success flag and rgb values.
2062 """
d55e5bfc
RD
2063 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2064
4cf4100f
RD
2065 def ConvertAlphaToMask(*args, **kwargs):
2066 """
2067 ConvertAlphaToMask(self, byte threshold=128) -> bool
2068
2069 If the image has alpha channel, this method converts it to mask. All pixels
2070 with alpha value less than ``threshold`` are replaced with mask colour and the
2071 alpha channel is removed. Mask colour is chosen automatically using
2072 `FindFirstUnusedColour`.
2073
2074 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2075 nothing.
2076 """
2077 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2078
d55e5bfc
RD
2079 def SetMaskFromImage(*args, **kwargs):
2080 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
2081 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2082
2083 def CanRead(*args, **kwargs):
c24da6d6 2084 """CanRead(String name) -> bool"""
d55e5bfc
RD
2085 return _core_.Image_CanRead(*args, **kwargs)
2086
2087 CanRead = staticmethod(CanRead)
2088 def GetImageCount(*args, **kwargs):
c24da6d6 2089 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
d55e5bfc
RD
2090 return _core_.Image_GetImageCount(*args, **kwargs)
2091
2092 GetImageCount = staticmethod(GetImageCount)
2093 def LoadFile(*args, **kwargs):
2094 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2095 return _core_.Image_LoadFile(*args, **kwargs)
2096
2097 def LoadMimeFile(*args, **kwargs):
2098 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
2099 return _core_.Image_LoadMimeFile(*args, **kwargs)
2100
2101 def SaveFile(*args, **kwargs):
2102 """SaveFile(self, String name, int type) -> bool"""
2103 return _core_.Image_SaveFile(*args, **kwargs)
2104
2105 def SaveMimeFile(*args, **kwargs):
2106 """SaveMimeFile(self, String name, String mimetype) -> bool"""
2107 return _core_.Image_SaveMimeFile(*args, **kwargs)
2108
2109 def CanReadStream(*args, **kwargs):
c24da6d6 2110 """CanReadStream(InputStream stream) -> bool"""
d55e5bfc
RD
2111 return _core_.Image_CanReadStream(*args, **kwargs)
2112
2113 CanReadStream = staticmethod(CanReadStream)
2114 def LoadStream(*args, **kwargs):
2115 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2116 return _core_.Image_LoadStream(*args, **kwargs)
2117
2118 def LoadMimeStream(*args, **kwargs):
2119 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
2120 return _core_.Image_LoadMimeStream(*args, **kwargs)
2121
2122 def Ok(*args, **kwargs):
2123 """Ok(self) -> bool"""
2124 return _core_.Image_Ok(*args, **kwargs)
2125
2126 def GetWidth(*args, **kwargs):
2127 """GetWidth(self) -> int"""
2128 return _core_.Image_GetWidth(*args, **kwargs)
2129
2130 def GetHeight(*args, **kwargs):
2131 """GetHeight(self) -> int"""
2132 return _core_.Image_GetHeight(*args, **kwargs)
2133
2134 def GetSize(*args, **kwargs):
2135 """GetSize(self) -> Size"""
2136 return _core_.Image_GetSize(*args, **kwargs)
2137
2138 def GetSubImage(*args, **kwargs):
2139 """GetSubImage(self, Rect rect) -> Image"""
2140 return _core_.Image_GetSubImage(*args, **kwargs)
2141
2142 def Copy(*args, **kwargs):
2143 """Copy(self) -> Image"""
2144 return _core_.Image_Copy(*args, **kwargs)
2145
2146 def Paste(*args, **kwargs):
2147 """Paste(self, Image image, int x, int y)"""
2148 return _core_.Image_Paste(*args, **kwargs)
2149
2150 def GetData(*args, **kwargs):
2151 """GetData(self) -> PyObject"""
2152 return _core_.Image_GetData(*args, **kwargs)
2153
2154 def SetData(*args, **kwargs):
2155 """SetData(self, PyObject data)"""
2156 return _core_.Image_SetData(*args, **kwargs)
2157
2158 def GetDataBuffer(*args, **kwargs):
2159 """GetDataBuffer(self) -> PyObject"""
2160 return _core_.Image_GetDataBuffer(*args, **kwargs)
2161
2162 def SetDataBuffer(*args, **kwargs):
2163 """SetDataBuffer(self, PyObject data)"""
2164 return _core_.Image_SetDataBuffer(*args, **kwargs)
2165
2166 def GetAlphaData(*args, **kwargs):
2167 """GetAlphaData(self) -> PyObject"""
2168 return _core_.Image_GetAlphaData(*args, **kwargs)
2169
2170 def SetAlphaData(*args, **kwargs):
2171 """SetAlphaData(self, PyObject data)"""
2172 return _core_.Image_SetAlphaData(*args, **kwargs)
2173
2174 def GetAlphaBuffer(*args, **kwargs):
2175 """GetAlphaBuffer(self) -> PyObject"""
2176 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2177
2178 def SetAlphaBuffer(*args, **kwargs):
2179 """SetAlphaBuffer(self, PyObject data)"""
2180 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2181
2182 def SetMaskColour(*args, **kwargs):
2183 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
2184 return _core_.Image_SetMaskColour(*args, **kwargs)
2185
2186 def GetMaskRed(*args, **kwargs):
2187 """GetMaskRed(self) -> unsigned char"""
2188 return _core_.Image_GetMaskRed(*args, **kwargs)
2189
2190 def GetMaskGreen(*args, **kwargs):
2191 """GetMaskGreen(self) -> unsigned char"""
2192 return _core_.Image_GetMaskGreen(*args, **kwargs)
2193
2194 def GetMaskBlue(*args, **kwargs):
2195 """GetMaskBlue(self) -> unsigned char"""
2196 return _core_.Image_GetMaskBlue(*args, **kwargs)
2197
2198 def SetMask(*args, **kwargs):
2199 """SetMask(self, bool mask=True)"""
2200 return _core_.Image_SetMask(*args, **kwargs)
2201
2202 def HasMask(*args, **kwargs):
2203 """HasMask(self) -> bool"""
2204 return _core_.Image_HasMask(*args, **kwargs)
2205
2206 def Rotate(*args, **kwargs):
2207 """
2208 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2209 Point offset_after_rotation=None) -> Image
2210 """
2211 return _core_.Image_Rotate(*args, **kwargs)
2212
2213 def Rotate90(*args, **kwargs):
2214 """Rotate90(self, bool clockwise=True) -> Image"""
2215 return _core_.Image_Rotate90(*args, **kwargs)
2216
2217 def Mirror(*args, **kwargs):
2218 """Mirror(self, bool horizontally=True) -> Image"""
2219 return _core_.Image_Mirror(*args, **kwargs)
2220
2221 def Replace(*args, **kwargs):
2222 """
2223 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
2224 unsigned char r2, unsigned char g2, unsigned char b2)
2225 """
2226 return _core_.Image_Replace(*args, **kwargs)
2227
2228 def ConvertToMono(*args, **kwargs):
2229 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
2230 return _core_.Image_ConvertToMono(*args, **kwargs)
2231
2232 def SetOption(*args, **kwargs):
2233 """SetOption(self, String name, String value)"""
2234 return _core_.Image_SetOption(*args, **kwargs)
2235
2236 def SetOptionInt(*args, **kwargs):
2237 """SetOptionInt(self, String name, int value)"""
2238 return _core_.Image_SetOptionInt(*args, **kwargs)
2239
2240 def GetOption(*args, **kwargs):
2241 """GetOption(self, String name) -> String"""
2242 return _core_.Image_GetOption(*args, **kwargs)
2243
2244 def GetOptionInt(*args, **kwargs):
2245 """GetOptionInt(self, String name) -> int"""
2246 return _core_.Image_GetOptionInt(*args, **kwargs)
2247
2248 def HasOption(*args, **kwargs):
2249 """HasOption(self, String name) -> bool"""
2250 return _core_.Image_HasOption(*args, **kwargs)
2251
2252 def CountColours(*args, **kwargs):
2253 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2254 return _core_.Image_CountColours(*args, **kwargs)
2255
2256 def ComputeHistogram(*args, **kwargs):
2257 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2258 return _core_.Image_ComputeHistogram(*args, **kwargs)
2259
2260 def AddHandler(*args, **kwargs):
c24da6d6 2261 """AddHandler(ImageHandler handler)"""
d55e5bfc
RD
2262 return _core_.Image_AddHandler(*args, **kwargs)
2263
2264 AddHandler = staticmethod(AddHandler)
2265 def InsertHandler(*args, **kwargs):
c24da6d6 2266 """InsertHandler(ImageHandler handler)"""
d55e5bfc
RD
2267 return _core_.Image_InsertHandler(*args, **kwargs)
2268
2269 InsertHandler = staticmethod(InsertHandler)
2270 def RemoveHandler(*args, **kwargs):
c24da6d6 2271 """RemoveHandler(String name) -> bool"""
d55e5bfc
RD
2272 return _core_.Image_RemoveHandler(*args, **kwargs)
2273
2274 RemoveHandler = staticmethod(RemoveHandler)
2275 def GetImageExtWildcard(*args, **kwargs):
c24da6d6 2276 """GetImageExtWildcard() -> String"""
d55e5bfc
RD
2277 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2278
2279 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2280 def ConvertToBitmap(*args, **kwargs):
2281 """ConvertToBitmap(self) -> Bitmap"""
2282 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2283
2284 def ConvertToMonoBitmap(*args, **kwargs):
2285 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
2286 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2287
2288 def __nonzero__(self): return self.Ok()
2289
2290class ImagePtr(Image):
2291 def __init__(self, this):
2292 self.this = this
2293 if not hasattr(self,"thisown"): self.thisown = 0
2294 self.__class__ = Image
2295_core_.Image_swigregister(ImagePtr)
2296
2297def ImageFromMime(*args, **kwargs):
2298 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
2299 val = _core_.new_ImageFromMime(*args, **kwargs)
2300 val.thisown = 1
2301 return val
2302
2303def ImageFromStream(*args, **kwargs):
2304 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2305 val = _core_.new_ImageFromStream(*args, **kwargs)
2306 val.thisown = 1
2307 return val
2308
2309def ImageFromStreamMime(*args, **kwargs):
2310 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
2311 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2312 val.thisown = 1
2313 return val
2314
c24da6d6
RD
2315def EmptyImage(*args, **kwargs):
2316 """EmptyImage(int width=0, int height=0, bool clear=True) -> Image"""
2317 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2318 val.thisown = 1
2319 return val
2320
2321def ImageFromBitmap(*args, **kwargs):
2322 """ImageFromBitmap(Bitmap bitmap) -> Image"""
2323 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2324 val.thisown = 1
2325 return val
2326
2327def ImageFromData(*args, **kwargs):
2328 """ImageFromData(int width, int height, unsigned char data) -> Image"""
2329 val = _core_.new_ImageFromData(*args, **kwargs)
2330 val.thisown = 1
2331 return val
2332
2333def Image_CanRead(*args, **kwargs):
2334 """Image_CanRead(String name) -> bool"""
2335 return _core_.Image_CanRead(*args, **kwargs)
2336
2337def Image_GetImageCount(*args, **kwargs):
2338 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2339 return _core_.Image_GetImageCount(*args, **kwargs)
2340
2341def Image_CanReadStream(*args, **kwargs):
2342 """Image_CanReadStream(InputStream stream) -> bool"""
2343 return _core_.Image_CanReadStream(*args, **kwargs)
2344
2345def Image_AddHandler(*args, **kwargs):
2346 """Image_AddHandler(ImageHandler handler)"""
2347 return _core_.Image_AddHandler(*args, **kwargs)
2348
2349def Image_InsertHandler(*args, **kwargs):
2350 """Image_InsertHandler(ImageHandler handler)"""
2351 return _core_.Image_InsertHandler(*args, **kwargs)
2352
2353def Image_RemoveHandler(*args, **kwargs):
2354 """Image_RemoveHandler(String name) -> bool"""
2355 return _core_.Image_RemoveHandler(*args, **kwargs)
2356
2357def Image_GetImageExtWildcard(*args, **kwargs):
2358 """Image_GetImageExtWildcard() -> String"""
2359 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2360
a07a67e6
RD
2361def InitAllImageHandlers():
2362 """
2363 The former functionality of InitAllImageHanders is now done internal to
2364 the _core_ extension module and so this function has become a simple NOP.
2365 """
2366 pass
d55e5bfc 2367
d55e5bfc
RD
2368IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2369IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2370BMP_24BPP = _core_.BMP_24BPP
2371BMP_8BPP = _core_.BMP_8BPP
2372BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2373BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2374BMP_8BPP_RED = _core_.BMP_8BPP_RED
2375BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2376BMP_4BPP = _core_.BMP_4BPP
2377BMP_1BPP = _core_.BMP_1BPP
2378BMP_1BPP_BW = _core_.BMP_1BPP_BW
2379class BMPHandler(ImageHandler):
2380 def __repr__(self):
2381 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2382 def __init__(self, *args, **kwargs):
2383 """__init__(self) -> BMPHandler"""
2384 newobj = _core_.new_BMPHandler(*args, **kwargs)
2385 self.this = newobj.this
2386 self.thisown = 1
2387 del newobj.thisown
2388
2389class BMPHandlerPtr(BMPHandler):
2390 def __init__(self, this):
2391 self.this = this
2392 if not hasattr(self,"thisown"): self.thisown = 0
2393 self.__class__ = BMPHandler
2394_core_.BMPHandler_swigregister(BMPHandlerPtr)
2395NullImage = cvar.NullImage
2396IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2397IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2398IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2399IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
2400IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
2401
2402class ICOHandler(BMPHandler):
2403 def __repr__(self):
2404 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2405 def __init__(self, *args, **kwargs):
2406 """__init__(self) -> ICOHandler"""
2407 newobj = _core_.new_ICOHandler(*args, **kwargs)
2408 self.this = newobj.this
2409 self.thisown = 1
2410 del newobj.thisown
2411
2412class ICOHandlerPtr(ICOHandler):
2413 def __init__(self, this):
2414 self.this = this
2415 if not hasattr(self,"thisown"): self.thisown = 0
2416 self.__class__ = ICOHandler
2417_core_.ICOHandler_swigregister(ICOHandlerPtr)
2418
2419class CURHandler(ICOHandler):
2420 def __repr__(self):
2421 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2422 def __init__(self, *args, **kwargs):
2423 """__init__(self) -> CURHandler"""
2424 newobj = _core_.new_CURHandler(*args, **kwargs)
2425 self.this = newobj.this
2426 self.thisown = 1
2427 del newobj.thisown
2428
2429class CURHandlerPtr(CURHandler):
2430 def __init__(self, this):
2431 self.this = this
2432 if not hasattr(self,"thisown"): self.thisown = 0
2433 self.__class__ = CURHandler
2434_core_.CURHandler_swigregister(CURHandlerPtr)
2435
2436class ANIHandler(CURHandler):
2437 def __repr__(self):
2438 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2439 def __init__(self, *args, **kwargs):
2440 """__init__(self) -> ANIHandler"""
2441 newobj = _core_.new_ANIHandler(*args, **kwargs)
2442 self.this = newobj.this
2443 self.thisown = 1
2444 del newobj.thisown
2445
2446class ANIHandlerPtr(ANIHandler):
2447 def __init__(self, this):
2448 self.this = this
2449 if not hasattr(self,"thisown"): self.thisown = 0
2450 self.__class__ = ANIHandler
2451_core_.ANIHandler_swigregister(ANIHandlerPtr)
2452
2453class PNGHandler(ImageHandler):
2454 def __repr__(self):
2455 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2456 def __init__(self, *args, **kwargs):
2457 """__init__(self) -> PNGHandler"""
2458 newobj = _core_.new_PNGHandler(*args, **kwargs)
2459 self.this = newobj.this
2460 self.thisown = 1
2461 del newobj.thisown
2462
2463class PNGHandlerPtr(PNGHandler):
2464 def __init__(self, this):
2465 self.this = this
2466 if not hasattr(self,"thisown"): self.thisown = 0
2467 self.__class__ = PNGHandler
2468_core_.PNGHandler_swigregister(PNGHandlerPtr)
2469
2470class GIFHandler(ImageHandler):
2471 def __repr__(self):
2472 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2473 def __init__(self, *args, **kwargs):
2474 """__init__(self) -> GIFHandler"""
2475 newobj = _core_.new_GIFHandler(*args, **kwargs)
2476 self.this = newobj.this
2477 self.thisown = 1
2478 del newobj.thisown
2479
2480class GIFHandlerPtr(GIFHandler):
2481 def __init__(self, this):
2482 self.this = this
2483 if not hasattr(self,"thisown"): self.thisown = 0
2484 self.__class__ = GIFHandler
2485_core_.GIFHandler_swigregister(GIFHandlerPtr)
2486
2487class PCXHandler(ImageHandler):
2488 def __repr__(self):
2489 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2490 def __init__(self, *args, **kwargs):
2491 """__init__(self) -> PCXHandler"""
2492 newobj = _core_.new_PCXHandler(*args, **kwargs)
2493 self.this = newobj.this
2494 self.thisown = 1
2495 del newobj.thisown
2496
2497class PCXHandlerPtr(PCXHandler):
2498 def __init__(self, this):
2499 self.this = this
2500 if not hasattr(self,"thisown"): self.thisown = 0
2501 self.__class__ = PCXHandler
2502_core_.PCXHandler_swigregister(PCXHandlerPtr)
2503
2504class JPEGHandler(ImageHandler):
2505 def __repr__(self):
2506 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2507 def __init__(self, *args, **kwargs):
2508 """__init__(self) -> JPEGHandler"""
2509 newobj = _core_.new_JPEGHandler(*args, **kwargs)
2510 self.this = newobj.this
2511 self.thisown = 1
2512 del newobj.thisown
2513
2514class JPEGHandlerPtr(JPEGHandler):
2515 def __init__(self, this):
2516 self.this = this
2517 if not hasattr(self,"thisown"): self.thisown = 0
2518 self.__class__ = JPEGHandler
2519_core_.JPEGHandler_swigregister(JPEGHandlerPtr)
2520
2521class PNMHandler(ImageHandler):
2522 def __repr__(self):
2523 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2524 def __init__(self, *args, **kwargs):
2525 """__init__(self) -> PNMHandler"""
2526 newobj = _core_.new_PNMHandler(*args, **kwargs)
2527 self.this = newobj.this
2528 self.thisown = 1
2529 del newobj.thisown
2530
2531class PNMHandlerPtr(PNMHandler):
2532 def __init__(self, this):
2533 self.this = this
2534 if not hasattr(self,"thisown"): self.thisown = 0
2535 self.__class__ = PNMHandler
2536_core_.PNMHandler_swigregister(PNMHandlerPtr)
2537
2538class XPMHandler(ImageHandler):
2539 def __repr__(self):
2540 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2541 def __init__(self, *args, **kwargs):
2542 """__init__(self) -> XPMHandler"""
2543 newobj = _core_.new_XPMHandler(*args, **kwargs)
2544 self.this = newobj.this
2545 self.thisown = 1
2546 del newobj.thisown
2547
2548class XPMHandlerPtr(XPMHandler):
2549 def __init__(self, this):
2550 self.this = this
2551 if not hasattr(self,"thisown"): self.thisown = 0
2552 self.__class__ = XPMHandler
2553_core_.XPMHandler_swigregister(XPMHandlerPtr)
2554
2555class TIFFHandler(ImageHandler):
2556 def __repr__(self):
2557 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2558 def __init__(self, *args, **kwargs):
2559 """__init__(self) -> TIFFHandler"""
2560 newobj = _core_.new_TIFFHandler(*args, **kwargs)
2561 self.this = newobj.this
2562 self.thisown = 1
2563 del newobj.thisown
2564
2565class TIFFHandlerPtr(TIFFHandler):
2566 def __init__(self, this):
2567 self.this = this
2568 if not hasattr(self,"thisown"): self.thisown = 0
2569 self.__class__ = TIFFHandler
2570_core_.TIFFHandler_swigregister(TIFFHandlerPtr)
2571
c0de73ae
RD
2572QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
2573QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
2574class Quantize(object):
2575 """Performs quantization, or colour reduction, on a wxImage."""
2576 def __init__(self): raise RuntimeError, "No constructor defined"
2577 def __repr__(self):
2578 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2579 def Quantize(*args, **kwargs):
2580 """
2581 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2582
2583 Reduce the colours in the source image and put the result into the
2584 destination image, setting the palette in the destination if
2585 needed. Both images may be the same, to overwrite the source image.
2586 """
2587 return _core_.Quantize_Quantize(*args, **kwargs)
2588
2589 Quantize = staticmethod(Quantize)
2590
2591class QuantizePtr(Quantize):
2592 def __init__(self, this):
2593 self.this = this
2594 if not hasattr(self,"thisown"): self.thisown = 0
2595 self.__class__ = Quantize
2596_core_.Quantize_swigregister(QuantizePtr)
2597
2598def Quantize_Quantize(*args, **kwargs):
2599 """
2600 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2601
2602 Reduce the colours in the source image and put the result into the
2603 destination image, setting the palette in the destination if
2604 needed. Both images may be the same, to overwrite the source image.
2605 """
2606 return _core_.Quantize_Quantize(*args, **kwargs)
2607
d55e5bfc
RD
2608#---------------------------------------------------------------------------
2609
2610class EvtHandler(Object):
2611 def __repr__(self):
2612 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2613 def __init__(self, *args, **kwargs):
2614 """__init__(self) -> EvtHandler"""
2615 newobj = _core_.new_EvtHandler(*args, **kwargs)
2616 self.this = newobj.this
2617 self.thisown = 1
2618 del newobj.thisown
2619 def GetNextHandler(*args, **kwargs):
2620 """GetNextHandler(self) -> EvtHandler"""
2621 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
2622
2623 def GetPreviousHandler(*args, **kwargs):
2624 """GetPreviousHandler(self) -> EvtHandler"""
2625 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
2626
2627 def SetNextHandler(*args, **kwargs):
2628 """SetNextHandler(self, EvtHandler handler)"""
2629 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
2630
2631 def SetPreviousHandler(*args, **kwargs):
2632 """SetPreviousHandler(self, EvtHandler handler)"""
2633 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
2634
2635 def GetEvtHandlerEnabled(*args, **kwargs):
2636 """GetEvtHandlerEnabled(self) -> bool"""
2637 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
2638
2639 def SetEvtHandlerEnabled(*args, **kwargs):
2640 """SetEvtHandlerEnabled(self, bool enabled)"""
2641 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
2642
2643 def ProcessEvent(*args, **kwargs):
2644 """ProcessEvent(self, Event event) -> bool"""
2645 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
2646
2647 def AddPendingEvent(*args, **kwargs):
2648 """AddPendingEvent(self, Event event)"""
2649 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
2650
2651 def ProcessPendingEvents(*args, **kwargs):
2652 """ProcessPendingEvents(self)"""
2653 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
2654
2655 def Connect(*args, **kwargs):
2656 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
2657 return _core_.EvtHandler_Connect(*args, **kwargs)
2658
2659 def Disconnect(*args, **kwargs):
2660 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
2661 return _core_.EvtHandler_Disconnect(*args, **kwargs)
2662
2663 def _setOORInfo(*args, **kwargs):
2664 """_setOORInfo(self, PyObject _self)"""
2665 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
2666
2667 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2668 """
2669 Bind an event to an event handler.
2670
caef1a4d
RD
2671 :param event: One of the EVT_* objects that specifies the
2672 type of event to bind,
d55e5bfc 2673
caef1a4d
RD
2674 :param handler: A callable object to be invoked when the
2675 event is delivered to self. Pass None to
2676 disconnect an event handler.
d55e5bfc 2677
caef1a4d
RD
2678 :param source: Sometimes the event originates from a
2679 different window than self, but you still
2680 want to catch it in self. (For example, a
2681 button event delivered to a frame.) By
2682 passing the source of the event, the event
2683 handling system is able to differentiate
2684 between the same event type from different
2685 controls.
d55e5bfc 2686
caef1a4d
RD
2687 :param id: Used to spcify the event source by ID instead
2688 of instance.
2689
2690 :param id2: Used when it is desirable to bind a handler
2691 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
2692 """
2693 if source is not None:
2694 id = source.GetId()
2695 event.Bind(self, id, id2, handler)
2696
c24da6d6
RD
2697 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2698 """
2699 Disconencts the event handler binding for event from self.
2700 Returns True if successful.
2701 """
2702 if source is not None:
2703 id = source.GetId()
2704 return event.Unbind(self, id, id2)
d55e5bfc
RD
2705
2706
2707class EvtHandlerPtr(EvtHandler):
2708 def __init__(self, this):
2709 self.this = this
2710 if not hasattr(self,"thisown"): self.thisown = 0
2711 self.__class__ = EvtHandler
2712_core_.EvtHandler_swigregister(EvtHandlerPtr)
2713
2714#---------------------------------------------------------------------------
2715
2716class PyEventBinder(object):
2717 """
2718 Instances of this class are used to bind specific events to event
2719 handlers.
2720 """
2721 def __init__(self, evtType, expectedIDs=0):
2722 if expectedIDs not in [0, 1, 2]:
2723 raise ValueError, "Invalid number of expectedIDs"
2724 self.expectedIDs = expectedIDs
2725
2726 if type(evtType) == list or type(evtType) == tuple:
2727 self.evtType = evtType
2728 else:
2729 self.evtType = [evtType]
2730
2731
2732 def Bind(self, target, id1, id2, function):
2733 """Bind this set of event types to target."""
2734 for et in self.evtType:
2735 target.Connect(id1, id2, et, function)
2736
c24da6d6
RD
2737
2738 def Unbind(self, target, id1, id2):
2739 """Remove an event binding."""
2740 success = 0
2741 for et in self.evtType:
2742 success += target.Disconnect(id1, id2, et)
2743 return success != 0
2744
d55e5bfc
RD
2745
2746 def __call__(self, *args):
2747 """
2748 For backwards compatibility with the old EVT_* functions.
2749 Should be called with either (window, func), (window, ID,
2750 func) or (window, ID1, ID2, func) parameters depending on the
2751 type of the event.
2752 """
2753 assert len(args) == 2 + self.expectedIDs
2754 id1 = wx.ID_ANY
2755 id2 = wx.ID_ANY
2756 target = args[0]
2757 if self.expectedIDs == 0:
2758 func = args[1]
2759 elif self.expectedIDs == 1:
2760 id1 = args[1]
2761 func = args[2]
2762 elif self.expectedIDs == 2:
2763 id1 = args[1]
2764 id2 = args[2]
2765 func = args[3]
2766 else:
2767 raise ValueError, "Unexpected number of IDs"
2768
2769 self.Bind(target, id1, id2, func)
2770
2771
2772# These two are square pegs that don't fit the PyEventBinder hole...
2773def EVT_COMMAND(win, id, cmd, func):
2774 win.Connect(id, -1, cmd, func)
2775def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
2776 win.Connect(id1, id2, cmd, func)
2777
2778
2779#---------------------------------------------------------------------------
2780
2781#---------------------------------------------------------------------------
2782
2783EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
2784EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
2785
2786def NewEventType(*args, **kwargs):
2787 """NewEventType() -> wxEventType"""
2788 return _core_.NewEventType(*args, **kwargs)
2789wxEVT_NULL = _core_.wxEVT_NULL
2790wxEVT_FIRST = _core_.wxEVT_FIRST
2791wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
2792wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
2793wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
2794wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
2795wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
2796wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
2797wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
2798wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
2799wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
2800wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
2801wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
2802wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
2803wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
2804wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
2805wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
2806wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
2807wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
2808wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
2809wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
2810wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
2811wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
2812wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
2813wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
2814wxEVT_MOTION = _core_.wxEVT_MOTION
2815wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
2816wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
2817wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
2818wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
2819wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
2820wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
2821wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
2822wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
2823wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
2824wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
2825wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
2826wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
2827wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
2828wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
2829wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
2830wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
2831wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
2832wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
2833wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
2834wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
2835wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
2836wxEVT_CHAR = _core_.wxEVT_CHAR
2837wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
2838wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
2839wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
2840wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
2841wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
2842wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
2843wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
2844wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
2845wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
2846wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
2847wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
2848wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
2849wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
2850wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
2851wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
2852wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
2853wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
2854wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
2855wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
2856wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
2857wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
2858wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
2859wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
2860wxEVT_SIZE = _core_.wxEVT_SIZE
2861wxEVT_MOVE = _core_.wxEVT_MOVE
2862wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
2863wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
2864wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
2865wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
2866wxEVT_POWER = _core_.wxEVT_POWER
2867wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
2868wxEVT_CREATE = _core_.wxEVT_CREATE
2869wxEVT_DESTROY = _core_.wxEVT_DESTROY
2870wxEVT_SHOW = _core_.wxEVT_SHOW
2871wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
2872wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
2873wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
2874wxEVT_PAINT = _core_.wxEVT_PAINT
2875wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
2876wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
2877wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
2878wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
2879wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
2880wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
2881wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
2882wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
2883wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
2884wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
2885wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
2886wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
2887wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
2888wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
2889wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
2890wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
2891wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
2892wxEVT_IDLE = _core_.wxEVT_IDLE
2893wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
2894wxEVT_SIZING = _core_.wxEVT_SIZING
2895wxEVT_MOVING = _core_.wxEVT_MOVING
2896wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
2897wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
2898wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
2899wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
2900wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
2901wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
2902wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
2903#
2904# Create some event binders
2905EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
2906EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
2907EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
2908EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
2909EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
2910EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
2911EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
2912EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
2913EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
2914EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
2915EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
2916EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
2917EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
2918EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
2919EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
2920EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
2921EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
2922EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
2923EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
2924EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
2925EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
2926EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
2927EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
2928EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
2929EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
2930EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
2931EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
2932EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
2933EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
2934EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
2935EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
2936EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
2937EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
2938EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
2939EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
2940EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
2941EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
2942EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
2943EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
2944EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
2945
2946EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
2947EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
2948EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
2949EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
2950EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
2951EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
2952EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
2953EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
2954EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
2955EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
2956EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
2957EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
2958EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
2959
2960EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
2961 wxEVT_LEFT_UP,
2962 wxEVT_MIDDLE_DOWN,
2963 wxEVT_MIDDLE_UP,
2964 wxEVT_RIGHT_DOWN,
2965 wxEVT_RIGHT_UP,
2966 wxEVT_MOTION,
2967 wxEVT_LEFT_DCLICK,
2968 wxEVT_MIDDLE_DCLICK,
2969 wxEVT_RIGHT_DCLICK,
2970 wxEVT_ENTER_WINDOW,
2971 wxEVT_LEAVE_WINDOW,
2972 wxEVT_MOUSEWHEEL
2973 ])
2974
2975
2976# Scrolling from wxWindow (sent to wxScrolledWindow)
2977EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
2978 wxEVT_SCROLLWIN_BOTTOM,
2979 wxEVT_SCROLLWIN_LINEUP,
2980 wxEVT_SCROLLWIN_LINEDOWN,
2981 wxEVT_SCROLLWIN_PAGEUP,
2982 wxEVT_SCROLLWIN_PAGEDOWN,
2983 wxEVT_SCROLLWIN_THUMBTRACK,
2984 wxEVT_SCROLLWIN_THUMBRELEASE,
2985 ])
2986
2987EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
2988EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
2989EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
2990EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
2991EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
2992EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
2993EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
2994EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
2995
2996# Scrolling from wxSlider and wxScrollBar
2997EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
2998 wxEVT_SCROLL_BOTTOM,
2999 wxEVT_SCROLL_LINEUP,
3000 wxEVT_SCROLL_LINEDOWN,
3001 wxEVT_SCROLL_PAGEUP,
3002 wxEVT_SCROLL_PAGEDOWN,
3003 wxEVT_SCROLL_THUMBTRACK,
3004 wxEVT_SCROLL_THUMBRELEASE,
3005 wxEVT_SCROLL_ENDSCROLL,
3006 ])
3007
3008EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3009EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3010EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3011EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3012EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3013EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3014EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3015EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3016EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3017
3018# Scrolling from wxSlider and wxScrollBar, with an id
3019EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3020 wxEVT_SCROLL_BOTTOM,
3021 wxEVT_SCROLL_LINEUP,
3022 wxEVT_SCROLL_LINEDOWN,
3023 wxEVT_SCROLL_PAGEUP,
3024 wxEVT_SCROLL_PAGEDOWN,
3025 wxEVT_SCROLL_THUMBTRACK,
3026 wxEVT_SCROLL_THUMBRELEASE,
3027 wxEVT_SCROLL_ENDSCROLL,
3028 ], 1)
3029
3030EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3031EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3032EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3033EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3034EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3035EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3036EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3037EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3038EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3039
3040EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3041EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3042EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3043EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3044EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3045EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3046EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3047EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3048EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3049EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3050
3051EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3052EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3053EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3054EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3055EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3056EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3057EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3058EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3059EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3060
3061
3062EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3063EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3064EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3065EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3066EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3067EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3068EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3069
3070EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3071
3072EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3073EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3074
3075EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3076
3077
3078
3079#---------------------------------------------------------------------------
3080
3081class Event(Object):
3082 def __init__(self): raise RuntimeError, "No constructor defined"
3083 def __repr__(self):
3084 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3085 def __del__(self, destroy=_core_.delete_Event):
3086 """__del__(self)"""
3087 try:
3088 if self.thisown: destroy(self)
3089 except: pass
3090
3091 def SetEventType(*args, **kwargs):
3092 """SetEventType(self, wxEventType typ)"""
3093 return _core_.Event_SetEventType(*args, **kwargs)
3094
3095 def GetEventType(*args, **kwargs):
3096 """GetEventType(self) -> wxEventType"""
3097 return _core_.Event_GetEventType(*args, **kwargs)
3098
3099 def GetEventObject(*args, **kwargs):
3100 """GetEventObject(self) -> Object"""
3101 return _core_.Event_GetEventObject(*args, **kwargs)
3102
3103 def SetEventObject(*args, **kwargs):
3104 """SetEventObject(self, Object obj)"""
3105 return _core_.Event_SetEventObject(*args, **kwargs)
3106
3107 def GetTimestamp(*args, **kwargs):
3108 """GetTimestamp(self) -> long"""
3109 return _core_.Event_GetTimestamp(*args, **kwargs)
3110
3111 def SetTimestamp(*args, **kwargs):
3112 """SetTimestamp(self, long ts=0)"""
3113 return _core_.Event_SetTimestamp(*args, **kwargs)
3114
3115 def GetId(*args, **kwargs):
3116 """GetId(self) -> int"""
3117 return _core_.Event_GetId(*args, **kwargs)
3118
3119 def SetId(*args, **kwargs):
3120 """SetId(self, int Id)"""
3121 return _core_.Event_SetId(*args, **kwargs)
3122
3123 def IsCommandEvent(*args, **kwargs):
3124 """IsCommandEvent(self) -> bool"""
3125 return _core_.Event_IsCommandEvent(*args, **kwargs)
3126
3127 def Skip(*args, **kwargs):
3128 """Skip(self, bool skip=True)"""
3129 return _core_.Event_Skip(*args, **kwargs)
3130
3131 def GetSkipped(*args, **kwargs):
3132 """GetSkipped(self) -> bool"""
3133 return _core_.Event_GetSkipped(*args, **kwargs)
3134
3135 def ShouldPropagate(*args, **kwargs):
3136 """ShouldPropagate(self) -> bool"""
3137 return _core_.Event_ShouldPropagate(*args, **kwargs)
3138
3139 def StopPropagation(*args, **kwargs):
3140 """StopPropagation(self) -> int"""
3141 return _core_.Event_StopPropagation(*args, **kwargs)
3142
3143 def ResumePropagation(*args, **kwargs):
3144 """ResumePropagation(self, int propagationLevel)"""
3145 return _core_.Event_ResumePropagation(*args, **kwargs)
3146
3147 def Clone(*args, **kwargs):
3148 """Clone(self) -> Event"""
3149 return _core_.Event_Clone(*args, **kwargs)
3150
3151
3152class EventPtr(Event):
3153 def __init__(self, this):
3154 self.this = this
3155 if not hasattr(self,"thisown"): self.thisown = 0
3156 self.__class__ = Event
3157_core_.Event_swigregister(EventPtr)
3158
3159#---------------------------------------------------------------------------
3160
3161class PropagationDisabler(object):
3162 def __repr__(self):
3163 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3164 def __init__(self, *args, **kwargs):
3165 """__init__(self, Event event) -> PropagationDisabler"""
3166 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
3167 self.this = newobj.this
3168 self.thisown = 1
3169 del newobj.thisown
3170 def __del__(self, destroy=_core_.delete_PropagationDisabler):
3171 """__del__(self)"""
3172 try:
3173 if self.thisown: destroy(self)
3174 except: pass
3175
3176
3177class PropagationDisablerPtr(PropagationDisabler):
3178 def __init__(self, this):
3179 self.this = this
3180 if not hasattr(self,"thisown"): self.thisown = 0
3181 self.__class__ = PropagationDisabler
3182_core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
3183
3184class PropagateOnce(object):
3185 def __repr__(self):
3186 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3187 def __init__(self, *args, **kwargs):
3188 """__init__(self, Event event) -> PropagateOnce"""
3189 newobj = _core_.new_PropagateOnce(*args, **kwargs)
3190 self.this = newobj.this
3191 self.thisown = 1
3192 del newobj.thisown
3193 def __del__(self, destroy=_core_.delete_PropagateOnce):
3194 """__del__(self)"""
3195 try:
3196 if self.thisown: destroy(self)
3197 except: pass
3198
3199
3200class PropagateOncePtr(PropagateOnce):
3201 def __init__(self, this):
3202 self.this = this
3203 if not hasattr(self,"thisown"): self.thisown = 0
3204 self.__class__ = PropagateOnce
3205_core_.PropagateOnce_swigregister(PropagateOncePtr)
3206
3207#---------------------------------------------------------------------------
3208
3209class CommandEvent(Event):
3210 def __repr__(self):
3211 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3212 def __init__(self, *args, **kwargs):
3213 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
3214 newobj = _core_.new_CommandEvent(*args, **kwargs)
3215 self.this = newobj.this
3216 self.thisown = 1
3217 del newobj.thisown
3218 def GetSelection(*args, **kwargs):
3219 """GetSelection(self) -> int"""
3220 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3221
3222 def SetString(*args, **kwargs):
3223 """SetString(self, String s)"""
3224 return _core_.CommandEvent_SetString(*args, **kwargs)
3225
3226 def GetString(*args, **kwargs):
3227 """GetString(self) -> String"""
3228 return _core_.CommandEvent_GetString(*args, **kwargs)
3229
3230 def IsChecked(*args, **kwargs):
3231 """IsChecked(self) -> bool"""
3232 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3233
3234 Checked = IsChecked
3235 def IsSelection(*args, **kwargs):
3236 """IsSelection(self) -> bool"""
3237 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3238
3239 def SetExtraLong(*args, **kwargs):
3240 """SetExtraLong(self, long extraLong)"""
3241 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3242
3243 def GetExtraLong(*args, **kwargs):
3244 """GetExtraLong(self) -> long"""
3245 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3246
3247 def SetInt(*args, **kwargs):
3248 """SetInt(self, int i)"""
3249 return _core_.CommandEvent_SetInt(*args, **kwargs)
3250
3251 def GetInt(*args, **kwargs):
3252 """GetInt(self) -> long"""
3253 return _core_.CommandEvent_GetInt(*args, **kwargs)
3254
3255 def Clone(*args, **kwargs):
3256 """Clone(self) -> Event"""
3257 return _core_.CommandEvent_Clone(*args, **kwargs)
3258
3259
3260class CommandEventPtr(CommandEvent):
3261 def __init__(self, this):
3262 self.this = this
3263 if not hasattr(self,"thisown"): self.thisown = 0
3264 self.__class__ = CommandEvent
3265_core_.CommandEvent_swigregister(CommandEventPtr)
3266
3267#---------------------------------------------------------------------------
3268
3269class NotifyEvent(CommandEvent):
3270 def __repr__(self):
3271 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3272 def __init__(self, *args, **kwargs):
3273 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
3274 newobj = _core_.new_NotifyEvent(*args, **kwargs)
3275 self.this = newobj.this
3276 self.thisown = 1
3277 del newobj.thisown
3278 def Veto(*args, **kwargs):
3279 """Veto(self)"""
3280 return _core_.NotifyEvent_Veto(*args, **kwargs)
3281
3282 def Allow(*args, **kwargs):
3283 """Allow(self)"""
3284 return _core_.NotifyEvent_Allow(*args, **kwargs)
3285
3286 def IsAllowed(*args, **kwargs):
3287 """IsAllowed(self) -> bool"""
3288 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
3289
3290
3291class NotifyEventPtr(NotifyEvent):
3292 def __init__(self, this):
3293 self.this = this
3294 if not hasattr(self,"thisown"): self.thisown = 0
3295 self.__class__ = NotifyEvent
3296_core_.NotifyEvent_swigregister(NotifyEventPtr)
3297
3298#---------------------------------------------------------------------------
3299
3300class ScrollEvent(CommandEvent):
3301 def __repr__(self):
3302 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3303 def __init__(self, *args, **kwargs):
3304 """
3305 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
3306 int orient=0) -> ScrollEvent
3307 """
3308 newobj = _core_.new_ScrollEvent(*args, **kwargs)
3309 self.this = newobj.this
3310 self.thisown = 1
3311 del newobj.thisown
3312 def GetOrientation(*args, **kwargs):
3313 """GetOrientation(self) -> int"""
3314 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
3315
3316 def GetPosition(*args, **kwargs):
3317 """GetPosition(self) -> int"""
3318 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
3319
3320 def SetOrientation(*args, **kwargs):
3321 """SetOrientation(self, int orient)"""
3322 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
3323
3324 def SetPosition(*args, **kwargs):
3325 """SetPosition(self, int pos)"""
3326 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
3327
3328
3329class ScrollEventPtr(ScrollEvent):
3330 def __init__(self, this):
3331 self.this = this
3332 if not hasattr(self,"thisown"): self.thisown = 0
3333 self.__class__ = ScrollEvent
3334_core_.ScrollEvent_swigregister(ScrollEventPtr)
3335
3336#---------------------------------------------------------------------------
3337
3338class ScrollWinEvent(Event):
3339 def __repr__(self):
3340 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3341 def __init__(self, *args, **kwargs):
3342 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
3343 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
3344 self.this = newobj.this
3345 self.thisown = 1
3346 del newobj.thisown
3347 def GetOrientation(*args, **kwargs):
3348 """GetOrientation(self) -> int"""
3349 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
3350
3351 def GetPosition(*args, **kwargs):
3352 """GetPosition(self) -> int"""
3353 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
3354
3355 def SetOrientation(*args, **kwargs):
3356 """SetOrientation(self, int orient)"""
3357 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
3358
3359 def SetPosition(*args, **kwargs):
3360 """SetPosition(self, int pos)"""
3361 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
3362
3363
3364class ScrollWinEventPtr(ScrollWinEvent):
3365 def __init__(self, this):
3366 self.this = this
3367 if not hasattr(self,"thisown"): self.thisown = 0
3368 self.__class__ = ScrollWinEvent
3369_core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
3370
3371#---------------------------------------------------------------------------
3372
3373MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3374MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3375MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3376MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3377MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
3378class MouseEvent(Event):
3379 def __repr__(self):
3380 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3381 def __init__(self, *args, **kwargs):
3382 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
3383 newobj = _core_.new_MouseEvent(*args, **kwargs)
3384 self.this = newobj.this
3385 self.thisown = 1
3386 del newobj.thisown
3387 def IsButton(*args, **kwargs):
3388 """IsButton(self) -> bool"""
3389 return _core_.MouseEvent_IsButton(*args, **kwargs)
3390
3391 def ButtonDown(*args, **kwargs):
3392 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
3393 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
3394
3395 def ButtonDClick(*args, **kwargs):
3396 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
3397 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
3398
3399 def ButtonUp(*args, **kwargs):
3400 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
3401 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
3402
3403 def Button(*args, **kwargs):
3404 """Button(self, int but) -> bool"""
3405 return _core_.MouseEvent_Button(*args, **kwargs)
3406
3407 def ButtonIsDown(*args, **kwargs):
3408 """ButtonIsDown(self, int but) -> bool"""
3409 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
3410
3411 def GetButton(*args, **kwargs):
3412 """GetButton(self) -> int"""
3413 return _core_.MouseEvent_GetButton(*args, **kwargs)
3414
3415 def ControlDown(*args, **kwargs):
3416 """ControlDown(self) -> bool"""
3417 return _core_.MouseEvent_ControlDown(*args, **kwargs)
3418
3419 def MetaDown(*args, **kwargs):
3420 """MetaDown(self) -> bool"""
3421 return _core_.MouseEvent_MetaDown(*args, **kwargs)
3422
3423 def AltDown(*args, **kwargs):
3424 """AltDown(self) -> bool"""
3425 return _core_.MouseEvent_AltDown(*args, **kwargs)
3426
3427 def ShiftDown(*args, **kwargs):
3428 """ShiftDown(self) -> bool"""
3429 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
3430
412d302d
RD
3431 def CmdDown(*args, **kwargs):
3432 """
3433 CmdDown(self) -> bool
3434
3435 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3436 platforms but the special "Apple" (a.k.a as "Command") key on
3437 Macs: it makes often sense to use it instead of, say, `ControlDown`
3438 because Cmd key is used for the same thing under Mac as Ctrl
3439 elsewhere. The Ctrl still exists, it's just not used for this
3440 purpose. So for non-Mac platforms this is the same as `ControlDown`
3441 and Macs this is the same as `MetaDown`.
3442 """
3443 return _core_.MouseEvent_CmdDown(*args, **kwargs)
3444
d55e5bfc
RD
3445 def LeftDown(*args, **kwargs):
3446 """LeftDown(self) -> bool"""
3447 return _core_.MouseEvent_LeftDown(*args, **kwargs)
3448
3449 def MiddleDown(*args, **kwargs):
3450 """MiddleDown(self) -> bool"""
3451 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
3452
3453 def RightDown(*args, **kwargs):
3454 """RightDown(self) -> bool"""
3455 return _core_.MouseEvent_RightDown(*args, **kwargs)
3456
3457 def LeftUp(*args, **kwargs):
3458 """LeftUp(self) -> bool"""
3459 return _core_.MouseEvent_LeftUp(*args, **kwargs)
3460
3461 def MiddleUp(*args, **kwargs):
3462 """MiddleUp(self) -> bool"""
3463 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
3464
3465 def RightUp(*args, **kwargs):
3466 """RightUp(self) -> bool"""
3467 return _core_.MouseEvent_RightUp(*args, **kwargs)
3468
3469 def LeftDClick(*args, **kwargs):
3470 """LeftDClick(self) -> bool"""
3471 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
3472
3473 def MiddleDClick(*args, **kwargs):
3474 """MiddleDClick(self) -> bool"""
3475 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
3476
3477 def RightDClick(*args, **kwargs):
3478 """RightDClick(self) -> bool"""
3479 return _core_.MouseEvent_RightDClick(*args, **kwargs)
3480
3481 def LeftIsDown(*args, **kwargs):
3482 """LeftIsDown(self) -> bool"""
3483 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
3484
3485 def MiddleIsDown(*args, **kwargs):
3486 """MiddleIsDown(self) -> bool"""
3487 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
3488
3489 def RightIsDown(*args, **kwargs):
3490 """RightIsDown(self) -> bool"""
3491 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
3492
3493 def Dragging(*args, **kwargs):
3494 """Dragging(self) -> bool"""
3495 return _core_.MouseEvent_Dragging(*args, **kwargs)
3496
3497 def Moving(*args, **kwargs):
3498 """Moving(self) -> bool"""
3499 return _core_.MouseEvent_Moving(*args, **kwargs)
3500
3501 def Entering(*args, **kwargs):
3502 """Entering(self) -> bool"""
3503 return _core_.MouseEvent_Entering(*args, **kwargs)
3504
3505 def Leaving(*args, **kwargs):
3506 """Leaving(self) -> bool"""
3507 return _core_.MouseEvent_Leaving(*args, **kwargs)
3508
3509 def GetPosition(*args, **kwargs):
3510 """
3511 GetPosition(self) -> Point
3512
79fccf9d
RD
3513 Returns the position of the mouse in window coordinates when the event
3514 happened.
d55e5bfc
RD
3515 """
3516 return _core_.MouseEvent_GetPosition(*args, **kwargs)
3517
3518 def GetPositionTuple(*args, **kwargs):
3519 """
3520 GetPositionTuple() -> (x,y)
3521
79fccf9d
RD
3522 Returns the position of the mouse in window coordinates when the event
3523 happened.
d55e5bfc
RD
3524 """
3525 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
3526
3527 def GetLogicalPosition(*args, **kwargs):
3528 """GetLogicalPosition(self, DC dc) -> Point"""
3529 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
3530
3531 def GetX(*args, **kwargs):
3532 """GetX(self) -> int"""
3533 return _core_.MouseEvent_GetX(*args, **kwargs)
3534
3535 def GetY(*args, **kwargs):
3536 """GetY(self) -> int"""
3537 return _core_.MouseEvent_GetY(*args, **kwargs)
3538
3539 def GetWheelRotation(*args, **kwargs):
3540 """GetWheelRotation(self) -> int"""
3541 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
3542
3543 def GetWheelDelta(*args, **kwargs):
3544 """GetWheelDelta(self) -> int"""
3545 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
3546
3547 def GetLinesPerAction(*args, **kwargs):
3548 """GetLinesPerAction(self) -> int"""
3549 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
3550
3551 def IsPageScroll(*args, **kwargs):
3552 """IsPageScroll(self) -> bool"""
3553 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3554
3555 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3556 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3557 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3558 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3559 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3560 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3561 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3562 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3563 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3564 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3565 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3566 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
3567
3568class MouseEventPtr(MouseEvent):
3569 def __init__(self, this):
3570 self.this = this
3571 if not hasattr(self,"thisown"): self.thisown = 0
3572 self.__class__ = MouseEvent
3573_core_.MouseEvent_swigregister(MouseEventPtr)
3574
3575#---------------------------------------------------------------------------
3576
3577class SetCursorEvent(Event):
3578 def __repr__(self):
3579 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3580 def __init__(self, *args, **kwargs):
3581 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
3582 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
3583 self.this = newobj.this
3584 self.thisown = 1
3585 del newobj.thisown
3586 def GetX(*args, **kwargs):
3587 """GetX(self) -> int"""
3588 return _core_.SetCursorEvent_GetX(*args, **kwargs)
3589
3590 def GetY(*args, **kwargs):
3591 """GetY(self) -> int"""
3592 return _core_.SetCursorEvent_GetY(*args, **kwargs)
3593
3594 def SetCursor(*args, **kwargs):
3595 """SetCursor(self, Cursor cursor)"""
3596 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
3597
3598 def GetCursor(*args, **kwargs):
3599 """GetCursor(self) -> Cursor"""
3600 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
3601
3602 def HasCursor(*args, **kwargs):
3603 """HasCursor(self) -> bool"""
3604 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
3605
3606
3607class SetCursorEventPtr(SetCursorEvent):
3608 def __init__(self, this):
3609 self.this = this
3610 if not hasattr(self,"thisown"): self.thisown = 0
3611 self.__class__ = SetCursorEvent
3612_core_.SetCursorEvent_swigregister(SetCursorEventPtr)
3613
3614#---------------------------------------------------------------------------
3615
3616class KeyEvent(Event):
3617 def __repr__(self):
3618 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3619 def __init__(self, *args, **kwargs):
3620 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
3621 newobj = _core_.new_KeyEvent(*args, **kwargs)
3622 self.this = newobj.this
3623 self.thisown = 1
3624 del newobj.thisown
3625 def ControlDown(*args, **kwargs):
3626 """ControlDown(self) -> bool"""
3627 return _core_.KeyEvent_ControlDown(*args, **kwargs)
3628
3629 def MetaDown(*args, **kwargs):
3630 """MetaDown(self) -> bool"""
3631 return _core_.KeyEvent_MetaDown(*args, **kwargs)
3632
3633 def AltDown(*args, **kwargs):
3634 """AltDown(self) -> bool"""
3635 return _core_.KeyEvent_AltDown(*args, **kwargs)
3636
3637 def ShiftDown(*args, **kwargs):
3638 """ShiftDown(self) -> bool"""
3639 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
3640
412d302d
RD
3641 def CmdDown(*args, **kwargs):
3642 """
3643 CmdDown(self) -> bool
3644
3645 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3646 platforms but the special "Apple" (a.k.a as "Command") key on
3647 Macs: it makes often sense to use it instead of, say, `ControlDown`
3648 because Cmd key is used for the same thing under Mac as Ctrl
3649 elsewhere. The Ctrl still exists, it's just not used for this
3650 purpose. So for non-Mac platforms this is the same as `ControlDown`
3651 and Macs this is the same as `MetaDown`.
3652 """
3653 return _core_.KeyEvent_CmdDown(*args, **kwargs)
3654
d55e5bfc
RD
3655 def HasModifiers(*args, **kwargs):
3656 """HasModifiers(self) -> bool"""
3657 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
3658
3659 def GetKeyCode(*args, **kwargs):
3660 """GetKeyCode(self) -> int"""
3661 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
3662
3663 KeyCode = GetKeyCode
19272049
RD
3664 def GetUnicodeKey(*args, **kwargs):
3665 """GetUnicodeKey(self) -> int"""
3666 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 3667
19272049 3668 GetUniChar = GetUnicodeKey
d55e5bfc
RD
3669 def GetRawKeyCode(*args, **kwargs):
3670 """GetRawKeyCode(self) -> unsigned int"""
3671 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
3672
3673 def GetRawKeyFlags(*args, **kwargs):
3674 """GetRawKeyFlags(self) -> unsigned int"""
3675 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
3676
3677 def GetPosition(*args, **kwargs):
3678 """
3679 GetPosition(self) -> Point
3680
3681 Find the position of the event.
3682 """
3683 return _core_.KeyEvent_GetPosition(*args, **kwargs)
3684
3685 def GetPositionTuple(*args, **kwargs):
3686 """
3687 GetPositionTuple() -> (x,y)
3688
3689 Find the position of the event.
3690 """
3691 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
3692
3693 def GetX(*args, **kwargs):
3694 """GetX(self) -> int"""
3695 return _core_.KeyEvent_GetX(*args, **kwargs)
3696
3697 def GetY(*args, **kwargs):
3698 """GetY(self) -> int"""
3699 return _core_.KeyEvent_GetY(*args, **kwargs)
3700
3701 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
3702 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
3703 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
3704 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
3705 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
3706 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
3707 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
3708 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
3709 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
3710 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
3711
3712class KeyEventPtr(KeyEvent):
3713 def __init__(self, this):
3714 self.this = this
3715 if not hasattr(self,"thisown"): self.thisown = 0
3716 self.__class__ = KeyEvent
3717_core_.KeyEvent_swigregister(KeyEventPtr)
3718
3719#---------------------------------------------------------------------------
3720
3721class SizeEvent(Event):
3722 def __repr__(self):
3723 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3724 def __init__(self, *args, **kwargs):
3725 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
3726 newobj = _core_.new_SizeEvent(*args, **kwargs)
3727 self.this = newobj.this
3728 self.thisown = 1
3729 del newobj.thisown
3730 def GetSize(*args, **kwargs):
3731 """GetSize(self) -> Size"""
3732 return _core_.SizeEvent_GetSize(*args, **kwargs)
3733
3734 def GetRect(*args, **kwargs):
3735 """GetRect(self) -> Rect"""
3736 return _core_.SizeEvent_GetRect(*args, **kwargs)
3737
3738 def SetRect(*args, **kwargs):
3739 """SetRect(self, Rect rect)"""
3740 return _core_.SizeEvent_SetRect(*args, **kwargs)
3741
3742 def SetSize(*args, **kwargs):
3743 """SetSize(self, Size size)"""
3744 return _core_.SizeEvent_SetSize(*args, **kwargs)
3745
3746 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
3747 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
3748
3749class SizeEventPtr(SizeEvent):
3750 def __init__(self, this):
3751 self.this = this
3752 if not hasattr(self,"thisown"): self.thisown = 0
3753 self.__class__ = SizeEvent
3754_core_.SizeEvent_swigregister(SizeEventPtr)
3755
3756#---------------------------------------------------------------------------
3757
3758class MoveEvent(Event):
3759 def __repr__(self):
3760 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3761 def __init__(self, *args, **kwargs):
3762 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
3763 newobj = _core_.new_MoveEvent(*args, **kwargs)
3764 self.this = newobj.this
3765 self.thisown = 1
3766 del newobj.thisown
3767 def GetPosition(*args, **kwargs):
3768 """GetPosition(self) -> Point"""
3769 return _core_.MoveEvent_GetPosition(*args, **kwargs)
3770
3771 def GetRect(*args, **kwargs):
3772 """GetRect(self) -> Rect"""
3773 return _core_.MoveEvent_GetRect(*args, **kwargs)
3774
3775 def SetRect(*args, **kwargs):
3776 """SetRect(self, Rect rect)"""
3777 return _core_.MoveEvent_SetRect(*args, **kwargs)
3778
3779 def SetPosition(*args, **kwargs):
3780 """SetPosition(self, Point pos)"""
3781 return _core_.MoveEvent_SetPosition(*args, **kwargs)
3782
3783 m_pos = property(_core_.MoveEvent_m_pos_get, _core_.MoveEvent_m_pos_set)
3784 m_rect = property(_core_.MoveEvent_m_rect_get, _core_.MoveEvent_m_rect_set)
3785
3786class MoveEventPtr(MoveEvent):
3787 def __init__(self, this):
3788 self.this = this
3789 if not hasattr(self,"thisown"): self.thisown = 0
3790 self.__class__ = MoveEvent
3791_core_.MoveEvent_swigregister(MoveEventPtr)
3792
3793#---------------------------------------------------------------------------
3794
3795class PaintEvent(Event):
3796 def __repr__(self):
3797 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3798 def __init__(self, *args, **kwargs):
3799 """__init__(self, int Id=0) -> PaintEvent"""
3800 newobj = _core_.new_PaintEvent(*args, **kwargs)
3801 self.this = newobj.this
3802 self.thisown = 1
3803 del newobj.thisown
3804
3805class PaintEventPtr(PaintEvent):
3806 def __init__(self, this):
3807 self.this = this
3808 if not hasattr(self,"thisown"): self.thisown = 0
3809 self.__class__ = PaintEvent
3810_core_.PaintEvent_swigregister(PaintEventPtr)
3811
3812class NcPaintEvent(Event):
3813 def __repr__(self):
3814 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3815 def __init__(self, *args, **kwargs):
3816 """__init__(self, int winid=0) -> NcPaintEvent"""
3817 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
3818 self.this = newobj.this
3819 self.thisown = 1
3820 del newobj.thisown
3821
3822class NcPaintEventPtr(NcPaintEvent):
3823 def __init__(self, this):
3824 self.this = this
3825 if not hasattr(self,"thisown"): self.thisown = 0
3826 self.__class__ = NcPaintEvent
3827_core_.NcPaintEvent_swigregister(NcPaintEventPtr)
3828
3829#---------------------------------------------------------------------------
3830
3831class EraseEvent(Event):
3832 def __repr__(self):
3833 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3834 def __init__(self, *args, **kwargs):
3835 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
3836 newobj = _core_.new_EraseEvent(*args, **kwargs)
3837 self.this = newobj.this
3838 self.thisown = 1
3839 del newobj.thisown
3840 def GetDC(*args, **kwargs):
3841 """GetDC(self) -> DC"""
3842 return _core_.EraseEvent_GetDC(*args, **kwargs)
3843
3844
3845class EraseEventPtr(EraseEvent):
3846 def __init__(self, this):
3847 self.this = this
3848 if not hasattr(self,"thisown"): self.thisown = 0
3849 self.__class__ = EraseEvent
3850_core_.EraseEvent_swigregister(EraseEventPtr)
3851
3852#---------------------------------------------------------------------------
3853
3854class FocusEvent(Event):
3855 def __repr__(self):
3856 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3857 def __init__(self, *args, **kwargs):
3858 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
3859 newobj = _core_.new_FocusEvent(*args, **kwargs)
3860 self.this = newobj.this
3861 self.thisown = 1
3862 del newobj.thisown
3863 def GetWindow(*args, **kwargs):
3864 """GetWindow(self) -> Window"""
3865 return _core_.FocusEvent_GetWindow(*args, **kwargs)
3866
3867 def SetWindow(*args, **kwargs):
3868 """SetWindow(self, Window win)"""
3869 return _core_.FocusEvent_SetWindow(*args, **kwargs)
3870
3871
3872class FocusEventPtr(FocusEvent):
3873 def __init__(self, this):
3874 self.this = this
3875 if not hasattr(self,"thisown"): self.thisown = 0
3876 self.__class__ = FocusEvent
3877_core_.FocusEvent_swigregister(FocusEventPtr)
3878
3879#---------------------------------------------------------------------------
3880
3881class ChildFocusEvent(CommandEvent):
3882 def __repr__(self):
3883 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3884 def __init__(self, *args, **kwargs):
3885 """__init__(self, Window win=None) -> ChildFocusEvent"""
3886 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
3887 self.this = newobj.this
3888 self.thisown = 1
3889 del newobj.thisown
3890 def GetWindow(*args, **kwargs):
3891 """GetWindow(self) -> Window"""
3892 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
3893
3894
3895class ChildFocusEventPtr(ChildFocusEvent):
3896 def __init__(self, this):
3897 self.this = this
3898 if not hasattr(self,"thisown"): self.thisown = 0
3899 self.__class__ = ChildFocusEvent
3900_core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
3901
3902#---------------------------------------------------------------------------
3903
3904class ActivateEvent(Event):
3905 def __repr__(self):
3906 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3907 def __init__(self, *args, **kwargs):
3908 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
3909 newobj = _core_.new_ActivateEvent(*args, **kwargs)
3910 self.this = newobj.this
3911 self.thisown = 1
3912 del newobj.thisown
3913 def GetActive(*args, **kwargs):
3914 """GetActive(self) -> bool"""
3915 return _core_.ActivateEvent_GetActive(*args, **kwargs)
3916
3917
3918class ActivateEventPtr(ActivateEvent):
3919 def __init__(self, this):
3920 self.this = this
3921 if not hasattr(self,"thisown"): self.thisown = 0
3922 self.__class__ = ActivateEvent
3923_core_.ActivateEvent_swigregister(ActivateEventPtr)
3924
3925#---------------------------------------------------------------------------
3926
3927class InitDialogEvent(Event):
3928 def __repr__(self):
3929 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3930 def __init__(self, *args, **kwargs):
3931 """__init__(self, int Id=0) -> InitDialogEvent"""
3932 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
3933 self.this = newobj.this
3934 self.thisown = 1
3935 del newobj.thisown
3936
3937class InitDialogEventPtr(InitDialogEvent):
3938 def __init__(self, this):
3939 self.this = this
3940 if not hasattr(self,"thisown"): self.thisown = 0
3941 self.__class__ = InitDialogEvent
3942_core_.InitDialogEvent_swigregister(InitDialogEventPtr)
3943
3944#---------------------------------------------------------------------------
3945
3946class MenuEvent(Event):
3947 def __repr__(self):
3948 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3949 def __init__(self, *args, **kwargs):
3950 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
3951 newobj = _core_.new_MenuEvent(*args, **kwargs)
3952 self.this = newobj.this
3953 self.thisown = 1
3954 del newobj.thisown
3955 def GetMenuId(*args, **kwargs):
3956 """GetMenuId(self) -> int"""
3957 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
3958
3959 def IsPopup(*args, **kwargs):
3960 """IsPopup(self) -> bool"""
3961 return _core_.MenuEvent_IsPopup(*args, **kwargs)
3962
3963 def GetMenu(*args, **kwargs):
3964 """GetMenu(self) -> Menu"""
3965 return _core_.MenuEvent_GetMenu(*args, **kwargs)
3966
3967
3968class MenuEventPtr(MenuEvent):
3969 def __init__(self, this):
3970 self.this = this
3971 if not hasattr(self,"thisown"): self.thisown = 0
3972 self.__class__ = MenuEvent
3973_core_.MenuEvent_swigregister(MenuEventPtr)
3974
3975#---------------------------------------------------------------------------
3976
3977class CloseEvent(Event):
3978 def __repr__(self):
3979 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3980 def __init__(self, *args, **kwargs):
3981 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
3982 newobj = _core_.new_CloseEvent(*args, **kwargs)
3983 self.this = newobj.this
3984 self.thisown = 1
3985 del newobj.thisown
3986 def SetLoggingOff(*args, **kwargs):
3987 """SetLoggingOff(self, bool logOff)"""
3988 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
3989
3990 def GetLoggingOff(*args, **kwargs):
3991 """GetLoggingOff(self) -> bool"""
3992 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
3993
3994 def Veto(*args, **kwargs):
3995 """Veto(self, bool veto=True)"""
3996 return _core_.CloseEvent_Veto(*args, **kwargs)
3997
3998 def SetCanVeto(*args, **kwargs):
3999 """SetCanVeto(self, bool canVeto)"""
4000 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
4001
4002 def CanVeto(*args, **kwargs):
4003 """CanVeto(self) -> bool"""
4004 return _core_.CloseEvent_CanVeto(*args, **kwargs)
4005
4006 def GetVeto(*args, **kwargs):
4007 """GetVeto(self) -> bool"""
4008 return _core_.CloseEvent_GetVeto(*args, **kwargs)
4009
4010
4011class CloseEventPtr(CloseEvent):
4012 def __init__(self, this):
4013 self.this = this
4014 if not hasattr(self,"thisown"): self.thisown = 0
4015 self.__class__ = CloseEvent
4016_core_.CloseEvent_swigregister(CloseEventPtr)
4017
4018#---------------------------------------------------------------------------
4019
4020class ShowEvent(Event):
4021 def __repr__(self):
4022 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4023 def __init__(self, *args, **kwargs):
4024 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
4025 newobj = _core_.new_ShowEvent(*args, **kwargs)
4026 self.this = newobj.this
4027 self.thisown = 1
4028 del newobj.thisown
4029 def SetShow(*args, **kwargs):
4030 """SetShow(self, bool show)"""
4031 return _core_.ShowEvent_SetShow(*args, **kwargs)
4032
4033 def GetShow(*args, **kwargs):
4034 """GetShow(self) -> bool"""
4035 return _core_.ShowEvent_GetShow(*args, **kwargs)
4036
4037
4038class ShowEventPtr(ShowEvent):
4039 def __init__(self, this):
4040 self.this = this
4041 if not hasattr(self,"thisown"): self.thisown = 0
4042 self.__class__ = ShowEvent
4043_core_.ShowEvent_swigregister(ShowEventPtr)
4044
4045#---------------------------------------------------------------------------
4046
4047class IconizeEvent(Event):
4048 def __repr__(self):
4049 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4050 def __init__(self, *args, **kwargs):
4051 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
4052 newobj = _core_.new_IconizeEvent(*args, **kwargs)
4053 self.this = newobj.this
4054 self.thisown = 1
4055 del newobj.thisown
4056 def Iconized(*args, **kwargs):
4057 """Iconized(self) -> bool"""
4058 return _core_.IconizeEvent_Iconized(*args, **kwargs)
4059
4060
4061class IconizeEventPtr(IconizeEvent):
4062 def __init__(self, this):
4063 self.this = this
4064 if not hasattr(self,"thisown"): self.thisown = 0
4065 self.__class__ = IconizeEvent
4066_core_.IconizeEvent_swigregister(IconizeEventPtr)
4067
4068#---------------------------------------------------------------------------
4069
4070class MaximizeEvent(Event):
4071 def __repr__(self):
4072 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4073 def __init__(self, *args, **kwargs):
4074 """__init__(self, int id=0) -> MaximizeEvent"""
4075 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
4076 self.this = newobj.this
4077 self.thisown = 1
4078 del newobj.thisown
4079
4080class MaximizeEventPtr(MaximizeEvent):
4081 def __init__(self, this):
4082 self.this = this
4083 if not hasattr(self,"thisown"): self.thisown = 0
4084 self.__class__ = MaximizeEvent
4085_core_.MaximizeEvent_swigregister(MaximizeEventPtr)
4086
4087#---------------------------------------------------------------------------
4088
4089class DropFilesEvent(Event):
4090 def __init__(self): raise RuntimeError, "No constructor defined"
4091 def __repr__(self):
4092 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4093 def GetPosition(*args, **kwargs):
4094 """GetPosition(self) -> Point"""
4095 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
4096
4097 def GetNumberOfFiles(*args, **kwargs):
4098 """GetNumberOfFiles(self) -> int"""
4099 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
4100
4101 def GetFiles(*args, **kwargs):
4102 """GetFiles(self) -> PyObject"""
4103 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
4104
4105
4106class DropFilesEventPtr(DropFilesEvent):
4107 def __init__(self, this):
4108 self.this = this
4109 if not hasattr(self,"thisown"): self.thisown = 0
4110 self.__class__ = DropFilesEvent
4111_core_.DropFilesEvent_swigregister(DropFilesEventPtr)
4112
4113#---------------------------------------------------------------------------
4114
4115UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4116UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
4117class UpdateUIEvent(CommandEvent):
4118 def __repr__(self):
4119 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4120 def __init__(self, *args, **kwargs):
4121 """__init__(self, int commandId=0) -> UpdateUIEvent"""
4122 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
4123 self.this = newobj.this
4124 self.thisown = 1
4125 del newobj.thisown
4126 def GetChecked(*args, **kwargs):
4127 """GetChecked(self) -> bool"""
4128 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
4129
4130 def GetEnabled(*args, **kwargs):
4131 """GetEnabled(self) -> bool"""
4132 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
4133
4134 def GetText(*args, **kwargs):
4135 """GetText(self) -> String"""
4136 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
4137
4138 def GetSetText(*args, **kwargs):
4139 """GetSetText(self) -> bool"""
4140 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
4141
4142 def GetSetChecked(*args, **kwargs):
4143 """GetSetChecked(self) -> bool"""
4144 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
4145
4146 def GetSetEnabled(*args, **kwargs):
4147 """GetSetEnabled(self) -> bool"""
4148 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
4149
4150 def Check(*args, **kwargs):
4151 """Check(self, bool check)"""
4152 return _core_.UpdateUIEvent_Check(*args, **kwargs)
4153
4154 def Enable(*args, **kwargs):
4155 """Enable(self, bool enable)"""
4156 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
4157
4158 def SetText(*args, **kwargs):
4159 """SetText(self, String text)"""
4160 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
4161
4162 def SetUpdateInterval(*args, **kwargs):
c24da6d6 4163 """SetUpdateInterval(long updateInterval)"""
d55e5bfc
RD
4164 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4165
4166 SetUpdateInterval = staticmethod(SetUpdateInterval)
4167 def GetUpdateInterval(*args, **kwargs):
c24da6d6 4168 """GetUpdateInterval() -> long"""
d55e5bfc
RD
4169 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4170
4171 GetUpdateInterval = staticmethod(GetUpdateInterval)
4172 def CanUpdate(*args, **kwargs):
c24da6d6 4173 """CanUpdate(Window win) -> bool"""
d55e5bfc
RD
4174 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4175
4176 CanUpdate = staticmethod(CanUpdate)
4177 def ResetUpdateTime(*args, **kwargs):
c24da6d6 4178 """ResetUpdateTime()"""
d55e5bfc
RD
4179 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4180
4181 ResetUpdateTime = staticmethod(ResetUpdateTime)
4182 def SetMode(*args, **kwargs):
c24da6d6 4183 """SetMode(int mode)"""
d55e5bfc
RD
4184 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4185
4186 SetMode = staticmethod(SetMode)
4187 def GetMode(*args, **kwargs):
c24da6d6 4188 """GetMode() -> int"""
d55e5bfc
RD
4189 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4190
4191 GetMode = staticmethod(GetMode)
4192
4193class UpdateUIEventPtr(UpdateUIEvent):
4194 def __init__(self, this):
4195 self.this = this
4196 if not hasattr(self,"thisown"): self.thisown = 0
4197 self.__class__ = UpdateUIEvent
4198_core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
4199
4200def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4201 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
4202 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4203
4204def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4205 """UpdateUIEvent_GetUpdateInterval() -> long"""
4206 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4207
4208def UpdateUIEvent_CanUpdate(*args, **kwargs):
4209 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
4210 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4211
4212def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4213 """UpdateUIEvent_ResetUpdateTime()"""
4214 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4215
4216def UpdateUIEvent_SetMode(*args, **kwargs):
4217 """UpdateUIEvent_SetMode(int mode)"""
4218 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4219
4220def UpdateUIEvent_GetMode(*args, **kwargs):
4221 """UpdateUIEvent_GetMode() -> int"""
4222 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4223
4224#---------------------------------------------------------------------------
4225
4226class SysColourChangedEvent(Event):
4227 def __repr__(self):
4228 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4229 def __init__(self, *args, **kwargs):
4230 """__init__(self) -> SysColourChangedEvent"""
4231 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
4232 self.this = newobj.this
4233 self.thisown = 1
4234 del newobj.thisown
4235
4236class SysColourChangedEventPtr(SysColourChangedEvent):
4237 def __init__(self, this):
4238 self.this = this
4239 if not hasattr(self,"thisown"): self.thisown = 0
4240 self.__class__ = SysColourChangedEvent
4241_core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
4242
4243#---------------------------------------------------------------------------
4244
4245class MouseCaptureChangedEvent(Event):
4246 def __repr__(self):
4247 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4248 def __init__(self, *args, **kwargs):
4249 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
4250 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
4251 self.this = newobj.this
4252 self.thisown = 1
4253 del newobj.thisown
4254 def GetCapturedWindow(*args, **kwargs):
4255 """GetCapturedWindow(self) -> Window"""
4256 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
4257
4258
4259class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
4260 def __init__(self, this):
4261 self.this = this
4262 if not hasattr(self,"thisown"): self.thisown = 0
4263 self.__class__ = MouseCaptureChangedEvent
4264_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
4265
4266#---------------------------------------------------------------------------
4267
4268class DisplayChangedEvent(Event):
4269 def __repr__(self):
4270 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4271 def __init__(self, *args, **kwargs):
4272 """__init__(self) -> DisplayChangedEvent"""
4273 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
4274 self.this = newobj.this
4275 self.thisown = 1
4276 del newobj.thisown
4277
4278class DisplayChangedEventPtr(DisplayChangedEvent):
4279 def __init__(self, this):
4280 self.this = this
4281 if not hasattr(self,"thisown"): self.thisown = 0
4282 self.__class__ = DisplayChangedEvent
4283_core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
4284
4285#---------------------------------------------------------------------------
4286
4287class PaletteChangedEvent(Event):
4288 def __repr__(self):
4289 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4290 def __init__(self, *args, **kwargs):
4291 """__init__(self, int id=0) -> PaletteChangedEvent"""
4292 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
4293 self.this = newobj.this
4294 self.thisown = 1
4295 del newobj.thisown
4296 def SetChangedWindow(*args, **kwargs):
4297 """SetChangedWindow(self, Window win)"""
4298 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
4299
4300 def GetChangedWindow(*args, **kwargs):
4301 """GetChangedWindow(self) -> Window"""
4302 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
4303
4304
4305class PaletteChangedEventPtr(PaletteChangedEvent):
4306 def __init__(self, this):
4307 self.this = this
4308 if not hasattr(self,"thisown"): self.thisown = 0
4309 self.__class__ = PaletteChangedEvent
4310_core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
4311
4312#---------------------------------------------------------------------------
4313
4314class QueryNewPaletteEvent(Event):
4315 def __repr__(self):
4316 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4317 def __init__(self, *args, **kwargs):
4318 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
4319 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
4320 self.this = newobj.this
4321 self.thisown = 1
4322 del newobj.thisown
4323 def SetPaletteRealized(*args, **kwargs):
4324 """SetPaletteRealized(self, bool realized)"""
4325 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
4326
4327 def GetPaletteRealized(*args, **kwargs):
4328 """GetPaletteRealized(self) -> bool"""
4329 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
4330
4331
4332class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
4333 def __init__(self, this):
4334 self.this = this
4335 if not hasattr(self,"thisown"): self.thisown = 0
4336 self.__class__ = QueryNewPaletteEvent
4337_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
4338
4339#---------------------------------------------------------------------------
4340
4341class NavigationKeyEvent(Event):
4342 def __repr__(self):
4343 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4344 def __init__(self, *args, **kwargs):
4345 """__init__(self) -> NavigationKeyEvent"""
4346 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
4347 self.this = newobj.this
4348 self.thisown = 1
4349 del newobj.thisown
4350 def GetDirection(*args, **kwargs):
4351 """GetDirection(self) -> bool"""
4352 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
4353
4354 def SetDirection(*args, **kwargs):
908b74cd 4355 """SetDirection(self, bool forward)"""
d55e5bfc
RD
4356 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
4357
4358 def IsWindowChange(*args, **kwargs):
4359 """IsWindowChange(self) -> bool"""
4360 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
4361
4362 def SetWindowChange(*args, **kwargs):
908b74cd 4363 """SetWindowChange(self, bool ischange)"""
d55e5bfc
RD
4364 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
4365
908b74cd
RD
4366 def SetFlags(*args, **kwargs):
4367 """SetFlags(self, long flags)"""
4368 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
4369
d55e5bfc
RD
4370 def GetCurrentFocus(*args, **kwargs):
4371 """GetCurrentFocus(self) -> Window"""
4372 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
4373
4374 def SetCurrentFocus(*args, **kwargs):
4375 """SetCurrentFocus(self, Window win)"""
4376 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
4377
b0f7404b 4378 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
4379 IsForward = _core_.NavigationKeyEvent_IsForward
4380 WinChange = _core_.NavigationKeyEvent_WinChange
d55e5bfc
RD
4381
4382class NavigationKeyEventPtr(NavigationKeyEvent):
4383 def __init__(self, this):
4384 self.this = this
4385 if not hasattr(self,"thisown"): self.thisown = 0
4386 self.__class__ = NavigationKeyEvent
4387_core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
4388
4389#---------------------------------------------------------------------------
4390
4391class WindowCreateEvent(CommandEvent):
4392 def __repr__(self):
4393 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4394 def __init__(self, *args, **kwargs):
4395 """__init__(self, Window win=None) -> WindowCreateEvent"""
4396 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
4397 self.this = newobj.this
4398 self.thisown = 1
4399 del newobj.thisown
4400 def GetWindow(*args, **kwargs):
4401 """GetWindow(self) -> Window"""
4402 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
4403
4404
4405class WindowCreateEventPtr(WindowCreateEvent):
4406 def __init__(self, this):
4407 self.this = this
4408 if not hasattr(self,"thisown"): self.thisown = 0
4409 self.__class__ = WindowCreateEvent
4410_core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
4411
4412class WindowDestroyEvent(CommandEvent):
4413 def __repr__(self):
4414 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4415 def __init__(self, *args, **kwargs):
4416 """__init__(self, Window win=None) -> WindowDestroyEvent"""
4417 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
4418 self.this = newobj.this
4419 self.thisown = 1
4420 del newobj.thisown
4421 def GetWindow(*args, **kwargs):
4422 """GetWindow(self) -> Window"""
4423 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
4424
4425
4426class WindowDestroyEventPtr(WindowDestroyEvent):
4427 def __init__(self, this):
4428 self.this = this
4429 if not hasattr(self,"thisown"): self.thisown = 0
4430 self.__class__ = WindowDestroyEvent
4431_core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
4432
4433#---------------------------------------------------------------------------
4434
4435class ContextMenuEvent(CommandEvent):
4436 def __repr__(self):
4437 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4438 def __init__(self, *args, **kwargs):
4439 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
4440 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
4441 self.this = newobj.this
4442 self.thisown = 1
4443 del newobj.thisown
4444 def GetPosition(*args, **kwargs):
4445 """GetPosition(self) -> Point"""
4446 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
4447
4448 def SetPosition(*args, **kwargs):
4449 """SetPosition(self, Point pos)"""
4450 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
4451
4452
4453class ContextMenuEventPtr(ContextMenuEvent):
4454 def __init__(self, this):
4455 self.this = this
4456 if not hasattr(self,"thisown"): self.thisown = 0
4457 self.__class__ = ContextMenuEvent
4458_core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
4459
4460#---------------------------------------------------------------------------
4461
4462IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4463IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
4464class IdleEvent(Event):
4465 def __repr__(self):
4466 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4467 def __init__(self, *args, **kwargs):
4468 """__init__(self) -> IdleEvent"""
4469 newobj = _core_.new_IdleEvent(*args, **kwargs)
4470 self.this = newobj.this
4471 self.thisown = 1
4472 del newobj.thisown
4473 def RequestMore(*args, **kwargs):
4474 """RequestMore(self, bool needMore=True)"""
4475 return _core_.IdleEvent_RequestMore(*args, **kwargs)
4476
4477 def MoreRequested(*args, **kwargs):
4478 """MoreRequested(self) -> bool"""
4479 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
4480
4481 def SetMode(*args, **kwargs):
c24da6d6 4482 """SetMode(int mode)"""
d55e5bfc
RD
4483 return _core_.IdleEvent_SetMode(*args, **kwargs)
4484
4485 SetMode = staticmethod(SetMode)
4486 def GetMode(*args, **kwargs):
c24da6d6 4487 """GetMode() -> int"""
d55e5bfc
RD
4488 return _core_.IdleEvent_GetMode(*args, **kwargs)
4489
4490 GetMode = staticmethod(GetMode)
4491 def CanSend(*args, **kwargs):
c24da6d6 4492 """CanSend(Window win) -> bool"""
d55e5bfc
RD
4493 return _core_.IdleEvent_CanSend(*args, **kwargs)
4494
4495 CanSend = staticmethod(CanSend)
4496
4497class IdleEventPtr(IdleEvent):
4498 def __init__(self, this):
4499 self.this = this
4500 if not hasattr(self,"thisown"): self.thisown = 0
4501 self.__class__ = IdleEvent
4502_core_.IdleEvent_swigregister(IdleEventPtr)
4503
4504def IdleEvent_SetMode(*args, **kwargs):
4505 """IdleEvent_SetMode(int mode)"""
4506 return _core_.IdleEvent_SetMode(*args, **kwargs)
4507
4508def IdleEvent_GetMode(*args, **kwargs):
4509 """IdleEvent_GetMode() -> int"""
4510 return _core_.IdleEvent_GetMode(*args, **kwargs)
4511
4512def IdleEvent_CanSend(*args, **kwargs):
4513 """IdleEvent_CanSend(Window win) -> bool"""
4514 return _core_.IdleEvent_CanSend(*args, **kwargs)
4515
4516#---------------------------------------------------------------------------
4517
4518class PyEvent(Event):
4519 def __repr__(self):
4520 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4521 def __init__(self, *args, **kwargs):
4522 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
4523 newobj = _core_.new_PyEvent(*args, **kwargs)
4524 self.this = newobj.this
4525 self.thisown = 1
4526 del newobj.thisown
4527 self.SetSelf(self)
4528
4529 def __del__(self, destroy=_core_.delete_PyEvent):
4530 """__del__(self)"""
4531 try:
4532 if self.thisown: destroy(self)
4533 except: pass
4534
4535 def SetSelf(*args, **kwargs):
4536 """SetSelf(self, PyObject self)"""
4537 return _core_.PyEvent_SetSelf(*args, **kwargs)
4538
4539 def GetSelf(*args, **kwargs):
4540 """GetSelf(self) -> PyObject"""
4541 return _core_.PyEvent_GetSelf(*args, **kwargs)
4542
4543
4544class PyEventPtr(PyEvent):
4545 def __init__(self, this):
4546 self.this = this
4547 if not hasattr(self,"thisown"): self.thisown = 0
4548 self.__class__ = PyEvent
4549_core_.PyEvent_swigregister(PyEventPtr)
4550
4551class PyCommandEvent(CommandEvent):
4552 def __repr__(self):
4553 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4554 def __init__(self, *args, **kwargs):
4555 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
4556 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
4557 self.this = newobj.this
4558 self.thisown = 1
4559 del newobj.thisown
4560 self.SetSelf(self)
4561
4562 def __del__(self, destroy=_core_.delete_PyCommandEvent):
4563 """__del__(self)"""
4564 try:
4565 if self.thisown: destroy(self)
4566 except: pass
4567
4568 def SetSelf(*args, **kwargs):
4569 """SetSelf(self, PyObject self)"""
4570 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
4571
4572 def GetSelf(*args, **kwargs):
4573 """GetSelf(self) -> PyObject"""
4574 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
4575
4576
4577class PyCommandEventPtr(PyCommandEvent):
4578 def __init__(self, this):
4579 self.this = this
4580 if not hasattr(self,"thisown"): self.thisown = 0
4581 self.__class__ = PyCommandEvent
4582_core_.PyCommandEvent_swigregister(PyCommandEventPtr)
4583
4584#---------------------------------------------------------------------------
4585
4586PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4587PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4588PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4589PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4590PRINT_WINDOWS = _core_.PRINT_WINDOWS
4591PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
4592class PyApp(EvtHandler):
c24da6d6
RD
4593 """
4594 The ``wx.PyApp`` class is an *implementation detail*, please use the
4595 `wx.App` class (or some other derived class) instead.
4596 """
d55e5bfc
RD
4597 def __repr__(self):
4598 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4599 def __init__(self, *args, **kwargs):
4600 """
4601 __init__(self) -> PyApp
4602
4603 Create a new application object, starting the bootstrap process.
4604 """
4605 newobj = _core_.new_PyApp(*args, **kwargs)
4606 self.this = newobj.this
4607 self.thisown = 1
4608 del newobj.thisown
4609 self._setCallbackInfo(self, PyApp)
4610 self._setOORInfo(self)
4611
4612 def __del__(self, destroy=_core_.delete_PyApp):
4613 """__del__(self)"""
4614 try:
4615 if self.thisown: destroy(self)
4616 except: pass
4617
4618 def _setCallbackInfo(*args, **kwargs):
4619 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
4620 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
4621
4622 def GetAppName(*args, **kwargs):
4623 """
4624 GetAppName(self) -> String
4625
4626 Get the application name.
4627 """
4628 return _core_.PyApp_GetAppName(*args, **kwargs)
4629
4630 def SetAppName(*args, **kwargs):
4631 """
4632 SetAppName(self, String name)
4633
c24da6d6
RD
4634 Set the application name. This value may be used automatically by
4635 `wx.Config` and such.
d55e5bfc
RD
4636 """
4637 return _core_.PyApp_SetAppName(*args, **kwargs)
4638
4639 def GetClassName(*args, **kwargs):
4640 """
4641 GetClassName(self) -> String
4642
4643 Get the application's class name.
4644 """
4645 return _core_.PyApp_GetClassName(*args, **kwargs)
4646
4647 def SetClassName(*args, **kwargs):
4648 """
4649 SetClassName(self, String name)
4650
c24da6d6
RD
4651 Set the application's class name. This value may be used for
4652 X-resources if applicable for the platform
d55e5bfc
RD
4653 """
4654 return _core_.PyApp_SetClassName(*args, **kwargs)
4655
4656 def GetVendorName(*args, **kwargs):
4657 """
4658 GetVendorName(self) -> String
4659
4660 Get the application's vendor name.
4661 """
4662 return _core_.PyApp_GetVendorName(*args, **kwargs)
4663
4664 def SetVendorName(*args, **kwargs):
4665 """
4666 SetVendorName(self, String name)
4667
c24da6d6
RD
4668 Set the application's vendor name. This value may be used
4669 automatically by `wx.Config` and such.
d55e5bfc
RD
4670 """
4671 return _core_.PyApp_SetVendorName(*args, **kwargs)
4672
4673 def GetTraits(*args, **kwargs):
4674 """
4675 GetTraits(self) -> wxAppTraits
4676
c24da6d6
RD
4677 Return (and create if necessary) the app traits object to which we
4678 delegate for everything which either should be configurable by the
4679 user (then he can change the default behaviour simply by overriding
4680 CreateTraits() and returning his own traits object) or which is
4681 GUI/console dependent as then wx.AppTraits allows us to abstract the
4682 differences behind the common facade.
4683
4684 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc
RD
4685 """
4686 return _core_.PyApp_GetTraits(*args, **kwargs)
4687
4688 def ProcessPendingEvents(*args, **kwargs):
4689 """
4690 ProcessPendingEvents(self)
4691
c24da6d6
RD
4692 Process all events in the Pending Events list -- it is necessary to
4693 call this function to process posted events. This normally happens
4694 during each event loop iteration.
d55e5bfc
RD
4695 """
4696 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
4697
4698 def Yield(*args, **kwargs):
4699 """
4700 Yield(self, bool onlyIfNeeded=False) -> bool
4701
c24da6d6
RD
4702 Process all currently pending events right now, instead of waiting
4703 until return to the event loop. It is an error to call ``Yield``
4704 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 4705
c24da6d6 4706 :warning: This function is dangerous as it can lead to unexpected
79fccf9d
RD
4707 reentrancies (i.e. when called from an event handler it may
4708 result in calling the same event handler again), use with
4709 extreme care or, better, don't use at all!
d55e5bfc 4710
c24da6d6 4711 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
79fccf9d 4712
d55e5bfc
RD
4713 """
4714 return _core_.PyApp_Yield(*args, **kwargs)
4715
4716 def WakeUpIdle(*args, **kwargs):
4717 """
4718 WakeUpIdle(self)
4719
c24da6d6
RD
4720 Make sure that idle events are sent again.
4721 :see: `wx.WakeUpIdle`
d55e5bfc
RD
4722 """
4723 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
4724
4725 def MainLoop(*args, **kwargs):
4726 """
4727 MainLoop(self) -> int
4728
c24da6d6
RD
4729 Execute the main GUI loop, the function doesn't normally return until
4730 all top level windows have been closed and destroyed.
d55e5bfc
RD
4731 """
4732 return _core_.PyApp_MainLoop(*args, **kwargs)
4733
4734 def Exit(*args, **kwargs):
4735 """
4736 Exit(self)
4737
4738 Exit the main loop thus terminating the application.
c24da6d6 4739 :see: `wx.Exit`
d55e5bfc
RD
4740 """
4741 return _core_.PyApp_Exit(*args, **kwargs)
4742
4743 def ExitMainLoop(*args, **kwargs):
4744 """
4745 ExitMainLoop(self)
4746
c24da6d6
RD
4747 Exit the main GUI loop during the next iteration of the main
4748 loop, (i.e. it does not stop the program immediately!)
d55e5bfc
RD
4749 """
4750 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
4751
4752 def Pending(*args, **kwargs):
4753 """
4754 Pending(self) -> bool
4755
4756 Returns True if there are unprocessed events in the event queue.
4757 """
4758 return _core_.PyApp_Pending(*args, **kwargs)
4759
4760 def Dispatch(*args, **kwargs):
4761 """
4762 Dispatch(self) -> bool
4763
4764 Process the first event in the event queue (blocks until an event
4765 appears if there are none currently)
4766 """
4767 return _core_.PyApp_Dispatch(*args, **kwargs)
4768
4769 def ProcessIdle(*args, **kwargs):
4770 """
4771 ProcessIdle(self) -> bool
4772
c24da6d6
RD
4773 Called from the MainLoop when the application becomes idle (there are
4774 no pending events) and sends a `wx.IdleEvent` to all interested
4775 parties. Returns True if more idle events are needed, False if not.
d55e5bfc
RD
4776 """
4777 return _core_.PyApp_ProcessIdle(*args, **kwargs)
4778
4779 def SendIdleEvents(*args, **kwargs):
4780 """
4781 SendIdleEvents(self, Window win, IdleEvent event) -> bool
4782
c24da6d6
RD
4783 Send idle event to window and all subwindows. Returns True if more
4784 idle time is requested.
d55e5bfc
RD
4785 """
4786 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
4787
4788 def IsActive(*args, **kwargs):
4789 """
4790 IsActive(self) -> bool
4791
4792 Return True if our app has focus.
4793 """
4794 return _core_.PyApp_IsActive(*args, **kwargs)
4795
4796 def SetTopWindow(*args, **kwargs):
4797 """
4798 SetTopWindow(self, Window win)
4799
c24da6d6 4800 Set the *main* top level window
d55e5bfc
RD
4801 """
4802 return _core_.PyApp_SetTopWindow(*args, **kwargs)
4803
4804 def GetTopWindow(*args, **kwargs):
4805 """
4806 GetTopWindow(self) -> Window
4807
c24da6d6
RD
4808 Return the *main* top level window (if it hadn't been set previously
4809 with SetTopWindow(), will return just some top level window and, if
4810 there not any, will return None)
d55e5bfc
RD
4811 """
4812 return _core_.PyApp_GetTopWindow(*args, **kwargs)
4813
4814 def SetExitOnFrameDelete(*args, **kwargs):
4815 """
4816 SetExitOnFrameDelete(self, bool flag)
4817
c24da6d6
RD
4818 Control the exit behaviour: by default, the program will exit the main
4819 loop (and so, usually, terminate) when the last top-level program
4820 window is deleted. Beware that if you disable this behaviour (with
4821 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
4822 explicitly from somewhere.
d55e5bfc
RD
4823 """
4824 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
4825
4826 def GetExitOnFrameDelete(*args, **kwargs):
4827 """
4828 GetExitOnFrameDelete(self) -> bool
4829
4830 Get the current exit behaviour setting.
4831 """
4832 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
4833
4834 def SetUseBestVisual(*args, **kwargs):
4835 """
4836 SetUseBestVisual(self, bool flag)
4837
c24da6d6
RD
4838 Set whether the app should try to use the best available visual on
4839 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc
RD
4840 """
4841 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
4842
4843 def GetUseBestVisual(*args, **kwargs):
4844 """
4845 GetUseBestVisual(self) -> bool
4846
4847 Get current UseBestVisual setting.
4848 """
4849 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
4850
4851 def SetPrintMode(*args, **kwargs):
4852 """SetPrintMode(self, int mode)"""
4853 return _core_.PyApp_SetPrintMode(*args, **kwargs)
4854
4855 def GetPrintMode(*args, **kwargs):
4856 """GetPrintMode(self) -> int"""
4857 return _core_.PyApp_GetPrintMode(*args, **kwargs)
4858
4859 def SetAssertMode(*args, **kwargs):
4860 """
4861 SetAssertMode(self, int mode)
4862
79fccf9d 4863 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc
RD
4864 """
4865 return _core_.PyApp_SetAssertMode(*args, **kwargs)
4866
4867 def GetAssertMode(*args, **kwargs):
4868 """
4869 GetAssertMode(self) -> int
4870
4871 Get the current OnAssert behaviour setting.
4872 """
4873 return _core_.PyApp_GetAssertMode(*args, **kwargs)
4874
4875 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 4876 """GetMacSupportPCMenuShortcuts() -> bool"""
d55e5bfc
RD
4877 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
4878
4879 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
4880 def GetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 4881 """GetMacAboutMenuItemId() -> long"""
d55e5bfc
RD
4882 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
4883
4884 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
4885 def GetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 4886 """GetMacPreferencesMenuItemId() -> long"""
d55e5bfc
RD
4887 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
4888
4889 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
4890 def GetMacExitMenuItemId(*args, **kwargs):
c24da6d6 4891 """GetMacExitMenuItemId() -> long"""
d55e5bfc
RD
4892 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
4893
4894 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
4895 def GetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 4896 """GetMacHelpMenuTitleName() -> String"""
d55e5bfc
RD
4897 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
4898
4899 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
4900 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 4901 """SetMacSupportPCMenuShortcuts(bool val)"""
d55e5bfc
RD
4902 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
4903
4904 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
4905 def SetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 4906 """SetMacAboutMenuItemId(long val)"""
d55e5bfc
RD
4907 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
4908
4909 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
4910 def SetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 4911 """SetMacPreferencesMenuItemId(long val)"""
d55e5bfc
RD
4912 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
4913
4914 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
4915 def SetMacExitMenuItemId(*args, **kwargs):
c24da6d6 4916 """SetMacExitMenuItemId(long val)"""
d55e5bfc
RD
4917 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
4918
4919 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
4920 def SetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 4921 """SetMacHelpMenuTitleName(String val)"""
d55e5bfc
RD
4922 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
4923
4924 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
4925 def _BootstrapApp(*args, **kwargs):
4926 """
4927 _BootstrapApp(self)
4928
4929 For internal use only
4930 """
4931 return _core_.PyApp__BootstrapApp(*args, **kwargs)
4932
4933 def GetComCtl32Version(*args, **kwargs):
4934 """
c24da6d6 4935 GetComCtl32Version() -> int
d55e5bfc 4936
c24da6d6
RD
4937 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
4938 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
4939 """
4940 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
4941
4942 GetComCtl32Version = staticmethod(GetComCtl32Version)
4943
4944class PyAppPtr(PyApp):
4945 def __init__(self, this):
4946 self.this = this
4947 if not hasattr(self,"thisown"): self.thisown = 0
4948 self.__class__ = PyApp
4949_core_.PyApp_swigregister(PyAppPtr)
4950
4951def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
4952 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
4953 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
4954
4955def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
4956 """PyApp_GetMacAboutMenuItemId() -> long"""
4957 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
4958
4959def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
4960 """PyApp_GetMacPreferencesMenuItemId() -> long"""
4961 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
4962
4963def PyApp_GetMacExitMenuItemId(*args, **kwargs):
4964 """PyApp_GetMacExitMenuItemId() -> long"""
4965 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
4966
4967def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
4968 """PyApp_GetMacHelpMenuTitleName() -> String"""
4969 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
4970
4971def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
4972 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
4973 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
4974
4975def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
4976 """PyApp_SetMacAboutMenuItemId(long val)"""
4977 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
4978
4979def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
4980 """PyApp_SetMacPreferencesMenuItemId(long val)"""
4981 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
4982
4983def PyApp_SetMacExitMenuItemId(*args, **kwargs):
4984 """PyApp_SetMacExitMenuItemId(long val)"""
4985 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
4986
4987def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
4988 """PyApp_SetMacHelpMenuTitleName(String val)"""
4989 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
4990
4991def PyApp_GetComCtl32Version(*args, **kwargs):
4992 """
4993 PyApp_GetComCtl32Version() -> int
4994
c24da6d6
RD
4995 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
4996 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
4997 """
4998 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
4999
5000#---------------------------------------------------------------------------
5001
5002
5003def Exit(*args, **kwargs):
5004 """
5005 Exit()
5006
5007 Force an exit of the application. Convenience for wx.GetApp().Exit()
5008 """
5009 return _core_.Exit(*args, **kwargs)
5010
5011def Yield(*args, **kwargs):
5012 """
5013 Yield() -> bool
5014
5015 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
5016 """
5017 return _core_.Yield(*args, **kwargs)
5018
5019def YieldIfNeeded(*args, **kwargs):
5020 """
5021 YieldIfNeeded() -> bool
5022
5023 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
5024 """
5025 return _core_.YieldIfNeeded(*args, **kwargs)
5026
5027def SafeYield(*args, **kwargs):
5028 """
5029 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
5030
c24da6d6
RD
5031 This function is similar to `wx.Yield`, except that it disables the
5032 user input to all program windows before calling `wx.Yield` and
5033 re-enables it again afterwards. If ``win`` is not None, this window
5034 will remain enabled, allowing the implementation of some limited user
5035 interaction.
d55e5bfc 5036
c24da6d6 5037 :Returns: the result of the call to `wx.Yield`.
d55e5bfc
RD
5038 """
5039 return _core_.SafeYield(*args, **kwargs)
5040
5041def WakeUpIdle(*args, **kwargs):
5042 """
5043 WakeUpIdle()
5044
c24da6d6
RD
5045 Cause the message queue to become empty again, so idle events will be
5046 sent.
d55e5bfc
RD
5047 """
5048 return _core_.WakeUpIdle(*args, **kwargs)
5049
5050def PostEvent(*args, **kwargs):
5051 """
5052 PostEvent(EvtHandler dest, Event event)
5053
c24da6d6
RD
5054 Send an event to a window or other wx.EvtHandler to be processed
5055 later.
d55e5bfc
RD
5056 """
5057 return _core_.PostEvent(*args, **kwargs)
5058
5059def App_CleanUp(*args, **kwargs):
5060 """
5061 App_CleanUp()
5062
79fccf9d 5063 For internal use only, it is used to cleanup after wxWidgets when
c24da6d6 5064 Python shuts down.
d55e5bfc
RD
5065 """
5066 return _core_.App_CleanUp(*args, **kwargs)
5067
5068def GetApp(*args, **kwargs):
5069 """
5070 GetApp() -> PyApp
5071
5072 Return a reference to the current wx.App object.
5073 """
5074 return _core_.GetApp(*args, **kwargs)
5075#----------------------------------------------------------------------
5076
5077class PyOnDemandOutputWindow:
5078 """
5079 A class that can be used for redirecting Python's stdout and
5080 stderr streams. It will do nothing until something is wrriten to
5081 the stream at which point it will create a Frame with a text area
5082 and write the text there.
5083 """
5084 def __init__(self, title = "wxPython: stdout/stderr"):
5085 self.frame = None
5086 self.title = title
412d302d
RD
5087 self.pos = wx.DefaultPosition
5088 self.size = (450, 300)
d55e5bfc
RD
5089 self.parent = None
5090
5091 def SetParent(self, parent):
5092 """Set the window to be used as the popup Frame's parent."""
5093 self.parent = parent
5094
5095
5096 def CreateOutputWindow(self, st):
412d302d
RD
5097 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
5098 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 5099 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 5100 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 5101 self.text.AppendText(st)
d55e5bfc
RD
5102 self.frame.Show(True)
5103 EVT_CLOSE(self.frame, self.OnCloseWindow)
5104
5105
5106 def OnCloseWindow(self, event):
5107 if self.frame is not None:
5108 self.frame.Destroy()
5109 self.frame = None
5110 self.text = None
5111
5112
5113 # These methods provide the file-like output behaviour.
5114 def write(self, text):
5115 """
5116 Create the output window if needed and write the string to it.
5117 If not called in the context of the gui thread then uses
5118 CallAfter to do the work there.
5119 """
5120 if self.frame is None:
5121 if not wx.Thread_IsMain():
5122 wx.CallAfter(self.CreateOutputWindow, text)
5123 else:
5124 self.CreateOutputWindow(text)
5125 else:
5126 if not wx.Thread_IsMain():
5127 wx.CallAfter(self.text.AppendText, text)
5128 else:
5129 self.text.AppendText(text)
5130
5131
5132 def close(self):
5133 if self.frame is not None:
5134 wx.CallAfter(self.frame.Close)
5135
5136
19272049
RD
5137 def flush(self):
5138 pass
5139
5140
d55e5bfc
RD
5141
5142#----------------------------------------------------------------------
5143
5144_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5145
5146class App(wx.PyApp):
5147 """
c24da6d6
RD
5148 The ``wx.App`` class represents the application and is used to:
5149
5150 * bootstrap the wxPython system and initialize the underlying
5151 gui toolkit
5152 * set and get application-wide properties
5153 * implement the windowing system main message or event loop,
5154 and to dispatch events to window instances
5155 * etc.
5156
5157 Every application must have a ``wx.App`` instance, and all
5158 creation of UI objects should be delayed until after the
5159 ``wx.App`` object has been created in order to ensure that the gui
5160 platform and wxWidgets have been fully initialized.
5161
5162 Normally you would derive from this class and implement an
5163 ``OnInit`` method that creates a frame and then calls
5164 ``self.SetTopWindow(frame)``.
5165
5166 :see: `wx.PySimpleApp` for a simpler app class that can be used
79fccf9d 5167 directly.
d55e5bfc 5168 """
c24da6d6 5169
d55e5bfc
RD
5170 outputWindowClass = PyOnDemandOutputWindow
5171
c24da6d6
RD
5172 def __init__(self, redirect=_defRedirect, filename=None,
5173 useBestVisual=False, clearSigInt=True):
5174 """
5175 Construct a ``wx.App`` object.
5176
5177 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5178 redirected? Defaults to True on Windows and Mac, False
5179 otherwise. If `filename` is None then output will be
5180 redirected to a window that pops up as needed. (You can
5181 control what kind of window is created for the output by
5182 resetting the class variable ``outputWindowClass`` to a
5183 class of your choosing.)
5184
5185 :param filename: The name of a file to redirect output to, if
5186 redirect is True.
5187
5188 :param useBestVisual: Should the app try to use the best
5189 available visual provided by the system (only relevant on
5190 systems that have more than one visual.) This parameter
5191 must be used instead of calling `SetUseBestVisual` later
5192 on because it must be set before the underlying GUI
5193 toolkit is initialized.
5194
5195 :param clearSigInt: Should SIGINT be cleared? This allows the
5196 app to terminate upon a Ctrl-C in the console like other
5197 GUI apps will.
5198
5199 :note: You should override OnInit to do applicaition
5200 initialization to ensure that the system, toolkit and
5201 wxWidgets are fully initialized.
5202 """
d55e5bfc
RD
5203 wx.PyApp.__init__(self)
5204
5205 if wx.Platform == "__WXMAC__":
5206 try:
5207 import MacOS
5208 if not MacOS.WMAvailable():
5209 print """\
5210This program needs access to the screen. Please run with 'pythonw',
5211not 'python', and only when you are logged in on the main display of
5212your Mac."""
5213 _sys.exit(1)
b1f29bf7
RD
5214 except SystemExit:
5215 raise
d55e5bfc
RD
5216 except:
5217 pass
5218
5219 # This has to be done before OnInit
5220 self.SetUseBestVisual(useBestVisual)
5221
5222 # Set the default handler for SIGINT. This fixes a problem
5223 # where if Ctrl-C is pressed in the console that started this
5224 # app then it will not appear to do anything, (not even send
5225 # KeyboardInterrupt???) but will later segfault on exit. By
5226 # setting the default handler then the app will exit, as
5227 # expected (depending on platform.)
c24da6d6
RD
5228 if clearSigInt:
5229 try:
5230 import signal
5231 signal.signal(signal.SIGINT, signal.SIG_DFL)
5232 except:
5233 pass
d55e5bfc
RD
5234
5235 # Save and redirect the stdio to a window?
5236 self.stdioWin = None
5237 self.saveStdio = (_sys.stdout, _sys.stderr)
5238 if redirect:
5239 self.RedirectStdio(filename)
5240
5241 # This finishes the initialization of wxWindows and then calls
5242 # the OnInit that should be present in the derived class
5243 self._BootstrapApp()
5244
5245
5246 def __del__(self):
5247 try:
5248 self.RestoreStdio() # Just in case the MainLoop was overridden
5249 except:
5250 pass
5251
5252
5253 def SetTopWindow(self, frame):
5254 """Set the \"main\" top level window"""
5255 if self.stdioWin:
5256 self.stdioWin.SetParent(frame)
5257 wx.PyApp.SetTopWindow(self, frame)
5258
5259
5260 def MainLoop(self):
5261 """Execute the main GUI event loop"""
5262 wx.PyApp.MainLoop(self)
5263 self.RestoreStdio()
5264
5265
5266 def RedirectStdio(self, filename=None):
5267 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
5268 if filename:
5269 _sys.stdout = _sys.stderr = open(filename, 'a')
5270 else:
5271 self.stdioWin = self.outputWindowClass()
5272 _sys.stdout = _sys.stderr = self.stdioWin
5273
5274
5275 def RestoreStdio(self):
5276 _sys.stdout, _sys.stderr = self.saveStdio
5277
5278
412d302d
RD
5279 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
5280 """
5281 Set the title, position and/or size of the output window if
f5b96ee1
RD
5282 the stdio has been redirected. This should be called before
5283 any output would cause the output window to be created.
412d302d
RD
5284 """
5285 if self.stdioWin:
5286 if title is not None:
5287 self.stdioWin.title = title
5288 if pos is not None:
5289 self.stdioWin.pos = pos
5290 if size is not None:
5291 self.stdioWin.size = size
5292
5293
5294
d55e5bfc 5295
c24da6d6 5296# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
5297App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5298App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5299App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5300App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5301App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5302App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5303App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5304App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5305App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5306App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5307App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
5308
5309#----------------------------------------------------------------------------
5310
5311class PySimpleApp(wx.App):
5312 """
5313 A simple application class. You can just create one of these and
5314 then then make your top level windows later, and not have to worry
c24da6d6 5315 about OnInit. For example::
d55e5bfc 5316
c24da6d6
RD
5317 app = wx.PySimpleApp()
5318 frame = wx.Frame(None, title='Hello World')
5319 frame.Show()
5320 app.MainLoop()
5321
5322 :see: `wx.App`
5323 """
5324
5325 def __init__(self, redirect=False, filename=None,
5326 useBestVisual=False, clearSigInt=True):
5327 """
5328 :see: `wx.App.__init__`
5329 """
5330 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
5331
5332 def OnInit(self):
d55e5bfc
RD
5333 return True
5334
5335
c24da6d6 5336
d55e5bfc
RD
5337# Is anybody using this one?
5338class PyWidgetTester(wx.App):
5339 def __init__(self, size = (250, 100)):
5340 self.size = size
5341 wx.App.__init__(self, 0)
5342
5343 def OnInit(self):
5344 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
5345 self.SetTopWindow(self.frame)
5346 return True
5347
c24da6d6
RD
5348 def SetWidget(self, widgetClass, *args, **kwargs):
5349 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
5350 self.frame.Show(True)
5351
5352#----------------------------------------------------------------------------
5353# DO NOT hold any other references to this object. This is how we
c24da6d6 5354# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 5355# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
c24da6d6 5356# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
5357
5358class __wxPyCleanup:
5359 def __init__(self):
5360 self.cleanup = _core_.App_CleanUp
5361 def __del__(self):
5362 self.cleanup()
5363
5364_sys.__wxPythonCleanup = __wxPyCleanup()
5365
5366## # another possible solution, but it gets called too early...
c24da6d6
RD
5367## import atexit
5368## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
5369
5370
5371#----------------------------------------------------------------------------
5372
5373#---------------------------------------------------------------------------
5374
5375class AcceleratorEntry(object):
c24da6d6
RD
5376 """
5377 A class used to define items in an `wx.AcceleratorTable`. wxPython
5378 programs can choose to use wx.AcceleratorEntry objects, but using a
5379 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
79fccf9d 5380 as well. See `__init__` for of the tuple values.
c24da6d6
RD
5381
5382 :see: `wx.AcceleratorTable`
5383 """
d55e5bfc
RD
5384 def __repr__(self):
5385 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5386 def __init__(self, *args, **kwargs):
c24da6d6
RD
5387 """
5388 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
5389
5390 Construct a wx.AcceleratorEntry.
c24da6d6 5391 """
d55e5bfc
RD
5392 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
5393 self.this = newobj.this
5394 self.thisown = 1
5395 del newobj.thisown
5396 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
5397 """__del__(self)"""
5398 try:
5399 if self.thisown: destroy(self)
5400 except: pass
5401
5402 def Set(*args, **kwargs):
c24da6d6
RD
5403 """
5404 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 5405
c24da6d6
RD
5406 (Re)set the attributes of a wx.AcceleratorEntry.
5407 :see `__init__`
5408 """
5409 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
5410
5411 def GetFlags(*args, **kwargs):
c24da6d6
RD
5412 """
5413 GetFlags(self) -> int
5414
5415 Get the AcceleratorEntry's flags.
5416 """
d55e5bfc
RD
5417 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
5418
5419 def GetKeyCode(*args, **kwargs):
c24da6d6
RD
5420 """
5421 GetKeyCode(self) -> int
5422
5423 Get the AcceleratorEntry's keycode.
5424 """
d55e5bfc
RD
5425 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
5426
5427 def GetCommand(*args, **kwargs):
c24da6d6
RD
5428 """
5429 GetCommand(self) -> int
5430
5431 Get the AcceleratorEntry's command ID.
5432 """
d55e5bfc
RD
5433 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
5434
5435
5436class AcceleratorEntryPtr(AcceleratorEntry):
5437 def __init__(self, this):
5438 self.this = this
5439 if not hasattr(self,"thisown"): self.thisown = 0
5440 self.__class__ = AcceleratorEntry
5441_core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
5442
5443class AcceleratorTable(Object):
c24da6d6
RD
5444 """
5445 An accelerator table allows the application to specify a table of
5446 keyboard shortcuts for menus or other commands. On Windows, menu or
5447 button commands are supported; on GTK, only menu commands are
5448 supported.
c24da6d6 5449 """
d55e5bfc
RD
5450 def __repr__(self):
5451 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5452 def __init__(self, *args, **kwargs):
5453 """
5454 __init__(entries) -> AcceleratorTable
5455
c24da6d6
RD
5456 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5457 items or or of 3-tuples (flags, keyCode, cmdID)
5458
5459 :see: `wx.AcceleratorEntry`
d55e5bfc
RD
5460 """
5461 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
5462 self.this = newobj.this
5463 self.thisown = 1
5464 del newobj.thisown
5465 def __del__(self, destroy=_core_.delete_AcceleratorTable):
5466 """__del__(self)"""
5467 try:
5468 if self.thisown: destroy(self)
5469 except: pass
5470
5471 def Ok(*args, **kwargs):
5472 """Ok(self) -> bool"""
5473 return _core_.AcceleratorTable_Ok(*args, **kwargs)
5474
5475
5476class AcceleratorTablePtr(AcceleratorTable):
5477 def __init__(self, this):
5478 self.this = this
5479 if not hasattr(self,"thisown"): self.thisown = 0
5480 self.__class__ = AcceleratorTable
5481_core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
5482
5483
5484def GetAccelFromString(*args, **kwargs):
5485 """GetAccelFromString(String label) -> AcceleratorEntry"""
5486 return _core_.GetAccelFromString(*args, **kwargs)
5487#---------------------------------------------------------------------------
5488
5489class VisualAttributes(object):
5490 """struct containing all the visual attributes of a control"""
5491 def __repr__(self):
5492 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5493 def __init__(self, *args, **kwargs):
5494 """
5495 __init__(self) -> VisualAttributes
5496
5497 struct containing all the visual attributes of a control
5498 """
5499 newobj = _core_.new_VisualAttributes(*args, **kwargs)
5500 self.this = newobj.this
5501 self.thisown = 1
5502 del newobj.thisown
5503 def __del__(self, destroy=_core_.delete_VisualAttributes):
5504 """__del__(self)"""
5505 try:
5506 if self.thisown: destroy(self)
5507 except: pass
5508
5509 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
5510 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
5511 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
5512
5513class VisualAttributesPtr(VisualAttributes):
5514 def __init__(self, this):
5515 self.this = this
5516 if not hasattr(self,"thisown"): self.thisown = 0
5517 self.__class__ = VisualAttributes
5518_core_.VisualAttributes_swigregister(VisualAttributesPtr)
5519NullAcceleratorTable = cvar.NullAcceleratorTable
5520PanelNameStr = cvar.PanelNameStr
5521
5522WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
5523WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
5524WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
5525WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
5526WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
5527class Window(EvtHandler):
5528 """
5529 wx.Window is the base class for all windows and represents any visible
5530 object on the screen. All controls, top level windows and so on are
5531 wx.Windows. Sizers and device contexts are not however, as they don't
5532 appear on screen themselves.
5533
5534 """
5535 def __repr__(self):
5536 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5537 def __init__(self, *args, **kwargs):
5538 """
5539 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
5540 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
5541
5542 Construct and show a generic Window.
5543 """
5544 newobj = _core_.new_Window(*args, **kwargs)
5545 self.this = newobj.this
5546 self.thisown = 1
5547 del newobj.thisown
5548 self._setOORInfo(self)
5549
5550 def Create(*args, **kwargs):
5551 """
5552 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
5553 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
5554
5555 Create the GUI part of the Window for 2-phase creation mode.
5556 """
5557 return _core_.Window_Create(*args, **kwargs)
5558
5559 def Close(*args, **kwargs):
5560 """
5561 Close(self, bool force=False) -> bool
5562
5563 This function simply generates a EVT_CLOSE event whose handler usually
5564 tries to close the window. It doesn't close the window itself,
5565 however. If force is False (the default) then the window's close
5566 handler will be allowed to veto the destruction of the window.
d55e5bfc
RD
5567 """
5568 return _core_.Window_Close(*args, **kwargs)
5569
5570 def Destroy(*args, **kwargs):
5571 """
5572 Destroy(self) -> bool
5573
5574 Destroys the window safely. Frames and dialogs are not destroyed
5575 immediately when this function is called -- they are added to a list
5576 of windows to be deleted on idle time, when all the window's events
5577 have been processed. This prevents problems with events being sent to
5578 non-existent windows.
5579
5580 Returns True if the window has either been successfully deleted, or it
5581 has been added to the list of windows pending real deletion.
5582 """
5583 return _core_.Window_Destroy(*args, **kwargs)
5584
5585 def DestroyChildren(*args, **kwargs):
5586 """
5587 DestroyChildren(self) -> bool
5588
79fccf9d
RD
5589 Destroys all children of a window. Called automatically by the
5590 destructor.
d55e5bfc
RD
5591 """
5592 return _core_.Window_DestroyChildren(*args, **kwargs)
5593
5594 def IsBeingDeleted(*args, **kwargs):
5595 """
5596 IsBeingDeleted(self) -> bool
5597
5598 Is the window in the process of being deleted?
5599 """
5600 return _core_.Window_IsBeingDeleted(*args, **kwargs)
5601
5602 def SetTitle(*args, **kwargs):
5603 """
5604 SetTitle(self, String title)
5605
5606 Sets the window's title. Applicable only to frames and dialogs.
5607 """
5608 return _core_.Window_SetTitle(*args, **kwargs)
5609
5610 def GetTitle(*args, **kwargs):
5611 """
5612 GetTitle(self) -> String
5613
5614 Gets the window's title. Applicable only to frames and dialogs.
5615 """
5616 return _core_.Window_GetTitle(*args, **kwargs)
5617
5618 def SetLabel(*args, **kwargs):
5619 """
5620 SetLabel(self, String label)
5621
5622 Set the text which the window shows in its label if applicable.
5623 """
5624 return _core_.Window_SetLabel(*args, **kwargs)
5625
5626 def GetLabel(*args, **kwargs):
5627 """
5628 GetLabel(self) -> String
5629
79fccf9d
RD
5630 Generic way of getting a label from any window, for identification
5631 purposes. The interpretation of this function differs from class to
5632 class. For frames and dialogs, the value returned is the title. For
5633 buttons or static text controls, it is the button text. This function
5634 can be useful for meta-programs such as testing tools or special-needs
5635 access programs)which need to identify windows by name.
d55e5bfc
RD
5636 """
5637 return _core_.Window_GetLabel(*args, **kwargs)
5638
5639 def SetName(*args, **kwargs):
5640 """
5641 SetName(self, String name)
5642
79fccf9d
RD
5643 Sets the window's name. The window name is used for ressource setting
5644 in X, it is not the same as the window title/label
d55e5bfc
RD
5645 """
5646 return _core_.Window_SetName(*args, **kwargs)
5647
5648 def GetName(*args, **kwargs):
5649 """
5650 GetName(self) -> String
5651
79fccf9d
RD
5652 Returns the windows name. This name is not guaranteed to be unique;
5653 it is up to the programmer to supply an appropriate name in the window
5654 constructor or via wx.Window.SetName.
d55e5bfc
RD
5655 """
5656 return _core_.Window_GetName(*args, **kwargs)
5657
5658 def SetWindowVariant(*args, **kwargs):
5659 """
5660 SetWindowVariant(self, int variant)
5661
79fccf9d
RD
5662 Sets the variant of the window/font size to use for this window, if
5663 the platform supports variants, for example, wxMac.
d55e5bfc
RD
5664 """
5665 return _core_.Window_SetWindowVariant(*args, **kwargs)
5666
5667 def GetWindowVariant(*args, **kwargs):
5668 """GetWindowVariant(self) -> int"""
5669 return _core_.Window_GetWindowVariant(*args, **kwargs)
5670
5671 def SetId(*args, **kwargs):
5672 """
5673 SetId(self, int winid)
5674
5675 Sets the identifier of the window. Each window has an integer
5676 identifier. If the application has not provided one, an identifier
5677 will be generated. Normally, the identifier should be provided on
5678 creation and should not be modified subsequently.
5679 """
5680 return _core_.Window_SetId(*args, **kwargs)
5681
5682 def GetId(*args, **kwargs):
5683 """
5684 GetId(self) -> int
5685
5686 Returns the identifier of the window. Each window has an integer
5687 identifier. If the application has not provided one (or the default Id
5688 -1 is used) then an unique identifier with a negative value will be
5689 generated.
5690 """
5691 return _core_.Window_GetId(*args, **kwargs)
5692
5693 def NewControlId(*args, **kwargs):
5694 """
c24da6d6 5695 NewControlId() -> int
d55e5bfc
RD
5696
5697 Generate a control id for the controls which were not given one.
5698 """
5699 return _core_.Window_NewControlId(*args, **kwargs)
5700
5701 NewControlId = staticmethod(NewControlId)
5702 def NextControlId(*args, **kwargs):
5703 """
c24da6d6 5704 NextControlId(int winid) -> int
d55e5bfc
RD
5705
5706 Get the id of the control following the one with the given
79fccf9d 5707 autogenerated) id
d55e5bfc
RD
5708 """
5709 return _core_.Window_NextControlId(*args, **kwargs)
5710
5711 NextControlId = staticmethod(NextControlId)
5712 def PrevControlId(*args, **kwargs):
5713 """
c24da6d6 5714 PrevControlId(int winid) -> int
d55e5bfc
RD
5715
5716 Get the id of the control preceding the one with the given
79fccf9d 5717 autogenerated) id
d55e5bfc
RD
5718 """
5719 return _core_.Window_PrevControlId(*args, **kwargs)
5720
5721 PrevControlId = staticmethod(PrevControlId)
5722 def SetSize(*args, **kwargs):
5723 """
5724 SetSize(self, Size size)
5725
5726 Sets the size of the window in pixels.
5727 """
5728 return _core_.Window_SetSize(*args, **kwargs)
5729
5730 def SetDimensions(*args, **kwargs):
5731 """
5732 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
5733
5734 Sets the position and size of the window in pixels. The sizeFlags
5735 parameter indicates the interpretation of the other params if they are
5736 -1. wx.SIZE_AUTO*: a -1 indicates that a class-specific default
5737 shoudl be used. wx.SIZE_USE_EXISTING: existing dimensions should be
5738 used if -1 values are supplied. wxSIZE_ALLOW_MINUS_ONE: allow
5739 dimensions of -1 and less to be interpreted as real dimensions, not
5740 default values.
5741 """
5742 return _core_.Window_SetDimensions(*args, **kwargs)
5743
5744 def SetRect(*args, **kwargs):
5745 """
5746 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
5747
5748 Sets the position and size of the window in pixels using a wx.Rect.
5749 """
5750 return _core_.Window_SetRect(*args, **kwargs)
5751
5752 def SetSizeWH(*args, **kwargs):
5753 """
5754 SetSizeWH(self, int width, int height)
5755
5756 Sets the size of the window in pixels.
5757 """
5758 return _core_.Window_SetSizeWH(*args, **kwargs)
5759
5760 def Move(*args, **kwargs):
5761 """
5762 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
5763
5764 Moves the window to the given position.
5765 """
5766 return _core_.Window_Move(*args, **kwargs)
5767
5768 SetPosition = Move
5769 def MoveXY(*args, **kwargs):
5770 """
5771 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
5772
5773 Moves the window to the given position.
5774 """
5775 return _core_.Window_MoveXY(*args, **kwargs)
5776
f8167d6e
RD
5777 def SetBestFittingSize(*args, **kwargs):
5778 """
5779 SetBestFittingSize(self, Size size=DefaultSize)
5780
5781 A 'Smart' SetSize that will fill in default size components with the
5782 window's *best size* values. Also set's the minsize for use with sizers.
5783 """
5784 return _core_.Window_SetBestFittingSize(*args, **kwargs)
5785
d55e5bfc
RD
5786 def Raise(*args, **kwargs):
5787 """
5788 Raise(self)
5789
5790 Raises the window to the top of the window hierarchy if it is a
5791 managed window (dialog or frame).
5792 """
5793 return _core_.Window_Raise(*args, **kwargs)
5794
5795 def Lower(*args, **kwargs):
5796 """
5797 Lower(self)
5798
5799 Lowers the window to the bottom of the window hierarchy if it is a
5800 managed window (dialog or frame).
5801 """
5802 return _core_.Window_Lower(*args, **kwargs)
5803
5804 def SetClientSize(*args, **kwargs):
5805 """
5806 SetClientSize(self, Size size)
5807
5808 This sets the size of the window client area in pixels. Using this
5809 function to size a window tends to be more device-independent than
5810 wx.Window.SetSize, since the application need not worry about what
5811 dimensions the border or title bar have when trying to fit the window
5812 around panel items, for example.
5813 """
5814 return _core_.Window_SetClientSize(*args, **kwargs)
5815
5816 def SetClientSizeWH(*args, **kwargs):
5817 """
5818 SetClientSizeWH(self, int width, int height)
5819
5820 This sets the size of the window client area in pixels. Using this
5821 function to size a window tends to be more device-independent than
5822 wx.Window.SetSize, since the application need not worry about what
5823 dimensions the border or title bar have when trying to fit the window
5824 around panel items, for example.
5825 """
5826 return _core_.Window_SetClientSizeWH(*args, **kwargs)
5827
5828 def SetClientRect(*args, **kwargs):
5829 """
5830 SetClientRect(self, Rect rect)
5831
5832 This sets the size of the window client area in pixels. Using this
5833 function to size a window tends to be more device-independent than
5834 wx.Window.SetSize, since the application need not worry about what
5835 dimensions the border or title bar have when trying to fit the window
5836 around panel items, for example.
5837 """
5838 return _core_.Window_SetClientRect(*args, **kwargs)
5839
5840 def GetPosition(*args, **kwargs):
5841 """
5842 GetPosition(self) -> Point
5843
5844 Get the window's position.
5845 """
5846 return _core_.Window_GetPosition(*args, **kwargs)
5847
5848 def GetPositionTuple(*args, **kwargs):
5849 """
5850 GetPositionTuple() -> (x,y)
5851
5852 Get the window's position.
5853 """
5854 return _core_.Window_GetPositionTuple(*args, **kwargs)
5855
5856 def GetSize(*args, **kwargs):
5857 """
5858 GetSize(self) -> Size
5859
5860 Get the window size.
5861 """
5862 return _core_.Window_GetSize(*args, **kwargs)
5863
5864 def GetSizeTuple(*args, **kwargs):
5865 """
5866 GetSizeTuple() -> (width, height)
5867
5868 Get the window size.
5869 """
5870 return _core_.Window_GetSizeTuple(*args, **kwargs)
5871
5872 def GetRect(*args, **kwargs):
5873 """
5874 GetRect(self) -> Rect
5875
5876 Returns the size and position of the window as a wx.Rect object.
5877 """
5878 return _core_.Window_GetRect(*args, **kwargs)
5879
5880 def GetClientSize(*args, **kwargs):
5881 """
5882 GetClientSize(self) -> Size
5883
5884 This gets the size of the window's 'client area' in pixels. The client
5885 area is the area which may be drawn on by the programmer, excluding
5886 title bar, border, scrollbars, etc.
5887 """
5888 return _core_.Window_GetClientSize(*args, **kwargs)
5889
5890 def GetClientSizeTuple(*args, **kwargs):
5891 """
5892 GetClientSizeTuple() -> (width, height)
5893
5894 This gets the size of the window's 'client area' in pixels. The client
5895 area is the area which may be drawn on by the programmer, excluding
5896 title bar, border, scrollbars, etc.
5897 """
5898 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
5899
5900 def GetClientAreaOrigin(*args, **kwargs):
5901 """
5902 GetClientAreaOrigin(self) -> Point
5903
5904 Get the origin of the client area of the window relative to the
5905 window's top left corner (the client area may be shifted because of
5906 the borders, scrollbars, other decorations...)
5907 """
5908 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
5909
5910 def GetClientRect(*args, **kwargs):
5911 """
5912 GetClientRect(self) -> Rect
5913
629f3c1b 5914 Get the client area position and size as a `wx.Rect` object.
d55e5bfc
RD
5915 """
5916 return _core_.Window_GetClientRect(*args, **kwargs)
5917
5918 def GetBestSize(*args, **kwargs):
5919 """
5920 GetBestSize(self) -> Size
5921
248ed943 5922 This function returns the best acceptable minimal size for the
79fccf9d
RD
5923 window, if applicable. For example, for a static text control, it will
5924 be the minimal size such that the control label is not truncated. For
5925 windows containing subwindows (suzh aswx.Panel), the size returned by
5926 this function will be the same as the size the window would have had
5927 after calling Fit.
d55e5bfc
RD
5928 """
5929 return _core_.Window_GetBestSize(*args, **kwargs)
5930
5931 def GetBestSizeTuple(*args, **kwargs):
5932 """
5933 GetBestSizeTuple() -> (width, height)
5934
248ed943 5935 This function returns the best acceptable minimal size for the
79fccf9d
RD
5936 window, if applicable. For example, for a static text control, it will
5937 be the minimal size such that the control label is not truncated. For
5938 windows containing subwindows (suzh aswx.Panel), the size returned by
5939 this function will be the same as the size the window would have had
5940 after calling Fit.
d55e5bfc
RD
5941 """
5942 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
5943
a001823c
RD
5944 def InvalidateBestSize(*args, **kwargs):
5945 """
5946 InvalidateBestSize(self)
5947
5948 Reset the cached best size value so it will be recalculated the next
5949 time it is needed.
5950 """
5951 return _core_.Window_InvalidateBestSize(*args, **kwargs)
5952
5953 def GetBestFittingSize(*args, **kwargs):
5954 """
5955 GetBestFittingSize(self) -> Size
5956
5957 This function will merge the window's best size into the window's
5958 minimum size, giving priority to the min size components, and returns
5959 the results.
5960
5961 """
5962 return _core_.Window_GetBestFittingSize(*args, **kwargs)
5963
d55e5bfc
RD
5964 def GetAdjustedBestSize(*args, **kwargs):
5965 """
5966 GetAdjustedBestSize(self) -> Size
5967
5968 This method is similar to GetBestSize, except in one
5969 thing. GetBestSize should return the minimum untruncated size of the
5970 window, while this method will return the largest of BestSize and any
5971 user specified minimum size. ie. it is the minimum size the window
5972 should currently be drawn at, not the minimal size it can possibly
5973 tolerate.
5974 """
5975 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
5976
5977 def Center(*args, **kwargs):
5978 """
5979 Center(self, int direction=BOTH)
5980
5981 Centers the window. The parameter specifies the direction for
5982 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
5983 also include wx.CENTER_ON_SCREEN flag if you want to center the window
5984 on the entire screen and not on its parent window. If it is a
5985 top-level window and has no parent then it will always be centered
5986 relative to the screen.
5987 """
5988 return _core_.Window_Center(*args, **kwargs)
5989
5990 Centre = Center
5991 def CenterOnScreen(*args, **kwargs):
5992 """
5993 CenterOnScreen(self, int dir=BOTH)
5994
5995 Center on screen (only works for top level windows)
5996 """
5997 return _core_.Window_CenterOnScreen(*args, **kwargs)
5998
5999 CentreOnScreen = CenterOnScreen
6000 def CenterOnParent(*args, **kwargs):
6001 """
6002 CenterOnParent(self, int dir=BOTH)
6003
6004 Center with respect to the the parent window
6005 """
6006 return _core_.Window_CenterOnParent(*args, **kwargs)
6007
6008 CentreOnParent = CenterOnParent
6009 def Fit(*args, **kwargs):
6010 """
6011 Fit(self)
6012
6013 Sizes the window so that it fits around its subwindows. This function
6014 won't do anything if there are no subwindows and will only really work
6015 correctly if sizers are used for the subwindows layout. Also, if the
6016 window has exactly one subwindow it is better (faster and the result
6017 is more precise as Fit adds some margin to account for fuzziness of
6018 its calculations) to call window.SetClientSize(child.GetSize())
6019 instead of calling Fit.
6020 """
6021 return _core_.Window_Fit(*args, **kwargs)
6022
6023 def FitInside(*args, **kwargs):
6024 """
6025 FitInside(self)
6026
6027 Similar to Fit, but sizes the interior (virtual) size of a
6028 window. Mainly useful with scrolled windows to reset scrollbars after
6029 sizing changes that do not trigger a size event, and/or scrolled
6030 windows without an interior sizer. This function similarly won't do
6031 anything if there are no subwindows.
6032 """
6033 return _core_.Window_FitInside(*args, **kwargs)
6034
03837c5c 6035 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
6036 """
6037 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
6038 int incH=-1)
d55e5bfc
RD
6039
6040 Allows specification of minimum and maximum window sizes, and window
6041 size increments. If a pair of values is not set (or set to -1), the
6042 default values will be used. If this function is called, the user
908b74cd
RD
6043 will not be able to size the window outside the given bounds (if it is
6044 a top-level window.) Sizers will also inspect the minimum window size
6045 and will use that value if set when calculating layout.
6046
6047 The resizing increments are only significant under Motif or Xt.
d55e5bfc 6048 """
03837c5c 6049 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 6050
03837c5c
RD
6051 def SetSizeHintsSz(*args, **kwargs):
6052 """
6053 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
6054
6055 Allows specification of minimum and maximum window sizes, and window
6056 size increments. If a pair of values is not set (or set to -1), the
6057 default values will be used. If this function is called, the user
6058 will not be able to size the window outside the given bounds (if it is
6059 a top-level window.) Sizers will also inspect the minimum window size
6060 and will use that value if set when calculating layout.
6061
6062 The resizing increments are only significant under Motif or Xt.
6063 """
6064 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
6065
6066 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 6067 """
908b74cd 6068 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
6069
6070 Allows specification of minimum and maximum virtual window sizes. If a
6071 pair of values is not set (or set to -1), the default values will be
6072 used. If this function is called, the user will not be able to size
6073 the virtual area of the window outside the given bounds.
6074 """
03837c5c
RD
6075 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
6076
6077 def SetVirtualSizeHintsSz(*args, **kwargs):
6078 """
6079 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
6080
6081 Allows specification of minimum and maximum virtual window sizes. If a
6082 pair of values is not set (or set to -1), the default values will be
6083 used. If this function is called, the user will not be able to size
6084 the virtual area of the window outside the given bounds.
6085 """
6086 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 6087
908b74cd
RD
6088 def GetMaxSize(*args, **kwargs):
6089 """GetMaxSize(self) -> Size"""
6090 return _core_.Window_GetMaxSize(*args, **kwargs)
6091
6092 def GetMinSize(*args, **kwargs):
6093 """GetMinSize(self) -> Size"""
6094 return _core_.Window_GetMinSize(*args, **kwargs)
6095
6096 def SetMinSize(*args, **kwargs):
6097 """
6098 SetMinSize(self, Size minSize)
6099
6100 A more convenient method than `SetSizeHints` for setting just the
6101 min size.
6102 """
6103 return _core_.Window_SetMinSize(*args, **kwargs)
6104
6105 def SetMaxSize(*args, **kwargs):
6106 """
6107 SetMaxSize(self, Size maxSize)
6108
6109 A more convenient method than `SetSizeHints` for setting just the
6110 max size.
6111 """
6112 return _core_.Window_SetMaxSize(*args, **kwargs)
6113
d55e5bfc
RD
6114 def GetMinWidth(*args, **kwargs):
6115 """GetMinWidth(self) -> int"""
6116 return _core_.Window_GetMinWidth(*args, **kwargs)
6117
6118 def GetMinHeight(*args, **kwargs):
6119 """GetMinHeight(self) -> int"""
6120 return _core_.Window_GetMinHeight(*args, **kwargs)
6121
6122 def GetMaxWidth(*args, **kwargs):
6123 """GetMaxWidth(self) -> int"""
6124 return _core_.Window_GetMaxWidth(*args, **kwargs)
6125
6126 def GetMaxHeight(*args, **kwargs):
6127 """GetMaxHeight(self) -> int"""
6128 return _core_.Window_GetMaxHeight(*args, **kwargs)
6129
d55e5bfc
RD
6130 def SetVirtualSize(*args, **kwargs):
6131 """
6132 SetVirtualSize(self, Size size)
6133
6134 Set the the virtual size of a window in pixels. For most windows this
6135 is just the client area of the window, but for some like scrolled
6136 windows it is more or less independent of the screen window size.
6137 """
6138 return _core_.Window_SetVirtualSize(*args, **kwargs)
6139
6140 def SetVirtualSizeWH(*args, **kwargs):
6141 """
6142 SetVirtualSizeWH(self, int w, int h)
6143
6144 Set the the virtual size of a window in pixels. For most windows this
6145 is just the client area of the window, but for some like scrolled
6146 windows it is more or less independent of the screen window size.
6147 """
6148 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
6149
6150 def GetVirtualSize(*args, **kwargs):
6151 """
6152 GetVirtualSize(self) -> Size
6153
6154 Get the the virtual size of the window in pixels. For most windows
6155 this is just the client area of the window, but for some like scrolled
6156 windows it is more or less independent of the screen window size.
6157 """
6158 return _core_.Window_GetVirtualSize(*args, **kwargs)
6159
6160 def GetVirtualSizeTuple(*args, **kwargs):
6161 """
6162 GetVirtualSizeTuple() -> (width, height)
6163
6164 Get the the virtual size of the window in pixels. For most windows
6165 this is just the client area of the window, but for some like scrolled
6166 windows it is more or less independent of the screen window size.
6167 """
6168 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
6169
6170 def GetBestVirtualSize(*args, **kwargs):
6171 """
6172 GetBestVirtualSize(self) -> Size
6173
6174 Return the largest of ClientSize and BestSize (as determined by a
6175 sizer, interior children, or other means)
6176 """
6177 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
6178
6179 def Show(*args, **kwargs):
6180 """
6181 Show(self, bool show=True) -> bool
6182
6183 Shows or hides the window. You may need to call Raise for a top level
6184 window if you want to bring it to top, although this is not needed if
6185 Show is called immediately after the frame creation. Returns True if
6186 the window has been shown or hidden or False if nothing was done
6187 because it already was in the requested state.
6188 """
6189 return _core_.Window_Show(*args, **kwargs)
6190
6191 def Hide(*args, **kwargs):
6192 """
6193 Hide(self) -> bool
6194
6195 Equivalent to calling Show(False).
6196 """
6197 return _core_.Window_Hide(*args, **kwargs)
6198
6199 def Enable(*args, **kwargs):
6200 """
6201 Enable(self, bool enable=True) -> bool
6202
6203 Enable or disable the window for user input. Note that when a parent
6204 window is disabled, all of its children are disabled as well and they
6205 are reenabled again when the parent is. Returns true if the window
6206 has been enabled or disabled, false if nothing was done, i.e. if the
6207 window had already been in the specified state.
6208 """
6209 return _core_.Window_Enable(*args, **kwargs)
6210
6211 def Disable(*args, **kwargs):
6212 """
6213 Disable(self) -> bool
6214
6215 Disables the window, same as Enable(false).
6216 """
6217 return _core_.Window_Disable(*args, **kwargs)
6218
6219 def IsShown(*args, **kwargs):
6220 """
6221 IsShown(self) -> bool
6222
6223 Returns true if the window is shown, false if it has been hidden.
6224 """
6225 return _core_.Window_IsShown(*args, **kwargs)
6226
6227 def IsEnabled(*args, **kwargs):
6228 """
6229 IsEnabled(self) -> bool
6230
6231 Returns true if the window is enabled for input, false otherwise.
6232 """
6233 return _core_.Window_IsEnabled(*args, **kwargs)
6234
6235 def SetWindowStyleFlag(*args, **kwargs):
6236 """
6237 SetWindowStyleFlag(self, long style)
6238
79fccf9d
RD
6239 Sets the style of the window. Please note that some styles cannot be
6240 changed after the window creation and that Refresh() might need to be
6241 called after changing the others for the change to take place
6242 immediately.
d55e5bfc
RD
6243 """
6244 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
6245
6246 def GetWindowStyleFlag(*args, **kwargs):
6247 """
6248 GetWindowStyleFlag(self) -> long
6249
6250 Gets the window style that was passed to the constructor or Create
6251 method.
6252 """
6253 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
6254
6255 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
6256 def HasFlag(*args, **kwargs):
6257 """
6258 HasFlag(self, int flag) -> bool
6259
6260 Test if the given style is set for this window.
6261 """
6262 return _core_.Window_HasFlag(*args, **kwargs)
6263
6264 def IsRetained(*args, **kwargs):
6265 """
6266 IsRetained(self) -> bool
6267
6268 Returns true if the window is retained, false otherwise. Retained
6269 windows are only available on X platforms.
6270 """
6271 return _core_.Window_IsRetained(*args, **kwargs)
6272
6273 def SetExtraStyle(*args, **kwargs):
6274 """
6275 SetExtraStyle(self, long exStyle)
6276
6277 Sets the extra style bits for the window. Extra styles are the less
6278 often used style bits which can't be set with the constructor or with
6279 SetWindowStyleFlag()
6280 """
6281 return _core_.Window_SetExtraStyle(*args, **kwargs)
6282
6283 def GetExtraStyle(*args, **kwargs):
6284 """
6285 GetExtraStyle(self) -> long
6286
6287 Returns the extra style bits for the window.
6288 """
6289 return _core_.Window_GetExtraStyle(*args, **kwargs)
6290
6291 def MakeModal(*args, **kwargs):
6292 """
6293 MakeModal(self, bool modal=True)
6294
6295 Disables all other windows in the application so that the user can
6296 only interact with this window. Passing False will reverse this
6297 effect.
6298 """
6299 return _core_.Window_MakeModal(*args, **kwargs)
6300
6301 def SetThemeEnabled(*args, **kwargs):
6302 """
6303 SetThemeEnabled(self, bool enableTheme)
6304
6305 This function tells a window if it should use the system's "theme"
6306 code to draw the windows' background instead if its own background
6307 drawing code. This will only have an effect on platforms that support
6308 the notion of themes in user defined windows. One such platform is
6309 GTK+ where windows can have (very colourful) backgrounds defined by a
6310 user's selected theme.
6311
6312 Dialogs, notebook pages and the status bar have this flag set to true
6313 by default so that the default look and feel is simulated best.
6314 """
6315 return _core_.Window_SetThemeEnabled(*args, **kwargs)
6316
6317 def GetThemeEnabled(*args, **kwargs):
6318 """
6319 GetThemeEnabled(self) -> bool
6320
6321 Return the themeEnabled flag.
6322 """
6323 return _core_.Window_GetThemeEnabled(*args, **kwargs)
6324
6325 def SetFocus(*args, **kwargs):
6326 """
6327 SetFocus(self)
6328
6329 Set's the focus to this window, allowing it to receive keyboard input.
6330 """
6331 return _core_.Window_SetFocus(*args, **kwargs)
6332
6333 def SetFocusFromKbd(*args, **kwargs):
6334 """
6335 SetFocusFromKbd(self)
6336
6337 Set focus to this window as the result of a keyboard action. Normally
6338 only called internally.
6339 """
6340 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
6341
6342 def FindFocus(*args, **kwargs):
6343 """
c24da6d6 6344 FindFocus() -> Window
d55e5bfc
RD
6345
6346 Returns the window or control that currently has the keyboard focus,
6347 or None.
6348 """
6349 return _core_.Window_FindFocus(*args, **kwargs)
6350
6351 FindFocus = staticmethod(FindFocus)
6352 def AcceptsFocus(*args, **kwargs):
6353 """
6354 AcceptsFocus(self) -> bool
6355
6356 Can this window have focus?
6357 """
6358 return _core_.Window_AcceptsFocus(*args, **kwargs)
6359
6360 def AcceptsFocusFromKeyboard(*args, **kwargs):
6361 """
6362 AcceptsFocusFromKeyboard(self) -> bool
6363
6364 Can this window be given focus by keyboard navigation? if not, the
6365 only way to give it focus (provided it accepts it at all) is to click
6366 it.
6367 """
6368 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
6369
6370 def GetDefaultItem(*args, **kwargs):
6371 """
6372 GetDefaultItem(self) -> Window
6373
6374 Get the default child of this parent, i.e. the one which is activated
6375 by pressing <Enter> such as the OK button on a wx.Dialog.
6376 """
6377 return _core_.Window_GetDefaultItem(*args, **kwargs)
6378
6379 def SetDefaultItem(*args, **kwargs):
6380 """
6381 SetDefaultItem(self, Window child) -> Window
6382
6383 Set this child as default, return the old default.
6384 """
6385 return _core_.Window_SetDefaultItem(*args, **kwargs)
6386
6387 def SetTmpDefaultItem(*args, **kwargs):
6388 """
6389 SetTmpDefaultItem(self, Window win)
6390
6391 Set this child as temporary default
6392 """
6393 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
6394
908b74cd
RD
6395 def Navigate(*args, **kwargs):
6396 """
6397 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6398
a8eff060
RD
6399 Does keyboard navigation from this window to another, by sending a
6400 `wx.NavigationKeyEvent`.
908b74cd
RD
6401 """
6402 return _core_.Window_Navigate(*args, **kwargs)
6403
bf26d883
RD
6404 def MoveAfterInTabOrder(*args, **kwargs):
6405 """
6406 MoveAfterInTabOrder(self, Window win)
6407
6408 Moves this window in the tab navigation order after the specified
6409 sibling window. This means that when the user presses the TAB key on
6410 that other window, the focus switches to this window.
6411
6412 The default tab order is the same as creation order. This function
6413 and `MoveBeforeInTabOrder` allow to change it after creating all the
6414 windows.
6415
6416 """
6417 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
6418
6419 def MoveBeforeInTabOrder(*args, **kwargs):
6420 """
6421 MoveBeforeInTabOrder(self, Window win)
6422
6423 Same as `MoveAfterInTabOrder` except that it inserts this window just
6424 before win instead of putting it right after it.
6425 """
6426 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
6427
d55e5bfc
RD
6428 def GetChildren(*args, **kwargs):
6429 """
6430 GetChildren(self) -> PyObject
6431
6432 Returns a list of the window's children. NOTE: Currently this is a
6433 copy of the child window list maintained by the window, so the return
6434 value of this function is only valid as long as the window's children
6435 do not change.
6436 """
6437 return _core_.Window_GetChildren(*args, **kwargs)
6438
6439 def GetParent(*args, **kwargs):
6440 """
6441 GetParent(self) -> Window
6442
6443 Returns the parent window of this window, or None if there isn't one.
6444 """
6445 return _core_.Window_GetParent(*args, **kwargs)
6446
6447 def GetGrandParent(*args, **kwargs):
6448 """
6449 GetGrandParent(self) -> Window
6450
79fccf9d
RD
6451 Returns the parent of the parent of this window, or None if there
6452 isn't one.
d55e5bfc
RD
6453 """
6454 return _core_.Window_GetGrandParent(*args, **kwargs)
6455
6456 def IsTopLevel(*args, **kwargs):
6457 """
6458 IsTopLevel(self) -> bool
6459
6460 Returns true if the given window is a top-level one. Currently all
6461 frames and dialogs are always considered to be top-level windows (even
6462 if they have a parent window).
6463 """
6464 return _core_.Window_IsTopLevel(*args, **kwargs)
6465
6466 def Reparent(*args, **kwargs):
6467 """
6468 Reparent(self, Window newParent) -> bool
6469
6470 Reparents the window, i.e the window will be removed from its current
6471 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6472 re-inserted into another. Available on Windows and GTK. Returns True
6473 if the parent was changed, False otherwise (error or newParent ==
6474 oldParent)
6475 """
6476 return _core_.Window_Reparent(*args, **kwargs)
6477
6478 def AddChild(*args, **kwargs):
6479 """
6480 AddChild(self, Window child)
6481
6482 Adds a child window. This is called automatically by window creation
6483 functions so should not be required by the application programmer.
6484 """
6485 return _core_.Window_AddChild(*args, **kwargs)
6486
6487 def RemoveChild(*args, **kwargs):
6488 """
6489 RemoveChild(self, Window child)
6490
6491 Removes a child window. This is called automatically by window
6492 deletion functions so should not be required by the application
6493 programmer.
6494 """
6495 return _core_.Window_RemoveChild(*args, **kwargs)
6496
6497 def FindWindowById(*args, **kwargs):
6498 """
6499 FindWindowById(self, long winid) -> Window
6500
6501 Find a chld of this window by window ID
6502 """
6503 return _core_.Window_FindWindowById(*args, **kwargs)
6504
6505 def FindWindowByName(*args, **kwargs):
6506 """
6507 FindWindowByName(self, String name) -> Window
6508
6509 Find a child of this window by name
6510 """
6511 return _core_.Window_FindWindowByName(*args, **kwargs)
6512
6513 def GetEventHandler(*args, **kwargs):
6514 """
6515 GetEventHandler(self) -> EvtHandler
6516
6517 Returns the event handler for this window. By default, the window is
6518 its own event handler.
6519 """
6520 return _core_.Window_GetEventHandler(*args, **kwargs)
6521
6522 def SetEventHandler(*args, **kwargs):
6523 """
6524 SetEventHandler(self, EvtHandler handler)
6525
6526 Sets the event handler for this window. An event handler is an object
6527 that is capable of processing the events sent to a window. By default,
6528 the window is its own event handler, but an application may wish to
6529 substitute another, for example to allow central implementation of
6530 event-handling for a variety of different window classes.
6531
79fccf9d 6532 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
6533 up a chain of event handlers, where an event not handled by one event
6534 handler is handed to the next one in the chain.
6535 """
6536 return _core_.Window_SetEventHandler(*args, **kwargs)
6537
6538 def PushEventHandler(*args, **kwargs):
6539 """
6540 PushEventHandler(self, EvtHandler handler)
6541
6542 Pushes this event handler onto the event handler stack for the window.
6543 An event handler is an object that is capable of processing the events
6544 sent to a window. By default, the window is its own event handler, but
6545 an application may wish to substitute another, for example to allow
6546 central implementation of event-handling for a variety of different
6547 window classes.
6548
6549 wx.Window.PushEventHandler allows an application to set up a chain of
6550 event handlers, where an event not handled by one event handler is
79fccf9d 6551 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
6552 remove the event handler.
6553 """
6554 return _core_.Window_PushEventHandler(*args, **kwargs)
6555
6556 def PopEventHandler(*args, **kwargs):
6557 """
6558 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
6559
6560 Removes and returns the top-most event handler on the event handler
6561 stack. If deleteHandler is True then the wx.EvtHandler object will be
6562 destroyed after it is popped.
6563 """
6564 return _core_.Window_PopEventHandler(*args, **kwargs)
6565
6566 def RemoveEventHandler(*args, **kwargs):
6567 """
6568 RemoveEventHandler(self, EvtHandler handler) -> bool
6569
79fccf9d
RD
6570 Find the given handler in the event handler chain and remove (but not
6571 delete) it from the event handler chain, return True if it was found
6572 and False otherwise (this also results in an assert failure so this
6573 function should only be called when the handler is supposed to be
6574 there.)
d55e5bfc
RD
6575 """
6576 return _core_.Window_RemoveEventHandler(*args, **kwargs)
6577
6578 def SetValidator(*args, **kwargs):
6579 """
6580 SetValidator(self, Validator validator)
6581
6582 Deletes the current validator (if any) and sets the window validator,
6583 having called wx.Validator.Clone to create a new validator of this
6584 type.
6585 """
6586 return _core_.Window_SetValidator(*args, **kwargs)
6587
6588 def GetValidator(*args, **kwargs):
6589 """
6590 GetValidator(self) -> Validator
6591
6592 Returns a pointer to the current validator for the window, or None if
6593 there is none.
6594 """
6595 return _core_.Window_GetValidator(*args, **kwargs)
6596
6597 def Validate(*args, **kwargs):
6598 """
6599 Validate(self) -> bool
6600
6601 Validates the current values of the child controls using their
79fccf9d
RD
6602 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6603 style flag set, the method will also call Validate() of all child
6604 windows. Returns false if any of the validations failed.
d55e5bfc
RD
6605 """
6606 return _core_.Window_Validate(*args, **kwargs)
6607
6608 def TransferDataToWindow(*args, **kwargs):
6609 """
6610 TransferDataToWindow(self) -> bool
6611
79fccf9d
RD
6612 Transfers values to child controls from data areas specified by their
6613 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6614 style flag set, the method will also call TransferDataToWindow() of
6615 all child windows.
d55e5bfc
RD
6616 """
6617 return _core_.Window_TransferDataToWindow(*args, **kwargs)
6618
6619 def TransferDataFromWindow(*args, **kwargs):
6620 """
6621 TransferDataFromWindow(self) -> bool
6622
79fccf9d
RD
6623 Transfers values from child controls to data areas specified by their
6624 validators. Returns false if a transfer failed. If the window has
6625 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
6626 also call TransferDataFromWindow() of all child windows.
d55e5bfc
RD
6627 """
6628 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
6629
6630 def InitDialog(*args, **kwargs):
6631 """
6632 InitDialog(self)
6633
79fccf9d
RD
6634 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
6635 to the dialog via validators.
d55e5bfc
RD
6636 """
6637 return _core_.Window_InitDialog(*args, **kwargs)
6638
6639 def SetAcceleratorTable(*args, **kwargs):
6640 """
6641 SetAcceleratorTable(self, AcceleratorTable accel)
6642
6643 Sets the accelerator table for this window.
6644 """
6645 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
6646
6647 def GetAcceleratorTable(*args, **kwargs):
6648 """
6649 GetAcceleratorTable(self) -> AcceleratorTable
6650
6651 Gets the accelerator table for this window.
6652 """
6653 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
6654
6655 def RegisterHotKey(*args, **kwargs):
6656 """
6657 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
6658
6659 Registers a system wide hotkey. Every time the user presses the hotkey
6660 registered here, this window will receive a hotkey event. It will
6661 receive the event even if the application is in the background and
6662 does not have the input focus because the user is working with some
6663 other application. To bind an event handler function to this hotkey
6664 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
6665 hotkey was registered successfully.
6666 """
6667 return _core_.Window_RegisterHotKey(*args, **kwargs)
6668
6669 def UnregisterHotKey(*args, **kwargs):
6670 """
6671 UnregisterHotKey(self, int hotkeyId) -> bool
6672
6673 Unregisters a system wide hotkey.
6674 """
6675 return _core_.Window_UnregisterHotKey(*args, **kwargs)
6676
6677 def ConvertDialogPointToPixels(*args, **kwargs):
6678 """
6679 ConvertDialogPointToPixels(self, Point pt) -> Point
6680
6681 Converts a point or size from dialog units to pixels. Dialog units
6682 are used for maintaining a dialog's proportions even if the font
6683 changes. For the x dimension, the dialog units are multiplied by the
6684 average character width and then divided by 4. For the y dimension,
6685 the dialog units are multiplied by the average character height and
6686 then divided by 8.
6687 """
6688 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
6689
6690 def ConvertDialogSizeToPixels(*args, **kwargs):
6691 """
6692 ConvertDialogSizeToPixels(self, Size sz) -> Size
6693
6694 Converts a point or size from dialog units to pixels. Dialog units
6695 are used for maintaining a dialog's proportions even if the font
6696 changes. For the x dimension, the dialog units are multiplied by the
6697 average character width and then divided by 4. For the y dimension,
6698 the dialog units are multiplied by the average character height and
6699 then divided by 8.
6700 """
6701 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
6702
6703 def DLG_PNT(*args, **kwargs):
6704 """
6705 DLG_PNT(self, Point pt) -> Point
6706
6707 Converts a point or size from dialog units to pixels. Dialog units
6708 are used for maintaining a dialog's proportions even if the font
6709 changes. For the x dimension, the dialog units are multiplied by the
6710 average character width and then divided by 4. For the y dimension,
6711 the dialog units are multiplied by the average character height and
6712 then divided by 8.
6713 """
6714 return _core_.Window_DLG_PNT(*args, **kwargs)
6715
6716 def DLG_SZE(*args, **kwargs):
6717 """
6718 DLG_SZE(self, Size sz) -> Size
6719
6720 Converts a point or size from dialog units to pixels. Dialog units
6721 are used for maintaining a dialog's proportions even if the font
6722 changes. For the x dimension, the dialog units are multiplied by the
6723 average character width and then divided by 4. For the y dimension,
6724 the dialog units are multiplied by the average character height and
6725 then divided by 8.
6726 """
6727 return _core_.Window_DLG_SZE(*args, **kwargs)
6728
6729 def ConvertPixelPointToDialog(*args, **kwargs):
6730 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
6731 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
6732
6733 def ConvertPixelSizeToDialog(*args, **kwargs):
6734 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
6735 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
6736
6737 def WarpPointer(*args, **kwargs):
6738 """
6739 WarpPointer(self, int x, int y)
6740
6741 Moves the pointer to the given position on the window.
6742
6743 NOTE: This function is not supported under Mac because Apple Human
6744 Interface Guidelines forbid moving the mouse cursor programmatically.
6745 """
6746 return _core_.Window_WarpPointer(*args, **kwargs)
6747
6748 def CaptureMouse(*args, **kwargs):
6749 """
6750 CaptureMouse(self)
6751
6752 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
6753 release the capture.
6754
6755 Note that wxWindows maintains the stack of windows having captured the
6756 mouse and when the mouse is released the capture returns to the window
6757 which had had captured it previously and it is only really released if
6758 there were no previous window. In particular, this means that you must
6759 release the mouse as many times as you capture it.
6760 """
6761 return _core_.Window_CaptureMouse(*args, **kwargs)
6762
6763 def ReleaseMouse(*args, **kwargs):
6764 """
6765 ReleaseMouse(self)
6766
6767 Releases mouse input captured with wx.Window.CaptureMouse.
6768 """
6769 return _core_.Window_ReleaseMouse(*args, **kwargs)
6770
6771 def GetCapture(*args, **kwargs):
6772 """
c24da6d6 6773 GetCapture() -> Window
d55e5bfc
RD
6774
6775 Returns the window which currently captures the mouse or None
6776 """
6777 return _core_.Window_GetCapture(*args, **kwargs)
6778
6779 GetCapture = staticmethod(GetCapture)
6780 def HasCapture(*args, **kwargs):
6781 """
6782 HasCapture(self) -> bool
6783
6784 Returns true if this window has the current mouse capture.
6785 """
6786 return _core_.Window_HasCapture(*args, **kwargs)
6787
6788 def Refresh(*args, **kwargs):
6789 """
6790 Refresh(self, bool eraseBackground=True, Rect rect=None)
6791
6792 Mark the specified rectangle (or the whole window) as "dirty" so it
6793 will be repainted. Causes an EVT_PAINT event to be generated and sent
6794 to the window.
6795 """
6796 return _core_.Window_Refresh(*args, **kwargs)
6797
6798 def RefreshRect(*args, **kwargs):
6799 """
6800 RefreshRect(self, Rect rect)
6801
6802 Redraws the contents of the given rectangle: the area inside it will
6803 be repainted. This is the same as Refresh but has a nicer syntax.
6804 """
6805 return _core_.Window_RefreshRect(*args, **kwargs)
6806
6807 def Update(*args, **kwargs):
6808 """
6809 Update(self)
6810
6811 Calling this method immediately repaints the invalidated area of the
6812 window instead of waiting for the EVT_PAINT event to happen, (normally
6813 this would usually only happen when the flow of control returns to the
6814 event loop.) Notice that this function doesn't refresh the window and
6815 does nothing if the window has been already repainted. Use Refresh
6816 first if you want to immediately redraw the window (or some portion of
6817 it) unconditionally.
6818 """
6819 return _core_.Window_Update(*args, **kwargs)
6820
6821 def ClearBackground(*args, **kwargs):
6822 """
6823 ClearBackground(self)
6824
6825 Clears the window by filling it with the current background
6826 colour. Does not cause an erase background event to be generated.
6827 """
6828 return _core_.Window_ClearBackground(*args, **kwargs)
6829
6830 def Freeze(*args, **kwargs):
6831 """
6832 Freeze(self)
6833
79fccf9d
RD
6834 Freezes the window or, in other words, prevents any updates from
6835 taking place on screen, the window is not redrawn at all. Thaw must be
6836 called to reenable window redrawing. Calls to Freeze/Thaw may be
6837 nested, with the actual Thaw being delayed until all the nesting has
6838 been undone.
d55e5bfc
RD
6839
6840 This method is useful for visual appearance optimization (for example,
6841 it is a good idea to use it before inserting large amount of text into
6842 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
6843 for all controls so it is mostly just a hint to wxWindows and not a
6844 mandatory directive.
6845 """
6846 return _core_.Window_Freeze(*args, **kwargs)
6847
6848 def Thaw(*args, **kwargs):
6849 """
6850 Thaw(self)
6851
6852 Reenables window updating after a previous call to Freeze. Calls to
79fccf9d
RD
6853 Freeze/Thaw may be nested, so Thaw must be called the same number of
6854 times that Freeze was before the window will be updated.
d55e5bfc
RD
6855 """
6856 return _core_.Window_Thaw(*args, **kwargs)
6857
6858 def PrepareDC(*args, **kwargs):
6859 """
6860 PrepareDC(self, DC dc)
6861
6862 Call this function to prepare the device context for drawing a
6863 scrolled image. It sets the device origin according to the current
6864 scroll position.
6865 """
6866 return _core_.Window_PrepareDC(*args, **kwargs)
6867
6868 def GetUpdateRegion(*args, **kwargs):
6869 """
6870 GetUpdateRegion(self) -> Region
6871
6872 Returns the region specifying which parts of the window have been
6873 damaged. Should only be called within an EVT_PAINT handler.
6874 """
6875 return _core_.Window_GetUpdateRegion(*args, **kwargs)
6876
6877 def GetUpdateClientRect(*args, **kwargs):
6878 """
6879 GetUpdateClientRect(self) -> Rect
6880
6881 Get the update rectangle region bounding box in client coords.
6882 """
6883 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
6884
6885 def IsExposed(*args, **kwargs):
6886 """
6887 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
6888
6889 Returns true if the given point or rectangle area has been exposed
6890 since the last repaint. Call this in an paint event handler to
6891 optimize redrawing by only redrawing those areas, which have been
6892 exposed.
6893 """
6894 return _core_.Window_IsExposed(*args, **kwargs)
6895
6896 def IsExposedPoint(*args, **kwargs):
6897 """
6898 IsExposedPoint(self, Point pt) -> bool
6899
6900 Returns true if the given point or rectangle area has been exposed
6901 since the last repaint. Call this in an paint event handler to
6902 optimize redrawing by only redrawing those areas, which have been
6903 exposed.
6904 """
6905 return _core_.Window_IsExposedPoint(*args, **kwargs)
6906
6907 def IsExposedRect(*args, **kwargs):
6908 """
6909 IsExposedRect(self, Rect rect) -> bool
6910
6911 Returns true if the given point or rectangle area has been exposed
6912 since the last repaint. Call this in an paint event handler to
6913 optimize redrawing by only redrawing those areas, which have been
6914 exposed.
6915 """
6916 return _core_.Window_IsExposedRect(*args, **kwargs)
6917
6918 def GetDefaultAttributes(*args, **kwargs):
6919 """
6920 GetDefaultAttributes(self) -> VisualAttributes
6921
79fccf9d
RD
6922 Get the default attributes for an instance of this class. This is
6923 useful if you want to use the same font or colour in your own control
6924 as in a standard control -- which is a much better idea than hard
6925 coding specific colours or fonts which might look completely out of
caef1a4d 6926 place on the user's system, especially if it uses themes.
d55e5bfc
RD
6927 """
6928 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
6929
6930 def GetClassDefaultAttributes(*args, **kwargs):
6931 """
c24da6d6 6932 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 6933
79fccf9d
RD
6934 Get the default attributes for this class. This is useful if you want
6935 to use the same font or colour in your own control as in a standard
6936 control -- which is a much better idea than hard coding specific
caef1a4d
RD
6937 colours or fonts which might look completely out of place on the
6938 user's system, especially if it uses themes.
d55e5bfc
RD
6939
6940 The variant parameter is only relevant under Mac currently and is
79fccf9d 6941 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
6942 the returned font. See `wx.Window.SetWindowVariant` for more about
6943 this.
d55e5bfc
RD
6944 """
6945 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
6946
6947 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
6948 def SetBackgroundColour(*args, **kwargs):
6949 """
6950 SetBackgroundColour(self, Colour colour) -> bool
6951
6952 Sets the background colour of the window. Returns True if the colour
6953 was changed. The background colour is usually painted by the default
6954 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
6955 automatically under GTK. Using `wx.NullColour` will reset the window
6956 to the default background colour.
d55e5bfc 6957
caef1a4d 6958 Note that setting the background colour may not cause an immediate
f8167d6e 6959 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
6960 calling this function.
6961
f8167d6e
RD
6962 Using this function will disable attempts to use themes for this
6963 window, if the system supports them. Use with care since usually the
6964 themes represent the appearance chosen by the user to be used for all
6965 applications on the system.
d55e5bfc
RD
6966 """
6967 return _core_.Window_SetBackgroundColour(*args, **kwargs)
6968
412d302d
RD
6969 def SetOwnBackgroundColour(*args, **kwargs):
6970 """SetOwnBackgroundColour(self, Colour colour)"""
6971 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
6972
6973 def SetForegroundColour(*args, **kwargs):
6974 """
6975 SetForegroundColour(self, Colour colour) -> bool
6976
6977 Sets the foreground colour of the window. Returns True is the colour
6978 was changed. The interpretation of foreground colour is dependent on
6979 the window class; it may be the text colour or other colour, or it may
6980 not be used at all.
6981 """
6982 return _core_.Window_SetForegroundColour(*args, **kwargs)
6983
fa47d7a7
VS
6984 def SetOwnForegroundColour(*args, **kwargs):
6985 """SetOwnForegroundColour(self, Colour colour)"""
6986 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
6987
6988 def GetBackgroundColour(*args, **kwargs):
6989 """
6990 GetBackgroundColour(self) -> Colour
6991
6992 Returns the background colour of the window.
6993 """
6994 return _core_.Window_GetBackgroundColour(*args, **kwargs)
6995
6996 def GetForegroundColour(*args, **kwargs):
6997 """
6998 GetForegroundColour(self) -> Colour
6999
7000 Returns the foreground colour of the window. The interpretation of
7001 foreground colour is dependent on the window class; it may be the text
7002 colour or other colour, or it may not be used at all.
7003 """
7004 return _core_.Window_GetForegroundColour(*args, **kwargs)
7005
7006 def SetCursor(*args, **kwargs):
7007 """
7008 SetCursor(self, Cursor cursor) -> bool
7009
7010 Sets the window's cursor. Notice that the window cursor also sets it
7011 for the children of the window implicitly.
7012
7013 The cursor may be wx.NullCursor in which case the window cursor will
7014 be reset back to default.
7015 """
7016 return _core_.Window_SetCursor(*args, **kwargs)
7017
7018 def GetCursor(*args, **kwargs):
7019 """
7020 GetCursor(self) -> Cursor
7021
7022 Return the cursor associated with this window.
7023 """
7024 return _core_.Window_GetCursor(*args, **kwargs)
7025
7026 def SetFont(*args, **kwargs):
7027 """
7028 SetFont(self, Font font) -> bool
7029
7030 Sets the font for this window.
7031 """
7032 return _core_.Window_SetFont(*args, **kwargs)
7033
fa47d7a7
VS
7034 def SetOwnFont(*args, **kwargs):
7035 """SetOwnFont(self, Font font)"""
7036 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
7037
7038 def GetFont(*args, **kwargs):
7039 """
7040 GetFont(self) -> Font
7041
7042 Returns the default font used for this window.
7043 """
7044 return _core_.Window_GetFont(*args, **kwargs)
7045
7046 def SetCaret(*args, **kwargs):
7047 """
7048 SetCaret(self, Caret caret)
7049
7050 Sets the caret associated with the window.
7051 """
7052 return _core_.Window_SetCaret(*args, **kwargs)
7053
7054 def GetCaret(*args, **kwargs):
7055 """
7056 GetCaret(self) -> Caret
7057
7058 Returns the caret associated with the window.
7059 """
7060 return _core_.Window_GetCaret(*args, **kwargs)
7061
7062 def GetCharHeight(*args, **kwargs):
7063 """
7064 GetCharHeight(self) -> int
7065
7066 Get the (average) character size for the current font.
7067 """
7068 return _core_.Window_GetCharHeight(*args, **kwargs)
7069
7070 def GetCharWidth(*args, **kwargs):
7071 """
7072 GetCharWidth(self) -> int
7073
7074 Get the (average) character size for the current font.
7075 """
7076 return _core_.Window_GetCharWidth(*args, **kwargs)
7077
7078 def GetTextExtent(*args, **kwargs):
a8eff060
RD
7079 """
7080 GetTextExtent(String string) -> (width, height)
7081
7082 Get the width and height of the text using the current font.
7083 """
d55e5bfc
RD
7084 return _core_.Window_GetTextExtent(*args, **kwargs)
7085
7086 def GetFullTextExtent(*args, **kwargs):
7087 """
7088 GetFullTextExtent(String string, Font font=None) ->
7089 (width, height, descent, externalLeading)
7090
7091 Get the width, height, decent and leading of the text using the
7092 current or specified font.
7093 """
7094 return _core_.Window_GetFullTextExtent(*args, **kwargs)
7095
7096 def ClientToScreenXY(*args, **kwargs):
7097 """
7098 ClientToScreenXY(int x, int y) -> (x,y)
7099
7100 Converts to screen coordinates from coordinates relative to this window.
7101 """
7102 return _core_.Window_ClientToScreenXY(*args, **kwargs)
7103
7104 def ScreenToClientXY(*args, **kwargs):
7105 """
7106 ScreenToClientXY(int x, int y) -> (x,y)
7107
7108 Converts from screen to client window coordinates.
7109 """
7110 return _core_.Window_ScreenToClientXY(*args, **kwargs)
7111
7112 def ClientToScreen(*args, **kwargs):
7113 """
7114 ClientToScreen(self, Point pt) -> Point
7115
7116 Converts to screen coordinates from coordinates relative to this window.
7117 """
7118 return _core_.Window_ClientToScreen(*args, **kwargs)
7119
7120 def ScreenToClient(*args, **kwargs):
7121 """
7122 ScreenToClient(self, Point pt) -> Point
7123
7124 Converts from screen to client window coordinates.
7125 """
7126 return _core_.Window_ScreenToClient(*args, **kwargs)
7127
7128 def HitTestXY(*args, **kwargs):
7129 """
7130 HitTestXY(self, int x, int y) -> int
7131
7132 Test where the given (in client coords) point lies
7133 """
7134 return _core_.Window_HitTestXY(*args, **kwargs)
7135
7136 def HitTest(*args, **kwargs):
7137 """
7138 HitTest(self, Point pt) -> int
7139
7140 Test where the given (in client coords) point lies
7141 """
7142 return _core_.Window_HitTest(*args, **kwargs)
7143
7144 def GetBorder(*args):
7145 """
7146 GetBorder(self, long flags) -> int
7147 GetBorder(self) -> int
7148
7149 Get border for the flags of this window
7150 """
7151 return _core_.Window_GetBorder(*args)
7152
7153 def UpdateWindowUI(*args, **kwargs):
7154 """
7155 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
7156
7157 This function sends EVT_UPDATE_UI events to the window. The particular
7158 implementation depends on the window; for example a wx.ToolBar will
7159 send an update UI event for each toolbar button, and a wx.Frame will
7160 send an update UI event for each menubar menu item. You can call this
7161 function from your application to ensure that your UI is up-to-date at
7162 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7163 concerned). This may be necessary if you have called
7164 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7165 limit the overhead that wxWindows incurs by sending update UI events
7166 in idle time.
d55e5bfc
RD
7167 """
7168 return _core_.Window_UpdateWindowUI(*args, **kwargs)
7169
7170 def PopupMenuXY(*args, **kwargs):
7171 """
7a0b95b0 7172 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 7173
7a0b95b0
RD
7174 Pops up the given menu at the specified coordinates, relative to this window,
7175 and returns control when the user has dismissed the menu. If a menu item is
7176 selected, the corresponding menu event is generated and will be processed as
7177 usual. If the default position is given then the current position of the
7178 mouse cursor will be used.
d55e5bfc
RD
7179 """
7180 return _core_.Window_PopupMenuXY(*args, **kwargs)
7181
7182 def PopupMenu(*args, **kwargs):
7183 """
7a0b95b0 7184 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 7185
7a0b95b0
RD
7186 Pops up the given menu at the specified coordinates, relative to this window,
7187 and returns control when the user has dismissed the menu. If a menu item is
7188 selected, the corresponding menu event is generated and will be processed as
7189 usual. If the default position is given then the current position of the
7190 mouse cursor will be used.
d55e5bfc
RD
7191 """
7192 return _core_.Window_PopupMenu(*args, **kwargs)
7193
7194 def GetHandle(*args, **kwargs):
7195 """
7196 GetHandle(self) -> long
7197
7198 Returns the platform-specific handle (as a long integer) of the
7199 physical window. Currently on wxMac it returns the handle of the
7200 toplevel parent of the window.
7201 """
7202 return _core_.Window_GetHandle(*args, **kwargs)
7203
7204 def OnPaint(*args, **kwargs):
7205 """OnPaint(self, PaintEvent event)"""
7206 return _core_.Window_OnPaint(*args, **kwargs)
7207
7208 def HasScrollbar(*args, **kwargs):
7209 """
7210 HasScrollbar(self, int orient) -> bool
7211
7212 Does the window have the scrollbar for this orientation?
7213 """
7214 return _core_.Window_HasScrollbar(*args, **kwargs)
7215
7216 def SetScrollbar(*args, **kwargs):
7217 """
79fccf9d 7218 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
7219 bool refresh=True)
7220
7221 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc
RD
7222 """
7223 return _core_.Window_SetScrollbar(*args, **kwargs)
7224
7225 def SetScrollPos(*args, **kwargs):
7226 """
7227 SetScrollPos(self, int orientation, int pos, bool refresh=True)
7228
7229 Sets the position of one of the built-in scrollbars.
7230 """
7231 return _core_.Window_SetScrollPos(*args, **kwargs)
7232
7233 def GetScrollPos(*args, **kwargs):
7234 """
7235 GetScrollPos(self, int orientation) -> int
7236
7237 Returns the built-in scrollbar position.
7238 """
7239 return _core_.Window_GetScrollPos(*args, **kwargs)
7240
7241 def GetScrollThumb(*args, **kwargs):
7242 """
7243 GetScrollThumb(self, int orientation) -> int
7244
7245 Returns the built-in scrollbar thumb size.
7246 """
7247 return _core_.Window_GetScrollThumb(*args, **kwargs)
7248
7249 def GetScrollRange(*args, **kwargs):
7250 """
7251 GetScrollRange(self, int orientation) -> int
7252
7253 Returns the built-in scrollbar range.
7254 """
7255 return _core_.Window_GetScrollRange(*args, **kwargs)
7256
7257 def ScrollWindow(*args, **kwargs):
7258 """
7259 ScrollWindow(self, int dx, int dy, Rect rect=None)
7260
7261 Physically scrolls the pixels in the window and move child windows
7262 accordingly. Use this function to optimise your scrolling
7263 implementations, to minimise the area that must be redrawn. Note that
7264 it is rarely required to call this function from a user program.
d55e5bfc
RD
7265 """
7266 return _core_.Window_ScrollWindow(*args, **kwargs)
7267
7268 def ScrollLines(*args, **kwargs):
7269 """
7270 ScrollLines(self, int lines) -> bool
7271
7272 If the platform and window class supports it, scrolls the window by
7273 the given number of lines down, if lines is positive, or up if lines
7274 is negative. Returns True if the window was scrolled, False if it was
7275 already on top/bottom and nothing was done.
7276 """
7277 return _core_.Window_ScrollLines(*args, **kwargs)
7278
7279 def ScrollPages(*args, **kwargs):
7280 """
7281 ScrollPages(self, int pages) -> bool
7282
79fccf9d 7283 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
7284 the given number of pages down, if pages is positive, or up if pages
7285 is negative. Returns True if the window was scrolled, False if it was
7286 already on top/bottom and nothing was done.
7287 """
7288 return _core_.Window_ScrollPages(*args, **kwargs)
7289
7290 def LineUp(*args, **kwargs):
7291 """
7292 LineUp(self) -> bool
7293
7294 This is just a wrapper for ScrollLines(-1).
7295 """
7296 return _core_.Window_LineUp(*args, **kwargs)
7297
7298 def LineDown(*args, **kwargs):
7299 """
7300 LineDown(self) -> bool
7301
7302 This is just a wrapper for ScrollLines(1).
7303 """
7304 return _core_.Window_LineDown(*args, **kwargs)
7305
7306 def PageUp(*args, **kwargs):
7307 """
7308 PageUp(self) -> bool
7309
7310 This is just a wrapper for ScrollPages(-1).
7311 """
7312 return _core_.Window_PageUp(*args, **kwargs)
7313
7314 def PageDown(*args, **kwargs):
7315 """
7316 PageDown(self) -> bool
7317
7318 This is just a wrapper for ScrollPages(1).
7319 """
7320 return _core_.Window_PageDown(*args, **kwargs)
7321
7322 def SetHelpText(*args, **kwargs):
7323 """
7324 SetHelpText(self, String text)
7325
7326 Sets the help text to be used as context-sensitive help for this
7327 window. Note that the text is actually stored by the current
7328 wxHelpProvider implementation, and not in the window object itself.
7329 """
7330 return _core_.Window_SetHelpText(*args, **kwargs)
7331
7332 def SetHelpTextForId(*args, **kwargs):
7333 """
7334 SetHelpTextForId(self, String text)
7335
7336 Associate this help text with all windows with the same id as this
7337 one.
7338 """
7339 return _core_.Window_SetHelpTextForId(*args, **kwargs)
7340
7341 def GetHelpText(*args, **kwargs):
7342 """
7343 GetHelpText(self) -> String
7344
7345 Gets the help text to be used as context-sensitive help for this
7346 window. Note that the text is actually stored by the current
7347 wxHelpProvider implementation, and not in the window object itself.
7348 """
7349 return _core_.Window_GetHelpText(*args, **kwargs)
7350
7351 def SetToolTipString(*args, **kwargs):
7352 """
7353 SetToolTipString(self, String tip)
7354
7355 Attach a tooltip to the window.
7356 """
7357 return _core_.Window_SetToolTipString(*args, **kwargs)
7358
7359 def SetToolTip(*args, **kwargs):
7360 """
7361 SetToolTip(self, ToolTip tip)
7362
7363 Attach a tooltip to the window.
7364 """
7365 return _core_.Window_SetToolTip(*args, **kwargs)
7366
7367 def GetToolTip(*args, **kwargs):
7368 """
7369 GetToolTip(self) -> ToolTip
7370
7371 get the associated tooltip or None if none
7372 """
7373 return _core_.Window_GetToolTip(*args, **kwargs)
7374
7375 def SetDropTarget(*args, **kwargs):
7376 """
7377 SetDropTarget(self, DropTarget dropTarget)
7378
7379 Associates a drop target with this window. If the window already has
7380 a drop target, it is deleted.
7381 """
7382 return _core_.Window_SetDropTarget(*args, **kwargs)
7383
7384 def GetDropTarget(*args, **kwargs):
7385 """
7386 GetDropTarget(self) -> DropTarget
7387
7388 Returns the associated drop target, which may be None.
7389 """
7390 return _core_.Window_GetDropTarget(*args, **kwargs)
7391
7392 def DragAcceptFiles(*args, **kwargs):
7393 """
7394 DragAcceptFiles(self, bool accept)
7395
7396 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
7397 Only available on Windows.
7398 """
7399 return _core_.Window_DragAcceptFiles(*args, **kwargs)
7400
7401 def SetConstraints(*args, **kwargs):
7402 """
7403 SetConstraints(self, LayoutConstraints constraints)
7404
7405 Sets the window to have the given layout constraints. If an existing
7406 layout constraints object is already owned by the window, it will be
7407 deleted. Pass None to disassociate and delete the window's current
7408 constraints.
7409
7410 You must call SetAutoLayout to tell a window to use the constraints
7411 automatically in its default EVT_SIZE handler; otherwise, you must
7412 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7413 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7414 effect.
7415 """
7416 return _core_.Window_SetConstraints(*args, **kwargs)
7417
7418 def GetConstraints(*args, **kwargs):
7419 """
7420 GetConstraints(self) -> LayoutConstraints
7421
7422 Returns a pointer to the window's layout constraints, or None if there
7423 are none.
7424 """
7425 return _core_.Window_GetConstraints(*args, **kwargs)
7426
7427 def SetAutoLayout(*args, **kwargs):
7428 """
7429 SetAutoLayout(self, bool autoLayout)
7430
7431 Determines whether the Layout function will be called automatically
7432 when the window is resized. It is called implicitly by SetSizer but
7433 if you use SetConstraints you should call it manually or otherwise the
7434 window layout won't be correctly updated when its size changes.
7435 """
7436 return _core_.Window_SetAutoLayout(*args, **kwargs)
7437
7438 def GetAutoLayout(*args, **kwargs):
7439 """
7440 GetAutoLayout(self) -> bool
7441
7442 Returns the current autoLayout setting
7443 """
7444 return _core_.Window_GetAutoLayout(*args, **kwargs)
7445
7446 def Layout(*args, **kwargs):
7447 """
7448 Layout(self) -> bool
7449
7450 Invokes the constraint-based layout algorithm or the sizer-based
7451 algorithm for this window. See SetAutoLayout: when auto layout is on,
7452 this function gets called automatically by the default EVT_SIZE
7453 handler when the window is resized.
7454 """
7455 return _core_.Window_Layout(*args, **kwargs)
7456
7457 def SetSizer(*args, **kwargs):
7458 """
7459 SetSizer(self, Sizer sizer, bool deleteOld=True)
7460
7461 Sets the window to have the given layout sizer. The window will then
7462 own the object, and will take care of its deletion. If an existing
7463 layout sizer object is already owned by the window, it will be deleted
7464 if the deleteOld parameter is true. Note that this function will also
7465 call SetAutoLayout implicitly with a True parameter if the sizer is
7466 non-NoneL and False otherwise.
7467 """
7468 return _core_.Window_SetSizer(*args, **kwargs)
7469
7470 def SetSizerAndFit(*args, **kwargs):
7471 """
7472 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
7473
7474 The same as SetSizer, except it also sets the size hints for the
7475 window based on the sizer's minimum size.
7476 """
7477 return _core_.Window_SetSizerAndFit(*args, **kwargs)
7478
7479 def GetSizer(*args, **kwargs):
7480 """
7481 GetSizer(self) -> Sizer
7482
7483 Return the sizer associated with the window by a previous call to
7484 SetSizer or None if there isn't one.
7485 """
7486 return _core_.Window_GetSizer(*args, **kwargs)
7487
7488 def SetContainingSizer(*args, **kwargs):
7489 """
7490 SetContainingSizer(self, Sizer sizer)
7491
7492 This normally does not need to be called by application code. It is
7493 called internally when a window is added to a sizer, and is used so
7494 the window can remove itself from the sizer when it is destroyed.
7495 """
7496 return _core_.Window_SetContainingSizer(*args, **kwargs)
7497
7498 def GetContainingSizer(*args, **kwargs):
7499 """
7500 GetContainingSizer(self) -> Sizer
7501
7502 Return the sizer that this window is a member of, if any, otherwise None.
7503 """
7504 return _core_.Window_GetContainingSizer(*args, **kwargs)
7505
7506 def InheritAttributes(*args, **kwargs):
7507 """
7508 InheritAttributes(self)
7509
79fccf9d
RD
7510 This function is (or should be, in case of custom controls) called
7511 during window creation to intelligently set up the window visual
7512 attributes, that is the font and the foreground and background
7513 colours.
7514
7515 By 'intelligently' the following is meant: by default, all windows use
7516 their own default attributes. However if some of the parent's
7517 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 7518 SetOwnFont) and if the corresponding attribute hadn't been
79fccf9d
RD
7519 explicitly set for this window itself, then this window takes the same
7520 value as used by the parent. In addition, if the window overrides
7521 ShouldInheritColours to return false, the colours will not be changed
7522 no matter what and only the font might.
7523
7524 This rather complicated logic is necessary in order to accomodate the
7525 different usage scenarius. The most common one is when all default
7526 attributes are used and in this case, nothing should be inherited as
7527 in modern GUIs different controls use different fonts (and colours)
7528 than their siblings so they can't inherit the same value from the
7529 parent. However it was also deemed desirable to allow to simply change
7530 the attributes of all children at once by just changing the font or
7531 colour of their common parent, hence in this case we do inherit the
7532 parents attributes.
7533
d55e5bfc
RD
7534 """
7535 return _core_.Window_InheritAttributes(*args, **kwargs)
7536
7537 def ShouldInheritColours(*args, **kwargs):
7538 """
7539 ShouldInheritColours(self) -> bool
7540
7541 Return true from here to allow the colours of this window to be
79fccf9d
RD
7542 changed by InheritAttributes, returning false forbids inheriting them
7543 from the parent window.
d55e5bfc 7544
79fccf9d
RD
7545 The base class version returns false, but this method is overridden in
7546 wxControl where it returns true.
d55e5bfc
RD
7547 """
7548 return _core_.Window_ShouldInheritColours(*args, **kwargs)
7549
7550 def PostCreate(self, pre):
7551 """
7552 Phase 3 of the 2-phase create <wink!>
7553 Call this method after precreating the window with the 2-phase create method.
7554 """
7555 self.this = pre.this
7556 self.thisown = pre.thisown
7557 pre.thisown = 0
7558 if hasattr(self, '_setOORInfo'):
7559 self._setOORInfo(self)
7560 if hasattr(self, '_setCallbackInfo'):
7561 self._setCallbackInfo(self, self.__class__)
7562
7563
7564class WindowPtr(Window):
7565 def __init__(self, this):
7566 self.this = this
7567 if not hasattr(self,"thisown"): self.thisown = 0
7568 self.__class__ = Window
7569_core_.Window_swigregister(WindowPtr)
7570
7571def PreWindow(*args, **kwargs):
7572 """
7573 PreWindow() -> Window
7574
7575 Precreate a Window for 2-phase creation.
7576 """
7577 val = _core_.new_PreWindow(*args, **kwargs)
7578 val.thisown = 1
7579 return val
7580
7581def Window_NewControlId(*args, **kwargs):
7582 """
7583 Window_NewControlId() -> int
7584
7585 Generate a control id for the controls which were not given one.
7586 """
7587 return _core_.Window_NewControlId(*args, **kwargs)
7588
7589def Window_NextControlId(*args, **kwargs):
7590 """
7591 Window_NextControlId(int winid) -> int
7592
7593 Get the id of the control following the one with the given
79fccf9d 7594 autogenerated) id
d55e5bfc
RD
7595 """
7596 return _core_.Window_NextControlId(*args, **kwargs)
7597
7598def Window_PrevControlId(*args, **kwargs):
7599 """
7600 Window_PrevControlId(int winid) -> int
7601
7602 Get the id of the control preceding the one with the given
79fccf9d 7603 autogenerated) id
d55e5bfc
RD
7604 """
7605 return _core_.Window_PrevControlId(*args, **kwargs)
7606
7607def Window_FindFocus(*args, **kwargs):
7608 """
7609 Window_FindFocus() -> Window
7610
7611 Returns the window or control that currently has the keyboard focus,
7612 or None.
7613 """
7614 return _core_.Window_FindFocus(*args, **kwargs)
7615
7616def Window_GetCapture(*args, **kwargs):
7617 """
7618 Window_GetCapture() -> Window
7619
7620 Returns the window which currently captures the mouse or None
7621 """
7622 return _core_.Window_GetCapture(*args, **kwargs)
7623
7624def Window_GetClassDefaultAttributes(*args, **kwargs):
7625 """
7626 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7627
79fccf9d
RD
7628 Get the default attributes for this class. This is useful if you want
7629 to use the same font or colour in your own control as in a standard
7630 control -- which is a much better idea than hard coding specific
caef1a4d
RD
7631 colours or fonts which might look completely out of place on the
7632 user's system, especially if it uses themes.
d55e5bfc
RD
7633
7634 The variant parameter is only relevant under Mac currently and is
79fccf9d 7635 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
7636 the returned font. See `wx.Window.SetWindowVariant` for more about
7637 this.
d55e5bfc
RD
7638 """
7639 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
7640
7641def DLG_PNT(win, point_or_x, y=None):
7642 """
7643 Convenience function for converting a Point or (x,y) in
7644 dialog units to pixel units.
7645 """
7646 if y is None:
7647 return win.ConvertDialogPointToPixels(point_or_x)
7648 else:
7649 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
7650
7651def DLG_SZE(win, size_width, height=None):
7652 """
7653 Convenience function for converting a Size or (w,h) in
7654 dialog units to pixel units.
7655 """
7656 if height is None:
7657 return win.ConvertDialogSizeToPixels(size_width)
7658 else:
7659 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
7660
7661
7662def FindWindowById(*args, **kwargs):
7663 """
7664 FindWindowById(long id, Window parent=None) -> Window
7665
7666 Find the first window in the application with the given id. If parent
7667 is None, the search will start from all top-level frames and dialog
7668 boxes; if non-None, the search will be limited to the given window
7669 hierarchy. The search is recursive in both cases.
7670 """
7671 return _core_.FindWindowById(*args, **kwargs)
7672
7673def FindWindowByName(*args, **kwargs):
7674 """
7675 FindWindowByName(String name, Window parent=None) -> Window
7676
7677 Find a window by its name (as given in a window constructor or Create
7678 function call). If parent is None, the search will start from all
7679 top-level frames and dialog boxes; if non-None, the search will be
7680 limited to the given window hierarchy. The search is recursive in both
7681 cases.
7682
7683 If no window with such name is found, wx.FindWindowByLabel is called.
7684 """
7685 return _core_.FindWindowByName(*args, **kwargs)
7686
7687def FindWindowByLabel(*args, **kwargs):
7688 """
7689 FindWindowByLabel(String label, Window parent=None) -> Window
7690
7691 Find a window by its label. Depending on the type of window, the label
7692 may be a window title or panel item label. If parent is None, the
7693 search will start from all top-level frames and dialog boxes; if
7694 non-None, the search will be limited to the given window
7695 hierarchy. The search is recursive in both cases.
7696 """
7697 return _core_.FindWindowByLabel(*args, **kwargs)
7698
7699def Window_FromHWND(*args, **kwargs):
7700 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
7701 return _core_.Window_FromHWND(*args, **kwargs)
7702#---------------------------------------------------------------------------
7703
7704class Validator(EvtHandler):
7705 def __repr__(self):
7706 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7707 def __init__(self, *args, **kwargs):
7708 """__init__(self) -> Validator"""
7709 newobj = _core_.new_Validator(*args, **kwargs)
7710 self.this = newobj.this
7711 self.thisown = 1
7712 del newobj.thisown
7713 self._setOORInfo(self)
7714
7715 def Clone(*args, **kwargs):
7716 """Clone(self) -> Validator"""
7717 return _core_.Validator_Clone(*args, **kwargs)
7718
7719 def Validate(*args, **kwargs):
7720 """Validate(self, Window parent) -> bool"""
7721 return _core_.Validator_Validate(*args, **kwargs)
7722
7723 def TransferToWindow(*args, **kwargs):
7724 """TransferToWindow(self) -> bool"""
7725 return _core_.Validator_TransferToWindow(*args, **kwargs)
7726
7727 def TransferFromWindow(*args, **kwargs):
7728 """TransferFromWindow(self) -> bool"""
7729 return _core_.Validator_TransferFromWindow(*args, **kwargs)
7730
7731 def GetWindow(*args, **kwargs):
7732 """GetWindow(self) -> Window"""
7733 return _core_.Validator_GetWindow(*args, **kwargs)
7734
7735 def SetWindow(*args, **kwargs):
7736 """SetWindow(self, Window window)"""
7737 return _core_.Validator_SetWindow(*args, **kwargs)
7738
7739 def IsSilent(*args, **kwargs):
c24da6d6 7740 """IsSilent() -> bool"""
d55e5bfc
RD
7741 return _core_.Validator_IsSilent(*args, **kwargs)
7742
7743 IsSilent = staticmethod(IsSilent)
7744 def SetBellOnError(*args, **kwargs):
c24da6d6 7745 """SetBellOnError(int doIt=True)"""
d55e5bfc
RD
7746 return _core_.Validator_SetBellOnError(*args, **kwargs)
7747
7748 SetBellOnError = staticmethod(SetBellOnError)
7749
7750class ValidatorPtr(Validator):
7751 def __init__(self, this):
7752 self.this = this
7753 if not hasattr(self,"thisown"): self.thisown = 0
7754 self.__class__ = Validator
7755_core_.Validator_swigregister(ValidatorPtr)
7756
7757def Validator_IsSilent(*args, **kwargs):
7758 """Validator_IsSilent() -> bool"""
7759 return _core_.Validator_IsSilent(*args, **kwargs)
7760
7761def Validator_SetBellOnError(*args, **kwargs):
7762 """Validator_SetBellOnError(int doIt=True)"""
7763 return _core_.Validator_SetBellOnError(*args, **kwargs)
7764
7765class PyValidator(Validator):
7766 def __repr__(self):
7767 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7768 def __init__(self, *args, **kwargs):
7769 """__init__(self) -> PyValidator"""
7770 newobj = _core_.new_PyValidator(*args, **kwargs)
7771 self.this = newobj.this
7772 self.thisown = 1
7773 del newobj.thisown
7774
7775 self._setCallbackInfo(self, PyValidator, 1)
7776 self._setOORInfo(self)
7777
7778 def _setCallbackInfo(*args, **kwargs):
7779 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
7780 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
7781
7782
7783class PyValidatorPtr(PyValidator):
7784 def __init__(self, this):
7785 self.this = this
7786 if not hasattr(self,"thisown"): self.thisown = 0
7787 self.__class__ = PyValidator
7788_core_.PyValidator_swigregister(PyValidatorPtr)
7789
7790#---------------------------------------------------------------------------
7791
7792class Menu(EvtHandler):
7793 def __repr__(self):
7794 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7795 def __init__(self, *args, **kwargs):
7796 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
7797 newobj = _core_.new_Menu(*args, **kwargs)
7798 self.this = newobj.this
7799 self.thisown = 1
7800 del newobj.thisown
7801 self._setOORInfo(self)
7802
7803 def Append(*args, **kwargs):
7804 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
7805 return _core_.Menu_Append(*args, **kwargs)
7806
7807 def AppendSeparator(*args, **kwargs):
7808 """AppendSeparator(self) -> MenuItem"""
7809 return _core_.Menu_AppendSeparator(*args, **kwargs)
7810
7811 def AppendCheckItem(*args, **kwargs):
7812 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
7813 return _core_.Menu_AppendCheckItem(*args, **kwargs)
7814
7815 def AppendRadioItem(*args, **kwargs):
7816 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
7817 return _core_.Menu_AppendRadioItem(*args, **kwargs)
7818
7819 def AppendMenu(*args, **kwargs):
7820 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
7821 return _core_.Menu_AppendMenu(*args, **kwargs)
7822
7823 def AppendItem(*args, **kwargs):
7824 """AppendItem(self, MenuItem item) -> MenuItem"""
7825 return _core_.Menu_AppendItem(*args, **kwargs)
7826
7827 def Break(*args, **kwargs):
7828 """Break(self)"""
7829 return _core_.Menu_Break(*args, **kwargs)
7830
7831 def InsertItem(*args, **kwargs):
7832 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
7833 return _core_.Menu_InsertItem(*args, **kwargs)
7834
7835 def Insert(*args, **kwargs):
7836 """
7837 Insert(self, size_t pos, int id, String text, String help=EmptyString,
7838 int kind=ITEM_NORMAL) -> MenuItem
7839 """
7840 return _core_.Menu_Insert(*args, **kwargs)
7841
7842 def InsertSeparator(*args, **kwargs):
7843 """InsertSeparator(self, size_t pos) -> MenuItem"""
7844 return _core_.Menu_InsertSeparator(*args, **kwargs)
7845
7846 def InsertCheckItem(*args, **kwargs):
7847 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
7848 return _core_.Menu_InsertCheckItem(*args, **kwargs)
7849
7850 def InsertRadioItem(*args, **kwargs):
7851 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
7852 return _core_.Menu_InsertRadioItem(*args, **kwargs)
7853
7854 def InsertMenu(*args, **kwargs):
7855 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
7856 return _core_.Menu_InsertMenu(*args, **kwargs)
7857
7858 def PrependItem(*args, **kwargs):
7859 """PrependItem(self, MenuItem item) -> MenuItem"""
7860 return _core_.Menu_PrependItem(*args, **kwargs)
7861
7862 def Prepend(*args, **kwargs):
7863 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
7864 return _core_.Menu_Prepend(*args, **kwargs)
7865
7866 def PrependSeparator(*args, **kwargs):
7867 """PrependSeparator(self) -> MenuItem"""
7868 return _core_.Menu_PrependSeparator(*args, **kwargs)
7869
7870 def PrependCheckItem(*args, **kwargs):
7871 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
7872 return _core_.Menu_PrependCheckItem(*args, **kwargs)
7873
7874 def PrependRadioItem(*args, **kwargs):
7875 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
7876 return _core_.Menu_PrependRadioItem(*args, **kwargs)
7877
7878 def PrependMenu(*args, **kwargs):
7879 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
7880 return _core_.Menu_PrependMenu(*args, **kwargs)
7881
7882 def Remove(*args, **kwargs):
7883 """Remove(self, int id) -> MenuItem"""
7884 return _core_.Menu_Remove(*args, **kwargs)
7885
7886 def RemoveItem(*args, **kwargs):
7887 """RemoveItem(self, MenuItem item) -> MenuItem"""
7888 return _core_.Menu_RemoveItem(*args, **kwargs)
7889
7890 def Delete(*args, **kwargs):
7891 """Delete(self, int id) -> bool"""
7892 return _core_.Menu_Delete(*args, **kwargs)
7893
7894 def DeleteItem(*args, **kwargs):
7895 """DeleteItem(self, MenuItem item) -> bool"""
7896 return _core_.Menu_DeleteItem(*args, **kwargs)
7897
7898 def Destroy(*args, **kwargs):
7899 """
7900 Destroy(self)
7901
7902 Deletes the C++ object this Python object is a proxy for.
7903 """
7904 return _core_.Menu_Destroy(*args, **kwargs)
7905
7906 def DestroyId(*args, **kwargs):
7907 """
7908 DestroyId(self, int id) -> bool
7909
7910 Deletes the C++ object this Python object is a proxy for.
7911 """
7912 return _core_.Menu_DestroyId(*args, **kwargs)
7913
7914 def DestroyItem(*args, **kwargs):
7915 """
7916 DestroyItem(self, MenuItem item) -> bool
7917
7918 Deletes the C++ object this Python object is a proxy for.
7919 """
7920 return _core_.Menu_DestroyItem(*args, **kwargs)
7921
7922 def GetMenuItemCount(*args, **kwargs):
7923 """GetMenuItemCount(self) -> size_t"""
7924 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
7925
7926 def GetMenuItems(*args, **kwargs):
7927 """GetMenuItems(self) -> PyObject"""
7928 return _core_.Menu_GetMenuItems(*args, **kwargs)
7929
7930 def FindItem(*args, **kwargs):
7931 """FindItem(self, String item) -> int"""
7932 return _core_.Menu_FindItem(*args, **kwargs)
7933
7934 def FindItemById(*args, **kwargs):
7935 """FindItemById(self, int id) -> MenuItem"""
7936 return _core_.Menu_FindItemById(*args, **kwargs)
7937
7938 def FindItemByPosition(*args, **kwargs):
7939 """FindItemByPosition(self, size_t position) -> MenuItem"""
7940 return _core_.Menu_FindItemByPosition(*args, **kwargs)
7941
7942 def Enable(*args, **kwargs):
7943 """Enable(self, int id, bool enable)"""
7944 return _core_.Menu_Enable(*args, **kwargs)
7945
7946 def IsEnabled(*args, **kwargs):
7947 """IsEnabled(self, int id) -> bool"""
7948 return _core_.Menu_IsEnabled(*args, **kwargs)
7949
7950 def Check(*args, **kwargs):
7951 """Check(self, int id, bool check)"""
7952 return _core_.Menu_Check(*args, **kwargs)
7953
7954 def IsChecked(*args, **kwargs):
7955 """IsChecked(self, int id) -> bool"""
7956 return _core_.Menu_IsChecked(*args, **kwargs)
7957
7958 def SetLabel(*args, **kwargs):
7959 """SetLabel(self, int id, String label)"""
7960 return _core_.Menu_SetLabel(*args, **kwargs)
7961
7962 def GetLabel(*args, **kwargs):
7963 """GetLabel(self, int id) -> String"""
7964 return _core_.Menu_GetLabel(*args, **kwargs)
7965
7966 def SetHelpString(*args, **kwargs):
7967 """SetHelpString(self, int id, String helpString)"""
7968 return _core_.Menu_SetHelpString(*args, **kwargs)
7969
7970 def GetHelpString(*args, **kwargs):
7971 """GetHelpString(self, int id) -> String"""
7972 return _core_.Menu_GetHelpString(*args, **kwargs)
7973
7974 def SetTitle(*args, **kwargs):
7975 """SetTitle(self, String title)"""
7976 return _core_.Menu_SetTitle(*args, **kwargs)
7977
7978 def GetTitle(*args, **kwargs):
7979 """GetTitle(self) -> String"""
7980 return _core_.Menu_GetTitle(*args, **kwargs)
7981
7982 def SetEventHandler(*args, **kwargs):
7983 """SetEventHandler(self, EvtHandler handler)"""
7984 return _core_.Menu_SetEventHandler(*args, **kwargs)
7985
7986 def GetEventHandler(*args, **kwargs):
7987 """GetEventHandler(self) -> EvtHandler"""
7988 return _core_.Menu_GetEventHandler(*args, **kwargs)
7989
7990 def SetInvokingWindow(*args, **kwargs):
7991 """SetInvokingWindow(self, Window win)"""
7992 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
7993
7994 def GetInvokingWindow(*args, **kwargs):
7995 """GetInvokingWindow(self) -> Window"""
7996 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
7997
7998 def GetStyle(*args, **kwargs):
7999 """GetStyle(self) -> long"""
8000 return _core_.Menu_GetStyle(*args, **kwargs)
8001
8002 def UpdateUI(*args, **kwargs):
8003 """UpdateUI(self, EvtHandler source=None)"""
8004 return _core_.Menu_UpdateUI(*args, **kwargs)
8005
8006 def GetMenuBar(*args, **kwargs):
8007 """GetMenuBar(self) -> MenuBar"""
8008 return _core_.Menu_GetMenuBar(*args, **kwargs)
8009
8010 def Attach(*args, **kwargs):
8011 """Attach(self, wxMenuBarBase menubar)"""
8012 return _core_.Menu_Attach(*args, **kwargs)
8013
8014 def Detach(*args, **kwargs):
8015 """Detach(self)"""
8016 return _core_.Menu_Detach(*args, **kwargs)
8017
8018 def IsAttached(*args, **kwargs):
8019 """IsAttached(self) -> bool"""
8020 return _core_.Menu_IsAttached(*args, **kwargs)
8021
8022 def SetParent(*args, **kwargs):
8023 """SetParent(self, Menu parent)"""
8024 return _core_.Menu_SetParent(*args, **kwargs)
8025
8026 def GetParent(*args, **kwargs):
8027 """GetParent(self) -> Menu"""
8028 return _core_.Menu_GetParent(*args, **kwargs)
8029
8030
8031class MenuPtr(Menu):
8032 def __init__(self, this):
8033 self.this = this
8034 if not hasattr(self,"thisown"): self.thisown = 0
8035 self.__class__ = Menu
8036_core_.Menu_swigregister(MenuPtr)
8037DefaultValidator = cvar.DefaultValidator
8038
8039#---------------------------------------------------------------------------
8040
8041class MenuBar(Window):
8042 def __repr__(self):
8043 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8044 def __init__(self, *args, **kwargs):
8045 """__init__(self, long style=0) -> MenuBar"""
8046 newobj = _core_.new_MenuBar(*args, **kwargs)
8047 self.this = newobj.this
8048 self.thisown = 1
8049 del newobj.thisown
8050 self._setOORInfo(self)
8051
8052 def Append(*args, **kwargs):
8053 """Append(self, Menu menu, String title) -> bool"""
8054 return _core_.MenuBar_Append(*args, **kwargs)
8055
8056 def Insert(*args, **kwargs):
8057 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
8058 return _core_.MenuBar_Insert(*args, **kwargs)
8059
8060 def GetMenuCount(*args, **kwargs):
8061 """GetMenuCount(self) -> size_t"""
8062 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
8063
8064 def GetMenu(*args, **kwargs):
8065 """GetMenu(self, size_t pos) -> Menu"""
8066 return _core_.MenuBar_GetMenu(*args, **kwargs)
8067
8068 def Replace(*args, **kwargs):
8069 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
8070 return _core_.MenuBar_Replace(*args, **kwargs)
8071
8072 def Remove(*args, **kwargs):
8073 """Remove(self, size_t pos) -> Menu"""
8074 return _core_.MenuBar_Remove(*args, **kwargs)
8075
8076 def EnableTop(*args, **kwargs):
8077 """EnableTop(self, size_t pos, bool enable)"""
8078 return _core_.MenuBar_EnableTop(*args, **kwargs)
8079
8080 def IsEnabledTop(*args, **kwargs):
8081 """IsEnabledTop(self, size_t pos) -> bool"""
8082 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
8083
8084 def SetLabelTop(*args, **kwargs):
8085 """SetLabelTop(self, size_t pos, String label)"""
8086 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
8087
8088 def GetLabelTop(*args, **kwargs):
8089 """GetLabelTop(self, size_t pos) -> String"""
8090 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
8091
8092 def FindMenuItem(*args, **kwargs):
8093 """FindMenuItem(self, String menu, String item) -> int"""
8094 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
8095
8096 def FindItemById(*args, **kwargs):
8097 """FindItemById(self, int id) -> MenuItem"""
8098 return _core_.MenuBar_FindItemById(*args, **kwargs)
8099
8100 def FindMenu(*args, **kwargs):
8101 """FindMenu(self, String title) -> int"""
8102 return _core_.MenuBar_FindMenu(*args, **kwargs)
8103
8104 def Enable(*args, **kwargs):
8105 """Enable(self, int id, bool enable)"""
8106 return _core_.MenuBar_Enable(*args, **kwargs)
8107
8108 def Check(*args, **kwargs):
8109 """Check(self, int id, bool check)"""
8110 return _core_.MenuBar_Check(*args, **kwargs)
8111
8112 def IsChecked(*args, **kwargs):
8113 """IsChecked(self, int id) -> bool"""
8114 return _core_.MenuBar_IsChecked(*args, **kwargs)
8115
8116 def IsEnabled(*args, **kwargs):
8117 """IsEnabled(self, int id) -> bool"""
8118 return _core_.MenuBar_IsEnabled(*args, **kwargs)
8119
8120 def SetLabel(*args, **kwargs):
8121 """SetLabel(self, int id, String label)"""
8122 return _core_.MenuBar_SetLabel(*args, **kwargs)
8123
8124 def GetLabel(*args, **kwargs):
8125 """GetLabel(self, int id) -> String"""
8126 return _core_.MenuBar_GetLabel(*args, **kwargs)
8127
8128 def SetHelpString(*args, **kwargs):
8129 """SetHelpString(self, int id, String helpString)"""
8130 return _core_.MenuBar_SetHelpString(*args, **kwargs)
8131
8132 def GetHelpString(*args, **kwargs):
8133 """GetHelpString(self, int id) -> String"""
8134 return _core_.MenuBar_GetHelpString(*args, **kwargs)
8135
8136 def GetFrame(*args, **kwargs):
8137 """GetFrame(self) -> wxFrame"""
8138 return _core_.MenuBar_GetFrame(*args, **kwargs)
8139
8140 def IsAttached(*args, **kwargs):
8141 """IsAttached(self) -> bool"""
8142 return _core_.MenuBar_IsAttached(*args, **kwargs)
8143
8144 def Attach(*args, **kwargs):
8145 """Attach(self, wxFrame frame)"""
8146 return _core_.MenuBar_Attach(*args, **kwargs)
8147
8148 def Detach(*args, **kwargs):
8149 """Detach(self)"""
8150 return _core_.MenuBar_Detach(*args, **kwargs)
8151
8152
8153class MenuBarPtr(MenuBar):
8154 def __init__(self, this):
8155 self.this = this
8156 if not hasattr(self,"thisown"): self.thisown = 0
8157 self.__class__ = MenuBar
8158_core_.MenuBar_swigregister(MenuBarPtr)
8159
8160#---------------------------------------------------------------------------
8161
8162class MenuItem(Object):
8163 def __repr__(self):
8164 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8165 def __init__(self, *args, **kwargs):
8166 """
8167 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
8168 String help=EmptyString, int kind=ITEM_NORMAL,
8169 Menu subMenu=None) -> MenuItem
8170 """
8171 newobj = _core_.new_MenuItem(*args, **kwargs)
8172 self.this = newobj.this
8173 self.thisown = 1
8174 del newobj.thisown
8175 def GetMenu(*args, **kwargs):
8176 """GetMenu(self) -> Menu"""
8177 return _core_.MenuItem_GetMenu(*args, **kwargs)
8178
8179 def SetMenu(*args, **kwargs):
8180 """SetMenu(self, Menu menu)"""
8181 return _core_.MenuItem_SetMenu(*args, **kwargs)
8182
8183 def SetId(*args, **kwargs):
8184 """SetId(self, int id)"""
8185 return _core_.MenuItem_SetId(*args, **kwargs)
8186
8187 def GetId(*args, **kwargs):
8188 """GetId(self) -> int"""
8189 return _core_.MenuItem_GetId(*args, **kwargs)
8190
8191 def IsSeparator(*args, **kwargs):
8192 """IsSeparator(self) -> bool"""
8193 return _core_.MenuItem_IsSeparator(*args, **kwargs)
8194
8195 def SetText(*args, **kwargs):
8196 """SetText(self, String str)"""
8197 return _core_.MenuItem_SetText(*args, **kwargs)
8198
8199 def GetLabel(*args, **kwargs):
8200 """GetLabel(self) -> String"""
8201 return _core_.MenuItem_GetLabel(*args, **kwargs)
8202
8203 def GetText(*args, **kwargs):
8204 """GetText(self) -> String"""
8205 return _core_.MenuItem_GetText(*args, **kwargs)
8206
8207 def GetLabelFromText(*args, **kwargs):
c24da6d6 8208 """GetLabelFromText(String text) -> String"""
d55e5bfc
RD
8209 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8210
8211 GetLabelFromText = staticmethod(GetLabelFromText)
8212 def GetKind(*args, **kwargs):
8213 """GetKind(self) -> int"""
8214 return _core_.MenuItem_GetKind(*args, **kwargs)
8215
8216 def SetKind(*args, **kwargs):
8217 """SetKind(self, int kind)"""
8218 return _core_.MenuItem_SetKind(*args, **kwargs)
8219
8220 def SetCheckable(*args, **kwargs):
8221 """SetCheckable(self, bool checkable)"""
8222 return _core_.MenuItem_SetCheckable(*args, **kwargs)
8223
8224 def IsCheckable(*args, **kwargs):
8225 """IsCheckable(self) -> bool"""
8226 return _core_.MenuItem_IsCheckable(*args, **kwargs)
8227
8228 def IsSubMenu(*args, **kwargs):
8229 """IsSubMenu(self) -> bool"""
8230 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
8231
8232 def SetSubMenu(*args, **kwargs):
8233 """SetSubMenu(self, Menu menu)"""
8234 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
8235
8236 def GetSubMenu(*args, **kwargs):
8237 """GetSubMenu(self) -> Menu"""
8238 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
8239
8240 def Enable(*args, **kwargs):
8241 """Enable(self, bool enable=True)"""
8242 return _core_.MenuItem_Enable(*args, **kwargs)
8243
8244 def IsEnabled(*args, **kwargs):
8245 """IsEnabled(self) -> bool"""
8246 return _core_.MenuItem_IsEnabled(*args, **kwargs)
8247
8248 def Check(*args, **kwargs):
8249 """Check(self, bool check=True)"""
8250 return _core_.MenuItem_Check(*args, **kwargs)
8251
8252 def IsChecked(*args, **kwargs):
8253 """IsChecked(self) -> bool"""
8254 return _core_.MenuItem_IsChecked(*args, **kwargs)
8255
8256 def Toggle(*args, **kwargs):
8257 """Toggle(self)"""
8258 return _core_.MenuItem_Toggle(*args, **kwargs)
8259
8260 def SetHelp(*args, **kwargs):
8261 """SetHelp(self, String str)"""
8262 return _core_.MenuItem_SetHelp(*args, **kwargs)
8263
8264 def GetHelp(*args, **kwargs):
8265 """GetHelp(self) -> String"""
8266 return _core_.MenuItem_GetHelp(*args, **kwargs)
8267
8268 def GetAccel(*args, **kwargs):
8269 """GetAccel(self) -> AcceleratorEntry"""
8270 return _core_.MenuItem_GetAccel(*args, **kwargs)
8271
8272 def SetAccel(*args, **kwargs):
8273 """SetAccel(self, AcceleratorEntry accel)"""
8274 return _core_.MenuItem_SetAccel(*args, **kwargs)
8275
8276 def SetFont(*args, **kwargs):
8277 """SetFont(self, Font font)"""
8278 return _core_.MenuItem_SetFont(*args, **kwargs)
8279
8280 def GetFont(*args, **kwargs):
8281 """GetFont(self) -> Font"""
8282 return _core_.MenuItem_GetFont(*args, **kwargs)
8283
8284 def SetTextColour(*args, **kwargs):
8285 """SetTextColour(self, Colour colText)"""
8286 return _core_.MenuItem_SetTextColour(*args, **kwargs)
8287
8288 def GetTextColour(*args, **kwargs):
8289 """GetTextColour(self) -> Colour"""
8290 return _core_.MenuItem_GetTextColour(*args, **kwargs)
8291
8292 def SetBackgroundColour(*args, **kwargs):
8293 """SetBackgroundColour(self, Colour colBack)"""
8294 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
8295
8296 def GetBackgroundColour(*args, **kwargs):
8297 """GetBackgroundColour(self) -> Colour"""
8298 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
8299
8300 def SetBitmaps(*args, **kwargs):
8301 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
8302 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
8303
8304 def SetDisabledBitmap(*args, **kwargs):
8305 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
8306 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
8307
8308 def GetDisabledBitmap(*args, **kwargs):
8309 """GetDisabledBitmap(self) -> Bitmap"""
8310 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
8311
8312 def SetMarginWidth(*args, **kwargs):
8313 """SetMarginWidth(self, int nWidth)"""
8314 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
8315
8316 def GetMarginWidth(*args, **kwargs):
8317 """GetMarginWidth(self) -> int"""
8318 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
8319
8320 def GetDefaultMarginWidth(*args, **kwargs):
c24da6d6 8321 """GetDefaultMarginWidth() -> int"""
d55e5bfc
RD
8322 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8323
8324 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
8325 def IsOwnerDrawn(*args, **kwargs):
8326 """IsOwnerDrawn(self) -> bool"""
8327 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
8328
8329 def SetOwnerDrawn(*args, **kwargs):
8330 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
8331 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
8332
8333 def ResetOwnerDrawn(*args, **kwargs):
8334 """ResetOwnerDrawn(self)"""
8335 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
8336
8337 def SetBitmap(*args, **kwargs):
8338 """SetBitmap(self, Bitmap bitmap)"""
8339 return _core_.MenuItem_SetBitmap(*args, **kwargs)
8340
8341 def GetBitmap(*args, **kwargs):
8342 """GetBitmap(self) -> Bitmap"""
8343 return _core_.MenuItem_GetBitmap(*args, **kwargs)
8344
8345
8346class MenuItemPtr(MenuItem):
8347 def __init__(self, this):
8348 self.this = this
8349 if not hasattr(self,"thisown"): self.thisown = 0
8350 self.__class__ = MenuItem
8351_core_.MenuItem_swigregister(MenuItemPtr)
8352
8353def MenuItem_GetLabelFromText(*args, **kwargs):
8354 """MenuItem_GetLabelFromText(String text) -> String"""
8355 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8356
8357def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8358 """MenuItem_GetDefaultMarginWidth() -> int"""
8359 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8360
8361#---------------------------------------------------------------------------
8362
8363class Control(Window):
8364 """
8365 This is the base class for a control or 'widget'.
8366
79fccf9d
RD
8367 A control is generally a small window which processes user input
8368 and/or displays one or more item of data.
d55e5bfc
RD
8369 """
8370 def __repr__(self):
8371 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8372 def __init__(self, *args, **kwargs):
8373 """
248ed943
RD
8374 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8375 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
8376 String name=ControlNameStr) -> Control
8377
79fccf9d
RD
8378 Create a Control. Normally you should only call this from a subclass'
8379 __init__ as a plain old wx.Control is not very useful.
d55e5bfc
RD
8380 """
8381 newobj = _core_.new_Control(*args, **kwargs)
8382 self.this = newobj.this
8383 self.thisown = 1
8384 del newobj.thisown
8385 self._setOORInfo(self)
8386
8387 def Create(*args, **kwargs):
8388 """
248ed943
RD
8389 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8390 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
8391 String name=ControlNameStr) -> bool
8392
8393 Do the 2nd phase and create the GUI control.
8394 """
8395 return _core_.Control_Create(*args, **kwargs)
8396
8397 def Command(*args, **kwargs):
8398 """
8399 Command(self, CommandEvent event)
8400
79fccf9d
RD
8401 Simulates the effect of the user issuing a command to the item.
8402
8403 :see: `wx.CommandEvent`
8404
d55e5bfc
RD
8405 """
8406 return _core_.Control_Command(*args, **kwargs)
8407
8408 def GetLabel(*args, **kwargs):
8409 """
8410 GetLabel(self) -> String
8411
8412 Return a control's text.
8413 """
8414 return _core_.Control_GetLabel(*args, **kwargs)
8415
8416 def SetLabel(*args, **kwargs):
8417 """
8418 SetLabel(self, String label)
8419
8420 Sets the item's text.
8421 """
8422 return _core_.Control_SetLabel(*args, **kwargs)
8423
a001823c 8424 def GetClassDefaultAttributes(*args, **kwargs):
f8167d6e 8425 """
a001823c 8426 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
f8167d6e 8427
a001823c
RD
8428 Get the default attributes for this class. This is useful if you want
8429 to use the same font or colour in your own control as in a standard
8430 control -- which is a much better idea than hard coding specific
8431 colours or fonts which might look completely out of place on the
8432 user's system, especially if it uses themes.
f8167d6e 8433
a001823c
RD
8434 The variant parameter is only relevant under Mac currently and is
8435 ignore under other platforms. Under Mac, it will change the size of
8436 the returned font. See `wx.Window.SetWindowVariant` for more about
8437 this.
f8167d6e 8438 """
d55e5bfc
RD
8439 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8440
8441 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8442
8443class ControlPtr(Control):
8444 def __init__(self, this):
8445 self.this = this
8446 if not hasattr(self,"thisown"): self.thisown = 0
8447 self.__class__ = Control
8448_core_.Control_swigregister(ControlPtr)
8449ControlNameStr = cvar.ControlNameStr
8450
8451def PreControl(*args, **kwargs):
8452 """
8453 PreControl() -> Control
8454
8455 Precreate a Control control for 2-phase creation
8456 """
8457 val = _core_.new_PreControl(*args, **kwargs)
8458 val.thisown = 1
8459 return val
8460
8461def Control_GetClassDefaultAttributes(*args, **kwargs):
a001823c
RD
8462 """
8463 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8464
8465 Get the default attributes for this class. This is useful if you want
8466 to use the same font or colour in your own control as in a standard
8467 control -- which is a much better idea than hard coding specific
8468 colours or fonts which might look completely out of place on the
8469 user's system, especially if it uses themes.
8470
8471 The variant parameter is only relevant under Mac currently and is
8472 ignore under other platforms. Under Mac, it will change the size of
8473 the returned font. See `wx.Window.SetWindowVariant` for more about
8474 this.
8475 """
d55e5bfc
RD
8476 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8477
8478#---------------------------------------------------------------------------
8479
8480class ItemContainer(object):
8481 """
8482 wx.ItemContainer defines an interface which is implemented by all
79fccf9d
RD
8483 controls which have string subitems, each of which may be selected,
8484 such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well as
8485 `wx.ComboBox` which implements an extended interface deriving from
8486 this one.
d55e5bfc 8487
79fccf9d
RD
8488 It defines the methods for accessing the control's items and although
8489 each of the derived classes implements them differently, they still
8490 all conform to the same interface.
d55e5bfc 8491
79fccf9d
RD
8492 The items in a wx.ItemContainer have (non empty) string labels and,
8493 optionally, client data associated with them.
d55e5bfc
RD
8494
8495 """
8496 def __init__(self): raise RuntimeError, "No constructor defined"
8497 def __repr__(self):
8498 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8499 def Append(*args, **kwargs):
8500 """
8501 Append(self, String item, PyObject clientData=None) -> int
8502
79fccf9d
RD
8503 Adds the item to the control, associating the given data with the item
8504 if not None. The return value is the index of the newly added item
8505 which may be different from the last one if the control is sorted (e.g.
8506 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc
RD
8507 """
8508 return _core_.ItemContainer_Append(*args, **kwargs)
8509
8510 def AppendItems(*args, **kwargs):
8511 """
f5b96ee1 8512 AppendItems(self, List strings)
d55e5bfc 8513
79fccf9d
RD
8514 Apend several items at once to the control. Notice that calling this
8515 method may be much faster than appending the items one by one if you
8516 need to add a lot of items.
d55e5bfc
RD
8517 """
8518 return _core_.ItemContainer_AppendItems(*args, **kwargs)
8519
8520 def Insert(*args, **kwargs):
8521 """
8522 Insert(self, String item, int pos, PyObject clientData=None) -> int
8523
79fccf9d 8524 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
8525 optionally associating some data object with the item.
8526 """
8527 return _core_.ItemContainer_Insert(*args, **kwargs)
8528
8529 def Clear(*args, **kwargs):
8530 """
8531 Clear(self)
8532
8533 Removes all items from the control.
8534 """
8535 return _core_.ItemContainer_Clear(*args, **kwargs)
8536
8537 def Delete(*args, **kwargs):
8538 """
8539 Delete(self, int n)
8540
79fccf9d
RD
8541 Deletes the item at the zero-based index 'n' from the control. Note
8542 that it is an error (signalled by a `wx.PyAssertionError` exception if
8543 enabled) to remove an item with the index negative or greater or equal
8544 than the number of items in the control.
d55e5bfc
RD
8545 """
8546 return _core_.ItemContainer_Delete(*args, **kwargs)
8547
8548 def GetCount(*args, **kwargs):
8549 """
8550 GetCount(self) -> int
8551
8552 Returns the number of items in the control.
8553 """
8554 return _core_.ItemContainer_GetCount(*args, **kwargs)
8555
8556 def IsEmpty(*args, **kwargs):
8557 """
8558 IsEmpty(self) -> bool
8559
8560 Returns True if the control is empty or False if it has some items.
8561 """
8562 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
8563
8564 def GetString(*args, **kwargs):
8565 """
8566 GetString(self, int n) -> String
8567
8568 Returns the label of the item with the given index.
8569 """
8570 return _core_.ItemContainer_GetString(*args, **kwargs)
8571
8572 def GetStrings(*args, **kwargs):
8573 """GetStrings(self) -> wxArrayString"""
8574 return _core_.ItemContainer_GetStrings(*args, **kwargs)
8575
8576 def SetString(*args, **kwargs):
8577 """
8578 SetString(self, int n, String s)
8579
8580 Sets the label for the given item.
8581 """
8582 return _core_.ItemContainer_SetString(*args, **kwargs)
8583
8584 def FindString(*args, **kwargs):
8585 """
8586 FindString(self, String s) -> int
8587
8588 Finds an item whose label matches the given string. Returns the
79fccf9d
RD
8589 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
8590 found.
d55e5bfc
RD
8591 """
8592 return _core_.ItemContainer_FindString(*args, **kwargs)
8593
8594 def Select(*args, **kwargs):
8595 """
8596 Select(self, int n)
8597
8598 Sets the item at index 'n' to be the selected item.
8599 """
8600 return _core_.ItemContainer_Select(*args, **kwargs)
8601
8602 SetSelection = Select
8603 def GetSelection(*args, **kwargs):
8604 """
8605 GetSelection(self) -> int
8606
79fccf9d
RD
8607 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
8608 is selected.
d55e5bfc
RD
8609 """
8610 return _core_.ItemContainer_GetSelection(*args, **kwargs)
8611
8612 def GetStringSelection(*args, **kwargs):
8613 """
8614 GetStringSelection(self) -> String
8615
79fccf9d
RD
8616 Returns the label of the selected item or an empty string if no item
8617 is selected.
d55e5bfc
RD
8618 """
8619 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
8620
8621 def GetClientData(*args, **kwargs):
8622 """
8623 GetClientData(self, int n) -> PyObject
8624
8625 Returns the client data associated with the given item, (if any.)
8626 """
8627 return _core_.ItemContainer_GetClientData(*args, **kwargs)
8628
8629 def SetClientData(*args, **kwargs):
8630 """
8631 SetClientData(self, int n, PyObject clientData)
8632
8633 Associate the given client data with the item at position n.
8634 """
8635 return _core_.ItemContainer_SetClientData(*args, **kwargs)
8636
8637
8638class ItemContainerPtr(ItemContainer):
8639 def __init__(self, this):
8640 self.this = this
8641 if not hasattr(self,"thisown"): self.thisown = 0
8642 self.__class__ = ItemContainer
8643_core_.ItemContainer_swigregister(ItemContainerPtr)
8644
8645#---------------------------------------------------------------------------
8646
8647class ControlWithItems(Control,ItemContainer):
8648 """
79fccf9d
RD
8649 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
8650 wx.Control class, and is used for the base class of various controls
8651 that have items.
d55e5bfc
RD
8652 """
8653 def __init__(self): raise RuntimeError, "No constructor defined"
8654 def __repr__(self):
8655 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8656
8657class ControlWithItemsPtr(ControlWithItems):
8658 def __init__(self, this):
8659 self.this = this
8660 if not hasattr(self,"thisown"): self.thisown = 0
8661 self.__class__ = ControlWithItems
8662_core_.ControlWithItems_swigregister(ControlWithItemsPtr)
8663
8664#---------------------------------------------------------------------------
8665
8666class SizerItem(Object):
248ed943
RD
8667 """
8668 The wx.SizerItem class is used to track the position, size and other
8669 attributes of each item managed by a `wx.Sizer`. In normal usage user
8670 code should never need to deal directly with a wx.SizerItem, but
8671 custom classes derived from `wx.PySizer` will probably need to use the
8672 collection of wx.SizerItems held by wx.Sizer when calculating layout.
8673
8674 :see: `wx.Sizer`, `wx.GBSizerItem`
8675 """
d55e5bfc
RD
8676 def __repr__(self):
8677 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8678 def __init__(self, *args, **kwargs):
248ed943
RD
8679 """
8680 __init__(self) -> SizerItem
8681
8682 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
8683 size will need to be set before this item can be used in a Sizer.
8684
8685 You will probably never need to create a wx.SizerItem directly as they
8686 are created automatically when the sizer's Add, Insert or Prepend
8687 methods are called.
8688
8689 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
8690 """
d55e5bfc
RD
8691 newobj = _core_.new_SizerItem(*args, **kwargs)
8692 self.this = newobj.this
8693 self.thisown = 1
8694 del newobj.thisown
8695 def DeleteWindows(*args, **kwargs):
248ed943
RD
8696 """
8697 DeleteWindows(self)
8698
8699 Destroy the window or the windows in a subsizer, depending on the type
8700 of item.
8701 """
d55e5bfc
RD
8702 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
8703
8704 def DetachSizer(*args, **kwargs):
248ed943
RD
8705 """
8706 DetachSizer(self)
8707
8708 Enable deleting the SizerItem without destroying the contained sizer.
8709 """
d55e5bfc
RD
8710 return _core_.SizerItem_DetachSizer(*args, **kwargs)
8711
8712 def GetSize(*args, **kwargs):
248ed943
RD
8713 """
8714 GetSize(self) -> Size
8715
8716 Get the current size of the item, as set in the last Layout.
8717 """
d55e5bfc
RD
8718 return _core_.SizerItem_GetSize(*args, **kwargs)
8719
8720 def CalcMin(*args, **kwargs):
248ed943
RD
8721 """
8722 CalcMin(self) -> Size
8723
8724 Calculates the minimum desired size for the item, including any space
8725 needed by borders.
8726 """
d55e5bfc
RD
8727 return _core_.SizerItem_CalcMin(*args, **kwargs)
8728
8729 def SetDimension(*args, **kwargs):
248ed943
RD
8730 """
8731 SetDimension(self, Point pos, Size size)
8732
8733 Set the position and size of the space allocated for this item by the
8734 sizer, and adjust the position and size of the item (window or
8735 subsizer) to be within that space taking alignment and borders into
8736 account.
8737 """
d55e5bfc
RD
8738 return _core_.SizerItem_SetDimension(*args, **kwargs)
8739
8740 def GetMinSize(*args, **kwargs):
248ed943
RD
8741 """
8742 GetMinSize(self) -> Size
8743
8744 Get the minimum size needed for the item.
8745 """
d55e5bfc
RD
8746 return _core_.SizerItem_GetMinSize(*args, **kwargs)
8747
a001823c
RD
8748 def GetMinSizeWithBorder(*args, **kwargs):
8749 """
8750 GetMinSizeWithBorder(self) -> Size
8751
8752 Get the minimum size needed for the item with space for the borders
8753 added, if needed.
8754 """
8755 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
8756
d55e5bfc
RD
8757 def SetInitSize(*args, **kwargs):
8758 """SetInitSize(self, int x, int y)"""
8759 return _core_.SizerItem_SetInitSize(*args, **kwargs)
8760
8761 def SetRatioWH(*args, **kwargs):
248ed943
RD
8762 """
8763 SetRatioWH(self, int width, int height)
8764
8765 Set the ratio item attribute.
8766 """
d55e5bfc
RD
8767 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
8768
8769 def SetRatioSize(*args, **kwargs):
248ed943
RD
8770 """
8771 SetRatioSize(self, Size size)
8772
8773 Set the ratio item attribute.
8774 """
d55e5bfc
RD
8775 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
8776
8777 def SetRatio(*args, **kwargs):
248ed943
RD
8778 """
8779 SetRatio(self, float ratio)
8780
8781 Set the ratio item attribute.
8782 """
d55e5bfc
RD
8783 return _core_.SizerItem_SetRatio(*args, **kwargs)
8784
8785 def GetRatio(*args, **kwargs):
248ed943
RD
8786 """
8787 GetRatio(self) -> float
8788
8789 Set the ratio item attribute.
8790 """
d55e5bfc
RD
8791 return _core_.SizerItem_GetRatio(*args, **kwargs)
8792
8793 def IsWindow(*args, **kwargs):
248ed943
RD
8794 """
8795 IsWindow(self) -> bool
8796
8797 Is this sizer item a window?
8798 """
d55e5bfc
RD
8799 return _core_.SizerItem_IsWindow(*args, **kwargs)
8800
8801 def IsSizer(*args, **kwargs):
248ed943
RD
8802 """
8803 IsSizer(self) -> bool
8804
8805 Is this sizer item a subsizer?
8806 """
d55e5bfc
RD
8807 return _core_.SizerItem_IsSizer(*args, **kwargs)
8808
8809 def IsSpacer(*args, **kwargs):
248ed943
RD
8810 """
8811 IsSpacer(self) -> bool
8812
8813 Is this sizer item a spacer?
8814 """
d55e5bfc
RD
8815 return _core_.SizerItem_IsSpacer(*args, **kwargs)
8816
8817 def SetProportion(*args, **kwargs):
248ed943
RD
8818 """
8819 SetProportion(self, int proportion)
8820
8821 Set the proportion value for this item.
8822 """
d55e5bfc
RD
8823 return _core_.SizerItem_SetProportion(*args, **kwargs)
8824
8825 def GetProportion(*args, **kwargs):
248ed943
RD
8826 """
8827 GetProportion(self) -> int
8828
8829 Get the proportion value for this item.
8830 """
d55e5bfc
RD
8831 return _core_.SizerItem_GetProportion(*args, **kwargs)
8832
248ed943
RD
8833 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
8834 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 8835 def SetFlag(*args, **kwargs):
248ed943
RD
8836 """
8837 SetFlag(self, int flag)
8838
8839 Set the flag value for this item.
8840 """
d55e5bfc
RD
8841 return _core_.SizerItem_SetFlag(*args, **kwargs)
8842
8843 def GetFlag(*args, **kwargs):
248ed943
RD
8844 """
8845 GetFlag(self) -> int
8846
8847 Get the flag value for this item.
8848 """
d55e5bfc
RD
8849 return _core_.SizerItem_GetFlag(*args, **kwargs)
8850
8851 def SetBorder(*args, **kwargs):
248ed943
RD
8852 """
8853 SetBorder(self, int border)
8854
8855 Set the border value for this item.
8856 """
d55e5bfc
RD
8857 return _core_.SizerItem_SetBorder(*args, **kwargs)
8858
8859 def GetBorder(*args, **kwargs):
248ed943
RD
8860 """
8861 GetBorder(self) -> int
8862
8863 Get the border value for this item.
8864 """
d55e5bfc
RD
8865 return _core_.SizerItem_GetBorder(*args, **kwargs)
8866
8867 def GetWindow(*args, **kwargs):
248ed943
RD
8868 """
8869 GetWindow(self) -> Window
8870
8871 Get the window (if any) that is managed by this sizer item.
8872 """
d55e5bfc
RD
8873 return _core_.SizerItem_GetWindow(*args, **kwargs)
8874
8875 def SetWindow(*args, **kwargs):
248ed943
RD
8876 """
8877 SetWindow(self, Window window)
8878
8879 Set the window to be managed by this sizer item.
8880 """
d55e5bfc
RD
8881 return _core_.SizerItem_SetWindow(*args, **kwargs)
8882
8883 def GetSizer(*args, **kwargs):
248ed943
RD
8884 """
8885 GetSizer(self) -> Sizer
8886
8887 Get the subsizer (if any) that is managed by this sizer item.
8888 """
d55e5bfc
RD
8889 return _core_.SizerItem_GetSizer(*args, **kwargs)
8890
8891 def SetSizer(*args, **kwargs):
248ed943
RD
8892 """
8893 SetSizer(self, Sizer sizer)
8894
8895 Set the subsizer to be managed by this sizer item.
8896 """
d55e5bfc
RD
8897 return _core_.SizerItem_SetSizer(*args, **kwargs)
8898
8899 def GetSpacer(*args, **kwargs):
248ed943
RD
8900 """
8901 GetSpacer(self) -> Size
8902
8903 Get the size of the spacer managed by this sizer item.
8904 """
d55e5bfc
RD
8905 return _core_.SizerItem_GetSpacer(*args, **kwargs)
8906
8907 def SetSpacer(*args, **kwargs):
248ed943
RD
8908 """
8909 SetSpacer(self, Size size)
8910
8911 Set the size of the spacer to be managed by this sizer item.
8912 """
d55e5bfc
RD
8913 return _core_.SizerItem_SetSpacer(*args, **kwargs)
8914
8915 def Show(*args, **kwargs):
248ed943
RD
8916 """
8917 Show(self, bool show)
8918
8919 Set the show item attribute, which sizers use to determine if the item
8920 is to be made part of the layout or not. If the item is tracking a
8921 window then it is shown or hidden as needed.
8922 """
d55e5bfc
RD
8923 return _core_.SizerItem_Show(*args, **kwargs)
8924
8925 def IsShown(*args, **kwargs):
248ed943
RD
8926 """
8927 IsShown(self) -> bool
8928
8929 Is the item to be shown in the layout?
8930 """
d55e5bfc
RD
8931 return _core_.SizerItem_IsShown(*args, **kwargs)
8932
8933 def GetPosition(*args, **kwargs):
248ed943
RD
8934 """
8935 GetPosition(self) -> Point
8936
8937 Returns the current position of the item, as set in the last Layout.
8938 """
d55e5bfc
RD
8939 return _core_.SizerItem_GetPosition(*args, **kwargs)
8940
8941 def GetUserData(*args, **kwargs):
248ed943
RD
8942 """
8943 GetUserData(self) -> PyObject
8944
8945 Returns the userData associated with this sizer item, or None if there
8946 isn't any.
8947 """
d55e5bfc
RD
8948 return _core_.SizerItem_GetUserData(*args, **kwargs)
8949
8950
8951class SizerItemPtr(SizerItem):
8952 def __init__(self, this):
8953 self.this = this
8954 if not hasattr(self,"thisown"): self.thisown = 0
8955 self.__class__ = SizerItem
8956_core_.SizerItem_swigregister(SizerItemPtr)
8957
248ed943 8958def SizerItemWindow(*args, **kwargs):
d55e5bfc 8959 """
248ed943
RD
8960 SizerItemWindow(Window window, int proportion, int flag, int border,
8961 PyObject userData=None) -> SizerItem
8962
8963 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 8964 """
248ed943 8965 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
8966 val.thisown = 1
8967 return val
8968
248ed943 8969def SizerItemSpacer(*args, **kwargs):
d55e5bfc 8970 """
248ed943
RD
8971 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
8972 PyObject userData=None) -> SizerItem
8973
8974 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 8975 """
248ed943 8976 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
8977 val.thisown = 1
8978 return val
8979
8980def SizerItemSizer(*args, **kwargs):
8981 """
8982 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
8983 PyObject userData=None) -> SizerItem
8984
8985 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc
RD
8986 """
8987 val = _core_.new_SizerItemSizer(*args, **kwargs)
8988 val.thisown = 1
8989 return val
8990
8991class Sizer(Object):
248ed943
RD
8992 """
8993 wx.Sizer is the abstract base class used for laying out subwindows in
8994 a window. You cannot use wx.Sizer directly; instead, you will have to
8995 use one of the sizer classes derived from it such as `wx.BoxSizer`,
8996 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
8997 and `wx.GridBagSizer`.
8998
8999 The concept implemented by sizers in wxWidgets is closely related to
9000 layout tools in other GUI toolkits, such as Java's AWT, the GTK
9001 toolkit or the Qt toolkit. It is based upon the idea of the individual
9002 subwindows reporting their minimal required size and their ability to
9003 get stretched if the size of the parent window has changed. This will
9004 most often mean that the programmer does not set the original size of
9005 a dialog in the beginning, rather the dialog will assigned a sizer and
9006 this sizer will be queried about the recommended size. The sizer in
9007 turn will query its children, which can be normal windows or contorls,
9008 empty space or other sizers, so that a hierarchy of sizers can be
9009 constructed. Note that wxSizer does not derive from wxWindow and thus
9010 do not interfere with tab ordering and requires very little resources
9011 compared to a real window on screen.
9012
9013 What makes sizers so well fitted for use in wxWidgets is the fact that
9014 every control reports its own minimal size and the algorithm can
9015 handle differences in font sizes or different window (dialog item)
9016 sizes on different platforms without problems. If for example the
9017 standard font as well as the overall design of Mac widgets requires
9018 more space than on Windows, then the initial size of a dialog using a
9019 sizer will automatically be bigger on Mac than on Windows.
9020 """
d55e5bfc
RD
9021 def __init__(self): raise RuntimeError, "No constructor defined"
9022 def __repr__(self):
9023 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9024 def _setOORInfo(*args, **kwargs):
9025 """_setOORInfo(self, PyObject _self)"""
9026 return _core_.Sizer__setOORInfo(*args, **kwargs)
9027
9028 def Add(*args, **kwargs):
9029 """
248ed943 9030 Add(self, item, int proportion=0, int flag=0, int border=0,
d55e5bfc 9031 PyObject userData=None)
248ed943
RD
9032
9033 Appends a child item to the sizer.
d55e5bfc
RD
9034 """
9035 return _core_.Sizer_Add(*args, **kwargs)
9036
9037 def Insert(*args, **kwargs):
9038 """
248ed943
RD
9039 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
9040 PyObject userData=None)
9041
9042 Inserts a new item into the list of items managed by this sizer before
9043 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc
RD
9044 """
9045 return _core_.Sizer_Insert(*args, **kwargs)
9046
9047 def Prepend(*args, **kwargs):
9048 """
248ed943 9049 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d55e5bfc 9050 PyObject userData=None)
248ed943
RD
9051
9052 Adds a new item to the begining of the list of sizer items managed by
9053 this sizer. See `Add` for a description of the parameters.
d55e5bfc
RD
9054 """
9055 return _core_.Sizer_Prepend(*args, **kwargs)
9056
9057 def Remove(*args, **kwargs):
248ed943
RD
9058 """
9059 Remove(self, item) -> bool
9060
9061 Removes an item from the sizer and destroys it. This method does not
9062 cause any layout or resizing to take place, call `Layout` to update
9063 the layout on screen after removing a child from the sizer. The
9064 *item* parameter can be either a window, a sizer, or the zero-based
9065 index of an item to remove. Returns True if the child item was found
9066 and removed.
9067 """
d55e5bfc
RD
9068 return _core_.Sizer_Remove(*args, **kwargs)
9069
1a6bba1e 9070 def Detach(*args, **kwargs):
248ed943
RD
9071 """
9072 Detach(self, item) -> bool
9073
9074 Detaches an item from the sizer without destroying it. This method
9075 does not cause any layout or resizing to take place, call `Layout` to
9076 do so. The *item* parameter can be either a window, a sizer, or the
9077 zero-based index of the item to be detached. Returns True if the child item
9078 was found and detached.
9079 """
1a6bba1e
RD
9080 return _core_.Sizer_Detach(*args, **kwargs)
9081
d55e5bfc
RD
9082 def _SetItemMinSize(*args, **kwargs):
9083 """_SetItemMinSize(self, PyObject item, Size size)"""
9084 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
9085
248ed943
RD
9086 def SetItemMinSize(self, item, *args):
9087 """
9088 SetItemMinSize(self, item, Size size)
9089
9090 Sets the minimum size that will be allocated for an item in the sizer.
9091 The *item* parameter can be either a window, a sizer, or the
9092 zero-based index of the item. If a window or sizer is given then it
9093 will be searched for recursivly in subsizers if neccessary.
9094 """
9095 if len(args) == 2:
9096 # for backward compatibility accept separate width,height args too
9097 return self._SetItemMinSize(item, args)
9098 else:
9099 return self._SetItemMinSize(item, args[0])
9100
d55e5bfc 9101 def AddItem(*args, **kwargs):
248ed943
RD
9102 """
9103 AddItem(self, SizerItem item)
9104
9105 Adds a `wx.SizerItem` to the sizer.
9106 """
d55e5bfc
RD
9107 return _core_.Sizer_AddItem(*args, **kwargs)
9108
9109 def InsertItem(*args, **kwargs):
248ed943
RD
9110 """
9111 InsertItem(self, int index, SizerItem item)
9112
9113 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
9114 """
d55e5bfc
RD
9115 return _core_.Sizer_InsertItem(*args, **kwargs)
9116
9117 def PrependItem(*args, **kwargs):
248ed943
RD
9118 """
9119 PrependItem(self, SizerItem item)
9120
9121 Prepends a `wx.SizerItem` to the sizer.
9122 """
d55e5bfc
RD
9123 return _core_.Sizer_PrependItem(*args, **kwargs)
9124
248ed943 9125 def AddMany(self, items):
c24da6d6
RD
9126 """
9127 AddMany is a convenience method for adding several items
9128 to a sizer at one time. Simply pass it a list of tuples,
9129 where each tuple consists of the parameters that you
9130 would normally pass to the `Add` method.
9131 """
248ed943
RD
9132 for item in items:
9133 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
9134 item = (item, )
9135 self.Add(*item)
d55e5bfc
RD
9136
9137 # for backwards compatibility only, please do not use in new code
c24da6d6
RD
9138 AddWindow = wx._deprecated(Add, "AddWindow is deprecated, use `Add` instead.")
9139 AddSizer = wx._deprecated(Add, "AddSizer is deprecated, use `Add` instead.")
9140 AddSpacer = wx._deprecated(Add, "AddSpacer is deprecated, use `Add` instead.")
9141 PrependWindow = wx._deprecated(Prepend, "PrependWindow is deprecated, use `Prepend` instead.")
9142 PrependSizer = wx._deprecated(Prepend, "PrependSizer is deprecated, use `Prepend` instead.")
9143 PrependSpacer = wx._deprecated(Prepend, "PrependSpacer is deprecated, use `Prepend` instead.")
9144 InsertWindow = wx._deprecated(Insert, "InsertWindow is deprecated, use `Insert` instead.")
9145 InsertSizer = wx._deprecated(Insert, "InsertSizer is deprecated, use `Insert` instead.")
9146 InsertSpacer = wx._deprecated(Insert, "InsertSpacer is deprecated, use `Insert` instead.")
9147 RemoveWindow = wx._deprecated(Remove, "RemoveWindow is deprecated, use `Remove` instead.")
9148 RemoveSizer = wx._deprecated(Remove, "RemoveSizer is deprecated, use `Remove` instead.")
9149 RemovePos = wx._deprecated(Remove, "RemovePos is deprecated, use `Remove` instead.")
d55e5bfc
RD
9150
9151
d55e5bfc 9152 def SetDimension(*args, **kwargs):
248ed943
RD
9153 """
9154 SetDimension(self, int x, int y, int width, int height)
9155
9156 Call this to force the sizer to take the given dimension and thus
9157 force the items owned by the sizer to resize themselves according to
9158 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
9159 methods.
9160 """
d55e5bfc
RD
9161 return _core_.Sizer_SetDimension(*args, **kwargs)
9162
9163 def SetMinSize(*args, **kwargs):
248ed943
RD
9164 """
9165 SetMinSize(self, Size size)
9166
9167 Call this to give the sizer a minimal size. Normally, the sizer will
9168 calculate its minimal size based purely on how much space its children
9169 need. After calling this method `GetMinSize` will return either the
9170 minimal size as requested by its children or the minimal size set
9171 here, depending on which is bigger.
9172 """
d55e5bfc
RD
9173 return _core_.Sizer_SetMinSize(*args, **kwargs)
9174
9175 def GetSize(*args, **kwargs):
248ed943
RD
9176 """
9177 GetSize(self) -> Size
9178
9179 Returns the current size of the space managed by the sizer.
9180 """
d55e5bfc
RD
9181 return _core_.Sizer_GetSize(*args, **kwargs)
9182
9183 def GetPosition(*args, **kwargs):
248ed943
RD
9184 """
9185 GetPosition(self) -> Point
9186
9187 Returns the current position of the sizer's managed space.
9188 """
d55e5bfc
RD
9189 return _core_.Sizer_GetPosition(*args, **kwargs)
9190
9191 def GetMinSize(*args, **kwargs):
248ed943
RD
9192 """
9193 GetMinSize(self) -> Size
9194
9195 Returns the minimal size of the sizer. This is either the combined
9196 minimal size of all the children and their borders or the minimal size
9197 set by SetMinSize, depending on which is bigger.
9198 """
d55e5bfc
RD
9199 return _core_.Sizer_GetMinSize(*args, **kwargs)
9200
9201 def GetSizeTuple(self):
1a6bba1e 9202 return self.GetSize().Get()
d55e5bfc 9203 def GetPositionTuple(self):
1a6bba1e 9204 return self.GetPosition().Get()
d55e5bfc 9205 def GetMinSizeTuple(self):
1a6bba1e 9206 return self.GetMinSize().Get()
d55e5bfc
RD
9207
9208 def RecalcSizes(*args, **kwargs):
248ed943
RD
9209 """
9210 RecalcSizes(self)
9211
9212 Using the sizes calculated by `CalcMin` reposition and resize all the
9213 items managed by this sizer. You should not need to call this directly as
9214 it is called by `Layout`.
9215 """
d55e5bfc
RD
9216 return _core_.Sizer_RecalcSizes(*args, **kwargs)
9217
9218 def CalcMin(*args, **kwargs):
248ed943
RD
9219 """
9220 CalcMin(self) -> Size
9221
9222 This method is where the sizer will do the actual calculation of its
9223 children's minimal sizes. You should not need to call this directly as
9224 it is called by `Layout`.
9225 """
d55e5bfc
RD
9226 return _core_.Sizer_CalcMin(*args, **kwargs)
9227
9228 def Layout(*args, **kwargs):
248ed943
RD
9229 """
9230 Layout(self)
9231
9232 This method will force the recalculation and layout of the items
9233 controlled by the sizer using the current space allocated to the
9234 sizer. Normally this is called automatically from the owning window's
9235 EVT_SIZE handler, but it is also useful to call it from user code when
9236 one of the items in a sizer change size, or items are added or
9237 removed.
9238 """
d55e5bfc
RD
9239 return _core_.Sizer_Layout(*args, **kwargs)
9240
9241 def Fit(*args, **kwargs):
248ed943
RD
9242 """
9243 Fit(self, Window window) -> Size
9244
9245 Tell the sizer to resize the *window* to match the sizer's minimal
9246 size. This is commonly done in the constructor of the window itself in
9247 order to set its initial size to match the needs of the children as
9248 determined by the sizer. Returns the new size.
9249
9250 For a top level window this is the total window size, not the client size.
9251 """
d55e5bfc
RD
9252 return _core_.Sizer_Fit(*args, **kwargs)
9253
9254 def FitInside(*args, **kwargs):
248ed943
RD
9255 """
9256 FitInside(self, Window window)
9257
9258 Tell the sizer to resize the *virtual size* of the *window* to match the
9259 sizer's minimal size. This will not alter the on screen size of the
9260 window, but may cause the addition/removal/alteration of scrollbars
9261 required to view the virtual area in windows which manage it.
9262
9263 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9264
9265 """
d55e5bfc
RD
9266 return _core_.Sizer_FitInside(*args, **kwargs)
9267
9268 def SetSizeHints(*args, **kwargs):
248ed943
RD
9269 """
9270 SetSizeHints(self, Window window)
9271
9272 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9273 match the sizer's minimal size. This is commonly done in the
9274 constructor of the window itself if the window is resizable (as are
9275 many dialogs under Unix and frames on probably all platforms) in order
9276 to prevent the window from being sized smaller than the minimal size
9277 required by the sizer.
9278 """
d55e5bfc
RD
9279 return _core_.Sizer_SetSizeHints(*args, **kwargs)
9280
9281 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
9282 """
9283 SetVirtualSizeHints(self, Window window)
9284
9285 Tell the sizer to set the minimal size of the window virtual area to
9286 match the sizer's minimal size. For windows with managed scrollbars
9287 this will set them appropriately.
9288
9289 :see: `wx.ScrolledWindow.SetScrollbars`
9290
9291 """
d55e5bfc
RD
9292 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
9293
9294 def Clear(*args, **kwargs):
248ed943
RD
9295 """
9296 Clear(self, bool deleteWindows=False)
9297
9298 Clear all items from the sizer, optionally destroying the window items
9299 as well.
9300 """
d55e5bfc
RD
9301 return _core_.Sizer_Clear(*args, **kwargs)
9302
9303 def DeleteWindows(*args, **kwargs):
248ed943
RD
9304 """
9305 DeleteWindows(self)
9306
9307 Destroy all windows managed by the sizer.
9308 """
d55e5bfc
RD
9309 return _core_.Sizer_DeleteWindows(*args, **kwargs)
9310
9311 def GetChildren(*args, **kwargs):
248ed943
RD
9312 """
9313 GetChildren(sefl) -> list
9314
9315 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9316 """
d55e5bfc
RD
9317 return _core_.Sizer_GetChildren(*args, **kwargs)
9318
9319 def Show(*args, **kwargs):
248ed943
RD
9320 """
9321 Show(self, item, bool show=True)
d55e5bfc 9322
248ed943
RD
9323 Shows or hides an item managed by the sizer. To make a sizer item
9324 disappear or reappear, use Show followed by `Layout`. The *item*
9325 parameter can be either a window, a sizer, or the zero-based index of
9326 the item.
9327 """
9328 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
9329
9330 def IsShown(*args, **kwargs):
248ed943
RD
9331 """
9332 IsShown(self, item)
9333
9334 Determines if the item is currently shown. sizer. To make a sizer
9335 item disappear or reappear, use Show followed by `Layout`. The *item*
9336 parameter can be either a window, a sizer, or the zero-based index of
9337 the item.
9338 """
d55e5bfc
RD
9339 return _core_.Sizer_IsShown(*args, **kwargs)
9340
248ed943
RD
9341 def Hide(self, item):
9342 """
9343 A convenience method for Show(item, False).
9344 """
9345 self.Show(item, False)
9346
d55e5bfc 9347 def ShowItems(*args, **kwargs):
248ed943
RD
9348 """
9349 ShowItems(self, bool show)
9350
9351 Recursively call `wx.Window.Show` on all sizer items.
9352 """
d55e5bfc
RD
9353 return _core_.Sizer_ShowItems(*args, **kwargs)
9354
9355
9356class SizerPtr(Sizer):
9357 def __init__(self, this):
9358 self.this = this
9359 if not hasattr(self,"thisown"): self.thisown = 0
9360 self.__class__ = Sizer
9361_core_.Sizer_swigregister(SizerPtr)
9362
9363class PySizer(Sizer):
248ed943
RD
9364 """
9365 wx.PySizer is a special version of `wx.Sizer` that has been
9366 instrumented to allow the C++ virtual methods to be overloaded in
9367 Python derived classes. You would derive from this class if you are
9368 wanting to implement a custom sizer in Python code. Simply implement
9369 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
9370 For example::
9371
9372 class MySizer(wx.PySizer):
9373 def __init__(self):
9374 wx.PySizer.__init__(self)
9375
9376 def CalcMin(self):
9377 for item in self.GetChildren():
9378 # calculate the total minimum width and height needed
9379 # by all items in the sizer according to this sizer's
9380 # layout algorithm.
9381 ...
9382 return wx.Size(width, height)
9383
9384 def RecalcSizes(self):
9385 # find the space allotted to this sizer
9386 pos = self.GetPosition()
9387 size = self.GetSize()
9388 for item in self.GetChildren():
9389 # Recalculate (if necessary) the position and size of
9390 # each item and then call item.SetDimension to do the
9391 # actual positioning and sizing of the items within the
9392 # space alloted to this sizer.
9393 ...
9394 item.SetDimension(itemPos, itemSize)
9395
9396
9397 When `Layout` is called it first calls `CalcMin` followed by
9398 `RecalcSizes` so you can optimize a bit by saving the results of
9399 `CalcMin` and resuing them in `RecalcSizes`.
9400
9401 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
9402
9403
9404 """
d55e5bfc
RD
9405 def __repr__(self):
9406 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9407 def __init__(self, *args, **kwargs):
248ed943
RD
9408 """
9409 __init__(self) -> PySizer
9410
9411 Creates a wx.PySizer. Must be called from the __init__ in the derived
9412 class.
9413 """
d55e5bfc
RD
9414 newobj = _core_.new_PySizer(*args, **kwargs)
9415 self.this = newobj.this
9416 self.thisown = 1
9417 del newobj.thisown
9418 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
9419
9420 def _setCallbackInfo(*args, **kwargs):
9421 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
9422 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
9423
9424
9425class PySizerPtr(PySizer):
9426 def __init__(self, this):
9427 self.this = this
9428 if not hasattr(self,"thisown"): self.thisown = 0
9429 self.__class__ = PySizer
9430_core_.PySizer_swigregister(PySizerPtr)
9431
9432#---------------------------------------------------------------------------
9433
9434class BoxSizer(Sizer):
248ed943
RD
9435 """
9436 The basic idea behind a box sizer is that windows will most often be
9437 laid out in rather simple basic geometry, typically in a row or a
9438 column or nested hierarchies of either. A wx.BoxSizer will lay out
9439 its items in a simple row or column, depending on the orientation
9440 parameter passed to the constructor.
9441 """
d55e5bfc
RD
9442 def __repr__(self):
9443 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9444 def __init__(self, *args, **kwargs):
248ed943
RD
9445 """
9446 __init__(self, int orient=HORIZONTAL) -> BoxSizer
9447
9448 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
9449 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
9450 sizer.
9451 """
d55e5bfc
RD
9452 newobj = _core_.new_BoxSizer(*args, **kwargs)
9453 self.this = newobj.this
9454 self.thisown = 1
9455 del newobj.thisown
9456 self._setOORInfo(self)
9457
9458 def GetOrientation(*args, **kwargs):
248ed943
RD
9459 """
9460 GetOrientation(self) -> int
9461
9462 Returns the current orientation of the sizer.
9463 """
d55e5bfc
RD
9464 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
9465
9466 def SetOrientation(*args, **kwargs):
248ed943
RD
9467 """
9468 SetOrientation(self, int orient)
d55e5bfc 9469
248ed943
RD
9470 Resets the orientation of the sizer.
9471 """
9472 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc
RD
9473
9474
9475class BoxSizerPtr(BoxSizer):
9476 def __init__(self, this):
9477 self.this = this
9478 if not hasattr(self,"thisown"): self.thisown = 0
9479 self.__class__ = BoxSizer
9480_core_.BoxSizer_swigregister(BoxSizerPtr)
9481
9482#---------------------------------------------------------------------------
9483
9484class StaticBoxSizer(BoxSizer):
248ed943
RD
9485 """
9486 wx.StaticBoxSizer derives from and functions identically to the
9487 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
9488 manages. Note that this static box must be created separately and
9489 passed to the sizer constructor.
9490 """
d55e5bfc
RD
9491 def __repr__(self):
9492 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9493 def __init__(self, *args, **kwargs):
248ed943
RD
9494 """
9495 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
9496
9497 Constructor. It takes an associated static box and the orientation
9498 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
9499 ``wx.HORIZONTAL``.
9500 """
d55e5bfc
RD
9501 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
9502 self.this = newobj.this
9503 self.thisown = 1
9504 del newobj.thisown
9505 self._setOORInfo(self)
9506
9507 def GetStaticBox(*args, **kwargs):
248ed943
RD
9508 """
9509 GetStaticBox(self) -> StaticBox
d55e5bfc 9510
248ed943
RD
9511 Returns the static box associated with this sizer.
9512 """
9513 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc
RD
9514
9515
9516class StaticBoxSizerPtr(StaticBoxSizer):
9517 def __init__(self, this):
9518 self.this = this
9519 if not hasattr(self,"thisown"): self.thisown = 0
9520 self.__class__ = StaticBoxSizer
9521_core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
9522
9523#---------------------------------------------------------------------------
9524
9525class GridSizer(Sizer):
248ed943
RD
9526 """
9527 A grid sizer is a sizer which lays out its children in a
9528 two-dimensional table with all cells having the same size. In other
9529 words, the width of each cell within the grid is the width of the
9530 widest item added to the sizer and the height of each grid cell is the
9531 height of the tallest item. An optional vertical and/or horizontal
9532 gap between items can also be specified (in pixels.)
9533
9534 Items are placed in the cells of the grid in the order they are added,
9535 in row-major order. In other words, the first row is filled first,
9536 then the second, and so on until all items have been added. (If
9537 neccessary, additional rows will be added as items are added.) If you
9538 need to have greater control over the cells that items are placed in
9539 then use the `wx.GridBagSizer`.
9540
9541 """
d55e5bfc
RD
9542 def __repr__(self):
9543 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9544 def __init__(self, *args, **kwargs):
248ed943
RD
9545 """
9546 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
9547
9548 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
9549 of columns and rows in the sizer - if either of the parameters is
9550 zero, it will be calculated to from the total number of children in
9551 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9552 define extra space between all children.
9553 """
d55e5bfc
RD
9554 newobj = _core_.new_GridSizer(*args, **kwargs)
9555 self.this = newobj.this
9556 self.thisown = 1
9557 del newobj.thisown
9558 self._setOORInfo(self)
9559
d55e5bfc 9560 def SetCols(*args, **kwargs):
248ed943
RD
9561 """
9562 SetCols(self, int cols)
9563
9564 Sets the number of columns in the sizer.
9565 """
d55e5bfc
RD
9566 return _core_.GridSizer_SetCols(*args, **kwargs)
9567
9568 def SetRows(*args, **kwargs):
248ed943
RD
9569 """
9570 SetRows(self, int rows)
9571
9572 Sets the number of rows in the sizer.
9573 """
d55e5bfc
RD
9574 return _core_.GridSizer_SetRows(*args, **kwargs)
9575
9576 def SetVGap(*args, **kwargs):
248ed943
RD
9577 """
9578 SetVGap(self, int gap)
9579
9580 Sets the vertical gap (in pixels) between the cells in the sizer.
9581 """
d55e5bfc
RD
9582 return _core_.GridSizer_SetVGap(*args, **kwargs)
9583
9584 def SetHGap(*args, **kwargs):
248ed943
RD
9585 """
9586 SetHGap(self, int gap)
9587
9588 Sets the horizontal gap (in pixels) between cells in the sizer
9589 """
d55e5bfc
RD
9590 return _core_.GridSizer_SetHGap(*args, **kwargs)
9591
9592 def GetCols(*args, **kwargs):
248ed943
RD
9593 """
9594 GetCols(self) -> int
9595
9596 Returns the number of columns in the sizer.
9597 """
d55e5bfc
RD
9598 return _core_.GridSizer_GetCols(*args, **kwargs)
9599
9600 def GetRows(*args, **kwargs):
248ed943
RD
9601 """
9602 GetRows(self) -> int
9603
9604 Returns the number of rows in the sizer.
9605 """
d55e5bfc
RD
9606 return _core_.GridSizer_GetRows(*args, **kwargs)
9607
9608 def GetVGap(*args, **kwargs):
248ed943
RD
9609 """
9610 GetVGap(self) -> int
9611
9612 Returns the vertical gap (in pixels) between the cells in the sizer.
9613 """
d55e5bfc
RD
9614 return _core_.GridSizer_GetVGap(*args, **kwargs)
9615
9616 def GetHGap(*args, **kwargs):
248ed943
RD
9617 """
9618 GetHGap(self) -> int
9619
9620 Returns the horizontal gap (in pixels) between cells in the sizer.
9621 """
d55e5bfc
RD
9622 return _core_.GridSizer_GetHGap(*args, **kwargs)
9623
9624
9625class GridSizerPtr(GridSizer):
9626 def __init__(self, this):
9627 self.this = this
9628 if not hasattr(self,"thisown"): self.thisown = 0
9629 self.__class__ = GridSizer
9630_core_.GridSizer_swigregister(GridSizerPtr)
9631
9632#---------------------------------------------------------------------------
9633
9634FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
9635FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
9636FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
9637class FlexGridSizer(GridSizer):
248ed943
RD
9638 """
9639 A flex grid sizer is a sizer which lays out its children in a
9640 two-dimensional table with all table cells in one row having the same
9641 height and all cells in one column having the same width, but all
9642 rows or all columns are not necessarily the same height or width as in
9643 the `wx.GridSizer`.
9644
9645 wx.FlexGridSizer can also size items equally in one direction but
9646 unequally ("flexibly") in the other. If the sizer is only flexible
9647 in one direction (this can be changed using `SetFlexibleDirection`), it
9648 needs to be decided how the sizer should grow in the other ("non
9649 flexible") direction in order to fill the available space. The
9650 `SetNonFlexibleGrowMode` method serves this purpose.
9651
9652
9653 """
d55e5bfc
RD
9654 def __repr__(self):
9655 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9656 def __init__(self, *args, **kwargs):
248ed943
RD
9657 """
9658 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
9659
9660 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
9661 number of columns and rows in the sizer - if either of the parameters
9662 is zero, it will be calculated to from the total number of children in
9663 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9664 define extra space between all children.
9665 """
d55e5bfc
RD
9666 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
9667 self.this = newobj.this
9668 self.thisown = 1
9669 del newobj.thisown
9670 self._setOORInfo(self)
9671
248ed943
RD
9672 def AddGrowableRow(*args, **kwargs):
9673 """
9674 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 9675
248ed943
RD
9676 Specifies that row *idx* (starting from zero) should be grown if there
9677 is extra space available to the sizer.
d55e5bfc 9678
248ed943
RD
9679 The *proportion* parameter has the same meaning as the stretch factor
9680 for the box sizers except that if all proportions are 0, then all
9681 columns are resized equally (instead of not being resized at all).
9682 """
d55e5bfc
RD
9683 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
9684
9685 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
9686 """
9687 RemoveGrowableRow(self, size_t idx)
9688
9689 Specifies that row *idx* is no longer growable.
9690 """
d55e5bfc
RD
9691 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
9692
9693 def AddGrowableCol(*args, **kwargs):
248ed943
RD
9694 """
9695 AddGrowableCol(self, size_t idx, int proportion=0)
9696
9697 Specifies that column *idx* (starting from zero) should be grown if
9698 there is extra space available to the sizer.
9699
9700 The *proportion* parameter has the same meaning as the stretch factor
9701 for the box sizers except that if all proportions are 0, then all
9702 columns are resized equally (instead of not being resized at all).
9703 """
d55e5bfc
RD
9704 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
9705
9706 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
9707 """
9708 RemoveGrowableCol(self, size_t idx)
9709
9710 Specifies that column *idx* is no longer growable.
9711 """
d55e5bfc
RD
9712 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
9713
9714 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
9715 """
9716 SetFlexibleDirection(self, int direction)
9717
9718 Specifies whether the sizer should flexibly resize its columns, rows,
9719 or both. Argument *direction* can be one of the following values. Any
9720 other value is ignored.
9721
9722 ============== =======================================
9723 wx.VERTICAL Rows are flexibly sized.
9724 wx.HORIZONTAL Columns are flexibly sized.
9725 wx.BOTH Both rows and columns are flexibly sized
9726 (this is the default value).
9727 ============== =======================================
9728
9729 Note that this method does not trigger relayout.
9730
9731 """
d55e5bfc
RD
9732 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
9733
9734 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
9735 """
9736 GetFlexibleDirection(self) -> int
9737
9738 Returns a value that specifies whether the sizer
9739 flexibly resizes its columns, rows, or both (default).
9740
9741 :see: `SetFlexibleDirection`
9742 """
d55e5bfc
RD
9743 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
9744
9745 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
9746 """
9747 SetNonFlexibleGrowMode(self, int mode)
9748
9749 Specifies how the sizer should grow in the non-flexible direction if
9750 there is one (so `SetFlexibleDirection` must have been called
9751 previously). Argument *mode* can be one of the following values:
9752
9753 ========================== =================================================
9754 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
9755 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
9756 `AddGrowableCol` and `AddGrowableRow`. In this
9757 case equal sizing applies to minimum sizes of
9758 columns or rows (this is the default value).
9759 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
9760 the non flexible direction, whether they are
9761 growable or not in the flexbile direction.
9762 ========================== =================================================
9763
9764 Note that this method does not trigger relayout.
9765
9766
9767 """
d55e5bfc
RD
9768 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
9769
9770 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
9771 """
9772 GetNonFlexibleGrowMode(self) -> int
9773
9774 Returns the value that specifies how the sizer grows in the
9775 non-flexible direction if there is one.
9776
9777 :see: `SetNonFlexibleGrowMode`
9778 """
d55e5bfc
RD
9779 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
9780
9781 def GetRowHeights(*args, **kwargs):
a8eff060
RD
9782 """
9783 GetRowHeights(self) -> list
9784
9785 Returns a list of integers representing the heights of each of the
9786 rows in the sizer.
9787 """
d55e5bfc
RD
9788 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
9789
9790 def GetColWidths(*args, **kwargs):
a8eff060
RD
9791 """
9792 GetColWidths(self) -> list
9793
9794 Returns a list of integers representing the widths of each of the
9795 columns in the sizer.
9796 """
d55e5bfc
RD
9797 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
9798
9799
9800class FlexGridSizerPtr(FlexGridSizer):
9801 def __init__(self, this):
9802 self.this = this
9803 if not hasattr(self,"thisown"): self.thisown = 0
9804 self.__class__ = FlexGridSizer
9805_core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
9806
9807#---------------------------------------------------------------------------
9808
9809class GBPosition(object):
248ed943
RD
9810 """
9811 This class represents the position of an item in a virtual grid of
9812 rows and columns managed by a `wx.GridBagSizer`. wxPython has
9813 typemaps that will automatically convert from a 2-element sequence of
9814 integers to a wx.GBPosition, so you can use the more pythonic
9815 representation of the position nearly transparently in Python code.
9816 """
d55e5bfc
RD
9817 def __repr__(self):
9818 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9819 def __init__(self, *args, **kwargs):
248ed943
RD
9820 """
9821 __init__(self, int row=0, int col=0) -> GBPosition
9822
9823 This class represents the position of an item in a virtual grid of
9824 rows and columns managed by a `wx.GridBagSizer`. wxPython has
9825 typemaps that will automatically convert from a 2-element sequence of
9826 integers to a wx.GBPosition, so you can use the more pythonic
9827 representation of the position nearly transparently in Python code.
9828 """
d55e5bfc
RD
9829 newobj = _core_.new_GBPosition(*args, **kwargs)
9830 self.this = newobj.this
9831 self.thisown = 1
9832 del newobj.thisown
9833 def GetRow(*args, **kwargs):
9834 """GetRow(self) -> int"""
9835 return _core_.GBPosition_GetRow(*args, **kwargs)
9836
9837 def GetCol(*args, **kwargs):
9838 """GetCol(self) -> int"""
9839 return _core_.GBPosition_GetCol(*args, **kwargs)
9840
9841 def SetRow(*args, **kwargs):
9842 """SetRow(self, int row)"""
9843 return _core_.GBPosition_SetRow(*args, **kwargs)
9844
9845 def SetCol(*args, **kwargs):
9846 """SetCol(self, int col)"""
9847 return _core_.GBPosition_SetCol(*args, **kwargs)
9848
9849 def __eq__(*args, **kwargs):
9850 """__eq__(self, GBPosition other) -> bool"""
9851 return _core_.GBPosition___eq__(*args, **kwargs)
9852
9853 def __ne__(*args, **kwargs):
9854 """__ne__(self, GBPosition other) -> bool"""
9855 return _core_.GBPosition___ne__(*args, **kwargs)
9856
9857 def Set(*args, **kwargs):
9858 """Set(self, int row=0, int col=0)"""
9859 return _core_.GBPosition_Set(*args, **kwargs)
9860
9861 def Get(*args, **kwargs):
9862 """Get(self) -> PyObject"""
9863 return _core_.GBPosition_Get(*args, **kwargs)
9864
79fccf9d 9865 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
9866 def __str__(self): return str(self.Get())
9867 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
9868 def __len__(self): return len(self.Get())
9869 def __getitem__(self, index): return self.Get()[index]
9870 def __setitem__(self, index, val):
9871 if index == 0: self.SetRow(val)
9872 elif index == 1: self.SetCol(val)
9873 else: raise IndexError
9874 def __nonzero__(self): return self.Get() != (0,0)
9875 __safe_for_unpickling__ = True
9876 def __reduce__(self): return (wx.GBPosition, self.Get())
9877
9878 row = property(GetRow, SetRow)
9879 col = property(GetCol, SetCol)
9880
9881
9882class GBPositionPtr(GBPosition):
9883 def __init__(self, this):
9884 self.this = this
9885 if not hasattr(self,"thisown"): self.thisown = 0
9886 self.__class__ = GBPosition
9887_core_.GBPosition_swigregister(GBPositionPtr)
9888
9889class GBSpan(object):
248ed943
RD
9890 """
9891 This class is used to hold the row and column spanning attributes of
9892 items in a `wx.GridBagSizer`. wxPython has typemaps that will
9893 automatically convert from a 2-element sequence of integers to a
9894 wx.GBSpan, so you can use the more pythonic representation of the span
9895 nearly transparently in Python code.
9896
9897 """
d55e5bfc
RD
9898 def __repr__(self):
9899 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9900 def __init__(self, *args, **kwargs):
248ed943
RD
9901 """
9902 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
9903
9904 Construct a new wxGBSpan, optionally setting the rowspan and
9905 colspan. The default is (1,1). (Meaning that the item occupies one
9906 cell in each direction.
9907 """
d55e5bfc
RD
9908 newobj = _core_.new_GBSpan(*args, **kwargs)
9909 self.this = newobj.this
9910 self.thisown = 1
9911 del newobj.thisown
9912 def GetRowspan(*args, **kwargs):
9913 """GetRowspan(self) -> int"""
9914 return _core_.GBSpan_GetRowspan(*args, **kwargs)
9915
9916 def GetColspan(*args, **kwargs):
9917 """GetColspan(self) -> int"""
9918 return _core_.GBSpan_GetColspan(*args, **kwargs)
9919
9920 def SetRowspan(*args, **kwargs):
9921 """SetRowspan(self, int rowspan)"""
9922 return _core_.GBSpan_SetRowspan(*args, **kwargs)
9923
9924 def SetColspan(*args, **kwargs):
9925 """SetColspan(self, int colspan)"""
9926 return _core_.GBSpan_SetColspan(*args, **kwargs)
9927
9928 def __eq__(*args, **kwargs):
9929 """__eq__(self, GBSpan other) -> bool"""
9930 return _core_.GBSpan___eq__(*args, **kwargs)
9931
9932 def __ne__(*args, **kwargs):
9933 """__ne__(self, GBSpan other) -> bool"""
9934 return _core_.GBSpan___ne__(*args, **kwargs)
9935
9936 def Set(*args, **kwargs):
9937 """Set(self, int rowspan=1, int colspan=1)"""
9938 return _core_.GBSpan_Set(*args, **kwargs)
9939
9940 def Get(*args, **kwargs):
9941 """Get(self) -> PyObject"""
9942 return _core_.GBSpan_Get(*args, **kwargs)
9943
79fccf9d 9944 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
9945 def __str__(self): return str(self.Get())
9946 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
9947 def __len__(self): return len(self.Get())
9948 def __getitem__(self, index): return self.Get()[index]
9949 def __setitem__(self, index, val):
9950 if index == 0: self.SetRowspan(val)
9951 elif index == 1: self.SetColspan(val)
9952 else: raise IndexError
9953 def __nonzero__(self): return self.Get() != (0,0)
9954 __safe_for_unpickling__ = True
9955 def __reduce__(self): return (wx.GBSpan, self.Get())
9956
9957 rowspan = property(GetRowspan, SetRowspan)
9958 colspan = property(GetColspan, SetColspan)
9959
9960
9961class GBSpanPtr(GBSpan):
9962 def __init__(self, this):
9963 self.this = this
9964 if not hasattr(self,"thisown"): self.thisown = 0
9965 self.__class__ = GBSpan
9966_core_.GBSpan_swigregister(GBSpanPtr)
9967
9968class GBSizerItem(SizerItem):
248ed943
RD
9969 """
9970 The wx.GBSizerItem class is used to track the additional data about
9971 items in a `wx.GridBagSizer` such as the item's position in the grid
9972 and how many rows or columns it spans.
9973
9974 """
d55e5bfc
RD
9975 def __repr__(self):
9976 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9977 def __init__(self, *args, **kwargs):
248ed943
RD
9978 """
9979 __init__(self) -> GBSizerItem
9980
9981 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
9982 size will need to be set, as well as a position and span before this
9983 item can be used in a Sizer.
9984
9985 You will probably never need to create a wx.GBSizerItem directly as they
9986 are created automatically when the sizer's Add method is called.
9987 """
d55e5bfc
RD
9988 newobj = _core_.new_GBSizerItem(*args, **kwargs)
9989 self.this = newobj.this
9990 self.thisown = 1
9991 del newobj.thisown
9992 def GetPos(*args, **kwargs):
248ed943
RD
9993 """
9994 GetPos(self) -> GBPosition
9995
9996 Get the grid position of the item
9997 """
d55e5bfc
RD
9998 return _core_.GBSizerItem_GetPos(*args, **kwargs)
9999
10000 def GetPosTuple(self): return self.GetPos().Get()
10001 def GetSpan(*args, **kwargs):
248ed943
RD
10002 """
10003 GetSpan(self) -> GBSpan
10004
10005 Get the row and column spanning of the item
10006 """
d55e5bfc
RD
10007 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
10008
10009 def GetSpanTuple(self): return self.GetSpan().Get()
10010 def SetPos(*args, **kwargs):
248ed943
RD
10011 """
10012 SetPos(self, GBPosition pos) -> bool
10013
10014 If the item is already a member of a sizer then first ensure that
10015 there is no other item that would intersect with this one at the new
10016 position, then set the new position. Returns True if the change is
10017 successful and after the next Layout() the item will be moved.
10018 """
d55e5bfc
RD
10019 return _core_.GBSizerItem_SetPos(*args, **kwargs)
10020
10021 def SetSpan(*args, **kwargs):
248ed943
RD
10022 """
10023 SetSpan(self, GBSpan span) -> bool
10024
10025 If the item is already a member of a sizer then first ensure that
10026 there is no other item that would intersect with this one with its new
10027 spanning size, then set the new spanning. Returns True if the change
10028 is successful and after the next Layout() the item will be resized.
10029
10030 """
d55e5bfc
RD
10031 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
10032
248ed943 10033 def Intersects(*args, **kwargs):
d55e5bfc
RD
10034 """
10035 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
10036
10037 Returns True if this item and the other item instersect.
d55e5bfc 10038 """
248ed943
RD
10039 return _core_.GBSizerItem_Intersects(*args, **kwargs)
10040
10041 def IntersectsPos(*args, **kwargs):
10042 """
10043 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
10044
10045 Returns True if the given pos/span would intersect with this item.
10046 """
10047 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
10048
10049 def GetEndPos(*args, **kwargs):
248ed943
RD
10050 """
10051 GetEndPos(self) -> GBPosition
10052
10053 Get the row and column of the endpoint of this item.
10054 """
d55e5bfc
RD
10055 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
10056
10057 def GetGBSizer(*args, **kwargs):
248ed943
RD
10058 """
10059 GetGBSizer(self) -> GridBagSizer
10060
10061 Get the sizer this item is a member of.
10062 """
d55e5bfc
RD
10063 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
10064
10065 def SetGBSizer(*args, **kwargs):
248ed943
RD
10066 """
10067 SetGBSizer(self, GridBagSizer sizer)
10068
10069 Set the sizer this item is a member of.
10070 """
d55e5bfc
RD
10071 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
10072
10073
10074class GBSizerItemPtr(GBSizerItem):
10075 def __init__(self, this):
10076 self.this = this
10077 if not hasattr(self,"thisown"): self.thisown = 0
10078 self.__class__ = GBSizerItem
10079_core_.GBSizerItem_swigregister(GBSizerItemPtr)
10080DefaultSpan = cvar.DefaultSpan
10081
10082def GBSizerItemWindow(*args, **kwargs):
10083 """
10084 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
10085 int border, PyObject userData=None) -> GBSizerItem
10086
10087 Construct a `wx.GBSizerItem` for a window.
d55e5bfc
RD
10088 """
10089 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
10090 val.thisown = 1
10091 return val
10092
10093def GBSizerItemSizer(*args, **kwargs):
10094 """
10095 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
10096 int border, PyObject userData=None) -> GBSizerItem
10097
10098 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc
RD
10099 """
10100 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
10101 val.thisown = 1
10102 return val
10103
10104def GBSizerItemSpacer(*args, **kwargs):
10105 """
10106 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
10107 int flag, int border, PyObject userData=None) -> GBSizerItem
10108
10109 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc
RD
10110 """
10111 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
10112 val.thisown = 1
10113 return val
10114
10115class GridBagSizer(FlexGridSizer):
248ed943
RD
10116 """
10117 A `wx.Sizer` that can lay out items in a virtual grid like a
10118 `wx.FlexGridSizer` but in this case explicit positioning of the items
10119 is allowed using `wx.GBPosition`, and items can optionally span more
10120 than one row and/or column using `wx.GBSpan`. The total size of the
10121 virtual grid is determined by the largest row and column that items are
10122 positioned at, adjusted for spanning.
10123
10124 """
d55e5bfc
RD
10125 def __repr__(self):
10126 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10127 def __init__(self, *args, **kwargs):
248ed943
RD
10128 """
10129 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
10130
10131 Constructor, with optional parameters to specify the gap between the
10132 rows and columns.
10133 """
d55e5bfc
RD
10134 newobj = _core_.new_GridBagSizer(*args, **kwargs)
10135 self.this = newobj.this
10136 self.thisown = 1
10137 del newobj.thisown
10138 def Add(*args, **kwargs):
10139 """
248ed943
RD
10140 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
10141 int border=0, userData=None)
10142
10143 Adds an item to the sizer at the grid cell *pos*, optionally spanning
10144 more than one row or column as specified with *span*. The remaining
10145 args behave similarly to `wx.Sizer.Add`.
10146
10147 Returns True if the item was successfully placed at the given cell
10148 position, False if something was already there.
10149
d55e5bfc
RD
10150 """
10151 return _core_.GridBagSizer_Add(*args, **kwargs)
10152
10153 def AddItem(*args, **kwargs):
248ed943
RD
10154 """
10155 Add(self, GBSizerItem item) -> bool
10156
10157 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
10158 the item was successfully placed at its given cell position, False if
10159 something was already there.
10160 """
d55e5bfc
RD
10161 return _core_.GridBagSizer_AddItem(*args, **kwargs)
10162
10163 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
10164 """
10165 GetEmptyCellSize(self) -> Size
10166
10167 Get the size used for cells in the grid with no item.
10168 """
d55e5bfc
RD
10169 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
10170
10171 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
10172 """
10173 SetEmptyCellSize(self, Size sz)
10174
10175 Set the size used for cells in the grid with no item.
10176 """
d55e5bfc
RD
10177 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
10178
10179 def GetItemPosition(*args):
10180 """
248ed943
RD
10181 GetItemPosition(self, item) -> GBPosition
10182
10183 Get the grid position of the specified *item* where *item* is either a
10184 window or subsizer that is a member of this sizer, or a zero-based
10185 index of an item.
d55e5bfc
RD
10186 """
10187 return _core_.GridBagSizer_GetItemPosition(*args)
10188
10189 def SetItemPosition(*args):
10190 """
248ed943
RD
10191 SetItemPosition(self, item, GBPosition pos) -> bool
10192
10193 Set the grid position of the specified *item* where *item* is either a
10194 window or subsizer that is a member of this sizer, or a zero-based
10195 index of an item. Returns True on success. If the move is not
10196 allowed (because an item is already there) then False is returned.
10197
d55e5bfc
RD
10198 """
10199 return _core_.GridBagSizer_SetItemPosition(*args)
10200
10201 def GetItemSpan(*args):
10202 """
248ed943
RD
10203 GetItemSpan(self, item) -> GBSpan
10204
10205 Get the row/col spanning of the specified *item* where *item* is
10206 either a window or subsizer that is a member of this sizer, or a
10207 zero-based index of an item.
d55e5bfc
RD
10208 """
10209 return _core_.GridBagSizer_GetItemSpan(*args)
10210
10211 def SetItemSpan(*args):
10212 """
248ed943
RD
10213 SetItemSpan(self, item, GBSpan span) -> bool
10214
10215 Set the row/col spanning of the specified *item* where *item* is
10216 either a window or subsizer that is a member of this sizer, or a
10217 zero-based index of an item. Returns True on success. If the move is
10218 not allowed (because an item is already there) then False is returned.
d55e5bfc
RD
10219 """
10220 return _core_.GridBagSizer_SetItemSpan(*args)
10221
10222 def FindItem(*args):
10223 """
248ed943
RD
10224 FindItem(self, item) -> GBSizerItem
10225
10226 Find the sizer item for the given window or subsizer, returns None if
10227 not found. (non-recursive)
d55e5bfc
RD
10228 """
10229 return _core_.GridBagSizer_FindItem(*args)
10230
10231 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
10232 """
10233 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
10234
10235 Return the sizer item for the given grid cell, or None if there is no
10236 item at that position. (non-recursive)
10237 """
d55e5bfc
RD
10238 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
10239
10240 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
10241 """
10242 FindItemAtPoint(self, Point pt) -> GBSizerItem
10243
10244 Return the sizer item located at the point given in *pt*, or None if
10245 there is no item at that point. The (x,y) coordinates in pt correspond
10246 to the client coordinates of the window using the sizer for
10247 layout. (non-recursive)
10248 """
d55e5bfc
RD
10249 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
10250
248ed943
RD
10251 def CheckForIntersection(*args, **kwargs):
10252 """
10253 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 10254
248ed943
RD
10255 Look at all items and see if any intersect (or would overlap) the
10256 given *item*. Returns True if so, False if there would be no overlap.
10257 If an *excludeItem* is given then it will not be checked for
10258 intersection, for example it may be the item we are checking the
10259 position of.
d55e5bfc 10260
248ed943
RD
10261 """
10262 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 10263
248ed943 10264 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 10265 """
248ed943
RD
10266 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
10267
10268 Look at all items and see if any intersect (or would overlap) the
10269 given position and span. Returns True if so, False if there would be
10270 no overlap. If an *excludeItem* is given then it will not be checked
10271 for intersection, for example it may be the item we are checking the
10272 position of.
d55e5bfc 10273 """
248ed943 10274 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc
RD
10275
10276
10277class GridBagSizerPtr(GridBagSizer):
10278 def __init__(self, this):
10279 self.this = this
10280 if not hasattr(self,"thisown"): self.thisown = 0
10281 self.__class__ = GridBagSizer
10282_core_.GridBagSizer_swigregister(GridBagSizerPtr)
10283
10284#---------------------------------------------------------------------------
10285
10286Left = _core_.Left
10287Top = _core_.Top
10288Right = _core_.Right
10289Bottom = _core_.Bottom
10290Width = _core_.Width
10291Height = _core_.Height
10292Centre = _core_.Centre
10293Center = _core_.Center
10294CentreX = _core_.CentreX
10295CentreY = _core_.CentreY
10296Unconstrained = _core_.Unconstrained
10297AsIs = _core_.AsIs
10298PercentOf = _core_.PercentOf
10299Above = _core_.Above
10300Below = _core_.Below
10301LeftOf = _core_.LeftOf
10302RightOf = _core_.RightOf
10303SameAs = _core_.SameAs
10304Absolute = _core_.Absolute
10305class IndividualLayoutConstraint(Object):
10306 """
79fccf9d
RD
10307 Objects of this class are stored in the `wx.LayoutConstraints` class as
10308 one of eight possible constraints that a window can be involved in.
10309 You will never need to create an instance of
10310 wx.IndividualLayoutConstraint, rather you should create a
10311 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 10312 that it contains.
d55e5bfc
RD
10313 """
10314 def __init__(self): raise RuntimeError, "No constructor defined"
10315 def __repr__(self):
10316 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10317 def Set(*args, **kwargs):
79fccf9d
RD
10318 """
10319 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
10320
10321 Sets the properties of the constraint. Normally called by one of the
10322 convenience functions such as Above, RightOf, SameAs.
10323 """
d55e5bfc
RD
10324 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
10325
10326 def LeftOf(*args, **kwargs):
10327 """
10328 LeftOf(self, Window sibling, int marg=0)
10329
79fccf9d
RD
10330 Constrains this edge to be to the left of the given window, with an
10331 optional margin. Implicitly, this is relative to the left edge of the
10332 other window.
d55e5bfc
RD
10333 """
10334 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
10335
10336 def RightOf(*args, **kwargs):
10337 """
10338 RightOf(self, Window sibling, int marg=0)
10339
79fccf9d
RD
10340 Constrains this edge to be to the right of the given window, with an
10341 optional margin. Implicitly, this is relative to the right edge of the
10342 other window.
d55e5bfc
RD
10343 """
10344 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
10345
10346 def Above(*args, **kwargs):
10347 """
10348 Above(self, Window sibling, int marg=0)
10349
79fccf9d
RD
10350 Constrains this edge to be above the given window, with an optional
10351 margin. Implicitly, this is relative to the top edge of the other
10352 window.
d55e5bfc
RD
10353 """
10354 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
10355
10356 def Below(*args, **kwargs):
10357 """
10358 Below(self, Window sibling, int marg=0)
10359
79fccf9d
RD
10360 Constrains this edge to be below the given window, with an optional
10361 margin. Implicitly, this is relative to the bottom edge of the other
10362 window.
d55e5bfc
RD
10363 """
10364 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
10365
10366 def SameAs(*args, **kwargs):
10367 """
10368 SameAs(self, Window otherW, int edge, int marg=0)
10369
79fccf9d
RD
10370 Constrains this edge or dimension to be to the same as the edge of the
10371 given window, with an optional margin.
d55e5bfc
RD
10372 """
10373 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
10374
10375 def PercentOf(*args, **kwargs):
10376 """
10377 PercentOf(self, Window otherW, int wh, int per)
10378
79fccf9d
RD
10379 Constrains this edge or dimension to be to a percentage of the given
10380 window, with an optional margin.
d55e5bfc
RD
10381 """
10382 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
10383
10384 def Absolute(*args, **kwargs):
10385 """
10386 Absolute(self, int val)
10387
79fccf9d 10388 Constrains this edge or dimension to be the given absolute value.
d55e5bfc
RD
10389 """
10390 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
10391
10392 def Unconstrained(*args, **kwargs):
10393 """
10394 Unconstrained(self)
10395
79fccf9d
RD
10396 Sets this edge or dimension to be unconstrained, that is, dependent on
10397 other edges and dimensions from which this value can be deduced.
d55e5bfc
RD
10398 """
10399 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
10400
10401 def AsIs(*args, **kwargs):
10402 """
10403 AsIs(self)
10404
79fccf9d
RD
10405 Sets this edge or constraint to be whatever the window's value is at
10406 the moment. If either of the width and height constraints are *as is*,
10407 the window will not be resized, but moved instead. This is important
10408 when considering panel items which are intended to have a default
10409 size, such as a button, which may take its size from the size of the
10410 button label.
d55e5bfc
RD
10411 """
10412 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
10413
10414 def GetOtherWindow(*args, **kwargs):
10415 """GetOtherWindow(self) -> Window"""
10416 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
10417
10418 def GetMyEdge(*args, **kwargs):
10419 """GetMyEdge(self) -> int"""
10420 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
10421
10422 def SetEdge(*args, **kwargs):
10423 """SetEdge(self, int which)"""
10424 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
10425
10426 def SetValue(*args, **kwargs):
10427 """SetValue(self, int v)"""
10428 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
10429
10430 def GetMargin(*args, **kwargs):
10431 """GetMargin(self) -> int"""
10432 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
10433
10434 def SetMargin(*args, **kwargs):
10435 """SetMargin(self, int m)"""
10436 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
10437
10438 def GetValue(*args, **kwargs):
10439 """GetValue(self) -> int"""
10440 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
10441
10442 def GetPercent(*args, **kwargs):
10443 """GetPercent(self) -> int"""
10444 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
10445
10446 def GetOtherEdge(*args, **kwargs):
10447 """GetOtherEdge(self) -> int"""
10448 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
10449
10450 def GetDone(*args, **kwargs):
10451 """GetDone(self) -> bool"""
10452 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
10453
10454 def SetDone(*args, **kwargs):
10455 """SetDone(self, bool d)"""
10456 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
10457
10458 def GetRelationship(*args, **kwargs):
10459 """GetRelationship(self) -> int"""
10460 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
10461
10462 def SetRelationship(*args, **kwargs):
10463 """SetRelationship(self, int r)"""
10464 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
10465
10466 def ResetIfWin(*args, **kwargs):
10467 """
10468 ResetIfWin(self, Window otherW) -> bool
10469
10470 Reset constraint if it mentions otherWin
10471 """
10472 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
10473
10474 def SatisfyConstraint(*args, **kwargs):
10475 """
10476 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
10477
10478 Try to satisfy constraint
10479 """
10480 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
10481
10482 def GetEdge(*args, **kwargs):
10483 """
10484 GetEdge(self, int which, Window thisWin, Window other) -> int
10485
10486 Get the value of this edge or dimension, or if this
10487 is not determinable, -1.
10488 """
10489 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
10490
10491
10492class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
10493 def __init__(self, this):
10494 self.this = this
10495 if not hasattr(self,"thisown"): self.thisown = 0
10496 self.__class__ = IndividualLayoutConstraint
10497_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
10498
10499class LayoutConstraints(Object):
10500 """
79fccf9d
RD
10501 **Note:** constraints are now deprecated and you should use sizers
10502 instead.
d55e5bfc 10503
79fccf9d
RD
10504 Objects of this class can be associated with a window to define its
10505 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
10506
10507 The class consists of the following eight constraints of class
10508 wx.IndividualLayoutConstraint, some or all of which should be accessed
10509 directly to set the appropriate constraints.
10510
10511 * left: represents the left hand edge of the window
10512 * right: represents the right hand edge of the window
10513 * top: represents the top edge of the window
10514 * bottom: represents the bottom edge of the window
10515 * width: represents the width of the window
10516 * height: represents the height of the window
10517 * centreX: represents the horizontal centre point of the window
10518 * centreY: represents the vertical centre point of the window
10519
79fccf9d
RD
10520 Most constraints are initially set to have the relationship
10521 wxUnconstrained, which means that their values should be calculated by
10522 looking at known constraints. The exceptions are width and height,
10523 which are set to wxAsIs to ensure that if the user does not specify a
10524 constraint, the existing width and height will be used, to be
10525 compatible with panel items which often have take a default size. If
10526 the constraint is ``wx.AsIs``, the dimension will not be changed.
10527
10528 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
10529
10530 """
10531 def __repr__(self):
10532 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10533 left = property(_core_.LayoutConstraints_left_get)
10534 top = property(_core_.LayoutConstraints_top_get)
10535 right = property(_core_.LayoutConstraints_right_get)
10536 bottom = property(_core_.LayoutConstraints_bottom_get)
10537 width = property(_core_.LayoutConstraints_width_get)
10538 height = property(_core_.LayoutConstraints_height_get)
10539 centreX = property(_core_.LayoutConstraints_centreX_get)
10540 centreY = property(_core_.LayoutConstraints_centreY_get)
10541 def __init__(self, *args, **kwargs):
10542 """__init__(self) -> LayoutConstraints"""
10543 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
10544 self.this = newobj.this
10545 self.thisown = 1
10546 del newobj.thisown
10547 def SatisfyConstraints(*args, **kwargs):
10548 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
10549 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
10550
10551 def AreSatisfied(*args, **kwargs):
10552 """AreSatisfied(self) -> bool"""
10553 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
10554
10555
10556class LayoutConstraintsPtr(LayoutConstraints):
10557 def __init__(self, this):
10558 self.this = this
10559 if not hasattr(self,"thisown"): self.thisown = 0
10560 self.__class__ = LayoutConstraints
10561_core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
10562
10563#----------------------------------------------------------------------------
10564
10565# Use Python's bool constants if available, make some if not
10566try:
10567 True
10568except NameError:
10569 __builtins__.True = 1==1
10570 __builtins__.False = 1==0
10571 def bool(value): return not not value
10572 __builtins__.bool = bool
10573
10574
10575
10576# workarounds for bad wxRTTI names
10577__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
10578__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
10579__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
10580
10581
10582#----------------------------------------------------------------------------
10583# Load version numbers from __version__... Ensure that major and minor
10584# versions are the same for both wxPython and wxWindows.
10585
10586from __version__ import *
10587__version__ = VERSION_STRING
10588
10589assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWindows version mismatch"
10590assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWindows version mismatch"
10591if RELEASE_VERSION != _core_.RELEASE_VERSION:
10592 import warnings
10593 warnings.warn("wxPython/wxWindows release number mismatch")
10594
10595#----------------------------------------------------------------------------
10596
10597class PyDeadObjectError(AttributeError):
10598 pass
10599
10600class _wxPyDeadObject(object):
10601 """
10602 Instances of wx objects that are OOR capable will have their __class__
10603 changed to this class when the C++ object is deleted. This should help
10604 prevent crashes due to referencing a bogus C++ pointer.
10605 """
10606 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
10607 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
10608
10609 def __repr__(self):
10610 if not hasattr(self, "_name"):
10611 self._name = "[unknown]"
10612 return self.reprStr % self._name
10613
10614 def __getattr__(self, *args):
10615 if not hasattr(self, "_name"):
10616 self._name = "[unknown]"
10617 raise PyDeadObjectError(self.attrStr % self._name)
10618
10619 def __nonzero__(self):
10620 return 0
10621
10622
10623
10624class PyUnbornObjectError(AttributeError):
10625 pass
10626
10627class _wxPyUnbornObject(object):
10628 """
10629 Some stock objects are created when the wx._core module is
10630 imported, but their C++ instance is not created until the wx.App
10631 object is created and initialized. These object instances will
10632 temporarily have their __class__ changed to this class so an
10633 exception will be raised if they are used before the C++ instance
10634 is ready.
10635 """
10636
10637 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
10638 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
10639
10640 def __repr__(self):
10641 #if not hasattr(self, "_name"):
10642 # self._name = "[unknown]"
10643 return self.reprStr #% self._name
10644
10645 def __getattr__(self, *args):
10646 #if not hasattr(self, "_name"):
10647 # self._name = "[unknown]"
10648 raise PyUnbornObjectError(self.attrStr) # % self._name )
10649
10650 def __nonzero__(self):
10651 return 0
10652
10653
10654#----------------------------------------------------------------------------
10655_wxPyCallAfterId = None
10656
10657def CallAfter(callable, *args, **kw):
10658 """
10659 Call the specified function after the current and pending event
10660 handlers have been completed. This is also good for making GUI
0439c23b
RD
10661 method calls from non-GUI threads. Any extra positional or
10662 keyword args are passed on to the callable when it is called.
10663
10664 :see: `wx.FutureCall`
d55e5bfc
RD
10665 """
10666 app = wx.GetApp()
a001823c 10667 assert app is not None, 'No wx.App created yet'
d55e5bfc
RD
10668
10669 global _wxPyCallAfterId
10670 if _wxPyCallAfterId is None:
10671 _wxPyCallAfterId = wx.NewEventType()
10672 app.Connect(-1, -1, _wxPyCallAfterId,
10673 lambda event: event.callable(*event.args, **event.kw) )
10674 evt = wx.PyEvent()
10675 evt.SetEventType(_wxPyCallAfterId)
10676 evt.callable = callable
10677 evt.args = args
10678 evt.kw = kw
10679 wx.PostEvent(app, evt)
10680
10681
10682#----------------------------------------------------------------------------
10683
10684
10685class FutureCall:
10686 """
10687 A convenience class for wx.Timer, that calls the given callable
10688 object once after the given amount of milliseconds, passing any
10689 positional or keyword args. The return value of the callable is
0439c23b 10690 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
10691
10692 If you don't need to get the return value or restart the timer
10693 then there is no need to hold a reference to this object. It will
10694 hold a reference to itself while the timer is running (the timer
10695 has a reference to self.Notify) but the cycle will be broken when
10696 the timer completes, automatically cleaning up the wx.FutureCall
10697 object.
0439c23b
RD
10698
10699 :see: `wx.CallAfter`
d55e5bfc
RD
10700 """
10701 def __init__(self, millis, callable, *args, **kwargs):
10702 self.millis = millis
10703 self.callable = callable
10704 self.SetArgs(*args, **kwargs)
10705 self.runCount = 0
10706 self.running = False
10707 self.hasRun = False
10708 self.result = None
10709 self.timer = None
10710 self.Start()
10711
10712 def __del__(self):
10713 self.Stop()
10714
10715
10716 def Start(self, millis=None, *args, **kwargs):
10717 """
10718 (Re)start the timer
10719 """
10720 self.hasRun = False
10721 if millis is not None:
10722 self.millis = millis
10723 if args or kwargs:
10724 self.SetArgs(*args, **kwargs)
10725 self.Stop()
10726 self.timer = wx.PyTimer(self.Notify)
10727 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
10728 self.running = True
10729 Restart = Start
10730
10731
10732 def Stop(self):
10733 """
10734 Stop and destroy the timer.
10735 """
10736 if self.timer is not None:
10737 self.timer.Stop()
10738 self.timer = None
10739
10740
10741 def GetInterval(self):
10742 if self.timer is not None:
10743 return self.timer.GetInterval()
10744 else:
10745 return 0
10746
10747
10748 def IsRunning(self):
10749 return self.timer is not None and self.timer.IsRunning()
10750
10751
10752 def SetArgs(self, *args, **kwargs):
10753 """
10754 (Re)set the args passed to the callable object. This is
10755 useful in conjunction with Restart if you want to schedule a
10756 new call to the same callable object but with different
10757 parameters.
10758 """
10759 self.args = args
10760 self.kwargs = kwargs
10761
10762
10763 def HasRun(self):
10764 return self.hasRun
10765
10766 def GetResult(self):
10767 return self.result
10768
10769 def Notify(self):
10770 """
10771 The timer has expired so call the callable.
10772 """
10773 if self.callable and getattr(self.callable, 'im_self', True):
10774 self.runCount += 1
10775 self.running = False
10776 self.result = self.callable(*self.args, **self.kwargs)
10777 self.hasRun = True
10778 if not self.running:
10779 # if it wasn't restarted, then cleanup
10780 wx.CallAfter(self.Stop)
10781
10782
10783
10784#----------------------------------------------------------------------------
10785# Control which items in this module should be documented by epydoc.
10786# We allow only classes and functions, which will help reduce the size
10787# of the docs by filtering out the zillions of constants, EVT objects,
10788# and etc that don't make much sense by themselves, but are instead
10789# documented (or will be) as part of the classes/functions/methods
10790# where they should be used.
10791
c24da6d6
RD
10792class __DocFilter:
10793 """
10794 A filter for epydoc that only allows non-Ptr classes and
10795 fucntions, in order to reduce the clutter in the API docs.
10796 """
10797 def __init__(self, globals):
10798 self._globals = globals
10799
10800 def __call__(self, name):
10801 import types
10802 obj = self._globals.get(name, None)
10803 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
10804 return False
10805 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
10806 return False
10807 return True
d55e5bfc
RD
10808
10809#----------------------------------------------------------------------------
10810#----------------------------------------------------------------------------
10811
10812# Import other modules in this package that should show up in the
10813# "core" wx namespace
10814from _gdi import *
10815from _windows import *
10816from _controls import *
10817from _misc import *
10818
10819
10820# Fixup the stock objects since they can't be used yet. (They will be
10821# restored in wx.PyApp.OnInit.)
10822_core_._wxPyFixStockObjects()
10823
10824#----------------------------------------------------------------------------
10825#----------------------------------------------------------------------------
10826
10827