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