]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/mac/_core.py
reSWIGged
[wxWidgets.git] / wxPython / src / mac / _core.py
1 # This file was created automatically by SWIG.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 import _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.
12 import sys as _sys
13 wx = _sys.modules[__name__]
14
15
16 #----------------------------------------------------------------------------
17
18 def _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
35 NOT_FOUND = _core_.NOT_FOUND
36 VSCROLL = _core_.VSCROLL
37 HSCROLL = _core_.HSCROLL
38 CAPTION = _core_.CAPTION
39 DOUBLE_BORDER = _core_.DOUBLE_BORDER
40 SUNKEN_BORDER = _core_.SUNKEN_BORDER
41 RAISED_BORDER = _core_.RAISED_BORDER
42 BORDER = _core_.BORDER
43 SIMPLE_BORDER = _core_.SIMPLE_BORDER
44 STATIC_BORDER = _core_.STATIC_BORDER
45 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
46 NO_BORDER = _core_.NO_BORDER
47 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
48 WANTS_CHARS = _core_.WANTS_CHARS
49 POPUP_WINDOW = _core_.POPUP_WINDOW
50 CENTER_FRAME = _core_.CENTER_FRAME
51 CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
52 CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
53 ED_CLIENT_MARGIN = _core_.ED_CLIENT_MARGIN
54 ED_BUTTONS_BOTTOM = _core_.ED_BUTTONS_BOTTOM
55 ED_BUTTONS_RIGHT = _core_.ED_BUTTONS_RIGHT
56 ED_STATIC_LINE = _core_.ED_STATIC_LINE
57 EXT_DIALOG_STYLE = _core_.EXT_DIALOG_STYLE
58 CLIP_CHILDREN = _core_.CLIP_CHILDREN
59 CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
60 ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
61 RETAINED = _core_.RETAINED
62 BACKINGSTORE = _core_.BACKINGSTORE
63 COLOURED = _core_.COLOURED
64 FIXED_LENGTH = _core_.FIXED_LENGTH
65 LB_NEEDED_SB = _core_.LB_NEEDED_SB
66 LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
67 LB_SORT = _core_.LB_SORT
68 LB_SINGLE = _core_.LB_SINGLE
69 LB_MULTIPLE = _core_.LB_MULTIPLE
70 LB_EXTENDED = _core_.LB_EXTENDED
71 LB_OWNERDRAW = _core_.LB_OWNERDRAW
72 LB_HSCROLL = _core_.LB_HSCROLL
73 PROCESS_ENTER = _core_.PROCESS_ENTER
74 PASSWORD = _core_.PASSWORD
75 CB_SIMPLE = _core_.CB_SIMPLE
76 CB_DROPDOWN = _core_.CB_DROPDOWN
77 CB_SORT = _core_.CB_SORT
78 CB_READONLY = _core_.CB_READONLY
79 RA_HORIZONTAL = _core_.RA_HORIZONTAL
80 RA_VERTICAL = _core_.RA_VERTICAL
81 RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
82 RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
83 RB_GROUP = _core_.RB_GROUP
84 RB_SINGLE = _core_.RB_SINGLE
85 SL_HORIZONTAL = _core_.SL_HORIZONTAL
86 SL_VERTICAL = _core_.SL_VERTICAL
87 SL_AUTOTICKS = _core_.SL_AUTOTICKS
88 SL_LABELS = _core_.SL_LABELS
89 SL_LEFT = _core_.SL_LEFT
90 SL_TOP = _core_.SL_TOP
91 SL_RIGHT = _core_.SL_RIGHT
92 SL_BOTTOM = _core_.SL_BOTTOM
93 SL_BOTH = _core_.SL_BOTH
94 SL_SELRANGE = _core_.SL_SELRANGE
95 SB_HORIZONTAL = _core_.SB_HORIZONTAL
96 SB_VERTICAL = _core_.SB_VERTICAL
97 ST_SIZEGRIP = _core_.ST_SIZEGRIP
98 ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
99 FLOOD_SURFACE = _core_.FLOOD_SURFACE
100 FLOOD_BORDER = _core_.FLOOD_BORDER
101 ODDEVEN_RULE = _core_.ODDEVEN_RULE
102 WINDING_RULE = _core_.WINDING_RULE
103 TOOL_TOP = _core_.TOOL_TOP
104 TOOL_BOTTOM = _core_.TOOL_BOTTOM
105 TOOL_LEFT = _core_.TOOL_LEFT
106 TOOL_RIGHT = _core_.TOOL_RIGHT
107 OK = _core_.OK
108 YES_NO = _core_.YES_NO
109 CANCEL = _core_.CANCEL
110 YES = _core_.YES
111 NO = _core_.NO
112 NO_DEFAULT = _core_.NO_DEFAULT
113 YES_DEFAULT = _core_.YES_DEFAULT
114 ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
115 ICON_HAND = _core_.ICON_HAND
116 ICON_QUESTION = _core_.ICON_QUESTION
117 ICON_INFORMATION = _core_.ICON_INFORMATION
118 ICON_STOP = _core_.ICON_STOP
119 ICON_ASTERISK = _core_.ICON_ASTERISK
120 ICON_MASK = _core_.ICON_MASK
121 ICON_WARNING = _core_.ICON_WARNING
122 ICON_ERROR = _core_.ICON_ERROR
123 FORWARD = _core_.FORWARD
124 BACKWARD = _core_.BACKWARD
125 RESET = _core_.RESET
126 HELP = _core_.HELP
127 MORE = _core_.MORE
128 SETUP = _core_.SETUP
129 SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
130 SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
131 SIZE_AUTO = _core_.SIZE_AUTO
132 SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
133 SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
134 PORTRAIT = _core_.PORTRAIT
135 LANDSCAPE = _core_.LANDSCAPE
136 PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
137 PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
138 PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
139 PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
140 ID_ANY = _core_.ID_ANY
141 ID_SEPARATOR = _core_.ID_SEPARATOR
142 ID_LOWEST = _core_.ID_LOWEST
143 ID_OPEN = _core_.ID_OPEN
144 ID_CLOSE = _core_.ID_CLOSE
145 ID_NEW = _core_.ID_NEW
146 ID_SAVE = _core_.ID_SAVE
147 ID_SAVEAS = _core_.ID_SAVEAS
148 ID_REVERT = _core_.ID_REVERT
149 ID_EXIT = _core_.ID_EXIT
150 ID_UNDO = _core_.ID_UNDO
151 ID_REDO = _core_.ID_REDO
152 ID_HELP = _core_.ID_HELP
153 ID_PRINT = _core_.ID_PRINT
154 ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
155 ID_PREVIEW = _core_.ID_PREVIEW
156 ID_ABOUT = _core_.ID_ABOUT
157 ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
158 ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
159 ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
160 ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
161 ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
162 ID_PREFERENCES = _core_.ID_PREFERENCES
163 ID_CUT = _core_.ID_CUT
164 ID_COPY = _core_.ID_COPY
165 ID_PASTE = _core_.ID_PASTE
166 ID_CLEAR = _core_.ID_CLEAR
167 ID_FIND = _core_.ID_FIND
168 ID_DUPLICATE = _core_.ID_DUPLICATE
169 ID_SELECTALL = _core_.ID_SELECTALL
170 ID_DELETE = _core_.ID_DELETE
171 ID_REPLACE = _core_.ID_REPLACE
172 ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
173 ID_PROPERTIES = _core_.ID_PROPERTIES
174 ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
175 ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
176 ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
177 ID_VIEW_LIST = _core_.ID_VIEW_LIST
178 ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
179 ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
180 ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
181 ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
182 ID_FILE1 = _core_.ID_FILE1
183 ID_FILE2 = _core_.ID_FILE2
184 ID_FILE3 = _core_.ID_FILE3
185 ID_FILE4 = _core_.ID_FILE4
186 ID_FILE5 = _core_.ID_FILE5
187 ID_FILE6 = _core_.ID_FILE6
188 ID_FILE7 = _core_.ID_FILE7
189 ID_FILE8 = _core_.ID_FILE8
190 ID_FILE9 = _core_.ID_FILE9
191 ID_OK = _core_.ID_OK
192 ID_CANCEL = _core_.ID_CANCEL
193 ID_APPLY = _core_.ID_APPLY
194 ID_YES = _core_.ID_YES
195 ID_NO = _core_.ID_NO
196 ID_STATIC = _core_.ID_STATIC
197 ID_FORWARD = _core_.ID_FORWARD
198 ID_BACKWARD = _core_.ID_BACKWARD
199 ID_DEFAULT = _core_.ID_DEFAULT
200 ID_MORE = _core_.ID_MORE
201 ID_SETUP = _core_.ID_SETUP
202 ID_RESET = _core_.ID_RESET
203 ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
204 ID_YESTOALL = _core_.ID_YESTOALL
205 ID_NOTOALL = _core_.ID_NOTOALL
206 ID_ABORT = _core_.ID_ABORT
207 ID_RETRY = _core_.ID_RETRY
208 ID_IGNORE = _core_.ID_IGNORE
209 ID_ADD = _core_.ID_ADD
210 ID_REMOVE = _core_.ID_REMOVE
211 ID_UP = _core_.ID_UP
212 ID_DOWN = _core_.ID_DOWN
213 ID_HOME = _core_.ID_HOME
214 ID_REFRESH = _core_.ID_REFRESH
215 ID_STOP = _core_.ID_STOP
216 ID_INDEX = _core_.ID_INDEX
217 ID_BOLD = _core_.ID_BOLD
218 ID_ITALIC = _core_.ID_ITALIC
219 ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
220 ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
221 ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
222 ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
223 ID_UNDERLINE = _core_.ID_UNDERLINE
224 ID_INDENT = _core_.ID_INDENT
225 ID_UNINDENT = _core_.ID_UNINDENT
226 ID_ZOOM_100 = _core_.ID_ZOOM_100
227 ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
228 ID_ZOOM_IN = _core_.ID_ZOOM_IN
229 ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
230 ID_UNDELETE = _core_.ID_UNDELETE
231 ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
232 ID_HIGHEST = _core_.ID_HIGHEST
233 OPEN = _core_.OPEN
234 SAVE = _core_.SAVE
235 HIDE_READONLY = _core_.HIDE_READONLY
236 OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
237 FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
238 MULTIPLE = _core_.MULTIPLE
239 CHANGE_DIR = _core_.CHANGE_DIR
240 ACCEL_ALT = _core_.ACCEL_ALT
241 ACCEL_CTRL = _core_.ACCEL_CTRL
242 ACCEL_SHIFT = _core_.ACCEL_SHIFT
243 ACCEL_NORMAL = _core_.ACCEL_NORMAL
244 PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
245 PD_APP_MODAL = _core_.PD_APP_MODAL
246 PD_CAN_ABORT = _core_.PD_CAN_ABORT
247 PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
248 PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
249 PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
250 DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
251 DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
252 MENU_TEAROFF = _core_.MENU_TEAROFF
253 MB_DOCKABLE = _core_.MB_DOCKABLE
254 NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
255 FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
256 LI_HORIZONTAL = _core_.LI_HORIZONTAL
257 LI_VERTICAL = _core_.LI_VERTICAL
258 WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
259 WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
260 WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
261 WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
262 WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
263 WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
264 MM_TEXT = _core_.MM_TEXT
265 MM_LOMETRIC = _core_.MM_LOMETRIC
266 MM_HIMETRIC = _core_.MM_HIMETRIC
267 MM_LOENGLISH = _core_.MM_LOENGLISH
268 MM_HIENGLISH = _core_.MM_HIENGLISH
269 MM_TWIPS = _core_.MM_TWIPS
270 MM_ISOTROPIC = _core_.MM_ISOTROPIC
271 MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
272 MM_POINTS = _core_.MM_POINTS
273 MM_METRIC = _core_.MM_METRIC
274 CENTRE = _core_.CENTRE
275 CENTER = _core_.CENTER
276 HORIZONTAL = _core_.HORIZONTAL
277 VERTICAL = _core_.VERTICAL
278 BOTH = _core_.BOTH
279 LEFT = _core_.LEFT
280 RIGHT = _core_.RIGHT
281 UP = _core_.UP
282 DOWN = _core_.DOWN
283 TOP = _core_.TOP
284 BOTTOM = _core_.BOTTOM
285 NORTH = _core_.NORTH
286 SOUTH = _core_.SOUTH
287 WEST = _core_.WEST
288 EAST = _core_.EAST
289 ALL = _core_.ALL
290 ALIGN_NOT = _core_.ALIGN_NOT
291 ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
292 ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
293 ALIGN_LEFT = _core_.ALIGN_LEFT
294 ALIGN_TOP = _core_.ALIGN_TOP
295 ALIGN_RIGHT = _core_.ALIGN_RIGHT
296 ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
297 ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
298 ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
299 ALIGN_CENTER = _core_.ALIGN_CENTER
300 ALIGN_CENTRE = _core_.ALIGN_CENTRE
301 ALIGN_MASK = _core_.ALIGN_MASK
302 STRETCH_NOT = _core_.STRETCH_NOT
303 SHRINK = _core_.SHRINK
304 GROW = _core_.GROW
305 EXPAND = _core_.EXPAND
306 SHAPED = _core_.SHAPED
307 FIXED_MINSIZE = _core_.FIXED_MINSIZE
308 TILE = _core_.TILE
309 ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
310 BORDER_DEFAULT = _core_.BORDER_DEFAULT
311 BORDER_NONE = _core_.BORDER_NONE
312 BORDER_STATIC = _core_.BORDER_STATIC
313 BORDER_SIMPLE = _core_.BORDER_SIMPLE
314 BORDER_RAISED = _core_.BORDER_RAISED
315 BORDER_SUNKEN = _core_.BORDER_SUNKEN
316 BORDER_DOUBLE = _core_.BORDER_DOUBLE
317 BORDER_MASK = _core_.BORDER_MASK
318 BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
319 BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
320 BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
321 DEFAULT = _core_.DEFAULT
322 DECORATIVE = _core_.DECORATIVE
323 ROMAN = _core_.ROMAN
324 SCRIPT = _core_.SCRIPT
325 SWISS = _core_.SWISS
326 MODERN = _core_.MODERN
327 TELETYPE = _core_.TELETYPE
328 VARIABLE = _core_.VARIABLE
329 FIXED = _core_.FIXED
330 NORMAL = _core_.NORMAL
331 LIGHT = _core_.LIGHT
332 BOLD = _core_.BOLD
333 ITALIC = _core_.ITALIC
334 SLANT = _core_.SLANT
335 SOLID = _core_.SOLID
336 DOT = _core_.DOT
337 LONG_DASH = _core_.LONG_DASH
338 SHORT_DASH = _core_.SHORT_DASH
339 DOT_DASH = _core_.DOT_DASH
340 USER_DASH = _core_.USER_DASH
341 TRANSPARENT = _core_.TRANSPARENT
342 STIPPLE = _core_.STIPPLE
343 BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
344 CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
345 FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
346 CROSS_HATCH = _core_.CROSS_HATCH
347 HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
348 VERTICAL_HATCH = _core_.VERTICAL_HATCH
349 JOIN_BEVEL = _core_.JOIN_BEVEL
350 JOIN_MITER = _core_.JOIN_MITER
351 JOIN_ROUND = _core_.JOIN_ROUND
352 CAP_ROUND = _core_.CAP_ROUND
353 CAP_PROJECTING = _core_.CAP_PROJECTING
354 CAP_BUTT = _core_.CAP_BUTT
355 CLEAR = _core_.CLEAR
356 XOR = _core_.XOR
357 INVERT = _core_.INVERT
358 OR_REVERSE = _core_.OR_REVERSE
359 AND_REVERSE = _core_.AND_REVERSE
360 COPY = _core_.COPY
361 AND = _core_.AND
362 AND_INVERT = _core_.AND_INVERT
363 NO_OP = _core_.NO_OP
364 NOR = _core_.NOR
365 EQUIV = _core_.EQUIV
366 SRC_INVERT = _core_.SRC_INVERT
367 OR_INVERT = _core_.OR_INVERT
368 NAND = _core_.NAND
369 OR = _core_.OR
370 SET = _core_.SET
371 WXK_BACK = _core_.WXK_BACK
372 WXK_TAB = _core_.WXK_TAB
373 WXK_RETURN = _core_.WXK_RETURN
374 WXK_ESCAPE = _core_.WXK_ESCAPE
375 WXK_SPACE = _core_.WXK_SPACE
376 WXK_DELETE = _core_.WXK_DELETE
377 WXK_START = _core_.WXK_START
378 WXK_LBUTTON = _core_.WXK_LBUTTON
379 WXK_RBUTTON = _core_.WXK_RBUTTON
380 WXK_CANCEL = _core_.WXK_CANCEL
381 WXK_MBUTTON = _core_.WXK_MBUTTON
382 WXK_CLEAR = _core_.WXK_CLEAR
383 WXK_SHIFT = _core_.WXK_SHIFT
384 WXK_ALT = _core_.WXK_ALT
385 WXK_CONTROL = _core_.WXK_CONTROL
386 WXK_MENU = _core_.WXK_MENU
387 WXK_PAUSE = _core_.WXK_PAUSE
388 WXK_CAPITAL = _core_.WXK_CAPITAL
389 WXK_PRIOR = _core_.WXK_PRIOR
390 WXK_NEXT = _core_.WXK_NEXT
391 WXK_END = _core_.WXK_END
392 WXK_HOME = _core_.WXK_HOME
393 WXK_LEFT = _core_.WXK_LEFT
394 WXK_UP = _core_.WXK_UP
395 WXK_RIGHT = _core_.WXK_RIGHT
396 WXK_DOWN = _core_.WXK_DOWN
397 WXK_SELECT = _core_.WXK_SELECT
398 WXK_PRINT = _core_.WXK_PRINT
399 WXK_EXECUTE = _core_.WXK_EXECUTE
400 WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
401 WXK_INSERT = _core_.WXK_INSERT
402 WXK_HELP = _core_.WXK_HELP
403 WXK_NUMPAD0 = _core_.WXK_NUMPAD0
404 WXK_NUMPAD1 = _core_.WXK_NUMPAD1
405 WXK_NUMPAD2 = _core_.WXK_NUMPAD2
406 WXK_NUMPAD3 = _core_.WXK_NUMPAD3
407 WXK_NUMPAD4 = _core_.WXK_NUMPAD4
408 WXK_NUMPAD5 = _core_.WXK_NUMPAD5
409 WXK_NUMPAD6 = _core_.WXK_NUMPAD6
410 WXK_NUMPAD7 = _core_.WXK_NUMPAD7
411 WXK_NUMPAD8 = _core_.WXK_NUMPAD8
412 WXK_NUMPAD9 = _core_.WXK_NUMPAD9
413 WXK_MULTIPLY = _core_.WXK_MULTIPLY
414 WXK_ADD = _core_.WXK_ADD
415 WXK_SEPARATOR = _core_.WXK_SEPARATOR
416 WXK_SUBTRACT = _core_.WXK_SUBTRACT
417 WXK_DECIMAL = _core_.WXK_DECIMAL
418 WXK_DIVIDE = _core_.WXK_DIVIDE
419 WXK_F1 = _core_.WXK_F1
420 WXK_F2 = _core_.WXK_F2
421 WXK_F3 = _core_.WXK_F3
422 WXK_F4 = _core_.WXK_F4
423 WXK_F5 = _core_.WXK_F5
424 WXK_F6 = _core_.WXK_F6
425 WXK_F7 = _core_.WXK_F7
426 WXK_F8 = _core_.WXK_F8
427 WXK_F9 = _core_.WXK_F9
428 WXK_F10 = _core_.WXK_F10
429 WXK_F11 = _core_.WXK_F11
430 WXK_F12 = _core_.WXK_F12
431 WXK_F13 = _core_.WXK_F13
432 WXK_F14 = _core_.WXK_F14
433 WXK_F15 = _core_.WXK_F15
434 WXK_F16 = _core_.WXK_F16
435 WXK_F17 = _core_.WXK_F17
436 WXK_F18 = _core_.WXK_F18
437 WXK_F19 = _core_.WXK_F19
438 WXK_F20 = _core_.WXK_F20
439 WXK_F21 = _core_.WXK_F21
440 WXK_F22 = _core_.WXK_F22
441 WXK_F23 = _core_.WXK_F23
442 WXK_F24 = _core_.WXK_F24
443 WXK_NUMLOCK = _core_.WXK_NUMLOCK
444 WXK_SCROLL = _core_.WXK_SCROLL
445 WXK_PAGEUP = _core_.WXK_PAGEUP
446 WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
447 WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
448 WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
449 WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
450 WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
451 WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
452 WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
453 WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
454 WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
455 WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
456 WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
457 WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
458 WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
459 WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
460 WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
461 WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
462 WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
463 WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
464 WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
465 WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
466 WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
467 WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
468 WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
469 WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
470 WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
471 WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
472 WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
473 WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
474 WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
475 WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
476 WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
477 PAPER_NONE = _core_.PAPER_NONE
478 PAPER_LETTER = _core_.PAPER_LETTER
479 PAPER_LEGAL = _core_.PAPER_LEGAL
480 PAPER_A4 = _core_.PAPER_A4
481 PAPER_CSHEET = _core_.PAPER_CSHEET
482 PAPER_DSHEET = _core_.PAPER_DSHEET
483 PAPER_ESHEET = _core_.PAPER_ESHEET
484 PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
485 PAPER_TABLOID = _core_.PAPER_TABLOID
486 PAPER_LEDGER = _core_.PAPER_LEDGER
487 PAPER_STATEMENT = _core_.PAPER_STATEMENT
488 PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
489 PAPER_A3 = _core_.PAPER_A3
490 PAPER_A4SMALL = _core_.PAPER_A4SMALL
491 PAPER_A5 = _core_.PAPER_A5
492 PAPER_B4 = _core_.PAPER_B4
493 PAPER_B5 = _core_.PAPER_B5
494 PAPER_FOLIO = _core_.PAPER_FOLIO
495 PAPER_QUARTO = _core_.PAPER_QUARTO
496 PAPER_10X14 = _core_.PAPER_10X14
497 PAPER_11X17 = _core_.PAPER_11X17
498 PAPER_NOTE = _core_.PAPER_NOTE
499 PAPER_ENV_9 = _core_.PAPER_ENV_9
500 PAPER_ENV_10 = _core_.PAPER_ENV_10
501 PAPER_ENV_11 = _core_.PAPER_ENV_11
502 PAPER_ENV_12 = _core_.PAPER_ENV_12
503 PAPER_ENV_14 = _core_.PAPER_ENV_14
504 PAPER_ENV_DL = _core_.PAPER_ENV_DL
505 PAPER_ENV_C5 = _core_.PAPER_ENV_C5
506 PAPER_ENV_C3 = _core_.PAPER_ENV_C3
507 PAPER_ENV_C4 = _core_.PAPER_ENV_C4
508 PAPER_ENV_C6 = _core_.PAPER_ENV_C6
509 PAPER_ENV_C65 = _core_.PAPER_ENV_C65
510 PAPER_ENV_B4 = _core_.PAPER_ENV_B4
511 PAPER_ENV_B5 = _core_.PAPER_ENV_B5
512 PAPER_ENV_B6 = _core_.PAPER_ENV_B6
513 PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
514 PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
515 PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
516 PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
517 PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
518 PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
519 PAPER_ISO_B4 = _core_.PAPER_ISO_B4
520 PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
521 PAPER_9X11 = _core_.PAPER_9X11
522 PAPER_10X11 = _core_.PAPER_10X11
523 PAPER_15X11 = _core_.PAPER_15X11
524 PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
525 PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
526 PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
527 PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
528 PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
529 PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
530 PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
531 PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
532 PAPER_A_PLUS = _core_.PAPER_A_PLUS
533 PAPER_B_PLUS = _core_.PAPER_B_PLUS
534 PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
535 PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
536 PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
537 PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
538 PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
539 PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
540 PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
541 PAPER_A2 = _core_.PAPER_A2
542 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
543 PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
544 DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
545 DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
546 DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
547 ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
548 ITEM_NORMAL = _core_.ITEM_NORMAL
549 ITEM_CHECK = _core_.ITEM_CHECK
550 ITEM_RADIO = _core_.ITEM_RADIO
551 ITEM_MAX = _core_.ITEM_MAX
552 HT_NOWHERE = _core_.HT_NOWHERE
553 HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
554 HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
555 HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
556 HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
557 HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
558 HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
559 HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
560 HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
561 HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
562 HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
563 HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
564 HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
565 HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
566 HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
567 HT_MAX = _core_.HT_MAX
568 MOD_NONE = _core_.MOD_NONE
569 MOD_ALT = _core_.MOD_ALT
570 MOD_CONTROL = _core_.MOD_CONTROL
571 MOD_SHIFT = _core_.MOD_SHIFT
572 MOD_WIN = _core_.MOD_WIN
573 UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
574 UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
575 UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
576 #---------------------------------------------------------------------------
577
578 class Object(object):
579 """
580 The base class for most wx objects, although in wxPython not
581 much functionality is needed nor exposed.
582 """
583 def __init__(self): raise RuntimeError, "No constructor defined"
584 def __repr__(self):
585 return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
586 def GetClassName(*args, **kwargs):
587 """
588 GetClassName(self) -> String
589
590 Returns the class name of the C++ class using wxRTTI.
591 """
592 return _core_.Object_GetClassName(*args, **kwargs)
593
594 def Destroy(*args, **kwargs):
595 """
596 Destroy(self)
597
598 Deletes the C++ object this Python object is a proxy for.
599 """
600 return _core_.Object_Destroy(*args, **kwargs)
601
602
603 class ObjectPtr(Object):
604 def __init__(self, this):
605 self.this = this
606 if not hasattr(self,"thisown"): self.thisown = 0
607 self.__class__ = Object
608 _core_.Object_swigregister(ObjectPtr)
609 _wxPySetDictionary = _core_._wxPySetDictionary
610
611 _wxPyFixStockObjects = _core_._wxPyFixStockObjects
612
613 cvar = _core_.cvar
614 EmptyString = cvar.EmptyString
615
616 #---------------------------------------------------------------------------
617
618 BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
619 BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
620 BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
621 BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
622 BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
623 BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
624 BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
625 BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
626 BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
627 BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
628 BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
629 BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
630 BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
631 BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
632 BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
633 BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
634 BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
635 BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
636 BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
637 BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
638 CURSOR_NONE = _core_.CURSOR_NONE
639 CURSOR_ARROW = _core_.CURSOR_ARROW
640 CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
641 CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
642 CURSOR_CHAR = _core_.CURSOR_CHAR
643 CURSOR_CROSS = _core_.CURSOR_CROSS
644 CURSOR_HAND = _core_.CURSOR_HAND
645 CURSOR_IBEAM = _core_.CURSOR_IBEAM
646 CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
647 CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
648 CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
649 CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
650 CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
651 CURSOR_PENCIL = _core_.CURSOR_PENCIL
652 CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
653 CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
654 CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
655 CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
656 CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
657 CURSOR_SIZENS = _core_.CURSOR_SIZENS
658 CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
659 CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
660 CURSOR_SIZING = _core_.CURSOR_SIZING
661 CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
662 CURSOR_WAIT = _core_.CURSOR_WAIT
663 CURSOR_WATCH = _core_.CURSOR_WATCH
664 CURSOR_BLANK = _core_.CURSOR_BLANK
665 CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
666 CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
667 CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
668 CURSOR_MAX = _core_.CURSOR_MAX
669 #---------------------------------------------------------------------------
670
671 class Size(object):
672 """
673 wx.Size is a useful data structure used to represent the size of
674 something. It simply contians integer width and height proprtites.
675 In most places in wxPython where a wx.Size is expected a
676 (width,height) tuple can be used instead.
677 """
678 def __repr__(self):
679 return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
680 width = property(_core_.Size_width_get, _core_.Size_width_set)
681 height = property(_core_.Size_height_get, _core_.Size_height_set)
682 x = width; y = height
683 def __init__(self, *args, **kwargs):
684 """
685 __init__(self, int w=0, int h=0) -> Size
686
687 Creates a size object.
688 """
689 newobj = _core_.new_Size(*args, **kwargs)
690 self.this = newobj.this
691 self.thisown = 1
692 del newobj.thisown
693 def __del__(self, destroy=_core_.delete_Size):
694 """__del__(self)"""
695 try:
696 if self.thisown: destroy(self)
697 except: pass
698
699 def __eq__(*args, **kwargs):
700 """
701 __eq__(self, Size sz) -> bool
702
703 Test for equality of wx.Size objects.
704 """
705 return _core_.Size___eq__(*args, **kwargs)
706
707 def __ne__(*args, **kwargs):
708 """
709 __ne__(self, Size sz) -> bool
710
711 Test for inequality.
712 """
713 return _core_.Size___ne__(*args, **kwargs)
714
715 def __add__(*args, **kwargs):
716 """
717 __add__(self, Size sz) -> Size
718
719 Add sz's proprties to this and return the result.
720 """
721 return _core_.Size___add__(*args, **kwargs)
722
723 def __sub__(*args, **kwargs):
724 """
725 __sub__(self, Size sz) -> Size
726
727 Subtract sz's properties from this and return the result.
728 """
729 return _core_.Size___sub__(*args, **kwargs)
730
731 def IncTo(*args, **kwargs):
732 """
733 IncTo(self, Size sz)
734
735 Increments this object so that both of its dimensions are not less
736 than the corresponding dimensions of the size.
737 """
738 return _core_.Size_IncTo(*args, **kwargs)
739
740 def DecTo(*args, **kwargs):
741 """
742 DecTo(self, Size sz)
743
744 Decrements this object so that both of its dimensions are not greater
745 than the corresponding dimensions of the size.
746 """
747 return _core_.Size_DecTo(*args, **kwargs)
748
749 def Set(*args, **kwargs):
750 """
751 Set(self, int w, int h)
752
753 Set both width and height.
754 """
755 return _core_.Size_Set(*args, **kwargs)
756
757 def SetWidth(*args, **kwargs):
758 """SetWidth(self, int w)"""
759 return _core_.Size_SetWidth(*args, **kwargs)
760
761 def SetHeight(*args, **kwargs):
762 """SetHeight(self, int h)"""
763 return _core_.Size_SetHeight(*args, **kwargs)
764
765 def GetWidth(*args, **kwargs):
766 """GetWidth(self) -> int"""
767 return _core_.Size_GetWidth(*args, **kwargs)
768
769 def GetHeight(*args, **kwargs):
770 """GetHeight(self) -> int"""
771 return _core_.Size_GetHeight(*args, **kwargs)
772
773 def IsFullySpecified(*args, **kwargs):
774 """
775 IsFullySpecified(self) -> bool
776
777 Returns True if both components of the size are non-default values.
778 """
779 return _core_.Size_IsFullySpecified(*args, **kwargs)
780
781 def SetDefaults(*args, **kwargs):
782 """
783 SetDefaults(self, Size size)
784
785 Combine this size with the other one replacing the default components
786 of this object (i.e. equal to -1) with those of the other.
787 """
788 return _core_.Size_SetDefaults(*args, **kwargs)
789
790 def Get(*args, **kwargs):
791 """
792 Get() -> (width,height)
793
794 Returns the width and height properties as a tuple.
795 """
796 return _core_.Size_Get(*args, **kwargs)
797
798 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
799 def __str__(self): return str(self.Get())
800 def __repr__(self): return 'wx.Size'+str(self.Get())
801 def __len__(self): return len(self.Get())
802 def __getitem__(self, index): return self.Get()[index]
803 def __setitem__(self, index, val):
804 if index == 0: self.width = val
805 elif index == 1: self.height = val
806 else: raise IndexError
807 def __nonzero__(self): return self.Get() != (0,0)
808 __safe_for_unpickling__ = True
809 def __reduce__(self): return (wx.Size, self.Get())
810
811
812 class SizePtr(Size):
813 def __init__(self, this):
814 self.this = this
815 if not hasattr(self,"thisown"): self.thisown = 0
816 self.__class__ = Size
817 _core_.Size_swigregister(SizePtr)
818
819 #---------------------------------------------------------------------------
820
821 class RealPoint(object):
822 """
823 A data structure for representing a point or position with floating
824 point x and y properties. In wxPython most places that expect a
825 wx.RealPoint can also accept a (x,y) tuple.
826 """
827 def __repr__(self):
828 return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
829 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
830 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
831 def __init__(self, *args, **kwargs):
832 """
833 __init__(self, double x=0.0, double y=0.0) -> RealPoint
834
835 Create a wx.RealPoint object
836 """
837 newobj = _core_.new_RealPoint(*args, **kwargs)
838 self.this = newobj.this
839 self.thisown = 1
840 del newobj.thisown
841 def __del__(self, destroy=_core_.delete_RealPoint):
842 """__del__(self)"""
843 try:
844 if self.thisown: destroy(self)
845 except: pass
846
847 def __eq__(*args, **kwargs):
848 """
849 __eq__(self, RealPoint pt) -> bool
850
851 Test for equality of wx.RealPoint objects.
852 """
853 return _core_.RealPoint___eq__(*args, **kwargs)
854
855 def __ne__(*args, **kwargs):
856 """
857 __ne__(self, RealPoint pt) -> bool
858
859 Test for inequality of wx.RealPoint objects.
860 """
861 return _core_.RealPoint___ne__(*args, **kwargs)
862
863 def __add__(*args, **kwargs):
864 """
865 __add__(self, RealPoint pt) -> RealPoint
866
867 Add pt's proprties to this and return the result.
868 """
869 return _core_.RealPoint___add__(*args, **kwargs)
870
871 def __sub__(*args, **kwargs):
872 """
873 __sub__(self, RealPoint pt) -> RealPoint
874
875 Subtract pt's proprties from this and return the result
876 """
877 return _core_.RealPoint___sub__(*args, **kwargs)
878
879 def Set(*args, **kwargs):
880 """
881 Set(self, double x, double y)
882
883 Set both the x and y properties
884 """
885 return _core_.RealPoint_Set(*args, **kwargs)
886
887 def Get(*args, **kwargs):
888 """
889 Get() -> (x,y)
890
891 Return the x and y properties as a tuple.
892 """
893 return _core_.RealPoint_Get(*args, **kwargs)
894
895 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
896 def __str__(self): return str(self.Get())
897 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
898 def __len__(self): return len(self.Get())
899 def __getitem__(self, index): return self.Get()[index]
900 def __setitem__(self, index, val):
901 if index == 0: self.x = val
902 elif index == 1: self.y = val
903 else: raise IndexError
904 def __nonzero__(self): return self.Get() != (0.0, 0.0)
905 __safe_for_unpickling__ = True
906 def __reduce__(self): return (wx.RealPoint, self.Get())
907
908
909 class RealPointPtr(RealPoint):
910 def __init__(self, this):
911 self.this = this
912 if not hasattr(self,"thisown"): self.thisown = 0
913 self.__class__ = RealPoint
914 _core_.RealPoint_swigregister(RealPointPtr)
915
916 #---------------------------------------------------------------------------
917
918 class Point(object):
919 """
920 A data structure for representing a point or position with integer x
921 and y properties. Most places in wxPython that expect a wx.Point can
922 also accept a (x,y) tuple.
923 """
924 def __repr__(self):
925 return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
926 x = property(_core_.Point_x_get, _core_.Point_x_set)
927 y = property(_core_.Point_y_get, _core_.Point_y_set)
928 def __init__(self, *args, **kwargs):
929 """
930 __init__(self, int x=0, int y=0) -> Point
931
932 Create a wx.Point object
933 """
934 newobj = _core_.new_Point(*args, **kwargs)
935 self.this = newobj.this
936 self.thisown = 1
937 del newobj.thisown
938 def __del__(self, destroy=_core_.delete_Point):
939 """__del__(self)"""
940 try:
941 if self.thisown: destroy(self)
942 except: pass
943
944 def __eq__(*args, **kwargs):
945 """
946 __eq__(self, Point pt) -> bool
947
948 Test for equality of wx.Point objects.
949 """
950 return _core_.Point___eq__(*args, **kwargs)
951
952 def __ne__(*args, **kwargs):
953 """
954 __ne__(self, Point pt) -> bool
955
956 Test for inequality of wx.Point objects.
957 """
958 return _core_.Point___ne__(*args, **kwargs)
959
960 def __add__(*args, **kwargs):
961 """
962 __add__(self, Point pt) -> Point
963
964 Add pt's proprties to this and return the result.
965 """
966 return _core_.Point___add__(*args, **kwargs)
967
968 def __sub__(*args, **kwargs):
969 """
970 __sub__(self, Point pt) -> Point
971
972 Subtract pt's proprties from this and return the result
973 """
974 return _core_.Point___sub__(*args, **kwargs)
975
976 def __iadd__(*args, **kwargs):
977 """
978 __iadd__(self, Point pt) -> Point
979
980 Add pt to this object.
981 """
982 return _core_.Point___iadd__(*args, **kwargs)
983
984 def __isub__(*args, **kwargs):
985 """
986 __isub__(self, Point pt) -> Point
987
988 Subtract pt from this object.
989 """
990 return _core_.Point___isub__(*args, **kwargs)
991
992 def Set(*args, **kwargs):
993 """
994 Set(self, long x, long y)
995
996 Set both the x and y properties
997 """
998 return _core_.Point_Set(*args, **kwargs)
999
1000 def Get(*args, **kwargs):
1001 """
1002 Get() -> (x,y)
1003
1004 Return the x and y properties as a tuple.
1005 """
1006 return _core_.Point_Get(*args, **kwargs)
1007
1008 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1009 def __str__(self): return str(self.Get())
1010 def __repr__(self): return 'wx.Point'+str(self.Get())
1011 def __len__(self): return len(self.Get())
1012 def __getitem__(self, index): return self.Get()[index]
1013 def __setitem__(self, index, val):
1014 if index == 0: self.x = val
1015 elif index == 1: self.y = val
1016 else: raise IndexError
1017 def __nonzero__(self): return self.Get() != (0,0)
1018 __safe_for_unpickling__ = True
1019 def __reduce__(self): return (wx.Point, self.Get())
1020
1021
1022 class PointPtr(Point):
1023 def __init__(self, this):
1024 self.this = this
1025 if not hasattr(self,"thisown"): self.thisown = 0
1026 self.__class__ = Point
1027 _core_.Point_swigregister(PointPtr)
1028
1029 #---------------------------------------------------------------------------
1030
1031 class Rect(object):
1032 """
1033 A class for representing and manipulating rectangles. It has x, y,
1034 width and height properties. In wxPython most palces that expect a
1035 wx.Rect can also accept a (x,y,width,height) tuple.
1036 """
1037 def __repr__(self):
1038 return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1039 def __init__(self, *args, **kwargs):
1040 """
1041 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1042
1043 Create a new Rect object.
1044 """
1045 newobj = _core_.new_Rect(*args, **kwargs)
1046 self.this = newobj.this
1047 self.thisown = 1
1048 del newobj.thisown
1049 def __del__(self, destroy=_core_.delete_Rect):
1050 """__del__(self)"""
1051 try:
1052 if self.thisown: destroy(self)
1053 except: pass
1054
1055 def GetX(*args, **kwargs):
1056 """GetX(self) -> int"""
1057 return _core_.Rect_GetX(*args, **kwargs)
1058
1059 def SetX(*args, **kwargs):
1060 """SetX(self, int x)"""
1061 return _core_.Rect_SetX(*args, **kwargs)
1062
1063 def GetY(*args, **kwargs):
1064 """GetY(self) -> int"""
1065 return _core_.Rect_GetY(*args, **kwargs)
1066
1067 def SetY(*args, **kwargs):
1068 """SetY(self, int y)"""
1069 return _core_.Rect_SetY(*args, **kwargs)
1070
1071 def GetWidth(*args, **kwargs):
1072 """GetWidth(self) -> int"""
1073 return _core_.Rect_GetWidth(*args, **kwargs)
1074
1075 def SetWidth(*args, **kwargs):
1076 """SetWidth(self, int w)"""
1077 return _core_.Rect_SetWidth(*args, **kwargs)
1078
1079 def GetHeight(*args, **kwargs):
1080 """GetHeight(self) -> int"""
1081 return _core_.Rect_GetHeight(*args, **kwargs)
1082
1083 def SetHeight(*args, **kwargs):
1084 """SetHeight(self, int h)"""
1085 return _core_.Rect_SetHeight(*args, **kwargs)
1086
1087 def GetPosition(*args, **kwargs):
1088 """GetPosition(self) -> Point"""
1089 return _core_.Rect_GetPosition(*args, **kwargs)
1090
1091 def SetPosition(*args, **kwargs):
1092 """SetPosition(self, Point p)"""
1093 return _core_.Rect_SetPosition(*args, **kwargs)
1094
1095 def GetSize(*args, **kwargs):
1096 """GetSize(self) -> Size"""
1097 return _core_.Rect_GetSize(*args, **kwargs)
1098
1099 def SetSize(*args, **kwargs):
1100 """SetSize(self, Size s)"""
1101 return _core_.Rect_SetSize(*args, **kwargs)
1102
1103 def GetTopLeft(*args, **kwargs):
1104 """GetTopLeft(self) -> Point"""
1105 return _core_.Rect_GetTopLeft(*args, **kwargs)
1106
1107 def SetTopLeft(*args, **kwargs):
1108 """SetTopLeft(self, Point p)"""
1109 return _core_.Rect_SetTopLeft(*args, **kwargs)
1110
1111 def GetBottomRight(*args, **kwargs):
1112 """GetBottomRight(self) -> Point"""
1113 return _core_.Rect_GetBottomRight(*args, **kwargs)
1114
1115 def SetBottomRight(*args, **kwargs):
1116 """SetBottomRight(self, Point p)"""
1117 return _core_.Rect_SetBottomRight(*args, **kwargs)
1118
1119 def GetLeft(*args, **kwargs):
1120 """GetLeft(self) -> int"""
1121 return _core_.Rect_GetLeft(*args, **kwargs)
1122
1123 def GetTop(*args, **kwargs):
1124 """GetTop(self) -> int"""
1125 return _core_.Rect_GetTop(*args, **kwargs)
1126
1127 def GetBottom(*args, **kwargs):
1128 """GetBottom(self) -> int"""
1129 return _core_.Rect_GetBottom(*args, **kwargs)
1130
1131 def GetRight(*args, **kwargs):
1132 """GetRight(self) -> int"""
1133 return _core_.Rect_GetRight(*args, **kwargs)
1134
1135 def SetLeft(*args, **kwargs):
1136 """SetLeft(self, int left)"""
1137 return _core_.Rect_SetLeft(*args, **kwargs)
1138
1139 def SetRight(*args, **kwargs):
1140 """SetRight(self, int right)"""
1141 return _core_.Rect_SetRight(*args, **kwargs)
1142
1143 def SetTop(*args, **kwargs):
1144 """SetTop(self, int top)"""
1145 return _core_.Rect_SetTop(*args, **kwargs)
1146
1147 def SetBottom(*args, **kwargs):
1148 """SetBottom(self, int bottom)"""
1149 return _core_.Rect_SetBottom(*args, **kwargs)
1150
1151 position = property(GetPosition, SetPosition)
1152 size = property(GetSize, SetSize)
1153 left = property(GetLeft, SetLeft)
1154 right = property(GetRight, SetRight)
1155 top = property(GetTop, SetTop)
1156 bottom = property(GetBottom, SetBottom)
1157
1158 def Inflate(*args, **kwargs):
1159 """
1160 Inflate(self, int dx, int dy) -> Rect
1161
1162 Increase the rectangle size by dx in x direction and dy in y
1163 direction. Both or one of) parameters may be negative to decrease the
1164 rectangle size.
1165 """
1166 return _core_.Rect_Inflate(*args, **kwargs)
1167
1168 def Deflate(*args, **kwargs):
1169 """
1170 Deflate(self, int dx, int dy) -> Rect
1171
1172 Decrease the rectangle size by dx in x direction and dy in y
1173 direction. Both or one of) parameters may be negative to increase the
1174 rectngle size. This method is the opposite of Inflate.
1175 """
1176 return _core_.Rect_Deflate(*args, **kwargs)
1177
1178 def OffsetXY(*args, **kwargs):
1179 """
1180 OffsetXY(self, int dx, int dy)
1181
1182 Moves the rectangle by the specified offset. If dx is positive, the
1183 rectangle is moved to the right, if dy is positive, it is moved to the
1184 bottom, otherwise it is moved to the left or top respectively.
1185 """
1186 return _core_.Rect_OffsetXY(*args, **kwargs)
1187
1188 def Offset(*args, **kwargs):
1189 """
1190 Offset(self, Point pt)
1191
1192 Same as OffsetXY but uses dx,dy from Point
1193 """
1194 return _core_.Rect_Offset(*args, **kwargs)
1195
1196 def Intersect(*args, **kwargs):
1197 """
1198 Intersect(self, Rect rect) -> Rect
1199
1200 Return the intersectsion of this rectangle and rect.
1201 """
1202 return _core_.Rect_Intersect(*args, **kwargs)
1203
1204 def __add__(*args, **kwargs):
1205 """
1206 __add__(self, Rect rect) -> Rect
1207
1208 Add the properties of rect to this rectangle and return the result.
1209 """
1210 return _core_.Rect___add__(*args, **kwargs)
1211
1212 def __iadd__(*args, **kwargs):
1213 """
1214 __iadd__(self, Rect rect) -> Rect
1215
1216 Add the properties of rect to this rectangle, updating this rectangle.
1217 """
1218 return _core_.Rect___iadd__(*args, **kwargs)
1219
1220 def __eq__(*args, **kwargs):
1221 """
1222 __eq__(self, Rect rect) -> bool
1223
1224 Test for equality.
1225 """
1226 return _core_.Rect___eq__(*args, **kwargs)
1227
1228 def __ne__(*args, **kwargs):
1229 """
1230 __ne__(self, Rect rect) -> bool
1231
1232 Test for inequality.
1233 """
1234 return _core_.Rect___ne__(*args, **kwargs)
1235
1236 def InsideXY(*args, **kwargs):
1237 """
1238 InsideXY(self, int x, int y) -> bool
1239
1240 Return True if the point is (not strcitly) inside the rect.
1241 """
1242 return _core_.Rect_InsideXY(*args, **kwargs)
1243
1244 def Inside(*args, **kwargs):
1245 """
1246 Inside(self, Point pt) -> bool
1247
1248 Return True if the point is (not strcitly) inside the rect.
1249 """
1250 return _core_.Rect_Inside(*args, **kwargs)
1251
1252 def Intersects(*args, **kwargs):
1253 """
1254 Intersects(self, Rect rect) -> bool
1255
1256 Returns True if the rectangles have a non empty intersection.
1257 """
1258 return _core_.Rect_Intersects(*args, **kwargs)
1259
1260 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1261 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1262 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1263 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1264 def Set(*args, **kwargs):
1265 """
1266 Set(self, int x=0, int y=0, int width=0, int height=0)
1267
1268 Set all rectangle properties.
1269 """
1270 return _core_.Rect_Set(*args, **kwargs)
1271
1272 def Get(*args, **kwargs):
1273 """
1274 Get() -> (x,y,width,height)
1275
1276 Return the rectangle properties as a tuple.
1277 """
1278 return _core_.Rect_Get(*args, **kwargs)
1279
1280 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1281 def __str__(self): return str(self.Get())
1282 def __repr__(self): return 'wx.Rect'+str(self.Get())
1283 def __len__(self): return len(self.Get())
1284 def __getitem__(self, index): return self.Get()[index]
1285 def __setitem__(self, index, val):
1286 if index == 0: self.x = val
1287 elif index == 1: self.y = val
1288 elif index == 2: self.width = val
1289 elif index == 3: self.height = val
1290 else: raise IndexError
1291 def __nonzero__(self): return self.Get() != (0,0,0,0)
1292 __safe_for_unpickling__ = True
1293 def __reduce__(self): return (wx.Rect, self.Get())
1294
1295
1296 class RectPtr(Rect):
1297 def __init__(self, this):
1298 self.this = this
1299 if not hasattr(self,"thisown"): self.thisown = 0
1300 self.__class__ = Rect
1301 _core_.Rect_swigregister(RectPtr)
1302
1303 def RectPP(*args, **kwargs):
1304 """
1305 RectPP(Point topLeft, Point bottomRight) -> Rect
1306
1307 Create a new Rect object from Points representing two corners.
1308 """
1309 val = _core_.new_RectPP(*args, **kwargs)
1310 val.thisown = 1
1311 return val
1312
1313 def RectPS(*args, **kwargs):
1314 """
1315 RectPS(Point pos, Size size) -> Rect
1316
1317 Create a new Rect from a position and size.
1318 """
1319 val = _core_.new_RectPS(*args, **kwargs)
1320 val.thisown = 1
1321 return val
1322
1323 def RectS(*args, **kwargs):
1324 """
1325 RectS(Size size) -> Rect
1326
1327 Create a new Rect from a size only.
1328 """
1329 val = _core_.new_RectS(*args, **kwargs)
1330 val.thisown = 1
1331 return val
1332
1333
1334 def IntersectRect(*args, **kwargs):
1335 """
1336 IntersectRect(Rect r1, Rect r2) -> Rect
1337
1338 Calculate and return the intersection of r1 and r2.
1339 """
1340 return _core_.IntersectRect(*args, **kwargs)
1341 #---------------------------------------------------------------------------
1342
1343 class Point2D(object):
1344 """
1345 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1346 with floating point values.
1347 """
1348 def __repr__(self):
1349 return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1350 def __init__(self, *args, **kwargs):
1351 """
1352 __init__(self, double x=0.0, double y=0.0) -> Point2D
1353
1354 Create a w.Point2D object.
1355 """
1356 newobj = _core_.new_Point2D(*args, **kwargs)
1357 self.this = newobj.this
1358 self.thisown = 1
1359 del newobj.thisown
1360 def GetFloor(*args, **kwargs):
1361 """
1362 GetFloor() -> (x,y)
1363
1364 Convert to integer
1365 """
1366 return _core_.Point2D_GetFloor(*args, **kwargs)
1367
1368 def GetRounded(*args, **kwargs):
1369 """
1370 GetRounded() -> (x,y)
1371
1372 Convert to integer
1373 """
1374 return _core_.Point2D_GetRounded(*args, **kwargs)
1375
1376 def GetVectorLength(*args, **kwargs):
1377 """GetVectorLength(self) -> double"""
1378 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1379
1380 def GetVectorAngle(*args, **kwargs):
1381 """GetVectorAngle(self) -> double"""
1382 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1383
1384 def SetVectorLength(*args, **kwargs):
1385 """SetVectorLength(self, double length)"""
1386 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1387
1388 def SetVectorAngle(*args, **kwargs):
1389 """SetVectorAngle(self, double degrees)"""
1390 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1391
1392 def SetPolarCoordinates(self, angle, length):
1393 self.SetVectorLength(length)
1394 self.SetVectorAngle(angle)
1395 def Normalize(self):
1396 self.SetVectorLength(1.0)
1397
1398 def GetDistance(*args, **kwargs):
1399 """GetDistance(self, Point2D pt) -> double"""
1400 return _core_.Point2D_GetDistance(*args, **kwargs)
1401
1402 def GetDistanceSquare(*args, **kwargs):
1403 """GetDistanceSquare(self, Point2D pt) -> double"""
1404 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1405
1406 def GetDotProduct(*args, **kwargs):
1407 """GetDotProduct(self, Point2D vec) -> double"""
1408 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1409
1410 def GetCrossProduct(*args, **kwargs):
1411 """GetCrossProduct(self, Point2D vec) -> double"""
1412 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1413
1414 def __neg__(*args, **kwargs):
1415 """
1416 __neg__(self) -> Point2D
1417
1418 the reflection of this point
1419 """
1420 return _core_.Point2D___neg__(*args, **kwargs)
1421
1422 def __iadd__(*args, **kwargs):
1423 """__iadd__(self, Point2D pt) -> Point2D"""
1424 return _core_.Point2D___iadd__(*args, **kwargs)
1425
1426 def __isub__(*args, **kwargs):
1427 """__isub__(self, Point2D pt) -> Point2D"""
1428 return _core_.Point2D___isub__(*args, **kwargs)
1429
1430 def __imul__(*args, **kwargs):
1431 """__imul__(self, Point2D pt) -> Point2D"""
1432 return _core_.Point2D___imul__(*args, **kwargs)
1433
1434 def __idiv__(*args, **kwargs):
1435 """__idiv__(self, Point2D pt) -> Point2D"""
1436 return _core_.Point2D___idiv__(*args, **kwargs)
1437
1438 def __eq__(*args, **kwargs):
1439 """
1440 __eq__(self, Point2D pt) -> bool
1441
1442 Test for equality
1443 """
1444 return _core_.Point2D___eq__(*args, **kwargs)
1445
1446 def __ne__(*args, **kwargs):
1447 """
1448 __ne__(self, Point2D pt) -> bool
1449
1450 Test for inequality
1451 """
1452 return _core_.Point2D___ne__(*args, **kwargs)
1453
1454 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1455 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1456 def Set(*args, **kwargs):
1457 """Set(self, double x=0, double y=0)"""
1458 return _core_.Point2D_Set(*args, **kwargs)
1459
1460 def Get(*args, **kwargs):
1461 """
1462 Get() -> (x,y)
1463
1464 Return x and y properties as a tuple.
1465 """
1466 return _core_.Point2D_Get(*args, **kwargs)
1467
1468 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
1469 def __str__(self): return str(self.Get())
1470 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1471 def __len__(self): return len(self.Get())
1472 def __getitem__(self, index): return self.Get()[index]
1473 def __setitem__(self, index, val):
1474 if index == 0: self.x = val
1475 elif index == 1: self.y = val
1476 else: raise IndexError
1477 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1478 __safe_for_unpickling__ = True
1479 def __reduce__(self): return (wx.Point2D, self.Get())
1480
1481
1482 class Point2DPtr(Point2D):
1483 def __init__(self, this):
1484 self.this = this
1485 if not hasattr(self,"thisown"): self.thisown = 0
1486 self.__class__ = Point2D
1487 _core_.Point2D_swigregister(Point2DPtr)
1488
1489 def Point2DCopy(*args, **kwargs):
1490 """
1491 Point2DCopy(Point2D pt) -> Point2D
1492
1493 Create a w.Point2D object.
1494 """
1495 val = _core_.new_Point2DCopy(*args, **kwargs)
1496 val.thisown = 1
1497 return val
1498
1499 def Point2DFromPoint(*args, **kwargs):
1500 """
1501 Point2DFromPoint(Point pt) -> Point2D
1502
1503 Create a w.Point2D object.
1504 """
1505 val = _core_.new_Point2DFromPoint(*args, **kwargs)
1506 val.thisown = 1
1507 return val
1508
1509 #---------------------------------------------------------------------------
1510
1511 FromStart = _core_.FromStart
1512 FromCurrent = _core_.FromCurrent
1513 FromEnd = _core_.FromEnd
1514 class InputStream(object):
1515 def __repr__(self):
1516 return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1517 def __init__(self, *args, **kwargs):
1518 """__init__(self, PyObject p) -> InputStream"""
1519 newobj = _core_.new_InputStream(*args, **kwargs)
1520 self.this = newobj.this
1521 self.thisown = 1
1522 del newobj.thisown
1523 def close(*args, **kwargs):
1524 """close(self)"""
1525 return _core_.InputStream_close(*args, **kwargs)
1526
1527 def flush(*args, **kwargs):
1528 """flush(self)"""
1529 return _core_.InputStream_flush(*args, **kwargs)
1530
1531 def eof(*args, **kwargs):
1532 """eof(self) -> bool"""
1533 return _core_.InputStream_eof(*args, **kwargs)
1534
1535 def read(*args, **kwargs):
1536 """read(self, int size=-1) -> PyObject"""
1537 return _core_.InputStream_read(*args, **kwargs)
1538
1539 def readline(*args, **kwargs):
1540 """readline(self, int size=-1) -> PyObject"""
1541 return _core_.InputStream_readline(*args, **kwargs)
1542
1543 def readlines(*args, **kwargs):
1544 """readlines(self, int sizehint=-1) -> PyObject"""
1545 return _core_.InputStream_readlines(*args, **kwargs)
1546
1547 def seek(*args, **kwargs):
1548 """seek(self, int offset, int whence=0)"""
1549 return _core_.InputStream_seek(*args, **kwargs)
1550
1551 def tell(*args, **kwargs):
1552 """tell(self) -> int"""
1553 return _core_.InputStream_tell(*args, **kwargs)
1554
1555 def Peek(*args, **kwargs):
1556 """Peek(self) -> char"""
1557 return _core_.InputStream_Peek(*args, **kwargs)
1558
1559 def GetC(*args, **kwargs):
1560 """GetC(self) -> char"""
1561 return _core_.InputStream_GetC(*args, **kwargs)
1562
1563 def LastRead(*args, **kwargs):
1564 """LastRead(self) -> size_t"""
1565 return _core_.InputStream_LastRead(*args, **kwargs)
1566
1567 def CanRead(*args, **kwargs):
1568 """CanRead(self) -> bool"""
1569 return _core_.InputStream_CanRead(*args, **kwargs)
1570
1571 def Eof(*args, **kwargs):
1572 """Eof(self) -> bool"""
1573 return _core_.InputStream_Eof(*args, **kwargs)
1574
1575 def Ungetch(*args, **kwargs):
1576 """Ungetch(self, char c) -> bool"""
1577 return _core_.InputStream_Ungetch(*args, **kwargs)
1578
1579 def SeekI(*args, **kwargs):
1580 """SeekI(self, long pos, int mode=FromStart) -> long"""
1581 return _core_.InputStream_SeekI(*args, **kwargs)
1582
1583 def TellI(*args, **kwargs):
1584 """TellI(self) -> long"""
1585 return _core_.InputStream_TellI(*args, **kwargs)
1586
1587
1588 class InputStreamPtr(InputStream):
1589 def __init__(self, this):
1590 self.this = this
1591 if not hasattr(self,"thisown"): self.thisown = 0
1592 self.__class__ = InputStream
1593 _core_.InputStream_swigregister(InputStreamPtr)
1594 DefaultPosition = cvar.DefaultPosition
1595 DefaultSize = cvar.DefaultSize
1596
1597 class OutputStream(object):
1598 def __init__(self): raise RuntimeError, "No constructor defined"
1599 def __repr__(self):
1600 return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1601 def write(*args, **kwargs):
1602 """write(self, PyObject obj)"""
1603 return _core_.OutputStream_write(*args, **kwargs)
1604
1605
1606 class OutputStreamPtr(OutputStream):
1607 def __init__(self, this):
1608 self.this = this
1609 if not hasattr(self,"thisown"): self.thisown = 0
1610 self.__class__ = OutputStream
1611 _core_.OutputStream_swigregister(OutputStreamPtr)
1612
1613 #---------------------------------------------------------------------------
1614
1615 class FSFile(Object):
1616 def __repr__(self):
1617 return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1618 def __init__(self, *args, **kwargs):
1619 """
1620 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1621 DateTime modif) -> FSFile
1622 """
1623 newobj = _core_.new_FSFile(*args, **kwargs)
1624 self.this = newobj.this
1625 self.thisown = 1
1626 del newobj.thisown
1627 self.thisown = 0 # It will normally be deleted by the user of the wxFileSystem
1628
1629 def __del__(self, destroy=_core_.delete_FSFile):
1630 """__del__(self)"""
1631 try:
1632 if self.thisown: destroy(self)
1633 except: pass
1634
1635 def GetStream(*args, **kwargs):
1636 """GetStream(self) -> InputStream"""
1637 return _core_.FSFile_GetStream(*args, **kwargs)
1638
1639 def GetMimeType(*args, **kwargs):
1640 """GetMimeType(self) -> String"""
1641 return _core_.FSFile_GetMimeType(*args, **kwargs)
1642
1643 def GetLocation(*args, **kwargs):
1644 """GetLocation(self) -> String"""
1645 return _core_.FSFile_GetLocation(*args, **kwargs)
1646
1647 def GetAnchor(*args, **kwargs):
1648 """GetAnchor(self) -> String"""
1649 return _core_.FSFile_GetAnchor(*args, **kwargs)
1650
1651 def GetModificationTime(*args, **kwargs):
1652 """GetModificationTime(self) -> DateTime"""
1653 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1654
1655
1656 class FSFilePtr(FSFile):
1657 def __init__(self, this):
1658 self.this = this
1659 if not hasattr(self,"thisown"): self.thisown = 0
1660 self.__class__ = FSFile
1661 _core_.FSFile_swigregister(FSFilePtr)
1662
1663 class CPPFileSystemHandler(object):
1664 def __init__(self): raise RuntimeError, "No constructor defined"
1665 def __repr__(self):
1666 return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1667
1668 class CPPFileSystemHandlerPtr(CPPFileSystemHandler):
1669 def __init__(self, this):
1670 self.this = this
1671 if not hasattr(self,"thisown"): self.thisown = 0
1672 self.__class__ = CPPFileSystemHandler
1673 _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr)
1674
1675 class FileSystemHandler(CPPFileSystemHandler):
1676 def __repr__(self):
1677 return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1678 def __init__(self, *args, **kwargs):
1679 """__init__(self) -> FileSystemHandler"""
1680 newobj = _core_.new_FileSystemHandler(*args, **kwargs)
1681 self.this = newobj.this
1682 self.thisown = 1
1683 del newobj.thisown
1684 self._setCallbackInfo(self, FileSystemHandler)
1685
1686 def _setCallbackInfo(*args, **kwargs):
1687 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1688 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1689
1690 def CanOpen(*args, **kwargs):
1691 """CanOpen(self, String location) -> bool"""
1692 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1693
1694 def OpenFile(*args, **kwargs):
1695 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1696 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1697
1698 def FindFirst(*args, **kwargs):
1699 """FindFirst(self, String spec, int flags=0) -> String"""
1700 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1701
1702 def FindNext(*args, **kwargs):
1703 """FindNext(self) -> String"""
1704 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1705
1706 def GetProtocol(*args, **kwargs):
1707 """GetProtocol(self, String location) -> String"""
1708 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1709
1710 def GetLeftLocation(*args, **kwargs):
1711 """GetLeftLocation(self, String location) -> String"""
1712 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1713
1714 def GetAnchor(*args, **kwargs):
1715 """GetAnchor(self, String location) -> String"""
1716 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1717
1718 def GetRightLocation(*args, **kwargs):
1719 """GetRightLocation(self, String location) -> String"""
1720 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1721
1722 def GetMimeTypeFromExt(*args, **kwargs):
1723 """GetMimeTypeFromExt(self, String location) -> String"""
1724 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1725
1726
1727 class FileSystemHandlerPtr(FileSystemHandler):
1728 def __init__(self, this):
1729 self.this = this
1730 if not hasattr(self,"thisown"): self.thisown = 0
1731 self.__class__ = FileSystemHandler
1732 _core_.FileSystemHandler_swigregister(FileSystemHandlerPtr)
1733
1734 class FileSystem(Object):
1735 def __repr__(self):
1736 return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1737 def __init__(self, *args, **kwargs):
1738 """__init__(self) -> FileSystem"""
1739 newobj = _core_.new_FileSystem(*args, **kwargs)
1740 self.this = newobj.this
1741 self.thisown = 1
1742 del newobj.thisown
1743 def __del__(self, destroy=_core_.delete_FileSystem):
1744 """__del__(self)"""
1745 try:
1746 if self.thisown: destroy(self)
1747 except: pass
1748
1749 def ChangePathTo(*args, **kwargs):
1750 """ChangePathTo(self, String location, bool is_dir=False)"""
1751 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1752
1753 def GetPath(*args, **kwargs):
1754 """GetPath(self) -> String"""
1755 return _core_.FileSystem_GetPath(*args, **kwargs)
1756
1757 def OpenFile(*args, **kwargs):
1758 """OpenFile(self, String location) -> FSFile"""
1759 return _core_.FileSystem_OpenFile(*args, **kwargs)
1760
1761 def FindFirst(*args, **kwargs):
1762 """FindFirst(self, String spec, int flags=0) -> String"""
1763 return _core_.FileSystem_FindFirst(*args, **kwargs)
1764
1765 def FindNext(*args, **kwargs):
1766 """FindNext(self) -> String"""
1767 return _core_.FileSystem_FindNext(*args, **kwargs)
1768
1769 def AddHandler(*args, **kwargs):
1770 """AddHandler(CPPFileSystemHandler handler)"""
1771 return _core_.FileSystem_AddHandler(*args, **kwargs)
1772
1773 AddHandler = staticmethod(AddHandler)
1774 def CleanUpHandlers(*args, **kwargs):
1775 """CleanUpHandlers()"""
1776 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1777
1778 CleanUpHandlers = staticmethod(CleanUpHandlers)
1779 def FileNameToURL(*args, **kwargs):
1780 """FileNameToURL(String filename) -> String"""
1781 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1782
1783 FileNameToURL = staticmethod(FileNameToURL)
1784 def URLToFileName(*args, **kwargs):
1785 """URLToFileName(String url) -> String"""
1786 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1787
1788 URLToFileName = staticmethod(URLToFileName)
1789
1790 class FileSystemPtr(FileSystem):
1791 def __init__(self, this):
1792 self.this = this
1793 if not hasattr(self,"thisown"): self.thisown = 0
1794 self.__class__ = FileSystem
1795 _core_.FileSystem_swigregister(FileSystemPtr)
1796
1797 def FileSystem_AddHandler(*args, **kwargs):
1798 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1799 return _core_.FileSystem_AddHandler(*args, **kwargs)
1800
1801 def FileSystem_CleanUpHandlers(*args, **kwargs):
1802 """FileSystem_CleanUpHandlers()"""
1803 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1804
1805 def FileSystem_FileNameToURL(*args, **kwargs):
1806 """FileSystem_FileNameToURL(String filename) -> String"""
1807 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1808
1809 def FileSystem_URLToFileName(*args, **kwargs):
1810 """FileSystem_URLToFileName(String url) -> String"""
1811 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1812
1813 class InternetFSHandler(CPPFileSystemHandler):
1814 def __repr__(self):
1815 return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1816 def __init__(self, *args, **kwargs):
1817 """__init__(self) -> InternetFSHandler"""
1818 newobj = _core_.new_InternetFSHandler(*args, **kwargs)
1819 self.this = newobj.this
1820 self.thisown = 1
1821 del newobj.thisown
1822 def CanOpen(*args, **kwargs):
1823 """CanOpen(self, String location) -> bool"""
1824 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1825
1826 def OpenFile(*args, **kwargs):
1827 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1828 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1829
1830
1831 class InternetFSHandlerPtr(InternetFSHandler):
1832 def __init__(self, this):
1833 self.this = this
1834 if not hasattr(self,"thisown"): self.thisown = 0
1835 self.__class__ = InternetFSHandler
1836 _core_.InternetFSHandler_swigregister(InternetFSHandlerPtr)
1837
1838 class ZipFSHandler(CPPFileSystemHandler):
1839 def __repr__(self):
1840 return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1841 def __init__(self, *args, **kwargs):
1842 """__init__(self) -> ZipFSHandler"""
1843 newobj = _core_.new_ZipFSHandler(*args, **kwargs)
1844 self.this = newobj.this
1845 self.thisown = 1
1846 del newobj.thisown
1847 def CanOpen(*args, **kwargs):
1848 """CanOpen(self, String location) -> bool"""
1849 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1850
1851 def OpenFile(*args, **kwargs):
1852 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1853 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1854
1855 def FindFirst(*args, **kwargs):
1856 """FindFirst(self, String spec, int flags=0) -> String"""
1857 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1858
1859 def FindNext(*args, **kwargs):
1860 """FindNext(self) -> String"""
1861 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1862
1863
1864 class ZipFSHandlerPtr(ZipFSHandler):
1865 def __init__(self, this):
1866 self.this = this
1867 if not hasattr(self,"thisown"): self.thisown = 0
1868 self.__class__ = ZipFSHandler
1869 _core_.ZipFSHandler_swigregister(ZipFSHandlerPtr)
1870
1871
1872 def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1873 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1874 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
1875
1876 def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1877 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1878 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
1879
1880 def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1881 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1882 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
1883 def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1884 """
1885 Add 'file' to the memory filesystem. The dataItem parameter can
1886 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1887 arbitrary data. If a bitmap or image is used then the imgType
1888 parameter should specify what kind of image file it should be
1889 written as, wx.BITMAP_TYPE_PNG, etc.
1890 """
1891 if isinstance(dataItem, wx.Image):
1892 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1893 elif isinstance(dataItem, wx.Bitmap):
1894 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1895 elif type(dataItem) == str:
1896 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1897 else:
1898 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
1899
1900 class MemoryFSHandler(CPPFileSystemHandler):
1901 def __repr__(self):
1902 return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1903 def __init__(self, *args, **kwargs):
1904 """__init__(self) -> MemoryFSHandler"""
1905 newobj = _core_.new_MemoryFSHandler(*args, **kwargs)
1906 self.this = newobj.this
1907 self.thisown = 1
1908 del newobj.thisown
1909 def RemoveFile(*args, **kwargs):
1910 """RemoveFile(String filename)"""
1911 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1912
1913 RemoveFile = staticmethod(RemoveFile)
1914 AddFile = staticmethod(MemoryFSHandler_AddFile)
1915 def CanOpen(*args, **kwargs):
1916 """CanOpen(self, String location) -> bool"""
1917 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1918
1919 def OpenFile(*args, **kwargs):
1920 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1921 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1922
1923 def FindFirst(*args, **kwargs):
1924 """FindFirst(self, String spec, int flags=0) -> String"""
1925 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1926
1927 def FindNext(*args, **kwargs):
1928 """FindNext(self) -> String"""
1929 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1930
1931
1932 class MemoryFSHandlerPtr(MemoryFSHandler):
1933 def __init__(self, this):
1934 self.this = this
1935 if not hasattr(self,"thisown"): self.thisown = 0
1936 self.__class__ = MemoryFSHandler
1937 _core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr)
1938
1939 def MemoryFSHandler_RemoveFile(*args, **kwargs):
1940 """MemoryFSHandler_RemoveFile(String filename)"""
1941 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1942
1943 #---------------------------------------------------------------------------
1944
1945 class ImageHandler(Object):
1946 def __init__(self): raise RuntimeError, "No constructor defined"
1947 def __repr__(self):
1948 return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1949 def GetName(*args, **kwargs):
1950 """GetName(self) -> String"""
1951 return _core_.ImageHandler_GetName(*args, **kwargs)
1952
1953 def GetExtension(*args, **kwargs):
1954 """GetExtension(self) -> String"""
1955 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1956
1957 def GetType(*args, **kwargs):
1958 """GetType(self) -> long"""
1959 return _core_.ImageHandler_GetType(*args, **kwargs)
1960
1961 def GetMimeType(*args, **kwargs):
1962 """GetMimeType(self) -> String"""
1963 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
1964
1965 def CanRead(*args, **kwargs):
1966 """CanRead(self, String name) -> bool"""
1967 return _core_.ImageHandler_CanRead(*args, **kwargs)
1968
1969 def SetName(*args, **kwargs):
1970 """SetName(self, String name)"""
1971 return _core_.ImageHandler_SetName(*args, **kwargs)
1972
1973 def SetExtension(*args, **kwargs):
1974 """SetExtension(self, String extension)"""
1975 return _core_.ImageHandler_SetExtension(*args, **kwargs)
1976
1977 def SetType(*args, **kwargs):
1978 """SetType(self, long type)"""
1979 return _core_.ImageHandler_SetType(*args, **kwargs)
1980
1981 def SetMimeType(*args, **kwargs):
1982 """SetMimeType(self, String mimetype)"""
1983 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
1984
1985
1986 class ImageHandlerPtr(ImageHandler):
1987 def __init__(self, this):
1988 self.this = this
1989 if not hasattr(self,"thisown"): self.thisown = 0
1990 self.__class__ = ImageHandler
1991 _core_.ImageHandler_swigregister(ImageHandlerPtr)
1992
1993 class ImageHistogram(object):
1994 def __repr__(self):
1995 return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
1996 def __init__(self, *args, **kwargs):
1997 """__init__(self) -> ImageHistogram"""
1998 newobj = _core_.new_ImageHistogram(*args, **kwargs)
1999 self.this = newobj.this
2000 self.thisown = 1
2001 del newobj.thisown
2002 def MakeKey(*args, **kwargs):
2003 """
2004 MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2005
2006 Get the key in the histogram for the given RGB values
2007 """
2008 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2009
2010 MakeKey = staticmethod(MakeKey)
2011 def FindFirstUnusedColour(*args, **kwargs):
2012 """
2013 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2014
2015 Find first colour that is not used in the image and has higher RGB
2016 values than startR, startG, startB. Returns a tuple consisting of a
2017 success flag and rgb values.
2018 """
2019 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2020
2021
2022 class ImageHistogramPtr(ImageHistogram):
2023 def __init__(self, this):
2024 self.this = this
2025 if not hasattr(self,"thisown"): self.thisown = 0
2026 self.__class__ = ImageHistogram
2027 _core_.ImageHistogram_swigregister(ImageHistogramPtr)
2028
2029 def ImageHistogram_MakeKey(*args, **kwargs):
2030 """
2031 ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long
2032
2033 Get the key in the histogram for the given RGB values
2034 """
2035 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2036
2037 class Image(Object):
2038 def __repr__(self):
2039 return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2040 def __init__(self, *args, **kwargs):
2041 """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2042 newobj = _core_.new_Image(*args, **kwargs)
2043 self.this = newobj.this
2044 self.thisown = 1
2045 del newobj.thisown
2046 def __del__(self, destroy=_core_.delete_Image):
2047 """__del__(self)"""
2048 try:
2049 if self.thisown: destroy(self)
2050 except: pass
2051
2052 def Create(*args, **kwargs):
2053 """Create(self, int width, int height)"""
2054 return _core_.Image_Create(*args, **kwargs)
2055
2056 def Destroy(*args, **kwargs):
2057 """
2058 Destroy(self)
2059
2060 Deletes the C++ object this Python object is a proxy for.
2061 """
2062 return _core_.Image_Destroy(*args, **kwargs)
2063
2064 def Scale(*args, **kwargs):
2065 """Scale(self, int width, int height) -> Image"""
2066 return _core_.Image_Scale(*args, **kwargs)
2067
2068 def ShrinkBy(*args, **kwargs):
2069 """ShrinkBy(self, int xFactor, int yFactor) -> Image"""
2070 return _core_.Image_ShrinkBy(*args, **kwargs)
2071
2072 def Rescale(*args, **kwargs):
2073 """Rescale(self, int width, int height) -> Image"""
2074 return _core_.Image_Rescale(*args, **kwargs)
2075
2076 def SetRGB(*args, **kwargs):
2077 """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)"""
2078 return _core_.Image_SetRGB(*args, **kwargs)
2079
2080 def GetRed(*args, **kwargs):
2081 """GetRed(self, int x, int y) -> unsigned char"""
2082 return _core_.Image_GetRed(*args, **kwargs)
2083
2084 def GetGreen(*args, **kwargs):
2085 """GetGreen(self, int x, int y) -> unsigned char"""
2086 return _core_.Image_GetGreen(*args, **kwargs)
2087
2088 def GetBlue(*args, **kwargs):
2089 """GetBlue(self, int x, int y) -> unsigned char"""
2090 return _core_.Image_GetBlue(*args, **kwargs)
2091
2092 def SetAlpha(*args, **kwargs):
2093 """SetAlpha(self, int x, int y, unsigned char alpha)"""
2094 return _core_.Image_SetAlpha(*args, **kwargs)
2095
2096 def GetAlpha(*args, **kwargs):
2097 """GetAlpha(self, int x, int y) -> unsigned char"""
2098 return _core_.Image_GetAlpha(*args, **kwargs)
2099
2100 def HasAlpha(*args, **kwargs):
2101 """HasAlpha(self) -> bool"""
2102 return _core_.Image_HasAlpha(*args, **kwargs)
2103
2104 def FindFirstUnusedColour(*args, **kwargs):
2105 """
2106 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2107
2108 Find first colour that is not used in the image and has higher RGB
2109 values than startR, startG, startB. Returns a tuple consisting of a
2110 success flag and rgb values.
2111 """
2112 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2113
2114 def ConvertAlphaToMask(*args, **kwargs):
2115 """
2116 ConvertAlphaToMask(self, byte threshold=128) -> bool
2117
2118 If the image has alpha channel, this method converts it to mask. All pixels
2119 with alpha value less than ``threshold`` are replaced with mask colour and the
2120 alpha channel is removed. Mask colour is chosen automatically using
2121 `FindFirstUnusedColour`.
2122
2123 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2124 nothing.
2125 """
2126 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2127
2128 def SetMaskFromImage(*args, **kwargs):
2129 """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool"""
2130 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2131
2132 def CanRead(*args, **kwargs):
2133 """CanRead(String name) -> bool"""
2134 return _core_.Image_CanRead(*args, **kwargs)
2135
2136 CanRead = staticmethod(CanRead)
2137 def GetImageCount(*args, **kwargs):
2138 """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2139 return _core_.Image_GetImageCount(*args, **kwargs)
2140
2141 GetImageCount = staticmethod(GetImageCount)
2142 def LoadFile(*args, **kwargs):
2143 """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2144 return _core_.Image_LoadFile(*args, **kwargs)
2145
2146 def LoadMimeFile(*args, **kwargs):
2147 """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool"""
2148 return _core_.Image_LoadMimeFile(*args, **kwargs)
2149
2150 def SaveFile(*args, **kwargs):
2151 """SaveFile(self, String name, int type) -> bool"""
2152 return _core_.Image_SaveFile(*args, **kwargs)
2153
2154 def SaveMimeFile(*args, **kwargs):
2155 """SaveMimeFile(self, String name, String mimetype) -> bool"""
2156 return _core_.Image_SaveMimeFile(*args, **kwargs)
2157
2158 def CanReadStream(*args, **kwargs):
2159 """CanReadStream(InputStream stream) -> bool"""
2160 return _core_.Image_CanReadStream(*args, **kwargs)
2161
2162 CanReadStream = staticmethod(CanReadStream)
2163 def LoadStream(*args, **kwargs):
2164 """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool"""
2165 return _core_.Image_LoadStream(*args, **kwargs)
2166
2167 def LoadMimeStream(*args, **kwargs):
2168 """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool"""
2169 return _core_.Image_LoadMimeStream(*args, **kwargs)
2170
2171 def Ok(*args, **kwargs):
2172 """Ok(self) -> bool"""
2173 return _core_.Image_Ok(*args, **kwargs)
2174
2175 def GetWidth(*args, **kwargs):
2176 """GetWidth(self) -> int"""
2177 return _core_.Image_GetWidth(*args, **kwargs)
2178
2179 def GetHeight(*args, **kwargs):
2180 """GetHeight(self) -> int"""
2181 return _core_.Image_GetHeight(*args, **kwargs)
2182
2183 def GetSize(*args, **kwargs):
2184 """GetSize(self) -> Size"""
2185 return _core_.Image_GetSize(*args, **kwargs)
2186
2187 def GetSubImage(*args, **kwargs):
2188 """GetSubImage(self, Rect rect) -> Image"""
2189 return _core_.Image_GetSubImage(*args, **kwargs)
2190
2191 def Copy(*args, **kwargs):
2192 """Copy(self) -> Image"""
2193 return _core_.Image_Copy(*args, **kwargs)
2194
2195 def Paste(*args, **kwargs):
2196 """Paste(self, Image image, int x, int y)"""
2197 return _core_.Image_Paste(*args, **kwargs)
2198
2199 def GetData(*args, **kwargs):
2200 """GetData(self) -> PyObject"""
2201 return _core_.Image_GetData(*args, **kwargs)
2202
2203 def SetData(*args, **kwargs):
2204 """SetData(self, PyObject data)"""
2205 return _core_.Image_SetData(*args, **kwargs)
2206
2207 def GetDataBuffer(*args, **kwargs):
2208 """GetDataBuffer(self) -> PyObject"""
2209 return _core_.Image_GetDataBuffer(*args, **kwargs)
2210
2211 def SetDataBuffer(*args, **kwargs):
2212 """SetDataBuffer(self, PyObject data)"""
2213 return _core_.Image_SetDataBuffer(*args, **kwargs)
2214
2215 def GetAlphaData(*args, **kwargs):
2216 """GetAlphaData(self) -> PyObject"""
2217 return _core_.Image_GetAlphaData(*args, **kwargs)
2218
2219 def SetAlphaData(*args, **kwargs):
2220 """SetAlphaData(self, PyObject data)"""
2221 return _core_.Image_SetAlphaData(*args, **kwargs)
2222
2223 def GetAlphaBuffer(*args, **kwargs):
2224 """GetAlphaBuffer(self) -> PyObject"""
2225 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2226
2227 def SetAlphaBuffer(*args, **kwargs):
2228 """SetAlphaBuffer(self, PyObject data)"""
2229 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2230
2231 def SetMaskColour(*args, **kwargs):
2232 """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)"""
2233 return _core_.Image_SetMaskColour(*args, **kwargs)
2234
2235 def GetMaskRed(*args, **kwargs):
2236 """GetMaskRed(self) -> unsigned char"""
2237 return _core_.Image_GetMaskRed(*args, **kwargs)
2238
2239 def GetMaskGreen(*args, **kwargs):
2240 """GetMaskGreen(self) -> unsigned char"""
2241 return _core_.Image_GetMaskGreen(*args, **kwargs)
2242
2243 def GetMaskBlue(*args, **kwargs):
2244 """GetMaskBlue(self) -> unsigned char"""
2245 return _core_.Image_GetMaskBlue(*args, **kwargs)
2246
2247 def SetMask(*args, **kwargs):
2248 """SetMask(self, bool mask=True)"""
2249 return _core_.Image_SetMask(*args, **kwargs)
2250
2251 def HasMask(*args, **kwargs):
2252 """HasMask(self) -> bool"""
2253 return _core_.Image_HasMask(*args, **kwargs)
2254
2255 def Rotate(*args, **kwargs):
2256 """
2257 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2258 Point offset_after_rotation=None) -> Image
2259 """
2260 return _core_.Image_Rotate(*args, **kwargs)
2261
2262 def Rotate90(*args, **kwargs):
2263 """Rotate90(self, bool clockwise=True) -> Image"""
2264 return _core_.Image_Rotate90(*args, **kwargs)
2265
2266 def Mirror(*args, **kwargs):
2267 """Mirror(self, bool horizontally=True) -> Image"""
2268 return _core_.Image_Mirror(*args, **kwargs)
2269
2270 def Replace(*args, **kwargs):
2271 """
2272 Replace(self, unsigned char r1, unsigned char g1, unsigned char b1,
2273 unsigned char r2, unsigned char g2, unsigned char b2)
2274 """
2275 return _core_.Image_Replace(*args, **kwargs)
2276
2277 def ConvertToMono(*args, **kwargs):
2278 """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image"""
2279 return _core_.Image_ConvertToMono(*args, **kwargs)
2280
2281 def SetOption(*args, **kwargs):
2282 """SetOption(self, String name, String value)"""
2283 return _core_.Image_SetOption(*args, **kwargs)
2284
2285 def SetOptionInt(*args, **kwargs):
2286 """SetOptionInt(self, String name, int value)"""
2287 return _core_.Image_SetOptionInt(*args, **kwargs)
2288
2289 def GetOption(*args, **kwargs):
2290 """GetOption(self, String name) -> String"""
2291 return _core_.Image_GetOption(*args, **kwargs)
2292
2293 def GetOptionInt(*args, **kwargs):
2294 """GetOptionInt(self, String name) -> int"""
2295 return _core_.Image_GetOptionInt(*args, **kwargs)
2296
2297 def HasOption(*args, **kwargs):
2298 """HasOption(self, String name) -> bool"""
2299 return _core_.Image_HasOption(*args, **kwargs)
2300
2301 def CountColours(*args, **kwargs):
2302 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2303 return _core_.Image_CountColours(*args, **kwargs)
2304
2305 def ComputeHistogram(*args, **kwargs):
2306 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2307 return _core_.Image_ComputeHistogram(*args, **kwargs)
2308
2309 def AddHandler(*args, **kwargs):
2310 """AddHandler(ImageHandler handler)"""
2311 return _core_.Image_AddHandler(*args, **kwargs)
2312
2313 AddHandler = staticmethod(AddHandler)
2314 def InsertHandler(*args, **kwargs):
2315 """InsertHandler(ImageHandler handler)"""
2316 return _core_.Image_InsertHandler(*args, **kwargs)
2317
2318 InsertHandler = staticmethod(InsertHandler)
2319 def RemoveHandler(*args, **kwargs):
2320 """RemoveHandler(String name) -> bool"""
2321 return _core_.Image_RemoveHandler(*args, **kwargs)
2322
2323 RemoveHandler = staticmethod(RemoveHandler)
2324 def GetImageExtWildcard(*args, **kwargs):
2325 """GetImageExtWildcard() -> String"""
2326 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2327
2328 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2329 def ConvertToBitmap(*args, **kwargs):
2330 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2331 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2332
2333 def ConvertToMonoBitmap(*args, **kwargs):
2334 """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap"""
2335 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2336
2337 def __nonzero__(self): return self.Ok()
2338
2339 class ImagePtr(Image):
2340 def __init__(self, this):
2341 self.this = this
2342 if not hasattr(self,"thisown"): self.thisown = 0
2343 self.__class__ = Image
2344 _core_.Image_swigregister(ImagePtr)
2345
2346 def ImageFromMime(*args, **kwargs):
2347 """ImageFromMime(String name, String mimetype, int index=-1) -> Image"""
2348 val = _core_.new_ImageFromMime(*args, **kwargs)
2349 val.thisown = 1
2350 return val
2351
2352 def ImageFromStream(*args, **kwargs):
2353 """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image"""
2354 val = _core_.new_ImageFromStream(*args, **kwargs)
2355 val.thisown = 1
2356 return val
2357
2358 def ImageFromStreamMime(*args, **kwargs):
2359 """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image"""
2360 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
2361 val.thisown = 1
2362 return val
2363
2364 def EmptyImage(*args, **kwargs):
2365 """EmptyImage(int width=0, int height=0, bool clear=True) -> Image"""
2366 val = _core_.new_EmptyImage(*args, **kwargs)
2367 val.thisown = 1
2368 return val
2369
2370 def ImageFromBitmap(*args, **kwargs):
2371 """ImageFromBitmap(Bitmap bitmap) -> Image"""
2372 val = _core_.new_ImageFromBitmap(*args, **kwargs)
2373 val.thisown = 1
2374 return val
2375
2376 def ImageFromData(*args, **kwargs):
2377 """ImageFromData(int width, int height, unsigned char data) -> Image"""
2378 val = _core_.new_ImageFromData(*args, **kwargs)
2379 val.thisown = 1
2380 return val
2381
2382 def Image_CanRead(*args, **kwargs):
2383 """Image_CanRead(String name) -> bool"""
2384 return _core_.Image_CanRead(*args, **kwargs)
2385
2386 def Image_GetImageCount(*args, **kwargs):
2387 """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int"""
2388 return _core_.Image_GetImageCount(*args, **kwargs)
2389
2390 def Image_CanReadStream(*args, **kwargs):
2391 """Image_CanReadStream(InputStream stream) -> bool"""
2392 return _core_.Image_CanReadStream(*args, **kwargs)
2393
2394 def Image_AddHandler(*args, **kwargs):
2395 """Image_AddHandler(ImageHandler handler)"""
2396 return _core_.Image_AddHandler(*args, **kwargs)
2397
2398 def Image_InsertHandler(*args, **kwargs):
2399 """Image_InsertHandler(ImageHandler handler)"""
2400 return _core_.Image_InsertHandler(*args, **kwargs)
2401
2402 def Image_RemoveHandler(*args, **kwargs):
2403 """Image_RemoveHandler(String name) -> bool"""
2404 return _core_.Image_RemoveHandler(*args, **kwargs)
2405
2406 def Image_GetImageExtWildcard(*args, **kwargs):
2407 """Image_GetImageExtWildcard() -> String"""
2408 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2409
2410 def InitAllImageHandlers():
2411 """
2412 The former functionality of InitAllImageHanders is now done internal to
2413 the _core_ extension module and so this function has become a simple NOP.
2414 """
2415 pass
2416
2417 IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
2418 IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
2419 BMP_24BPP = _core_.BMP_24BPP
2420 BMP_8BPP = _core_.BMP_8BPP
2421 BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
2422 BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
2423 BMP_8BPP_RED = _core_.BMP_8BPP_RED
2424 BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
2425 BMP_4BPP = _core_.BMP_4BPP
2426 BMP_1BPP = _core_.BMP_1BPP
2427 BMP_1BPP_BW = _core_.BMP_1BPP_BW
2428 class BMPHandler(ImageHandler):
2429 def __repr__(self):
2430 return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2431 def __init__(self, *args, **kwargs):
2432 """__init__(self) -> BMPHandler"""
2433 newobj = _core_.new_BMPHandler(*args, **kwargs)
2434 self.this = newobj.this
2435 self.thisown = 1
2436 del newobj.thisown
2437
2438 class BMPHandlerPtr(BMPHandler):
2439 def __init__(self, this):
2440 self.this = this
2441 if not hasattr(self,"thisown"): self.thisown = 0
2442 self.__class__ = BMPHandler
2443 _core_.BMPHandler_swigregister(BMPHandlerPtr)
2444 NullImage = cvar.NullImage
2445 IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
2446 IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
2447 IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
2448 IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
2449 IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
2450
2451 class ICOHandler(BMPHandler):
2452 def __repr__(self):
2453 return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2454 def __init__(self, *args, **kwargs):
2455 """__init__(self) -> ICOHandler"""
2456 newobj = _core_.new_ICOHandler(*args, **kwargs)
2457 self.this = newobj.this
2458 self.thisown = 1
2459 del newobj.thisown
2460
2461 class ICOHandlerPtr(ICOHandler):
2462 def __init__(self, this):
2463 self.this = this
2464 if not hasattr(self,"thisown"): self.thisown = 0
2465 self.__class__ = ICOHandler
2466 _core_.ICOHandler_swigregister(ICOHandlerPtr)
2467
2468 class CURHandler(ICOHandler):
2469 def __repr__(self):
2470 return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2471 def __init__(self, *args, **kwargs):
2472 """__init__(self) -> CURHandler"""
2473 newobj = _core_.new_CURHandler(*args, **kwargs)
2474 self.this = newobj.this
2475 self.thisown = 1
2476 del newobj.thisown
2477
2478 class CURHandlerPtr(CURHandler):
2479 def __init__(self, this):
2480 self.this = this
2481 if not hasattr(self,"thisown"): self.thisown = 0
2482 self.__class__ = CURHandler
2483 _core_.CURHandler_swigregister(CURHandlerPtr)
2484
2485 class ANIHandler(CURHandler):
2486 def __repr__(self):
2487 return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2488 def __init__(self, *args, **kwargs):
2489 """__init__(self) -> ANIHandler"""
2490 newobj = _core_.new_ANIHandler(*args, **kwargs)
2491 self.this = newobj.this
2492 self.thisown = 1
2493 del newobj.thisown
2494
2495 class ANIHandlerPtr(ANIHandler):
2496 def __init__(self, this):
2497 self.this = this
2498 if not hasattr(self,"thisown"): self.thisown = 0
2499 self.__class__ = ANIHandler
2500 _core_.ANIHandler_swigregister(ANIHandlerPtr)
2501
2502 class PNGHandler(ImageHandler):
2503 def __repr__(self):
2504 return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2505 def __init__(self, *args, **kwargs):
2506 """__init__(self) -> PNGHandler"""
2507 newobj = _core_.new_PNGHandler(*args, **kwargs)
2508 self.this = newobj.this
2509 self.thisown = 1
2510 del newobj.thisown
2511
2512 class PNGHandlerPtr(PNGHandler):
2513 def __init__(self, this):
2514 self.this = this
2515 if not hasattr(self,"thisown"): self.thisown = 0
2516 self.__class__ = PNGHandler
2517 _core_.PNGHandler_swigregister(PNGHandlerPtr)
2518
2519 class GIFHandler(ImageHandler):
2520 def __repr__(self):
2521 return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2522 def __init__(self, *args, **kwargs):
2523 """__init__(self) -> GIFHandler"""
2524 newobj = _core_.new_GIFHandler(*args, **kwargs)
2525 self.this = newobj.this
2526 self.thisown = 1
2527 del newobj.thisown
2528
2529 class GIFHandlerPtr(GIFHandler):
2530 def __init__(self, this):
2531 self.this = this
2532 if not hasattr(self,"thisown"): self.thisown = 0
2533 self.__class__ = GIFHandler
2534 _core_.GIFHandler_swigregister(GIFHandlerPtr)
2535
2536 class PCXHandler(ImageHandler):
2537 def __repr__(self):
2538 return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2539 def __init__(self, *args, **kwargs):
2540 """__init__(self) -> PCXHandler"""
2541 newobj = _core_.new_PCXHandler(*args, **kwargs)
2542 self.this = newobj.this
2543 self.thisown = 1
2544 del newobj.thisown
2545
2546 class PCXHandlerPtr(PCXHandler):
2547 def __init__(self, this):
2548 self.this = this
2549 if not hasattr(self,"thisown"): self.thisown = 0
2550 self.__class__ = PCXHandler
2551 _core_.PCXHandler_swigregister(PCXHandlerPtr)
2552
2553 class JPEGHandler(ImageHandler):
2554 def __repr__(self):
2555 return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2556 def __init__(self, *args, **kwargs):
2557 """__init__(self) -> JPEGHandler"""
2558 newobj = _core_.new_JPEGHandler(*args, **kwargs)
2559 self.this = newobj.this
2560 self.thisown = 1
2561 del newobj.thisown
2562
2563 class JPEGHandlerPtr(JPEGHandler):
2564 def __init__(self, this):
2565 self.this = this
2566 if not hasattr(self,"thisown"): self.thisown = 0
2567 self.__class__ = JPEGHandler
2568 _core_.JPEGHandler_swigregister(JPEGHandlerPtr)
2569
2570 class PNMHandler(ImageHandler):
2571 def __repr__(self):
2572 return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2573 def __init__(self, *args, **kwargs):
2574 """__init__(self) -> PNMHandler"""
2575 newobj = _core_.new_PNMHandler(*args, **kwargs)
2576 self.this = newobj.this
2577 self.thisown = 1
2578 del newobj.thisown
2579
2580 class PNMHandlerPtr(PNMHandler):
2581 def __init__(self, this):
2582 self.this = this
2583 if not hasattr(self,"thisown"): self.thisown = 0
2584 self.__class__ = PNMHandler
2585 _core_.PNMHandler_swigregister(PNMHandlerPtr)
2586
2587 class XPMHandler(ImageHandler):
2588 def __repr__(self):
2589 return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2590 def __init__(self, *args, **kwargs):
2591 """__init__(self) -> XPMHandler"""
2592 newobj = _core_.new_XPMHandler(*args, **kwargs)
2593 self.this = newobj.this
2594 self.thisown = 1
2595 del newobj.thisown
2596
2597 class XPMHandlerPtr(XPMHandler):
2598 def __init__(self, this):
2599 self.this = this
2600 if not hasattr(self,"thisown"): self.thisown = 0
2601 self.__class__ = XPMHandler
2602 _core_.XPMHandler_swigregister(XPMHandlerPtr)
2603
2604 class TIFFHandler(ImageHandler):
2605 def __repr__(self):
2606 return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2607 def __init__(self, *args, **kwargs):
2608 """__init__(self) -> TIFFHandler"""
2609 newobj = _core_.new_TIFFHandler(*args, **kwargs)
2610 self.this = newobj.this
2611 self.thisown = 1
2612 del newobj.thisown
2613
2614 class TIFFHandlerPtr(TIFFHandler):
2615 def __init__(self, this):
2616 self.this = this
2617 if not hasattr(self,"thisown"): self.thisown = 0
2618 self.__class__ = TIFFHandler
2619 _core_.TIFFHandler_swigregister(TIFFHandlerPtr)
2620
2621 QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
2622 QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
2623 class Quantize(object):
2624 """Performs quantization, or colour reduction, on a wxImage."""
2625 def __init__(self): raise RuntimeError, "No constructor defined"
2626 def __repr__(self):
2627 return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2628 def Quantize(*args, **kwargs):
2629 """
2630 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2631
2632 Reduce the colours in the source image and put the result into the
2633 destination image, setting the palette in the destination if
2634 needed. Both images may be the same, to overwrite the source image.
2635 """
2636 return _core_.Quantize_Quantize(*args, **kwargs)
2637
2638 Quantize = staticmethod(Quantize)
2639
2640 class QuantizePtr(Quantize):
2641 def __init__(self, this):
2642 self.this = this
2643 if not hasattr(self,"thisown"): self.thisown = 0
2644 self.__class__ = Quantize
2645 _core_.Quantize_swigregister(QuantizePtr)
2646
2647 def Quantize_Quantize(*args, **kwargs):
2648 """
2649 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
2650
2651 Reduce the colours in the source image and put the result into the
2652 destination image, setting the palette in the destination if
2653 needed. Both images may be the same, to overwrite the source image.
2654 """
2655 return _core_.Quantize_Quantize(*args, **kwargs)
2656
2657 #---------------------------------------------------------------------------
2658
2659 class EvtHandler(Object):
2660 def __repr__(self):
2661 return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
2662 def __init__(self, *args, **kwargs):
2663 """__init__(self) -> EvtHandler"""
2664 newobj = _core_.new_EvtHandler(*args, **kwargs)
2665 self.this = newobj.this
2666 self.thisown = 1
2667 del newobj.thisown
2668 def GetNextHandler(*args, **kwargs):
2669 """GetNextHandler(self) -> EvtHandler"""
2670 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
2671
2672 def GetPreviousHandler(*args, **kwargs):
2673 """GetPreviousHandler(self) -> EvtHandler"""
2674 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
2675
2676 def SetNextHandler(*args, **kwargs):
2677 """SetNextHandler(self, EvtHandler handler)"""
2678 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
2679
2680 def SetPreviousHandler(*args, **kwargs):
2681 """SetPreviousHandler(self, EvtHandler handler)"""
2682 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
2683
2684 def GetEvtHandlerEnabled(*args, **kwargs):
2685 """GetEvtHandlerEnabled(self) -> bool"""
2686 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
2687
2688 def SetEvtHandlerEnabled(*args, **kwargs):
2689 """SetEvtHandlerEnabled(self, bool enabled)"""
2690 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
2691
2692 def ProcessEvent(*args, **kwargs):
2693 """ProcessEvent(self, Event event) -> bool"""
2694 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
2695
2696 def AddPendingEvent(*args, **kwargs):
2697 """AddPendingEvent(self, Event event)"""
2698 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
2699
2700 def ProcessPendingEvents(*args, **kwargs):
2701 """ProcessPendingEvents(self)"""
2702 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
2703
2704 def Connect(*args, **kwargs):
2705 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
2706 return _core_.EvtHandler_Connect(*args, **kwargs)
2707
2708 def Disconnect(*args, **kwargs):
2709 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
2710 return _core_.EvtHandler_Disconnect(*args, **kwargs)
2711
2712 def _setOORInfo(*args, **kwargs):
2713 """_setOORInfo(self, PyObject _self)"""
2714 return _core_.EvtHandler__setOORInfo(*args, **kwargs)
2715
2716 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2717 """
2718 Bind an event to an event handler.
2719
2720 :param event: One of the EVT_* objects that specifies the
2721 type of event to bind,
2722
2723 :param handler: A callable object to be invoked when the
2724 event is delivered to self. Pass None to
2725 disconnect an event handler.
2726
2727 :param source: Sometimes the event originates from a
2728 different window than self, but you still
2729 want to catch it in self. (For example, a
2730 button event delivered to a frame.) By
2731 passing the source of the event, the event
2732 handling system is able to differentiate
2733 between the same event type from different
2734 controls.
2735
2736 :param id: Used to spcify the event source by ID instead
2737 of instance.
2738
2739 :param id2: Used when it is desirable to bind a handler
2740 to a range of IDs, such as with EVT_MENU_RANGE.
2741 """
2742 if source is not None:
2743 id = source.GetId()
2744 event.Bind(self, id, id2, handler)
2745
2746 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
2747 """
2748 Disconencts the event handler binding for event from self.
2749 Returns True if successful.
2750 """
2751 if source is not None:
2752 id = source.GetId()
2753 return event.Unbind(self, id, id2)
2754
2755
2756 class EvtHandlerPtr(EvtHandler):
2757 def __init__(self, this):
2758 self.this = this
2759 if not hasattr(self,"thisown"): self.thisown = 0
2760 self.__class__ = EvtHandler
2761 _core_.EvtHandler_swigregister(EvtHandlerPtr)
2762
2763 #---------------------------------------------------------------------------
2764
2765 class PyEventBinder(object):
2766 """
2767 Instances of this class are used to bind specific events to event
2768 handlers.
2769 """
2770 def __init__(self, evtType, expectedIDs=0):
2771 if expectedIDs not in [0, 1, 2]:
2772 raise ValueError, "Invalid number of expectedIDs"
2773 self.expectedIDs = expectedIDs
2774
2775 if type(evtType) == list or type(evtType) == tuple:
2776 self.evtType = evtType
2777 else:
2778 self.evtType = [evtType]
2779
2780
2781 def Bind(self, target, id1, id2, function):
2782 """Bind this set of event types to target."""
2783 for et in self.evtType:
2784 target.Connect(id1, id2, et, function)
2785
2786
2787 def Unbind(self, target, id1, id2):
2788 """Remove an event binding."""
2789 success = 0
2790 for et in self.evtType:
2791 success += target.Disconnect(id1, id2, et)
2792 return success != 0
2793
2794
2795 def __call__(self, *args):
2796 """
2797 For backwards compatibility with the old EVT_* functions.
2798 Should be called with either (window, func), (window, ID,
2799 func) or (window, ID1, ID2, func) parameters depending on the
2800 type of the event.
2801 """
2802 assert len(args) == 2 + self.expectedIDs
2803 id1 = wx.ID_ANY
2804 id2 = wx.ID_ANY
2805 target = args[0]
2806 if self.expectedIDs == 0:
2807 func = args[1]
2808 elif self.expectedIDs == 1:
2809 id1 = args[1]
2810 func = args[2]
2811 elif self.expectedIDs == 2:
2812 id1 = args[1]
2813 id2 = args[2]
2814 func = args[3]
2815 else:
2816 raise ValueError, "Unexpected number of IDs"
2817
2818 self.Bind(target, id1, id2, func)
2819
2820
2821 # These two are square pegs that don't fit the PyEventBinder hole...
2822 def EVT_COMMAND(win, id, cmd, func):
2823 win.Connect(id, -1, cmd, func)
2824 def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
2825 win.Connect(id1, id2, cmd, func)
2826
2827
2828 #---------------------------------------------------------------------------
2829
2830 #---------------------------------------------------------------------------
2831
2832 EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
2833 EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
2834
2835 def NewEventType(*args, **kwargs):
2836 """NewEventType() -> wxEventType"""
2837 return _core_.NewEventType(*args, **kwargs)
2838 wxEVT_NULL = _core_.wxEVT_NULL
2839 wxEVT_FIRST = _core_.wxEVT_FIRST
2840 wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
2841 wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
2842 wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
2843 wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
2844 wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
2845 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
2846 wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
2847 wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
2848 wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
2849 wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
2850 wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
2851 wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
2852 wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
2853 wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
2854 wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
2855 wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
2856 wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
2857 wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
2858 wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
2859 wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
2860 wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
2861 wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
2862 wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
2863 wxEVT_MOTION = _core_.wxEVT_MOTION
2864 wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
2865 wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
2866 wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
2867 wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
2868 wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
2869 wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
2870 wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
2871 wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
2872 wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
2873 wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
2874 wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
2875 wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
2876 wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
2877 wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
2878 wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
2879 wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
2880 wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
2881 wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
2882 wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
2883 wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
2884 wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
2885 wxEVT_CHAR = _core_.wxEVT_CHAR
2886 wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
2887 wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
2888 wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
2889 wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
2890 wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
2891 wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
2892 wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
2893 wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
2894 wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
2895 wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
2896 wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
2897 wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
2898 wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
2899 wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
2900 wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL
2901 wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
2902 wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
2903 wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
2904 wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
2905 wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
2906 wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
2907 wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
2908 wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
2909 wxEVT_SIZE = _core_.wxEVT_SIZE
2910 wxEVT_MOVE = _core_.wxEVT_MOVE
2911 wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
2912 wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
2913 wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
2914 wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
2915 wxEVT_POWER = _core_.wxEVT_POWER
2916 wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
2917 wxEVT_CREATE = _core_.wxEVT_CREATE
2918 wxEVT_DESTROY = _core_.wxEVT_DESTROY
2919 wxEVT_SHOW = _core_.wxEVT_SHOW
2920 wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
2921 wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
2922 wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
2923 wxEVT_PAINT = _core_.wxEVT_PAINT
2924 wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
2925 wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
2926 wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
2927 wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
2928 wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
2929 wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
2930 wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
2931 wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
2932 wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
2933 wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
2934 wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
2935 wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
2936 wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
2937 wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
2938 wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
2939 wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
2940 wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
2941 wxEVT_IDLE = _core_.wxEVT_IDLE
2942 wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
2943 wxEVT_SIZING = _core_.wxEVT_SIZING
2944 wxEVT_MOVING = _core_.wxEVT_MOVING
2945 wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
2946 wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
2947 wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
2948 wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
2949 wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
2950 wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
2951 wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
2952 #
2953 # Create some event binders
2954 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
2955 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
2956 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
2957 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
2958 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
2959 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
2960 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
2961 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
2962 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
2963 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
2964 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
2965 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
2966 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
2967 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
2968 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
2969 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
2970 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
2971 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
2972 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
2973 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
2974 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
2975 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
2976 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
2977 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
2978 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
2979 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
2980 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
2981 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
2982 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
2983 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
2984 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
2985 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
2986 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
2987 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
2988 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
2989 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
2990 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
2991 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
2992 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
2993 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
2994
2995 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
2996 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
2997 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
2998 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
2999 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3000 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3001 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3002 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3003 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3004 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3005 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3006 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3007 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3008
3009 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3010 wxEVT_LEFT_UP,
3011 wxEVT_MIDDLE_DOWN,
3012 wxEVT_MIDDLE_UP,
3013 wxEVT_RIGHT_DOWN,
3014 wxEVT_RIGHT_UP,
3015 wxEVT_MOTION,
3016 wxEVT_LEFT_DCLICK,
3017 wxEVT_MIDDLE_DCLICK,
3018 wxEVT_RIGHT_DCLICK,
3019 wxEVT_ENTER_WINDOW,
3020 wxEVT_LEAVE_WINDOW,
3021 wxEVT_MOUSEWHEEL
3022 ])
3023
3024
3025 # Scrolling from wxWindow (sent to wxScrolledWindow)
3026 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3027 wxEVT_SCROLLWIN_BOTTOM,
3028 wxEVT_SCROLLWIN_LINEUP,
3029 wxEVT_SCROLLWIN_LINEDOWN,
3030 wxEVT_SCROLLWIN_PAGEUP,
3031 wxEVT_SCROLLWIN_PAGEDOWN,
3032 wxEVT_SCROLLWIN_THUMBTRACK,
3033 wxEVT_SCROLLWIN_THUMBRELEASE,
3034 ])
3035
3036 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3037 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3038 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3039 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3040 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3041 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3042 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3043 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3044
3045 # Scrolling from wxSlider and wxScrollBar
3046 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3047 wxEVT_SCROLL_BOTTOM,
3048 wxEVT_SCROLL_LINEUP,
3049 wxEVT_SCROLL_LINEDOWN,
3050 wxEVT_SCROLL_PAGEUP,
3051 wxEVT_SCROLL_PAGEDOWN,
3052 wxEVT_SCROLL_THUMBTRACK,
3053 wxEVT_SCROLL_THUMBRELEASE,
3054 wxEVT_SCROLL_ENDSCROLL,
3055 ])
3056
3057 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3058 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3059 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3060 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3061 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3062 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3063 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3064 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
3065 EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
3066
3067 # Scrolling from wxSlider and wxScrollBar, with an id
3068 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3069 wxEVT_SCROLL_BOTTOM,
3070 wxEVT_SCROLL_LINEUP,
3071 wxEVT_SCROLL_LINEDOWN,
3072 wxEVT_SCROLL_PAGEUP,
3073 wxEVT_SCROLL_PAGEDOWN,
3074 wxEVT_SCROLL_THUMBTRACK,
3075 wxEVT_SCROLL_THUMBRELEASE,
3076 wxEVT_SCROLL_ENDSCROLL,
3077 ], 1)
3078
3079 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3080 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3081 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3082 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3083 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3084 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3085 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3086 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
3087 EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
3088
3089 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3090 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3091 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3092 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3093 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3094 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3095 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3096 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3097 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3098 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3099
3100 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3101 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3102 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3103 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3104 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3105 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3106 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3107 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3108 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3109
3110
3111 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3112 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3113 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3114 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3115 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3116 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3117 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3118
3119 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3120
3121 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3122 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3123
3124 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3125
3126
3127
3128 #---------------------------------------------------------------------------
3129
3130 class Event(Object):
3131 def __init__(self): raise RuntimeError, "No constructor defined"
3132 def __repr__(self):
3133 return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3134 def __del__(self, destroy=_core_.delete_Event):
3135 """__del__(self)"""
3136 try:
3137 if self.thisown: destroy(self)
3138 except: pass
3139
3140 def SetEventType(*args, **kwargs):
3141 """SetEventType(self, wxEventType typ)"""
3142 return _core_.Event_SetEventType(*args, **kwargs)
3143
3144 def GetEventType(*args, **kwargs):
3145 """GetEventType(self) -> wxEventType"""
3146 return _core_.Event_GetEventType(*args, **kwargs)
3147
3148 def GetEventObject(*args, **kwargs):
3149 """GetEventObject(self) -> Object"""
3150 return _core_.Event_GetEventObject(*args, **kwargs)
3151
3152 def SetEventObject(*args, **kwargs):
3153 """SetEventObject(self, Object obj)"""
3154 return _core_.Event_SetEventObject(*args, **kwargs)
3155
3156 def GetTimestamp(*args, **kwargs):
3157 """GetTimestamp(self) -> long"""
3158 return _core_.Event_GetTimestamp(*args, **kwargs)
3159
3160 def SetTimestamp(*args, **kwargs):
3161 """SetTimestamp(self, long ts=0)"""
3162 return _core_.Event_SetTimestamp(*args, **kwargs)
3163
3164 def GetId(*args, **kwargs):
3165 """GetId(self) -> int"""
3166 return _core_.Event_GetId(*args, **kwargs)
3167
3168 def SetId(*args, **kwargs):
3169 """SetId(self, int Id)"""
3170 return _core_.Event_SetId(*args, **kwargs)
3171
3172 def IsCommandEvent(*args, **kwargs):
3173 """IsCommandEvent(self) -> bool"""
3174 return _core_.Event_IsCommandEvent(*args, **kwargs)
3175
3176 def Skip(*args, **kwargs):
3177 """Skip(self, bool skip=True)"""
3178 return _core_.Event_Skip(*args, **kwargs)
3179
3180 def GetSkipped(*args, **kwargs):
3181 """GetSkipped(self) -> bool"""
3182 return _core_.Event_GetSkipped(*args, **kwargs)
3183
3184 def ShouldPropagate(*args, **kwargs):
3185 """ShouldPropagate(self) -> bool"""
3186 return _core_.Event_ShouldPropagate(*args, **kwargs)
3187
3188 def StopPropagation(*args, **kwargs):
3189 """StopPropagation(self) -> int"""
3190 return _core_.Event_StopPropagation(*args, **kwargs)
3191
3192 def ResumePropagation(*args, **kwargs):
3193 """ResumePropagation(self, int propagationLevel)"""
3194 return _core_.Event_ResumePropagation(*args, **kwargs)
3195
3196 def Clone(*args, **kwargs):
3197 """Clone(self) -> Event"""
3198 return _core_.Event_Clone(*args, **kwargs)
3199
3200
3201 class EventPtr(Event):
3202 def __init__(self, this):
3203 self.this = this
3204 if not hasattr(self,"thisown"): self.thisown = 0
3205 self.__class__ = Event
3206 _core_.Event_swigregister(EventPtr)
3207
3208 #---------------------------------------------------------------------------
3209
3210 class PropagationDisabler(object):
3211 def __repr__(self):
3212 return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3213 def __init__(self, *args, **kwargs):
3214 """__init__(self, Event event) -> PropagationDisabler"""
3215 newobj = _core_.new_PropagationDisabler(*args, **kwargs)
3216 self.this = newobj.this
3217 self.thisown = 1
3218 del newobj.thisown
3219 def __del__(self, destroy=_core_.delete_PropagationDisabler):
3220 """__del__(self)"""
3221 try:
3222 if self.thisown: destroy(self)
3223 except: pass
3224
3225
3226 class PropagationDisablerPtr(PropagationDisabler):
3227 def __init__(self, this):
3228 self.this = this
3229 if not hasattr(self,"thisown"): self.thisown = 0
3230 self.__class__ = PropagationDisabler
3231 _core_.PropagationDisabler_swigregister(PropagationDisablerPtr)
3232
3233 class PropagateOnce(object):
3234 def __repr__(self):
3235 return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3236 def __init__(self, *args, **kwargs):
3237 """__init__(self, Event event) -> PropagateOnce"""
3238 newobj = _core_.new_PropagateOnce(*args, **kwargs)
3239 self.this = newobj.this
3240 self.thisown = 1
3241 del newobj.thisown
3242 def __del__(self, destroy=_core_.delete_PropagateOnce):
3243 """__del__(self)"""
3244 try:
3245 if self.thisown: destroy(self)
3246 except: pass
3247
3248
3249 class PropagateOncePtr(PropagateOnce):
3250 def __init__(self, this):
3251 self.this = this
3252 if not hasattr(self,"thisown"): self.thisown = 0
3253 self.__class__ = PropagateOnce
3254 _core_.PropagateOnce_swigregister(PropagateOncePtr)
3255
3256 #---------------------------------------------------------------------------
3257
3258 class CommandEvent(Event):
3259 def __repr__(self):
3260 return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3261 def __init__(self, *args, **kwargs):
3262 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent"""
3263 newobj = _core_.new_CommandEvent(*args, **kwargs)
3264 self.this = newobj.this
3265 self.thisown = 1
3266 del newobj.thisown
3267 def GetSelection(*args, **kwargs):
3268 """GetSelection(self) -> int"""
3269 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3270
3271 def SetString(*args, **kwargs):
3272 """SetString(self, String s)"""
3273 return _core_.CommandEvent_SetString(*args, **kwargs)
3274
3275 def GetString(*args, **kwargs):
3276 """GetString(self) -> String"""
3277 return _core_.CommandEvent_GetString(*args, **kwargs)
3278
3279 def IsChecked(*args, **kwargs):
3280 """IsChecked(self) -> bool"""
3281 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3282
3283 Checked = IsChecked
3284 def IsSelection(*args, **kwargs):
3285 """IsSelection(self) -> bool"""
3286 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3287
3288 def SetExtraLong(*args, **kwargs):
3289 """SetExtraLong(self, long extraLong)"""
3290 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3291
3292 def GetExtraLong(*args, **kwargs):
3293 """GetExtraLong(self) -> long"""
3294 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3295
3296 def SetInt(*args, **kwargs):
3297 """SetInt(self, int i)"""
3298 return _core_.CommandEvent_SetInt(*args, **kwargs)
3299
3300 def GetInt(*args, **kwargs):
3301 """GetInt(self) -> long"""
3302 return _core_.CommandEvent_GetInt(*args, **kwargs)
3303
3304 def Clone(*args, **kwargs):
3305 """Clone(self) -> Event"""
3306 return _core_.CommandEvent_Clone(*args, **kwargs)
3307
3308
3309 class CommandEventPtr(CommandEvent):
3310 def __init__(self, this):
3311 self.this = this
3312 if not hasattr(self,"thisown"): self.thisown = 0
3313 self.__class__ = CommandEvent
3314 _core_.CommandEvent_swigregister(CommandEventPtr)
3315
3316 #---------------------------------------------------------------------------
3317
3318 class NotifyEvent(CommandEvent):
3319 def __repr__(self):
3320 return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3321 def __init__(self, *args, **kwargs):
3322 """__init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent"""
3323 newobj = _core_.new_NotifyEvent(*args, **kwargs)
3324 self.this = newobj.this
3325 self.thisown = 1
3326 del newobj.thisown
3327 def Veto(*args, **kwargs):
3328 """Veto(self)"""
3329 return _core_.NotifyEvent_Veto(*args, **kwargs)
3330
3331 def Allow(*args, **kwargs):
3332 """Allow(self)"""
3333 return _core_.NotifyEvent_Allow(*args, **kwargs)
3334
3335 def IsAllowed(*args, **kwargs):
3336 """IsAllowed(self) -> bool"""
3337 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
3338
3339
3340 class NotifyEventPtr(NotifyEvent):
3341 def __init__(self, this):
3342 self.this = this
3343 if not hasattr(self,"thisown"): self.thisown = 0
3344 self.__class__ = NotifyEvent
3345 _core_.NotifyEvent_swigregister(NotifyEventPtr)
3346
3347 #---------------------------------------------------------------------------
3348
3349 class ScrollEvent(CommandEvent):
3350 def __repr__(self):
3351 return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3352 def __init__(self, *args, **kwargs):
3353 """
3354 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
3355 int orient=0) -> ScrollEvent
3356 """
3357 newobj = _core_.new_ScrollEvent(*args, **kwargs)
3358 self.this = newobj.this
3359 self.thisown = 1
3360 del newobj.thisown
3361 def GetOrientation(*args, **kwargs):
3362 """GetOrientation(self) -> int"""
3363 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
3364
3365 def GetPosition(*args, **kwargs):
3366 """GetPosition(self) -> int"""
3367 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
3368
3369 def SetOrientation(*args, **kwargs):
3370 """SetOrientation(self, int orient)"""
3371 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
3372
3373 def SetPosition(*args, **kwargs):
3374 """SetPosition(self, int pos)"""
3375 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
3376
3377
3378 class ScrollEventPtr(ScrollEvent):
3379 def __init__(self, this):
3380 self.this = this
3381 if not hasattr(self,"thisown"): self.thisown = 0
3382 self.__class__ = ScrollEvent
3383 _core_.ScrollEvent_swigregister(ScrollEventPtr)
3384
3385 #---------------------------------------------------------------------------
3386
3387 class ScrollWinEvent(Event):
3388 def __repr__(self):
3389 return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3390 def __init__(self, *args, **kwargs):
3391 """__init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent"""
3392 newobj = _core_.new_ScrollWinEvent(*args, **kwargs)
3393 self.this = newobj.this
3394 self.thisown = 1
3395 del newobj.thisown
3396 def GetOrientation(*args, **kwargs):
3397 """GetOrientation(self) -> int"""
3398 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
3399
3400 def GetPosition(*args, **kwargs):
3401 """GetPosition(self) -> int"""
3402 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
3403
3404 def SetOrientation(*args, **kwargs):
3405 """SetOrientation(self, int orient)"""
3406 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
3407
3408 def SetPosition(*args, **kwargs):
3409 """SetPosition(self, int pos)"""
3410 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
3411
3412
3413 class ScrollWinEventPtr(ScrollWinEvent):
3414 def __init__(self, this):
3415 self.this = this
3416 if not hasattr(self,"thisown"): self.thisown = 0
3417 self.__class__ = ScrollWinEvent
3418 _core_.ScrollWinEvent_swigregister(ScrollWinEventPtr)
3419
3420 #---------------------------------------------------------------------------
3421
3422 MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
3423 MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
3424 MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
3425 MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
3426 MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
3427 class MouseEvent(Event):
3428 def __repr__(self):
3429 return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3430 def __init__(self, *args, **kwargs):
3431 """__init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent"""
3432 newobj = _core_.new_MouseEvent(*args, **kwargs)
3433 self.this = newobj.this
3434 self.thisown = 1
3435 del newobj.thisown
3436 def IsButton(*args, **kwargs):
3437 """IsButton(self) -> bool"""
3438 return _core_.MouseEvent_IsButton(*args, **kwargs)
3439
3440 def ButtonDown(*args, **kwargs):
3441 """ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool"""
3442 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
3443
3444 def ButtonDClick(*args, **kwargs):
3445 """ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool"""
3446 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
3447
3448 def ButtonUp(*args, **kwargs):
3449 """ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool"""
3450 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
3451
3452 def Button(*args, **kwargs):
3453 """Button(self, int but) -> bool"""
3454 return _core_.MouseEvent_Button(*args, **kwargs)
3455
3456 def ButtonIsDown(*args, **kwargs):
3457 """ButtonIsDown(self, int but) -> bool"""
3458 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
3459
3460 def GetButton(*args, **kwargs):
3461 """GetButton(self) -> int"""
3462 return _core_.MouseEvent_GetButton(*args, **kwargs)
3463
3464 def ControlDown(*args, **kwargs):
3465 """ControlDown(self) -> bool"""
3466 return _core_.MouseEvent_ControlDown(*args, **kwargs)
3467
3468 def MetaDown(*args, **kwargs):
3469 """MetaDown(self) -> bool"""
3470 return _core_.MouseEvent_MetaDown(*args, **kwargs)
3471
3472 def AltDown(*args, **kwargs):
3473 """AltDown(self) -> bool"""
3474 return _core_.MouseEvent_AltDown(*args, **kwargs)
3475
3476 def ShiftDown(*args, **kwargs):
3477 """ShiftDown(self) -> bool"""
3478 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
3479
3480 def CmdDown(*args, **kwargs):
3481 """
3482 CmdDown(self) -> bool
3483
3484 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3485 platforms but the special "Apple" (a.k.a as "Command") key on
3486 Macs: it makes often sense to use it instead of, say, `ControlDown`
3487 because Cmd key is used for the same thing under Mac as Ctrl
3488 elsewhere. The Ctrl still exists, it's just not used for this
3489 purpose. So for non-Mac platforms this is the same as `ControlDown`
3490 and Macs this is the same as `MetaDown`.
3491 """
3492 return _core_.MouseEvent_CmdDown(*args, **kwargs)
3493
3494 def LeftDown(*args, **kwargs):
3495 """LeftDown(self) -> bool"""
3496 return _core_.MouseEvent_LeftDown(*args, **kwargs)
3497
3498 def MiddleDown(*args, **kwargs):
3499 """MiddleDown(self) -> bool"""
3500 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
3501
3502 def RightDown(*args, **kwargs):
3503 """RightDown(self) -> bool"""
3504 return _core_.MouseEvent_RightDown(*args, **kwargs)
3505
3506 def LeftUp(*args, **kwargs):
3507 """LeftUp(self) -> bool"""
3508 return _core_.MouseEvent_LeftUp(*args, **kwargs)
3509
3510 def MiddleUp(*args, **kwargs):
3511 """MiddleUp(self) -> bool"""
3512 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
3513
3514 def RightUp(*args, **kwargs):
3515 """RightUp(self) -> bool"""
3516 return _core_.MouseEvent_RightUp(*args, **kwargs)
3517
3518 def LeftDClick(*args, **kwargs):
3519 """LeftDClick(self) -> bool"""
3520 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
3521
3522 def MiddleDClick(*args, **kwargs):
3523 """MiddleDClick(self) -> bool"""
3524 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
3525
3526 def RightDClick(*args, **kwargs):
3527 """RightDClick(self) -> bool"""
3528 return _core_.MouseEvent_RightDClick(*args, **kwargs)
3529
3530 def LeftIsDown(*args, **kwargs):
3531 """LeftIsDown(self) -> bool"""
3532 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
3533
3534 def MiddleIsDown(*args, **kwargs):
3535 """MiddleIsDown(self) -> bool"""
3536 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
3537
3538 def RightIsDown(*args, **kwargs):
3539 """RightIsDown(self) -> bool"""
3540 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
3541
3542 def Dragging(*args, **kwargs):
3543 """Dragging(self) -> bool"""
3544 return _core_.MouseEvent_Dragging(*args, **kwargs)
3545
3546 def Moving(*args, **kwargs):
3547 """Moving(self) -> bool"""
3548 return _core_.MouseEvent_Moving(*args, **kwargs)
3549
3550 def Entering(*args, **kwargs):
3551 """Entering(self) -> bool"""
3552 return _core_.MouseEvent_Entering(*args, **kwargs)
3553
3554 def Leaving(*args, **kwargs):
3555 """Leaving(self) -> bool"""
3556 return _core_.MouseEvent_Leaving(*args, **kwargs)
3557
3558 def GetPosition(*args, **kwargs):
3559 """
3560 GetPosition(self) -> Point
3561
3562 Returns the position of the mouse in window coordinates when the event
3563 happened.
3564 """
3565 return _core_.MouseEvent_GetPosition(*args, **kwargs)
3566
3567 def GetPositionTuple(*args, **kwargs):
3568 """
3569 GetPositionTuple() -> (x,y)
3570
3571 Returns the position of the mouse in window coordinates when the event
3572 happened.
3573 """
3574 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
3575
3576 def GetLogicalPosition(*args, **kwargs):
3577 """GetLogicalPosition(self, DC dc) -> Point"""
3578 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
3579
3580 def GetX(*args, **kwargs):
3581 """GetX(self) -> int"""
3582 return _core_.MouseEvent_GetX(*args, **kwargs)
3583
3584 def GetY(*args, **kwargs):
3585 """GetY(self) -> int"""
3586 return _core_.MouseEvent_GetY(*args, **kwargs)
3587
3588 def GetWheelRotation(*args, **kwargs):
3589 """GetWheelRotation(self) -> int"""
3590 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
3591
3592 def GetWheelDelta(*args, **kwargs):
3593 """GetWheelDelta(self) -> int"""
3594 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
3595
3596 def GetLinesPerAction(*args, **kwargs):
3597 """GetLinesPerAction(self) -> int"""
3598 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
3599
3600 def IsPageScroll(*args, **kwargs):
3601 """IsPageScroll(self) -> bool"""
3602 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
3603
3604 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
3605 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
3606 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
3607 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
3608 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
3609 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
3610 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
3611 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
3612 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
3613 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
3614 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
3615 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
3616
3617 class MouseEventPtr(MouseEvent):
3618 def __init__(self, this):
3619 self.this = this
3620 if not hasattr(self,"thisown"): self.thisown = 0
3621 self.__class__ = MouseEvent
3622 _core_.MouseEvent_swigregister(MouseEventPtr)
3623
3624 #---------------------------------------------------------------------------
3625
3626 class SetCursorEvent(Event):
3627 def __repr__(self):
3628 return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3629 def __init__(self, *args, **kwargs):
3630 """__init__(self, int x=0, int y=0) -> SetCursorEvent"""
3631 newobj = _core_.new_SetCursorEvent(*args, **kwargs)
3632 self.this = newobj.this
3633 self.thisown = 1
3634 del newobj.thisown
3635 def GetX(*args, **kwargs):
3636 """GetX(self) -> int"""
3637 return _core_.SetCursorEvent_GetX(*args, **kwargs)
3638
3639 def GetY(*args, **kwargs):
3640 """GetY(self) -> int"""
3641 return _core_.SetCursorEvent_GetY(*args, **kwargs)
3642
3643 def SetCursor(*args, **kwargs):
3644 """SetCursor(self, Cursor cursor)"""
3645 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
3646
3647 def GetCursor(*args, **kwargs):
3648 """GetCursor(self) -> Cursor"""
3649 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
3650
3651 def HasCursor(*args, **kwargs):
3652 """HasCursor(self) -> bool"""
3653 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
3654
3655
3656 class SetCursorEventPtr(SetCursorEvent):
3657 def __init__(self, this):
3658 self.this = this
3659 if not hasattr(self,"thisown"): self.thisown = 0
3660 self.__class__ = SetCursorEvent
3661 _core_.SetCursorEvent_swigregister(SetCursorEventPtr)
3662
3663 #---------------------------------------------------------------------------
3664
3665 class KeyEvent(Event):
3666 def __repr__(self):
3667 return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3668 def __init__(self, *args, **kwargs):
3669 """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent"""
3670 newobj = _core_.new_KeyEvent(*args, **kwargs)
3671 self.this = newobj.this
3672 self.thisown = 1
3673 del newobj.thisown
3674 def ControlDown(*args, **kwargs):
3675 """ControlDown(self) -> bool"""
3676 return _core_.KeyEvent_ControlDown(*args, **kwargs)
3677
3678 def MetaDown(*args, **kwargs):
3679 """MetaDown(self) -> bool"""
3680 return _core_.KeyEvent_MetaDown(*args, **kwargs)
3681
3682 def AltDown(*args, **kwargs):
3683 """AltDown(self) -> bool"""
3684 return _core_.KeyEvent_AltDown(*args, **kwargs)
3685
3686 def ShiftDown(*args, **kwargs):
3687 """ShiftDown(self) -> bool"""
3688 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
3689
3690 def CmdDown(*args, **kwargs):
3691 """
3692 CmdDown(self) -> bool
3693
3694 "Cmd" is a pseudo key which is the same as Control for PC and Unix
3695 platforms but the special "Apple" (a.k.a as "Command") key on
3696 Macs: it makes often sense to use it instead of, say, `ControlDown`
3697 because Cmd key is used for the same thing under Mac as Ctrl
3698 elsewhere. The Ctrl still exists, it's just not used for this
3699 purpose. So for non-Mac platforms this is the same as `ControlDown`
3700 and Macs this is the same as `MetaDown`.
3701 """
3702 return _core_.KeyEvent_CmdDown(*args, **kwargs)
3703
3704 def HasModifiers(*args, **kwargs):
3705 """HasModifiers(self) -> bool"""
3706 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
3707
3708 def GetKeyCode(*args, **kwargs):
3709 """GetKeyCode(self) -> int"""
3710 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
3711
3712 KeyCode = GetKeyCode
3713 def GetUnicodeKey(*args, **kwargs):
3714 """GetUnicodeKey(self) -> int"""
3715 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
3716
3717 GetUniChar = GetUnicodeKey
3718 def GetRawKeyCode(*args, **kwargs):
3719 """GetRawKeyCode(self) -> unsigned int"""
3720 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
3721
3722 def GetRawKeyFlags(*args, **kwargs):
3723 """GetRawKeyFlags(self) -> unsigned int"""
3724 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
3725
3726 def GetPosition(*args, **kwargs):
3727 """
3728 GetPosition(self) -> Point
3729
3730 Find the position of the event.
3731 """
3732 return _core_.KeyEvent_GetPosition(*args, **kwargs)
3733
3734 def GetPositionTuple(*args, **kwargs):
3735 """
3736 GetPositionTuple() -> (x,y)
3737
3738 Find the position of the event.
3739 """
3740 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
3741
3742 def GetX(*args, **kwargs):
3743 """GetX(self) -> int"""
3744 return _core_.KeyEvent_GetX(*args, **kwargs)
3745
3746 def GetY(*args, **kwargs):
3747 """GetY(self) -> int"""
3748 return _core_.KeyEvent_GetY(*args, **kwargs)
3749
3750 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
3751 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
3752 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
3753 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
3754 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
3755 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
3756 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
3757 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
3758 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
3759 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
3760
3761 class KeyEventPtr(KeyEvent):
3762 def __init__(self, this):
3763 self.this = this
3764 if not hasattr(self,"thisown"): self.thisown = 0
3765 self.__class__ = KeyEvent
3766 _core_.KeyEvent_swigregister(KeyEventPtr)
3767
3768 #---------------------------------------------------------------------------
3769
3770 class SizeEvent(Event):
3771 def __repr__(self):
3772 return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3773 def __init__(self, *args, **kwargs):
3774 """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent"""
3775 newobj = _core_.new_SizeEvent(*args, **kwargs)
3776 self.this = newobj.this
3777 self.thisown = 1
3778 del newobj.thisown
3779 def GetSize(*args, **kwargs):
3780 """GetSize(self) -> Size"""
3781 return _core_.SizeEvent_GetSize(*args, **kwargs)
3782
3783 def GetRect(*args, **kwargs):
3784 """GetRect(self) -> Rect"""
3785 return _core_.SizeEvent_GetRect(*args, **kwargs)
3786
3787 def SetRect(*args, **kwargs):
3788 """SetRect(self, Rect rect)"""
3789 return _core_.SizeEvent_SetRect(*args, **kwargs)
3790
3791 def SetSize(*args, **kwargs):
3792 """SetSize(self, Size size)"""
3793 return _core_.SizeEvent_SetSize(*args, **kwargs)
3794
3795 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
3796 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
3797
3798 class SizeEventPtr(SizeEvent):
3799 def __init__(self, this):
3800 self.this = this
3801 if not hasattr(self,"thisown"): self.thisown = 0
3802 self.__class__ = SizeEvent
3803 _core_.SizeEvent_swigregister(SizeEventPtr)
3804
3805 #---------------------------------------------------------------------------
3806
3807 class MoveEvent(Event):
3808 def __repr__(self):
3809 return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3810 def __init__(self, *args, **kwargs):
3811 """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent"""
3812 newobj = _core_.new_MoveEvent(*args, **kwargs)
3813 self.this = newobj.this
3814 self.thisown = 1
3815 del newobj.thisown
3816 def GetPosition(*args, **kwargs):
3817 """GetPosition(self) -> Point"""
3818 return _core_.MoveEvent_GetPosition(*args, **kwargs)
3819
3820 def GetRect(*args, **kwargs):
3821 """GetRect(self) -> Rect"""
3822 return _core_.MoveEvent_GetRect(*args, **kwargs)
3823
3824 def SetRect(*args, **kwargs):
3825 """SetRect(self, Rect rect)"""
3826 return _core_.MoveEvent_SetRect(*args, **kwargs)
3827
3828 def SetPosition(*args, **kwargs):
3829 """SetPosition(self, Point pos)"""
3830 return _core_.MoveEvent_SetPosition(*args, **kwargs)
3831
3832 m_pos = property(_core_.MoveEvent_m_pos_get, _core_.MoveEvent_m_pos_set)
3833 m_rect = property(_core_.MoveEvent_m_rect_get, _core_.MoveEvent_m_rect_set)
3834
3835 class MoveEventPtr(MoveEvent):
3836 def __init__(self, this):
3837 self.this = this
3838 if not hasattr(self,"thisown"): self.thisown = 0
3839 self.__class__ = MoveEvent
3840 _core_.MoveEvent_swigregister(MoveEventPtr)
3841
3842 #---------------------------------------------------------------------------
3843
3844 class PaintEvent(Event):
3845 def __repr__(self):
3846 return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3847 def __init__(self, *args, **kwargs):
3848 """__init__(self, int Id=0) -> PaintEvent"""
3849 newobj = _core_.new_PaintEvent(*args, **kwargs)
3850 self.this = newobj.this
3851 self.thisown = 1
3852 del newobj.thisown
3853
3854 class PaintEventPtr(PaintEvent):
3855 def __init__(self, this):
3856 self.this = this
3857 if not hasattr(self,"thisown"): self.thisown = 0
3858 self.__class__ = PaintEvent
3859 _core_.PaintEvent_swigregister(PaintEventPtr)
3860
3861 class NcPaintEvent(Event):
3862 def __repr__(self):
3863 return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3864 def __init__(self, *args, **kwargs):
3865 """__init__(self, int winid=0) -> NcPaintEvent"""
3866 newobj = _core_.new_NcPaintEvent(*args, **kwargs)
3867 self.this = newobj.this
3868 self.thisown = 1
3869 del newobj.thisown
3870
3871 class NcPaintEventPtr(NcPaintEvent):
3872 def __init__(self, this):
3873 self.this = this
3874 if not hasattr(self,"thisown"): self.thisown = 0
3875 self.__class__ = NcPaintEvent
3876 _core_.NcPaintEvent_swigregister(NcPaintEventPtr)
3877
3878 #---------------------------------------------------------------------------
3879
3880 class EraseEvent(Event):
3881 def __repr__(self):
3882 return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3883 def __init__(self, *args, **kwargs):
3884 """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent"""
3885 newobj = _core_.new_EraseEvent(*args, **kwargs)
3886 self.this = newobj.this
3887 self.thisown = 1
3888 del newobj.thisown
3889 def GetDC(*args, **kwargs):
3890 """GetDC(self) -> DC"""
3891 return _core_.EraseEvent_GetDC(*args, **kwargs)
3892
3893
3894 class EraseEventPtr(EraseEvent):
3895 def __init__(self, this):
3896 self.this = this
3897 if not hasattr(self,"thisown"): self.thisown = 0
3898 self.__class__ = EraseEvent
3899 _core_.EraseEvent_swigregister(EraseEventPtr)
3900
3901 #---------------------------------------------------------------------------
3902
3903 class FocusEvent(Event):
3904 def __repr__(self):
3905 return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3906 def __init__(self, *args, **kwargs):
3907 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent"""
3908 newobj = _core_.new_FocusEvent(*args, **kwargs)
3909 self.this = newobj.this
3910 self.thisown = 1
3911 del newobj.thisown
3912 def GetWindow(*args, **kwargs):
3913 """GetWindow(self) -> Window"""
3914 return _core_.FocusEvent_GetWindow(*args, **kwargs)
3915
3916 def SetWindow(*args, **kwargs):
3917 """SetWindow(self, Window win)"""
3918 return _core_.FocusEvent_SetWindow(*args, **kwargs)
3919
3920
3921 class FocusEventPtr(FocusEvent):
3922 def __init__(self, this):
3923 self.this = this
3924 if not hasattr(self,"thisown"): self.thisown = 0
3925 self.__class__ = FocusEvent
3926 _core_.FocusEvent_swigregister(FocusEventPtr)
3927
3928 #---------------------------------------------------------------------------
3929
3930 class ChildFocusEvent(CommandEvent):
3931 def __repr__(self):
3932 return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3933 def __init__(self, *args, **kwargs):
3934 """__init__(self, Window win=None) -> ChildFocusEvent"""
3935 newobj = _core_.new_ChildFocusEvent(*args, **kwargs)
3936 self.this = newobj.this
3937 self.thisown = 1
3938 del newobj.thisown
3939 def GetWindow(*args, **kwargs):
3940 """GetWindow(self) -> Window"""
3941 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
3942
3943
3944 class ChildFocusEventPtr(ChildFocusEvent):
3945 def __init__(self, this):
3946 self.this = this
3947 if not hasattr(self,"thisown"): self.thisown = 0
3948 self.__class__ = ChildFocusEvent
3949 _core_.ChildFocusEvent_swigregister(ChildFocusEventPtr)
3950
3951 #---------------------------------------------------------------------------
3952
3953 class ActivateEvent(Event):
3954 def __repr__(self):
3955 return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3956 def __init__(self, *args, **kwargs):
3957 """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent"""
3958 newobj = _core_.new_ActivateEvent(*args, **kwargs)
3959 self.this = newobj.this
3960 self.thisown = 1
3961 del newobj.thisown
3962 def GetActive(*args, **kwargs):
3963 """GetActive(self) -> bool"""
3964 return _core_.ActivateEvent_GetActive(*args, **kwargs)
3965
3966
3967 class ActivateEventPtr(ActivateEvent):
3968 def __init__(self, this):
3969 self.this = this
3970 if not hasattr(self,"thisown"): self.thisown = 0
3971 self.__class__ = ActivateEvent
3972 _core_.ActivateEvent_swigregister(ActivateEventPtr)
3973
3974 #---------------------------------------------------------------------------
3975
3976 class InitDialogEvent(Event):
3977 def __repr__(self):
3978 return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3979 def __init__(self, *args, **kwargs):
3980 """__init__(self, int Id=0) -> InitDialogEvent"""
3981 newobj = _core_.new_InitDialogEvent(*args, **kwargs)
3982 self.this = newobj.this
3983 self.thisown = 1
3984 del newobj.thisown
3985
3986 class InitDialogEventPtr(InitDialogEvent):
3987 def __init__(self, this):
3988 self.this = this
3989 if not hasattr(self,"thisown"): self.thisown = 0
3990 self.__class__ = InitDialogEvent
3991 _core_.InitDialogEvent_swigregister(InitDialogEventPtr)
3992
3993 #---------------------------------------------------------------------------
3994
3995 class MenuEvent(Event):
3996 def __repr__(self):
3997 return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
3998 def __init__(self, *args, **kwargs):
3999 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent"""
4000 newobj = _core_.new_MenuEvent(*args, **kwargs)
4001 self.this = newobj.this
4002 self.thisown = 1
4003 del newobj.thisown
4004 def GetMenuId(*args, **kwargs):
4005 """GetMenuId(self) -> int"""
4006 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
4007
4008 def IsPopup(*args, **kwargs):
4009 """IsPopup(self) -> bool"""
4010 return _core_.MenuEvent_IsPopup(*args, **kwargs)
4011
4012 def GetMenu(*args, **kwargs):
4013 """GetMenu(self) -> Menu"""
4014 return _core_.MenuEvent_GetMenu(*args, **kwargs)
4015
4016
4017 class MenuEventPtr(MenuEvent):
4018 def __init__(self, this):
4019 self.this = this
4020 if not hasattr(self,"thisown"): self.thisown = 0
4021 self.__class__ = MenuEvent
4022 _core_.MenuEvent_swigregister(MenuEventPtr)
4023
4024 #---------------------------------------------------------------------------
4025
4026 class CloseEvent(Event):
4027 def __repr__(self):
4028 return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4029 def __init__(self, *args, **kwargs):
4030 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent"""
4031 newobj = _core_.new_CloseEvent(*args, **kwargs)
4032 self.this = newobj.this
4033 self.thisown = 1
4034 del newobj.thisown
4035 def SetLoggingOff(*args, **kwargs):
4036 """SetLoggingOff(self, bool logOff)"""
4037 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
4038
4039 def GetLoggingOff(*args, **kwargs):
4040 """GetLoggingOff(self) -> bool"""
4041 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
4042
4043 def Veto(*args, **kwargs):
4044 """Veto(self, bool veto=True)"""
4045 return _core_.CloseEvent_Veto(*args, **kwargs)
4046
4047 def SetCanVeto(*args, **kwargs):
4048 """SetCanVeto(self, bool canVeto)"""
4049 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
4050
4051 def CanVeto(*args, **kwargs):
4052 """CanVeto(self) -> bool"""
4053 return _core_.CloseEvent_CanVeto(*args, **kwargs)
4054
4055 def GetVeto(*args, **kwargs):
4056 """GetVeto(self) -> bool"""
4057 return _core_.CloseEvent_GetVeto(*args, **kwargs)
4058
4059
4060 class CloseEventPtr(CloseEvent):
4061 def __init__(self, this):
4062 self.this = this
4063 if not hasattr(self,"thisown"): self.thisown = 0
4064 self.__class__ = CloseEvent
4065 _core_.CloseEvent_swigregister(CloseEventPtr)
4066
4067 #---------------------------------------------------------------------------
4068
4069 class ShowEvent(Event):
4070 def __repr__(self):
4071 return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4072 def __init__(self, *args, **kwargs):
4073 """__init__(self, int winid=0, bool show=False) -> ShowEvent"""
4074 newobj = _core_.new_ShowEvent(*args, **kwargs)
4075 self.this = newobj.this
4076 self.thisown = 1
4077 del newobj.thisown
4078 def SetShow(*args, **kwargs):
4079 """SetShow(self, bool show)"""
4080 return _core_.ShowEvent_SetShow(*args, **kwargs)
4081
4082 def GetShow(*args, **kwargs):
4083 """GetShow(self) -> bool"""
4084 return _core_.ShowEvent_GetShow(*args, **kwargs)
4085
4086
4087 class ShowEventPtr(ShowEvent):
4088 def __init__(self, this):
4089 self.this = this
4090 if not hasattr(self,"thisown"): self.thisown = 0
4091 self.__class__ = ShowEvent
4092 _core_.ShowEvent_swigregister(ShowEventPtr)
4093
4094 #---------------------------------------------------------------------------
4095
4096 class IconizeEvent(Event):
4097 def __repr__(self):
4098 return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4099 def __init__(self, *args, **kwargs):
4100 """__init__(self, int id=0, bool iconized=True) -> IconizeEvent"""
4101 newobj = _core_.new_IconizeEvent(*args, **kwargs)
4102 self.this = newobj.this
4103 self.thisown = 1
4104 del newobj.thisown
4105 def Iconized(*args, **kwargs):
4106 """Iconized(self) -> bool"""
4107 return _core_.IconizeEvent_Iconized(*args, **kwargs)
4108
4109
4110 class IconizeEventPtr(IconizeEvent):
4111 def __init__(self, this):
4112 self.this = this
4113 if not hasattr(self,"thisown"): self.thisown = 0
4114 self.__class__ = IconizeEvent
4115 _core_.IconizeEvent_swigregister(IconizeEventPtr)
4116
4117 #---------------------------------------------------------------------------
4118
4119 class MaximizeEvent(Event):
4120 def __repr__(self):
4121 return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4122 def __init__(self, *args, **kwargs):
4123 """__init__(self, int id=0) -> MaximizeEvent"""
4124 newobj = _core_.new_MaximizeEvent(*args, **kwargs)
4125 self.this = newobj.this
4126 self.thisown = 1
4127 del newobj.thisown
4128
4129 class MaximizeEventPtr(MaximizeEvent):
4130 def __init__(self, this):
4131 self.this = this
4132 if not hasattr(self,"thisown"): self.thisown = 0
4133 self.__class__ = MaximizeEvent
4134 _core_.MaximizeEvent_swigregister(MaximizeEventPtr)
4135
4136 #---------------------------------------------------------------------------
4137
4138 class DropFilesEvent(Event):
4139 def __init__(self): raise RuntimeError, "No constructor defined"
4140 def __repr__(self):
4141 return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4142 def GetPosition(*args, **kwargs):
4143 """GetPosition(self) -> Point"""
4144 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
4145
4146 def GetNumberOfFiles(*args, **kwargs):
4147 """GetNumberOfFiles(self) -> int"""
4148 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
4149
4150 def GetFiles(*args, **kwargs):
4151 """GetFiles(self) -> PyObject"""
4152 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
4153
4154
4155 class DropFilesEventPtr(DropFilesEvent):
4156 def __init__(self, this):
4157 self.this = this
4158 if not hasattr(self,"thisown"): self.thisown = 0
4159 self.__class__ = DropFilesEvent
4160 _core_.DropFilesEvent_swigregister(DropFilesEventPtr)
4161
4162 #---------------------------------------------------------------------------
4163
4164 UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
4165 UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
4166 class UpdateUIEvent(CommandEvent):
4167 def __repr__(self):
4168 return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4169 def __init__(self, *args, **kwargs):
4170 """__init__(self, int commandId=0) -> UpdateUIEvent"""
4171 newobj = _core_.new_UpdateUIEvent(*args, **kwargs)
4172 self.this = newobj.this
4173 self.thisown = 1
4174 del newobj.thisown
4175 def GetChecked(*args, **kwargs):
4176 """GetChecked(self) -> bool"""
4177 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
4178
4179 def GetEnabled(*args, **kwargs):
4180 """GetEnabled(self) -> bool"""
4181 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
4182
4183 def GetText(*args, **kwargs):
4184 """GetText(self) -> String"""
4185 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
4186
4187 def GetSetText(*args, **kwargs):
4188 """GetSetText(self) -> bool"""
4189 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
4190
4191 def GetSetChecked(*args, **kwargs):
4192 """GetSetChecked(self) -> bool"""
4193 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
4194
4195 def GetSetEnabled(*args, **kwargs):
4196 """GetSetEnabled(self) -> bool"""
4197 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
4198
4199 def Check(*args, **kwargs):
4200 """Check(self, bool check)"""
4201 return _core_.UpdateUIEvent_Check(*args, **kwargs)
4202
4203 def Enable(*args, **kwargs):
4204 """Enable(self, bool enable)"""
4205 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
4206
4207 def SetText(*args, **kwargs):
4208 """SetText(self, String text)"""
4209 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
4210
4211 def SetUpdateInterval(*args, **kwargs):
4212 """SetUpdateInterval(long updateInterval)"""
4213 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4214
4215 SetUpdateInterval = staticmethod(SetUpdateInterval)
4216 def GetUpdateInterval(*args, **kwargs):
4217 """GetUpdateInterval() -> long"""
4218 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4219
4220 GetUpdateInterval = staticmethod(GetUpdateInterval)
4221 def CanUpdate(*args, **kwargs):
4222 """CanUpdate(Window win) -> bool"""
4223 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4224
4225 CanUpdate = staticmethod(CanUpdate)
4226 def ResetUpdateTime(*args, **kwargs):
4227 """ResetUpdateTime()"""
4228 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4229
4230 ResetUpdateTime = staticmethod(ResetUpdateTime)
4231 def SetMode(*args, **kwargs):
4232 """SetMode(int mode)"""
4233 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4234
4235 SetMode = staticmethod(SetMode)
4236 def GetMode(*args, **kwargs):
4237 """GetMode() -> int"""
4238 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4239
4240 GetMode = staticmethod(GetMode)
4241
4242 class UpdateUIEventPtr(UpdateUIEvent):
4243 def __init__(self, this):
4244 self.this = this
4245 if not hasattr(self,"thisown"): self.thisown = 0
4246 self.__class__ = UpdateUIEvent
4247 _core_.UpdateUIEvent_swigregister(UpdateUIEventPtr)
4248
4249 def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
4250 """UpdateUIEvent_SetUpdateInterval(long updateInterval)"""
4251 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
4252
4253 def UpdateUIEvent_GetUpdateInterval(*args, **kwargs):
4254 """UpdateUIEvent_GetUpdateInterval() -> long"""
4255 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
4256
4257 def UpdateUIEvent_CanUpdate(*args, **kwargs):
4258 """UpdateUIEvent_CanUpdate(Window win) -> bool"""
4259 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
4260
4261 def UpdateUIEvent_ResetUpdateTime(*args, **kwargs):
4262 """UpdateUIEvent_ResetUpdateTime()"""
4263 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
4264
4265 def UpdateUIEvent_SetMode(*args, **kwargs):
4266 """UpdateUIEvent_SetMode(int mode)"""
4267 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
4268
4269 def UpdateUIEvent_GetMode(*args, **kwargs):
4270 """UpdateUIEvent_GetMode() -> int"""
4271 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
4272
4273 #---------------------------------------------------------------------------
4274
4275 class SysColourChangedEvent(Event):
4276 def __repr__(self):
4277 return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4278 def __init__(self, *args, **kwargs):
4279 """__init__(self) -> SysColourChangedEvent"""
4280 newobj = _core_.new_SysColourChangedEvent(*args, **kwargs)
4281 self.this = newobj.this
4282 self.thisown = 1
4283 del newobj.thisown
4284
4285 class SysColourChangedEventPtr(SysColourChangedEvent):
4286 def __init__(self, this):
4287 self.this = this
4288 if not hasattr(self,"thisown"): self.thisown = 0
4289 self.__class__ = SysColourChangedEvent
4290 _core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr)
4291
4292 #---------------------------------------------------------------------------
4293
4294 class MouseCaptureChangedEvent(Event):
4295 def __repr__(self):
4296 return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4297 def __init__(self, *args, **kwargs):
4298 """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent"""
4299 newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs)
4300 self.this = newobj.this
4301 self.thisown = 1
4302 del newobj.thisown
4303 def GetCapturedWindow(*args, **kwargs):
4304 """GetCapturedWindow(self) -> Window"""
4305 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
4306
4307
4308 class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent):
4309 def __init__(self, this):
4310 self.this = this
4311 if not hasattr(self,"thisown"): self.thisown = 0
4312 self.__class__ = MouseCaptureChangedEvent
4313 _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr)
4314
4315 #---------------------------------------------------------------------------
4316
4317 class DisplayChangedEvent(Event):
4318 def __repr__(self):
4319 return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4320 def __init__(self, *args, **kwargs):
4321 """__init__(self) -> DisplayChangedEvent"""
4322 newobj = _core_.new_DisplayChangedEvent(*args, **kwargs)
4323 self.this = newobj.this
4324 self.thisown = 1
4325 del newobj.thisown
4326
4327 class DisplayChangedEventPtr(DisplayChangedEvent):
4328 def __init__(self, this):
4329 self.this = this
4330 if not hasattr(self,"thisown"): self.thisown = 0
4331 self.__class__ = DisplayChangedEvent
4332 _core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr)
4333
4334 #---------------------------------------------------------------------------
4335
4336 class PaletteChangedEvent(Event):
4337 def __repr__(self):
4338 return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4339 def __init__(self, *args, **kwargs):
4340 """__init__(self, int id=0) -> PaletteChangedEvent"""
4341 newobj = _core_.new_PaletteChangedEvent(*args, **kwargs)
4342 self.this = newobj.this
4343 self.thisown = 1
4344 del newobj.thisown
4345 def SetChangedWindow(*args, **kwargs):
4346 """SetChangedWindow(self, Window win)"""
4347 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
4348
4349 def GetChangedWindow(*args, **kwargs):
4350 """GetChangedWindow(self) -> Window"""
4351 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
4352
4353
4354 class PaletteChangedEventPtr(PaletteChangedEvent):
4355 def __init__(self, this):
4356 self.this = this
4357 if not hasattr(self,"thisown"): self.thisown = 0
4358 self.__class__ = PaletteChangedEvent
4359 _core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr)
4360
4361 #---------------------------------------------------------------------------
4362
4363 class QueryNewPaletteEvent(Event):
4364 def __repr__(self):
4365 return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4366 def __init__(self, *args, **kwargs):
4367 """__init__(self, int winid=0) -> QueryNewPaletteEvent"""
4368 newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs)
4369 self.this = newobj.this
4370 self.thisown = 1
4371 del newobj.thisown
4372 def SetPaletteRealized(*args, **kwargs):
4373 """SetPaletteRealized(self, bool realized)"""
4374 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
4375
4376 def GetPaletteRealized(*args, **kwargs):
4377 """GetPaletteRealized(self) -> bool"""
4378 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
4379
4380
4381 class QueryNewPaletteEventPtr(QueryNewPaletteEvent):
4382 def __init__(self, this):
4383 self.this = this
4384 if not hasattr(self,"thisown"): self.thisown = 0
4385 self.__class__ = QueryNewPaletteEvent
4386 _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr)
4387
4388 #---------------------------------------------------------------------------
4389
4390 class NavigationKeyEvent(Event):
4391 def __repr__(self):
4392 return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4393 def __init__(self, *args, **kwargs):
4394 """__init__(self) -> NavigationKeyEvent"""
4395 newobj = _core_.new_NavigationKeyEvent(*args, **kwargs)
4396 self.this = newobj.this
4397 self.thisown = 1
4398 del newobj.thisown
4399 def GetDirection(*args, **kwargs):
4400 """GetDirection(self) -> bool"""
4401 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
4402
4403 def SetDirection(*args, **kwargs):
4404 """SetDirection(self, bool forward)"""
4405 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
4406
4407 def IsWindowChange(*args, **kwargs):
4408 """IsWindowChange(self) -> bool"""
4409 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
4410
4411 def SetWindowChange(*args, **kwargs):
4412 """SetWindowChange(self, bool ischange)"""
4413 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
4414
4415 def SetFlags(*args, **kwargs):
4416 """SetFlags(self, long flags)"""
4417 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
4418
4419 def GetCurrentFocus(*args, **kwargs):
4420 """GetCurrentFocus(self) -> Window"""
4421 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
4422
4423 def SetCurrentFocus(*args, **kwargs):
4424 """SetCurrentFocus(self, Window win)"""
4425 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
4426
4427 IsBackward = _core_.NavigationKeyEvent_IsBackward
4428 IsForward = _core_.NavigationKeyEvent_IsForward
4429 WinChange = _core_.NavigationKeyEvent_WinChange
4430
4431 class NavigationKeyEventPtr(NavigationKeyEvent):
4432 def __init__(self, this):
4433 self.this = this
4434 if not hasattr(self,"thisown"): self.thisown = 0
4435 self.__class__ = NavigationKeyEvent
4436 _core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr)
4437
4438 #---------------------------------------------------------------------------
4439
4440 class WindowCreateEvent(CommandEvent):
4441 def __repr__(self):
4442 return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4443 def __init__(self, *args, **kwargs):
4444 """__init__(self, Window win=None) -> WindowCreateEvent"""
4445 newobj = _core_.new_WindowCreateEvent(*args, **kwargs)
4446 self.this = newobj.this
4447 self.thisown = 1
4448 del newobj.thisown
4449 def GetWindow(*args, **kwargs):
4450 """GetWindow(self) -> Window"""
4451 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
4452
4453
4454 class WindowCreateEventPtr(WindowCreateEvent):
4455 def __init__(self, this):
4456 self.this = this
4457 if not hasattr(self,"thisown"): self.thisown = 0
4458 self.__class__ = WindowCreateEvent
4459 _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr)
4460
4461 class WindowDestroyEvent(CommandEvent):
4462 def __repr__(self):
4463 return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4464 def __init__(self, *args, **kwargs):
4465 """__init__(self, Window win=None) -> WindowDestroyEvent"""
4466 newobj = _core_.new_WindowDestroyEvent(*args, **kwargs)
4467 self.this = newobj.this
4468 self.thisown = 1
4469 del newobj.thisown
4470 def GetWindow(*args, **kwargs):
4471 """GetWindow(self) -> Window"""
4472 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
4473
4474
4475 class WindowDestroyEventPtr(WindowDestroyEvent):
4476 def __init__(self, this):
4477 self.this = this
4478 if not hasattr(self,"thisown"): self.thisown = 0
4479 self.__class__ = WindowDestroyEvent
4480 _core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr)
4481
4482 #---------------------------------------------------------------------------
4483
4484 class ContextMenuEvent(CommandEvent):
4485 def __repr__(self):
4486 return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4487 def __init__(self, *args, **kwargs):
4488 """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent"""
4489 newobj = _core_.new_ContextMenuEvent(*args, **kwargs)
4490 self.this = newobj.this
4491 self.thisown = 1
4492 del newobj.thisown
4493 def GetPosition(*args, **kwargs):
4494 """GetPosition(self) -> Point"""
4495 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
4496
4497 def SetPosition(*args, **kwargs):
4498 """SetPosition(self, Point pos)"""
4499 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
4500
4501
4502 class ContextMenuEventPtr(ContextMenuEvent):
4503 def __init__(self, this):
4504 self.this = this
4505 if not hasattr(self,"thisown"): self.thisown = 0
4506 self.__class__ = ContextMenuEvent
4507 _core_.ContextMenuEvent_swigregister(ContextMenuEventPtr)
4508
4509 #---------------------------------------------------------------------------
4510
4511 IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
4512 IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
4513 class IdleEvent(Event):
4514 def __repr__(self):
4515 return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4516 def __init__(self, *args, **kwargs):
4517 """__init__(self) -> IdleEvent"""
4518 newobj = _core_.new_IdleEvent(*args, **kwargs)
4519 self.this = newobj.this
4520 self.thisown = 1
4521 del newobj.thisown
4522 def RequestMore(*args, **kwargs):
4523 """RequestMore(self, bool needMore=True)"""
4524 return _core_.IdleEvent_RequestMore(*args, **kwargs)
4525
4526 def MoreRequested(*args, **kwargs):
4527 """MoreRequested(self) -> bool"""
4528 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
4529
4530 def SetMode(*args, **kwargs):
4531 """SetMode(int mode)"""
4532 return _core_.IdleEvent_SetMode(*args, **kwargs)
4533
4534 SetMode = staticmethod(SetMode)
4535 def GetMode(*args, **kwargs):
4536 """GetMode() -> int"""
4537 return _core_.IdleEvent_GetMode(*args, **kwargs)
4538
4539 GetMode = staticmethod(GetMode)
4540 def CanSend(*args, **kwargs):
4541 """CanSend(Window win) -> bool"""
4542 return _core_.IdleEvent_CanSend(*args, **kwargs)
4543
4544 CanSend = staticmethod(CanSend)
4545
4546 class IdleEventPtr(IdleEvent):
4547 def __init__(self, this):
4548 self.this = this
4549 if not hasattr(self,"thisown"): self.thisown = 0
4550 self.__class__ = IdleEvent
4551 _core_.IdleEvent_swigregister(IdleEventPtr)
4552
4553 def IdleEvent_SetMode(*args, **kwargs):
4554 """IdleEvent_SetMode(int mode)"""
4555 return _core_.IdleEvent_SetMode(*args, **kwargs)
4556
4557 def IdleEvent_GetMode(*args, **kwargs):
4558 """IdleEvent_GetMode() -> int"""
4559 return _core_.IdleEvent_GetMode(*args, **kwargs)
4560
4561 def IdleEvent_CanSend(*args, **kwargs):
4562 """IdleEvent_CanSend(Window win) -> bool"""
4563 return _core_.IdleEvent_CanSend(*args, **kwargs)
4564
4565 #---------------------------------------------------------------------------
4566
4567 class PyEvent(Event):
4568 def __repr__(self):
4569 return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4570 def __init__(self, *args, **kwargs):
4571 """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent"""
4572 newobj = _core_.new_PyEvent(*args, **kwargs)
4573 self.this = newobj.this
4574 self.thisown = 1
4575 del newobj.thisown
4576 self.SetSelf(self)
4577
4578 def __del__(self, destroy=_core_.delete_PyEvent):
4579 """__del__(self)"""
4580 try:
4581 if self.thisown: destroy(self)
4582 except: pass
4583
4584 def SetSelf(*args, **kwargs):
4585 """SetSelf(self, PyObject self)"""
4586 return _core_.PyEvent_SetSelf(*args, **kwargs)
4587
4588 def GetSelf(*args, **kwargs):
4589 """GetSelf(self) -> PyObject"""
4590 return _core_.PyEvent_GetSelf(*args, **kwargs)
4591
4592
4593 class PyEventPtr(PyEvent):
4594 def __init__(self, this):
4595 self.this = this
4596 if not hasattr(self,"thisown"): self.thisown = 0
4597 self.__class__ = PyEvent
4598 _core_.PyEvent_swigregister(PyEventPtr)
4599
4600 class PyCommandEvent(CommandEvent):
4601 def __repr__(self):
4602 return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4603 def __init__(self, *args, **kwargs):
4604 """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
4605 newobj = _core_.new_PyCommandEvent(*args, **kwargs)
4606 self.this = newobj.this
4607 self.thisown = 1
4608 del newobj.thisown
4609 self.SetSelf(self)
4610
4611 def __del__(self, destroy=_core_.delete_PyCommandEvent):
4612 """__del__(self)"""
4613 try:
4614 if self.thisown: destroy(self)
4615 except: pass
4616
4617 def SetSelf(*args, **kwargs):
4618 """SetSelf(self, PyObject self)"""
4619 return _core_.PyCommandEvent_SetSelf(*args, **kwargs)
4620
4621 def GetSelf(*args, **kwargs):
4622 """GetSelf(self) -> PyObject"""
4623 return _core_.PyCommandEvent_GetSelf(*args, **kwargs)
4624
4625
4626 class PyCommandEventPtr(PyCommandEvent):
4627 def __init__(self, this):
4628 self.this = this
4629 if not hasattr(self,"thisown"): self.thisown = 0
4630 self.__class__ = PyCommandEvent
4631 _core_.PyCommandEvent_swigregister(PyCommandEventPtr)
4632
4633 #---------------------------------------------------------------------------
4634
4635 PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
4636 PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
4637 PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
4638 PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
4639 PRINT_WINDOWS = _core_.PRINT_WINDOWS
4640 PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
4641 class PyApp(EvtHandler):
4642 """
4643 The ``wx.PyApp`` class is an *implementation detail*, please use the
4644 `wx.App` class (or some other derived class) instead.
4645 """
4646 def __repr__(self):
4647 return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
4648 def __init__(self, *args, **kwargs):
4649 """
4650 __init__(self) -> PyApp
4651
4652 Create a new application object, starting the bootstrap process.
4653 """
4654 newobj = _core_.new_PyApp(*args, **kwargs)
4655 self.this = newobj.this
4656 self.thisown = 1
4657 del newobj.thisown
4658 self._setCallbackInfo(self, PyApp)
4659 self._setOORInfo(self)
4660
4661 def __del__(self, destroy=_core_.delete_PyApp):
4662 """__del__(self)"""
4663 try:
4664 if self.thisown: destroy(self)
4665 except: pass
4666
4667 def _setCallbackInfo(*args, **kwargs):
4668 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
4669 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
4670
4671 def GetAppName(*args, **kwargs):
4672 """
4673 GetAppName(self) -> String
4674
4675 Get the application name.
4676 """
4677 return _core_.PyApp_GetAppName(*args, **kwargs)
4678
4679 def SetAppName(*args, **kwargs):
4680 """
4681 SetAppName(self, String name)
4682
4683 Set the application name. This value may be used automatically by
4684 `wx.Config` and such.
4685 """
4686 return _core_.PyApp_SetAppName(*args, **kwargs)
4687
4688 def GetClassName(*args, **kwargs):
4689 """
4690 GetClassName(self) -> String
4691
4692 Get the application's class name.
4693 """
4694 return _core_.PyApp_GetClassName(*args, **kwargs)
4695
4696 def SetClassName(*args, **kwargs):
4697 """
4698 SetClassName(self, String name)
4699
4700 Set the application's class name. This value may be used for
4701 X-resources if applicable for the platform
4702 """
4703 return _core_.PyApp_SetClassName(*args, **kwargs)
4704
4705 def GetVendorName(*args, **kwargs):
4706 """
4707 GetVendorName(self) -> String
4708
4709 Get the application's vendor name.
4710 """
4711 return _core_.PyApp_GetVendorName(*args, **kwargs)
4712
4713 def SetVendorName(*args, **kwargs):
4714 """
4715 SetVendorName(self, String name)
4716
4717 Set the application's vendor name. This value may be used
4718 automatically by `wx.Config` and such.
4719 """
4720 return _core_.PyApp_SetVendorName(*args, **kwargs)
4721
4722 def GetTraits(*args, **kwargs):
4723 """
4724 GetTraits(self) -> wxAppTraits
4725
4726 Return (and create if necessary) the app traits object to which we
4727 delegate for everything which either should be configurable by the
4728 user (then he can change the default behaviour simply by overriding
4729 CreateTraits() and returning his own traits object) or which is
4730 GUI/console dependent as then wx.AppTraits allows us to abstract the
4731 differences behind the common facade.
4732
4733 :todo: Add support for overriding CreateAppTraits in wxPython.
4734 """
4735 return _core_.PyApp_GetTraits(*args, **kwargs)
4736
4737 def ProcessPendingEvents(*args, **kwargs):
4738 """
4739 ProcessPendingEvents(self)
4740
4741 Process all events in the Pending Events list -- it is necessary to
4742 call this function to process posted events. This normally happens
4743 during each event loop iteration.
4744 """
4745 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
4746
4747 def Yield(*args, **kwargs):
4748 """
4749 Yield(self, bool onlyIfNeeded=False) -> bool
4750
4751 Process all currently pending events right now, instead of waiting
4752 until return to the event loop. It is an error to call ``Yield``
4753 recursively unless the value of ``onlyIfNeeded`` is True.
4754
4755 :warning: This function is dangerous as it can lead to unexpected
4756 reentrancies (i.e. when called from an event handler it may
4757 result in calling the same event handler again), use with
4758 extreme care or, better, don't use at all!
4759
4760 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
4761
4762 """
4763 return _core_.PyApp_Yield(*args, **kwargs)
4764
4765 def WakeUpIdle(*args, **kwargs):
4766 """
4767 WakeUpIdle(self)
4768
4769 Make sure that idle events are sent again.
4770 :see: `wx.WakeUpIdle`
4771 """
4772 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
4773
4774 def IsMainLoopRunning(*args, **kwargs):
4775 """
4776 IsMainLoopRunning() -> bool
4777
4778 Returns True if we're running the main loop, i.e. if the events can
4779 currently be dispatched.
4780 """
4781 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
4782
4783 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
4784 def MainLoop(*args, **kwargs):
4785 """
4786 MainLoop(self) -> int
4787
4788 Execute the main GUI loop, the function doesn't normally return until
4789 all top level windows have been closed and destroyed.
4790 """
4791 return _core_.PyApp_MainLoop(*args, **kwargs)
4792
4793 def Exit(*args, **kwargs):
4794 """
4795 Exit(self)
4796
4797 Exit the main loop thus terminating the application.
4798 :see: `wx.Exit`
4799 """
4800 return _core_.PyApp_Exit(*args, **kwargs)
4801
4802 def ExitMainLoop(*args, **kwargs):
4803 """
4804 ExitMainLoop(self)
4805
4806 Exit the main GUI loop during the next iteration of the main
4807 loop, (i.e. it does not stop the program immediately!)
4808 """
4809 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
4810
4811 def Pending(*args, **kwargs):
4812 """
4813 Pending(self) -> bool
4814
4815 Returns True if there are unprocessed events in the event queue.
4816 """
4817 return _core_.PyApp_Pending(*args, **kwargs)
4818
4819 def Dispatch(*args, **kwargs):
4820 """
4821 Dispatch(self) -> bool
4822
4823 Process the first event in the event queue (blocks until an event
4824 appears if there are none currently)
4825 """
4826 return _core_.PyApp_Dispatch(*args, **kwargs)
4827
4828 def ProcessIdle(*args, **kwargs):
4829 """
4830 ProcessIdle(self) -> bool
4831
4832 Called from the MainLoop when the application becomes idle (there are
4833 no pending events) and sends a `wx.IdleEvent` to all interested
4834 parties. Returns True if more idle events are needed, False if not.
4835 """
4836 return _core_.PyApp_ProcessIdle(*args, **kwargs)
4837
4838 def SendIdleEvents(*args, **kwargs):
4839 """
4840 SendIdleEvents(self, Window win, IdleEvent event) -> bool
4841
4842 Send idle event to window and all subwindows. Returns True if more
4843 idle time is requested.
4844 """
4845 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
4846
4847 def IsActive(*args, **kwargs):
4848 """
4849 IsActive(self) -> bool
4850
4851 Return True if our app has focus.
4852 """
4853 return _core_.PyApp_IsActive(*args, **kwargs)
4854
4855 def SetTopWindow(*args, **kwargs):
4856 """
4857 SetTopWindow(self, Window win)
4858
4859 Set the *main* top level window
4860 """
4861 return _core_.PyApp_SetTopWindow(*args, **kwargs)
4862
4863 def GetTopWindow(*args, **kwargs):
4864 """
4865 GetTopWindow(self) -> Window
4866
4867 Return the *main* top level window (if it hadn't been set previously
4868 with SetTopWindow(), will return just some top level window and, if
4869 there not any, will return None)
4870 """
4871 return _core_.PyApp_GetTopWindow(*args, **kwargs)
4872
4873 def SetExitOnFrameDelete(*args, **kwargs):
4874 """
4875 SetExitOnFrameDelete(self, bool flag)
4876
4877 Control the exit behaviour: by default, the program will exit the main
4878 loop (and so, usually, terminate) when the last top-level program
4879 window is deleted. Beware that if you disable this behaviour (with
4880 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
4881 explicitly from somewhere.
4882 """
4883 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
4884
4885 def GetExitOnFrameDelete(*args, **kwargs):
4886 """
4887 GetExitOnFrameDelete(self) -> bool
4888
4889 Get the current exit behaviour setting.
4890 """
4891 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
4892
4893 def SetUseBestVisual(*args, **kwargs):
4894 """
4895 SetUseBestVisual(self, bool flag)
4896
4897 Set whether the app should try to use the best available visual on
4898 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
4899 """
4900 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
4901
4902 def GetUseBestVisual(*args, **kwargs):
4903 """
4904 GetUseBestVisual(self) -> bool
4905
4906 Get current UseBestVisual setting.
4907 """
4908 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
4909
4910 def SetPrintMode(*args, **kwargs):
4911 """SetPrintMode(self, int mode)"""
4912 return _core_.PyApp_SetPrintMode(*args, **kwargs)
4913
4914 def GetPrintMode(*args, **kwargs):
4915 """GetPrintMode(self) -> int"""
4916 return _core_.PyApp_GetPrintMode(*args, **kwargs)
4917
4918 def SetAssertMode(*args, **kwargs):
4919 """
4920 SetAssertMode(self, int mode)
4921
4922 Set the OnAssert behaviour for debug and hybrid builds.
4923 """
4924 return _core_.PyApp_SetAssertMode(*args, **kwargs)
4925
4926 def GetAssertMode(*args, **kwargs):
4927 """
4928 GetAssertMode(self) -> int
4929
4930 Get the current OnAssert behaviour setting.
4931 """
4932 return _core_.PyApp_GetAssertMode(*args, **kwargs)
4933
4934 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
4935 """GetMacSupportPCMenuShortcuts() -> bool"""
4936 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
4937
4938 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
4939 def GetMacAboutMenuItemId(*args, **kwargs):
4940 """GetMacAboutMenuItemId() -> long"""
4941 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
4942
4943 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
4944 def GetMacPreferencesMenuItemId(*args, **kwargs):
4945 """GetMacPreferencesMenuItemId() -> long"""
4946 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
4947
4948 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
4949 def GetMacExitMenuItemId(*args, **kwargs):
4950 """GetMacExitMenuItemId() -> long"""
4951 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
4952
4953 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
4954 def GetMacHelpMenuTitleName(*args, **kwargs):
4955 """GetMacHelpMenuTitleName() -> String"""
4956 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
4957
4958 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
4959 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
4960 """SetMacSupportPCMenuShortcuts(bool val)"""
4961 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
4962
4963 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
4964 def SetMacAboutMenuItemId(*args, **kwargs):
4965 """SetMacAboutMenuItemId(long val)"""
4966 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
4967
4968 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
4969 def SetMacPreferencesMenuItemId(*args, **kwargs):
4970 """SetMacPreferencesMenuItemId(long val)"""
4971 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
4972
4973 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
4974 def SetMacExitMenuItemId(*args, **kwargs):
4975 """SetMacExitMenuItemId(long val)"""
4976 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
4977
4978 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
4979 def SetMacHelpMenuTitleName(*args, **kwargs):
4980 """SetMacHelpMenuTitleName(String val)"""
4981 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
4982
4983 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
4984 def _BootstrapApp(*args, **kwargs):
4985 """
4986 _BootstrapApp(self)
4987
4988 For internal use only
4989 """
4990 return _core_.PyApp__BootstrapApp(*args, **kwargs)
4991
4992 def GetComCtl32Version(*args, **kwargs):
4993 """
4994 GetComCtl32Version() -> int
4995
4996 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
4997 it wasn't found at all. Raises an exception on non-Windows platforms.
4998 """
4999 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5000
5001 GetComCtl32Version = staticmethod(GetComCtl32Version)
5002
5003 class PyAppPtr(PyApp):
5004 def __init__(self, this):
5005 self.this = this
5006 if not hasattr(self,"thisown"): self.thisown = 0
5007 self.__class__ = PyApp
5008 _core_.PyApp_swigregister(PyAppPtr)
5009
5010 def PyApp_IsMainLoopRunning(*args, **kwargs):
5011 """
5012 PyApp_IsMainLoopRunning() -> bool
5013
5014 Returns True if we're running the main loop, i.e. if the events can
5015 currently be dispatched.
5016 """
5017 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
5018
5019 def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs):
5020 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
5021 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
5022
5023 def PyApp_GetMacAboutMenuItemId(*args, **kwargs):
5024 """PyApp_GetMacAboutMenuItemId() -> long"""
5025 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
5026
5027 def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs):
5028 """PyApp_GetMacPreferencesMenuItemId() -> long"""
5029 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
5030
5031 def PyApp_GetMacExitMenuItemId(*args, **kwargs):
5032 """PyApp_GetMacExitMenuItemId() -> long"""
5033 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
5034
5035 def PyApp_GetMacHelpMenuTitleName(*args, **kwargs):
5036 """PyApp_GetMacHelpMenuTitleName() -> String"""
5037 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
5038
5039 def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
5040 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
5041 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
5042
5043 def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
5044 """PyApp_SetMacAboutMenuItemId(long val)"""
5045 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
5046
5047 def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
5048 """PyApp_SetMacPreferencesMenuItemId(long val)"""
5049 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
5050
5051 def PyApp_SetMacExitMenuItemId(*args, **kwargs):
5052 """PyApp_SetMacExitMenuItemId(long val)"""
5053 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
5054
5055 def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
5056 """PyApp_SetMacHelpMenuTitleName(String val)"""
5057 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
5058
5059 def PyApp_GetComCtl32Version(*args, **kwargs):
5060 """
5061 PyApp_GetComCtl32Version() -> int
5062
5063 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
5064 it wasn't found at all. Raises an exception on non-Windows platforms.
5065 """
5066 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
5067
5068 #---------------------------------------------------------------------------
5069
5070
5071 def Exit(*args, **kwargs):
5072 """
5073 Exit()
5074
5075 Force an exit of the application. Convenience for wx.GetApp().Exit()
5076 """
5077 return _core_.Exit(*args, **kwargs)
5078
5079 def Yield(*args, **kwargs):
5080 """
5081 Yield() -> bool
5082
5083 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
5084 """
5085 return _core_.Yield(*args, **kwargs)
5086
5087 def YieldIfNeeded(*args, **kwargs):
5088 """
5089 YieldIfNeeded() -> bool
5090
5091 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
5092 """
5093 return _core_.YieldIfNeeded(*args, **kwargs)
5094
5095 def SafeYield(*args, **kwargs):
5096 """
5097 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
5098
5099 This function is similar to `wx.Yield`, except that it disables the
5100 user input to all program windows before calling `wx.Yield` and
5101 re-enables it again afterwards. If ``win`` is not None, this window
5102 will remain enabled, allowing the implementation of some limited user
5103 interaction.
5104
5105 :Returns: the result of the call to `wx.Yield`.
5106 """
5107 return _core_.SafeYield(*args, **kwargs)
5108
5109 def WakeUpIdle(*args, **kwargs):
5110 """
5111 WakeUpIdle()
5112
5113 Cause the message queue to become empty again, so idle events will be
5114 sent.
5115 """
5116 return _core_.WakeUpIdle(*args, **kwargs)
5117
5118 def PostEvent(*args, **kwargs):
5119 """
5120 PostEvent(EvtHandler dest, Event event)
5121
5122 Send an event to a window or other wx.EvtHandler to be processed
5123 later.
5124 """
5125 return _core_.PostEvent(*args, **kwargs)
5126
5127 def App_CleanUp(*args, **kwargs):
5128 """
5129 App_CleanUp()
5130
5131 For internal use only, it is used to cleanup after wxWidgets when
5132 Python shuts down.
5133 """
5134 return _core_.App_CleanUp(*args, **kwargs)
5135
5136 def GetApp(*args, **kwargs):
5137 """
5138 GetApp() -> PyApp
5139
5140 Return a reference to the current wx.App object.
5141 """
5142 return _core_.GetApp(*args, **kwargs)
5143 #----------------------------------------------------------------------
5144
5145 class PyOnDemandOutputWindow:
5146 """
5147 A class that can be used for redirecting Python's stdout and
5148 stderr streams. It will do nothing until something is wrriten to
5149 the stream at which point it will create a Frame with a text area
5150 and write the text there.
5151 """
5152 def __init__(self, title = "wxPython: stdout/stderr"):
5153 self.frame = None
5154 self.title = title
5155 self.pos = wx.DefaultPosition
5156 self.size = (450, 300)
5157 self.parent = None
5158
5159 def SetParent(self, parent):
5160 """Set the window to be used as the popup Frame's parent."""
5161 self.parent = parent
5162
5163
5164 def CreateOutputWindow(self, st):
5165 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
5166 style=wx.DEFAULT_FRAME_STYLE)
5167 self.text = wx.TextCtrl(self.frame, -1, "",
5168 style=wx.TE_MULTILINE|wx.TE_READONLY)
5169 self.text.AppendText(st)
5170 self.frame.Show(True)
5171 EVT_CLOSE(self.frame, self.OnCloseWindow)
5172
5173
5174 def OnCloseWindow(self, event):
5175 if self.frame is not None:
5176 self.frame.Destroy()
5177 self.frame = None
5178 self.text = None
5179
5180
5181 # These methods provide the file-like output behaviour.
5182 def write(self, text):
5183 """
5184 Create the output window if needed and write the string to it.
5185 If not called in the context of the gui thread then uses
5186 CallAfter to do the work there.
5187 """
5188 if self.frame is None:
5189 if not wx.Thread_IsMain():
5190 wx.CallAfter(self.CreateOutputWindow, text)
5191 else:
5192 self.CreateOutputWindow(text)
5193 else:
5194 if not wx.Thread_IsMain():
5195 wx.CallAfter(self.text.AppendText, text)
5196 else:
5197 self.text.AppendText(text)
5198
5199
5200 def close(self):
5201 if self.frame is not None:
5202 wx.CallAfter(self.frame.Close)
5203
5204
5205 def flush(self):
5206 pass
5207
5208
5209
5210 #----------------------------------------------------------------------
5211
5212 _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
5213
5214 class App(wx.PyApp):
5215 """
5216 The ``wx.App`` class represents the application and is used to:
5217
5218 * bootstrap the wxPython system and initialize the underlying
5219 gui toolkit
5220 * set and get application-wide properties
5221 * implement the windowing system main message or event loop,
5222 and to dispatch events to window instances
5223 * etc.
5224
5225 Every application must have a ``wx.App`` instance, and all
5226 creation of UI objects should be delayed until after the
5227 ``wx.App`` object has been created in order to ensure that the gui
5228 platform and wxWidgets have been fully initialized.
5229
5230 Normally you would derive from this class and implement an
5231 ``OnInit`` method that creates a frame and then calls
5232 ``self.SetTopWindow(frame)``.
5233
5234 :see: `wx.PySimpleApp` for a simpler app class that can be used
5235 directly.
5236 """
5237
5238 outputWindowClass = PyOnDemandOutputWindow
5239
5240 def __init__(self, redirect=_defRedirect, filename=None,
5241 useBestVisual=False, clearSigInt=True):
5242 """
5243 Construct a ``wx.App`` object.
5244
5245 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
5246 redirected? Defaults to True on Windows and Mac, False
5247 otherwise. If `filename` is None then output will be
5248 redirected to a window that pops up as needed. (You can
5249 control what kind of window is created for the output by
5250 resetting the class variable ``outputWindowClass`` to a
5251 class of your choosing.)
5252
5253 :param filename: The name of a file to redirect output to, if
5254 redirect is True.
5255
5256 :param useBestVisual: Should the app try to use the best
5257 available visual provided by the system (only relevant on
5258 systems that have more than one visual.) This parameter
5259 must be used instead of calling `SetUseBestVisual` later
5260 on because it must be set before the underlying GUI
5261 toolkit is initialized.
5262
5263 :param clearSigInt: Should SIGINT be cleared? This allows the
5264 app to terminate upon a Ctrl-C in the console like other
5265 GUI apps will.
5266
5267 :note: You should override OnInit to do applicaition
5268 initialization to ensure that the system, toolkit and
5269 wxWidgets are fully initialized.
5270 """
5271 wx.PyApp.__init__(self)
5272
5273 if wx.Platform == "__WXMAC__":
5274 try:
5275 import MacOS
5276 if not MacOS.WMAvailable():
5277 print """\
5278 This program needs access to the screen. Please run with 'pythonw',
5279 not 'python', and only when you are logged in on the main display of
5280 your Mac."""
5281 _sys.exit(1)
5282 except SystemExit:
5283 raise
5284 except:
5285 pass
5286
5287 # This has to be done before OnInit
5288 self.SetUseBestVisual(useBestVisual)
5289
5290 # Set the default handler for SIGINT. This fixes a problem
5291 # where if Ctrl-C is pressed in the console that started this
5292 # app then it will not appear to do anything, (not even send
5293 # KeyboardInterrupt???) but will later segfault on exit. By
5294 # setting the default handler then the app will exit, as
5295 # expected (depending on platform.)
5296 if clearSigInt:
5297 try:
5298 import signal
5299 signal.signal(signal.SIGINT, signal.SIG_DFL)
5300 except:
5301 pass
5302
5303 # Save and redirect the stdio to a window?
5304 self.stdioWin = None
5305 self.saveStdio = (_sys.stdout, _sys.stderr)
5306 if redirect:
5307 self.RedirectStdio(filename)
5308
5309 # This finishes the initialization of wxWindows and then calls
5310 # the OnInit that should be present in the derived class
5311 self._BootstrapApp()
5312
5313
5314 def __del__(self):
5315 try:
5316 self.RestoreStdio() # Just in case the MainLoop was overridden
5317 except:
5318 pass
5319
5320
5321 def SetTopWindow(self, frame):
5322 """Set the \"main\" top level window"""
5323 if self.stdioWin:
5324 self.stdioWin.SetParent(frame)
5325 wx.PyApp.SetTopWindow(self, frame)
5326
5327
5328 def MainLoop(self):
5329 """Execute the main GUI event loop"""
5330 wx.PyApp.MainLoop(self)
5331 self.RestoreStdio()
5332
5333
5334 def RedirectStdio(self, filename=None):
5335 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
5336 if filename:
5337 _sys.stdout = _sys.stderr = open(filename, 'a')
5338 else:
5339 self.stdioWin = self.outputWindowClass()
5340 _sys.stdout = _sys.stderr = self.stdioWin
5341
5342
5343 def RestoreStdio(self):
5344 _sys.stdout, _sys.stderr = self.saveStdio
5345
5346
5347 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
5348 """
5349 Set the title, position and/or size of the output window if
5350 the stdio has been redirected. This should be called before
5351 any output would cause the output window to be created.
5352 """
5353 if self.stdioWin:
5354 if title is not None:
5355 self.stdioWin.title = title
5356 if pos is not None:
5357 self.stdioWin.pos = pos
5358 if size is not None:
5359 self.stdioWin.size = size
5360
5361
5362
5363
5364 # change from wx.PyApp_XX to wx.App_XX
5365 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
5366 App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
5367 App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
5368 App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
5369 App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
5370 App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
5371 App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
5372 App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
5373 App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
5374 App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
5375 App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
5376
5377 #----------------------------------------------------------------------------
5378
5379 class PySimpleApp(wx.App):
5380 """
5381 A simple application class. You can just create one of these and
5382 then then make your top level windows later, and not have to worry
5383 about OnInit. For example::
5384
5385 app = wx.PySimpleApp()
5386 frame = wx.Frame(None, title='Hello World')
5387 frame.Show()
5388 app.MainLoop()
5389
5390 :see: `wx.App`
5391 """
5392
5393 def __init__(self, redirect=False, filename=None,
5394 useBestVisual=False, clearSigInt=True):
5395 """
5396 :see: `wx.App.__init__`
5397 """
5398 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
5399
5400 def OnInit(self):
5401 return True
5402
5403
5404
5405 # Is anybody using this one?
5406 class PyWidgetTester(wx.App):
5407 def __init__(self, size = (250, 100)):
5408 self.size = size
5409 wx.App.__init__(self, 0)
5410
5411 def OnInit(self):
5412 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
5413 self.SetTopWindow(self.frame)
5414 return True
5415
5416 def SetWidget(self, widgetClass, *args, **kwargs):
5417 w = widgetClass(self.frame, *args, **kwargs)
5418 self.frame.Show(True)
5419
5420 #----------------------------------------------------------------------------
5421 # DO NOT hold any other references to this object. This is how we
5422 # know when to cleanup system resources that wxWidgets is holding. When
5423 # the sys module is unloaded, the refcount on sys.__wxPythonCleanup
5424 # goes to zero and it calls the wx.App_CleanUp function.
5425
5426 class __wxPyCleanup:
5427 def __init__(self):
5428 self.cleanup = _core_.App_CleanUp
5429 def __del__(self):
5430 self.cleanup()
5431
5432 _sys.__wxPythonCleanup = __wxPyCleanup()
5433
5434 ## # another possible solution, but it gets called too early...
5435 ## import atexit
5436 ## atexit.register(_core_.wxApp_CleanUp)
5437
5438
5439 #----------------------------------------------------------------------------
5440
5441 #---------------------------------------------------------------------------
5442
5443 class EventLoop(object):
5444 def __repr__(self):
5445 return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5446 def __init__(self, *args, **kwargs):
5447 """__init__(self) -> EventLoop"""
5448 newobj = _core_.new_EventLoop(*args, **kwargs)
5449 self.this = newobj.this
5450 self.thisown = 1
5451 del newobj.thisown
5452 def __del__(self, destroy=_core_.delete_EventLoop):
5453 """__del__(self)"""
5454 try:
5455 if self.thisown: destroy(self)
5456 except: pass
5457
5458 def Run(*args, **kwargs):
5459 """Run(self) -> int"""
5460 return _core_.EventLoop_Run(*args, **kwargs)
5461
5462 def Exit(*args, **kwargs):
5463 """Exit(self, int rc=0)"""
5464 return _core_.EventLoop_Exit(*args, **kwargs)
5465
5466 def Pending(*args, **kwargs):
5467 """Pending(self) -> bool"""
5468 return _core_.EventLoop_Pending(*args, **kwargs)
5469
5470 def Dispatch(*args, **kwargs):
5471 """Dispatch(self) -> bool"""
5472 return _core_.EventLoop_Dispatch(*args, **kwargs)
5473
5474 def IsRunning(*args, **kwargs):
5475 """IsRunning(self) -> bool"""
5476 return _core_.EventLoop_IsRunning(*args, **kwargs)
5477
5478 def GetActive(*args, **kwargs):
5479 """GetActive() -> EventLoop"""
5480 return _core_.EventLoop_GetActive(*args, **kwargs)
5481
5482 GetActive = staticmethod(GetActive)
5483 def SetActive(*args, **kwargs):
5484 """SetActive(EventLoop loop)"""
5485 return _core_.EventLoop_SetActive(*args, **kwargs)
5486
5487 SetActive = staticmethod(SetActive)
5488
5489 class EventLoopPtr(EventLoop):
5490 def __init__(self, this):
5491 self.this = this
5492 if not hasattr(self,"thisown"): self.thisown = 0
5493 self.__class__ = EventLoop
5494 _core_.EventLoop_swigregister(EventLoopPtr)
5495
5496 def EventLoop_GetActive(*args, **kwargs):
5497 """EventLoop_GetActive() -> EventLoop"""
5498 return _core_.EventLoop_GetActive(*args, **kwargs)
5499
5500 def EventLoop_SetActive(*args, **kwargs):
5501 """EventLoop_SetActive(EventLoop loop)"""
5502 return _core_.EventLoop_SetActive(*args, **kwargs)
5503
5504 #---------------------------------------------------------------------------
5505
5506 class AcceleratorEntry(object):
5507 """
5508 A class used to define items in an `wx.AcceleratorTable`. wxPython
5509 programs can choose to use wx.AcceleratorEntry objects, but using a
5510 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
5511 as well. See `__init__` for of the tuple values.
5512
5513 :see: `wx.AcceleratorTable`
5514 """
5515 def __repr__(self):
5516 return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5517 def __init__(self, *args, **kwargs):
5518 """
5519 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
5520
5521 Construct a wx.AcceleratorEntry.
5522 """
5523 newobj = _core_.new_AcceleratorEntry(*args, **kwargs)
5524 self.this = newobj.this
5525 self.thisown = 1
5526 del newobj.thisown
5527 def __del__(self, destroy=_core_.delete_AcceleratorEntry):
5528 """__del__(self)"""
5529 try:
5530 if self.thisown: destroy(self)
5531 except: pass
5532
5533 def Set(*args, **kwargs):
5534 """
5535 Set(self, int flags, int keyCode, int cmd)
5536
5537 (Re)set the attributes of a wx.AcceleratorEntry.
5538 :see `__init__`
5539 """
5540 return _core_.AcceleratorEntry_Set(*args, **kwargs)
5541
5542 def GetFlags(*args, **kwargs):
5543 """
5544 GetFlags(self) -> int
5545
5546 Get the AcceleratorEntry's flags.
5547 """
5548 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
5549
5550 def GetKeyCode(*args, **kwargs):
5551 """
5552 GetKeyCode(self) -> int
5553
5554 Get the AcceleratorEntry's keycode.
5555 """
5556 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
5557
5558 def GetCommand(*args, **kwargs):
5559 """
5560 GetCommand(self) -> int
5561
5562 Get the AcceleratorEntry's command ID.
5563 """
5564 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
5565
5566
5567 class AcceleratorEntryPtr(AcceleratorEntry):
5568 def __init__(self, this):
5569 self.this = this
5570 if not hasattr(self,"thisown"): self.thisown = 0
5571 self.__class__ = AcceleratorEntry
5572 _core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr)
5573
5574 class AcceleratorTable(Object):
5575 """
5576 An accelerator table allows the application to specify a table of
5577 keyboard shortcuts for menus or other commands. On Windows, menu or
5578 button commands are supported; on GTK, only menu commands are
5579 supported.
5580 """
5581 def __repr__(self):
5582 return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5583 def __init__(self, *args, **kwargs):
5584 """
5585 __init__(entries) -> AcceleratorTable
5586
5587 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
5588 items or or of 3-tuples (flags, keyCode, cmdID)
5589
5590 :see: `wx.AcceleratorEntry`
5591 """
5592 newobj = _core_.new_AcceleratorTable(*args, **kwargs)
5593 self.this = newobj.this
5594 self.thisown = 1
5595 del newobj.thisown
5596 def __del__(self, destroy=_core_.delete_AcceleratorTable):
5597 """__del__(self)"""
5598 try:
5599 if self.thisown: destroy(self)
5600 except: pass
5601
5602 def Ok(*args, **kwargs):
5603 """Ok(self) -> bool"""
5604 return _core_.AcceleratorTable_Ok(*args, **kwargs)
5605
5606
5607 class AcceleratorTablePtr(AcceleratorTable):
5608 def __init__(self, this):
5609 self.this = this
5610 if not hasattr(self,"thisown"): self.thisown = 0
5611 self.__class__ = AcceleratorTable
5612 _core_.AcceleratorTable_swigregister(AcceleratorTablePtr)
5613
5614
5615 def GetAccelFromString(*args, **kwargs):
5616 """GetAccelFromString(String label) -> AcceleratorEntry"""
5617 return _core_.GetAccelFromString(*args, **kwargs)
5618 #---------------------------------------------------------------------------
5619
5620 class VisualAttributes(object):
5621 """struct containing all the visual attributes of a control"""
5622 def __repr__(self):
5623 return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5624 def __init__(self, *args, **kwargs):
5625 """
5626 __init__(self) -> VisualAttributes
5627
5628 struct containing all the visual attributes of a control
5629 """
5630 newobj = _core_.new_VisualAttributes(*args, **kwargs)
5631 self.this = newobj.this
5632 self.thisown = 1
5633 del newobj.thisown
5634 def __del__(self, destroy=_core_.delete_VisualAttributes):
5635 """__del__(self)"""
5636 try:
5637 if self.thisown: destroy(self)
5638 except: pass
5639
5640 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
5641 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
5642 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
5643
5644 class VisualAttributesPtr(VisualAttributes):
5645 def __init__(self, this):
5646 self.this = this
5647 if not hasattr(self,"thisown"): self.thisown = 0
5648 self.__class__ = VisualAttributes
5649 _core_.VisualAttributes_swigregister(VisualAttributesPtr)
5650 NullAcceleratorTable = cvar.NullAcceleratorTable
5651 PanelNameStr = cvar.PanelNameStr
5652
5653 WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
5654 WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
5655 WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
5656 WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
5657 WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
5658 class Window(EvtHandler):
5659 """
5660 wx.Window is the base class for all windows and represents any visible
5661 object on the screen. All controls, top level windows and so on are
5662 wx.Windows. Sizers and device contexts are not however, as they don't
5663 appear on screen themselves.
5664
5665 """
5666 def __repr__(self):
5667 return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
5668 def __init__(self, *args, **kwargs):
5669 """
5670 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
5671 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
5672
5673 Construct and show a generic Window.
5674 """
5675 newobj = _core_.new_Window(*args, **kwargs)
5676 self.this = newobj.this
5677 self.thisown = 1
5678 del newobj.thisown
5679 self._setOORInfo(self)
5680
5681 def Create(*args, **kwargs):
5682 """
5683 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
5684 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
5685
5686 Create the GUI part of the Window for 2-phase creation mode.
5687 """
5688 return _core_.Window_Create(*args, **kwargs)
5689
5690 def Close(*args, **kwargs):
5691 """
5692 Close(self, bool force=False) -> bool
5693
5694 This function simply generates a EVT_CLOSE event whose handler usually
5695 tries to close the window. It doesn't close the window itself,
5696 however. If force is False (the default) then the window's close
5697 handler will be allowed to veto the destruction of the window.
5698 """
5699 return _core_.Window_Close(*args, **kwargs)
5700
5701 def Destroy(*args, **kwargs):
5702 """
5703 Destroy(self) -> bool
5704
5705 Destroys the window safely. Frames and dialogs are not destroyed
5706 immediately when this function is called -- they are added to a list
5707 of windows to be deleted on idle time, when all the window's events
5708 have been processed. This prevents problems with events being sent to
5709 non-existent windows.
5710
5711 Returns True if the window has either been successfully deleted, or it
5712 has been added to the list of windows pending real deletion.
5713 """
5714 return _core_.Window_Destroy(*args, **kwargs)
5715
5716 def DestroyChildren(*args, **kwargs):
5717 """
5718 DestroyChildren(self) -> bool
5719
5720 Destroys all children of a window. Called automatically by the
5721 destructor.
5722 """
5723 return _core_.Window_DestroyChildren(*args, **kwargs)
5724
5725 def IsBeingDeleted(*args, **kwargs):
5726 """
5727 IsBeingDeleted(self) -> bool
5728
5729 Is the window in the process of being deleted?
5730 """
5731 return _core_.Window_IsBeingDeleted(*args, **kwargs)
5732
5733 def SetTitle(*args, **kwargs):
5734 """
5735 SetTitle(self, String title)
5736
5737 Sets the window's title. Applicable only to frames and dialogs.
5738 """
5739 return _core_.Window_SetTitle(*args, **kwargs)
5740
5741 def GetTitle(*args, **kwargs):
5742 """
5743 GetTitle(self) -> String
5744
5745 Gets the window's title. Applicable only to frames and dialogs.
5746 """
5747 return _core_.Window_GetTitle(*args, **kwargs)
5748
5749 def SetLabel(*args, **kwargs):
5750 """
5751 SetLabel(self, String label)
5752
5753 Set the text which the window shows in its label if applicable.
5754 """
5755 return _core_.Window_SetLabel(*args, **kwargs)
5756
5757 def GetLabel(*args, **kwargs):
5758 """
5759 GetLabel(self) -> String
5760
5761 Generic way of getting a label from any window, for identification
5762 purposes. The interpretation of this function differs from class to
5763 class. For frames and dialogs, the value returned is the title. For
5764 buttons or static text controls, it is the button text. This function
5765 can be useful for meta-programs such as testing tools or special-needs
5766 access programs)which need to identify windows by name.
5767 """
5768 return _core_.Window_GetLabel(*args, **kwargs)
5769
5770 def SetName(*args, **kwargs):
5771 """
5772 SetName(self, String name)
5773
5774 Sets the window's name. The window name is used for ressource setting
5775 in X, it is not the same as the window title/label
5776 """
5777 return _core_.Window_SetName(*args, **kwargs)
5778
5779 def GetName(*args, **kwargs):
5780 """
5781 GetName(self) -> String
5782
5783 Returns the windows name. This name is not guaranteed to be unique;
5784 it is up to the programmer to supply an appropriate name in the window
5785 constructor or via wx.Window.SetName.
5786 """
5787 return _core_.Window_GetName(*args, **kwargs)
5788
5789 def SetWindowVariant(*args, **kwargs):
5790 """
5791 SetWindowVariant(self, int variant)
5792
5793 Sets the variant of the window/font size to use for this window, if
5794 the platform supports variants, for example, wxMac.
5795 """
5796 return _core_.Window_SetWindowVariant(*args, **kwargs)
5797
5798 def GetWindowVariant(*args, **kwargs):
5799 """GetWindowVariant(self) -> int"""
5800 return _core_.Window_GetWindowVariant(*args, **kwargs)
5801
5802 def SetId(*args, **kwargs):
5803 """
5804 SetId(self, int winid)
5805
5806 Sets the identifier of the window. Each window has an integer
5807 identifier. If the application has not provided one, an identifier
5808 will be generated. Normally, the identifier should be provided on
5809 creation and should not be modified subsequently.
5810 """
5811 return _core_.Window_SetId(*args, **kwargs)
5812
5813 def GetId(*args, **kwargs):
5814 """
5815 GetId(self) -> int
5816
5817 Returns the identifier of the window. Each window has an integer
5818 identifier. If the application has not provided one (or the default Id
5819 -1 is used) then an unique identifier with a negative value will be
5820 generated.
5821 """
5822 return _core_.Window_GetId(*args, **kwargs)
5823
5824 def NewControlId(*args, **kwargs):
5825 """
5826 NewControlId() -> int
5827
5828 Generate a control id for the controls which were not given one.
5829 """
5830 return _core_.Window_NewControlId(*args, **kwargs)
5831
5832 NewControlId = staticmethod(NewControlId)
5833 def NextControlId(*args, **kwargs):
5834 """
5835 NextControlId(int winid) -> int
5836
5837 Get the id of the control following the one with the given
5838 autogenerated) id
5839 """
5840 return _core_.Window_NextControlId(*args, **kwargs)
5841
5842 NextControlId = staticmethod(NextControlId)
5843 def PrevControlId(*args, **kwargs):
5844 """
5845 PrevControlId(int winid) -> int
5846
5847 Get the id of the control preceding the one with the given
5848 autogenerated) id
5849 """
5850 return _core_.Window_PrevControlId(*args, **kwargs)
5851
5852 PrevControlId = staticmethod(PrevControlId)
5853 def SetSize(*args, **kwargs):
5854 """
5855 SetSize(self, Size size)
5856
5857 Sets the size of the window in pixels.
5858 """
5859 return _core_.Window_SetSize(*args, **kwargs)
5860
5861 def SetDimensions(*args, **kwargs):
5862 """
5863 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
5864
5865 Sets the position and size of the window in pixels. The sizeFlags
5866 parameter indicates the interpretation of the other params if they are
5867 -1. wx.SIZE_AUTO*: a -1 indicates that a class-specific default
5868 shoudl be used. wx.SIZE_USE_EXISTING: existing dimensions should be
5869 used if -1 values are supplied. wxSIZE_ALLOW_MINUS_ONE: allow
5870 dimensions of -1 and less to be interpreted as real dimensions, not
5871 default values.
5872 """
5873 return _core_.Window_SetDimensions(*args, **kwargs)
5874
5875 def SetRect(*args, **kwargs):
5876 """
5877 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
5878
5879 Sets the position and size of the window in pixels using a wx.Rect.
5880 """
5881 return _core_.Window_SetRect(*args, **kwargs)
5882
5883 def SetSizeWH(*args, **kwargs):
5884 """
5885 SetSizeWH(self, int width, int height)
5886
5887 Sets the size of the window in pixels.
5888 """
5889 return _core_.Window_SetSizeWH(*args, **kwargs)
5890
5891 def Move(*args, **kwargs):
5892 """
5893 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
5894
5895 Moves the window to the given position.
5896 """
5897 return _core_.Window_Move(*args, **kwargs)
5898
5899 SetPosition = Move
5900 def MoveXY(*args, **kwargs):
5901 """
5902 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
5903
5904 Moves the window to the given position.
5905 """
5906 return _core_.Window_MoveXY(*args, **kwargs)
5907
5908 def SetBestFittingSize(*args, **kwargs):
5909 """
5910 SetBestFittingSize(self, Size size=DefaultSize)
5911
5912 A 'Smart' SetSize that will fill in default size components with the
5913 window's *best size* values. Also set's the minsize for use with sizers.
5914 """
5915 return _core_.Window_SetBestFittingSize(*args, **kwargs)
5916
5917 def Raise(*args, **kwargs):
5918 """
5919 Raise(self)
5920
5921 Raises the window to the top of the window hierarchy if it is a
5922 managed window (dialog or frame).
5923 """
5924 return _core_.Window_Raise(*args, **kwargs)
5925
5926 def Lower(*args, **kwargs):
5927 """
5928 Lower(self)
5929
5930 Lowers the window to the bottom of the window hierarchy if it is a
5931 managed window (dialog or frame).
5932 """
5933 return _core_.Window_Lower(*args, **kwargs)
5934
5935 def SetClientSize(*args, **kwargs):
5936 """
5937 SetClientSize(self, Size size)
5938
5939 This sets the size of the window client area in pixels. Using this
5940 function to size a window tends to be more device-independent than
5941 wx.Window.SetSize, since the application need not worry about what
5942 dimensions the border or title bar have when trying to fit the window
5943 around panel items, for example.
5944 """
5945 return _core_.Window_SetClientSize(*args, **kwargs)
5946
5947 def SetClientSizeWH(*args, **kwargs):
5948 """
5949 SetClientSizeWH(self, int width, int height)
5950
5951 This sets the size of the window client area in pixels. Using this
5952 function to size a window tends to be more device-independent than
5953 wx.Window.SetSize, since the application need not worry about what
5954 dimensions the border or title bar have when trying to fit the window
5955 around panel items, for example.
5956 """
5957 return _core_.Window_SetClientSizeWH(*args, **kwargs)
5958
5959 def SetClientRect(*args, **kwargs):
5960 """
5961 SetClientRect(self, Rect rect)
5962
5963 This sets the size of the window client area in pixels. Using this
5964 function to size a window tends to be more device-independent than
5965 wx.Window.SetSize, since the application need not worry about what
5966 dimensions the border or title bar have when trying to fit the window
5967 around panel items, for example.
5968 """
5969 return _core_.Window_SetClientRect(*args, **kwargs)
5970
5971 def GetPosition(*args, **kwargs):
5972 """
5973 GetPosition(self) -> Point
5974
5975 Get the window's position.
5976 """
5977 return _core_.Window_GetPosition(*args, **kwargs)
5978
5979 def GetPositionTuple(*args, **kwargs):
5980 """
5981 GetPositionTuple() -> (x,y)
5982
5983 Get the window's position.
5984 """
5985 return _core_.Window_GetPositionTuple(*args, **kwargs)
5986
5987 def GetSize(*args, **kwargs):
5988 """
5989 GetSize(self) -> Size
5990
5991 Get the window size.
5992 """
5993 return _core_.Window_GetSize(*args, **kwargs)
5994
5995 def GetSizeTuple(*args, **kwargs):
5996 """
5997 GetSizeTuple() -> (width, height)
5998
5999 Get the window size.
6000 """
6001 return _core_.Window_GetSizeTuple(*args, **kwargs)
6002
6003 def GetRect(*args, **kwargs):
6004 """
6005 GetRect(self) -> Rect
6006
6007 Returns the size and position of the window as a wx.Rect object.
6008 """
6009 return _core_.Window_GetRect(*args, **kwargs)
6010
6011 def GetClientSize(*args, **kwargs):
6012 """
6013 GetClientSize(self) -> Size
6014
6015 This gets the size of the window's 'client area' in pixels. The client
6016 area is the area which may be drawn on by the programmer, excluding
6017 title bar, border, scrollbars, etc.
6018 """
6019 return _core_.Window_GetClientSize(*args, **kwargs)
6020
6021 def GetClientSizeTuple(*args, **kwargs):
6022 """
6023 GetClientSizeTuple() -> (width, height)
6024
6025 This gets the size of the window's 'client area' in pixels. The client
6026 area is the area which may be drawn on by the programmer, excluding
6027 title bar, border, scrollbars, etc.
6028 """
6029 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
6030
6031 def GetClientAreaOrigin(*args, **kwargs):
6032 """
6033 GetClientAreaOrigin(self) -> Point
6034
6035 Get the origin of the client area of the window relative to the
6036 window's top left corner (the client area may be shifted because of
6037 the borders, scrollbars, other decorations...)
6038 """
6039 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
6040
6041 def GetClientRect(*args, **kwargs):
6042 """
6043 GetClientRect(self) -> Rect
6044
6045 Get the client area position and size as a `wx.Rect` object.
6046 """
6047 return _core_.Window_GetClientRect(*args, **kwargs)
6048
6049 def GetBestSize(*args, **kwargs):
6050 """
6051 GetBestSize(self) -> Size
6052
6053 This function returns the best acceptable minimal size for the
6054 window, if applicable. For example, for a static text control, it will
6055 be the minimal size such that the control label is not truncated. For
6056 windows containing subwindows (suzh aswx.Panel), the size returned by
6057 this function will be the same as the size the window would have had
6058 after calling Fit.
6059 """
6060 return _core_.Window_GetBestSize(*args, **kwargs)
6061
6062 def GetBestSizeTuple(*args, **kwargs):
6063 """
6064 GetBestSizeTuple() -> (width, height)
6065
6066 This function returns the best acceptable minimal size for the
6067 window, if applicable. For example, for a static text control, it will
6068 be the minimal size such that the control label is not truncated. For
6069 windows containing subwindows (suzh aswx.Panel), the size returned by
6070 this function will be the same as the size the window would have had
6071 after calling Fit.
6072 """
6073 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
6074
6075 def InvalidateBestSize(*args, **kwargs):
6076 """
6077 InvalidateBestSize(self)
6078
6079 Reset the cached best size value so it will be recalculated the next
6080 time it is needed.
6081 """
6082 return _core_.Window_InvalidateBestSize(*args, **kwargs)
6083
6084 def GetBestFittingSize(*args, **kwargs):
6085 """
6086 GetBestFittingSize(self) -> Size
6087
6088 This function will merge the window's best size into the window's
6089 minimum size, giving priority to the min size components, and returns
6090 the results.
6091
6092 """
6093 return _core_.Window_GetBestFittingSize(*args, **kwargs)
6094
6095 def GetAdjustedBestSize(*args, **kwargs):
6096 """
6097 GetAdjustedBestSize(self) -> Size
6098
6099 This method is similar to GetBestSize, except in one
6100 thing. GetBestSize should return the minimum untruncated size of the
6101 window, while this method will return the largest of BestSize and any
6102 user specified minimum size. ie. it is the minimum size the window
6103 should currently be drawn at, not the minimal size it can possibly
6104 tolerate.
6105 """
6106 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
6107
6108 def Center(*args, **kwargs):
6109 """
6110 Center(self, int direction=BOTH)
6111
6112 Centers the window. The parameter specifies the direction for
6113 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
6114 also include wx.CENTER_ON_SCREEN flag if you want to center the window
6115 on the entire screen and not on its parent window. If it is a
6116 top-level window and has no parent then it will always be centered
6117 relative to the screen.
6118 """
6119 return _core_.Window_Center(*args, **kwargs)
6120
6121 Centre = Center
6122 def CenterOnScreen(*args, **kwargs):
6123 """
6124 CenterOnScreen(self, int dir=BOTH)
6125
6126 Center on screen (only works for top level windows)
6127 """
6128 return _core_.Window_CenterOnScreen(*args, **kwargs)
6129
6130 CentreOnScreen = CenterOnScreen
6131 def CenterOnParent(*args, **kwargs):
6132 """
6133 CenterOnParent(self, int dir=BOTH)
6134
6135 Center with respect to the the parent window
6136 """
6137 return _core_.Window_CenterOnParent(*args, **kwargs)
6138
6139 CentreOnParent = CenterOnParent
6140 def Fit(*args, **kwargs):
6141 """
6142 Fit(self)
6143
6144 Sizes the window so that it fits around its subwindows. This function
6145 won't do anything if there are no subwindows and will only really work
6146 correctly if sizers are used for the subwindows layout. Also, if the
6147 window has exactly one subwindow it is better (faster and the result
6148 is more precise as Fit adds some margin to account for fuzziness of
6149 its calculations) to call window.SetClientSize(child.GetSize())
6150 instead of calling Fit.
6151 """
6152 return _core_.Window_Fit(*args, **kwargs)
6153
6154 def FitInside(*args, **kwargs):
6155 """
6156 FitInside(self)
6157
6158 Similar to Fit, but sizes the interior (virtual) size of a
6159 window. Mainly useful with scrolled windows to reset scrollbars after
6160 sizing changes that do not trigger a size event, and/or scrolled
6161 windows without an interior sizer. This function similarly won't do
6162 anything if there are no subwindows.
6163 """
6164 return _core_.Window_FitInside(*args, **kwargs)
6165
6166 def SetSizeHints(*args, **kwargs):
6167 """
6168 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
6169 int incH=-1)
6170
6171 Allows specification of minimum and maximum window sizes, and window
6172 size increments. If a pair of values is not set (or set to -1), the
6173 default values will be used. If this function is called, the user
6174 will not be able to size the window outside the given bounds (if it is
6175 a top-level window.) Sizers will also inspect the minimum window size
6176 and will use that value if set when calculating layout.
6177
6178 The resizing increments are only significant under Motif or Xt.
6179 """
6180 return _core_.Window_SetSizeHints(*args, **kwargs)
6181
6182 def SetSizeHintsSz(*args, **kwargs):
6183 """
6184 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
6185
6186 Allows specification of minimum and maximum window sizes, and window
6187 size increments. If a pair of values is not set (or set to -1), the
6188 default values will be used. If this function is called, the user
6189 will not be able to size the window outside the given bounds (if it is
6190 a top-level window.) Sizers will also inspect the minimum window size
6191 and will use that value if set when calculating layout.
6192
6193 The resizing increments are only significant under Motif or Xt.
6194 """
6195 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
6196
6197 def SetVirtualSizeHints(*args, **kwargs):
6198 """
6199 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
6200
6201 Allows specification of minimum and maximum virtual window sizes. If a
6202 pair of values is not set (or set to -1), the default values will be
6203 used. If this function is called, the user will not be able to size
6204 the virtual area of the window outside the given bounds.
6205 """
6206 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
6207
6208 def SetVirtualSizeHintsSz(*args, **kwargs):
6209 """
6210 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
6211
6212 Allows specification of minimum and maximum virtual window sizes. If a
6213 pair of values is not set (or set to -1), the default values will be
6214 used. If this function is called, the user will not be able to size
6215 the virtual area of the window outside the given bounds.
6216 """
6217 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
6218
6219 def GetMaxSize(*args, **kwargs):
6220 """GetMaxSize(self) -> Size"""
6221 return _core_.Window_GetMaxSize(*args, **kwargs)
6222
6223 def GetMinSize(*args, **kwargs):
6224 """GetMinSize(self) -> Size"""
6225 return _core_.Window_GetMinSize(*args, **kwargs)
6226
6227 def SetMinSize(*args, **kwargs):
6228 """
6229 SetMinSize(self, Size minSize)
6230
6231 A more convenient method than `SetSizeHints` for setting just the
6232 min size.
6233 """
6234 return _core_.Window_SetMinSize(*args, **kwargs)
6235
6236 def SetMaxSize(*args, **kwargs):
6237 """
6238 SetMaxSize(self, Size maxSize)
6239
6240 A more convenient method than `SetSizeHints` for setting just the
6241 max size.
6242 """
6243 return _core_.Window_SetMaxSize(*args, **kwargs)
6244
6245 def GetMinWidth(*args, **kwargs):
6246 """GetMinWidth(self) -> int"""
6247 return _core_.Window_GetMinWidth(*args, **kwargs)
6248
6249 def GetMinHeight(*args, **kwargs):
6250 """GetMinHeight(self) -> int"""
6251 return _core_.Window_GetMinHeight(*args, **kwargs)
6252
6253 def GetMaxWidth(*args, **kwargs):
6254 """GetMaxWidth(self) -> int"""
6255 return _core_.Window_GetMaxWidth(*args, **kwargs)
6256
6257 def GetMaxHeight(*args, **kwargs):
6258 """GetMaxHeight(self) -> int"""
6259 return _core_.Window_GetMaxHeight(*args, **kwargs)
6260
6261 def SetVirtualSize(*args, **kwargs):
6262 """
6263 SetVirtualSize(self, Size size)
6264
6265 Set the the virtual size of a window in pixels. For most windows this
6266 is just the client area of the window, but for some like scrolled
6267 windows it is more or less independent of the screen window size.
6268 """
6269 return _core_.Window_SetVirtualSize(*args, **kwargs)
6270
6271 def SetVirtualSizeWH(*args, **kwargs):
6272 """
6273 SetVirtualSizeWH(self, int w, int h)
6274
6275 Set the the virtual size of a window in pixels. For most windows this
6276 is just the client area of the window, but for some like scrolled
6277 windows it is more or less independent of the screen window size.
6278 """
6279 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
6280
6281 def GetVirtualSize(*args, **kwargs):
6282 """
6283 GetVirtualSize(self) -> Size
6284
6285 Get the the virtual size of the window in pixels. For most windows
6286 this is just the client area of the window, but for some like scrolled
6287 windows it is more or less independent of the screen window size.
6288 """
6289 return _core_.Window_GetVirtualSize(*args, **kwargs)
6290
6291 def GetVirtualSizeTuple(*args, **kwargs):
6292 """
6293 GetVirtualSizeTuple() -> (width, height)
6294
6295 Get the the virtual size of the window in pixels. For most windows
6296 this is just the client area of the window, but for some like scrolled
6297 windows it is more or less independent of the screen window size.
6298 """
6299 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
6300
6301 def GetBestVirtualSize(*args, **kwargs):
6302 """
6303 GetBestVirtualSize(self) -> Size
6304
6305 Return the largest of ClientSize and BestSize (as determined by a
6306 sizer, interior children, or other means)
6307 """
6308 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
6309
6310 def Show(*args, **kwargs):
6311 """
6312 Show(self, bool show=True) -> bool
6313
6314 Shows or hides the window. You may need to call Raise for a top level
6315 window if you want to bring it to top, although this is not needed if
6316 Show is called immediately after the frame creation. Returns True if
6317 the window has been shown or hidden or False if nothing was done
6318 because it already was in the requested state.
6319 """
6320 return _core_.Window_Show(*args, **kwargs)
6321
6322 def Hide(*args, **kwargs):
6323 """
6324 Hide(self) -> bool
6325
6326 Equivalent to calling Show(False).
6327 """
6328 return _core_.Window_Hide(*args, **kwargs)
6329
6330 def Enable(*args, **kwargs):
6331 """
6332 Enable(self, bool enable=True) -> bool
6333
6334 Enable or disable the window for user input. Note that when a parent
6335 window is disabled, all of its children are disabled as well and they
6336 are reenabled again when the parent is. Returns true if the window
6337 has been enabled or disabled, false if nothing was done, i.e. if the
6338 window had already been in the specified state.
6339 """
6340 return _core_.Window_Enable(*args, **kwargs)
6341
6342 def Disable(*args, **kwargs):
6343 """
6344 Disable(self) -> bool
6345
6346 Disables the window, same as Enable(false).
6347 """
6348 return _core_.Window_Disable(*args, **kwargs)
6349
6350 def IsShown(*args, **kwargs):
6351 """
6352 IsShown(self) -> bool
6353
6354 Returns true if the window is shown, false if it has been hidden.
6355 """
6356 return _core_.Window_IsShown(*args, **kwargs)
6357
6358 def IsEnabled(*args, **kwargs):
6359 """
6360 IsEnabled(self) -> bool
6361
6362 Returns true if the window is enabled for input, false otherwise.
6363 """
6364 return _core_.Window_IsEnabled(*args, **kwargs)
6365
6366 def SetWindowStyleFlag(*args, **kwargs):
6367 """
6368 SetWindowStyleFlag(self, long style)
6369
6370 Sets the style of the window. Please note that some styles cannot be
6371 changed after the window creation and that Refresh() might need to be
6372 called after changing the others for the change to take place
6373 immediately.
6374 """
6375 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
6376
6377 def GetWindowStyleFlag(*args, **kwargs):
6378 """
6379 GetWindowStyleFlag(self) -> long
6380
6381 Gets the window style that was passed to the constructor or Create
6382 method.
6383 """
6384 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
6385
6386 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
6387 def HasFlag(*args, **kwargs):
6388 """
6389 HasFlag(self, int flag) -> bool
6390
6391 Test if the given style is set for this window.
6392 """
6393 return _core_.Window_HasFlag(*args, **kwargs)
6394
6395 def IsRetained(*args, **kwargs):
6396 """
6397 IsRetained(self) -> bool
6398
6399 Returns true if the window is retained, false otherwise. Retained
6400 windows are only available on X platforms.
6401 """
6402 return _core_.Window_IsRetained(*args, **kwargs)
6403
6404 def SetExtraStyle(*args, **kwargs):
6405 """
6406 SetExtraStyle(self, long exStyle)
6407
6408 Sets the extra style bits for the window. Extra styles are the less
6409 often used style bits which can't be set with the constructor or with
6410 SetWindowStyleFlag()
6411 """
6412 return _core_.Window_SetExtraStyle(*args, **kwargs)
6413
6414 def GetExtraStyle(*args, **kwargs):
6415 """
6416 GetExtraStyle(self) -> long
6417
6418 Returns the extra style bits for the window.
6419 """
6420 return _core_.Window_GetExtraStyle(*args, **kwargs)
6421
6422 def MakeModal(*args, **kwargs):
6423 """
6424 MakeModal(self, bool modal=True)
6425
6426 Disables all other windows in the application so that the user can
6427 only interact with this window. Passing False will reverse this
6428 effect.
6429 """
6430 return _core_.Window_MakeModal(*args, **kwargs)
6431
6432 def SetThemeEnabled(*args, **kwargs):
6433 """
6434 SetThemeEnabled(self, bool enableTheme)
6435
6436 This function tells a window if it should use the system's "theme"
6437 code to draw the windows' background instead if its own background
6438 drawing code. This will only have an effect on platforms that support
6439 the notion of themes in user defined windows. One such platform is
6440 GTK+ where windows can have (very colourful) backgrounds defined by a
6441 user's selected theme.
6442
6443 Dialogs, notebook pages and the status bar have this flag set to true
6444 by default so that the default look and feel is simulated best.
6445 """
6446 return _core_.Window_SetThemeEnabled(*args, **kwargs)
6447
6448 def GetThemeEnabled(*args, **kwargs):
6449 """
6450 GetThemeEnabled(self) -> bool
6451
6452 Return the themeEnabled flag.
6453 """
6454 return _core_.Window_GetThemeEnabled(*args, **kwargs)
6455
6456 def SetFocus(*args, **kwargs):
6457 """
6458 SetFocus(self)
6459
6460 Set's the focus to this window, allowing it to receive keyboard input.
6461 """
6462 return _core_.Window_SetFocus(*args, **kwargs)
6463
6464 def SetFocusFromKbd(*args, **kwargs):
6465 """
6466 SetFocusFromKbd(self)
6467
6468 Set focus to this window as the result of a keyboard action. Normally
6469 only called internally.
6470 """
6471 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
6472
6473 def FindFocus(*args, **kwargs):
6474 """
6475 FindFocus() -> Window
6476
6477 Returns the window or control that currently has the keyboard focus,
6478 or None.
6479 """
6480 return _core_.Window_FindFocus(*args, **kwargs)
6481
6482 FindFocus = staticmethod(FindFocus)
6483 def AcceptsFocus(*args, **kwargs):
6484 """
6485 AcceptsFocus(self) -> bool
6486
6487 Can this window have focus?
6488 """
6489 return _core_.Window_AcceptsFocus(*args, **kwargs)
6490
6491 def AcceptsFocusFromKeyboard(*args, **kwargs):
6492 """
6493 AcceptsFocusFromKeyboard(self) -> bool
6494
6495 Can this window be given focus by keyboard navigation? if not, the
6496 only way to give it focus (provided it accepts it at all) is to click
6497 it.
6498 """
6499 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
6500
6501 def GetDefaultItem(*args, **kwargs):
6502 """
6503 GetDefaultItem(self) -> Window
6504
6505 Get the default child of this parent, i.e. the one which is activated
6506 by pressing <Enter> such as the OK button on a wx.Dialog.
6507 """
6508 return _core_.Window_GetDefaultItem(*args, **kwargs)
6509
6510 def SetDefaultItem(*args, **kwargs):
6511 """
6512 SetDefaultItem(self, Window child) -> Window
6513
6514 Set this child as default, return the old default.
6515 """
6516 return _core_.Window_SetDefaultItem(*args, **kwargs)
6517
6518 def SetTmpDefaultItem(*args, **kwargs):
6519 """
6520 SetTmpDefaultItem(self, Window win)
6521
6522 Set this child as temporary default
6523 """
6524 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
6525
6526 def Navigate(*args, **kwargs):
6527 """
6528 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
6529
6530 Does keyboard navigation from this window to another, by sending a
6531 `wx.NavigationKeyEvent`.
6532 """
6533 return _core_.Window_Navigate(*args, **kwargs)
6534
6535 def MoveAfterInTabOrder(*args, **kwargs):
6536 """
6537 MoveAfterInTabOrder(self, Window win)
6538
6539 Moves this window in the tab navigation order after the specified
6540 sibling window. This means that when the user presses the TAB key on
6541 that other window, the focus switches to this window.
6542
6543 The default tab order is the same as creation order. This function
6544 and `MoveBeforeInTabOrder` allow to change it after creating all the
6545 windows.
6546
6547 """
6548 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
6549
6550 def MoveBeforeInTabOrder(*args, **kwargs):
6551 """
6552 MoveBeforeInTabOrder(self, Window win)
6553
6554 Same as `MoveAfterInTabOrder` except that it inserts this window just
6555 before win instead of putting it right after it.
6556 """
6557 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
6558
6559 def GetChildren(*args, **kwargs):
6560 """
6561 GetChildren(self) -> PyObject
6562
6563 Returns a list of the window's children. NOTE: Currently this is a
6564 copy of the child window list maintained by the window, so the return
6565 value of this function is only valid as long as the window's children
6566 do not change.
6567 """
6568 return _core_.Window_GetChildren(*args, **kwargs)
6569
6570 def GetParent(*args, **kwargs):
6571 """
6572 GetParent(self) -> Window
6573
6574 Returns the parent window of this window, or None if there isn't one.
6575 """
6576 return _core_.Window_GetParent(*args, **kwargs)
6577
6578 def GetGrandParent(*args, **kwargs):
6579 """
6580 GetGrandParent(self) -> Window
6581
6582 Returns the parent of the parent of this window, or None if there
6583 isn't one.
6584 """
6585 return _core_.Window_GetGrandParent(*args, **kwargs)
6586
6587 def IsTopLevel(*args, **kwargs):
6588 """
6589 IsTopLevel(self) -> bool
6590
6591 Returns true if the given window is a top-level one. Currently all
6592 frames and dialogs are always considered to be top-level windows (even
6593 if they have a parent window).
6594 """
6595 return _core_.Window_IsTopLevel(*args, **kwargs)
6596
6597 def Reparent(*args, **kwargs):
6598 """
6599 Reparent(self, Window newParent) -> bool
6600
6601 Reparents the window, i.e the window will be removed from its current
6602 parent window (e.g. a non-standard toolbar in a wxFrame) and then
6603 re-inserted into another. Available on Windows and GTK. Returns True
6604 if the parent was changed, False otherwise (error or newParent ==
6605 oldParent)
6606 """
6607 return _core_.Window_Reparent(*args, **kwargs)
6608
6609 def AddChild(*args, **kwargs):
6610 """
6611 AddChild(self, Window child)
6612
6613 Adds a child window. This is called automatically by window creation
6614 functions so should not be required by the application programmer.
6615 """
6616 return _core_.Window_AddChild(*args, **kwargs)
6617
6618 def RemoveChild(*args, **kwargs):
6619 """
6620 RemoveChild(self, Window child)
6621
6622 Removes a child window. This is called automatically by window
6623 deletion functions so should not be required by the application
6624 programmer.
6625 """
6626 return _core_.Window_RemoveChild(*args, **kwargs)
6627
6628 def FindWindowById(*args, **kwargs):
6629 """
6630 FindWindowById(self, long winid) -> Window
6631
6632 Find a chld of this window by window ID
6633 """
6634 return _core_.Window_FindWindowById(*args, **kwargs)
6635
6636 def FindWindowByName(*args, **kwargs):
6637 """
6638 FindWindowByName(self, String name) -> Window
6639
6640 Find a child of this window by name
6641 """
6642 return _core_.Window_FindWindowByName(*args, **kwargs)
6643
6644 def GetEventHandler(*args, **kwargs):
6645 """
6646 GetEventHandler(self) -> EvtHandler
6647
6648 Returns the event handler for this window. By default, the window is
6649 its own event handler.
6650 """
6651 return _core_.Window_GetEventHandler(*args, **kwargs)
6652
6653 def SetEventHandler(*args, **kwargs):
6654 """
6655 SetEventHandler(self, EvtHandler handler)
6656
6657 Sets the event handler for this window. An event handler is an object
6658 that is capable of processing the events sent to a window. By default,
6659 the window is its own event handler, but an application may wish to
6660 substitute another, for example to allow central implementation of
6661 event-handling for a variety of different window classes.
6662
6663 It is usually better to use `wx.Window.PushEventHandler` since this sets
6664 up a chain of event handlers, where an event not handled by one event
6665 handler is handed to the next one in the chain.
6666 """
6667 return _core_.Window_SetEventHandler(*args, **kwargs)
6668
6669 def PushEventHandler(*args, **kwargs):
6670 """
6671 PushEventHandler(self, EvtHandler handler)
6672
6673 Pushes this event handler onto the event handler stack for the window.
6674 An event handler is an object that is capable of processing the events
6675 sent to a window. By default, the window is its own event handler, but
6676 an application may wish to substitute another, for example to allow
6677 central implementation of event-handling for a variety of different
6678 window classes.
6679
6680 wx.Window.PushEventHandler allows an application to set up a chain of
6681 event handlers, where an event not handled by one event handler is
6682 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
6683 remove the event handler.
6684 """
6685 return _core_.Window_PushEventHandler(*args, **kwargs)
6686
6687 def PopEventHandler(*args, **kwargs):
6688 """
6689 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
6690
6691 Removes and returns the top-most event handler on the event handler
6692 stack. If deleteHandler is True then the wx.EvtHandler object will be
6693 destroyed after it is popped.
6694 """
6695 return _core_.Window_PopEventHandler(*args, **kwargs)
6696
6697 def RemoveEventHandler(*args, **kwargs):
6698 """
6699 RemoveEventHandler(self, EvtHandler handler) -> bool
6700
6701 Find the given handler in the event handler chain and remove (but not
6702 delete) it from the event handler chain, return True if it was found
6703 and False otherwise (this also results in an assert failure so this
6704 function should only be called when the handler is supposed to be
6705 there.)
6706 """
6707 return _core_.Window_RemoveEventHandler(*args, **kwargs)
6708
6709 def SetValidator(*args, **kwargs):
6710 """
6711 SetValidator(self, Validator validator)
6712
6713 Deletes the current validator (if any) and sets the window validator,
6714 having called wx.Validator.Clone to create a new validator of this
6715 type.
6716 """
6717 return _core_.Window_SetValidator(*args, **kwargs)
6718
6719 def GetValidator(*args, **kwargs):
6720 """
6721 GetValidator(self) -> Validator
6722
6723 Returns a pointer to the current validator for the window, or None if
6724 there is none.
6725 """
6726 return _core_.Window_GetValidator(*args, **kwargs)
6727
6728 def Validate(*args, **kwargs):
6729 """
6730 Validate(self) -> bool
6731
6732 Validates the current values of the child controls using their
6733 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6734 style flag set, the method will also call Validate() of all child
6735 windows. Returns false if any of the validations failed.
6736 """
6737 return _core_.Window_Validate(*args, **kwargs)
6738
6739 def TransferDataToWindow(*args, **kwargs):
6740 """
6741 TransferDataToWindow(self) -> bool
6742
6743 Transfers values to child controls from data areas specified by their
6744 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
6745 style flag set, the method will also call TransferDataToWindow() of
6746 all child windows.
6747 """
6748 return _core_.Window_TransferDataToWindow(*args, **kwargs)
6749
6750 def TransferDataFromWindow(*args, **kwargs):
6751 """
6752 TransferDataFromWindow(self) -> bool
6753
6754 Transfers values from child controls to data areas specified by their
6755 validators. Returns false if a transfer failed. If the window has
6756 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
6757 also call TransferDataFromWindow() of all child windows.
6758 """
6759 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
6760
6761 def InitDialog(*args, **kwargs):
6762 """
6763 InitDialog(self)
6764
6765 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
6766 to the dialog via validators.
6767 """
6768 return _core_.Window_InitDialog(*args, **kwargs)
6769
6770 def SetAcceleratorTable(*args, **kwargs):
6771 """
6772 SetAcceleratorTable(self, AcceleratorTable accel)
6773
6774 Sets the accelerator table for this window.
6775 """
6776 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
6777
6778 def GetAcceleratorTable(*args, **kwargs):
6779 """
6780 GetAcceleratorTable(self) -> AcceleratorTable
6781
6782 Gets the accelerator table for this window.
6783 """
6784 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
6785
6786 def RegisterHotKey(*args, **kwargs):
6787 """
6788 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
6789
6790 Registers a system wide hotkey. Every time the user presses the hotkey
6791 registered here, this window will receive a hotkey event. It will
6792 receive the event even if the application is in the background and
6793 does not have the input focus because the user is working with some
6794 other application. To bind an event handler function to this hotkey
6795 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
6796 hotkey was registered successfully.
6797 """
6798 return _core_.Window_RegisterHotKey(*args, **kwargs)
6799
6800 def UnregisterHotKey(*args, **kwargs):
6801 """
6802 UnregisterHotKey(self, int hotkeyId) -> bool
6803
6804 Unregisters a system wide hotkey.
6805 """
6806 return _core_.Window_UnregisterHotKey(*args, **kwargs)
6807
6808 def ConvertDialogPointToPixels(*args, **kwargs):
6809 """
6810 ConvertDialogPointToPixels(self, Point pt) -> Point
6811
6812 Converts a point or size from dialog units to pixels. Dialog units
6813 are used for maintaining a dialog's proportions even if the font
6814 changes. For the x dimension, the dialog units are multiplied by the
6815 average character width and then divided by 4. For the y dimension,
6816 the dialog units are multiplied by the average character height and
6817 then divided by 8.
6818 """
6819 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
6820
6821 def ConvertDialogSizeToPixels(*args, **kwargs):
6822 """
6823 ConvertDialogSizeToPixels(self, Size sz) -> Size
6824
6825 Converts a point or size from dialog units to pixels. Dialog units
6826 are used for maintaining a dialog's proportions even if the font
6827 changes. For the x dimension, the dialog units are multiplied by the
6828 average character width and then divided by 4. For the y dimension,
6829 the dialog units are multiplied by the average character height and
6830 then divided by 8.
6831 """
6832 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
6833
6834 def DLG_PNT(*args, **kwargs):
6835 """
6836 DLG_PNT(self, Point pt) -> Point
6837
6838 Converts a point or size from dialog units to pixels. Dialog units
6839 are used for maintaining a dialog's proportions even if the font
6840 changes. For the x dimension, the dialog units are multiplied by the
6841 average character width and then divided by 4. For the y dimension,
6842 the dialog units are multiplied by the average character height and
6843 then divided by 8.
6844 """
6845 return _core_.Window_DLG_PNT(*args, **kwargs)
6846
6847 def DLG_SZE(*args, **kwargs):
6848 """
6849 DLG_SZE(self, Size sz) -> Size
6850
6851 Converts a point or size from dialog units to pixels. Dialog units
6852 are used for maintaining a dialog's proportions even if the font
6853 changes. For the x dimension, the dialog units are multiplied by the
6854 average character width and then divided by 4. For the y dimension,
6855 the dialog units are multiplied by the average character height and
6856 then divided by 8.
6857 """
6858 return _core_.Window_DLG_SZE(*args, **kwargs)
6859
6860 def ConvertPixelPointToDialog(*args, **kwargs):
6861 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
6862 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
6863
6864 def ConvertPixelSizeToDialog(*args, **kwargs):
6865 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
6866 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
6867
6868 def WarpPointer(*args, **kwargs):
6869 """
6870 WarpPointer(self, int x, int y)
6871
6872 Moves the pointer to the given position on the window.
6873
6874 NOTE: This function is not supported under Mac because Apple Human
6875 Interface Guidelines forbid moving the mouse cursor programmatically.
6876 """
6877 return _core_.Window_WarpPointer(*args, **kwargs)
6878
6879 def CaptureMouse(*args, **kwargs):
6880 """
6881 CaptureMouse(self)
6882
6883 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
6884 release the capture.
6885
6886 Note that wxWindows maintains the stack of windows having captured the
6887 mouse and when the mouse is released the capture returns to the window
6888 which had had captured it previously and it is only really released if
6889 there were no previous window. In particular, this means that you must
6890 release the mouse as many times as you capture it.
6891 """
6892 return _core_.Window_CaptureMouse(*args, **kwargs)
6893
6894 def ReleaseMouse(*args, **kwargs):
6895 """
6896 ReleaseMouse(self)
6897
6898 Releases mouse input captured with wx.Window.CaptureMouse.
6899 """
6900 return _core_.Window_ReleaseMouse(*args, **kwargs)
6901
6902 def GetCapture(*args, **kwargs):
6903 """
6904 GetCapture() -> Window
6905
6906 Returns the window which currently captures the mouse or None
6907 """
6908 return _core_.Window_GetCapture(*args, **kwargs)
6909
6910 GetCapture = staticmethod(GetCapture)
6911 def HasCapture(*args, **kwargs):
6912 """
6913 HasCapture(self) -> bool
6914
6915 Returns true if this window has the current mouse capture.
6916 """
6917 return _core_.Window_HasCapture(*args, **kwargs)
6918
6919 def Refresh(*args, **kwargs):
6920 """
6921 Refresh(self, bool eraseBackground=True, Rect rect=None)
6922
6923 Mark the specified rectangle (or the whole window) as "dirty" so it
6924 will be repainted. Causes an EVT_PAINT event to be generated and sent
6925 to the window.
6926 """
6927 return _core_.Window_Refresh(*args, **kwargs)
6928
6929 def RefreshRect(*args, **kwargs):
6930 """
6931 RefreshRect(self, Rect rect)
6932
6933 Redraws the contents of the given rectangle: the area inside it will
6934 be repainted. This is the same as Refresh but has a nicer syntax.
6935 """
6936 return _core_.Window_RefreshRect(*args, **kwargs)
6937
6938 def Update(*args, **kwargs):
6939 """
6940 Update(self)
6941
6942 Calling this method immediately repaints the invalidated area of the
6943 window instead of waiting for the EVT_PAINT event to happen, (normally
6944 this would usually only happen when the flow of control returns to the
6945 event loop.) Notice that this function doesn't refresh the window and
6946 does nothing if the window has been already repainted. Use Refresh
6947 first if you want to immediately redraw the window (or some portion of
6948 it) unconditionally.
6949 """
6950 return _core_.Window_Update(*args, **kwargs)
6951
6952 def ClearBackground(*args, **kwargs):
6953 """
6954 ClearBackground(self)
6955
6956 Clears the window by filling it with the current background
6957 colour. Does not cause an erase background event to be generated.
6958 """
6959 return _core_.Window_ClearBackground(*args, **kwargs)
6960
6961 def Freeze(*args, **kwargs):
6962 """
6963 Freeze(self)
6964
6965 Freezes the window or, in other words, prevents any updates from
6966 taking place on screen, the window is not redrawn at all. Thaw must be
6967 called to reenable window redrawing. Calls to Freeze/Thaw may be
6968 nested, with the actual Thaw being delayed until all the nesting has
6969 been undone.
6970
6971 This method is useful for visual appearance optimization (for example,
6972 it is a good idea to use it before inserting large amount of text into
6973 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
6974 for all controls so it is mostly just a hint to wxWindows and not a
6975 mandatory directive.
6976 """
6977 return _core_.Window_Freeze(*args, **kwargs)
6978
6979 def Thaw(*args, **kwargs):
6980 """
6981 Thaw(self)
6982
6983 Reenables window updating after a previous call to Freeze. Calls to
6984 Freeze/Thaw may be nested, so Thaw must be called the same number of
6985 times that Freeze was before the window will be updated.
6986 """
6987 return _core_.Window_Thaw(*args, **kwargs)
6988
6989 def PrepareDC(*args, **kwargs):
6990 """
6991 PrepareDC(self, DC dc)
6992
6993 Call this function to prepare the device context for drawing a
6994 scrolled image. It sets the device origin according to the current
6995 scroll position.
6996 """
6997 return _core_.Window_PrepareDC(*args, **kwargs)
6998
6999 def GetUpdateRegion(*args, **kwargs):
7000 """
7001 GetUpdateRegion(self) -> Region
7002
7003 Returns the region specifying which parts of the window have been
7004 damaged. Should only be called within an EVT_PAINT handler.
7005 """
7006 return _core_.Window_GetUpdateRegion(*args, **kwargs)
7007
7008 def GetUpdateClientRect(*args, **kwargs):
7009 """
7010 GetUpdateClientRect(self) -> Rect
7011
7012 Get the update rectangle region bounding box in client coords.
7013 """
7014 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
7015
7016 def IsExposed(*args, **kwargs):
7017 """
7018 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
7019
7020 Returns true if the given point or rectangle area has been exposed
7021 since the last repaint. Call this in an paint event handler to
7022 optimize redrawing by only redrawing those areas, which have been
7023 exposed.
7024 """
7025 return _core_.Window_IsExposed(*args, **kwargs)
7026
7027 def IsExposedPoint(*args, **kwargs):
7028 """
7029 IsExposedPoint(self, Point pt) -> bool
7030
7031 Returns true if the given point or rectangle area has been exposed
7032 since the last repaint. Call this in an paint event handler to
7033 optimize redrawing by only redrawing those areas, which have been
7034 exposed.
7035 """
7036 return _core_.Window_IsExposedPoint(*args, **kwargs)
7037
7038 def IsExposedRect(*args, **kwargs):
7039 """
7040 IsExposedRect(self, Rect rect) -> bool
7041
7042 Returns true if the given point or rectangle area has been exposed
7043 since the last repaint. Call this in an paint event handler to
7044 optimize redrawing by only redrawing those areas, which have been
7045 exposed.
7046 """
7047 return _core_.Window_IsExposedRect(*args, **kwargs)
7048
7049 def GetDefaultAttributes(*args, **kwargs):
7050 """
7051 GetDefaultAttributes(self) -> VisualAttributes
7052
7053 Get the default attributes for an instance of this class. This is
7054 useful if you want to use the same font or colour in your own control
7055 as in a standard control -- which is a much better idea than hard
7056 coding specific colours or fonts which might look completely out of
7057 place on the user's system, especially if it uses themes.
7058 """
7059 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
7060
7061 def GetClassDefaultAttributes(*args, **kwargs):
7062 """
7063 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7064
7065 Get the default attributes for this class. This is useful if you want
7066 to use the same font or colour in your own control as in a standard
7067 control -- which is a much better idea than hard coding specific
7068 colours or fonts which might look completely out of place on the
7069 user's system, especially if it uses themes.
7070
7071 The variant parameter is only relevant under Mac currently and is
7072 ignore under other platforms. Under Mac, it will change the size of
7073 the returned font. See `wx.Window.SetWindowVariant` for more about
7074 this.
7075 """
7076 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
7077
7078 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
7079 def SetBackgroundColour(*args, **kwargs):
7080 """
7081 SetBackgroundColour(self, Colour colour) -> bool
7082
7083 Sets the background colour of the window. Returns True if the colour
7084 was changed. The background colour is usually painted by the default
7085 EVT_ERASE_BACKGROUND event handler function under Windows and
7086 automatically under GTK. Using `wx.NullColour` will reset the window
7087 to the default background colour.
7088
7089 Note that setting the background colour may not cause an immediate
7090 refresh, so you may wish to call `ClearBackground` or `Refresh` after
7091 calling this function.
7092
7093 Using this function will disable attempts to use themes for this
7094 window, if the system supports them. Use with care since usually the
7095 themes represent the appearance chosen by the user to be used for all
7096 applications on the system.
7097 """
7098 return _core_.Window_SetBackgroundColour(*args, **kwargs)
7099
7100 def SetOwnBackgroundColour(*args, **kwargs):
7101 """SetOwnBackgroundColour(self, Colour colour)"""
7102 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
7103
7104 def SetForegroundColour(*args, **kwargs):
7105 """
7106 SetForegroundColour(self, Colour colour) -> bool
7107
7108 Sets the foreground colour of the window. Returns True is the colour
7109 was changed. The interpretation of foreground colour is dependent on
7110 the window class; it may be the text colour or other colour, or it may
7111 not be used at all.
7112 """
7113 return _core_.Window_SetForegroundColour(*args, **kwargs)
7114
7115 def SetOwnForegroundColour(*args, **kwargs):
7116 """SetOwnForegroundColour(self, Colour colour)"""
7117 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
7118
7119 def GetBackgroundColour(*args, **kwargs):
7120 """
7121 GetBackgroundColour(self) -> Colour
7122
7123 Returns the background colour of the window.
7124 """
7125 return _core_.Window_GetBackgroundColour(*args, **kwargs)
7126
7127 def GetForegroundColour(*args, **kwargs):
7128 """
7129 GetForegroundColour(self) -> Colour
7130
7131 Returns the foreground colour of the window. The interpretation of
7132 foreground colour is dependent on the window class; it may be the text
7133 colour or other colour, or it may not be used at all.
7134 """
7135 return _core_.Window_GetForegroundColour(*args, **kwargs)
7136
7137 def SetBackgroundStyle(*args, **kwargs):
7138 """
7139 SetBackgroundStyle(self, int style) -> bool
7140
7141 Returns the background style of the window. The background style
7142 indicates how the background of the window is drawn.
7143
7144 ====================== ========================================
7145 wx.BG_STYLE_SYSTEM The background colour or pattern should
7146 be determined by the system
7147 wx.BG_STYLE_COLOUR The background should be a solid colour
7148 wx.BG_STYLE_CUSTOM The background will be implemented by the
7149 application.
7150 ====================== ========================================
7151
7152 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
7153 a custom background, such as a tiled bitmap. Currently the style has
7154 no effect on other platforms.
7155
7156 :see: `GetBackgroundStyle`, `SetBackgroundColour`
7157 """
7158 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
7159
7160 def GetBackgroundStyle(*args, **kwargs):
7161 """
7162 GetBackgroundStyle(self) -> int
7163
7164 Returns the background style of the window.
7165
7166 :see: `SetBackgroundStyle`
7167 """
7168 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
7169
7170 def SetCursor(*args, **kwargs):
7171 """
7172 SetCursor(self, Cursor cursor) -> bool
7173
7174 Sets the window's cursor. Notice that the window cursor also sets it
7175 for the children of the window implicitly.
7176
7177 The cursor may be wx.NullCursor in which case the window cursor will
7178 be reset back to default.
7179 """
7180 return _core_.Window_SetCursor(*args, **kwargs)
7181
7182 def GetCursor(*args, **kwargs):
7183 """
7184 GetCursor(self) -> Cursor
7185
7186 Return the cursor associated with this window.
7187 """
7188 return _core_.Window_GetCursor(*args, **kwargs)
7189
7190 def SetFont(*args, **kwargs):
7191 """
7192 SetFont(self, Font font) -> bool
7193
7194 Sets the font for this window.
7195 """
7196 return _core_.Window_SetFont(*args, **kwargs)
7197
7198 def SetOwnFont(*args, **kwargs):
7199 """SetOwnFont(self, Font font)"""
7200 return _core_.Window_SetOwnFont(*args, **kwargs)
7201
7202 def GetFont(*args, **kwargs):
7203 """
7204 GetFont(self) -> Font
7205
7206 Returns the default font used for this window.
7207 """
7208 return _core_.Window_GetFont(*args, **kwargs)
7209
7210 def SetCaret(*args, **kwargs):
7211 """
7212 SetCaret(self, Caret caret)
7213
7214 Sets the caret associated with the window.
7215 """
7216 return _core_.Window_SetCaret(*args, **kwargs)
7217
7218 def GetCaret(*args, **kwargs):
7219 """
7220 GetCaret(self) -> Caret
7221
7222 Returns the caret associated with the window.
7223 """
7224 return _core_.Window_GetCaret(*args, **kwargs)
7225
7226 def GetCharHeight(*args, **kwargs):
7227 """
7228 GetCharHeight(self) -> int
7229
7230 Get the (average) character size for the current font.
7231 """
7232 return _core_.Window_GetCharHeight(*args, **kwargs)
7233
7234 def GetCharWidth(*args, **kwargs):
7235 """
7236 GetCharWidth(self) -> int
7237
7238 Get the (average) character size for the current font.
7239 """
7240 return _core_.Window_GetCharWidth(*args, **kwargs)
7241
7242 def GetTextExtent(*args, **kwargs):
7243 """
7244 GetTextExtent(String string) -> (width, height)
7245
7246 Get the width and height of the text using the current font.
7247 """
7248 return _core_.Window_GetTextExtent(*args, **kwargs)
7249
7250 def GetFullTextExtent(*args, **kwargs):
7251 """
7252 GetFullTextExtent(String string, Font font=None) ->
7253 (width, height, descent, externalLeading)
7254
7255 Get the width, height, decent and leading of the text using the
7256 current or specified font.
7257 """
7258 return _core_.Window_GetFullTextExtent(*args, **kwargs)
7259
7260 def ClientToScreenXY(*args, **kwargs):
7261 """
7262 ClientToScreenXY(int x, int y) -> (x,y)
7263
7264 Converts to screen coordinates from coordinates relative to this window.
7265 """
7266 return _core_.Window_ClientToScreenXY(*args, **kwargs)
7267
7268 def ScreenToClientXY(*args, **kwargs):
7269 """
7270 ScreenToClientXY(int x, int y) -> (x,y)
7271
7272 Converts from screen to client window coordinates.
7273 """
7274 return _core_.Window_ScreenToClientXY(*args, **kwargs)
7275
7276 def ClientToScreen(*args, **kwargs):
7277 """
7278 ClientToScreen(self, Point pt) -> Point
7279
7280 Converts to screen coordinates from coordinates relative to this window.
7281 """
7282 return _core_.Window_ClientToScreen(*args, **kwargs)
7283
7284 def ScreenToClient(*args, **kwargs):
7285 """
7286 ScreenToClient(self, Point pt) -> Point
7287
7288 Converts from screen to client window coordinates.
7289 """
7290 return _core_.Window_ScreenToClient(*args, **kwargs)
7291
7292 def HitTestXY(*args, **kwargs):
7293 """
7294 HitTestXY(self, int x, int y) -> int
7295
7296 Test where the given (in client coords) point lies
7297 """
7298 return _core_.Window_HitTestXY(*args, **kwargs)
7299
7300 def HitTest(*args, **kwargs):
7301 """
7302 HitTest(self, Point pt) -> int
7303
7304 Test where the given (in client coords) point lies
7305 """
7306 return _core_.Window_HitTest(*args, **kwargs)
7307
7308 def GetBorder(*args):
7309 """
7310 GetBorder(self, long flags) -> int
7311 GetBorder(self) -> int
7312
7313 Get border for the flags of this window
7314 """
7315 return _core_.Window_GetBorder(*args)
7316
7317 def UpdateWindowUI(*args, **kwargs):
7318 """
7319 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
7320
7321 This function sends EVT_UPDATE_UI events to the window. The particular
7322 implementation depends on the window; for example a wx.ToolBar will
7323 send an update UI event for each toolbar button, and a wx.Frame will
7324 send an update UI event for each menubar menu item. You can call this
7325 function from your application to ensure that your UI is up-to-date at
7326 a particular point in time (as far as your EVT_UPDATE_UI handlers are
7327 concerned). This may be necessary if you have called
7328 wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to
7329 limit the overhead that wxWindows incurs by sending update UI events
7330 in idle time.
7331 """
7332 return _core_.Window_UpdateWindowUI(*args, **kwargs)
7333
7334 def PopupMenuXY(*args, **kwargs):
7335 """
7336 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
7337
7338 Pops up the given menu at the specified coordinates, relative to this window,
7339 and returns control when the user has dismissed the menu. If a menu item is
7340 selected, the corresponding menu event is generated and will be processed as
7341 usual. If the default position is given then the current position of the
7342 mouse cursor will be used.
7343 """
7344 return _core_.Window_PopupMenuXY(*args, **kwargs)
7345
7346 def PopupMenu(*args, **kwargs):
7347 """
7348 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
7349
7350 Pops up the given menu at the specified coordinates, relative to this window,
7351 and returns control when the user has dismissed the menu. If a menu item is
7352 selected, the corresponding menu event is generated and will be processed as
7353 usual. If the default position is given then the current position of the
7354 mouse cursor will be used.
7355 """
7356 return _core_.Window_PopupMenu(*args, **kwargs)
7357
7358 def GetHandle(*args, **kwargs):
7359 """
7360 GetHandle(self) -> long
7361
7362 Returns the platform-specific handle (as a long integer) of the
7363 physical window. Currently on wxMac it returns the handle of the
7364 toplevel parent of the window.
7365 """
7366 return _core_.Window_GetHandle(*args, **kwargs)
7367
7368 def AssociateHandle(*args, **kwargs):
7369 """
7370 AssociateHandle(self, long handle)
7371
7372 Associate the window with a new native handle
7373 """
7374 return _core_.Window_AssociateHandle(*args, **kwargs)
7375
7376 def DissociateHandle(*args, **kwargs):
7377 """
7378 DissociateHandle(self)
7379
7380 Dissociate the current native handle from the window
7381 """
7382 return _core_.Window_DissociateHandle(*args, **kwargs)
7383
7384 def HasScrollbar(*args, **kwargs):
7385 """
7386 HasScrollbar(self, int orient) -> bool
7387
7388 Does the window have the scrollbar for this orientation?
7389 """
7390 return _core_.Window_HasScrollbar(*args, **kwargs)
7391
7392 def SetScrollbar(*args, **kwargs):
7393 """
7394 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
7395 bool refresh=True)
7396
7397 Sets the scrollbar properties of a built-in scrollbar.
7398 """
7399 return _core_.Window_SetScrollbar(*args, **kwargs)
7400
7401 def SetScrollPos(*args, **kwargs):
7402 """
7403 SetScrollPos(self, int orientation, int pos, bool refresh=True)
7404
7405 Sets the position of one of the built-in scrollbars.
7406 """
7407 return _core_.Window_SetScrollPos(*args, **kwargs)
7408
7409 def GetScrollPos(*args, **kwargs):
7410 """
7411 GetScrollPos(self, int orientation) -> int
7412
7413 Returns the built-in scrollbar position.
7414 """
7415 return _core_.Window_GetScrollPos(*args, **kwargs)
7416
7417 def GetScrollThumb(*args, **kwargs):
7418 """
7419 GetScrollThumb(self, int orientation) -> int
7420
7421 Returns the built-in scrollbar thumb size.
7422 """
7423 return _core_.Window_GetScrollThumb(*args, **kwargs)
7424
7425 def GetScrollRange(*args, **kwargs):
7426 """
7427 GetScrollRange(self, int orientation) -> int
7428
7429 Returns the built-in scrollbar range.
7430 """
7431 return _core_.Window_GetScrollRange(*args, **kwargs)
7432
7433 def ScrollWindow(*args, **kwargs):
7434 """
7435 ScrollWindow(self, int dx, int dy, Rect rect=None)
7436
7437 Physically scrolls the pixels in the window and move child windows
7438 accordingly. Use this function to optimise your scrolling
7439 implementations, to minimise the area that must be redrawn. Note that
7440 it is rarely required to call this function from a user program.
7441 """
7442 return _core_.Window_ScrollWindow(*args, **kwargs)
7443
7444 def ScrollLines(*args, **kwargs):
7445 """
7446 ScrollLines(self, int lines) -> bool
7447
7448 If the platform and window class supports it, scrolls the window by
7449 the given number of lines down, if lines is positive, or up if lines
7450 is negative. Returns True if the window was scrolled, False if it was
7451 already on top/bottom and nothing was done.
7452 """
7453 return _core_.Window_ScrollLines(*args, **kwargs)
7454
7455 def ScrollPages(*args, **kwargs):
7456 """
7457 ScrollPages(self, int pages) -> bool
7458
7459 If the platform and window class supports it, scrolls the window by
7460 the given number of pages down, if pages is positive, or up if pages
7461 is negative. Returns True if the window was scrolled, False if it was
7462 already on top/bottom and nothing was done.
7463 """
7464 return _core_.Window_ScrollPages(*args, **kwargs)
7465
7466 def LineUp(*args, **kwargs):
7467 """
7468 LineUp(self) -> bool
7469
7470 This is just a wrapper for ScrollLines(-1).
7471 """
7472 return _core_.Window_LineUp(*args, **kwargs)
7473
7474 def LineDown(*args, **kwargs):
7475 """
7476 LineDown(self) -> bool
7477
7478 This is just a wrapper for ScrollLines(1).
7479 """
7480 return _core_.Window_LineDown(*args, **kwargs)
7481
7482 def PageUp(*args, **kwargs):
7483 """
7484 PageUp(self) -> bool
7485
7486 This is just a wrapper for ScrollPages(-1).
7487 """
7488 return _core_.Window_PageUp(*args, **kwargs)
7489
7490 def PageDown(*args, **kwargs):
7491 """
7492 PageDown(self) -> bool
7493
7494 This is just a wrapper for ScrollPages(1).
7495 """
7496 return _core_.Window_PageDown(*args, **kwargs)
7497
7498 def SetHelpText(*args, **kwargs):
7499 """
7500 SetHelpText(self, String text)
7501
7502 Sets the help text to be used as context-sensitive help for this
7503 window. Note that the text is actually stored by the current
7504 wxHelpProvider implementation, and not in the window object itself.
7505 """
7506 return _core_.Window_SetHelpText(*args, **kwargs)
7507
7508 def SetHelpTextForId(*args, **kwargs):
7509 """
7510 SetHelpTextForId(self, String text)
7511
7512 Associate this help text with all windows with the same id as this
7513 one.
7514 """
7515 return _core_.Window_SetHelpTextForId(*args, **kwargs)
7516
7517 def GetHelpText(*args, **kwargs):
7518 """
7519 GetHelpText(self) -> String
7520
7521 Gets the help text to be used as context-sensitive help for this
7522 window. Note that the text is actually stored by the current
7523 wxHelpProvider implementation, and not in the window object itself.
7524 """
7525 return _core_.Window_GetHelpText(*args, **kwargs)
7526
7527 def SetToolTipString(*args, **kwargs):
7528 """
7529 SetToolTipString(self, String tip)
7530
7531 Attach a tooltip to the window.
7532 """
7533 return _core_.Window_SetToolTipString(*args, **kwargs)
7534
7535 def SetToolTip(*args, **kwargs):
7536 """
7537 SetToolTip(self, ToolTip tip)
7538
7539 Attach a tooltip to the window.
7540 """
7541 return _core_.Window_SetToolTip(*args, **kwargs)
7542
7543 def GetToolTip(*args, **kwargs):
7544 """
7545 GetToolTip(self) -> ToolTip
7546
7547 get the associated tooltip or None if none
7548 """
7549 return _core_.Window_GetToolTip(*args, **kwargs)
7550
7551 def SetDropTarget(*args, **kwargs):
7552 """
7553 SetDropTarget(self, DropTarget dropTarget)
7554
7555 Associates a drop target with this window. If the window already has
7556 a drop target, it is deleted.
7557 """
7558 return _core_.Window_SetDropTarget(*args, **kwargs)
7559
7560 def GetDropTarget(*args, **kwargs):
7561 """
7562 GetDropTarget(self) -> DropTarget
7563
7564 Returns the associated drop target, which may be None.
7565 """
7566 return _core_.Window_GetDropTarget(*args, **kwargs)
7567
7568 def SetConstraints(*args, **kwargs):
7569 """
7570 SetConstraints(self, LayoutConstraints constraints)
7571
7572 Sets the window to have the given layout constraints. If an existing
7573 layout constraints object is already owned by the window, it will be
7574 deleted. Pass None to disassociate and delete the window's current
7575 constraints.
7576
7577 You must call SetAutoLayout to tell a window to use the constraints
7578 automatically in its default EVT_SIZE handler; otherwise, you must
7579 handle EVT_SIZE yourself and call Layout() explicitly. When setting
7580 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
7581 effect.
7582 """
7583 return _core_.Window_SetConstraints(*args, **kwargs)
7584
7585 def GetConstraints(*args, **kwargs):
7586 """
7587 GetConstraints(self) -> LayoutConstraints
7588
7589 Returns a pointer to the window's layout constraints, or None if there
7590 are none.
7591 """
7592 return _core_.Window_GetConstraints(*args, **kwargs)
7593
7594 def SetAutoLayout(*args, **kwargs):
7595 """
7596 SetAutoLayout(self, bool autoLayout)
7597
7598 Determines whether the Layout function will be called automatically
7599 when the window is resized. It is called implicitly by SetSizer but
7600 if you use SetConstraints you should call it manually or otherwise the
7601 window layout won't be correctly updated when its size changes.
7602 """
7603 return _core_.Window_SetAutoLayout(*args, **kwargs)
7604
7605 def GetAutoLayout(*args, **kwargs):
7606 """
7607 GetAutoLayout(self) -> bool
7608
7609 Returns the current autoLayout setting
7610 """
7611 return _core_.Window_GetAutoLayout(*args, **kwargs)
7612
7613 def Layout(*args, **kwargs):
7614 """
7615 Layout(self) -> bool
7616
7617 Invokes the constraint-based layout algorithm or the sizer-based
7618 algorithm for this window. See SetAutoLayout: when auto layout is on,
7619 this function gets called automatically by the default EVT_SIZE
7620 handler when the window is resized.
7621 """
7622 return _core_.Window_Layout(*args, **kwargs)
7623
7624 def SetSizer(*args, **kwargs):
7625 """
7626 SetSizer(self, Sizer sizer, bool deleteOld=True)
7627
7628 Sets the window to have the given layout sizer. The window will then
7629 own the object, and will take care of its deletion. If an existing
7630 layout sizer object is already owned by the window, it will be deleted
7631 if the deleteOld parameter is true. Note that this function will also
7632 call SetAutoLayout implicitly with a True parameter if the sizer is
7633 non-None, and False otherwise.
7634 """
7635 return _core_.Window_SetSizer(*args, **kwargs)
7636
7637 def SetSizerAndFit(*args, **kwargs):
7638 """
7639 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
7640
7641 The same as SetSizer, except it also sets the size hints for the
7642 window based on the sizer's minimum size.
7643 """
7644 return _core_.Window_SetSizerAndFit(*args, **kwargs)
7645
7646 def GetSizer(*args, **kwargs):
7647 """
7648 GetSizer(self) -> Sizer
7649
7650 Return the sizer associated with the window by a previous call to
7651 SetSizer or None if there isn't one.
7652 """
7653 return _core_.Window_GetSizer(*args, **kwargs)
7654
7655 def SetContainingSizer(*args, **kwargs):
7656 """
7657 SetContainingSizer(self, Sizer sizer)
7658
7659 This normally does not need to be called by application code. It is
7660 called internally when a window is added to a sizer, and is used so
7661 the window can remove itself from the sizer when it is destroyed.
7662 """
7663 return _core_.Window_SetContainingSizer(*args, **kwargs)
7664
7665 def GetContainingSizer(*args, **kwargs):
7666 """
7667 GetContainingSizer(self) -> Sizer
7668
7669 Return the sizer that this window is a member of, if any, otherwise None.
7670 """
7671 return _core_.Window_GetContainingSizer(*args, **kwargs)
7672
7673 def InheritAttributes(*args, **kwargs):
7674 """
7675 InheritAttributes(self)
7676
7677 This function is (or should be, in case of custom controls) called
7678 during window creation to intelligently set up the window visual
7679 attributes, that is the font and the foreground and background
7680 colours.
7681
7682 By 'intelligently' the following is meant: by default, all windows use
7683 their own default attributes. However if some of the parent's
7684 attributes are explicitly changed (that is, using SetFont and not
7685 SetOwnFont) and if the corresponding attribute hadn't been
7686 explicitly set for this window itself, then this window takes the same
7687 value as used by the parent. In addition, if the window overrides
7688 ShouldInheritColours to return false, the colours will not be changed
7689 no matter what and only the font might.
7690
7691 This rather complicated logic is necessary in order to accommodate the
7692 different usage scenarios. The most common one is when all default
7693 attributes are used and in this case, nothing should be inherited as
7694 in modern GUIs different controls use different fonts (and colours)
7695 than their siblings so they can't inherit the same value from the
7696 parent. However it was also deemed desirable to allow to simply change
7697 the attributes of all children at once by just changing the font or
7698 colour of their common parent, hence in this case we do inherit the
7699 parents attributes.
7700
7701 """
7702 return _core_.Window_InheritAttributes(*args, **kwargs)
7703
7704 def ShouldInheritColours(*args, **kwargs):
7705 """
7706 ShouldInheritColours(self) -> bool
7707
7708 Return true from here to allow the colours of this window to be
7709 changed by InheritAttributes, returning false forbids inheriting them
7710 from the parent window.
7711
7712 The base class version returns false, but this method is overridden in
7713 wxControl where it returns true.
7714 """
7715 return _core_.Window_ShouldInheritColours(*args, **kwargs)
7716
7717 def PostCreate(self, pre):
7718 """
7719 Phase 3 of the 2-phase create <wink!>
7720 Call this method after precreating the window with the 2-phase create method.
7721 """
7722 self.this = pre.this
7723 self.thisown = pre.thisown
7724 pre.thisown = 0
7725 if hasattr(self, '_setOORInfo'):
7726 self._setOORInfo(self)
7727 if hasattr(self, '_setCallbackInfo'):
7728 self._setCallbackInfo(self, self.__class__)
7729
7730
7731 class WindowPtr(Window):
7732 def __init__(self, this):
7733 self.this = this
7734 if not hasattr(self,"thisown"): self.thisown = 0
7735 self.__class__ = Window
7736 _core_.Window_swigregister(WindowPtr)
7737
7738 def PreWindow(*args, **kwargs):
7739 """
7740 PreWindow() -> Window
7741
7742 Precreate a Window for 2-phase creation.
7743 """
7744 val = _core_.new_PreWindow(*args, **kwargs)
7745 val.thisown = 1
7746 return val
7747
7748 def Window_NewControlId(*args, **kwargs):
7749 """
7750 Window_NewControlId() -> int
7751
7752 Generate a control id for the controls which were not given one.
7753 """
7754 return _core_.Window_NewControlId(*args, **kwargs)
7755
7756 def Window_NextControlId(*args, **kwargs):
7757 """
7758 Window_NextControlId(int winid) -> int
7759
7760 Get the id of the control following the one with the given
7761 autogenerated) id
7762 """
7763 return _core_.Window_NextControlId(*args, **kwargs)
7764
7765 def Window_PrevControlId(*args, **kwargs):
7766 """
7767 Window_PrevControlId(int winid) -> int
7768
7769 Get the id of the control preceding the one with the given
7770 autogenerated) id
7771 """
7772 return _core_.Window_PrevControlId(*args, **kwargs)
7773
7774 def Window_FindFocus(*args, **kwargs):
7775 """
7776 Window_FindFocus() -> Window
7777
7778 Returns the window or control that currently has the keyboard focus,
7779 or None.
7780 """
7781 return _core_.Window_FindFocus(*args, **kwargs)
7782
7783 def Window_GetCapture(*args, **kwargs):
7784 """
7785 Window_GetCapture() -> Window
7786
7787 Returns the window which currently captures the mouse or None
7788 """
7789 return _core_.Window_GetCapture(*args, **kwargs)
7790
7791 def Window_GetClassDefaultAttributes(*args, **kwargs):
7792 """
7793 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
7794
7795 Get the default attributes for this class. This is useful if you want
7796 to use the same font or colour in your own control as in a standard
7797 control -- which is a much better idea than hard coding specific
7798 colours or fonts which might look completely out of place on the
7799 user's system, especially if it uses themes.
7800
7801 The variant parameter is only relevant under Mac currently and is
7802 ignore under other platforms. Under Mac, it will change the size of
7803 the returned font. See `wx.Window.SetWindowVariant` for more about
7804 this.
7805 """
7806 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
7807
7808 def DLG_PNT(win, point_or_x, y=None):
7809 """
7810 Convenience function for converting a Point or (x,y) in
7811 dialog units to pixel units.
7812 """
7813 if y is None:
7814 return win.ConvertDialogPointToPixels(point_or_x)
7815 else:
7816 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
7817
7818 def DLG_SZE(win, size_width, height=None):
7819 """
7820 Convenience function for converting a Size or (w,h) in
7821 dialog units to pixel units.
7822 """
7823 if height is None:
7824 return win.ConvertDialogSizeToPixels(size_width)
7825 else:
7826 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
7827
7828
7829 def FindWindowById(*args, **kwargs):
7830 """
7831 FindWindowById(long id, Window parent=None) -> Window
7832
7833 Find the first window in the application with the given id. If parent
7834 is None, the search will start from all top-level frames and dialog
7835 boxes; if non-None, the search will be limited to the given window
7836 hierarchy. The search is recursive in both cases.
7837 """
7838 return _core_.FindWindowById(*args, **kwargs)
7839
7840 def FindWindowByName(*args, **kwargs):
7841 """
7842 FindWindowByName(String name, Window parent=None) -> Window
7843
7844 Find a window by its name (as given in a window constructor or Create
7845 function call). If parent is None, the search will start from all
7846 top-level frames and dialog boxes; if non-None, the search will be
7847 limited to the given window hierarchy. The search is recursive in both
7848 cases.
7849
7850 If no window with such name is found, wx.FindWindowByLabel is called.
7851 """
7852 return _core_.FindWindowByName(*args, **kwargs)
7853
7854 def FindWindowByLabel(*args, **kwargs):
7855 """
7856 FindWindowByLabel(String label, Window parent=None) -> Window
7857
7858 Find a window by its label. Depending on the type of window, the label
7859 may be a window title or panel item label. If parent is None, the
7860 search will start from all top-level frames and dialog boxes; if
7861 non-None, the search will be limited to the given window
7862 hierarchy. The search is recursive in both cases.
7863 """
7864 return _core_.FindWindowByLabel(*args, **kwargs)
7865
7866 def Window_FromHWND(*args, **kwargs):
7867 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
7868 return _core_.Window_FromHWND(*args, **kwargs)
7869 #---------------------------------------------------------------------------
7870
7871 class Validator(EvtHandler):
7872 def __repr__(self):
7873 return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7874 def __init__(self, *args, **kwargs):
7875 """__init__(self) -> Validator"""
7876 newobj = _core_.new_Validator(*args, **kwargs)
7877 self.this = newobj.this
7878 self.thisown = 1
7879 del newobj.thisown
7880 self._setOORInfo(self)
7881
7882 def Clone(*args, **kwargs):
7883 """Clone(self) -> Validator"""
7884 return _core_.Validator_Clone(*args, **kwargs)
7885
7886 def Validate(*args, **kwargs):
7887 """Validate(self, Window parent) -> bool"""
7888 return _core_.Validator_Validate(*args, **kwargs)
7889
7890 def TransferToWindow(*args, **kwargs):
7891 """TransferToWindow(self) -> bool"""
7892 return _core_.Validator_TransferToWindow(*args, **kwargs)
7893
7894 def TransferFromWindow(*args, **kwargs):
7895 """TransferFromWindow(self) -> bool"""
7896 return _core_.Validator_TransferFromWindow(*args, **kwargs)
7897
7898 def GetWindow(*args, **kwargs):
7899 """GetWindow(self) -> Window"""
7900 return _core_.Validator_GetWindow(*args, **kwargs)
7901
7902 def SetWindow(*args, **kwargs):
7903 """SetWindow(self, Window window)"""
7904 return _core_.Validator_SetWindow(*args, **kwargs)
7905
7906 def IsSilent(*args, **kwargs):
7907 """IsSilent() -> bool"""
7908 return _core_.Validator_IsSilent(*args, **kwargs)
7909
7910 IsSilent = staticmethod(IsSilent)
7911 def SetBellOnError(*args, **kwargs):
7912 """SetBellOnError(int doIt=True)"""
7913 return _core_.Validator_SetBellOnError(*args, **kwargs)
7914
7915 SetBellOnError = staticmethod(SetBellOnError)
7916
7917 class ValidatorPtr(Validator):
7918 def __init__(self, this):
7919 self.this = this
7920 if not hasattr(self,"thisown"): self.thisown = 0
7921 self.__class__ = Validator
7922 _core_.Validator_swigregister(ValidatorPtr)
7923
7924 def Validator_IsSilent(*args, **kwargs):
7925 """Validator_IsSilent() -> bool"""
7926 return _core_.Validator_IsSilent(*args, **kwargs)
7927
7928 def Validator_SetBellOnError(*args, **kwargs):
7929 """Validator_SetBellOnError(int doIt=True)"""
7930 return _core_.Validator_SetBellOnError(*args, **kwargs)
7931
7932 class PyValidator(Validator):
7933 def __repr__(self):
7934 return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7935 def __init__(self, *args, **kwargs):
7936 """__init__(self) -> PyValidator"""
7937 newobj = _core_.new_PyValidator(*args, **kwargs)
7938 self.this = newobj.this
7939 self.thisown = 1
7940 del newobj.thisown
7941
7942 self._setCallbackInfo(self, PyValidator, 1)
7943 self._setOORInfo(self)
7944
7945 def _setCallbackInfo(*args, **kwargs):
7946 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
7947 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
7948
7949
7950 class PyValidatorPtr(PyValidator):
7951 def __init__(self, this):
7952 self.this = this
7953 if not hasattr(self,"thisown"): self.thisown = 0
7954 self.__class__ = PyValidator
7955 _core_.PyValidator_swigregister(PyValidatorPtr)
7956
7957 #---------------------------------------------------------------------------
7958
7959 class Menu(EvtHandler):
7960 def __repr__(self):
7961 return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
7962 def __init__(self, *args, **kwargs):
7963 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
7964 newobj = _core_.new_Menu(*args, **kwargs)
7965 self.this = newobj.this
7966 self.thisown = 1
7967 del newobj.thisown
7968 self._setOORInfo(self)
7969
7970 def Append(*args, **kwargs):
7971 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
7972 return _core_.Menu_Append(*args, **kwargs)
7973
7974 def AppendSeparator(*args, **kwargs):
7975 """AppendSeparator(self) -> MenuItem"""
7976 return _core_.Menu_AppendSeparator(*args, **kwargs)
7977
7978 def AppendCheckItem(*args, **kwargs):
7979 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
7980 return _core_.Menu_AppendCheckItem(*args, **kwargs)
7981
7982 def AppendRadioItem(*args, **kwargs):
7983 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
7984 return _core_.Menu_AppendRadioItem(*args, **kwargs)
7985
7986 def AppendMenu(*args, **kwargs):
7987 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
7988 return _core_.Menu_AppendMenu(*args, **kwargs)
7989
7990 def AppendItem(*args, **kwargs):
7991 """AppendItem(self, MenuItem item) -> MenuItem"""
7992 return _core_.Menu_AppendItem(*args, **kwargs)
7993
7994 def Break(*args, **kwargs):
7995 """Break(self)"""
7996 return _core_.Menu_Break(*args, **kwargs)
7997
7998 def InsertItem(*args, **kwargs):
7999 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
8000 return _core_.Menu_InsertItem(*args, **kwargs)
8001
8002 def Insert(*args, **kwargs):
8003 """
8004 Insert(self, size_t pos, int id, String text, String help=EmptyString,
8005 int kind=ITEM_NORMAL) -> MenuItem
8006 """
8007 return _core_.Menu_Insert(*args, **kwargs)
8008
8009 def InsertSeparator(*args, **kwargs):
8010 """InsertSeparator(self, size_t pos) -> MenuItem"""
8011 return _core_.Menu_InsertSeparator(*args, **kwargs)
8012
8013 def InsertCheckItem(*args, **kwargs):
8014 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8015 return _core_.Menu_InsertCheckItem(*args, **kwargs)
8016
8017 def InsertRadioItem(*args, **kwargs):
8018 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
8019 return _core_.Menu_InsertRadioItem(*args, **kwargs)
8020
8021 def InsertMenu(*args, **kwargs):
8022 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8023 return _core_.Menu_InsertMenu(*args, **kwargs)
8024
8025 def PrependItem(*args, **kwargs):
8026 """PrependItem(self, MenuItem item) -> MenuItem"""
8027 return _core_.Menu_PrependItem(*args, **kwargs)
8028
8029 def Prepend(*args, **kwargs):
8030 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
8031 return _core_.Menu_Prepend(*args, **kwargs)
8032
8033 def PrependSeparator(*args, **kwargs):
8034 """PrependSeparator(self) -> MenuItem"""
8035 return _core_.Menu_PrependSeparator(*args, **kwargs)
8036
8037 def PrependCheckItem(*args, **kwargs):
8038 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8039 return _core_.Menu_PrependCheckItem(*args, **kwargs)
8040
8041 def PrependRadioItem(*args, **kwargs):
8042 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
8043 return _core_.Menu_PrependRadioItem(*args, **kwargs)
8044
8045 def PrependMenu(*args, **kwargs):
8046 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
8047 return _core_.Menu_PrependMenu(*args, **kwargs)
8048
8049 def Remove(*args, **kwargs):
8050 """Remove(self, int id) -> MenuItem"""
8051 return _core_.Menu_Remove(*args, **kwargs)
8052
8053 def RemoveItem(*args, **kwargs):
8054 """RemoveItem(self, MenuItem item) -> MenuItem"""
8055 return _core_.Menu_RemoveItem(*args, **kwargs)
8056
8057 def Delete(*args, **kwargs):
8058 """Delete(self, int id) -> bool"""
8059 return _core_.Menu_Delete(*args, **kwargs)
8060
8061 def DeleteItem(*args, **kwargs):
8062 """DeleteItem(self, MenuItem item) -> bool"""
8063 return _core_.Menu_DeleteItem(*args, **kwargs)
8064
8065 def Destroy(*args, **kwargs):
8066 """
8067 Destroy(self)
8068
8069 Deletes the C++ object this Python object is a proxy for.
8070 """
8071 return _core_.Menu_Destroy(*args, **kwargs)
8072
8073 def DestroyId(*args, **kwargs):
8074 """
8075 DestroyId(self, int id) -> bool
8076
8077 Deletes the C++ object this Python object is a proxy for.
8078 """
8079 return _core_.Menu_DestroyId(*args, **kwargs)
8080
8081 def DestroyItem(*args, **kwargs):
8082 """
8083 DestroyItem(self, MenuItem item) -> bool
8084
8085 Deletes the C++ object this Python object is a proxy for.
8086 """
8087 return _core_.Menu_DestroyItem(*args, **kwargs)
8088
8089 def GetMenuItemCount(*args, **kwargs):
8090 """GetMenuItemCount(self) -> size_t"""
8091 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
8092
8093 def GetMenuItems(*args, **kwargs):
8094 """GetMenuItems(self) -> PyObject"""
8095 return _core_.Menu_GetMenuItems(*args, **kwargs)
8096
8097 def FindItem(*args, **kwargs):
8098 """FindItem(self, String item) -> int"""
8099 return _core_.Menu_FindItem(*args, **kwargs)
8100
8101 def FindItemById(*args, **kwargs):
8102 """FindItemById(self, int id) -> MenuItem"""
8103 return _core_.Menu_FindItemById(*args, **kwargs)
8104
8105 def FindItemByPosition(*args, **kwargs):
8106 """FindItemByPosition(self, size_t position) -> MenuItem"""
8107 return _core_.Menu_FindItemByPosition(*args, **kwargs)
8108
8109 def Enable(*args, **kwargs):
8110 """Enable(self, int id, bool enable)"""
8111 return _core_.Menu_Enable(*args, **kwargs)
8112
8113 def IsEnabled(*args, **kwargs):
8114 """IsEnabled(self, int id) -> bool"""
8115 return _core_.Menu_IsEnabled(*args, **kwargs)
8116
8117 def Check(*args, **kwargs):
8118 """Check(self, int id, bool check)"""
8119 return _core_.Menu_Check(*args, **kwargs)
8120
8121 def IsChecked(*args, **kwargs):
8122 """IsChecked(self, int id) -> bool"""
8123 return _core_.Menu_IsChecked(*args, **kwargs)
8124
8125 def SetLabel(*args, **kwargs):
8126 """SetLabel(self, int id, String label)"""
8127 return _core_.Menu_SetLabel(*args, **kwargs)
8128
8129 def GetLabel(*args, **kwargs):
8130 """GetLabel(self, int id) -> String"""
8131 return _core_.Menu_GetLabel(*args, **kwargs)
8132
8133 def SetHelpString(*args, **kwargs):
8134 """SetHelpString(self, int id, String helpString)"""
8135 return _core_.Menu_SetHelpString(*args, **kwargs)
8136
8137 def GetHelpString(*args, **kwargs):
8138 """GetHelpString(self, int id) -> String"""
8139 return _core_.Menu_GetHelpString(*args, **kwargs)
8140
8141 def SetTitle(*args, **kwargs):
8142 """SetTitle(self, String title)"""
8143 return _core_.Menu_SetTitle(*args, **kwargs)
8144
8145 def GetTitle(*args, **kwargs):
8146 """GetTitle(self) -> String"""
8147 return _core_.Menu_GetTitle(*args, **kwargs)
8148
8149 def SetEventHandler(*args, **kwargs):
8150 """SetEventHandler(self, EvtHandler handler)"""
8151 return _core_.Menu_SetEventHandler(*args, **kwargs)
8152
8153 def GetEventHandler(*args, **kwargs):
8154 """GetEventHandler(self) -> EvtHandler"""
8155 return _core_.Menu_GetEventHandler(*args, **kwargs)
8156
8157 def SetInvokingWindow(*args, **kwargs):
8158 """SetInvokingWindow(self, Window win)"""
8159 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
8160
8161 def GetInvokingWindow(*args, **kwargs):
8162 """GetInvokingWindow(self) -> Window"""
8163 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
8164
8165 def GetStyle(*args, **kwargs):
8166 """GetStyle(self) -> long"""
8167 return _core_.Menu_GetStyle(*args, **kwargs)
8168
8169 def UpdateUI(*args, **kwargs):
8170 """UpdateUI(self, EvtHandler source=None)"""
8171 return _core_.Menu_UpdateUI(*args, **kwargs)
8172
8173 def GetMenuBar(*args, **kwargs):
8174 """GetMenuBar(self) -> MenuBar"""
8175 return _core_.Menu_GetMenuBar(*args, **kwargs)
8176
8177 def Attach(*args, **kwargs):
8178 """Attach(self, wxMenuBarBase menubar)"""
8179 return _core_.Menu_Attach(*args, **kwargs)
8180
8181 def Detach(*args, **kwargs):
8182 """Detach(self)"""
8183 return _core_.Menu_Detach(*args, **kwargs)
8184
8185 def IsAttached(*args, **kwargs):
8186 """IsAttached(self) -> bool"""
8187 return _core_.Menu_IsAttached(*args, **kwargs)
8188
8189 def SetParent(*args, **kwargs):
8190 """SetParent(self, Menu parent)"""
8191 return _core_.Menu_SetParent(*args, **kwargs)
8192
8193 def GetParent(*args, **kwargs):
8194 """GetParent(self) -> Menu"""
8195 return _core_.Menu_GetParent(*args, **kwargs)
8196
8197
8198 class MenuPtr(Menu):
8199 def __init__(self, this):
8200 self.this = this
8201 if not hasattr(self,"thisown"): self.thisown = 0
8202 self.__class__ = Menu
8203 _core_.Menu_swigregister(MenuPtr)
8204 DefaultValidator = cvar.DefaultValidator
8205
8206 #---------------------------------------------------------------------------
8207
8208 class MenuBar(Window):
8209 def __repr__(self):
8210 return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8211 def __init__(self, *args, **kwargs):
8212 """__init__(self, long style=0) -> MenuBar"""
8213 newobj = _core_.new_MenuBar(*args, **kwargs)
8214 self.this = newobj.this
8215 self.thisown = 1
8216 del newobj.thisown
8217 self._setOORInfo(self)
8218
8219 def Append(*args, **kwargs):
8220 """Append(self, Menu menu, String title) -> bool"""
8221 return _core_.MenuBar_Append(*args, **kwargs)
8222
8223 def Insert(*args, **kwargs):
8224 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
8225 return _core_.MenuBar_Insert(*args, **kwargs)
8226
8227 def GetMenuCount(*args, **kwargs):
8228 """GetMenuCount(self) -> size_t"""
8229 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
8230
8231 def GetMenu(*args, **kwargs):
8232 """GetMenu(self, size_t pos) -> Menu"""
8233 return _core_.MenuBar_GetMenu(*args, **kwargs)
8234
8235 def Replace(*args, **kwargs):
8236 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
8237 return _core_.MenuBar_Replace(*args, **kwargs)
8238
8239 def Remove(*args, **kwargs):
8240 """Remove(self, size_t pos) -> Menu"""
8241 return _core_.MenuBar_Remove(*args, **kwargs)
8242
8243 def EnableTop(*args, **kwargs):
8244 """EnableTop(self, size_t pos, bool enable)"""
8245 return _core_.MenuBar_EnableTop(*args, **kwargs)
8246
8247 def IsEnabledTop(*args, **kwargs):
8248 """IsEnabledTop(self, size_t pos) -> bool"""
8249 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
8250
8251 def SetLabelTop(*args, **kwargs):
8252 """SetLabelTop(self, size_t pos, String label)"""
8253 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
8254
8255 def GetLabelTop(*args, **kwargs):
8256 """GetLabelTop(self, size_t pos) -> String"""
8257 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
8258
8259 def FindMenuItem(*args, **kwargs):
8260 """FindMenuItem(self, String menu, String item) -> int"""
8261 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
8262
8263 def FindItemById(*args, **kwargs):
8264 """FindItemById(self, int id) -> MenuItem"""
8265 return _core_.MenuBar_FindItemById(*args, **kwargs)
8266
8267 def FindMenu(*args, **kwargs):
8268 """FindMenu(self, String title) -> int"""
8269 return _core_.MenuBar_FindMenu(*args, **kwargs)
8270
8271 def Enable(*args, **kwargs):
8272 """Enable(self, int id, bool enable)"""
8273 return _core_.MenuBar_Enable(*args, **kwargs)
8274
8275 def Check(*args, **kwargs):
8276 """Check(self, int id, bool check)"""
8277 return _core_.MenuBar_Check(*args, **kwargs)
8278
8279 def IsChecked(*args, **kwargs):
8280 """IsChecked(self, int id) -> bool"""
8281 return _core_.MenuBar_IsChecked(*args, **kwargs)
8282
8283 def IsEnabled(*args, **kwargs):
8284 """IsEnabled(self, int id) -> bool"""
8285 return _core_.MenuBar_IsEnabled(*args, **kwargs)
8286
8287 def SetLabel(*args, **kwargs):
8288 """SetLabel(self, int id, String label)"""
8289 return _core_.MenuBar_SetLabel(*args, **kwargs)
8290
8291 def GetLabel(*args, **kwargs):
8292 """GetLabel(self, int id) -> String"""
8293 return _core_.MenuBar_GetLabel(*args, **kwargs)
8294
8295 def SetHelpString(*args, **kwargs):
8296 """SetHelpString(self, int id, String helpString)"""
8297 return _core_.MenuBar_SetHelpString(*args, **kwargs)
8298
8299 def GetHelpString(*args, **kwargs):
8300 """GetHelpString(self, int id) -> String"""
8301 return _core_.MenuBar_GetHelpString(*args, **kwargs)
8302
8303 def GetFrame(*args, **kwargs):
8304 """GetFrame(self) -> wxFrame"""
8305 return _core_.MenuBar_GetFrame(*args, **kwargs)
8306
8307 def IsAttached(*args, **kwargs):
8308 """IsAttached(self) -> bool"""
8309 return _core_.MenuBar_IsAttached(*args, **kwargs)
8310
8311 def Attach(*args, **kwargs):
8312 """Attach(self, wxFrame frame)"""
8313 return _core_.MenuBar_Attach(*args, **kwargs)
8314
8315 def Detach(*args, **kwargs):
8316 """Detach(self)"""
8317 return _core_.MenuBar_Detach(*args, **kwargs)
8318
8319
8320 class MenuBarPtr(MenuBar):
8321 def __init__(self, this):
8322 self.this = this
8323 if not hasattr(self,"thisown"): self.thisown = 0
8324 self.__class__ = MenuBar
8325 _core_.MenuBar_swigregister(MenuBarPtr)
8326
8327 #---------------------------------------------------------------------------
8328
8329 class MenuItem(Object):
8330 def __repr__(self):
8331 return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8332 def __init__(self, *args, **kwargs):
8333 """
8334 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
8335 String help=EmptyString, int kind=ITEM_NORMAL,
8336 Menu subMenu=None) -> MenuItem
8337 """
8338 newobj = _core_.new_MenuItem(*args, **kwargs)
8339 self.this = newobj.this
8340 self.thisown = 1
8341 del newobj.thisown
8342 def GetMenu(*args, **kwargs):
8343 """GetMenu(self) -> Menu"""
8344 return _core_.MenuItem_GetMenu(*args, **kwargs)
8345
8346 def SetMenu(*args, **kwargs):
8347 """SetMenu(self, Menu menu)"""
8348 return _core_.MenuItem_SetMenu(*args, **kwargs)
8349
8350 def SetId(*args, **kwargs):
8351 """SetId(self, int id)"""
8352 return _core_.MenuItem_SetId(*args, **kwargs)
8353
8354 def GetId(*args, **kwargs):
8355 """GetId(self) -> int"""
8356 return _core_.MenuItem_GetId(*args, **kwargs)
8357
8358 def IsSeparator(*args, **kwargs):
8359 """IsSeparator(self) -> bool"""
8360 return _core_.MenuItem_IsSeparator(*args, **kwargs)
8361
8362 def SetText(*args, **kwargs):
8363 """SetText(self, String str)"""
8364 return _core_.MenuItem_SetText(*args, **kwargs)
8365
8366 def GetLabel(*args, **kwargs):
8367 """GetLabel(self) -> String"""
8368 return _core_.MenuItem_GetLabel(*args, **kwargs)
8369
8370 def GetText(*args, **kwargs):
8371 """GetText(self) -> String"""
8372 return _core_.MenuItem_GetText(*args, **kwargs)
8373
8374 def GetLabelFromText(*args, **kwargs):
8375 """GetLabelFromText(String text) -> String"""
8376 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8377
8378 GetLabelFromText = staticmethod(GetLabelFromText)
8379 def GetKind(*args, **kwargs):
8380 """GetKind(self) -> int"""
8381 return _core_.MenuItem_GetKind(*args, **kwargs)
8382
8383 def SetKind(*args, **kwargs):
8384 """SetKind(self, int kind)"""
8385 return _core_.MenuItem_SetKind(*args, **kwargs)
8386
8387 def SetCheckable(*args, **kwargs):
8388 """SetCheckable(self, bool checkable)"""
8389 return _core_.MenuItem_SetCheckable(*args, **kwargs)
8390
8391 def IsCheckable(*args, **kwargs):
8392 """IsCheckable(self) -> bool"""
8393 return _core_.MenuItem_IsCheckable(*args, **kwargs)
8394
8395 def IsSubMenu(*args, **kwargs):
8396 """IsSubMenu(self) -> bool"""
8397 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
8398
8399 def SetSubMenu(*args, **kwargs):
8400 """SetSubMenu(self, Menu menu)"""
8401 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
8402
8403 def GetSubMenu(*args, **kwargs):
8404 """GetSubMenu(self) -> Menu"""
8405 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
8406
8407 def Enable(*args, **kwargs):
8408 """Enable(self, bool enable=True)"""
8409 return _core_.MenuItem_Enable(*args, **kwargs)
8410
8411 def IsEnabled(*args, **kwargs):
8412 """IsEnabled(self) -> bool"""
8413 return _core_.MenuItem_IsEnabled(*args, **kwargs)
8414
8415 def Check(*args, **kwargs):
8416 """Check(self, bool check=True)"""
8417 return _core_.MenuItem_Check(*args, **kwargs)
8418
8419 def IsChecked(*args, **kwargs):
8420 """IsChecked(self) -> bool"""
8421 return _core_.MenuItem_IsChecked(*args, **kwargs)
8422
8423 def Toggle(*args, **kwargs):
8424 """Toggle(self)"""
8425 return _core_.MenuItem_Toggle(*args, **kwargs)
8426
8427 def SetHelp(*args, **kwargs):
8428 """SetHelp(self, String str)"""
8429 return _core_.MenuItem_SetHelp(*args, **kwargs)
8430
8431 def GetHelp(*args, **kwargs):
8432 """GetHelp(self) -> String"""
8433 return _core_.MenuItem_GetHelp(*args, **kwargs)
8434
8435 def GetAccel(*args, **kwargs):
8436 """GetAccel(self) -> AcceleratorEntry"""
8437 return _core_.MenuItem_GetAccel(*args, **kwargs)
8438
8439 def SetAccel(*args, **kwargs):
8440 """SetAccel(self, AcceleratorEntry accel)"""
8441 return _core_.MenuItem_SetAccel(*args, **kwargs)
8442
8443 def GetDefaultMarginWidth(*args, **kwargs):
8444 """GetDefaultMarginWidth() -> int"""
8445 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8446
8447 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
8448 def SetBitmap(*args, **kwargs):
8449 """SetBitmap(self, Bitmap bitmap)"""
8450 return _core_.MenuItem_SetBitmap(*args, **kwargs)
8451
8452 def GetBitmap(*args, **kwargs):
8453 """GetBitmap(self) -> Bitmap"""
8454 return _core_.MenuItem_GetBitmap(*args, **kwargs)
8455
8456
8457 class MenuItemPtr(MenuItem):
8458 def __init__(self, this):
8459 self.this = this
8460 if not hasattr(self,"thisown"): self.thisown = 0
8461 self.__class__ = MenuItem
8462 _core_.MenuItem_swigregister(MenuItemPtr)
8463
8464 def MenuItem_GetLabelFromText(*args, **kwargs):
8465 """MenuItem_GetLabelFromText(String text) -> String"""
8466 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
8467
8468 def MenuItem_GetDefaultMarginWidth(*args, **kwargs):
8469 """MenuItem_GetDefaultMarginWidth() -> int"""
8470 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
8471
8472 #---------------------------------------------------------------------------
8473
8474 class Control(Window):
8475 """
8476 This is the base class for a control or 'widget'.
8477
8478 A control is generally a small window which processes user input
8479 and/or displays one or more item of data.
8480 """
8481 def __repr__(self):
8482 return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8483 def __init__(self, *args, **kwargs):
8484 """
8485 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8486 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
8487 String name=ControlNameStr) -> Control
8488
8489 Create a Control. Normally you should only call this from a subclass'
8490 __init__ as a plain old wx.Control is not very useful.
8491 """
8492 newobj = _core_.new_Control(*args, **kwargs)
8493 self.this = newobj.this
8494 self.thisown = 1
8495 del newobj.thisown
8496 self._setOORInfo(self)
8497
8498 def Create(*args, **kwargs):
8499 """
8500 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8501 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
8502 String name=ControlNameStr) -> bool
8503
8504 Do the 2nd phase and create the GUI control.
8505 """
8506 return _core_.Control_Create(*args, **kwargs)
8507
8508 def Command(*args, **kwargs):
8509 """
8510 Command(self, CommandEvent event)
8511
8512 Simulates the effect of the user issuing a command to the item.
8513
8514 :see: `wx.CommandEvent`
8515
8516 """
8517 return _core_.Control_Command(*args, **kwargs)
8518
8519 def GetLabel(*args, **kwargs):
8520 """
8521 GetLabel(self) -> String
8522
8523 Return a control's text.
8524 """
8525 return _core_.Control_GetLabel(*args, **kwargs)
8526
8527 def SetLabel(*args, **kwargs):
8528 """
8529 SetLabel(self, String label)
8530
8531 Sets the item's text.
8532 """
8533 return _core_.Control_SetLabel(*args, **kwargs)
8534
8535 def GetClassDefaultAttributes(*args, **kwargs):
8536 """
8537 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8538
8539 Get the default attributes for this class. This is useful if you want
8540 to use the same font or colour in your own control as in a standard
8541 control -- which is a much better idea than hard coding specific
8542 colours or fonts which might look completely out of place on the
8543 user's system, especially if it uses themes.
8544
8545 The variant parameter is only relevant under Mac currently and is
8546 ignore under other platforms. Under Mac, it will change the size of
8547 the returned font. See `wx.Window.SetWindowVariant` for more about
8548 this.
8549 """
8550 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8551
8552 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8553
8554 class ControlPtr(Control):
8555 def __init__(self, this):
8556 self.this = this
8557 if not hasattr(self,"thisown"): self.thisown = 0
8558 self.__class__ = Control
8559 _core_.Control_swigregister(ControlPtr)
8560 ControlNameStr = cvar.ControlNameStr
8561
8562 def PreControl(*args, **kwargs):
8563 """
8564 PreControl() -> Control
8565
8566 Precreate a Control control for 2-phase creation
8567 """
8568 val = _core_.new_PreControl(*args, **kwargs)
8569 val.thisown = 1
8570 return val
8571
8572 def Control_GetClassDefaultAttributes(*args, **kwargs):
8573 """
8574 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
8575
8576 Get the default attributes for this class. This is useful if you want
8577 to use the same font or colour in your own control as in a standard
8578 control -- which is a much better idea than hard coding specific
8579 colours or fonts which might look completely out of place on the
8580 user's system, especially if it uses themes.
8581
8582 The variant parameter is only relevant under Mac currently and is
8583 ignore under other platforms. Under Mac, it will change the size of
8584 the returned font. See `wx.Window.SetWindowVariant` for more about
8585 this.
8586 """
8587 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
8588
8589 #---------------------------------------------------------------------------
8590
8591 class ItemContainer(object):
8592 """
8593 wx.ItemContainer defines an interface which is implemented by all
8594 controls which have string subitems, each of which may be selected,
8595 such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well as
8596 `wx.ComboBox` which implements an extended interface deriving from
8597 this one.
8598
8599 It defines the methods for accessing the control's items and although
8600 each of the derived classes implements them differently, they still
8601 all conform to the same interface.
8602
8603 The items in a wx.ItemContainer have (non empty) string labels and,
8604 optionally, client data associated with them.
8605
8606 """
8607 def __init__(self): raise RuntimeError, "No constructor defined"
8608 def __repr__(self):
8609 return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8610 def Append(*args, **kwargs):
8611 """
8612 Append(self, String item, PyObject clientData=None) -> int
8613
8614 Adds the item to the control, associating the given data with the item
8615 if not None. The return value is the index of the newly added item
8616 which may be different from the last one if the control is sorted (e.g.
8617 has wx.LB_SORT or wx.CB_SORT style).
8618 """
8619 return _core_.ItemContainer_Append(*args, **kwargs)
8620
8621 def AppendItems(*args, **kwargs):
8622 """
8623 AppendItems(self, List strings)
8624
8625 Apend several items at once to the control. Notice that calling this
8626 method may be much faster than appending the items one by one if you
8627 need to add a lot of items.
8628 """
8629 return _core_.ItemContainer_AppendItems(*args, **kwargs)
8630
8631 def Insert(*args, **kwargs):
8632 """
8633 Insert(self, String item, int pos, PyObject clientData=None) -> int
8634
8635 Insert an item into the control before the item at the ``pos`` index,
8636 optionally associating some data object with the item.
8637 """
8638 return _core_.ItemContainer_Insert(*args, **kwargs)
8639
8640 def Clear(*args, **kwargs):
8641 """
8642 Clear(self)
8643
8644 Removes all items from the control.
8645 """
8646 return _core_.ItemContainer_Clear(*args, **kwargs)
8647
8648 def Delete(*args, **kwargs):
8649 """
8650 Delete(self, int n)
8651
8652 Deletes the item at the zero-based index 'n' from the control. Note
8653 that it is an error (signalled by a `wx.PyAssertionError` exception if
8654 enabled) to remove an item with the index negative or greater or equal
8655 than the number of items in the control.
8656 """
8657 return _core_.ItemContainer_Delete(*args, **kwargs)
8658
8659 def GetCount(*args, **kwargs):
8660 """
8661 GetCount(self) -> int
8662
8663 Returns the number of items in the control.
8664 """
8665 return _core_.ItemContainer_GetCount(*args, **kwargs)
8666
8667 def IsEmpty(*args, **kwargs):
8668 """
8669 IsEmpty(self) -> bool
8670
8671 Returns True if the control is empty or False if it has some items.
8672 """
8673 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
8674
8675 def GetString(*args, **kwargs):
8676 """
8677 GetString(self, int n) -> String
8678
8679 Returns the label of the item with the given index.
8680 """
8681 return _core_.ItemContainer_GetString(*args, **kwargs)
8682
8683 def GetStrings(*args, **kwargs):
8684 """GetStrings(self) -> wxArrayString"""
8685 return _core_.ItemContainer_GetStrings(*args, **kwargs)
8686
8687 def SetString(*args, **kwargs):
8688 """
8689 SetString(self, int n, String s)
8690
8691 Sets the label for the given item.
8692 """
8693 return _core_.ItemContainer_SetString(*args, **kwargs)
8694
8695 def FindString(*args, **kwargs):
8696 """
8697 FindString(self, String s) -> int
8698
8699 Finds an item whose label matches the given string. Returns the
8700 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
8701 found.
8702 """
8703 return _core_.ItemContainer_FindString(*args, **kwargs)
8704
8705 def Select(*args, **kwargs):
8706 """
8707 Select(self, int n)
8708
8709 Sets the item at index 'n' to be the selected item.
8710 """
8711 return _core_.ItemContainer_Select(*args, **kwargs)
8712
8713 SetSelection = Select
8714 def GetSelection(*args, **kwargs):
8715 """
8716 GetSelection(self) -> int
8717
8718 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
8719 is selected.
8720 """
8721 return _core_.ItemContainer_GetSelection(*args, **kwargs)
8722
8723 def GetStringSelection(*args, **kwargs):
8724 """
8725 GetStringSelection(self) -> String
8726
8727 Returns the label of the selected item or an empty string if no item
8728 is selected.
8729 """
8730 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
8731
8732 def GetClientData(*args, **kwargs):
8733 """
8734 GetClientData(self, int n) -> PyObject
8735
8736 Returns the client data associated with the given item, (if any.)
8737 """
8738 return _core_.ItemContainer_GetClientData(*args, **kwargs)
8739
8740 def SetClientData(*args, **kwargs):
8741 """
8742 SetClientData(self, int n, PyObject clientData)
8743
8744 Associate the given client data with the item at position n.
8745 """
8746 return _core_.ItemContainer_SetClientData(*args, **kwargs)
8747
8748
8749 class ItemContainerPtr(ItemContainer):
8750 def __init__(self, this):
8751 self.this = this
8752 if not hasattr(self,"thisown"): self.thisown = 0
8753 self.__class__ = ItemContainer
8754 _core_.ItemContainer_swigregister(ItemContainerPtr)
8755
8756 #---------------------------------------------------------------------------
8757
8758 class ControlWithItems(Control,ItemContainer):
8759 """
8760 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
8761 wx.Control class, and is used for the base class of various controls
8762 that have items.
8763 """
8764 def __init__(self): raise RuntimeError, "No constructor defined"
8765 def __repr__(self):
8766 return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8767
8768 class ControlWithItemsPtr(ControlWithItems):
8769 def __init__(self, this):
8770 self.this = this
8771 if not hasattr(self,"thisown"): self.thisown = 0
8772 self.__class__ = ControlWithItems
8773 _core_.ControlWithItems_swigregister(ControlWithItemsPtr)
8774
8775 #---------------------------------------------------------------------------
8776
8777 class SizerItem(Object):
8778 """
8779 The wx.SizerItem class is used to track the position, size and other
8780 attributes of each item managed by a `wx.Sizer`. In normal usage user
8781 code should never need to deal directly with a wx.SizerItem, but
8782 custom classes derived from `wx.PySizer` will probably need to use the
8783 collection of wx.SizerItems held by wx.Sizer when calculating layout.
8784
8785 :see: `wx.Sizer`, `wx.GBSizerItem`
8786 """
8787 def __repr__(self):
8788 return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
8789 def __init__(self, *args, **kwargs):
8790 """
8791 __init__(self) -> SizerItem
8792
8793 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
8794 size will need to be set before this item can be used in a Sizer.
8795
8796 You will probably never need to create a wx.SizerItem directly as they
8797 are created automatically when the sizer's Add, Insert or Prepend
8798 methods are called.
8799
8800 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
8801 """
8802 newobj = _core_.new_SizerItem(*args, **kwargs)
8803 self.this = newobj.this
8804 self.thisown = 1
8805 del newobj.thisown
8806 def DeleteWindows(*args, **kwargs):
8807 """
8808 DeleteWindows(self)
8809
8810 Destroy the window or the windows in a subsizer, depending on the type
8811 of item.
8812 """
8813 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
8814
8815 def DetachSizer(*args, **kwargs):
8816 """
8817 DetachSizer(self)
8818
8819 Enable deleting the SizerItem without destroying the contained sizer.
8820 """
8821 return _core_.SizerItem_DetachSizer(*args, **kwargs)
8822
8823 def GetSize(*args, **kwargs):
8824 """
8825 GetSize(self) -> Size
8826
8827 Get the current size of the item, as set in the last Layout.
8828 """
8829 return _core_.SizerItem_GetSize(*args, **kwargs)
8830
8831 def CalcMin(*args, **kwargs):
8832 """
8833 CalcMin(self) -> Size
8834
8835 Calculates the minimum desired size for the item, including any space
8836 needed by borders.
8837 """
8838 return _core_.SizerItem_CalcMin(*args, **kwargs)
8839
8840 def SetDimension(*args, **kwargs):
8841 """
8842 SetDimension(self, Point pos, Size size)
8843
8844 Set the position and size of the space allocated for this item by the
8845 sizer, and adjust the position and size of the item (window or
8846 subsizer) to be within that space taking alignment and borders into
8847 account.
8848 """
8849 return _core_.SizerItem_SetDimension(*args, **kwargs)
8850
8851 def GetMinSize(*args, **kwargs):
8852 """
8853 GetMinSize(self) -> Size
8854
8855 Get the minimum size needed for the item.
8856 """
8857 return _core_.SizerItem_GetMinSize(*args, **kwargs)
8858
8859 def GetMinSizeWithBorder(*args, **kwargs):
8860 """
8861 GetMinSizeWithBorder(self) -> Size
8862
8863 Get the minimum size needed for the item with space for the borders
8864 added, if needed.
8865 """
8866 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
8867
8868 def SetInitSize(*args, **kwargs):
8869 """SetInitSize(self, int x, int y)"""
8870 return _core_.SizerItem_SetInitSize(*args, **kwargs)
8871
8872 def SetRatioWH(*args, **kwargs):
8873 """
8874 SetRatioWH(self, int width, int height)
8875
8876 Set the ratio item attribute.
8877 """
8878 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
8879
8880 def SetRatioSize(*args, **kwargs):
8881 """
8882 SetRatioSize(self, Size size)
8883
8884 Set the ratio item attribute.
8885 """
8886 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
8887
8888 def SetRatio(*args, **kwargs):
8889 """
8890 SetRatio(self, float ratio)
8891
8892 Set the ratio item attribute.
8893 """
8894 return _core_.SizerItem_SetRatio(*args, **kwargs)
8895
8896 def GetRatio(*args, **kwargs):
8897 """
8898 GetRatio(self) -> float
8899
8900 Set the ratio item attribute.
8901 """
8902 return _core_.SizerItem_GetRatio(*args, **kwargs)
8903
8904 def GetRect(*args, **kwargs):
8905 """
8906 GetRect(self) -> Rect
8907
8908 Returns the rectangle that the sizer item should occupy
8909 """
8910 return _core_.SizerItem_GetRect(*args, **kwargs)
8911
8912 def IsWindow(*args, **kwargs):
8913 """
8914 IsWindow(self) -> bool
8915
8916 Is this sizer item a window?
8917 """
8918 return _core_.SizerItem_IsWindow(*args, **kwargs)
8919
8920 def IsSizer(*args, **kwargs):
8921 """
8922 IsSizer(self) -> bool
8923
8924 Is this sizer item a subsizer?
8925 """
8926 return _core_.SizerItem_IsSizer(*args, **kwargs)
8927
8928 def IsSpacer(*args, **kwargs):
8929 """
8930 IsSpacer(self) -> bool
8931
8932 Is this sizer item a spacer?
8933 """
8934 return _core_.SizerItem_IsSpacer(*args, **kwargs)
8935
8936 def SetProportion(*args, **kwargs):
8937 """
8938 SetProportion(self, int proportion)
8939
8940 Set the proportion value for this item.
8941 """
8942 return _core_.SizerItem_SetProportion(*args, **kwargs)
8943
8944 def GetProportion(*args, **kwargs):
8945 """
8946 GetProportion(self) -> int
8947
8948 Get the proportion value for this item.
8949 """
8950 return _core_.SizerItem_GetProportion(*args, **kwargs)
8951
8952 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
8953 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
8954 def SetFlag(*args, **kwargs):
8955 """
8956 SetFlag(self, int flag)
8957
8958 Set the flag value for this item.
8959 """
8960 return _core_.SizerItem_SetFlag(*args, **kwargs)
8961
8962 def GetFlag(*args, **kwargs):
8963 """
8964 GetFlag(self) -> int
8965
8966 Get the flag value for this item.
8967 """
8968 return _core_.SizerItem_GetFlag(*args, **kwargs)
8969
8970 def SetBorder(*args, **kwargs):
8971 """
8972 SetBorder(self, int border)
8973
8974 Set the border value for this item.
8975 """
8976 return _core_.SizerItem_SetBorder(*args, **kwargs)
8977
8978 def GetBorder(*args, **kwargs):
8979 """
8980 GetBorder(self) -> int
8981
8982 Get the border value for this item.
8983 """
8984 return _core_.SizerItem_GetBorder(*args, **kwargs)
8985
8986 def GetWindow(*args, **kwargs):
8987 """
8988 GetWindow(self) -> Window
8989
8990 Get the window (if any) that is managed by this sizer item.
8991 """
8992 return _core_.SizerItem_GetWindow(*args, **kwargs)
8993
8994 def SetWindow(*args, **kwargs):
8995 """
8996 SetWindow(self, Window window)
8997
8998 Set the window to be managed by this sizer item.
8999 """
9000 return _core_.SizerItem_SetWindow(*args, **kwargs)
9001
9002 def GetSizer(*args, **kwargs):
9003 """
9004 GetSizer(self) -> Sizer
9005
9006 Get the subsizer (if any) that is managed by this sizer item.
9007 """
9008 return _core_.SizerItem_GetSizer(*args, **kwargs)
9009
9010 def SetSizer(*args, **kwargs):
9011 """
9012 SetSizer(self, Sizer sizer)
9013
9014 Set the subsizer to be managed by this sizer item.
9015 """
9016 return _core_.SizerItem_SetSizer(*args, **kwargs)
9017
9018 def GetSpacer(*args, **kwargs):
9019 """
9020 GetSpacer(self) -> Size
9021
9022 Get the size of the spacer managed by this sizer item.
9023 """
9024 return _core_.SizerItem_GetSpacer(*args, **kwargs)
9025
9026 def SetSpacer(*args, **kwargs):
9027 """
9028 SetSpacer(self, Size size)
9029
9030 Set the size of the spacer to be managed by this sizer item.
9031 """
9032 return _core_.SizerItem_SetSpacer(*args, **kwargs)
9033
9034 def Show(*args, **kwargs):
9035 """
9036 Show(self, bool show)
9037
9038 Set the show item attribute, which sizers use to determine if the item
9039 is to be made part of the layout or not. If the item is tracking a
9040 window then it is shown or hidden as needed.
9041 """
9042 return _core_.SizerItem_Show(*args, **kwargs)
9043
9044 def IsShown(*args, **kwargs):
9045 """
9046 IsShown(self) -> bool
9047
9048 Is the item to be shown in the layout?
9049 """
9050 return _core_.SizerItem_IsShown(*args, **kwargs)
9051
9052 def GetPosition(*args, **kwargs):
9053 """
9054 GetPosition(self) -> Point
9055
9056 Returns the current position of the item, as set in the last Layout.
9057 """
9058 return _core_.SizerItem_GetPosition(*args, **kwargs)
9059
9060 def GetUserData(*args, **kwargs):
9061 """
9062 GetUserData(self) -> PyObject
9063
9064 Returns the userData associated with this sizer item, or None if there
9065 isn't any.
9066 """
9067 return _core_.SizerItem_GetUserData(*args, **kwargs)
9068
9069
9070 class SizerItemPtr(SizerItem):
9071 def __init__(self, this):
9072 self.this = this
9073 if not hasattr(self,"thisown"): self.thisown = 0
9074 self.__class__ = SizerItem
9075 _core_.SizerItem_swigregister(SizerItemPtr)
9076
9077 def SizerItemWindow(*args, **kwargs):
9078 """
9079 SizerItemWindow(Window window, int proportion, int flag, int border,
9080 PyObject userData=None) -> SizerItem
9081
9082 Constructs a `wx.SizerItem` for tracking a window.
9083 """
9084 val = _core_.new_SizerItemWindow(*args, **kwargs)
9085 val.thisown = 1
9086 return val
9087
9088 def SizerItemSpacer(*args, **kwargs):
9089 """
9090 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
9091 PyObject userData=None) -> SizerItem
9092
9093 Constructs a `wx.SizerItem` for tracking a spacer.
9094 """
9095 val = _core_.new_SizerItemSpacer(*args, **kwargs)
9096 val.thisown = 1
9097 return val
9098
9099 def SizerItemSizer(*args, **kwargs):
9100 """
9101 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
9102 PyObject userData=None) -> SizerItem
9103
9104 Constructs a `wx.SizerItem` for tracking a subsizer
9105 """
9106 val = _core_.new_SizerItemSizer(*args, **kwargs)
9107 val.thisown = 1
9108 return val
9109
9110 class Sizer(Object):
9111 """
9112 wx.Sizer is the abstract base class used for laying out subwindows in
9113 a window. You cannot use wx.Sizer directly; instead, you will have to
9114 use one of the sizer classes derived from it such as `wx.BoxSizer`,
9115 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
9116 and `wx.GridBagSizer`.
9117
9118 The concept implemented by sizers in wxWidgets is closely related to
9119 layout tools in other GUI toolkits, such as Java's AWT, the GTK
9120 toolkit or the Qt toolkit. It is based upon the idea of the individual
9121 subwindows reporting their minimal required size and their ability to
9122 get stretched if the size of the parent window has changed. This will
9123 most often mean that the programmer does not set the original size of
9124 a dialog in the beginning, rather the dialog will assigned a sizer and
9125 this sizer will be queried about the recommended size. The sizer in
9126 turn will query its children, which can be normal windows or contorls,
9127 empty space or other sizers, so that a hierarchy of sizers can be
9128 constructed. Note that wxSizer does not derive from wxWindow and thus
9129 do not interfere with tab ordering and requires very little resources
9130 compared to a real window on screen.
9131
9132 What makes sizers so well fitted for use in wxWidgets is the fact that
9133 every control reports its own minimal size and the algorithm can
9134 handle differences in font sizes or different window (dialog item)
9135 sizes on different platforms without problems. If for example the
9136 standard font as well as the overall design of Mac widgets requires
9137 more space than on Windows, then the initial size of a dialog using a
9138 sizer will automatically be bigger on Mac than on Windows.
9139 """
9140 def __init__(self): raise RuntimeError, "No constructor defined"
9141 def __repr__(self):
9142 return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9143 def _setOORInfo(*args, **kwargs):
9144 """_setOORInfo(self, PyObject _self)"""
9145 return _core_.Sizer__setOORInfo(*args, **kwargs)
9146
9147 def Add(*args, **kwargs):
9148 """
9149 Add(self, item, int proportion=0, int flag=0, int border=0,
9150 PyObject userData=None) -> wx.SizerItem
9151
9152 Appends a child item to the sizer.
9153 """
9154 return _core_.Sizer_Add(*args, **kwargs)
9155
9156 def Insert(*args, **kwargs):
9157 """
9158 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
9159 PyObject userData=None) -> wx.SizerItem
9160
9161 Inserts a new item into the list of items managed by this sizer before
9162 the item at index *before*. See `Add` for a description of the parameters.
9163 """
9164 return _core_.Sizer_Insert(*args, **kwargs)
9165
9166 def Prepend(*args, **kwargs):
9167 """
9168 Prepend(self, item, int proportion=0, int flag=0, int border=0,
9169 PyObject userData=None) -> wx.SizerItem
9170
9171 Adds a new item to the begining of the list of sizer items managed by
9172 this sizer. See `Add` for a description of the parameters.
9173 """
9174 return _core_.Sizer_Prepend(*args, **kwargs)
9175
9176 def Remove(*args, **kwargs):
9177 """
9178 Remove(self, item) -> bool
9179
9180 Removes an item from the sizer and destroys it. This method does not
9181 cause any layout or resizing to take place, call `Layout` to update
9182 the layout on screen after removing a child from the sizer. The
9183 *item* parameter can be either a window, a sizer, or the zero-based
9184 index of an item to remove. Returns True if the child item was found
9185 and removed.
9186 """
9187 return _core_.Sizer_Remove(*args, **kwargs)
9188
9189 def Detach(*args, **kwargs):
9190 """
9191 Detach(self, item) -> bool
9192
9193 Detaches an item from the sizer without destroying it. This method
9194 does not cause any layout or resizing to take place, call `Layout` to
9195 do so. The *item* parameter can be either a window, a sizer, or the
9196 zero-based index of the item to be detached. Returns True if the child item
9197 was found and detached.
9198 """
9199 return _core_.Sizer_Detach(*args, **kwargs)
9200
9201 def GetItem(*args, **kwargs):
9202 """
9203 GetItem(self, item) -> wx.SizerItem
9204
9205 Returns the `wx.SizerItem` which holds the *item* given. The *item*
9206 parameter can be either a window, a sizer, or the zero-based index of
9207 the item to be detached.
9208 """
9209 return _core_.Sizer_GetItem(*args, **kwargs)
9210
9211 def _SetItemMinSize(*args, **kwargs):
9212 """_SetItemMinSize(self, PyObject item, Size size)"""
9213 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
9214
9215 def SetItemMinSize(self, item, *args):
9216 """
9217 SetItemMinSize(self, item, Size size)
9218
9219 Sets the minimum size that will be allocated for an item in the sizer.
9220 The *item* parameter can be either a window, a sizer, or the
9221 zero-based index of the item. If a window or sizer is given then it
9222 will be searched for recursivly in subsizers if neccessary.
9223 """
9224 if len(args) == 2:
9225 # for backward compatibility accept separate width,height args too
9226 return self._SetItemMinSize(item, args)
9227 else:
9228 return self._SetItemMinSize(item, args[0])
9229
9230 def AddItem(*args, **kwargs):
9231 """
9232 AddItem(self, SizerItem item)
9233
9234 Adds a `wx.SizerItem` to the sizer.
9235 """
9236 return _core_.Sizer_AddItem(*args, **kwargs)
9237
9238 def InsertItem(*args, **kwargs):
9239 """
9240 InsertItem(self, int index, SizerItem item)
9241
9242 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
9243 """
9244 return _core_.Sizer_InsertItem(*args, **kwargs)
9245
9246 def PrependItem(*args, **kwargs):
9247 """
9248 PrependItem(self, SizerItem item)
9249
9250 Prepends a `wx.SizerItem` to the sizer.
9251 """
9252 return _core_.Sizer_PrependItem(*args, **kwargs)
9253
9254 def AddMany(self, items):
9255 """
9256 AddMany is a convenience method for adding several items
9257 to a sizer at one time. Simply pass it a list of tuples,
9258 where each tuple consists of the parameters that you
9259 would normally pass to the `Add` method.
9260 """
9261 for item in items:
9262 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
9263 item = (item, )
9264 self.Add(*item)
9265
9266 # for backwards compatibility only, please do not use in new code
9267 AddWindow = wx._deprecated(Add, "AddWindow is deprecated, use `Add` instead.")
9268 AddSizer = wx._deprecated(Add, "AddSizer is deprecated, use `Add` instead.")
9269 AddSpacer = wx._deprecated(Add, "AddSpacer is deprecated, use `Add` instead.")
9270 PrependWindow = wx._deprecated(Prepend, "PrependWindow is deprecated, use `Prepend` instead.")
9271 PrependSizer = wx._deprecated(Prepend, "PrependSizer is deprecated, use `Prepend` instead.")
9272 PrependSpacer = wx._deprecated(Prepend, "PrependSpacer is deprecated, use `Prepend` instead.")
9273 InsertWindow = wx._deprecated(Insert, "InsertWindow is deprecated, use `Insert` instead.")
9274 InsertSizer = wx._deprecated(Insert, "InsertSizer is deprecated, use `Insert` instead.")
9275 InsertSpacer = wx._deprecated(Insert, "InsertSpacer is deprecated, use `Insert` instead.")
9276 RemoveWindow = wx._deprecated(Remove, "RemoveWindow is deprecated, use `Remove` instead.")
9277 RemoveSizer = wx._deprecated(Remove, "RemoveSizer is deprecated, use `Remove` instead.")
9278 RemovePos = wx._deprecated(Remove, "RemovePos is deprecated, use `Remove` instead.")
9279
9280
9281 def SetDimension(*args, **kwargs):
9282 """
9283 SetDimension(self, int x, int y, int width, int height)
9284
9285 Call this to force the sizer to take the given dimension and thus
9286 force the items owned by the sizer to resize themselves according to
9287 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
9288 methods.
9289 """
9290 return _core_.Sizer_SetDimension(*args, **kwargs)
9291
9292 def SetMinSize(*args, **kwargs):
9293 """
9294 SetMinSize(self, Size size)
9295
9296 Call this to give the sizer a minimal size. Normally, the sizer will
9297 calculate its minimal size based purely on how much space its children
9298 need. After calling this method `GetMinSize` will return either the
9299 minimal size as requested by its children or the minimal size set
9300 here, depending on which is bigger.
9301 """
9302 return _core_.Sizer_SetMinSize(*args, **kwargs)
9303
9304 def GetSize(*args, **kwargs):
9305 """
9306 GetSize(self) -> Size
9307
9308 Returns the current size of the space managed by the sizer.
9309 """
9310 return _core_.Sizer_GetSize(*args, **kwargs)
9311
9312 def GetPosition(*args, **kwargs):
9313 """
9314 GetPosition(self) -> Point
9315
9316 Returns the current position of the sizer's managed space.
9317 """
9318 return _core_.Sizer_GetPosition(*args, **kwargs)
9319
9320 def GetMinSize(*args, **kwargs):
9321 """
9322 GetMinSize(self) -> Size
9323
9324 Returns the minimal size of the sizer. This is either the combined
9325 minimal size of all the children and their borders or the minimal size
9326 set by SetMinSize, depending on which is bigger.
9327 """
9328 return _core_.Sizer_GetMinSize(*args, **kwargs)
9329
9330 def GetSizeTuple(self):
9331 return self.GetSize().Get()
9332 def GetPositionTuple(self):
9333 return self.GetPosition().Get()
9334 def GetMinSizeTuple(self):
9335 return self.GetMinSize().Get()
9336
9337 def RecalcSizes(*args, **kwargs):
9338 """
9339 RecalcSizes(self)
9340
9341 Using the sizes calculated by `CalcMin` reposition and resize all the
9342 items managed by this sizer. You should not need to call this directly as
9343 it is called by `Layout`.
9344 """
9345 return _core_.Sizer_RecalcSizes(*args, **kwargs)
9346
9347 def CalcMin(*args, **kwargs):
9348 """
9349 CalcMin(self) -> Size
9350
9351 This method is where the sizer will do the actual calculation of its
9352 children's minimal sizes. You should not need to call this directly as
9353 it is called by `Layout`.
9354 """
9355 return _core_.Sizer_CalcMin(*args, **kwargs)
9356
9357 def Layout(*args, **kwargs):
9358 """
9359 Layout(self)
9360
9361 This method will force the recalculation and layout of the items
9362 controlled by the sizer using the current space allocated to the
9363 sizer. Normally this is called automatically from the owning window's
9364 EVT_SIZE handler, but it is also useful to call it from user code when
9365 one of the items in a sizer change size, or items are added or
9366 removed.
9367 """
9368 return _core_.Sizer_Layout(*args, **kwargs)
9369
9370 def Fit(*args, **kwargs):
9371 """
9372 Fit(self, Window window) -> Size
9373
9374 Tell the sizer to resize the *window* to match the sizer's minimal
9375 size. This is commonly done in the constructor of the window itself in
9376 order to set its initial size to match the needs of the children as
9377 determined by the sizer. Returns the new size.
9378
9379 For a top level window this is the total window size, not the client size.
9380 """
9381 return _core_.Sizer_Fit(*args, **kwargs)
9382
9383 def FitInside(*args, **kwargs):
9384 """
9385 FitInside(self, Window window)
9386
9387 Tell the sizer to resize the *virtual size* of the *window* to match the
9388 sizer's minimal size. This will not alter the on screen size of the
9389 window, but may cause the addition/removal/alteration of scrollbars
9390 required to view the virtual area in windows which manage it.
9391
9392 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
9393
9394 """
9395 return _core_.Sizer_FitInside(*args, **kwargs)
9396
9397 def SetSizeHints(*args, **kwargs):
9398 """
9399 SetSizeHints(self, Window window)
9400
9401 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
9402 match the sizer's minimal size. This is commonly done in the
9403 constructor of the window itself if the window is resizable (as are
9404 many dialogs under Unix and frames on probably all platforms) in order
9405 to prevent the window from being sized smaller than the minimal size
9406 required by the sizer.
9407 """
9408 return _core_.Sizer_SetSizeHints(*args, **kwargs)
9409
9410 def SetVirtualSizeHints(*args, **kwargs):
9411 """
9412 SetVirtualSizeHints(self, Window window)
9413
9414 Tell the sizer to set the minimal size of the window virtual area to
9415 match the sizer's minimal size. For windows with managed scrollbars
9416 this will set them appropriately.
9417
9418 :see: `wx.ScrolledWindow.SetScrollbars`
9419
9420 """
9421 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
9422
9423 def Clear(*args, **kwargs):
9424 """
9425 Clear(self, bool deleteWindows=False)
9426
9427 Clear all items from the sizer, optionally destroying the window items
9428 as well.
9429 """
9430 return _core_.Sizer_Clear(*args, **kwargs)
9431
9432 def DeleteWindows(*args, **kwargs):
9433 """
9434 DeleteWindows(self)
9435
9436 Destroy all windows managed by the sizer.
9437 """
9438 return _core_.Sizer_DeleteWindows(*args, **kwargs)
9439
9440 def GetChildren(*args, **kwargs):
9441 """
9442 GetChildren(sefl) -> list
9443
9444 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
9445 """
9446 return _core_.Sizer_GetChildren(*args, **kwargs)
9447
9448 def Show(*args, **kwargs):
9449 """
9450 Show(self, item, bool show=True, bool recursive=false) -> bool
9451
9452 Shows or hides an item managed by the sizer. To make a sizer item
9453 disappear or reappear, use Show followed by `Layout`. The *item*
9454 parameter can be either a window, a sizer, or the zero-based index of
9455 the item. Use the recursive parameter to show or hide an item in a
9456 subsizer. Returns True if the item was found.
9457 """
9458 return _core_.Sizer_Show(*args, **kwargs)
9459
9460 def IsShown(*args, **kwargs):
9461 """
9462 IsShown(self, item)
9463
9464 Determines if the item is currently shown. sizer. To make a sizer
9465 item disappear or reappear, use Show followed by `Layout`. The *item*
9466 parameter can be either a window, a sizer, or the zero-based index of
9467 the item.
9468 """
9469 return _core_.Sizer_IsShown(*args, **kwargs)
9470
9471 def Hide(self, item, recursive=False):
9472 """
9473 A convenience method for Show(item, False, recursive).
9474 """
9475 return self.Show(item, False, recursive)
9476
9477 def ShowItems(*args, **kwargs):
9478 """
9479 ShowItems(self, bool show)
9480
9481 Recursively call `wx.SizerItem.Show` on all sizer items.
9482 """
9483 return _core_.Sizer_ShowItems(*args, **kwargs)
9484
9485
9486 class SizerPtr(Sizer):
9487 def __init__(self, this):
9488 self.this = this
9489 if not hasattr(self,"thisown"): self.thisown = 0
9490 self.__class__ = Sizer
9491 _core_.Sizer_swigregister(SizerPtr)
9492
9493 class PySizer(Sizer):
9494 """
9495 wx.PySizer is a special version of `wx.Sizer` that has been
9496 instrumented to allow the C++ virtual methods to be overloaded in
9497 Python derived classes. You would derive from this class if you are
9498 wanting to implement a custom sizer in Python code. Simply implement
9499 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
9500 For example::
9501
9502 class MySizer(wx.PySizer):
9503 def __init__(self):
9504 wx.PySizer.__init__(self)
9505
9506 def CalcMin(self):
9507 for item in self.GetChildren():
9508 # calculate the total minimum width and height needed
9509 # by all items in the sizer according to this sizer's
9510 # layout algorithm.
9511 ...
9512 return wx.Size(width, height)
9513
9514 def RecalcSizes(self):
9515 # find the space allotted to this sizer
9516 pos = self.GetPosition()
9517 size = self.GetSize()
9518 for item in self.GetChildren():
9519 # Recalculate (if necessary) the position and size of
9520 # each item and then call item.SetDimension to do the
9521 # actual positioning and sizing of the items within the
9522 # space alloted to this sizer.
9523 ...
9524 item.SetDimension(itemPos, itemSize)
9525
9526
9527 When `Layout` is called it first calls `CalcMin` followed by
9528 `RecalcSizes` so you can optimize a bit by saving the results of
9529 `CalcMin` and resuing them in `RecalcSizes`.
9530
9531 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
9532
9533
9534 """
9535 def __repr__(self):
9536 return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9537 def __init__(self, *args, **kwargs):
9538 """
9539 __init__(self) -> PySizer
9540
9541 Creates a wx.PySizer. Must be called from the __init__ in the derived
9542 class.
9543 """
9544 newobj = _core_.new_PySizer(*args, **kwargs)
9545 self.this = newobj.this
9546 self.thisown = 1
9547 del newobj.thisown
9548 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
9549
9550 def _setCallbackInfo(*args, **kwargs):
9551 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
9552 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
9553
9554
9555 class PySizerPtr(PySizer):
9556 def __init__(self, this):
9557 self.this = this
9558 if not hasattr(self,"thisown"): self.thisown = 0
9559 self.__class__ = PySizer
9560 _core_.PySizer_swigregister(PySizerPtr)
9561
9562 #---------------------------------------------------------------------------
9563
9564 class BoxSizer(Sizer):
9565 """
9566 The basic idea behind a box sizer is that windows will most often be
9567 laid out in rather simple basic geometry, typically in a row or a
9568 column or nested hierarchies of either. A wx.BoxSizer will lay out
9569 its items in a simple row or column, depending on the orientation
9570 parameter passed to the constructor.
9571 """
9572 def __repr__(self):
9573 return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9574 def __init__(self, *args, **kwargs):
9575 """
9576 __init__(self, int orient=HORIZONTAL) -> BoxSizer
9577
9578 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
9579 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
9580 sizer.
9581 """
9582 newobj = _core_.new_BoxSizer(*args, **kwargs)
9583 self.this = newobj.this
9584 self.thisown = 1
9585 del newobj.thisown
9586 self._setOORInfo(self)
9587
9588 def GetOrientation(*args, **kwargs):
9589 """
9590 GetOrientation(self) -> int
9591
9592 Returns the current orientation of the sizer.
9593 """
9594 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
9595
9596 def SetOrientation(*args, **kwargs):
9597 """
9598 SetOrientation(self, int orient)
9599
9600 Resets the orientation of the sizer.
9601 """
9602 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
9603
9604
9605 class BoxSizerPtr(BoxSizer):
9606 def __init__(self, this):
9607 self.this = this
9608 if not hasattr(self,"thisown"): self.thisown = 0
9609 self.__class__ = BoxSizer
9610 _core_.BoxSizer_swigregister(BoxSizerPtr)
9611
9612 #---------------------------------------------------------------------------
9613
9614 class StaticBoxSizer(BoxSizer):
9615 """
9616 wx.StaticBoxSizer derives from and functions identically to the
9617 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
9618 manages. Note that this static box must be created separately and
9619 passed to the sizer constructor.
9620 """
9621 def __repr__(self):
9622 return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9623 def __init__(self, *args, **kwargs):
9624 """
9625 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
9626
9627 Constructor. It takes an associated static box and the orientation
9628 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
9629 ``wx.HORIZONTAL``.
9630 """
9631 newobj = _core_.new_StaticBoxSizer(*args, **kwargs)
9632 self.this = newobj.this
9633 self.thisown = 1
9634 del newobj.thisown
9635 self._setOORInfo(self)
9636
9637 def GetStaticBox(*args, **kwargs):
9638 """
9639 GetStaticBox(self) -> StaticBox
9640
9641 Returns the static box associated with this sizer.
9642 """
9643 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
9644
9645
9646 class StaticBoxSizerPtr(StaticBoxSizer):
9647 def __init__(self, this):
9648 self.this = this
9649 if not hasattr(self,"thisown"): self.thisown = 0
9650 self.__class__ = StaticBoxSizer
9651 _core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr)
9652
9653 #---------------------------------------------------------------------------
9654
9655 class GridSizer(Sizer):
9656 """
9657 A grid sizer is a sizer which lays out its children in a
9658 two-dimensional table with all cells having the same size. In other
9659 words, the width of each cell within the grid is the width of the
9660 widest item added to the sizer and the height of each grid cell is the
9661 height of the tallest item. An optional vertical and/or horizontal
9662 gap between items can also be specified (in pixels.)
9663
9664 Items are placed in the cells of the grid in the order they are added,
9665 in row-major order. In other words, the first row is filled first,
9666 then the second, and so on until all items have been added. (If
9667 neccessary, additional rows will be added as items are added.) If you
9668 need to have greater control over the cells that items are placed in
9669 then use the `wx.GridBagSizer`.
9670
9671 """
9672 def __repr__(self):
9673 return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9674 def __init__(self, *args, **kwargs):
9675 """
9676 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
9677
9678 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
9679 of columns and rows in the sizer - if either of the parameters is
9680 zero, it will be calculated to from the total number of children in
9681 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9682 define extra space between all children.
9683 """
9684 newobj = _core_.new_GridSizer(*args, **kwargs)
9685 self.this = newobj.this
9686 self.thisown = 1
9687 del newobj.thisown
9688 self._setOORInfo(self)
9689
9690 def SetCols(*args, **kwargs):
9691 """
9692 SetCols(self, int cols)
9693
9694 Sets the number of columns in the sizer.
9695 """
9696 return _core_.GridSizer_SetCols(*args, **kwargs)
9697
9698 def SetRows(*args, **kwargs):
9699 """
9700 SetRows(self, int rows)
9701
9702 Sets the number of rows in the sizer.
9703 """
9704 return _core_.GridSizer_SetRows(*args, **kwargs)
9705
9706 def SetVGap(*args, **kwargs):
9707 """
9708 SetVGap(self, int gap)
9709
9710 Sets the vertical gap (in pixels) between the cells in the sizer.
9711 """
9712 return _core_.GridSizer_SetVGap(*args, **kwargs)
9713
9714 def SetHGap(*args, **kwargs):
9715 """
9716 SetHGap(self, int gap)
9717
9718 Sets the horizontal gap (in pixels) between cells in the sizer
9719 """
9720 return _core_.GridSizer_SetHGap(*args, **kwargs)
9721
9722 def GetCols(*args, **kwargs):
9723 """
9724 GetCols(self) -> int
9725
9726 Returns the number of columns in the sizer.
9727 """
9728 return _core_.GridSizer_GetCols(*args, **kwargs)
9729
9730 def GetRows(*args, **kwargs):
9731 """
9732 GetRows(self) -> int
9733
9734 Returns the number of rows in the sizer.
9735 """
9736 return _core_.GridSizer_GetRows(*args, **kwargs)
9737
9738 def GetVGap(*args, **kwargs):
9739 """
9740 GetVGap(self) -> int
9741
9742 Returns the vertical gap (in pixels) between the cells in the sizer.
9743 """
9744 return _core_.GridSizer_GetVGap(*args, **kwargs)
9745
9746 def GetHGap(*args, **kwargs):
9747 """
9748 GetHGap(self) -> int
9749
9750 Returns the horizontal gap (in pixels) between cells in the sizer.
9751 """
9752 return _core_.GridSizer_GetHGap(*args, **kwargs)
9753
9754
9755 class GridSizerPtr(GridSizer):
9756 def __init__(self, this):
9757 self.this = this
9758 if not hasattr(self,"thisown"): self.thisown = 0
9759 self.__class__ = GridSizer
9760 _core_.GridSizer_swigregister(GridSizerPtr)
9761
9762 #---------------------------------------------------------------------------
9763
9764 FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
9765 FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
9766 FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
9767 class FlexGridSizer(GridSizer):
9768 """
9769 A flex grid sizer is a sizer which lays out its children in a
9770 two-dimensional table with all table cells in one row having the same
9771 height and all cells in one column having the same width, but all
9772 rows or all columns are not necessarily the same height or width as in
9773 the `wx.GridSizer`.
9774
9775 wx.FlexGridSizer can also size items equally in one direction but
9776 unequally ("flexibly") in the other. If the sizer is only flexible
9777 in one direction (this can be changed using `SetFlexibleDirection`), it
9778 needs to be decided how the sizer should grow in the other ("non
9779 flexible") direction in order to fill the available space. The
9780 `SetNonFlexibleGrowMode` method serves this purpose.
9781
9782
9783 """
9784 def __repr__(self):
9785 return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9786 def __init__(self, *args, **kwargs):
9787 """
9788 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
9789
9790 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
9791 number of columns and rows in the sizer - if either of the parameters
9792 is zero, it will be calculated to from the total number of children in
9793 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
9794 define extra space between all children.
9795 """
9796 newobj = _core_.new_FlexGridSizer(*args, **kwargs)
9797 self.this = newobj.this
9798 self.thisown = 1
9799 del newobj.thisown
9800 self._setOORInfo(self)
9801
9802 def AddGrowableRow(*args, **kwargs):
9803 """
9804 AddGrowableRow(self, size_t idx, int proportion=0)
9805
9806 Specifies that row *idx* (starting from zero) should be grown if there
9807 is extra space available to the sizer.
9808
9809 The *proportion* parameter has the same meaning as the stretch factor
9810 for the box sizers except that if all proportions are 0, then all
9811 columns are resized equally (instead of not being resized at all).
9812 """
9813 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
9814
9815 def RemoveGrowableRow(*args, **kwargs):
9816 """
9817 RemoveGrowableRow(self, size_t idx)
9818
9819 Specifies that row *idx* is no longer growable.
9820 """
9821 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
9822
9823 def AddGrowableCol(*args, **kwargs):
9824 """
9825 AddGrowableCol(self, size_t idx, int proportion=0)
9826
9827 Specifies that column *idx* (starting from zero) should be grown if
9828 there is extra space available to the sizer.
9829
9830 The *proportion* parameter has the same meaning as the stretch factor
9831 for the box sizers except that if all proportions are 0, then all
9832 columns are resized equally (instead of not being resized at all).
9833 """
9834 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
9835
9836 def RemoveGrowableCol(*args, **kwargs):
9837 """
9838 RemoveGrowableCol(self, size_t idx)
9839
9840 Specifies that column *idx* is no longer growable.
9841 """
9842 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
9843
9844 def SetFlexibleDirection(*args, **kwargs):
9845 """
9846 SetFlexibleDirection(self, int direction)
9847
9848 Specifies whether the sizer should flexibly resize its columns, rows,
9849 or both. Argument *direction* can be one of the following values. Any
9850 other value is ignored.
9851
9852 ============== =======================================
9853 wx.VERTICAL Rows are flexibly sized.
9854 wx.HORIZONTAL Columns are flexibly sized.
9855 wx.BOTH Both rows and columns are flexibly sized
9856 (this is the default value).
9857 ============== =======================================
9858
9859 Note that this method does not trigger relayout.
9860
9861 """
9862 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
9863
9864 def GetFlexibleDirection(*args, **kwargs):
9865 """
9866 GetFlexibleDirection(self) -> int
9867
9868 Returns a value that specifies whether the sizer
9869 flexibly resizes its columns, rows, or both (default).
9870
9871 :see: `SetFlexibleDirection`
9872 """
9873 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
9874
9875 def SetNonFlexibleGrowMode(*args, **kwargs):
9876 """
9877 SetNonFlexibleGrowMode(self, int mode)
9878
9879 Specifies how the sizer should grow in the non-flexible direction if
9880 there is one (so `SetFlexibleDirection` must have been called
9881 previously). Argument *mode* can be one of the following values:
9882
9883 ========================== =================================================
9884 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
9885 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
9886 `AddGrowableCol` and `AddGrowableRow`. In this
9887 case equal sizing applies to minimum sizes of
9888 columns or rows (this is the default value).
9889 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
9890 the non flexible direction, whether they are
9891 growable or not in the flexbile direction.
9892 ========================== =================================================
9893
9894 Note that this method does not trigger relayout.
9895
9896
9897 """
9898 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
9899
9900 def GetNonFlexibleGrowMode(*args, **kwargs):
9901 """
9902 GetNonFlexibleGrowMode(self) -> int
9903
9904 Returns the value that specifies how the sizer grows in the
9905 non-flexible direction if there is one.
9906
9907 :see: `SetNonFlexibleGrowMode`
9908 """
9909 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
9910
9911 def GetRowHeights(*args, **kwargs):
9912 """
9913 GetRowHeights(self) -> list
9914
9915 Returns a list of integers representing the heights of each of the
9916 rows in the sizer.
9917 """
9918 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
9919
9920 def GetColWidths(*args, **kwargs):
9921 """
9922 GetColWidths(self) -> list
9923
9924 Returns a list of integers representing the widths of each of the
9925 columns in the sizer.
9926 """
9927 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
9928
9929
9930 class FlexGridSizerPtr(FlexGridSizer):
9931 def __init__(self, this):
9932 self.this = this
9933 if not hasattr(self,"thisown"): self.thisown = 0
9934 self.__class__ = FlexGridSizer
9935 _core_.FlexGridSizer_swigregister(FlexGridSizerPtr)
9936
9937 #---------------------------------------------------------------------------
9938
9939 class GBPosition(object):
9940 """
9941 This class represents the position of an item in a virtual grid of
9942 rows and columns managed by a `wx.GridBagSizer`. wxPython has
9943 typemaps that will automatically convert from a 2-element sequence of
9944 integers to a wx.GBPosition, so you can use the more pythonic
9945 representation of the position nearly transparently in Python code.
9946 """
9947 def __repr__(self):
9948 return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
9949 def __init__(self, *args, **kwargs):
9950 """
9951 __init__(self, int row=0, int col=0) -> GBPosition
9952
9953 This class represents the position of an item in a virtual grid of
9954 rows and columns managed by a `wx.GridBagSizer`. wxPython has
9955 typemaps that will automatically convert from a 2-element sequence of
9956 integers to a wx.GBPosition, so you can use the more pythonic
9957 representation of the position nearly transparently in Python code.
9958 """
9959 newobj = _core_.new_GBPosition(*args, **kwargs)
9960 self.this = newobj.this
9961 self.thisown = 1
9962 del newobj.thisown
9963 def GetRow(*args, **kwargs):
9964 """GetRow(self) -> int"""
9965 return _core_.GBPosition_GetRow(*args, **kwargs)
9966
9967 def GetCol(*args, **kwargs):
9968 """GetCol(self) -> int"""
9969 return _core_.GBPosition_GetCol(*args, **kwargs)
9970
9971 def SetRow(*args, **kwargs):
9972 """SetRow(self, int row)"""
9973 return _core_.GBPosition_SetRow(*args, **kwargs)
9974
9975 def SetCol(*args, **kwargs):
9976 """SetCol(self, int col)"""
9977 return _core_.GBPosition_SetCol(*args, **kwargs)
9978
9979 def __eq__(*args, **kwargs):
9980 """__eq__(self, GBPosition other) -> bool"""
9981 return _core_.GBPosition___eq__(*args, **kwargs)
9982
9983 def __ne__(*args, **kwargs):
9984 """__ne__(self, GBPosition other) -> bool"""
9985 return _core_.GBPosition___ne__(*args, **kwargs)
9986
9987 def Set(*args, **kwargs):
9988 """Set(self, int row=0, int col=0)"""
9989 return _core_.GBPosition_Set(*args, **kwargs)
9990
9991 def Get(*args, **kwargs):
9992 """Get(self) -> PyObject"""
9993 return _core_.GBPosition_Get(*args, **kwargs)
9994
9995 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
9996 def __str__(self): return str(self.Get())
9997 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
9998 def __len__(self): return len(self.Get())
9999 def __getitem__(self, index): return self.Get()[index]
10000 def __setitem__(self, index, val):
10001 if index == 0: self.SetRow(val)
10002 elif index == 1: self.SetCol(val)
10003 else: raise IndexError
10004 def __nonzero__(self): return self.Get() != (0,0)
10005 __safe_for_unpickling__ = True
10006 def __reduce__(self): return (wx.GBPosition, self.Get())
10007
10008 row = property(GetRow, SetRow)
10009 col = property(GetCol, SetCol)
10010
10011
10012 class GBPositionPtr(GBPosition):
10013 def __init__(self, this):
10014 self.this = this
10015 if not hasattr(self,"thisown"): self.thisown = 0
10016 self.__class__ = GBPosition
10017 _core_.GBPosition_swigregister(GBPositionPtr)
10018
10019 class GBSpan(object):
10020 """
10021 This class is used to hold the row and column spanning attributes of
10022 items in a `wx.GridBagSizer`. wxPython has typemaps that will
10023 automatically convert from a 2-element sequence of integers to a
10024 wx.GBSpan, so you can use the more pythonic representation of the span
10025 nearly transparently in Python code.
10026
10027 """
10028 def __repr__(self):
10029 return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10030 def __init__(self, *args, **kwargs):
10031 """
10032 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
10033
10034 Construct a new wxGBSpan, optionally setting the rowspan and
10035 colspan. The default is (1,1). (Meaning that the item occupies one
10036 cell in each direction.
10037 """
10038 newobj = _core_.new_GBSpan(*args, **kwargs)
10039 self.this = newobj.this
10040 self.thisown = 1
10041 del newobj.thisown
10042 def GetRowspan(*args, **kwargs):
10043 """GetRowspan(self) -> int"""
10044 return _core_.GBSpan_GetRowspan(*args, **kwargs)
10045
10046 def GetColspan(*args, **kwargs):
10047 """GetColspan(self) -> int"""
10048 return _core_.GBSpan_GetColspan(*args, **kwargs)
10049
10050 def SetRowspan(*args, **kwargs):
10051 """SetRowspan(self, int rowspan)"""
10052 return _core_.GBSpan_SetRowspan(*args, **kwargs)
10053
10054 def SetColspan(*args, **kwargs):
10055 """SetColspan(self, int colspan)"""
10056 return _core_.GBSpan_SetColspan(*args, **kwargs)
10057
10058 def __eq__(*args, **kwargs):
10059 """__eq__(self, GBSpan other) -> bool"""
10060 return _core_.GBSpan___eq__(*args, **kwargs)
10061
10062 def __ne__(*args, **kwargs):
10063 """__ne__(self, GBSpan other) -> bool"""
10064 return _core_.GBSpan___ne__(*args, **kwargs)
10065
10066 def Set(*args, **kwargs):
10067 """Set(self, int rowspan=1, int colspan=1)"""
10068 return _core_.GBSpan_Set(*args, **kwargs)
10069
10070 def Get(*args, **kwargs):
10071 """Get(self) -> PyObject"""
10072 return _core_.GBSpan_Get(*args, **kwargs)
10073
10074 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
10075 def __str__(self): return str(self.Get())
10076 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
10077 def __len__(self): return len(self.Get())
10078 def __getitem__(self, index): return self.Get()[index]
10079 def __setitem__(self, index, val):
10080 if index == 0: self.SetRowspan(val)
10081 elif index == 1: self.SetColspan(val)
10082 else: raise IndexError
10083 def __nonzero__(self): return self.Get() != (0,0)
10084 __safe_for_unpickling__ = True
10085 def __reduce__(self): return (wx.GBSpan, self.Get())
10086
10087 rowspan = property(GetRowspan, SetRowspan)
10088 colspan = property(GetColspan, SetColspan)
10089
10090
10091 class GBSpanPtr(GBSpan):
10092 def __init__(self, this):
10093 self.this = this
10094 if not hasattr(self,"thisown"): self.thisown = 0
10095 self.__class__ = GBSpan
10096 _core_.GBSpan_swigregister(GBSpanPtr)
10097
10098 class GBSizerItem(SizerItem):
10099 """
10100 The wx.GBSizerItem class is used to track the additional data about
10101 items in a `wx.GridBagSizer` such as the item's position in the grid
10102 and how many rows or columns it spans.
10103
10104 """
10105 def __repr__(self):
10106 return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10107 def __init__(self, *args, **kwargs):
10108 """
10109 __init__(self) -> GBSizerItem
10110
10111 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
10112 size will need to be set, as well as a position and span before this
10113 item can be used in a Sizer.
10114
10115 You will probably never need to create a wx.GBSizerItem directly as they
10116 are created automatically when the sizer's Add method is called.
10117 """
10118 newobj = _core_.new_GBSizerItem(*args, **kwargs)
10119 self.this = newobj.this
10120 self.thisown = 1
10121 del newobj.thisown
10122 def GetPos(*args, **kwargs):
10123 """
10124 GetPos(self) -> GBPosition
10125
10126 Get the grid position of the item
10127 """
10128 return _core_.GBSizerItem_GetPos(*args, **kwargs)
10129
10130 def GetPosTuple(self): return self.GetPos().Get()
10131 def GetSpan(*args, **kwargs):
10132 """
10133 GetSpan(self) -> GBSpan
10134
10135 Get the row and column spanning of the item
10136 """
10137 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
10138
10139 def GetSpanTuple(self): return self.GetSpan().Get()
10140 def SetPos(*args, **kwargs):
10141 """
10142 SetPos(self, GBPosition pos) -> bool
10143
10144 If the item is already a member of a sizer then first ensure that
10145 there is no other item that would intersect with this one at the new
10146 position, then set the new position. Returns True if the change is
10147 successful and after the next Layout() the item will be moved.
10148 """
10149 return _core_.GBSizerItem_SetPos(*args, **kwargs)
10150
10151 def SetSpan(*args, **kwargs):
10152 """
10153 SetSpan(self, GBSpan span) -> bool
10154
10155 If the item is already a member of a sizer then first ensure that
10156 there is no other item that would intersect with this one with its new
10157 spanning size, then set the new spanning. Returns True if the change
10158 is successful and after the next Layout() the item will be resized.
10159
10160 """
10161 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
10162
10163 def Intersects(*args, **kwargs):
10164 """
10165 Intersects(self, GBSizerItem other) -> bool
10166
10167 Returns True if this item and the other item instersect.
10168 """
10169 return _core_.GBSizerItem_Intersects(*args, **kwargs)
10170
10171 def IntersectsPos(*args, **kwargs):
10172 """
10173 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
10174
10175 Returns True if the given pos/span would intersect with this item.
10176 """
10177 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
10178
10179 def GetEndPos(*args, **kwargs):
10180 """
10181 GetEndPos(self) -> GBPosition
10182
10183 Get the row and column of the endpoint of this item.
10184 """
10185 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
10186
10187 def GetGBSizer(*args, **kwargs):
10188 """
10189 GetGBSizer(self) -> GridBagSizer
10190
10191 Get the sizer this item is a member of.
10192 """
10193 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
10194
10195 def SetGBSizer(*args, **kwargs):
10196 """
10197 SetGBSizer(self, GridBagSizer sizer)
10198
10199 Set the sizer this item is a member of.
10200 """
10201 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
10202
10203
10204 class GBSizerItemPtr(GBSizerItem):
10205 def __init__(self, this):
10206 self.this = this
10207 if not hasattr(self,"thisown"): self.thisown = 0
10208 self.__class__ = GBSizerItem
10209 _core_.GBSizerItem_swigregister(GBSizerItemPtr)
10210 DefaultSpan = cvar.DefaultSpan
10211
10212 def GBSizerItemWindow(*args, **kwargs):
10213 """
10214 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
10215 int border, PyObject userData=None) -> GBSizerItem
10216
10217 Construct a `wx.GBSizerItem` for a window.
10218 """
10219 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
10220 val.thisown = 1
10221 return val
10222
10223 def GBSizerItemSizer(*args, **kwargs):
10224 """
10225 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
10226 int border, PyObject userData=None) -> GBSizerItem
10227
10228 Construct a `wx.GBSizerItem` for a sizer
10229 """
10230 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
10231 val.thisown = 1
10232 return val
10233
10234 def GBSizerItemSpacer(*args, **kwargs):
10235 """
10236 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
10237 int flag, int border, PyObject userData=None) -> GBSizerItem
10238
10239 Construct a `wx.GBSizerItem` for a spacer.
10240 """
10241 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
10242 val.thisown = 1
10243 return val
10244
10245 class GridBagSizer(FlexGridSizer):
10246 """
10247 A `wx.Sizer` that can lay out items in a virtual grid like a
10248 `wx.FlexGridSizer` but in this case explicit positioning of the items
10249 is allowed using `wx.GBPosition`, and items can optionally span more
10250 than one row and/or column using `wx.GBSpan`. The total size of the
10251 virtual grid is determined by the largest row and column that items are
10252 positioned at, adjusted for spanning.
10253
10254 """
10255 def __repr__(self):
10256 return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10257 def __init__(self, *args, **kwargs):
10258 """
10259 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
10260
10261 Constructor, with optional parameters to specify the gap between the
10262 rows and columns.
10263 """
10264 newobj = _core_.new_GridBagSizer(*args, **kwargs)
10265 self.this = newobj.this
10266 self.thisown = 1
10267 del newobj.thisown
10268 def Add(*args, **kwargs):
10269 """
10270 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
10271 int border=0, userData=None) -> wx.GBSizerItem
10272
10273 Adds an item to the sizer at the grid cell *pos*, optionally spanning
10274 more than one row or column as specified with *span*. The remaining
10275 args behave similarly to `wx.Sizer.Add`.
10276
10277 Returns True if the item was successfully placed at the given cell
10278 position, False if something was already there.
10279
10280 """
10281 return _core_.GridBagSizer_Add(*args, **kwargs)
10282
10283 def AddItem(*args, **kwargs):
10284 """
10285 Add(self, GBSizerItem item) -> wx.GBSizerItem
10286
10287 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
10288 the item was successfully placed at its given cell position, False if
10289 something was already there.
10290 """
10291 return _core_.GridBagSizer_AddItem(*args, **kwargs)
10292
10293 def GetCellSize(*args, **kwargs):
10294 """
10295 GetCellSize(self, int row, int col) -> Size
10296
10297 Get the size of the specified cell, including hgap and
10298 vgap. Only valid after a Layout.
10299 """
10300 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
10301
10302 def GetEmptyCellSize(*args, **kwargs):
10303 """
10304 GetEmptyCellSize(self) -> Size
10305
10306 Get the size used for cells in the grid with no item.
10307 """
10308 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
10309
10310 def SetEmptyCellSize(*args, **kwargs):
10311 """
10312 SetEmptyCellSize(self, Size sz)
10313
10314 Set the size used for cells in the grid with no item.
10315 """
10316 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
10317
10318 def GetItemPosition(*args):
10319 """
10320 GetItemPosition(self, item) -> GBPosition
10321
10322 Get the grid position of the specified *item* where *item* is either a
10323 window or subsizer that is a member of this sizer, or a zero-based
10324 index of an item.
10325 """
10326 return _core_.GridBagSizer_GetItemPosition(*args)
10327
10328 def SetItemPosition(*args):
10329 """
10330 SetItemPosition(self, item, GBPosition pos) -> bool
10331
10332 Set the grid position of the specified *item* where *item* is either a
10333 window or subsizer that is a member of this sizer, or a zero-based
10334 index of an item. Returns True on success. If the move is not
10335 allowed (because an item is already there) then False is returned.
10336
10337 """
10338 return _core_.GridBagSizer_SetItemPosition(*args)
10339
10340 def GetItemSpan(*args):
10341 """
10342 GetItemSpan(self, item) -> GBSpan
10343
10344 Get the row/col spanning of the specified *item* where *item* is
10345 either a window or subsizer that is a member of this sizer, or a
10346 zero-based index of an item.
10347 """
10348 return _core_.GridBagSizer_GetItemSpan(*args)
10349
10350 def SetItemSpan(*args):
10351 """
10352 SetItemSpan(self, item, GBSpan span) -> bool
10353
10354 Set the row/col spanning of the specified *item* where *item* is
10355 either a window or subsizer that is a member of this sizer, or a
10356 zero-based index of an item. Returns True on success. If the move is
10357 not allowed (because an item is already there) then False is returned.
10358 """
10359 return _core_.GridBagSizer_SetItemSpan(*args)
10360
10361 def FindItem(*args):
10362 """
10363 FindItem(self, item) -> GBSizerItem
10364
10365 Find the sizer item for the given window or subsizer, returns None if
10366 not found. (non-recursive)
10367 """
10368 return _core_.GridBagSizer_FindItem(*args)
10369
10370 def FindItemAtPosition(*args, **kwargs):
10371 """
10372 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
10373
10374 Return the sizer item for the given grid cell, or None if there is no
10375 item at that position. (non-recursive)
10376 """
10377 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
10378
10379 def FindItemAtPoint(*args, **kwargs):
10380 """
10381 FindItemAtPoint(self, Point pt) -> GBSizerItem
10382
10383 Return the sizer item located at the point given in *pt*, or None if
10384 there is no item at that point. The (x,y) coordinates in pt correspond
10385 to the client coordinates of the window using the sizer for
10386 layout. (non-recursive)
10387 """
10388 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
10389
10390 def CheckForIntersection(*args, **kwargs):
10391 """
10392 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
10393
10394 Look at all items and see if any intersect (or would overlap) the
10395 given *item*. Returns True if so, False if there would be no overlap.
10396 If an *excludeItem* is given then it will not be checked for
10397 intersection, for example it may be the item we are checking the
10398 position of.
10399
10400 """
10401 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
10402
10403 def CheckForIntersectionPos(*args, **kwargs):
10404 """
10405 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
10406
10407 Look at all items and see if any intersect (or would overlap) the
10408 given position and span. Returns True if so, False if there would be
10409 no overlap. If an *excludeItem* is given then it will not be checked
10410 for intersection, for example it may be the item we are checking the
10411 position of.
10412 """
10413 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
10414
10415
10416 class GridBagSizerPtr(GridBagSizer):
10417 def __init__(self, this):
10418 self.this = this
10419 if not hasattr(self,"thisown"): self.thisown = 0
10420 self.__class__ = GridBagSizer
10421 _core_.GridBagSizer_swigregister(GridBagSizerPtr)
10422
10423 #---------------------------------------------------------------------------
10424
10425 Left = _core_.Left
10426 Top = _core_.Top
10427 Right = _core_.Right
10428 Bottom = _core_.Bottom
10429 Width = _core_.Width
10430 Height = _core_.Height
10431 Centre = _core_.Centre
10432 Center = _core_.Center
10433 CentreX = _core_.CentreX
10434 CentreY = _core_.CentreY
10435 Unconstrained = _core_.Unconstrained
10436 AsIs = _core_.AsIs
10437 PercentOf = _core_.PercentOf
10438 Above = _core_.Above
10439 Below = _core_.Below
10440 LeftOf = _core_.LeftOf
10441 RightOf = _core_.RightOf
10442 SameAs = _core_.SameAs
10443 Absolute = _core_.Absolute
10444 class IndividualLayoutConstraint(Object):
10445 """
10446 Objects of this class are stored in the `wx.LayoutConstraints` class as
10447 one of eight possible constraints that a window can be involved in.
10448 You will never need to create an instance of
10449 wx.IndividualLayoutConstraint, rather you should create a
10450 `wx.LayoutConstraints` instance and use the individual contstraints
10451 that it contains.
10452 """
10453 def __init__(self): raise RuntimeError, "No constructor defined"
10454 def __repr__(self):
10455 return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10456 def Set(*args, **kwargs):
10457 """
10458 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
10459
10460 Sets the properties of the constraint. Normally called by one of the
10461 convenience functions such as Above, RightOf, SameAs.
10462 """
10463 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
10464
10465 def LeftOf(*args, **kwargs):
10466 """
10467 LeftOf(self, Window sibling, int marg=0)
10468
10469 Constrains this edge to be to the left of the given window, with an
10470 optional margin. Implicitly, this is relative to the left edge of the
10471 other window.
10472 """
10473 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
10474
10475 def RightOf(*args, **kwargs):
10476 """
10477 RightOf(self, Window sibling, int marg=0)
10478
10479 Constrains this edge to be to the right of the given window, with an
10480 optional margin. Implicitly, this is relative to the right edge of the
10481 other window.
10482 """
10483 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
10484
10485 def Above(*args, **kwargs):
10486 """
10487 Above(self, Window sibling, int marg=0)
10488
10489 Constrains this edge to be above the given window, with an optional
10490 margin. Implicitly, this is relative to the top edge of the other
10491 window.
10492 """
10493 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
10494
10495 def Below(*args, **kwargs):
10496 """
10497 Below(self, Window sibling, int marg=0)
10498
10499 Constrains this edge to be below the given window, with an optional
10500 margin. Implicitly, this is relative to the bottom edge of the other
10501 window.
10502 """
10503 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
10504
10505 def SameAs(*args, **kwargs):
10506 """
10507 SameAs(self, Window otherW, int edge, int marg=0)
10508
10509 Constrains this edge or dimension to be to the same as the edge of the
10510 given window, with an optional margin.
10511 """
10512 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
10513
10514 def PercentOf(*args, **kwargs):
10515 """
10516 PercentOf(self, Window otherW, int wh, int per)
10517
10518 Constrains this edge or dimension to be to a percentage of the given
10519 window, with an optional margin.
10520 """
10521 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
10522
10523 def Absolute(*args, **kwargs):
10524 """
10525 Absolute(self, int val)
10526
10527 Constrains this edge or dimension to be the given absolute value.
10528 """
10529 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
10530
10531 def Unconstrained(*args, **kwargs):
10532 """
10533 Unconstrained(self)
10534
10535 Sets this edge or dimension to be unconstrained, that is, dependent on
10536 other edges and dimensions from which this value can be deduced.
10537 """
10538 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
10539
10540 def AsIs(*args, **kwargs):
10541 """
10542 AsIs(self)
10543
10544 Sets this edge or constraint to be whatever the window's value is at
10545 the moment. If either of the width and height constraints are *as is*,
10546 the window will not be resized, but moved instead. This is important
10547 when considering panel items which are intended to have a default
10548 size, such as a button, which may take its size from the size of the
10549 button label.
10550 """
10551 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
10552
10553 def GetOtherWindow(*args, **kwargs):
10554 """GetOtherWindow(self) -> Window"""
10555 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
10556
10557 def GetMyEdge(*args, **kwargs):
10558 """GetMyEdge(self) -> int"""
10559 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
10560
10561 def SetEdge(*args, **kwargs):
10562 """SetEdge(self, int which)"""
10563 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
10564
10565 def SetValue(*args, **kwargs):
10566 """SetValue(self, int v)"""
10567 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
10568
10569 def GetMargin(*args, **kwargs):
10570 """GetMargin(self) -> int"""
10571 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
10572
10573 def SetMargin(*args, **kwargs):
10574 """SetMargin(self, int m)"""
10575 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
10576
10577 def GetValue(*args, **kwargs):
10578 """GetValue(self) -> int"""
10579 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
10580
10581 def GetPercent(*args, **kwargs):
10582 """GetPercent(self) -> int"""
10583 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
10584
10585 def GetOtherEdge(*args, **kwargs):
10586 """GetOtherEdge(self) -> int"""
10587 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
10588
10589 def GetDone(*args, **kwargs):
10590 """GetDone(self) -> bool"""
10591 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
10592
10593 def SetDone(*args, **kwargs):
10594 """SetDone(self, bool d)"""
10595 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
10596
10597 def GetRelationship(*args, **kwargs):
10598 """GetRelationship(self) -> int"""
10599 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
10600
10601 def SetRelationship(*args, **kwargs):
10602 """SetRelationship(self, int r)"""
10603 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
10604
10605 def ResetIfWin(*args, **kwargs):
10606 """
10607 ResetIfWin(self, Window otherW) -> bool
10608
10609 Reset constraint if it mentions otherWin
10610 """
10611 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
10612
10613 def SatisfyConstraint(*args, **kwargs):
10614 """
10615 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
10616
10617 Try to satisfy constraint
10618 """
10619 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
10620
10621 def GetEdge(*args, **kwargs):
10622 """
10623 GetEdge(self, int which, Window thisWin, Window other) -> int
10624
10625 Get the value of this edge or dimension, or if this
10626 is not determinable, -1.
10627 """
10628 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
10629
10630
10631 class IndividualLayoutConstraintPtr(IndividualLayoutConstraint):
10632 def __init__(self, this):
10633 self.this = this
10634 if not hasattr(self,"thisown"): self.thisown = 0
10635 self.__class__ = IndividualLayoutConstraint
10636 _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr)
10637
10638 class LayoutConstraints(Object):
10639 """
10640 **Note:** constraints are now deprecated and you should use sizers
10641 instead.
10642
10643 Objects of this class can be associated with a window to define its
10644 layout constraints, with respect to siblings or its parent.
10645
10646 The class consists of the following eight constraints of class
10647 wx.IndividualLayoutConstraint, some or all of which should be accessed
10648 directly to set the appropriate constraints.
10649
10650 * left: represents the left hand edge of the window
10651 * right: represents the right hand edge of the window
10652 * top: represents the top edge of the window
10653 * bottom: represents the bottom edge of the window
10654 * width: represents the width of the window
10655 * height: represents the height of the window
10656 * centreX: represents the horizontal centre point of the window
10657 * centreY: represents the vertical centre point of the window
10658
10659 Most constraints are initially set to have the relationship
10660 wxUnconstrained, which means that their values should be calculated by
10661 looking at known constraints. The exceptions are width and height,
10662 which are set to wxAsIs to ensure that if the user does not specify a
10663 constraint, the existing width and height will be used, to be
10664 compatible with panel items which often have take a default size. If
10665 the constraint is ``wx.AsIs``, the dimension will not be changed.
10666
10667 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
10668
10669 """
10670 def __repr__(self):
10671 return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
10672 left = property(_core_.LayoutConstraints_left_get)
10673 top = property(_core_.LayoutConstraints_top_get)
10674 right = property(_core_.LayoutConstraints_right_get)
10675 bottom = property(_core_.LayoutConstraints_bottom_get)
10676 width = property(_core_.LayoutConstraints_width_get)
10677 height = property(_core_.LayoutConstraints_height_get)
10678 centreX = property(_core_.LayoutConstraints_centreX_get)
10679 centreY = property(_core_.LayoutConstraints_centreY_get)
10680 def __init__(self, *args, **kwargs):
10681 """__init__(self) -> LayoutConstraints"""
10682 newobj = _core_.new_LayoutConstraints(*args, **kwargs)
10683 self.this = newobj.this
10684 self.thisown = 1
10685 del newobj.thisown
10686 def SatisfyConstraints(*args, **kwargs):
10687 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
10688 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
10689
10690 def AreSatisfied(*args, **kwargs):
10691 """AreSatisfied(self) -> bool"""
10692 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
10693
10694
10695 class LayoutConstraintsPtr(LayoutConstraints):
10696 def __init__(self, this):
10697 self.this = this
10698 if not hasattr(self,"thisown"): self.thisown = 0
10699 self.__class__ = LayoutConstraints
10700 _core_.LayoutConstraints_swigregister(LayoutConstraintsPtr)
10701
10702 #----------------------------------------------------------------------------
10703
10704 # Use Python's bool constants if available, make some if not
10705 try:
10706 True
10707 except NameError:
10708 __builtins__.True = 1==1
10709 __builtins__.False = 1==0
10710 def bool(value): return not not value
10711 __builtins__.bool = bool
10712
10713
10714
10715 # workarounds for bad wxRTTI names
10716 __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
10717 __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
10718 __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
10719
10720
10721 #----------------------------------------------------------------------------
10722 # Load version numbers from __version__... Ensure that major and minor
10723 # versions are the same for both wxPython and wxWidgets.
10724
10725 from __version__ import *
10726 __version__ = VERSION_STRING
10727
10728 assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
10729 assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
10730 if RELEASE_VERSION != _core_.RELEASE_VERSION:
10731 import warnings
10732 warnings.warn("wxPython/wxWidgets release number mismatch")
10733
10734 #----------------------------------------------------------------------------
10735
10736 class PyDeadObjectError(AttributeError):
10737 pass
10738
10739 class _wxPyDeadObject(object):
10740 """
10741 Instances of wx objects that are OOR capable will have their __class__
10742 changed to this class when the C++ object is deleted. This should help
10743 prevent crashes due to referencing a bogus C++ pointer.
10744 """
10745 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
10746 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
10747
10748 def __repr__(self):
10749 if not hasattr(self, "_name"):
10750 self._name = "[unknown]"
10751 return self.reprStr % self._name
10752
10753 def __getattr__(self, *args):
10754 if not hasattr(self, "_name"):
10755 self._name = "[unknown]"
10756 raise PyDeadObjectError(self.attrStr % self._name)
10757
10758 def __nonzero__(self):
10759 return 0
10760
10761
10762
10763 class PyUnbornObjectError(AttributeError):
10764 pass
10765
10766 class _wxPyUnbornObject(object):
10767 """
10768 Some stock objects are created when the wx._core module is
10769 imported, but their C++ instance is not created until the wx.App
10770 object is created and initialized. These object instances will
10771 temporarily have their __class__ changed to this class so an
10772 exception will be raised if they are used before the C++ instance
10773 is ready.
10774 """
10775
10776 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
10777 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
10778
10779 def __repr__(self):
10780 #if not hasattr(self, "_name"):
10781 # self._name = "[unknown]"
10782 return self.reprStr #% self._name
10783
10784 def __getattr__(self, *args):
10785 #if not hasattr(self, "_name"):
10786 # self._name = "[unknown]"
10787 raise PyUnbornObjectError(self.attrStr) # % self._name )
10788
10789 def __nonzero__(self):
10790 return 0
10791
10792
10793 #----------------------------------------------------------------------------
10794 _wxPyCallAfterId = None
10795
10796 def CallAfter(callable, *args, **kw):
10797 """
10798 Call the specified function after the current and pending event
10799 handlers have been completed. This is also good for making GUI
10800 method calls from non-GUI threads. Any extra positional or
10801 keyword args are passed on to the callable when it is called.
10802
10803 :see: `wx.FutureCall`
10804 """
10805 app = wx.GetApp()
10806 assert app is not None, 'No wx.App created yet'
10807
10808 global _wxPyCallAfterId
10809 if _wxPyCallAfterId is None:
10810 _wxPyCallAfterId = wx.NewEventType()
10811 app.Connect(-1, -1, _wxPyCallAfterId,
10812 lambda event: event.callable(*event.args, **event.kw) )
10813 evt = wx.PyEvent()
10814 evt.SetEventType(_wxPyCallAfterId)
10815 evt.callable = callable
10816 evt.args = args
10817 evt.kw = kw
10818 wx.PostEvent(app, evt)
10819
10820
10821 #----------------------------------------------------------------------------
10822
10823
10824 class FutureCall:
10825 """
10826 A convenience class for wx.Timer, that calls the given callable
10827 object once after the given amount of milliseconds, passing any
10828 positional or keyword args. The return value of the callable is
10829 availbale after it has been run with the `GetResult` method.
10830
10831 If you don't need to get the return value or restart the timer
10832 then there is no need to hold a reference to this object. It will
10833 hold a reference to itself while the timer is running (the timer
10834 has a reference to self.Notify) but the cycle will be broken when
10835 the timer completes, automatically cleaning up the wx.FutureCall
10836 object.
10837
10838 :see: `wx.CallAfter`
10839 """
10840 def __init__(self, millis, callable, *args, **kwargs):
10841 self.millis = millis
10842 self.callable = callable
10843 self.SetArgs(*args, **kwargs)
10844 self.runCount = 0
10845 self.running = False
10846 self.hasRun = False
10847 self.result = None
10848 self.timer = None
10849 self.Start()
10850
10851 def __del__(self):
10852 self.Stop()
10853
10854
10855 def Start(self, millis=None, *args, **kwargs):
10856 """
10857 (Re)start the timer
10858 """
10859 self.hasRun = False
10860 if millis is not None:
10861 self.millis = millis
10862 if args or kwargs:
10863 self.SetArgs(*args, **kwargs)
10864 self.Stop()
10865 self.timer = wx.PyTimer(self.Notify)
10866 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
10867 self.running = True
10868 Restart = Start
10869
10870
10871 def Stop(self):
10872 """
10873 Stop and destroy the timer.
10874 """
10875 if self.timer is not None:
10876 self.timer.Stop()
10877 self.timer = None
10878
10879
10880 def GetInterval(self):
10881 if self.timer is not None:
10882 return self.timer.GetInterval()
10883 else:
10884 return 0
10885
10886
10887 def IsRunning(self):
10888 return self.timer is not None and self.timer.IsRunning()
10889
10890
10891 def SetArgs(self, *args, **kwargs):
10892 """
10893 (Re)set the args passed to the callable object. This is
10894 useful in conjunction with Restart if you want to schedule a
10895 new call to the same callable object but with different
10896 parameters.
10897 """
10898 self.args = args
10899 self.kwargs = kwargs
10900
10901
10902 def HasRun(self):
10903 return self.hasRun
10904
10905 def GetResult(self):
10906 return self.result
10907
10908 def Notify(self):
10909 """
10910 The timer has expired so call the callable.
10911 """
10912 if self.callable and getattr(self.callable, 'im_self', True):
10913 self.runCount += 1
10914 self.running = False
10915 self.result = self.callable(*self.args, **self.kwargs)
10916 self.hasRun = True
10917 if not self.running:
10918 # if it wasn't restarted, then cleanup
10919 wx.CallAfter(self.Stop)
10920
10921
10922
10923 #----------------------------------------------------------------------------
10924 # Control which items in this module should be documented by epydoc.
10925 # We allow only classes and functions, which will help reduce the size
10926 # of the docs by filtering out the zillions of constants, EVT objects,
10927 # and etc that don't make much sense by themselves, but are instead
10928 # documented (or will be) as part of the classes/functions/methods
10929 # where they should be used.
10930
10931 class __DocFilter:
10932 """
10933 A filter for epydoc that only allows non-Ptr classes and
10934 fucntions, in order to reduce the clutter in the API docs.
10935 """
10936 def __init__(self, globals):
10937 self._globals = globals
10938
10939 def __call__(self, name):
10940 import types
10941 obj = self._globals.get(name, None)
10942 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
10943 return False
10944 if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'):
10945 return False
10946 return True
10947
10948 #----------------------------------------------------------------------------
10949 #----------------------------------------------------------------------------
10950
10951 # Import other modules in this package that should show up in the
10952 # "core" wx namespace
10953 from _gdi import *
10954 from _windows import *
10955 from _controls import *
10956 from _misc import *
10957
10958
10959 # Fixup the stock objects since they can't be used yet. (They will be
10960 # restored in wx.PyApp.OnInit.)
10961 _core_._wxPyFixStockObjects()
10962
10963 #----------------------------------------------------------------------------
10964 #----------------------------------------------------------------------------
10965
10966